@feedmepos/mf-menu 0.23.9 → 0.23.10

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 (50) hide show
  1. package/dist/{App-DtqKFa-M.js → App-PTR4Oduj.js} +3 -3
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-DMqELa0a.js → ApplyProduct.vue_vue_type_script_setup_true_lang-HXBglWhV.js} +2 -2
  3. package/dist/{Catalog-Bx46vALl.js → Catalog-BnM8KRfr.js} +5 -5
  4. package/dist/{Category-DGtEAdJZ.js → Category-CaV4N1Ce.js} +5 -5
  5. package/dist/{CookingGuide-b7YyO9Uy.js → CookingGuide-B9xYIoDL.js} +4 -4
  6. package/dist/{Group-BTUGQYMx.js → Group-RbcApNfe.js} +1 -1
  7. package/dist/{Group-COCWh9QO.js → Group-x3izNi9W.js} +3 -3
  8. package/dist/{Group.vue_vue_type_script_setup_true_lang-DCivMxe6.js → Group.vue_vue_type_script_setup_true_lang-DIjzdkDQ.js} +7 -7
  9. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BBJaNNDB.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CTV83veT.js} +2 -2
  10. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-OyB5MZ6E.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-CwQWKEag.js} +6 -6
  11. package/dist/{Ingredient-CRoJXhJg.js → Ingredient-BreWqCKr.js} +4 -4
  12. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-BWZziQhN.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DZaOLUJV.js} +2 -2
  13. package/dist/{LinkProductSideSheet-DCbv5LOb.js → LinkProductSideSheet-D06husQO.js} +2 -2
  14. package/dist/{MenuSetting-0MA-y5Uo.js → MenuSetting-DN5JYAvT.js} +2 -2
  15. package/dist/{PrintRoute-C8UqmCC-.js → PrintRoute-7wcCwna0.js} +4 -4
  16. package/dist/{Product-BLaiwDHh.js → Product-Co2ehVk3.js} +1 -1
  17. package/dist/{Product.vue_vue_type_script_setup_true_lang-RudSoGAO.js → Product.vue_vue_type_script_setup_true_lang-DxX0mf9K.js} +10 -10
  18. package/dist/{Products-CGSNvUUN.js → Products-C-0Q-357.js} +8 -8
  19. package/dist/{Publish-DorH8Kkg.js → Publish-Dyrls8D2.js} +3 -3
  20. package/dist/{Recipe-3PKNbSja.js → Recipe-DdtZhYbv.js} +5 -5
  21. package/dist/{Scheduler-DQp8JrtH.js → Scheduler-BTJArkGR.js} +3 -3
  22. package/dist/{SchedulerSelector.vue_vue_type_script_setup_true_lang-D--M_zHZ.js → SchedulerSelector.vue_vue_type_script_setup_true_lang-PhvXUzQq.js} +1 -1
  23. package/dist/{ServingSequence-D_nZTbyM.js → ServingSequence-Bx2aAuL4.js} +3 -3
  24. package/dist/{Setting-CQNoA3wW.js → Setting-BKUvMO8u.js} +4 -4
  25. package/dist/{Takeaway-sTbaVafp.js → Takeaway--ZhpZpsh.js} +4 -4
  26. package/dist/{Takeaway-B9Wb5yaU.js → Takeaway-Btu1oQWJ.js} +1 -1
  27. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CMqg7VPL.js → Takeaway.vue_vue_type_script_setup_true_lang-yxRFoL-O.js} +5 -5
  28. package/dist/{Unit-ktOnE-cI.js → Unit-BNc4SeqW.js} +2 -2
  29. package/dist/{Variant-AoSfk5Rq.js → Variant-MQe7d-DT.js} +3 -3
  30. package/dist/{_id_-C1wv42CB.js → _id_-DNGTnw4D.js} +7 -7
  31. package/dist/{app-cqyYeBCV.js → app-CfyDRqR4.js} +21 -21
  32. package/dist/{app-BZMBFu8I.js → app-D8AROOBS.js} +1 -1
  33. package/dist/app.js +1 -1
  34. package/dist/assets/{linked-status-Dt294ozy.js → linked-status-BvASKsex.js} +3 -3
  35. package/dist/assets/{override-menu-BLgReVRT.js → override-menu-DtS3BJkg.js} +3 -3
  36. package/dist/assets/{validate-menu-DVcfUeaF.js → validate-menu-BhmkpiOm.js} +3 -3
  37. package/dist/{catalog-Xy4edEu0.js → catalog-CL9Uya1M.js} +1 -1
  38. package/dist/{catalogSetting-Dj4uJ6ap.js → catalogSetting-QIkOL11D.js} +1 -1
  39. package/dist/{currency-D47utL_H.js → currency-DCy6AfmR.js} +1 -1
  40. package/dist/{discardConfirm-DrKZ0dlv.js → discardConfirm-BDW3__vj.js} +1 -1
  41. package/dist/{index-Cj8NFmQq.js → index-BDzqlEcq.js} +3 -3
  42. package/dist/{index-BMRkuLfJ.js → index-DT6UQyx3.js} +4 -4
  43. package/dist/{item-CZZFhIzx.js → item-C-Ozk1eC.js} +1083 -1082
  44. package/dist/{menu-2uZhJ8-G.js → menu-DOa1Rij1.js} +1 -1
  45. package/dist/{menu-cH-dKOpr.js → menu-DX-Lk6_z.js} +173 -173
  46. package/dist/{remy-CmV80QtE.js → remy-CGxGPvYn.js} +2 -2
  47. package/dist/{scheduler-B6inGG_h.js → scheduler-CRapKvah.js} +4 -4
  48. package/dist/{toExcel-DKWtLi4q.js → toExcel-Ugc5Oxl0.js} +2 -2
  49. package/dist/{unit-BY8M4FGB.js → unit-Dce10XNe.js} +2 -2
  50. package/package.json +1 -1
@@ -1,27 +1,27 @@
1
1
  import { defineStore as Pi } from "pinia";
2
- import { openBlock as O, createElementBlock as Q, createElementVNode as P, defineComponent as ue, resolveComponent as G, toDisplayString as de, createVNode as w, Fragment as ke, renderList as Ye, createBlock as Y, h as he, ref as J, computed as F, watch as Re, unref as p, renderSlot as ve, withCtx as L, createCommentVNode as te, Transition as bn, resolveDynamicComponent as St, withDirectives as Qe, vShow as At, mergeProps as Ti, withModifiers as Rt, createTextVNode as Ct, normalizeClass as Le, onMounted as ut, resolveDirective as Nt, nextTick as Ui, onBeforeUnmount as yn, normalizeProps as _n, guardReactiveProps as wn, normalizeStyle as Sn, getCurrentInstance as Cn, render as An } from "vue";
3
- import { G as B, J as pe, Y as Rn, a0 as xn, a1 as Mn, H as ne, z as Se, B as Ae, a2 as Vi, u as fe, a3 as $i, a4 as bi, A as He, K as Xe, U as kn, a5 as On, V as Et, W as zn, a6 as yi, a7 as En } from "./menu-cH-dKOpr.js";
2
+ import { openBlock as O, createElementBlock as Q, createElementVNode as P, defineComponent as ue, resolveComponent as G, toDisplayString as de, createVNode as S, Fragment as Me, renderList as Ye, createBlock as Y, h as he, ref as J, computed as F, watch as Re, unref as p, renderSlot as ve, withCtx as L, createCommentVNode as te, Transition as bn, resolveDynamicComponent as St, withDirectives as Qe, vShow as At, mergeProps as Ti, withModifiers as Rt, createTextVNode as Ct, normalizeClass as Le, onMounted as ut, resolveDirective as Nt, nextTick as Ui, onBeforeUnmount as yn, normalizeProps as _n, guardReactiveProps as wn, normalizeStyle as Sn, getCurrentInstance as Cn, render as An } from "vue";
3
+ import { G as B, J as pe, Y as Rn, a0 as xn, a1 as kn, H as ne, z as Se, B as Ae, a2 as Vi, u as fe, a3 as $i, a4 as bi, A as He, K as Xe, U as Mn, a5 as On, V as Et, W as zn, a6 as yi, a7 as En } from "./menu-DX-Lk6_z.js";
4
4
  import { useI18n as me, useCoreStore as Zt, CustomAttributesForm as Fn } from "@feedmepos/mf-common";
5
5
  import { useDialog as Be, useDialogChild as Jt, useSnackbar as De, components as xe, FmButtonColorThemeVariant as je, FmButtonVariant as qe, useBreakpoints as Ni } from "@feedmepos/ui-library";
6
- import { C as Ue } from "./catalog-Xy4edEu0.js";
6
+ import { C as Ue } from "./catalog-CL9Uya1M.js";
7
7
  import { u as In, c as Dn } from "./search-7ZYHUW7s.js";
8
- import { p as Qt, u as Pn } from "./app-cqyYeBCV.js";
8
+ import { p as Qt, u as Pn } from "./app-CfyDRqR4.js";
9
9
  import { _ as _i, a as Li } from "./tooltip-DpokWKto.js";
10
10
  import { _ as st } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
11
  import { _ as Ke, a as Tn } from "./FormSection.vue_vue_type_script_setup_true_lang-BWJUD8NZ.js";
12
12
  import { s as Lt, F as Un } from "./object-DNBFWMt7.js";
13
- import { l as $e, u as Bi } from "./discardConfirm-DrKZ0dlv.js";
14
- import { R as Ne } from "./remy-CmV80QtE.js";
13
+ import { l as $e, u as Bi } from "./discardConfirm-BDW3__vj.js";
14
+ import { R as Ne } from "./remy-CGxGPvYn.js";
15
15
  import { _ as nt } from "./FormItem.vue_vue_type_script_setup_true_lang-DKsxEK-8.js";
16
- import { _ as it, l as Bt, T as Vn } from "./index-BMRkuLfJ.js";
16
+ import { _ as it, l as Bt, T as Vn } from "./index-DT6UQyx3.js";
17
17
  import { useInventoryStore as Ki, InventoryBindingForm as $n, InventoryBindingSummary as Nn } from "@feedmepos/mf-inventory-portal";
18
18
  import { c as pt } from "./check-C9mY6LiX.js";
19
- import { L as Ln } from "./LinkProductSideSheet-DCbv5LOb.js";
20
- import { f as mt } from "./currency-D47utL_H.js";
19
+ import { L as Ln } from "./LinkProductSideSheet-D06husQO.js";
20
+ import { f as mt } from "./currency-DCy6AfmR.js";
21
21
  import { c as Bn } from "./string-DpfFixWH.js";
22
22
  import { V as Gi } from "./vuedraggable-WU01qJgi.js";
23
- import { _ as Kn } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-DMqELa0a.js";
24
- import { V as wi } from "./index-Cj8NFmQq.js";
23
+ import { _ as Kn } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-HXBglWhV.js";
24
+ import { V as wi } from "./index-BDzqlEcq.js";
25
25
  class _t {
26
26
  constructor(i, t, n, a) {
27
27
  this.scheduler = i, this.menuStore = t, this.updateMenu = n, this.dialog = a;
@@ -222,7 +222,7 @@ class _t {
222
222
  const i = xn(
223
223
  this.menuStore.variants,
224
224
  this.menuStore.categories,
225
- Mn(this.menuStore.state.menu.modules.item, (a) => a.code || a.name)
225
+ kn(this.menuStore.state.menu.modules.item, (a) => a.code || a.name)
226
226
  ), t = new Set(
227
227
  this.menuStore.currentCatalog ? Ue.getItemAvailable(this.menuStore.currentCatalog) : this.menuStore.state.menu.modules.item.map((a) => a._id)
228
228
  );
@@ -367,25 +367,25 @@ class Wi {
367
367
  const n = this.getFallbackPrices(i), a = this.menuStore.state.menu.modules.item, o = this.menuStore.state.menu.modules.group, r = this.menuStore.items;
368
368
  function l(s, u) {
369
369
  const c = s.items.reduce((h, m) => {
370
- var D, k, y, g;
371
- const b = a.find((C) => m._id === C._id);
372
- if (!b && t) return h;
373
- const v = m.combinationKey ? {
374
- ...(D = b == null ? void 0 : b.variant) == null ? void 0 : D.variantCombinations.find(
375
- (C) => C.combinationKey === m.combinationKey
370
+ var D, M, b, _;
371
+ const v = a.find((A) => m._id === A._id);
372
+ if (!v && t) return h;
373
+ const g = m.combinationKey ? {
374
+ ...(D = v == null ? void 0 : v.variant) == null ? void 0 : D.variantCombinations.find(
375
+ (A) => A.combinationKey === m.combinationKey
376
376
  ),
377
- name: Vi(fe().variants, ((k = b == null ? void 0 : b.variant) == null ? void 0 : k.variantGroupIds) || [])[m.combinationKey]
378
- } : b, f = (y = o.find((C) => C._id === s._id)) == null ? void 0 : y.items.find((C) => C._id === m._id && C.combinationKey === m.combinationKey), S = !t && !m.combinationKey, z = (g = u.find(
379
- (C) => C._id == m._id && C.combinationKey == m.combinationKey
380
- )) == null ? void 0 : g.price, E = m.name ?? (f == null ? void 0 : f.name) ?? (v == null ? void 0 : v.name) ?? "", j = {
377
+ name: Vi(fe().variants, ((M = v == null ? void 0 : v.variant) == null ? void 0 : M.variantGroupIds) || [])[m.combinationKey]
378
+ } : v, f = (b = o.find((A) => A._id === s._id)) == null ? void 0 : b.items.find((A) => A._id === m._id && A.combinationKey === m.combinationKey), C = !t && !m.combinationKey, z = (_ = u.find(
379
+ (A) => A._id == m._id && A.combinationKey == m.combinationKey
380
+ )) == null ? void 0 : _.price, E = m.name ?? (f == null ? void 0 : f.name) ?? (g == null ? void 0 : g.name) ?? "", j = {
381
381
  ...m,
382
382
  name: E,
383
- code: v == null ? void 0 : v.code,
384
- fallbackName: S ? null : E,
383
+ code: g == null ? void 0 : g.code,
384
+ fallbackName: C ? null : E,
385
385
  price: m.price,
386
- fallbackPrice: S ? null : z,
386
+ fallbackPrice: C ? null : z,
387
387
  orderFrom: m.orderFrom,
388
- fallbackOrder: v == null ? void 0 : v.orderFrom
388
+ fallbackOrder: g == null ? void 0 : g.orderFrom
389
389
  };
390
390
  return [...h, j];
391
391
  }, []), d = xt(a, s.items);
@@ -447,9 +447,9 @@ class Wi {
447
447
  }
448
448
  function a(s, u, c) {
449
449
  var m;
450
- const d = n(u.groups, c), h = (((m = u.variant) == null ? void 0 : m.variantCombinations) ?? []).map((b) => {
451
- const v = n(b.groups ?? [], c);
452
- return { ...b, groups: v };
450
+ const d = n(u.groups, c), h = (((m = u.variant) == null ? void 0 : m.variantCombinations) ?? []).map((v) => {
451
+ const g = n(v.groups ?? [], c);
452
+ return { ...v, groups: g };
453
453
  });
454
454
  return gn(s, {
455
455
  ...u,
@@ -512,8 +512,8 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
512
512
  const r = G("FmButton");
513
513
  return i.variant === "full" ? (O(), Q("div", Hn, [
514
514
  P("div", Xn, de(a.title), 1),
515
- w(Yn),
516
- (O(!0), Q(ke, null, Ye(a.items, (l) => (O(), Y(_i, {
515
+ S(Yn),
516
+ (O(!0), Q(Me, null, Ye(a.items, (l) => (O(), Y(_i, {
517
517
  key: l.name,
518
518
  name: l.name,
519
519
  value: l.value || "--"
@@ -535,9 +535,9 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
535
535
  setup(e, { emit: i }) {
536
536
  const t = e, n = i, { t: a } = me(), o = fe(), r = J(o.state.currentCatalogId || null), l = F(() => {
537
537
  const h = Object.keys(t.linkedStatus.catalogs).map((m) => {
538
- var b;
538
+ var v;
539
539
  return {
540
- label: ((b = o.state.menu.modules.catalog.find((v) => v._id === m)) == null ? void 0 : b.name) || "Unknown",
540
+ label: ((v = o.state.menu.modules.catalog.find((g) => g._id === m)) == null ? void 0 : v.name) || "Unknown",
541
541
  value: m
542
542
  };
543
543
  });
@@ -549,11 +549,11 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
549
549
  ...h
550
550
  ];
551
551
  }), s = J(o.state.currentSchedulerId || null), u = () => r.value ? t.linkedStatus.catalogs[r.value].schedulers : t.linkedStatus.schedulers, c = F(() => {
552
- const m = u().map((b) => {
553
- var v;
552
+ const m = u().map((v) => {
553
+ var g;
554
554
  return {
555
- label: ((v = o.state.menu.modules.scheduler.find((f) => f._id === b)) == null ? void 0 : v.name) || "Unknown",
556
- value: b
555
+ label: ((g = o.state.menu.modules.scheduler.find((f) => f._id === v)) == null ? void 0 : g.name) || "Unknown",
556
+ value: v
557
557
  };
558
558
  });
559
559
  return [
@@ -576,7 +576,7 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
576
576
  d();
577
577
  }
578
578
  ), (h, m) => {
579
- const b = G("FmSelect");
579
+ const v = G("FmSelect");
580
580
  return O(), Q("div", qn, [
581
581
  P("div", Zn, [
582
582
  P("div", Jn, de(p(a)("menu.catalog_scheduler.title")), 1),
@@ -584,19 +584,19 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
584
584
  ]),
585
585
  P("div", eo, [
586
586
  P("div", to, [
587
- w(b, {
587
+ S(v, {
588
588
  label: p(a)("menu.common.labels.catalog"),
589
589
  items: l.value,
590
590
  modelValue: r.value,
591
- "onUpdate:modelValue": m[0] || (m[0] = (v) => r.value = v)
591
+ "onUpdate:modelValue": m[0] || (m[0] = (g) => r.value = g)
592
592
  }, null, 8, ["label", "items", "modelValue"])
593
593
  ]),
594
594
  P("div", io, [
595
- w(b, {
595
+ S(v, {
596
596
  label: p(a)("menu.common.labels.scheduler"),
597
597
  items: c.value,
598
598
  modelValue: s.value,
599
- "onUpdate:modelValue": m[1] || (m[1] = (v) => s.value = v)
599
+ "onUpdate:modelValue": m[1] || (m[1] = (g) => s.value = g)
600
600
  }, null, 8, ["label", "items", "modelValue"])
601
601
  ])
602
602
  ])
@@ -630,12 +630,12 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
630
630
  P("p", ro, de(n.title), 1),
631
631
  n.description ? (O(), Q("p", so, de(n.description), 1)) : te("", !0)
632
632
  ]),
633
- w(o, {
633
+ S(o, {
634
634
  "model-value": n.toggle,
635
635
  "onUpdate:modelValue": a[0] || (a[0] = (l) => t("update:toggle", l))
636
636
  }, null, 8, ["model-value"])
637
637
  ]),
638
- w(bn, { name: "expand" }, {
638
+ S(bn, { name: "expand" }, {
639
639
  default: L(() => [
640
640
  n.toggle ? (O(), Q("div", lo, [
641
641
  ve(n.$slots, "default", {}, void 0, !0)
@@ -648,7 +648,7 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
648
648
  }));
649
649
  };
650
650
  }
651
- }), Ze = /* @__PURE__ */ st(uo, [["__scopeId", "data-v-e920f110"]]), co = "/assets/linked-status-Dt294ozy.js", mo = "/assets/override-menu-BLgReVRT.js";
651
+ }), Ze = /* @__PURE__ */ st(uo, [["__scopeId", "data-v-e920f110"]]), co = "/assets/linked-status-BvASKsex.js", mo = "/assets/override-menu-DtS3BJkg.js";
652
652
  function ho(e) {
653
653
  var n;
654
654
  const i = ne(e), t = (n = i.variant) == null ? void 0 : n.variantCombinations;
@@ -657,10 +657,10 @@ function ho(e) {
657
657
  function po(e, i, t, n) {
658
658
  const a = ne(i), o = t ? a.modules.catalog.find((h) => h._id === t) : null, r = n ? a.modules.scheduler.find((h) => h._id === n) : null, l = o ? ne(o) : void 0, s = t ? a.modules.catalog.filter((h) => h._id !== t) : [], u = r ? ne(r) : void 0, c = e.reduce((h, m) => (h[m._id] = ho(m), h), {});
659
659
  function d(h = []) {
660
- const m = e.map((b) => b._id);
660
+ const m = e.map((v) => v._id);
661
661
  return [
662
- ...h.filter((b) => !m.includes(b._id)),
663
- ...Object.values(c).flatMap((b) => b)
662
+ ...h.filter((v) => !m.includes(v._id)),
663
+ ...Object.values(c).flatMap((v) => v)
664
664
  ];
665
665
  }
666
666
  return l && n ? (l.override.scheduler = {
@@ -702,9 +702,9 @@ function ct(e, i, t) {
702
702
  const l = (u = e == null ? void 0 : e.groups) == null ? void 0 : u.find((h) => h._id === r._id);
703
703
  let s;
704
704
  return l ? s = ((c = r.items) == null ? void 0 : c.map((h) => {
705
- var b;
706
- const m = (b = l.items) == null ? void 0 : b.find(
707
- (v) => v._id === h._id && v.combinationKey === h.combinationKey
705
+ var v;
706
+ const m = (v = l.items) == null ? void 0 : v.find(
707
+ (g) => g._id === h._id && g.combinationKey === h.combinationKey
708
708
  );
709
709
  return ct(m || h, i, t + 1);
710
710
  })) ?? [] : s = ((d = r.items) == null ? void 0 : d.map((h) => ct(h, i, t + 1))) ?? [], {
@@ -866,11 +866,11 @@ async function Bs(e, i, t) {
866
866
  const u = (r = s.items) == null ? void 0 : r.find((d) => d._id === t && !d.combinationKey), c = e.modules.item.find((d) => d._id === t);
867
867
  if (u) {
868
868
  const d = (l = s.items) == null ? void 0 : l.filter((m) => m._id === t && m.combinationKey), h = [u, ...d].map((m) => {
869
- var f, S;
870
- const b = m.combinationKey ? (S = (f = c == null ? void 0 : c.variant) == null ? void 0 : f.variantCombinations) == null ? void 0 : S.find(
869
+ var f, C;
870
+ const v = m.combinationKey ? (C = (f = c == null ? void 0 : c.variant) == null ? void 0 : f.variantCombinations) == null ? void 0 : C.find(
871
871
  (z) => z.combinationKey === m.combinationKey
872
- ) : c, v = b && c ? o(c, b) : m;
873
- return o(v, m);
872
+ ) : c, g = v && c ? o(c, v) : m;
873
+ return o(g, m);
874
874
  });
875
875
  a.push({
876
876
  group: s,
@@ -956,7 +956,7 @@ function Dt(e, i) {
956
956
  for (var t = 0, n = new Array(i); t < i; t++) n[t] = e[t];
957
957
  return n;
958
958
  }
959
- var Ai, Mo, ft, ge = (Ai = function(e) {
959
+ var Ai, ko, ft, ge = (Ai = function(e) {
960
960
  /*!
961
961
  Copyright (c) 2018 Jed Watson.
962
962
  Licensed under the MIT License (MIT), see
@@ -983,7 +983,7 @@ var Ai, Mo, ft, ge = (Ai = function(e) {
983
983
  }
984
984
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
985
985
  })();
986
- }, Ai(ft = { path: Mo, exports: {}, require: function(e, i) {
986
+ }, Ai(ft = { path: ko, exports: {}, require: function(e, i) {
987
987
  return function() {
988
988
  throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
989
989
  }(i == null && ft.path);
@@ -1082,7 +1082,7 @@ function Zi(e, i) {
1082
1082
  }
1083
1083
  var dt = function(e, i) {
1084
1084
  e === void 0 && (e = {}), i === void 0 && (i = {}), this.type = "manipulateImage", this.move = e, this.scale = i;
1085
- }, ko = function(e, i) {
1085
+ }, Mo = function(e, i) {
1086
1086
  i === void 0 && (i = {}), this.type = "resize", this.directions = e, this.params = i;
1087
1087
  }, ti = function(e) {
1088
1088
  this.type = "move", this.directions = e;
@@ -1162,7 +1162,7 @@ var Pt = Ee("vue-handler-wrapper"), Ji = { name: "HandlerWrapper", components: {
1162
1162
  } }, emits: ["leave", "enter", "drag", "drag-end"] };
1163
1163
  Ji.render = function(e, i, t, n, a, o) {
1164
1164
  var r = G("DraggableElement");
1165
- return O(), Y("div", { class: o.classes.root }, [w(r, { class: o.classes.draggable, onDrag: i[1] || (i[1] = function(l) {
1165
+ return O(), Y("div", { class: o.classes.root }, [S(r, { class: o.classes.draggable, onDrag: i[1] || (i[1] = function(l) {
1166
1166
  return e.$emit("drag", l);
1167
1167
  }), onDragEnd: i[2] || (i[2] = function(l) {
1168
1168
  return e.$emit("drag-end");
@@ -1192,8 +1192,8 @@ Qi.render = function(e, i, t, n, a, o) {
1192
1192
  return [ve(e.$slots, "default")];
1193
1193
  }), _: 3 }, 8, ["class"]);
1194
1194
  };
1195
- var Ie = ["left", "right", "top", "bottom"], Eo = ["left", "right"], Fo = ["top", "bottom"], Io = ["left", "top"], Do = ["fill-area", "fit-area", "stencil", "none"], Mi = { left: 0, top: 0, width: 0, height: 0 };
1196
- function ki(e, i, t) {
1195
+ var Ie = ["left", "right", "top", "bottom"], Eo = ["left", "right"], Fo = ["top", "bottom"], Io = ["left", "top"], Do = ["fill-area", "fit-area", "stencil", "none"], ki = { left: 0, top: 0, width: 0, height: 0 };
1196
+ function Mi(e, i, t) {
1197
1197
  return !(t = t || ["width", "height", "left", "top"]).some(function(n) {
1198
1198
  return e[n] !== i[n];
1199
1199
  });
@@ -1217,10 +1217,10 @@ function ht(e, i) {
1217
1217
  function Fe(e, i) {
1218
1218
  return { left: e.left - i.left, top: e.top - i.top, width: e.width + i.left + i.right, height: e.height + i.top + i.bottom };
1219
1219
  }
1220
- function Mt(e) {
1220
+ function kt(e) {
1221
1221
  return { left: -e.left, top: -e.top };
1222
1222
  }
1223
- function Me(e, i) {
1223
+ function ke(e, i) {
1224
1224
  return X(X({}, e), { left: e.left + i.left, top: e.top + i.top });
1225
1225
  }
1226
1226
  function ze(e, i, t, n) {
@@ -1259,14 +1259,14 @@ function We(e, i) {
1259
1259
  var t = i * Math.PI / 180;
1260
1260
  return { left: e.left * Math.cos(t) - e.top * Math.sin(t), top: e.left * Math.sin(t) + e.top * Math.cos(t) };
1261
1261
  }
1262
- function kt(e, i) {
1262
+ function Mt(e, i) {
1263
1263
  var t = ht(we(e, i), i);
1264
1264
  return t.left + t.right + t.top + t.bottom ? t.left + t.right > t.top + t.bottom ? Math.min((e.width + t.left + t.right) / e.width, at(e, i)) : Math.min((e.height + t.top + t.bottom) / e.height, at(e, i)) : 1;
1265
1265
  }
1266
1266
  function we(e, i, t) {
1267
1267
  t === void 0 && (t = !1);
1268
1268
  var n = rt(e, i);
1269
- return Me(e, t ? Mt(n) : n);
1269
+ return ke(e, t ? kt(n) : n);
1270
1270
  }
1271
1271
  function Yt(e) {
1272
1272
  return { width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : 1 / 0, height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : 1 / 0 };
@@ -1307,8 +1307,8 @@ function Ve(e) {
1307
1307
  return s && { width: s.width, height: s.height };
1308
1308
  }
1309
1309
  function Ht(e) {
1310
- var i = e.event, t = e.coordinates, n = e.positionRestrictions, a = n === void 0 ? {} : n, o = Me(t, i.directions);
1311
- return Me(o, rt(o, a));
1310
+ var i = e.event, t = e.coordinates, n = e.positionRestrictions, a = n === void 0 ? {} : n, o = ke(t, i.directions);
1311
+ return ke(o, rt(o, a));
1312
1312
  }
1313
1313
  function To(e) {
1314
1314
  var i = e.coordinates, t = e.transform, n = e.imageSize, a = e.sizeRestrictions, o = e.positionRestrictions, r = e.aspectRatio, l = e.visibleArea, s = function(c, d) {
@@ -1317,8 +1317,8 @@ function To(e) {
1317
1317
  return (Array.isArray(t) ? t : [t]).forEach(function(c) {
1318
1318
  var d = {};
1319
1319
  be((d = typeof c == "function" ? c({ coordinates: u, imageSize: n, visibleArea: l }) : c).width) && be(d.height) || (u = function(h, m) {
1320
- var b = X(X(X({}, h), Ve({ width: m.width, height: m.height, sizeRestrictions: a, aspectRatio: r })), { left: 0, top: 0 });
1321
- return s(b, { left: h.left, top: h.top });
1320
+ var v = X(X(X({}, h), Ve({ width: m.width, height: m.height, sizeRestrictions: a, aspectRatio: r })), { left: 0, top: 0 });
1321
+ return s(v, { left: h.left, top: h.top });
1322
1322
  }(u, X(X({}, u), d))), be(d.left) && be(d.top) || (u = s(u, X(X({}, u), d)));
1323
1323
  }), u;
1324
1324
  }
@@ -1330,8 +1330,8 @@ function Uo(e) {
1330
1330
  e.stencilReference;
1331
1331
  var s, u, c, d = X({}, n), h = X({}, a), m = X({}, o);
1332
1332
  s = ae(m), u = ae(d), c === void 0 && (c = 1e-3), (s === 0 || u === 0 ? Math.abs(u - s) < c : Math.abs(u / s) < 1 + c && Math.abs(u / s) > 1 - c) || (d = X(X({}, d), Ve({ sizeRestrictions: r, width: d.width, height: d.height, aspectRatio: { minimum: ae(m), maximum: ae(m) } })));
1333
- var b = kt(h = ze(h, d.width * t.width / (h.width * m.width)), i({ visibleArea: h, type: "resize" }));
1334
- return b !== 1 && (h = ze(h, b), d = ze(d, b)), h = we(h = Me(h, ot(_e(d), _e(h))), i({ visibleArea: h, type: "move" })), { coordinates: d = we(d, Ot(Pe(h), l)), visibleArea: h };
1333
+ var v = Mt(h = ze(h, d.width * t.width / (h.width * m.width)), i({ visibleArea: h, type: "resize" }));
1334
+ return v !== 1 && (h = ze(h, v), d = ze(d, v)), h = we(h = ke(h, ot(_e(d), _e(h))), i({ visibleArea: h, type: "move" })), { coordinates: d = we(d, Ot(Pe(h), l)), visibleArea: h };
1335
1335
  }
1336
1336
  function Vo(e) {
1337
1337
  var i = e.event, t = e.getAreaRestrictions, n = e.boundaries, a = e.coordinates, o = e.visibleArea;
@@ -1342,8 +1342,8 @@ function Vo(e) {
1342
1342
  if (a && o && i.type !== "manipulateImage") {
1343
1343
  var u = { width: 0, height: 0 };
1344
1344
  s.width, n.width, ae(n) > ae(l) ? (u.height = 0.8 * n.height, u.width = u.height * ae(l)) : (u.width = 0.8 * n.width, u.height = u.width * ae(l));
1345
- var c = kt(s = ze(s, l.width * n.width / (s.width * u.width)), t({ visibleArea: s, type: "resize" }));
1346
- s = ze(s, c), c !== 1 && (u.height /= c, u.width /= c), s = we(s = Me(s, ot(_e(l), _e(s))), t({ visibleArea: s, type: "move" })), l = we(l, Ot(Pe(s), r));
1345
+ var c = Mt(s = ze(s, l.width * n.width / (s.width * u.width)), t({ visibleArea: s, type: "resize" }));
1346
+ s = ze(s, c), c !== 1 && (u.height /= c, u.width /= c), s = we(s = ke(s, ot(_e(l), _e(s))), t({ visibleArea: s, type: "move" })), l = we(l, Ot(Pe(s), r));
1347
1347
  }
1348
1348
  return { coordinates: l, visibleArea: s };
1349
1349
  }
@@ -1351,7 +1351,7 @@ function $o(e) {
1351
1351
  var i = e.event, t = e.coordinates, n = e.visibleArea, a = e.getAreaRestrictions, o = X({}, n), r = X({}, t);
1352
1352
  if (i.type === "setCoordinates") {
1353
1353
  var l = Math.max(0, r.width - o.width), s = Math.max(0, r.height - o.height);
1354
- l > s ? o = ze(o, Math.min(r.width / o.width, at(o, a({ visibleArea: o, type: "resize" })))) : s > l && (o = ze(o, Math.min(r.height / o.height, at(o, a({ visibleArea: o, type: "resize" }))))), o = we(o = Me(o, Mt(rt(r, Pe(o)))), a({ visibleArea: o, type: "move" }));
1354
+ l > s ? o = ze(o, Math.min(r.width / o.width, at(o, a({ visibleArea: o, type: "resize" })))) : s > l && (o = ze(o, Math.min(r.height / o.height, at(o, a({ visibleArea: o, type: "resize" }))))), o = we(o = ke(o, kt(rt(r, Pe(o)))), a({ visibleArea: o, type: "move" }));
1355
1355
  }
1356
1356
  return { visibleArea: o, coordinates: r };
1357
1357
  }
@@ -1380,22 +1380,22 @@ function vt(e, i) {
1380
1380
  return nn(e, Pe(i));
1381
1381
  }
1382
1382
  function Go(e) {
1383
- var i = e.event, t = e.coordinates, n = e.visibleArea, a = e.sizeRestrictions, o = e.getAreaRestrictions, r = e.positionRestrictions, l = e.adjustStencil, s = i.scale, u = i.move, c = X({}, n), d = X({}, t), h = 1, m = 1, b = s.factor && Math.abs(s.factor - 1) > 1e-3;
1384
- c = Me(c, { left: u.left || 0, top: u.top || 0 });
1385
- var v = { stencil: { minimum: Math.max(a.minWidth ? a.minWidth / d.width : 0, a.minHeight ? a.minHeight / d.height : 0), maximum: Math.min(a.maxWidth ? a.maxWidth / d.width : 1 / 0, a.maxHeight ? a.maxHeight / d.height : 1 / 0, at(d, r)) }, area: { maximum: at(c, o({ visibleArea: c, type: "resize" })) } };
1386
- s.factor && b && (s.factor < 1 ? (m = Math.max(s.factor, v.stencil.minimum)) > 1 && (m = 1) : s.factor > 1 && (m = Math.min(s.factor, Math.min(v.area.maximum, v.stencil.maximum))) < 1 && (m = 1)), m && (c = ze(c, m, s.center));
1387
- var f = t.left - n.left, S = n.width + n.left - (t.width + t.left), z = t.top - n.top, E = n.height + n.top - (t.height + t.top);
1388
- return c = we(c = Me(c, rt(c, { left: r.left !== void 0 ? r.left - f * m : void 0, top: r.top !== void 0 ? r.top - z * m : void 0, bottom: r.bottom !== void 0 ? r.bottom + E * m : void 0, right: r.right !== void 0 ? r.right + S * m : void 0 })), o({ visibleArea: c, type: "move" })), d.width = d.width * m, d.height = d.height * m, d.left = c.left + f * m, d.top = c.top + z * m, d = we(d, Ot(Pe(c), r)), s.factor && b && l && (s.factor > 1 ? h = Math.min(v.area.maximum, s.factor) / m : s.factor < 1 && (h = Math.max(d.height / c.height, d.width / c.width, s.factor / m)), h !== 1 && (c = Me(c = we(c = ze(c, h, s.factor > 1 ? s.center : _e(d)), o({ visibleArea: c, type: "move" })), Mt(rt(d, Pe(c)))))), { coordinates: d, visibleArea: c };
1383
+ var i = e.event, t = e.coordinates, n = e.visibleArea, a = e.sizeRestrictions, o = e.getAreaRestrictions, r = e.positionRestrictions, l = e.adjustStencil, s = i.scale, u = i.move, c = X({}, n), d = X({}, t), h = 1, m = 1, v = s.factor && Math.abs(s.factor - 1) > 1e-3;
1384
+ c = ke(c, { left: u.left || 0, top: u.top || 0 });
1385
+ var g = { stencil: { minimum: Math.max(a.minWidth ? a.minWidth / d.width : 0, a.minHeight ? a.minHeight / d.height : 0), maximum: Math.min(a.maxWidth ? a.maxWidth / d.width : 1 / 0, a.maxHeight ? a.maxHeight / d.height : 1 / 0, at(d, r)) }, area: { maximum: at(c, o({ visibleArea: c, type: "resize" })) } };
1386
+ s.factor && v && (s.factor < 1 ? (m = Math.max(s.factor, g.stencil.minimum)) > 1 && (m = 1) : s.factor > 1 && (m = Math.min(s.factor, Math.min(g.area.maximum, g.stencil.maximum))) < 1 && (m = 1)), m && (c = ze(c, m, s.center));
1387
+ var f = t.left - n.left, C = n.width + n.left - (t.width + t.left), z = t.top - n.top, E = n.height + n.top - (t.height + t.top);
1388
+ return c = we(c = ke(c, rt(c, { left: r.left !== void 0 ? r.left - f * m : void 0, top: r.top !== void 0 ? r.top - z * m : void 0, bottom: r.bottom !== void 0 ? r.bottom + E * m : void 0, right: r.right !== void 0 ? r.right + C * m : void 0 })), o({ visibleArea: c, type: "move" })), d.width = d.width * m, d.height = d.height * m, d.left = c.left + f * m, d.top = c.top + z * m, d = we(d, Ot(Pe(c), r)), s.factor && v && l && (s.factor > 1 ? h = Math.min(g.area.maximum, s.factor) / m : s.factor < 1 && (h = Math.max(d.height / c.height, d.width / c.width, s.factor / m)), h !== 1 && (c = ke(c = we(c = ze(c, h, s.factor > 1 ? s.center : _e(d)), o({ visibleArea: c, type: "move" })), kt(rt(d, Pe(c)))))), { coordinates: d, visibleArea: c };
1389
1389
  }
1390
1390
  function jo(e) {
1391
1391
  var i = e.aspectRatio, t = e.getAreaRestrictions, n = e.coordinates, a = e.visibleArea, o = e.sizeRestrictions, r = e.positionRestrictions, l = e.imageSize, s = e.previousImageSize, u = e.angle, c = X({}, n), d = X({}, a), h = We(_e(X({ left: 0, top: 0 }, s)), u);
1392
- return (c = X(X({}, Ve({ sizeRestrictions: o, aspectRatio: i, width: c.width, height: c.height })), We(_e(c), u))).left -= h.left - l.width / 2 + c.width / 2, c.top -= h.top - l.height / 2 + c.height / 2, d = ze(d, kt(d, t({ visibleArea: d, type: "resize" }))), { coordinates: c = we(c, r), visibleArea: d = we(d = Me(d, ot(_e(c), _e(n))), t({ visibleArea: d, type: "move" })) };
1392
+ return (c = X(X({}, Ve({ sizeRestrictions: o, aspectRatio: i, width: c.width, height: c.height })), We(_e(c), u))).left -= h.left - l.width / 2 + c.width / 2, c.top -= h.top - l.height / 2 + c.height / 2, d = ze(d, Mt(d, t({ visibleArea: d, type: "resize" }))), { coordinates: c = we(c, r), visibleArea: d = we(d = ke(d, ot(_e(c), _e(n))), t({ visibleArea: d, type: "move" })) };
1393
1393
  }
1394
1394
  function Wo(e) {
1395
1395
  var i = e.flip, t = e.previousFlip, n = e.rotate, a = e.getAreaRestrictions, o = e.coordinates, r = e.visibleArea, l = e.imageSize, s = X({}, o), u = X({}, r), c = t.horizontal !== i.horizontal, d = t.vertical !== i.vertical;
1396
1396
  if (c || d) {
1397
- var h = We({ left: l.width / 2, top: l.height / 2 }, -n), m = We(_e(s), -n), b = We({ left: c ? h.left - (m.left - h.left) : m.left, top: d ? h.top - (m.top - h.top) : m.top }, n);
1398
- s = Me(s, ot(b, _e(s))), m = We(_e(u), -n), u = we(u = Me(u, ot(b = We({ left: c ? h.left - (m.left - h.left) : m.left, top: d ? h.top - (m.top - h.top) : m.top }, n), _e(u))), a({ visibleArea: u, type: "move" }));
1397
+ var h = We({ left: l.width / 2, top: l.height / 2 }, -n), m = We(_e(s), -n), v = We({ left: c ? h.left - (m.left - h.left) : m.left, top: d ? h.top - (m.top - h.top) : m.top }, n);
1398
+ s = ke(s, ot(v, _e(s))), m = We(_e(u), -n), u = we(u = ke(u, ot(v = We({ left: c ? h.left - (m.left - h.left) : m.left, top: d ? h.top - (m.top - h.top) : m.top }, n), _e(u))), a({ visibleArea: u, type: "move" }));
1399
1399
  }
1400
1400
  return { coordinates: s, visibleArea: u };
1401
1401
  }
@@ -1405,28 +1405,28 @@ function Ei(e) {
1405
1405
  var d = ht(Fe(t, s), a);
1406
1406
  l && (d.left && d.left > 0 && d.right === 0 ? (s.right += d.left, s.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (s.left += d.right, s.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (s.bottom += d.top, s.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (s.top += d.bottom, s.bottom -= d.bottom), d = ht(Fe(t, s), a));
1407
1407
  var h = { width: 1 / 0, height: 1 / 0, left: 1 / 0, right: 1 / 0, top: 1 / 0, bottom: 1 / 0 };
1408
- if (Ie.forEach(function(v) {
1409
- var f = d[v];
1410
- f && s[v] && (h[v] = Math.max(0, 1 - f / s[v]));
1408
+ if (Ie.forEach(function(g) {
1409
+ var f = d[g];
1410
+ f && s[g] && (h[g] = Math.max(0, 1 - f / s[g]));
1411
1411
  }), r) {
1412
- var m = Math.min.apply(null, Ie.map(function(v) {
1413
- return h[v];
1412
+ var m = Math.min.apply(null, Ie.map(function(g) {
1413
+ return h[g];
1414
1414
  }));
1415
- m !== 1 / 0 && Ie.forEach(function(v) {
1416
- s[v] *= m;
1415
+ m !== 1 / 0 && Ie.forEach(function(g) {
1416
+ s[g] *= m;
1417
1417
  });
1418
- } else Ie.forEach(function(v) {
1419
- h[v] !== 1 / 0 && (s[v] *= h[v]);
1418
+ } else Ie.forEach(function(g) {
1419
+ h[g] !== 1 / 0 && (s[g] *= h[g]);
1420
1420
  });
1421
1421
  if (u = Fe(t, s).width, c = Fe(t, s).height, s.right + s.left && (u > o.maxWidth ? h.width = (o.maxWidth - t.width) / (s.right + s.left) : u < o.minWidth && (h.width = (o.minWidth - t.width) / (s.right + s.left))), s.bottom + s.top && (c > o.maxHeight ? h.height = (o.maxHeight - t.height) / (s.bottom + s.top) : c < o.minHeight && (h.height = (o.minHeight - t.height) / (s.bottom + s.top))), r) {
1422
- var b = Math.min(h.width, h.height);
1423
- b !== 1 / 0 && Ie.forEach(function(v) {
1424
- s[v] *= b;
1422
+ var v = Math.min(h.width, h.height);
1423
+ v !== 1 / 0 && Ie.forEach(function(g) {
1424
+ s[g] *= v;
1425
1425
  });
1426
- } else h.width !== 1 / 0 && Eo.forEach(function(v) {
1427
- s[v] *= h.width;
1428
- }), h.height !== 1 / 0 && Fo.forEach(function(v) {
1429
- s[v] *= h.height;
1426
+ } else h.width !== 1 / 0 && Eo.forEach(function(g) {
1427
+ s[g] *= h.width;
1428
+ }), h.height !== 1 / 0 && Fo.forEach(function(g) {
1429
+ s[g] *= h.height;
1430
1430
  });
1431
1431
  return s;
1432
1432
  }
@@ -1450,7 +1450,7 @@ var Yo = Ee("vue-simple-handler"), Ho = Ee("vue-simple-handler-wrapper"), ni = {
1450
1450
  ni.render = function(e, i, t, n, a, o) {
1451
1451
  var r = G("HandlerWrapper");
1452
1452
  return O(), Y(r, { class: o.classes.wrapper, "vertical-position": t.verticalPosition, "horizontal-position": t.horizontalPosition, disabled: t.disabled, onDrag: o.onDrag, onDragEnd: o.onDragEnd, onEnter: o.onEnter, onLeave: o.onLeave }, { default: L(function() {
1453
- return [w("div", { class: o.classes.default }, null, 2)];
1453
+ return [S("div", { class: o.classes.default }, null, 2)];
1454
1454
  }), _: 1 }, 8, ["class", "vertical-position", "horizontal-position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
1455
1455
  };
1456
1456
  var Xo = Ee("vue-simple-line"), qo = Ee("vue-simple-line-wrapper"), oi = { name: "SimpleLine", components: { LineWrapper: Qi }, props: { defaultClass: { type: String }, hoverClass: { type: String }, wrapperClass: { type: String }, position: { type: String }, disabled: { type: Boolean, default: !1 } }, data: function() {
@@ -1469,7 +1469,7 @@ var Xo = Ee("vue-simple-line"), qo = Ee("vue-simple-line-wrapper"), oi = { name:
1469
1469
  oi.render = function(e, i, t, n, a, o) {
1470
1470
  var r = G("LineWrapper");
1471
1471
  return O(), Y(r, { class: o.classes.wrapper, position: t.position, disabled: t.disabled, onDrag: o.onDrag, onDragEnd: o.onDragEnd, onEnter: o.onEnter, onLeave: o.onLeave }, { default: L(function() {
1472
- return [w("div", { class: o.classes.root }, null, 2)];
1472
+ return [S("div", { class: o.classes.root }, null, 2)];
1473
1473
  }), _: 1 }, 8, ["class", "position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
1474
1474
  };
1475
1475
  var Ut = Ee("vue-bounding-box"), Zo = ["east", "west", null], Jo = ["south", "north", null], on = { name: "BoundingBox", props: { width: { type: Number }, height: { type: Number }, transitions: { type: Object }, handlers: { type: Object, default: function() {
@@ -1531,16 +1531,16 @@ var Ut = Ee("vue-bounding-box"), Zo = ["east", "west", null], Jo = ["south", "no
1531
1531
  this.$emit("resize-end");
1532
1532
  }, onHandlerDrag: function(e, i, t) {
1533
1533
  var n, a = e.shift(), o = a.left, r = a.top, l = { left: 0, right: 0, top: 0, bottom: 0 };
1534
- i === "west" ? l.left -= o : i === "east" && (l.right += o), t === "north" ? l.top -= r : t === "south" && (l.bottom += r), !t && i ? n = "width" : t && !i && (n = "height"), this.resizable && this.$emit("resize", new ko(l, { allowedDirections: { left: i === "west" || !i, right: i === "east" || !i, bottom: t === "south" || !t, top: t === "north" || !t }, preserveAspectRatio: e.nativeEvent && e.nativeEvent.shiftKey, respectDirection: n }));
1534
+ i === "west" ? l.left -= o : i === "east" && (l.right += o), t === "north" ? l.top -= r : t === "south" && (l.bottom += r), !t && i ? n = "width" : t && !i && (n = "height"), this.resizable && this.$emit("resize", new Mo(l, { allowedDirections: { left: i === "west" || !i, right: i === "east" || !i, bottom: t === "south" || !t, top: t === "north" || !t }, preserveAspectRatio: e.nativeEvent && e.nativeEvent.shiftKey, respectDirection: n }));
1535
1535
  } }, emits: ["resize", "resize-end"] };
1536
1536
  on.render = function(e, i, t, n, a, o) {
1537
- return O(), Y("div", { ref: "box", class: o.classes.root, style: o.style }, [ve(e.$slots, "default"), w("div", null, [(O(!0), Y(ke, null, Ye(o.lineNodes, function(r) {
1537
+ return O(), Y("div", { ref: "box", class: o.classes.root, style: o.style }, [ve(e.$slots, "default"), S("div", null, [(O(!0), Y(Me, null, Ye(o.lineNodes, function(r) {
1538
1538
  return O(), Y(St(r.component), { key: r.name, "default-class": r.class, "hover-class": r.hoverClass, "wrapper-class": r.wrapperClass, position: r.name, disabled: r.disabled, onDrag: function(l) {
1539
1539
  return o.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
1540
1540
  }, onDragEnd: i[1] || (i[1] = function(l) {
1541
1541
  return o.onEnd();
1542
1542
  }) }, null, 8, ["default-class", "hover-class", "wrapper-class", "position", "disabled", "onDrag"]);
1543
- }), 128))]), (O(!0), Y(ke, null, Ye(o.handlerNodes, function(r) {
1543
+ }), 128))]), (O(!0), Y(Me, null, Ye(o.handlerNodes, function(r) {
1544
1544
  return O(), Y("div", { key: r.name, style: r.wrapperStyle, class: r.wrapperClass }, [(O(), Y(St(r.component), { "default-class": r.class, "hover-class": r.hoverClass, "wrapper-class": r.wrapperClass, "horizontal-position": r.horizontalDirection, "vertical-position": r.verticalDirection, disabled: r.disabled, onDrag: function(l) {
1545
1545
  return o.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
1546
1546
  }, onDragEnd: i[2] || (i[2] = function(l) {
@@ -1643,10 +1643,10 @@ function ta(e) {
1643
1643
  }
1644
1644
  s++;
1645
1645
  }
1646
- if (o && (n = o + 10, function(m, b, v) {
1647
- var f, S = "";
1648
- for (f = b, v += b; f < v; f++) S += String.fromCharCode(m.getUint8(f));
1649
- return S;
1646
+ if (o && (n = o + 10, function(m, v, g) {
1647
+ var f, C = "";
1648
+ for (f = v, g += v; f < g; f++) C += String.fromCharCode(m.getUint8(f));
1649
+ return C;
1650
1650
  }(t, o + 4, 4) === "Exif")) {
1651
1651
  var u = t.getUint16(n);
1652
1652
  if (((a = u === 18761) || u === 19789) && t.getUint16(n + 2, a) === 42) {
@@ -1794,7 +1794,7 @@ var yt = Ee("vue-preview"), ln = { props: { coordinates: { type: Object }, trans
1794
1794
  e && e.complete && this.refreshImage(), this.refresh();
1795
1795
  } } };
1796
1796
  ln.render = function(e, i, t, n, a, o) {
1797
- return O(), Y("div", { ref: "root", class: o.classes.root, style: o.style }, [w("div", { ref: "wrapper", class: o.classes.wrapper, style: o.wrapperStyle }, [Qe(w("img", { ref: "image", src: t.image && t.image.src, class: o.classes.image, style: o.imageStyle }, null, 14, ["src"]), [[At, t.image && t.image.src]])], 6)], 6);
1797
+ return O(), Y("div", { ref: "root", class: o.classes.root, style: o.style }, [S("div", { ref: "wrapper", class: o.classes.wrapper, style: o.wrapperStyle }, [Qe(S("img", { ref: "image", src: t.image && t.image.src, class: o.classes.image, style: o.imageStyle }, null, 14, ["src"]), [[At, t.image && t.image.src]])], 6)], 6);
1798
1798
  };
1799
1799
  var un = { components: { Preview: ln }, inheritAttrs: !1 };
1800
1800
  un.render = function(e, i, t, n, a, o) {
@@ -1833,9 +1833,9 @@ var $t = Ee("vue-rectangle-stencil"), cn = { name: "RectangleStencil", component
1833
1833
  } }, emits: ["resize", "resize-end", "move", "move-end"] };
1834
1834
  cn.render = function(e, i, t, n, a, o) {
1835
1835
  var r = G("stencil-preview"), l = G("draggable-area"), s = G("bounding-box");
1836
- return O(), Y("div", { class: o.classes.stencil, style: o.style }, [w(s, { width: t.stencilCoordinates.width, height: t.stencilCoordinates.height, transitions: t.transitions, class: o.classes.boundingBox, handlers: t.handlers, "handlers-component": t.handlersComponent, "handlers-classes": t.handlersClasses, "handlers-wrappers-classes": t.handlersWrappersClasses, lines: t.lines, "lines-component": t.linesComponent, "lines-classes": t.linesClasses, "lines-wrappers-classes": t.linesWrappersClasses, resizable: t.resizable, onResize: o.onResize, onResizeEnd: o.onResizeEnd }, { default: L(function() {
1837
- return [w(l, { movable: t.movable, onMove: o.onMove, onMoveEnd: o.onMoveEnd }, { default: L(function() {
1838
- return [w(r, { image: t.image, coordinates: t.coordinates, width: t.stencilCoordinates.width, height: t.stencilCoordinates.height, class: o.classes.preview, transitions: t.transitions }, null, 8, ["image", "coordinates", "width", "height", "class", "transitions"])];
1836
+ return O(), Y("div", { class: o.classes.stencil, style: o.style }, [S(s, { width: t.stencilCoordinates.width, height: t.stencilCoordinates.height, transitions: t.transitions, class: o.classes.boundingBox, handlers: t.handlers, "handlers-component": t.handlersComponent, "handlers-classes": t.handlersClasses, "handlers-wrappers-classes": t.handlersWrappersClasses, lines: t.lines, "lines-component": t.linesComponent, "lines-classes": t.linesClasses, "lines-wrappers-classes": t.linesWrappersClasses, resizable: t.resizable, onResize: o.onResize, onResizeEnd: o.onResizeEnd }, { default: L(function() {
1837
+ return [S(l, { movable: t.movable, onMove: o.onMove, onMoveEnd: o.onMoveEnd }, { default: L(function() {
1838
+ return [S(r, { image: t.image, coordinates: t.coordinates, width: t.stencilCoordinates.width, height: t.stencilCoordinates.height, class: o.classes.preview, transitions: t.transitions }, null, 8, ["image", "coordinates", "width", "height", "class", "transitions"])];
1839
1839
  }), _: 1 }, 8, ["movable", "onMove", "onMoveEnd"])];
1840
1840
  }), _: 1 }, 8, ["width", "height", "transitions", "class", "handlers", "handlers-component", "handlers-classes", "handlers-wrappers-classes", "lines", "lines-component", "lines-classes", "lines-wrappers-classes", "resizable", "onResize", "onResizeEnd"])], 6);
1841
1841
  };
@@ -1858,17 +1858,17 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
1858
1858
  if (h) {
1859
1859
  var m = l.respectDirection;
1860
1860
  if (m || (m = r.width >= r.height || h === 1 ? "width" : "height"), m === "width") {
1861
- var b = c / h - r.height;
1861
+ var v = c / h - r.height;
1862
1862
  if (u.top && u.bottom) {
1863
- var v = s.top, f = s.bottom;
1864
- s.bottom = bt(b, f, v), s.top = bt(b, v, f);
1865
- } else u.bottom ? s.bottom = b : u.top ? s.top = b : u.right ? s.right = 0 : u.left && (s.left = 0);
1863
+ var g = s.top, f = s.bottom;
1864
+ s.bottom = bt(v, f, g), s.top = bt(v, g, f);
1865
+ } else u.bottom ? s.bottom = v : u.top ? s.top = v : u.right ? s.right = 0 : u.left && (s.left = 0);
1866
1866
  } else if (m === "height") {
1867
- var S = r.width - d * h;
1867
+ var C = r.width - d * h;
1868
1868
  if (u.left && u.right) {
1869
1869
  var z = s.left, E = s.right;
1870
- s.left = -bt(S, z, E), s.right = -bt(S, E, z);
1871
- } else u.left ? s.left = -S : u.right ? s.right = -S : u.top ? s.top = 0 : u.bottom && (s.bottom = 0);
1870
+ s.left = -bt(C, z, E), s.right = -bt(C, E, z);
1871
+ } else u.left ? s.left = -C : u.right ? s.right = -C : u.top ? s.top = 0 : u.bottom && (s.bottom = 0);
1872
1872
  }
1873
1873
  s = Ei({ directions: s, coordinates: r, sizeRestrictions: o, positionRestrictions: a, preserveRatio: !0, compensate: l.compensate });
1874
1874
  }
@@ -1880,12 +1880,12 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
1880
1880
  i.style.width = t.width + "px", i.style.height = i.clientWidth / n + "px", i.style.width = i.clientWidth + "px";
1881
1881
  } }, fitCoordinates: { type: Function, default: function(e) {
1882
1882
  var i = e.visibleArea, t = e.coordinates, n = e.aspectRatio, a = e.sizeRestrictions, o = e.positionRestrictions, r = X(X({}, t), Ve({ width: t.width, height: t.height, aspectRatio: n, sizeRestrictions: { maxWidth: i.width, maxHeight: i.height, minHeight: Math.min(i.height, a.minHeight), minWidth: Math.min(i.width, a.minWidth) } }));
1883
- return r = we(r = Me(r, ot(_e(t), _e(r))), Ot(Pe(i), o));
1883
+ return r = we(r = ke(r, ot(_e(t), _e(r))), Ot(Pe(i), o));
1884
1884
  } }, fitVisibleArea: { type: Function, default: function(e) {
1885
1885
  var i = e.visibleArea, t = e.boundaries, n = e.getAreaRestrictions, a = e.coordinates, o = X({}, i);
1886
1886
  o.height = o.width / ae(t), o.top += (i.height - o.height) / 2, (a.height - o.height > 0 || a.width - o.width > 0) && (o = ze(o, Math.max(a.height / o.height, a.width / o.width)));
1887
- var r = Mt(rt(a, Pe(o = ze(o, kt(o, n({ visibleArea: o, type: "resize" }))))));
1888
- return o.width < a.width && (r.left = 0), o.height < a.height && (r.top = 0), o = we(o = Me(o, r), n({ visibleArea: o, type: "move" }));
1887
+ var r = kt(rt(a, Pe(o = ze(o, Mt(o, n({ visibleArea: o, type: "resize" }))))));
1888
+ return o.width < a.width && (r.left = 0), o.height < a.height && (r.top = 0), o = we(o = ke(o, r), n({ visibleArea: o, type: "move" }));
1889
1889
  } }, areaRestrictionsAlgorithm: { type: Function, default: function(e) {
1890
1890
  var i = e.visibleArea, t = e.boundaries, n = e.imageSize, a = e.imageRestriction, o = e.type, r = {};
1891
1891
  return a === "fill-area" ? r = { left: 0, top: 0, right: n.width, bottom: n.height } : a === "fit-area" && (ae(t) > ae(n) ? (r = { top: 0, bottom: n.height }, i && o === "move" && (i.width > n.width ? (r.left = -(i.width - n.width) / 2, r.right = n.width - r.left) : (r.left = 0, r.right = n.width))) : (r = { left: 0, right: n.width }, i && o === "move" && (i.height > n.height ? (r.top = -(i.height - n.height) / 2, r.bottom = n.height - r.top) : (r.top = 0, r.bottom = n.height)))), r;
@@ -1895,7 +1895,7 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
1895
1895
  var i = e.imageSize, t = {};
1896
1896
  return e.imageRestriction !== "none" && (t = { left: 0, top: 0, right: i.width, bottom: i.height }), t;
1897
1897
  } } }, data: function() {
1898
- return { transitionsActive: !1, imageLoaded: !1, imageAttributes: { width: null, height: null, crossOrigin: null, src: null }, defaultImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, appliedImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, boundaries: { width: 0, height: 0 }, visibleArea: null, coordinates: oe({}, Mi) };
1898
+ return { transitionsActive: !1, imageLoaded: !1, imageAttributes: { width: null, height: null, crossOrigin: null, src: null }, defaultImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, appliedImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, boundaries: { width: 0, height: 0 }, visibleArea: null, coordinates: oe({}, ki) };
1899
1899
  }, computed: { image: function() {
1900
1900
  return { src: this.imageAttributes.src, width: this.imageAttributes.width, height: this.imageAttributes.height, transforms: this.imageTransforms };
1901
1901
  }, imageTransforms: function() {
@@ -2020,7 +2020,7 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
2020
2020
  var a = this.autoZoomAlgorithm;
2021
2021
  a || (a = this.stencilSize ? Uo : this.autoZoom ? Vo : $o);
2022
2022
  var o = a({ event: { type: e, params: n }, visibleArea: i, coordinates: t, boundaries: this.boundaries, aspectRatio: this.getAspectRatio(), positionRestrictions: this.positionRestrictions, getAreaRestrictions: this.getAreaRestrictions, sizeRestrictions: this.sizeRestrictions, stencilSize: this.getStencilSize() });
2023
- return oe(oe({}, o), {}, { changed: !ki(o.visibleArea, i) || !ki(o.coordinates, t) });
2023
+ return oe(oe({}, o), {}, { changed: !Mi(o.visibleArea, i) || !Mi(o.coordinates, t) });
2024
2024
  }, runAutoZoom: function(e) {
2025
2025
  var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = i.transitions, n = t !== void 0 && t, a = xo(i, ia), o = this.processAutoZoom(e, this.visibleArea, this.coordinates, a), r = o.visibleArea, l = o.coordinates, s = o.changed;
2026
2026
  n && s && this.enableTransitions(), this.visibleArea = r, this.coordinates = l, n && s && this.debouncedDisableTransitions();
@@ -2045,10 +2045,10 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
2045
2045
  }, getCanvas: function() {
2046
2046
  if (this.$refs.canvas) {
2047
2047
  var e = this.$refs.canvas, i = this.$refs.image, t = this.imageTransforms.rotate !== 0 || this.imageTransforms.flip.horizontal || this.imageTransforms.flip.vertical ? function(l, s, u) {
2048
- var c = u.rotate, d = u.flip, h = { width: s.naturalWidth, height: s.naturalHeight }, m = tn(h, c), b = l.getContext("2d");
2049
- l.height = m.height, l.width = m.width, b.save();
2050
- var v = We(_e(X({ left: 0, top: 0 }, h)), c);
2051
- return b.translate(-(v.left - m.width / 2), -(v.top - m.height / 2)), b.rotate(c * Math.PI / 180), b.translate(d.horizontal ? h.width : 0, d.vertical ? h.height : 0), b.scale(d.horizontal ? -1 : 1, d.vertical ? -1 : 1), b.drawImage(s, 0, 0, h.width, h.height), b.restore(), l;
2048
+ var c = u.rotate, d = u.flip, h = { width: s.naturalWidth, height: s.naturalHeight }, m = tn(h, c), v = l.getContext("2d");
2049
+ l.height = m.height, l.width = m.width, v.save();
2050
+ var g = We(_e(X({ left: 0, top: 0 }, h)), c);
2051
+ return v.translate(-(g.left - m.width / 2), -(g.top - m.height / 2)), v.rotate(c * Math.PI / 180), v.translate(d.horizontal ? h.width : 0, d.vertical ? h.height : 0), v.scale(d.horizontal ? -1 : 1, d.vertical ? -1 : 1), v.drawImage(s, 0, 0, h.width, h.height), v.restore(), l;
2052
2052
  }(this.$refs.sourceCanvas, i, this.imageTransforms) : i, n = oe({ minWidth: 0, minHeight: 0, maxWidth: 1 / 0, maxHeight: 1 / 0, maxArea: this.maxCanvasSize, imageSmoothingEnabled: !0, imageSmoothingQuality: "high", fillColor: "transparent" }, this.canvas), a = function(l) {
2053
2053
  return l.find(function(s) {
2054
2054
  return u = s, !Number.isNaN(parseFloat(u)) && isFinite(u);
@@ -2063,8 +2063,8 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
2063
2063
  l.width = c ? c.width : u.width, l.height = c ? c.height : u.height;
2064
2064
  var h = l.getContext("2d");
2065
2065
  h.clearRect(0, 0, l.width, l.height), d && (d.imageSmoothingEnabled && (h.imageSmoothingEnabled = d.imageSmoothingEnabled), d.imageSmoothingQuality && (h.imageSmoothingQuality = d.imageSmoothingQuality), d.fillColor && (h.fillStyle = d.fillColor, h.fillRect(0, 0, l.width, l.height), h.save()));
2066
- var m = u.left < 0 ? -u.left : 0, b = u.top < 0 ? -u.top : 0;
2067
- h.drawImage(s, u.left + m, u.top + b, u.width, u.height, m * (l.width / u.width), b * (l.height / u.height), l.width, l.height);
2066
+ var m = u.left < 0 ? -u.left : 0, v = u.top < 0 ? -u.top : 0;
2067
+ h.drawImage(s, u.left + m, u.top + v, u.width, u.height, m * (l.width / u.width), v * (l.height / u.height), l.width, l.height);
2068
2068
  }(e, t, this.coordinates, o, n), e;
2069
2069
  }
2070
2070
  }, update: function() {
@@ -2247,7 +2247,7 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
2247
2247
  }, getPublicProperties: function() {
2248
2248
  return { coefficient: this.coefficient, visibleArea: this.visibleArea, coordinates: this.coordinates, boundaries: this.boundaries, sizeRestrictions: this.sizeRestrictions, positionRestrictions: this.positionRestrictions, aspectRatio: this.getAspectRatio(), imageRestriction: this.imageRestriction };
2249
2249
  }, defaultCoordinates: function() {
2250
- return oe({}, Mi);
2250
+ return oe({}, ki);
2251
2251
  }, flip: function(e, i) {
2252
2252
  var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = t.transitions, a = n === void 0 || n;
2253
2253
  if (!this.transitionsActive) {
@@ -2266,9 +2266,9 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
2266
2266
  }
2267
2267
  } }, emits: ["change", "error", "ready"] }, na = { key: 0, ref: "canvas", style: { display: "none" } }, oa = { key: 1, ref: "sourceCanvas", style: { display: "none" } };
2268
2268
  dn.render = function(e, i, t, n, a, o) {
2269
- return O(), Y("div", { ref: "cropper", class: o.classes.cropper }, [w("div", { ref: "stretcher", class: o.classes.stretcher }, null, 2), w("div", { class: o.classes.boundaries, style: o.boundariesStyle }, [(O(), Y(St(t.backgroundWrapperComponent), { class: o.classes.cropperWrapper, "wheel-resize": o.settings.resizeImage.wheel, "touch-resize": o.settings.resizeImage.touch, "touch-move": o.settings.moveImage.touch, "mouse-move": o.settings.moveImage.mouse, onMove: o.onManipulateImage, onResize: o.onManipulateImage }, { default: L(function() {
2270
- return [w("div", { class: o.classes.background, style: o.boundariesStyle }, null, 6), w("div", { class: o.classes.imageWrapper }, [w("img", { ref: "image", crossorigin: a.imageAttributes.crossOrigin, src: a.imageAttributes.src, class: o.classes.image, style: o.imageStyle, onMousedown: i[1] || (i[1] = Rt(function() {
2271
- }, ["prevent"])) }, null, 46, ["crossorigin", "src"])], 2), w("div", { class: o.classes.foreground, style: o.boundariesStyle }, null, 6), Qe((O(), Y(St(t.stencilComponent), Ti({ ref: "stencil", image: o.image, coordinates: a.coordinates, "stencil-coordinates": o.stencilCoordinates, transitions: o.transitionsOptions }, t.stencilProps, { onResize: o.onResize, onResizeEnd: o.onResizeEnd, onMove: o.onMove, onMoveEnd: o.onMoveEnd }), null, 16, ["image", "coordinates", "stencil-coordinates", "transitions", "onResize", "onResizeEnd", "onMove", "onMoveEnd"])), [[At, a.imageLoaded]]), t.canvas ? (O(), Y("canvas", na, null, 512)) : te("", !0), t.canvas ? (O(), Y("canvas", oa, null, 512)) : te("", !0)];
2269
+ return O(), Y("div", { ref: "cropper", class: o.classes.cropper }, [S("div", { ref: "stretcher", class: o.classes.stretcher }, null, 2), S("div", { class: o.classes.boundaries, style: o.boundariesStyle }, [(O(), Y(St(t.backgroundWrapperComponent), { class: o.classes.cropperWrapper, "wheel-resize": o.settings.resizeImage.wheel, "touch-resize": o.settings.resizeImage.touch, "touch-move": o.settings.moveImage.touch, "mouse-move": o.settings.moveImage.mouse, onMove: o.onManipulateImage, onResize: o.onManipulateImage }, { default: L(function() {
2270
+ return [S("div", { class: o.classes.background, style: o.boundariesStyle }, null, 6), S("div", { class: o.classes.imageWrapper }, [S("img", { ref: "image", crossorigin: a.imageAttributes.crossOrigin, src: a.imageAttributes.src, class: o.classes.image, style: o.imageStyle, onMousedown: i[1] || (i[1] = Rt(function() {
2271
+ }, ["prevent"])) }, null, 46, ["crossorigin", "src"])], 2), S("div", { class: o.classes.foreground, style: o.boundariesStyle }, null, 6), Qe((O(), Y(St(t.stencilComponent), Ti({ ref: "stencil", image: o.image, coordinates: a.coordinates, "stencil-coordinates": o.stencilCoordinates, transitions: o.transitionsOptions }, t.stencilProps, { onResize: o.onResize, onResizeEnd: o.onResizeEnd, onMove: o.onMove, onMoveEnd: o.onMoveEnd }), null, 16, ["image", "coordinates", "stencil-coordinates", "transitions", "onResize", "onResizeEnd", "onMove", "onMoveEnd"])), [[At, a.imageLoaded]]), t.canvas ? (O(), Y("canvas", na, null, 512)) : te("", !0), t.canvas ? (O(), Y("canvas", oa, null, 512)) : te("", !0)];
2272
2272
  }), _: 1 }, 8, ["class", "wheel-resize", "touch-resize", "touch-move", "mouse-move", "onMove", "onResize"]))], 6)], 2);
2273
2273
  };
2274
2274
  const aa = {
@@ -2292,49 +2292,49 @@ const aa = {
2292
2292
  emits: ["update:model-value", "reset:model-value"],
2293
2293
  setup(e, { emit: i }) {
2294
2294
  const t = e, { t: n } = me(), a = i, o = F(() => t.modelValue ? URL.createObjectURL(t.modelValue) : ""), r = J();
2295
- function l(b, v) {
2296
- const S = 2e3 / b;
2295
+ function l(v, g) {
2296
+ const C = 2e3 / v;
2297
2297
  return {
2298
- ratio: S,
2299
- width: b * S,
2300
- height: v * S
2298
+ ratio: C,
2299
+ width: v * C,
2300
+ height: g * C
2301
2301
  };
2302
2302
  }
2303
- function s(b) {
2304
- const { width: v, height: f } = b, S = 16 / 9, z = v / f;
2305
- let E = v, j = f;
2306
- z > S ? j = E / S : E = j * S;
2307
- const D = l(E, j), k = Ro(D.width, D.height), y = E > v ? (E - v) / 2 * D.ratio : 0, g = j > f ? (j - f) / 2 * D.ratio : 0, C = k.getContext("2d");
2308
- return C.fillStyle = "white", C.fillRect(0, 0, D.width, D.height), C.drawImage(b, 0, 0, E, j, y, g, D.width, D.height), k.toDataURL();
2303
+ function s(v) {
2304
+ const { width: g, height: f } = v, C = 16 / 9, z = g / f;
2305
+ let E = g, j = f;
2306
+ z > C ? j = E / C : E = j * C;
2307
+ const D = l(E, j), M = Ro(D.width, D.height), b = E > g ? (E - g) / 2 * D.ratio : 0, _ = j > f ? (j - f) / 2 * D.ratio : 0, A = M.getContext("2d");
2308
+ return A.fillStyle = "white", A.fillRect(0, 0, D.width, D.height), A.drawImage(v, 0, 0, E, j, b, _, D.width, D.height), M.toDataURL();
2309
2309
  }
2310
2310
  const u = J(!1);
2311
- async function c([b]) {
2312
- if (!b) return;
2311
+ async function c([v]) {
2312
+ if (!v) return;
2313
2313
  u.value = !0;
2314
- const v = new FileReader();
2315
- v.onload = () => {
2314
+ const g = new FileReader();
2315
+ g.onload = () => {
2316
2316
  const f = new Image();
2317
- f.src = v.result, f.onload = () => {
2318
- const S = s(f);
2319
- r.value = S, u.value = !1;
2317
+ f.src = g.result, f.onload = () => {
2318
+ const C = s(f);
2319
+ r.value = C, u.value = !1;
2320
2320
  }, f.onerror = () => {
2321
2321
  u.value = !1;
2322
2322
  };
2323
- }, v.readAsDataURL(b);
2323
+ }, g.readAsDataURL(v);
2324
2324
  }
2325
- const d = (b) => {
2326
- c([b]);
2325
+ const d = (v) => {
2326
+ c([v]);
2327
2327
  };
2328
- async function h(b) {
2328
+ async function h(v) {
2329
2329
  !r.value && o.value && (r.value = o.value);
2330
- const { canvas: v } = b, f = v.toDataURL("image/jpeg", 0.75), S = await (await fetch(f)).blob(), z = new File([S], "img.jpeg", { type: "image/jpeg" });
2330
+ const { canvas: g } = v, f = g.toDataURL("image/jpeg", 0.75), C = await (await fetch(f)).blob(), z = new File([C], "img.jpeg", { type: "image/jpeg" });
2331
2331
  a("update:model-value", z);
2332
2332
  }
2333
2333
  function m() {
2334
2334
  r.value = void 0, a("reset:model-value");
2335
2335
  }
2336
- return (b, v) => {
2337
- const f = G("fm-icon"), S = G("fm-drop-field");
2336
+ return (v, g) => {
2337
+ const f = G("fm-icon"), C = G("fm-drop-field");
2338
2338
  return r.value || o.value ? (O(), Q("div", aa, [
2339
2339
  P("p", ra, [
2340
2340
  Ct(de(p(n)("menu.common.labels.product_image")) + " ", 1),
@@ -2343,7 +2343,7 @@ const aa = {
2343
2343
  P("div", la, [
2344
2344
  P("div", ua, [
2345
2345
  P("div", ca, [
2346
- w(p(dn), {
2346
+ S(p(dn), {
2347
2347
  class: "cropper h-[150px] w-[200px]",
2348
2348
  src: r.value || o.value,
2349
2349
  "stencil-props": {
@@ -2368,11 +2368,11 @@ const aa = {
2368
2368
  type: "button",
2369
2369
  onClick: m
2370
2370
  }, [
2371
- w(f, { name: "close" })
2371
+ S(f, { name: "close" })
2372
2372
  ])
2373
2373
  ])
2374
2374
  ])
2375
- ])) : (O(), Y(S, {
2375
+ ])) : (O(), Y(C, {
2376
2376
  key: 1,
2377
2377
  accept: ".jpg, .jpeg, .png, .gif",
2378
2378
  "content-class": "h-[150px] w-[200px]",
@@ -2470,7 +2470,7 @@ const aa = {
2470
2470
  return (u, c) => {
2471
2471
  const d = G("fm-select");
2472
2472
  return O(), Q("div", null, [
2473
- w(d, {
2473
+ S(d, {
2474
2474
  disabled: e.disable,
2475
2475
  items: r.value,
2476
2476
  label: e.label ?? p(n)("menu.common.labels.order_from"),
@@ -2570,7 +2570,7 @@ const _a = { render: ya }, mn = /* @__PURE__ */ ue({
2570
2570
  onValidationSuccess: l[1] || (l[1] = (c) => p(o)("primary"))
2571
2571
  }, {
2572
2572
  default: L(() => [
2573
- w(s, {
2573
+ S(s, {
2574
2574
  modelValue: n.value,
2575
2575
  "onUpdate:modelValue": l[0] || (l[0] = (c) => n.value = c),
2576
2576
  rules: [(c) => !!c || p(t)("menu.category.dialog.add.name.required")],
@@ -2701,9 +2701,9 @@ const Ca = {
2701
2701
  class: /* @__PURE__ */ Le(["flex space-x-16", "xs:flex-col xs:space-x-0 xs:space-y-16"])
2702
2702
  }, xa = {
2703
2703
  class: "w-[160px] xs:w-full"
2704
- }, Ma = {
2705
- class: "flex-1"
2706
2704
  }, ka = {
2705
+ class: "flex-1"
2706
+ }, Ma = {
2707
2707
  class: "relative"
2708
2708
  }, Oa = {
2709
2709
  class: "fm-typo-en-body-lg-600"
@@ -2746,53 +2746,53 @@ const Da = /* @__PURE__ */ ue({
2746
2746
  }), {
2747
2747
  checkMenuIsLoading: u
2748
2748
  } = Xe(He(De())), c = i, d = F(() => n.rules.item), h = F(() => n.categorizedItems), m = F(() => {
2749
- const k = h.value.map((y) => ({
2750
- label: y.name,
2751
- value: y.id
2749
+ const M = h.value.map((b) => ({
2750
+ label: b.name,
2751
+ value: b.id
2752
2752
  }));
2753
- return t.isAddon ? k : k.filter((y) => !!y.value);
2754
- }), b = F(() => d.value.addon), v = F(() => !m.value.find((k) => !!k.value)), f = () => {
2755
- var k;
2756
- return t.isAddon ? null : Qe(w(xe.FmSelect, {
2753
+ return t.isAddon ? M : M.filter((b) => !!b.value);
2754
+ }), v = F(() => d.value.addon), g = F(() => !m.value.find((M) => !!M.value)), f = () => {
2755
+ var M;
2756
+ return t.isAddon ? null : Qe(S(xe.FmSelect, {
2757
2757
  disabled: !d.value.category || t.isAddon || u(),
2758
2758
  items: m.value,
2759
- modelValue: t.form.category ?? ((k = t.fallback) == null ? void 0 : k.category),
2759
+ modelValue: t.form.category ?? ((M = t.fallback) == null ? void 0 : M.category),
2760
2760
  shiftMenu: !0,
2761
- "onUpdate:model-value": (y) => c("update:form", "category", y)
2761
+ "onUpdate:model-value": (b) => c("update:form", "category", b)
2762
2762
  }, {
2763
- "append-menu": () => w("button", {
2763
+ "append-menu": () => S("button", {
2764
2764
  class: "flex items-center py-8 px-16 space-x-8",
2765
2765
  type: "button",
2766
2766
  onClick: () => s.create()
2767
- }, [w(xe.FmIcon, {
2767
+ }, [S(xe.FmIcon, {
2768
2768
  color: "primary",
2769
2769
  name: "add",
2770
2770
  size: "md"
2771
- }, null), w("p", {
2771
+ }, null), S("p", {
2772
2772
  class: "fm-typo-en-body-lg-600 text-fm-color-primary"
2773
2773
  }, [Ct("Add new Category")])])
2774
2774
  }), [[Nt("if"), !t.isAddon]]);
2775
2775
  };
2776
2776
  ut(() => {
2777
- !v.value && t.form.category === void 0 && t.isCreate && z(Je.PRODUCT);
2777
+ !g.value && t.form.category === void 0 && t.isCreate && z(Je.PRODUCT);
2778
2778
  });
2779
- const S = F(() => {
2780
- var y;
2781
- const k = t.form.name || ((y = t.fallback) == null ? void 0 : y.name);
2782
- return k ? n.items.filter((g) => !!g.category && g._id !== t.form._id && g.name === k).length : 0;
2779
+ const C = F(() => {
2780
+ var b;
2781
+ const M = t.form.name || ((b = t.fallback) == null ? void 0 : b.name);
2782
+ return M ? n.items.filter((_) => !!_.category && _._id !== t.form._id && _.name === M).length : 0;
2783
2783
  });
2784
- function z(k) {
2785
- var g, C, x;
2786
- const y = k == Je.ADD_ON;
2787
- c("update:form", "category", t.isOverride ? y ? "" : ((g = t.fallback) == null ? void 0 : g.category) ?? ((C = m.value.find((M) => !!M.value)) == null ? void 0 : C.value) : y ? null : (x = m.value.find((M) => !!M.value)) == null ? void 0 : x.value);
2784
+ function z(M) {
2785
+ var _, A, y;
2786
+ const b = M == Je.ADD_ON;
2787
+ c("update:form", "category", t.isOverride ? b ? "" : ((_ = t.fallback) == null ? void 0 : _.category) ?? ((A = m.value.find((k) => !!k.value)) == null ? void 0 : A.value) : b ? null : (y = m.value.find((k) => !!k.value)) == null ? void 0 : y.value);
2788
2788
  }
2789
2789
  const E = J(!1);
2790
2790
  async function j() {
2791
- var k, y, g;
2791
+ var M, b, _;
2792
2792
  if (!t.form.name) {
2793
- const C = document.getElementById("product-name");
2794
- if (C) {
2795
- C.focus();
2793
+ const A = document.getElementById("product-name");
2794
+ if (A) {
2795
+ A.focus();
2796
2796
  return;
2797
2797
  } else
2798
2798
  return;
@@ -2802,10 +2802,10 @@ const Da = /* @__PURE__ */ ue({
2802
2802
  E.value = !0, Qt({
2803
2803
  event: "menu_catalog_item_general_remy_suggest_description"
2804
2804
  }), Ne.toggleDialog(!0);
2805
- const C = await ((y = (k = Ne).getItemDescription) == null ? void 0 : y.call(k, {
2805
+ const A = await ((b = (M = Ne).getItemDescription) == null ? void 0 : b.call(M, {
2806
2806
  name: t.form.name || ""
2807
- }, !0)), x = (g = C == null ? void 0 : C.data) == null ? void 0 : g.value;
2808
- typeof x == "string" && c("update:form", "description", x);
2807
+ }, !0)), y = (_ = A == null ? void 0 : A.data) == null ? void 0 : _.value;
2808
+ typeof y == "string" && c("update:form", "description", y);
2809
2809
  } finally {
2810
2810
  E.value = !1;
2811
2811
  }
@@ -2813,99 +2813,99 @@ const Da = /* @__PURE__ */ ue({
2813
2813
  const {
2814
2814
  t: D
2815
2815
  } = me();
2816
- return (k, y) => {
2817
- const g = G("fm-text-field"), C = G("fm-textarea"), x = G("fm-radio"), M = G("FmSnackbar"), R = G("FmButton"), _ = G("fm-radio-group"), A = G("FmFormGroup"), U = Nt("tooltip");
2816
+ return (M, b) => {
2817
+ const _ = G("fm-text-field"), A = G("fm-textarea"), y = G("fm-radio"), k = G("FmSnackbar"), x = G("FmButton"), w = G("fm-radio-group"), R = G("FmFormGroup"), U = Nt("tooltip");
2818
2818
  return O(), Y(Ke, {
2819
2819
  title: p(D)("menu.product.form.detail.title")
2820
2820
  }, {
2821
2821
  default: L(() => {
2822
2822
  var V, N;
2823
- return [P("div", Ca, [P("div", Aa, [P("div", Ra, [P("div", xa, [w(g, {
2824
- "model-value": k.form.code,
2825
- placeholder: ((V = k.fallback) == null ? void 0 : V.code) || p(D)("menu.product.form.detail.fields.code.placeholder"),
2823
+ return [P("div", Ca, [P("div", Aa, [P("div", Ra, [P("div", xa, [S(_, {
2824
+ "model-value": M.form.code,
2825
+ placeholder: ((V = M.fallback) == null ? void 0 : V.code) || p(D)("menu.product.form.detail.fields.code.placeholder"),
2826
2826
  label: p(D)("menu.product.form.detail.fields.code.label"),
2827
- "onUpdate:modelValue": y[0] || (y[0] = (q) => c("update:form", "code", p(hn)(q, k.isOverride)))
2828
- }, null, 8, ["model-value", "placeholder", "label"])]), P("div", Ma, [w(g, {
2827
+ "onUpdate:modelValue": b[0] || (b[0] = (q) => c("update:form", "code", p(hn)(q, M.isOverride)))
2828
+ }, null, 8, ["model-value", "placeholder", "label"])]), P("div", ka, [S(_, {
2829
2829
  id: "product-name",
2830
2830
  disabled: !d.value.name,
2831
- "helper-text": S.value > 0 ? p(D)("menu.product.form.detail.fields.name.duplicate_warning", {
2832
- count: S.value
2831
+ "helper-text": C.value > 0 ? p(D)("menu.product.form.detail.fields.name.duplicate_warning", {
2832
+ count: C.value
2833
2833
  }) : void 0,
2834
- "model-value": k.form.name,
2835
- placeholder: (N = k.fallback) == null ? void 0 : N.name,
2834
+ "model-value": M.form.name,
2835
+ placeholder: (N = M.fallback) == null ? void 0 : N.name,
2836
2836
  rules: d.value.name ? [(q) => !!q || p(D)("menu.product.form.detail.fields.name.required")] : void 0,
2837
2837
  "label-mark": "required",
2838
2838
  autofocus: "",
2839
2839
  label: p(D)("menu.product.form.detail.fields.name.label"),
2840
- "onUpdate:modelValue": y[1] || (y[1] = (q) => c("update:form", "name", q))
2841
- }, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), P("div", ka, [w(C, {
2840
+ "onUpdate:modelValue": b[1] || (b[1] = (q) => c("update:form", "name", q))
2841
+ }, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), P("div", Ma, [S(A, {
2842
2842
  disabled: !d.value.description,
2843
- "model-value": k.form.description,
2843
+ "model-value": M.form.description,
2844
2844
  placeholder: p(D)("menu.product.form.detail.fields.description.placeholder"),
2845
- "onUpdate:modelValue": y[2] || (y[2] = (q) => c("update:form", "description", q.trim())),
2845
+ "onUpdate:modelValue": b[2] || (b[2] = (q) => c("update:form", "description", q.trim())),
2846
2846
  class: "description"
2847
2847
  }, {
2848
2848
  label: L(() => [P("p", Oa, [Ct(de(p(D)("menu.product.form.detail.fields.description.label")) + " ", 1), P("span", za, de(p(D)("menu.product.form.detail.fields.description.optional")), 1)])]),
2849
2849
  _: 1
2850
- }, 8, ["disabled", "model-value", "placeholder"]), Qe(w(mn, {
2850
+ }, 8, ["disabled", "model-value", "placeholder"]), Qe(S(mn, {
2851
2851
  class: "absolute top-32 right-4 cursor-pointer",
2852
2852
  onClick: j
2853
- }, null, 512), [[U, p(Li)("Suggest description")]])])]), w(pa, {
2853
+ }, null, 512), [[U, p(Li)("Suggest description")]])])]), S(pa, {
2854
2854
  disabled: !d.value.thumbnail,
2855
- "model-value": k.thumbnail,
2856
- "onUpdate:modelValue": y[3] || (y[3] = (q) => c("update:thumbnail", q)),
2857
- "onReset:modelValue": y[4] || (y[4] = (q) => c("reset:thumbnail"))
2858
- }, null, 8, ["disabled", "model-value"])]), w(nt, {
2855
+ "model-value": M.thumbnail,
2856
+ "onUpdate:modelValue": b[3] || (b[3] = (q) => c("update:thumbnail", q)),
2857
+ "onReset:modelValue": b[4] || (b[4] = (q) => c("reset:thumbnail"))
2858
+ }, null, 8, ["disabled", "model-value"])]), S(nt, {
2859
2859
  label: p(D)("menu.product.form.detail.category.label")
2860
2860
  }, {
2861
- default: L(() => [b.value ? (O(), Y(_, {
2861
+ default: L(() => [v.value ? (O(), Y(w, {
2862
2862
  key: 0,
2863
2863
  disabled: !d.value.category,
2864
- "model-value": k.isAddon ? Je.ADD_ON : Je.PRODUCT,
2865
- "onUpdate:modelValue": y[5] || (y[5] = (q) => z(q))
2864
+ "model-value": M.isAddon ? Je.ADD_ON : Je.PRODUCT,
2865
+ "onUpdate:modelValue": b[5] || (b[5] = (q) => z(q))
2866
2866
  }, {
2867
- default: L(() => [P("div", Ea, [P("div", Fa, [w(x, {
2868
- disabled: v.value,
2867
+ default: L(() => [P("div", Ea, [P("div", Fa, [S(y, {
2868
+ disabled: g.value,
2869
2869
  value: Je.PRODUCT,
2870
2870
  label: p(D)("menu.product.form.detail.category.options.product.label"),
2871
2871
  sublabel: p(D)("menu.product.form.detail.category.options.product.sublabel")
2872
- }, null, 8, ["disabled", "value", "label", "sublabel"]), w(Ao, null, {
2872
+ }, null, 8, ["disabled", "value", "label", "sublabel"]), S(Ao, null, {
2873
2873
  default: L(() => [p(n).isV4 ? (O(), Y(f, {
2874
2874
  key: 0
2875
2875
  })) : te("", !0)]),
2876
2876
  _: 1
2877
- })]), v.value ? (O(), Q("div", Ia, [w(M, {
2877
+ })]), g.value ? (O(), Q("div", Ia, [S(k, {
2878
2878
  title: p(D)("menu.product.form.detail.category.add_first"),
2879
2879
  variant: "info"
2880
- }, null, 8, ["title"]), w(R, {
2880
+ }, null, 8, ["title"]), S(x, {
2881
2881
  label: p(D)("menu.common.actions.add"),
2882
2882
  "prepend-icon": "add",
2883
2883
  variant: "secondary",
2884
2884
  onClick: p(s).create
2885
- }, null, 8, ["label", "onClick"])])) : te("", !0), w(x, {
2885
+ }, null, 8, ["label", "onClick"])])) : te("", !0), S(y, {
2886
2886
  value: Je.ADD_ON,
2887
2887
  label: p(D)("menu.product.form.detail.category.options.addon.label"),
2888
2888
  sublabel: p(D)("menu.product.form.detail.category.options.addon.sublabel")
2889
2889
  }, null, 8, ["value", "label", "sublabel"])])]),
2890
2890
  _: 1
2891
- }, 8, ["disabled", "model-value"])) : te("", !0), p(n).isV4 ? te("", !0) : (O(), Y(A, {
2891
+ }, 8, ["disabled", "model-value"])) : te("", !0), p(n).isV4 ? te("", !0) : (O(), Y(R, {
2892
2892
  key: 1,
2893
- modelValue: k.form.category,
2894
- "onUpdate:modelValue": y[6] || (y[6] = (q) => k.form.category = q),
2895
- rules: [(q) => !q && !k.isOverride ? "Category is required" : !0]
2893
+ modelValue: M.form.category,
2894
+ "onUpdate:modelValue": b[6] || (b[6] = (q) => M.form.category = q),
2895
+ rules: [(q) => !q && !M.isOverride ? "Category is required" : !0]
2896
2896
  }, {
2897
- default: L(() => [w(f)]),
2897
+ default: L(() => [S(f)]),
2898
2898
  _: 1
2899
2899
  }, 8, ["modelValue", "rules"]))]),
2900
2900
  _: 1
2901
- }, 8, ["label"]), w(ai, {
2901
+ }, 8, ["label"]), S(ai, {
2902
2902
  disabled: !d.value.orderFrom,
2903
- "model-value": k.form.orderFrom,
2903
+ "model-value": M.form.orderFrom,
2904
2904
  "order-from-none": d.value.orderFromNone,
2905
2905
  required: d.value.orderFrom,
2906
2906
  "default-label": p(D)("menu.product.form.detail.order_from.default"),
2907
2907
  label: p(D)("menu.product.form.detail.order_from.label"),
2908
- "onUpdate:modelValue": y[7] || (y[7] = (q) => q && c("update:form", "orderFrom", q))
2908
+ "onUpdate:modelValue": b[7] || (b[7] = (q) => q && c("update:form", "orderFrom", q))
2909
2909
  }, null, 8, ["disabled", "model-value", "order-from-none", "required", "default-label", "label"])];
2910
2910
  }),
2911
2911
  _: 1
@@ -2925,17 +2925,17 @@ const pn = /* @__PURE__ */ st(Ta, [["render", $a]]), Na = /* @__PURE__ */ ue({
2925
2925
  setup(e) {
2926
2926
  const i = fe(), t = F(() => i.rules.group), n = F(() => !!i.state.currentCatalogId || !!i.state.currentSchedulerId), a = F(() => {
2927
2927
  const s = !i.state.currentSchedulerId, u = i.rules.group.type, c = i.version === B.F_MENU_VERSION.enum.v3, d = i.rules.item.orderFromActiveOnly, h = i.rules.item.bindToVariant;
2928
- return function(b) {
2928
+ return function(v) {
2929
2929
  return {
2930
- link: (v) => !n.value && (!v || h),
2931
- name: (v) => !n.value && !v,
2932
- isDefault: (v) => !n.value,
2933
- type: u && !b._id && !n.value,
2934
- price: b.type !== B.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
2935
- inventory: s ? c ? !n.value && b.type === B.F_ADDON_GROUP_TYPE.enum.NORMAL : !n.value : !1,
2936
- orderFrom: (v) => s ? c ? b.type === B.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? n.value : !!n.value == !v : n.value : !1,
2930
+ link: (g) => !n.value && (!g || h),
2931
+ name: (g) => !n.value && !g,
2932
+ isDefault: (g) => !n.value,
2933
+ type: u && !v._id && !n.value,
2934
+ price: v.type !== B.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
2935
+ inventory: s ? c ? !n.value && v.type === B.F_ADDON_GROUP_TYPE.enum.NORMAL : !n.value : !1,
2936
+ orderFrom: (g) => s ? c ? v.type === B.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? n.value : !!n.value == !g : n.value : !1,
2937
2937
  orderFromActiveOnly: d,
2938
- showOrderFrom: s ? c ? n.value ? !0 : b.type === B.F_ADDON_GROUP_TYPE.enum.PRODUCT : n.value : !1,
2938
+ showOrderFrom: s ? c ? n.value ? !0 : v.type === B.F_ADDON_GROUP_TYPE.enum.PRODUCT : n.value : !1,
2939
2939
  bindToVariant: h,
2940
2940
  isOverride: n.value,
2941
2941
  isItemGroup: !1,
@@ -3005,14 +3005,14 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3005
3005
  }
3006
3006
  ), i({ getKey: () => n.bindingKey, trigger: o });
3007
3007
  const { t: d } = me(), h = Ki();
3008
- return (m, b) => {
3009
- const v = G("fm-text-field"), f = G("fm-card"), S = G("fm-button"), z = G("fm-side-sheet");
3010
- return O(), Q(ke, null, [
3008
+ return (m, v) => {
3009
+ const g = G("fm-text-field"), f = G("fm-card"), C = G("fm-button"), z = G("fm-side-sheet");
3010
+ return O(), Q(Me, null, [
3011
3011
  ve(m.$slots, "default", { trigger: o }),
3012
- w(z, {
3012
+ S(z, {
3013
3013
  id: "inventory-form",
3014
3014
  modelValue: a.value,
3015
- "onUpdate:modelValue": b[2] || (b[2] = (E) => a.value = E),
3015
+ "onUpdate:modelValue": v[2] || (v[2] = (E) => a.value = E),
3016
3016
  "close-button": !1,
3017
3017
  "is-container": p(xe).FmForm,
3018
3018
  "is-container-props": {
@@ -3027,35 +3027,35 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3027
3027
  ]),
3028
3028
  "side-sheet-footer": L(() => [
3029
3029
  P("div", Ya, [
3030
- w(S, {
3030
+ S(C, {
3031
3031
  label: p(d)("menu.common.actions.add"),
3032
3032
  size: "lg",
3033
3033
  type: "submit",
3034
3034
  variant: "primary"
3035
3035
  }, null, 8, ["label"]),
3036
- w(S, {
3036
+ S(C, {
3037
3037
  label: p(d)("menu.common.actions.cancel"),
3038
3038
  size: "lg",
3039
3039
  variant: "tertiary",
3040
- onClick: b[1] || (b[1] = () => a.value = !1)
3040
+ onClick: v[1] || (v[1] = () => a.value = !1)
3041
3041
  }, null, 8, ["label"])
3042
3042
  ])
3043
3043
  ]),
3044
3044
  default: L(() => [
3045
3045
  P("div", Wa, [
3046
- w(v, {
3046
+ S(g, {
3047
3047
  "model-value": m.name,
3048
3048
  disabled: "",
3049
3049
  label: p(d)("menu.inventory.form.product_name")
3050
3050
  }, null, 8, ["model-value", "label"]),
3051
- w(f, {
3051
+ S(f, {
3052
3052
  class: "p-16 space-y-24",
3053
3053
  variant: "outlined"
3054
3054
  }, {
3055
3055
  default: L(() => [
3056
- w(p($n), {
3056
+ S(p($n), {
3057
3057
  modelValue: r.value,
3058
- "onUpdate:modelValue": b[0] || (b[0] = (E) => r.value = E)
3058
+ "onUpdate:modelValue": v[0] || (v[0] = (E) => r.value = E)
3059
3059
  }, null, 8, ["modelValue"])
3060
3060
  ]),
3061
3061
  _: 1
@@ -3097,9 +3097,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3097
3097
  combinationKey: T.combinationKey
3098
3098
  }))])), {
3099
3099
  searchKey: m,
3100
- filter: b
3101
- } = In(), v = F(() => {
3102
- const I = Object.entries(t.group.items).filter(([, T]) => b([T.code || "", T.name || T.fallbackName, z(T.price ?? T.fallbackPrice), E(T.orderFrom || T.fallbackOrder), ...(T.items || []).map((K) => [K.code || "", K.name || K.fallbackName, z(K.price ?? K.fallbackPrice), E(K.orderFrom || K.fallbackOrder)].join(""))]));
3100
+ filter: v
3101
+ } = In(), g = F(() => {
3102
+ const I = Object.entries(t.group.items).filter(([, T]) => v([T.code || "", T.name || T.fallbackName, z(T.price ?? T.fallbackPrice), E(T.orderFrom || T.fallbackOrder), ...(T.items || []).map((K) => [K.code || "", K.name || K.fallbackName, z(K.price ?? K.fallbackPrice), E(K.orderFrom || K.fallbackOrder)].join(""))]));
3103
3103
  return Object.fromEntries(I);
3104
3104
  }), f = (I) => ({
3105
3105
  ...t.config,
@@ -3107,14 +3107,14 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3107
3107
  link: t.config.link(I),
3108
3108
  name: t.config.name(I),
3109
3109
  orderFrom: t.config.orderFrom(I)
3110
- }), S = F(() => t.config.isItemGroup), z = (I) => I ? mt(I, !1) : "", E = (I) => {
3110
+ }), C = F(() => t.config.isItemGroup), z = (I) => I ? mt(I, !1) : "", E = (I) => {
3111
3111
  var T;
3112
- return I == null ? "" : (T = kn()[I]) == null ? void 0 : T.label;
3113
- }, j = F(() => Object.values(v.value)), D = J({}), {
3114
- t: k
3115
- } = me(), y = J([{
3112
+ return I == null ? "" : (T = Mn()[I]) == null ? void 0 : T.label;
3113
+ }, j = F(() => Object.values(g.value)), D = J({}), {
3114
+ t: M
3115
+ } = me(), b = J([{
3116
3116
  accessorKey: "isDefault",
3117
- header: () => k("menu.group.option.is_default"),
3117
+ header: () => M("menu.group.option.is_default"),
3118
3118
  enableSorting: !1,
3119
3119
  size: 75,
3120
3120
  cell: (I) => {
@@ -3122,7 +3122,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3122
3122
  if ((ie = (ee = I.row.original) == null ? void 0 : ee.items) != null && ie.length)
3123
3123
  return null;
3124
3124
  const T = I.row.depth > 0, K = I.row.original, Z = !!I.getValue();
3125
- return w(xe.FmCheckbox, {
3125
+ return S(xe.FmCheckbox, {
3126
3126
  value: "default",
3127
3127
  modelValue: Z,
3128
3128
  disabled: !f(K.combinationKey).isDefault,
@@ -3131,32 +3131,32 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3131
3131
  if (T) {
3132
3132
  const Ge = (ye = I.row.getParentRow()) == null ? void 0 : ye.original;
3133
3133
  if (!Ge) return;
3134
- M(Ge._id, K.combinationKey ?? "", "isDefault", le);
3134
+ k(Ge._id, K.combinationKey ?? "", "isDefault", le);
3135
3135
  } else
3136
- x(K._id, "isDefault", le);
3136
+ y(K._id, "isDefault", le);
3137
3137
  }
3138
3138
  }, null);
3139
3139
  }
3140
3140
  }, {
3141
3141
  accessorKey: "code",
3142
- header: () => k("menu.group.option.code"),
3142
+ header: () => M("menu.group.option.code"),
3143
3143
  enableSorting: !1,
3144
3144
  size: 100,
3145
3145
  cell: (I) => {
3146
3146
  const T = I.getValue();
3147
- return w(xe.FmTooltip, {
3147
+ return S(xe.FmTooltip, {
3148
3148
  class: "flex",
3149
3149
  content: T,
3150
3150
  zIndex: 110
3151
3151
  }, {
3152
- default: () => [w("div", {
3152
+ default: () => [S("div", {
3153
3153
  class: "break-all max-w-[100px]"
3154
3154
  }, [T])]
3155
3155
  });
3156
3156
  }
3157
3157
  }, {
3158
3158
  accessorKey: "name",
3159
- header: () => k("menu.group.option.product_title"),
3159
+ header: () => M("menu.group.option.product_title"),
3160
3160
  enableSorting: !1,
3161
3161
  cell: (I) => {
3162
3162
  const T = I.getValue(), K = I.row.original, Z = I.row.depth > 0, ee = K.combinationKey ? Yi(K.combinationKey, fe().variants) : null;
@@ -3164,15 +3164,15 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3164
3164
  modelValue: T,
3165
3165
  placeholder: ee ?? "",
3166
3166
  disabled: !f(K.combinationKey).name,
3167
- rules: ee ? void 0 : [(ie) => ie.length > 0 || k("menu.group.option.product_title_required")],
3167
+ rules: ee ? void 0 : [(ie) => ie.length > 0 || M("menu.group.option.product_title_required")],
3168
3168
  "onUpdate:modelValue": (ie) => {
3169
3169
  var le;
3170
3170
  if (Z) {
3171
3171
  const ye = (le = I.row.getParentRow()) == null ? void 0 : le.original;
3172
3172
  if (!ye) return;
3173
- M(ye._id, K.combinationKey ?? "", "name", ie);
3173
+ k(ye._id, K.combinationKey ?? "", "name", ie);
3174
3174
  } else
3175
- x(K._id, "name", ie);
3175
+ y(K._id, "name", ie);
3176
3176
  },
3177
3177
  class: "min-w-[300px]"
3178
3178
  }, {
@@ -3192,7 +3192,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3192
3192
  enableSorting: !1,
3193
3193
  header: () => {
3194
3194
  var I;
3195
- return k("menu.group.option.price", {
3195
+ return M("menu.group.option.price", {
3196
3196
  symbol: (I = l.value) == null ? void 0 : I.currency.symbol
3197
3197
  });
3198
3198
  },
@@ -3204,13 +3204,13 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3204
3204
  modelValue: T,
3205
3205
  required: !Z,
3206
3206
  nullable: !!Z,
3207
- min: S.value ? void 0 : 0,
3207
+ min: C.value ? void 0 : 0,
3208
3208
  "onUpdate:modelValue": (ie) => {
3209
3209
  var le;
3210
3210
  if (ee) {
3211
3211
  const ye = (le = I.row.getParentRow()) == null ? void 0 : le.original;
3212
3212
  if (!ye) return;
3213
- M(
3213
+ k(
3214
3214
  ye._id,
3215
3215
  K.combinationKey ?? "",
3216
3216
  // @ts-ignore
@@ -3218,7 +3218,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3218
3218
  ie
3219
3219
  );
3220
3220
  } else
3221
- x(K._id, "price", ie);
3221
+ y(K._id, "price", ie);
3222
3222
  },
3223
3223
  showCurrency: !1,
3224
3224
  class: "min-w-[88px]"
@@ -3226,7 +3226,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3226
3226
  }
3227
3227
  }, {
3228
3228
  accessorKey: "orderFrom",
3229
- header: () => k("menu.common.labels.order_from"),
3229
+ header: () => M("menu.common.labels.order_from"),
3230
3230
  size: 100,
3231
3231
  enableSorting: !1,
3232
3232
  cell: (I) => {
@@ -3242,7 +3242,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3242
3242
  if (ee) {
3243
3243
  const ye = (le = I.row.getParentRow()) == null ? void 0 : le.original;
3244
3244
  if (!ye) return;
3245
- M(
3245
+ k(
3246
3246
  ye._id,
3247
3247
  K.combinationKey ?? "",
3248
3248
  // @ts-ignore
@@ -3250,7 +3250,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3250
3250
  ie
3251
3251
  );
3252
3252
  } else
3253
- x(K._id, "orderFrom", ie);
3253
+ y(K._id, "orderFrom", ie);
3254
3254
  },
3255
3255
  label: "",
3256
3256
  menuZIndex: 101
@@ -3266,9 +3266,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3266
3266
  size: 80,
3267
3267
  cell: (I) => {
3268
3268
  const T = I.row.original, K = I.row.depth > 0;
3269
- return w("div", {
3269
+ return S("div", {
3270
3270
  class: "flex items-center justify-end"
3271
- }, [f(T.combinationKey).inventory && w(qt, {
3271
+ }, [f(T.combinationKey).inventory && S(qt, {
3272
3272
  title: "Inventory",
3273
3273
  initialValue: T.inventoryBindings ?? [],
3274
3274
  name: T.name ?? T.fallbackName ?? "",
@@ -3278,7 +3278,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3278
3278
  if (K) {
3279
3279
  const ie = (ee = I.row.getParentRow()) == null ? void 0 : ee.original;
3280
3280
  if (!ie) return;
3281
- M(
3281
+ k(
3282
3282
  ie._id,
3283
3283
  T.combinationKey ?? "",
3284
3284
  // @ts-ignore
@@ -3286,18 +3286,18 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3286
3286
  Z
3287
3287
  );
3288
3288
  } else
3289
- x(T._id, "inventoryBindings", Z);
3289
+ y(T._id, "inventoryBindings", Z);
3290
3290
  }
3291
3291
  }, {
3292
3292
  default: ({
3293
3293
  trigger: Z
3294
- }) => w(G("fm-tooltip"), {
3294
+ }) => S(G("fm-tooltip"), {
3295
3295
  content: "Inventory",
3296
3296
  zIndex: 110
3297
3297
  }, {
3298
3298
  default: () => {
3299
3299
  var ee;
3300
- return [w(G("fm-button"), {
3300
+ return [S(G("fm-button"), {
3301
3301
  variant: qe.Tertiary,
3302
3302
  prependIcon: "inventory_2",
3303
3303
  overwriteIconOutline: (ee = T.inventoryBindings) != null && ee.length ? "filled" : "outline",
@@ -3306,7 +3306,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3306
3306
  }, null)];
3307
3307
  }
3308
3308
  })
3309
- }), f(T.combinationKey).link && w(G("fm-button"), {
3309
+ }), f(T.combinationKey).link && S(G("fm-button"), {
3310
3310
  variant: qe.Tertiary,
3311
3311
  prependIcon: "delete",
3312
3312
  textColor: je.NeutralGray400,
@@ -3317,27 +3317,27 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3317
3317
  if (!ie) return;
3318
3318
  if ((((ee = t.group.items[ie._id].items) == null ? void 0 : ee.length) || 0) <= 1) {
3319
3319
  a.open({
3320
- title: k("menu.group.option.should_link_at_least_one_variant", {
3320
+ title: M("menu.group.option.should_link_at_least_one_variant", {
3321
3321
  name: ie.name
3322
3322
  }),
3323
3323
  type: "error"
3324
3324
  });
3325
3325
  return;
3326
3326
  }
3327
- _(ie._id, T.combinationKey ?? "");
3327
+ w(ie._id, T.combinationKey ?? "");
3328
3328
  } else
3329
- R(T._id);
3329
+ x(T._id);
3330
3330
  }
3331
3331
  }, null)]);
3332
3332
  }
3333
- }]), g = F(() => ({
3333
+ }]), _ = F(() => ({
3334
3334
  code: d.value,
3335
3335
  name: !0,
3336
3336
  price: f(null).price,
3337
3337
  orderFrom: f(null).showOrderFrom,
3338
3338
  action: f(null).inventory || f(null).link
3339
3339
  }));
3340
- async function C() {
3340
+ async function A() {
3341
3341
  const I = (/* @__PURE__ */ new Date()).toISOString();
3342
3342
  n("update:group", {
3343
3343
  ...t.group,
@@ -3355,7 +3355,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3355
3355
  }
3356
3356
  });
3357
3357
  }
3358
- function x(I, T, K) {
3358
+ function y(I, T, K) {
3359
3359
  const Z = t.group.items[I];
3360
3360
  if (!Z) return;
3361
3361
  const ee = {
@@ -3369,7 +3369,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3369
3369
  }
3370
3370
  });
3371
3371
  }
3372
- function M(I, T, K, Z) {
3372
+ function k(I, T, K, Z) {
3373
3373
  var ye, Ge;
3374
3374
  const ee = ne(t.group), ie = (ye = ee.items[I].items) == null ? void 0 : ye.findIndex((lt) => lt.combinationKey === T);
3375
3375
  if (!pt.isSet(ie)) return;
@@ -3379,15 +3379,15 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3379
3379
  [K]: Z
3380
3380
  }, ee.items[I].items[ie] = le, n("update:group", ee));
3381
3381
  }
3382
- function R(I) {
3382
+ function x(I) {
3383
3383
  const T = ne(t.group);
3384
3384
  delete T.items[I], n("update:group", T);
3385
3385
  }
3386
- function _(I, T) {
3386
+ function w(I, T) {
3387
3387
  const K = ne(t.group), Z = K.items[I];
3388
3388
  Z && (Z.items = (Z.items || []).filter((ee) => ee.combinationKey !== T), K.items[I] = Z, n("update:group", K));
3389
3389
  }
3390
- const A = F(() => t.categorizedItems.flatMap((I) => I.items).reduce((I, T) => {
3390
+ const R = F(() => t.categorizedItems.flatMap((I) => I.items).reduce((I, T) => {
3391
3391
  var K;
3392
3392
  return I[T._id] = {
3393
3393
  price: T.price,
@@ -3405,7 +3405,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3405
3405
  T = {
3406
3406
  ...T,
3407
3407
  items: I.map((K) => {
3408
- const Z = T.items.find((ie) => ie._id == K._id && ie.combinationKey == K.combinationKey), ee = A.value[K._id];
3408
+ const Z = T.items.find((ie) => ie._id == K._id && ie.combinationKey == K.combinationKey), ee = R.value[K._id];
3409
3409
  return Z || {
3410
3410
  ...K,
3411
3411
  name: U(K),
@@ -3426,40 +3426,40 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3426
3426
  return (I, T) => {
3427
3427
  const K = G("fm-button"), Z = G("fm-table");
3428
3428
  return O(), Y(Ke, {
3429
- title: p(k)("menu.group.option.title")
3429
+ title: p(M)("menu.group.option.title")
3430
3430
  }, {
3431
- "append-title": L(() => [I.config.link() ? (O(), Q(ke, {
3431
+ "append-title": L(() => [I.config.link() ? (O(), Q(Me, {
3432
3432
  key: 0
3433
- }, [c.value ? (O(), Q("div", Xa, [w(Ln, {
3433
+ }, [c.value ? (O(), Q("div", Xa, [S(Ln, {
3434
3434
  "categorized-items": I.categorizedItems,
3435
3435
  "initial-value": h.value,
3436
3436
  "show-variant": I.config.bindToVariant,
3437
3437
  "select-variant": "",
3438
- title: p(k)("menu.group.option.link_products"),
3438
+ title: p(M)("menu.group.option.link_products"),
3439
3439
  onSubmit: V
3440
3440
  }, {
3441
3441
  default: L(({
3442
3442
  trigger: ee
3443
- }) => [w(K, {
3443
+ }) => [S(K, {
3444
3444
  "text-color": p(je).ColorPrimary,
3445
3445
  "border-color": p(je).ColorPrimary,
3446
3446
  variant: "secondary",
3447
- label: p(k)("menu.group.option.link_products"),
3447
+ label: p(M)("menu.group.option.link_products"),
3448
3448
  "prepend-icon": "link",
3449
3449
  onClick: ee
3450
3450
  }, null, 8, ["text-color", "border-color", "label", "onClick"])]),
3451
3451
  _: 1
3452
- }, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (O(), Q("div", qa, [w(K, {
3452
+ }, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (O(), Q("div", qa, [S(K, {
3453
3453
  "text-color": p(je).ColorPrimary,
3454
3454
  "border-color": p(je).ColorPrimary,
3455
3455
  variant: "secondary",
3456
- label: p(k)("menu.group.option.add_option"),
3456
+ label: p(M)("menu.group.option.add_option"),
3457
3457
  "prepend-icon": "add",
3458
- onClick: C
3458
+ onClick: A
3459
3459
  }, null, 8, ["text-color", "border-color", "label"])]))], 64)) : te("", !0)]),
3460
- default: L(() => [P("div", Za, [P("div", Ja, [w(Z, {
3461
- "column-defs": y.value,
3462
- "column-visibility": g.value,
3460
+ default: L(() => [P("div", Za, [P("div", Ja, [S(Z, {
3461
+ "column-defs": b.value,
3462
+ "column-visibility": _.value,
3463
3463
  draggable: !Ce.value && f(null).name,
3464
3464
  "expanded-state": s.value ? {} : D.value,
3465
3465
  "get-sub-row": N,
@@ -3492,8 +3492,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3492
3492
  emits: ["update:group", "submit:group", "status:show"],
3493
3493
  setup(e, { expose: i, emit: t }) {
3494
3494
  let n = e;
3495
- const a = t, o = fe(), r = Be(), l = Xe(He(De())), s = J(!1), u = J(!1), c = (y) => {
3496
- pt.isBoolean(y) ? u.value = y : u.value = !u.value;
3495
+ const a = t, o = fe(), r = Be(), l = Xe(He(De())), s = J(!1), u = J(!1), c = (b) => {
3496
+ pt.isBoolean(b) ? u.value = b : u.value = !u.value;
3497
3497
  }, d = F(() => n.config(n.group)), h = F(() => [
3498
3498
  {
3499
3499
  label: "Normal",
@@ -3508,15 +3508,15 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3508
3508
  value: B.F_ADDON_GROUP_TYPE.enum.DYNAMIC
3509
3509
  }
3510
3510
  ]);
3511
- function m(y) {
3512
- a("update:group", y);
3511
+ function m(b) {
3512
+ a("update:group", b);
3513
3513
  }
3514
- function b(y) {
3515
- function g() {
3514
+ function v(b) {
3515
+ function _() {
3516
3516
  m({
3517
3517
  ...n.group,
3518
3518
  items: {},
3519
- type: y
3519
+ type: b
3520
3520
  });
3521
3521
  }
3522
3522
  Object.keys(n.group.items).length > 0 ? r.open({
@@ -3530,68 +3530,68 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3530
3530
  text: "No",
3531
3531
  close: !0
3532
3532
  }
3533
- }).onPrimary(g) : g();
3533
+ }).onPrimary(_) : _();
3534
3534
  }
3535
- function v(y) {
3535
+ function g(b) {
3536
3536
  return new Wi(o, l.updateMenu, r).mapGroups(
3537
- [y],
3537
+ [b],
3538
3538
  d.value.isOverride
3539
3539
  )[0];
3540
3540
  }
3541
- function f(y) {
3542
- let g = 0;
3543
- for (const C of Object.values(y.items)) {
3544
- C.isDefault && g++;
3545
- for (const x of C.items ?? [])
3546
- x.isDefault && g++;
3541
+ function f(b) {
3542
+ let _ = 0;
3543
+ for (const A of Object.values(b.items)) {
3544
+ A.isDefault && _++;
3545
+ for (const y of A.items ?? [])
3546
+ y.isDefault && _++;
3547
3547
  }
3548
- return g;
3548
+ return _;
3549
3549
  }
3550
- function S(y) {
3551
- return f(y) <= y.max || k("menu.common.validation.max_default_items", { max: y.max });
3550
+ function C(b) {
3551
+ return f(b) <= b.max || M("menu.common.validation.max_default_items", { max: b.max });
3552
3552
  }
3553
3553
  const z = J($e.clone(n.group)), E = Bi(
3554
3554
  () => !$e.isEqual(n.group, z.value),
3555
3555
  () => {
3556
3556
  u.value = !1;
3557
3557
  }
3558
- ), j = F(() => n.action === "add" ? k("common.add") : k("common.update"));
3558
+ ), j = F(() => n.action === "add" ? M("common.add") : M("common.update"));
3559
3559
  async function D() {
3560
3560
  if (n.action === "add") {
3561
- const { group: y, linkItems: g } = ji(n.group), C = {
3561
+ const { group: b, linkItems: _ } = ji(n.group), A = {
3562
3562
  module: B.F_MENU_MODULE_V4_KEY.enum.group,
3563
3563
  operation: pe.F_OPERATION_TYPE.create,
3564
- data: y,
3564
+ data: b,
3565
3565
  link: [
3566
3566
  {
3567
3567
  module: B.F_MENU_MODULE_V4_KEY.enum.item,
3568
3568
  id: "",
3569
- data: g
3569
+ data: _
3570
3570
  }
3571
3571
  ]
3572
3572
  };
3573
- await l.updateMenu(C, y.name), a("submit:group", n.group);
3573
+ await l.updateMenu(A, b.name), a("submit:group", n.group);
3574
3574
  } else n.action === "update" && a("submit:group", n.group);
3575
3575
  c(!1);
3576
3576
  }
3577
3577
  Re(
3578
3578
  () => u.value,
3579
- async (y) => {
3580
- a("status:show", y), y && (await Ui(), z.value = $e.clone(n.group));
3579
+ async (b) => {
3580
+ a("status:show", b), b && (await Ui(), z.value = $e.clone(n.group));
3581
3581
  }
3582
3582
  ), i({
3583
3583
  trigger: c,
3584
3584
  show: u
3585
3585
  });
3586
- const { t: k } = me();
3587
- return (y, g) => {
3588
- const C = G("fm-text-field"), x = G("fm-stepper-field"), M = G("FmFormGroup"), R = G("fm-radio"), _ = G("fm-radio-group"), A = G("fm-switch"), U = G("fm-button"), V = G("fm-side-sheet");
3589
- return O(), Q(ke, null, [
3590
- ve(y.$slots, "default", { trigger: c }),
3591
- w(V, {
3586
+ const { t: M } = me();
3587
+ return (b, _) => {
3588
+ const A = G("fm-text-field"), y = G("fm-stepper-field"), k = G("FmFormGroup"), x = G("fm-radio"), w = G("fm-radio-group"), R = G("fm-switch"), U = G("fm-button"), V = G("fm-side-sheet");
3589
+ return O(), Q(Me, null, [
3590
+ ve(b.$slots, "default", { trigger: c }),
3591
+ S(V, {
3592
3592
  id: "group-form",
3593
3593
  modelValue: u.value,
3594
- "onUpdate:modelValue": g[8] || (g[8] = (N) => u.value = N),
3594
+ "onUpdate:modelValue": _[8] || (_[8] = (N) => u.value = N),
3595
3595
  "is-container": p(xe).FmForm,
3596
3596
  "is-container-props": {
3597
3597
  onValidationSuccess: D,
@@ -3601,64 +3601,64 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3601
3601
  "onOn:clickedAway": p(E)
3602
3602
  }, {
3603
3603
  "side-sheet-header": L(() => [
3604
- P("p", er, de(y.title), 1)
3604
+ P("p", er, de(b.title), 1)
3605
3605
  ]),
3606
3606
  "side-sheet-footer": L(() => [
3607
3607
  P("div", ir, [
3608
- w(U, {
3608
+ S(U, {
3609
3609
  label: p(Bn)(j.value),
3610
3610
  loading: s.value,
3611
3611
  size: "lg",
3612
3612
  type: "submit",
3613
3613
  variant: "primary"
3614
3614
  }, null, 8, ["label", "loading"]),
3615
- w(U, {
3616
- label: p(k)("menu.common.actions.cancel"),
3615
+ S(U, {
3616
+ label: p(M)("menu.common.actions.cancel"),
3617
3617
  size: "lg",
3618
3618
  variant: "tertiary",
3619
- onClick: g[7] || (g[7] = () => u.value = !1)
3619
+ onClick: _[7] || (_[7] = () => u.value = !1)
3620
3620
  }, null, 8, ["label"])
3621
3621
  ])
3622
3622
  ]),
3623
3623
  default: L(() => [
3624
- y.group ? (O(), Q("div", tr, [
3625
- ve(y.$slots, "variant-section"),
3626
- w(Tn, null, {
3624
+ b.group ? (O(), Q("div", tr, [
3625
+ ve(b.$slots, "variant-section"),
3626
+ S(Tn, null, {
3627
3627
  default: L(() => [
3628
3628
  P("div", null, [
3629
- w(C, {
3630
- modelValue: y.group.name,
3631
- "onUpdate:modelValue": g[0] || (g[0] = (N) => y.group.name = N),
3629
+ S(A, {
3630
+ modelValue: b.group.name,
3631
+ "onUpdate:modelValue": _[0] || (_[0] = (N) => b.group.name = N),
3632
3632
  disabled: !d.value.link(),
3633
3633
  rules: [
3634
- (N) => !!N || p(k)("menu.common.validation.required", { field: p(k)("menu.common.labels.group_name") })
3634
+ (N) => !!N || p(M)("menu.common.validation.required", { field: p(M)("menu.common.labels.group_name") })
3635
3635
  ],
3636
3636
  autofocus: "",
3637
- label: p(k)("menu.common.labels.group_name")
3637
+ label: p(M)("menu.common.labels.group_name")
3638
3638
  }, null, 8, ["modelValue", "disabled", "rules", "label"])
3639
3639
  ]),
3640
- w(M, {
3641
- "model-value": y.group,
3642
- rules: [() => y.group.min <= y.group.max || p(k)("menu.common.validation.min_max")]
3640
+ S(k, {
3641
+ "model-value": b.group,
3642
+ rules: [() => b.group.min <= b.group.max || p(M)("menu.common.validation.min_max")]
3643
3643
  }, {
3644
3644
  default: L(() => [
3645
- w(Ga, null, {
3645
+ S(Ga, null, {
3646
3646
  default: L(() => [
3647
- w(x, {
3648
- modelValue: y.group.min,
3649
- "onUpdate:modelValue": g[1] || (g[1] = (N) => y.group.min = N),
3647
+ S(y, {
3648
+ modelValue: b.group.min,
3649
+ "onUpdate:modelValue": _[1] || (_[1] = (N) => b.group.min = N),
3650
3650
  disabled: !d.value.link(),
3651
3651
  min: 0,
3652
3652
  class: "flex-1",
3653
- label: p(k)("menu.common.labels.min_select")
3653
+ label: p(M)("menu.common.labels.min_select")
3654
3654
  }, null, 8, ["modelValue", "disabled", "label"]),
3655
- w(x, {
3656
- modelValue: y.group.max,
3657
- "onUpdate:modelValue": g[2] || (g[2] = (N) => y.group.max = N),
3655
+ S(y, {
3656
+ modelValue: b.group.max,
3657
+ "onUpdate:modelValue": _[2] || (_[2] = (N) => b.group.max = N),
3658
3658
  disabled: !d.value.link(),
3659
- min: y.group.min,
3659
+ min: b.group.min,
3660
3660
  class: "flex-1",
3661
- label: p(k)("menu.common.labels.max_select")
3661
+ label: p(M)("menu.common.labels.max_select")
3662
3662
  }, null, 8, ["modelValue", "disabled", "min", "label"])
3663
3663
  ]),
3664
3664
  _: 1
@@ -3668,18 +3668,18 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3668
3668
  }, 8, ["model-value", "rules"]),
3669
3669
  d.value.type ? (O(), Y(nt, {
3670
3670
  key: 0,
3671
- label: p(k)("menu.common.labels.group_type")
3671
+ label: p(M)("menu.common.labels.group_type")
3672
3672
  }, {
3673
3673
  default: L(() => [
3674
- w(_, {
3674
+ S(w, {
3675
3675
  disabled: !d.value.type,
3676
- "model-value": y.group.type,
3677
- "onUpdate:modelValue": g[3] || (g[3] = (N) => b(N))
3676
+ "model-value": b.group.type,
3677
+ "onUpdate:modelValue": _[3] || (_[3] = (N) => v(N))
3678
3678
  }, {
3679
3679
  default: L(() => [
3680
- (O(!0), Q(ke, null, Ye(h.value, (N) => (O(), Y(R, {
3680
+ (O(!0), Q(Me, null, Ye(h.value, (N) => (O(), Y(x, {
3681
3681
  key: N.value,
3682
- label: p(k)(`menu.group.types.${N.label.toLowerCase()}`),
3682
+ label: p(M)(`menu.group.types.${N.label.toLowerCase()}`),
3683
3683
  value: N.value
3684
3684
  }, null, 8, ["label", "value"]))), 128))
3685
3685
  ]),
@@ -3688,17 +3688,17 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3688
3688
  ]),
3689
3689
  _: 1
3690
3690
  }, 8, ["label"])) : te("", !0),
3691
- w(nt, {
3692
- label: p(k)("menu.common.labels.configuration")
3691
+ S(nt, {
3692
+ label: p(M)("menu.common.labels.configuration")
3693
3693
  }, {
3694
3694
  default: L(() => [
3695
- w(A, {
3696
- modelValue: y.group.stackable,
3697
- "onUpdate:modelValue": g[4] || (g[4] = (N) => y.group.stackable = N),
3695
+ S(R, {
3696
+ modelValue: b.group.stackable,
3697
+ "onUpdate:modelValue": _[4] || (_[4] = (N) => b.group.stackable = N),
3698
3698
  disabled: !d.value.link(),
3699
- label: p(k)("menu.common.labels.stackable"),
3699
+ label: p(M)("menu.common.labels.stackable"),
3700
3700
  "label-placement": "right",
3701
- sublabel: p(k)("menu.common.labels.stackable_sublabel")
3701
+ sublabel: p(M)("menu.common.labels.stackable_sublabel")
3702
3702
  }, null, 8, ["modelValue", "disabled", "label", "sublabel"])
3703
3703
  ]),
3704
3704
  _: 1
@@ -3706,23 +3706,23 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3706
3706
  ]),
3707
3707
  _: 1
3708
3708
  }),
3709
- w(M, {
3709
+ S(k, {
3710
3710
  tag: "div",
3711
- modelValue: y.group,
3712
- rules: [S],
3713
- "helper-text": p(k)("menu.common.validation.default_items_tip", {
3714
- count: f(y.group),
3715
- max: y.group.max
3711
+ modelValue: b.group,
3712
+ rules: [C],
3713
+ "helper-text": p(M)("menu.common.validation.default_items_tip", {
3714
+ count: f(b.group),
3715
+ max: b.group.max
3716
3716
  })
3717
3717
  }, {
3718
3718
  default: L(() => [
3719
- w(Qa, {
3720
- "allow-refund-inventory": y.allowRefundInventory ?? !1,
3721
- "categorized-items": y.categorizedItems,
3719
+ S(Qa, {
3720
+ "allow-refund-inventory": b.allowRefundInventory ?? !1,
3721
+ "categorized-items": b.categorizedItems,
3722
3722
  config: d.value,
3723
- group: y.group,
3724
- "onUpdate:group": g[5] || (g[5] = (N) => m(N)),
3725
- "onUpdate:unmapGroup": g[6] || (g[6] = (N) => m(v(N)))
3723
+ group: b.group,
3724
+ "onUpdate:group": _[5] || (_[5] = (N) => m(N)),
3725
+ "onUpdate:unmapGroup": _[6] || (_[6] = (N) => m(g(N)))
3726
3726
  }, null, 8, ["allow-refund-inventory", "categorized-items", "config", "group"])
3727
3727
  ]),
3728
3728
  _: 1
@@ -3745,60 +3745,60 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3745
3745
  setup(e, { expose: i, emit: t }) {
3746
3746
  var j, D;
3747
3747
  const n = e, a = t, o = fe(), r = Be(), l = Xe(He(De())), s = J([]), u = J(n.combinations[0].combinationKey || ""), c = F(
3748
- () => s.value.findIndex((k) => k.combinationKey == u.value)
3748
+ () => s.value.findIndex((M) => M.combinationKey == u.value)
3749
3749
  ), d = F(
3750
- () => n.combinations.map((k) => ({
3751
- label: n.fullCombinations[k.combinationKey || ""],
3752
- value: k.combinationKey || ""
3750
+ () => n.combinations.map((M) => ({
3751
+ label: n.fullCombinations[M.combinationKey || ""],
3752
+ value: M.combinationKey || ""
3753
3753
  }))
3754
3754
  ), h = F(() => {
3755
- var M, R;
3756
- if (!S.value) return null;
3757
- const k = ((R = (M = s.value[c.value]) == null ? void 0 : M.groups) == null ? void 0 : R.find(
3758
- (_) => _._id === n.groupId
3755
+ var k, x;
3756
+ if (!C.value) return null;
3757
+ const M = ((x = (k = s.value[c.value]) == null ? void 0 : k.groups) == null ? void 0 : x.find(
3758
+ (w) => w._id === n.groupId
3759
3759
  )) || {
3760
3760
  _id: n.groupId,
3761
3761
  groupKey: ""
3762
- }, g = o.state.menu.modules.group.find((_) => _._id === n.groupId), C = Object.entries({ ...k, items: void 0 }).filter(([, _]) => !!_), x = {
3763
- ...g,
3764
- ...Object.fromEntries(C),
3765
- items: g.items.map((_) => {
3762
+ }, _ = o.state.menu.modules.group.find((w) => w._id === n.groupId), A = Object.entries({ ...M, items: void 0 }).filter(([, w]) => !!w), y = {
3763
+ ..._,
3764
+ ...Object.fromEntries(A),
3765
+ items: _.items.map((w) => {
3766
3766
  var U;
3767
- const A = (U = k.items) == null ? void 0 : U.find(
3768
- (V) => V._id == _._id && V.combinationKey == _.combinationKey
3767
+ const R = (U = M.items) == null ? void 0 : U.find(
3768
+ (V) => V._id == w._id && V.combinationKey == w.combinationKey
3769
3769
  );
3770
3770
  return {
3771
- ..._,
3772
- ...A ?? {},
3773
- price: (A == null ? void 0 : A.price) || null,
3774
- inventoryBindings: (A == null ? void 0 : A.inventoryBindings) || null
3771
+ ...w,
3772
+ ...R ?? {},
3773
+ price: (R == null ? void 0 : R.price) || null,
3774
+ inventoryBindings: (R == null ? void 0 : R.inventoryBindings) || null
3775
3775
  };
3776
3776
  })
3777
3777
  };
3778
- return new Wi(o, l.updateMenu, r).mapGroups([x], !0)[0];
3778
+ return new Wi(o, l.updateMenu, r).mapGroups([y], !0)[0];
3779
3779
  });
3780
- function m(k) {
3781
- var x, M;
3782
- const y = (x = s.value[c.value].groups) == null ? void 0 : x.findIndex(
3783
- (R) => R._id === n.groupId
3784
- ), g = ne(s.value), C = { ...ei(k), _id: n.groupId, groupKey: "" };
3785
- (y ?? -1) < 0 ? g[c.value] = {
3786
- ...g[c.value],
3787
- groups: [...((M = g[c.value]) == null ? void 0 : M.groups) || [], C]
3788
- } : g[c.value].groups[y] = C, s.value = g;
3780
+ function m(M) {
3781
+ var y, k;
3782
+ const b = (y = s.value[c.value].groups) == null ? void 0 : y.findIndex(
3783
+ (x) => x._id === n.groupId
3784
+ ), _ = ne(s.value), A = { ...ei(M), _id: n.groupId, groupKey: "" };
3785
+ (b ?? -1) < 0 ? _[c.value] = {
3786
+ ..._[c.value],
3787
+ groups: [...((k = _[c.value]) == null ? void 0 : k.groups) || [], A]
3788
+ } : _[c.value].groups[b] = A, s.value = _;
3789
3789
  }
3790
- function b(k) {
3791
- const y = d.value.length;
3792
- let g = c.value;
3793
- k === "left" ? g = g === 0 ? y - 1 : g - 1 : g = g === y - 1 ? 0 : g + 1, u.value = d.value[g].value;
3790
+ function v(M) {
3791
+ const b = d.value.length;
3792
+ let _ = c.value;
3793
+ M === "left" ? _ = _ === 0 ? b - 1 : _ - 1 : _ = _ === b - 1 ? 0 : _ + 1, u.value = d.value[_].value;
3794
3794
  }
3795
- function v(k) {
3795
+ function g(M) {
3796
3796
  return {
3797
3797
  isV4: o.version === B.F_MENU_VERSION.enum.v4,
3798
- isDefault: (y) => !1,
3799
- link: (y) => !1,
3800
- orderFrom: (y) => !0,
3801
- name: (y) => !1,
3798
+ isDefault: (b) => !1,
3799
+ link: (b) => !1,
3800
+ orderFrom: (b) => !0,
3801
+ name: (b) => !1,
3802
3802
  bindToVariant: !1,
3803
3803
  inventory: !0,
3804
3804
  orderFromActiveOnly: o.rules.item.orderFromActiveOnly,
@@ -3812,11 +3812,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3812
3812
  function f() {
3813
3813
  a("update:combinations", s.value);
3814
3814
  }
3815
- const S = J(!1);
3815
+ const C = J(!1);
3816
3816
  Re(
3817
- () => S.value,
3818
- (k) => {
3819
- k && (s.value = ne(n.combinations), u.value = n.combinations[0].combinationKey || "");
3817
+ () => C.value,
3818
+ (M) => {
3819
+ M && (s.value = ne(n.combinations), u.value = n.combinations[0].combinationKey || "");
3820
3820
  }
3821
3821
  );
3822
3822
  const z = J();
@@ -3825,26 +3825,26 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3825
3825
  trigger: (D = z.value) == null ? void 0 : D.trigger
3826
3826
  });
3827
3827
  const { t: E } = me();
3828
- return (k, y) => {
3829
- const g = G("fm-select"), C = G("fm-button"), x = G("fm-card");
3828
+ return (M, b) => {
3829
+ const _ = G("fm-select"), A = G("fm-button"), y = G("fm-card");
3830
3830
  return O(), Y(fn, {
3831
3831
  ref_key: "sheet",
3832
3832
  ref: z,
3833
3833
  "allow-refund-inventory": !0,
3834
3834
  "categorized-items": p(o).categorizedItems,
3835
- config: v,
3835
+ config: g,
3836
3836
  group: h.value,
3837
3837
  action: "update",
3838
3838
  title: p(E)("menu.group.update"),
3839
- "onUpdate:group": y[3] || (y[3] = (M) => m(M)),
3840
- "onSubmit:group": y[4] || (y[4] = (M) => f()),
3841
- "onStatus:show": y[5] || (y[5] = (M) => S.value = M)
3839
+ "onUpdate:group": b[3] || (b[3] = (k) => m(k)),
3840
+ "onSubmit:group": b[4] || (b[4] = (k) => f()),
3841
+ "onStatus:show": b[5] || (b[5] = (k) => C.value = k)
3842
3842
  }, {
3843
- default: L(({ trigger: M }) => [
3844
- ve(k.$slots, "default", { trigger: M })
3843
+ default: L(({ trigger: k }) => [
3844
+ ve(M.$slots, "default", { trigger: k })
3845
3845
  ]),
3846
3846
  "variant-section": L(() => [
3847
- u.value ? (O(), Y(x, {
3847
+ u.value ? (O(), Y(y, {
3848
3848
  key: 0,
3849
3849
  class: "p-16 bg-fm-color-neutral-gray-100 space-y-24",
3850
3850
  variant: "outlined"
@@ -3852,24 +3852,24 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3852
3852
  default: L(() => [
3853
3853
  P("p", nr, de(p(E)("menu.group.option.variant")), 1),
3854
3854
  P("div", or, [
3855
- w(g, {
3855
+ S(_, {
3856
3856
  modelValue: u.value,
3857
- "onUpdate:modelValue": y[0] || (y[0] = (M) => u.value = M),
3857
+ "onUpdate:modelValue": b[0] || (b[0] = (k) => u.value = k),
3858
3858
  items: d.value,
3859
3859
  class: "flex-1"
3860
3860
  }, null, 8, ["modelValue", "items"]),
3861
3861
  P("div", ar, [
3862
- w(C, {
3862
+ S(A, {
3863
3863
  variant: p(qe).Tertiary,
3864
3864
  "prepend-icon": "keyboard_arrow_left",
3865
3865
  size: "lg",
3866
- onClick: y[1] || (y[1] = (M) => b("left"))
3866
+ onClick: b[1] || (b[1] = (k) => v("left"))
3867
3867
  }, null, 8, ["variant"]),
3868
- w(C, {
3868
+ S(A, {
3869
3869
  variant: p(qe).Tertiary,
3870
3870
  "prepend-icon": "keyboard_arrow_right",
3871
3871
  size: "lg",
3872
- onClick: y[2] || (y[2] = (M) => b("right"))
3872
+ onClick: b[2] || (b[2] = (k) => v("right"))
3873
3873
  }, null, 8, ["variant"])
3874
3874
  ])
3875
3875
  ])
@@ -3906,18 +3906,18 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3906
3906
  value: z
3907
3907
  }))
3908
3908
  ]), d = F(() => !!o.state.currentCatalogId || !!o.state.currentSchedulerId), h = F(() => {
3909
- const z = !o.state.currentSchedulerId, E = o.rules.group.type, j = o.version == B.F_MENU_VERSION.enum.v3, D = o.rules.item.orderFromActiveOnly, k = o.rules.item.bindToVariant;
3910
- return function(g) {
3909
+ const z = !o.state.currentSchedulerId, E = o.rules.group.type, j = o.version == B.F_MENU_VERSION.enum.v3, D = o.rules.item.orderFromActiveOnly, M = o.rules.item.bindToVariant;
3910
+ return function(_) {
3911
3911
  return {
3912
- link: (C) => !d.value && (!C || k),
3913
- name: (C) => !d.value && !C,
3914
- type: E && !g._id && !d.value,
3915
- price: g.type != B.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
3916
- inventory: z ? j ? !d.value && g.type == B.F_ADDON_GROUP_TYPE.enum.NORMAL : !d.value : !1,
3917
- orderFrom: (C) => z ? j ? g.type == B.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? d.value : !!d.value == !C : d.value : !1,
3912
+ link: (A) => !d.value && (!A || M),
3913
+ name: (A) => !d.value && !A,
3914
+ type: E && !_._id && !d.value,
3915
+ price: _.type != B.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
3916
+ inventory: z ? j ? !d.value && _.type == B.F_ADDON_GROUP_TYPE.enum.NORMAL : !d.value : !1,
3917
+ orderFrom: (A) => z ? j ? _.type == B.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? d.value : !!d.value == !A : d.value : !1,
3918
3918
  orderFromActiveOnly: D,
3919
- showOrderFrom: z ? j ? d.value ? !0 : g.type == B.F_ADDON_GROUP_TYPE.enum.PRODUCT : d.value : !1,
3920
- bindToVariant: k,
3919
+ showOrderFrom: z ? j ? d.value ? !0 : _.type == B.F_ADDON_GROUP_TYPE.enum.PRODUCT : d.value : !1,
3920
+ bindToVariant: M,
3921
3921
  isOverride: d.value,
3922
3922
  isItemGroup: !1,
3923
3923
  isV4: !j
@@ -3929,60 +3929,60 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3929
3929
  items: {},
3930
3930
  position: o.groups.length - 1,
3931
3931
  itemsLinked: []
3932
- })), b = J(ne(i.groupIds || [])), v = J(""), { t: f } = me(), S = () => {
3933
- n(b.value), a("primary"), t.close();
3932
+ })), v = J(ne(i.groupIds || [])), g = J(""), { t: f } = me(), C = () => {
3933
+ n(v.value), a("primary"), t.close();
3934
3934
  };
3935
3935
  return (z, E) => {
3936
- const j = G("FmSearch"), D = G("FmCheckbox"), k = G("FmButton");
3936
+ const j = G("FmSearch"), D = G("FmCheckbox"), M = G("FmButton");
3937
3937
  return c.value.length > 0 ? (O(), Q("div", ur, [
3938
3938
  P("div", null, [
3939
- w(j, {
3939
+ S(j, {
3940
3940
  autofocus: "",
3941
- modelValue: v.value,
3942
- "onUpdate:modelValue": E[0] || (E[0] = (y) => v.value = y),
3941
+ modelValue: g.value,
3942
+ "onUpdate:modelValue": E[0] || (E[0] = (b) => g.value = b),
3943
3943
  placeholder: p(f)("menu.common.labels.search_groups")
3944
3944
  }, null, 8, ["modelValue", "placeholder"])
3945
3945
  ]),
3946
3946
  P("div", cr, [
3947
3947
  P("div", null, [
3948
- (O(!0), Q(ke, null, Ye(c.value, (y) => (O(), Q("div", {
3949
- key: y.value
3948
+ (O(!0), Q(Me, null, Ye(c.value, (b) => (O(), Q("div", {
3949
+ key: b.value
3950
3950
  }, [
3951
- Qe(w(D, {
3952
- modelValue: b.value,
3951
+ Qe(S(D, {
3952
+ modelValue: v.value,
3953
3953
  "onUpdate:modelValue": [
3954
- E[1] || (E[1] = (g) => b.value = g),
3955
- E[2] || (E[2] = (g) => p(n)(b.value))
3954
+ E[1] || (E[1] = (_) => v.value = _),
3955
+ E[2] || (E[2] = (_) => p(n)(v.value))
3956
3956
  ],
3957
- label: y.label,
3958
- value: y.value
3957
+ label: b.label,
3958
+ value: b.value
3959
3959
  }, null, 8, ["modelValue", "label", "value"]), [
3960
- [At, y.label.toLowerCase().includes(v.value.toLowerCase())]
3960
+ [At, b.label.toLowerCase().includes(g.value.toLowerCase())]
3961
3961
  ])
3962
3962
  ]))), 128))
3963
3963
  ])
3964
3964
  ]),
3965
3965
  P("div", dr, [
3966
- w(p(Di), null, {
3967
- default: L(({ trigger: y }) => [
3968
- w(k, {
3966
+ S(p(Di), null, {
3967
+ default: L(({ trigger: b }) => [
3968
+ S(M, {
3969
3969
  label: p(f)("menu.common.actions.add_group"),
3970
3970
  variant: "tertiary",
3971
3971
  "text-color": "primary",
3972
- onClick: (g) => y()
3972
+ onClick: (_) => b()
3973
3973
  }, null, 8, ["label", "onClick"])
3974
3974
  ]),
3975
3975
  _: 1
3976
3976
  }),
3977
3977
  P("div", mr, [
3978
- w(k, {
3978
+ S(M, {
3979
3979
  label: p(f)("menu.common.actions.cancel"),
3980
3980
  variant: "tertiary",
3981
- onClick: E[3] || (E[3] = (y) => p(t).close())
3981
+ onClick: E[3] || (E[3] = (b) => p(t).close())
3982
3982
  }, null, 8, ["label"]),
3983
- w(k, {
3983
+ S(M, {
3984
3984
  label: p(f)("menu.common.actions.confirm"),
3985
- onClick: E[4] || (E[4] = (y) => S())
3985
+ onClick: E[4] || (E[4] = (b) => C())
3986
3986
  }, null, 8, ["label"])
3987
3987
  ])
3988
3988
  ])
@@ -3991,18 +3991,18 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
3991
3991
  P("p", fr, de(p(f)("menu.common.empty.no_group.title")), 1),
3992
3992
  P("p", gr, de(p(f)("menu.common.empty.no_group.subtitle")), 1)
3993
3993
  ]),
3994
- w(p(Di), {
3994
+ S(p(Di), {
3995
3995
  "categorized-items": p(o).categorizedItems,
3996
3996
  config: h.value,
3997
3997
  group: m.value,
3998
3998
  action: "add",
3999
3999
  title: p(f)("menu.group.add")
4000
4000
  }, {
4001
- default: L(({ trigger: y }) => [
4002
- w(k, {
4001
+ default: L(({ trigger: b }) => [
4002
+ S(M, {
4003
4003
  label: p(f)("menu.common.actions.add_group"),
4004
4004
  icon: "add",
4005
- onClick: (g) => y()
4005
+ onClick: (_) => b()
4006
4006
  }, null, 8, ["label", "onClick"])
4007
4007
  ]),
4008
4008
  _: 1
@@ -4031,9 +4031,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4031
4031
  t: r
4032
4032
  } = me(), l = i, s = F(() => n.rules.group), u = F(() => n.rules.item), c = F(() => n.groups);
4033
4033
  Xe(He(De())), J(!1);
4034
- function d(R, _) {
4035
- return ne(_ ?? []).map((U) => {
4036
- const V = R.find((N) => N._id === U._id);
4034
+ function d(x, w) {
4035
+ return ne(w ?? []).map((U) => {
4036
+ const V = x.find((N) => N._id === U._id);
4037
4037
  return {
4038
4038
  name: (V == null ? void 0 : V.name) ?? "",
4039
4039
  ...U,
@@ -4042,81 +4042,81 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4042
4042
  });
4043
4043
  }
4044
4044
  const h = F(() => {
4045
- var _;
4046
- return [...m(d(c.value, t.form.groups || ((_ = t.fallback) == null ? void 0 : _.groups) || [])).map((A) => A._id)];
4045
+ var w;
4046
+ return [...m(d(c.value, t.form.groups || ((w = t.fallback) == null ? void 0 : w.groups) || [])).map((R) => R._id)];
4047
4047
  });
4048
- function m(R) {
4049
- return ne(R ?? []).sort((A, U) => A.position - U.position);
4048
+ function m(x) {
4049
+ return ne(x ?? []).sort((R, U) => R.position - U.position);
4050
4050
  }
4051
- function b(R) {
4052
- const _ = c.value.find((V) => V._id === R);
4053
- if (!_)
4051
+ function v(x) {
4052
+ const w = c.value.find((V) => V._id === x);
4053
+ if (!w)
4054
4054
  return [];
4055
- const A = [];
4056
- return _.items.forEach((V) => {
4055
+ const R = [];
4056
+ return w.items.forEach((V) => {
4057
4057
  if (V.combinationKey)
4058
4058
  return;
4059
- const N = n.items.find((re) => re._id === V._id), q = _.items.filter((re) => re._id === V._id && re.combinationKey).length;
4060
- A.push({
4059
+ const N = n.items.find((re) => re._id === V._id), q = w.items.filter((re) => re._id === V._id && re.combinationKey).length;
4060
+ R.push({
4061
4061
  code: V.code || (N == null ? void 0 : N.code),
4062
4062
  name: V.name || (N == null ? void 0 : N.name),
4063
4063
  variantCount: q
4064
4064
  });
4065
- }), A.map((V) => {
4065
+ }), R.map((V) => {
4066
4066
  const N = [(V == null ? void 0 : V.code) || "", (V == null ? void 0 : V.name) || ""].join(" ").trim();
4067
4067
  return (V.variantCount || 0) > 1 ? `${N} (${r("menu.group.list.variants", {
4068
4068
  count: V.variantCount
4069
4069
  })})` : N;
4070
4070
  });
4071
4071
  }
4072
- const v = F(() => m(c.value).reduce((R, _) => (R[_._id] = {
4073
- name: _.name,
4074
- type: xt(n.items, _.items)
4075
- }, R), {})), f = F(() => [...Object.entries(v.value).map(([R, {
4076
- name: _,
4077
- type: A
4072
+ const g = F(() => m(c.value).reduce((x, w) => (x[w._id] = {
4073
+ name: w.name,
4074
+ type: xt(n.items, w.items)
4075
+ }, x), {})), f = F(() => [...Object.entries(g.value).map(([x, {
4076
+ name: w,
4077
+ type: R
4078
4078
  }]) => ({
4079
- label: `${_} ${s.value.type ? `(${Lt(A)})` : ""}`.trim(),
4080
- value: R
4081
- }))]), S = F(() => [{
4079
+ label: `${w} ${s.value.type ? `(${Lt(R)})` : ""}`.trim(),
4080
+ value: x
4081
+ }))]), C = F(() => [{
4082
4082
  accessorKey: "name",
4083
4083
  header: () => r("menu.product.form.group.columns.title"),
4084
4084
  enableSorting: !1,
4085
- cell: (R) => {
4086
- const _ = R.row.original._id;
4087
- return x(_);
4085
+ cell: (x) => {
4086
+ const w = x.row.original._id;
4087
+ return y(w);
4088
4088
  }
4089
4089
  }, {
4090
4090
  id: "type",
4091
4091
  accessorKey: "type",
4092
4092
  header: () => r("menu.product.form.group.columns.type"),
4093
4093
  enableSorting: !1,
4094
- cell: (R) => {
4095
- var A;
4096
- const _ = R.row.original._id;
4097
- return Lt((A = v.value[_]) == null ? void 0 : A.type);
4094
+ cell: (x) => {
4095
+ var R;
4096
+ const w = x.row.original._id;
4097
+ return Lt((R = g.value[w]) == null ? void 0 : R.type);
4098
4098
  }
4099
4099
  }, {
4100
4100
  accessorKey: "items",
4101
4101
  header: () => r("menu.group.list.columns.products"),
4102
4102
  enableSorting: !1,
4103
4103
  size: 200,
4104
- cell: (R) => {
4105
- const _ = R.row.original._id, U = b(_).join(", ");
4106
- return w(xe.FmTooltip, {
4104
+ cell: (x) => {
4105
+ const w = x.row.original._id, U = v(w).join(", ");
4106
+ return S(xe.FmTooltip, {
4107
4107
  "z-index": 51,
4108
4108
  class: "flex",
4109
4109
  variant: "rich",
4110
4110
  placement: "top"
4111
4111
  }, {
4112
- default: () => w("div", {
4112
+ default: () => S("div", {
4113
4113
  class: "line-clamp-2 break-all"
4114
4114
  }, [U]),
4115
- content: () => w("div", {
4115
+ content: () => S("div", {
4116
4116
  class: "py-12 px-16 space-y-12"
4117
- }, [w("p", {
4117
+ }, [S("p", {
4118
4118
  class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-600"
4119
- }, [r("menu.group.list.columns.products")]), w("div", {
4119
+ }, [r("menu.group.list.columns.products")]), S("div", {
4120
4120
  class: "flex flex-wrap gap-8"
4121
4121
  }, [U])])
4122
4122
  });
@@ -4126,8 +4126,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4126
4126
  header: "",
4127
4127
  size: 52,
4128
4128
  enableSorting: !1,
4129
- cell: (R) => {
4130
- const _ = R.row.original._id;
4129
+ cell: (x) => {
4130
+ const w = x.row.original._id;
4131
4131
  return he("div", {
4132
4132
  class: "flex justify-end"
4133
4133
  }, [he(xe.FmButton, {
@@ -4135,22 +4135,22 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4135
4135
  variant: "tertiary",
4136
4136
  textColor: "neutral-gray-400",
4137
4137
  onClick: Rt(async () => {
4138
- D(_);
4138
+ D(w);
4139
4139
  }, ["stop", "prevent"])
4140
4140
  }), he(lr, {
4141
- combinations: y.value ?? [],
4141
+ combinations: b.value ?? [],
4142
4142
  fullCombinations: t.fullCombinations,
4143
- groupId: _,
4144
- "onUpdate:combinations": M
4143
+ groupId: w,
4144
+ "onUpdate:combinations": k
4145
4145
  }, {
4146
4146
  default: ({
4147
- trigger: A
4147
+ trigger: R
4148
4148
  }) => he(xe.FmButton, {
4149
4149
  icon: "edit",
4150
4150
  variant: "tertiary",
4151
- disabled: !g(_),
4151
+ disabled: !_(w),
4152
4152
  textColor: "neutral-gray-400",
4153
- onClick: A
4153
+ onClick: R
4154
4154
  })
4155
4155
  })]);
4156
4156
  }
@@ -4164,48 +4164,48 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4164
4164
  contentComponentProps: {
4165
4165
  groupIds: h.value
4166
4166
  }
4167
- }).onPrimary((R) => {
4168
- j(R);
4167
+ }).onPrimary((x) => {
4168
+ j(x);
4169
4169
  });
4170
4170
  }
4171
- function j(R) {
4172
- const _ = R.reduce((A, U) => {
4171
+ function j(x) {
4172
+ const w = x.reduce((R, U) => {
4173
4173
  var N;
4174
4174
  const V = ((N = t.form.groups) == null ? void 0 : N.find((q) => q._id === U)) || {
4175
4175
  _id: U,
4176
4176
  groupKey: ""
4177
4177
  };
4178
- return A.push(V), A;
4178
+ return R.push(V), R;
4179
4179
  }, []);
4180
4180
  l("replace:form", a.initDynamicGroupItem({
4181
4181
  ...t.form,
4182
- groups: _
4182
+ groups: w
4183
4183
  }));
4184
4184
  }
4185
- function D(R) {
4186
- var A;
4187
- const _ = ((A = t.form.groups) == null ? void 0 : A.filter((U) => U._id !== R)) || [];
4185
+ function D(x) {
4186
+ var R;
4187
+ const w = ((R = t.form.groups) == null ? void 0 : R.filter((U) => U._id !== x)) || [];
4188
4188
  l("replace:form", a.initDynamicGroupItem({
4189
4189
  ...t.form,
4190
- groups: _
4190
+ groups: w
4191
4191
  }));
4192
4192
  }
4193
- const k = F(() => {
4194
- var R;
4195
- return !!((R = t.form.variant) != null && R.variantGroupIds.length);
4196
- }), y = F(() => {
4197
- var R;
4198
- return k.value ? (R = t.form.variant) == null ? void 0 : R.variantCombinations : [{
4193
+ const M = F(() => {
4194
+ var x;
4195
+ return !!((x = t.form.variant) != null && x.variantGroupIds.length);
4196
+ }), b = F(() => {
4197
+ var x;
4198
+ return M.value ? (x = t.form.variant) == null ? void 0 : x.variantCombinations : [{
4199
4199
  _id: t.form._id,
4200
4200
  combinationKey: "",
4201
4201
  groups: t.form.groups || []
4202
4202
  }];
4203
4203
  });
4204
- function g(R) {
4205
- var A;
4206
- if (!R) return !1;
4204
+ function _(x) {
4205
+ var R;
4206
+ if (!x) return !1;
4207
4207
  if (u.value.overrideProductGroup) return !0;
4208
- switch ((A = v.value[R]) == null ? void 0 : A.type) {
4208
+ switch ((R = g.value[x]) == null ? void 0 : R.type) {
4209
4209
  case B.F_ADDON_GROUP_TYPE.enum.DYNAMIC:
4210
4210
  return !0;
4211
4211
  case B.F_ADDON_GROUP_TYPE.enum.PRODUCT:
@@ -4223,56 +4223,56 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4223
4223
  position: n.groups.length - 1,
4224
4224
  itemsLinked: []
4225
4225
  }));
4226
- const C = F(() => !!n.state.currentCatalogId || !!n.state.currentSchedulerId);
4226
+ const A = F(() => !!n.state.currentCatalogId || !!n.state.currentSchedulerId);
4227
4227
  F(() => {
4228
- const R = !n.state.currentSchedulerId, _ = n.rules.group.type, A = n.version == B.F_MENU_VERSION.enum.v3, U = n.rules.item.orderFromActiveOnly, V = n.rules.item.bindToVariant;
4228
+ const x = !n.state.currentSchedulerId, w = n.rules.group.type, R = n.version == B.F_MENU_VERSION.enum.v3, U = n.rules.item.orderFromActiveOnly, V = n.rules.item.bindToVariant;
4229
4229
  return function(q) {
4230
4230
  return {
4231
- link: (re) => !C.value && (!re || V),
4232
- name: (re) => !C.value && !re,
4233
- isDefault: (re) => !C.value,
4234
- type: _ && !q._id && !C.value,
4231
+ link: (re) => !A.value && (!re || V),
4232
+ name: (re) => !A.value && !re,
4233
+ isDefault: (re) => !A.value,
4234
+ type: w && !q._id && !A.value,
4235
4235
  price: q.type != B.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
4236
- inventory: R ? A ? !C.value && q.type == B.F_ADDON_GROUP_TYPE.enum.NORMAL : !C.value : !1,
4237
- orderFrom: (re) => R ? A ? q.type == B.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? C.value : !!C.value == !re : C.value : !1,
4236
+ inventory: x ? R ? !A.value && q.type == B.F_ADDON_GROUP_TYPE.enum.NORMAL : !A.value : !1,
4237
+ orderFrom: (re) => x ? R ? q.type == B.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? A.value : !!A.value == !re : A.value : !1,
4238
4238
  orderFromActiveOnly: U,
4239
- showOrderFrom: R ? A ? C.value ? !0 : q.type == B.F_ADDON_GROUP_TYPE.enum.PRODUCT : C.value : !1,
4239
+ showOrderFrom: x ? R ? A.value ? !0 : q.type == B.F_ADDON_GROUP_TYPE.enum.PRODUCT : A.value : !1,
4240
4240
  bindToVariant: V,
4241
- isOverride: C.value,
4241
+ isOverride: A.value,
4242
4242
  isItemGroup: !1,
4243
- isV4: !A
4243
+ isV4: !R
4244
4244
  };
4245
4245
  };
4246
4246
  });
4247
- const x = (R) => {
4248
- var _;
4249
- return (_ = f.value.find((A) => A.value === R)) == null ? void 0 : _.label;
4250
- }, M = (R) => {
4251
- var _;
4252
- k.value ? l("update:form", "variant", {
4253
- variantGroupIds: ((_ = t.form.variant) == null ? void 0 : _.variantGroupIds) || [],
4254
- variantCombinations: R
4255
- }) : l("update:form", "groups", R[0].groups || []);
4247
+ const y = (x) => {
4248
+ var w;
4249
+ return (w = f.value.find((R) => R.value === x)) == null ? void 0 : w.label;
4250
+ }, k = (x) => {
4251
+ var w;
4252
+ M.value ? l("update:form", "variant", {
4253
+ variantGroupIds: ((w = t.form.variant) == null ? void 0 : w.variantGroupIds) || [],
4254
+ variantCombinations: x
4255
+ }) : l("update:form", "groups", x[0].groups || []);
4256
4256
  };
4257
- return (R, _) => {
4258
- const A = G("FmButton"), U = G("FmTable");
4257
+ return (x, w) => {
4258
+ const R = G("FmButton"), U = G("FmTable");
4259
4259
  return O(), Y(Ke, {
4260
4260
  title: p(r)("menu.product.form.group.title"),
4261
4261
  "sub-title": p(r)("menu.product.form.group.subtitle")
4262
4262
  }, {
4263
- "append-title": L(() => [w(A, {
4263
+ "append-title": L(() => [S(R, {
4264
4264
  class: "flex-shrink-0",
4265
4265
  label: p(r)("menu.product.form.group.add"),
4266
4266
  "prepend-icon": "add",
4267
4267
  variant: "secondary",
4268
4268
  onClick: E
4269
4269
  }, null, 8, ["label"])]),
4270
- default: L(() => [w(pn, null, {
4270
+ default: L(() => [S(pn, null, {
4271
4271
  default: L(() => {
4272
4272
  var V;
4273
4273
  return [((V = h.value) == null ? void 0 : V.length) > 0 ? (O(), Y(U, {
4274
4274
  key: 0,
4275
- "column-defs": S.value,
4275
+ "column-defs": C.value,
4276
4276
  "column-visibility": z.value,
4277
4277
  "row-data": h.value.map((N) => ({
4278
4278
  _id: N
@@ -4313,11 +4313,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4313
4313
  const {
4314
4314
  t
4315
4315
  } = me(), n = e, a = i, o = fe(), r = F(() => o.rules.item), l = F(() => r.value.inventory);
4316
- function s(v, f, S, z) {
4316
+ function s(g, f, C, z) {
4317
4317
  return !f || f && f.length === 0 ? [{
4318
4318
  _id: "",
4319
- name: S,
4320
- binding: v || []
4319
+ name: C,
4320
+ binding: g || []
4321
4321
  }] : f.map((E) => ({
4322
4322
  _id: E.combinationKey || "",
4323
4323
  name: Yi(E.combinationKey || "", z),
@@ -4325,33 +4325,33 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4325
4325
  }));
4326
4326
  }
4327
4327
  const u = F(() => {
4328
- var v;
4329
- return n.form.name || ((v = n.fallback) == null ? void 0 : v.name) || "";
4328
+ var g;
4329
+ return n.form.name || ((g = n.fallback) == null ? void 0 : g.name) || "";
4330
4330
  }), c = F(() => {
4331
- var v;
4332
- return s(n.form.inventoryBindings || [], ((v = n.form.variant) == null ? void 0 : v.variantCombinations) || [], u.value, o.variants);
4331
+ var g;
4332
+ return s(n.form.inventoryBindings || [], ((g = n.form.variant) == null ? void 0 : g.variantCombinations) || [], u.value, o.variants);
4333
4333
  });
4334
- function d(v, f) {
4334
+ function d(g, f) {
4335
4335
  var j, D;
4336
- let S = $e.clone(n.form);
4337
- const z = S.variant;
4336
+ let C = $e.clone(n.form);
4337
+ const z = C.variant;
4338
4338
  if ((((j = z == null ? void 0 : z.variantCombinations) == null ? void 0 : j.length) ?? 0) > 0 && z) {
4339
- const k = z.variantCombinations.findIndex((g) => g.combinationKey === v);
4340
- if (k < 0) return;
4341
- const y = $e.clone(z.variantCombinations);
4342
- y[k].inventoryBindings = f, S = {
4343
- ...S,
4339
+ const M = z.variantCombinations.findIndex((_) => _.combinationKey === g);
4340
+ if (M < 0) return;
4341
+ const b = $e.clone(z.variantCombinations);
4342
+ b[M].inventoryBindings = f, C = {
4343
+ ...C,
4344
4344
  variant: {
4345
- variantGroupIds: ((D = S.variant) == null ? void 0 : D.variantGroupIds) || [],
4346
- variantCombinations: y
4345
+ variantGroupIds: ((D = C.variant) == null ? void 0 : D.variantGroupIds) || [],
4346
+ variantCombinations: b
4347
4347
  }
4348
4348
  };
4349
4349
  } else
4350
- S = {
4351
- ...S,
4350
+ C = {
4351
+ ...C,
4352
4352
  inventoryBindings: f
4353
4353
  };
4354
- a("replace:form", S);
4354
+ a("replace:form", C);
4355
4355
  }
4356
4356
  J([{
4357
4357
  accessorKey: "name",
@@ -4361,8 +4361,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4361
4361
  accessorKey: "_skuLinked",
4362
4362
  header: () => t("menu.inventory.columns.ingredient"),
4363
4363
  enableSorting: !1,
4364
- cell: (v) => {
4365
- const f = v.getValue();
4364
+ cell: (g) => {
4365
+ const f = g.getValue();
4366
4366
  return f ? t("menu.inventory.status.sku_linked", {
4367
4367
  count: f
4368
4368
  }) : t("menu.inventory.status.not_set");
@@ -4371,8 +4371,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4371
4371
  accessorKey: "_recipeLinked",
4372
4372
  header: () => t("menu.inventory.columns.recipe"),
4373
4373
  enableSorting: !1,
4374
- cell: (v) => {
4375
- const f = v.getValue();
4374
+ cell: (g) => {
4375
+ const f = g.getValue();
4376
4376
  return f ? t("menu.inventory.status.recipe_linked", {
4377
4377
  count: f
4378
4378
  }) : t("menu.inventory.status.not_set");
@@ -4381,59 +4381,59 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4381
4381
  id: "action",
4382
4382
  size: 52,
4383
4383
  enableSorting: !1,
4384
- cell: (v) => {
4385
- const f = v.row.original;
4386
- return l.value ? w("div", {
4384
+ cell: (g) => {
4385
+ const f = g.row.original;
4386
+ return l.value ? S("div", {
4387
4387
  class: "flex items-center justify-end"
4388
- }, [w(qt, {
4388
+ }, [S(qt, {
4389
4389
  name: f.name,
4390
4390
  initialValue: f.bindings ?? [],
4391
4391
  title: t("menu.inventory.dialog.title", {
4392
4392
  name: u.value
4393
4393
  }),
4394
- "onUpdate:inventory": (S) => {
4395
- d(f.key, S);
4394
+ "onUpdate:inventory": (C) => {
4395
+ d(f.key, C);
4396
4396
  }
4397
4397
  }, {
4398
4398
  default: ({
4399
- trigger: S
4400
- }) => w(G("fm-button"), {
4399
+ trigger: C
4400
+ }) => S(G("fm-button"), {
4401
4401
  variant: qe.Tertiary,
4402
4402
  prependIcon: "edit",
4403
4403
  textColor: je.NeutralGray400,
4404
- onClick: S
4404
+ onClick: C
4405
4405
  }, null)
4406
4406
  })]) : null;
4407
4407
  }
4408
4408
  }]);
4409
4409
  const h = J([]);
4410
4410
  async function m({
4411
- _id: v
4411
+ _id: g
4412
4412
  }) {
4413
4413
  for (const f of h.value)
4414
- f.getKey() === v && f.trigger(!0);
4414
+ f.getKey() === g && f.trigger(!0);
4415
4415
  }
4416
- const b = Ki();
4416
+ const v = Ki();
4417
4417
  return ut(() => {
4418
- b.readInventory();
4419
- }), (v, f) => (O(), Y(Ke, {
4418
+ v.readInventory();
4419
+ }), (g, f) => (O(), Y(Ke, {
4420
4420
  title: p(t)("menu.inventory.title"),
4421
4421
  subTitle: p(t)("menu.inventory.subtitle")
4422
4422
  }, {
4423
- default: L(() => [P("div", yr, [P("div", _r, [(O(!0), Q(ke, null, Ye(c.value, (S) => (O(), Y(p(qt), {
4423
+ default: L(() => [P("div", yr, [P("div", _r, [(O(!0), Q(Me, null, Ye(c.value, (C) => (O(), Y(p(qt), {
4424
4424
  ref_for: !0,
4425
4425
  ref_key: "inventoryManagerForms",
4426
4426
  ref: h,
4427
4427
  title: p(t)("menu.inventory.dialog.title", {
4428
4428
  name: u.value
4429
4429
  }),
4430
- name: S.name,
4431
- bindingKey: S._id,
4432
- initialValue: S.binding ?? [],
4430
+ name: C.name,
4431
+ bindingKey: C._id,
4432
+ initialValue: C.binding ?? [],
4433
4433
  "onUpdate:inventory": (z) => {
4434
- d(S._id, z);
4434
+ d(C._id, z);
4435
4435
  }
4436
- }, null, 8, ["title", "name", "bindingKey", "initialValue", "onUpdate:inventory"]))), 256)), w(p(Nn), {
4436
+ }, null, 8, ["title", "name", "bindingKey", "initialValue", "onUpdate:inventory"]))), 256)), S(p(Nn), {
4437
4437
  "row-data": c.value,
4438
4438
  onRowClick: m
4439
4439
  }, null, 8, ["row-data"])])])]),
@@ -4445,7 +4445,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4445
4445
  }, Cr = { class: "space-y-16" }, Ar = { class: "space-y-8" }, Rr = {
4446
4446
  key: 0,
4447
4447
  class: "pl-32 pb-4 space-x-16 flex items-center"
4448
- }, xr = { class: "fm-typo-en-body-lg-400" }, Mr = { class: "w-[258px]" }, kr = { class: "w-[117px]" }, Or = {
4448
+ }, xr = { class: "fm-typo-en-body-lg-400" }, kr = { class: "w-[258px]" }, Mr = { class: "w-[117px]" }, Or = {
4449
4449
  key: 0,
4450
4450
  class: "space-y-8"
4451
4451
  }, zr = {
@@ -4466,8 +4466,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4466
4466
  setup(e, { emit: i }) {
4467
4467
  const t = e, n = Zt(), a = fe(), { t: o } = me(), r = i, l = F(() => a.rules.item), s = F(() => {
4468
4468
  var z, E;
4469
- const f = t.isOverride ? ((z = t.fallback) == null ? void 0 : z.unit) ?? ((E = t.fallback) == null ? void 0 : E.perXUnit) : void 0, S = t.form.unit ?? t.form.perXUnit ?? f;
4470
- return S != null;
4469
+ const f = t.isOverride ? ((z = t.fallback) == null ? void 0 : z.unit) ?? ((E = t.fallback) == null ? void 0 : E.perXUnit) : void 0, C = t.form.unit ?? t.form.perXUnit ?? f;
4470
+ return C != null;
4471
4471
  }), u = (f) => {
4472
4472
  r("update:form", "unit", f ? "" : void 0), r("update:form", "perXUnit", f ? 0 : void 0);
4473
4473
  }, c = F(() => Et.setCoreStore(n).taxSetting()), d = F(() => {
@@ -4479,85 +4479,85 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4479
4479
  );
4480
4480
  });
4481
4481
  function h(f) {
4482
- const S = f.replace(/[^0-9.]/g, "");
4482
+ const C = f.replace(/[^0-9.]/g, "");
4483
4483
  if (!f) return !1;
4484
- r("update:form", "perXUnit", parseFloat(S));
4484
+ r("update:form", "perXUnit", parseFloat(C));
4485
4485
  }
4486
4486
  function m(f) {
4487
4487
  if (!f && t.form.perXUnit) {
4488
- const [S, z] = t.form.perXUnit.toString().split(".");
4488
+ const [C, z] = t.form.perXUnit.toString().split(".");
4489
4489
  if (z && z.length > 4) {
4490
4490
  const j = (typeof t.form.perXUnit == "string" ? parseFloat(t.form.perXUnit) : t.form.perXUnit).toFixed(4);
4491
4491
  r("update:form", "perXUnit", parseFloat(j));
4492
4492
  }
4493
4493
  }
4494
4494
  }
4495
- const b = J(!1);
4496
- async function v() {
4497
- var S, z, E, j, D, k, y, g;
4495
+ const v = J(!1);
4496
+ async function g() {
4497
+ var C, z, E, j, D, M, b, _;
4498
4498
  if (!(t.form.name || "")) {
4499
- const C = document.getElementById("product-name");
4500
- if (C) {
4501
- C.focus();
4499
+ const A = document.getElementById("product-name");
4500
+ if (A) {
4501
+ A.focus();
4502
4502
  return;
4503
4503
  } else
4504
4504
  return;
4505
4505
  }
4506
- if (!b.value)
4506
+ if (!v.value)
4507
4507
  try {
4508
- b.value = !0, Qt({ event: "menu_catalog_item_price_remy_suggest_pricing" }), Ne.toggleDialog(!0), Ne.registerOnSelect((C) => {
4509
- typeof C == "number" && r(
4508
+ v.value = !0, Qt({ event: "menu_catalog_item_price_remy_suggest_pricing" }), Ne.toggleDialog(!0), Ne.registerOnSelect((A) => {
4509
+ typeof A == "number" && r(
4510
4510
  "update:form",
4511
4511
  "price",
4512
4512
  Ae.Dinero.fromNumber({
4513
- number: C
4513
+ number: A
4514
4514
  }).toObject()
4515
4515
  );
4516
- }), await ((g = (y = Ne).getItemPricing) == null ? void 0 : g.call(
4517
- y,
4516
+ }), await ((_ = (b = Ne).getItemPricing) == null ? void 0 : _.call(
4517
+ b,
4518
4518
  {
4519
4519
  name: t.form.name || "",
4520
- lat: (E = (z = (S = n.currentRestaurant) == null ? void 0 : S.value) == null ? void 0 : z.profile.address.coordinates) == null ? void 0 : E[1],
4521
- lon: (k = (D = (j = n.currentRestaurant) == null ? void 0 : j.value) == null ? void 0 : D.profile.address.coordinates) == null ? void 0 : k[0]
4520
+ lat: (E = (z = (C = n.currentRestaurant) == null ? void 0 : C.value) == null ? void 0 : z.profile.address.coordinates) == null ? void 0 : E[1],
4521
+ lon: (M = (D = (j = n.currentRestaurant) == null ? void 0 : j.value) == null ? void 0 : D.profile.address.coordinates) == null ? void 0 : M[0]
4522
4522
  },
4523
4523
  !0
4524
4524
  ));
4525
4525
  } finally {
4526
- b.value = !1;
4526
+ v.value = !1;
4527
4527
  }
4528
4528
  }
4529
- return (f, S) => {
4529
+ return (f, C) => {
4530
4530
  const z = G("fm-select"), E = G("fm-checkbox"), j = G("fm-text-field"), D = Nt("tooltip");
4531
4531
  return O(), Y(Ke, {
4532
4532
  title: p(o)("menu.product.form.price.title")
4533
4533
  }, {
4534
4534
  default: L(() => {
4535
- var k;
4535
+ var M;
4536
4536
  return [
4537
4537
  P("div", Sr, [
4538
- w(it, {
4538
+ S(it, {
4539
4539
  min: 0,
4540
4540
  "model-value": f.form.price || null,
4541
- placeholder: (k = f.fallback) != null && k.price ? p(mt)(f.fallback.price, !1) : void 0,
4541
+ placeholder: (M = f.fallback) != null && M.price ? p(mt)(f.fallback.price, !1) : void 0,
4542
4542
  rules: [
4543
- l.value.price ? (y) => !!y || p(o)("menu.product.form.price.fields.selling_price.required") : void 0
4543
+ l.value.price ? (b) => !!b || p(o)("menu.product.form.price.fields.selling_price.required") : void 0
4544
4544
  ].filter(p(pt).isSet),
4545
4545
  class: "w-[258px] xs:w-full",
4546
4546
  label: p(o)("menu.product.form.price.fields.selling_price.label"),
4547
4547
  "show-currency": "",
4548
- "onUpdate:modelValue": S[0] || (S[0] = (y) => y && r("update:form", "price", y))
4548
+ "onUpdate:modelValue": C[0] || (C[0] = (b) => b && r("update:form", "price", b))
4549
4549
  }, {
4550
4550
  append: L(() => [
4551
- Qe(w(mn, {
4551
+ Qe(S(mn, {
4552
4552
  "pure-styling": "",
4553
- onClick: v
4553
+ onClick: g
4554
4554
  }, null, 512), [
4555
4555
  [D, p(Li)("Suggest pricing")]
4556
4556
  ])
4557
4557
  ]),
4558
4558
  _: 1
4559
4559
  }, 8, ["model-value", "placeholder", "rules", "label"]),
4560
- w(z, {
4560
+ S(z, {
4561
4561
  disabled: !l.value.tax || !c.value.systemCode,
4562
4562
  items: c.value.countryTaxOptions,
4563
4563
  label: c.value.systemCode ? p(o)("menu.product.form.price.fields.tax.label_with_code", {
@@ -4567,26 +4567,26 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4567
4567
  placeholder: "--",
4568
4568
  class: "flex-1",
4569
4569
  "shift-menu": "",
4570
- "onUpdate:modelValue": S[1] || (S[1] = (y) => r("update:form", "taxes", [p(Et).decodeTax(y)]))
4570
+ "onUpdate:modelValue": C[1] || (C[1] = (b) => r("update:form", "taxes", [p(Et).decodeTax(b)]))
4571
4571
  }, null, 8, ["disabled", "items", "label", "model-value"])
4572
4572
  ]),
4573
- w(nt, {
4573
+ S(nt, {
4574
4574
  label: p(o)("menu.product.form.price.settings.title")
4575
4575
  }, {
4576
4576
  default: L(() => {
4577
- var y;
4577
+ var b, _, A;
4578
4578
  return [
4579
4579
  P("div", Cr, [
4580
- w(E, {
4580
+ S(E, {
4581
4581
  disabled: !l.value.openPrice,
4582
- "model-value": f.form.openPrice ?? ((y = f.fallback) == null ? void 0 : y.openPrice) ?? !1,
4582
+ "model-value": f.form.openPrice ?? ((b = f.fallback) == null ? void 0 : b.openPrice) ?? !1,
4583
4583
  value: f.form.openPrice,
4584
4584
  label: p(o)("menu.product.form.price.settings.open_price.label"),
4585
4585
  sublabel: p(o)("menu.product.form.price.settings.open_price.sublabel"),
4586
- "onUpdate:modelValue": S[2] || (S[2] = (g) => r("update:form", "openPrice", g))
4586
+ "onUpdate:modelValue": C[2] || (C[2] = (y) => r("update:form", "openPrice", y))
4587
4587
  }, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
4588
4588
  P("div", Ar, [
4589
- w(E, {
4589
+ S(E, {
4590
4590
  disabled: !l.value.unit,
4591
4591
  "model-value": s.value,
4592
4592
  value: s.value,
@@ -4596,13 +4596,13 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4596
4596
  }, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
4597
4597
  s.value ? (O(), Q("div", Rr, [
4598
4598
  P("p", xr, de(p(o)("menu.product.form.price.settings.sell_by_unit.per_unit.label")), 1),
4599
- P("div", Mr, [
4600
- w(j, {
4599
+ P("div", kr, [
4600
+ S(j, {
4601
4601
  disabled: !l.value.unit,
4602
- "model-value": f.form.perXUnit || null,
4602
+ "model-value": f.form.perXUnit || ((_ = f.fallback) == null ? void 0 : _.perXUnit) || null,
4603
4603
  rules: [
4604
- (g) => !!g || p(o)("menu.product.form.price.settings.sell_by_unit.per_unit.required"),
4605
- (g) => !g || g > 0 || p(o)("menu.product.form.price.settings.sell_by_unit.per_unit.min")
4604
+ (y) => !!y || p(o)("menu.product.form.price.settings.sell_by_unit.per_unit.required"),
4605
+ (y) => !y || y > 0 || p(o)("menu.product.form.price.settings.sell_by_unit.per_unit.min")
4606
4606
  ],
4607
4607
  inputmode: "numeric",
4608
4608
  placeholder: p(o)("menu.product.form.price.settings.sell_by_unit.per_unit.placeholder"),
@@ -4611,45 +4611,46 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4611
4611
  "onUpdate:modelValue": h
4612
4612
  }, null, 8, ["disabled", "model-value", "rules", "placeholder"])
4613
4613
  ]),
4614
- P("div", kr, [
4615
- w(j, {
4616
- "model-value": f.form.unit || null,
4614
+ P("div", Mr, [
4615
+ S(j, {
4616
+ disabled: !l.value.unit,
4617
+ "model-value": f.form.unit || ((A = f.fallback) == null ? void 0 : A.unit) || null,
4617
4618
  rules: [
4618
- (g) => !!g || p(o)("menu.product.form.price.settings.sell_by_unit.unit.required")
4619
+ (y) => !!y || p(o)("menu.product.form.price.settings.sell_by_unit.unit.required")
4619
4620
  ],
4620
4621
  placeholder: p(o)("menu.product.form.price.settings.sell_by_unit.unit.placeholder"),
4621
- "onUpdate:modelValue": S[3] || (S[3] = (g) => r("update:form", "unit", g))
4622
- }, null, 8, ["model-value", "rules", "placeholder"])
4622
+ "onUpdate:modelValue": C[3] || (C[3] = (y) => r("update:form", "unit", y))
4623
+ }, null, 8, ["disabled", "model-value", "rules", "placeholder"])
4623
4624
  ])
4624
4625
  ])) : te("", !0)
4625
4626
  ]),
4626
4627
  l.value.costing ? (O(), Q("div", Or, [
4627
- w(E, {
4628
+ S(E, {
4628
4629
  "model-value": !!f.form.costing,
4629
4630
  value: !!f.form.costing,
4630
4631
  label: p(o)("menu.product.form.price.settings.track_costing.label"),
4631
- "onUpdate:modelValue": S[4] || (S[4] = (g) => r("update:form", "costing", g ? p(Ae.Dinero).zero().toObject() : void 0))
4632
+ "onUpdate:modelValue": C[4] || (C[4] = (y) => r("update:form", "costing", y ? p(Ae.Dinero).zero().toObject() : void 0))
4632
4633
  }, null, 8, ["model-value", "value", "label"]),
4633
4634
  f.form.costing ? (O(), Q("div", zr, [
4634
4635
  P("div", Er, [
4635
- w(it, {
4636
+ S(it, {
4636
4637
  class: "w-full",
4637
4638
  min: 0,
4638
4639
  "model-value": f.form.costing || null,
4639
4640
  nullable: "",
4640
4641
  "show-currency": "",
4641
- "onUpdate:modelValue": S[5] || (S[5] = (g) => r("update:form", "costing", g ?? p(Ae.Dinero).zero().toObject()))
4642
+ "onUpdate:modelValue": C[5] || (C[5] = (y) => r("update:form", "costing", y ?? p(Ae.Dinero).zero().toObject()))
4642
4643
  }, null, 8, ["model-value"])
4643
4644
  ])
4644
4645
  ])) : te("", !0)
4645
4646
  ])) : te("", !0),
4646
4647
  l.value.minPrice ? (O(), Q("div", Fr, [
4647
- w(E, {
4648
+ S(E, {
4648
4649
  disabled: !l.value.minPrice,
4649
4650
  "model-value": !!f.form.minPrice,
4650
4651
  value: !!f.form.minPrice,
4651
4652
  label: p(o)("menu.product.form.price.settings.min_price.label"),
4652
- "onUpdate:modelValue": S[6] || (S[6] = (g) => r("update:form", "minPrice", g ? p(Ae.Dinero).zero().toObject() : void 0))
4653
+ "onUpdate:modelValue": C[6] || (C[6] = (y) => r("update:form", "minPrice", y ? p(Ae.Dinero).zero().toObject() : void 0))
4653
4654
  }, null, 8, ["disabled", "model-value", "value", "label"]),
4654
4655
  P("div", Ir, [
4655
4656
  P("div", Dr, [
@@ -4660,7 +4661,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4660
4661
  "model-value": f.form.minPrice || null,
4661
4662
  class: "flex-1",
4662
4663
  "show-currency": "",
4663
- "onUpdate:modelValue": S[7] || (S[7] = (g) => r("update:form", "minPrice", g ?? p(Ae.Dinero).zero().toObject()))
4664
+ "onUpdate:modelValue": C[7] || (C[7] = (y) => r("update:form", "minPrice", y ?? p(Ae.Dinero).zero().toObject()))
4664
4665
  }, null, 8, ["max", "model-value"])) : te("", !0)
4665
4666
  ])
4666
4667
  ])
@@ -4724,10 +4725,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4724
4725
  d && (r.value = t.initialValue ? ne(t.initialValue) : { ...Se.generator.initMenuV4PrintDepartment(), usedBy: [] });
4725
4726
  }
4726
4727
  ), (d, h) => {
4727
- const m = G("fm-text-field"), b = G("fm-button"), v = G("fm-side-sheet");
4728
- return O(), Q(ke, null, [
4728
+ const m = G("fm-text-field"), v = G("fm-button"), g = G("fm-side-sheet");
4729
+ return O(), Q(Me, null, [
4729
4730
  ve(d.$slots, "default", { trigger: u }),
4730
- w(v, {
4731
+ S(g, {
4731
4732
  id: "variant-form",
4732
4733
  modelValue: s.value,
4733
4734
  "onUpdate:modelValue": h[3] || (h[3] = (f) => s.value = f),
@@ -4744,14 +4745,14 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4744
4745
  ]),
4745
4746
  "side-sheet-footer": L(() => [
4746
4747
  P("div", Vr, [
4747
- w(b, {
4748
+ S(v, {
4748
4749
  label: o.value,
4749
4750
  loading: l.value,
4750
4751
  size: "lg",
4751
4752
  type: "submit",
4752
4753
  variant: "primary"
4753
4754
  }, null, 8, ["label", "loading"]),
4754
- w(b, {
4755
+ S(v, {
4755
4756
  label: p(i)("menu.common.actions.cancel"),
4756
4757
  size: "lg",
4757
4758
  variant: "tertiary",
@@ -4761,7 +4762,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4761
4762
  ]),
4762
4763
  default: L(() => [
4763
4764
  P("div", Ur, [
4764
- w(m, {
4765
+ S(m, {
4765
4766
  modelValue: r.value.name,
4766
4767
  "onUpdate:modelValue": h[0] || (h[0] = (f) => r.value.name = f),
4767
4768
  rules: [
@@ -4807,43 +4808,43 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4807
4808
  };
4808
4809
  }
4809
4810
  const l = F(() => n.rules.item), s = F(() => n.printDepartments), u = F(() => {
4810
- var S;
4811
- return ((S = t.form.print) == null ? void 0 : S.sequential) ?? !1;
4811
+ var C;
4812
+ return ((C = t.form.print) == null ? void 0 : C.sequential) ?? !1;
4812
4813
  }), c = F(() => {
4813
- var S;
4814
+ var C;
4814
4815
  return u.value ? s.value.reduce(
4815
4816
  (z, { _id: E }) => (z.includes(E) || (z = [...z, E]), z),
4816
- [...((S = t.form.print) == null ? void 0 : S.department) ?? []]
4817
+ [...((C = t.form.print) == null ? void 0 : C.department) ?? []]
4817
4818
  ) : s.value.map(({ _id: z }) => z);
4818
- }), d = F(() => s.value.reduce((S, z) => (S[z._id] = z.name, S), {}));
4819
- function h(S) {
4819
+ }), d = F(() => s.value.reduce((C, z) => (C[z._id] = z.name, C), {}));
4820
+ function h(C) {
4820
4821
  o("update:form", "print", {
4821
4822
  ...r(),
4822
4823
  ...t.form.print,
4823
- toRoot: !S
4824
+ toRoot: !C
4824
4825
  });
4825
4826
  }
4826
- function m(S) {
4827
+ function m(C) {
4827
4828
  o("update:form", "print", {
4828
4829
  ...r(),
4829
4830
  ...t.form.print,
4830
- sequential: S
4831
+ sequential: C
4831
4832
  });
4832
4833
  }
4833
- function b(S) {
4834
+ function v(C) {
4834
4835
  o("update:form", "print", {
4835
4836
  ...r(),
4836
4837
  ...t.form.print,
4837
- department: S.filter((z) => {
4838
+ department: C.filter((z) => {
4838
4839
  var E;
4839
4840
  return (((E = t.form.print) == null ? void 0 : E.department) ?? []).includes(z);
4840
4841
  })
4841
4842
  });
4842
4843
  }
4843
- function v(S, z) {
4844
+ function g(C, z) {
4844
4845
  var j, D;
4845
4846
  let E = [...((D = (j = t.form) == null ? void 0 : j.print) == null ? void 0 : D.department) ?? []];
4846
- z && !E.includes(S) ? E = [...E, S] : z || (E = E.filter((k) => k !== S)), o("update:form", "print", {
4847
+ z && !E.includes(C) ? E = [...E, C] : z || (E = E.filter((M) => M !== C)), o("update:form", "print", {
4847
4848
  ...r(),
4848
4849
  ...t.form.print,
4849
4850
  department: E
@@ -4863,70 +4864,70 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4863
4864
  ]);
4864
4865
  return Re(
4865
4866
  () => s.value.length,
4866
- () => v(s.value[s.value.length - 1]._id, !0)
4867
- ), (S, z) => {
4868
- const E = G("fm-switch"), j = G("fm-radio"), D = G("fm-radio-group"), k = G("fm-button"), y = G("fm-checkbox");
4867
+ () => g(s.value[s.value.length - 1]._id, !0)
4868
+ ), (C, z) => {
4869
+ const E = G("fm-switch"), j = G("fm-radio"), D = G("fm-radio-group"), M = G("fm-button"), b = G("fm-checkbox");
4869
4870
  return O(), Y(Ke, {
4870
4871
  title: p(a)("menu.product.form.print.title")
4871
4872
  }, {
4872
4873
  default: L(() => {
4873
- var g;
4874
+ var _;
4874
4875
  return [
4875
4876
  l.value.printConfig ? (O(), Y(nt, {
4876
4877
  key: 0,
4877
4878
  label: p(a)("menu.product.form.print.config.label")
4878
4879
  }, {
4879
4880
  default: L(() => {
4880
- var C;
4881
+ var A;
4881
4882
  return [
4882
- w(E, {
4883
- "model-value": !((C = S.form.print) != null && C.toRoot),
4883
+ S(E, {
4884
+ "model-value": !((A = C.form.print) != null && A.toRoot),
4884
4885
  label: p(a)("menu.product.form.print.config.group_parent.label"),
4885
4886
  "label-placement": "right",
4886
4887
  sublabel: p(a)("menu.product.form.print.config.group_parent.sublabel"),
4887
- "onUpdate:modelValue": z[0] || (z[0] = (x) => h(x))
4888
+ "onUpdate:modelValue": z[0] || (z[0] = (y) => h(y))
4888
4889
  }, null, 8, ["model-value", "label", "sublabel"])
4889
4890
  ];
4890
4891
  }),
4891
4892
  _: 1
4892
4893
  }, 8, ["label"])) : te("", !0),
4893
- w(D, {
4894
+ S(D, {
4894
4895
  label: p(a)("menu.product.form.print.kds.label"),
4895
- "model-value": ((g = S.form.print) == null ? void 0 : g.sequential) ?? !1,
4896
- "onUpdate:modelValue": z[1] || (z[1] = (C) => m(C))
4896
+ "model-value": ((_ = C.form.print) == null ? void 0 : _.sequential) ?? !1,
4897
+ "onUpdate:modelValue": z[1] || (z[1] = (A) => m(A))
4897
4898
  }, {
4898
4899
  default: L(() => [
4899
4900
  P("div", Lr, [
4900
- (O(!0), Q(ke, null, Ye(f.value, (C, x) => (O(), Y(j, {
4901
- key: x,
4902
- label: C.label,
4903
- sublabel: C.description,
4904
- value: C.value
4901
+ (O(!0), Q(Me, null, Ye(f.value, (A, y) => (O(), Y(j, {
4902
+ key: y,
4903
+ label: A.label,
4904
+ sublabel: A.description,
4905
+ value: A.value
4905
4906
  }, null, 8, ["label", "sublabel", "value"]))), 128))
4906
4907
  ])
4907
4908
  ]),
4908
4909
  _: 1
4909
4910
  }, 8, ["label", "model-value"]),
4910
- w(nt, {
4911
+ S(nt, {
4911
4912
  label: p(a)("menu.product.form.print.routes.label")
4912
4913
  }, {
4913
4914
  default: L(() => [
4914
4915
  c.value.length ? (O(), Y(p(Gi), {
4915
4916
  key: 0,
4916
- "item-key": (C) => C,
4917
+ "item-key": (A) => A,
4917
4918
  "model-value": c.value,
4918
4919
  handle: ".handle",
4919
- "onUpdate:modelValue": z[3] || (z[3] = (C) => b(C)),
4920
+ "onUpdate:modelValue": z[3] || (z[3] = (A) => v(A)),
4920
4921
  class: "space-y-16"
4921
4922
  }, {
4922
- item: L(({ element: C }) => {
4923
- var x, M, R, _, A;
4923
+ item: L(({ element: A }) => {
4924
+ var y, k, x, w, R;
4924
4925
  return [
4925
4926
  P("div", Br, [
4926
4927
  P("div", Kr, [
4927
- u.value ? (O(), Y(k, {
4928
+ u.value ? (O(), Y(M, {
4928
4929
  key: 0,
4929
- disabled: !((M = (x = t.form.print) == null ? void 0 : x.department) != null && M.includes(C)),
4930
+ disabled: !((k = (y = t.form.print) == null ? void 0 : y.department) != null && k.includes(A)),
4930
4931
  class: "handle",
4931
4932
  "prepend-icon": "drag_handle",
4932
4933
  variant: "tertiary",
@@ -4934,28 +4935,28 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4934
4935
  }, ["stop"]))
4935
4936
  }, null, 8, ["disabled"])) : te("", !0)
4936
4937
  ]),
4937
- w(y, {
4938
- id: C,
4939
- "data-checked": (_ = (R = t.form.print) == null ? void 0 : R.department) == null ? void 0 : _.includes(C),
4940
- label: d.value[C],
4941
- "model-value": (((A = t.form.print) == null ? void 0 : A.department) ?? []).includes(C),
4942
- value: C,
4938
+ S(b, {
4939
+ id: A,
4940
+ "data-checked": (w = (x = t.form.print) == null ? void 0 : x.department) == null ? void 0 : w.includes(A),
4941
+ label: d.value[A],
4942
+ "model-value": (((R = t.form.print) == null ? void 0 : R.department) ?? []).includes(A),
4943
+ value: A,
4943
4944
  class: "flex-1",
4944
- "onUpdate:modelValue": (U) => v(C, U)
4945
+ "onUpdate:modelValue": (U) => g(A, U)
4945
4946
  }, null, 8, ["id", "data-checked", "label", "model-value", "value", "onUpdate:modelValue"])
4946
4947
  ])
4947
4948
  ];
4948
4949
  }),
4949
4950
  _: 1
4950
4951
  }, 8, ["item-key", "model-value"])) : te("", !0),
4951
- w(p(Nr), { "apply-product": !1 }, {
4952
- default: L(({ trigger: C }) => [
4952
+ S(p(Nr), { "apply-product": !1 }, {
4953
+ default: L(({ trigger: A }) => [
4953
4954
  P("div", Gr, [
4954
- w(k, {
4955
+ S(M, {
4955
4956
  variant: p(qe).Secondary,
4956
4957
  label: p(a)("menu.product.form.print.routes.add"),
4957
4958
  "prepend-icon": "add",
4958
- onClick: C
4959
+ onClick: A
4959
4960
  }, null, 8, ["variant", "label", "onClick"])
4960
4961
  ])
4961
4962
  ]),
@@ -4990,26 +4991,26 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
4990
4991
  const t = e, n = fe(), a = F(() => n.rules.item), o = Xe(He(De())), {
4991
4992
  t: r
4992
4993
  } = me(), l = i, s = F(() => {
4993
- var b, v;
4994
- return !!((v = (b = t.form.variant) == null ? void 0 : b.variantCombinations) != null && v.length);
4994
+ var v, g;
4995
+ return !!((g = (v = t.form.variant) == null ? void 0 : v.variantCombinations) != null && g.length);
4995
4996
  }), u = F(() => {
4996
- var b;
4997
+ var v;
4997
4998
  return [{
4998
4999
  key: "",
4999
- name: t.form.name || ((b = t.fallback) == null ? void 0 : b.name) || "Product",
5000
+ name: t.form.name || ((v = t.fallback) == null ? void 0 : v.name) || "Product",
5000
5001
  takeaway: t.form.takeawayUsed,
5001
- onUpdate: (v) => l("update:form", "takeawayUsed", v)
5002
+ onUpdate: (g) => l("update:form", "takeawayUsed", g)
5002
5003
  }];
5003
5004
  }), c = F(() => {
5004
- var b;
5005
- return (((b = t.form.variant) == null ? void 0 : b.variantCombinations) || []).map((v, f) => ({
5006
- key: v.combinationKey || "",
5007
- name: t.fullCombinations[v.combinationKey || ""],
5008
- takeaway: v.takeawayUsed,
5009
- onUpdate: (S) => {
5005
+ var v;
5006
+ return (((v = t.form.variant) == null ? void 0 : v.variantCombinations) || []).map((g, f) => ({
5007
+ key: g.combinationKey || "",
5008
+ name: t.fullCombinations[g.combinationKey || ""],
5009
+ takeaway: g.takeawayUsed,
5010
+ onUpdate: (C) => {
5010
5011
  var E, j;
5011
5012
  const z = ne(((E = t.form.variant) == null ? void 0 : E.variantCombinations) || []);
5012
- z[f].takeawayUsed = S, l("update:form", "variant", {
5013
+ z[f].takeawayUsed = C, l("update:form", "variant", {
5013
5014
  variantGroupIds: ((j = t.form.variant) == null ? void 0 : j.variantGroupIds) || [],
5014
5015
  variantCombinations: z
5015
5016
  });
@@ -5021,9 +5022,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5021
5022
  } : {
5022
5023
  label: r("menu.product.form.takeaway.options.no_preset"),
5023
5024
  value: null
5024
- }, ...n.takeaways.map((b) => ({
5025
- label: b.name,
5026
- value: b._id
5025
+ }, ...n.takeaways.map((v) => ({
5026
+ label: v.name,
5027
+ value: v._id
5027
5028
  }))]), m = J([{
5028
5029
  accessorKey: "name",
5029
5030
  enableSorting: !1,
@@ -5032,25 +5033,25 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5032
5033
  accessorKey: "takeaway",
5033
5034
  enableSorting: !1,
5034
5035
  header: () => r("menu.product.form.takeaway.columns.takeaway"),
5035
- cell: (b) => {
5036
- const v = b.getValue(), f = b.row.original;
5036
+ cell: (v) => {
5037
+ const g = v.getValue(), f = v.row.original;
5037
5038
  return he(Vn, {
5038
5039
  action: "add",
5039
5040
  applyProduct: !1,
5040
5041
  bindToVariant: n.rules.item.bindToVariant,
5041
- "onUpdate:takeaway": async (S) => {
5042
+ "onUpdate:takeaway": async (C) => {
5042
5043
  await o.updateMenu({
5043
5044
  module: B.F_MENU_MODULE_V4_KEY.enum.takeaway,
5044
5045
  operation: pe.F_OPERATION_TYPE.create,
5045
- data: S,
5046
- link: Bt(S.usedBy || [])
5047
- }, S.name);
5046
+ data: C,
5047
+ link: Bt(C.usedBy || [])
5048
+ }, C.name);
5048
5049
  }
5049
5050
  }, {
5050
5051
  default: ({
5051
- trigger: S
5052
+ trigger: C
5052
5053
  }) => he(xe.FmSelect, {
5053
- modelValue: v || null,
5054
+ modelValue: g || null,
5054
5055
  menuZIndex: 103,
5055
5056
  items: h.value,
5056
5057
  shiftMenu: !0,
@@ -5061,7 +5062,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5061
5062
  "append-menu": () => n.rules.takeaway.create ? he("button", {
5062
5063
  class: "flex items-center py-8 px-16 space-x-8",
5063
5064
  type: "button",
5064
- onClick: S
5065
+ onClick: C
5065
5066
  }, [he(xe.FmIcon, {
5066
5067
  name: "add",
5067
5068
  size: "md",
@@ -5073,13 +5074,13 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5073
5074
  });
5074
5075
  }
5075
5076
  }]);
5076
- return (b, v) => {
5077
+ return (v, g) => {
5077
5078
  const f = G("fm-table");
5078
5079
  return O(), Y(Ke, {
5079
5080
  title: p(r)("menu.product.form.takeaway.title"),
5080
5081
  "sub-title": p(r)("menu.product.form.takeaway.subtitle")
5081
5082
  }, {
5082
- default: L(() => [w(f, {
5083
+ default: L(() => [S(f, {
5083
5084
  columnDefs: m.value,
5084
5085
  "page-size": d.value.length,
5085
5086
  "row-data": d.value,
@@ -5109,10 +5110,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5109
5110
  t(s.value), n("primary"), i.close();
5110
5111
  };
5111
5112
  return (d, h) => {
5112
- const m = G("FmSearch"), b = G("FmCheckbox"), v = G("FmButton");
5113
+ const m = G("FmSearch"), v = G("FmCheckbox"), g = G("FmButton");
5113
5114
  return l.value.length > 0 ? (O(), Q("div", Yr, [
5114
5115
  P("div", null, [
5115
- w(m, {
5116
+ S(m, {
5116
5117
  autofocus: "",
5117
5118
  modelValue: u.value,
5118
5119
  "onUpdate:modelValue": h[0] || (h[0] = (f) => u.value = f),
@@ -5121,14 +5122,14 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5121
5122
  ]),
5122
5123
  P("div", Hr, [
5123
5124
  P("div", null, [
5124
- (O(!0), Q(ke, null, Ye(l.value, (f) => (O(), Q("div", {
5125
+ (O(!0), Q(Me, null, Ye(l.value, (f) => (O(), Q("div", {
5125
5126
  key: f.value
5126
5127
  }, [
5127
- Qe(w(b, {
5128
+ Qe(S(v, {
5128
5129
  modelValue: s.value,
5129
5130
  "onUpdate:modelValue": [
5130
- h[1] || (h[1] = (S) => s.value = S),
5131
- h[2] || (h[2] = (S) => p(t)(s.value))
5131
+ h[1] || (h[1] = (C) => s.value = C),
5132
+ h[2] || (h[2] = (C) => p(t)(s.value))
5132
5133
  ],
5133
5134
  label: f.label,
5134
5135
  value: f.value
@@ -5139,25 +5140,25 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5139
5140
  ])
5140
5141
  ]),
5141
5142
  P("div", Xr, [
5142
- w(p(wi), null, {
5143
+ S(p(wi), null, {
5143
5144
  default: L(({ trigger: f }) => [
5144
- p(a).rules.item.variant ? (O(), Y(v, {
5145
+ p(a).rules.item.variant ? (O(), Y(g, {
5145
5146
  key: 0,
5146
5147
  label: p(o)("menu.common.actions.add_new_variant"),
5147
5148
  variant: "tertiary",
5148
5149
  "text-color": "primary",
5149
- onClick: (S) => f()
5150
+ onClick: (C) => f()
5150
5151
  }, null, 8, ["label", "onClick"])) : te("", !0)
5151
5152
  ]),
5152
5153
  _: 1
5153
5154
  }),
5154
5155
  P("div", qr, [
5155
- w(v, {
5156
+ S(g, {
5156
5157
  label: p(o)("menu.common.actions.cancel"),
5157
5158
  variant: "tertiary",
5158
5159
  onClick: h[3] || (h[3] = (f) => p(i).close())
5159
5160
  }, null, 8, ["label"]),
5160
- w(v, {
5161
+ S(g, {
5161
5162
  label: p(o)("menu.common.actions.confirm"),
5162
5163
  onClick: h[4] || (h[4] = (f) => c())
5163
5164
  }, null, 8, ["label"])
@@ -5168,12 +5169,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5168
5169
  P("p", Qr, de(p(o)("menu.common.empty.no_variant.title")), 1),
5169
5170
  P("p", es, de(p(o)("menu.common.empty.no_variant.subtitle")), 1)
5170
5171
  ]),
5171
- w(p(wi), null, {
5172
+ S(p(wi), null, {
5172
5173
  default: L(({ trigger: f }) => [
5173
- w(v, {
5174
+ S(g, {
5174
5175
  label: p(o)("menu.variant.add"),
5175
5176
  icon: "add",
5176
- onClick: (S) => f()
5177
+ onClick: (C) => f()
5177
5178
  }, null, 8, ["label", "onClick"])
5178
5179
  ]),
5179
5180
  _: 1
@@ -5208,146 +5209,146 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5208
5209
  }) {
5209
5210
  const t = e, n = fe(), a = ri(), o = De(), r = Be(), {
5210
5211
  t: l
5211
- } = me(), s = F(() => n.rules.item), u = F(() => s.value.minPrice && !!t.form.minPrice), c = F(() => !n.state.currentCatalogId), d = F(() => n.variants.reduce((g, C) => (g[C._id] = C, g), {}));
5212
+ } = me(), s = F(() => n.rules.item), u = F(() => s.value.minPrice && !!t.form.minPrice), c = F(() => !n.state.currentCatalogId), d = F(() => n.variants.reduce((_, A) => (_[A._id] = A, _), {}));
5212
5213
  J(!1);
5213
5214
  const h = i;
5214
- function m(g) {
5215
- const C = $e.clone(t.form);
5215
+ function m(_) {
5216
+ const A = $e.clone(t.form);
5216
5217
  for (const {
5217
- key: x,
5218
- value: M
5219
- } of g)
5220
- C[x] = M;
5221
- h("replace:form", C);
5218
+ key: y,
5219
+ value: k
5220
+ } of _)
5221
+ A[y] = k;
5222
+ h("replace:form", A);
5222
5223
  }
5223
- F(() => n.variants.map((g) => ({
5224
- label: g.name,
5225
- value: g._id,
5224
+ F(() => n.variants.map((_) => ({
5225
+ label: _.name,
5226
+ value: _._id,
5226
5227
  disabled: !1
5227
5228
  })));
5228
- function b(g) {
5229
- var x;
5230
- const C = f(g.combinationKey || "");
5229
+ function v(_) {
5230
+ var y;
5231
+ const A = f(_.combinationKey || "");
5231
5232
  return {
5232
- ...g,
5233
- price: C == null ? void 0 : C.price,
5234
- inventoryBindings: (C == null ? void 0 : C.inventoryBindings) || t.form.inventoryBindings,
5235
- takeawayUsed: (C == null ? void 0 : C.takeawayUsed) || t.form.takeawayUsed,
5236
- groups: (C == null ? void 0 : C.groups) || ((x = t.form.groups) == null ? void 0 : x.map((M) => ({
5237
- ...M,
5233
+ ..._,
5234
+ price: A == null ? void 0 : A.price,
5235
+ inventoryBindings: (A == null ? void 0 : A.inventoryBindings) || t.form.inventoryBindings,
5236
+ takeawayUsed: (A == null ? void 0 : A.takeawayUsed) || t.form.takeawayUsed,
5237
+ groups: (A == null ? void 0 : A.groups) || ((y = t.form.groups) == null ? void 0 : y.map((k) => ({
5238
+ ...k,
5238
5239
  groupKey: ""
5239
5240
  })))
5240
5241
  };
5241
5242
  }
5242
- function v() {
5243
- var g;
5243
+ function g() {
5244
+ var _;
5244
5245
  r.open({
5245
5246
  title: "Add variant",
5246
5247
  contentComponent: ts,
5247
5248
  contentComponentProps: {
5248
- selectedVariants: ((g = t.form.variant) == null ? void 0 : g.variantGroupIds) ?? []
5249
+ selectedVariants: ((_ = t.form.variant) == null ? void 0 : _.variantGroupIds) ?? []
5249
5250
  }
5250
- }).onPrimary(async (C) => {
5251
- E(C, b);
5251
+ }).onPrimary(async (A) => {
5252
+ E(A, v);
5252
5253
  });
5253
5254
  }
5254
- function f(g) {
5255
- var A, U;
5256
- const C = ((A = t.form.variant) == null ? void 0 : A.variantGroupIds) || [], x = (U = t.form.variant) == null ? void 0 : U.variantCombinations, _ = g.split(/(?=variant)/g).map((V) => V.replace(/\/*$/, "")).filter((V) => C.some((N) => V.includes(N))).join("/");
5257
- return x == null ? void 0 : x.find((V) => V.combinationKey === _);
5255
+ function f(_) {
5256
+ var R, U;
5257
+ const A = ((R = t.form.variant) == null ? void 0 : R.variantGroupIds) || [], y = (U = t.form.variant) == null ? void 0 : U.variantCombinations, w = _.split(/(?=variant)/g).map((V) => V.replace(/\/*$/, "")).filter((V) => A.some((N) => V.includes(N))).join("/");
5258
+ return y == null ? void 0 : y.find((V) => V.combinationKey === w);
5258
5259
  }
5259
- const S = (g) => {
5260
- E(g);
5260
+ const C = (_) => {
5261
+ E(_);
5261
5262
  }, z = F(() => {
5262
- var C;
5263
- return (((C = t.form.variant) == null ? void 0 : C.variantCombinations) || []).map((x) => {
5264
- var R, _;
5265
- const M = (_ = (R = t.fallback) == null ? void 0 : R.variant) == null ? void 0 : _.variantCombinations.find(({
5266
- combinationKey: A
5267
- }) => A === x.combinationKey);
5263
+ var A;
5264
+ return (((A = t.form.variant) == null ? void 0 : A.variantCombinations) || []).map((y) => {
5265
+ var x, w;
5266
+ const k = (w = (x = t.fallback) == null ? void 0 : x.variant) == null ? void 0 : w.variantCombinations.find(({
5267
+ combinationKey: R
5268
+ }) => R === y.combinationKey);
5268
5269
  return {
5269
- ...x,
5270
+ ...y,
5270
5271
  fallback: {
5271
- ...M,
5272
- _id: x._id,
5273
- combinationKey: x.combinationKey,
5274
- price: c.value ? t.form.price ?? (M == null ? void 0 : M.price) : x.price ?? (M == null ? void 0 : M.price),
5275
- minPrice: t.form.minPrice ?? (M == null ? void 0 : M.minPrice)
5272
+ ...k,
5273
+ _id: y._id,
5274
+ combinationKey: y.combinationKey,
5275
+ price: c.value ? t.form.price ?? (k == null ? void 0 : k.price) : y.price ?? (k == null ? void 0 : k.price),
5276
+ minPrice: t.form.minPrice ?? (k == null ? void 0 : k.minPrice)
5276
5277
  }
5277
5278
  };
5278
5279
  });
5279
5280
  });
5280
- function E(g, C = (x) => x) {
5281
- var R;
5282
- const x = g.filter((_) => !!_);
5283
- let M;
5284
- if (x.length) {
5285
- const _ = x.map((U) => n.variants.find((V) => V._id === U)), A = Se.fullVariantCombination(_).map(({
5281
+ function E(_, A = (y) => y) {
5282
+ var x;
5283
+ const y = _.filter((w) => !!w);
5284
+ let k;
5285
+ if (y.length) {
5286
+ const w = y.map((U) => n.variants.find((V) => V._id === U)), R = Se.fullVariantCombination(w).map(({
5286
5287
  combinationKey: U
5287
5288
  }) => {
5288
5289
  var N;
5289
5290
  const V = (N = t.form.variant) == null ? void 0 : N.variantCombinations.find((q) => q.combinationKey === U);
5290
- return C(V || {
5291
+ return A(V || {
5291
5292
  _id: t.form._id,
5292
5293
  combinationKey: U
5293
5294
  });
5294
5295
  });
5295
- if (A.length > 100) {
5296
+ if (R.length > 100) {
5296
5297
  o.open({
5297
5298
  type: "error",
5298
5299
  message: "'Combinations of variant should not be more than 100'"
5299
5300
  });
5300
5301
  return;
5301
5302
  }
5302
- M = {
5303
+ k = {
5303
5304
  ...t.form,
5304
5305
  variant: {
5305
- variantGroupIds: x,
5306
- variantCombinations: A
5306
+ variantGroupIds: y,
5307
+ variantCombinations: R
5307
5308
  },
5308
5309
  inventoryBindings: null,
5309
5310
  takeawayUsed: null
5310
5311
  };
5311
5312
  } else {
5312
- const _ = (R = t.form.variant) == null ? void 0 : R.variantCombinations.map((U) => U.takeawayUsed), A = [...new Set(_)];
5313
+ const w = (x = t.form.variant) == null ? void 0 : x.variantCombinations.map((U) => U.takeawayUsed), R = [...new Set(w)];
5313
5314
  m([{
5314
5315
  key: "variant",
5315
5316
  value: void 0
5316
5317
  }, {
5317
5318
  key: "takeawayUsed",
5318
- value: A.length === 1 ? A[0] : null
5319
- }]), M = {
5319
+ value: R.length === 1 ? R[0] : null
5320
+ }]), k = {
5320
5321
  ...t.form,
5321
5322
  variant: void 0,
5322
- takeawayUsed: A.length === 1 ? A[0] : null
5323
+ takeawayUsed: R.length === 1 ? R[0] : null
5323
5324
  };
5324
5325
  }
5325
- h("replace:form", a.initDynamicGroupItem(M));
5326
+ h("replace:form", a.initDynamicGroupItem(k));
5326
5327
  }
5327
- async function j(g, C, x) {
5328
- const M = $e.clone(t.form);
5329
- M.variant.variantCombinations[g][C] = x, m([{
5328
+ async function j(_, A, y) {
5329
+ const k = $e.clone(t.form);
5330
+ k.variant.variantCombinations[_][A] = y, m([{
5330
5331
  key: "variant",
5331
- value: M.variant
5332
+ value: k.variant
5332
5333
  }]);
5333
5334
  }
5334
5335
  const D = F(() => [{
5335
5336
  accessorKey: "combinationKey",
5336
5337
  header: () => l("menu.product.form.variant.columns.variant"),
5337
5338
  enableSorting: !1,
5338
- cell: (g) => t.fullCombinations[g.getValue()]
5339
+ cell: (_) => t.fullCombinations[_.getValue()]
5339
5340
  }, {
5340
5341
  accessorKey: "code",
5341
5342
  header: () => l("menu.product.form.variant.columns.code"),
5342
5343
  enableSorting: !1,
5343
- cell: (g) => {
5344
- var _, A;
5345
- const C = g.getValue(), R = ((_ = g.row.original.fallback) == null ? void 0 : _.code) ?? t.form.code ?? ((A = t.fallback) == null ? void 0 : A.code);
5344
+ cell: (_) => {
5345
+ var w, R;
5346
+ const A = _.getValue(), x = ((w = _.row.original.fallback) == null ? void 0 : w.code) ?? t.form.code ?? ((R = t.fallback) == null ? void 0 : R.code);
5346
5347
  return he(xe.FmTextField, {
5347
- modelValue: C,
5348
- placeholder: R || l("menu.product.form.variant.placeholders.no_code"),
5348
+ modelValue: A,
5349
+ placeholder: x || l("menu.product.form.variant.placeholders.no_code"),
5349
5350
  "onUpdate:modelValue": (U) => {
5350
- j(g.row.index, "code", hn(U, t.isOverride));
5351
+ j(_.row.index, "code", hn(U, t.isOverride));
5351
5352
  }
5352
5353
  });
5353
5354
  }
@@ -5355,17 +5356,17 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5355
5356
  accessorKey: "orderFrom",
5356
5357
  header: () => l("menu.product.form.variant.columns.order_from"),
5357
5358
  enableSorting: !1,
5358
- cell: (g) => {
5359
- var R, _;
5360
- const C = g.getValue(), M = (R = g.row.original.fallback) == null ? void 0 : R.orderFrom;
5359
+ cell: (_) => {
5360
+ var x, w;
5361
+ const A = _.getValue(), k = (x = _.row.original.fallback) == null ? void 0 : x.orderFrom;
5361
5362
  return he(ai, {
5362
- modelValue: C ?? null,
5363
- fallback: t.form.orderFrom ?? M ?? ((_ = t.fallback) == null ? void 0 : _.orderFrom),
5363
+ modelValue: A ?? null,
5364
+ fallback: t.form.orderFrom ?? k ?? ((w = t.fallback) == null ? void 0 : w.orderFrom),
5364
5365
  disable: !s.value.orderFrom,
5365
5366
  required: s.value.orderFrom && s.value.orderFromActiveOnly,
5366
5367
  editActiveOnly: s.value.orderFromActiveOnly || !1,
5367
- "onUpdate:modelValue": (A) => {
5368
- j(g.row.index, "orderFrom", A);
5368
+ "onUpdate:modelValue": (R) => {
5369
+ j(_.row.index, "orderFrom", R);
5369
5370
  },
5370
5371
  label: "",
5371
5372
  defaultLabel: "Follow general"
@@ -5375,15 +5376,15 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5375
5376
  accessorKey: "price",
5376
5377
  header: () => l("menu.product.form.variant.columns.price"),
5377
5378
  enableSorting: !1,
5378
- cell: (g) => {
5379
- var _, A;
5380
- const C = g.getValue(), R = ((_ = g.row.original.fallback) == null ? void 0 : _.price) ?? t.form.price ?? ((A = t.fallback) == null ? void 0 : A.price);
5379
+ cell: (_) => {
5380
+ var w, R;
5381
+ const A = _.getValue(), x = ((w = _.row.original.fallback) == null ? void 0 : w.price) ?? t.form.price ?? ((R = t.fallback) == null ? void 0 : R.price);
5381
5382
  return he(it, {
5382
- placeholder: R ? mt(R) : void 0,
5383
- modelValue: C,
5383
+ placeholder: x ? mt(x) : void 0,
5384
+ modelValue: A,
5384
5385
  min: 0,
5385
5386
  "onUpdate:modelValue": (U) => {
5386
- j(g.row.index, "price", U);
5387
+ j(_.row.index, "price", U);
5387
5388
  },
5388
5389
  nullable: !0,
5389
5390
  showCurrency: !1
@@ -5393,71 +5394,71 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5393
5394
  accessorKey: "minPrice",
5394
5395
  header: () => l("menu.product.form.variant.columns.min_price"),
5395
5396
  enableSorting: !1,
5396
- cell: (g) => {
5397
- var _, A, U;
5398
- const C = g.getValue(), x = g.row.original, R = ((_ = x.fallback) == null ? void 0 : _.minPrice) ?? t.form.minPrice ?? ((A = t.fallback) == null ? void 0 : A.minPrice);
5397
+ cell: (_) => {
5398
+ var w, R, U;
5399
+ const A = _.getValue(), y = _.row.original, x = ((w = y.fallback) == null ? void 0 : w.minPrice) ?? t.form.minPrice ?? ((R = t.fallback) == null ? void 0 : R.minPrice);
5399
5400
  return he(it, {
5400
- placeholder: R ? mt(R) : void 0,
5401
- modelValue: C,
5402
- max: Ae.Dinero.fromFdoDinero(x.price ?? ((U = x.fallback) == null ? void 0 : U.price) ?? Ae.Dinero.zero().toObject()).toUnit(),
5401
+ placeholder: x ? mt(x) : void 0,
5402
+ modelValue: A,
5403
+ max: Ae.Dinero.fromFdoDinero(y.price ?? ((U = y.fallback) == null ? void 0 : U.price) ?? Ae.Dinero.zero().toObject()).toUnit(),
5403
5404
  "onUpdate:modelValue": (V) => {
5404
- j(g.row.index, "minPrice", V);
5405
+ j(_.row.index, "minPrice", V);
5405
5406
  },
5406
5407
  nullable: !0,
5407
5408
  showCurrency: !1
5408
5409
  });
5409
5410
  }
5410
- }]), k = F(() => ({
5411
+ }]), M = F(() => ({
5411
5412
  minPrice: u.value
5412
5413
  }));
5413
- function y(g) {
5414
- return g != null && g.length && g.length > n.rules.item.maxVariant ? l("menu.product.form.variant.validation.max_variants", {
5414
+ function b(_) {
5415
+ return _ != null && _.length && _.length > n.rules.item.maxVariant ? l("menu.product.form.variant.validation.max_variants", {
5415
5416
  max: n.rules.item.maxVariant
5416
5417
  }) : !0;
5417
5418
  }
5418
- return (g, C) => {
5419
- const x = G("fm-button"), M = G("fm-icon"), R = G("FmFormGroup"), _ = G("fm-table");
5419
+ return (_, A) => {
5420
+ const y = G("fm-button"), k = G("fm-icon"), x = G("FmFormGroup"), w = G("fm-table");
5420
5421
  return O(), Y(Ke, {
5421
5422
  title: p(l)("menu.product.form.variant.title"),
5422
5423
  "sub-title": p(l)("menu.product.form.variant.subtitle")
5423
5424
  }, {
5424
- "append-title": L(() => [p(n).rules.item.variant ? (O(), Y(x, {
5425
+ "append-title": L(() => [p(n).rules.item.variant ? (O(), Y(y, {
5425
5426
  key: 0,
5426
5427
  label: p(l)("menu.product.form.variant.add"),
5427
5428
  variant: "secondary",
5428
5429
  "prepend-icon": "add",
5429
- onClick: v
5430
+ onClick: g
5430
5431
  }, null, 8, ["label"])) : te("", !0)]),
5431
5432
  default: L(() => {
5432
- var A;
5433
- return [P("div", is, [w(R, {
5434
- "model-value": (A = g.form.variant) == null ? void 0 : A.variantGroupIds,
5435
- rules: [y]
5433
+ var R;
5434
+ return [P("div", is, [S(x, {
5435
+ "model-value": (R = _.form.variant) == null ? void 0 : R.variantGroupIds,
5436
+ rules: [b]
5436
5437
  }, {
5437
5438
  default: L(() => {
5438
5439
  var U;
5439
- return [w(p(Gi), {
5440
- "model-value": ((U = g.form.variant) == null ? void 0 : U.variantGroupIds) ?? [],
5440
+ return [S(p(Gi), {
5441
+ "model-value": ((U = _.form.variant) == null ? void 0 : U.variantGroupIds) ?? [],
5441
5442
  class: "space-y-16",
5442
5443
  group: "variants",
5443
5444
  handle: ".handle",
5444
5445
  "item-key": "id",
5445
- "onUpdate:modelValue": S
5446
+ "onUpdate:modelValue": C
5446
5447
  }, {
5447
5448
  item: L(({
5448
5449
  element: V
5449
5450
  }) => {
5450
5451
  var N;
5451
- return [P("div", ns, [w(x, {
5452
+ return [P("div", ns, [S(y, {
5452
5453
  variant: p(qe).Tertiary,
5453
5454
  class: "handle",
5454
5455
  "prepend-icon": "drag_handle"
5455
- }, null, 8, ["variant"]), P("div", os, [P("p", as, de((N = d.value[V]) == null ? void 0 : N.name), 1), w(M, {
5456
+ }, null, 8, ["variant"]), P("div", os, [P("p", as, de((N = d.value[V]) == null ? void 0 : N.name), 1), S(k, {
5456
5457
  class: "cursor-pointer",
5457
5458
  name: "close",
5458
5459
  onClick: Rt((q) => {
5459
5460
  var re;
5460
- return E(((re = g.form.variant) == null ? void 0 : re.variantGroupIds.filter((Ce) => Ce !== V)) ?? []);
5461
+ return E(((re = _.form.variant) == null ? void 0 : re.variantGroupIds.filter((Ce) => Ce !== V)) ?? []);
5461
5462
  }, ["stop"])
5462
5463
  }, null, 8, ["onClick"])])])];
5463
5464
  }),
@@ -5465,12 +5466,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5465
5466
  }, 8, ["model-value"])];
5466
5467
  }),
5467
5468
  _: 1
5468
- }, 8, ["model-value", "rules"]), w(pn, null, {
5469
- default: L(() => [z.value.length ? (O(), Y(_, {
5469
+ }, 8, ["model-value", "rules"]), S(pn, null, {
5470
+ default: L(() => [z.value.length ? (O(), Y(w, {
5470
5471
  key: 0,
5471
5472
  class: "w-full",
5472
5473
  "column-defs": D.value,
5473
- "column-visibility": k.value,
5474
+ "column-visibility": M.value,
5474
5475
  "page-size": z.value.length ?? 0,
5475
5476
  "row-data": z.value ?? [],
5476
5477
  "hide-footer": "",
@@ -5538,12 +5539,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5538
5539
  ...Se.generator.initMenuV4Item(),
5539
5540
  category: t.categoryId
5540
5541
  }
5541
- ), b = J(null);
5542
+ ), v = J(null);
5542
5543
  Re(
5543
5544
  () => t.initialForm,
5544
5545
  async () => {
5545
5546
  if (t.initialForm)
5546
- b.value = await bo(
5547
+ v.value = await bo(
5547
5548
  a.state.menu,
5548
5549
  t.initialForm._id
5549
5550
  );
@@ -5554,11 +5555,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5554
5555
  immediate: !0
5555
5556
  }
5556
5557
  );
5557
- const v = ri(), f = async ([W, $]) => {
5558
- a.selectCatalog(W), a.selectScheduler($), await Ui(), v.update(m.value._id), setTimeout(() => {
5558
+ const g = ri(), f = async ([W, $]) => {
5559
+ a.selectCatalog(W), a.selectScheduler($), await Ui(), g.update(m.value._id), setTimeout(() => {
5559
5560
  n("update:show", !1);
5560
5561
  }, 100);
5561
- }, S = F(() => {
5562
+ }, C = F(() => {
5562
5563
  var W;
5563
5564
  return a.mapVariant((W = m.value.variant) == null ? void 0 : W.variantGroupIds);
5564
5565
  }), z = J(null);
@@ -5593,11 +5594,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5593
5594
  }
5594
5595
  const D = F(
5595
5596
  () => !!a.currentCatalog || !!a.state.currentSchedulerId
5596
- ), k = F(() => {
5597
+ ), M = F(() => {
5597
5598
  var W;
5598
5599
  return D.value ? m.value.category == "" || m.value.category == null && ((W = h.value) == null ? void 0 : W.category) == null : a.version === B.F_MENU_VERSION.enum.v4 && m.value.category == null;
5599
- }), y = F(() => o.itemAttributeSettings.value.length > 0 && !D.value);
5600
- function g() {
5600
+ }), b = F(() => o.itemAttributeSettings.value.length > 0 && !D.value);
5601
+ function _() {
5601
5602
  var ce;
5602
5603
  const W = a.getSelectedTax(
5603
5604
  m.value.taxes,
@@ -5606,10 +5607,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5606
5607
  ), se = a.taxSetting.countryTaxOptions.find((H) => H.value === W);
5607
5608
  return se ? zn(se.meta.rate) : "-";
5608
5609
  }
5609
- function C() {
5610
+ function A() {
5610
5611
  z.value = null, m.value.thumbnail = null;
5611
5612
  }
5612
- const x = F(() => {
5613
+ const y = F(() => {
5613
5614
  var W, $, se, ce, H, hi, pi, fi, gi;
5614
5615
  return {
5615
5616
  title: r("menu.product.form.summary.title"),
@@ -5636,7 +5637,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5636
5637
  },
5637
5638
  {
5638
5639
  name: r("menu.product.form.summary.fields.tax"),
5639
- value: g()
5640
+ value: _()
5640
5641
  },
5641
5642
  {
5642
5643
  name: r("menu.product.form.summary.fields.inventory"),
@@ -5653,10 +5654,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5653
5654
  }
5654
5655
  ]
5655
5656
  };
5656
- }), M = J(
5657
+ }), k = J(
5657
5658
  m.value.category != null || !!m.value.code || !!m.value.orderFrom
5658
5659
  );
5659
- function R(W) {
5660
+ function x(W) {
5660
5661
  W || (m.value = {
5661
5662
  ...m.value,
5662
5663
  name: void 0,
@@ -5665,14 +5666,14 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5665
5666
  orderFrom: void 0
5666
5667
  });
5667
5668
  }
5668
- const _ = F(() => {
5669
+ const w = F(() => {
5669
5670
  const W = {};
5670
5671
  return a.state.menu.modules.item.forEach(($) => {
5671
5672
  var se;
5672
5673
  for (const [ce, H] of Object.entries($.customAttributes || {}))
5673
5674
  typeof H == "string" && H && !((se = W[ce]) != null && se.includes(H)) && (W[ce] = [...W[ce] || [], H]);
5674
5675
  }), W;
5675
- }), A = J(!!m.value.price || !!m.value.minPrice || !!m.value.costing);
5676
+ }), R = J(!!m.value.price || !!m.value.minPrice || !!m.value.costing);
5676
5677
  function U(W) {
5677
5678
  W || (m.value = {
5678
5679
  ...m.value,
@@ -5804,8 +5805,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5804
5805
  }
5805
5806
  function ye() {
5806
5807
  D.value && [
5807
- [M.value, R],
5808
- [A.value, U]
5808
+ [k.value, x],
5809
+ [R.value, U]
5809
5810
  ].forEach(([$, se]) => {
5810
5811
  $ || se(!1);
5811
5812
  }), n("submit:form", m.value, z.value), d(), le();
@@ -5816,11 +5817,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5816
5817
  const { isAtMost: lt } = Ni();
5817
5818
  F(() => lt("sm"));
5818
5819
  const si = J(null), vn = Pn(si);
5819
- return (W, $) => (O(), Q(ke, null, [
5820
+ return (W, $) => (O(), Q(Me, null, [
5820
5821
  ve(W.$slots, "trigger", _n(wn({
5821
5822
  trigger: d
5822
5823
  }))),
5823
- w(Un, {
5824
+ S(Un, {
5824
5825
  title: l.value,
5825
5826
  show: c.value,
5826
5827
  "primary-action": {
@@ -5839,8 +5840,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5839
5840
  p(lt)("sm") ? (O(), Y(Si, {
5840
5841
  key: 0,
5841
5842
  variant: "dialog",
5842
- title: x.value.title,
5843
- items: x.value.items
5843
+ title: y.value.title,
5844
+ items: y.value.items
5844
5845
  }, null, 8, ["title", "items"])) : te("", !0)
5845
5846
  ]),
5846
5847
  default: L(() => {
@@ -5854,8 +5855,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5854
5855
  left: p(vn).right + "px"
5855
5856
  }),
5856
5857
  variant: "full",
5857
- title: x.value.title,
5858
- items: x.value.items
5858
+ title: y.value.title,
5859
+ items: y.value.items
5859
5860
  }, null, 8, ["style", "title", "items"])),
5860
5861
  P("div", ss, [
5861
5862
  P("div", {
@@ -5863,58 +5864,58 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5863
5864
  ref: si,
5864
5865
  class: Le(["flex-1 py-24 space-y-24", "xs:w-full"])
5865
5866
  }, [
5866
- b.value && (Object.keys(b.value.catalogs || {}).length > 0 || b.value.schedulers.length > 0) ? (O(), Y(no, {
5867
+ v.value && (Object.keys(v.value.catalogs || {}).length > 0 || v.value.schedulers.length > 0) ? (O(), Y(no, {
5867
5868
  key: 0,
5868
- "linked-status": b.value,
5869
+ "linked-status": v.value,
5869
5870
  "onUpdate:catalogAndScheduler": f
5870
5871
  }, null, 8, ["linked-status"])) : te("", !0),
5871
- w(Ze, {
5872
- toggle: M.value,
5872
+ S(Ze, {
5873
+ toggle: k.value,
5873
5874
  "onUpdate:toggle": [
5874
- $[1] || ($[1] = (H) => M.value = H),
5875
- $[2] || ($[2] = (H) => R(H))
5875
+ $[1] || ($[1] = (H) => k.value = H),
5876
+ $[2] || ($[2] = (H) => x(H))
5876
5877
  ],
5877
5878
  disabled: !D.value,
5878
5879
  description: p(r)("menu.product.form.sections.general.description"),
5879
5880
  title: p(r)("menu.product.form.sections.general.title")
5880
5881
  }, {
5881
5882
  default: L(() => [
5882
- w(Pa, {
5883
+ S(Pa, {
5883
5884
  fallback: h.value,
5884
5885
  form: m.value,
5885
- "is-addon": k.value,
5886
+ "is-addon": M.value,
5886
5887
  "is-override": D.value,
5887
5888
  "is-create": t.action === "add",
5888
5889
  thumbnail: z.value,
5889
5890
  "onUpdate:form": E,
5890
5891
  "onUpdate:thumbnail": $[0] || ($[0] = (H) => z.value = H),
5891
- "onReset:thumbnail": C
5892
+ "onReset:thumbnail": A
5892
5893
  }, null, 8, ["fallback", "form", "is-addon", "is-override", "is-create", "thumbnail"])
5893
5894
  ]),
5894
5895
  _: 1
5895
5896
  }, 8, ["toggle", "disabled", "description", "title"]),
5896
5897
  D.value ? te("", !0) : (O(), Q("div", ls)),
5897
- y.value ? (O(), Y(Ke, {
5898
+ b.value ? (O(), Y(Ke, {
5898
5899
  key: 2,
5899
5900
  title: p(r)("menu.product.form.sections.tagging.title"),
5900
5901
  "sub-title": p(r)("menu.product.form.sections.tagging.subtitle")
5901
5902
  }, {
5902
5903
  default: L(() => [
5903
- w(p(Fn), {
5904
+ S(p(Fn), {
5904
5905
  entity: "item",
5905
5906
  "model-value": m.value.customAttributes || {},
5906
5907
  "onUpdate:modelValue": $[3] || ($[3] = (H) => E("customAttributes", H)),
5907
- "value-options": _.value
5908
+ "value-options": w.value
5908
5909
  }, null, 8, ["model-value", "value-options"])
5909
5910
  ]),
5910
5911
  _: 1
5911
5912
  }, 8, ["title", "sub-title"])) : te("", !0),
5912
- y.value ? (O(), Q("div", us)) : te("", !0),
5913
+ b.value ? (O(), Q("div", us)) : te("", !0),
5913
5914
  D.value ? te("", !0) : (O(), Q("div", cs)),
5914
- w(Ze, {
5915
- toggle: A.value,
5915
+ S(Ze, {
5916
+ toggle: R.value,
5916
5917
  "onUpdate:toggle": [
5917
- $[4] || ($[4] = (H) => A.value = H),
5918
+ $[4] || ($[4] = (H) => R.value = H),
5918
5919
  $[5] || ($[5] = (H) => U(H))
5919
5920
  ],
5920
5921
  disabled: !D.value,
@@ -5922,10 +5923,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5922
5923
  title: p(r)("menu.product.form.sections.price.title")
5923
5924
  }, {
5924
5925
  default: L(() => [
5925
- w(Pr, {
5926
+ S(Pr, {
5926
5927
  fallback: h.value,
5927
5928
  form: m.value,
5928
- "is-addon": k.value,
5929
+ "is-addon": M.value,
5929
5930
  "is-override": D.value,
5930
5931
  "onUpdate:form": E
5931
5932
  }, null, 8, ["fallback", "form", "is-addon", "is-override"])
@@ -5945,11 +5946,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5945
5946
  title: "Update print"
5946
5947
  }, {
5947
5948
  default: L(() => [
5948
- w(jr, {
5949
+ S(jr, {
5949
5950
  fallback: h.value,
5950
5951
  form: m.value,
5951
- "full-combinations": S.value,
5952
- "is-addon": k.value,
5952
+ "full-combinations": C.value,
5953
+ "is-addon": M.value,
5953
5954
  "is-override": D.value,
5954
5955
  "onUpdate:form": E,
5955
5956
  "onReplace:form": $[6] || ($[6] = (H) => m.value = H)
@@ -5958,7 +5959,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5958
5959
  _: 1
5959
5960
  }, 8, ["toggle"])) : te("", !0),
5960
5961
  D.value ? te("", !0) : (O(), Q("div", ms)),
5961
- w(Ze, {
5962
+ S(Ze, {
5962
5963
  toggle: V.value,
5963
5964
  "onUpdate:toggle": [
5964
5965
  $[10] || ($[10] = (H) => V.value = H),
@@ -5969,11 +5970,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5969
5970
  title: p(r)("menu.product.form.sections.variant.title")
5970
5971
  }, {
5971
5972
  default: L(() => [
5972
- w(rs, {
5973
+ S(rs, {
5973
5974
  fallback: h.value,
5974
5975
  form: m.value,
5975
- "full-combinations": S.value,
5976
- "is-addon": k.value,
5976
+ "full-combinations": C.value,
5977
+ "is-addon": M.value,
5977
5978
  "is-override": D.value,
5978
5979
  "onUpdate:form": E,
5979
5980
  "onReplace:form": $[9] || ($[9] = (H) => m.value = H)
@@ -5994,11 +5995,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
5994
5995
  title: "Update group"
5995
5996
  }, {
5996
5997
  default: L(() => [
5997
- w(br, {
5998
+ S(br, {
5998
5999
  fallback: h.value,
5999
6000
  form: m.value,
6000
- "full-combinations": S.value,
6001
- "is-addon": k.value,
6001
+ "full-combinations": C.value,
6002
+ "is-addon": M.value,
6002
6003
  "is-override": D.value,
6003
6004
  "onUpdate:form": E,
6004
6005
  "onReplace:form": $[12] || ($[12] = (H) => m.value = H)
@@ -6019,11 +6020,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
6019
6020
  title: p(r)("menu.product.form.sections.inventory.title")
6020
6021
  }, {
6021
6022
  default: L(() => [
6022
- w(wr, {
6023
+ S(wr, {
6023
6024
  fallback: h.value,
6024
6025
  form: m.value,
6025
- "full-combinations": S.value,
6026
- "is-addon": k.value,
6026
+ "full-combinations": C.value,
6027
+ "is-addon": M.value,
6027
6028
  "is-override": D.value,
6028
6029
  "onUpdate:form": E,
6029
6030
  "onReplace:form": $[15] || ($[15] = (H) => m.value = H)
@@ -6044,11 +6045,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
6044
6045
  title: p(r)("menu.product.form.sections.takeaway.title")
6045
6046
  }, {
6046
6047
  default: L(() => [
6047
- w(Wr, {
6048
+ S(Wr, {
6048
6049
  fallback: h.value,
6049
6050
  form: m.value,
6050
- "full-combinations": S.value,
6051
- "is-addon": k.value,
6051
+ "full-combinations": C.value,
6052
+ "is-addon": M.value,
6052
6053
  "is-override": D.value,
6053
6054
  "onUpdate:form": E,
6054
6055
  "onReplace:form": $[18] || ($[18] = (H) => m.value = H)
@@ -6076,16 +6077,16 @@ function gn(e, i) {
6076
6077
  const n = t.map((u) => u._id);
6077
6078
  function a(u) {
6078
6079
  const c = t.map((d) => {
6079
- var b;
6080
- const h = u.find((v) => v._id === d._id), m = (b = d.items) == null ? void 0 : b.map((v) => {
6081
- var S;
6082
- const f = (S = h == null ? void 0 : h.items) == null ? void 0 : S.find(
6083
- (z) => z._id === v._id && z.combinationKey == v.combinationKey
6080
+ var v;
6081
+ const h = u.find((g) => g._id === d._id), m = (v = d.items) == null ? void 0 : v.map((g) => {
6082
+ var C;
6083
+ const f = (C = h == null ? void 0 : h.items) == null ? void 0 : C.find(
6084
+ (z) => z._id === g._id && z.combinationKey == g.combinationKey
6084
6085
  );
6085
6086
  return {
6086
6087
  ...f || {},
6087
- _id: v._id,
6088
- combinationKey: v.combinationKey,
6088
+ _id: g._id,
6089
+ combinationKey: g.combinationKey,
6089
6090
  price: (f == null ? void 0 : f.price) ?? Ae.Dinero.zero().toObject(),
6090
6091
  orderFrom: (f == null ? void 0 : f.orderFrom) ?? B.F_ORDER_FROM.enum.ALL
6091
6092
  };
@@ -6111,89 +6112,89 @@ function gn(e, i) {
6111
6112
  return { ...i, groups: a(i.groups || []) };
6112
6113
  }
6113
6114
  const ri = Pi("item-manager", () => {
6114
- const e = fe(), i = De(), t = Be(), n = He(i), a = Xe(n), o = Cn(), { t: r } = me(), l = (x) => {
6115
+ const e = fe(), i = De(), t = Be(), n = He(i), a = Xe(n), o = Cn(), { t: r } = me(), l = (y) => {
6115
6116
  if (!o) throw new Error("No current instance found");
6116
- const { container: M } = Dn(vs, o, {
6117
- ...x,
6117
+ const { container: k } = Dn(vs, o, {
6118
+ ...y,
6118
6119
  autoShow: !0,
6119
- "onUpdate:show": async (R) => {
6120
- R || (An(null, M), M.remove());
6120
+ "onUpdate:show": async (x) => {
6121
+ x || (An(null, k), k.remove());
6121
6122
  }
6122
6123
  });
6123
6124
  };
6124
- function s(x) {
6125
- var _;
6126
- const M = ne(x), R = (_ = M.variant) == null ? void 0 : _.variantCombinations;
6127
- return delete M.variant, delete M.thumbnail, [M, ...R || []];
6125
+ function s(y) {
6126
+ var w;
6127
+ const k = ne(y), x = (w = k.variant) == null ? void 0 : w.variantCombinations;
6128
+ return delete k.variant, delete k.thumbnail, [k, ...x || []];
6128
6129
  }
6129
- function u(x, M, R, _) {
6130
- const A = ne(M), U = R ? A.modules.catalog.find((T) => T._id === R) : null, V = _ ? A.modules.scheduler.find((T) => T._id === _) : null, N = U ? ne(U) : void 0, q = R ? A.modules.catalog.filter((T) => T._id !== R) : [], re = V ? ne(V) : void 0, Ce = x.reduce((T, K) => (T[K._id] = s(K), T), {});
6130
+ function u(y, k, x, w) {
6131
+ const R = ne(k), U = x ? R.modules.catalog.find((T) => T._id === x) : null, V = w ? R.modules.scheduler.find((T) => T._id === w) : null, N = U ? ne(U) : void 0, q = x ? R.modules.catalog.filter((T) => T._id !== x) : [], re = V ? ne(V) : void 0, Ce = y.reduce((T, K) => (T[K._id] = s(K), T), {});
6131
6132
  function I(T = []) {
6132
- const K = x.map((Z) => Z._id);
6133
+ const K = y.map((Z) => Z._id);
6133
6134
  return [
6134
6135
  ...T.filter((Z) => !K.includes(Z._id)),
6135
6136
  ...Object.values(Ce).flatMap((Z) => Z)
6136
6137
  ];
6137
6138
  }
6138
- return N && _ ? (N.override.scheduler = {
6139
+ return N && w ? (N.override.scheduler = {
6139
6140
  ...N.override.scheduler,
6140
- [_]: {
6141
- ...N.override.scheduler[_],
6142
- _id: _,
6141
+ [w]: {
6142
+ ...N.override.scheduler[w],
6143
+ _id: w,
6143
6144
  items: I(re == null ? void 0 : re.items).map((T) => ({
6144
6145
  ...T,
6145
6146
  orderFrom: B.F_ORDER_FROM.enum.ALL
6146
6147
  }))
6147
6148
  }
6148
- }, A.modules.catalog = [...q, N], A) : N ? (N.override.items = {
6149
+ }, R.modules.catalog = [...q, N], R) : N ? (N.override.items = {
6149
6150
  ...N.override.items,
6150
6151
  ...Ce
6151
- }, A.modules.catalog = [...q, N], A) : re ? (re.items = I(re.items), A.modules.scheduler = [
6152
- ...A.modules.scheduler.filter((T) => T._id !== _),
6152
+ }, R.modules.catalog = [...q, N], R) : re ? (re.items = I(re.items), R.modules.scheduler = [
6153
+ ...R.modules.scheduler.filter((T) => T._id !== w),
6153
6154
  re
6154
- ], A) : {
6155
+ ], R) : {
6155
6156
  ...Se.generator.initMenuV4(),
6156
6157
  modules: {
6157
6158
  ...Se.generator.initMenuV4().modules,
6158
- catalog: A.modules.catalog,
6159
- item: A.modules.item,
6160
- group: A.modules.group,
6161
- scheduler: A.modules.scheduler
6159
+ catalog: R.modules.catalog,
6160
+ item: R.modules.item,
6161
+ group: R.modules.group,
6162
+ scheduler: R.modules.scheduler
6162
6163
  },
6163
- _id: A._id
6164
+ _id: R._id
6164
6165
  };
6165
6166
  }
6166
- function c(x) {
6167
- const { saveMenuWithThumbnail: M } = a;
6167
+ function c(y) {
6168
+ const { saveMenuWithThumbnail: k } = a;
6168
6169
  l({
6169
6170
  action: "add",
6170
- categoryId: x,
6171
- "onSubmit:form": async (R, _) => {
6172
- R.inventoryBindings ?? (R.inventoryBindings = []), R.inventoryBindings.length === 0 && (R.inventoryBindings = null);
6173
- const A = yi();
6174
- await M(R, pe.F_OPERATION_TYPE.create, A, _);
6171
+ categoryId: y,
6172
+ "onSubmit:form": async (x, w) => {
6173
+ x.inventoryBindings ?? (x.inventoryBindings = []), x.inventoryBindings.length === 0 && (x.inventoryBindings = null);
6174
+ const R = yi();
6175
+ await k(x, pe.F_OPERATION_TYPE.create, R, w);
6175
6176
  }
6176
6177
  });
6177
6178
  }
6178
- function d(x, M) {
6179
- var _;
6179
+ function d(y, k) {
6180
+ var w;
6180
6181
  return {
6181
- ...M.find((A) => !A.combinationKey),
6182
+ ...k.find((R) => !R.combinationKey),
6182
6183
  variant: {
6183
- ...x.variant,
6184
- variantCombinations: (_ = x.variant) == null ? void 0 : _.variantCombinations.map((A) => M.find((V) => V.combinationKey === A.combinationKey) || { _id: x._id, combinationKey: A.combinationKey })
6184
+ ...y.variant,
6185
+ variantCombinations: (w = y.variant) == null ? void 0 : w.variantCombinations.map((R) => k.find((V) => V.combinationKey === R.combinationKey) || { _id: y._id, combinationKey: R.combinationKey })
6185
6186
  },
6186
- _id: x._id
6187
+ _id: y._id
6187
6188
  };
6188
6189
  }
6189
- async function h(x, M, R) {
6190
+ async function h(y, k, x) {
6190
6191
  l({
6191
- initialForm: d(x, M || []),
6192
+ initialForm: d(y, k || []),
6192
6193
  action: "update",
6193
- "onSubmit:form": async (_) => {
6194
- _.inventoryBindings ?? (_.inventoryBindings = []), _.inventoryBindings.length === 0 && (_.inventoryBindings = null), await R(
6194
+ "onSubmit:form": async (w) => {
6195
+ w.inventoryBindings ?? (w.inventoryBindings = []), w.inventoryBindings.length === 0 && (w.inventoryBindings = null), await x(
6195
6196
  u(
6196
- [_],
6197
+ [w],
6197
6198
  e.state.menu,
6198
6199
  e.state.currentCatalogId,
6199
6200
  e.state.currentSchedulerId
@@ -6202,59 +6203,59 @@ const ri = Pi("item-manager", () => {
6202
6203
  }
6203
6204
  });
6204
6205
  }
6205
- async function m(x) {
6206
+ async function m(y) {
6206
6207
  var U;
6207
- const M = e.currentCatalog, R = e.state.currentSchedulerId, _ = M.override.scheduler[R] ?? {
6208
- _id: R
6209
- }, A = (U = _ == null ? void 0 : _.items) == null ? void 0 : U.filter((V) => V._id === x._id);
6210
- await h(x, A, async (V) => {
6208
+ const k = e.currentCatalog, x = e.state.currentSchedulerId, w = k.override.scheduler[x] ?? {
6209
+ _id: x
6210
+ }, R = (U = w == null ? void 0 : w.items) == null ? void 0 : U.filter((V) => V._id === y._id);
6211
+ await h(y, R, async (V) => {
6211
6212
  const N = V.modules.catalog.find(
6212
- (q) => q._id === M._id
6213
+ (q) => q._id === k._id
6213
6214
  );
6214
6215
  await new Ue(N, e, a.updateMenu, t).update();
6215
6216
  });
6216
6217
  }
6217
- async function b(x) {
6218
- const M = e.currentCatalog;
6219
- await h(x, M.override.items[x._id], async (R) => {
6220
- const _ = R.modules.catalog.find(
6221
- (A) => A._id === M._id
6218
+ async function v(y) {
6219
+ const k = e.currentCatalog;
6220
+ await h(y, k.override.items[y._id], async (x) => {
6221
+ const w = x.modules.catalog.find(
6222
+ (R) => R._id === k._id
6222
6223
  );
6223
- await new Ue(_, e, a.updateMenu, t).update();
6224
+ await new Ue(w, e, a.updateMenu, t).update();
6224
6225
  });
6225
6226
  }
6226
- async function v(x) {
6227
- const M = e.schedulers.find(
6228
- (_) => _._id === e.state.currentSchedulerId
6229
- ), R = M.items.filter((_) => _._id === x._id);
6230
- await h(x, R, async (_) => {
6231
- const A = _.modules.scheduler.find(
6232
- (U) => U._id === M._id
6227
+ async function g(y) {
6228
+ const k = e.schedulers.find(
6229
+ (w) => w._id === e.state.currentSchedulerId
6230
+ ), x = k.items.filter((w) => w._id === y._id);
6231
+ await h(y, x, async (w) => {
6232
+ const R = w.modules.scheduler.find(
6233
+ (U) => U._id === k._id
6233
6234
  );
6234
- await new _t(A, e, a.updateMenu, t).update();
6235
+ await new _t(R, e, a.updateMenu, t).update();
6235
6236
  });
6236
6237
  }
6237
- async function f(x) {
6238
- var A, U;
6239
- const M = e.state.currentSchedulerId, R = ne(e.currentCatalog), _ = (U = ((A = R.override.scheduler[M]) == null ? void 0 : A.items) || []) == null ? void 0 : U.reduce((V, N) => {
6238
+ async function f(y) {
6239
+ var R, U;
6240
+ const k = e.state.currentSchedulerId, x = ne(e.currentCatalog), w = (U = ((R = x.override.scheduler[k]) == null ? void 0 : R.items) || []) == null ? void 0 : U.reduce((V, N) => {
6240
6241
  if (N.combinationKey) return [...V, N];
6241
- const q = x.find((re) => re._id === N._id);
6242
+ const q = y.find((re) => re._id === N._id);
6242
6243
  return q ? [...V, { ...N, price: q.price }] : [...V, N];
6243
6244
  }, []);
6244
- R.override.scheduler = {
6245
- ...R.override.scheduler,
6246
- [M]: {
6247
- ...R.override.scheduler[M],
6248
- _id: M,
6249
- items: _
6245
+ x.override.scheduler = {
6246
+ ...x.override.scheduler,
6247
+ [k]: {
6248
+ ...x.override.scheduler[k],
6249
+ _id: k,
6250
+ items: w
6250
6251
  }
6251
- }, await new Ue(R, e, a.updateMenu, t).update();
6252
+ }, await new Ue(x, e, a.updateMenu, t).update();
6252
6253
  }
6253
- async function S(x) {
6254
- var A;
6255
- const M = ne(e.currentCatalog), R = (A = Object.entries(M.override.items)) == null ? void 0 : A.reduce(
6254
+ async function C(y) {
6255
+ var R;
6256
+ const k = ne(e.currentCatalog), x = (R = Object.entries(k.override.items)) == null ? void 0 : R.reduce(
6256
6257
  (U, [V, N]) => {
6257
- const q = x.find((Ce) => Ce._id === V);
6258
+ const q = y.find((Ce) => Ce._id === V);
6258
6259
  if (!q)
6259
6260
  return U[V] = N, U;
6260
6261
  const re = N.find((Ce) => !Ce.combinationKey);
@@ -6270,84 +6271,84 @@ const ri = Pi("item-manager", () => {
6270
6271
  ], U;
6271
6272
  },
6272
6273
  {}
6273
- ), { updateMenu: _ } = a;
6274
+ ), { updateMenu: w } = a;
6274
6275
  await new Ue(
6275
6276
  {
6276
- ...M,
6277
+ ...k,
6277
6278
  override: {
6278
- ...M.override,
6279
- items: R
6279
+ ...k.override,
6280
+ items: x
6280
6281
  }
6281
6282
  },
6282
6283
  e,
6283
- _,
6284
+ w,
6284
6285
  t
6285
6286
  ).update();
6286
6287
  }
6287
- async function z(x) {
6288
- const M = ne(e.currentScheduler), R = M.items.reduce((_, A) => {
6289
- if (A.combinationKey) return [..._, A];
6290
- const U = x.find((V) => V._id === A._id);
6291
- return U ? [..._, { ...A, price: U.price }] : [..._, A];
6288
+ async function z(y) {
6289
+ const k = ne(e.currentScheduler), x = k.items.reduce((w, R) => {
6290
+ if (R.combinationKey) return [...w, R];
6291
+ const U = y.find((V) => V._id === R._id);
6292
+ return U ? [...w, { ...R, price: U.price }] : [...w, R];
6292
6293
  }, []);
6293
6294
  await new _t(
6294
6295
  {
6295
- ...M,
6296
- items: R
6296
+ ...k,
6297
+ items: x
6297
6298
  },
6298
6299
  e,
6299
6300
  a.updateMenu,
6300
6301
  t
6301
6302
  ).update();
6302
6303
  }
6303
- async function E(x) {
6304
- const M = x.reduce((_, A) => {
6305
- const U = e.items.find((V) => V._id === A._id);
6306
- return U && _.push({
6304
+ async function E(y) {
6305
+ const k = y.reduce((w, R) => {
6306
+ const U = e.items.find((V) => V._id === R._id);
6307
+ return U && w.push({
6307
6308
  ...U,
6308
- code: A.code ?? U.code,
6309
- name: A.name || U.name,
6310
- price: A.price ?? U.price,
6311
- orderFrom: A.orderFrom ?? U.orderFrom,
6312
- taxes: A.taxes ?? U.taxes,
6313
- category: A.category === void 0 ? U.category : A.category
6314
- }), _;
6315
- }, []), { updateMenu: R } = a;
6316
- await R(
6317
- M.map((_) => ({
6309
+ code: R.code ?? U.code,
6310
+ name: R.name || U.name,
6311
+ price: R.price ?? U.price,
6312
+ orderFrom: R.orderFrom ?? U.orderFrom,
6313
+ taxes: R.taxes ?? U.taxes,
6314
+ category: R.category === void 0 ? U.category : R.category
6315
+ }), w;
6316
+ }, []), { updateMenu: x } = a;
6317
+ await x(
6318
+ k.map((w) => ({
6318
6319
  module: B.F_MENU_MODULE_V4_KEY.enum.item,
6319
6320
  operation: pe.F_OPERATION_TYPE.update,
6320
- data: _
6321
+ data: w
6321
6322
  })),
6322
- `${M.length} products`
6323
+ `${k.length} products`
6323
6324
  );
6324
6325
  }
6325
- function j(x) {
6326
- const { saveMenuWithThumbnail: M } = a;
6326
+ function j(y) {
6327
+ const { saveMenuWithThumbnail: k } = a;
6327
6328
  l({
6328
- initialForm: x,
6329
+ initialForm: y,
6329
6330
  action: "update",
6330
- "onSubmit:form": async (R, _) => {
6331
- const A = yi(x._id);
6332
- R.inventoryBindings ?? (R.inventoryBindings = []), R.inventoryBindings.length === 0 && (R.inventoryBindings = null), await M(R, pe.F_OPERATION_TYPE.update, A, _);
6331
+ "onSubmit:form": async (x, w) => {
6332
+ const R = yi(y._id);
6333
+ x.inventoryBindings ?? (x.inventoryBindings = []), x.inventoryBindings.length === 0 && (x.inventoryBindings = null), await k(x, pe.F_OPERATION_TYPE.update, R, w);
6333
6334
  }
6334
6335
  });
6335
6336
  }
6336
- async function D(x) {
6337
- const M = e.state.menu.modules.item.find((R) => R._id === x);
6338
- e.currentCatalog ? e.state.currentSchedulerId ? await m(M) : await b(M) : e.state.currentSchedulerId ? await v(M) : j(M);
6337
+ async function D(y) {
6338
+ const k = e.state.menu.modules.item.find((x) => x._id === y);
6339
+ e.currentCatalog ? e.state.currentSchedulerId ? await m(k) : await v(k) : e.state.currentSchedulerId ? await g(k) : j(k);
6339
6340
  }
6340
- async function k(x) {
6341
- e.currentCatalog ? e.currentScheduler ? await f(x) : await S(x) : (
6341
+ async function M(y) {
6342
+ e.currentCatalog ? e.currentScheduler ? await f(y) : await C(y) : (
6342
6343
  // If Main
6343
- e.currentScheduler ? await z(x) : await E(x)
6344
+ e.currentScheduler ? await z(y) : await E(y)
6344
6345
  );
6345
6346
  }
6346
- function y(x) {
6347
- const { updateMenu: M } = a, R = x.length > 1 ? `${x.length} products` : x[0].name;
6347
+ function b(y) {
6348
+ const { updateMenu: k } = a, x = y.length > 1 ? `${y.length} products` : y[0].name;
6348
6349
  t.open({
6349
6350
  title: r("menu.common.dialog.remove.product.title"),
6350
- message: r("menu.common.dialog.remove.product.message", { name: R }),
6351
+ message: r("menu.common.dialog.remove.product.message", { name: x }),
6351
6352
  primaryActions: {
6352
6353
  text: r("menu.common.actions.remove"),
6353
6354
  close: !0,
@@ -6358,54 +6359,54 @@ const ri = Pi("item-manager", () => {
6358
6359
  close: !0
6359
6360
  }
6360
6361
  }).onPrimary(async () => {
6361
- await M(
6362
- x.map(({ _id: _ }) => ({
6362
+ await k(
6363
+ y.map(({ _id: w }) => ({
6363
6364
  module: B.F_MENU_MODULE_V4_KEY.enum.item,
6364
6365
  operation: pe.F_OPERATION_TYPE.delete,
6365
- data: _
6366
+ data: w
6366
6367
  })),
6367
- R,
6368
+ x,
6368
6369
  !0
6369
6370
  );
6370
- for (const _ of x)
6371
- _.thumbnail && await En.delete(_.thumbnail);
6371
+ for (const w of y)
6372
+ w.thumbnail && await En.delete(w.thumbnail);
6372
6373
  i.open({
6373
6374
  message: r("menu.common.dialog.remove.product.success"),
6374
6375
  type: "success"
6375
6376
  });
6376
6377
  });
6377
6378
  }
6378
- async function g(x) {
6379
+ async function _(y) {
6379
6380
  e.currentScheduler ? await new _t(
6380
6381
  e.currentScheduler,
6381
6382
  e,
6382
6383
  a.updateMenu,
6383
6384
  t
6384
- ).unlinkProduct(x.map((M) => M._id)) : e.currentCatalog ? await new Ue(
6385
+ ).unlinkProduct(y.map((k) => k._id)) : e.currentCatalog ? await new Ue(
6385
6386
  e.currentCatalog,
6386
6387
  e,
6387
6388
  a.updateMenu,
6388
6389
  t
6389
- ).unlinkProduct(x.map((M) => M._id)) : y(x);
6390
+ ).unlinkProduct(y.map((k) => k._id)) : b(y);
6390
6391
  }
6391
- async function C(x) {
6392
- const { updateMenu: M } = a;
6393
- await M(
6392
+ async function A(y) {
6393
+ const { updateMenu: k } = a;
6394
+ await k(
6394
6395
  {
6395
6396
  module: B.F_MENU_MODULE_V4_KEY.enum.item,
6396
6397
  operation: pe.F_OPERATION_TYPE.rearrange,
6397
- data: x
6398
+ data: y
6398
6399
  },
6399
6400
  "Products"
6400
6401
  );
6401
6402
  }
6402
6403
  return {
6403
- initDynamicGroupItem: (x) => gn(e, x),
6404
+ initDynamicGroupItem: (y) => gn(e, y),
6404
6405
  create: c,
6405
6406
  update: D,
6406
- updateMany: k,
6407
- deleteItem: g,
6408
- rearrange: C
6407
+ updateMany: M,
6408
+ deleteItem: _,
6409
+ rearrange: A
6409
6410
  };
6410
6411
  });
6411
6412
  export {