@feedmepos/mf-menu 0.32.3-beta.1 → 0.32.4-dev

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 (84) hide show
  1. package/dist/{App-DJBZBaaC.js → App-5YVGeojR.js} +5 -5
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-c9SlmPp2.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DhoHYIHW.js} +20 -20
  3. package/dist/{Catalog-Ct9jk3A_.js → Catalog-BTNv5n_D.js} +18 -18
  4. package/dist/{Category-Cf5KfKdv.js → Category-BE-kkKcL.js} +22 -23
  5. package/dist/{Category-CTTAtG31.js → Category-DuLhbRxE.js} +21 -22
  6. package/dist/{CookingGuide-BaNzajgf.js → CookingGuide-JtE8QMC6.js} +92 -93
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-CRodr6tr.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-DdJ-o_PW.js} +1 -1
  8. package/dist/FormItem.vue_vue_type_script_setup_true_lang-B3Ixruh-.js +26 -0
  9. package/dist/{Group-BfRPCCbK.js → Group-BP-j3K6J.js} +1 -1
  10. package/dist/{Group-BJep-xq-.js → Group-DhS9e2E3.js} +3 -3
  11. package/dist/{Group.vue_vue_type_script_setup_true_lang-CoCq0edM.js → Group.vue_vue_type_script_setup_true_lang-DXUQrXXI.js} +33 -34
  12. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DviXfima.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CXzz4ClS.js} +24 -23
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DSrxcKIK.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Bpt-8tbe.js} +11525 -11504
  14. package/dist/{Ingredient-BnzW69zW.js → Ingredient-NSl0x-0T.js} +5 -6
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-D8m1pyLp.js → InventoryBinding.vue_vue_type_script_setup_true_lang-ByrNVvzs.js} +2 -2
  16. package/dist/LinkProductSideSheet-B_R_2iH6.js +692 -0
  17. package/dist/MenuSetting-C7cpv4S3.js +580 -0
  18. package/dist/{PrintRoute-CLsiDIkn.js → PrintRoute-DmP7KH58.js} +10 -11
  19. package/dist/{Product-DHE0XtX1.js → Product-B6gwN4g0.js} +1 -1
  20. package/dist/{Product.vue_vue_type_script_setup_true_lang-CVR8j-XT.js → Product.vue_vue_type_script_setup_true_lang-BKhn8Txf.js} +15 -16
  21. package/dist/{ProductInternalTools-BQOXHzYp.js → ProductInternalTools-D5xIh2j2.js} +5 -5
  22. package/dist/Products-Cxx8pJGK.js +692 -0
  23. package/dist/{Publish-BlEcoJaI.js → Publish-ZCzRBB5V.js} +21 -22
  24. package/dist/{Recipe-CkcNxf7p.js → Recipe-DcHdr_5J.js} +9 -10
  25. package/dist/RuleView.vue_vue_type_script_setup_true_lang-edNbsZTq.js +3282 -0
  26. package/dist/{Scheduler-DV0s_qkV.js → Scheduler-ZhDXk5gQ.js} +18 -19
  27. package/dist/{ServingSequence-CFd8Nwws.js → ServingSequence-DcfMbHjn.js} +15 -16
  28. package/dist/{Setting-B55IsZCX.js → Setting-fqf_sOIc.js} +45 -44
  29. package/dist/{Subcategory-BXCcVdR3.js → Subcategory-BidmfEOK.js} +18 -19
  30. package/dist/{Takeaway-BDvcwBHP.js → Takeaway-C83SKEvl.js} +1 -1
  31. package/dist/{Takeaway--U_lsgYi.js → Takeaway-p6thRg74.js} +4 -4
  32. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DaYk2xdF.js → Takeaway.vue_vue_type_script_setup_true_lang-Dq6CjXCv.js} +48 -49
  33. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-VBpTghy9.js → Thumbnail.vue_vue_type_script_setup_true_lang-CjLOy2k9.js} +10 -10
  34. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-IBM6rC5M.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CWdsp9eo.js} +17 -16
  35. package/dist/{Unit-DkvTsQWA.js → Unit-CKIaBxVE.js} +7 -8
  36. package/dist/{Variant-tte76SbR.js → Variant-CE21vKC4.js} +38 -39
  37. package/dist/{_id_-AVMi3j91.js → _id_-BhWpg9Kj.js} +10 -10
  38. package/dist/{app-0s3jY-aE.js → app-BkcVM9nE.js} +1 -1
  39. package/dist/app-CEIhTuYG.js +363 -0
  40. package/dist/app.js +1 -1
  41. package/dist/apps/mf-menu/src/app.d.ts +250 -0
  42. package/dist/apps/mf-menu/src/components/rule_group/CatalogLinkItemRuleForm.vue.d.ts +146 -0
  43. package/dist/apps/mf-menu/src/components/rule_group/CatalogLinkItemRuleView.vue.d.ts +158 -0
  44. package/dist/apps/mf-menu/src/components/rule_group/RuleCondition.vue.d.ts +103 -0
  45. package/dist/apps/mf-menu/src/components/rule_group/RuleConditionListView.vue.d.ts +54 -0
  46. package/dist/apps/mf-menu/src/components/rule_group/RuleConditionSelector.vue.d.ts +50 -0
  47. package/dist/apps/mf-menu/src/components/rule_group/RuleForm.vue.d.ts +117 -0
  48. package/dist/apps/mf-menu/src/components/rule_group/RuleView.vue.d.ts +141 -0
  49. package/dist/apps/mf-menu/src/composable/attributes.d.ts +10 -0
  50. package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +2 -3
  51. package/dist/apps/mf-menu/src/helper/menuExport.d.ts +3 -1
  52. package/dist/apps/mf-menu/src/helper/menuImport.d.ts +3 -2
  53. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  54. package/dist/assets/{linked-status-DEGoFflv.js → linked-status-CStQ46Ze.js} +2 -2
  55. package/dist/assets/{override-menu-CZe07SCm.js → override-menu-DHTQAnIJ.js} +2 -2
  56. package/dist/assets/{validate-menu-BnHfAUEN.js → validate-menu-C_kUDOhd.js} +2 -2
  57. package/dist/{catalog-YE_knev1.js → catalog-WBrPmQwl.js} +1 -1
  58. package/dist/{catalogSetting-CeVHRHOo.js → catalogSetting-BAry7I_V.js} +1 -1
  59. package/dist/{category-Dph1iWr8.js → category-bW36h16p.js} +1 -1
  60. package/dist/{currency-Byslycrk.js → currency-vVxHIVBs.js} +1 -1
  61. package/dist/{index-C0T32LLy.js → index-Ba5-dCQA.js} +1 -1
  62. package/dist/{index-CUTY6cCm.js → index-C0EV3eSc.js} +20 -20
  63. package/dist/{index-DycbrG1l.js → index-XZlEgR2k.js} +8 -7
  64. package/dist/{index-Ddt_Nw9F.js → index-pxnQHVnU.js} +4 -4
  65. package/dist/{menu-tHhzkxDL.js → index.vue_vue_type_script_setup_true_lang-CFPMPQFg.js} +18612 -18558
  66. package/dist/item-mFv0bFSn.js +7648 -0
  67. package/dist/{iteration-CcobmcUk.js → iteration-CaFp1Rtz.js} +3 -3
  68. package/dist/{jszip.min-DQrtMdm5.js → jszip.min-BkSmQKmf.js} +353 -353
  69. package/dist/{menu-DkRrqTVY.js → menu-ud-tWfIM.js} +1 -1
  70. package/dist/{menuV2-DJevKCqE.js → menuV2-xUMdUls0.js} +65 -65
  71. package/dist/mf-menu.css +1 -1
  72. package/dist/{priceTier-Bkogs1qc.js → priceTier-BVTab4k1.js} +1 -1
  73. package/dist/{scheduler-BGQ_lxUL.js → scheduler-CAt7sELO.js} +13 -12
  74. package/dist/{subcategory-DvxvLe8X.js → subcategory-DMZuedoM.js} +2 -2
  75. package/dist/{toExcel-DQ4jlZPI.js → toExcel-CczXOnKy.js} +2 -2
  76. package/dist/{unit-DoxpI5dG.js → unit-CbD3sYqC.js} +2 -2
  77. package/package.json +4 -3
  78. package/dist/LinkProductSideSheet-C4yBnJSM.js +0 -361
  79. package/dist/MenuSetting-Fxl8F6N5.js +0 -618
  80. package/dist/Products-BLvwrz9P.js +0 -689
  81. package/dist/app-CjfWVFOg.js +0 -363
  82. package/dist/customAttributes-DvbvCfOd.js +0 -180
  83. package/dist/index.vue_vue_type_script_setup_true_lang-B1_JqsYF.js +0 -57
  84. package/dist/item-x1WWjISR.js +0 -9175
@@ -0,0 +1,580 @@
1
+ import { defineComponent as X, ref as C, computed as $, watch as j, resolveComponent as g, createBlock as L, openBlock as d, unref as t, withCtx as y, createElementVNode as r, createVNode as u, createElementBlock as h, Fragment as K, renderList as Y, createCommentVNode as B, toDisplayString as A, withModifiers as oe } from "vue";
2
+ import { u as Z, I as Q, a3 as ae, D as ne, A as re, H as le } from "./index.vue_vue_type_script_setup_true_lang-CFPMPQFg.js";
3
+ import { useI18n as ee, useCoreStore as ie } from "@feedmepos/mf-common";
4
+ import { components as te, FmButtonVariant as N, useDialog as ce, useSnackbar as ue, useBreakpoints as me, FmButtonColorThemeVariant as W } from "@feedmepos/ui-library";
5
+ import { u as de, m as P, _ as H, b as pe, c as _e, f as q } from "./RuleView.vue_vue_type_script_setup_true_lang-edNbsZTq.js";
6
+ import { _ as se } from "./app-CEIhTuYG.js";
7
+ import { u as ve } from "./discardConfirm-BHni0LNu.js";
8
+ import { _ as fe } from "./PageLayout.vue_vue_type_script_setup_true_lang-vFqWGM6P.js";
9
+ import { C as z, a as M } from "./catalogSetting-BAry7I_V.js";
10
+ import { u as ge } from "./priceTier-BVTab4k1.js";
11
+ const be = {
12
+ class: "fm-typo-en-title-md-600 mr-auto"
13
+ }, ye = {
14
+ class: "py-8 px-8 overflow-y-auto space-y-24"
15
+ }, he = {
16
+ class: "space-y-16"
17
+ }, xe = {
18
+ class: "flex flex-col"
19
+ }, ke = {
20
+ class: "flex-1 relative border border-fm-color-neutral-gray-200 rounded-md p-16"
21
+ }, Se = {
22
+ key: 0,
23
+ class: "flex items-center select-none ml-16"
24
+ }, we = {
25
+ class: "fm-typo-en-body-lg-400 text-fm-color-neutral-gray-300"
26
+ }, Ce = {
27
+ class: "flex gap-8 items-center justify-start"
28
+ }, Te = /* @__PURE__ */ X({
29
+ __name: "RuleGroupSideSheet",
30
+ props: {
31
+ modelValue: {
32
+ type: Boolean
33
+ },
34
+ editingGroup: {}
35
+ },
36
+ emits: ["update:modelValue", "submit"],
37
+ setup(E, {
38
+ emit: n
39
+ }) {
40
+ const x = E, G = n, {
41
+ t: i
42
+ } = ee(), T = Z(), l = C({
43
+ name: "",
44
+ description: "",
45
+ rules: []
46
+ }), {
47
+ convertCategoryIdToName: b,
48
+ convertCategoryNameToId: R
49
+ } = de({
50
+ menuItems: $(() => T.state.menu.modules.item || []),
51
+ categories: $(() => T.categories || [])
52
+ }), m = $({
53
+ get: () => x.modelValue,
54
+ set: (a) => G("update:modelValue", a)
55
+ }), V = C(null);
56
+ j(() => x.editingGroup, (a) => {
57
+ a ? l.value = {
58
+ name: a.name,
59
+ description: a.description,
60
+ rules: a.rules.map((e) => ({
61
+ ...e,
62
+ restaurantRule: e.restaurantRule ? {
63
+ restaurantAttributes: P(e.restaurantRule.restaurantAttributes),
64
+ restaurantCustomAttributes: P(e.restaurantRule.restaurantCustomAttributes)
65
+ } : void 0,
66
+ itemRule: e.itemRule ? {
67
+ itemAttributes: b(P(e.itemRule.itemAttributes)),
68
+ itemCustomAttributes: P(e.itemRule.itemCustomAttributes)
69
+ } : void 0
70
+ }))
71
+ } : l.value = {
72
+ name: "",
73
+ description: "",
74
+ rules: []
75
+ }, V.value = Q.cloneDeep(l.value);
76
+ }, {
77
+ immediate: !0
78
+ }), j(() => x.modelValue, (a) => {
79
+ a || (l.value = {
80
+ name: "",
81
+ description: "",
82
+ rules: []
83
+ });
84
+ });
85
+ function S(a) {
86
+ return `${a}_${(/* @__PURE__ */ new Date()).toISOString()}`;
87
+ }
88
+ async function U() {
89
+ var e;
90
+ const a = {
91
+ _id: ((e = x.editingGroup) == null ? void 0 : e._id) ?? S("group"),
92
+ name: l.value.name,
93
+ description: l.value.description,
94
+ rules: l.value.rules.map((s) => ({
95
+ _id: s._id,
96
+ restaurantRule: s.restaurantRule ? {
97
+ restaurantAttributes: q(s.restaurantRule.restaurantAttributes),
98
+ restaurantCustomAttributes: q(s.restaurantRule.restaurantCustomAttributes)
99
+ } : void 0,
100
+ itemRule: s.itemRule ? {
101
+ itemAttributes: q(R(s.itemRule.itemAttributes)),
102
+ itemCustomAttributes: q(s.itemRule.itemCustomAttributes)
103
+ } : void 0
104
+ }))
105
+ };
106
+ G("submit", a);
107
+ }
108
+ const w = () => ({
109
+ _id: S("rule"),
110
+ restaurantRule: {
111
+ restaurantAttributes: null,
112
+ restaurantCustomAttributes: null
113
+ },
114
+ itemRule: {
115
+ itemAttributes: null,
116
+ itemCustomAttributes: null
117
+ }
118
+ });
119
+ function D(a) {
120
+ l.value.rules = l.value.rules.filter((e) => e._id !== a);
121
+ }
122
+ function I() {
123
+ m.value = !1;
124
+ }
125
+ const v = ve(() => !Q.isEqual(V.value, l.value), () => {
126
+ m.value = !1;
127
+ });
128
+ function c(a) {
129
+ l.value.rules.map((s) => s._id).includes(a.menuRule._id) ? l.value.rules = l.value.rules.map((s) => s._id === a.menuRule._id ? a.menuRule : s) : l.value.rules.push({
130
+ ...a.menuRule
131
+ });
132
+ }
133
+ const p = C();
134
+ return (a, e) => {
135
+ const s = g("fm-button"), _ = g("FmTextField"), k = g("FmButton"), F = g("FmFormGroup"), f = g("fm-side-sheet");
136
+ return d(), L(f, {
137
+ modelValue: m.value,
138
+ "onUpdate:modelValue": e[6] || (e[6] = (o) => m.value = o),
139
+ "is-container": t(te).FmForm,
140
+ "is-container-props": {
141
+ onValidationSuccess: U,
142
+ blameFormChildOnValidationFailed: !0
143
+ },
144
+ "max-width": 760,
145
+ "onOn:clickedAway": t(v)
146
+ }, {
147
+ "side-sheet-header": y(() => [u(s, {
148
+ variant: t(N).Tertiary,
149
+ class: "cursor-pointer mr-4",
150
+ "prepend-icon": "arrow_back",
151
+ onClick: e[0] || (e[0] = () => m.value = !1)
152
+ }, null, 8, ["variant"]), r("p", be, A(E.editingGroup ? t(i)("menu.rule_groups.edit_group") : t(i)("menu.rule_groups.create_group")), 1)]),
153
+ "side-sheet-footer": y(() => [r("div", Ce, [u(s, {
154
+ label: t(i)("common.save"),
155
+ size: "lg",
156
+ type: "submit",
157
+ variant: "primary"
158
+ }, null, 8, ["label"]), u(s, {
159
+ label: t(i)("common.cancel"),
160
+ size: "lg",
161
+ variant: "tertiary",
162
+ onClick: I
163
+ }, null, 8, ["label"])])]),
164
+ default: y(() => [r("div", ye, [u(H, {
165
+ title: t(i)("menu.rule_groups.form.basic_info")
166
+ }, {
167
+ default: y(() => [r("div", he, [u(_, {
168
+ label: t(i)("menu.rule_groups.form.name"),
169
+ "label-mark": "required",
170
+ modelValue: l.value.name,
171
+ "onUpdate:modelValue": e[1] || (e[1] = (o) => l.value.name = o),
172
+ placeholder: t(i)("menu.rule_groups.form.name_placeholder"),
173
+ required: "",
174
+ rules: [(o) => !!(o != null && o.trim()) || t(i)("menu.rule_groups.validation.name_required")]
175
+ }, null, 8, ["label", "modelValue", "placeholder", "rules"]), u(_, {
176
+ label: t(i)("menu.rule_groups.form.description"),
177
+ "label-mark": "optional",
178
+ modelValue: l.value.description,
179
+ "onUpdate:modelValue": e[2] || (e[2] = (o) => l.value.description = o),
180
+ placeholder: t(i)("menu.rule_groups.form.description_placeholder"),
181
+ multiline: "",
182
+ rows: 3
183
+ }, null, 8, ["label", "modelValue", "placeholder"])])]),
184
+ _: 1
185
+ }, 8, ["title"]), u(F, {
186
+ tag: "div",
187
+ "model-value": l.value.rules,
188
+ rules: [(o) => o.length > 0 || t(i)("menu.rule_groups.validation.at_least_one_rule_required")]
189
+ }, {
190
+ default: y(() => [u(H, {
191
+ title: t(i)("menu.rule_groups.form.rules"),
192
+ "sub-title": t(i)("menu.rule_groups.form.rules_description")
193
+ }, {
194
+ default: y(() => [l.value.rules.length > 0 ? (d(!0), h(K, {
195
+ key: 0
196
+ }, Y(l.value.rules, (o, O) => (d(), h(K, {
197
+ key: O
198
+ }, [r("div", xe, [r("div", ke, [u(pe, {
199
+ "model-value": o,
200
+ title: `${t(i)("menu.rule_groups.condition_view.rule")} ${O + 1}`,
201
+ "onUpdate:modelValue": e[3] || (e[3] = (J) => c(J)),
202
+ onDeleteRule: e[4] || (e[4] = (J) => D(J))
203
+ }, null, 8, ["model-value", "title"])])]), l.value.rules.length > 1 && O < l.value.rules.length - 1 ? (d(), h("div", Se, [r("span", we, A(t(i)("menu.rule_groups.condition_view.or")), 1)])) : B("", !0)], 64))), 128)) : (d(), L(ae, {
204
+ key: 1,
205
+ title: "",
206
+ subtitle: t(i)("menu.rule_groups.condition_view.empty_data.no_rule_available"),
207
+ action: {
208
+ text: t(i)("menu.link_product.rules.add_rule"),
209
+ callback: () => {
210
+ var o;
211
+ (o = p.value) == null || o.trigger();
212
+ }
213
+ }
214
+ }, null, 8, ["subtitle", "action"])), r("div", null, [u(_e, {
215
+ ref_key: "ruleFormRef",
216
+ ref: p,
217
+ "is-edit-mode": !0,
218
+ "model-value": w(),
219
+ "onUpdate:modelValue": e[5] || (e[5] = (o) => c(o))
220
+ }, {
221
+ default: y(({
222
+ trigger: o
223
+ }) => [l.value.rules.length > 0 ? (d(), L(k, {
224
+ key: 0,
225
+ variant: t(N).Primary,
226
+ label: t(i)("menu.link_product.rules.add_rule"),
227
+ "prepend-icon": "add",
228
+ onClick: oe(o, ["stop"])
229
+ }, null, 8, ["variant", "label", "onClick"])) : B("", !0)]),
230
+ _: 1
231
+ }, 8, ["model-value"])])]),
232
+ _: 1
233
+ }, 8, ["title", "sub-title"])]),
234
+ _: 1
235
+ }, 8, ["model-value", "rules"])])]),
236
+ _: 1
237
+ }, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"]);
238
+ };
239
+ }
240
+ }), Re = {
241
+ key: 0,
242
+ class: "space-y-8"
243
+ }, Ve = {
244
+ class: "flex items-center justify-between"
245
+ }, Fe = {
246
+ class: "fm-typo-en-title-md-600"
247
+ }, Ae = {
248
+ class: "text-fm-color-typo-secondary"
249
+ }, $e = {
250
+ class: "flex justify-end items-center"
251
+ }, Ge = {
252
+ class: "w-[320px]"
253
+ }, Ue = {
254
+ key: 1,
255
+ class: "flex-1 flex flex-col min-h-0"
256
+ }, Ie = {
257
+ class: "flex items-center justify-between p-8"
258
+ }, Me = {
259
+ class: "flex-1 mr-8"
260
+ }, Be = {
261
+ class: "flex flex-1 flex-col min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64"
262
+ }, Ne = ["onClick"], De = {
263
+ class: "flex-1 space-y-4"
264
+ }, Oe = {
265
+ class: "fm-typo-en-body-lg-600"
266
+ }, ze = {
267
+ key: 0,
268
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
269
+ }, Le = /* @__PURE__ */ X({
270
+ __name: "LinkProductRuleGroups",
271
+ setup(E) {
272
+ const {
273
+ t: n
274
+ } = ee(), x = ce(), G = ue(), i = ne(G), T = Z(), l = C(T.state.menu.ruleGroupSettings || {
275
+ groups: []
276
+ });
277
+ j(() => T.state.menu.ruleGroupSettings, (e) => {
278
+ l.value = e || {
279
+ groups: []
280
+ };
281
+ }, {
282
+ deep: !0
283
+ });
284
+ const b = C(!1), R = C(null), m = me(), V = $(() => m.breakpoints.value.xs), S = C(""), U = $(() => l.value.groups.filter((e) => e.name.toLowerCase().includes(S.value.toLowerCase()))), w = [{
285
+ header: n("menu.rule_groups.table.columns.name"),
286
+ accessorKey: "name",
287
+ enableSorting: !0
288
+ }, {
289
+ header: n("menu.rule_groups.table.columns.description"),
290
+ accessorKey: "description",
291
+ enableSorting: !1
292
+ }, {
293
+ id: "actions",
294
+ size: 100,
295
+ cell: (e) => u("div", {
296
+ class: "px-4 flex justify-end"
297
+ }, [u(te.FmButton, {
298
+ icon: "delete",
299
+ "text-color": W.NeutralGray400,
300
+ variant: N.Tertiary,
301
+ onClick: (s) => {
302
+ s.stopPropagation(), c(e.row.original._id);
303
+ }
304
+ }, null)])
305
+ }];
306
+ function D(e) {
307
+ v(e.original);
308
+ }
309
+ function I() {
310
+ R.value = null, b.value = !0;
311
+ }
312
+ function v(e) {
313
+ R.value = e, b.value = !0;
314
+ }
315
+ function c(e) {
316
+ const s = l.value.groups.find((_) => _._id === e);
317
+ s && x.open({
318
+ title: n("menu.rule_groups.delete_dialog.title"),
319
+ message: n("menu.rule_groups.delete_dialog.message", {
320
+ name: s.name
321
+ }),
322
+ primaryActions: {
323
+ text: n("menu.common.actions.remove"),
324
+ close: !1,
325
+ variant: N.Destructive
326
+ },
327
+ secondaryActions: {
328
+ text: n("menu.common.actions.cancel"),
329
+ close: !0
330
+ }
331
+ }).onPrimary(async () => {
332
+ const _ = Q.cloneDeep(l.value);
333
+ _.groups = _.groups.filter((k) => k._id !== e), await p(_), x.close();
334
+ });
335
+ }
336
+ async function p(e) {
337
+ await i.minor(async () => {
338
+ await T.updateMenuSetting({
339
+ ruleGroupSettings: e
340
+ });
341
+ }, {
342
+ successMessage: n("menu.rule_groups.saved_successfully")
343
+ });
344
+ }
345
+ async function a(e) {
346
+ var k;
347
+ const s = (k = l.value.groups) == null ? void 0 : k.findIndex((F) => F._id === e._id), _ = Q.cloneDeep(l.value);
348
+ s >= 0 ? _.groups[s] = e : _.groups.push(e), await p(_), b.value = !1;
349
+ }
350
+ return j(() => b.value, (e) => {
351
+ e || (R.value = null);
352
+ }), (e, s) => {
353
+ const _ = g("FmButton"), k = g("FmSearch"), F = g("FmTable");
354
+ return d(), h("div", null, [V.value ? (d(), h("div", Ue, [r("div", Ie, [r("div", Me, [u(k, {
355
+ modelValue: S.value,
356
+ "onUpdate:modelValue": s[1] || (s[1] = (f) => S.value = f),
357
+ autofocus: "",
358
+ class: "w-full",
359
+ placeholder: t(n)("menu.rule_groups.search_placeholder")
360
+ }, null, 8, ["modelValue", "placeholder"])]), u(_, {
361
+ icon: "add",
362
+ variant: t(N).Secondary,
363
+ onClick: I
364
+ }, null, 8, ["variant"])]), r("div", Be, [(d(!0), h(K, null, Y(U.value, (f) => (d(), h("div", {
365
+ key: f._id,
366
+ class: "flex flex-row py-12 px-16 cursor-pointer",
367
+ onClick: (o) => v(f)
368
+ }, [r("div", De, [r("p", Oe, A(f.name), 1), f.description ? (d(), h("p", ze, A(f.description), 1)) : B("", !0)]), u(_, {
369
+ "text-color": t(W).NeutralGray400,
370
+ variant: t(N).Tertiary,
371
+ icon: "delete",
372
+ onClick: oe((o) => c(f._id), ["stop"])
373
+ }, null, 8, ["text-color", "variant", "onClick"])], 8, Ne))), 128))])])) : (d(), h("div", Re, [r("div", Ve, [r("div", null, [r("h1", Fe, A(t(n)("menu.rule_groups.title")), 1), r("p", Ae, A(t(n)("menu.rule_groups.description")), 1)]), u(_, {
374
+ label: t(n)("menu.rule_groups.create_group"),
375
+ icon: "add",
376
+ onClick: I
377
+ }, null, 8, ["label"])]), r("div", $e, [r("div", Ge, [u(k, {
378
+ modelValue: S.value,
379
+ "onUpdate:modelValue": s[0] || (s[0] = (f) => S.value = f),
380
+ autofocus: "",
381
+ class: "mb-8",
382
+ placeholder: t(n)("menu.rule_groups.search_placeholder")
383
+ }, null, 8, ["modelValue", "placeholder"])])]), u(se, null, {
384
+ default: y(() => [u(F, {
385
+ "column-defs": w,
386
+ "row-data": U.value,
387
+ "page-size": U.value.length,
388
+ "hide-footer": !0,
389
+ onRowClick: D
390
+ }, null, 8, ["row-data", "page-size"])]),
391
+ _: 1
392
+ })])), u(Te, {
393
+ modelValue: b.value,
394
+ "onUpdate:modelValue": s[2] || (s[2] = (f) => b.value = f),
395
+ "editing-group": R.value,
396
+ onSubmit: a
397
+ }, null, 8, ["modelValue", "editing-group"])]);
398
+ };
399
+ }
400
+ }), je = {
401
+ class: "py-16"
402
+ }, Ee = {
403
+ key: 0,
404
+ class: "space-y-32 max-w-[750px] xs:p-16"
405
+ }, Pe = {
406
+ key: 0,
407
+ class: "pl-32 space-x-8"
408
+ }, qe = {
409
+ key: 1
410
+ }, Ke = {
411
+ class: "space-y-8"
412
+ }, Qe = {
413
+ class: "flex items-center justify-between"
414
+ }, He = {
415
+ class: "fm-typo-en-title-md-600"
416
+ }, Je = {
417
+ class: "text-fm-color-typo-secondary"
418
+ }, We = {
419
+ key: 2
420
+ }, at = /* @__PURE__ */ X({
421
+ __name: "MenuSetting",
422
+ setup(E) {
423
+ var I;
424
+ const {
425
+ t: n
426
+ } = ee(), x = Z(), G = ie(), i = ue(), T = ne(i), l = $(() => ({
427
+ lowStock: x.state.menu.lowStockThreshold,
428
+ taxSetting: x.state.menu.masterCatalogSetting,
429
+ priceTierSettings: x.state.menu.priceTierSettings
430
+ })), b = C("conf"), R = $(() => [{
431
+ label: n("menu.menu_setting.tabs.menu_configuration"),
432
+ value: "conf"
433
+ }, ...x.isV4 ? [{
434
+ label: n("menu.menu_setting.tabs.price_group"),
435
+ value: "price-group"
436
+ }, {
437
+ label: n("menu.menu_setting.tabs.link_product_rule_groups"),
438
+ value: "link-product-rule-groups"
439
+ }] : []]), m = C(z.transformTax((I = l.value.taxSetting) == null ? void 0 : I.inclusiveTaxes));
440
+ j(() => l.value, (v) => {
441
+ var c;
442
+ m.value = z.transformTax((c = v.taxSetting) == null ? void 0 : c.inclusiveTaxes);
443
+ });
444
+ const V = $(() => {
445
+ if (!G.currentCountry.value) return [];
446
+ const v = m.value.mode === M.MANUAL ? m.value.inclusive ?? [] : [];
447
+ return re.Country.getCountry(G.currentCountry.value).taxSystems.map((p) => {
448
+ const a = v.find((e) => e.systemCode === p.code);
449
+ return {
450
+ inclusive: (a == null ? void 0 : a.inclusive) || !1,
451
+ systemCode: p.code
452
+ };
453
+ });
454
+ });
455
+ function S(v) {
456
+ const c = m.value, p = c.mode === M.AUTO ? z.manualTax(V.value) : le(c);
457
+ p.inclusive ?? (p.inclusive = []);
458
+ const a = p.inclusive.findIndex((e) => e.systemCode === v.systemCode);
459
+ a < 0 ? p.inclusive.push(v) : p.inclusive.splice(a, 1, v), m.value = p;
460
+ }
461
+ async function U() {
462
+ if (l.value.lowStock !== null && l.value.lowStock !== void 0 && !Number.isInteger(l.value.lowStock))
463
+ return;
464
+ const v = m.value.mode === M.AUTO ? null : le(m.value.inclusive);
465
+ await T.minor(async () => {
466
+ const c = l.value.lowStock === null || l.value.lowStock === void 0 || l.value.lowStock === 0;
467
+ await x.updateMenuSetting({
468
+ masterCatalogSetting: {
469
+ inclusiveTaxes: v
470
+ },
471
+ lowStockThreshold: c ? null : l.value.lowStock,
472
+ priceTierSettings: w.priceTiers.value
473
+ });
474
+ }, {
475
+ successMessage: n("menu.menu_setting.fields.low_stock.updated")
476
+ });
477
+ }
478
+ const w = ge(), D = [{
479
+ header: n("menu.price_tier.settings_table.columns.name"),
480
+ accessorKey: "key",
481
+ enableSorting: !1
482
+ }, {
483
+ id: "actions",
484
+ size: 50,
485
+ cell: (v) => u("div", {
486
+ class: "px-4 flex justify-end"
487
+ }, [u(te.FmButton, {
488
+ icon: "delete",
489
+ "text-color": W.NeutralGray400,
490
+ variant: N.Tertiary,
491
+ onClick: () => w.deletePriceTier(v.row.original.key)
492
+ }, null)])
493
+ }];
494
+ return (v, c) => {
495
+ const p = g("FmTabs"), a = g("fm-radio"), e = g("fm-radio-group"), s = g("fm-checkbox"), _ = g("FormItem"), k = g("FmStepperField"), F = g("FmButton"), f = g("FmTable");
496
+ return d(), L(fe, {
497
+ heading: t(n)("menu.menu_setting.title")
498
+ }, {
499
+ default: y(() => [u(p, {
500
+ items: R.value,
501
+ modelValue: b.value,
502
+ "onUpdate:modelValue": c[0] || (c[0] = (o) => b.value = o)
503
+ }, null, 8, ["items", "modelValue"]), r("div", je, [b.value === "conf" ? (d(), h("div", Ee, [u(H, {
504
+ title: "Tax setting"
505
+ }, {
506
+ default: y(() => [u(_, {
507
+ label: t(n)("menu.setting.tax.title")
508
+ }, {
509
+ default: y(() => [u(e, {
510
+ "model-value": m.value.mode,
511
+ "onUpdate:modelValue": c[1] || (c[1] = (o) => {
512
+ o === t(M).AUTO ? m.value = t(z).autoTax() : m.value = t(z).manualTax(V.value);
513
+ })
514
+ }, {
515
+ default: y(() => [u(a, {
516
+ value: t(M).AUTO,
517
+ label: t(n)("menu.setting.tax.modes.auto.label"),
518
+ sublabel: t(n)("menu.setting.tax.modes.auto.sublabel")
519
+ }, null, 8, ["value", "label", "sublabel"]), u(a, {
520
+ value: t(M).MANUAL,
521
+ label: t(n)("menu.setting.tax.modes.manual.label"),
522
+ sublabel: t(n)("menu.setting.tax.modes.manual.sublabel")
523
+ }, null, 8, ["value", "label", "sublabel"])]),
524
+ _: 1
525
+ }, 8, ["model-value"]), m.value.mode === t(M).MANUAL ? (d(), h("div", Pe, [(d(!0), h(K, null, Y(V.value, (o) => (d(), L(s, {
526
+ key: o.systemCode,
527
+ "model-value": o.inclusive,
528
+ value: !0,
529
+ label: o.systemCode + " inclusive",
530
+ "onUpdate:modelValue": (O) => {
531
+ S({
532
+ ...o,
533
+ inclusive: O
534
+ });
535
+ }
536
+ }, null, 8, ["model-value", "label", "onUpdate:modelValue"]))), 128))])) : B("", !0)]),
537
+ _: 1
538
+ }, 8, ["label"])]),
539
+ _: 1
540
+ }), u(H, {
541
+ title: t(n)("menu.menu_setting.fields.low_stock.title"),
542
+ "sub-title": t(n)("menu.menu_setting.fields.low_stock.subtitle")
543
+ }, {
544
+ default: y(() => [u(k, {
545
+ "model-value": l.value.lowStock || null,
546
+ min: 0,
547
+ max: 1e3,
548
+ step: 1,
549
+ placeholder: t(n)("menu.menu_setting.fields.low_stock.not_set"),
550
+ "onUpdate:modelValue": c[2] || (c[2] = (o) => {
551
+ l.value.lowStock = o;
552
+ }),
553
+ rules: [(o) => o === null || Number.isInteger(o) || t(n)("menu.menu_setting.fields.low_stock.must_be_integer")],
554
+ "helper-text": t(n)("menu.menu_setting.fields.low_stock.helper_text")
555
+ }, null, 8, ["model-value", "placeholder", "rules", "helper-text"])]),
556
+ _: 1
557
+ }, 8, ["title", "sub-title"]), u(F, {
558
+ onClick: U,
559
+ label: t(n)("common.save")
560
+ }, null, 8, ["label"])])) : B("", !0), b.value === "price-group" ? (d(), h("div", qe, [r("div", Ke, [r("div", Qe, [r("div", null, [r("h1", He, A(t(n)("menu.price_tier.price_group")), 1), r("p", Je, A(t(n)("menu.price_tier.description")), 1)]), u(F, {
561
+ label: t(n)("menu.price_tier.add_price_group"),
562
+ icon: "add",
563
+ onClick: t(w).create
564
+ }, null, 8, ["label", "onClick"])]), u(se, null, {
565
+ default: y(() => [u(f, {
566
+ "column-defs": D,
567
+ "row-data": t(w).priceTiers.value,
568
+ "page-size": t(w).priceTiers.value.length,
569
+ "hide-footer": !0
570
+ }, null, 8, ["row-data", "page-size"])]),
571
+ _: 1
572
+ })])])) : B("", !0), b.value === "link-product-rule-groups" ? (d(), h("div", We, [u(Le)])) : B("", !0)])]),
573
+ _: 1
574
+ }, 8, ["heading"]);
575
+ };
576
+ }
577
+ });
578
+ export {
579
+ at as default
580
+ };
@@ -2,12 +2,11 @@ import { defineComponent as J, ref as T, computed as f, resolveComponent as g, c
2
2
  import { useI18n as Q } from "@feedmepos/mf-common";
3
3
  import { components as W, useSnackbar as te, useDialog 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 { _ as ae } from "./app-CjfWVFOg.js";
6
- import { H as j, I as le, J as Y, z as C, u as re, O as se, D as ie } from "./menu-tHhzkxDL.js";
7
- import { _ as H } from "./customAttributes-DvbvCfOd.js";
8
- import { u as ue } from "./discardConfirm-BHni0LNu.js";
9
- import { L as de } from "./LinkProductSideSheet-C4yBnJSM.js";
10
- import { _ as ce } from "./index.vue_vue_type_script_setup_true_lang-B1_JqsYF.js";
5
+ import { _ as ae } from "./app-CEIhTuYG.js";
6
+ import { H as j, I as le, J as Y, z as C, u as re, O as se, D as ie, a3 as ue } from "./index.vue_vue_type_script_setup_true_lang-CFPMPQFg.js";
7
+ import { _ as H } from "./RuleView.vue_vue_type_script_setup_true_lang-edNbsZTq.js";
8
+ import { u as de } from "./discardConfirm-BHni0LNu.js";
9
+ import { L as ce } from "./LinkProductSideSheet-B_R_2iH6.js";
11
10
  import { _ as me } from "./PageLayout.vue_vue_type_script_setup_true_lang-vFqWGM6P.js";
12
11
  const pe = { class: "fm-typo-en-title-md-600" }, _e = { class: "space-y-32" }, fe = { class: "space-y-16" }, ve = { class: "flex items-center gap-8" }, ye = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ge = { class: "flex-1" }, he = { class: "grow overflow-y-auto" }, be = { class: "text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 px-16 py-8 border-b border-b-fm-color-neutral-gray-200" }, xe = { class: "px-16 py-8 flex-1" }, ke = { class: "py-8" }, Fe = { class: "flex gap-8 items-center justify-start" }, Ie = /* @__PURE__ */ J({
13
12
  __name: "PrintDepartmentDialog",
@@ -65,7 +64,7 @@ const pe = { class: "fm-typo-en-title-md-600" }, _e = { class: "space-y-32" }, f
65
64
  );
66
65
  return U.length && a.push({ ...d, items: U }), a;
67
66
  }, []);
68
- }), y = h, w = ue(
67
+ }), y = h, w = de(
69
68
  () => !le.isEqual(M.value, n.value),
70
69
  () => {
71
70
  x.value = !1;
@@ -133,7 +132,7 @@ const pe = { class: "fm-typo-en-title-md-600" }, _e = { class: "space-y-32" }, f
133
132
  }, {
134
133
  "append-title": m(() => [
135
134
  c(U),
136
- c(de, {
135
+ c(ce, {
137
136
  "categorized-items": v.categorizedItems,
138
137
  "initial-value": n.value.applyToItems.map((s) => ({
139
138
  _id: s
@@ -238,7 +237,7 @@ const Ee = {
238
237
  class: "fm-typo-en-body-lg-600"
239
238
  }, Le = {
240
239
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
241
- }, Ye = /* @__PURE__ */ J({
240
+ }, Be = /* @__PURE__ */ J({
242
241
  __name: "PrintRoute",
243
242
  setup(v) {
244
243
  const {
@@ -397,7 +396,7 @@ const Ee = {
397
396
  _: 2
398
397
  }, 1032, ["label", "onClick"]))), 128))]),
399
398
  _: 1
400
- })], 64)) : (p(), P(l(ce), {
399
+ })], 64)) : (p(), P(l(ue), {
401
400
  key: 0,
402
401
  action: {
403
402
  text: l(t)("menu.print_route.empty.action"),
@@ -417,5 +416,5 @@ const Ee = {
417
416
  }
418
417
  });
419
418
  export {
420
- Ye as default
419
+ Be as default
421
420
  };
@@ -1,4 +1,4 @@
1
- import { a as f } from "./Product.vue_vue_type_script_setup_true_lang-CVR8j-XT.js";
1
+ import { a as f } from "./Product.vue_vue_type_script_setup_true_lang-BKhn8Txf.js";
2
2
  export {
3
3
  f as default
4
4
  };