@feedmepos/mf-menu 0.32.63-dev.4 → 0.32.63
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.
- package/dist/{App-D8wf-3gk.js → App-BBbO4JIS.js} +8 -8
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BBMuf15P.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CbxSzHxq.js} +3 -3
- package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-CR7AGqfY.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-7WuKnUmN.js} +3 -3
- package/dist/{Catalog-Dzs2obez.js → Catalog-BmegfFgh.js} +6 -6
- package/dist/{Category-CF-bfcWZ.js → Category-C7Ue-fUU.js} +4 -4
- package/dist/{Category-CRG_zlyN.js → Category-Ddyf3rse.js} +4 -4
- package/dist/{CookingGuide-CumoLERq.js → CookingGuide-CLgt2sOm.js} +5 -5
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Cw0LfYWI.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-COeFm_ww.js} +1 -1
- package/dist/{Group-Bl6IXiL5.js → Group-CRKR1Ykj.js} +1 -1
- package/dist/{Group-XPHRRll5.js → Group-CYPqL4lj.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-Dp41u-9T.js → Group.vue_vue_type_script_setup_true_lang-NuuNUptx.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DBim4X7-.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B3C6VTGC.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-AK0_2AOY.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-VtcRq2HL.js} +2697 -2697
- package/dist/{Ingredient-BBi88auU.js → Ingredient-DRf6aqJJ.js} +4 -4
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-D8C0do_V.js → InventoryBinding.vue_vue_type_script_setup_true_lang-Bybxf9pl.js} +2 -2
- package/dist/{LinkProductSideSheet-BQc-iCkQ.js → LinkProductSideSheet-HDmjKJSh.js} +4 -4
- package/dist/{MenuSetting-FTo1hoSN.js → MenuSetting-BGbL4Z6H.js} +7 -7
- package/dist/{OrderPacing-BUcd8nJm.js → OrderPacing-DF_HE2Cg.js} +5 -5
- package/dist/{PrintRoute-DUnqYpDY.js → PrintRoute-CnXWRLaD.js} +5 -5
- package/dist/{Product-5jToTVxL.js → Product-Iyo2jhYY.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-CvUR3VeZ.js → Product.vue_vue_type_script_setup_true_lang-HVRVPZqe.js} +13 -13
- package/dist/{ProductInternalTools-DVo8n6WR.js → ProductInternalTools-BInH19jg.js} +7 -7
- package/dist/{Products-74l_V3s-.js → Products-BIhb7G8B.js} +57 -57
- package/dist/{Publish-C_N7lkj5.js → Publish-CKmI_Dm1.js} +4 -4
- package/dist/{Recipe-Ds_84fu9.js → Recipe-BoVvW9JJ.js} +5 -5
- package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-B1wtDQ9P.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-wMFM8TLf.js} +1 -1
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-ntxQXlpV.js → RuleView.vue_vue_type_script_setup_true_lang-BxYsaZfB.js} +595 -595
- package/dist/{Scheduler--pD1opc1.js → Scheduler-QZtG4Vyg.js} +3 -3
- package/dist/{ServingSequence-B3xxkMbp.js → ServingSequence-BsCeJ9tY.js} +3 -3
- package/dist/{Setting-GBA945nB.js → Setting-C4zVAUUs.js} +5 -5
- package/dist/{Subcategory-BikyD-je.js → Subcategory-Cqj_0Zcf.js} +6 -6
- package/dist/{Takeaway-DqDIobRV.js → Takeaway-Bg_Ulvvu.js} +1 -1
- package/dist/{Takeaway-XPKWPa1W.js → Takeaway-hlLosEp5.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CJG-SwOd.js → Takeaway.vue_vue_type_script_setup_true_lang-VokixlT7.js} +5 -5
- package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-ogrcEhDA.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-Cqt2GuoP.js} +1 -1
- package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-BZfaB7Vl.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-D-gqJRTs.js} +2 -2
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DaSfi9fx.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BgfluI5H.js} +605 -603
- package/dist/{Unit-yJJmRvha.js → Unit-DcXSwJZn.js} +2 -2
- package/dist/{Variant-DcCYBJS2.js → Variant-B0gnJndI.js} +3 -3
- package/dist/{_id_-BpkYdn5i.js → _id_-Do06Eogr.js} +9 -9
- package/dist/{app-BzMTHTrI.js → app-CoLRt3Jh.js} +1 -1
- package/dist/{app-BMI3O5C9.js → app-b2SIk1B-.js} +32 -32
- package/dist/app.js +1 -1
- package/dist/assets/{linked-status-C8NLd-zI.js → linked-status-D83s5iw2.js} +3 -3
- package/dist/assets/{menu-export-hXupkCVZ.js → menu-export-CTANUT4c.js} +6 -6
- package/dist/assets/{override-menu-CwJOJV2k.js → override-menu-BU4SgNGf.js} +3 -3
- package/dist/assets/{validate-menu-BrXEl7Mi.js → validate-menu-C5Oth47D.js} +2 -2
- package/dist/{catalog-L2sdRcQf.js → catalog-D7j4_Q_e.js} +1 -1
- package/dist/{catalogSetting-CGSmZhMj.js → catalogSetting-g3y-LVDw.js} +1 -1
- package/dist/{currency-QIXheiUu.js → currency-tR7w0ukg.js} +1 -1
- package/dist/{dayjs.min-CGH3EzsL.js → dayjs.min-D1MKpV8B.js} +2 -2
- package/dist/{discardConfirm-B61hQjlH.js → discardConfirm-BaKm8467.js} +1 -1
- package/dist/{index-DCSeBwkM.js → index-CQkYxKQd.js} +5 -5
- package/dist/{index-CUcUva0h.js → index-LnI6_0IZ.js} +6 -6
- package/dist/{index.vue_vue_type_script_setup_true_lang-BVBi4Vvc.js → index.vue_vue_type_script_setup_true_lang-P7O7STU9.js} +7 -7
- package/dist/{item-BMyRZqY8.js → item-43Eu4ZXr.js} +550 -550
- package/dist/{jszip.min-BaD6pNmW.js → jszip.min-B_t4VNZS.js} +529 -529
- package/dist/{linkProducts-CqH6KCgg.js → linkProducts-8GEwo-Eo.js} +4 -4
- package/dist/{memberPricing-DNAuPva3.js → memberPricing-DNqHrCnd.js} +1 -1
- package/dist/{menu-BNrZkzpK.js → menu-CjpQrL-3.js} +1 -1
- package/dist/{menuV2-D1bGhwPG.js → menuV2-CiFcZLoW.js} +47 -47
- package/dist/{order_pacing-CmC9xxja.js → order_pacing-DXKwdyi5.js} +5 -5
- package/dist/{priceTier-DZ5JRGkT.js → priceTier-BVEITapN.js} +1 -1
- package/dist/{rules-B2yeUFyY.js → rules-BEYt9OD5.js} +3 -3
- package/dist/{scheduler-DVKJQGbT.js → scheduler-7EG7twK8.js} +5 -5
- package/dist/{toExcel-D8feJ9ZC.js → toExcel-VC6zCquB.js} +2 -2
- package/dist/{unit-DI5JogzR.js → unit-C2SwnTZh.js} +3 -3
- package/package.json +1 -1
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import { defineStore as Ni } from "pinia";
|
|
2
2
|
import { defineComponent as fe, resolveComponent as M, createElementBlock as W, createBlock as Q, openBlock as _, createElementVNode as C, createVNode as h, toDisplayString as oe, Fragment as ve, renderList as Ie, h as Ue, ref as H, computed as E, watch as Se, unref as m, renderSlot as Oe, withCtx as F, createCommentVNode as ee, Transition as ar, normalizeClass as Ve, resolveDynamicComponent as Cn, withDirectives as Xe, vShow as Pn, mergeProps as Bi, withModifiers as ct, onBeforeUnmount as Li, resolveDirective as Ht, onMounted as Wt, onUnmounted as Eo, createTextVNode as Sn, getCurrentInstance as Oo, render as xn, useSlots as rr, markRaw as sr, mergeModels as Xo, useModel as lr, isVNode as ur, nextTick as ji, normalizeProps as cr, guardReactiveProps as dr, normalizeStyle as mr } from "vue";
|
|
3
|
-
import { V as pr, W as fr, g as Ne, h as Be, k as Pe, T as hr, X as gr, s as Wi, d as Ce, m as at, j as Te, a as Ye, n as vr, u as De, b as st, i as pt, Y as br, Z as yr, $ as Gi, a0 as _n, a1 as Zo, a2 as Gn, a3 as Et, a4 as _r, a5 as wr, a6 as Qo, a7 as kr, a8 as Cr, a9 as Jo, aa as Sr, ab as xr, ac as Ar, ad as ei, ae as ti, t as Hi, af as Tr, F as At, x as ni, r as Rr, o as Ir, l as Er, I as Hn, ag as Or, Q as Dr, w as oi, v as $r, ah as Pr } from "./index.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { V as pr, W as fr, g as Ne, h as Be, k as Pe, T as hr, X as gr, s as Wi, d as Ce, m as at, j as Te, a as Ye, n as vr, u as De, b as st, i as pt, Y as br, Z as yr, $ as Gi, a0 as _n, a1 as Zo, a2 as Gn, a3 as Et, a4 as _r, a5 as wr, a6 as Qo, a7 as kr, a8 as Cr, a9 as Jo, aa as Sr, ab as xr, ac as Ar, ad as ei, ae as ti, t as Hi, af as Tr, F as At, x as ni, r as Rr, o as Ir, l as Er, I as Hn, ag as Or, Q as Dr, w as oi, v as $r, ah as Pr } from "./index.vue_vue_type_script_setup_true_lang-P7O7STU9.js";
|
|
4
4
|
import { useI18n as ge, useCoreStore as zt, CustomAttributesForm as Ki } from "@feedmepos/mf-common";
|
|
5
5
|
import { useDialog as tt, useSnackbar as Qe, useDialogChild as Nt, FmButtonVariant as ze, components as Ee, FmButtonColorThemeVariant as nt, useBreakpoints as qi } from "@feedmepos/ui-library";
|
|
6
|
-
import { C as gt } from "./catalog-
|
|
7
|
-
import { g as co, a as Vr, m as Fr, i as Mr } from "./menuV2-
|
|
6
|
+
import { C as gt } from "./catalog-D7j4_Q_e.js";
|
|
7
|
+
import { g as co, a as Vr, m as Fr, i as Mr } from "./menuV2-CiFcZLoW.js";
|
|
8
8
|
import { c as Yi } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
9
9
|
import { a as ii, _ as Vt } from "./tooltip-B5BiPMx9.js";
|
|
10
|
-
import { H as Ur, L as zr } from "./LinkProductSideSheet-
|
|
11
|
-
import { _ as Ke, u as Nr, a as Br } from "./RuleView.vue_vue_type_script_setup_true_lang-
|
|
10
|
+
import { H as Ur, L as zr } from "./LinkProductSideSheet-HDmjKJSh.js";
|
|
11
|
+
import { _ as Ke, u as Nr, a as Br } from "./RuleView.vue_vue_type_script_setup_true_lang-BxYsaZfB.js";
|
|
12
12
|
import { a as Gt, s as mo, F as Lr, _ as jr } from "./index-CD_omf3p.js";
|
|
13
|
-
import { e as Wr } from "./app-
|
|
14
|
-
import { l as $e, u as Xt } from "./discardConfirm-
|
|
13
|
+
import { e as Wr } from "./app-b2SIk1B-.js";
|
|
14
|
+
import { l as $e, u as Xt } from "./discardConfirm-BaKm8467.js";
|
|
15
15
|
import { _ as Tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
16
|
import { useAppStore as cn, RemyButton as An } from "@feedmepos/mf-remy-panel";
|
|
17
17
|
import { _ as yt } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
|
|
18
|
-
import { u as Gr, r as Hr } from "./rules-
|
|
19
|
-
import { _ as Xi, a as Tn, b as Rn, c as In } from "./TranslationFieldSection.vue_vue_type_script_setup_true_lang-
|
|
18
|
+
import { u as Gr, r as Hr } from "./rules-BEYt9OD5.js";
|
|
19
|
+
import { _ as Xi, a as Tn, b as Rn, c as In } from "./TranslationFieldSection.vue_vue_type_script_setup_true_lang-Cqt2GuoP.js";
|
|
20
20
|
import { a as po, g as Ct } from "./translation-fNx6yEpy.js";
|
|
21
21
|
import { c as En } from "./object-DVUNCr7w.js";
|
|
22
|
-
import { _ as Do } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-
|
|
23
|
-
import { u as Kr } from "./menu-
|
|
22
|
+
import { _ as Do } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-D-gqJRTs.js";
|
|
23
|
+
import { u as Kr } from "./menu-CjpQrL-3.js";
|
|
24
24
|
import { c as Bt } from "./check-C9mY6LiX.js";
|
|
25
|
-
import { _ as bt, l as fo, T as qr } from "./index-
|
|
25
|
+
import { _ as bt, l as fo, T as qr } from "./index-LnI6_0IZ.js";
|
|
26
26
|
import { useInventoryStore as Zi, InventoryBindingForm as Yr, InventoryBindingSummary as Xr } from "@feedmepos/mf-inventory-portal";
|
|
27
|
-
import { f as rt } from "./currency-
|
|
28
|
-
import { u as Vn } from "./memberPricing-
|
|
29
|
-
import { u as Qi } from "./priceTier-
|
|
27
|
+
import { f as rt } from "./currency-tR7w0ukg.js";
|
|
28
|
+
import { u as Vn } from "./memberPricing-DNqHrCnd.js";
|
|
29
|
+
import { u as Qi } from "./priceTier-BVEITapN.js";
|
|
30
30
|
import { u as Zr } from "./search-BAPEUu1R.js";
|
|
31
31
|
import { c as Qr } from "./string-DpfFixWH.js";
|
|
32
32
|
import { d as Ji } from "./RuleConditionSelector.vue_vue_type_style_index_0_lang-CK8z7qA8.js";
|
|
33
|
-
import { _ as Jr } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-
|
|
34
|
-
import { u as es, a as ts } from "./order_pacing-
|
|
35
|
-
import { V as ai } from "./index-
|
|
33
|
+
import { _ as Jr } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-CbxSzHxq.js";
|
|
34
|
+
import { u as es, a as ts } from "./order_pacing-DXKwdyi5.js";
|
|
35
|
+
import { V as ai } from "./index-CQkYxKQd.js";
|
|
36
36
|
var Kn, mn, qn = 0, Yn = 0;
|
|
37
37
|
function ns(e, t, n) {
|
|
38
38
|
var o = 0, i = new Array(16);
|
|
@@ -425,16 +425,16 @@ class ta {
|
|
|
425
425
|
const i = this.menuStore.state.menu.modules.item, a = this.menuStore.state.menu.modules.group, r = this.menuStore.items, l = this.menuStore.rules.group.linkAddonName;
|
|
426
426
|
function s(u, d) {
|
|
427
427
|
const c = u.items.reduce((f, g) => {
|
|
428
|
-
var
|
|
429
|
-
const w = i.find((
|
|
428
|
+
var P, N, B, k;
|
|
429
|
+
const w = i.find((O) => g._id === O._id);
|
|
430
430
|
if (!w && n) return f;
|
|
431
431
|
const y = g.combinationKey ? {
|
|
432
|
-
...(
|
|
433
|
-
(
|
|
432
|
+
...(P = w == null ? void 0 : w.variant) == null ? void 0 : P.variantCombinations.find(
|
|
433
|
+
(O) => O.combinationKey === g.combinationKey
|
|
434
434
|
),
|
|
435
435
|
name: vr(De().variants, ((N = w == null ? void 0 : w.variant) == null ? void 0 : N.variantGroupIds) || [])[g.combinationKey]
|
|
436
|
-
} : w, b = (B = a.find((
|
|
437
|
-
(
|
|
436
|
+
} : w, b = (B = a.find((O) => O._id === u._id)) == null ? void 0 : B.items.find((O) => O._id === g._id && O.combinationKey === g.combinationKey), R = !n && !g.combinationKey, A = (k = d.find(
|
|
437
|
+
(O) => O._id == g._id && O.combinationKey == g.combinationKey
|
|
438
438
|
)) == null ? void 0 : k.price, L = l ? null : y == null ? void 0 : y.name, I = g.name || (b == null ? void 0 : b.name) || L || null, T = (y == null ? void 0 : y.name) || null, x = g.name_locale ?? (b == null ? void 0 : b.name_locale) ?? (y == null ? void 0 : y.name_locale) ?? null, U = {
|
|
439
439
|
...g,
|
|
440
440
|
name: I,
|
|
@@ -1355,7 +1355,7 @@ const zs = /* @__PURE__ */ Tt(Fs, [["render", Us]]), Ns = { class: "flex flex-co
|
|
|
1355
1355
|
},
|
|
1356
1356
|
{ immediate: !0 }
|
|
1357
1357
|
), (R, A) => {
|
|
1358
|
-
const L = M("FmIcon"), I = M("FmField"), T = M("FmMenuItem"), x = M("FmMenu"), U = M("FmFormGroup"),
|
|
1358
|
+
const L = M("FmIcon"), I = M("FmField"), T = M("FmMenuItem"), x = M("FmMenu"), U = M("FmFormGroup"), P = M("FmChipGroup");
|
|
1359
1359
|
return _(), W("div", ol, [
|
|
1360
1360
|
h(U, {
|
|
1361
1361
|
"model-value": R.modelValue,
|
|
@@ -1426,7 +1426,7 @@ const zs = /* @__PURE__ */ Tt(Fs, [["render", Us]]), Ns = { class: "flex flex-co
|
|
|
1426
1426
|
_: 1
|
|
1427
1427
|
}, 8, ["model-value", "disabled", "focused", "helper-state", "helper-text", "rules"]),
|
|
1428
1428
|
R.shouldShowChips && d.value.length > 0 ? (_(), W("div", rl, [
|
|
1429
|
-
h(
|
|
1429
|
+
h(P, {
|
|
1430
1430
|
disabled: R.disabled,
|
|
1431
1431
|
items: d.value.map((N) => ({ label: N.label })),
|
|
1432
1432
|
removable: "",
|
|
@@ -3062,16 +3062,16 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3062
3062
|
};
|
|
3063
3063
|
function I(v, S) {
|
|
3064
3064
|
if (!c.value || S !== "active") return null;
|
|
3065
|
-
const
|
|
3066
|
-
return q ? `${
|
|
3065
|
+
const V = Zo(c.value.url, v), q = b.value[v];
|
|
3066
|
+
return q ? `${V}&t=${q}` : V;
|
|
3067
3067
|
}
|
|
3068
3068
|
const T = H(!1), x = H(null), U = E(() => {
|
|
3069
3069
|
if (!c.value) return null;
|
|
3070
3070
|
const v = x.value;
|
|
3071
3071
|
if (!v) return c.value.url;
|
|
3072
|
-
const S = Zo(c.value.url, v),
|
|
3073
|
-
return
|
|
3074
|
-
}),
|
|
3072
|
+
const S = Zo(c.value.url, v), V = b.value[v];
|
|
3073
|
+
return V ? `${S}&t=${V}` : S;
|
|
3074
|
+
}), P = E(
|
|
3075
3075
|
() => x.value ? Gn(x.value) : i("menu.product_image.manage.original")
|
|
3076
3076
|
);
|
|
3077
3077
|
function N(v) {
|
|
@@ -3079,8 +3079,8 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3079
3079
|
}
|
|
3080
3080
|
function B(v) {
|
|
3081
3081
|
const S = /* @__PURE__ */ new Set();
|
|
3082
|
-
for (const
|
|
3083
|
-
for (const q of
|
|
3082
|
+
for (const V of v)
|
|
3083
|
+
for (const q of V.images ?? [])
|
|
3084
3084
|
for (const re of Object.keys(q.imageSet ?? {}))
|
|
3085
3085
|
Et.includes(re) || S.add(re);
|
|
3086
3086
|
return S;
|
|
@@ -3088,14 +3088,14 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3088
3088
|
const k = E(() => {
|
|
3089
3089
|
var S;
|
|
3090
3090
|
const v = B(n.menuItems ?? []);
|
|
3091
|
-
for (const
|
|
3092
|
-
Et.includes(
|
|
3091
|
+
for (const V of Object.keys(((S = c.value) == null ? void 0 : S.imageSet) ?? {}))
|
|
3092
|
+
Et.includes(V) || v.add(V);
|
|
3093
3093
|
return [...v];
|
|
3094
|
-
}),
|
|
3095
|
-
var
|
|
3096
|
-
const v = Object.keys(((
|
|
3094
|
+
}), O = E(() => {
|
|
3095
|
+
var V;
|
|
3096
|
+
const v = Object.keys(((V = c.value) == null ? void 0 : V.imageSet) ?? {});
|
|
3097
3097
|
return [...Et.filter((q) => v.includes(q)), ...k.value].map((q) => {
|
|
3098
|
-
var
|
|
3098
|
+
var $;
|
|
3099
3099
|
const re = R.value[q] ? "pending" : f.value[q];
|
|
3100
3100
|
return {
|
|
3101
3101
|
ratio: q,
|
|
@@ -3106,7 +3106,7 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3106
3106
|
url: I(q, re),
|
|
3107
3107
|
// A union-only ratio this image has never carried cannot be removed here: the ✕
|
|
3108
3108
|
// deletes this image's own variant, so it only renders for ratios the image has.
|
|
3109
|
-
removable: !Et.includes(q) && q in (((
|
|
3109
|
+
removable: !Et.includes(q) && q in ((($ = c.value) == null ? void 0 : $.imageSet) ?? {})
|
|
3110
3110
|
};
|
|
3111
3111
|
});
|
|
3112
3112
|
}), z = E(
|
|
@@ -3123,18 +3123,18 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3123
3123
|
try {
|
|
3124
3124
|
const S = await _r.listImages([n.itemId]);
|
|
3125
3125
|
if (!n.modelValue) return;
|
|
3126
|
-
const
|
|
3126
|
+
const V = S.find((D) => {
|
|
3127
3127
|
var K;
|
|
3128
|
-
return
|
|
3128
|
+
return D.imageId === ((K = c.value) == null ? void 0 : K._id);
|
|
3129
3129
|
}), q = f.value;
|
|
3130
3130
|
f.value = Object.fromEntries(
|
|
3131
|
-
((
|
|
3131
|
+
((V == null ? void 0 : V.variants) ?? []).map((D) => [D.aspectRatio, D.status])
|
|
3132
3132
|
), g.value = !0;
|
|
3133
|
-
const re = Date.now(),
|
|
3134
|
-
Object.entries(
|
|
3135
|
-
const X = f.value[
|
|
3136
|
-
!X && !le && re < K || (delete D
|
|
3137
|
-
}), R.value =
|
|
3133
|
+
const re = Date.now(), $ = { ...R.value };
|
|
3134
|
+
Object.entries($).forEach(([D, K]) => {
|
|
3135
|
+
const X = f.value[D] === "active" && q[D] !== "active", le = f.value[D] === "failed";
|
|
3136
|
+
!X && !le && re < K || (delete $[D], b.value = { ...b.value, [D]: re });
|
|
3137
|
+
}), R.value = $;
|
|
3138
3138
|
} catch {
|
|
3139
3139
|
return;
|
|
3140
3140
|
}
|
|
@@ -3191,8 +3191,8 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3191
3191
|
y.value = v;
|
|
3192
3192
|
try {
|
|
3193
3193
|
await S();
|
|
3194
|
-
} catch (
|
|
3195
|
-
r.open({ message: `${
|
|
3194
|
+
} catch (V) {
|
|
3195
|
+
r.open({ message: `${V}`, type: "error" });
|
|
3196
3196
|
} finally {
|
|
3197
3197
|
y.value = null;
|
|
3198
3198
|
}
|
|
@@ -3206,20 +3206,20 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3206
3206
|
contentComponentProps: { ratio: v.ratio },
|
|
3207
3207
|
primaryActions: { text: i("menu.common.actions.confirm"), close: !0 },
|
|
3208
3208
|
secondaryActions: { text: i("menu.common.actions.cancel"), close: !0 }
|
|
3209
|
-
}).onPrimary((
|
|
3210
|
-
if (!
|
|
3209
|
+
}).onPrimary((V) => {
|
|
3210
|
+
if (!V) {
|
|
3211
3211
|
r.open({ message: i("menu.product_image.replace.no_file"), type: "error" });
|
|
3212
3212
|
return;
|
|
3213
3213
|
}
|
|
3214
3214
|
me(v.ratio, async () => {
|
|
3215
|
-
c.value = await kr(n.itemId, S, v.ratio,
|
|
3215
|
+
c.value = await kr(n.itemId, S, v.ratio, V);
|
|
3216
3216
|
const q = { ...w.value };
|
|
3217
3217
|
delete q[v.ratio], w.value = q, b.value = { ...b.value, [v.ratio]: Date.now() }, r.open({ message: i("menu.product_image.replace.done"), type: "success" }), ne();
|
|
3218
3218
|
});
|
|
3219
3219
|
});
|
|
3220
3220
|
}
|
|
3221
3221
|
function te(v) {
|
|
3222
|
-
var
|
|
3222
|
+
var V;
|
|
3223
3223
|
if (n.coverOnly || !c.value) return;
|
|
3224
3224
|
const S = c.value;
|
|
3225
3225
|
if (w.value[v.ratio] === !0 || g.value && !f.value[v.ratio]) {
|
|
@@ -3244,7 +3244,7 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3244
3244
|
ratioLabel: v.label,
|
|
3245
3245
|
// A ratio holding a custom image must never be re-derived from the original —
|
|
3246
3246
|
// that would silently discard the merchant's own photo.
|
|
3247
|
-
canRegenerateFromOrigin: !((
|
|
3247
|
+
canRegenerateFromOrigin: !((V = S.imageSet) != null && V[v.ratio])
|
|
3248
3248
|
},
|
|
3249
3249
|
primaryActions: { text: i("menu.product_image.regenerate.action"), close: !0 },
|
|
3250
3250
|
secondaryActions: { text: i("menu.common.actions.cancel"), close: !0 }
|
|
@@ -3261,8 +3261,8 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3261
3261
|
q,
|
|
3262
3262
|
re
|
|
3263
3263
|
);
|
|
3264
|
-
const
|
|
3265
|
-
delete
|
|
3264
|
+
const $ = { ...w.value };
|
|
3265
|
+
delete $[v.ratio], w.value = $, R.value = {
|
|
3266
3266
|
...R.value,
|
|
3267
3267
|
[v.ratio]: Date.now() + yi
|
|
3268
3268
|
}, r.open({ message: i("menu.product_image.regenerate.queued"), type: "success" }), ne();
|
|
@@ -3273,8 +3273,8 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3273
3273
|
function ce(v) {
|
|
3274
3274
|
if (n.coverOnly || !c.value) return;
|
|
3275
3275
|
if (w.value[v]) {
|
|
3276
|
-
const
|
|
3277
|
-
delete
|
|
3276
|
+
const V = { ...c.value.imageSet };
|
|
3277
|
+
delete V[v], c.value = { ...c.value, imageSet: V };
|
|
3278
3278
|
const q = { ...w.value };
|
|
3279
3279
|
delete q[v], w.value = q;
|
|
3280
3280
|
return;
|
|
@@ -3290,10 +3290,10 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3290
3290
|
}).onPrimary(async () => {
|
|
3291
3291
|
try {
|
|
3292
3292
|
c.value = await wr(n.itemId, S, v);
|
|
3293
|
-
const
|
|
3294
|
-
delete
|
|
3295
|
-
} catch (
|
|
3296
|
-
r.open({ message: `${
|
|
3293
|
+
const V = { ...f.value };
|
|
3294
|
+
delete V[v], f.value = V;
|
|
3295
|
+
} catch (V) {
|
|
3296
|
+
r.open({ message: `${V}`, type: "error" });
|
|
3297
3297
|
}
|
|
3298
3298
|
});
|
|
3299
3299
|
}
|
|
@@ -3304,8 +3304,8 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3304
3304
|
c.value && !$e.isEqual(c.value, p.value) && o("update:image", c.value), u.value = !1;
|
|
3305
3305
|
}
|
|
3306
3306
|
return (v, S) => {
|
|
3307
|
-
const
|
|
3308
|
-
return _(), Q(
|
|
3307
|
+
const V = M("fm-button"), q = M("fm-chip"), re = M("fm-switch"), $ = M("fm-dialog"), D = M("fm-side-sheet"), K = Ht("tooltip");
|
|
3308
|
+
return _(), Q(D, {
|
|
3309
3309
|
id: "manage-product-image",
|
|
3310
3310
|
modelValue: u.value,
|
|
3311
3311
|
"onUpdate:modelValue": S[4] || (S[4] = (X) => u.value = X),
|
|
@@ -3317,14 +3317,14 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3317
3317
|
]),
|
|
3318
3318
|
"side-sheet-footer": F(() => [
|
|
3319
3319
|
C("div", Du, [
|
|
3320
|
-
h(
|
|
3320
|
+
h(V, {
|
|
3321
3321
|
disabled: v.disabled,
|
|
3322
3322
|
label: m(i)("menu.common.actions.update"),
|
|
3323
3323
|
size: "lg",
|
|
3324
3324
|
variant: "primary",
|
|
3325
3325
|
onClick: G
|
|
3326
3326
|
}, null, 8, ["disabled", "label"]),
|
|
3327
|
-
h(
|
|
3327
|
+
h(V, {
|
|
3328
3328
|
label: m(i)("menu.common.actions.cancel"),
|
|
3329
3329
|
size: "lg",
|
|
3330
3330
|
variant: "tertiary",
|
|
@@ -3349,14 +3349,14 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3349
3349
|
C("p", fu, oe(m(i)("menu.product_image.manage.aspect_ratio")), 1),
|
|
3350
3350
|
C("p", hu, oe(m(i)("menu.product_image.manage.aspect_ratio_hint")), 1)
|
|
3351
3351
|
]),
|
|
3352
|
-
z.value.length ? (_(), Q(
|
|
3352
|
+
z.value.length ? (_(), Q(V, {
|
|
3353
3353
|
key: 0,
|
|
3354
3354
|
disabled: d.value,
|
|
3355
3355
|
label: m(i)("menu.product_image.manage.generate_all"),
|
|
3356
3356
|
variant: m(ze).Secondary,
|
|
3357
3357
|
onClick: ie
|
|
3358
3358
|
}, null, 8, ["disabled", "label", "variant"])) : ee("", !0),
|
|
3359
|
-
h(
|
|
3359
|
+
h(V, {
|
|
3360
3360
|
disabled: d.value,
|
|
3361
3361
|
label: m(i)("menu.product_image.manage.add_format"),
|
|
3362
3362
|
"prepend-icon": "add",
|
|
@@ -3385,7 +3385,7 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3385
3385
|
C("p", yu, oe(m(i)("menu.product_image.manage.custom_sizing")), 1)
|
|
3386
3386
|
])
|
|
3387
3387
|
]),
|
|
3388
|
-
(_(!0), W(ve, null, Ie(
|
|
3388
|
+
(_(!0), W(ve, null, Ie(O.value, (X) => (_(), W("div", {
|
|
3389
3389
|
key: X.ratio,
|
|
3390
3390
|
class: "flex items-center gap-16 py-12"
|
|
3391
3391
|
}, [
|
|
@@ -3429,7 +3429,7 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3429
3429
|
!X.required && !X.url ? (_(), W("p", xu, oe(m(i)("menu.product_image.manage.custom_image_hint")), 1)) : ee("", !0)
|
|
3430
3430
|
]),
|
|
3431
3431
|
C("div", Au, [
|
|
3432
|
-
Xe(h(
|
|
3432
|
+
Xe(h(V, {
|
|
3433
3433
|
disabled: d.value || y.value !== null || X.status === "pending",
|
|
3434
3434
|
icon: "image",
|
|
3435
3435
|
variant: m(ze).Tertiary,
|
|
@@ -3437,7 +3437,7 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3437
3437
|
}, null, 8, ["disabled", "variant", "onClick"]), [
|
|
3438
3438
|
[K, m(i)("menu.product_image.replace.action")]
|
|
3439
3439
|
]),
|
|
3440
|
-
Xe(h(
|
|
3440
|
+
Xe(h(V, {
|
|
3441
3441
|
disabled: d.value || y.value !== null || X.status === "pending",
|
|
3442
3442
|
icon: "autorenew",
|
|
3443
3443
|
variant: m(ze).Tertiary,
|
|
@@ -3445,7 +3445,7 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3445
3445
|
}, null, 8, ["disabled", "variant", "onClick"]), [
|
|
3446
3446
|
[K, m(i)("menu.product_image.regenerate.action")]
|
|
3447
3447
|
]),
|
|
3448
|
-
X.removable ? (_(), Q(
|
|
3448
|
+
X.removable ? (_(), Q(V, {
|
|
3449
3449
|
key: 0,
|
|
3450
3450
|
disabled: d.value || y.value !== null || X.status === "pending",
|
|
3451
3451
|
icon: "close",
|
|
@@ -3471,20 +3471,20 @@ const Yl = { class: "flex flex-col items-center gap-12" }, Xl = { class: "fm-typ
|
|
|
3471
3471
|
])
|
|
3472
3472
|
])
|
|
3473
3473
|
])) : ee("", !0),
|
|
3474
|
-
h(
|
|
3474
|
+
h($, {
|
|
3475
3475
|
modelValue: T.value,
|
|
3476
3476
|
"onUpdate:modelValue": S[2] || (S[2] = (X) => T.value = X),
|
|
3477
3477
|
"max-width": 560,
|
|
3478
3478
|
"onOn:clickedAway": S[3] || (S[3] = (X) => T.value = !1)
|
|
3479
3479
|
}, {
|
|
3480
3480
|
"dialog-header": F(() => [
|
|
3481
|
-
C("p", $u, oe(
|
|
3481
|
+
C("p", $u, oe(P.value), 1)
|
|
3482
3482
|
]),
|
|
3483
3483
|
default: F(() => [
|
|
3484
3484
|
C("div", Pu, [
|
|
3485
3485
|
U.value ? (_(), W("img", {
|
|
3486
3486
|
key: 0,
|
|
3487
|
-
alt:
|
|
3487
|
+
alt: P.value,
|
|
3488
3488
|
src: U.value,
|
|
3489
3489
|
class: "max-h-full max-w-full object-contain"
|
|
3490
3490
|
}, null, 8, Vu)) : ee("", !0)
|
|
@@ -3605,7 +3605,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3605
3605
|
function U(G) {
|
|
3606
3606
|
return f.value && p.value === G._id;
|
|
3607
3607
|
}
|
|
3608
|
-
function
|
|
3608
|
+
function P(G) {
|
|
3609
3609
|
return G._id === Jo;
|
|
3610
3610
|
}
|
|
3611
3611
|
const N = Gi.join(",");
|
|
@@ -3618,7 +3618,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3618
3618
|
type: "error"
|
|
3619
3619
|
});
|
|
3620
3620
|
}
|
|
3621
|
-
async function
|
|
3621
|
+
async function O(G) {
|
|
3622
3622
|
const v = await Ta(G.url, {
|
|
3623
3623
|
withTimestamp: !0,
|
|
3624
3624
|
filename: "product-image"
|
|
@@ -3632,8 +3632,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3632
3632
|
if (!(n.disabled || n.coverOnly || R.value)) {
|
|
3633
3633
|
R.value = !0;
|
|
3634
3634
|
try {
|
|
3635
|
-
const S = await v,
|
|
3636
|
-
if (
|
|
3635
|
+
const S = await v, V = _n(S);
|
|
3636
|
+
if (V) throw new Error(i(`menu.product_image.error.${V}`));
|
|
3637
3637
|
const q = await xr(S);
|
|
3638
3638
|
b.value = G, Sa(y), g.activate({ imageData: q, command: "modifyImage" });
|
|
3639
3639
|
} catch (S) {
|
|
@@ -3645,8 +3645,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3645
3645
|
}
|
|
3646
3646
|
function Z(G) {
|
|
3647
3647
|
z(
|
|
3648
|
-
|
|
3649
|
-
|
|
3648
|
+
P(G) ? { type: "legacy" } : { type: "image", imageId: G._id },
|
|
3649
|
+
O(G)
|
|
3650
3650
|
);
|
|
3651
3651
|
}
|
|
3652
3652
|
function ne(G) {
|
|
@@ -3660,8 +3660,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3660
3660
|
} catch {
|
|
3661
3661
|
throw new Error(i("menu.product_image.error.unreadable"));
|
|
3662
3662
|
}
|
|
3663
|
-
const
|
|
3664
|
-
if (
|
|
3663
|
+
const V = _n(S);
|
|
3664
|
+
if (V) throw new Error(i(`menu.product_image.error.${V}`));
|
|
3665
3665
|
if (G.type === "staged") {
|
|
3666
3666
|
const K = I.value.find((X) => X._id === G.imageId);
|
|
3667
3667
|
if (!K) return;
|
|
@@ -3688,8 +3688,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3688
3688
|
}
|
|
3689
3689
|
);
|
|
3690
3690
|
if (!re) return;
|
|
3691
|
-
const
|
|
3692
|
-
o("update:modelValue",
|
|
3691
|
+
const $ = { ...re, isDefault: (q == null ? void 0 : q.isDefault) ?? !0 }, D = q ? A.value.map((K) => K._id === q._id ? $ : K) : [$];
|
|
3692
|
+
o("update:modelValue", D);
|
|
3693
3693
|
} catch (S) {
|
|
3694
3694
|
k(S);
|
|
3695
3695
|
}
|
|
@@ -3700,8 +3700,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3700
3700
|
});
|
|
3701
3701
|
async function ie(G) {
|
|
3702
3702
|
if (n.disabled || n.coverOnly || !G.length) return;
|
|
3703
|
-
const v = G.filter((
|
|
3704
|
-
const q = _n(
|
|
3703
|
+
const v = G.filter((V) => {
|
|
3704
|
+
const q = _n(V);
|
|
3705
3705
|
return q && r.open({ message: i(`menu.product_image.error.${q}`), type: "error" }), !q;
|
|
3706
3706
|
});
|
|
3707
3707
|
if (!v.length) return;
|
|
@@ -3711,32 +3711,32 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3711
3711
|
r.open({ message: i("menu.product_image.error.no_item"), type: "error" });
|
|
3712
3712
|
return;
|
|
3713
3713
|
}
|
|
3714
|
-
const
|
|
3715
|
-
v.forEach((q) =>
|
|
3714
|
+
const V = [...I.value];
|
|
3715
|
+
v.forEach((q) => V.push(Ar(q, S && !V.length))), o("update:staged", V);
|
|
3716
3716
|
return;
|
|
3717
3717
|
}
|
|
3718
3718
|
await l.minor(
|
|
3719
3719
|
async () => {
|
|
3720
|
-
let
|
|
3720
|
+
let V = [...A.value];
|
|
3721
3721
|
const q = [];
|
|
3722
3722
|
try {
|
|
3723
3723
|
for (const re of v) {
|
|
3724
|
-
const
|
|
3724
|
+
const $ = await ei(n.itemId, re, {
|
|
3725
3725
|
aspectRatios: ti(u.value),
|
|
3726
3726
|
unreadableMessage: i("menu.product_image.error.unreadable")
|
|
3727
3727
|
});
|
|
3728
|
-
q.push({ itemId: n.itemId, imageId:
|
|
3728
|
+
q.push({ itemId: n.itemId, imageId: $._id }), V = [...V, { ...$, isDefault: V.length === 0 }];
|
|
3729
3729
|
}
|
|
3730
3730
|
} catch (re) {
|
|
3731
3731
|
if (q.length)
|
|
3732
3732
|
try {
|
|
3733
3733
|
await Hi(q);
|
|
3734
|
-
} catch (
|
|
3735
|
-
console.error("Failed to clean up partially uploaded product images",
|
|
3734
|
+
} catch ($) {
|
|
3735
|
+
console.error("Failed to clean up partially uploaded product images", $);
|
|
3736
3736
|
}
|
|
3737
3737
|
throw re;
|
|
3738
3738
|
}
|
|
3739
|
-
o("update:modelValue",
|
|
3739
|
+
o("update:modelValue", V);
|
|
3740
3740
|
},
|
|
3741
3741
|
{
|
|
3742
3742
|
message: i("menu.product_image.uploading"),
|
|
@@ -3765,8 +3765,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3765
3765
|
}
|
|
3766
3766
|
function pe(G) {
|
|
3767
3767
|
me(async () => {
|
|
3768
|
-
if (
|
|
3769
|
-
const S = A.value.filter((
|
|
3768
|
+
if (P(G)) {
|
|
3769
|
+
const S = A.value.filter((V) => V._id !== G._id);
|
|
3770
3770
|
o("update:modelValue", S);
|
|
3771
3771
|
return;
|
|
3772
3772
|
}
|
|
@@ -3782,20 +3782,20 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3782
3782
|
});
|
|
3783
3783
|
}
|
|
3784
3784
|
function ce(G) {
|
|
3785
|
-
|
|
3785
|
+
P(G) || (p.value = G._id, f.value = !0);
|
|
3786
3786
|
}
|
|
3787
3787
|
function be(G) {
|
|
3788
3788
|
let v = A.value.map((S) => S._id === G._id ? G : S);
|
|
3789
3789
|
if (G.isDefault)
|
|
3790
3790
|
v = Sr(v, G._id, !0);
|
|
3791
3791
|
else if (!n.coverOnly && v.length && !v.some((S) => S.isDefault)) {
|
|
3792
|
-
const S = v.find((
|
|
3793
|
-
v = v.map((
|
|
3792
|
+
const S = v.find((V) => V._id !== G._id) ?? v[0];
|
|
3793
|
+
v = v.map((V) => V._id === S._id ? { ...V, isDefault: !0 } : V);
|
|
3794
3794
|
}
|
|
3795
3795
|
o("update:modelValue", v);
|
|
3796
3796
|
}
|
|
3797
3797
|
return (G, v) => {
|
|
3798
|
-
const S = M("fm-icon"),
|
|
3798
|
+
const S = M("fm-icon"), V = M("fm-button"), q = M("fm-chip"), re = M("FmFormGroup"), $ = Ht("tooltip");
|
|
3799
3799
|
return _(), Q(re, {
|
|
3800
3800
|
tag: "div",
|
|
3801
3801
|
label: m(i)("menu.common.labels.product_image"),
|
|
@@ -3812,8 +3812,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3812
3812
|
c.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300",
|
|
3813
3813
|
G.disabled || G.coverOnly ? "opacity-50 cursor-not-allowed" : ""
|
|
3814
3814
|
]),
|
|
3815
|
-
onDragleave: v[1] || (v[1] = ct((
|
|
3816
|
-
onDragover: v[2] || (v[2] = ct((
|
|
3815
|
+
onDragleave: v[1] || (v[1] = ct((D) => c.value = !1, ["prevent"])),
|
|
3816
|
+
onDragover: v[2] || (v[2] = ct((D) => c.value = !G.disabled && !G.coverOnly, ["prevent"])),
|
|
3817
3817
|
onDrop: ct(Y, ["prevent"])
|
|
3818
3818
|
}, [
|
|
3819
3819
|
h(S, {
|
|
@@ -3822,11 +3822,11 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3822
3822
|
outline: ""
|
|
3823
3823
|
}),
|
|
3824
3824
|
C("p", Bu, oe(m(i)("menu.product_image.drop_hint")), 1),
|
|
3825
|
-
h(
|
|
3825
|
+
h(V, {
|
|
3826
3826
|
disabled: G.disabled || G.coverOnly,
|
|
3827
3827
|
label: m(i)("menu.product_image.add_file"),
|
|
3828
3828
|
variant: "secondary",
|
|
3829
|
-
onClick: v[0] || (v[0] = (
|
|
3829
|
+
onClick: v[0] || (v[0] = (D) => {
|
|
3830
3830
|
var K;
|
|
3831
3831
|
return (K = d.value) == null ? void 0 : K.click();
|
|
3832
3832
|
})
|
|
@@ -3841,42 +3841,42 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3841
3841
|
onChange: se
|
|
3842
3842
|
}, null, 40, Lu)
|
|
3843
3843
|
], 34),
|
|
3844
|
-
(_(!0), W(ve, null, Ie(L.value, (
|
|
3845
|
-
key:
|
|
3844
|
+
(_(!0), W(ve, null, Ie(L.value, (D) => Xe((_(), W("div", {
|
|
3845
|
+
key: D._id,
|
|
3846
3846
|
class: "product-image-tile relative aspect-square"
|
|
3847
3847
|
}, [
|
|
3848
|
-
|
|
3848
|
+
P(D) ? (_(), W("div", ju, [
|
|
3849
3849
|
h(Gt, {
|
|
3850
3850
|
alt: m(i)("menu.common.labels.product_image"),
|
|
3851
3851
|
"class-name": "w-full h-full",
|
|
3852
3852
|
size: { width: 180, height: 180 },
|
|
3853
|
-
src:
|
|
3853
|
+
src: D.url
|
|
3854
3854
|
}, null, 8, ["alt", "src"])
|
|
3855
3855
|
])) : (_(), W("button", {
|
|
3856
3856
|
key: 1,
|
|
3857
3857
|
class: Ve([
|
|
3858
3858
|
"block w-full h-full rounded-md overflow-hidden",
|
|
3859
|
-
U(
|
|
3859
|
+
U(D) ? "ring-2 ring-fm-color-primary" : ""
|
|
3860
3860
|
]),
|
|
3861
3861
|
disabled: G.disabled,
|
|
3862
3862
|
type: "button",
|
|
3863
|
-
onClick: (K) => ce(
|
|
3863
|
+
onClick: (K) => ce(D)
|
|
3864
3864
|
}, [
|
|
3865
3865
|
h(Gt, {
|
|
3866
3866
|
alt: m(i)("menu.common.labels.product_image"),
|
|
3867
3867
|
"class-name": "w-full h-full",
|
|
3868
3868
|
size: { width: 180, height: 180 },
|
|
3869
|
-
src:
|
|
3869
|
+
src: D.url
|
|
3870
3870
|
}, null, 8, ["alt", "src"])
|
|
3871
3871
|
], 10, Wu)),
|
|
3872
3872
|
C("div", Gu, [
|
|
3873
|
-
|
|
3873
|
+
D.isDefault ? (_(), Q(q, {
|
|
3874
3874
|
key: 0,
|
|
3875
3875
|
label: m(i)("menu.product_image.cover_badge")
|
|
3876
3876
|
}, null, 8, ["label"])) : ee("", !0),
|
|
3877
|
-
u.value &&
|
|
3877
|
+
u.value && !P(D) ? (_(), Q(q, {
|
|
3878
3878
|
key: 1,
|
|
3879
|
-
label: `${B(
|
|
3879
|
+
label: `${B(D)}`,
|
|
3880
3880
|
"right-icon": "resize"
|
|
3881
3881
|
}, null, 8, ["label"])) : ee("", !0)
|
|
3882
3882
|
]),
|
|
@@ -3886,7 +3886,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3886
3886
|
title: m(i)("menu.remy.title"),
|
|
3887
3887
|
class: "absolute bottom-8 right-8 rounded-full bg-fm-color-neutral-white w-32 h-32 flex items-center justify-center shadow-sm",
|
|
3888
3888
|
type: "button",
|
|
3889
|
-
onClick: ct((K) => Z(
|
|
3889
|
+
onClick: ct((K) => Z(D), ["stop"])
|
|
3890
3890
|
}, [
|
|
3891
3891
|
h(S, {
|
|
3892
3892
|
name: "auto_awesome",
|
|
@@ -3897,7 +3897,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3897
3897
|
key: 3,
|
|
3898
3898
|
class: "absolute -top-8 -right-8 rounded-full bg-fm-color-neutral-black w-24 h-24 flex items-center justify-center",
|
|
3899
3899
|
type: "button",
|
|
3900
|
-
onClick: (K) => pe(
|
|
3900
|
+
onClick: (K) => pe(D)
|
|
3901
3901
|
}, [
|
|
3902
3902
|
h(S, {
|
|
3903
3903
|
color: "neutral-white",
|
|
@@ -3907,12 +3907,12 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3907
3907
|
], 8, Ku)) : ee("", !0)
|
|
3908
3908
|
])), [
|
|
3909
3909
|
[
|
|
3910
|
-
|
|
3911
|
-
u.value &&
|
|
3910
|
+
$,
|
|
3911
|
+
u.value && P(D) ? m(Vt)(m(i)("menu.product_image.legacy_hint")) : void 0
|
|
3912
3912
|
]
|
|
3913
3913
|
])), 128)),
|
|
3914
|
-
(_(!0), W(ve, null, Ie(I.value, (
|
|
3915
|
-
key:
|
|
3914
|
+
(_(!0), W(ve, null, Ie(I.value, (D) => Xe((_(), W("div", {
|
|
3915
|
+
key: D._id,
|
|
3916
3916
|
class: "product-image-tile relative aspect-square"
|
|
3917
3917
|
}, [
|
|
3918
3918
|
C("div", qu, [
|
|
@@ -3921,11 +3921,11 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3921
3921
|
"class-name": "w-full h-full",
|
|
3922
3922
|
crossorigin: !1,
|
|
3923
3923
|
size: { width: 180, height: 180 },
|
|
3924
|
-
src:
|
|
3924
|
+
src: D.previewUrl
|
|
3925
3925
|
}, null, 8, ["alt", "src"])
|
|
3926
3926
|
]),
|
|
3927
3927
|
C("div", Yu, [
|
|
3928
|
-
|
|
3928
|
+
D.isDefault ? (_(), Q(q, {
|
|
3929
3929
|
key: 0,
|
|
3930
3930
|
label: m(i)("menu.product_image.cover_badge")
|
|
3931
3931
|
}, null, 8, ["label"])) : ee("", !0)
|
|
@@ -3936,7 +3936,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3936
3936
|
title: m(i)("menu.remy.title"),
|
|
3937
3937
|
class: "absolute bottom-8 right-8 rounded-full bg-fm-color-neutral-white w-32 h-32 flex items-center justify-center shadow-sm",
|
|
3938
3938
|
type: "button",
|
|
3939
|
-
onClick: ct((K) => ne(
|
|
3939
|
+
onClick: ct((K) => ne(D), ["stop"])
|
|
3940
3940
|
}, [
|
|
3941
3941
|
h(S, {
|
|
3942
3942
|
name: "auto_awesome",
|
|
@@ -3947,7 +3947,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3947
3947
|
key: 1,
|
|
3948
3948
|
class: "absolute -top-8 -right-8 rounded-full bg-fm-color-neutral-black w-24 h-24 flex items-center justify-center",
|
|
3949
3949
|
type: "button",
|
|
3950
|
-
onClick: (K) => te(
|
|
3950
|
+
onClick: (K) => te(D)
|
|
3951
3951
|
}, [
|
|
3952
3952
|
h(S, {
|
|
3953
3953
|
color: "neutral-white",
|
|
@@ -3956,12 +3956,12 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
3956
3956
|
})
|
|
3957
3957
|
], 8, Zu)) : ee("", !0)
|
|
3958
3958
|
])), [
|
|
3959
|
-
[
|
|
3959
|
+
[$, m(Vt)(m(i)("menu.product_image.staged_hint"))]
|
|
3960
3960
|
])), 128))
|
|
3961
3961
|
]),
|
|
3962
3962
|
h(Fu, {
|
|
3963
3963
|
modelValue: f.value,
|
|
3964
|
-
"onUpdate:modelValue": v[3] || (v[3] = (
|
|
3964
|
+
"onUpdate:modelValue": v[3] || (v[3] = (D) => f.value = D),
|
|
3965
3965
|
"can-clear-cover": G.coverOnly || A.value.length > 1,
|
|
3966
3966
|
"cover-only": G.coverOnly,
|
|
3967
3967
|
disabled: G.disabled,
|
|
@@ -4001,8 +4001,8 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
4001
4001
|
setup(e, { emit: t }) {
|
|
4002
4002
|
const n = e, o = t, { t: i } = ge(), a = H([]), r = H([]), l = H(""), s = H(""), u = H(""), d = H(""), c = H(!0), p = H(!1);
|
|
4003
4003
|
function f() {
|
|
4004
|
-
const x = n.productNameLocale || {}, U = n.productDescriptionLocale || {},
|
|
4005
|
-
return
|
|
4004
|
+
const x = n.productNameLocale || {}, U = n.productDescriptionLocale || {}, P = /* @__PURE__ */ new Set([...Object.keys(x), ...Object.keys(U)]);
|
|
4005
|
+
return P.size === 0 ? [] : Array.from(P).map((N) => ({
|
|
4006
4006
|
localeCode: N,
|
|
4007
4007
|
localeName: po(N),
|
|
4008
4008
|
nameValue: x[N] || "",
|
|
@@ -4024,7 +4024,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
4024
4024
|
);
|
|
4025
4025
|
const g = E(() => a.value.map((x) => x.localeCode));
|
|
4026
4026
|
function w(x) {
|
|
4027
|
-
const U = new Set(g.value),
|
|
4027
|
+
const U = new Set(g.value), P = new Set(x);
|
|
4028
4028
|
for (const N of x)
|
|
4029
4029
|
U.has(N) || a.value.push({
|
|
4030
4030
|
localeCode: N,
|
|
@@ -4032,18 +4032,18 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
4032
4032
|
nameValue: "",
|
|
4033
4033
|
descriptionValue: ""
|
|
4034
4034
|
});
|
|
4035
|
-
a.value = a.value.filter((N) =>
|
|
4035
|
+
a.value = a.value.filter((N) => P.has(N.localeCode));
|
|
4036
4036
|
}
|
|
4037
4037
|
function y() {
|
|
4038
|
-
const x = !$e.isEqual(a.value, r.value), U = l.value !== u.value,
|
|
4039
|
-
return x || U ||
|
|
4038
|
+
const x = !$e.isEqual(a.value, r.value), U = l.value !== u.value, P = s.value !== d.value;
|
|
4039
|
+
return x || U || P;
|
|
4040
4040
|
}
|
|
4041
4041
|
function b() {
|
|
4042
4042
|
o("update:name", l.value.trim()), o("update:description", s.value.trim());
|
|
4043
4043
|
const x = a.value.filter((B) => B.nameValue.trim()), U = x.length === 0 ? void 0 : x.reduce(
|
|
4044
4044
|
(B, k) => (B[k.localeCode] = k.nameValue.trim(), B),
|
|
4045
4045
|
{}
|
|
4046
|
-
),
|
|
4046
|
+
), P = a.value.filter((B) => B.descriptionValue.trim()), N = P.length === 0 ? void 0 : P.reduce(
|
|
4047
4047
|
(B, k) => (B[k.localeCode] = k.descriptionValue.trim(), B),
|
|
4048
4048
|
{}
|
|
4049
4049
|
);
|
|
@@ -4063,7 +4063,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
4063
4063
|
p.value = !p.value;
|
|
4064
4064
|
}
|
|
4065
4065
|
return (x, U) => {
|
|
4066
|
-
const
|
|
4066
|
+
const P = M("FmIcon"), N = M("fm-button"), B = M("fm-dialog");
|
|
4067
4067
|
return _(), Q(B, {
|
|
4068
4068
|
modelValue: L.value,
|
|
4069
4069
|
"onUpdate:modelValue": U[2] || (U[2] = (k) => L.value = k),
|
|
@@ -4101,7 +4101,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
4101
4101
|
class: "flex items-center gap-16 cursor-pointer",
|
|
4102
4102
|
onClick: I
|
|
4103
4103
|
}, [
|
|
4104
|
-
h(
|
|
4104
|
+
h(P, {
|
|
4105
4105
|
name: c.value ? "keyboard_arrow_down" : "keyboard_arrow_right"
|
|
4106
4106
|
}, null, 8, ["name"]),
|
|
4107
4107
|
C("p", oc, oe(m(i)("menu.product.translation.product_name")), 1)
|
|
@@ -4122,7 +4122,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
4122
4122
|
key: k.localeCode,
|
|
4123
4123
|
"locale-code": k.localeCode,
|
|
4124
4124
|
modelValue: k.nameValue,
|
|
4125
|
-
"onUpdate:modelValue": (
|
|
4125
|
+
"onUpdate:modelValue": (O) => k.nameValue = O,
|
|
4126
4126
|
placeholder: m(i)("menu.product.translation.placeholder")
|
|
4127
4127
|
}, null, 8, ["locale-code", "modelValue", "onUpdate:modelValue", "placeholder"]))), 128))
|
|
4128
4128
|
])) : ee("", !0)
|
|
@@ -4133,7 +4133,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
4133
4133
|
class: "flex items-center gap-16 cursor-pointer",
|
|
4134
4134
|
onClick: T
|
|
4135
4135
|
}, [
|
|
4136
|
-
h(
|
|
4136
|
+
h(P, {
|
|
4137
4137
|
name: p.value ? "keyboard_arrow_down" : "keyboard_arrow_right"
|
|
4138
4138
|
}, null, 8, ["name"]),
|
|
4139
4139
|
C("p", sc, [
|
|
@@ -4158,7 +4158,7 @@ const zu = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-12"
|
|
|
4158
4158
|
key: k.localeCode,
|
|
4159
4159
|
"locale-code": k.localeCode,
|
|
4160
4160
|
modelValue: k.descriptionValue,
|
|
4161
|
-
"onUpdate:modelValue": (
|
|
4161
|
+
"onUpdate:modelValue": (O) => k.descriptionValue = O,
|
|
4162
4162
|
placeholder: m(i)("menu.product.translation.placeholder"),
|
|
4163
4163
|
"input-type": "textarea"
|
|
4164
4164
|
}, null, 8, ["locale-code", "modelValue", "onUpdate:modelValue", "placeholder"]))), 128))
|
|
@@ -7350,7 +7350,7 @@ const Mi = {
|
|
|
7350
7350
|
await dp(o);
|
|
7351
7351
|
}
|
|
7352
7352
|
};
|
|
7353
|
-
var Ui = { firebase: { storageBucket: "image.
|
|
7353
|
+
var Ui = { firebase: { storageBucket: "image.feedme.cc" } };
|
|
7354
7354
|
const hp = {
|
|
7355
7355
|
class: "fm-typo-en-title-md-600"
|
|
7356
7356
|
}, gp = {
|
|
@@ -7430,7 +7430,7 @@ const hp = {
|
|
|
7430
7430
|
R.value || await l.update(j._id);
|
|
7431
7431
|
}
|
|
7432
7432
|
const U = E(() => r.version === At.enum.v4);
|
|
7433
|
-
async function
|
|
7433
|
+
async function P(j) {
|
|
7434
7434
|
const ie = Ss(j, b.value.id);
|
|
7435
7435
|
await l.updateMany(ie);
|
|
7436
7436
|
}
|
|
@@ -7449,7 +7449,7 @@ const hp = {
|
|
|
7449
7449
|
});
|
|
7450
7450
|
}), j;
|
|
7451
7451
|
});
|
|
7452
|
-
function
|
|
7452
|
+
function O(j) {
|
|
7453
7453
|
f.value = j;
|
|
7454
7454
|
}
|
|
7455
7455
|
function z(j) {
|
|
@@ -7628,7 +7628,7 @@ const hp = {
|
|
|
7628
7628
|
"shrink-at": !1,
|
|
7629
7629
|
"hide-footer": "",
|
|
7630
7630
|
"pin-header-row": "",
|
|
7631
|
-
onDndChanged:
|
|
7631
|
+
onDndChanged: P,
|
|
7632
7632
|
onRowClick: ie[5] || (ie[5] = (G) => x(G.original))
|
|
7633
7633
|
}, null, 8, ["draggable", "page-size", "row-data", "search-value"])])]),
|
|
7634
7634
|
_: 1
|
|
@@ -7641,7 +7641,7 @@ const hp = {
|
|
|
7641
7641
|
name: b.value.name,
|
|
7642
7642
|
"name-locale": f.value,
|
|
7643
7643
|
"onUpdate:name": z,
|
|
7644
|
-
"onUpdate:nameLocale":
|
|
7644
|
+
"onUpdate:nameLocale": O
|
|
7645
7645
|
}, null, 8, ["modelValue", "title", "name", "name-locale"])], 64);
|
|
7646
7646
|
};
|
|
7647
7647
|
}
|
|
@@ -7880,60 +7880,60 @@ const Lp = /* @__PURE__ */ fe({
|
|
|
7880
7880
|
checkMenuIsLoading: d
|
|
7881
7881
|
} = pt(st(Qe())), c = t, p = E(() => o.rules.item), f = E(() => !!o.state.currentCatalogId && !o.state.currentSchedulerId), g = E(() => {
|
|
7882
7882
|
var K;
|
|
7883
|
-
const
|
|
7884
|
-
return
|
|
7883
|
+
const $ = n.form.images ?? ((K = n.fallback) == null ? void 0 : K.images), D = n.form.image;
|
|
7884
|
+
return !$ || !D || !$.some((X) => X._id === D) ? $ : $.map((X) => ({
|
|
7885
7885
|
...X,
|
|
7886
|
-
isDefault: X._id ===
|
|
7886
|
+
isDefault: X._id === D
|
|
7887
7887
|
}));
|
|
7888
7888
|
});
|
|
7889
|
-
function w(
|
|
7890
|
-
var
|
|
7891
|
-
f.value ? c("update:form", "image", ((
|
|
7892
|
-
images:
|
|
7889
|
+
function w($) {
|
|
7890
|
+
var D;
|
|
7891
|
+
f.value ? c("update:form", "image", ((D = $.find((K) => K.isDefault)) == null ? void 0 : D._id) ?? null) : c("update:form", "images", $), c("update:form", "thumbnail", Rr({
|
|
7892
|
+
images: $,
|
|
7893
7893
|
thumbnail: n.form.thumbnail ?? null
|
|
7894
7894
|
}));
|
|
7895
7895
|
}
|
|
7896
7896
|
const y = E(() => o.categorizedItems), b = E(() => {
|
|
7897
|
-
const
|
|
7898
|
-
label:
|
|
7899
|
-
value:
|
|
7897
|
+
const $ = y.value.map((D) => ({
|
|
7898
|
+
label: D.name,
|
|
7899
|
+
value: D.id
|
|
7900
7900
|
}));
|
|
7901
|
-
return n.isAddon ?
|
|
7902
|
-
}), R = E(() => p.value.addon), A = E(() => !b.value.find((
|
|
7901
|
+
return n.isAddon ? $ : $.filter((D) => !!D.value);
|
|
7902
|
+
}), R = E(() => p.value.addon), A = E(() => !b.value.find(($) => !!$.value)), L = E(() => Ft(n.form.category ? n.form : n.fallback) || []), I = E(() => L.value.reduce(($, D) => ($[D._id] = D, $), {})), T = E({
|
|
7903
7903
|
get() {
|
|
7904
|
-
return L.value.map((
|
|
7904
|
+
return L.value.map(($) => $._id);
|
|
7905
7905
|
},
|
|
7906
|
-
set(
|
|
7907
|
-
const [
|
|
7906
|
+
set($ = []) {
|
|
7907
|
+
const [D, ...K] = $.map((X) => {
|
|
7908
7908
|
const le = I.value[X];
|
|
7909
7909
|
return le || {
|
|
7910
7910
|
_id: X,
|
|
7911
7911
|
position: null
|
|
7912
7912
|
};
|
|
7913
7913
|
});
|
|
7914
|
-
if (!
|
|
7914
|
+
if (!D) {
|
|
7915
7915
|
c("update:form", "category", null), c("update:form", "additionalCategories", []);
|
|
7916
7916
|
return;
|
|
7917
7917
|
}
|
|
7918
|
-
c("update:form", "category",
|
|
7918
|
+
c("update:form", "category", D._id), c("update:form", "additionalCategories", K);
|
|
7919
7919
|
}
|
|
7920
7920
|
}), x = H(), U = ({
|
|
7921
|
-
multiple:
|
|
7921
|
+
multiple: $ = !0
|
|
7922
7922
|
} = {}) => n.isAddon ? null : h(Ws, {
|
|
7923
7923
|
ref: x,
|
|
7924
7924
|
disabled: !p.value.category || n.isAddon || d(),
|
|
7925
7925
|
items: b.value,
|
|
7926
7926
|
modelValue: T.value,
|
|
7927
|
-
"onUpdate:model-value": (
|
|
7927
|
+
"onUpdate:model-value": (D) => T.value = D,
|
|
7928
7928
|
placeholder: Y("menu.product.form.detail.category.placeholder"),
|
|
7929
|
-
multiple:
|
|
7929
|
+
multiple: $
|
|
7930
7930
|
}, {
|
|
7931
7931
|
"append-menu": () => h("button", {
|
|
7932
7932
|
class: "flex items-center py-8 px-16 space-x-8",
|
|
7933
7933
|
type: "button",
|
|
7934
7934
|
onClick: () => {
|
|
7935
|
-
var
|
|
7936
|
-
(
|
|
7935
|
+
var D;
|
|
7936
|
+
(D = x.value) == null || D.hideMenu(), u.create();
|
|
7937
7937
|
}
|
|
7938
7938
|
}, [h(Ee.FmIcon, {
|
|
7939
7939
|
color: "primary",
|
|
@@ -7946,39 +7946,39 @@ const Lp = /* @__PURE__ */ fe({
|
|
|
7946
7946
|
Wt(async () => {
|
|
7947
7947
|
!A.value && n.form.category === void 0 && n.isCreate && z($t.PRODUCT);
|
|
7948
7948
|
});
|
|
7949
|
-
const
|
|
7950
|
-
var
|
|
7951
|
-
const
|
|
7952
|
-
return
|
|
7949
|
+
const P = E(() => {
|
|
7950
|
+
var D;
|
|
7951
|
+
const $ = n.form.name || ((D = n.fallback) == null ? void 0 : D.name);
|
|
7952
|
+
return $ ? o.items.filter((K) => !!K.category && K._id !== n.form._id && K.name === $).length : 0;
|
|
7953
7953
|
}), N = E(() => {
|
|
7954
|
-
var
|
|
7955
|
-
const
|
|
7956
|
-
return
|
|
7954
|
+
var D;
|
|
7955
|
+
const $ = n.form.name2 || ((D = n.fallback) == null ? void 0 : D.name2);
|
|
7956
|
+
return $ ? o.items.filter((K) => !!K.category && K._id !== n.form._id && K.name2 === $).length : 0;
|
|
7957
7957
|
}), B = E(() => o.state.featureFlags.uniqueProductCode), k = E(() => {
|
|
7958
7958
|
var X, le, Ae;
|
|
7959
|
-
const
|
|
7960
|
-
if (
|
|
7961
|
-
let
|
|
7959
|
+
const $ = n.form.code || ((X = n.fallback) == null ? void 0 : X.code);
|
|
7960
|
+
if (!$) return 0;
|
|
7961
|
+
let D = o.itemCodeMap.get($) || 0;
|
|
7962
7962
|
const K = o.items.find((xe) => xe._id === n.form._id);
|
|
7963
|
-
return (K == null ? void 0 : K.code) ===
|
|
7964
|
-
xe.code ===
|
|
7965
|
-
}),
|
|
7966
|
-
}),
|
|
7967
|
-
function z(
|
|
7963
|
+
return (K == null ? void 0 : K.code) === $ && (D -= 1), (Ae = (le = K == null ? void 0 : K.variant) == null ? void 0 : le.variantCombinations) == null || Ae.forEach((xe) => {
|
|
7964
|
+
xe.code === $ && (D -= 1);
|
|
7965
|
+
}), D;
|
|
7966
|
+
}), O = E(() => n.isAddon ? $t.ADD_ON : $t.PRODUCT);
|
|
7967
|
+
function z($) {
|
|
7968
7968
|
var K, X, le;
|
|
7969
|
-
if (
|
|
7970
|
-
const
|
|
7971
|
-
c("update:form", "category", n.isOverride ?
|
|
7969
|
+
if (O.value === $) return;
|
|
7970
|
+
const D = $ == $t.ADD_ON;
|
|
7971
|
+
c("update:form", "category", n.isOverride ? D ? "" : ((K = n.fallback) == null ? void 0 : K.category) ?? ((X = b.value.find((Ae) => !!Ae.value)) == null ? void 0 : X.value) : D ? null : (le = b.value.find((Ae) => !!Ae.value)) == null ? void 0 : le.value), D && (c("update:form", "additionalCategories", []), c("update:form", "subCategories", []));
|
|
7972
7972
|
}
|
|
7973
7973
|
const Z = cn();
|
|
7974
|
-
Nn("apply-description", (
|
|
7975
|
-
c("update:form", "description",
|
|
7974
|
+
Nn("apply-description", ($) => {
|
|
7975
|
+
c("update:form", "description", $ || "");
|
|
7976
7976
|
});
|
|
7977
7977
|
async function ne() {
|
|
7978
7978
|
if (!n.form.name) {
|
|
7979
|
-
const
|
|
7980
|
-
if (
|
|
7981
|
-
|
|
7979
|
+
const $ = document.getElementById("product-name");
|
|
7980
|
+
if ($) {
|
|
7981
|
+
$.focus();
|
|
7982
7982
|
return;
|
|
7983
7983
|
} else
|
|
7984
7984
|
return;
|
|
@@ -7990,46 +7990,46 @@ const Lp = /* @__PURE__ */ fe({
|
|
|
7990
7990
|
command: "suggestDescription"
|
|
7991
7991
|
});
|
|
7992
7992
|
}
|
|
7993
|
-
const j = E(() => o.subcategories), ie = E(() => j.value.map((
|
|
7994
|
-
label:
|
|
7995
|
-
value:
|
|
7993
|
+
const j = E(() => o.subcategories), ie = E(() => j.value.map(($) => ({
|
|
7994
|
+
label: $.name,
|
|
7995
|
+
value: $._id
|
|
7996
7996
|
}))), se = E({
|
|
7997
7997
|
get() {
|
|
7998
7998
|
return n.form.subCategories || [];
|
|
7999
7999
|
},
|
|
8000
|
-
set(
|
|
8001
|
-
c("update:form", "subCategories",
|
|
8000
|
+
set($) {
|
|
8001
|
+
c("update:form", "subCategories", $);
|
|
8002
8002
|
}
|
|
8003
8003
|
}), {
|
|
8004
8004
|
t: Y
|
|
8005
8005
|
} = ge(), me = H(!1), pe = H("name"), te = E(() => {
|
|
8006
8006
|
var le, Ae;
|
|
8007
|
-
const
|
|
8008
|
-
return (n.form.name || (le = n.fallback) != null && le.name) && !X &&
|
|
8009
|
-
locale:
|
|
8007
|
+
const $ = [], D = "en-US", K = n.form.name_locale, X = K == null ? void 0 : K[D];
|
|
8008
|
+
return (n.form.name || (le = n.fallback) != null && le.name) && !X && $.push({
|
|
8009
|
+
locale: D,
|
|
8010
8010
|
name: n.form.name || ((Ae = n.fallback) == null ? void 0 : Ae.name) || "",
|
|
8011
|
-
localeDisplay: Ct(
|
|
8011
|
+
localeDisplay: Ct(D)
|
|
8012
8012
|
}), K && Object.entries(K).filter(([xe, je]) => je && je.trim()).sort(([xe], [je]) => xe.localeCompare(je)).forEach(([xe, je]) => {
|
|
8013
|
-
|
|
8013
|
+
$.push({
|
|
8014
8014
|
locale: xe,
|
|
8015
8015
|
name: je,
|
|
8016
8016
|
localeDisplay: Ct(xe)
|
|
8017
8017
|
});
|
|
8018
|
-
}),
|
|
8018
|
+
}), $;
|
|
8019
8019
|
}), ce = E(() => {
|
|
8020
8020
|
var le, Ae;
|
|
8021
|
-
const
|
|
8022
|
-
return (n.form.description || (le = n.fallback) != null && le.description) && !X &&
|
|
8023
|
-
locale:
|
|
8021
|
+
const $ = [], D = "en-US", K = n.form.description_locale, X = K == null ? void 0 : K[D];
|
|
8022
|
+
return (n.form.description || (le = n.fallback) != null && le.description) && !X && $.push({
|
|
8023
|
+
locale: D,
|
|
8024
8024
|
name: n.form.description || ((Ae = n.fallback) == null ? void 0 : Ae.description) || "",
|
|
8025
|
-
localeDisplay: Ct(
|
|
8025
|
+
localeDisplay: Ct(D)
|
|
8026
8026
|
}), K && Object.entries(K).filter(([xe, je]) => je && je.trim()).sort(([xe], [je]) => xe.localeCompare(je)).forEach(([xe, je]) => {
|
|
8027
|
-
|
|
8027
|
+
$.push({
|
|
8028
8028
|
locale: xe,
|
|
8029
8029
|
name: je,
|
|
8030
8030
|
localeDisplay: Ct(xe)
|
|
8031
8031
|
});
|
|
8032
|
-
}),
|
|
8032
|
+
}), $;
|
|
8033
8033
|
});
|
|
8034
8034
|
function be() {
|
|
8035
8035
|
pe.value = "name", me.value = !0;
|
|
@@ -8037,23 +8037,23 @@ const Lp = /* @__PURE__ */ fe({
|
|
|
8037
8037
|
function G() {
|
|
8038
8038
|
pe.value = "description", me.value = !0;
|
|
8039
8039
|
}
|
|
8040
|
-
function v(
|
|
8041
|
-
c("update:form", "name",
|
|
8040
|
+
function v($) {
|
|
8041
|
+
c("update:form", "name", $);
|
|
8042
8042
|
}
|
|
8043
|
-
function S(
|
|
8044
|
-
c("update:form", "description",
|
|
8043
|
+
function S($) {
|
|
8044
|
+
c("update:form", "description", $);
|
|
8045
8045
|
}
|
|
8046
|
-
function
|
|
8047
|
-
c("update:form", "name_locale",
|
|
8046
|
+
function V($) {
|
|
8047
|
+
c("update:form", "name_locale", $);
|
|
8048
8048
|
}
|
|
8049
|
-
function q(
|
|
8050
|
-
c("update:form", "description_locale",
|
|
8049
|
+
function q($) {
|
|
8050
|
+
c("update:form", "description_locale", $);
|
|
8051
8051
|
}
|
|
8052
8052
|
const re = E(() => {
|
|
8053
|
-
var
|
|
8054
|
-
return !!n.form.name || !!((
|
|
8053
|
+
var $;
|
|
8054
|
+
return !!n.form.name || !!(($ = n.fallback) != null && $.name);
|
|
8055
8055
|
});
|
|
8056
|
-
return (D
|
|
8056
|
+
return ($, D) => {
|
|
8057
8057
|
var Rt, Je;
|
|
8058
8058
|
const K = M("fm-text-field"), X = M("fm-button"), le = M("FmTooltip"), Ae = M("fm-textarea"), xe = M("fm-radio"), je = M("FmSnackbar"), ae = M("FmButton"), J = M("fm-radio-group"), ye = M("FmFormGroup"), ke = M("FmStepperField"), ue = Ht("tooltip");
|
|
8059
8059
|
return _(), W(ve, null, [h(Ke, {
|
|
@@ -8062,8 +8062,8 @@ const Lp = /* @__PURE__ */ fe({
|
|
|
8062
8062
|
default: F(() => {
|
|
8063
8063
|
var It, Qt, Lt, Jt, Yo;
|
|
8064
8064
|
return [C("div", Tp, [C("div", Rp, [C("div", Ip, [h(K, {
|
|
8065
|
-
"model-value":
|
|
8066
|
-
placeholder: ((It =
|
|
8065
|
+
"model-value": $.form.code,
|
|
8066
|
+
placeholder: ((It = $.fallback) == null ? void 0 : It.code) || m(Y)("menu.product.form.detail.fields.code.placeholder"),
|
|
8067
8067
|
"helper-text": !B.value && k.value > 0 ? m(Y)("menu.product.form.detail.fields.code.duplicate_hint", {
|
|
8068
8068
|
count: k.value
|
|
8069
8069
|
}) : void 0,
|
|
@@ -8071,20 +8071,20 @@ const Lp = /* @__PURE__ */ fe({
|
|
|
8071
8071
|
rules: [(he) => !B.value || k.value === 0 || m(Y)("menu.product.form.detail.fields.code.duplicate_warning", {
|
|
8072
8072
|
count: k.value
|
|
8073
8073
|
})],
|
|
8074
|
-
"onUpdate:modelValue":
|
|
8074
|
+
"onUpdate:modelValue": D[0] || (D[0] = (he) => c("update:form", "code", m(Ro)(he, $.isOverride)))
|
|
8075
8075
|
}, null, 8, ["model-value", "placeholder", "helper-text", "label", "rules"])]), C("div", Ep, [h(K, {
|
|
8076
8076
|
id: "product-name",
|
|
8077
8077
|
disabled: !p.value.name,
|
|
8078
|
-
"helper-text":
|
|
8079
|
-
count:
|
|
8078
|
+
"helper-text": P.value > 0 ? m(Y)("menu.product.form.detail.fields.name.duplicate_warning", {
|
|
8079
|
+
count: P.value
|
|
8080
8080
|
}) : void 0,
|
|
8081
|
-
"model-value":
|
|
8082
|
-
placeholder: (Qt =
|
|
8081
|
+
"model-value": $.form.name,
|
|
8082
|
+
placeholder: (Qt = $.fallback) == null ? void 0 : Qt.name,
|
|
8083
8083
|
rules: p.value.name ? [(he) => !!he || m(Y)("menu.product.form.detail.fields.name.required")] : void 0,
|
|
8084
8084
|
"label-mark": "required",
|
|
8085
8085
|
autofocus: "",
|
|
8086
8086
|
label: m(Y)("menu.product.form.detail.fields.name.label"),
|
|
8087
|
-
"onUpdate:modelValue":
|
|
8087
|
+
"onUpdate:modelValue": D[1] || (D[1] = (he) => c("update:form", "name", he))
|
|
8088
8088
|
}, {
|
|
8089
8089
|
append: F(() => [h(le, {
|
|
8090
8090
|
variant: "plain",
|
|
@@ -8109,15 +8109,15 @@ const Lp = /* @__PURE__ */ fe({
|
|
|
8109
8109
|
"helper-text": N.value > 0 ? m(Y)("menu.product.form.detail.fields.name2.duplicate_warning", {
|
|
8110
8110
|
count: N.value
|
|
8111
8111
|
}) : void 0,
|
|
8112
|
-
"model-value":
|
|
8113
|
-
placeholder: ((Lt =
|
|
8112
|
+
"model-value": $.form.name2,
|
|
8113
|
+
placeholder: ((Lt = $.fallback) == null ? void 0 : Lt.name2) || m(Y)("menu.product.form.detail.fields.name2.placeholder"),
|
|
8114
8114
|
label: m(Y)("menu.product.form.detail.fields.name2.label"),
|
|
8115
|
-
"onUpdate:modelValue":
|
|
8115
|
+
"onUpdate:modelValue": D[2] || (D[2] = (he) => c("update:form", "name2", m(Ro)(he, $.isOverride)))
|
|
8116
8116
|
}, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "label"]), C("div", Dp, [h(Ae, {
|
|
8117
8117
|
disabled: !p.value.description,
|
|
8118
|
-
"model-value":
|
|
8119
|
-
placeholder: ((Jt =
|
|
8120
|
-
"onUpdate:modelValue":
|
|
8118
|
+
"model-value": $.form.description || void 0,
|
|
8119
|
+
placeholder: ((Jt = $.fallback) == null ? void 0 : Jt.description) || m(Y)("menu.product.form.detail.fields.description.placeholder"),
|
|
8120
|
+
"onUpdate:modelValue": D[3] || (D[3] = (he) => c("update:form", "description", he.trim())),
|
|
8121
8121
|
class: "description"
|
|
8122
8122
|
}, {
|
|
8123
8123
|
label: F(() => [C("p", $p, [Sn(oe(m(Y)("menu.product.form.detail.fields.description.label")) + " ", 1), C("span", Pp, oe(m(Y)("menu.product.form.detail.fields.description.optional")), 1)])]),
|
|
@@ -8136,7 +8136,7 @@ const Lp = /* @__PURE__ */ fe({
|
|
|
8136
8136
|
variant: "tertiary",
|
|
8137
8137
|
icon: "g_translate",
|
|
8138
8138
|
class: "cursor-pointer",
|
|
8139
|
-
disabled: !(
|
|
8139
|
+
disabled: !($.form.description || (he = $.fallback) != null && he.description) || !p.value.description,
|
|
8140
8140
|
onClick: G
|
|
8141
8141
|
}, null, 8, ["disabled"]), [[ue, m(Vt)("Translate description")]])];
|
|
8142
8142
|
}),
|
|
@@ -8147,21 +8147,21 @@ const Lp = /* @__PURE__ */ fe({
|
|
|
8147
8147
|
}, null, 512), [[ue, m(Vt)("Suggest description")]])])]), h(Ju, {
|
|
8148
8148
|
"cover-only": f.value,
|
|
8149
8149
|
disabled: !p.value.images && !f.value,
|
|
8150
|
-
"item-id":
|
|
8151
|
-
"legacy-thumbnail":
|
|
8150
|
+
"item-id": $.form._id || "",
|
|
8151
|
+
"legacy-thumbnail": $.form.thumbnail ?? ((Yo = $.fallback) == null ? void 0 : Yo.thumbnail) ?? null,
|
|
8152
8152
|
"menu-items": m(o).state.menu.modules.item,
|
|
8153
8153
|
"model-value": g.value,
|
|
8154
|
-
staged:
|
|
8154
|
+
staged: $.staged,
|
|
8155
8155
|
"onUpdate:modelValue": w,
|
|
8156
|
-
"onUpdate:staged":
|
|
8156
|
+
"onUpdate:staged": D[4] || (D[4] = (he) => c("update:staged", he))
|
|
8157
8157
|
}, null, 8, ["cover-only", "disabled", "item-id", "legacy-thumbnail", "menu-items", "model-value", "staged"])]), h(yt, {
|
|
8158
8158
|
label: m(o).isV4 ? m(Y)("menu.product.form.detail.category.label") : m(Y)("menu.product.form.detail.category.label_singular")
|
|
8159
8159
|
}, {
|
|
8160
8160
|
default: F(() => [R.value ? (_(), Q(J, {
|
|
8161
8161
|
key: 0,
|
|
8162
8162
|
disabled: !p.value.category,
|
|
8163
|
-
"model-value":
|
|
8164
|
-
"onUpdate:modelValue":
|
|
8163
|
+
"model-value": O.value,
|
|
8164
|
+
"onUpdate:modelValue": D[5] || (D[5] = (he) => z(he))
|
|
8165
8165
|
}, {
|
|
8166
8166
|
default: F(() => [C("div", Mp, [C("div", Up, [h(xe, {
|
|
8167
8167
|
disabled: A.value || !p.value.category,
|
|
@@ -8189,9 +8189,9 @@ const Lp = /* @__PURE__ */ fe({
|
|
|
8189
8189
|
_: 1
|
|
8190
8190
|
}, 8, ["disabled", "model-value"])) : ee("", !0), m(o).isV4 ? ee("", !0) : (_(), Q(ye, {
|
|
8191
8191
|
key: 1,
|
|
8192
|
-
"model-value":
|
|
8193
|
-
rules: [(he) => !he &&
|
|
8194
|
-
"onUpdate:modelValue":
|
|
8192
|
+
"model-value": $.form.category,
|
|
8193
|
+
rules: [(he) => !he && !$.isOverride ? "Category is required" : !0],
|
|
8194
|
+
"onUpdate:modelValue": D[6] || (D[6] = (he) => c("update:form", "category", he))
|
|
8195
8195
|
}, {
|
|
8196
8196
|
default: F(() => [h(U, {
|
|
8197
8197
|
multiple: !1
|
|
@@ -8199,53 +8199,53 @@ const Lp = /* @__PURE__ */ fe({
|
|
|
8199
8199
|
_: 1
|
|
8200
8200
|
}, 8, ["model-value", "rules"]))]),
|
|
8201
8201
|
_: 1
|
|
8202
|
-
}, 8, ["label"]), m(o).isV4 &&
|
|
8202
|
+
}, 8, ["label"]), m(o).isV4 && !$.isAddon ? (_(), Q(yt, {
|
|
8203
8203
|
key: 0,
|
|
8204
8204
|
label: m(Y)("menu.product.form.detail.path.label")
|
|
8205
8205
|
}, {
|
|
8206
8206
|
default: F(() => [C("div", Np, [h(ll, {
|
|
8207
8207
|
modelValue: se.value,
|
|
8208
|
-
"onUpdate:modelValue":
|
|
8208
|
+
"onUpdate:modelValue": D[7] || (D[7] = (he) => se.value = he),
|
|
8209
8209
|
items: ie.value,
|
|
8210
8210
|
placeholder: m(Y)("menu.product.form.detail.path.placeholder"),
|
|
8211
8211
|
disabled: !p.value.category,
|
|
8212
8212
|
"is-local-only": !1
|
|
8213
8213
|
}, null, 8, ["modelValue", "items", "placeholder", "disabled"])])]),
|
|
8214
8214
|
_: 1
|
|
8215
|
-
}, 8, ["label"])) : ee("", !0), m(o).isV4 &&
|
|
8215
|
+
}, 8, ["label"])) : ee("", !0), m(o).isV4 && !$.isOverride ? (_(), W("div", Bp, [h(ke, {
|
|
8216
8216
|
label: m(Y)("menu.product.form.detail.fields.shelf_life.label"),
|
|
8217
|
-
"model-value":
|
|
8217
|
+
"model-value": $.form.shelfLife ?? null,
|
|
8218
8218
|
rules: [(he) => he == null || he > 0 || m(Y)("menu.common.validation.min_value", {
|
|
8219
8219
|
value: 1
|
|
8220
8220
|
})],
|
|
8221
|
-
"onUpdate:modelValue":
|
|
8221
|
+
"onUpdate:modelValue": D[8] || (D[8] = (he) => {
|
|
8222
8222
|
(he == null || he > 0) && c("update:form", "shelfLife", he);
|
|
8223
8223
|
})
|
|
8224
8224
|
}, null, 8, ["label", "model-value", "rules"]), h(nl, {
|
|
8225
|
-
form:
|
|
8226
|
-
"onUpdate:orderQuantity":
|
|
8225
|
+
form: $.form,
|
|
8226
|
+
"onUpdate:orderQuantity": D[9] || (D[9] = (he) => c("update:form", "orderQuantity", he))
|
|
8227
8227
|
}, null, 8, ["form"])])) : ee("", !0), h($o, {
|
|
8228
8228
|
disabled: !p.value.orderFrom,
|
|
8229
|
-
"model-value":
|
|
8229
|
+
"model-value": $.form.orderFrom,
|
|
8230
8230
|
"order-from-none": p.value.orderFromNone,
|
|
8231
8231
|
required: p.value.orderFrom,
|
|
8232
8232
|
"default-label": m(Y)("menu.product.form.detail.order_from.default"),
|
|
8233
8233
|
label: m(Y)("menu.product.form.detail.order_from.label"),
|
|
8234
|
-
"onUpdate:modelValue":
|
|
8234
|
+
"onUpdate:modelValue": D[10] || (D[10] = (he) => he && c("update:form", "orderFrom", he))
|
|
8235
8235
|
}, null, 8, ["disabled", "model-value", "order-from-none", "required", "default-label", "label"])];
|
|
8236
8236
|
}),
|
|
8237
8237
|
_: 1
|
|
8238
8238
|
}, 8, ["title"]), h(mc, {
|
|
8239
8239
|
modelValue: me.value,
|
|
8240
|
-
"onUpdate:modelValue":
|
|
8241
|
-
"product-name":
|
|
8242
|
-
"product-name-locale":
|
|
8243
|
-
"product-description":
|
|
8244
|
-
"product-description-locale":
|
|
8240
|
+
"onUpdate:modelValue": D[11] || (D[11] = (It) => me.value = It),
|
|
8241
|
+
"product-name": $.form.name || ((Rt = $.fallback) == null ? void 0 : Rt.name) || "",
|
|
8242
|
+
"product-name-locale": $.form.name_locale,
|
|
8243
|
+
"product-description": $.form.description || ((Je = $.fallback) == null ? void 0 : Je.description),
|
|
8244
|
+
"product-description-locale": $.form.description_locale,
|
|
8245
8245
|
"initial-section": pe.value,
|
|
8246
8246
|
"onUpdate:name": v,
|
|
8247
8247
|
"onUpdate:description": S,
|
|
8248
|
-
"onUpdate:nameLocale":
|
|
8248
|
+
"onUpdate:nameLocale": V,
|
|
8249
8249
|
"onUpdate:descriptionLocale": q
|
|
8250
8250
|
}, null, 8, ["modelValue", "product-name", "product-name-locale", "product-description", "product-description-locale", "initial-section"])], 64);
|
|
8251
8251
|
};
|
|
@@ -8348,12 +8348,12 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
|
|
|
8348
8348
|
}), T.size === 0 && n.group.name_locale && Object.keys(n.group.name_locale).forEach((N) => T.add(N));
|
|
8349
8349
|
const x = Array.from(T);
|
|
8350
8350
|
l.value = x;
|
|
8351
|
-
const U = {},
|
|
8351
|
+
const U = {}, P = {};
|
|
8352
8352
|
Object.values(n.group.items).forEach((N) => {
|
|
8353
8353
|
U[N._id] = {}, N.name_locale && Object.entries(N.name_locale).forEach(([B, k]) => {
|
|
8354
8354
|
U[N._id][B] = k;
|
|
8355
|
-
}),
|
|
8356
|
-
}), u.value = U, c.value =
|
|
8355
|
+
}), P[N._id] = N.name || N.fallbackName || "";
|
|
8356
|
+
}), u.value = U, c.value = P;
|
|
8357
8357
|
}
|
|
8358
8358
|
Se(
|
|
8359
8359
|
() => [n.modelValue, n.group],
|
|
@@ -8364,13 +8364,13 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
|
|
|
8364
8364
|
);
|
|
8365
8365
|
function y(T) {
|
|
8366
8366
|
const x = new Set(l.value), U = new Set(T);
|
|
8367
|
-
for (const
|
|
8368
|
-
x.has(
|
|
8369
|
-
u.value[N][
|
|
8367
|
+
for (const P of T)
|
|
8368
|
+
x.has(P) || Object.keys(u.value).forEach((N) => {
|
|
8369
|
+
u.value[N][P] || (u.value[N][P] = "");
|
|
8370
8370
|
});
|
|
8371
|
-
for (const
|
|
8372
|
-
U.has(
|
|
8373
|
-
delete u.value[N][
|
|
8371
|
+
for (const P of x)
|
|
8372
|
+
U.has(P) || Object.keys(u.value).forEach((N) => {
|
|
8373
|
+
delete u.value[N][P];
|
|
8374
8374
|
});
|
|
8375
8375
|
l.value = T;
|
|
8376
8376
|
}
|
|
@@ -8382,10 +8382,10 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
|
|
|
8382
8382
|
Object.keys(T.items).forEach((x) => {
|
|
8383
8383
|
const U = c.value[x];
|
|
8384
8384
|
U !== void 0 && (T.items[x].name = U || null);
|
|
8385
|
-
const
|
|
8386
|
-
if (
|
|
8385
|
+
const P = u.value[x];
|
|
8386
|
+
if (P && Object.keys(P).length > 0) {
|
|
8387
8387
|
const N = {};
|
|
8388
|
-
Object.entries(
|
|
8388
|
+
Object.entries(P).forEach(([B, k]) => {
|
|
8389
8389
|
k && k.trim() && (N[B] = k.trim());
|
|
8390
8390
|
}), Object.keys(N).length > 0 ? T.items[x].name_locale = N : delete T.items[x].name_locale;
|
|
8391
8391
|
} else
|
|
@@ -8400,7 +8400,7 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
|
|
|
8400
8400
|
set: (T) => o("update:modelValue", T)
|
|
8401
8401
|
});
|
|
8402
8402
|
return (T, x) => {
|
|
8403
|
-
const U = M("FmIcon"),
|
|
8403
|
+
const U = M("FmIcon"), P = M("fm-button"), N = M("fm-side-sheet");
|
|
8404
8404
|
return _(), Q(N, {
|
|
8405
8405
|
modelValue: I.value,
|
|
8406
8406
|
"onUpdate:modelValue": x[2] || (x[2] = (B) => I.value = B),
|
|
@@ -8412,13 +8412,13 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
|
|
|
8412
8412
|
]),
|
|
8413
8413
|
"side-sheet-footer": F(() => [
|
|
8414
8414
|
C("div", mf, [
|
|
8415
|
-
h(
|
|
8415
|
+
h(P, {
|
|
8416
8416
|
label: m(i)("common.save"),
|
|
8417
8417
|
size: "lg",
|
|
8418
8418
|
variant: "primary",
|
|
8419
8419
|
onClick: R
|
|
8420
8420
|
}, null, 8, ["label"]),
|
|
8421
|
-
h(
|
|
8421
|
+
h(P, {
|
|
8422
8422
|
label: m(i)("common.cancel"),
|
|
8423
8423
|
size: "lg",
|
|
8424
8424
|
variant: "tertiary",
|
|
@@ -8497,7 +8497,7 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
|
|
|
8497
8497
|
key: k,
|
|
8498
8498
|
"locale-code": k,
|
|
8499
8499
|
modelValue: u.value[B._id][k],
|
|
8500
|
-
"onUpdate:modelValue": (
|
|
8500
|
+
"onUpdate:modelValue": (O) => u.value[B._id][k] = O,
|
|
8501
8501
|
placeholder: B.name || B.fallbackName || ""
|
|
8502
8502
|
}, null, 8, ["locale-code", "modelValue", "onUpdate:modelValue", "placeholder"]))), 128))
|
|
8503
8503
|
])) : ee("", !0)
|
|
@@ -8530,14 +8530,14 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
|
|
|
8530
8530
|
value: T.combinationKey || ""
|
|
8531
8531
|
}))
|
|
8532
8532
|
), p = E(() => {
|
|
8533
|
-
var k,
|
|
8533
|
+
var k, O;
|
|
8534
8534
|
if (!b.value) return null;
|
|
8535
|
-
const T = ((
|
|
8535
|
+
const T = ((O = (k = s.value[d.value]) == null ? void 0 : k.groups) == null ? void 0 : O.find((z) => z._id === o.groupId)) || {
|
|
8536
8536
|
_id: o.groupId,
|
|
8537
8537
|
groupKey: ""
|
|
8538
|
-
}, U = a.state.menu.modules.group.find((z) => z._id === o.groupId),
|
|
8538
|
+
}, U = a.state.menu.modules.group.find((z) => z._id === o.groupId), P = Object.entries({ ...T, items: void 0 }).filter(([, z]) => !!z), N = {
|
|
8539
8539
|
...U,
|
|
8540
|
-
...Object.fromEntries(
|
|
8540
|
+
...Object.fromEntries(P),
|
|
8541
8541
|
items: U.items.map((z) => {
|
|
8542
8542
|
var ne;
|
|
8543
8543
|
const Z = (ne = T.items) == null ? void 0 : ne.find(
|
|
@@ -8563,11 +8563,11 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
|
|
|
8563
8563
|
var N, B;
|
|
8564
8564
|
const x = (N = s.value[d.value].groups) == null ? void 0 : N.findIndex(
|
|
8565
8565
|
(k) => k._id === o.groupId
|
|
8566
|
-
), U = Ce(s.value),
|
|
8566
|
+
), U = Ce(s.value), P = { ...On(T), _id: o.groupId, groupKey: "" };
|
|
8567
8567
|
(x ?? -1) < 0 ? U[d.value] = {
|
|
8568
8568
|
...U[d.value],
|
|
8569
|
-
groups: [...((B = U[d.value]) == null ? void 0 : B.groups) || [],
|
|
8570
|
-
} : U[d.value].groups[x] =
|
|
8569
|
+
groups: [...((B = U[d.value]) == null ? void 0 : B.groups) || [], P]
|
|
8570
|
+
} : U[d.value].groups[x] = P, s.value = U;
|
|
8571
8571
|
}
|
|
8572
8572
|
function g(T) {
|
|
8573
8573
|
const x = c.value.length;
|
|
@@ -8598,8 +8598,8 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
|
|
|
8598
8598
|
var U;
|
|
8599
8599
|
return {
|
|
8600
8600
|
...x,
|
|
8601
|
-
groups: (U = x.groups) == null ? void 0 : U.map((
|
|
8602
|
-
...as(
|
|
8601
|
+
groups: (U = x.groups) == null ? void 0 : U.map((P) => ({
|
|
8602
|
+
...as(P, w())
|
|
8603
8603
|
}))
|
|
8604
8604
|
};
|
|
8605
8605
|
});
|
|
@@ -8619,7 +8619,7 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
|
|
|
8619
8619
|
});
|
|
8620
8620
|
const { t: A } = ge();
|
|
8621
8621
|
return (T, x) => {
|
|
8622
|
-
const U = M("fm-select"),
|
|
8622
|
+
const U = M("fm-select"), P = M("fm-button"), N = M("fm-card");
|
|
8623
8623
|
return _(), Q(or, {
|
|
8624
8624
|
ref_key: "baseFormRef",
|
|
8625
8625
|
ref: R,
|
|
@@ -8652,13 +8652,13 @@ const Qp = /* @__PURE__ */ Tt(Yp, [["render", Zp]]), Jp = { class: "fm-typo-en-t
|
|
|
8652
8652
|
class: "flex-1"
|
|
8653
8653
|
}, null, 8, ["modelValue", "items"]),
|
|
8654
8654
|
C("div", gf, [
|
|
8655
|
-
h(
|
|
8655
|
+
h(P, {
|
|
8656
8656
|
variant: m(ze).Tertiary,
|
|
8657
8657
|
"prepend-icon": "keyboard_arrow_left",
|
|
8658
8658
|
size: "lg",
|
|
8659
8659
|
onClick: x[1] || (x[1] = (B) => g("left"))
|
|
8660
8660
|
}, null, 8, ["variant"]),
|
|
8661
|
-
h(
|
|
8661
|
+
h(P, {
|
|
8662
8662
|
variant: m(ze).Tertiary,
|
|
8663
8663
|
"prepend-icon": "keyboard_arrow_right",
|
|
8664
8664
|
size: "lg",
|
|
@@ -9430,7 +9430,7 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9430
9430
|
searchKey: f,
|
|
9431
9431
|
filter: g
|
|
9432
9432
|
} = Zr(), w = E(() => {
|
|
9433
|
-
const v = Object.entries(n.group.items).filter(([, S]) => g([S.code || "", S.name || S.fallbackName, R(S.price ?? S.fallbackPrice), A(S.orderFrom || S.fallbackOrder), ...(S.items || []).map((
|
|
9433
|
+
const v = Object.entries(n.group.items).filter(([, S]) => g([S.code || "", S.name || S.fallbackName, R(S.price ?? S.fallbackPrice), A(S.orderFrom || S.fallbackOrder), ...(S.items || []).map((V) => [V.code || "", V.name || V.fallbackName, R(V.price ?? V.fallbackPrice), A(V.orderFrom || V.fallbackOrder)].join(""))]));
|
|
9434
9434
|
return Object.fromEntries(v);
|
|
9435
9435
|
}), y = (v) => ({
|
|
9436
9436
|
...n.config,
|
|
@@ -9449,10 +9449,10 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9449
9449
|
enableSorting: !1,
|
|
9450
9450
|
size: 35,
|
|
9451
9451
|
cell: (v) => {
|
|
9452
|
-
var D
|
|
9453
|
-
if ((
|
|
9452
|
+
var $, D;
|
|
9453
|
+
if ((D = ($ = v.row.original) == null ? void 0 : $.items) != null && D.length)
|
|
9454
9454
|
return null;
|
|
9455
|
-
const S = v.row.depth > 0,
|
|
9455
|
+
const S = v.row.depth > 0, V = v.row.original, q = !y(V.combinationKey).isDefault || V.orderFrom === Pe.enum.NONE, re = !!v.getValue();
|
|
9456
9456
|
return h(Ee.FmCheckbox, {
|
|
9457
9457
|
value: "default",
|
|
9458
9458
|
modelValue: re,
|
|
@@ -9462,9 +9462,9 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9462
9462
|
if (S) {
|
|
9463
9463
|
const le = (X = v.row.getParentRow()) == null ? void 0 : X.original;
|
|
9464
9464
|
if (!le) return;
|
|
9465
|
-
k(le._id,
|
|
9465
|
+
k(le._id, V.combinationKey ?? "", "isDefault", K);
|
|
9466
9466
|
} else
|
|
9467
|
-
B(
|
|
9467
|
+
B(V._id, "isDefault", K);
|
|
9468
9468
|
}
|
|
9469
9469
|
}, null);
|
|
9470
9470
|
}
|
|
@@ -9500,21 +9500,21 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9500
9500
|
})]),
|
|
9501
9501
|
enableSorting: !1,
|
|
9502
9502
|
cell: (v) => {
|
|
9503
|
-
var
|
|
9504
|
-
const S = v.getValue(),
|
|
9503
|
+
var D;
|
|
9504
|
+
const S = v.getValue(), V = v.row.original, q = !y(V.combinationKey).name || V.orderFrom === Pe.enum.NONE, re = v.row.depth > 0, $ = V.combinationKey ? co(V.combinationKey, De().variants) : a.rules.group.linkAddonName ? (D = ne.value[V._id]) == null ? void 0 : D.name : null;
|
|
9505
9505
|
return Ue("div", Ue(Ee.FmTextField, {
|
|
9506
9506
|
modelValue: S,
|
|
9507
|
-
placeholder:
|
|
9507
|
+
placeholder: $ ?? "",
|
|
9508
9508
|
disabled: q,
|
|
9509
|
-
rules:
|
|
9509
|
+
rules: $ ? void 0 : [(K) => ((K == null ? void 0 : K.length) ?? 0) > 0 || T("menu.group.option.product_title_required")],
|
|
9510
9510
|
"onUpdate:modelValue": (K) => {
|
|
9511
9511
|
var X;
|
|
9512
9512
|
if (re) {
|
|
9513
9513
|
const le = (X = v.row.getParentRow()) == null ? void 0 : X.original;
|
|
9514
9514
|
if (!le) return;
|
|
9515
|
-
k(le._id,
|
|
9515
|
+
k(le._id, V.combinationKey ?? "", "name", K || null);
|
|
9516
9516
|
} else
|
|
9517
|
-
B(
|
|
9517
|
+
B(V._id, "name", K || null);
|
|
9518
9518
|
},
|
|
9519
9519
|
class: "min-w-[300px]"
|
|
9520
9520
|
}, {
|
|
@@ -9524,7 +9524,7 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9524
9524
|
name: "keyboard_arrow_up",
|
|
9525
9525
|
onClick: v.row.getToggleExpandedHandler(),
|
|
9526
9526
|
class: ["cursor-pointer", "transition-transform", v.row.getIsExpanded() ? "transform rotate-180" : ""],
|
|
9527
|
-
color: y(
|
|
9527
|
+
color: y(V.combinationKey).name ? void 0 : nt.NeutralGray200
|
|
9528
9528
|
}) : void 0;
|
|
9529
9529
|
}
|
|
9530
9530
|
}));
|
|
@@ -9540,7 +9540,7 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9540
9540
|
},
|
|
9541
9541
|
size: 400,
|
|
9542
9542
|
cell: (v) => {
|
|
9543
|
-
const S = v.getValue(),
|
|
9543
|
+
const S = v.getValue(), V = v.row.original, q = !y(null).priceEdit || V.orderFrom === Pe.enum.NONE, re = V.fallbackPrice, $ = v.row.depth > 0, D = x.getMemberPricingPriceVariant(V.price_variant), K = Object.values(D).every((X) => X === null);
|
|
9544
9544
|
return h("div", {
|
|
9545
9545
|
class: "flex items-center gap-8"
|
|
9546
9546
|
}, [h(bt, {
|
|
@@ -9552,18 +9552,18 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9552
9552
|
min: b.value ? void 0 : 0,
|
|
9553
9553
|
"onUpdate:model-value": (X) => {
|
|
9554
9554
|
var le;
|
|
9555
|
-
if (
|
|
9555
|
+
if ($) {
|
|
9556
9556
|
const Ae = (le = v.row.getParentRow()) == null ? void 0 : le.original;
|
|
9557
9557
|
if (!Ae) return;
|
|
9558
9558
|
k(
|
|
9559
9559
|
Ae._id,
|
|
9560
|
-
|
|
9560
|
+
V.combinationKey ?? "",
|
|
9561
9561
|
// @ts-ignore
|
|
9562
9562
|
"price",
|
|
9563
9563
|
X
|
|
9564
9564
|
);
|
|
9565
9565
|
} else
|
|
9566
|
-
B(
|
|
9566
|
+
B(V._id, "price", X);
|
|
9567
9567
|
},
|
|
9568
9568
|
showCurrency: !1,
|
|
9569
9569
|
class: "min-w-[88px]"
|
|
@@ -9572,7 +9572,7 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9572
9572
|
}, [h(Ln, {
|
|
9573
9573
|
title: T("menu.product.form.member_price.configure.title"),
|
|
9574
9574
|
currentConfig: "",
|
|
9575
|
-
priceVariants:
|
|
9575
|
+
priceVariants: D,
|
|
9576
9576
|
showRemy: !1,
|
|
9577
9577
|
basePrice: S,
|
|
9578
9578
|
basePriceFallback: re ? rt(re) : void 0,
|
|
@@ -9582,12 +9582,12 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9582
9582
|
price: X.basePrice,
|
|
9583
9583
|
price_variant: qo(X.priceVariants)
|
|
9584
9584
|
};
|
|
9585
|
-
if (
|
|
9585
|
+
if ($) {
|
|
9586
9586
|
const xe = (Ae = v.row.getParentRow()) == null ? void 0 : Ae.original;
|
|
9587
9587
|
if (!xe) return;
|
|
9588
|
-
k(xe._id,
|
|
9588
|
+
k(xe._id, V.combinationKey ?? "", le);
|
|
9589
9589
|
} else
|
|
9590
|
-
B(
|
|
9590
|
+
B(V._id, le);
|
|
9591
9591
|
}
|
|
9592
9592
|
}, {
|
|
9593
9593
|
default: ({
|
|
@@ -9600,11 +9600,11 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9600
9600
|
default: () => h("span", {
|
|
9601
9601
|
class: "underline line-clamp-2 break-all"
|
|
9602
9602
|
}, [K ? T("menu.product.form.member_price.configure.title") : T("menu.product.form.member_price.configure.title_with_tier", {
|
|
9603
|
-
num: Object.values(
|
|
9603
|
+
num: Object.values(D).filter((le) => le !== null).length
|
|
9604
9604
|
})])
|
|
9605
9605
|
})
|
|
9606
9606
|
}), h(jn, {
|
|
9607
|
-
priceVariants:
|
|
9607
|
+
priceVariants: D,
|
|
9608
9608
|
placement: "left"
|
|
9609
9609
|
}, null)])]);
|
|
9610
9610
|
}
|
|
@@ -9614,27 +9614,27 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9614
9614
|
size: 100,
|
|
9615
9615
|
enableSorting: !1,
|
|
9616
9616
|
cell: (v) => {
|
|
9617
|
-
const S = v.getValue(),
|
|
9617
|
+
const S = v.getValue(), V = v.row.original, q = V.fallbackOrder, re = v.row.depth > 0;
|
|
9618
9618
|
return Ue($o, {
|
|
9619
9619
|
modelValue: S,
|
|
9620
9620
|
fallback: q,
|
|
9621
|
-
disable: !y(
|
|
9621
|
+
disable: !y(V.combinationKey).orderFrom,
|
|
9622
9622
|
required: !0,
|
|
9623
|
-
editActiveOnly: y(
|
|
9624
|
-
"onUpdate:modelValue": (
|
|
9625
|
-
var
|
|
9623
|
+
editActiveOnly: y(V.combinationKey).orderFromActiveOnly,
|
|
9624
|
+
"onUpdate:modelValue": ($) => {
|
|
9625
|
+
var D;
|
|
9626
9626
|
if (re) {
|
|
9627
|
-
const K = (
|
|
9627
|
+
const K = (D = v.row.getParentRow()) == null ? void 0 : D.original;
|
|
9628
9628
|
if (!K) return;
|
|
9629
9629
|
k(
|
|
9630
9630
|
K._id,
|
|
9631
|
-
|
|
9631
|
+
V.combinationKey ?? "",
|
|
9632
9632
|
// @ts-ignore
|
|
9633
9633
|
"orderFrom",
|
|
9634
|
-
|
|
9634
|
+
$
|
|
9635
9635
|
);
|
|
9636
9636
|
} else
|
|
9637
|
-
B(
|
|
9637
|
+
B(V._id, "orderFrom", $);
|
|
9638
9638
|
},
|
|
9639
9639
|
label: "",
|
|
9640
9640
|
menuZIndex: 101
|
|
@@ -9649,13 +9649,13 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9649
9649
|
// size: rules.value.inventory && rules.value.link ? 80 : 40,
|
|
9650
9650
|
size: 80,
|
|
9651
9651
|
cell: (v) => {
|
|
9652
|
-
const S = v.row.original,
|
|
9652
|
+
const S = v.row.original, V = S.orderFrom === Pe.enum.NONE, q = v.row.depth > 0, re = se(S), $ = (D) => {
|
|
9653
9653
|
const K = h(M("fm-button"), {
|
|
9654
9654
|
variant: ze.Tertiary,
|
|
9655
|
-
disabled:
|
|
9655
|
+
disabled: V || !re.length,
|
|
9656
9656
|
prependIcon: "arrow_split",
|
|
9657
9657
|
textColor: nt.NeutralGray400,
|
|
9658
|
-
onClick:
|
|
9658
|
+
onClick: D
|
|
9659
9659
|
}, null);
|
|
9660
9660
|
return h(M("fm-tooltip"), {
|
|
9661
9661
|
content: T("menu.group.nested.title"),
|
|
@@ -9674,12 +9674,12 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9674
9674
|
}, [y(null).priceTier && h(nr, {
|
|
9675
9675
|
priceTiers: S.priceTiers,
|
|
9676
9676
|
priceTiersVariant: S.priceTiers_variant,
|
|
9677
|
-
disabled:
|
|
9678
|
-
"onUpdate:value": (
|
|
9677
|
+
disabled: V,
|
|
9678
|
+
"onUpdate:value": (D) => {
|
|
9679
9679
|
var X;
|
|
9680
9680
|
const K = {
|
|
9681
|
-
priceTiers:
|
|
9682
|
-
priceTiers_variant: Ko(
|
|
9681
|
+
priceTiers: D.priceTiers,
|
|
9682
|
+
priceTiers_variant: Ko(D.priceTiersVariant)
|
|
9683
9683
|
};
|
|
9684
9684
|
if (q) {
|
|
9685
9685
|
const le = (X = v.row.getParentRow()) == null ? void 0 : X.original;
|
|
@@ -9693,7 +9693,7 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9693
9693
|
initialValue: S.inventoryBindings ?? [],
|
|
9694
9694
|
name: S.name ?? S.fallbackName ?? "",
|
|
9695
9695
|
allowRefund: n.allowRefundInventory,
|
|
9696
|
-
"onUpdate:inventory": (
|
|
9696
|
+
"onUpdate:inventory": (D) => {
|
|
9697
9697
|
var K;
|
|
9698
9698
|
if (q) {
|
|
9699
9699
|
const X = (K = v.row.getParentRow()) == null ? void 0 : K.original;
|
|
@@ -9703,14 +9703,14 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9703
9703
|
S.combinationKey ?? "",
|
|
9704
9704
|
// @ts-ignore
|
|
9705
9705
|
"inventoryBindings",
|
|
9706
|
-
|
|
9706
|
+
D
|
|
9707
9707
|
);
|
|
9708
9708
|
} else
|
|
9709
|
-
B(S._id, "inventoryBindings",
|
|
9709
|
+
B(S._id, "inventoryBindings", D);
|
|
9710
9710
|
}
|
|
9711
9711
|
}, {
|
|
9712
9712
|
default: ({
|
|
9713
|
-
trigger:
|
|
9713
|
+
trigger: D
|
|
9714
9714
|
}) => h(M("fm-tooltip"), {
|
|
9715
9715
|
content: "Inventory",
|
|
9716
9716
|
zIndex: 110
|
|
@@ -9719,25 +9719,25 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9719
9719
|
var K;
|
|
9720
9720
|
return [h(M("fm-button"), {
|
|
9721
9721
|
variant: ze.Tertiary,
|
|
9722
|
-
disabled:
|
|
9722
|
+
disabled: V,
|
|
9723
9723
|
prependIcon: "inventory_2",
|
|
9724
9724
|
overwriteIconOutline: (K = S.inventoryBindings) != null && K.length ? "filled" : "outline",
|
|
9725
9725
|
textColor: nt.NeutralGray400,
|
|
9726
|
-
onClick:
|
|
9726
|
+
onClick: D
|
|
9727
9727
|
}, null)];
|
|
9728
9728
|
}
|
|
9729
9729
|
})
|
|
9730
|
-
}), re.length === 0 ?
|
|
9730
|
+
}), re.length === 0 ? $() : h(Ef, {
|
|
9731
9731
|
itemName: Y(S),
|
|
9732
9732
|
groups: re,
|
|
9733
9733
|
allItems: a.state.menu.modules.item,
|
|
9734
9734
|
maxWidth: 800
|
|
9735
9735
|
}, {
|
|
9736
9736
|
default: ({
|
|
9737
|
-
trigger:
|
|
9738
|
-
}) => D
|
|
9737
|
+
trigger: D
|
|
9738
|
+
}) => $(D),
|
|
9739
9739
|
action: ({
|
|
9740
|
-
group:
|
|
9740
|
+
group: D
|
|
9741
9741
|
}) => h(er, {
|
|
9742
9742
|
combinations: [{
|
|
9743
9743
|
_id: S._id,
|
|
@@ -9747,7 +9747,7 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9747
9747
|
fullCombinations: {
|
|
9748
9748
|
[S.combinationKey || ""]: S.name || S.fallbackName || ""
|
|
9749
9749
|
},
|
|
9750
|
-
groupId:
|
|
9750
|
+
groupId: D._id,
|
|
9751
9751
|
hideVariantSection: !0,
|
|
9752
9752
|
"onUpdate:combinations": (K) => {
|
|
9753
9753
|
var le, Ae;
|
|
@@ -9775,11 +9775,11 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9775
9775
|
textColor: nt.NeutralGray400,
|
|
9776
9776
|
disabled: q,
|
|
9777
9777
|
onClick: () => {
|
|
9778
|
-
|
|
9778
|
+
O(S._id);
|
|
9779
9779
|
}
|
|
9780
9780
|
}, null)]);
|
|
9781
9781
|
}
|
|
9782
|
-
}]),
|
|
9782
|
+
}]), P = E(() => ({
|
|
9783
9783
|
code: c.value,
|
|
9784
9784
|
name: !0,
|
|
9785
9785
|
price: y(null).price,
|
|
@@ -9804,7 +9804,7 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9804
9804
|
}
|
|
9805
9805
|
});
|
|
9806
9806
|
}
|
|
9807
|
-
function B(v, S,
|
|
9807
|
+
function B(v, S, V) {
|
|
9808
9808
|
const q = n.group.items[v];
|
|
9809
9809
|
if (!q) return;
|
|
9810
9810
|
const re = {
|
|
@@ -9813,8 +9813,8 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9813
9813
|
if (typeof S == "object" && S !== null)
|
|
9814
9814
|
Object.assign(re, S);
|
|
9815
9815
|
else {
|
|
9816
|
-
const
|
|
9817
|
-
|
|
9816
|
+
const $ = S;
|
|
9817
|
+
$ === "price" ? re.price = !V && !q.fallbackPrice ? Ye.Dinero.zero().toObject() : V : re[$] = V;
|
|
9818
9818
|
}
|
|
9819
9819
|
o("update:group", {
|
|
9820
9820
|
...n.group,
|
|
@@ -9824,20 +9824,20 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9824
9824
|
}
|
|
9825
9825
|
});
|
|
9826
9826
|
}
|
|
9827
|
-
function k(v, S,
|
|
9827
|
+
function k(v, S, V, q) {
|
|
9828
9828
|
var K, X;
|
|
9829
|
-
const re = Ce(n.group),
|
|
9830
|
-
if (!Bt.isSet(
|
|
9831
|
-
let
|
|
9832
|
-
|
|
9833
|
-
...
|
|
9834
|
-
...
|
|
9835
|
-
} :
|
|
9836
|
-
...
|
|
9837
|
-
[
|
|
9838
|
-
}, re.items[v].items[
|
|
9839
|
-
}
|
|
9840
|
-
function
|
|
9829
|
+
const re = Ce(n.group), $ = (K = re.items[v].items) == null ? void 0 : K.findIndex((le) => le.combinationKey === S);
|
|
9830
|
+
if (!Bt.isSet($)) return;
|
|
9831
|
+
let D = (X = re.items[v].items) == null ? void 0 : X[$];
|
|
9832
|
+
D && (typeof V == "object" && V !== null ? D = {
|
|
9833
|
+
...D,
|
|
9834
|
+
...V
|
|
9835
|
+
} : D = {
|
|
9836
|
+
...D,
|
|
9837
|
+
[V]: q
|
|
9838
|
+
}, re.items[v].items[$] = D, o("update:group", re));
|
|
9839
|
+
}
|
|
9840
|
+
function O(v) {
|
|
9841
9841
|
const S = Ce(n.group);
|
|
9842
9842
|
delete S.items[v], o("update:group", S);
|
|
9843
9843
|
}
|
|
@@ -9845,14 +9845,14 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9845
9845
|
n.config.isV4 ? o("update:group", v) : o("update:unmap-group", On(v));
|
|
9846
9846
|
}
|
|
9847
9847
|
const Z = E(() => n.categorizedItems.flatMap((v) => v.items).reduce((v, S) => {
|
|
9848
|
-
var
|
|
9848
|
+
var V;
|
|
9849
9849
|
return v[S._id] = {
|
|
9850
9850
|
price: S.price,
|
|
9851
|
-
variants: Er(((
|
|
9851
|
+
variants: Er(((V = S.variant) == null ? void 0 : V.variantCombinations) || [], "combinationKey")
|
|
9852
9852
|
}, v;
|
|
9853
9853
|
}, {})), ne = E(() => a.state.menu.modules.item.reduce((v, S) => (v[S._id] = S, v), {})), j = E(() => {
|
|
9854
9854
|
const v = a.state.menu.modules.item, S = a.state.menu.modules.group;
|
|
9855
|
-
return Object.values(n.group.items).flatMap((
|
|
9855
|
+
return Object.values(n.group.items).flatMap((V) => [V, ...V.items ?? []]).reduce((V, q) => (V[ie(q)] = Qf(q, v, S), V), {});
|
|
9856
9856
|
});
|
|
9857
9857
|
function ie(v) {
|
|
9858
9858
|
return `${v._id}:${v.combinationKey ?? ""}`;
|
|
@@ -9861,22 +9861,22 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9861
9861
|
return j.value[ie(v)] ?? [];
|
|
9862
9862
|
}
|
|
9863
9863
|
function Y(v) {
|
|
9864
|
-
var
|
|
9865
|
-
const S = v.combinationKey ? co(v.combinationKey, a.variants) : (
|
|
9864
|
+
var V;
|
|
9865
|
+
const S = v.combinationKey ? co(v.combinationKey, a.variants) : (V = ne.value[v._id]) == null ? void 0 : V.name;
|
|
9866
9866
|
return v.name || v.fallbackName || S || "";
|
|
9867
9867
|
}
|
|
9868
9868
|
function me(v) {
|
|
9869
|
-
const S = [],
|
|
9869
|
+
const S = [], V = new Set(v.filter((q) => q.combinationKey).map((q) => `${q._id}:${q.combinationKey}`));
|
|
9870
9870
|
return v.forEach((q) => {
|
|
9871
|
-
var
|
|
9871
|
+
var D;
|
|
9872
9872
|
if (q.combinationKey)
|
|
9873
9873
|
return;
|
|
9874
9874
|
S.push(q);
|
|
9875
9875
|
const re = ne.value[q._id];
|
|
9876
|
-
if (!re || !re.variant || ((
|
|
9876
|
+
if (!re || !re.variant || ((D = re.variant.variantCombinations) == null ? void 0 : D.length) === 0)
|
|
9877
9877
|
return;
|
|
9878
9878
|
(re.variant.variantCombinations || []).forEach((K) => {
|
|
9879
|
-
const X = `${K._id}:${K.combinationKey}`, le = !
|
|
9879
|
+
const X = `${K._id}:${K.combinationKey}`, le = !V.has(X);
|
|
9880
9880
|
S.push({
|
|
9881
9881
|
_id: K._id,
|
|
9882
9882
|
combinationKey: K.combinationKey,
|
|
@@ -9887,18 +9887,18 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9887
9887
|
}
|
|
9888
9888
|
const pe = async (v) => {
|
|
9889
9889
|
let S = On(n.group);
|
|
9890
|
-
const
|
|
9890
|
+
const V = me(v);
|
|
9891
9891
|
S = {
|
|
9892
9892
|
...S,
|
|
9893
|
-
items:
|
|
9894
|
-
const re = S.items.find((
|
|
9893
|
+
items: V.map((q) => {
|
|
9894
|
+
const re = S.items.find((D) => D._id == q._id && D.combinationKey == q.combinationKey);
|
|
9895
9895
|
q.orderFrom && re && (re.orderFrom = q.orderFrom);
|
|
9896
|
-
const
|
|
9896
|
+
const $ = Z.value[q._id];
|
|
9897
9897
|
return re || {
|
|
9898
9898
|
...q,
|
|
9899
9899
|
name: null,
|
|
9900
9900
|
// By default for linking products, setting null making the item name be determined by fallback name, which is the original item/variant name, and user can still edit the name if needed.
|
|
9901
|
-
price: q.combinationKey ?
|
|
9901
|
+
price: q.combinationKey ? $.variants[q.combinationKey || ""].price : $.price,
|
|
9902
9902
|
orderFrom: q.orderFrom ?? Pe.enum.ALL
|
|
9903
9903
|
};
|
|
9904
9904
|
})
|
|
@@ -9906,14 +9906,14 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9906
9906
|
}, te = (v) => v.items;
|
|
9907
9907
|
function ce(v) {
|
|
9908
9908
|
const S = Ce(n.group);
|
|
9909
|
-
S.items = v.reduce((
|
|
9910
|
-
...
|
|
9909
|
+
S.items = v.reduce((V, q) => ({
|
|
9910
|
+
...V,
|
|
9911
9911
|
[q._id]: q
|
|
9912
9912
|
}), {}), o("update:group", S);
|
|
9913
9913
|
}
|
|
9914
9914
|
const be = qi(), G = E(() => be.breakpoints.value.xs);
|
|
9915
9915
|
return (v, S) => {
|
|
9916
|
-
const
|
|
9916
|
+
const V = M("fm-button"), q = M("fm-table");
|
|
9917
9917
|
return _(), W(ve, null, [h(Ke, {
|
|
9918
9918
|
title: m(T)("menu.group.option.title"),
|
|
9919
9919
|
"sub-title": v.config.link() && d.value ? m(T)("menu.group.option.subtitle") : ""
|
|
@@ -9932,7 +9932,7 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9932
9932
|
}, {
|
|
9933
9933
|
default: F(({
|
|
9934
9934
|
trigger: re
|
|
9935
|
-
}) => [h(
|
|
9935
|
+
}) => [h(V, {
|
|
9936
9936
|
"text-color": m(nt).ColorPrimary,
|
|
9937
9937
|
"border-color": m(nt).ColorPrimary,
|
|
9938
9938
|
variant: "secondary",
|
|
@@ -9941,7 +9941,7 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9941
9941
|
onClick: re
|
|
9942
9942
|
}, null, 8, ["text-color", "border-color", "label", "onClick"])]),
|
|
9943
9943
|
_: 1
|
|
9944
|
-
}, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (_(), W("div", eh, [h(
|
|
9944
|
+
}, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (_(), W("div", eh, [h(V, {
|
|
9945
9945
|
"text-color": m(nt).ColorPrimary,
|
|
9946
9946
|
"border-color": m(nt).ColorPrimary,
|
|
9947
9947
|
variant: "secondary",
|
|
@@ -9951,7 +9951,7 @@ const ih = /* @__PURE__ */ fe({
|
|
|
9951
9951
|
}, null, 8, ["text-color", "border-color", "label"])]))], 64)) : ee("", !0)]),
|
|
9952
9952
|
default: F(() => [C("div", th, [C("div", nh, [h(q, {
|
|
9953
9953
|
"column-defs": U.value,
|
|
9954
|
-
"column-visibility":
|
|
9954
|
+
"column-visibility": P.value,
|
|
9955
9955
|
draggable: !G.value && y(null).name,
|
|
9956
9956
|
"expanded-state": l.value ? {} : I.value,
|
|
9957
9957
|
"get-sub-row": te,
|
|
@@ -10084,7 +10084,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10084
10084
|
name: te
|
|
10085
10085
|
}));
|
|
10086
10086
|
}
|
|
10087
|
-
function
|
|
10087
|
+
function P(te) {
|
|
10088
10088
|
function ce() {
|
|
10089
10089
|
I({
|
|
10090
10090
|
...o.group,
|
|
@@ -10116,7 +10116,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10116
10116
|
() => {
|
|
10117
10117
|
g.value = !1;
|
|
10118
10118
|
}
|
|
10119
|
-
),
|
|
10119
|
+
), O = E(() => o.action === "add" ? Y("common.add") : Y("common.update"));
|
|
10120
10120
|
async function z() {
|
|
10121
10121
|
var te;
|
|
10122
10122
|
if (o.action === "add") {
|
|
@@ -10223,10 +10223,10 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10223
10223
|
});
|
|
10224
10224
|
return (te, ce) => {
|
|
10225
10225
|
var K;
|
|
10226
|
-
const be = M("fm-button"), G = M("FmTooltip"), v = M("fm-text-field"), S = M("fm-stepper-field"),
|
|
10226
|
+
const be = M("fm-button"), G = M("FmTooltip"), v = M("fm-text-field"), S = M("fm-stepper-field"), V = M("FmFormGroup"), q = M("fm-radio"), re = M("fm-radio-group"), $ = M("fm-switch"), D = M("fm-side-sheet");
|
|
10227
10227
|
return _(), W(ve, null, [
|
|
10228
10228
|
Oe(te.$slots, "default", { trigger: y }),
|
|
10229
|
-
h(
|
|
10229
|
+
h(D, {
|
|
10230
10230
|
id: "group-form",
|
|
10231
10231
|
modelValue: g.value,
|
|
10232
10232
|
"onUpdate:modelValue": ce[9] || (ce[9] = (X) => g.value = X),
|
|
@@ -10244,7 +10244,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10244
10244
|
"side-sheet-footer": F(() => [
|
|
10245
10245
|
C("div", uh, [
|
|
10246
10246
|
h(be, {
|
|
10247
|
-
label: m(Qr)(
|
|
10247
|
+
label: m(Qr)(O.value),
|
|
10248
10248
|
loading: f.value,
|
|
10249
10249
|
size: "lg",
|
|
10250
10250
|
type: "submit",
|
|
@@ -10300,7 +10300,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10300
10300
|
]),
|
|
10301
10301
|
_: 1
|
|
10302
10302
|
}, 8, ["modelValue", "placeholder", "disabled", "rules", "label"]),
|
|
10303
|
-
h(
|
|
10303
|
+
h(V, {
|
|
10304
10304
|
"model-value": te.group.min + " " + te.group.max,
|
|
10305
10305
|
rules: m(p)
|
|
10306
10306
|
}, {
|
|
@@ -10337,7 +10337,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10337
10337
|
h(re, {
|
|
10338
10338
|
disabled: A("type"),
|
|
10339
10339
|
"model-value": te.group.type,
|
|
10340
|
-
"onUpdate:modelValue": ce[4] || (ce[4] = (le) =>
|
|
10340
|
+
"onUpdate:modelValue": ce[4] || (ce[4] = (le) => P(le))
|
|
10341
10341
|
}, {
|
|
10342
10342
|
default: F(() => [
|
|
10343
10343
|
(_(!0), W(ve, null, Ie(L.value, (le) => (_(), Q(q, {
|
|
@@ -10355,7 +10355,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10355
10355
|
label: m(Y)("menu.common.labels.configuration")
|
|
10356
10356
|
}, {
|
|
10357
10357
|
default: F(() => [
|
|
10358
|
-
h(
|
|
10358
|
+
h($, {
|
|
10359
10359
|
modelValue: te.group.stackable,
|
|
10360
10360
|
"onUpdate:modelValue": ce[5] || (ce[5] = (le) => te.group.stackable = le),
|
|
10361
10361
|
disabled: A("stackable"),
|
|
@@ -10385,7 +10385,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10385
10385
|
}),
|
|
10386
10386
|
_: 1
|
|
10387
10387
|
}),
|
|
10388
|
-
h(
|
|
10388
|
+
h(V, {
|
|
10389
10389
|
tag: "div",
|
|
10390
10390
|
modelValue: te.group,
|
|
10391
10391
|
rules: [m(c)],
|
|
@@ -10571,8 +10571,8 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10571
10571
|
const n = e, o = Qe(), i = De(), a = Wn(), r = tt(), {
|
|
10572
10572
|
t: l
|
|
10573
10573
|
} = ge(), s = t, u = E(() => i.rules.group), d = E(() => i.rules.item), c = E(() => i.groups);
|
|
10574
|
-
function p(k,
|
|
10575
|
-
return Ce(
|
|
10574
|
+
function p(k, O) {
|
|
10575
|
+
return Ce(O ?? []).map((Z) => {
|
|
10576
10576
|
const ne = k.find((j) => j._id === Z._id);
|
|
10577
10577
|
return {
|
|
10578
10578
|
name: (ne == null ? void 0 : ne.name) ?? "",
|
|
@@ -10582,21 +10582,21 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10582
10582
|
});
|
|
10583
10583
|
}
|
|
10584
10584
|
const f = E(() => {
|
|
10585
|
-
var
|
|
10586
|
-
return [...g(p(c.value, n.form.groups || ((
|
|
10585
|
+
var O;
|
|
10586
|
+
return [...g(p(c.value, n.form.groups || ((O = n.fallback) == null ? void 0 : O.groups) || [])).map((z) => z._id)];
|
|
10587
10587
|
});
|
|
10588
10588
|
function g(k) {
|
|
10589
10589
|
return Ce(k ?? []).sort((z, Z) => z.position - Z.position);
|
|
10590
10590
|
}
|
|
10591
10591
|
function w(k) {
|
|
10592
|
-
const
|
|
10593
|
-
if (!
|
|
10592
|
+
const O = c.value.find((ne) => ne._id === k);
|
|
10593
|
+
if (!O)
|
|
10594
10594
|
return [];
|
|
10595
10595
|
const z = [];
|
|
10596
|
-
return
|
|
10596
|
+
return O.items.forEach((ne) => {
|
|
10597
10597
|
if (ne.combinationKey)
|
|
10598
10598
|
return;
|
|
10599
|
-
const j = i.items.find((se) => se._id === ne._id), ie =
|
|
10599
|
+
const j = i.items.find((se) => se._id === ne._id), ie = O.items.filter((se) => se._id === ne._id && se.combinationKey).length;
|
|
10600
10600
|
z.push({
|
|
10601
10601
|
code: ne.code || (j == null ? void 0 : j.code),
|
|
10602
10602
|
name: ne.name || (j == null ? void 0 : j.name),
|
|
@@ -10609,22 +10609,22 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10609
10609
|
})})` : j;
|
|
10610
10610
|
});
|
|
10611
10611
|
}
|
|
10612
|
-
const y = E(() => g(c.value).reduce((k,
|
|
10613
|
-
name:
|
|
10614
|
-
type: Fn(i.items,
|
|
10612
|
+
const y = E(() => g(c.value).reduce((k, O) => (k[O._id] = {
|
|
10613
|
+
name: O.name,
|
|
10614
|
+
type: Fn(i.items, O.items)
|
|
10615
10615
|
}, k), {})), b = E(() => [...Object.entries(y.value).map(([k, {
|
|
10616
|
-
name:
|
|
10616
|
+
name: O,
|
|
10617
10617
|
type: z
|
|
10618
10618
|
}]) => ({
|
|
10619
|
-
label: `${
|
|
10619
|
+
label: `${O} ${u.value.type ? `(${mo(z)})` : ""}`.trim(),
|
|
10620
10620
|
value: k
|
|
10621
10621
|
}))]), R = E(() => [{
|
|
10622
10622
|
accessorKey: "name",
|
|
10623
10623
|
header: () => l("menu.product.form.group.columns.title"),
|
|
10624
10624
|
enableSorting: !1,
|
|
10625
10625
|
cell: (k) => {
|
|
10626
|
-
const
|
|
10627
|
-
return N(
|
|
10626
|
+
const O = k.row.original._id;
|
|
10627
|
+
return N(O);
|
|
10628
10628
|
}
|
|
10629
10629
|
}, {
|
|
10630
10630
|
id: "type",
|
|
@@ -10633,8 +10633,8 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10633
10633
|
enableSorting: !1,
|
|
10634
10634
|
cell: (k) => {
|
|
10635
10635
|
var z;
|
|
10636
|
-
const
|
|
10637
|
-
return mo((z = y.value[
|
|
10636
|
+
const O = k.row.original._id;
|
|
10637
|
+
return mo((z = y.value[O]) == null ? void 0 : z.type);
|
|
10638
10638
|
}
|
|
10639
10639
|
}, {
|
|
10640
10640
|
accessorKey: "items",
|
|
@@ -10642,7 +10642,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10642
10642
|
enableSorting: !1,
|
|
10643
10643
|
size: 200,
|
|
10644
10644
|
cell: (k) => {
|
|
10645
|
-
const
|
|
10645
|
+
const O = k.row.original._id, Z = w(O).join(", ");
|
|
10646
10646
|
return h(Ee.FmTooltip, {
|
|
10647
10647
|
"z-index": 51,
|
|
10648
10648
|
class: "flex",
|
|
@@ -10667,7 +10667,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10667
10667
|
size: 52,
|
|
10668
10668
|
enableSorting: !1,
|
|
10669
10669
|
cell: (k) => {
|
|
10670
|
-
const
|
|
10670
|
+
const O = k.row.original._id;
|
|
10671
10671
|
return Ue("div", {
|
|
10672
10672
|
class: "flex justify-end"
|
|
10673
10673
|
}, [Ue(Ee.FmButton, {
|
|
@@ -10675,14 +10675,14 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10675
10675
|
variant: "tertiary",
|
|
10676
10676
|
textColor: "neutral-gray-400",
|
|
10677
10677
|
onClick: ct(async () => {
|
|
10678
|
-
T(
|
|
10678
|
+
T(O);
|
|
10679
10679
|
}, ["stop", "prevent"])
|
|
10680
10680
|
}), Ue(dh, {
|
|
10681
10681
|
// variant items
|
|
10682
10682
|
combinations: U.value ?? [],
|
|
10683
10683
|
// combinationKey: varaintName
|
|
10684
10684
|
fullCombinations: n.fullCombinations,
|
|
10685
|
-
groupId:
|
|
10685
|
+
groupId: O,
|
|
10686
10686
|
"onUpdate:combinations": B
|
|
10687
10687
|
}, {
|
|
10688
10688
|
default: ({
|
|
@@ -10690,7 +10690,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10690
10690
|
}) => Ue(Ee.FmButton, {
|
|
10691
10691
|
icon: "edit",
|
|
10692
10692
|
variant: "tertiary",
|
|
10693
|
-
disabled:
|
|
10693
|
+
disabled: !P(O),
|
|
10694
10694
|
textColor: "neutral-gray-400",
|
|
10695
10695
|
onClick: z
|
|
10696
10696
|
})
|
|
@@ -10707,10 +10707,10 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10707
10707
|
groupIds: f.value
|
|
10708
10708
|
}
|
|
10709
10709
|
}).onPrimary((k) => {
|
|
10710
|
-
var
|
|
10710
|
+
var O;
|
|
10711
10711
|
for (const z of k)
|
|
10712
10712
|
if (Ps(i.state.menu, z, n.form._id)) {
|
|
10713
|
-
const Z = (
|
|
10713
|
+
const Z = (O = y.value[z]) == null ? void 0 : O.name;
|
|
10714
10714
|
o.open({
|
|
10715
10715
|
type: "error",
|
|
10716
10716
|
message: l("menu.product.form.group.circularError", {
|
|
@@ -10724,7 +10724,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10724
10724
|
});
|
|
10725
10725
|
}
|
|
10726
10726
|
function I(k) {
|
|
10727
|
-
const
|
|
10727
|
+
const O = k.reduce((z, Z) => {
|
|
10728
10728
|
var j;
|
|
10729
10729
|
const ne = ((j = n.form.groups) == null ? void 0 : j.find((ie) => ie._id === Z)) || {
|
|
10730
10730
|
_id: Z,
|
|
@@ -10734,20 +10734,20 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10734
10734
|
}, []);
|
|
10735
10735
|
s("replace:form", a.initDynamicGroupItem({
|
|
10736
10736
|
...n.form,
|
|
10737
|
-
groups:
|
|
10737
|
+
groups: O
|
|
10738
10738
|
}));
|
|
10739
10739
|
}
|
|
10740
10740
|
function T(k) {
|
|
10741
10741
|
var z, Z, ne;
|
|
10742
10742
|
if (!n.form.groups)
|
|
10743
10743
|
return;
|
|
10744
|
-
const
|
|
10745
|
-
|
|
10744
|
+
const O = Ce(n.form.groups);
|
|
10745
|
+
O.splice(O.findIndex((j) => j._id === k), 1);
|
|
10746
10746
|
for (const j of ((z = n.form.variant) == null ? void 0 : z.variantCombinations) || [])
|
|
10747
10747
|
(ne = j.groups) == null || ne.splice((Z = j.groups) == null ? void 0 : Z.findIndex((ie) => ie._id === k), 1);
|
|
10748
10748
|
s("replace:form", a.initDynamicGroupItem({
|
|
10749
10749
|
...n.form,
|
|
10750
|
-
groups:
|
|
10750
|
+
groups: O
|
|
10751
10751
|
}));
|
|
10752
10752
|
}
|
|
10753
10753
|
const x = E(() => {
|
|
@@ -10761,7 +10761,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10761
10761
|
groups: n.form.groups || []
|
|
10762
10762
|
}];
|
|
10763
10763
|
});
|
|
10764
|
-
function
|
|
10764
|
+
function P(k) {
|
|
10765
10765
|
var z;
|
|
10766
10766
|
if (!k) return !1;
|
|
10767
10767
|
if (d.value.overrideProductGroup) return !0;
|
|
@@ -10778,16 +10778,16 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10778
10778
|
}
|
|
10779
10779
|
Se(() => c.value.length, () => I([...f.value, c.value[c.value.length - 1]._id]));
|
|
10780
10780
|
const N = (k) => {
|
|
10781
|
-
var
|
|
10782
|
-
return (
|
|
10781
|
+
var O;
|
|
10782
|
+
return (O = b.value.find((z) => z.value === k)) == null ? void 0 : O.label;
|
|
10783
10783
|
}, B = (k) => {
|
|
10784
|
-
var
|
|
10784
|
+
var O;
|
|
10785
10785
|
x.value ? s("update:form", "variant", {
|
|
10786
|
-
variantGroupIds: ((
|
|
10786
|
+
variantGroupIds: ((O = n.form.variant) == null ? void 0 : O.variantGroupIds) || [],
|
|
10787
10787
|
variantCombinations: k
|
|
10788
10788
|
}) : s("update:form", "groups", k[0].groups || []);
|
|
10789
10789
|
};
|
|
10790
|
-
return (k,
|
|
10790
|
+
return (k, O) => {
|
|
10791
10791
|
const z = M("FmButton"), Z = M("FmTable");
|
|
10792
10792
|
return _(), Q(Ke, {
|
|
10793
10793
|
title: m(l)("menu.product.form.group.title"),
|
|
@@ -10869,7 +10869,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10869
10869
|
return p(o.form.inventoryBindings || [], ((A = o.form.variant) == null ? void 0 : A.variantCombinations) || [], f.value, a.variants);
|
|
10870
10870
|
});
|
|
10871
10871
|
function w(A, L) {
|
|
10872
|
-
var U,
|
|
10872
|
+
var U, P;
|
|
10873
10873
|
let I = $e.clone(o.form);
|
|
10874
10874
|
const T = I.variant;
|
|
10875
10875
|
if ((((U = T == null ? void 0 : T.variantCombinations) == null ? void 0 : U.length) ?? 0) > 0 && T) {
|
|
@@ -10879,7 +10879,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
10879
10879
|
B[N].inventoryBindings = L, I = {
|
|
10880
10880
|
...I,
|
|
10881
10881
|
variant: {
|
|
10882
|
-
variantGroupIds: ((
|
|
10882
|
+
variantGroupIds: ((P = I.variant) == null ? void 0 : P.variantGroupIds) || [],
|
|
10883
10883
|
variantCombinations: B
|
|
10884
10884
|
}
|
|
10885
10885
|
};
|
|
@@ -11051,8 +11051,8 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
11051
11051
|
if (!I && n.form.perXUnit) {
|
|
11052
11052
|
const [T, x] = n.form.perXUnit.toString().split(".");
|
|
11053
11053
|
if (x && x.length > 4) {
|
|
11054
|
-
const
|
|
11055
|
-
l("update:form", "perXUnit", parseFloat(
|
|
11054
|
+
const P = (typeof n.form.perXUnit == "string" ? parseFloat(n.form.perXUnit) : n.form.perXUnit).toFixed(4);
|
|
11055
|
+
l("update:form", "perXUnit", parseFloat(P));
|
|
11056
11056
|
}
|
|
11057
11057
|
}
|
|
11058
11058
|
}
|
|
@@ -11083,12 +11083,12 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
11083
11083
|
T ? l("update:form", "priceTiers_variant", Ko(I)) : l("update:form", "price_variant", qo(I));
|
|
11084
11084
|
}
|
|
11085
11085
|
return (I, T) => {
|
|
11086
|
-
const x = M("fm-select"), U = M("FmButton"),
|
|
11086
|
+
const x = M("fm-select"), U = M("FmButton"), P = M("fm-checkbox"), N = M("fm-text-field"), B = Ht("tooltip");
|
|
11087
11087
|
return _(), Q(Ke, {
|
|
11088
11088
|
title: m(r)("menu.product.form.price.title")
|
|
11089
11089
|
}, {
|
|
11090
11090
|
default: F(() => {
|
|
11091
|
-
var k,
|
|
11091
|
+
var k, O;
|
|
11092
11092
|
return [
|
|
11093
11093
|
C("div", xh, [
|
|
11094
11094
|
h(bt, {
|
|
@@ -11139,7 +11139,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
11139
11139
|
currentConfig: "Main Pricing",
|
|
11140
11140
|
"product-name": I.form.name,
|
|
11141
11141
|
"base-price": I.form.price,
|
|
11142
|
-
"base-price-fallback": (
|
|
11142
|
+
"base-price-fallback": (O = I.fallback) != null && O.price ? m(rt)(I.fallback.price, !1) : void 0,
|
|
11143
11143
|
"price-variants": A.value,
|
|
11144
11144
|
"show-remy": !0,
|
|
11145
11145
|
"onUpdate:basePrice": T[2] || (T[2] = (z) => l("update:form", "price", z)),
|
|
@@ -11193,7 +11193,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
11193
11193
|
var z, Z, ne;
|
|
11194
11194
|
return [
|
|
11195
11195
|
C("div", Oh, [
|
|
11196
|
-
h(
|
|
11196
|
+
h(P, {
|
|
11197
11197
|
disabled: !s.value.openPrice || I.isAddon,
|
|
11198
11198
|
"model-value": I.form.openPrice ?? ((z = I.fallback) == null ? void 0 : z.openPrice) ?? !1,
|
|
11199
11199
|
value: I.form.openPrice,
|
|
@@ -11202,7 +11202,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
11202
11202
|
"onUpdate:modelValue": T[6] || (T[6] = (j) => l("update:form", "openPrice", j))
|
|
11203
11203
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
11204
11204
|
C("div", Dh, [
|
|
11205
|
-
h(
|
|
11205
|
+
h(P, {
|
|
11206
11206
|
disabled: !s.value.unit || I.isAddon,
|
|
11207
11207
|
"model-value": u.value,
|
|
11208
11208
|
value: u.value,
|
|
@@ -11241,7 +11241,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
11241
11241
|
])) : ee("", !0)
|
|
11242
11242
|
]),
|
|
11243
11243
|
s.value.costing ? (_(), W("div", Mh, [
|
|
11244
|
-
h(
|
|
11244
|
+
h(P, {
|
|
11245
11245
|
"model-value": !!I.form.costing,
|
|
11246
11246
|
value: !!I.form.costing,
|
|
11247
11247
|
label: m(r)("menu.product.form.price.settings.track_costing.label"),
|
|
@@ -11261,7 +11261,7 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
11261
11261
|
])) : ee("", !0)
|
|
11262
11262
|
])) : ee("", !0),
|
|
11263
11263
|
s.value.minPrice ? (_(), W("div", Nh, [
|
|
11264
|
-
h(
|
|
11264
|
+
h(P, {
|
|
11265
11265
|
disabled: !s.value.minPrice || I.isAddon,
|
|
11266
11266
|
"model-value": !!I.form.minPrice,
|
|
11267
11267
|
value: !!I.form.minPrice,
|
|
@@ -11494,10 +11494,10 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
11494
11494
|
label: m(i)("menu.product.form.print.config.label")
|
|
11495
11495
|
}, {
|
|
11496
11496
|
default: F(() => {
|
|
11497
|
-
var
|
|
11497
|
+
var P;
|
|
11498
11498
|
return [
|
|
11499
11499
|
h(A, {
|
|
11500
|
-
"model-value": !((
|
|
11500
|
+
"model-value": !((P = b.form.print) != null && P.toRoot),
|
|
11501
11501
|
label: m(i)("menu.product.form.print.config.group_parent.label"),
|
|
11502
11502
|
"label-placement": "right",
|
|
11503
11503
|
sublabel: m(i)("menu.product.form.print.config.group_parent.sublabel"),
|
|
@@ -11510,15 +11510,15 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
11510
11510
|
h(I, {
|
|
11511
11511
|
label: m(i)("menu.product.form.print.kds.label"),
|
|
11512
11512
|
"model-value": ((U = b.form.print) == null ? void 0 : U.sequential) ?? !1,
|
|
11513
|
-
"onUpdate:modelValue": R[1] || (R[1] = (
|
|
11513
|
+
"onUpdate:modelValue": R[1] || (R[1] = (P) => f(P))
|
|
11514
11514
|
}, {
|
|
11515
11515
|
default: F(() => [
|
|
11516
11516
|
C("div", Yh, [
|
|
11517
|
-
(_(!0), W(ve, null, Ie(y.value, (
|
|
11517
|
+
(_(!0), W(ve, null, Ie(y.value, (P, N) => (_(), Q(L, {
|
|
11518
11518
|
key: N,
|
|
11519
|
-
label:
|
|
11520
|
-
sublabel:
|
|
11521
|
-
value:
|
|
11519
|
+
label: P.label,
|
|
11520
|
+
sublabel: P.description,
|
|
11521
|
+
value: P.value
|
|
11522
11522
|
}, null, 8, ["label", "sublabel", "value"]))), 128))
|
|
11523
11523
|
])
|
|
11524
11524
|
]),
|
|
@@ -11530,20 +11530,20 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
11530
11530
|
default: F(() => [
|
|
11531
11531
|
d.value.length ? (_(), Q(m(Ji), {
|
|
11532
11532
|
key: 0,
|
|
11533
|
-
"item-key": (
|
|
11533
|
+
"item-key": (P) => P,
|
|
11534
11534
|
"model-value": d.value,
|
|
11535
11535
|
handle: ".handle",
|
|
11536
|
-
"onUpdate:modelValue": R[3] || (R[3] = (
|
|
11536
|
+
"onUpdate:modelValue": R[3] || (R[3] = (P) => g(P)),
|
|
11537
11537
|
class: "space-y-16"
|
|
11538
11538
|
}, {
|
|
11539
|
-
item: F(({ element:
|
|
11540
|
-
var N, B, k,
|
|
11539
|
+
item: F(({ element: P }) => {
|
|
11540
|
+
var N, B, k, O, z;
|
|
11541
11541
|
return [
|
|
11542
11542
|
C("div", Xh, [
|
|
11543
11543
|
C("div", Zh, [
|
|
11544
11544
|
u.value ? (_(), Q(T, {
|
|
11545
11545
|
key: 0,
|
|
11546
|
-
disabled: !((B = (N = n.form.print) == null ? void 0 : N.department) != null && B.includes(
|
|
11546
|
+
disabled: !((B = (N = n.form.print) == null ? void 0 : N.department) != null && B.includes(P)),
|
|
11547
11547
|
class: "handle",
|
|
11548
11548
|
"prepend-icon": "drag_handle",
|
|
11549
11549
|
variant: "tertiary",
|
|
@@ -11552,13 +11552,13 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
11552
11552
|
}, null, 8, ["disabled"])) : ee("", !0)
|
|
11553
11553
|
]),
|
|
11554
11554
|
h(x, {
|
|
11555
|
-
id:
|
|
11556
|
-
"data-checked": (
|
|
11557
|
-
label: c.value[
|
|
11558
|
-
"model-value": (((z = n.form.print) == null ? void 0 : z.department) ?? []).includes(
|
|
11559
|
-
value:
|
|
11555
|
+
id: P,
|
|
11556
|
+
"data-checked": (O = (k = n.form.print) == null ? void 0 : k.department) == null ? void 0 : O.includes(P),
|
|
11557
|
+
label: c.value[P],
|
|
11558
|
+
"model-value": (((z = n.form.print) == null ? void 0 : z.department) ?? []).includes(P),
|
|
11559
|
+
value: P,
|
|
11560
11560
|
class: "flex-1",
|
|
11561
|
-
"onUpdate:modelValue": (Z) => w(
|
|
11561
|
+
"onUpdate:modelValue": (Z) => w(P, Z)
|
|
11562
11562
|
}, null, 8, ["id", "data-checked", "label", "model-value", "value", "onUpdate:modelValue"])
|
|
11563
11563
|
])
|
|
11564
11564
|
];
|
|
@@ -11566,13 +11566,13 @@ const rh = { class: "fm-typo-en-title-md-600" }, sh = {
|
|
|
11566
11566
|
_: 1
|
|
11567
11567
|
}, 8, ["item-key", "model-value"])) : ee("", !0),
|
|
11568
11568
|
h(m(qh), { "apply-product": !1 }, {
|
|
11569
|
-
default: F(({ trigger:
|
|
11569
|
+
default: F(({ trigger: P }) => [
|
|
11570
11570
|
C("div", Qh, [
|
|
11571
11571
|
h(T, {
|
|
11572
11572
|
variant: m(ze).Secondary,
|
|
11573
11573
|
label: m(i)("menu.product.form.print.routes.add"),
|
|
11574
11574
|
"prepend-icon": "add",
|
|
11575
|
-
onClick:
|
|
11575
|
+
onClick: P
|
|
11576
11576
|
}, null, 8, ["variant", "label", "onClick"])
|
|
11577
11577
|
])
|
|
11578
11578
|
]),
|
|
@@ -12094,25 +12094,25 @@ const sg = {
|
|
|
12094
12094
|
}) {
|
|
12095
12095
|
const n = e, o = De(), i = Wn(), a = Qe(), r = tt(), {
|
|
12096
12096
|
t: l
|
|
12097
|
-
} = ge(), s = H(!1), u = E(() => o.rules.item), d = E(() => u.value.minPrice && !!n.form.minPrice), c = E(() => !o.state.currentCatalogId), p = E(() => o.variants.reduce((k,
|
|
12097
|
+
} = ge(), s = H(!1), u = E(() => o.rules.item), d = E(() => u.value.minPrice && !!n.form.minPrice), c = E(() => !o.state.currentCatalogId), p = E(() => o.variants.reduce((k, O) => (k[O._id] = O, k), {})), f = t;
|
|
12098
12098
|
function g(k) {
|
|
12099
|
-
const
|
|
12099
|
+
const O = $e.clone(n.form);
|
|
12100
12100
|
for (const {
|
|
12101
12101
|
key: z,
|
|
12102
12102
|
value: Z
|
|
12103
12103
|
} of k)
|
|
12104
|
-
|
|
12105
|
-
f("replace:form",
|
|
12104
|
+
O[z] = Z;
|
|
12105
|
+
f("replace:form", O);
|
|
12106
12106
|
}
|
|
12107
12107
|
function w(k) {
|
|
12108
12108
|
var z;
|
|
12109
|
-
const
|
|
12109
|
+
const O = b(k.combinationKey || "");
|
|
12110
12110
|
return {
|
|
12111
12111
|
...k,
|
|
12112
|
-
price:
|
|
12113
|
-
inventoryBindings: (
|
|
12114
|
-
takeawayUsed: (
|
|
12115
|
-
groups: (
|
|
12112
|
+
price: O == null ? void 0 : O.price,
|
|
12113
|
+
inventoryBindings: (O == null ? void 0 : O.inventoryBindings) || n.form.inventoryBindings,
|
|
12114
|
+
takeawayUsed: (O == null ? void 0 : O.takeawayUsed) || n.form.takeawayUsed,
|
|
12115
|
+
groups: (O == null ? void 0 : O.groups) || ((z = n.form.groups) == null ? void 0 : z.map((Z) => ({
|
|
12116
12116
|
...Z,
|
|
12117
12117
|
groupKey: ""
|
|
12118
12118
|
})))
|
|
@@ -12126,20 +12126,20 @@ const sg = {
|
|
|
12126
12126
|
contentComponentProps: {
|
|
12127
12127
|
selectedVariants: ((k = n.form.variant) == null ? void 0 : k.variantGroupIds) ?? []
|
|
12128
12128
|
}
|
|
12129
|
-
}).onPrimary(async (
|
|
12130
|
-
L(
|
|
12129
|
+
}).onPrimary(async (O) => {
|
|
12130
|
+
L(O, w);
|
|
12131
12131
|
});
|
|
12132
12132
|
}
|
|
12133
12133
|
function b(k) {
|
|
12134
12134
|
var ie, se;
|
|
12135
|
-
const
|
|
12135
|
+
const O = ((ie = n.form.variant) == null ? void 0 : ie.variantGroupIds) || [], z = (se = n.form.variant) == null ? void 0 : se.variantCombinations, j = k.split(/(?=variant)/g).map((Y) => Y.replace(/\/*$/, "")).filter((Y) => O.some((me) => Y.includes(me))).join("/");
|
|
12136
12136
|
return z == null ? void 0 : z.find((Y) => Y.combinationKey === j);
|
|
12137
12137
|
}
|
|
12138
12138
|
const R = (k) => {
|
|
12139
12139
|
L(k);
|
|
12140
12140
|
}, A = E(() => {
|
|
12141
|
-
var
|
|
12142
|
-
return (((
|
|
12141
|
+
var O;
|
|
12142
|
+
return (((O = n.form.variant) == null ? void 0 : O.variantCombinations) || []).map((z) => {
|
|
12143
12143
|
var j, ie;
|
|
12144
12144
|
const Z = (ie = (j = n.fallback) == null ? void 0 : j.variant) == null ? void 0 : ie.variantCombinations.find(({
|
|
12145
12145
|
combinationKey: se
|
|
@@ -12158,7 +12158,7 @@ const sg = {
|
|
|
12158
12158
|
};
|
|
12159
12159
|
});
|
|
12160
12160
|
});
|
|
12161
|
-
function L(k,
|
|
12161
|
+
function L(k, O = (z) => z) {
|
|
12162
12162
|
var ne;
|
|
12163
12163
|
const z = k.filter((j) => !!j);
|
|
12164
12164
|
let Z;
|
|
@@ -12168,7 +12168,7 @@ const sg = {
|
|
|
12168
12168
|
}) => {
|
|
12169
12169
|
var me;
|
|
12170
12170
|
const Y = (me = n.form.variant) == null ? void 0 : me.variantCombinations.find((pe) => pe.combinationKey === se);
|
|
12171
|
-
return
|
|
12171
|
+
return O(Y || {
|
|
12172
12172
|
_id: n.form._id,
|
|
12173
12173
|
combinationKey: se
|
|
12174
12174
|
});
|
|
@@ -12205,17 +12205,17 @@ const sg = {
|
|
|
12205
12205
|
}
|
|
12206
12206
|
f("replace:form", i.initDynamicGroupItem(Z));
|
|
12207
12207
|
}
|
|
12208
|
-
async function I(k,
|
|
12208
|
+
async function I(k, O, z) {
|
|
12209
12209
|
const Z = $e.clone(n.form);
|
|
12210
|
-
Z.variant.variantCombinations[k][
|
|
12210
|
+
Z.variant.variantCombinations[k][O] = z, g([{
|
|
12211
12211
|
key: "variant",
|
|
12212
12212
|
value: Z.variant
|
|
12213
12213
|
}]);
|
|
12214
12214
|
}
|
|
12215
12215
|
const T = E(() => {
|
|
12216
|
-
var k,
|
|
12217
|
-
return ((k = o.currentCatalog) == null ? void 0 : k.priceTierRules) ?? ((
|
|
12218
|
-
}), x = E(() => T.value.length > 0 && o.currentCatalog && !o.currentScheduler), U = Vn(),
|
|
12216
|
+
var k, O;
|
|
12217
|
+
return ((k = o.currentCatalog) == null ? void 0 : k.priceTierRules) ?? ((O = o.currentCatalog) == null ? void 0 : O.usePriceTiers) ?? [];
|
|
12218
|
+
}), x = E(() => T.value.length > 0 && o.currentCatalog && !o.currentScheduler), U = Vn(), P = E(() => [{
|
|
12219
12219
|
accessorKey: "combinationKey",
|
|
12220
12220
|
header: () => l("menu.product.form.variant.columns.variant"),
|
|
12221
12221
|
enableSorting: !1,
|
|
@@ -12226,9 +12226,9 @@ const sg = {
|
|
|
12226
12226
|
enableSorting: !1,
|
|
12227
12227
|
cell: (k) => {
|
|
12228
12228
|
var j, ie;
|
|
12229
|
-
const
|
|
12229
|
+
const O = k.getValue(), z = k.row.original, ne = ((j = z.fallback) == null ? void 0 : j.code) ?? n.form.code ?? ((ie = n.fallback) == null ? void 0 : ie.code);
|
|
12230
12230
|
return h(Ee.FmTextField, {
|
|
12231
|
-
modelValue:
|
|
12231
|
+
modelValue: O,
|
|
12232
12232
|
placeholder: ne || l("menu.product.form.variant.placeholders.no_code"),
|
|
12233
12233
|
rules: [(se) => {
|
|
12234
12234
|
const Y = se, me = E(() => {
|
|
@@ -12254,9 +12254,9 @@ const sg = {
|
|
|
12254
12254
|
enableSorting: !1,
|
|
12255
12255
|
cell: (k) => {
|
|
12256
12256
|
var ne, j;
|
|
12257
|
-
const
|
|
12257
|
+
const O = k.getValue(), Z = (ne = k.row.original.fallback) == null ? void 0 : ne.orderFrom;
|
|
12258
12258
|
return h($o, {
|
|
12259
|
-
modelValue:
|
|
12259
|
+
modelValue: O,
|
|
12260
12260
|
fallback: n.form.orderFrom ?? Z ?? ((j = n.fallback) == null ? void 0 : j.orderFrom),
|
|
12261
12261
|
disable: !u.value.orderFrom,
|
|
12262
12262
|
required: u.value.orderFrom && u.value.orderFromActiveOnly,
|
|
@@ -12275,13 +12275,13 @@ const sg = {
|
|
|
12275
12275
|
enableSorting: !1,
|
|
12276
12276
|
cell: (k) => {
|
|
12277
12277
|
var se, Y, me;
|
|
12278
|
-
const
|
|
12278
|
+
const O = k.getValue(), z = k.row.original, ne = ((se = z.fallback) == null ? void 0 : se.price) ?? n.form.price ?? ((Y = n.fallback) == null ? void 0 : Y.price), j = U.getMemberPricingPriceVariant(z.price_variant), ie = Object.values(j).every((pe) => pe === null);
|
|
12279
12279
|
return h("div", {
|
|
12280
12280
|
class: "flex items-center gap-8"
|
|
12281
12281
|
}, [h(bt, {
|
|
12282
12282
|
disable: x.value,
|
|
12283
12283
|
placeholder: ne ? rt(ne) : void 0,
|
|
12284
|
-
modelValue:
|
|
12284
|
+
modelValue: O,
|
|
12285
12285
|
min: 0,
|
|
12286
12286
|
"onUpdate:model-value": (pe) => {
|
|
12287
12287
|
I(k.row.index, "price", pe);
|
|
@@ -12295,7 +12295,7 @@ const sg = {
|
|
|
12295
12295
|
currentConfig: "",
|
|
12296
12296
|
priceVariants: j,
|
|
12297
12297
|
showRemy: !1,
|
|
12298
|
-
basePrice:
|
|
12298
|
+
basePrice: O,
|
|
12299
12299
|
basePriceFallback: ne ? rt(ne) : void 0,
|
|
12300
12300
|
"onUpdate:basePrice": (pe) => {
|
|
12301
12301
|
I(k.row.index, "price", pe);
|
|
@@ -12334,10 +12334,10 @@ const sg = {
|
|
|
12334
12334
|
enableSorting: !1,
|
|
12335
12335
|
cell: (k) => {
|
|
12336
12336
|
var j, ie, se;
|
|
12337
|
-
const
|
|
12337
|
+
const O = k.getValue(), z = k.row.original, ne = ((j = z.fallback) == null ? void 0 : j.minPrice) ?? n.form.minPrice ?? ((ie = n.fallback) == null ? void 0 : ie.minPrice);
|
|
12338
12338
|
return h(bt, {
|
|
12339
12339
|
placeholder: ne ? rt(ne) : void 0,
|
|
12340
|
-
modelValue:
|
|
12340
|
+
modelValue: O,
|
|
12341
12341
|
max: Ye.Dinero.fromFdoDinero(z.price ?? ((se = z.fallback) == null ? void 0 : se.price) ?? Ye.Dinero.zero().toObject()).toUnit(),
|
|
12342
12342
|
"onUpdate:model-value": (Y) => {
|
|
12343
12343
|
I(k.row.index, "minPrice", Y);
|
|
@@ -12354,7 +12354,7 @@ const sg = {
|
|
|
12354
12354
|
max: o.rules.item.maxVariant
|
|
12355
12355
|
}) : !0;
|
|
12356
12356
|
}
|
|
12357
|
-
return (k,
|
|
12357
|
+
return (k, O) => {
|
|
12358
12358
|
const z = M("fm-button"), Z = M("fm-icon"), ne = M("FmFormGroup"), j = M("fm-table");
|
|
12359
12359
|
return _(), Q(Ke, {
|
|
12360
12360
|
title: m(l)("menu.product.form.variant.title"),
|
|
@@ -12408,7 +12408,7 @@ const sg = {
|
|
|
12408
12408
|
default: F(() => [A.value.length ? (_(), Q(j, {
|
|
12409
12409
|
key: 0,
|
|
12410
12410
|
class: "w-full",
|
|
12411
|
-
"column-defs":
|
|
12411
|
+
"column-defs": P.value,
|
|
12412
12412
|
"column-visibility": N.value,
|
|
12413
12413
|
"page-size": A.value.length ?? 0,
|
|
12414
12414
|
"row-data": A.value ?? [],
|
|
@@ -12533,7 +12533,7 @@ const sg = {
|
|
|
12533
12533
|
), ye = i.taxSetting.countryTaxOptions.find((ue) => ue.value === ae);
|
|
12534
12534
|
return ye ? Dr(ye.meta.rate) : "-";
|
|
12535
12535
|
}
|
|
12536
|
-
const
|
|
12536
|
+
const P = E(() => {
|
|
12537
12537
|
var ae, J, ye, ke, ue, Rt, Je, It, Qt;
|
|
12538
12538
|
return {
|
|
12539
12539
|
title: r("menu.product.form.summary.title"),
|
|
@@ -12598,7 +12598,7 @@ const sg = {
|
|
|
12598
12598
|
for (const [ke, ue] of Object.entries(J.customAttributes || {}))
|
|
12599
12599
|
typeof ue == "string" && ue && !((ye = ae[ke]) != null && ye.includes(ue)) && (ae[ke] = [...ae[ke] || [], ue]);
|
|
12600
12600
|
}), ae;
|
|
12601
|
-
}),
|
|
12601
|
+
}), O = H(!!f.value.price || !!f.value.minPrice || !!f.value.costing);
|
|
12602
12602
|
function z(ae) {
|
|
12603
12603
|
ae || (f.value = {
|
|
12604
12604
|
...f.value,
|
|
@@ -12750,16 +12750,16 @@ const sg = {
|
|
|
12750
12750
|
Wt(() => {
|
|
12751
12751
|
S.isUpdatingItem || (S.isUpdatingItem = !0, S.storedCatalogId = i.state.currentCatalogId, S.storedSchedulerId = i.state.currentSchedulerId);
|
|
12752
12752
|
});
|
|
12753
|
-
function
|
|
12753
|
+
function V() {
|
|
12754
12754
|
S.isUpdatingItem = !1, i.selectCatalog(S.storedCatalogId), i.selectScheduler(S.storedSchedulerId);
|
|
12755
12755
|
}
|
|
12756
12756
|
async function q() {
|
|
12757
12757
|
await oi(), I.value && [
|
|
12758
12758
|
[N.value, B],
|
|
12759
|
-
[
|
|
12759
|
+
[O.value, z]
|
|
12760
12760
|
].forEach(([J, ye]) => {
|
|
12761
12761
|
J || ye(!1);
|
|
12762
|
-
}), o("submit:form", Rs(Ce(f.value)), R.value), c(),
|
|
12762
|
+
}), o("submit:form", Rs(Ce(f.value)), R.value), c(), V();
|
|
12763
12763
|
}
|
|
12764
12764
|
async function re() {
|
|
12765
12765
|
var ae;
|
|
@@ -12776,9 +12776,9 @@ const sg = {
|
|
|
12776
12776
|
console.error("Failed to clean up discarded product images", ye);
|
|
12777
12777
|
}
|
|
12778
12778
|
}
|
|
12779
|
-
c(),
|
|
12779
|
+
c(), V();
|
|
12780
12780
|
}
|
|
12781
|
-
const { isAtMost:
|
|
12781
|
+
const { isAtMost: $ } = qi(), D = H(null), K = Wr(D);
|
|
12782
12782
|
return (ae, J) => (_(), W(ve, null, [
|
|
12783
12783
|
Oe(ae.$slots, "trigger", cr(dr({
|
|
12784
12784
|
trigger: c
|
|
@@ -12799,17 +12799,17 @@ const sg = {
|
|
|
12799
12799
|
onOnCancel: re
|
|
12800
12800
|
}, {
|
|
12801
12801
|
"append-title": F(() => [
|
|
12802
|
-
m(
|
|
12802
|
+
m($)("sm") ? (_(), Q(ri, {
|
|
12803
12803
|
key: 0,
|
|
12804
12804
|
variant: "dialog",
|
|
12805
|
-
title:
|
|
12806
|
-
items:
|
|
12805
|
+
title: P.value.title,
|
|
12806
|
+
items: P.value.items
|
|
12807
12807
|
}, null, 8, ["title", "items"])) : ee("", !0)
|
|
12808
12808
|
]),
|
|
12809
12809
|
default: F(() => {
|
|
12810
12810
|
var ye, ke;
|
|
12811
12811
|
return [
|
|
12812
|
-
m(
|
|
12812
|
+
m($)("sm") ? ee("", !0) : (_(), Q(ri, {
|
|
12813
12813
|
key: 0,
|
|
12814
12814
|
class: "fixed",
|
|
12815
12815
|
style: mr({
|
|
@@ -12817,13 +12817,13 @@ const sg = {
|
|
|
12817
12817
|
left: m(K).right + "px"
|
|
12818
12818
|
}),
|
|
12819
12819
|
variant: "full",
|
|
12820
|
-
title:
|
|
12821
|
-
items:
|
|
12820
|
+
title: P.value.title,
|
|
12821
|
+
items: P.value.items
|
|
12822
12822
|
}, null, 8, ["style", "title", "items"])),
|
|
12823
12823
|
C("div", Cg, [
|
|
12824
12824
|
C("div", {
|
|
12825
12825
|
ref_key: "formWrapper",
|
|
12826
|
-
ref:
|
|
12826
|
+
ref: D,
|
|
12827
12827
|
class: Ve(["flex-1 py-24 space-y-24", "xs:w-full"])
|
|
12828
12828
|
}, [
|
|
12829
12829
|
g.value && (Object.keys(g.value.catalogs || {}).length > 0 || g.value.schedulers.length > 0) ? (_(), Q(hs, {
|
|
@@ -12874,9 +12874,9 @@ const sg = {
|
|
|
12874
12874
|
}, 8, ["title", "sub-title"])) : ee("", !0),
|
|
12875
12875
|
x.value ? (_(), W("div", xg)) : ee("", !0),
|
|
12876
12876
|
h(Ot, {
|
|
12877
|
-
toggle:
|
|
12877
|
+
toggle: O.value,
|
|
12878
12878
|
"onUpdate:toggle": [
|
|
12879
|
-
J[4] || (J[4] = (ue) =>
|
|
12879
|
+
J[4] || (J[4] = (ue) => O.value = ue),
|
|
12880
12880
|
J[5] || (J[5] = (ue) => z(ue))
|
|
12881
12881
|
],
|
|
12882
12882
|
disabled: !I.value,
|
|
@@ -13134,8 +13134,8 @@ const Wn = Ni("item-manager", () => {
|
|
|
13134
13134
|
const { container: U } = Yi($g, a, {
|
|
13135
13135
|
...x,
|
|
13136
13136
|
autoShow: !0,
|
|
13137
|
-
"onUpdate:show": async (
|
|
13138
|
-
|
|
13137
|
+
"onUpdate:show": async (P) => {
|
|
13138
|
+
P || (xn(null, U), U.remove());
|
|
13139
13139
|
}
|
|
13140
13140
|
});
|
|
13141
13141
|
};
|
|
@@ -13144,17 +13144,17 @@ const Wn = Ni("item-manager", () => {
|
|
|
13144
13144
|
l({
|
|
13145
13145
|
action: "add",
|
|
13146
13146
|
categoryId: x,
|
|
13147
|
-
"onSubmit:form": async (
|
|
13148
|
-
|
|
13147
|
+
"onSubmit:form": async (P, N) => {
|
|
13148
|
+
P.inventoryBindings ?? (P.inventoryBindings = []), P.inventoryBindings.length === 0 && (P.inventoryBindings = null), await U(P, Ne.F_OPERATION_TYPE.create, N);
|
|
13149
13149
|
}
|
|
13150
13150
|
});
|
|
13151
13151
|
}
|
|
13152
|
-
async function u(x, U,
|
|
13152
|
+
async function u(x, U, P) {
|
|
13153
13153
|
l({
|
|
13154
13154
|
initialForm: Vg(x, U || []),
|
|
13155
13155
|
action: "update",
|
|
13156
13156
|
"onSubmit:form": async (N) => {
|
|
13157
|
-
N.inventoryBindings ?? (N.inventoryBindings = []), N.inventoryBindings.length === 0 && (N.inventoryBindings = null), await
|
|
13157
|
+
N.inventoryBindings ?? (N.inventoryBindings = []), N.inventoryBindings.length === 0 && (N.inventoryBindings = null), await P(
|
|
13158
13158
|
Pg(
|
|
13159
13159
|
[N],
|
|
13160
13160
|
e.state.menu,
|
|
@@ -13167,9 +13167,9 @@ const Wn = Ni("item-manager", () => {
|
|
|
13167
13167
|
}
|
|
13168
13168
|
async function d(x) {
|
|
13169
13169
|
var k;
|
|
13170
|
-
const U = e.currentCatalog,
|
|
13171
|
-
await u(x, B, async (
|
|
13172
|
-
const z =
|
|
13170
|
+
const U = e.currentCatalog, P = e.state.currentSchedulerId, N = U.override.scheduler[P] ?? {}, B = (k = N == null ? void 0 : N.items) == null ? void 0 : k.filter((O) => O._id === x._id);
|
|
13171
|
+
await u(x, B, async (O) => {
|
|
13172
|
+
const z = O.modules.catalog.find(
|
|
13173
13173
|
(Z) => Z._id === U._id
|
|
13174
13174
|
);
|
|
13175
13175
|
await new gt(z, e, i.updateMenu, n).update();
|
|
@@ -13177,8 +13177,8 @@ const Wn = Ni("item-manager", () => {
|
|
|
13177
13177
|
}
|
|
13178
13178
|
async function c(x) {
|
|
13179
13179
|
const U = e.currentCatalog;
|
|
13180
|
-
await u(x, U.override.items[x._id], async (
|
|
13181
|
-
const N =
|
|
13180
|
+
await u(x, U.override.items[x._id], async (P) => {
|
|
13181
|
+
const N = P.modules.catalog.find(
|
|
13182
13182
|
(B) => B._id === U._id
|
|
13183
13183
|
);
|
|
13184
13184
|
await new gt(N, e, i.updateMenu, n).update();
|
|
@@ -13187,8 +13187,8 @@ const Wn = Ni("item-manager", () => {
|
|
|
13187
13187
|
async function p(x) {
|
|
13188
13188
|
const U = e.schedulers.find(
|
|
13189
13189
|
(N) => N._id === e.state.currentSchedulerId
|
|
13190
|
-
),
|
|
13191
|
-
await u(x,
|
|
13190
|
+
), P = U.items.filter((N) => N._id === x._id);
|
|
13191
|
+
await u(x, P, async (N) => {
|
|
13192
13192
|
const B = N.modules.scheduler.find(
|
|
13193
13193
|
(k) => k._id === U._id
|
|
13194
13194
|
);
|
|
@@ -13197,29 +13197,29 @@ const Wn = Ni("item-manager", () => {
|
|
|
13197
13197
|
}
|
|
13198
13198
|
async function f(x) {
|
|
13199
13199
|
var B, k;
|
|
13200
|
-
const U = e.state.currentSchedulerId,
|
|
13201
|
-
if (z.combinationKey) return [...
|
|
13200
|
+
const U = e.state.currentSchedulerId, P = Ce(e.currentCatalog), N = (k = ((B = P.override.scheduler[U]) == null ? void 0 : B.items) || []) == null ? void 0 : k.reduce((O, z) => {
|
|
13201
|
+
if (z.combinationKey) return [...O, z];
|
|
13202
13202
|
const Z = x.find((ne) => ne._id === z._id);
|
|
13203
|
-
return Z ? [...
|
|
13203
|
+
return Z ? [...O, { ...z, price: Z.price }] : [...O, z];
|
|
13204
13204
|
}, []);
|
|
13205
|
-
|
|
13206
|
-
|
|
13205
|
+
P.override.scheduler = {
|
|
13206
|
+
...P.override.scheduler,
|
|
13207
13207
|
[U]: {
|
|
13208
|
-
|
|
13208
|
+
...P.override.scheduler[U],
|
|
13209
13209
|
_id: U,
|
|
13210
13210
|
items: N
|
|
13211
13211
|
}
|
|
13212
|
-
}, await new gt(
|
|
13212
|
+
}, await new gt(P, e, i.updateMenu, n).update();
|
|
13213
13213
|
}
|
|
13214
13214
|
async function g(x) {
|
|
13215
13215
|
var B;
|
|
13216
|
-
const U = Ce(e.currentCatalog),
|
|
13217
|
-
(k, [
|
|
13218
|
-
const Z = x.find((j) => j._id ===
|
|
13216
|
+
const U = Ce(e.currentCatalog), P = (B = Object.entries(U.override.items)) == null ? void 0 : B.reduce(
|
|
13217
|
+
(k, [O, z]) => {
|
|
13218
|
+
const Z = x.find((j) => j._id === O);
|
|
13219
13219
|
if (!Z)
|
|
13220
|
-
return k[
|
|
13220
|
+
return k[O] = z, k;
|
|
13221
13221
|
const ne = z.find((j) => !j.combinationKey);
|
|
13222
|
-
return k[
|
|
13222
|
+
return k[O] = [
|
|
13223
13223
|
...z.filter((j) => !!j.combinationKey),
|
|
13224
13224
|
{
|
|
13225
13225
|
...ne,
|
|
@@ -13237,7 +13237,7 @@ const Wn = Ni("item-manager", () => {
|
|
|
13237
13237
|
...U,
|
|
13238
13238
|
override: {
|
|
13239
13239
|
...U.override,
|
|
13240
|
-
items:
|
|
13240
|
+
items: P
|
|
13241
13241
|
}
|
|
13242
13242
|
},
|
|
13243
13243
|
e,
|
|
@@ -13246,15 +13246,15 @@ const Wn = Ni("item-manager", () => {
|
|
|
13246
13246
|
).update();
|
|
13247
13247
|
}
|
|
13248
13248
|
async function w(x) {
|
|
13249
|
-
const U = Ce(e.currentScheduler),
|
|
13249
|
+
const U = Ce(e.currentScheduler), P = U.items.reduce((N, B) => {
|
|
13250
13250
|
if (B.combinationKey) return [...N, B];
|
|
13251
|
-
const k = x.find((
|
|
13251
|
+
const k = x.find((O) => O._id === B._id);
|
|
13252
13252
|
return k ? [...N, { ...B, price: k.price }] : [...N, B];
|
|
13253
13253
|
}, []);
|
|
13254
13254
|
await new wn(
|
|
13255
13255
|
{
|
|
13256
13256
|
...U,
|
|
13257
|
-
items:
|
|
13257
|
+
items: P
|
|
13258
13258
|
},
|
|
13259
13259
|
e,
|
|
13260
13260
|
i.updateMenu,
|
|
@@ -13262,28 +13262,28 @@ const Wn = Ni("item-manager", () => {
|
|
|
13262
13262
|
).update();
|
|
13263
13263
|
}
|
|
13264
13264
|
async function y(x) {
|
|
13265
|
-
const U = x.reduce((
|
|
13266
|
-
const
|
|
13267
|
-
return
|
|
13268
|
-
...
|
|
13269
|
-
code:
|
|
13270
|
-
name:
|
|
13271
|
-
price:
|
|
13272
|
-
orderFrom:
|
|
13273
|
-
taxes:
|
|
13274
|
-
category:
|
|
13275
|
-
position:
|
|
13276
|
-
additionalCategories:
|
|
13277
|
-
subCategories:
|
|
13278
|
-
}),
|
|
13279
|
-
}, []), { updateMenu:
|
|
13280
|
-
await
|
|
13281
|
-
|
|
13265
|
+
const U = new Map(e.state.menu.modules.item.map((B) => [B._id, B])), P = x.reduce((B, k) => {
|
|
13266
|
+
const O = U.get(k._id);
|
|
13267
|
+
return O && B.push({
|
|
13268
|
+
...O,
|
|
13269
|
+
code: k.code ?? O.code,
|
|
13270
|
+
name: k.name || O.name,
|
|
13271
|
+
price: k.price ?? O.price,
|
|
13272
|
+
orderFrom: k.orderFrom ?? O.orderFrom,
|
|
13273
|
+
taxes: k.taxes ?? O.taxes,
|
|
13274
|
+
category: k.category === void 0 ? O.category : k.category,
|
|
13275
|
+
position: k.position ?? O.position,
|
|
13276
|
+
additionalCategories: k.additionalCategories ?? O.additionalCategories,
|
|
13277
|
+
subCategories: k.subCategories ?? O.subCategories
|
|
13278
|
+
}), B;
|
|
13279
|
+
}, []), { updateMenu: N } = i;
|
|
13280
|
+
await N(
|
|
13281
|
+
P.map((B) => ({
|
|
13282
13282
|
module: Be.enum.item,
|
|
13283
13283
|
operation: Ne.F_OPERATION_TYPE.update,
|
|
13284
|
-
data:
|
|
13284
|
+
data: B
|
|
13285
13285
|
})),
|
|
13286
|
-
`${
|
|
13286
|
+
`${P.length} products`
|
|
13287
13287
|
);
|
|
13288
13288
|
}
|
|
13289
13289
|
function b(x) {
|
|
@@ -13291,13 +13291,13 @@ const Wn = Ni("item-manager", () => {
|
|
|
13291
13291
|
l({
|
|
13292
13292
|
initialForm: x,
|
|
13293
13293
|
action: "update",
|
|
13294
|
-
"onSubmit:form": async (
|
|
13295
|
-
|
|
13294
|
+
"onSubmit:form": async (P, N) => {
|
|
13295
|
+
P.inventoryBindings ?? (P.inventoryBindings = []), P.inventoryBindings.length === 0 && (P.inventoryBindings = null), await U(P, Ne.F_OPERATION_TYPE.update, N);
|
|
13296
13296
|
}
|
|
13297
13297
|
});
|
|
13298
13298
|
}
|
|
13299
13299
|
async function R(x) {
|
|
13300
|
-
const U = e.state.menu.modules.item.find((
|
|
13300
|
+
const U = e.state.menu.modules.item.find((P) => P._id === x);
|
|
13301
13301
|
e.currentCatalog ? e.state.currentSchedulerId ? await d(U) : await c(U) : e.state.currentSchedulerId ? await p(U) : b(U);
|
|
13302
13302
|
}
|
|
13303
13303
|
async function A(x) {
|
|
@@ -13307,10 +13307,10 @@ const Wn = Ni("item-manager", () => {
|
|
|
13307
13307
|
);
|
|
13308
13308
|
}
|
|
13309
13309
|
function L(x) {
|
|
13310
|
-
const { updateMenu: U } = i,
|
|
13310
|
+
const { updateMenu: U } = i, P = x.length > 1 ? `${x.length} products` : x[0].name;
|
|
13311
13311
|
n.open({
|
|
13312
13312
|
title: r("menu.common.dialog.remove.product.title"),
|
|
13313
|
-
message: r("menu.common.dialog.remove.product.message", { name:
|
|
13313
|
+
message: r("menu.common.dialog.remove.product.message", { name: P }),
|
|
13314
13314
|
primaryActions: {
|
|
13315
13315
|
text: r("menu.common.actions.remove"),
|
|
13316
13316
|
close: !0,
|
|
@@ -13327,7 +13327,7 @@ const Wn = Ni("item-manager", () => {
|
|
|
13327
13327
|
operation: Ne.F_OPERATION_TYPE.delete,
|
|
13328
13328
|
data: N
|
|
13329
13329
|
})),
|
|
13330
|
-
|
|
13330
|
+
P,
|
|
13331
13331
|
!0
|
|
13332
13332
|
);
|
|
13333
13333
|
try {
|