@feedmepos/mf-menu 0.31.33-beta.1 → 0.31.33-beta.6

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 (89) hide show
  1. package/dist/{App-B4rnpCXN.js → App-Dt6RQiUh.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-LtwWMoPW.js → ApplyProduct.vue_vue_type_script_setup_true_lang-B_SQpWg7.js} +2 -2
  3. package/dist/{Catalog-Cd7J8de0.js → Catalog-CFx7t_Nu.js} +79 -79
  4. package/dist/{Category-p8UUDEiv.js → Category-CPMx86rY.js} +23 -19
  5. package/dist/{Category-D3WDm9Fe.js → Category-OjK-v--G.js} +5 -5
  6. package/dist/{CookingGuide-hFtxmtGj.js → CookingGuide-ANnXKBjc.js} +3 -3
  7. package/dist/CustomAttributeChip.vue_vue_type_script_setup_true_lang-D-1OzZ-i.js +113 -0
  8. package/dist/{Group-Bv0dyi8v.js → Group--DJjkGab.js} +1 -1
  9. package/dist/{Group-BTrqZgFd.js → Group-K4925_bP.js} +3 -3
  10. package/dist/Group.vue_vue_type_script_setup_true_lang-36O78xv0.js +684 -0
  11. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BIX-gPUO.js +372 -0
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CxPaVLVu.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-C-z1m3jh.js} +13987 -13378
  13. package/dist/{Ingredient-BCostN4Y.js → Ingredient-G4Txx6_0.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-MAqpI7ZD.js → InventoryBinding.vue_vue_type_script_setup_true_lang-HgHBlflo.js} +2 -2
  15. package/dist/{LinkProductSideSheet-abzVzmo3.js → LinkProductSideSheet-CWNarCEs.js} +1 -1
  16. package/dist/{MenuSetting-TfAo82-E.js → MenuSetting-Cx-EHG-6.js} +4 -4
  17. package/dist/{PrintRoute-B43rP5A9.js → PrintRoute-IxHGvGzF.js} +3 -3
  18. package/dist/{Product-C7cYyDHH.js → Product-D1gqn5J6.js} +1 -1
  19. package/dist/Product.vue_vue_type_script_setup_true_lang-BCQd-ks4.js +1641 -0
  20. package/dist/{ProductInternalTools-CkswVuAF.js → ProductInternalTools-GJ2OE5gU.js} +5 -5
  21. package/dist/Products-DJqgSe-Y.js +270 -0
  22. package/dist/{Publish-DIKqaH2f.js → Publish-C86rd413.js} +3 -3
  23. package/dist/{Recipe-_ApT00c_.js → Recipe-BbQKou9p.js} +4 -4
  24. package/dist/{Scheduler-DWY1kKHO.js → Scheduler-DUeTkyGQ.js} +3 -3
  25. package/dist/{ServingSequence-Z1S9zOTO.js → ServingSequence-BROo5rC_.js} +3 -3
  26. package/dist/Setting-D-ueTlwO.js +259 -0
  27. package/dist/{Subcategory-Lqq6XHz2.js → Subcategory-DVewA8HX.js} +4 -4
  28. package/dist/{Takeaway-DiGzrarg.js → Takeaway-B4lDGQDh.js} +4 -4
  29. package/dist/{Takeaway-DGvM9SBP.js → Takeaway-DyPjHuCl.js} +1 -1
  30. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-BfWy217t.js → Takeaway.vue_vue_type_script_setup_true_lang-BTDlzYuX.js} +6 -6
  31. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B2wC_Mf0.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B5BAKDRP.js} +642 -642
  32. package/dist/{Unit-D11rRFAf.js → Unit-CVF0dom4.js} +2 -2
  33. package/dist/{Variant-LaKYPxDe.js → Variant-DmccAgFU.js} +3 -3
  34. package/dist/_id_-CWtK62Fy.js +178 -0
  35. package/dist/{app-C5UXrJGj.js → app-CV_q8OdE.js} +75 -75
  36. package/dist/{app-Br9mC24D.js → app-ClinzawZ.js} +1 -1
  37. package/dist/app-DvG3mOom.js +8024 -0
  38. package/dist/app.js +1 -1
  39. package/dist/apps/mf-menu/src/app.d.ts +60 -1
  40. package/dist/apps/mf-menu/src/components/feature/AttributesSelector.vue.d.ts +2 -0
  41. package/dist/apps/mf-menu/src/components/feature/LinkProduct/LinkProductUnifiedSideSheet.vue.d.ts +12 -0
  42. package/dist/apps/mf-menu/src/components/feature/PriceTier/LinkPriceTierSection.vue.d.ts +24 -0
  43. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierRuleEditor.vue.d.ts +30 -0
  44. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +77 -0
  45. package/dist/apps/mf-menu/src/composable/customAttributes.d.ts +88 -0
  46. package/dist/apps/mf-menu/src/helper/{menuImport.d.ts → import-export.d.ts} +204 -3
  47. package/dist/apps/mf-menu/src/helper/menu.d.ts +77 -0
  48. package/dist/apps/mf-menu/src/helper/setting/catalogSetting.d.ts +11 -2
  49. package/dist/apps/mf-menu/src/manager/menu/item.d.ts +77 -0
  50. package/dist/apps/mf-menu/src/stores/manager/catalog.d.ts +2 -0
  51. package/dist/apps/mf-menu/src/stores/menu.d.ts +79 -0
  52. package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +82 -0
  53. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  54. package/dist/assets/linked-status-fZD691Js.js +24 -0
  55. package/dist/assets/override-menu-Cjy1BJuz.js +24 -0
  56. package/dist/assets/validate-menu-uwysUwDP.js +24 -0
  57. package/dist/{catalog-BDyG_i9q.js → catalog-Wx88K6iI.js} +1 -1
  58. package/dist/catalogSetting-DTEHDSAd.js +71 -0
  59. package/dist/{category-Bi6gpIYU.js → category-BRTw76Vf.js} +1 -1
  60. package/dist/{currency-DDseyYg1.js → currency-562bPc2l.js} +1 -1
  61. package/dist/customAttributes-CXzd5ud1.js +33 -0
  62. package/dist/{dayjs.min-DoQgN0KD.js → dayjs.min-Cnfm8bQm.js} +1 -1
  63. package/dist/{index-DxrEwDTr.js → index-4hf9vONw.js} +2 -2
  64. package/dist/{index-C-zLHAG1.js → index-Crs_eZ0i.js} +28 -28
  65. package/dist/{index-DTUmry92.js → index-DJXrJdeQ.js} +3 -3
  66. package/dist/{item-DqXzPUy9.js → item-CuIxc9FT.js} +377 -377
  67. package/dist/{jszip.min-iAC5WNVU.js → jszip.min-C9xLIvo4.js} +245 -245
  68. package/dist/menu-ILWxqJQe.js +133263 -0
  69. package/dist/{menu-D6df9rcz.js → menu-Mkzv9c8C.js} +4 -4
  70. package/dist/{priceTier-C56BYecC.js → priceTier-D4joq_kN.js} +1 -1
  71. package/dist/{scheduler-DCSpt65t.js → scheduler-DuxWoNVb.js} +3 -3
  72. package/dist/{subcategory-CydaPy_X.js → subcategory-CLLMagXY.js} +43 -43
  73. package/dist/{toExcel-Bil8CwJs.js → toExcel-hGfpS_Uo.js} +2 -2
  74. package/dist/{unit-8DyuBx-X.js → unit-9fycj1fu.js} +1 -1
  75. package/package.json +4 -4
  76. package/dist/CustomAttributeChip.vue_vue_type_script_setup_true_lang-Cf17Iy5i.js +0 -7949
  77. package/dist/Group.vue_vue_type_script_setup_true_lang-vk1J9IxK.js +0 -698
  78. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B1wrLnf6.js +0 -206
  79. package/dist/Product.vue_vue_type_script_setup_true_lang-BOq8wMzq.js +0 -1560
  80. package/dist/Products-C7BtAjhB.js +0 -659
  81. package/dist/Setting-Bfuf26Gc.js +0 -258
  82. package/dist/_id_-Q_Tyhr4U.js +0 -200
  83. package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +0 -123
  84. package/dist/apps/mf-menu/src/helper/menuExport.d.ts +0 -32
  85. package/dist/assets/linked-status-BhGrXd73.js +0 -24
  86. package/dist/assets/override-menu-CUNDHOWA.js +0 -24
  87. package/dist/assets/validate-menu-BqOizHsX.js +0 -24
  88. package/dist/catalogSetting-C33p_dck.js +0 -65
  89. package/dist/menu-Cir-22ei.js +0 -108039
@@ -1,31 +1,31 @@
1
1
  import { shallowRef as Yt, ref as q, computed as S, nextTick as st, watch as ye, getCurrentInstance as In, onMounted as $e, defineComponent as ie, resolveComponent as H, createElementBlock as J, openBlock as V, createBlock as Q, normalizeClass as fe, createElementVNode as G, createVNode as C, unref as a, withCtx as Y, toDisplayString as ge, mergeModels as zt, useModel as jt, createCommentVNode as X, resolveDirective as Wt, withDirectives as ut, createTextVNode as kn, renderSlot as Me, h as ve, Fragment as xe, renderList as Ue, vShow as Ht, withModifiers as ze, createSlots as En, onBeforeUnmount as Ft, watchEffect as Tn, onUnmounted as xn, normalizeStyle as at, mergeProps as Fn, normalizeProps as Sn, guardReactiveProps as On, Teleport as Dn, Transition as Vn, withKeys as Pn } from "vue";
2
- import { g as Mn, o as $n, f as Un, a as Rn, n as qt, _ as Xt, I as An, S as Nn, b as St, C as Ln, R as Ge, c as Jt, d as Ct, e as Qt, h as Gn, m as Kn, F as Bn, M as Zt, j as Yn, r as zn, k as en, l as Ut, p as tn, q as jn, P as Wn, s as Hn, t as nn, u as qn, T as Ne } from "./item-DqXzPUy9.js";
3
- import { _ as Xn, T as Jn } from "./app-C5UXrJGj.js";
4
- import { A as be, J as pe, G as Z, D as qe, K as Qn, M as Zn, N as eo, O as dt, P as to, B as Re, Q as no, H as me, R as oo, T as Ot, I as Ce, U as mt, V as ro, W as ao, X as lo, Y as pt, Z as Rt, $ as io, u as on, a0 as so } from "./menu-Cir-22ei.js";
2
+ import { g as Mn, o as $n, f as Un, a as Rn, n as qt, _ as Xt, I as An, S as Nn, b as St, C as Ln, R as Ge, c as Jt, d as Ct, e as Qt, h as Gn, m as Kn, F as Bn, M as Zt, j as Yn, r as zn, k as en, l as Ut, p as tn, q as jn, P as Wn, s as Hn, t as nn, u as qn, T as Ne } from "./item-CuIxc9FT.js";
3
+ import { _ as Xn, T as Jn } from "./app-CV_q8OdE.js";
4
+ import { A as be, J as pe, G as Z, D as qe, K as Qn, M as Zn, N as eo, O as dt, P as to, B as Re, Q as no, H as me, R as oo, T as Ot, I as Ce, U as mt, V as ro, W as ao, X as lo, Y as pt, Z as Rt, $ as io, u as on, a0 as so } from "./menu-ILWxqJQe.js";
5
5
  import { useI18n as ce, useCoreStore as Ze, CustomAttributesForm as rn } from "@feedmepos/mf-common";
6
6
  import { useDialog as Pe, useDialogChild as Dt, useSnackbar as Fe, FmButtonColorThemeVariant as Te, components as we, FmButtonVariant as Ke, useBreakpoints as uo } from "@feedmepos/ui-library";
7
7
  import { u as Vt } from "./discardConfirm-BHni0LNu.js";
8
8
  import { defineStore as co } from "pinia";
9
9
  import { _ as Se, a as mo } from "./FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js";
10
- import { u as se, g as an, m as po } from "./subcategory-CydaPy_X.js";
11
- import { s as It, _ as fo } from "./index-C-zLHAG1.js";
10
+ import { u as se, g as an, m as po } from "./subcategory-CLLMagXY.js";
11
+ import { s as It, _ as fo } from "./index-Crs_eZ0i.js";
12
12
  import { _ as Ve } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
13
- import { _ as At } from "./category-Bi6gpIYU.js";
13
+ import { _ as At } from "./category-BRTw76Vf.js";
14
14
  import { _ as go } from "./Thumbnail.vue_vue_type_script_setup_true_lang-DzQ8_6Bi.js";
15
- import { _ as Xe, L as kt } from "./LinkProductSideSheet-abzVzmo3.js";
15
+ import { _ as Xe, L as kt } from "./LinkProductSideSheet-CWNarCEs.js";
16
16
  import { _ as ln } from "./tooltip-B5BiPMx9.js";
17
- import { _ as je, T as vo, l as _o } from "./index-DTUmry92.js";
17
+ import { _ as je, T as vo, l as _o } from "./index-DJXrJdeQ.js";
18
18
  import { u as bo } from "./search-BAPEUu1R.js";
19
19
  import { c as Pt } from "./check-C9mY6LiX.js";
20
- import { f as Qe } from "./currency-DDseyYg1.js";
20
+ import { f as Qe } from "./currency-562bPc2l.js";
21
21
  import { c as yo } from "./string-DpfFixWH.js";
22
22
  import { useInventoryStore as ho, InventoryBindingSummary as wo } from "@feedmepos/mf-inventory-portal";
23
- import { u as Co } from "./priceTier-C56BYecC.js";
23
+ import { u as Co } from "./priceTier-D4joq_kN.js";
24
24
  import { d as Mt } from "./vuedraggable-CK8z7qA8.js";
25
- import { _ as Io } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-LtwWMoPW.js";
25
+ import { _ as Io } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-B_SQpWg7.js";
26
26
  /* empty css */
27
27
  import { i as ko, t as $t, w as Eo, a as sn, b as un, n as To, c as xo, u as Fo, r as So } from "./index-Ce4v8o7D.js";
28
- import { C as Et } from "./catalog-BDyG_i9q.js";
28
+ import { C as Et } from "./catalog-Wx88K6iI.js";
29
29
  import { c as lt } from "./object-DVUNCr7w.js";
30
30
  import { _ as Oo } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
31
31
  import { _ as Nt } from "./MenuSelector.vue_vue_type_script_setup_true_lang-K6Z0QJBl.js";
@@ -36,20 +36,20 @@ function Le(t) {
36
36
  }
37
37
  const We = ko ? window : void 0;
38
38
  function Lt(...t) {
39
- let o, e, n, f;
40
- if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([e, n, f] = t, o = We) : [o, e, n, f] = t, !o)
39
+ let o, e, n, p;
40
+ if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([e, n, p] = t, o = We) : [o, e, n, p] = t, !o)
41
41
  return To;
42
42
  Array.isArray(e) || (e = [e]), Array.isArray(n) || (n = [n]);
43
43
  const s = [], m = () => {
44
- s.forEach((p) => p()), s.length = 0;
45
- }, u = (p, v, _, r) => (p.addEventListener(v, _, r), () => p.removeEventListener(v, _, r)), g = ye(
46
- () => [Le(o), $t(f)],
47
- ([p, v]) => {
48
- if (m(), !p)
44
+ s.forEach((f) => f()), s.length = 0;
45
+ }, u = (f, v, _, r) => (f.addEventListener(v, _, r), () => f.removeEventListener(v, _, r)), g = ye(
46
+ () => [Le(o), $t(p)],
47
+ ([f, v]) => {
48
+ if (m(), !f)
49
49
  return;
50
50
  const _ = xo(v) ? { ...v } : v;
51
51
  s.push(
52
- ...e.flatMap((r) => n.map((E) => u(p, r, E, _)))
52
+ ...e.flatMap((r) => n.map((T) => u(f, r, T, _)))
53
53
  );
54
54
  },
55
55
  { immediate: !0, flush: "post" }
@@ -113,21 +113,21 @@ const Ro = {
113
113
  }
114
114
  }, Gt = "vueuse-storage";
115
115
  function Ao(t, o, e, n = {}) {
116
- var f;
116
+ var p;
117
117
  const {
118
118
  flush: s = "pre",
119
119
  deep: m = !0,
120
120
  listenToStorageChanges: u = !0,
121
121
  writeDefaults: g = !0,
122
122
  mergeDefaults: h = !1,
123
- shallow: p,
123
+ shallow: f,
124
124
  window: v = We,
125
125
  eventFilter: _,
126
126
  onError: r = (l) => {
127
127
  console.error(l);
128
128
  },
129
- initOnMounted: E
130
- } = n, k = (p ? Yt : q)(typeof o == "function" ? o() : o);
129
+ initOnMounted: T
130
+ } = n, k = (f ? Yt : q)(typeof o == "function" ? o() : o);
131
131
  if (!e)
132
132
  try {
133
133
  e = $o("getDefaultStorage", () => {
@@ -139,14 +139,14 @@ function Ao(t, o, e, n = {}) {
139
139
  }
140
140
  if (!e)
141
141
  return k;
142
- const F = $t(o), w = Uo(F), c = (f = n.serializer) != null ? f : Ro[w], { pause: x, resume: U } = Eo(
142
+ const F = $t(o), w = Uo(F), c = (p = n.serializer) != null ? p : Ro[w], { pause: E, resume: U } = Eo(
143
143
  k,
144
144
  () => P(k.value),
145
145
  { flush: s, deep: m, eventFilter: _ }
146
146
  );
147
147
  v && u && sn(() => {
148
- Lt(v, "storage", I), Lt(v, Gt, d), E && I();
149
- }), E || I();
148
+ Lt(v, "storage", I), Lt(v, Gt, d), T && I();
149
+ }), T || I();
150
150
  function N(l, i) {
151
151
  v && v.dispatchEvent(new CustomEvent(Gt, {
152
152
  detail: {
@@ -186,7 +186,7 @@ function Ao(t, o, e, n = {}) {
186
186
  return;
187
187
  }
188
188
  if (!(l && l.key !== t)) {
189
- x();
189
+ E();
190
190
  try {
191
191
  (l == null ? void 0 : l.newValue) !== c.write(k.value) && (k.value = L(l));
192
192
  } catch (i) {
@@ -203,7 +203,7 @@ function Ao(t, o, e, n = {}) {
203
203
  return k;
204
204
  }
205
205
  function No(t, o, e = {}) {
206
- const { window: n = We, ...f } = e;
206
+ const { window: n = We, ...p } = e;
207
207
  let s;
208
208
  const m = Vo(() => n && "ResizeObserver" in n), u = () => {
209
209
  s && (s.disconnect(), s = void 0);
@@ -213,35 +213,35 @@ function No(t, o, e = {}) {
213
213
  if (u(), m.value && n) {
214
214
  s = new ResizeObserver(o);
215
215
  for (const _ of v)
216
- _ && s.observe(_, f);
216
+ _ && s.observe(_, p);
217
217
  }
218
218
  },
219
219
  { immediate: !0, flush: "post" }
220
- ), p = () => {
220
+ ), f = () => {
221
221
  u(), h();
222
222
  };
223
- return un(p), {
223
+ return un(f), {
224
224
  isSupported: m,
225
- stop: p
225
+ stop: f
226
226
  };
227
227
  }
228
228
  function Lo(t, o = { width: 0, height: 0 }, e = {}) {
229
- const { window: n = We, box: f = "content-box" } = e, s = S(() => {
229
+ const { window: n = We, box: p = "content-box" } = e, s = S(() => {
230
230
  var v, _;
231
231
  return (_ = (v = Le(t)) == null ? void 0 : v.namespaceURI) == null ? void 0 : _.includes("svg");
232
232
  }), m = q(o.width), u = q(o.height), { stop: g } = No(
233
233
  t,
234
234
  ([v]) => {
235
- const _ = f === "border-box" ? v.borderBoxSize : f === "content-box" ? v.contentBoxSize : v.devicePixelContentBoxSize;
235
+ const _ = p === "border-box" ? v.borderBoxSize : p === "content-box" ? v.contentBoxSize : v.devicePixelContentBoxSize;
236
236
  if (n && s.value) {
237
237
  const r = Le(t);
238
238
  if (r) {
239
- const E = r.getBoundingClientRect();
240
- m.value = E.width, u.value = E.height;
239
+ const T = r.getBoundingClientRect();
240
+ m.value = T.width, u.value = T.height;
241
241
  }
242
242
  } else if (_) {
243
243
  const r = Array.isArray(_) ? _ : [_];
244
- m.value = r.reduce((E, { inlineSize: k }) => E + k, 0), u.value = r.reduce((E, { blockSize: k }) => E + k, 0);
244
+ m.value = r.reduce((T, { inlineSize: k }) => T + k, 0), u.value = r.reduce((T, { blockSize: k }) => T + k, 0);
245
245
  } else
246
246
  m.value = v.contentRect.width, u.value = v.contentRect.height;
247
247
  },
@@ -257,13 +257,13 @@ function Lo(t, o = { width: 0, height: 0 }, e = {}) {
257
257
  m.value = v ? o.width : 0, u.value = v ? o.height : 0;
258
258
  }
259
259
  );
260
- function p() {
260
+ function f() {
261
261
  g(), h();
262
262
  }
263
263
  return {
264
264
  width: m,
265
265
  height: u,
266
- stop: p
266
+ stop: f
267
267
  };
268
268
  }
269
269
  function Go(t, o, e = {}) {
@@ -271,10 +271,10 @@ function Go(t, o, e = {}) {
271
271
  return Ao(t, o, n == null ? void 0 : n.localStorage, e);
272
272
  }
273
273
  function Ko(t, o) {
274
- const { containerStyle: e, wrapperProps: n, scrollTo: f, calculateRange: s, currentList: m, containerRef: u } = "itemHeight" in o ? zo(o, t) : Yo(o, t);
274
+ const { containerStyle: e, wrapperProps: n, scrollTo: p, calculateRange: s, currentList: m, containerRef: u } = "itemHeight" in o ? zo(o, t) : Yo(o, t);
275
275
  return {
276
276
  list: m,
277
- scrollTo: f,
277
+ scrollTo: p,
278
278
  containerProps: {
279
279
  ref: u,
280
280
  onScroll: () => {
@@ -286,55 +286,55 @@ function Ko(t, o) {
286
286
  };
287
287
  }
288
288
  function dn(t) {
289
- const o = q(null), e = Lo(o), n = q([]), f = Yt(t);
290
- return { state: q({ start: 0, end: 10 }), source: f, currentList: n, size: e, containerRef: o };
289
+ const o = q(null), e = Lo(o), n = q([]), p = Yt(t);
290
+ return { state: q({ start: 0, end: 10 }), source: p, currentList: n, size: e, containerRef: o };
291
291
  }
292
292
  function cn(t, o, e) {
293
293
  return (n) => {
294
294
  if (typeof e == "number")
295
295
  return Math.ceil(n / e);
296
- const { start: f = 0 } = t.value;
296
+ const { start: p = 0 } = t.value;
297
297
  let s = 0, m = 0;
298
- for (let u = f; u < o.value.length; u++) {
298
+ for (let u = p; u < o.value.length; u++) {
299
299
  const g = e(u);
300
300
  if (s += g, m = u, s > n)
301
301
  break;
302
302
  }
303
- return m - f;
303
+ return m - p;
304
304
  };
305
305
  }
306
306
  function mn(t, o) {
307
307
  return (e) => {
308
308
  if (typeof o == "number")
309
309
  return Math.floor(e / o) + 1;
310
- let n = 0, f = 0;
310
+ let n = 0, p = 0;
311
311
  for (let s = 0; s < t.value.length; s++) {
312
312
  const m = o(s);
313
313
  if (n += m, n >= e) {
314
- f = s;
314
+ p = s;
315
315
  break;
316
316
  }
317
317
  }
318
- return f + 1;
318
+ return p + 1;
319
319
  };
320
320
  }
321
- function pn(t, o, e, n, { containerRef: f, state: s, currentList: m, source: u }) {
321
+ function pn(t, o, e, n, { containerRef: p, state: s, currentList: m, source: u }) {
322
322
  return () => {
323
- const g = f.value;
323
+ const g = p.value;
324
324
  if (g) {
325
- const h = e(t === "vertical" ? g.scrollTop : g.scrollLeft), p = n(t === "vertical" ? g.clientHeight : g.clientWidth), v = h - o, _ = h + p + o;
325
+ const h = e(t === "vertical" ? g.scrollTop : g.scrollLeft), f = n(t === "vertical" ? g.clientHeight : g.clientWidth), v = h - o, _ = h + f + o;
326
326
  s.value = {
327
327
  start: v < 0 ? 0 : v,
328
328
  end: _ > u.value.length ? u.value.length : _
329
- }, m.value = u.value.slice(s.value.start, s.value.end).map((r, E) => ({
329
+ }, m.value = u.value.slice(s.value.start, s.value.end).map((r, T) => ({
330
330
  data: r,
331
- index: E + s.value.start
331
+ index: T + s.value.start
332
332
  }));
333
333
  }
334
334
  };
335
335
  }
336
336
  function fn(t, o) {
337
- return (e) => typeof t == "number" ? e * t : o.value.slice(0, e).reduce((f, s, m) => f + t(m), 0);
337
+ return (e) => typeof t == "number" ? e * t : o.value.slice(0, e).reduce((p, s, m) => p + t(m), 0);
338
338
  }
339
339
  function gn(t, o, e, n) {
340
340
  ye([t.width, t.height, o, e], () => {
@@ -342,21 +342,21 @@ function gn(t, o, e, n) {
342
342
  });
343
343
  }
344
344
  function vn(t, o) {
345
- return S(() => typeof t == "number" ? o.value.length * t : o.value.reduce((e, n, f) => e + t(f), 0));
345
+ return S(() => typeof t == "number" ? o.value.length * t : o.value.reduce((e, n, p) => e + t(p), 0));
346
346
  }
347
347
  const Bo = {
348
348
  horizontal: "scrollLeft",
349
349
  vertical: "scrollTop"
350
350
  };
351
351
  function _n(t, o, e, n) {
352
- return (f) => {
353
- n.value && (n.value[Bo[t]] = e(f), o());
352
+ return (p) => {
353
+ n.value && (n.value[Bo[t]] = e(p), o());
354
354
  };
355
355
  }
356
356
  function Yo(t, o) {
357
- const e = dn(o), { state: n, source: f, currentList: s, size: m, containerRef: u } = e, g = { overflowX: "auto" }, { itemWidth: h, overscan: p = 5 } = t, v = cn(n, f, h), _ = mn(f, h), r = pn("horizontal", p, _, v, e), E = fn(h, f), k = S(() => E(n.value.start)), F = vn(h, f);
357
+ const e = dn(o), { state: n, source: p, currentList: s, size: m, containerRef: u } = e, g = { overflowX: "auto" }, { itemWidth: h, overscan: f = 5 } = t, v = cn(n, p, h), _ = mn(p, h), r = pn("horizontal", f, _, v, e), T = fn(h, p), k = S(() => T(n.value.start)), F = vn(h, p);
358
358
  gn(m, o, u, r);
359
- const w = _n("horizontal", r, E, u), c = S(() => ({
359
+ const w = _n("horizontal", r, T, u), c = S(() => ({
360
360
  style: {
361
361
  height: "100%",
362
362
  width: `${F.value - k.value}px`,
@@ -374,9 +374,9 @@ function Yo(t, o) {
374
374
  };
375
375
  }
376
376
  function zo(t, o) {
377
- const e = dn(o), { state: n, source: f, currentList: s, size: m, containerRef: u } = e, g = { overflowY: "auto" }, { itemHeight: h, overscan: p = 5 } = t, v = cn(n, f, h), _ = mn(f, h), r = pn("vertical", p, _, v, e), E = fn(h, f), k = S(() => E(n.value.start)), F = vn(h, f);
377
+ const e = dn(o), { state: n, source: p, currentList: s, size: m, containerRef: u } = e, g = { overflowY: "auto" }, { itemHeight: h, overscan: f = 5 } = t, v = cn(n, p, h), _ = mn(p, h), r = pn("vertical", f, _, v, e), T = fn(h, p), k = S(() => T(n.value.start)), F = vn(h, p);
378
378
  gn(m, o, u, r);
379
- const w = _n("vertical", r, E, u), c = S(() => ({
379
+ const w = _n("vertical", r, T, u), c = S(() => ({
380
380
  style: {
381
381
  width: "100%",
382
382
  height: `${F.value - k.value}px`,
@@ -425,7 +425,7 @@ function Wo(t, o) {
425
425
  for (; m.parent; )
426
426
  e.add(m.parent.id), m = m.parent;
427
427
  }
428
- function f(s, m) {
428
+ function p(s, m) {
429
429
  var v, _;
430
430
  if (m.length === 0 || !s)
431
431
  return s;
@@ -440,7 +440,7 @@ function Wo(t, o) {
440
440
  highlightedStrings: m[0].query
441
441
  } : s;
442
442
  if (s.children && s.children.length > 0) {
443
- const r = s.children.map((E) => f(E, g ? m.slice(1) : m)).filter((E) => !!E);
443
+ const r = s.children.map((T) => p(T, g ? m.slice(1) : m)).filter((T) => !!T);
444
444
  return r.length > 0 ? {
445
445
  ...h,
446
446
  children: r
@@ -450,7 +450,7 @@ function Wo(t, o) {
450
450
  }
451
451
  return {
452
452
  // @ts-ignore
453
- subTree: t.map((s) => f(s, o.levels)).filter((s) => !!s),
453
+ subTree: t.map((s) => p(s, o.levels)).filter((s) => !!s),
454
454
  shouldExpandNodeIds: Array.from(e)
455
455
  };
456
456
  }
@@ -471,10 +471,10 @@ function qo(t, o) {
471
471
  return Wo(t, e);
472
472
  }
473
473
  function _t(t, o, e) {
474
- const n = [...t], f = n[o];
474
+ const n = [...t], p = n[o];
475
475
  n.splice(o, 1);
476
476
  let s = e;
477
- return o < e && s--, n.splice(s, 0, f), n;
477
+ return o < e && s--, n.splice(s, 0, p), n;
478
478
  }
479
479
  function Kt(t, o) {
480
480
  return o ? `${o}, ${t}` : t;
@@ -482,8 +482,8 @@ function Kt(t, o) {
482
482
  function Xo(t) {
483
483
  const o = /* @__PURE__ */ new Map();
484
484
  function e(n) {
485
- var f;
486
- o.set(n.id, n), (f = n.meta) != null && f.rawId && o.set(n.meta.rawId, n), n.children && n.children.forEach(e);
485
+ var p;
486
+ o.set(n.id, n), (p = n.meta) != null && p.rawId && o.set(n.meta.rawId, n), n.children && n.children.forEach(e);
487
487
  }
488
488
  return t.forEach(e), o;
489
489
  }
@@ -495,8 +495,8 @@ function Jo(t) {
495
495
  }
496
496
  const et = co("mf-menu-tree", () => {
497
497
  const t = q(), o = q([]), e = q(null), n = q([]);
498
- function f(_) {
499
- o.value = _, p.value = Xo(_);
498
+ function p(_) {
499
+ o.value = _, f.value = Xo(_);
500
500
  }
501
501
  function s(_) {
502
502
  e.value = _;
@@ -507,7 +507,7 @@ const et = co("mf-menu-tree", () => {
507
507
  function u(_) {
508
508
  if (!_)
509
509
  return;
510
- const r = p.value.get(_);
510
+ const r = f.value.get(_);
511
511
  r && (e.value = r.id);
512
512
  }
513
513
  async function g() {
@@ -515,25 +515,25 @@ const et = co("mf-menu-tree", () => {
515
515
  }
516
516
  function h() {
517
517
  const _ = [];
518
- function r(E) {
519
- _.push(E.id);
520
- for (const k of E.children ?? [])
518
+ function r(T) {
519
+ _.push(T.id);
520
+ for (const k of T.children ?? [])
521
521
  r(k);
522
522
  }
523
- for (const E of o.value)
524
- r(E);
523
+ for (const T of o.value)
524
+ r(T);
525
525
  n.value = _;
526
526
  }
527
- const p = q(/* @__PURE__ */ new Map());
527
+ const f = q(/* @__PURE__ */ new Map());
528
528
  function v(_) {
529
- return p.value.get(_);
529
+ return f.value.get(_);
530
530
  }
531
531
  return {
532
532
  treeRef: t,
533
533
  treeNodes: o,
534
534
  selectedNodeId: e,
535
535
  expandedNodeIds: n,
536
- setTreeNodes: f,
536
+ setTreeNodes: p,
537
537
  setSelectedNodeId: s,
538
538
  setSelectedNodeByItemId: u,
539
539
  setExpandedNodeIds: m,
@@ -550,12 +550,12 @@ function Qo(t, o) {
550
550
  if (g != null && g.length && g.length > 0)
551
551
  return !1;
552
552
  const h = u;
553
- return n(h), f(h);
553
+ return n(h), p(h);
554
554
  }
555
555
  function n(u) {
556
556
  u.inventoryBindings ?? (u.inventoryBindings = []), u.inventoryBindings.length === 0 && (u.inventoryBindings = null);
557
557
  }
558
- function f(u) {
558
+ function p(u) {
559
559
  return !o.state.currentCatalogId && !o.state.currentSchedulerId ? (s(u), !0) : m(u);
560
560
  }
561
561
  function s(u) {
@@ -574,7 +574,7 @@ function Qo(t, o) {
574
574
  );
575
575
  if (o.state.currentCatalogId) {
576
576
  const h = g.modules.catalog.find(
577
- (p) => p._id === o.state.currentCatalogId
577
+ (f) => f._id === o.state.currentCatalogId
578
578
  );
579
579
  return o.updateMenu({
580
580
  module: Z.F_MENU_MODULE_V4_KEY.enum.catalog,
@@ -584,7 +584,7 @@ function Qo(t, o) {
584
584
  }
585
585
  if (o.state.currentSchedulerId) {
586
586
  const h = g.modules.scheduler.find(
587
- (p) => p._id === o.state.currentSchedulerId
587
+ (f) => f._id === o.state.currentSchedulerId
588
588
  );
589
589
  return o.updateMenu({
590
590
  module: Z.F_MENU_MODULE_V4_KEY.enum.scheduler,
@@ -614,30 +614,30 @@ function er({
614
614
  schedulerId: e,
615
615
  itemId: n
616
616
  }) {
617
- var f, s, m, u;
617
+ var p, s, m, u;
618
618
  if (!o && !e)
619
619
  throw new Error("catalogId or schedulerId are required");
620
620
  if (o && !e)
621
- return (f = t.modules.catalog.find((g) => g._id === o)) == null ? void 0 : f.override.items[n];
621
+ return (p = t.modules.catalog.find((g) => g._id === o)) == null ? void 0 : p.override.items[n];
622
622
  if (!o && e)
623
623
  return (m = (s = t.modules.scheduler.find((g) => g._id === e)) == null ? void 0 : s.items) == null ? void 0 : m.filter((g) => g._id === n);
624
624
  {
625
- const g = t.modules.catalog.find((p) => p._id === o), h = g == null ? void 0 : g.override.scheduler[e];
626
- return (u = h == null ? void 0 : h.items) == null ? void 0 : u.filter((p) => p._id === n);
625
+ const g = t.modules.catalog.find((f) => f._id === o), h = g == null ? void 0 : g.override.scheduler[e];
626
+ return (u = h == null ? void 0 : h.items) == null ? void 0 : u.filter((f) => f._id === n);
627
627
  }
628
628
  }
629
629
  function tr(t, o, e, n) {
630
- const f = er({ menu: t, catalogId: o, schedulerId: e, itemId: n });
631
- if (!f)
630
+ const p = er({ menu: t, catalogId: o, schedulerId: e, itemId: n });
631
+ if (!p)
632
632
  throw new Error(`Item overrider ${n} not found`);
633
633
  const s = t.modules.item.find((m) => m._id === n);
634
634
  if (!s)
635
635
  throw new Error(`Item ${n} not found in merged menu`);
636
- return $n(s, f);
636
+ return $n(s, p);
637
637
  }
638
638
  function nr(t) {
639
639
  const o = q(null), e = S(() => o.value ? !t.state.currentCatalogId && !t.state.currentSchedulerId ? t.state.menu.modules.item.find(
640
- (f) => f._id === o.value
640
+ (p) => p._id === o.value
641
641
  ) : tr(
642
642
  t.state.menu,
643
643
  t.state.currentCatalogId,
@@ -679,7 +679,7 @@ const ct = () => {
679
679
  }), o.close());
680
680
  });
681
681
  }
682
- function f(u) {
682
+ function p(u) {
683
683
  o.open({
684
684
  title: t("menu.category.manager.dialog.update.title"),
685
685
  contentComponent: At,
@@ -721,7 +721,7 @@ const ct = () => {
721
721
  }
722
722
  return {
723
723
  create: n,
724
- update: f,
724
+ update: p,
725
725
  deleteCategory: s,
726
726
  rearrange: m
727
727
  };
@@ -740,31 +740,31 @@ const ct = () => {
740
740
  __name: "ImageUploadDialog",
741
741
  setup(t) {
742
742
  const { t: o } = ce(), e = q(), n = q(!1);
743
- async function f([h]) {
743
+ async function p([h]) {
744
744
  if (!h) return;
745
745
  n.value = !0;
746
- const p = new FileReader();
747
- p.onload = () => {
746
+ const f = new FileReader();
747
+ f.onload = () => {
748
748
  const v = new Image();
749
- v.src = p.result, v.onload = () => {
749
+ v.src = f.result, v.onload = () => {
750
750
  const _ = Rn(v, 1.3333333333333333);
751
751
  e.value = _, n.value = !1;
752
752
  }, v.onerror = () => {
753
753
  n.value = !1;
754
754
  };
755
- }, p.readAsDataURL(h);
755
+ }, f.readAsDataURL(h);
756
756
  }
757
757
  const s = (h) => {
758
- f([h]);
758
+ p([h]);
759
759
  }, { emitData: m } = Dt();
760
760
  async function u(h) {
761
- const { canvas: p } = h, v = p.toDataURL("image/jpeg", 0.75), _ = await (await fetch(v)).blob(), r = new File([_], "img.jpeg", { type: "image/jpeg" });
761
+ const { canvas: f } = h, v = f.toDataURL("image/jpeg", 0.75), _ = await (await fetch(v)).blob(), r = new File([_], "img.jpeg", { type: "image/jpeg" });
762
762
  m(r);
763
763
  }
764
764
  function g() {
765
765
  e.value = void 0, m(null);
766
766
  }
767
- return (h, p) => {
767
+ return (h, f) => {
768
768
  const v = H("fm-icon"), _ = H("fm-drop-field");
769
769
  return V(), J("div", or, [
770
770
  e.value ? (V(), J("div", rr, [
@@ -839,10 +839,10 @@ const dr = {
839
839
  t: o
840
840
  } = ce(), e = t, n = jt(t, "modelValue");
841
841
  q(!1);
842
- const f = Pe(), s = () => {
842
+ const p = Pe(), s = () => {
843
843
  n.value = null;
844
844
  }, m = () => {
845
- f.open({
845
+ p.open({
846
846
  title: "Delete image",
847
847
  message: "Are you sure you want to delete this image?",
848
848
  primaryActions: {
@@ -857,7 +857,7 @@ const dr = {
857
857
  s();
858
858
  });
859
859
  }, u = Fe(), g = qe(u), h = () => {
860
- f.open({
860
+ p.open({
861
861
  title: "Upload image",
862
862
  message: "Please upload an image for your product.",
863
863
  contentComponent: sr,
@@ -869,14 +869,14 @@ const dr = {
869
869
  text: "Cancel",
870
870
  close: !0
871
871
  }
872
- }).onPrimary(async (p) => {
872
+ }).onPrimary(async (f) => {
873
873
  await g.minor(async () => {
874
- if (!p)
874
+ if (!f)
875
875
  throw new Error("No image selected");
876
876
  if (!e.itemId)
877
877
  throw new Error("Item ID is required when uploading image");
878
878
  const v = Qn(e.itemId);
879
- await Zn.update(v, p, ur.firebase.storageBucket), n.value = eo(v);
879
+ await Zn.update(v, f, ur.firebase.storageBucket), n.value = eo(v);
880
880
  }, {
881
881
  message: "Uploading image...",
882
882
  successMessage: "Image uploaded successfully",
@@ -884,7 +884,7 @@ const dr = {
884
884
  });
885
885
  });
886
886
  };
887
- return (p, v) => {
887
+ return (f, v) => {
888
888
  const _ = H("FmButton"), r = H("FmFormGroup");
889
889
  return V(), Q(r, {
890
890
  tag: "div",
@@ -893,7 +893,7 @@ const dr = {
893
893
  "label-mark": "optional"
894
894
  }, {
895
895
  default: Y(() => [G("div", {
896
- class: fe(`relative container ${p.disabled ? "cursor-not-allowed" : ""}`)
896
+ class: fe(`relative container ${f.disabled ? "cursor-not-allowed" : ""}`)
897
897
  }, [C(go, {
898
898
  size: {
899
899
  width: 200,
@@ -901,7 +901,7 @@ const dr = {
901
901
  },
902
902
  src: n.value,
903
903
  alt: "Product image"
904
- }, null, 8, ["src"]), p.disabled ? X("", !0) : (V(), J("div", dr, [G("div", cr, [C(_, {
904
+ }, null, 8, ["src"]), f.disabled ? X("", !0) : (V(), J("div", dr, [G("div", cr, [C(_, {
905
905
  icon: n.value ? "edit" : "add",
906
906
  variant: "secondary",
907
907
  "text-color": a(Te).NeutralGray400,
@@ -967,21 +967,21 @@ const Tr = /* @__PURE__ */ ie({
967
967
  setup(t, {
968
968
  emit: o
969
969
  }) {
970
- const e = t, n = se(), f = ct(), {
970
+ const e = t, n = se(), p = ct(), {
971
971
  checkMenuIsLoading: s
972
- } = dt(qe(Fe())), m = Ze(), u = o, g = S(() => n.rules.item), h = S(() => n.categorizedItems), p = S(() => {
972
+ } = dt(qe(Fe())), m = Ze(), u = o, g = S(() => n.rules.item), h = S(() => n.categorizedItems), f = S(() => {
973
973
  const i = h.value.map((b) => ({
974
974
  label: b.name,
975
975
  value: b.id
976
976
  }));
977
977
  return e.isAddon ? i : i.filter((b) => !!b.value);
978
- }), v = S(() => g.value.addon), _ = S(() => !p.value.find((i) => !!i.value)), r = S(() => to(e.form.category ? e.form : e.fallback) || []), E = S(() => r.value.reduce((i, b) => (i[b._id] = b, i), {})), k = S({
978
+ }), v = S(() => g.value.addon), _ = S(() => !f.value.find((i) => !!i.value)), r = S(() => to(e.form.category ? e.form : e.fallback) || []), T = S(() => r.value.reduce((i, b) => (i[b._id] = b, i), {})), k = S({
979
979
  get() {
980
980
  return r.value.map((i) => i._id);
981
981
  },
982
982
  set(i = []) {
983
- const [b, ...T] = i.map((y) => {
984
- const M = E.value[y];
983
+ const [b, ...x] = i.map((y) => {
984
+ const M = T.value[y];
985
985
  return M || {
986
986
  _id: y,
987
987
  position: null
@@ -991,12 +991,12 @@ const Tr = /* @__PURE__ */ ie({
991
991
  u("update:form", "category", null), u("update:form", "additionalCategories", []);
992
992
  return;
993
993
  }
994
- u("update:form", "category", b._id), u("update:form", "additionalCategories", T);
994
+ u("update:form", "category", b._id), u("update:form", "additionalCategories", x);
995
995
  }
996
996
  }), F = q(), w = () => e.isAddon ? null : C(Ln, {
997
997
  ref: F,
998
998
  disabled: !g.value.category || s(),
999
- items: p.value,
999
+ items: f.value,
1000
1000
  modelValue: k.value,
1001
1001
  "onUpdate:model-value": (i) => k.value = i,
1002
1002
  placeholder: l("menu.product.form.detail.category.placeholder")
@@ -1006,7 +1006,7 @@ const Tr = /* @__PURE__ */ ie({
1006
1006
  type: "button",
1007
1007
  onClick: () => {
1008
1008
  var i;
1009
- (i = F.value) == null || i.hideMenu(), f.create();
1009
+ (i = F.value) == null || i.hideMenu(), p.create();
1010
1010
  }
1011
1011
  }, [C(we.FmIcon, {
1012
1012
  color: "primary",
@@ -1022,17 +1022,17 @@ const Tr = /* @__PURE__ */ ie({
1022
1022
  const c = S(() => {
1023
1023
  var b;
1024
1024
  const i = e.form.name || ((b = e.fallback) == null ? void 0 : b.name);
1025
- return i ? n.items.filter((T) => !!T.category && T._id !== e.form._id && T.name === i).length : 0;
1026
- }), x = S(() => e.isAddon ? De.ADD_ON : De.PRODUCT);
1025
+ return i ? n.items.filter((x) => !!x.category && x._id !== e.form._id && x.name === i).length : 0;
1026
+ }), E = S(() => e.isAddon ? De.ADD_ON : De.PRODUCT);
1027
1027
  function U(i) {
1028
- var T, y, M;
1029
- if (x.value === i) return;
1028
+ var x, y, M;
1029
+ if (E.value === i) return;
1030
1030
  const b = i == De.ADD_ON;
1031
- u("update:form", "category", e.isOverride ? b ? "" : ((T = e.fallback) == null ? void 0 : T.category) ?? ((y = p.value.find((W) => !!W.value)) == null ? void 0 : y.value) : b ? null : (M = p.value.find((W) => !!W.value)) == null ? void 0 : M.value), b && u("update:form", "additionalCategories", []);
1031
+ u("update:form", "category", e.isOverride ? b ? "" : ((x = e.fallback) == null ? void 0 : x.category) ?? ((y = f.value.find((W) => !!W.value)) == null ? void 0 : y.value) : b ? null : (M = f.value.find((W) => !!W.value)) == null ? void 0 : M.value), b && u("update:form", "additionalCategories", []);
1032
1032
  }
1033
1033
  const N = q(!1);
1034
1034
  async function P() {
1035
- var i, b, T;
1035
+ var i, b, x;
1036
1036
  if (!e.form.name) {
1037
1037
  const y = document.getElementById("product-name");
1038
1038
  if (y) {
@@ -1048,7 +1048,7 @@ const Tr = /* @__PURE__ */ ie({
1048
1048
  }), Ge.toggleDialog(!0);
1049
1049
  const y = await ((b = (i = Ge).getItemDescription) == null ? void 0 : b.call(i, {
1050
1050
  name: e.form.name || ""
1051
- }, !0)), M = (T = y == null ? void 0 : y.data) == null ? void 0 : T.value;
1051
+ }, !0)), M = (x = y == null ? void 0 : y.data) == null ? void 0 : x.value;
1052
1052
  typeof M == "string" && u("update:form", "description", M);
1053
1053
  } finally {
1054
1054
  N.value = !1;
@@ -1068,18 +1068,18 @@ const Tr = /* @__PURE__ */ ie({
1068
1068
  t: l
1069
1069
  } = ce();
1070
1070
  return (i, b) => {
1071
- const T = H("fm-text-field"), y = H("fm-textarea"), M = H("fm-radio"), W = H("FmSnackbar"), ee = H("FmButton"), O = H("fm-radio-group"), ne = H("FmFormGroup"), ue = Wt("tooltip");
1071
+ const x = H("fm-text-field"), y = H("fm-textarea"), M = H("fm-radio"), W = H("FmSnackbar"), ee = H("FmButton"), O = H("fm-radio-group"), ne = H("FmFormGroup"), ue = Wt("tooltip");
1072
1072
  return V(), Q(Se, {
1073
1073
  title: a(l)("menu.product.form.detail.title")
1074
1074
  }, {
1075
1075
  default: Y(() => {
1076
1076
  var D, R, $;
1077
- return [G("div", fr, [G("div", gr, [G("div", vr, [G("div", _r, [C(T, {
1077
+ return [G("div", fr, [G("div", gr, [G("div", vr, [G("div", _r, [C(x, {
1078
1078
  "model-value": i.form.code,
1079
1079
  placeholder: ((D = i.fallback) == null ? void 0 : D.code) || a(l)("menu.product.form.detail.fields.code.placeholder"),
1080
1080
  label: a(l)("menu.product.form.detail.fields.code.label"),
1081
1081
  "onUpdate:modelValue": b[0] || (b[0] = (B) => u("update:form", "code", a(qt)(B, i.isOverride)))
1082
- }, null, 8, ["model-value", "placeholder", "label"])]), G("div", br, [C(T, {
1082
+ }, null, 8, ["model-value", "placeholder", "label"])]), G("div", br, [C(x, {
1083
1083
  id: "product-name",
1084
1084
  disabled: !g.value.name,
1085
1085
  "helper-text": c.value > 0 ? a(l)("menu.product.form.detail.fields.name.duplicate_warning", {
@@ -1134,7 +1134,7 @@ const Tr = /* @__PURE__ */ ie({
1134
1134
  label: a(l)("menu.common.actions.add"),
1135
1135
  "prepend-icon": "add",
1136
1136
  variant: "secondary",
1137
- onClick: a(f).create
1137
+ onClick: a(p).create
1138
1138
  }, null, 8, ["label", "onClick"])])) : X("", !0), C(M, {
1139
1139
  value: De.ADD_ON,
1140
1140
  disabled: !1,
@@ -1181,25 +1181,25 @@ const Tr = /* @__PURE__ */ ie({
1181
1181
  }), xr = /* @__PURE__ */ Xe(Tr, [["__scopeId", "data-v-317a5447"]]), Fr = /* @__PURE__ */ ie({
1182
1182
  __name: "AddForm",
1183
1183
  setup(t) {
1184
- const o = se(), e = S(() => o.rules.group), n = S(() => !!o.state.currentCatalogId || !!o.state.currentSchedulerId), f = S(() => {
1185
- const g = !o.state.currentSchedulerId, h = o.rules.group.type, p = o.version === Z.F_MENU_VERSION.enum.v3, v = o.rules.item.orderFromActiveOnly, _ = o.rules.item.bindToVariant;
1186
- return function(E) {
1184
+ const o = se(), e = S(() => o.rules.group), n = S(() => !!o.state.currentCatalogId || !!o.state.currentSchedulerId), p = S(() => {
1185
+ const g = !o.state.currentSchedulerId, h = o.rules.group.type, f = o.version === Z.F_MENU_VERSION.enum.v3, v = o.rules.item.orderFromActiveOnly, _ = o.rules.item.bindToVariant;
1186
+ return function(T) {
1187
1187
  return {
1188
1188
  link: (k) => !n.value && (!k || _),
1189
1189
  name: (k) => !n.value && !k,
1190
1190
  isDefault: (k) => !n.value,
1191
- type: h && !E._id && !n.value,
1192
- price: E.type !== Z.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
1191
+ type: h && !T._id && !n.value,
1192
+ price: T.type !== Z.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
1193
1193
  priceEdit: !0,
1194
1194
  priceTier: o.isV4,
1195
- inventory: g ? p ? !n.value && E.type === Z.F_ADDON_GROUP_TYPE.enum.NORMAL : !n.value : !1,
1196
- orderFrom: (k) => g ? p ? E.type === Z.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? n.value : !!n.value == !k : n.value : !1,
1195
+ inventory: g ? f ? !n.value && T.type === Z.F_ADDON_GROUP_TYPE.enum.NORMAL : !n.value : !1,
1196
+ orderFrom: (k) => g ? f ? T.type === Z.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? n.value : !!n.value == !k : n.value : !1,
1197
1197
  orderFromActiveOnly: v,
1198
- showOrderFrom: g ? p ? n.value ? !0 : E.type === Z.F_ADDON_GROUP_TYPE.enum.PRODUCT : n.value : !1,
1198
+ showOrderFrom: g ? f ? n.value ? !0 : T.type === Z.F_ADDON_GROUP_TYPE.enum.PRODUCT : n.value : !1,
1199
1199
  bindToVariant: _,
1200
1200
  isOverride: n.value,
1201
1201
  isItemGroup: !1,
1202
- isV4: !p
1202
+ isV4: !f
1203
1203
  };
1204
1204
  };
1205
1205
  }), s = () => ({
@@ -1212,17 +1212,17 @@ const Tr = /* @__PURE__ */ ie({
1212
1212
  return (g, h) => e.value.create ? (V(), Q(a(Gr), {
1213
1213
  key: 0,
1214
1214
  "categorized-items": a(o).categorizedItems,
1215
- config: f.value,
1215
+ config: p.value,
1216
1216
  group: m.value,
1217
- "onUpdate:group": h[0] || (h[0] = (p) => m.value = p),
1218
- "onStatus:show": h[1] || (h[1] = (p) => {
1219
- p || (m.value = s());
1217
+ "onUpdate:group": h[0] || (h[0] = (f) => m.value = f),
1218
+ "onStatus:show": h[1] || (h[1] = (f) => {
1219
+ f || (m.value = s());
1220
1220
  }),
1221
1221
  action: "add",
1222
1222
  title: a(u)("menu.group.add")
1223
1223
  }, {
1224
- default: Y(({ trigger: p }) => [
1225
- Me(g.$slots, "default", { trigger: p })
1224
+ default: Y(({ trigger: f }) => [
1225
+ Me(g.$slots, "default", { trigger: f })
1226
1226
  ]),
1227
1227
  _: 3
1228
1228
  }, 8, ["categorized-items", "config", "group", "title"])) : X("", !0);
@@ -1249,7 +1249,7 @@ const Tr = /* @__PURE__ */ ie({
1249
1249
  setup(t, {
1250
1250
  emit: o
1251
1251
  }) {
1252
- const e = t, n = o, f = Fe(), s = Ze(), m = se(), u = S(() => be.Country.getCountry(s.currentCountry.value)), g = q(!1), h = S(() => e.config.isV4 || e.group.type === Z.F_ADDON_GROUP_TYPE.enum.PRODUCT), p = S(() => h.value), v = S(() => h.value), _ = S(() => Object.values(e.group.items).flatMap((D) => [{
1252
+ const e = t, n = o, p = Fe(), s = Ze(), m = se(), u = S(() => be.Country.getCountry(s.currentCountry.value)), g = q(!1), h = S(() => e.config.isV4 || e.group.type === Z.F_ADDON_GROUP_TYPE.enum.PRODUCT), f = S(() => h.value), v = S(() => h.value), _ = S(() => Object.values(e.group.items).flatMap((D) => [{
1253
1253
  _id: D._id,
1254
1254
  combinationKey: void 0
1255
1255
  }, ...(D.items ?? []).map((R) => ({
@@ -1257,9 +1257,9 @@ const Tr = /* @__PURE__ */ ie({
1257
1257
  combinationKey: R.combinationKey
1258
1258
  }))])), {
1259
1259
  searchKey: r,
1260
- filter: E
1260
+ filter: T
1261
1261
  } = bo(), k = S(() => {
1262
- const D = Object.entries(e.group.items).filter(([, R]) => E([R.code || "", R.name || R.fallbackName, c(R.price ?? R.fallbackPrice), x(R.orderFrom || R.fallbackOrder), ...(R.items || []).map(($) => [$.code || "", $.name || $.fallbackName, c($.price ?? $.fallbackPrice), x($.orderFrom || $.fallbackOrder)].join(""))]));
1262
+ const D = Object.entries(e.group.items).filter(([, R]) => T([R.code || "", R.name || R.fallbackName, c(R.price ?? R.fallbackPrice), E(R.orderFrom || R.fallbackOrder), ...(R.items || []).map(($) => [$.code || "", $.name || $.fallbackName, c($.price ?? $.fallbackPrice), E($.orderFrom || $.fallbackOrder)].join(""))]));
1263
1263
  return Object.fromEntries(D);
1264
1264
  }), F = (D) => ({
1265
1265
  ...e.config,
@@ -1267,7 +1267,7 @@ const Tr = /* @__PURE__ */ ie({
1267
1267
  link: e.config.link(D),
1268
1268
  name: e.config.name(D),
1269
1269
  orderFrom: e.config.orderFrom(D)
1270
- }), w = S(() => !0), c = (D) => D ? Qe(D, !1) : "", x = (D) => {
1270
+ }), w = S(() => !0), c = (D) => D ? Qe(D, !1) : "", E = (D) => {
1271
1271
  var R;
1272
1272
  return D == null ? "" : (R = no()[D]) == null ? void 0 : R.label;
1273
1273
  }, U = S(() => Object.values(k.value)), N = q({}), {
@@ -1495,7 +1495,7 @@ const Tr = /* @__PURE__ */ ie({
1495
1495
  const j = (B = D.row.getParentRow()) == null ? void 0 : B.original;
1496
1496
  if (!j) return;
1497
1497
  if ((((A = e.group.items[j._id].items) == null ? void 0 : A.length) || 0) <= 1) {
1498
- f.open({
1498
+ p.open({
1499
1499
  title: P("menu.group.option.should_link_at_least_one_variant", {
1500
1500
  name: j.name
1501
1501
  }),
@@ -1503,7 +1503,7 @@ const Tr = /* @__PURE__ */ ie({
1503
1503
  });
1504
1504
  return;
1505
1505
  }
1506
- T(j._id, R.combinationKey ?? "");
1506
+ x(j._id, R.combinationKey ?? "");
1507
1507
  } else
1508
1508
  b(R._id);
1509
1509
  }
@@ -1562,7 +1562,7 @@ const Tr = /* @__PURE__ */ ie({
1562
1562
  const R = me(e.group);
1563
1563
  delete R.items[D], n("update:group", R);
1564
1564
  }
1565
- function T(D, R) {
1565
+ function x(D, R) {
1566
1566
  const $ = me(e.group), B = $.items[D];
1567
1567
  B && (B.items = (B.items || []).filter((A) => A.combinationKey !== R), $.items[D] = B, n("update:group", $));
1568
1568
  }
@@ -1609,7 +1609,7 @@ const Tr = /* @__PURE__ */ ie({
1609
1609
  }, {
1610
1610
  "append-title": Y(() => [D.config.link() ? (V(), J(xe, {
1611
1611
  key: 0
1612
- }, [p.value ? (V(), J("div", Sr, [C(kt, {
1612
+ }, [f.value ? (V(), J("div", Sr, [C(kt, {
1613
1613
  "categorized-items": D.categorizedItems,
1614
1614
  "initial-value": _.value,
1615
1615
  "show-variant": D.config.bindToVariant,
@@ -1671,9 +1671,9 @@ const Tr = /* @__PURE__ */ ie({
1671
1671
  emits: ["update:group", "submit:group", "status:show"],
1672
1672
  setup(t, { expose: o, emit: e }) {
1673
1673
  let n = t;
1674
- const f = e, s = se(), m = Ze(), u = Pe(), g = dt(qe(Fe())), { countDefaultItems: h, validateGroupItems: p, minMaxValidationRules: v } = Gn(
1674
+ const p = e, s = se(), m = Ze(), u = Pe(), g = dt(qe(Fe())), { countDefaultItems: h, validateGroupItems: f, minMaxValidationRules: v } = Gn(
1675
1675
  () => n.group
1676
- ), _ = q(!1), r = q(!1), E = (y) => {
1676
+ ), _ = q(!1), r = q(!1), T = (y) => {
1677
1677
  Pt.isBoolean(y) ? r.value = y : r.value = !r.value;
1678
1678
  }, k = S(() => n.group ? n.config(n.group) : null), F = S(() => Kn(k.value)), w = (y) => F.value.includes(y), c = S(() => [
1679
1679
  {
@@ -1689,12 +1689,12 @@ const Tr = /* @__PURE__ */ ie({
1689
1689
  value: Z.F_ADDON_GROUP_TYPE.enum.DYNAMIC
1690
1690
  }
1691
1691
  ]);
1692
- function x(y) {
1693
- f("update:group", y);
1692
+ function E(y) {
1693
+ p("update:group", y);
1694
1694
  }
1695
1695
  function U(y) {
1696
1696
  function M() {
1697
- x({
1697
+ E({
1698
1698
  ...n.group,
1699
1699
  items: {},
1700
1700
  type: y
@@ -1724,7 +1724,7 @@ const Tr = /* @__PURE__ */ ie({
1724
1724
  () => {
1725
1725
  r.value = !1;
1726
1726
  }
1727
- ), I = S(() => n.action === "add" ? T("common.add") : T("common.update"));
1727
+ ), I = S(() => n.action === "add" ? x("common.add") : x("common.update"));
1728
1728
  async function d() {
1729
1729
  if (n.action === "add") {
1730
1730
  const { group: y, linkItems: M } = Yn(n.group), W = {
@@ -1739,14 +1739,14 @@ const Tr = /* @__PURE__ */ ie({
1739
1739
  }
1740
1740
  ]
1741
1741
  };
1742
- await s.updateMenu(W), f("submit:group", n.group);
1743
- } else n.action === "update" && f("submit:group", n.group);
1744
- E(!1);
1742
+ await s.updateMenu(W), p("submit:group", n.group);
1743
+ } else n.action === "update" && p("submit:group", n.group);
1744
+ T(!1);
1745
1745
  }
1746
1746
  ye(
1747
1747
  () => r.value,
1748
1748
  async (y) => {
1749
- f("status:show", y), y && (await st(), P.value = Ce.clone(n.group));
1749
+ p("status:show", y), y && (await st(), P.value = Ce.clone(n.group));
1750
1750
  }
1751
1751
  );
1752
1752
  const l = S(() => {
@@ -1760,20 +1760,20 @@ const Tr = /* @__PURE__ */ ie({
1760
1760
  typeof O == "string" && O && !((W = y[ee]) != null && W.includes(O)) && (y[ee] = [...y[ee] || [], O]);
1761
1761
  }), y;
1762
1762
  }), b = (y) => {
1763
- n.group && x({
1763
+ n.group && E({
1764
1764
  ...n.group,
1765
1765
  customAttributes: y
1766
1766
  });
1767
1767
  };
1768
1768
  o({
1769
- trigger: E,
1769
+ trigger: T,
1770
1770
  show: r
1771
1771
  });
1772
- const { t: T } = ce();
1772
+ const { t: x } = ce();
1773
1773
  return (y, M) => {
1774
1774
  const W = H("fm-text-field"), ee = H("fm-stepper-field"), O = H("FmFormGroup"), ne = H("fm-radio"), ue = H("fm-radio-group"), D = H("fm-switch"), R = H("FormSection"), $ = H("fm-button"), B = H("fm-side-sheet");
1775
1775
  return V(), J(xe, null, [
1776
- Me(y.$slots, "default", { trigger: E }),
1776
+ Me(y.$slots, "default", { trigger: T }),
1777
1777
  C(B, {
1778
1778
  id: "group-form",
1779
1779
  modelValue: r.value,
@@ -1799,7 +1799,7 @@ const Tr = /* @__PURE__ */ ie({
1799
1799
  variant: "primary"
1800
1800
  }, null, 8, ["label", "loading"]),
1801
1801
  C($, {
1802
- label: a(T)("menu.common.actions.cancel"),
1802
+ label: a(x)("menu.common.actions.cancel"),
1803
1803
  size: "lg",
1804
1804
  variant: "tertiary",
1805
1805
  onClick: M[7] || (M[7] = () => r.value = !1)
@@ -1817,10 +1817,10 @@ const Tr = /* @__PURE__ */ ie({
1817
1817
  "onUpdate:modelValue": M[0] || (M[0] = (A) => y.group.name = A),
1818
1818
  disabled: w("name"),
1819
1819
  rules: [
1820
- (A) => !!A || a(T)("menu.common.validation.required", { field: a(T)("menu.common.labels.group_name") })
1820
+ (A) => !!A || a(x)("menu.common.validation.required", { field: a(x)("menu.common.labels.group_name") })
1821
1821
  ],
1822
1822
  autofocus: "",
1823
- label: a(T)("menu.common.labels.group_name")
1823
+ label: a(x)("menu.common.labels.group_name")
1824
1824
  }, null, 8, ["modelValue", "disabled", "rules", "label"])
1825
1825
  ]),
1826
1826
  C(O, {
@@ -1836,7 +1836,7 @@ const Tr = /* @__PURE__ */ ie({
1836
1836
  disabled: w("min"),
1837
1837
  min: 0,
1838
1838
  class: "flex-1",
1839
- label: a(T)("menu.common.labels.min_select")
1839
+ label: a(x)("menu.common.labels.min_select")
1840
1840
  }, null, 8, ["modelValue", "disabled", "label"]),
1841
1841
  C(ee, {
1842
1842
  modelValue: y.group.max,
@@ -1844,7 +1844,7 @@ const Tr = /* @__PURE__ */ ie({
1844
1844
  disabled: w("max"),
1845
1845
  min: y.group.min,
1846
1846
  class: "flex-1",
1847
- label: a(T)("menu.common.labels.max_select")
1847
+ label: a(x)("menu.common.labels.max_select")
1848
1848
  }, null, 8, ["modelValue", "disabled", "min", "label"])
1849
1849
  ]),
1850
1850
  _: 1
@@ -1854,7 +1854,7 @@ const Tr = /* @__PURE__ */ ie({
1854
1854
  }, 8, ["model-value", "rules"]),
1855
1855
  k.value.type ? (V(), Q(Ve, {
1856
1856
  key: 0,
1857
- label: a(T)("menu.common.labels.group_type")
1857
+ label: a(x)("menu.common.labels.group_type")
1858
1858
  }, {
1859
1859
  default: Y(() => [
1860
1860
  C(ue, {
@@ -1865,7 +1865,7 @@ const Tr = /* @__PURE__ */ ie({
1865
1865
  default: Y(() => [
1866
1866
  (V(!0), J(xe, null, Ue(c.value, (A) => (V(), Q(ne, {
1867
1867
  key: A.value,
1868
- label: a(T)(`menu.group.types.${A.label.toLowerCase()}`),
1868
+ label: a(x)(`menu.group.types.${A.label.toLowerCase()}`),
1869
1869
  value: A.value
1870
1870
  }, null, 8, ["label", "value"]))), 128))
1871
1871
  ]),
@@ -1875,24 +1875,24 @@ const Tr = /* @__PURE__ */ ie({
1875
1875
  _: 1
1876
1876
  }, 8, ["label"])) : X("", !0),
1877
1877
  C(Ve, {
1878
- label: a(T)("menu.common.labels.configuration")
1878
+ label: a(x)("menu.common.labels.configuration")
1879
1879
  }, {
1880
1880
  default: Y(() => [
1881
1881
  C(D, {
1882
1882
  modelValue: y.group.stackable,
1883
1883
  "onUpdate:modelValue": M[4] || (M[4] = (A) => y.group.stackable = A),
1884
1884
  disabled: w("stackable"),
1885
- label: a(T)("menu.common.labels.stackable"),
1885
+ label: a(x)("menu.common.labels.stackable"),
1886
1886
  "label-placement": "right",
1887
- sublabel: a(T)("menu.common.labels.stackable_sublabel")
1887
+ sublabel: a(x)("menu.common.labels.stackable_sublabel")
1888
1888
  }, null, 8, ["modelValue", "disabled", "label", "sublabel"])
1889
1889
  ]),
1890
1890
  _: 1
1891
1891
  }, 8, ["label"]),
1892
1892
  l.value ? (V(), Q(R, {
1893
1893
  key: 1,
1894
- title: a(T)("menu.group.form.tagging.title"),
1895
- "sub-title": a(T)("menu.group.form.tagging.subtitle")
1894
+ title: a(x)("menu.group.form.tagging.title"),
1895
+ "sub-title": a(x)("menu.group.form.tagging.subtitle")
1896
1896
  }, {
1897
1897
  default: Y(() => [
1898
1898
  C(a(rn), {
@@ -1910,8 +1910,8 @@ const Tr = /* @__PURE__ */ ie({
1910
1910
  C(O, {
1911
1911
  tag: "div",
1912
1912
  modelValue: y.group,
1913
- rules: [a(p)],
1914
- "helper-text": a(T)("menu.common.validation.default_items_tip", {
1913
+ rules: [a(f)],
1914
+ "helper-text": a(x)("menu.common.validation.default_items_tip", {
1915
1915
  count: a(h)(y.group),
1916
1916
  max: y.group.max
1917
1917
  })
@@ -1922,8 +1922,8 @@ const Tr = /* @__PURE__ */ ie({
1922
1922
  "categorized-items": y.categorizedItems,
1923
1923
  config: k.value,
1924
1924
  group: y.group,
1925
- "onUpdate:group": M[5] || (M[5] = (A) => x(A)),
1926
- "onUpdate:unmapGroup": M[6] || (M[6] = (A) => x(N(A)))
1925
+ "onUpdate:group": M[5] || (M[5] = (A) => E(A)),
1926
+ "onUpdate:unmapGroup": M[6] || (M[6] = (A) => E(N(A)))
1927
1927
  }, null, 8, ["allow-refund-inventory", "categorized-items", "config", "group"])
1928
1928
  ]),
1929
1929
  _: 1
@@ -1945,7 +1945,7 @@ const Tr = /* @__PURE__ */ ie({
1945
1945
  emits: ["update:combinations"],
1946
1946
  setup(t, { expose: o, emit: e }) {
1947
1947
  var U, N;
1948
- const n = t, f = e, s = se(), m = Pe(), u = dt(qe(Fe())), g = q([]), h = q(n.combinations[0].combinationKey || ""), p = S(
1948
+ const n = t, p = e, s = se(), m = Pe(), u = dt(qe(Fe())), g = q([]), h = q(n.combinations[0].combinationKey || ""), f = S(
1949
1949
  () => g.value.findIndex((P) => P.combinationKey == h.value)
1950
1950
  ), v = S(
1951
1951
  () => n.combinations.map((P) => ({
@@ -1955,19 +1955,19 @@ const Tr = /* @__PURE__ */ ie({
1955
1955
  ), _ = S(() => {
1956
1956
  var i, b;
1957
1957
  if (!w.value) return null;
1958
- const P = ((b = (i = g.value[p.value]) == null ? void 0 : i.groups) == null ? void 0 : b.find((T) => T._id === n.groupId)) || {
1958
+ const P = ((b = (i = g.value[f.value]) == null ? void 0 : i.groups) == null ? void 0 : b.find((x) => x._id === n.groupId)) || {
1959
1959
  _id: n.groupId,
1960
1960
  groupKey: ""
1961
- }, I = s.state.menu.modules.group.find((T) => T._id === n.groupId), d = Object.entries({ ...P, items: void 0 }).filter(([, T]) => !!T), l = {
1961
+ }, I = s.state.menu.modules.group.find((x) => x._id === n.groupId), d = Object.entries({ ...P, items: void 0 }).filter(([, x]) => !!x), l = {
1962
1962
  ...I,
1963
1963
  ...Object.fromEntries(d),
1964
- items: I.items.map((T) => {
1964
+ items: I.items.map((x) => {
1965
1965
  var M;
1966
1966
  const y = (M = P.items) == null ? void 0 : M.find(
1967
- (W) => W._id == T._id && W.combinationKey == T.combinationKey
1967
+ (W) => W._id == x._id && W.combinationKey == x.combinationKey
1968
1968
  );
1969
1969
  return {
1970
- ...T,
1970
+ ...x,
1971
1971
  ...y ?? {},
1972
1972
  price: (y == null ? void 0 : y.price) || null,
1973
1973
  priceTiers: (y == null ? void 0 : y.priceTiers) || null,
@@ -1979,17 +1979,17 @@ const Tr = /* @__PURE__ */ ie({
1979
1979
  });
1980
1980
  function r(P) {
1981
1981
  var l, i;
1982
- const L = (l = g.value[p.value].groups) == null ? void 0 : l.findIndex(
1982
+ const L = (l = g.value[f.value].groups) == null ? void 0 : l.findIndex(
1983
1983
  (b) => b._id === n.groupId
1984
1984
  ), I = me(g.value), d = { ...Qt(P), _id: n.groupId, groupKey: "" };
1985
- (L ?? -1) < 0 ? I[p.value] = {
1986
- ...I[p.value],
1987
- groups: [...((i = I[p.value]) == null ? void 0 : i.groups) || [], d]
1988
- } : I[p.value].groups[L] = d, g.value = I;
1985
+ (L ?? -1) < 0 ? I[f.value] = {
1986
+ ...I[f.value],
1987
+ groups: [...((i = I[f.value]) == null ? void 0 : i.groups) || [], d]
1988
+ } : I[f.value].groups[L] = d, g.value = I;
1989
1989
  }
1990
- function E(P) {
1990
+ function T(P) {
1991
1991
  const L = v.value.length;
1992
- let I = p.value;
1992
+ let I = f.value;
1993
1993
  P === "left" ? I = I === 0 ? L - 1 : I - 1 : I = I === L - 1 ? 0 : I + 1, h.value = v.value[I].value;
1994
1994
  }
1995
1995
  function k(P) {
@@ -2021,7 +2021,7 @@ const Tr = /* @__PURE__ */ ie({
2021
2021
  }))
2022
2022
  };
2023
2023
  });
2024
- f("update:combinations", P);
2024
+ p("update:combinations", P);
2025
2025
  }
2026
2026
  const w = q(!1);
2027
2027
  ye(
@@ -2035,7 +2035,7 @@ const Tr = /* @__PURE__ */ ie({
2035
2035
  show: (U = c.value) == null ? void 0 : U.show,
2036
2036
  trigger: (N = c.value) == null ? void 0 : N.trigger
2037
2037
  });
2038
- const { t: x } = ce();
2038
+ const { t: E } = ce();
2039
2039
  return (P, L) => {
2040
2040
  const I = H("fm-select"), d = H("fm-button"), l = H("fm-card");
2041
2041
  return V(), Q(yn, {
@@ -2046,7 +2046,7 @@ const Tr = /* @__PURE__ */ ie({
2046
2046
  config: k,
2047
2047
  group: _.value,
2048
2048
  action: "update",
2049
- title: a(x)("menu.group.update"),
2049
+ title: a(E)("menu.group.update"),
2050
2050
  "onUpdate:group": L[3] || (L[3] = (i) => r(i)),
2051
2051
  "onSubmit:group": L[4] || (L[4] = (i) => F()),
2052
2052
  "onStatus:show": L[5] || (L[5] = (i) => w.value = i)
@@ -2061,7 +2061,7 @@ const Tr = /* @__PURE__ */ ie({
2061
2061
  variant: "outlined"
2062
2062
  }, {
2063
2063
  default: Y(() => [
2064
- G("p", Rr, ge(a(x)("menu.group.option.variant")), 1),
2064
+ G("p", Rr, ge(a(E)("menu.group.option.variant")), 1),
2065
2065
  G("div", Ar, [
2066
2066
  C(I, {
2067
2067
  modelValue: h.value,
@@ -2074,13 +2074,13 @@ const Tr = /* @__PURE__ */ ie({
2074
2074
  variant: a(Ke).Tertiary,
2075
2075
  "prepend-icon": "keyboard_arrow_left",
2076
2076
  size: "lg",
2077
- onClick: L[1] || (L[1] = (i) => E("left"))
2077
+ onClick: L[1] || (L[1] = (i) => T("left"))
2078
2078
  }, null, 8, ["variant"]),
2079
2079
  C(d, {
2080
2080
  variant: a(Ke).Tertiary,
2081
2081
  "prepend-icon": "keyboard_arrow_right",
2082
2082
  size: "lg",
2083
- onClick: L[2] || (L[2] = (i) => E("right"))
2083
+ onClick: L[2] || (L[2] = (i) => T("right"))
2084
2084
  }, null, 8, ["variant"])
2085
2085
  ])
2086
2086
  ])
@@ -2104,21 +2104,21 @@ const Tr = /* @__PURE__ */ ie({
2104
2104
  groupIds: {}
2105
2105
  },
2106
2106
  setup(t) {
2107
- const o = t, e = Pe(), { emitData: n, emitAction: f } = Dt(), s = se(), m = S(() => s.rules.group), u = S(() => s.groups);
2107
+ const o = t, e = Pe(), { emitData: n, emitAction: p } = Dt(), s = se(), m = S(() => s.rules.group), u = S(() => s.groups);
2108
2108
  function g(F) {
2109
- return me(F ?? []).sort((c, x) => c.position - x.position);
2109
+ return me(F ?? []).sort((c, E) => c.position - E.position);
2110
2110
  }
2111
2111
  const h = S(() => g(u.value).reduce((F, w) => (F[w._id] = {
2112
2112
  name: w.name,
2113
2113
  type: en(s.items, w.items)
2114
- }, F), {})), p = S(() => [
2114
+ }, F), {})), f = S(() => [
2115
2115
  ...Object.entries(h.value).map(([F, { name: w, type: c }]) => ({
2116
2116
  label: `${w} ${m.value.type ? `(${It(c)})` : ""}`.trim(),
2117
2117
  value: F
2118
2118
  }))
2119
2119
  ]), v = S(() => !!s.state.currentCatalogId || !!s.state.currentSchedulerId);
2120
2120
  S(() => {
2121
- const F = !s.state.currentSchedulerId, w = s.rules.group.type, c = s.version == Z.F_MENU_VERSION.enum.v3, x = s.rules.item.orderFromActiveOnly, U = s.rules.item.bindToVariant;
2121
+ const F = !s.state.currentSchedulerId, w = s.rules.group.type, c = s.version == Z.F_MENU_VERSION.enum.v3, E = s.rules.item.orderFromActiveOnly, U = s.rules.item.bindToVariant;
2122
2122
  return function(P) {
2123
2123
  return {
2124
2124
  isDefault: (L) => !v.value && !L,
@@ -2130,7 +2130,7 @@ const Tr = /* @__PURE__ */ ie({
2130
2130
  priceTier: s.isV4,
2131
2131
  inventory: F ? c ? !v.value && P.type == Z.F_ADDON_GROUP_TYPE.enum.NORMAL : !v.value : !1,
2132
2132
  orderFrom: (L) => F ? c ? P.type == Z.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? v.value : !!v.value == !L : v.value : !1,
2133
- orderFromActiveOnly: x,
2133
+ orderFromActiveOnly: E,
2134
2134
  showOrderFrom: F ? c ? v.value ? !0 : P.type == Z.F_ADDON_GROUP_TYPE.enum.PRODUCT : v.value : !1,
2135
2135
  bindToVariant: U,
2136
2136
  isOverride: v.value,
@@ -2145,26 +2145,26 @@ const Tr = /* @__PURE__ */ ie({
2145
2145
  position: s.groups.length - 1,
2146
2146
  itemsLinked: []
2147
2147
  }));
2148
- const _ = q(me(o.groupIds || [])), r = q(""), { t: E } = ce(), k = () => {
2149
- n(_.value), f("primary"), e.close();
2148
+ const _ = q(me(o.groupIds || [])), r = q(""), { t: T } = ce(), k = () => {
2149
+ n(_.value), p("primary"), e.close();
2150
2150
  };
2151
2151
  return (F, w) => {
2152
- const c = H("FmSearch"), x = H("FmCheckbox"), U = H("FmButton");
2153
- return p.value.length > 0 ? (V(), J("div", Br, [
2152
+ const c = H("FmSearch"), E = H("FmCheckbox"), U = H("FmButton");
2153
+ return f.value.length > 0 ? (V(), J("div", Br, [
2154
2154
  G("div", null, [
2155
2155
  C(c, {
2156
2156
  autofocus: "",
2157
2157
  modelValue: r.value,
2158
2158
  "onUpdate:modelValue": w[0] || (w[0] = (N) => r.value = N),
2159
- placeholder: a(E)("menu.common.labels.search_groups")
2159
+ placeholder: a(T)("menu.common.labels.search_groups")
2160
2160
  }, null, 8, ["modelValue", "placeholder"])
2161
2161
  ]),
2162
2162
  G("div", Yr, [
2163
2163
  G("div", null, [
2164
- (V(!0), J(xe, null, Ue(p.value, (N) => (V(), J("div", {
2164
+ (V(!0), J(xe, null, Ue(f.value, (N) => (V(), J("div", {
2165
2165
  key: N.value
2166
2166
  }, [
2167
- ut(C(x, {
2167
+ ut(C(E, {
2168
2168
  modelValue: _.value,
2169
2169
  "onUpdate:modelValue": [
2170
2170
  w[1] || (w[1] = (P) => _.value = P),
@@ -2182,7 +2182,7 @@ const Tr = /* @__PURE__ */ ie({
2182
2182
  C(a(Bt), null, {
2183
2183
  default: Y(({ trigger: N }) => [
2184
2184
  C(U, {
2185
- label: a(E)("menu.common.actions.add_group"),
2185
+ label: a(T)("menu.common.actions.add_group"),
2186
2186
  variant: "tertiary",
2187
2187
  "text-color": "primary",
2188
2188
  onClick: (P) => N()
@@ -2192,25 +2192,25 @@ const Tr = /* @__PURE__ */ ie({
2192
2192
  }),
2193
2193
  G("div", jr, [
2194
2194
  C(U, {
2195
- label: a(E)("menu.common.actions.cancel"),
2195
+ label: a(T)("menu.common.actions.cancel"),
2196
2196
  variant: "tertiary",
2197
2197
  onClick: w[3] || (w[3] = (N) => a(e).close())
2198
2198
  }, null, 8, ["label"]),
2199
2199
  C(U, {
2200
- label: a(E)("menu.common.actions.confirm"),
2200
+ label: a(T)("menu.common.actions.confirm"),
2201
2201
  onClick: w[4] || (w[4] = (N) => k())
2202
2202
  }, null, 8, ["label"])
2203
2203
  ])
2204
2204
  ])
2205
2205
  ])) : (V(), J("div", Wr, [
2206
2206
  G("div", Hr, [
2207
- G("p", qr, ge(a(E)("menu.common.empty.no_group.title")), 1),
2208
- G("p", Xr, ge(a(E)("menu.common.empty.no_group.subtitle")), 1)
2207
+ G("p", qr, ge(a(T)("menu.common.empty.no_group.title")), 1),
2208
+ G("p", Xr, ge(a(T)("menu.common.empty.no_group.subtitle")), 1)
2209
2209
  ]),
2210
2210
  C(a(Bt), null, {
2211
2211
  default: Y(({ trigger: N }) => [
2212
2212
  C(U, {
2213
- label: a(E)("menu.common.actions.add_group"),
2213
+ label: a(T)("menu.common.actions.add_group"),
2214
2214
  icon: "add",
2215
2215
  onClick: (P) => N()
2216
2216
  }, null, 8, ["label", "onClick"])
@@ -2237,25 +2237,25 @@ const Tr = /* @__PURE__ */ ie({
2237
2237
  setup(t, {
2238
2238
  emit: o
2239
2239
  }) {
2240
- const e = t, n = se(), f = Pe(), {
2240
+ const e = t, n = se(), p = Pe(), {
2241
2241
  t: s
2242
2242
  } = ce(), m = o, u = S(() => n.rules.group), g = S(() => n.rules.item), h = S(() => n.groups);
2243
- function p(l, i) {
2244
- return me(i ?? []).map((T) => {
2245
- const y = l.find((M) => M._id === T._id);
2243
+ function f(l, i) {
2244
+ return me(i ?? []).map((x) => {
2245
+ const y = l.find((M) => M._id === x._id);
2246
2246
  return {
2247
2247
  name: (y == null ? void 0 : y.name) ?? "",
2248
- ...T,
2248
+ ...x,
2249
2249
  position: y == null ? void 0 : y.position
2250
2250
  };
2251
2251
  });
2252
2252
  }
2253
2253
  const v = S(() => {
2254
2254
  var i;
2255
- return [..._(p(h.value, e.form.groups || ((i = e.fallback) == null ? void 0 : i.groups) || [])).map((b) => b._id)];
2255
+ return [..._(f(h.value, e.form.groups || ((i = e.fallback) == null ? void 0 : i.groups) || [])).map((b) => b._id)];
2256
2256
  });
2257
2257
  function _(l) {
2258
- return me(l ?? []).sort((b, T) => b.position - T.position);
2258
+ return me(l ?? []).sort((b, x) => b.position - x.position);
2259
2259
  }
2260
2260
  function r(l) {
2261
2261
  const i = h.value.find((y) => y._id === l);
@@ -2278,10 +2278,10 @@ const Tr = /* @__PURE__ */ ie({
2278
2278
  })})` : M;
2279
2279
  });
2280
2280
  }
2281
- const E = S(() => _(h.value).reduce((l, i) => (l[i._id] = {
2281
+ const T = S(() => _(h.value).reduce((l, i) => (l[i._id] = {
2282
2282
  name: i.name,
2283
2283
  type: en(n.items, i.items)
2284
- }, l), {})), k = S(() => [...Object.entries(E.value).map(([l, {
2284
+ }, l), {})), k = S(() => [...Object.entries(T.value).map(([l, {
2285
2285
  name: i,
2286
2286
  type: b
2287
2287
  }]) => ({
@@ -2303,7 +2303,7 @@ const Tr = /* @__PURE__ */ ie({
2303
2303
  cell: (l) => {
2304
2304
  var b;
2305
2305
  const i = l.row.original._id;
2306
- return It((b = E.value[i]) == null ? void 0 : b.type);
2306
+ return It((b = T.value[i]) == null ? void 0 : b.type);
2307
2307
  }
2308
2308
  }, {
2309
2309
  accessorKey: "items",
@@ -2311,7 +2311,7 @@ const Tr = /* @__PURE__ */ ie({
2311
2311
  enableSorting: !1,
2312
2312
  size: 200,
2313
2313
  cell: (l) => {
2314
- const i = l.row.original._id, T = r(i).join(", ");
2314
+ const i = l.row.original._id, x = r(i).join(", ");
2315
2315
  return C(we.FmTooltip, {
2316
2316
  "z-index": 51,
2317
2317
  class: "flex",
@@ -2320,14 +2320,14 @@ const Tr = /* @__PURE__ */ ie({
2320
2320
  }, {
2321
2321
  default: () => C("div", {
2322
2322
  class: "line-clamp-2 break-all"
2323
- }, [T]),
2323
+ }, [x]),
2324
2324
  content: () => C("div", {
2325
2325
  class: "py-12 px-16 space-y-12"
2326
2326
  }, [C("p", {
2327
2327
  class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-600"
2328
2328
  }, [s("menu.group.list.columns.products")]), C("div", {
2329
2329
  class: "flex flex-wrap gap-8"
2330
- }, [T])])
2330
+ }, [x])])
2331
2331
  });
2332
2332
  }
2333
2333
  }, {
@@ -2370,21 +2370,21 @@ const Tr = /* @__PURE__ */ ie({
2370
2370
  type: n.version !== Z.F_MENU_VERSION.enum.v4
2371
2371
  }));
2372
2372
  function c() {
2373
- f.open({
2373
+ p.open({
2374
2374
  title: s("menu.product.form.group.add"),
2375
2375
  contentComponent: Jr,
2376
2376
  contentComponentProps: {
2377
2377
  groupIds: v.value
2378
2378
  }
2379
2379
  }).onPrimary((l) => {
2380
- x(l);
2380
+ E(l);
2381
2381
  });
2382
2382
  }
2383
- function x(l) {
2384
- const i = l.reduce((b, T) => {
2383
+ function E(l) {
2384
+ const i = l.reduce((b, x) => {
2385
2385
  var M;
2386
- const y = ((M = e.form.groups) == null ? void 0 : M.find((W) => W._id === T)) || {
2387
- _id: T,
2386
+ const y = ((M = e.form.groups) == null ? void 0 : M.find((W) => W._id === x)) || {
2387
+ _id: x,
2388
2388
  groupKey: ""
2389
2389
  };
2390
2390
  return b.push(y), b;
@@ -2395,13 +2395,13 @@ const Tr = /* @__PURE__ */ ie({
2395
2395
  }));
2396
2396
  }
2397
2397
  function U(l) {
2398
- var b, T, y;
2398
+ var b, x, y;
2399
2399
  if (!e.form.groups)
2400
2400
  return;
2401
2401
  const i = me(e.form.groups);
2402
2402
  i.splice(i.findIndex((M) => M._id === l), 1);
2403
2403
  for (const M of ((b = e.form.variant) == null ? void 0 : b.variantCombinations) || [])
2404
- (y = M.groups) == null || y.splice((T = M.groups) == null ? void 0 : T.findIndex((W) => W._id === l), 1);
2404
+ (y = M.groups) == null || y.splice((x = M.groups) == null ? void 0 : x.findIndex((W) => W._id === l), 1);
2405
2405
  m("replace:form", Ut(n, {
2406
2406
  ...e.form,
2407
2407
  groups: i
@@ -2422,7 +2422,7 @@ const Tr = /* @__PURE__ */ ie({
2422
2422
  var b;
2423
2423
  if (!l) return !1;
2424
2424
  if (g.value.overrideProductGroup) return !0;
2425
- switch ((b = E.value[l]) == null ? void 0 : b.type) {
2425
+ switch ((b = T.value[l]) == null ? void 0 : b.type) {
2426
2426
  case Z.F_ADDON_GROUP_TYPE.enum.DYNAMIC:
2427
2427
  return !0;
2428
2428
  case Z.F_ADDON_GROUP_TYPE.enum.PRODUCT:
@@ -2433,7 +2433,7 @@ const Tr = /* @__PURE__ */ ie({
2433
2433
  return !1;
2434
2434
  }
2435
2435
  }
2436
- ye(() => h.value.length, () => x([...v.value, h.value[h.value.length - 1]._id]));
2436
+ ye(() => h.value.length, () => E([...v.value, h.value[h.value.length - 1]._id]));
2437
2437
  const I = (l) => {
2438
2438
  var i;
2439
2439
  return (i = k.value.find((b) => b.value === l)) == null ? void 0 : i.label;
@@ -2445,7 +2445,7 @@ const Tr = /* @__PURE__ */ ie({
2445
2445
  }) : m("update:form", "groups", l[0].groups || []);
2446
2446
  };
2447
2447
  return (l, i) => {
2448
- const b = H("FmButton"), T = H("FmTable");
2448
+ const b = H("FmButton"), x = H("FmTable");
2449
2449
  return V(), Q(Se, {
2450
2450
  title: a(s)("menu.product.form.group.title"),
2451
2451
  "sub-title": a(s)("menu.product.form.group.subtitle"),
@@ -2461,7 +2461,7 @@ const Tr = /* @__PURE__ */ ie({
2461
2461
  default: Y(() => [C(tn, null, {
2462
2462
  default: Y(() => {
2463
2463
  var y;
2464
- return [((y = v.value) == null ? void 0 : y.length) > 0 ? (V(), Q(T, {
2464
+ return [((y = v.value) == null ? void 0 : y.length) > 0 ? (V(), Q(x, {
2465
2465
  key: 0,
2466
2466
  "column-defs": F.value,
2467
2467
  "column-visibility": w.value,
@@ -2503,22 +2503,22 @@ const Tr = /* @__PURE__ */ ie({
2503
2503
  }) {
2504
2504
  const {
2505
2505
  t: e
2506
- } = ce(), n = t, f = o, s = se(), m = S(() => s.rules.item), u = S(() => m.value.inventory);
2506
+ } = ce(), n = t, p = o, s = se(), m = S(() => s.rules.item), u = S(() => m.value.inventory);
2507
2507
  function g(k, F, w, c) {
2508
2508
  return !F || F && F.length === 0 ? [{
2509
2509
  _id: "",
2510
2510
  name: w || "",
2511
2511
  binding: k || []
2512
- }] : F.map((x) => ({
2513
- _id: x.combinationKey || "",
2514
- name: an(x.combinationKey || "", c),
2515
- binding: x.inventoryBindings || []
2512
+ }] : F.map((E) => ({
2513
+ _id: E.combinationKey || "",
2514
+ name: an(E.combinationKey || "", c),
2515
+ binding: E.inventoryBindings || []
2516
2516
  }));
2517
2517
  }
2518
2518
  const h = S(() => {
2519
2519
  var k;
2520
2520
  return n.form.name || ((k = n.fallback) == null ? void 0 : k.name) || "";
2521
- }), p = S(() => {
2521
+ }), f = S(() => {
2522
2522
  var k;
2523
2523
  return g(n.form.inventoryBindings || [], ((k = n.form.variant) == null ? void 0 : k.variantCombinations) || [], h.value, s.variants);
2524
2524
  });
@@ -2542,7 +2542,7 @@ const Tr = /* @__PURE__ */ ie({
2542
2542
  ...w,
2543
2543
  inventoryBindings: F
2544
2544
  };
2545
- f("replace:form", w);
2545
+ p("replace:form", w);
2546
2546
  }
2547
2547
  q([{
2548
2548
  accessorKey: "name",
@@ -2604,14 +2604,14 @@ const Tr = /* @__PURE__ */ ie({
2604
2604
  for (const F of _.value)
2605
2605
  F.getKey() === k && F.trigger(!0);
2606
2606
  }
2607
- const E = ho();
2607
+ const T = ho();
2608
2608
  return $e(() => {
2609
- E.readInventory();
2609
+ T.readInventory();
2610
2610
  }), (k, F) => (V(), Q(Se, {
2611
2611
  title: a(e)("menu.inventory.title"),
2612
2612
  subTitle: a(e)("menu.inventory.subtitle")
2613
2613
  }, {
2614
- default: Y(() => [G("div", Zr, [G("div", ea, [(V(!0), J(xe, null, Ue(p.value, (w) => (V(), Q(a(Ct), {
2614
+ default: Y(() => [G("div", Zr, [G("div", ea, [(V(!0), J(xe, null, Ue(f.value, (w) => (V(), Q(a(Ct), {
2615
2615
  key: w._id,
2616
2616
  ref_for: !0,
2617
2617
  ref_key: "inventoryManagerForms",
@@ -2626,7 +2626,7 @@ const Tr = /* @__PURE__ */ ie({
2626
2626
  v(w._id, c);
2627
2627
  }
2628
2628
  }, null, 8, ["title", "name", "bindingKey", "initialValue", "onUpdate:inventory"]))), 128)), C(a(wo), {
2629
- "row-data": p.value,
2629
+ "row-data": f.value,
2630
2630
  onRowClick: r
2631
2631
  }, null, 8, ["row-data"])])])]),
2632
2632
  _: 1
@@ -2654,40 +2654,40 @@ const Tr = /* @__PURE__ */ ie({
2654
2654
  },
2655
2655
  emits: ["update:form"],
2656
2656
  setup(t, { emit: o }) {
2657
- const e = t, n = Ze(), f = se(), { t: s } = ce(), m = o, u = S(() => f.rules.item), g = S(() => {
2657
+ const e = t, n = Ze(), p = se(), { t: s } = ce(), m = o, u = S(() => p.rules.item), g = S(() => {
2658
2658
  var U, N;
2659
- const c = e.isOverride ? ((U = e.fallback) == null ? void 0 : U.unit) ?? ((N = e.fallback) == null ? void 0 : N.perXUnit) : void 0, x = e.form.unit ?? e.form.perXUnit ?? c;
2660
- return x != null;
2659
+ const c = e.isOverride ? ((U = e.fallback) == null ? void 0 : U.unit) ?? ((N = e.fallback) == null ? void 0 : N.perXUnit) : void 0, E = e.form.unit ?? e.form.perXUnit ?? c;
2660
+ return E != null;
2661
2661
  }), h = (c) => {
2662
2662
  m("update:form", "unit", c ? "" : void 0), m("update:form", "perXUnit", c ? 0 : void 0);
2663
- }, p = S(() => {
2664
- const c = f.isV4;
2663
+ }, f = S(() => {
2664
+ const c = p.isV4;
2665
2665
  return mt.setCoreStore(n).taxSetting(c);
2666
2666
  }), v = S(() => {
2667
2667
  var c;
2668
2668
  return mt.getSelectedTax(
2669
2669
  e.form.taxes,
2670
2670
  (c = e.fallback) == null ? void 0 : c.taxes,
2671
- p.value.countryTaxOptions
2671
+ f.value.countryTaxOptions
2672
2672
  );
2673
2673
  });
2674
2674
  function _(c) {
2675
- const x = c.replace(/[^0-9.]/g, "");
2675
+ const E = c.replace(/[^0-9.]/g, "");
2676
2676
  if (!c) return !1;
2677
- m("update:form", "perXUnit", parseFloat(x));
2677
+ m("update:form", "perXUnit", parseFloat(E));
2678
2678
  }
2679
2679
  function r(c) {
2680
2680
  if (!c && e.form.perXUnit) {
2681
- const [x, U] = e.form.perXUnit.toString().split(".");
2681
+ const [E, U] = e.form.perXUnit.toString().split(".");
2682
2682
  if (U && U.length > 4) {
2683
2683
  const P = (typeof e.form.perXUnit == "string" ? parseFloat(e.form.perXUnit) : e.form.perXUnit).toFixed(4);
2684
2684
  m("update:form", "perXUnit", parseFloat(P));
2685
2685
  }
2686
2686
  }
2687
2687
  }
2688
- const E = q(!1);
2688
+ const T = q(!1);
2689
2689
  async function k() {
2690
- var x, U, N, P, L, I, d, l;
2690
+ var E, U, N, P, L, I, d, l;
2691
2691
  if (!(e.form.name || "")) {
2692
2692
  const i = document.getElementById("product-name");
2693
2693
  if (i) {
@@ -2696,9 +2696,9 @@ const Tr = /* @__PURE__ */ ie({
2696
2696
  } else
2697
2697
  return;
2698
2698
  }
2699
- if (!E.value)
2699
+ if (!T.value)
2700
2700
  try {
2701
- E.value = !0, n.pushDataLayer({ event: "menu_catalog_item_price_remy_suggest_pricing" }), Ge.toggleDialog(!0), Ge.registerOnSelect((i) => {
2701
+ T.value = !0, n.pushDataLayer({ event: "menu_catalog_item_price_remy_suggest_pricing" }), Ge.toggleDialog(!0), Ge.registerOnSelect((i) => {
2702
2702
  typeof i == "number" && m(
2703
2703
  "update:form",
2704
2704
  "price",
@@ -2710,20 +2710,20 @@ const Tr = /* @__PURE__ */ ie({
2710
2710
  d,
2711
2711
  {
2712
2712
  name: e.form.name || "",
2713
- lat: (N = (U = (x = n.currentRestaurant) == null ? void 0 : x.value) == null ? void 0 : U.profile.address.coordinates) == null ? void 0 : N[1],
2713
+ lat: (N = (U = (E = n.currentRestaurant) == null ? void 0 : E.value) == null ? void 0 : U.profile.address.coordinates) == null ? void 0 : N[1],
2714
2714
  lon: (I = (L = (P = n.currentRestaurant) == null ? void 0 : P.value) == null ? void 0 : L.profile.address.coordinates) == null ? void 0 : I[0]
2715
2715
  },
2716
2716
  !0
2717
2717
  ));
2718
2718
  } finally {
2719
- E.value = !1;
2719
+ T.value = !1;
2720
2720
  }
2721
2721
  }
2722
- const F = Co(f), w = S(() => {
2723
- var c;
2724
- return ((c = f.currentCatalog) == null ? void 0 : c.usePriceTiers) ?? [];
2722
+ const F = Co(p), w = S(() => {
2723
+ var c, E;
2724
+ return ((c = p.currentCatalog) == null ? void 0 : c.priceTierRules) ?? ((E = p.currentCatalog) == null ? void 0 : E.usePriceTiers) ?? [];
2725
2725
  });
2726
- return (c, x) => {
2726
+ return (c, E) => {
2727
2727
  const U = H("fm-select"), N = H("FmButton"), P = H("fm-checkbox"), L = H("fm-text-field"), I = Wt("tooltip");
2728
2728
  return V(), Q(Se, {
2729
2729
  title: a(s)("menu.product.form.price.title")
@@ -2736,7 +2736,7 @@ const Tr = /* @__PURE__ */ ie({
2736
2736
  class: fe(["flex space-x-16", "xs:flex-col xs:space-x-0 xs:space-y-16"])
2737
2737
  }, [
2738
2738
  C(je, {
2739
- disable: w.value.length > 0 && a(f).currentCatalog && !a(f).currentScheduler,
2739
+ disable: w.value.length > 0 && a(p).currentCatalog && !a(p).currentScheduler,
2740
2740
  min: 0,
2741
2741
  "model-value": c.form.price || null,
2742
2742
  placeholder: (d = c.fallback) != null && d.price ? a(Qe)(c.fallback.price, !1) : void 0,
@@ -2746,7 +2746,7 @@ const Tr = /* @__PURE__ */ ie({
2746
2746
  class: "w-[258px] xs:w-full",
2747
2747
  label: a(s)("menu.product.form.price.fields.selling_price.label"),
2748
2748
  "show-currency": "",
2749
- "onUpdate:modelValue": x[0] || (x[0] = (l) => l && m("update:form", "price", l))
2749
+ "onUpdate:modelValue": E[0] || (E[0] = (l) => l && m("update:form", "price", l))
2750
2750
  }, {
2751
2751
  append: Y(() => [
2752
2752
  ut(C(Xt, {
@@ -2759,19 +2759,19 @@ const Tr = /* @__PURE__ */ ie({
2759
2759
  _: 1
2760
2760
  }, 8, ["disable", "model-value", "placeholder", "rules", "label"]),
2761
2761
  C(U, {
2762
- disabled: !u.value.tax || !p.value.systemCode,
2763
- items: p.value.countryTaxOptions,
2764
- label: p.value.systemCode ? a(s)("menu.product.form.price.fields.tax.label_with_code", {
2765
- code: p.value.systemCode
2762
+ disabled: !u.value.tax || !f.value.systemCode,
2763
+ items: f.value.countryTaxOptions,
2764
+ label: f.value.systemCode ? a(s)("menu.product.form.price.fields.tax.label_with_code", {
2765
+ code: f.value.systemCode
2766
2766
  }) : a(s)("menu.product.form.price.fields.tax.label"),
2767
2767
  "model-value": v.value,
2768
2768
  placeholder: "--",
2769
2769
  class: "flex-1",
2770
2770
  "shift-menu": "",
2771
- "onUpdate:modelValue": x[1] || (x[1] = (l) => m("update:form", "taxes", [a(mt).decodeTax(l)]))
2771
+ "onUpdate:modelValue": E[1] || (E[1] = (l) => m("update:form", "taxes", [a(mt).decodeTax(l)]))
2772
2772
  }, null, 8, ["disabled", "items", "label", "model-value"])
2773
2773
  ], 8, na),
2774
- !c.isOverride && a(f).isV4 ? (V(), Q(Ve, {
2774
+ !c.isOverride && a(p).isV4 ? (V(), Q(Ve, {
2775
2775
  key: 0,
2776
2776
  label: a(s)("menu.price_tier.price_group"),
2777
2777
  description: a(s)("menu.price_tier.description")
@@ -2792,7 +2792,7 @@ const Tr = /* @__PURE__ */ ie({
2792
2792
  "price-tiers": a(F).priceTiers.value,
2793
2793
  "model-value": c.form.priceTiers || ((l = c.fallback) == null ? void 0 : l.priceTiers) || {},
2794
2794
  "allow-negative-price": !1,
2795
- "onUpdate:modelValue": x[2] || (x[2] = (i) => m("update:form", "priceTiers", i))
2795
+ "onUpdate:modelValue": E[2] || (E[2] = (i) => m("update:form", "priceTiers", i))
2796
2796
  }, null, 8, ["price-tiers", "model-value"]))
2797
2797
  ];
2798
2798
  }),
@@ -2811,7 +2811,7 @@ const Tr = /* @__PURE__ */ ie({
2811
2811
  value: c.form.openPrice,
2812
2812
  label: a(s)("menu.product.form.price.settings.open_price.label"),
2813
2813
  sublabel: a(s)("menu.product.form.price.settings.open_price.sublabel"),
2814
- "onUpdate:modelValue": x[3] || (x[3] = (T) => m("update:form", "openPrice", T))
2814
+ "onUpdate:modelValue": E[3] || (E[3] = (x) => m("update:form", "openPrice", x))
2815
2815
  }, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
2816
2816
  G("div", ra, [
2817
2817
  C(P, {
@@ -2829,8 +2829,8 @@ const Tr = /* @__PURE__ */ ie({
2829
2829
  disabled: !u.value.unit,
2830
2830
  "model-value": c.form.perXUnit || ((i = c.fallback) == null ? void 0 : i.perXUnit) || null,
2831
2831
  rules: [
2832
- (T) => !!T || a(s)("menu.product.form.price.settings.sell_by_unit.per_unit.required"),
2833
- (T) => !T || T > 0 || a(s)("menu.product.form.price.settings.sell_by_unit.per_unit.min")
2832
+ (x) => !!x || a(s)("menu.product.form.price.settings.sell_by_unit.per_unit.required"),
2833
+ (x) => !x || x > 0 || a(s)("menu.product.form.price.settings.sell_by_unit.per_unit.min")
2834
2834
  ],
2835
2835
  inputmode: "numeric",
2836
2836
  placeholder: a(s)("menu.product.form.price.settings.sell_by_unit.per_unit.placeholder"),
@@ -2844,10 +2844,10 @@ const Tr = /* @__PURE__ */ ie({
2844
2844
  disabled: !u.value.unit,
2845
2845
  "model-value": c.form.unit || ((b = c.fallback) == null ? void 0 : b.unit) || null,
2846
2846
  rules: [
2847
- (T) => !!T || a(s)("menu.product.form.price.settings.sell_by_unit.unit.required")
2847
+ (x) => !!x || a(s)("menu.product.form.price.settings.sell_by_unit.unit.required")
2848
2848
  ],
2849
2849
  placeholder: a(s)("menu.product.form.price.settings.sell_by_unit.unit.placeholder"),
2850
- "onUpdate:modelValue": x[4] || (x[4] = (T) => m("update:form", "unit", T))
2850
+ "onUpdate:modelValue": E[4] || (E[4] = (x) => m("update:form", "unit", x))
2851
2851
  }, null, 8, ["disabled", "model-value", "rules", "placeholder"])
2852
2852
  ])
2853
2853
  ])) : X("", !0)
@@ -2857,7 +2857,7 @@ const Tr = /* @__PURE__ */ ie({
2857
2857
  "model-value": !!c.form.costing,
2858
2858
  value: !!c.form.costing,
2859
2859
  label: a(s)("menu.product.form.price.settings.track_costing.label"),
2860
- "onUpdate:modelValue": x[5] || (x[5] = (T) => m("update:form", "costing", T ? a(be.Dinero).zero().toObject() : void 0))
2860
+ "onUpdate:modelValue": E[5] || (E[5] = (x) => m("update:form", "costing", x ? a(be.Dinero).zero().toObject() : void 0))
2861
2861
  }, null, 8, ["model-value", "value", "label"]),
2862
2862
  c.form.costing ? (V(), J("div", da, [
2863
2863
  G("div", ca, [
@@ -2867,7 +2867,7 @@ const Tr = /* @__PURE__ */ ie({
2867
2867
  "model-value": c.form.costing || null,
2868
2868
  nullable: "",
2869
2869
  "show-currency": "",
2870
- "onUpdate:modelValue": x[6] || (x[6] = (T) => m("update:form", "costing", T ?? a(be.Dinero).zero().toObject()))
2870
+ "onUpdate:modelValue": E[6] || (E[6] = (x) => m("update:form", "costing", x ?? a(be.Dinero).zero().toObject()))
2871
2871
  }, null, 8, ["model-value"])
2872
2872
  ])
2873
2873
  ])) : X("", !0)
@@ -2878,7 +2878,7 @@ const Tr = /* @__PURE__ */ ie({
2878
2878
  "model-value": !!c.form.minPrice,
2879
2879
  value: !!c.form.minPrice,
2880
2880
  label: a(s)("menu.product.form.price.settings.min_price.label"),
2881
- "onUpdate:modelValue": x[7] || (x[7] = (T) => m("update:form", "minPrice", T ? a(be.Dinero).zero().toObject() : void 0))
2881
+ "onUpdate:modelValue": E[7] || (E[7] = (x) => m("update:form", "minPrice", x ? a(be.Dinero).zero().toObject() : void 0))
2882
2882
  }, null, 8, ["disabled", "model-value", "value", "label"]),
2883
2883
  G("div", pa, [
2884
2884
  G("div", fa, [
@@ -2889,7 +2889,7 @@ const Tr = /* @__PURE__ */ ie({
2889
2889
  "model-value": c.form.minPrice || null,
2890
2890
  class: "flex-1",
2891
2891
  "show-currency": "",
2892
- "onUpdate:modelValue": x[8] || (x[8] = (T) => m("update:form", "minPrice", T ?? a(be.Dinero).zero().toObject()))
2892
+ "onUpdate:modelValue": E[8] || (E[8] = (x) => m("update:form", "minPrice", x ?? a(be.Dinero).zero().toObject()))
2893
2893
  }, null, 8, ["max", "model-value"])) : X("", !0)
2894
2894
  ])
2895
2895
  ])
@@ -2916,7 +2916,7 @@ const Tr = /* @__PURE__ */ ie({
2916
2916
  },
2917
2917
  emits: ["update:form", "replace:form"],
2918
2918
  setup(t, { emit: o }) {
2919
- const e = t, n = se(), { t: f } = ce(), s = o;
2919
+ const e = t, n = se(), { t: p } = ce(), s = o;
2920
2920
  function m() {
2921
2921
  return {
2922
2922
  ...Re.generator.initMenuV4PrintSetting(),
@@ -2927,10 +2927,10 @@ const Tr = /* @__PURE__ */ ie({
2927
2927
  const u = S(() => n.rules.item), g = S(() => n.printDepartments), h = S(() => {
2928
2928
  var w;
2929
2929
  return ((w = e.form.print) == null ? void 0 : w.sequential) ?? !1;
2930
- }), p = S(() => {
2930
+ }), f = S(() => {
2931
2931
  var w;
2932
2932
  return h.value ? g.value.reduce(
2933
- (c, { _id: x }) => (c.includes(x) || (c = [...c, x]), c),
2933
+ (c, { _id: E }) => (c.includes(E) || (c = [...c, E]), c),
2934
2934
  [...((w = e.form.print) == null ? void 0 : w.department) ?? []]
2935
2935
  ) : g.value.map(({ _id: c }) => c);
2936
2936
  }), v = S(() => g.value.reduce((w, c) => (w[c._id] = c.name, w), {}));
@@ -2948,60 +2948,60 @@ const Tr = /* @__PURE__ */ ie({
2948
2948
  sequential: w
2949
2949
  });
2950
2950
  }
2951
- function E(w) {
2951
+ function T(w) {
2952
2952
  s("update:form", "print", {
2953
2953
  ...m(),
2954
2954
  ...e.form.print,
2955
2955
  department: w.filter((c) => {
2956
- var x;
2957
- return (((x = e.form.print) == null ? void 0 : x.department) ?? []).includes(c);
2956
+ var E;
2957
+ return (((E = e.form.print) == null ? void 0 : E.department) ?? []).includes(c);
2958
2958
  })
2959
2959
  });
2960
2960
  }
2961
2961
  function k(w, c) {
2962
2962
  var U, N;
2963
- let x = [...((N = (U = e.form) == null ? void 0 : U.print) == null ? void 0 : N.department) ?? []];
2964
- c && !x.includes(w) ? x = [...x, w] : c || (x = x.filter((P) => P !== w)), s("update:form", "print", {
2963
+ let E = [...((N = (U = e.form) == null ? void 0 : U.print) == null ? void 0 : N.department) ?? []];
2964
+ c && !E.includes(w) ? E = [...E, w] : c || (E = E.filter((P) => P !== w)), s("update:form", "print", {
2965
2965
  ...m(),
2966
2966
  ...e.form.print,
2967
- department: x
2967
+ department: E
2968
2968
  });
2969
2969
  }
2970
2970
  const F = S(() => [
2971
2971
  {
2972
- label: f("menu.product.form.print.kds.options.all.label"),
2972
+ label: p("menu.product.form.print.kds.options.all.label"),
2973
2973
  value: !1,
2974
- description: f("menu.product.form.print.kds.options.all.description")
2974
+ description: p("menu.product.form.print.kds.options.all.description")
2975
2975
  },
2976
2976
  {
2977
- label: f("menu.product.form.print.kds.options.sequential.label"),
2977
+ label: p("menu.product.form.print.kds.options.sequential.label"),
2978
2978
  value: !0,
2979
- description: f("menu.product.form.print.kds.options.sequential.description")
2979
+ description: p("menu.product.form.print.kds.options.sequential.description")
2980
2980
  }
2981
2981
  ]);
2982
2982
  return ye(
2983
2983
  () => g.value.length,
2984
2984
  () => k(g.value[g.value.length - 1]._id, !0)
2985
2985
  ), (w, c) => {
2986
- const x = H("fm-switch"), U = H("fm-radio"), N = H("fm-radio-group"), P = H("fm-button"), L = H("fm-checkbox");
2986
+ const E = H("fm-switch"), U = H("fm-radio"), N = H("fm-radio-group"), P = H("fm-button"), L = H("fm-checkbox");
2987
2987
  return V(), Q(Se, {
2988
- title: a(f)("menu.product.form.print.title")
2988
+ title: a(p)("menu.product.form.print.title")
2989
2989
  }, {
2990
2990
  default: Y(() => {
2991
2991
  var I;
2992
2992
  return [
2993
2993
  u.value.printConfig ? (V(), Q(Ve, {
2994
2994
  key: 0,
2995
- label: a(f)("menu.product.form.print.config.label")
2995
+ label: a(p)("menu.product.form.print.config.label")
2996
2996
  }, {
2997
2997
  default: Y(() => {
2998
2998
  var d;
2999
2999
  return [
3000
- C(x, {
3000
+ C(E, {
3001
3001
  "model-value": !((d = w.form.print) != null && d.toRoot),
3002
- label: a(f)("menu.product.form.print.config.group_parent.label"),
3002
+ label: a(p)("menu.product.form.print.config.group_parent.label"),
3003
3003
  "label-placement": "right",
3004
- sublabel: a(f)("menu.product.form.print.config.group_parent.sublabel"),
3004
+ sublabel: a(p)("menu.product.form.print.config.group_parent.sublabel"),
3005
3005
  "onUpdate:modelValue": c[0] || (c[0] = (l) => _(l))
3006
3006
  }, null, 8, ["model-value", "label", "sublabel"])
3007
3007
  ];
@@ -3009,7 +3009,7 @@ const Tr = /* @__PURE__ */ ie({
3009
3009
  _: 1
3010
3010
  }, 8, ["label"])) : X("", !0),
3011
3011
  C(N, {
3012
- label: a(f)("menu.product.form.print.kds.label"),
3012
+ label: a(p)("menu.product.form.print.kds.label"),
3013
3013
  "model-value": ((I = w.form.print) == null ? void 0 : I.sequential) ?? !1,
3014
3014
  "onUpdate:modelValue": c[1] || (c[1] = (d) => r(d))
3015
3015
  }, {
@@ -3026,19 +3026,19 @@ const Tr = /* @__PURE__ */ ie({
3026
3026
  _: 1
3027
3027
  }, 8, ["label", "model-value"]),
3028
3028
  C(Ve, {
3029
- label: a(f)("menu.product.form.print.routes.label")
3029
+ label: a(p)("menu.product.form.print.routes.label")
3030
3030
  }, {
3031
3031
  default: Y(() => [
3032
- p.value.length ? (V(), Q(a(Mt), {
3032
+ f.value.length ? (V(), Q(a(Mt), {
3033
3033
  key: 0,
3034
3034
  "item-key": (d) => d,
3035
- "model-value": p.value,
3035
+ "model-value": f.value,
3036
3036
  handle: ".handle",
3037
- "onUpdate:modelValue": c[3] || (c[3] = (d) => E(d)),
3037
+ "onUpdate:modelValue": c[3] || (c[3] = (d) => T(d)),
3038
3038
  class: "space-y-16"
3039
3039
  }, {
3040
3040
  item: Y(({ element: d }) => {
3041
- var l, i, b, T, y;
3041
+ var l, i, b, x, y;
3042
3042
  return [
3043
3043
  G("div", _a, [
3044
3044
  G("div", ba, [
@@ -3054,7 +3054,7 @@ const Tr = /* @__PURE__ */ ie({
3054
3054
  ]),
3055
3055
  C(L, {
3056
3056
  id: d,
3057
- "data-checked": (T = (b = e.form.print) == null ? void 0 : b.department) == null ? void 0 : T.includes(d),
3057
+ "data-checked": (x = (b = e.form.print) == null ? void 0 : b.department) == null ? void 0 : x.includes(d),
3058
3058
  label: v.value[d],
3059
3059
  "model-value": (((y = e.form.print) == null ? void 0 : y.department) ?? []).includes(d),
3060
3060
  value: d,
@@ -3071,7 +3071,7 @@ const Tr = /* @__PURE__ */ ie({
3071
3071
  G("div", ya, [
3072
3072
  C(P, {
3073
3073
  variant: a(Ke).Secondary,
3074
- label: a(f)("menu.product.form.print.routes.add"),
3074
+ label: a(p)("menu.product.form.print.routes.add"),
3075
3075
  "prepend-icon": "add",
3076
3076
  onClick: d
3077
3077
  }, null, 8, ["variant", "label", "onClick"])
@@ -3105,12 +3105,12 @@ const Tr = /* @__PURE__ */ ie({
3105
3105
  setup(t, {
3106
3106
  emit: o
3107
3107
  }) {
3108
- const e = t, n = se(), f = S(() => n.rules.item), {
3108
+ const e = t, n = se(), p = S(() => n.rules.item), {
3109
3109
  t: s
3110
3110
  } = ce(), m = o, {
3111
3111
  hasVariant: u,
3112
3112
  takeaways: g
3113
- } = Hn(e, m, f), h = S(() => [e.isOverride ? {
3113
+ } = Hn(e, m, p), h = S(() => [e.isOverride ? {
3114
3114
  label: s("menu.product.form.takeaway.options.follows_main"),
3115
3115
  value: null
3116
3116
  } : {
@@ -3119,7 +3119,7 @@ const Tr = /* @__PURE__ */ ie({
3119
3119
  }, ...n.takeaways.map((v) => ({
3120
3120
  label: v.name,
3121
3121
  value: v._id
3122
- }))]), p = q([{
3122
+ }))]), f = q([{
3123
3123
  accessorKey: "name",
3124
3124
  enableSorting: !1,
3125
3125
  header: () => u.value ? s("menu.product.form.takeaway.columns.variant") : s("menu.product.form.takeaway.columns.product")
@@ -3133,17 +3133,17 @@ const Tr = /* @__PURE__ */ ie({
3133
3133
  action: "add",
3134
3134
  applyProduct: !1,
3135
3135
  bindToVariant: n.rules.item.bindToVariant,
3136
- "onUpdate:takeaway": async (E) => {
3136
+ "onUpdate:takeaway": async (T) => {
3137
3137
  await n.updateMenu({
3138
3138
  module: Z.F_MENU_MODULE_V4_KEY.enum.takeaway,
3139
3139
  operation: pe.F_OPERATION_TYPE.create,
3140
- data: E,
3141
- link: _o(E.usedBy || [])
3140
+ data: T,
3141
+ link: _o(T.usedBy || [])
3142
3142
  });
3143
3143
  }
3144
3144
  }, {
3145
3145
  default: ({
3146
- trigger: E
3146
+ trigger: T
3147
3147
  }) => ve(we.FmSelect, {
3148
3148
  modelValue: _ || null,
3149
3149
  menuZIndex: 103,
@@ -3156,7 +3156,7 @@ const Tr = /* @__PURE__ */ ie({
3156
3156
  "append-menu": () => n.rules.takeaway.create ? ve("button", {
3157
3157
  class: "flex items-center py-8 px-16 space-x-8",
3158
3158
  type: "button",
3159
- onClick: E
3159
+ onClick: T
3160
3160
  }, [ve(we.FmIcon, {
3161
3161
  name: "add",
3162
3162
  size: "md",
@@ -3175,7 +3175,7 @@ const Tr = /* @__PURE__ */ ie({
3175
3175
  "sub-title": a(s)("menu.product.form.takeaway.subtitle")
3176
3176
  }, {
3177
3177
  default: Y(() => [C(r, {
3178
- columnDefs: p.value,
3178
+ columnDefs: f.value,
3179
3179
  "page-size": a(g).length,
3180
3180
  "row-data": a(g),
3181
3181
  "hide-footer": ""
@@ -3194,7 +3194,7 @@ const Tr = /* @__PURE__ */ ie({
3194
3194
  },
3195
3195
  emits: ["update:show", "submit"],
3196
3196
  setup(t, { emit: o }) {
3197
- const e = t, n = o, f = () => {
3197
+ const e = t, n = o, p = () => {
3198
3198
  setTimeout(() => {
3199
3199
  n("update:show", !1);
3200
3200
  }, 100);
@@ -3209,17 +3209,17 @@ const Tr = /* @__PURE__ */ ie({
3209
3209
  }), U;
3210
3210
  } else
3211
3211
  return { ...Re.generator.initMenuV4VariantGroup(), usedBy: [] };
3212
- }, p = q(h()), v = q(!1), _ = q(!1);
3212
+ }, f = q(h()), v = q(!1), _ = q(!1);
3213
3213
  function r(U) {
3214
- p.value.options = U;
3214
+ f.value.options = U;
3215
3215
  }
3216
- function E(U, N) {
3217
- const P = me(p.value.options), L = P.findIndex((I) => I._id == U);
3218
- P[L].name = N, p.value.options = P, L === p.value.options.length - 1 && k();
3216
+ function T(U, N) {
3217
+ const P = me(f.value.options), L = P.findIndex((I) => I._id == U);
3218
+ P[L].name = N, f.value.options = P, L === f.value.options.length - 1 && k();
3219
3219
  }
3220
3220
  function k() {
3221
- const U = me(p.value.options);
3222
- p.value.options = [
3221
+ const U = me(f.value.options);
3222
+ f.value.options = [
3223
3223
  ...U,
3224
3224
  {
3225
3225
  _id: (/* @__PURE__ */ new Date()).toISOString(),
@@ -3228,11 +3228,11 @@ const Tr = /* @__PURE__ */ ie({
3228
3228
  ];
3229
3229
  }
3230
3230
  function F(U) {
3231
- const N = me(p.value.options);
3232
- p.value.options = N.filter((P) => P._id !== U);
3231
+ const N = me(f.value.options);
3232
+ f.value.options = N.filter((P) => P._id !== U);
3233
3233
  }
3234
3234
  ye(
3235
- () => p.value.options,
3235
+ () => f.value.options,
3236
3236
  (U) => {
3237
3237
  U.length <= 0 && k();
3238
3238
  },
@@ -3247,18 +3247,18 @@ const Tr = /* @__PURE__ */ ie({
3247
3247
  const c = Vt(
3248
3248
  () => {
3249
3249
  if (e.initialValue) {
3250
- const U = p.value.options.filter((N) => !!N.name.trim());
3251
- return !Ce.isEqual({ ...p.value, options: U }, e.initialValue);
3250
+ const U = f.value.options.filter((N) => !!N.name.trim());
3251
+ return !Ce.isEqual({ ...f.value, options: U }, e.initialValue);
3252
3252
  } else
3253
- return !!(p.value.options.length > 1 || p.value.name.trim());
3253
+ return !!(f.value.options.length > 1 || f.value.name.trim());
3254
3254
  },
3255
3255
  () => {
3256
3256
  _.value = !1;
3257
3257
  }
3258
- ), x = async () => {
3258
+ ), E = async () => {
3259
3259
  try {
3260
3260
  v.value = !0;
3261
- const U = me(p.value);
3261
+ const U = me(f.value);
3262
3262
  U.options = U.options.filter((N) => !!N.name.trim()), e.initialValue ? await s.updateMenu({
3263
3263
  module: Z.F_MENU_MODULE_V4_KEY.enum.variant,
3264
3264
  operation: pe.F_OPERATION_TYPE.update,
@@ -3267,7 +3267,7 @@ const Tr = /* @__PURE__ */ ie({
3267
3267
  module: Z.F_MENU_MODULE_V4_KEY.enum.variant,
3268
3268
  operation: pe.F_OPERATION_TYPE.create,
3269
3269
  data: U
3270
- }), f();
3270
+ }), p();
3271
3271
  } finally {
3272
3272
  v.value = !1;
3273
3273
  }
@@ -3275,7 +3275,7 @@ const Tr = /* @__PURE__ */ ie({
3275
3275
  return ye(
3276
3276
  () => _.value,
3277
3277
  (U) => {
3278
- U ? p.value = h() : f();
3278
+ U ? f.value = h() : p();
3279
3279
  }
3280
3280
  ), $e(() => {
3281
3281
  _.value = !0;
@@ -3287,7 +3287,7 @@ const Tr = /* @__PURE__ */ ie({
3287
3287
  "onUpdate:modelValue": N[2] || (N[2] = (l) => _.value = l),
3288
3288
  "is-container": a(we).FmForm,
3289
3289
  "is-container-props": {
3290
- onValidationSuccess: x,
3290
+ onValidationSuccess: E,
3291
3291
  blameFormChildOnValidationFailed: !0
3292
3292
  },
3293
3293
  "max-width": 560,
@@ -3325,8 +3325,8 @@ const Tr = /* @__PURE__ */ ie({
3325
3325
  autofocus: "",
3326
3326
  label: a(m)("menu.variant.form.name.label"),
3327
3327
  "helper-text": a(m)("menu.variant.form.name.helper"),
3328
- modelValue: p.value.name,
3329
- "onUpdate:modelValue": N[0] || (N[0] = (i) => p.value.name = i),
3328
+ modelValue: f.value.name,
3329
+ "onUpdate:modelValue": N[0] || (N[0] = (i) => f.value.name = i),
3330
3330
  rules: [(i) => !!i || a(m)("menu.variant.form.name.required")],
3331
3331
  placeholder: a(m)("menu.variant.form.name.placeholder")
3332
3332
  }, null, 8, ["label", "helper-text", "modelValue", "rules", "placeholder"]),
@@ -3336,7 +3336,7 @@ const Tr = /* @__PURE__ */ ie({
3336
3336
  default: Y(() => [
3337
3337
  G("div", null, [
3338
3338
  C(a(Mt), {
3339
- "model-value": p.value.options,
3339
+ "model-value": f.value.options,
3340
3340
  move: w,
3341
3341
  class: "space-y-16",
3342
3342
  group: "categories",
@@ -3347,9 +3347,9 @@ const Tr = /* @__PURE__ */ ie({
3347
3347
  item: Y(({ element: i, index: b }) => [
3348
3348
  G("div", {
3349
3349
  class: fe(["flex items-center", "space-x-8"]),
3350
- "data-not-allow-sort": b === p.value.options.length - 1
3350
+ "data-not-allow-sort": b === f.value.options.length - 1
3351
3351
  }, [
3352
- b !== p.value.options.length - 1 ? (V(), Q(L, {
3352
+ b !== f.value.options.length - 1 ? (V(), Q(L, {
3353
3353
  key: 0,
3354
3354
  class: "handle",
3355
3355
  name: "drag_handle"
@@ -3358,19 +3358,19 @@ const Tr = /* @__PURE__ */ ie({
3358
3358
  C(P, {
3359
3359
  "model-value": i.name,
3360
3360
  rules: [
3361
- () => !!p.value.options.length || a(m)("menu.variant.form.options.min_required"),
3362
- (T) => b === p.value.options.length - 1 || T ? !0 : a(m)("menu.variant.form.options.name_required")
3361
+ () => !!f.value.options.length || a(m)("menu.variant.form.options.min_required"),
3362
+ (x) => b === f.value.options.length - 1 || x ? !0 : a(m)("menu.variant.form.options.name_required")
3363
3363
  ],
3364
3364
  class: "flex-1",
3365
3365
  placeholder: a(m)("menu.variant.form.options.placeholder"),
3366
- "onUpdate:modelValue": (T) => E(i._id, T)
3366
+ "onUpdate:modelValue": (x) => T(i._id, x)
3367
3367
  }, En({ _: 2 }, [
3368
- b !== p.value.options.length - 1 ? {
3368
+ b !== f.value.options.length - 1 ? {
3369
3369
  name: "append",
3370
3370
  fn: Y(() => [
3371
3371
  C(L, {
3372
3372
  name: "close",
3373
- onClick: (T) => F(i._id)
3373
+ onClick: (x) => F(i._id)
3374
3374
  }, null, 8, ["onClick"])
3375
3375
  ]),
3376
3376
  key: "0"
@@ -3388,10 +3388,10 @@ const Tr = /* @__PURE__ */ ie({
3388
3388
  ]),
3389
3389
  _: 1
3390
3390
  }, 8, ["title"]),
3391
- (l = p.value.usedBy) != null && l.length ? (V(), Q(Io, {
3391
+ (l = f.value.usedBy) != null && l.length ? (V(), Q(Io, {
3392
3392
  key: 0,
3393
3393
  editable: !1,
3394
- overrides: p.value.usedBy || [],
3394
+ overrides: f.value.usedBy || [],
3395
3395
  "select-variant": !1,
3396
3396
  title: a(m)("menu.variant.form.applied_product")
3397
3397
  }, null, 8, ["overrides", "title"])) : X("", !0)
@@ -3429,18 +3429,18 @@ const Oa = {
3429
3429
  selectedVariants: {}
3430
3430
  },
3431
3431
  setup(t) {
3432
- const o = Pe(), { emitData: e, emitAction: n } = Dt(), f = se(), { t: s } = ce(), m = t, u = S(() => f.variants.map((_) => ({
3432
+ const o = Pe(), { emitData: e, emitAction: n } = Dt(), p = se(), { t: s } = ce(), m = t, u = S(() => p.variants.map((_) => ({
3433
3433
  label: _.name,
3434
3434
  value: _._id,
3435
3435
  disabled: !1
3436
- }))), g = q(me(m.selectedVariants)), h = q(""), { createVariant: p } = Sa(), v = () => {
3436
+ }))), g = q(me(m.selectedVariants)), h = q(""), { createVariant: f } = Sa(), v = () => {
3437
3437
  e(g.value), n("primary"), o.close();
3438
3438
  };
3439
3439
  return (_, r) => {
3440
- const E = H("FmSearch"), k = H("FmCheckbox"), F = H("FmButton");
3440
+ const T = H("FmSearch"), k = H("FmCheckbox"), F = H("FmButton");
3441
3441
  return u.value.length > 0 ? (V(), J("div", Oa, [
3442
3442
  G("div", null, [
3443
- C(E, {
3443
+ C(T, {
3444
3444
  autofocus: "",
3445
3445
  modelValue: h.value,
3446
3446
  "onUpdate:modelValue": r[0] || (r[0] = (w) => h.value = w),
@@ -3467,12 +3467,12 @@ const Oa = {
3467
3467
  ])
3468
3468
  ]),
3469
3469
  G("div", Va, [
3470
- a(f).rules.item.variant ? (V(), Q(F, {
3470
+ a(p).rules.item.variant ? (V(), Q(F, {
3471
3471
  key: 0,
3472
3472
  label: a(s)("menu.common.actions.add_new_variant"),
3473
3473
  variant: "tertiary",
3474
3474
  "text-color": "primary",
3475
- onClick: r[3] || (r[3] = (w) => a(p)())
3475
+ onClick: r[3] || (r[3] = (w) => a(f)())
3476
3476
  }, null, 8, ["label"])) : X("", !0),
3477
3477
  G("div", Pa, [
3478
3478
  C(F, {
@@ -3494,7 +3494,7 @@ const Oa = {
3494
3494
  C(F, {
3495
3495
  label: a(s)("menu.variant.add"),
3496
3496
  icon: "add",
3497
- onClick: r[6] || (r[6] = (w) => a(p)())
3497
+ onClick: r[6] || (r[6] = (w) => a(f)())
3498
3498
  }, null, 8, ["label"])
3499
3499
  ]));
3500
3500
  };
@@ -3524,9 +3524,9 @@ const Oa = {
3524
3524
  setup(t, {
3525
3525
  emit: o
3526
3526
  }) {
3527
- const e = t, n = se(), f = qn(), s = Fe(), m = Pe(), {
3527
+ const e = t, n = se(), p = qn(), s = Fe(), m = Pe(), {
3528
3528
  t: u
3529
- } = ce(), g = S(() => n.rules.item), h = S(() => g.value.minPrice && !!e.form.minPrice), p = S(() => !n.state.currentCatalogId), v = S(() => n.variants.reduce((d, l) => (d[l._id] = l, d), {}));
3529
+ } = ce(), g = S(() => n.rules.item), h = S(() => g.value.minPrice && !!e.form.minPrice), f = S(() => !n.state.currentCatalogId), v = S(() => n.variants.reduce((d, l) => (d[l._id] = l, d), {}));
3530
3530
  q(!1);
3531
3531
  const _ = o;
3532
3532
  function r(d) {
@@ -3543,7 +3543,7 @@ const Oa = {
3543
3543
  value: d._id,
3544
3544
  disabled: !1
3545
3545
  })));
3546
- function E(d) {
3546
+ function T(d) {
3547
3547
  var i;
3548
3548
  const l = F(d.combinationKey || "");
3549
3549
  return {
@@ -3566,7 +3566,7 @@ const Oa = {
3566
3566
  selectedVariants: ((d = e.form.variant) == null ? void 0 : d.variantGroupIds) ?? []
3567
3567
  }
3568
3568
  }).onPrimary(async (l) => {
3569
- x(l, E);
3569
+ E(l, T);
3570
3570
  });
3571
3571
  }
3572
3572
  function F(d) {
@@ -3575,12 +3575,12 @@ const Oa = {
3575
3575
  return i == null ? void 0 : i.find((ee) => ee.combinationKey === y);
3576
3576
  }
3577
3577
  const w = (d) => {
3578
- x(d);
3578
+ E(d);
3579
3579
  }, c = S(() => {
3580
3580
  var l;
3581
3581
  return (((l = e.form.variant) == null ? void 0 : l.variantCombinations) || []).map((i) => {
3582
- var T, y;
3583
- const b = (y = (T = e.fallback) == null ? void 0 : T.variant) == null ? void 0 : y.variantCombinations.find(({
3582
+ var x, y;
3583
+ const b = (y = (x = e.fallback) == null ? void 0 : x.variant) == null ? void 0 : y.variantCombinations.find(({
3584
3584
  combinationKey: M
3585
3585
  }) => M === i.combinationKey);
3586
3586
  return {
@@ -3589,15 +3589,15 @@ const Oa = {
3589
3589
  ...b,
3590
3590
  _id: i._id,
3591
3591
  combinationKey: i.combinationKey,
3592
- price: p.value ? e.form.price ?? (b == null ? void 0 : b.price) : i.price ?? (b == null ? void 0 : b.price),
3592
+ price: f.value ? e.form.price ?? (b == null ? void 0 : b.price) : i.price ?? (b == null ? void 0 : b.price),
3593
3593
  priceTiers: e.form.priceTiers,
3594
3594
  minPrice: e.form.minPrice ?? (b == null ? void 0 : b.minPrice)
3595
3595
  }
3596
3596
  };
3597
3597
  });
3598
3598
  });
3599
- function x(d, l = (i) => i) {
3600
- var T;
3599
+ function E(d, l = (i) => i) {
3600
+ var x;
3601
3601
  const i = d.filter((y) => !!y);
3602
3602
  let b;
3603
3603
  if (i.length) {
@@ -3628,7 +3628,7 @@ const Oa = {
3628
3628
  takeawayUsed: null
3629
3629
  };
3630
3630
  } else {
3631
- const y = (T = e.form.variant) == null ? void 0 : T.variantCombinations.map((W) => W.takeawayUsed), M = [...new Set(y)];
3631
+ const y = (x = e.form.variant) == null ? void 0 : x.variantCombinations.map((W) => W.takeawayUsed), M = [...new Set(y)];
3632
3632
  r([{
3633
3633
  key: "variant",
3634
3634
  value: void 0
@@ -3641,7 +3641,7 @@ const Oa = {
3641
3641
  takeawayUsed: M.length === 1 ? M[0] : null
3642
3642
  };
3643
3643
  }
3644
- _("replace:form", f.initDynamicGroupItem(b));
3644
+ _("replace:form", p.initDynamicGroupItem(b));
3645
3645
  }
3646
3646
  async function U(d, l, i) {
3647
3647
  const b = Ce.clone(e.form);
@@ -3651,8 +3651,8 @@ const Oa = {
3651
3651
  }]);
3652
3652
  }
3653
3653
  const N = S(() => {
3654
- var d;
3655
- return ((d = n.currentCatalog) == null ? void 0 : d.usePriceTiers) ?? [];
3654
+ var d, l;
3655
+ return ((d = n.currentCatalog) == null ? void 0 : d.priceTierRules) ?? ((l = n.currentCatalog) == null ? void 0 : l.usePriceTiers) ?? [];
3656
3656
  }), P = S(() => [{
3657
3657
  accessorKey: "combinationKey",
3658
3658
  header: () => u("menu.product.form.variant.columns.variant"),
@@ -3664,10 +3664,10 @@ const Oa = {
3664
3664
  enableSorting: !1,
3665
3665
  cell: (d) => {
3666
3666
  var y, M;
3667
- const l = d.getValue(), T = ((y = d.row.original.fallback) == null ? void 0 : y.code) ?? e.form.code ?? ((M = e.fallback) == null ? void 0 : M.code);
3667
+ const l = d.getValue(), x = ((y = d.row.original.fallback) == null ? void 0 : y.code) ?? e.form.code ?? ((M = e.fallback) == null ? void 0 : M.code);
3668
3668
  return ve(we.FmTextField, {
3669
3669
  modelValue: l,
3670
- placeholder: T || u("menu.product.form.variant.placeholders.no_code"),
3670
+ placeholder: x || u("menu.product.form.variant.placeholders.no_code"),
3671
3671
  "onUpdate:modelValue": (W) => {
3672
3672
  U(d.row.index, "code", qt(W, !0));
3673
3673
  }
@@ -3678,8 +3678,8 @@ const Oa = {
3678
3678
  header: () => u("menu.product.form.variant.columns.order_from"),
3679
3679
  enableSorting: !1,
3680
3680
  cell: (d) => {
3681
- var T, y;
3682
- const l = d.getValue(), b = (T = d.row.original.fallback) == null ? void 0 : T.orderFrom;
3681
+ var x, y;
3682
+ const l = d.getValue(), b = (x = d.row.original.fallback) == null ? void 0 : x.orderFrom;
3683
3683
  return ve(St, {
3684
3684
  modelValue: l ?? null,
3685
3685
  fallback: e.form.orderFrom ?? b ?? ((y = e.fallback) == null ? void 0 : y.orderFrom),
@@ -3699,13 +3699,13 @@ const Oa = {
3699
3699
  enableSorting: !1,
3700
3700
  cell: (d) => {
3701
3701
  var y, M, W;
3702
- const l = d.getValue(), i = d.row.original, T = ((y = i.fallback) == null ? void 0 : y.price) ?? e.form.price ?? ((M = e.fallback) == null ? void 0 : M.price);
3702
+ const l = d.getValue(), i = d.row.original, x = ((y = i.fallback) == null ? void 0 : y.price) ?? e.form.price ?? ((M = e.fallback) == null ? void 0 : M.price);
3703
3703
  return C("div", {
3704
3704
  id: it(ke.VARIANT, i.combinationKey ?? ""),
3705
3705
  class: "flex items-center gap-8"
3706
3706
  }, [C(je, {
3707
3707
  disable: N.value.length > 0 && n.currentCatalog && !n.currentScheduler,
3708
- placeholder: T ? Qe(T) : void 0,
3708
+ placeholder: x ? Qe(x) : void 0,
3709
3709
  modelValue: l,
3710
3710
  min: 0,
3711
3711
  "onUpdate:model-value": (ee) => {
@@ -3726,9 +3726,9 @@ const Oa = {
3726
3726
  enableSorting: !1,
3727
3727
  cell: (d) => {
3728
3728
  var y, M, W;
3729
- const l = d.getValue(), i = d.row.original, T = ((y = i.fallback) == null ? void 0 : y.minPrice) ?? e.form.minPrice ?? ((M = e.fallback) == null ? void 0 : M.minPrice);
3729
+ const l = d.getValue(), i = d.row.original, x = ((y = i.fallback) == null ? void 0 : y.minPrice) ?? e.form.minPrice ?? ((M = e.fallback) == null ? void 0 : M.minPrice);
3730
3730
  return ve(je, {
3731
- placeholder: T ? Qe(T) : void 0,
3731
+ placeholder: x ? Qe(x) : void 0,
3732
3732
  modelValue: l,
3733
3733
  max: be.Dinero.fromFdoDinero(i.price ?? ((W = i.fallback) == null ? void 0 : W.price) ?? be.Dinero.zero().toObject()).toUnit(),
3734
3734
  "onUpdate:modelValue": (ee) => {
@@ -3747,7 +3747,7 @@ const Oa = {
3747
3747
  }) : !0;
3748
3748
  }
3749
3749
  return (d, l) => {
3750
- const i = H("fm-button"), b = H("fm-icon"), T = H("FmFormGroup"), y = H("fm-table");
3750
+ const i = H("fm-button"), b = H("fm-icon"), x = H("FmFormGroup"), y = H("fm-table");
3751
3751
  return V(), Q(Se, {
3752
3752
  id: a(ke).VARIANT,
3753
3753
  title: a(u)("menu.product.form.variant.title"),
@@ -3762,7 +3762,7 @@ const Oa = {
3762
3762
  }, null, 8, ["label"])) : X("", !0)]),
3763
3763
  default: Y(() => {
3764
3764
  var M;
3765
- return [G("div", Na, [C(T, {
3765
+ return [G("div", Na, [C(x, {
3766
3766
  "model-value": (M = d.form.variant) == null ? void 0 : M.variantGroupIds,
3767
3767
  rules: [I]
3768
3768
  }, {
@@ -3789,7 +3789,7 @@ const Oa = {
3789
3789
  name: "close",
3790
3790
  onClick: ze((ne) => {
3791
3791
  var ue;
3792
- return x(((ue = d.form.variant) == null ? void 0 : ue.variantGroupIds.filter((D) => D !== ee)) ?? []);
3792
+ return E(((ue = d.form.variant) == null ? void 0 : ue.variantGroupIds.filter((D) => D !== ee)) ?? []);
3793
3793
  }, ["stop"])
3794
3794
  }, null, 8, ["onClick"])])])];
3795
3795
  }),
@@ -3848,7 +3848,7 @@ const Oa = {
3848
3848
  emits: ["update:editingState"],
3849
3849
  setup(t, { expose: o, emit: e }) {
3850
3850
  var _e, Ee, Ae, Be, Ye;
3851
- const n = t, f = e, s = Ze(), m = se(), { t: u } = ce();
3851
+ const n = t, p = e, s = Ze(), m = se(), { t: u } = ce();
3852
3852
  S(() => {
3853
3853
  var K;
3854
3854
  return (K = n.initialForm) != null && K._id ? u("menu.product.form.title.update") : u("menu.product.form.title.add");
@@ -3866,17 +3866,17 @@ const Oa = {
3866
3866
  route: ""
3867
3867
  }), ae = ae.parent;
3868
3868
  return z.reverse();
3869
- }), p = q(null);
3869
+ }), f = q(null);
3870
3870
  $e(() => {
3871
3871
  var K;
3872
- (K = p.value) == null || K.setSelectedItemIndex(h.value.length - 1);
3872
+ (K = f.value) == null || K.setSelectedItemIndex(h.value.length - 1);
3873
3873
  });
3874
3874
  const v = S(() => m.rules.item), _ = q(), r = q(
3875
3875
  n.initialForm ? me(n.initialForm) : {
3876
3876
  ...Re.generator.initMenuV4Item(),
3877
3877
  category: n.categoryId
3878
3878
  }
3879
- ), E = S(
3879
+ ), T = S(
3880
3880
  () => {
3881
3881
  var K;
3882
3882
  return Ot(n.menu.modules.variant, (K = r.value.variant) == null ? void 0 : K.variantGroupIds);
@@ -3901,7 +3901,7 @@ const Oa = {
3901
3901
  }
3902
3902
  const c = S(
3903
3903
  () => !!m.state.currentCatalogId || !!m.state.currentSchedulerId
3904
- ), x = S(() => {
3904
+ ), E = S(() => {
3905
3905
  var K;
3906
3906
  return c.value ? r.value.category == "" || r.value.category == null && ((K = _.value) == null ? void 0 : K.category) == null : bn(n.menu) && r.value.category == null;
3907
3907
  }), U = S(() => s.itemAttributeSettings.value.length > 0 && !c.value), N = q(
@@ -3955,7 +3955,7 @@ const Oa = {
3955
3955
  const b = q(
3956
3956
  !!r.value.inventoryBindings || (((Ee = r.value.variant) == null ? void 0 : Ee.variantCombinations) || []).some((K) => !!K.inventoryBindings) || !1
3957
3957
  );
3958
- function T(K) {
3958
+ function x(K) {
3959
3959
  var z, ae, te;
3960
3960
  K || (r.value = {
3961
3961
  ...r.value,
@@ -4046,7 +4046,7 @@ const Oa = {
4046
4046
  }
4047
4047
  });
4048
4048
  function D() {
4049
- f("update:editingState", Ce.cloneDeep(r.value));
4049
+ p("update:editingState", Ce.cloneDeep(r.value));
4050
4050
  }
4051
4051
  const R = Fo(D, 1e3), $ = q(null);
4052
4052
  function B() {
@@ -4094,7 +4094,7 @@ const Oa = {
4094
4094
  return [
4095
4095
  C(ae, {
4096
4096
  ref_key: "breadCrumbRef",
4097
- ref: p,
4097
+ ref: f,
4098
4098
  items: h.value
4099
4099
  }, null, 8, ["items"]),
4100
4100
  C(fo, { "menu-store": a(m) }, null, 8, ["menu-store"]),
@@ -4114,7 +4114,7 @@ const Oa = {
4114
4114
  C(xr, {
4115
4115
  fallback: _.value,
4116
4116
  form: r.value,
4117
- "is-addon": x.value,
4117
+ "is-addon": E.value,
4118
4118
  "is-override": c.value,
4119
4119
  "is-create": !((re = n.initialForm) != null && re._id),
4120
4120
  "onUpdate:form": k
@@ -4154,7 +4154,7 @@ const Oa = {
4154
4154
  C(ga, {
4155
4155
  fallback: _.value,
4156
4156
  form: r.value,
4157
- "is-addon": x.value,
4157
+ "is-addon": E.value,
4158
4158
  "is-override": c.value,
4159
4159
  "onUpdate:form": k
4160
4160
  }, null, 8, ["fallback", "form", "is-addon", "is-override"])
@@ -4177,8 +4177,8 @@ const Oa = {
4177
4177
  C(ha, {
4178
4178
  fallback: _.value,
4179
4179
  form: r.value,
4180
- "full-combinations": E.value,
4181
- "is-addon": x.value,
4180
+ "full-combinations": T.value,
4181
+ "is-addon": E.value,
4182
4182
  "is-override": c.value,
4183
4183
  "onUpdate:form": k,
4184
4184
  "onReplace:form": z[5] || (z[5] = (re) => F(re))
@@ -4201,8 +4201,8 @@ const Oa = {
4201
4201
  C(Ba, {
4202
4202
  fallback: _.value,
4203
4203
  form: r.value,
4204
- "full-combinations": E.value,
4205
- "is-addon": x.value,
4204
+ "full-combinations": T.value,
4205
+ "is-addon": E.value,
4206
4206
  "is-override": c.value,
4207
4207
  "onUpdate:form": k,
4208
4208
  "onReplace:form": z[8] || (z[8] = (re) => F(re))
@@ -4226,8 +4226,8 @@ const Oa = {
4226
4226
  C(Qr, {
4227
4227
  fallback: _.value,
4228
4228
  form: r.value,
4229
- "full-combinations": E.value,
4230
- "is-addon": x.value,
4229
+ "full-combinations": T.value,
4230
+ "is-addon": E.value,
4231
4231
  "is-override": c.value,
4232
4232
  "onUpdate:form": k,
4233
4233
  "onReplace:form": z[11] || (z[11] = (re) => F(re))
@@ -4241,7 +4241,7 @@ const Oa = {
4241
4241
  toggle: b.value,
4242
4242
  "onUpdate:toggle": [
4243
4243
  z[15] || (z[15] = (re) => b.value = re),
4244
- z[16] || (z[16] = (re) => T(re))
4244
+ z[16] || (z[16] = (re) => x(re))
4245
4245
  ],
4246
4246
  disabled: !c.value,
4247
4247
  description: a(u)("menu.product.form.sections.inventory.description"),
@@ -4251,8 +4251,8 @@ const Oa = {
4251
4251
  C(ta, {
4252
4252
  fallback: _.value,
4253
4253
  form: r.value,
4254
- "full-combinations": E.value,
4255
- "is-addon": x.value,
4254
+ "full-combinations": T.value,
4255
+ "is-addon": E.value,
4256
4256
  "is-override": c.value,
4257
4257
  "onUpdate:form": k,
4258
4258
  "onReplace:form": z[14] || (z[14] = (re) => F(re))
@@ -4276,8 +4276,8 @@ const Oa = {
4276
4276
  C(wa, {
4277
4277
  fallback: _.value,
4278
4278
  form: r.value,
4279
- "full-combinations": E.value,
4280
- "is-addon": x.value,
4279
+ "full-combinations": T.value,
4280
+ "is-addon": E.value,
4281
4281
  "is-override": c.value,
4282
4282
  "onUpdate:form": k,
4283
4283
  "onReplace:form": z[17] || (z[17] = (re) => F(re))
@@ -4293,27 +4293,27 @@ const Oa = {
4293
4293
  }
4294
4294
  });
4295
4295
  function Qa(t) {
4296
- const { storageKey: o, defaultWidth: e, minWidth: n, maxWidth: f } = t, s = Go(o, e), m = q(!1), u = q(null);
4296
+ const { storageKey: o, defaultWidth: e, minWidth: n, maxWidth: p } = t, s = Go(o, e), m = q(!1), u = q(null);
4297
4297
  function g(v) {
4298
- v.preventDefault(), m.value = !0, document.addEventListener("mousemove", h), document.addEventListener("mouseup", p), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
4298
+ v.preventDefault(), m.value = !0, document.addEventListener("mousemove", h), document.addEventListener("mouseup", f), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
4299
4299
  }
4300
4300
  function h(v) {
4301
4301
  if (m.value && u.value) {
4302
4302
  const _ = u.value.getBoundingClientRect(), r = v.clientX - _.left;
4303
- r >= n && r <= f && (s.value = r);
4303
+ r >= n && r <= p && (s.value = r);
4304
4304
  }
4305
4305
  }
4306
- function p() {
4307
- m.value = !1, document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", p), document.body.style.cursor = "", document.body.style.userSelect = "";
4306
+ function f() {
4307
+ m.value = !1, document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", f), document.body.style.cursor = "", document.body.style.userSelect = "";
4308
4308
  }
4309
4309
  return xn(() => {
4310
- document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", p);
4310
+ document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", f);
4311
4311
  }), {
4312
4312
  panelWidth: s,
4313
4313
  isDragging: m,
4314
4314
  containerRef: u,
4315
4315
  startResize: g,
4316
- stopResize: p
4316
+ stopResize: f
4317
4317
  };
4318
4318
  }
4319
4319
  const Za = {
@@ -4335,7 +4335,7 @@ const Za = {
4335
4335
  minWidth: ol,
4336
4336
  maxWidth: rl
4337
4337
  });
4338
- return (f, s) => (V(), J("div", {
4338
+ return (p, s) => (V(), J("div", {
4339
4339
  ref_key: "containerRef",
4340
4340
  ref: e,
4341
4341
  class: "flex h-full relative"
@@ -4344,7 +4344,7 @@ const Za = {
4344
4344
  style: at({ width: `${a(o)}px`, backgroundColor: "#FDFDFE" }),
4345
4345
  class: "flex-shrink-0 pl-24"
4346
4346
  }, [
4347
- Me(f.$slots, "left-panel", {}, void 0, !0)
4347
+ Me(p.$slots, "left-panel", {}, void 0, !0)
4348
4348
  ], 4),
4349
4349
  G("div", Za, [
4350
4350
  G("div", {
@@ -4354,10 +4354,10 @@ const Za = {
4354
4354
  }, null, 32)
4355
4355
  ]),
4356
4356
  G("div", el, [
4357
- Me(f.$slots, "right-panel", {}, void 0, !0)
4357
+ Me(p.$slots, "right-panel", {}, void 0, !0)
4358
4358
  ]),
4359
- f.$slots.overlay ? (V(), J("div", tl, [
4360
- Me(f.$slots, "overlay", {}, void 0, !0)
4359
+ p.$slots.overlay ? (V(), J("div", tl, [
4360
+ Me(p.$slots, "overlay", {}, void 0, !0)
4361
4361
  ])) : X("", !0)
4362
4362
  ], 512));
4363
4363
  }
@@ -4371,12 +4371,12 @@ function hn() {
4371
4371
  const u = t.currentCatalog;
4372
4372
  if (!u) return;
4373
4373
  const g = m.reduce(
4374
- (p, v) => (p[v] = bt(
4374
+ (f, v) => (f[v] = bt(
4375
4375
  v,
4376
4376
  u.override.items[v],
4377
4377
  m.includes(v),
4378
4378
  t.version === Z.F_MENU_VERSION.enum.v3
4379
- ), p),
4379
+ ), f),
4380
4380
  {}
4381
4381
  ), h = {
4382
4382
  ...u,
@@ -4393,8 +4393,8 @@ function hn() {
4393
4393
  data: h
4394
4394
  });
4395
4395
  }
4396
- async function f(m) {
4397
- var p;
4396
+ async function p(m) {
4397
+ var f;
4398
4398
  const u = t.currentCatalog;
4399
4399
  if (!u) return;
4400
4400
  const g = m.reduce(
@@ -4413,7 +4413,7 @@ function hn() {
4413
4413
  override: {
4414
4414
  ...u.override,
4415
4415
  items: {
4416
- ...((p = u.override) == null ? void 0 : p.items) || {},
4416
+ ...((f = u.override) == null ? void 0 : f.items) || {},
4417
4417
  ...g
4418
4418
  }
4419
4419
  }
@@ -4425,7 +4425,7 @@ function hn() {
4425
4425
  });
4426
4426
  }
4427
4427
  async function s(m) {
4428
- var p;
4428
+ var f;
4429
4429
  const u = t.currentCatalog;
4430
4430
  if (!u) return;
4431
4431
  const g = m.reduce(
@@ -4444,7 +4444,7 @@ function hn() {
4444
4444
  override: {
4445
4445
  ...u.override,
4446
4446
  items: {
4447
- ...((p = u.override) == null ? void 0 : p.items) || {},
4447
+ ...((f = u.override) == null ? void 0 : f.items) || {},
4448
4448
  ...g
4449
4449
  }
4450
4450
  }
@@ -4459,15 +4459,15 @@ function hn() {
4459
4459
  linkableItems: o,
4460
4460
  currentItems: e,
4461
4461
  setProduct: n,
4462
- applyProduct: f,
4462
+ applyProduct: p,
4463
4463
  removeProduct: s
4464
4464
  };
4465
4465
  }
4466
4466
  function bt(t, o, e, n) {
4467
- const f = o == null ? void 0 : o.find((u) => !u.combinationKey), s = e ? null : Z.F_ORDER_FROM.enum.NONE, m = n ? e ? null : "" : f == null ? void 0 : f.category;
4467
+ const p = o == null ? void 0 : o.find((u) => !u.combinationKey), s = e ? null : Z.F_ORDER_FROM.enum.NONE, m = n ? e ? null : "" : p == null ? void 0 : p.category;
4468
4468
  return [
4469
4469
  {
4470
- ...f ?? {},
4470
+ ...p ?? {},
4471
4471
  orderFrom: s,
4472
4472
  category: m,
4473
4473
  _id: t
@@ -4476,32 +4476,32 @@ function bt(t, o, e, n) {
4476
4476
  ];
4477
4477
  }
4478
4478
  function sl() {
4479
- const t = se(), o = Fe(), e = Pe(), n = qe(o), f = dt(n), s = S(() => {
4479
+ const t = se(), o = Fe(), e = Pe(), n = qe(o), p = dt(n), s = S(() => {
4480
4480
  const g = t.categorizedRawMenuItems, h = new Set(
4481
- t.currentCatalog ? Et.getItemAvailable(t.currentCatalog) : t.state.menu.modules.item.map((p) => p._id)
4481
+ t.currentCatalog ? Et.getItemAvailable(t.currentCatalog) : t.state.menu.modules.item.map((f) => f._id)
4482
4482
  );
4483
- return g.map((p) => ({
4484
- ...p,
4485
- items: p.items.filter((v) => h.has(v._id))
4486
- })).filter((p) => p.items.length > 0);
4483
+ return g.map((f) => ({
4484
+ ...f,
4485
+ items: f.items.filter((v) => h.has(v._id))
4486
+ })).filter((f) => f.items.length > 0);
4487
4487
  }), m = S(() => {
4488
4488
  var v;
4489
4489
  const g = t.currentScheduler;
4490
4490
  if (!g) return [];
4491
- const h = t.currentCatalog, p = h ? ((v = h.override.scheduler[g._id]) == null ? void 0 : v.items) ?? [] : g.items;
4491
+ const h = t.currentCatalog, f = h ? ((v = h.override.scheduler[g._id]) == null ? void 0 : v.items) ?? [] : g.items;
4492
4492
  return [
4493
- ...new Set(p.filter((_) => _.orderFrom != Z.F_ORDER_FROM.enum.NONE).map((_) => _._id))
4493
+ ...new Set(f.filter((_) => _.orderFrom != Z.F_ORDER_FROM.enum.NONE).map((_) => _._id))
4494
4494
  ].map((_) => ({ _id: _ }));
4495
4495
  });
4496
4496
  async function u(g) {
4497
4497
  const h = t.currentScheduler;
4498
4498
  if (!h) return;
4499
- const p = t.currentCatalog;
4500
- if (p && t.rules.scheduler.override) {
4499
+ const f = t.currentCatalog;
4500
+ if (f && t.rules.scheduler.override) {
4501
4501
  const v = new Et(
4502
- p,
4502
+ f,
4503
4503
  t,
4504
- f.updateMenu,
4504
+ p.updateMenu,
4505
4505
  e
4506
4506
  );
4507
4507
  v.overrideCatalogSchedulerItems(g, h._id), await t.updateMenu({
@@ -4511,10 +4511,10 @@ function sl() {
4511
4511
  });
4512
4512
  } else {
4513
4513
  const v = g.reduce(
4514
- (r, E) => {
4515
- const k = h.items.filter((F) => F._id == E) ?? [];
4514
+ (r, T) => {
4515
+ const k = h.items.filter((F) => F._id == T) ?? [];
4516
4516
  return r = r.concat(
4517
- ro(E, k, (F) => ({
4517
+ ro(T, k, (F) => ({
4518
4518
  ...F,
4519
4519
  orderFrom: null
4520
4520
  }))
@@ -4543,11 +4543,11 @@ function ul(t, o, e) {
4543
4543
  const n = () => ({
4544
4544
  position: 0,
4545
4545
  subCategoryMeta: {}
4546
- }), f = lt(t);
4547
- let s = f;
4546
+ }), p = lt(t);
4547
+ let s = p;
4548
4548
  for (const m of o)
4549
4549
  s.subCategoryMeta = s.subCategoryMeta ?? {}, s.subCategoryMeta[m] = s.subCategoryMeta[m] ?? n(), s = s.subCategoryMeta[m];
4550
- return Object.assign(s, e), f;
4550
+ return Object.assign(s, e), p;
4551
4551
  }
4552
4552
  function wn() {
4553
4553
  const t = se(), o = Fe();
@@ -4574,14 +4574,14 @@ function wn() {
4574
4574
  data: u._id
4575
4575
  });
4576
4576
  }
4577
- async function f(u) {
4577
+ async function p(u) {
4578
4578
  await t.updateMenu({
4579
4579
  module: Z.F_MENU_MODULE_V4_KEY.enum.item,
4580
4580
  operation: pe.F_OPERATION_TYPE.rearrange,
4581
4581
  data: u
4582
4582
  });
4583
4583
  }
4584
- async function s(u, g, h, p) {
4584
+ async function s(u, g, h, f) {
4585
4585
  let v = lt(g);
4586
4586
  const _ = /* @__PURE__ */ new Map(), r = lt(t.state.menu);
4587
4587
  for (const k of r.modules.item)
@@ -4591,17 +4591,17 @@ function wn() {
4591
4591
  const w = _.get(k.id);
4592
4592
  if (w) {
4593
4593
  let c = null;
4594
- p && p._id !== g._id && (c = ao(
4594
+ f && f._id !== g._id && (c = ao(
4595
4595
  w,
4596
- p == null ? void 0 : p._id,
4596
+ f == null ? void 0 : f._id,
4597
4597
  g._id
4598
4598
  ));
4599
- const x = lo(
4599
+ const E = lo(
4600
4600
  c ?? w,
4601
4601
  g._id,
4602
4602
  F + 1
4603
4603
  );
4604
- Object.assign(w, x);
4604
+ Object.assign(w, E);
4605
4605
  }
4606
4606
  } else if (k.type === "subCategory")
4607
4607
  v = ul(v, [...h, k.id], {
@@ -4610,8 +4610,8 @@ function wn() {
4610
4610
  else
4611
4611
  throw new Error("Invalid item type");
4612
4612
  });
4613
- const E = r.modules.category.find((k) => k._id === (g == null ? void 0 : g._id) || null);
4614
- E && (E.subCategoryMeta = v.subCategoryMeta), t.setMenu(r);
4613
+ const T = r.modules.category.find((k) => k._id === (g == null ? void 0 : g._id) || null);
4614
+ T && (T.subCategoryMeta = v.subCategoryMeta), t.setMenu(r);
4615
4615
  }
4616
4616
  async function m(u, g) {
4617
4617
  await t.updateMenu({
@@ -4624,7 +4624,7 @@ function wn() {
4624
4624
  return {
4625
4625
  createItem: e,
4626
4626
  deleteItem: n,
4627
- rearrange: f,
4627
+ rearrange: p,
4628
4628
  rearrangeWithSubCategory: s,
4629
4629
  updateItem: m
4630
4630
  };
@@ -4632,36 +4632,36 @@ function wn() {
4632
4632
  var Je = /* @__PURE__ */ ((t) => (t.CATEGORY = "category", t.ITEM = "item", t.SUB_CATEGORY = "subCategory", t))(Je || {});
4633
4633
  const ot = /* @__PURE__ */ new Map(), rt = /* @__PURE__ */ new Map();
4634
4634
  function dl() {
4635
- const { t } = ce(), o = se(), e = ct(), n = wn(), f = S(
4636
- () => o.subcategories.reduce((r, E) => (r[E._id] = E, r), {})
4635
+ const { t } = ce(), o = se(), e = ct(), n = wn(), p = S(
4636
+ () => o.subcategories.reduce((r, T) => (r[T._id] = T, r), {})
4637
4637
  );
4638
4638
  function s(r) {
4639
- var E;
4640
- return ((E = f.value[r]) == null ? void 0 : E.name) || r;
4639
+ var T;
4640
+ return ((T = p.value[r]) == null ? void 0 : T.name) || r;
4641
4641
  }
4642
4642
  function m(r) {
4643
- function E(k) {
4643
+ function T(k) {
4644
4644
  if (k.children && k.children.length > 0)
4645
4645
  for (const F of k.children)
4646
- F.parent = k, E(F);
4646
+ F.parent = k, T(F);
4647
4647
  }
4648
4648
  for (const k of r)
4649
- E(k);
4649
+ T(k);
4650
4650
  return r;
4651
4651
  }
4652
4652
  function u(r) {
4653
- return r.map((E) => {
4653
+ return r.map((T) => {
4654
4654
  var F, w, c;
4655
4655
  const k = {
4656
- ...E,
4656
+ ...T,
4657
4657
  children: []
4658
4658
  };
4659
- for (const x of E.children ?? []) {
4660
- if (((F = x.meta) == null ? void 0 : F.nodeType) !== "item")
4659
+ for (const E of T.children ?? []) {
4660
+ if (((F = E.meta) == null ? void 0 : F.nodeType) !== "item")
4661
4661
  continue;
4662
- const U = ot.get((w = x.meta) == null ? void 0 : w.rawId);
4662
+ const U = ot.get((w = E.meta) == null ? void 0 : w.rawId);
4663
4663
  if (!(U != null && U.subCategories) || !U.subCategories.length)
4664
- (c = k.children) == null || c.push(x);
4664
+ (c = k.children) == null || c.push(E);
4665
4665
  else {
4666
4666
  let N = k.children, P = "";
4667
4667
  for (const L of U.subCategories || []) {
@@ -4676,7 +4676,7 @@ function dl() {
4676
4676
  I.children = I.children || [], N = I.children;
4677
4677
  else {
4678
4678
  const d = {
4679
- id: `category-${E.label}-sub-category-${P}`,
4679
+ id: `category-${T.label}-sub-category-${P}`,
4680
4680
  label: s(L),
4681
4681
  icon: Oe.CATEGORY,
4682
4682
  children: [],
@@ -4689,34 +4689,34 @@ function dl() {
4689
4689
  N.push(d), N = d.children;
4690
4690
  }
4691
4691
  }
4692
- N.push(x);
4692
+ N.push(E);
4693
4693
  }
4694
4694
  }
4695
4695
  return k;
4696
4696
  });
4697
4697
  }
4698
4698
  function g(r) {
4699
- var E;
4700
- if (((E = r.meta) == null ? void 0 : E.nodeType) !== "subCategory")
4699
+ var T;
4700
+ if (((T = r.meta) == null ? void 0 : T.nodeType) !== "subCategory")
4701
4701
  throw new Error("Node is not a sub category");
4702
4702
  return 0;
4703
4703
  }
4704
4704
  function h(r) {
4705
4705
  var k;
4706
- let E = r;
4707
- for (; E; ) {
4708
- if (((k = E.meta) == null ? void 0 : k.nodeType) === "category")
4709
- return E;
4710
- E = E.parent;
4706
+ let T = r;
4707
+ for (; T; ) {
4708
+ if (((k = T.meta) == null ? void 0 : k.nodeType) === "category")
4709
+ return T;
4710
+ T = T.parent;
4711
4711
  }
4712
4712
  throw new Error("No parent category node found");
4713
4713
  }
4714
- function p(r) {
4715
- var F, w, c, x;
4714
+ function f(r) {
4715
+ var F, w, c, E;
4716
4716
  if (!r.children)
4717
4717
  return r;
4718
- const E = ((w = (F = h(r)) == null ? void 0 : F.meta) == null ? void 0 : w.rawId) ?? null, k = io(E);
4719
- return ((c = r.meta) == null ? void 0 : c.nodeType) === "category" || ((x = r.meta) == null ? void 0 : x.nodeType) === "subCategory" ? (r.children = pt(
4718
+ const T = ((w = (F = h(r)) == null ? void 0 : F.meta) == null ? void 0 : w.rawId) ?? null, k = io(T);
4719
+ return ((c = r.meta) == null ? void 0 : c.nodeType) === "category" || ((E = r.meta) == null ? void 0 : E.nodeType) === "subCategory" ? (r.children = pt(
4720
4720
  r.children,
4721
4721
  (U) => U.label,
4722
4722
  (U) => {
@@ -4727,20 +4727,20 @@ function dl() {
4727
4727
  return k(U.meta.rawObject);
4728
4728
  throw new Error("Should not have other node type in category");
4729
4729
  }
4730
- ), { ...r, children: r.children.map(p) }) : r;
4730
+ ), { ...r, children: r.children.map(f) }) : r;
4731
4731
  }
4732
4732
  function v(r) {
4733
- return r.map(p);
4733
+ return r.map(f);
4734
4734
  }
4735
4735
  async function _({ eventEmitter: r }) {
4736
4736
  var W, ee;
4737
- const E = o.state.menu, k = !o.state.currentCatalogId, F = !o.state.currentSchedulerId, w = hn(), c = o.mergedMenu;
4737
+ const T = o.state.menu, k = !o.state.currentCatalogId, F = !o.state.currentSchedulerId, w = hn(), c = o.mergedMenu;
4738
4738
  ot.clear(), rt.clear();
4739
- for (const O of E.modules.item)
4739
+ for (const O of T.modules.item)
4740
4740
  ot.set(O._id, O);
4741
4741
  for (const O of c.modules.group)
4742
4742
  rt.set(O._id, O);
4743
- function x(O, ne) {
4743
+ function E(O, ne) {
4744
4744
  return {
4745
4745
  id: `add-item-${O}`,
4746
4746
  icon: "add",
@@ -4875,7 +4875,7 @@ function dl() {
4875
4875
  }
4876
4876
  if (D) {
4877
4877
  const $ = (j, oe) => `item-${j}-variant-${oe}`, B = Ot(
4878
- E.modules.variant,
4878
+ T.modules.variant,
4879
4879
  O.variant.variantGroupIds
4880
4880
  ), A = O.variant.variantCombinations.map(
4881
4881
  (j) => {
@@ -4911,7 +4911,7 @@ function dl() {
4911
4911
  (O) => O.name
4912
4912
  ).map((O) => {
4913
4913
  const ne = [];
4914
- return o.rules.category.create && ne.push(x(O._id, n)), o.rules.category.edit && ne.push({
4914
+ return o.rules.category.create && ne.push(E(O._id, n)), o.rules.category.edit && ne.push({
4915
4915
  id: `update-category-${O._id}`,
4916
4916
  icon: "edit",
4917
4917
  showOnHover: !0,
@@ -4969,7 +4969,7 @@ function dl() {
4969
4969
  rawObject: null
4970
4970
  }
4971
4971
  };
4972
- l && (o.rules.category.create && b.actions.push(x(null, n)), o.currentCatalog && b.actions.push({
4972
+ l && (o.rules.category.create && b.actions.push(E(null, n)), o.currentCatalog && b.actions.push({
4973
4973
  id: "apply-to-catalog-addon",
4974
4974
  icon: "add_link",
4975
4975
  showOnHover: !0,
@@ -4979,7 +4979,7 @@ function dl() {
4979
4979
  w.applyProduct(O.map((ne) => ne._id));
4980
4980
  }
4981
4981
  }), d.push(b));
4982
- const T = (O, ne) => `item-${ne ?? "addon"}-${O}`;
4982
+ const x = (O, ne) => `item-${ne ?? "addon"}-${O}`;
4983
4983
  for (const O of c.modules.item)
4984
4984
  Rt(O).forEach(({ _id: ue }) => {
4985
4985
  var R, $, B, A, j, oe, de, _e;
@@ -5025,7 +5025,7 @@ function dl() {
5025
5025
  }));
5026
5026
  const le = O.code ? `${O.code}, ${O.name}` : O.name;
5027
5027
  D.children.push({
5028
- id: T(O._id, ue),
5028
+ id: x(O._id, ue),
5029
5029
  disabled: te,
5030
5030
  draggable: o.rules.item.sort,
5031
5031
  meta: {
@@ -5078,7 +5078,7 @@ function dl() {
5078
5078
  }
5079
5079
  function cl() {
5080
5080
  const t = Fe(), o = wn(), e = ct(), n = et();
5081
- function f(I) {
5081
+ function p(I) {
5082
5082
  t.open({
5083
5083
  message: I,
5084
5084
  type: "warning"
@@ -5113,7 +5113,7 @@ function cl() {
5113
5113
  u(l) && d.unshift(l.meta.rawId), l = l.parent || null;
5114
5114
  return d;
5115
5115
  }
5116
- function p(I) {
5116
+ function f(I) {
5117
5117
  return I.children ? I.children.map((d) => {
5118
5118
  if (m(d))
5119
5119
  return {
@@ -5141,7 +5141,7 @@ function cl() {
5141
5141
  m(l) ? d.push(l) : d = d.concat(r(l));
5142
5142
  return d;
5143
5143
  }
5144
- function E(I) {
5144
+ function T(I) {
5145
5145
  let d = I;
5146
5146
  for (; d; ) {
5147
5147
  if (s(d))
@@ -5152,8 +5152,8 @@ function cl() {
5152
5152
  }
5153
5153
  function k(I, d, l, i, b) {
5154
5154
  if (m(d)) {
5155
- const T = E(I), y = E(d);
5156
- return (T == null ? void 0 : T.id) === (y == null ? void 0 : y.id) ? !0 : !((T == null ? void 0 : T.id) !== (y == null ? void 0 : y.id) && r(y).some(
5155
+ const x = T(I), y = T(d);
5156
+ return (x == null ? void 0 : x.id) === (y == null ? void 0 : y.id) ? !0 : !((x == null ? void 0 : x.id) !== (y == null ? void 0 : y.id) && r(y).some(
5157
5157
  (M) => {
5158
5158
  var W, ee;
5159
5159
  return ((W = M.meta) == null ? void 0 : W.rawId) === ((ee = I.meta) == null ? void 0 : ee.rawId);
@@ -5166,21 +5166,21 @@ function cl() {
5166
5166
  }) : !!(m(d) && (b == null ? void 0 : b.id) !== (i == null ? void 0 : i.id) || u(d));
5167
5167
  }
5168
5168
  const F = (I, d, l) => {
5169
- const i = n.getNodeById(I), b = n.getNodeById(d), T = i == null ? void 0 : i.parent, y = b == null ? void 0 : b.parent;
5170
- return !i || !b ? !1 : s(i) ? v(i, b) : u(i) ? _(i, b, l, T, y) : m(i) ? k(i, b, l, T, y) : !1;
5169
+ const i = n.getNodeById(I), b = n.getNodeById(d), x = i == null ? void 0 : i.parent, y = b == null ? void 0 : b.parent;
5170
+ return !i || !b ? !1 : s(i) ? v(i, b) : u(i) ? _(i, b, l, x, y) : m(i) ? k(i, b, l, x, y) : !1;
5171
5171
  };
5172
5172
  async function w(I, d, l) {
5173
5173
  if (!v(I, d)) {
5174
- f("Can't drag category here");
5174
+ p("Can't drag category here");
5175
5175
  return;
5176
5176
  }
5177
5177
  const i = n.treeNodes, b = i.findIndex((W) => W.id === I.id);
5178
- let T = i.findIndex((W) => W.id === d.id);
5179
- l === "after" && T++;
5178
+ let x = i.findIndex((W) => W.id === d.id);
5179
+ l === "after" && x++;
5180
5180
  const y = i.map((W) => {
5181
5181
  var ee;
5182
5182
  return (ee = W.meta) == null ? void 0 : ee.rawId;
5183
- }).filter(Boolean), M = _t(y, b, T);
5183
+ }).filter(Boolean), M = _t(y, b, x);
5184
5184
  await e.rearrange(M);
5185
5185
  }
5186
5186
  function c(I, d) {
@@ -5203,30 +5203,30 @@ function cl() {
5203
5203
  }
5204
5204
  throw new Error("Invalid target node for item drop");
5205
5205
  }
5206
- async function x(I, d, l, i) {
5206
+ async function E(I, d, l, i) {
5207
5207
  var W;
5208
- const b = p(d), T = ((W = d.children) == null ? void 0 : W.findIndex((ee) => ee.id === I.id)) ?? -1;
5209
- if (T === -1) throw new Error("Source index not found");
5210
- const y = _t(b, T, l), M = h(d);
5208
+ const b = f(d), x = ((W = d.children) == null ? void 0 : W.findIndex((ee) => ee.id === I.id)) ?? -1;
5209
+ if (x === -1) throw new Error("Source index not found");
5210
+ const y = _t(b, x, l), M = h(d);
5211
5211
  await o.rearrangeWithSubCategory(y, i, M);
5212
5212
  }
5213
5213
  async function U(I, d, l, i) {
5214
5214
  var W;
5215
- const b = p(d);
5215
+ const b = f(d);
5216
5216
  b.splice(l, 0, {
5217
5217
  type: "item",
5218
5218
  id: I.meta.rawId
5219
5219
  });
5220
- const T = h(d);
5220
+ const x = h(d);
5221
5221
  if (((W = I.meta) == null ? void 0 : W.nodeType) !== Je.ITEM)
5222
5222
  throw new Error("Expected dragged node to be an item");
5223
5223
  const y = lt(I.meta.rawObject);
5224
- y.category = i._id, y.subCategories = T;
5224
+ y.category = i._id, y.subCategories = x;
5225
5225
  const M = g(I);
5226
5226
  await o.updateItem(y._id, y), await o.rearrangeWithSubCategory(
5227
5227
  b,
5228
5228
  i,
5229
- T,
5229
+ x,
5230
5230
  M
5231
5231
  );
5232
5232
  }
@@ -5234,23 +5234,23 @@ function cl() {
5234
5234
  var i;
5235
5235
  try {
5236
5236
  if (!k(I, d, l, I.parent, d.parent)) {
5237
- f("Cannot drop item here");
5237
+ p("Cannot drop item here");
5238
5238
  return;
5239
5239
  }
5240
- const b = c(d, l), T = g(d), y = I.meta;
5241
- ((i = I.parent) == null ? void 0 : i.id) === b.parent.id ? await x(
5240
+ const b = c(d, l), x = g(d), y = I.meta;
5241
+ ((i = I.parent) == null ? void 0 : i.id) === b.parent.id ? await E(
5242
5242
  I,
5243
5243
  b.parent,
5244
5244
  b.index,
5245
- T
5245
+ x
5246
5246
  ) : await U(
5247
5247
  I,
5248
5248
  b.parent,
5249
5249
  b.index,
5250
- T
5250
+ x
5251
5251
  );
5252
5252
  } catch (b) {
5253
- f(b.message || "Failed to move item");
5253
+ p(b.message || "Failed to move item");
5254
5254
  }
5255
5255
  }
5256
5256
  async function P(I, d, l) {
@@ -5261,23 +5261,23 @@ function cl() {
5261
5261
  I.parent,
5262
5262
  d.parent
5263
5263
  )) {
5264
- f("Can't drag sub-category here");
5264
+ p("Can't drag sub-category here");
5265
5265
  return;
5266
5266
  }
5267
5267
  const i = I.parent;
5268
5268
  if (!i || !i.children)
5269
5269
  throw new Error("Parent node not found or has no children");
5270
- const b = p(i), T = i.children.findIndex((O) => O.id === I.id);
5270
+ const b = f(i), x = i.children.findIndex((O) => O.id === I.id);
5271
5271
  let y = i.children.findIndex((O) => O.id === d.id);
5272
- if (T === -1 || y === -1)
5272
+ if (x === -1 || y === -1)
5273
5273
  throw new Error("Source or target index not found");
5274
5274
  l === "after" && y++;
5275
- const M = _t(b, T, y), W = g(i), ee = h(i);
5275
+ const M = _t(b, x, y), W = g(i), ee = h(i);
5276
5276
  await o.rearrangeWithSubCategory(M, W, ee);
5277
5277
  }
5278
5278
  async function L(I) {
5279
5279
  const d = n.getNodeById(I.draggedNodeId), l = n.getNodeById(I.targetNodeId);
5280
- !d || !l || (s(d) ? await w(d, l, I.dragPosition) : m(d) ? await N(d, l, I.dragPosition) : u(d) ? await P(d, l, I.dragPosition) : f("Unsupported drag operation"));
5280
+ !d || !l || (s(d) ? await w(d, l, I.dragPosition) : m(d) ? await N(d, l, I.dragPosition) : u(d) ? await P(d, l, I.dragPosition) : p("Unsupported drag operation"));
5281
5281
  }
5282
5282
  return {
5283
5283
  isCategoryNode: s,
@@ -5296,11 +5296,11 @@ const Tt = /* @__PURE__ */ ie({
5296
5296
  setup(t) {
5297
5297
  const o = t;
5298
5298
  return (e, n) => {
5299
- const f = H("FmIcon");
5299
+ const p = H("FmIcon");
5300
5300
  return V(), J("div", {
5301
5301
  class: fe(`p-4 relative flex items-center justify-center ${o.visible ? "" : "invisible"}`)
5302
5302
  }, [
5303
- C(f, {
5303
+ C(p, {
5304
5304
  name: o.name,
5305
5305
  size: "sm",
5306
5306
  outline: "",
@@ -5344,21 +5344,21 @@ const Tt = /* @__PURE__ */ ie({
5344
5344
  }
5345
5345
  }), Cn = 300;
5346
5346
  function ml(t) {
5347
- const { itemHeight: o, emit: e, getFlattenedItems: n, getContainerRef: f, canDropFn: s } = t, m = q(!1), u = q(null), g = q(null), h = q(null), p = q(0), v = q({ x: 0, y: 0 }), _ = q(/* @__PURE__ */ new Map());
5347
+ const { itemHeight: o, emit: e, getFlattenedItems: n, getContainerRef: p, canDropFn: s } = t, m = q(!1), u = q(null), g = q(null), h = q(null), f = q(0), v = q({ x: 0, y: 0 }), _ = q(/* @__PURE__ */ new Map());
5348
5348
  function r(w, c) {
5349
- c.button === 0 && (v.value = { x: c.clientX, y: c.clientY }, u.value = w, p.value = c.clientY, _.value = Jo(n()), setTimeout(() => {
5350
- u.value === w && (m.value = !0, v.value = { x: c.clientX, y: c.clientY }, e("updateDragState", w, null, null), document.addEventListener("mousemove", E), document.addEventListener("mouseup", k));
5349
+ c.button === 0 && (v.value = { x: c.clientX, y: c.clientY }, u.value = w, f.value = c.clientY, _.value = Jo(n()), setTimeout(() => {
5350
+ u.value === w && (m.value = !0, v.value = { x: c.clientX, y: c.clientY }, e("updateDragState", w, null, null), document.addEventListener("mousemove", T), document.addEventListener("mouseup", k));
5351
5351
  }, Cn));
5352
5352
  }
5353
- function E(w) {
5353
+ function T(w) {
5354
5354
  var I;
5355
5355
  if (!m.value || !u.value) return;
5356
5356
  requestAnimationFrame(() => {
5357
5357
  v.value = { x: w.clientX, y: w.clientY };
5358
5358
  });
5359
- const c = f();
5359
+ const c = p();
5360
5360
  if (!c) return;
5361
- const x = c.getBoundingClientRect(), U = w.clientY - x.top + c.scrollTop, N = Math.floor(U / o), P = n();
5361
+ const E = c.getBoundingClientRect(), U = w.clientY - E.top + c.scrollTop, N = Math.floor(U / o), P = n();
5362
5362
  if (N >= 0 && N < P.length) {
5363
5363
  const l = P[N].id;
5364
5364
  if (l === u.value) {
@@ -5378,17 +5378,17 @@ function ml(t) {
5378
5378
  e("updateDragState", u.value, g.value, h.value);
5379
5379
  }
5380
5380
  const L = 50;
5381
- w.clientY - x.top < L ? c.scrollTop -= 10 : x.bottom - w.clientY < L && (c.scrollTop += 10);
5381
+ w.clientY - E.top < L ? c.scrollTop -= 10 : E.bottom - w.clientY < L && (c.scrollTop += 10);
5382
5382
  }
5383
5383
  function k() {
5384
- document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", k), m.value && u.value && g.value && h.value && e("nodeDragDrop", {
5384
+ document.removeEventListener("mousemove", T), document.removeEventListener("mouseup", k), m.value && u.value && g.value && h.value && e("nodeDragDrop", {
5385
5385
  draggedNodeId: u.value,
5386
5386
  targetNodeId: g.value,
5387
5387
  dragPosition: h.value
5388
5388
  }), m.value = !1, e("updateDragState", null, null, null), u.value = null, g.value = null, h.value = null, _.value.clear();
5389
5389
  }
5390
5390
  function F() {
5391
- document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", k), m.value = !1, e("updateDragState", null, null, null), u.value = null, g.value = null, h.value = null, _.value.clear();
5391
+ document.removeEventListener("mousemove", T), document.removeEventListener("mouseup", k), m.value = !1, e("updateDragState", null, null, null), u.value = null, g.value = null, h.value = null, _.value.clear();
5392
5392
  }
5393
5393
  return {
5394
5394
  isDragging: m,
@@ -5403,7 +5403,7 @@ function ml(t) {
5403
5403
  function pl(t, o) {
5404
5404
  let e = null;
5405
5405
  const n = typeof o == "function" ? o : () => o.value;
5406
- function f(u) {
5406
+ function p(u) {
5407
5407
  n() || (e = setTimeout(() => {
5408
5408
  t(u);
5409
5409
  }, Cn));
@@ -5415,7 +5415,7 @@ function pl(t, o) {
5415
5415
  e && (clearTimeout(e), e = null);
5416
5416
  }
5417
5417
  return {
5418
- onMouseDown: f,
5418
+ onMouseDown: p,
5419
5419
  onMouseMove: s,
5420
5420
  onMouseUp: m
5421
5421
  };
@@ -5430,10 +5430,10 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5430
5430
  const o = t, e = S(() => {
5431
5431
  if (!o.highlightedStrings || o.highlightedStrings.length === 0 || !o.text)
5432
5432
  return o.text;
5433
- const n = o.highlightedStrings.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), f = new RegExp(`(${n})`, "gi");
5434
- return o.text.replace(f, '<span class="highlighted-span">$1</span>');
5433
+ const n = o.highlightedStrings.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), p = new RegExp(`(${n})`, "gi");
5434
+ return o.text.replace(p, '<span class="highlighted-span">$1</span>');
5435
5435
  });
5436
- return (n, f) => !n.highlightedStrings || n.highlightedStrings.length === 0 ? (V(), J("span", fl, ge(n.text), 1)) : (V(), J("span", {
5436
+ return (n, p) => !n.highlightedStrings || n.highlightedStrings.length === 0 ? (V(), J("span", fl, ge(n.text), 1)) : (V(), J("span", {
5437
5437
  key: 1,
5438
5438
  innerHTML: e.value
5439
5439
  }, null, 8, gl));
@@ -5493,9 +5493,9 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5493
5493
  setup(t, {
5494
5494
  emit: o
5495
5495
  }) {
5496
- const e = t, n = S(() => e.expanded ? "expand_more" : "chevron_right"), f = S(() => e.node.disabled ? "text-fm-color-neutral-gray-200" : ""), s = S(() => e.node.disabled ? "cursor-not-allowed" : e.node.onClick ? "cursor-pointer" : ""), m = S(() => e.selected ? "bg-fm-color-system-warning-100" : e.dropTarget && e.dropPosition === "inside" ? "bg-fm-color-primary-50" : ""), u = S(() => e.selected ? "text-fm-color-primary" : ""), g = o, {
5496
+ const e = t, n = S(() => e.expanded ? "expand_more" : "chevron_right"), p = S(() => e.node.disabled ? "text-fm-color-neutral-gray-200" : ""), s = S(() => e.node.disabled ? "cursor-not-allowed" : e.node.onClick ? "cursor-pointer" : ""), m = S(() => e.selected ? "bg-fm-color-system-warning-100" : e.dropTarget && e.dropPosition === "inside" ? "bg-fm-color-primary-50" : ""), u = S(() => e.selected ? "text-fm-color-primary" : ""), g = o, {
5497
5497
  onMouseDown: h,
5498
- onMouseMove: p,
5498
+ onMouseMove: f,
5499
5499
  onMouseUp: v
5500
5500
  } = pl((_) => {
5501
5501
  var r;
@@ -5506,24 +5506,24 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5506
5506
  });
5507
5507
  return (_, r) => {
5508
5508
  var F, w, c;
5509
- const E = H("FmIcon"), k = H("FmTooltip");
5509
+ const T = H("FmIcon"), k = H("FmTooltip");
5510
5510
  return V(), J("div", {
5511
- class: fe(["tree-node", "max-w-full", "py-4 px-8 flex items-center justify-between gap-4", "fm-corner-radius-sm", "select-none", f.value, s.value, m.value, {
5511
+ class: fe(["tree-node", "max-w-full", "py-4 px-8 flex items-center justify-between gap-4", "fm-corner-radius-sm", "select-none", p.value, s.value, m.value, {
5512
5512
  "opacity-50": _.dragging
5513
5513
  }, "hover-effect"]),
5514
5514
  onClick: r[2] || (r[2] = ze(() => {
5515
- var x, U;
5516
- _.node.disabled || (U = (x = _.node).onClick) == null || U.call(x);
5515
+ var E, U;
5516
+ _.node.disabled || (U = (E = _.node).onClick) == null || U.call(E);
5517
5517
  }, ["stop"])),
5518
5518
  onMousedown: r[3] || (r[3] = //@ts-ignore
5519
- (...x) => a(h) && a(h)(...x)),
5519
+ (...E) => a(h) && a(h)(...E)),
5520
5520
  onMousemove: r[4] || (r[4] = //@ts-ignore
5521
- (...x) => a(p) && a(p)(...x)),
5521
+ (...E) => a(f) && a(f)(...E)),
5522
5522
  onMouseup: r[5] || (r[5] = //@ts-ignore
5523
- (...x) => a(v) && a(v)(...x)),
5523
+ (...E) => a(v) && a(v)(...E)),
5524
5524
  onMouseleave: r[6] || (r[6] = //@ts-ignore
5525
- (...x) => a(v) && a(v)(...x))
5526
- }, [G("div", _l, [G("div", bl, [(F = _.node) != null && F.draggable && !_.node.disabled ? (V(), Q(E, {
5525
+ (...E) => a(v) && a(v)(...E))
5526
+ }, [G("div", _l, [G("div", bl, [(F = _.node) != null && F.draggable && !_.node.disabled ? (V(), Q(T, {
5527
5527
  key: 0,
5528
5528
  name: "drag_indicator",
5529
5529
  size: "sm",
@@ -5535,7 +5535,7 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5535
5535
  onClick: r[0] || (r[0] = ze(() => {
5536
5536
  _.node.disabled || g("toggleExpand");
5537
5537
  }, ["stop"]))
5538
- }, null, 8, ["name", "visible"]), _.node.icon ? (V(), Q(E, {
5538
+ }, null, 8, ["name", "visible"]), _.node.icon ? (V(), Q(T, {
5539
5539
  key: 1,
5540
5540
  size: "sm",
5541
5541
  outline: "",
@@ -5558,26 +5558,26 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5558
5558
  highlightedStrings: _.highlightedStrings
5559
5559
  }, null, 8, ["class", "text", "highlightedStrings"])]),
5560
5560
  _: 1
5561
- }, 8, ["content"])])]), G("div", wl, [(V(!0), J(xe, null, Ue(_.node.chips, (x) => (V(), Q(Oo, {
5562
- key: x.label,
5563
- size: x.size || "xs",
5564
- label: x.label,
5565
- variant: x.variant || "neutral",
5566
- border: x.border
5567
- }, null, 8, ["size", "label", "variant", "border"]))), 128))])]), G("div", Cl, [G("div", Il, [(V(!0), J(xe, null, Ue(_.node.actions, (x) => (V(), Q(xt, {
5568
- key: x.id,
5569
- name: x.icon,
5570
- tooltip: x.tooltip,
5561
+ }, 8, ["content"])])]), G("div", wl, [(V(!0), J(xe, null, Ue(_.node.chips, (E) => (V(), Q(Oo, {
5562
+ key: E.label,
5563
+ size: E.size || "xs",
5564
+ label: E.label,
5565
+ variant: E.variant || "neutral",
5566
+ border: E.border
5567
+ }, null, 8, ["size", "label", "variant", "border"]))), 128))])]), G("div", Cl, [G("div", Il, [(V(!0), J(xe, null, Ue(_.node.actions, (E) => (V(), Q(xt, {
5568
+ key: E.id,
5569
+ name: E.icon,
5570
+ tooltip: E.tooltip,
5571
5571
  visible: !0,
5572
5572
  onClick: (U) => {
5573
5573
  var N;
5574
- return (N = x.onClick) == null ? void 0 : N.call(x);
5574
+ return (N = E.onClick) == null ? void 0 : N.call(E);
5575
5575
  }
5576
5576
  }, null, 8, ["name", "tooltip", "onClick"]))), 128))]), C(yt, {
5577
5577
  class: fe(["fm-typo-en-body-md-400", ((w = _.node.rightLabel) == null ? void 0 : w.variant) === a(He).PRIMARY ? "text-fm-color-primary" : "text-fm-color-typo-secondary"]),
5578
5578
  text: (c = _.node.rightLabel) == null ? void 0 : c.label,
5579
5579
  highlightedStrings: _.highlightedStrings,
5580
- onClick: r[1] || (r[1] = ze((x) => {
5580
+ onClick: r[1] || (r[1] = ze((E) => {
5581
5581
  var U, N;
5582
5582
  return (N = (U = _.node.rightLabel) == null ? void 0 : U.onClick) == null ? void 0 : N.call(U);
5583
5583
  }, ["stop"]))
@@ -5606,12 +5606,12 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5606
5606
  }) {
5607
5607
  const {
5608
5608
  t: n
5609
- } = ce(), f = t, s = e;
5609
+ } = ce(), p = t, s = e;
5610
5610
  function m(P) {
5611
- const L = f.expandedNodeIds;
5611
+ const L = p.expandedNodeIds;
5612
5612
  L != null && L.includes(P) ? s("updateExpandedNodeIds", L.filter((I) => I !== P)) : s("updateExpandedNodeIds", [...L || [], P]);
5613
5613
  }
5614
- const u = S(() => new Set(f.expandedNodeIds)), g = S(() => {
5614
+ const u = S(() => new Set(p.expandedNodeIds)), g = S(() => {
5615
5615
  const P = [];
5616
5616
  function L(I, d = 0) {
5617
5617
  if (I)
@@ -5622,12 +5622,12 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5622
5622
  node: l
5623
5623
  }), u.value.has(l.id) && l.children && l.children.length > 0 && L(l.children, d + 1);
5624
5624
  }
5625
- return L(f.nodes), P;
5625
+ return L(p.nodes), P;
5626
5626
  });
5627
5627
  q(null);
5628
5628
  const {
5629
5629
  list: h,
5630
- scrollTo: p,
5630
+ scrollTo: f,
5631
5631
  containerProps: v,
5632
5632
  wrapperProps: _
5633
5633
  } = Ko(g, {
@@ -5636,21 +5636,21 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5636
5636
  });
5637
5637
  ye(() => g.value.length, async (P) => {
5638
5638
  const L = v.ref.value;
5639
- L && P * ht < L.scrollTop && (await st(), p(0));
5639
+ L && P * ht < L.scrollTop && (await st(), f(0));
5640
5640
  });
5641
5641
  function r() {
5642
- p(0);
5642
+ f(0);
5643
5643
  }
5644
- function E(P) {
5644
+ function T(P) {
5645
5645
  const L = g.value.findIndex((I) => I.id === P);
5646
- L !== -1 && p(L);
5646
+ L !== -1 && f(L);
5647
5647
  }
5648
5648
  const {
5649
5649
  isDragging: k,
5650
5650
  draggedNodeId: F,
5651
5651
  dropTargetNodeId: w,
5652
5652
  dropPosition: c,
5653
- mousePosition: x,
5653
+ mousePosition: E,
5654
5654
  onDragStart: U,
5655
5655
  cancelDrag: N
5656
5656
  } = ml({
@@ -5660,11 +5660,11 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5660
5660
  },
5661
5661
  getFlattenedItems: () => g.value,
5662
5662
  getContainerRef: () => v.ref.value,
5663
- canDropFn: f.canDropFn
5663
+ canDropFn: p.canDropFn
5664
5664
  });
5665
5665
  return o({
5666
5666
  scrollToTop: r,
5667
- scrollToNode: E,
5667
+ scrollToNode: T,
5668
5668
  cancelDrag: N
5669
5669
  }), (P, L) => {
5670
5670
  var d;
@@ -5688,7 +5688,7 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5688
5688
  }, [(V(), Q(xl, {
5689
5689
  key: l.id,
5690
5690
  node: l.node,
5691
- selected: f.selectedNodeId === l.id,
5691
+ selected: p.selectedNodeId === l.id,
5692
5692
  expandable: !!((i = l.node.children) != null && i.length && l.node.children.length > 0),
5693
5693
  expanded: u.value.has(l.id),
5694
5694
  highlightedStrings: l.node.highlightedStrings,
@@ -5705,8 +5705,8 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5705
5705
  key: 0,
5706
5706
  class: "drag-overlay",
5707
5707
  style: at({
5708
- top: `${a(x).y - 24}px`,
5709
- left: `${a(x).x - 24}px`,
5708
+ top: `${a(E).y - 24}px`,
5709
+ left: `${a(E).x - 24}px`,
5710
5710
  transform: "translate3d(0,0,0)"
5711
5711
  // Force hardware acceleration
5712
5712
  })
@@ -5754,13 +5754,13 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5754
5754
  setup(t, {
5755
5755
  emit: o
5756
5756
  }) {
5757
- const e = t, n = o, f = et(), s = se(), m = ct(), u = hn(), g = sl(), {
5757
+ const e = t, n = o, p = et(), s = se(), m = ct(), u = hn(), g = sl(), {
5758
5758
  canDropFn: h,
5759
- handleNodeDragDrop: p
5759
+ handleNodeDragDrop: f
5760
5760
  } = cl(), v = S(() => e.filterState.searchKey), _ = So(v, 300), {
5761
5761
  generateTreeFromMenu: r
5762
5762
  } = dl();
5763
- async function E() {
5763
+ async function T() {
5764
5764
  return await r({
5765
5765
  filterState: e.filterState,
5766
5766
  eventEmitter: (F) => {
@@ -5769,12 +5769,12 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5769
5769
  });
5770
5770
  }
5771
5771
  ye([() => e.overridedMenu, () => _.value], async () => {
5772
- const F = await E();
5772
+ const F = await T();
5773
5773
  if (e.filterState.searchKey) {
5774
5774
  const w = qo(F.tree, e.filterState.searchKey);
5775
- f.setTreeNodes(w.subTree), f.setExpandedNodeIds(w.shouldExpandNodeIds);
5775
+ p.setTreeNodes(w.subTree), p.setExpandedNodeIds(w.shouldExpandNodeIds);
5776
5776
  } else
5777
- f.setTreeNodes(F.tree);
5777
+ p.setTreeNodes(F.tree);
5778
5778
  });
5779
5779
  const {
5780
5780
  t: k
@@ -5789,7 +5789,7 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5789
5789
  "categorized-items": a(u).linkableItems.value,
5790
5790
  "initial-value": a(u).currentItems.value,
5791
5791
  "show-variant": !1,
5792
- onSubmit: w[1] || (w[1] = (c) => a(u).setProduct(c.map((x) => x._id)))
5792
+ onSubmit: w[1] || (w[1] = (c) => a(u).setProduct(c.map((E) => E._id)))
5793
5793
  }, {
5794
5794
  default: Y(({
5795
5795
  trigger: c
@@ -5804,7 +5804,7 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5804
5804
  "categorized-items": a(g).linkableItems.value,
5805
5805
  "initial-value": a(g).currentItems.value,
5806
5806
  "show-variant": !1,
5807
- onSubmit: w[2] || (w[2] = (c) => a(g).applyProduct(c.map((x) => x._id)))
5807
+ onSubmit: w[2] || (w[2] = (c) => a(g).applyProduct(c.map((E) => E._id)))
5808
5808
  }, {
5809
5809
  default: Y(({
5810
5810
  trigger: c
@@ -5818,20 +5818,20 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5818
5818
  name: "expand_all",
5819
5819
  tooltip: a(k)("menu.tree_editor.actions.expand_all"),
5820
5820
  visible: !0,
5821
- onClick: w[3] || (w[3] = (c) => a(f).expandAllNodes())
5821
+ onClick: w[3] || (w[3] = (c) => a(p).expandAllNodes())
5822
5822
  }, null, 8, ["tooltip"]), C(xt, {
5823
5823
  name: "collapse_all",
5824
5824
  tooltip: a(k)("menu.tree_editor.actions.collapse_all"),
5825
5825
  visible: !0,
5826
- onClick: w[4] || (w[4] = (c) => a(f).collapseAllNodes())
5826
+ onClick: w[4] || (w[4] = (c) => a(p).collapseAllNodes())
5827
5827
  }, null, 8, ["tooltip"])])]), C(Xn, null, {
5828
5828
  default: Y(() => [C(Vl, {
5829
- nodes: a(f).treeNodes,
5830
- selectedNodeId: a(f).selectedNodeId,
5831
- expandedNodeIds: a(f).expandedNodeIds,
5829
+ nodes: a(p).treeNodes,
5830
+ selectedNodeId: a(p).selectedNodeId,
5831
+ expandedNodeIds: a(p).expandedNodeIds,
5832
5832
  canDropFn: a(h),
5833
- onUpdateExpandedNodeIds: w[5] || (w[5] = (c) => a(f).setExpandedNodeIds(c)),
5834
- onNodeDragDrop: w[6] || (w[6] = (c) => a(p)(c))
5833
+ onUpdateExpandedNodeIds: w[5] || (w[5] = (c) => a(p).setExpandedNodeIds(c)),
5834
+ onNodeDragDrop: w[6] || (w[6] = (c) => a(f)(c))
5835
5835
  }, null, 8, ["nodes", "selectedNodeId", "expandedNodeIds", "canDropFn"])]),
5836
5836
  _: 1
5837
5837
  })]));
@@ -5851,62 +5851,62 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5851
5851
  setup(t) {
5852
5852
  const { t: o } = ce(), e = t, n = se();
5853
5853
  et();
5854
- const f = jt(t, "modelValue"), s = S(() => [
5854
+ const p = jt(t, "modelValue"), s = S(() => [
5855
5855
  {
5856
5856
  label: o("menu.tree_editor.labels.main_catalog"),
5857
5857
  value: ""
5858
5858
  },
5859
- ...e.menu.modules.catalog.map((p) => ({
5860
- label: p.name,
5861
- value: p._id
5859
+ ...e.menu.modules.catalog.map((f) => ({
5860
+ label: f.name,
5861
+ value: f._id
5862
5862
  }))
5863
5863
  ]), m = S(() => {
5864
5864
  var _;
5865
- const p = o("menu.common.labels.catalog"), v = ((_ = s.value.find((r) => r.value === f.value.catalogId)) == null ? void 0 : _.label) || o("menu.tree_editor.labels.main_catalog");
5866
- return `${p}: ${v}`;
5865
+ const f = o("menu.common.labels.catalog"), v = ((_ = s.value.find((r) => r.value === p.value.catalogId)) == null ? void 0 : _.label) || o("menu.tree_editor.labels.main_catalog");
5866
+ return `${f}: ${v}`;
5867
5867
  }), u = S(() => {
5868
5868
  var _;
5869
- const p = o("menu.common.labels.scheduler"), v = ((_ = h.value.find((r) => r.value === f.value.schedulerId)) == null ? void 0 : _.label) || o("menu.tree_editor.labels.all_time");
5870
- return `${p}: ${v}`;
5869
+ const f = o("menu.common.labels.scheduler"), v = ((_ = h.value.find((r) => r.value === p.value.schedulerId)) == null ? void 0 : _.label) || o("menu.tree_editor.labels.all_time");
5870
+ return `${f}: ${v}`;
5871
5871
  }), g = S(() => n.isV4), h = S(() => [
5872
5872
  {
5873
5873
  label: o("menu.tree_editor.labels.all_time"),
5874
5874
  value: ""
5875
5875
  },
5876
- ...e.menu.modules.scheduler.map((p) => ({
5877
- label: p.name,
5878
- value: p._id
5876
+ ...e.menu.modules.scheduler.map((f) => ({
5877
+ label: f.name,
5878
+ value: f._id
5879
5879
  }))
5880
5880
  ]);
5881
- return (p, v) => {
5881
+ return (f, v) => {
5882
5882
  const _ = H("FmSearch");
5883
5883
  return V(), J("div", Nl, [
5884
5884
  G("div", Ll, [
5885
5885
  G("div", Gl, [
5886
5886
  C(Nt, {
5887
- "model-value": f.value.catalogId || "",
5887
+ "model-value": p.value.catalogId || "",
5888
5888
  items: s.value,
5889
5889
  placeholder: a(o)("menu.tree_editor.labels.main_catalog"),
5890
5890
  "search-placeholder": a(o)("common.search"),
5891
5891
  "custom-label": m.value,
5892
- "onUpdate:modelValue": v[0] || (v[0] = (r) => f.value.catalogId = r)
5892
+ "onUpdate:modelValue": v[0] || (v[0] = (r) => p.value.catalogId = r)
5893
5893
  }, null, 8, ["model-value", "items", "placeholder", "search-placeholder", "custom-label"])
5894
5894
  ]),
5895
5895
  g.value ? (V(), J("div", Kl, [
5896
5896
  C(Nt, {
5897
- "model-value": f.value.schedulerId || "",
5897
+ "model-value": p.value.schedulerId || "",
5898
5898
  items: h.value,
5899
5899
  placeholder: a(o)("menu.tree_editor.labels.all_time"),
5900
5900
  "search-placeholder": a(o)("common.search"),
5901
5901
  "custom-label": u.value,
5902
- "onUpdate:modelValue": v[1] || (v[1] = (r) => f.value.schedulerId = r)
5902
+ "onUpdate:modelValue": v[1] || (v[1] = (r) => p.value.schedulerId = r)
5903
5903
  }, null, 8, ["model-value", "items", "placeholder", "search-placeholder", "custom-label"])
5904
5904
  ])) : X("", !0)
5905
5905
  ]),
5906
5906
  v[3] || (v[3] = G("div", { class: "h-[1px] bg-fm-color-neutral-gray-100" }, null, -1)),
5907
5907
  C(_, {
5908
- "model-value": f.value.searchKey || "",
5909
- "onUpdate:modelValue": v[2] || (v[2] = (r) => f.value.searchKey = r),
5908
+ "model-value": p.value.searchKey || "",
5909
+ "onUpdate:modelValue": v[2] || (v[2] = (r) => p.value.searchKey = r),
5910
5910
  placeholder: a(o)("common.search")
5911
5911
  }, null, 8, ["model-value", "placeholder"])
5912
5912
  ]);
@@ -5928,9 +5928,9 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5928
5928
  catalogId: null,
5929
5929
  schedulerId: null,
5930
5930
  searchKey: ""
5931
- }), f = se();
5931
+ }), p = se();
5932
5932
  return ye([() => n.value.catalogId, () => n.value.schedulerId], () => {
5933
- f.selectCatalog(n.value.catalogId), f.selectScheduler(n.value.schedulerId);
5933
+ p.selectCatalog(n.value.catalogId), p.selectScheduler(n.value.schedulerId);
5934
5934
  }), (s, m) => {
5935
5935
  const u = H("FmCircularProgress");
5936
5936
  return V(), J("div", Yl, [
@@ -5963,42 +5963,42 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
5963
5963
  menu: {}
5964
5964
  },
5965
5965
  setup(t) {
5966
- const { t: o } = ce(), e = t, n = se(), f = et();
5966
+ const { t: o } = ce(), e = t, n = se(), p = et();
5967
5967
  $e(() => {
5968
5968
  n.setMenu(Ce.cloneDeep(e.menu)), n.computeMergedMenu();
5969
5969
  }), Ft(() => {
5970
- n.clearHistory(), f.setExpandedNodeIds([]), f.setSelectedNodeId(null);
5970
+ n.clearHistory(), p.setExpandedNodeIds([]), p.setSelectedNodeId(null);
5971
5971
  });
5972
- const s = q(null), { currentItemId: m, initialForm: u, itemFormKey: g } = nr(n), { saveItemFormEditingState: h } = Qo(s, n), p = q(null);
5972
+ const s = q(null), { currentItemId: m, initialForm: u, itemFormKey: g } = nr(n), { saveItemFormEditingState: h } = Qo(s, n), f = q(null);
5973
5973
  async function v(r) {
5974
5974
  if (r.type === he.SELECT_ITEM || r.type === he.SELECT_PRICE || r.type === he.SELECT_GROUP || r.type === he.SELECT_VARIANT) {
5975
5975
  if (!_(r.itemId))
5976
5976
  return;
5977
- await st(), r.type === he.SELECT_ITEM ? p.value = {
5977
+ await st(), r.type === he.SELECT_ITEM ? f.value = {
5978
5978
  type: "general"
5979
- } : r.type === he.SELECT_PRICE ? p.value = {
5979
+ } : r.type === he.SELECT_PRICE ? f.value = {
5980
5980
  type: "price"
5981
- } : r.type === he.SELECT_GROUP ? p.value = {
5981
+ } : r.type === he.SELECT_GROUP ? f.value = {
5982
5982
  type: "group",
5983
5983
  id: r.groupId
5984
- } : r.type === he.SELECT_VARIANT && (p.value = {
5984
+ } : r.type === he.SELECT_VARIANT && (f.value = {
5985
5985
  type: "variant",
5986
5986
  id: r.combinationKey
5987
5987
  });
5988
5988
  }
5989
5989
  }
5990
5990
  function _(r) {
5991
- var E, k, F;
5992
- if (((E = u.value) == null ? void 0 : E._id) === r)
5991
+ var T, k, F;
5992
+ if (((T = u.value) == null ? void 0 : T._id) === r)
5993
5993
  return !0;
5994
5994
  if (m.value && m.value !== r && ((k = s.value) != null && k.hasUnsavedChanges())) {
5995
5995
  const w = (F = s.value) == null ? void 0 : F.validate();
5996
5996
  if (!w || w.length > 0)
5997
5997
  return !1;
5998
5998
  }
5999
- return r && (m.value = r, f.setSelectedNodeByItemId(r)), !0;
5999
+ return r && (m.value = r, p.setSelectedNodeByItemId(r)), !0;
6000
6000
  }
6001
- return (r, E) => (V(), Q(il, null, {
6001
+ return (r, T) => (V(), Q(il, null, {
6002
6002
  "left-panel": Y(() => [
6003
6003
  C(ql, {
6004
6004
  menu: r.menu,
@@ -6017,7 +6017,7 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
6017
6017
  menu: a(n).state.menu,
6018
6018
  "merged-menu": a(n).mergedMenu,
6019
6019
  "category-id": null,
6020
- focused: p.value,
6020
+ focused: f.value,
6021
6021
  "onUpdate:editingState": a(h)
6022
6022
  }, null, 8, ["initial-form", "menu", "merged-menu", "focused", "onUpdate:editingState"])) : (V(), J("div", Jl, [
6023
6023
  G("div", Ql, ge(a(o)("menu.tree_editor.labels.please_select_a_product_to_edit")), 1)
@@ -6044,18 +6044,18 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
6044
6044
  },
6045
6045
  emits: ["update:show", "submit"],
6046
6046
  setup(t, { emit: o }) {
6047
- const e = t, n = Fe(), { minor: f } = qe(n), { t: s } = ce(), m = o, u = () => {
6047
+ const e = t, n = Fe(), { minor: p } = qe(n), { t: s } = ce(), m = o, u = () => {
6048
6048
  m("update:show", !1);
6049
6049
  }, g = on(), h = se();
6050
6050
  h.selectCatalog(null), h.selectScheduler(null);
6051
- const p = q(!1), v = () => {
6052
- f(
6051
+ const f = q(!1), v = () => {
6052
+ p(
6053
6053
  async () => {
6054
- const r = h.state.menu, E = so(r);
6055
- await g.updateMenuSetting(E), await g.importMenu(E), u();
6054
+ const r = h.state.menu, T = so(r);
6055
+ await g.updateMenuSetting(T), await g.importMenu(T), u();
6056
6056
  },
6057
6057
  {
6058
- isLoading: p,
6058
+ isLoading: f,
6059
6059
  message: "Updating menu...",
6060
6060
  successMessage: "Menu updated successfully"
6061
6061
  }
@@ -6066,7 +6066,7 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
6066
6066
  u();
6067
6067
  }
6068
6068
  );
6069
- return (r, E) => {
6069
+ return (r, T) => {
6070
6070
  const k = H("fm-button"), F = H("fm-form");
6071
6071
  return V(), Q(Dn, { to: "body" }, [
6072
6072
  C(Vn, { name: "fade" }, {
@@ -6104,7 +6104,7 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
6104
6104
  label: a(s)("common.save"),
6105
6105
  type: "submit",
6106
6106
  variant: "primary",
6107
- loading: p.value
6107
+ loading: f.value
6108
6108
  }, null, 8, ["label", "loading"])
6109
6109
  ])
6110
6110
  ]),
@@ -6125,16 +6125,16 @@ const fl = { key: 0 }, gl = ["innerHTML"], vl = /* @__PURE__ */ ie({
6125
6125
  setup(t) {
6126
6126
  const o = on(), e = nn();
6127
6127
  function n() {
6128
- f();
6128
+ p();
6129
6129
  }
6130
- const f = () => {
6130
+ const p = () => {
6131
6131
  e.open({
6132
6132
  component: ai,
6133
6133
  props: { menu: o.state.menu }
6134
6134
  });
6135
6135
  };
6136
6136
  function s(m) {
6137
- m.data.type === Jn && f();
6137
+ m.data.type === Jn && p();
6138
6138
  }
6139
6139
  return $e(() => {
6140
6140
  window.addEventListener("message", s);