@feedmepos/mf-menu-portal 1.0.4-dev.2 → 1.0.4-dev.4

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-DtX4DyDA.js → App-CrpoLCjA.js} +3 -3
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C9OSr8ft.js → ApplyProduct.vue_vue_type_script_setup_true_lang-Hdsnu29V.js} +1 -1
  3. package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-BJN8ajuD.js → BindingTable.vue_vue_type_script_setup_true_lang-D3CmOOPY.js} +1 -1
  4. package/dist/{Catalog-Dly_r1yA.js → Catalog-VU3HhNro.js} +4 -4
  5. package/dist/{CatalogBinding-CNG4YcVq.js → CatalogBinding-BNATtZEY.js} +3 -3
  6. package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-Cy2culdR.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-BmG-xpW4.js} +3 -3
  7. package/dist/CatalogEditor.vue_vue_type_script_setup_true_lang-BFsRDFpj.js +784 -0
  8. package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-4EZ4yM_N.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-Bk4FqVmx.js} +14 -14
  9. package/dist/{Category-Dz1yFYyY.js → Category-DMoXTsfG.js} +5 -5
  10. package/dist/{Category-BS-vFDYy.js → Category-DxjdQ-NN.js} +2 -2
  11. package/dist/CategoryList.vue_vue_type_script_setup_true_lang-B3Ts1O-9.js +847 -0
  12. package/dist/{CookingGuide-CmbvWFgp.js → CookingGuide-DiZZDYD-.js} +5 -5
  13. package/dist/{Group-B7s-vPXb.js → Group-DFR8q-tt.js} +5 -5
  14. package/dist/{Group-BRmWZnHh.js → Group-rzfh_o6r.js} +2 -2
  15. package/dist/GroupList.vue_vue_type_script_setup_true_lang-DiN-wQXX.js +1807 -0
  16. package/dist/Ingredient-DpjGIuH9.js +505 -0
  17. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CnI80Ojd.js +782 -0
  18. package/dist/{MenuSetting-Ci7V_Jxn.js → MenuSetting-DR-pDSF_.js} +4 -4
  19. package/dist/OrderPacing-JcTuweqF.js +769 -0
  20. package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-NCH-SrZU.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-HwwJ2mGv.js} +2 -2
  21. package/dist/{Preview-BBGNaj1F.js → Preview-BZyun5lZ.js} +1 -1
  22. package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-BXJDpDCm.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-DquqNbE1.js} +1 -1
  23. package/dist/PrintRoute-CzEx2dCt.js +518 -0
  24. package/dist/{Product-DqN0NFUU.js → Product-CQb0n06E.js} +4 -4
  25. package/dist/ProductAttributeFilter.vue_vue_type_script_setup_true_lang-B2KdolJS.js +7931 -0
  26. package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang-Fkiw4lZp.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-CBlDEjqF.js} +9 -9
  27. package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-D8NQTCLx.js +2011 -0
  28. package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-CNWCT1OB.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-cG47Pu-6.js} +1 -1
  29. package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-BoQ9mVPY.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-0UwUcA2L.js} +800 -749
  30. package/dist/{ProductInternalTools-CC3SWSlT.js → ProductInternalTools-QrBR1nFp.js} +2 -2
  31. package/dist/{ProductInventoryDialog-SAhsVekx.js → ProductInventoryDialog-fV38GO1a.js} +1 -1
  32. package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-BB8UIIsW.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-Bzb3RrMg.js} +1 -1
  33. package/dist/ProductList.vue_vue_type_script_setup_true_lang-BwKQESr3.js +2765 -0
  34. package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-BMDSkfcn.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-CDYcHXo1.js} +1 -1
  35. package/dist/{Products-Cn6j1DOQ.js → Products-B8tysOAL.js} +3 -3
  36. package/dist/Publish-DTvOvFNa.js +1337 -0
  37. package/dist/Recipe-Ddx31csF.js +388 -0
  38. package/dist/{Scheduler-DlaSVACJ.js → Scheduler-CST5L_cw.js} +314 -254
  39. package/dist/ServingSequence-DYyEZI2S.js +374 -0
  40. package/dist/{Setting-CyCp2uw4.js → Setting-Ip0pGjks.js} +6 -6
  41. package/dist/Subcategory-BIgjzVta.js +459 -0
  42. package/dist/{Takeaway-sVVykWDg.js → Takeaway-CekhGM-m.js} +2 -2
  43. package/dist/{Takeaway-tYHCAXYU.js → Takeaway-aXsPg4JT.js} +5 -5
  44. package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-CV24v8Zg.js → TakeawayList.vue_vue_type_script_setup_true_lang-CaRR4_j3.js} +4 -4
  45. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CshqYpc9.js +1291 -0
  46. package/dist/Unit-BMW8u0Us.js +424 -0
  47. package/dist/{Variant-BNnR5rLv.js → Variant-CZsrYRMU.js} +5 -5
  48. package/dist/{_id_-a9ZtdjtT.js → _id_-D4swrvNa.js} +3 -3
  49. package/dist/{app-CmElp8cO.js → app-BWwwHsWi.js} +337 -337
  50. package/dist/app.js +1 -1
  51. package/dist/apps/mf-menu/src/app.d.ts +80 -0
  52. package/dist/apps/mf-menu/src/components/PriceTier/LinkPriceTierSection.vue.d.ts +9 -0
  53. package/dist/apps/mf-menu/src/components/Product/BulkCategorySelect.vue.d.ts +37 -0
  54. package/dist/apps/mf-menu/src/components/Product/ProductAttributeFilter.vue.d.ts +11 -1
  55. package/dist/apps/mf-menu/src/components/ProductList.vue.d.ts +2 -2
  56. package/dist/apps/mf-menu/src/components/feature/NestedGroupManager/NestedGroupOverrideSheets.vue.d.ts +27 -0
  57. package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesFilter.vue.d.ts +20 -0
  58. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  59. package/dist/assets/{menu-compute-B_wpWLAj.js → menu-compute-D7TdiHt4.js} +4 -4
  60. package/dist/assets/{validate-menu-DjxNxUxH.js → validate-menu-DXppWUVq.js} +2 -2
  61. package/dist/mf-menu-portal.css +1 -1
  62. package/dist/{provide-BJRbSauL.js → provide-CDmXzkhz.js} +67539 -65978
  63. package/dist/{useActionFeedback-89GwO41T.js → useActionFeedback-Dm2HDa_2.js} +1 -1
  64. package/dist/{FormSection.vue_vue_type_script_setup_true_lang-pY-_msnM.js → vuedraggable-CBtQLb_S.js} +140 -139
  65. package/package.json +2 -2
  66. package/dist/CatalogEditor.vue_vue_type_script_setup_true_lang-Byp1db9_.js +0 -484
  67. package/dist/CategoryList.vue_vue_type_script_setup_true_lang-CrHYjrTn.js +0 -797
  68. package/dist/GroupList.vue_vue_type_script_setup_true_lang-CWr52_a-.js +0 -2183
  69. package/dist/Ingredient-BMAlctE4.js +0 -463
  70. package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CR99740r.js +0 -709
  71. package/dist/OrderPacing-Bz5kn6DY.js +0 -698
  72. package/dist/PrintRoute-BnARWdR2.js +0 -473
  73. package/dist/ProductChipSummary.vue_vue_type_script_setup_true_lang-D8DygCBl.js +0 -110
  74. package/dist/ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-DryxrG-x.js +0 -1257
  75. package/dist/ProductList.vue_vue_type_script_setup_true_lang-BDnTs366.js +0 -10353
  76. package/dist/Publish-BPJhG39B.js +0 -1261
  77. package/dist/Recipe-mt1vec5-.js +0 -350
  78. package/dist/ServingSequence-Cr1REWZP.js +0 -336
  79. package/dist/Subcategory-kuB7gYvc.js +0 -412
  80. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Dz-Chgek.js +0 -1213
  81. package/dist/Unit-BSOvZxRy.js +0 -385
  82. package/dist/apps/mf-menu/src/views/MenuManagementEditor/RestaurantAttributesFilter.vue.d.ts +0 -2
@@ -0,0 +1,782 @@
1
+ import { defineComponent as Ge, ref as V, computed as h, watch as ue, resolveComponent as w, openBlock as d, createBlock as x, unref as o, withCtx as g, createElementBlock as p, createVNode as c, createElementVNode as r, toDisplayString as _, createCommentVNode as N, withModifiers as $, Fragment as L, renderList as I, withDirectives as Ae } from "vue";
2
+ import { d as Ue } from "./vuedraggable-CBtQLb_S.js";
3
+ import { useI18n as je, ItemSelector as $e } from "@feedmepos/mf-common";
4
+ import { components as ze } from "@feedmepos/ui-library";
5
+ import { r as Me } from "./provide-CDmXzkhz.js";
6
+ import { r as Be, a as re } from "./ruleValueKey-BF52PuHb.js";
7
+ import { _ as De } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
8
+ import { u as Ke } from "./useEditorValidation-Ctef5Bxt.js";
9
+ const Te = {
10
+ ALL: "menu.order.from.options.all",
11
+ POS_ONLY: "menu.order.from.options.pos_only",
12
+ NONE: "menu.order.from.options.none"
13
+ }, Ul = {
14
+ NORMAL: "menu.group.list.types.normal",
15
+ PRODUCT: "menu.group.list.types.product",
16
+ DYNAMIC: "menu.group.list.types.dynamic"
17
+ }, jl = {
18
+ ALL: "menu.product.table.availability.all",
19
+ POS_ONLY: "menu.product.table.availability.pos_only",
20
+ NONE: "menu.product.table.availability.none"
21
+ }, Ye = { class: "fm-typo-en-title-md-600 mr-auto" }, qe = {
22
+ key: 0,
23
+ class: "py-8 px-8 overflow-y-auto"
24
+ }, We = {
25
+ key: 1,
26
+ class: "p-8 overflow-y-auto flex flex-col gap-16"
27
+ }, He = { class: "relative top-0 -mb-8 leading-6 tracking-normal fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Je = {
28
+ key: 0,
29
+ class: "text-fm-color-typo-error",
30
+ role: "alert"
31
+ }, Qe = { class: "flex flex-col gap-8" }, Xe = { class: "relative border border-fm-color-neutral-gray-200 rounded-md p-16" }, Ze = { class: "absolute -top-[10px] left-[50px] bg-fm-color-neutral-white px-2 fm-typo-en-body-lg-400 text-fm-color-typo-secondary select-none z-10" }, el = { class: "flex items-center justify-between gap-8" }, ll = { class: "flex items-center gap-8 min-w-0" }, tl = { class: "text-fm-color-neutral-gray-300" }, al = { class: "flex gap-8" }, ol = { class: "flex flex-col gap-8 mt-8" }, nl = { class: "fm-typo-en-body-lg-600" }, sl = { class: "shrink-0" }, ul = { class: "shrink-0" }, rl = { class: "text-fm-color-primary underline underline-offset-2 truncate" }, il = { class: "flex gap-8" }, dl = { class: "fm-typo-en-body-lg-600" }, cl = {
32
+ key: 0,
33
+ class: "text-fm-color-neutral-gray-300 pl-16"
34
+ }, ml = { class: "flex items-center gap-24" }, pl = { class: "fm-typo-en-headline-lg-600" }, _l = { class: "overflow-y-auto" }, vl = { class: "mt-24 flex flex-col gap-16" }, bl = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, fl = { class: "flex items-center justify-between gap-8" }, yl = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-lg-600 break-all" }, gl = {
35
+ key: 0,
36
+ class: "flex flex-col gap-8"
37
+ }, kl = {
38
+ key: 0,
39
+ class: "text-fm-color-neutral-gray-300 p-16 ml-16"
40
+ }, hl = { class: "mt-24 flex flex-col gap-16" }, wl = { class: "link-product-rule-editor-sheet-marker fm-typo-en-body-lg-600" }, Sl = { class: "flex w-full justify-between gap-16" }, xl = {
41
+ key: 0,
42
+ class: "flex w-full [&>*]:w-full"
43
+ }, Cl = { class: "break-all fm-typo-en-body-lg-400 line-clamp-1" }, Rl = { class: "flex w-full items-center justify-end gap-16" }, Fl = {
44
+ key: 0,
45
+ class: "flex gap-8 items-center justify-start"
46
+ }, Vl = {
47
+ key: 1,
48
+ class: "flex gap-8 items-center justify-start"
49
+ }, $l = /* @__PURE__ */ Ge({
50
+ __name: "LinkProductSideSheet",
51
+ props: {
52
+ modelValue: { type: Boolean },
53
+ catalogue: {},
54
+ selectedProductIds: { default: () => [] },
55
+ selectedProducts: { default: void 0 },
56
+ selectVariant: { type: Boolean, default: !1 },
57
+ title: {},
58
+ rulesSession: { default: null },
59
+ rulesView: { default: null },
60
+ selectionSession: { default: null }
61
+ },
62
+ emits: ["update:modelValue", "submit", "submitLinks", "submit-rules"],
63
+ setup(ie, { emit: de }) {
64
+ const i = ie, P = de, { t: a } = je(), ce = {
65
+ mounted: (e, l) => {
66
+ var t;
67
+ (t = e.querySelector("input")) == null || t.setAttribute("aria-label", l.value);
68
+ },
69
+ updated: (e, l) => {
70
+ var t;
71
+ (t = e.querySelector("input")) == null || t.setAttribute("aria-label", l.value);
72
+ }
73
+ }, S = V("normal"), C = V(null), z = V([]), Z = Ke(() => C.value), M = V([]), ee = [
74
+ { value: "in", label: "menu.rule_groups.condition_view.operator.in" },
75
+ {
76
+ value: "notIn",
77
+ label: "menu.rule_groups.condition_view.operator.not_in"
78
+ },
79
+ {
80
+ value: "startsWith",
81
+ label: "menu.rule_groups.condition_view.operator.starts_with"
82
+ }
83
+ ], f = h(() => i.rulesView ?? null), Y = h(
84
+ () => {
85
+ var e;
86
+ return !!i.rulesSession && ((e = f.value) == null ? void 0 : e.rulesCapability.state) === "allowed";
87
+ }
88
+ ), G = h(() => {
89
+ var e;
90
+ return ((e = f.value) == null ? void 0 : e.rules) ?? [];
91
+ }), le = h(() => C.value !== null), me = h(
92
+ () => ee.map((e) => ({ label: a(e.label), value: e.value }))
93
+ );
94
+ function pe() {
95
+ var e;
96
+ return (((e = f.value) == null ? void 0 : e.attributeOptions) ?? []).map((l) => ({
97
+ label: a(l.label, l.labelParams ?? {}),
98
+ value: l.key
99
+ }));
100
+ }
101
+ function _e(e) {
102
+ var l, t;
103
+ return (((t = (l = f.value) == null ? void 0 : l.attributeOptions.find(
104
+ (n) => n.key === e.attribute
105
+ )) == null ? void 0 : t.values) ?? []).map((n) => ({
106
+ label: n.value === null ? a("menu.link_product.rules.addon") : n.label,
107
+ // FmSelect needs a primitive; a value travels as its key.
108
+ value: re(n.value)
109
+ }));
110
+ }
111
+ function ve(e) {
112
+ var t;
113
+ const l = (t = f.value) == null ? void 0 : t.attributeOptions.find(
114
+ (n) => n.key === e.attribute
115
+ );
116
+ return e.values.map((n) => {
117
+ const v = l == null ? void 0 : l.values.find(
118
+ (O) => O.value === n
119
+ );
120
+ return (v == null ? void 0 : v.value) === null ? a("menu.link_product.rules.addon") : (v == null ? void 0 : v.label) ?? String(n);
121
+ }).join(a("menu.link_product.rules.value_separator"));
122
+ }
123
+ function be(e, l) {
124
+ return e.values[l] === null ? a("menu.link_product.rules.addon") : e.valueLabels[l] ?? "";
125
+ }
126
+ function fe(e) {
127
+ return e.values.map(
128
+ (l, t) => be(e, t)
129
+ ).join(a("menu.link_product.rules.value_separator"));
130
+ }
131
+ function te(e, l) {
132
+ var t;
133
+ return a("menu.link_product.rules.condition_summary", {
134
+ condition: F(l),
135
+ attribute: a(
136
+ e.attributeLabel,
137
+ e.attributeLabelParams ?? {}
138
+ ),
139
+ operator: a(
140
+ ((t = ee.find((n) => n.value === e.operator)) == null ? void 0 : t.label) ?? ""
141
+ ),
142
+ value: fe(e)
143
+ });
144
+ }
145
+ function B(e) {
146
+ const l = i.rulesSession;
147
+ if (!l) return;
148
+ const t = (e == null ? void 0 : e.id) ?? l.addRule();
149
+ t && l.openRuleEditor(t) && (M.value = [], C.value = t);
150
+ }
151
+ function A() {
152
+ var e;
153
+ (e = i.rulesSession) == null || e.closeRuleEditor(), C.value = null, R.value = /* @__PURE__ */ new Set(), M.value = [];
154
+ }
155
+ function ye() {
156
+ const e = C.value, l = i.rulesSession;
157
+ if (!e || !l) return;
158
+ const t = l.saveRuleEditor();
159
+ t.kind === "accepted" ? A() : t.kind === "rejected" && (M.value = t.issues, Z.submit(
160
+ async () => ({ kind: "rejected", issues: t.issues })
161
+ ));
162
+ }
163
+ const q = V(""), W = h(
164
+ () => {
165
+ var e;
166
+ return ((e = j.value) == null ? void 0 : e.ruleGroupIds) ?? [];
167
+ }
168
+ ), ge = h(() => {
169
+ var t;
170
+ const e = ((t = f.value) == null ? void 0 : t.ruleGroupOptions) ?? [], l = q.value.trim().toLowerCase();
171
+ return l ? e.filter(
172
+ (n) => n.name.toLowerCase().includes(l)
173
+ ) : e;
174
+ }), ke = h(
175
+ () => W.value.flatMap((e) => {
176
+ var t;
177
+ const l = (t = f.value) == null ? void 0 : t.ruleGroupOptions.find(
178
+ (n) => n.id === e
179
+ );
180
+ return l ? [l] : [];
181
+ })
182
+ ), R = V(/* @__PURE__ */ new Set());
183
+ function he(e) {
184
+ const l = new Set(R.value);
185
+ l.has(e) ? l.delete(e) : l.add(e), R.value = l;
186
+ }
187
+ function we(e) {
188
+ const l = i.rulesSession;
189
+ if (!l) return;
190
+ const t = W.value;
191
+ l.setRuleEditorGroupIds(
192
+ t.includes(e) ? t.filter((n) => n !== e) : [...t, e]
193
+ );
194
+ }
195
+ function E(e, l) {
196
+ var O, T;
197
+ const t = `conditions.${e}.${l}`, n = (O = f.value) == null ? void 0 : O.editor, v = n ? n.issues : M.value;
198
+ return Z.issue(((T = j.value) == null ? void 0 : T.fieldIssues) ?? {}, t) ?? v.find((Q) => Q.field === t) ?? null;
199
+ }
200
+ function D(e) {
201
+ return e ? a(e.code) : "";
202
+ }
203
+ function Se(e) {
204
+ var t;
205
+ const l = (t = i.rulesSession) == null ? void 0 : t.reorderRules(e.map((n) => n.id));
206
+ z.value = (l == null ? void 0 : l.kind) === "rejected" ? l.issues : [];
207
+ }
208
+ function xe(e) {
209
+ var t;
210
+ const l = (t = i.rulesSession) == null ? void 0 : t.duplicateRule(e);
211
+ z.value = (l == null ? void 0 : l.kind) === "rejected" ? l.issues : [];
212
+ }
213
+ function Ce(e) {
214
+ return a(Te[e]);
215
+ }
216
+ function U(e) {
217
+ return a("menu.link_product.rules.rule_number", { index: e + 1 });
218
+ }
219
+ function F(e) {
220
+ return a("menu.link_product.rules.condition_number", { index: e + 1 });
221
+ }
222
+ function Re(e) {
223
+ var l;
224
+ (l = i.rulesSession) == null || l.removeRuleEditorCondition(e);
225
+ }
226
+ function Fe() {
227
+ var e;
228
+ (e = i.rulesSession) == null || e.addRuleEditorCondition();
229
+ }
230
+ function Ve() {
231
+ P("submit-rules");
232
+ }
233
+ function ae() {
234
+ return i.selectedProducts ?? i.selectedProductIds.map((e) => ({ itemId: e }));
235
+ }
236
+ function oe(e) {
237
+ const l = {};
238
+ for (const t of e) {
239
+ const n = l[t.itemId] ?? [];
240
+ n.push(
241
+ t.combinationKey ? { _id: t.itemId, combinationKey: t.combinationKey } : { _id: t.itemId }
242
+ ), l[t.itemId] = n;
243
+ }
244
+ return l;
245
+ }
246
+ const K = V(oe(ae()));
247
+ function Le(e) {
248
+ K.value = e, i.selectionSession && i.selectionSession.setSelectedProductIds([
249
+ ...new Set(
250
+ Object.values(e).flat().map((l) => l._id)
251
+ )
252
+ ]);
253
+ }
254
+ ue(
255
+ () => i.modelValue,
256
+ (e) => {
257
+ var l;
258
+ if (e) {
259
+ const t = (l = i.selectionSession) == null ? void 0 : l.get(), n = (t == null ? void 0 : t.status) === "ready" ? t.value.selectedProductIds : void 0;
260
+ K.value = oe(
261
+ n ? n.map((v) => ({ itemId: v })) : ae()
262
+ ), S.value = Y.value && G.value.length > 0 ? "rules" : "normal";
263
+ } else
264
+ A();
265
+ }
266
+ ), ue(G, (e) => {
267
+ i.modelValue && Y.value && e.length > 0 && C.value === null && S.value === "normal" && (S.value = "rules");
268
+ });
269
+ const H = h(() => Object.values(K.value).flat()), j = h(() => {
270
+ var l, t;
271
+ if ((l = f.value) != null && l.editor) return f.value.editor;
272
+ const e = (t = f.value) == null ? void 0 : t.rules.find(
273
+ (n) => n.id === C.value
274
+ );
275
+ return e ? {
276
+ ruleId: e.id,
277
+ mode: "update",
278
+ orderFrom: e.orderFrom,
279
+ ruleGroupIds: e.ruleGroupIds,
280
+ conditions: e.conditions.map((n) => ({
281
+ attribute: n.attribute,
282
+ operator: n.operator,
283
+ values: n.values
284
+ })),
285
+ issues: [],
286
+ fieldIssues: {}
287
+ } : null;
288
+ }), Ie = h(
289
+ () => {
290
+ var e;
291
+ return (((e = i.catalogue) == null ? void 0 : e.groups) ?? []).map((l) => ({
292
+ id: l.id,
293
+ name: l.isSynthetic ? a("menu.tree_editor.labels.addon") : l.name,
294
+ items: l.products.map((t) => ({
295
+ _id: t.id,
296
+ name: t.name,
297
+ code: t.code,
298
+ codeName: t.label,
299
+ // `ItemSelector` reads combinations off `variant.variantCombinations`
300
+ // and labels them by `codeName` (mf-common ItemSelector.vue:83-107); it
301
+ // only maps them when `selectVariant` is on, so this is inert for the
302
+ // hosts that link whole products.
303
+ variant: {
304
+ variantCombinations: t.variants.map((n) => ({
305
+ combinationKey: n.combinationKey,
306
+ codeName: n.label
307
+ }))
308
+ },
309
+ customAttributes: t.customAttributes
310
+ }))
311
+ }));
312
+ }
313
+ );
314
+ function J() {
315
+ P("update:modelValue", !1);
316
+ }
317
+ function Ee() {
318
+ i.selectedProducts !== void 0 ? P(
319
+ "submitLinks",
320
+ H.value.map(
321
+ (e) => e.combinationKey ? { itemId: e._id, combinationKey: e.combinationKey } : { itemId: e._id }
322
+ )
323
+ ) : P(
324
+ "submit",
325
+ H.value.map((e) => e._id)
326
+ );
327
+ }
328
+ return (e, l) => {
329
+ const t = w("FmButton"), n = w("FmSwitch"), v = w("FmRadio"), O = w("FmRadioGroup"), T = w("FmCard"), Q = w("FmSearch"), Oe = w("FmMenuItem"), Ne = w("FmMenu"), X = w("FmSelect"), Pe = w("FmTextField"), ne = w("FmSideSheet");
330
+ return d(), x(ne, {
331
+ "close-button": !1,
332
+ "is-container": o(ze).FmForm,
333
+ "is-container-props": {
334
+ onValidationSuccess: S.value === "normal" ? Ee : Ve
335
+ },
336
+ "max-width": 760,
337
+ "model-value": i.modelValue,
338
+ "z-index": 100,
339
+ "onUpdate:modelValue": l[4] || (l[4] = (m) => P("update:modelValue", m))
340
+ }, {
341
+ "side-sheet-header": g(() => [
342
+ c(t, {
343
+ "aria-label": o(a)("menu.common.actions.back"),
344
+ class: "cursor-pointer mr-4",
345
+ "prepend-icon": "arrow_back",
346
+ variant: "tertiary",
347
+ onClick: J
348
+ }, null, 8, ["aria-label"]),
349
+ r("p", Ye, _(i.title ?? o(a)("menu.link_product.title")), 1),
350
+ Y.value ? (d(), x(n, {
351
+ key: 0,
352
+ "model-value": S.value === "rules",
353
+ label: o(a)("menu.link_product.rules.section_title"),
354
+ "onUpdate:modelValue": l[0] || (l[0] = (m) => S.value = m ? "rules" : "normal")
355
+ }, null, 8, ["model-value", "label"])) : N("", !0)
356
+ ]),
357
+ "side-sheet-footer": g(() => {
358
+ var m, k;
359
+ return [
360
+ S.value === "normal" ? (d(), p("div", Fl, [
361
+ c(t, {
362
+ label: o(a)("menu.common.actions.confirm"),
363
+ size: "lg",
364
+ type: "submit",
365
+ variant: "primary"
366
+ }, null, 8, ["label"]),
367
+ c(t, {
368
+ label: o(a)("menu.common.actions.cancel"),
369
+ size: "lg",
370
+ variant: "tertiary",
371
+ onClick: J
372
+ }, null, 8, ["label"])
373
+ ])) : (d(), p("div", Vl, [
374
+ c(t, {
375
+ label: o(a)("menu.common.actions.confirm"),
376
+ size: "lg",
377
+ variant: "primary",
378
+ disabled: ((m = f.value) == null ? void 0 : m.submit.state) !== "allowed",
379
+ loading: ((k = f.value) == null ? void 0 : k.status) === "submitting",
380
+ type: "submit"
381
+ }, null, 8, ["label", "disabled", "loading"]),
382
+ c(t, {
383
+ label: o(a)("common.cancel"),
384
+ size: "lg",
385
+ variant: "tertiary",
386
+ onClick: J
387
+ }, null, 8, ["label"])
388
+ ]))
389
+ ];
390
+ }),
391
+ default: g(() => [
392
+ S.value === "normal" ? (d(), p("div", qe, [
393
+ c(o($e), {
394
+ "auto-focus-search": !0,
395
+ "categorized-items": Ie.value,
396
+ data: K.value,
397
+ "select-variant": i.selectVariant,
398
+ "selected-items": H.value,
399
+ "show-addon": !0,
400
+ "show-variant": i.selectVariant,
401
+ "onUpdate:data": Le
402
+ }, null, 8, ["categorized-items", "data", "select-variant", "selected-items", "show-variant"])
403
+ ])) : (d(), p("div", We, [
404
+ r("p", He, _(o(a)("menu.link_product.rules.hint")), 1),
405
+ z.value.length > 0 ? (d(), p("p", Je, _(D(z.value[0] ?? null)), 1)) : N("", !0),
406
+ c(o(Ue), {
407
+ "model-value": [...G.value],
408
+ "item-key": "id",
409
+ handle: ".link-product-rule-drag-handle",
410
+ class: "flex flex-col gap-8",
411
+ "onUpdate:modelValue": Se
412
+ }, {
413
+ item: g(({ element: m, index: k }) => [
414
+ r("div", Qe, [
415
+ r("div", Xe, [
416
+ r("span", Ze, _(o(a)("menu.rule_groups.condition_view.and")), 1),
417
+ r("div", el, [
418
+ r("div", ll, [
419
+ c(t, {
420
+ class: "link-product-rule-drag-handle cursor-grab",
421
+ variant: "tertiary",
422
+ "prepend-icon": "drag_indicator",
423
+ "aria-label": o(a)("menu.common.labels.a11y_labelled_name", {
424
+ label: o(a)("menu.menu_setting.rule_groups.reorder_rule"),
425
+ name: U(k)
426
+ })
427
+ }, null, 8, ["aria-label"]),
428
+ r("p", tl, _(U(k)), 1)
429
+ ]),
430
+ r("div", al, [
431
+ c(t, {
432
+ variant: "tertiary",
433
+ "prepend-icon": "edit",
434
+ "aria-label": o(a)("menu.common.labels.a11y_labelled_name", {
435
+ label: o(a)("menu.link_product.rules.edit_rule"),
436
+ name: U(k)
437
+ }),
438
+ onClick: $((s) => B(m), ["stop"])
439
+ }, null, 8, ["aria-label", "onClick"]),
440
+ c(t, {
441
+ variant: "tertiary",
442
+ "prepend-icon": "file_copy",
443
+ "aria-label": o(a)("menu.common.labels.a11y_labelled_name", {
444
+ label: o(a)("menu.menu_setting.rule_groups.copy_rule"),
445
+ name: U(k)
446
+ }),
447
+ onClick: $((s) => xe(m.id), ["stop"])
448
+ }, null, 8, ["aria-label", "onClick"]),
449
+ c(t, {
450
+ variant: "tertiary",
451
+ "prepend-icon": "delete",
452
+ "text-color": "typo-error",
453
+ "aria-label": o(a)("menu.common.labels.a11y_labelled_name", {
454
+ label: o(a)("menu.menu_setting.rule_groups.remove_rule"),
455
+ name: U(k)
456
+ }),
457
+ onClick: $((s) => {
458
+ var u;
459
+ return (u = i.rulesSession) == null ? void 0 : u.removeRule(m.id);
460
+ }, ["stop"])
461
+ }, null, 8, ["aria-label", "onClick"])
462
+ ])
463
+ ]),
464
+ r("div", ol, [
465
+ r("div", nl, _(o(a)("menu.rule_groups.condition_view.when")), 1),
466
+ (d(!0), p(L, null, I(m.ruleGroupNames, (s, u) => (d(), p("div", {
467
+ key: `${m.id}-group-${u}`,
468
+ class: "link-product-rule-group-row flex items-center gap-8 min-w-0"
469
+ }, [
470
+ r("span", sl, _(F(u)), 1),
471
+ r("span", ul, _(o(a)("menu.rule_groups.condition_view.in_rule_group")), 1),
472
+ c(t, {
473
+ variant: "plain",
474
+ class: "min-w-0",
475
+ label: s,
476
+ title: s,
477
+ onClick: $((b) => B(m), ["stop"])
478
+ }, {
479
+ default: g(() => [
480
+ r("span", rl, _(s), 1)
481
+ ]),
482
+ _: 2
483
+ }, 1032, ["label", "title", "onClick"])
484
+ ]))), 128)),
485
+ (d(!0), p(L, null, I(m.conditions, (s, u) => (d(), p("div", {
486
+ key: `${m.id}-${u}`,
487
+ class: "flex gap-8"
488
+ }, [
489
+ r("span", null, _(te(
490
+ s,
491
+ u + m.ruleGroupNames.length
492
+ )), 1)
493
+ ]))), 128)),
494
+ r("div", il, [
495
+ r("span", dl, _(o(a)("menu.rule_groups.condition_view.then")), 1),
496
+ r("span", null, _(o(a)("menu.link_product.rules.order_from_summary", {
497
+ label: o(a)("menu.link_product.rules.order_from"),
498
+ value: Ce(m.orderFrom)
499
+ })), 1)
500
+ ])
501
+ ])
502
+ ]),
503
+ k < G.value.length - 1 ? (d(), p("div", cl, _(o(a)("menu.link_product.rules.or")), 1)) : N("", !0)
504
+ ])
505
+ ]),
506
+ _: 1
507
+ }, 8, ["model-value"]),
508
+ G.value.length === 0 ? (d(), x(o(De), {
509
+ key: 1,
510
+ title: o(a)("menu.rule_groups.condition_view.empty_data.no_rules_added"),
511
+ subtitle: o(a)("menu.rule_groups.condition_view.empty_data.subtitle"),
512
+ action: {
513
+ text: o(a)("menu.link_product.rules.add_rule"),
514
+ callback: () => B()
515
+ }
516
+ }, null, 8, ["title", "subtitle", "action"])) : (d(), x(t, {
517
+ key: 2,
518
+ variant: "primary",
519
+ "prepend-icon": "add",
520
+ label: o(a)("menu.link_product.rules.add_rule"),
521
+ onClick: l[1] || (l[1] = (m) => B())
522
+ }, null, 8, ["label"]))
523
+ ])),
524
+ le.value ? (d(), x(ne, {
525
+ key: 2,
526
+ "model-value": le.value,
527
+ "max-width": 760,
528
+ "z-index": 101,
529
+ "close-button": !1,
530
+ "onUpdate:modelValue": A
531
+ }, {
532
+ "side-sheet-header": g(() => {
533
+ var m;
534
+ return [
535
+ r("div", ml, [
536
+ c(t, {
537
+ variant: "tertiary",
538
+ "prepend-icon": "arrow_back",
539
+ "aria-label": o(a)("menu.common.actions.back"),
540
+ onClick: A
541
+ }, null, 8, ["aria-label"]),
542
+ r("p", pl, _(o(a)(
543
+ ((m = j.value) == null ? void 0 : m.mode) === "create" ? "menu.link_product.rules.add_rule" : "menu.link_product.rules.edit_rule"
544
+ )), 1)
545
+ ])
546
+ ];
547
+ }),
548
+ "side-sheet-footer": g(() => [
549
+ r("div", Rl, [
550
+ c(t, {
551
+ label: o(a)("common.cancel"),
552
+ variant: "secondary",
553
+ onClick: A
554
+ }, null, 8, ["label"]),
555
+ c(t, {
556
+ label: o(a)("common.save"),
557
+ variant: "primary",
558
+ onClick: ye
559
+ }, null, 8, ["label"])
560
+ ])
561
+ ]),
562
+ default: g(() => {
563
+ var m, k;
564
+ return [
565
+ r("div", _l, [
566
+ c(O, {
567
+ "model-value": ((m = j.value) == null ? void 0 : m.orderFrom) ?? "ALL",
568
+ label: o(a)("menu.link_product.rules.availability"),
569
+ "onUpdate:modelValue": l[2] || (l[2] = (s) => {
570
+ var u;
571
+ return (u = i.rulesSession) == null ? void 0 : u.setRuleEditorOrderFrom(
572
+ s
573
+ );
574
+ })
575
+ }, {
576
+ default: g(() => [
577
+ c(v, {
578
+ label: o(a)("menu.link_product.rules.all"),
579
+ value: "ALL"
580
+ }, null, 8, ["label"]),
581
+ c(v, {
582
+ label: o(a)("menu.link_product.rules.pos_only"),
583
+ value: "POS_ONLY"
584
+ }, null, 8, ["label"]),
585
+ c(v, {
586
+ label: o(a)("menu.link_product.rules.none"),
587
+ value: "NONE"
588
+ }, null, 8, ["label"])
589
+ ]),
590
+ _: 1
591
+ }, 8, ["model-value", "label"]),
592
+ l[5] || (l[5] = r("div", { class: "mt-24 h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)),
593
+ r("div", vl, [
594
+ r("p", bl, _(o(a)("menu.link_product.rules.use_rule_group")), 1),
595
+ (d(!0), p(L, null, I(ke.value, (s) => (d(), x(T, {
596
+ key: s.id,
597
+ variant: "outlined",
598
+ class: "link-product-attached-rule-group p-24 flex flex-col gap-16"
599
+ }, {
600
+ default: g(() => [
601
+ r("div", fl, [
602
+ r("p", yl, _(s.name), 1),
603
+ c(t, {
604
+ variant: "tertiary",
605
+ "prepend-icon": R.value.has(s.id) ? "expand_less" : "expand_more",
606
+ "aria-expanded": R.value.has(s.id),
607
+ "aria-label": o(a)("menu.common.labels.a11y_labelled_name", {
608
+ label: o(a)(
609
+ R.value.has(s.id) ? "menu.tree_editor.actions.collapse_row" : "menu.tree_editor.actions.expand_row"
610
+ ),
611
+ name: s.name
612
+ }),
613
+ onClick: $((u) => he(s.id), ["stop", "prevent"])
614
+ }, null, 8, ["prepend-icon", "aria-expanded", "aria-label", "onClick"])
615
+ ]),
616
+ R.value.has(s.id) ? (d(), p("div", gl, [
617
+ (d(!0), p(L, null, I(s.rules, (u, b) => (d(), p("div", {
618
+ key: b,
619
+ class: "flex flex-col gap-8"
620
+ }, [
621
+ (d(!0), p(L, null, I(u.conditions, (y, se) => (d(), p("span", { key: se }, _(te(y, se)), 1))), 128)),
622
+ b < s.rules.length - 1 ? (d(), p("p", kl, _(o(a)("menu.link_product.rules.or")), 1)) : N("", !0)
623
+ ]))), 128))
624
+ ])) : N("", !0)
625
+ ]),
626
+ _: 2
627
+ }, 1024))), 128)),
628
+ c(Ne, { "close-on-click": !1 }, {
629
+ "menu-button": g(() => [
630
+ c(t, {
631
+ variant: "plain",
632
+ "prepend-icon": "add",
633
+ class: "self-start",
634
+ label: o(a)("menu.link_product.rules.add_rule_group")
635
+ }, null, 8, ["label"])
636
+ ]),
637
+ default: g(() => [
638
+ c(Q, {
639
+ "model-value": q.value,
640
+ "onUpdate:modelValue": l[3] || (l[3] = (s) => q.value = s),
641
+ class: "w-[200px] px-8",
642
+ placeholder: o(a)("menu.link_product.rules.filter_result")
643
+ }, null, 8, ["model-value", "placeholder"]),
644
+ (d(!0), p(L, null, I(ge.value, (s) => (d(), x(Oe, {
645
+ key: s.id,
646
+ label: s.name,
647
+ "has-checkbox": "",
648
+ "model-value": W.value.includes(s.id),
649
+ onClick: (u) => we(s.id)
650
+ }, null, 8, ["label", "model-value", "onClick"]))), 128))
651
+ ]),
652
+ _: 1
653
+ })
654
+ ]),
655
+ r("div", hl, [
656
+ r("p", wl, _(o(a)("menu.rule_groups.condition_view.condition")), 1),
657
+ (d(!0), p(L, null, I(((k = j.value) == null ? void 0 : k.conditions) ?? [], (s, u) => (d(), p("div", {
658
+ key: u,
659
+ class: "flex justify-between gap-8"
660
+ }, [
661
+ r("div", Sl, [
662
+ c(X, {
663
+ class: "flex w-full",
664
+ "menu-z-index": 102,
665
+ "model-value": s.attribute,
666
+ items: pe(),
667
+ placeholder: o(a)("menu.rule_groups.condition_view.select_item"),
668
+ "aria-label": o(a)("menu.common.labels.a11y_labelled_name", {
669
+ label: o(a)(
670
+ "menu.menu_setting.rule_groups.condition.attribute"
671
+ ),
672
+ name: F(u)
673
+ }),
674
+ "onUpdate:modelValue": (b) => {
675
+ var y;
676
+ (y = i.rulesSession) == null || y.setRuleEditorCondition(u, {
677
+ attribute: b,
678
+ values: []
679
+ });
680
+ }
681
+ }, null, 8, ["model-value", "items", "placeholder", "aria-label", "onUpdate:modelValue"]),
682
+ c(X, {
683
+ class: "flex w-full",
684
+ "menu-z-index": 102,
685
+ "model-value": s.operator,
686
+ items: me.value,
687
+ placeholder: o(a)("menu.rule_groups.condition_view.select_item"),
688
+ "aria-label": o(a)("menu.common.labels.a11y_labelled_name", {
689
+ label: o(a)(
690
+ "menu.menu_setting.rule_groups.condition.operator"
691
+ ),
692
+ name: F(u)
693
+ }),
694
+ "error-messages": E(u, "operator") ? [D(E(u, "operator"))] : [],
695
+ "onUpdate:modelValue": (b) => {
696
+ var y;
697
+ return (y = i.rulesSession) == null ? void 0 : y.setRuleEditorCondition(u, {
698
+ operator: b
699
+ });
700
+ }
701
+ }, null, 8, ["model-value", "items", "placeholder", "aria-label", "error-messages", "onUpdate:modelValue"]),
702
+ o(Me)(s.operator) === "text" ? Ae((d(), p("div", xl, [
703
+ c(Pe, {
704
+ "model-value": String(s.values[0] ?? ""),
705
+ placeholder: o(a)("menu.menu_setting.rule_groups.condition.value"),
706
+ "error-messages": E(u, "values") ? [D(E(u, "values"))] : [],
707
+ "onUpdate:modelValue": (b) => {
708
+ var y;
709
+ return (y = i.rulesSession) == null ? void 0 : y.setRuleEditorCondition(u, {
710
+ values: b === "" || b == null ? [] : [String(b)]
711
+ });
712
+ }
713
+ }, null, 8, ["model-value", "placeholder", "error-messages", "onUpdate:modelValue"])
714
+ ])), [
715
+ [
716
+ ce,
717
+ o(a)("menu.common.labels.a11y_labelled_name", {
718
+ label: o(a)("menu.menu_setting.rule_groups.condition.value"),
719
+ name: F(u)
720
+ })
721
+ ]
722
+ ]) : (d(), x(X, {
723
+ key: 1,
724
+ class: "flex w-full",
725
+ "menu-z-index": 102,
726
+ "model-value": s.values.map(o(re)),
727
+ items: _e(s),
728
+ multiselect: "",
729
+ "hide-chips": "",
730
+ placeholder: o(a)("menu.rule_groups.condition_view.select_item"),
731
+ "aria-label": o(a)("menu.common.labels.a11y_labelled_name", {
732
+ label: o(a)("menu.menu_setting.rule_groups.condition.value"),
733
+ name: F(u)
734
+ }),
735
+ "error-messages": E(u, "values") ? [D(E(u, "values"))] : [],
736
+ "onUpdate:modelValue": (b) => {
737
+ var y;
738
+ return (y = i.rulesSession) == null ? void 0 : y.setRuleEditorCondition(u, {
739
+ values: b.map(o(Be))
740
+ });
741
+ }
742
+ }, {
743
+ default: g(() => [
744
+ r("div", Cl, _(ve(s)), 1)
745
+ ]),
746
+ _: 2
747
+ }, 1032, ["model-value", "items", "placeholder", "aria-label", "error-messages", "onUpdate:modelValue"]))
748
+ ]),
749
+ c(t, {
750
+ variant: "tertiary",
751
+ "prepend-icon": "close",
752
+ "aria-label": o(a)("menu.common.labels.a11y_labelled_name", {
753
+ label: o(a)("menu.menu_setting.rule_groups.remove_condition"),
754
+ name: F(u)
755
+ }),
756
+ onClick: (b) => Re(u)
757
+ }, null, 8, ["aria-label", "onClick"])
758
+ ]))), 128)),
759
+ c(t, {
760
+ variant: "plain",
761
+ "prepend-icon": "add",
762
+ label: o(a)("menu.rule_groups.condition_view.add_condition"),
763
+ onClick: Fe
764
+ }, null, 8, ["label"])
765
+ ])
766
+ ])
767
+ ];
768
+ }),
769
+ _: 1
770
+ }, 8, ["model-value"])) : N("", !0)
771
+ ]),
772
+ _: 1
773
+ }, 8, ["is-container", "is-container-props", "model-value"]);
774
+ };
775
+ }
776
+ });
777
+ export {
778
+ Ul as A,
779
+ jl as O,
780
+ $l as _,
781
+ Te as a
782
+ };