@feedmepos/mf-connect 0.1.12-prod → 0.1.14-prod
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/{Analytic-D_0-S9bm.js → Analytic-MRp7gtO3.js} +9 -9
- package/dist/{App-CRUf3Y0S.js → App-BU3B2A-F.js} +6 -6
- package/dist/{Broadcast-B0pjSEvx.js → Broadcast-DmciJlSU.js} +38 -37
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-k3T8QO9-.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DJPOgBXj.js} +7 -7
- package/dist/{Card-DK6dhPcq.js → Card-Dq2cAgTi.js} +15 -15
- package/dist/Collections-B4x4VH1a.js +445 -0
- package/dist/{Credit-B2QhAnU7.js → Credit-CVdT1KBU.js} +57 -56
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CWMtJS9Z.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BmjXu-U7.js} +27 -27
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C09W42uh.js → EffectSheet.vue_vue_type_style_index_0_lang-A_uosv-g.js} +6 -6
- package/dist/{Experience-4j5Hoeig.js → Experience-CEeXWbue.js} +39 -38
- package/dist/{Game-Dvc5v56r.js → Game-mx5c5ZhV.js} +46 -45
- package/dist/{Index-vWNoadSH.js → Index-DQ1qadwz.js} +9 -9
- package/dist/{Marketing-DkkAcFb4.js → Marketing-CciBZijv.js} +5 -5
- package/dist/{Member-CM1b1duv.js → Member-C51SlKxj.js} +4 -4
- package/dist/{MemberList-b2Rlocct.js → MemberList-D1x731cU.js} +14 -14
- package/dist/{MemberTransactions-Fj2nJ4Ur.js → MemberTransactions-BpoTQHFQ.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BZKudA25.js → MessageInput.vue_vue_type_script_setup_true_lang-DZu24zwy.js} +2 -2
- package/dist/{Mission-KLaXikD6.js → Mission-LpCnpKYD.js} +35 -34
- package/dist/{Overview-BUc3n5O3.js → Overview-DxvOqUao.js} +17 -17
- package/dist/{Point-hB9FCAw0.js → Point-BmI7y6h6.js} +51 -50
- package/dist/{Promotion-3yLTsHvx.js → Promotion-MHaOqrwu.js} +34 -33
- package/dist/{Record-BZlaZcFg.js → Record-75BxMATe.js} +6 -6
- package/dist/{Reward-CyO0pKoa.js → Reward-8VfyFuEt.js} +14 -14
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-UYD9G3y0.js → RewardGroup.vue_vue_type_script_setup_true_lang-D12_r-9X.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DUKyzpZK.js → RuleGroup.vue_vue_type_script_setup_true_lang-BIdBxvN7.js} +13 -13
- package/dist/{Segment-BXV6-vOS.js → Segment-I9FUibZy.js} +13 -13
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-3pUUUAKD.js → SelectItems.vue_vue_type_script_setup_true_lang-BGeR0-AG.js} +2 -2
- package/dist/{Setting-CFZdsnpN.js → Setting-B8V2I0EZ.js} +8 -8
- package/dist/{Store-7vr-PeY6.js → Store-CQkGNSSm.js} +424 -417
- package/dist/{StoreRewards-Cqth7AIJ.js → StoreRewards-DOtjveqw.js} +12 -12
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-D0L5FGVd.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Cf9IsQXS.js} +251 -245
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B79xzd2T.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DPmeW62s.js} +1 -1
- package/dist/{Tier-im_GyLWx.js → Tier-DAj_5abZ.js} +19 -19
- package/dist/{Title-BhudgeSH.js → Title-DryO4wcO.js} +19 -19
- package/dist/{Transaction-CnugRki7.js → Transaction-DpibVFU-.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-m-_fdbTx.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DoiPRPPo.js} +6 -6
- package/dist/{Voucher-WB5QSvGY.js → Voucher-CSc0_dGX.js} +56 -55
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DK0pDVj1.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DRnVggfC.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DWV8fnLD.js → ZodTextField.vue_vue_type_script_setup_true_lang-BzBcsSYS.js} +1 -1
- package/dist/{app-C3K2hDWf.js → app-BoQTcBOD.js} +1798 -794
- package/dist/{app-NqsHFVEk.js → app-BzPle2EI.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-CcRzjtxz.js → business-H9a63ymR.js} +1 -1
- package/dist/{campaign-B67A_7OK.js → campaign-CR-16mwD.js} +2 -2
- package/dist/{campaign.enum-ByK4gMba.js → campaign.enum-DcaetYuk.js} +1 -1
- package/dist/{campaign.fn-DzGsXCdF.js → campaign.fn-BqGZqM77.js} +142 -142
- package/dist/{collectible.enum-BqASpzzd.js → collectible.enum-YKtiwQbt.js} +1 -1
- package/dist/{collection.fn-D2WvxL88.js → collection.fn-CI8lSAsC.js} +2 -2
- package/dist/{dto-Dw255bzd.js → dto-BBLfD0Lh.js} +17 -16
- package/dist/{effect-BxPu1FzR.js → effect-36H79d0n.js} +1 -1
- package/dist/{email-addresses-DcK0Q2zA.js → email-addresses-drrACeqJ.js} +1 -1
- package/dist/{export-7jK-Ioe-.js → export-BgnO3lJs.js} +3 -3
- package/dist/{helper-lXhemocG.js → helper-CcV9DZXq.js} +1 -1
- package/dist/{index-CQL21tjK.js → index-6RqtavHk.js} +9 -7
- package/dist/{index-C8XNjc5V.js → index-B5ii6hOh.js} +1 -1
- package/dist/{index-1l0_N69H.js → index-BEDXujqZ.js} +1 -1
- package/dist/{index-D_uxupsH.js → index-BPbhXWRp.js} +7 -7
- package/dist/{index-D42yBguK.js → index-BRTpdfj3.js} +3 -3
- package/dist/{index-DG2-DF-P.js → index-CB1CnEOn.js} +1 -1
- package/dist/{index-BhchMLq2.js → index-CibFRBGu.js} +2 -2
- package/dist/{index-DtMb1Vde.js → index-Cidu1YZP.js} +3 -3
- package/dist/{index-D2P6nwsu.js → index-DLAAi9ur.js} +3039 -3036
- package/dist/{index-BC2jOmNm.js → index-DydNNBhY.js} +1 -1
- package/dist/{index-96KcJ-Wb.js → index-ZycLk3NR.js} +1 -1
- package/dist/{index-B9BSm7oO.js → index-mgoYj6L9.js} +1 -1
- package/dist/{index.esm2017-D1A8aO1S.js → index.esm2017-QS_XhcBp.js} +1 -1
- package/dist/{loading-D2WV28Cg.js → loading-LktVwV5k.js} +4 -4
- package/dist/{membership-YYMIuLdo.js → membership-7ETvXph3.js} +3 -3
- package/dist/{money-JypeKzEz.js → money-BYszknw8.js} +1 -1
- package/dist/{number-B2nrtMri.js → number-Dmd4vT4F.js} +1 -1
- package/dist/objectid-BQtSeCVi.js +145 -0
- package/dist/{reward-DkpMRLGx.js → reward-DJGOX-D1.js} +1 -1
- package/dist/{rule-Bpwn27Yr.js → rule-D7jM4gdg.js} +3 -3
- package/dist/{rule-builder-BQ6QcxJ2.js → rule-builder-FO9UeYUJ.js} +1 -1
- package/dist/{template-C-b_3Q0G.js → template-C4Ddrpk1.js} +4 -4
- package/dist/{trigger-DE5iEB5A.js → trigger-w7Q4qOMB.js} +4 -4
- package/dist/{usePagination-C_YZGKWk.js → usePagination-PH1OvyZM.js} +1 -1
- package/dist/{user-VhJqEOJm.js → user-DRPXRVy2.js} +1 -1
- package/dist/{vue-i18n-BfBJ65t0.js → vue-i18n-B49HKiTU.js} +169 -169
- package/package.json +6 -6
- package/dist/Collections-C7dc9NQd.js +0 -435
- package/dist/objectid-9TjXs_6J.js +0 -145
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { defineComponent as ee, computed as
|
|
1
|
+
import { defineComponent as ee, computed as j, resolveComponent as h, openBlock as g, createBlock as I, withCtx as T, createElementVNode as x, createElementBlock as D, createVNode as r, createCommentVNode as A, toDisplayString as L, unref as e, Fragment as X, renderList as re, ref as R, isRef as ne, reactive as qe, onMounted as fe, watch as we, toRaw as He, createTextVNode as de, h as Ke } from "vue";
|
|
2
2
|
import { _ as We } from "./tier-BJDhpH6X.js";
|
|
3
3
|
import { useDialog as Ae, useDialogChild as Me, components as ze } from "@feedmepos/ui-library";
|
|
4
|
-
import { c as B, e as Ce, S as Ye } from "./index-
|
|
5
|
-
import { d as se, a as Je, p as he, u as Ee, n as Ge, f as Fe } from "./loading-
|
|
6
|
-
import { u as $e, C as me } from "./membership-
|
|
4
|
+
import { c as B, e as Ce, S as Ye } from "./index-DLAAi9ur.js";
|
|
5
|
+
import { d as se, a as Je, p as he, u as Ee, n as Ge, f as Fe } from "./loading-LktVwV5k.js";
|
|
6
|
+
import { u as $e, C as me } from "./membership-7ETvXph3.js";
|
|
7
7
|
import { a as Xe, c as Ne } from "./object-qECH92oz.js";
|
|
8
8
|
import { _ as ue } from "./lodash-B5I3zXaY.js";
|
|
9
|
-
import { u as be } from "./vue-i18n-
|
|
10
|
-
import { Z, g as
|
|
11
|
-
import { z as Q, R as Ze } from "./app-
|
|
12
|
-
import { m as Qe, n as et, o as tt, p as Oe, q as
|
|
9
|
+
import { u as be } from "./vue-i18n-B49HKiTU.js";
|
|
10
|
+
import { Z, g as J, a as G } from "./zod-Bg2FbC-D.js";
|
|
11
|
+
import { z as Q, R as Ze } from "./app-BoQTcBOD.js";
|
|
12
|
+
import { m as Qe, n as et, o as tt, p as Oe, q as ot } from "./index-6RqtavHk.js";
|
|
13
13
|
import { u as xe } from "./app-wDQR6dpb.js";
|
|
14
|
-
import { _ as te } from "./ZodTextField.vue_vue_type_script_setup_true_lang-
|
|
14
|
+
import { _ as te } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BzBcsSYS.js";
|
|
15
15
|
import { J as ke } from "./JsonViewer-v8_C7l5N.js";
|
|
16
|
-
import { _ as
|
|
16
|
+
import { _ as nt } from "./index-CibFRBGu.js";
|
|
17
17
|
import { _ as lt } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
18
18
|
import { _ as at } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
19
|
-
import { z as st, a as rt } from "./money-
|
|
20
|
-
import { F as it } from "./number-
|
|
21
|
-
import { t as dt } from "./helper-
|
|
22
|
-
import "./index-
|
|
23
|
-
import "./index-
|
|
24
|
-
import "./index-
|
|
25
|
-
import "./index-
|
|
26
|
-
import "./index-
|
|
27
|
-
import { m as ut } from "./index-
|
|
28
|
-
import { m as _e } from "./index-
|
|
19
|
+
import { z as st, a as rt } from "./money-BYszknw8.js";
|
|
20
|
+
import { F as it } from "./number-Dmd4vT4F.js";
|
|
21
|
+
import { t as dt } from "./helper-CcV9DZXq.js";
|
|
22
|
+
import "./index-CB1CnEOn.js";
|
|
23
|
+
import "./index-BRTpdfj3.js";
|
|
24
|
+
import "./index-BPbhXWRp.js";
|
|
25
|
+
import "./index-mgoYj6L9.js";
|
|
26
|
+
import "./index-Cidu1YZP.js";
|
|
27
|
+
import { m as ut } from "./index-ZycLk3NR.js";
|
|
28
|
+
import { m as _e } from "./index-DydNNBhY.js";
|
|
29
29
|
import { useRouter as ct } from "vue-router";
|
|
30
30
|
function je(v) {
|
|
31
31
|
return se.DineroFactory(v).toUnit();
|
|
32
32
|
}
|
|
33
33
|
function mt(v, _, a, f, i = [], b = []) {
|
|
34
|
-
const
|
|
35
|
-
_.map((t) => v.find((
|
|
36
|
-
), m =
|
|
37
|
-
(t,
|
|
34
|
+
const n = nt.compact(
|
|
35
|
+
_.map((t) => v.find((c) => c.systemCode === t.systemCode && c.taxCode === t.taxCode)).filter((t) => !!t && b.includes(t.systemCode))
|
|
36
|
+
), m = n.reduce(
|
|
37
|
+
(t, c) => {
|
|
38
38
|
var y;
|
|
39
39
|
return Object.assign(t, {
|
|
40
|
-
[
|
|
41
|
-
inclusive: ((y = i.find((
|
|
40
|
+
[c.taxCode]: {
|
|
41
|
+
inclusive: ((y = i.find((d) => d.systemCode === c.systemCode)) == null ? void 0 : y.inclusive) || !1,
|
|
42
42
|
adjustment: {
|
|
43
43
|
level: 1,
|
|
44
44
|
type: {
|
|
45
45
|
type: "BY_MULTIPLIER",
|
|
46
46
|
amount: {
|
|
47
|
-
amount:
|
|
48
|
-
precision:
|
|
47
|
+
amount: c.rate.amount,
|
|
48
|
+
precision: c.rate.precision,
|
|
49
49
|
currency: "MYR"
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -54,7 +54,7 @@ function mt(v, _, a, f, i = [], b = []) {
|
|
|
54
54
|
});
|
|
55
55
|
},
|
|
56
56
|
{}
|
|
57
|
-
),
|
|
57
|
+
), u = se.Calculator.calculate({
|
|
58
58
|
items: {
|
|
59
59
|
0: {
|
|
60
60
|
quantity: 1,
|
|
@@ -73,21 +73,21 @@ function mt(v, _, a, f, i = [], b = []) {
|
|
|
73
73
|
adjustments: {},
|
|
74
74
|
roundToNearest: 0
|
|
75
75
|
});
|
|
76
|
-
return
|
|
76
|
+
return n.map((t) => ({
|
|
77
77
|
setting: t,
|
|
78
78
|
systemCode: t.systemCode,
|
|
79
79
|
name: t.name,
|
|
80
80
|
taxCode: t.taxCode,
|
|
81
81
|
rate: t.rate,
|
|
82
82
|
total: se.DineroFactory({
|
|
83
|
-
...
|
|
83
|
+
...u.items[0].taxes[t.taxCode]
|
|
84
84
|
}).convertPrecision(2).toObject()
|
|
85
85
|
}));
|
|
86
86
|
}
|
|
87
87
|
function pt(v, _, a) {
|
|
88
88
|
return v ? v.reduce((f, i) => {
|
|
89
89
|
var b;
|
|
90
|
-
return (b = a.find((
|
|
90
|
+
return (b = a.find((n) => n.systemCode === i.systemCode)) != null && b.inclusive || (f = se.DineroFactory(f.toObject()).add(i.total)), f;
|
|
91
91
|
}, se.DineroFactory(_)).toObject() : se.DineroFactory(_).toObject();
|
|
92
92
|
}
|
|
93
93
|
const yt = { class: "relative h-[120px] aspect-video flex items-center justify-center border rounded-md border-fm-color-neutral-gray-300" }, ft = ["src"], bt = {
|
|
@@ -100,22 +100,22 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
100
100
|
},
|
|
101
101
|
emits: ["edit", "delete", "send"],
|
|
102
102
|
setup(v, { emit: _ }) {
|
|
103
|
-
const a = v, f = _, i =
|
|
104
|
-
const
|
|
105
|
-
return a.bundle.price.amount > 0 &&
|
|
103
|
+
const a = v, f = _, i = j(() => {
|
|
104
|
+
const n = [];
|
|
105
|
+
return a.bundle.price.amount > 0 && n.push(
|
|
106
106
|
`${B.Config.getCountry().currency.symbol}${je(a.bundle.price)}`
|
|
107
|
-
), a.bundle.coinPrice &&
|
|
108
|
-
}), b =
|
|
109
|
-
var m,
|
|
110
|
-
const
|
|
111
|
-
if (a.bundle.titles.length > 0 &&
|
|
112
|
-
const t = a.bundle.credit.normal + (((
|
|
113
|
-
|
|
107
|
+
), a.bundle.coinPrice && n.push(`${a.bundle.coinPrice} point(s)`), n.join(" or ");
|
|
108
|
+
}), b = j(() => {
|
|
109
|
+
var m, u;
|
|
110
|
+
const n = [];
|
|
111
|
+
if (a.bundle.titles.length > 0 && n.push(`${a.bundle.titles.length} title(s)`), a.bundle.vouchers.length > 0 && n.push(`${a.bundle.vouchers.length} voucher(s)`), a.bundle.credit.normal || (m = a.bundle.credit.free) != null && m.amount) {
|
|
112
|
+
const t = a.bundle.credit.normal + (((u = a.bundle.credit.free) == null ? void 0 : u.amount) ?? 0);
|
|
113
|
+
n.push(`${t} credit(s)`);
|
|
114
114
|
}
|
|
115
|
-
return
|
|
115
|
+
return n;
|
|
116
116
|
});
|
|
117
|
-
return (
|
|
118
|
-
const
|
|
117
|
+
return (n, m) => {
|
|
118
|
+
const u = h("FmIcon"), t = h("FmChip"), c = h("FmButton"), y = h("FmMenuItem"), d = h("FmMenu"), S = h("FmCard");
|
|
119
119
|
return g(), I(S, {
|
|
120
120
|
variant: "outlined",
|
|
121
121
|
class: "flex flex-col gap-y-8 p-16 min-h-[240px] h-full text-center items-center"
|
|
@@ -126,7 +126,7 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
126
126
|
key: 1,
|
|
127
127
|
src: v.bundle.image,
|
|
128
128
|
class: "w-full h-full object-contain aspect-video"
|
|
129
|
-
}, null, 8, ft)) : (g(), I(
|
|
129
|
+
}, null, 8, ft)) : (g(), I(u, {
|
|
130
130
|
key: 0,
|
|
131
131
|
name: "image",
|
|
132
132
|
outline: !0,
|
|
@@ -141,9 +141,9 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
141
141
|
})
|
|
142
142
|
])) : A("", !0),
|
|
143
143
|
x("div", gt, [
|
|
144
|
-
r(
|
|
144
|
+
r(d, { placement: "bottom-end" }, {
|
|
145
145
|
"menu-button": T(() => [
|
|
146
|
-
r(
|
|
146
|
+
r(c, {
|
|
147
147
|
icon: "more_vert",
|
|
148
148
|
variant: "tertiary"
|
|
149
149
|
})
|
|
@@ -174,10 +174,10 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
174
174
|
})
|
|
175
175
|
])
|
|
176
176
|
]),
|
|
177
|
-
x("div", ht,
|
|
178
|
-
x("div", _t,
|
|
177
|
+
x("div", ht, L(v.bundle.name), 1),
|
|
178
|
+
x("div", _t, L(e(i) || "Free"), 1),
|
|
179
179
|
x("div", xt, [
|
|
180
|
-
(g(!0), D(
|
|
180
|
+
(g(!0), D(X, null, re(e(b), (l, F) => (g(), I(t, {
|
|
181
181
|
key: F,
|
|
182
182
|
label: l
|
|
183
183
|
}, null, 8, ["label"]))), 128))
|
|
@@ -193,14 +193,14 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
193
193
|
setup(v, { emit: _ }) {
|
|
194
194
|
const { t: a } = be(), f = _;
|
|
195
195
|
return (i, b) => {
|
|
196
|
-
const
|
|
196
|
+
const n = h("FmButton"), m = h("FmCard");
|
|
197
197
|
return g(), I(m, {
|
|
198
198
|
variant: "outlined",
|
|
199
199
|
class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
|
|
200
200
|
}, {
|
|
201
201
|
default: T(() => [
|
|
202
|
-
r(
|
|
203
|
-
onClick: b[0] || (b[0] = (
|
|
202
|
+
r(n, {
|
|
203
|
+
onClick: b[0] || (b[0] = (u) => f("create")),
|
|
204
204
|
label: e(a)("connect.store.actions.addBundle"),
|
|
205
205
|
icon: "add",
|
|
206
206
|
variant: "secondary"
|
|
@@ -223,19 +223,19 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
223
223
|
}
|
|
224
224
|
},
|
|
225
225
|
setup(v) {
|
|
226
|
-
const { t: _ } = be(), a = v, f = Ae(), { emitData: i, emitAction: b } = Me(),
|
|
227
|
-
function
|
|
228
|
-
i(
|
|
226
|
+
const { t: _ } = be(), a = v, f = Ae(), { emitData: i, emitAction: b } = Me(), n = R(a.initialValue), m = Q.string().min(1);
|
|
227
|
+
function u() {
|
|
228
|
+
i(n.value), b("primary"), f.close();
|
|
229
229
|
}
|
|
230
230
|
function t() {
|
|
231
231
|
i(null), b("primary"), f.close();
|
|
232
232
|
}
|
|
233
|
-
return (
|
|
234
|
-
const
|
|
233
|
+
return (c, y) => {
|
|
234
|
+
const d = h("FmTextField"), S = h("FmButton");
|
|
235
235
|
return g(), D("div", Vt, [
|
|
236
|
-
r(
|
|
237
|
-
modelValue: e(
|
|
238
|
-
"onUpdate:modelValue": y[0] || (y[0] = (l) =>
|
|
236
|
+
r(d, {
|
|
237
|
+
modelValue: e(n),
|
|
238
|
+
"onUpdate:modelValue": y[0] || (y[0] = (l) => ne(n) ? n.value = l : null),
|
|
239
239
|
label: e(_)("connect.store.category.label"),
|
|
240
240
|
rules: [e(Z).toRule(e(m))]
|
|
241
241
|
}, null, 8, ["modelValue", "label", "rules"]),
|
|
@@ -256,8 +256,8 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
256
256
|
}, null, 8, ["label"]),
|
|
257
257
|
r(S, {
|
|
258
258
|
label: v.action == "edit" ? e(_)("connect.common.edit") : e(_)("connect.common.add"),
|
|
259
|
-
disabled: !e(
|
|
260
|
-
onClick:
|
|
259
|
+
disabled: !e(n),
|
|
260
|
+
onClick: u
|
|
261
261
|
}, null, 8, ["label", "disabled"])
|
|
262
262
|
])
|
|
263
263
|
])
|
|
@@ -267,23 +267,23 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
267
267
|
}), kt = { class: "space-y-16" }, Pt = /* @__PURE__ */ x("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Select a category to create FeedMe CNY 2025 bundle ", -1), Tt = { class: "flex items-center justify-end gap-8 pb-16" }, Ut = /* @__PURE__ */ ee({
|
|
268
268
|
__name: "SelectCategoryDialog",
|
|
269
269
|
setup(v) {
|
|
270
|
-
const { emitData: _, emitAction: a } = Me(), f = $e(), i = R(), b =
|
|
271
|
-
() => f.sortedStoreCategories.map((
|
|
272
|
-
label:
|
|
270
|
+
const { emitData: _, emitAction: a } = Me(), f = $e(), i = R(), b = j(
|
|
271
|
+
() => f.sortedStoreCategories.map((n, m) => ({
|
|
272
|
+
label: n.name,
|
|
273
273
|
value: m
|
|
274
274
|
}))
|
|
275
275
|
);
|
|
276
|
-
return (
|
|
277
|
-
const
|
|
276
|
+
return (n, m) => {
|
|
277
|
+
const u = h("FmSelect"), t = h("FmButton");
|
|
278
278
|
return g(), D("div", kt, [
|
|
279
279
|
Pt,
|
|
280
|
-
r(
|
|
280
|
+
r(u, {
|
|
281
281
|
placeholder: "Select a category",
|
|
282
282
|
items: e(b),
|
|
283
283
|
modelValue: e(i),
|
|
284
284
|
"onUpdate:modelValue": [
|
|
285
|
-
m[0] || (m[0] = (
|
|
286
|
-
m[1] || (m[1] = (
|
|
285
|
+
m[0] || (m[0] = (c) => ne(i) ? i.value = c : null),
|
|
286
|
+
m[1] || (m[1] = (c) => e(_)(c))
|
|
287
287
|
],
|
|
288
288
|
label: "Category"
|
|
289
289
|
}, null, 8, ["items", "modelValue"]),
|
|
@@ -291,11 +291,11 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
291
291
|
r(t, {
|
|
292
292
|
variant: "tertiary",
|
|
293
293
|
label: "Cancel",
|
|
294
|
-
onClick: m[2] || (m[2] = (
|
|
294
|
+
onClick: m[2] || (m[2] = (c) => e(a)("tertiary"))
|
|
295
295
|
}),
|
|
296
296
|
r(t, {
|
|
297
297
|
label: "Select",
|
|
298
|
-
onClick: m[3] || (m[3] = (
|
|
298
|
+
onClick: m[3] || (m[3] = (c) => e(a)("primary")),
|
|
299
299
|
disabled: e(i) == null
|
|
300
300
|
}, null, 8, ["disabled"])
|
|
301
301
|
])
|
|
@@ -409,7 +409,7 @@ const Rt = {
|
|
|
409
409
|
generateCode(v) {
|
|
410
410
|
return `${v.systemCode}/${v.taxCode}`;
|
|
411
411
|
}
|
|
412
|
-
},
|
|
412
|
+
}, oe = ye, It = /* @__PURE__ */ ee({
|
|
413
413
|
__name: "TaxInclusiveSetting",
|
|
414
414
|
props: {
|
|
415
415
|
modelValue: {
|
|
@@ -420,45 +420,45 @@ const Rt = {
|
|
|
420
420
|
},
|
|
421
421
|
emits: ["update:model-value"],
|
|
422
422
|
setup(v, { emit: _ }) {
|
|
423
|
-
const a = v, f =
|
|
424
|
-
function
|
|
425
|
-
const
|
|
426
|
-
S >= 0 ?
|
|
427
|
-
systemCode:
|
|
423
|
+
const a = v, f = oe.taxSystem, i = _, b = R(a.modelValue);
|
|
424
|
+
function n(c, y) {
|
|
425
|
+
const d = ue.clone(a.modelValue), S = d.findIndex((l) => l.systemCode === c);
|
|
426
|
+
S >= 0 ? d[S].inclusive = y : d.push({
|
|
427
|
+
systemCode: c,
|
|
428
428
|
inclusive: y
|
|
429
|
-
}), b.value =
|
|
429
|
+
}), b.value = d, i("update:model-value", d);
|
|
430
430
|
}
|
|
431
431
|
function m() {
|
|
432
|
-
return f.map((
|
|
433
|
-
const y = a.modelValue ? a.modelValue.find((
|
|
432
|
+
return f.map((c) => {
|
|
433
|
+
const y = a.modelValue ? a.modelValue.find((d) => d.systemCode === c.code) : !1;
|
|
434
434
|
return {
|
|
435
|
-
label:
|
|
435
|
+
label: c.name,
|
|
436
436
|
config: {
|
|
437
437
|
value: y ? y.inclusive : !1
|
|
438
438
|
},
|
|
439
|
-
input: (
|
|
440
|
-
|
|
439
|
+
input: (d) => {
|
|
440
|
+
n(c.code, d);
|
|
441
441
|
}
|
|
442
442
|
};
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
|
-
const
|
|
446
|
-
function t(
|
|
447
|
-
return `${
|
|
445
|
+
const u = qe(m());
|
|
446
|
+
function t(c, y) {
|
|
447
|
+
return `${c} ${y ? "Inclusive" : "Exclusive"}`;
|
|
448
448
|
}
|
|
449
449
|
return fe(() => {
|
|
450
|
-
a.modelValue.length ||
|
|
450
|
+
a.modelValue.length || n(f[0].code, !1);
|
|
451
451
|
}), we(
|
|
452
452
|
() => a.modelValue,
|
|
453
|
-
(
|
|
454
|
-
|
|
453
|
+
(c, y) => {
|
|
454
|
+
c != y && !c.length && n(f[0].code, !1);
|
|
455
455
|
}
|
|
456
|
-
), (
|
|
457
|
-
const
|
|
458
|
-
return g(!0), D(
|
|
456
|
+
), (c, y) => {
|
|
457
|
+
const d = h("FmSwitch");
|
|
458
|
+
return g(!0), D(X, null, re(e(u), (S, l) => {
|
|
459
459
|
var F;
|
|
460
460
|
return g(), D("div", { key: l }, [
|
|
461
|
-
r(
|
|
461
|
+
r(d, {
|
|
462
462
|
"model-value": ((F = e(b)[l]) == null ? void 0 : F.inclusive) || !1,
|
|
463
463
|
"label-placement": "left",
|
|
464
464
|
"onUpdate:modelValue": (w) => S.input(w)
|
|
@@ -466,7 +466,7 @@ const Rt = {
|
|
|
466
466
|
label: T(() => {
|
|
467
467
|
var w;
|
|
468
468
|
return [
|
|
469
|
-
x("div", null,
|
|
469
|
+
x("div", null, L(t(S.label, ((w = e(b)[l]) == null ? void 0 : w.inclusive) || !1)), 1)
|
|
470
470
|
];
|
|
471
471
|
}),
|
|
472
472
|
_: 2
|
|
@@ -488,24 +488,24 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
488
488
|
emits: ["update:modelValue"],
|
|
489
489
|
setup(v, { emit: _ }) {
|
|
490
490
|
const a = v, f = _, i = R(!1);
|
|
491
|
-
we(i, (
|
|
492
|
-
m !=
|
|
491
|
+
we(i, (n, m) => {
|
|
492
|
+
m != n && (!a.modelValue && n ? f("update:modelValue", {
|
|
493
493
|
apiKey: "",
|
|
494
494
|
webhookSecret: ""
|
|
495
|
-
}) :
|
|
495
|
+
}) : n || f("update:modelValue", void 0));
|
|
496
496
|
});
|
|
497
|
-
const b =
|
|
498
|
-
const
|
|
499
|
-
return `https://marketing${
|
|
497
|
+
const b = j(() => {
|
|
498
|
+
const n = Dt.mode === "development", m = B.Config.getCountry().code.toLowerCase(), u = m != "my" ? `.${m}` : "";
|
|
499
|
+
return `https://marketing${n ? "-dev" : ""}${u}.feedmeapi.com/stripe/${Ye.getBusinessId()}/webhook`;
|
|
500
500
|
});
|
|
501
501
|
return fe(() => {
|
|
502
502
|
i.value = !!a.modelValue;
|
|
503
|
-
}), (
|
|
504
|
-
const
|
|
503
|
+
}), (n, m) => {
|
|
504
|
+
const u = h("FmSwitch"), t = h("FmTextField"), c = h("FmButton");
|
|
505
505
|
return g(), D("div", Bt, [
|
|
506
|
-
r(
|
|
506
|
+
r(u, {
|
|
507
507
|
modelValue: e(i),
|
|
508
|
-
"onUpdate:modelValue": m[0] || (m[0] = (y) =>
|
|
508
|
+
"onUpdate:modelValue": m[0] || (m[0] = (y) => ne(i) ? i.value = y : null),
|
|
509
509
|
value: "true",
|
|
510
510
|
label: "Enable Stripe"
|
|
511
511
|
}, null, 8, ["modelValue"]),
|
|
@@ -523,7 +523,7 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
523
523
|
"helper-text": "Copy this URL to your Stripe dashboard"
|
|
524
524
|
}, {
|
|
525
525
|
append: T(() => [
|
|
526
|
-
r(
|
|
526
|
+
r(c, {
|
|
527
527
|
icon: "content_copy",
|
|
528
528
|
variant: "tertiary",
|
|
529
529
|
onClick: m[2] || (m[2] = (y) => e(Je)(e(b)))
|
|
@@ -552,7 +552,7 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
552
552
|
__name: "StoreSettingSheet",
|
|
553
553
|
emits: ["update"],
|
|
554
554
|
setup(v, { expose: _, emit: a }) {
|
|
555
|
-
const { t: f } = be(), i = a, b = R(!1),
|
|
555
|
+
const { t: f } = be(), i = a, b = R(!1), n = R(), m = R(!1), u = Qe.extend({
|
|
556
556
|
company: et.extend({
|
|
557
557
|
name: Q.string().min(1, "Company name is required"),
|
|
558
558
|
regNo: Q.string().min(1, "Registration number is required"),
|
|
@@ -567,9 +567,9 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
567
567
|
phoneNo: Q.string().min(1, "Phone number is required"),
|
|
568
568
|
sstRegNo: Q.string().optional()
|
|
569
569
|
})
|
|
570
|
-
}), t =
|
|
571
|
-
function
|
|
572
|
-
const S =
|
|
570
|
+
}), t = j(() => u.safeParse(n.value).success);
|
|
571
|
+
function c() {
|
|
572
|
+
const S = u.safeParse(n.value);
|
|
573
573
|
S.success && i("update", S.data);
|
|
574
574
|
}
|
|
575
575
|
function y() {
|
|
@@ -591,31 +591,31 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
591
591
|
inclusiveTaxes: []
|
|
592
592
|
};
|
|
593
593
|
}
|
|
594
|
-
function
|
|
595
|
-
b.value = S, S && (
|
|
594
|
+
function d(S, l) {
|
|
595
|
+
b.value = S, S && (n.value = l != null && l.company ? l : y());
|
|
596
596
|
}
|
|
597
597
|
return _({
|
|
598
|
-
showSheet:
|
|
599
|
-
data:
|
|
598
|
+
showSheet: d,
|
|
599
|
+
data: n
|
|
600
600
|
}), (S, l) => {
|
|
601
|
-
const F = h("FmIcon"), w = h("FmMenuItem"), N = h("FmMenu"), W = h("FmSelect"), Y = h("FmButton"),
|
|
602
|
-
return g(), I(
|
|
601
|
+
const F = h("FmIcon"), w = h("FmMenuItem"), N = h("FmMenu"), W = h("FmSelect"), Y = h("FmButton"), q = h("FmSideSheet");
|
|
602
|
+
return g(), I(q, {
|
|
603
603
|
"max-width": 560,
|
|
604
604
|
modelValue: e(b),
|
|
605
|
-
"onUpdate:modelValue": l[15] || (l[15] = (z) =>
|
|
605
|
+
"onUpdate:modelValue": l[15] || (l[15] = (z) => ne(b) ? b.value = z : null),
|
|
606
606
|
header: e(f)("connect.store.setting.title")
|
|
607
607
|
}, {
|
|
608
608
|
"side-sheet-footer": T(() => [
|
|
609
609
|
x("div", Yt, [
|
|
610
610
|
r(Y, {
|
|
611
611
|
label: e(f)("connect.common.save"),
|
|
612
|
-
onClick:
|
|
612
|
+
onClick: c,
|
|
613
613
|
disabled: !e(t) || e(xe)().isLoading,
|
|
614
614
|
loading: e(xe)().isLoading
|
|
615
615
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
616
616
|
r(Y, {
|
|
617
617
|
label: e(f)("connect.common.cancel"),
|
|
618
|
-
onClick: l[14] || (l[14] = (z) =>
|
|
618
|
+
onClick: l[14] || (l[14] = (z) => d(!1)),
|
|
619
619
|
variant: "tertiary"
|
|
620
620
|
}, null, 8, ["label"])
|
|
621
621
|
])
|
|
@@ -623,81 +623,81 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
623
623
|
default: T(() => {
|
|
624
624
|
var z, le;
|
|
625
625
|
return [
|
|
626
|
-
r(ke, { json: e(
|
|
627
|
-
e(
|
|
628
|
-
x("div", Mt,
|
|
626
|
+
r(ke, { json: e(n) }, null, 8, ["json"]),
|
|
627
|
+
e(n) && e(n).company ? (g(), D("div", At, [
|
|
628
|
+
x("div", Mt, L(e(f)("connect.store.setting.company.legal_info")), 1),
|
|
629
629
|
r(te, {
|
|
630
|
-
modelValue: e(
|
|
631
|
-
"onUpdate:modelValue": l[0] || (l[0] = (s) => e(
|
|
630
|
+
modelValue: e(n).company.name,
|
|
631
|
+
"onUpdate:modelValue": l[0] || (l[0] = (s) => e(n).company.name = s),
|
|
632
632
|
label: e(f)("connect.store.setting.company.name"),
|
|
633
|
-
schema: e(Z).typeAtPath(e(
|
|
633
|
+
schema: e(Z).typeAtPath(e(u), "company.name")
|
|
634
634
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
635
635
|
r(te, {
|
|
636
|
-
modelValue: e(
|
|
637
|
-
"onUpdate:modelValue": l[1] || (l[1] = (s) => e(
|
|
636
|
+
modelValue: e(n).company.regNo,
|
|
637
|
+
"onUpdate:modelValue": l[1] || (l[1] = (s) => e(n).company.regNo = s),
|
|
638
638
|
label: e(f)("connect.store.setting.company.reg_no"),
|
|
639
|
-
schema: e(Z).typeAtPath(e(
|
|
639
|
+
schema: e(Z).typeAtPath(e(u), "company.regNo")
|
|
640
640
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
641
641
|
e(B.Config).getCountry().taxSystems.length ? (g(), I(te, {
|
|
642
642
|
key: 0,
|
|
643
|
-
modelValue: e(
|
|
643
|
+
modelValue: e(n).company.sstRegNo,
|
|
644
644
|
"onUpdate:modelValue": [
|
|
645
|
-
l[2] || (l[2] = (s) => e(
|
|
646
|
-
l[3] || (l[3] = (s) => s ? null : e(
|
|
645
|
+
l[2] || (l[2] = (s) => e(n).company.sstRegNo = s),
|
|
646
|
+
l[3] || (l[3] = (s) => s ? null : e(n).inclusiveTaxes = [])
|
|
647
647
|
],
|
|
648
648
|
label: e(f)("connect.store.setting.company.tax_reg_no"),
|
|
649
|
-
schema: e(Z).typeAtPath(e(
|
|
649
|
+
schema: e(Z).typeAtPath(e(u), "company.sstRegNo")
|
|
650
650
|
}, null, 8, ["modelValue", "label", "schema"])) : A("", !0),
|
|
651
|
-
(z = e(
|
|
652
|
-
x("div", jt,
|
|
651
|
+
(z = e(n).company) != null && z.sstRegNo && e(n).inclusiveTaxes ? (g(), D("div", Et, [
|
|
652
|
+
x("div", jt, L(e(f)("connect.store.setting.company.tax")), 1),
|
|
653
653
|
r(It, {
|
|
654
|
-
modelValue: e(
|
|
655
|
-
"onUpdate:modelValue": l[4] || (l[4] = (s) => e(
|
|
654
|
+
modelValue: e(n).inclusiveTaxes,
|
|
655
|
+
"onUpdate:modelValue": l[4] || (l[4] = (s) => e(n).inclusiveTaxes = s)
|
|
656
656
|
}, null, 8, ["modelValue"])
|
|
657
657
|
])) : A("", !0),
|
|
658
658
|
r(te, {
|
|
659
|
-
modelValue: e(
|
|
660
|
-
"onUpdate:modelValue": l[5] || (l[5] = (s) => e(
|
|
659
|
+
modelValue: e(n).company.phoneNo,
|
|
660
|
+
"onUpdate:modelValue": l[5] || (l[5] = (s) => e(n).company.phoneNo = s),
|
|
661
661
|
label: e(f)("connect.store.setting.company.phone"),
|
|
662
|
-
schema: e(Z).typeAtPath(e(
|
|
662
|
+
schema: e(Z).typeAtPath(e(u), "company.phoneNo")
|
|
663
663
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
664
|
-
x("div", Lt,
|
|
664
|
+
x("div", Lt, L(e(f)("connect.store.setting.company.address.title")), 1),
|
|
665
665
|
r(te, {
|
|
666
|
-
modelValue: e(
|
|
667
|
-
"onUpdate:modelValue": l[6] || (l[6] = (s) => e(
|
|
666
|
+
modelValue: e(n).company.address.line1,
|
|
667
|
+
"onUpdate:modelValue": l[6] || (l[6] = (s) => e(n).company.address.line1 = s),
|
|
668
668
|
label: e(f)("connect.store.setting.company.address.line1"),
|
|
669
|
-
schema: e(Z).typeAtPath(e(
|
|
669
|
+
schema: e(Z).typeAtPath(e(u), "company.address.line1")
|
|
670
670
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
671
671
|
r(te, {
|
|
672
|
-
modelValue: e(
|
|
673
|
-
"onUpdate:modelValue": l[7] || (l[7] = (s) => e(
|
|
672
|
+
modelValue: e(n).company.address.line2,
|
|
673
|
+
"onUpdate:modelValue": l[7] || (l[7] = (s) => e(n).company.address.line2 = s),
|
|
674
674
|
label: e(f)("connect.store.setting.company.address.line2"),
|
|
675
|
-
schema: e(Z).typeAtPath(e(
|
|
675
|
+
schema: e(Z).typeAtPath(e(u), "company.address.line2")
|
|
676
676
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
677
677
|
x("div", qt, [
|
|
678
678
|
r(te, {
|
|
679
|
-
modelValue: e(
|
|
680
|
-
"onUpdate:modelValue": l[8] || (l[8] = (s) => e(
|
|
679
|
+
modelValue: e(n).company.address.city,
|
|
680
|
+
"onUpdate:modelValue": l[8] || (l[8] = (s) => e(n).company.address.city = s),
|
|
681
681
|
label: e(f)("connect.store.setting.company.address.city"),
|
|
682
|
-
schema: e(Z).typeAtPath(e(
|
|
682
|
+
schema: e(Z).typeAtPath(e(u), "company.address.city")
|
|
683
683
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
684
684
|
r(te, {
|
|
685
|
-
modelValue: e(
|
|
686
|
-
"onUpdate:modelValue": l[9] || (l[9] = (s) => e(
|
|
685
|
+
modelValue: e(n).company.address.postcode,
|
|
686
|
+
"onUpdate:modelValue": l[9] || (l[9] = (s) => e(n).company.address.postcode = s),
|
|
687
687
|
label: e(f)("connect.store.setting.company.address.postcode"),
|
|
688
|
-
schema: e(Z).typeAtPath(e(
|
|
688
|
+
schema: e(Z).typeAtPath(e(u), "company.address.postcode")
|
|
689
689
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
690
690
|
x("div", Ht, [
|
|
691
|
-
x("div", Kt,
|
|
691
|
+
x("div", Kt, L(e(f)("connect.store.setting.company.address.state")), 1),
|
|
692
692
|
r(N, {
|
|
693
693
|
placement: "top-end",
|
|
694
694
|
"model-value": e(m)
|
|
695
695
|
}, {
|
|
696
696
|
"menu-button": T(() => [
|
|
697
697
|
r(te, {
|
|
698
|
-
modelValue: e(
|
|
699
|
-
"onUpdate:modelValue": l[10] || (l[10] = (s) => e(
|
|
700
|
-
schema: e(Z).typeAtPath(e(
|
|
698
|
+
modelValue: e(n).company.address.state,
|
|
699
|
+
"onUpdate:modelValue": l[10] || (l[10] = (s) => e(n).company.address.state = s),
|
|
700
|
+
schema: e(Z).typeAtPath(e(u), "company.address.state"),
|
|
701
701
|
onFocusChanged: l[11] || (l[11] = (s) => m.value = s)
|
|
702
702
|
}, {
|
|
703
703
|
append: T(() => [
|
|
@@ -709,17 +709,17 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
709
709
|
}, 8, ["modelValue", "schema"])
|
|
710
710
|
]),
|
|
711
711
|
default: T(() => [
|
|
712
|
-
(g(!0), D(
|
|
712
|
+
(g(!0), D(X, null, re(e(Rt)[e(B.Config).getCountry().code].stateItems.filter(
|
|
713
713
|
(s) => {
|
|
714
714
|
var $, U;
|
|
715
|
-
return s.label.toLowerCase().includes(((U = ($ = e(
|
|
715
|
+
return s.label.toLowerCase().includes(((U = ($ = e(n)) == null ? void 0 : $.company) == null ? void 0 : U.address.state.toLowerCase()) ?? "");
|
|
716
716
|
}
|
|
717
717
|
) || [], (s) => (g(), I(w, {
|
|
718
718
|
key: s.value,
|
|
719
|
-
"model-value": e(
|
|
719
|
+
"model-value": e(n).company.address.state === s.value,
|
|
720
720
|
label: s.label,
|
|
721
721
|
onClick: () => {
|
|
722
|
-
e(
|
|
722
|
+
e(n).company.address.state = s.value, m.value = !1;
|
|
723
723
|
}
|
|
724
724
|
}, null, 8, ["model-value", "label", "onClick"]))), 128))
|
|
725
725
|
]),
|
|
@@ -728,22 +728,22 @@ const Bt = { class: "space-y-8" }, Nt = {
|
|
|
728
728
|
]),
|
|
729
729
|
r(W, {
|
|
730
730
|
label: e(f)("connect.store.setting.company.address.country"),
|
|
731
|
-
modelValue: e(
|
|
732
|
-
"onUpdate:modelValue": l[12] || (l[12] = (s) => e(
|
|
731
|
+
modelValue: e(n).company.address.country,
|
|
732
|
+
"onUpdate:modelValue": l[12] || (l[12] = (s) => e(n).company.address.country = s),
|
|
733
733
|
items: [
|
|
734
734
|
{
|
|
735
735
|
label: e(B.Config).getCountry().name,
|
|
736
736
|
value: e(B.Config).getCountry().name
|
|
737
737
|
}
|
|
738
738
|
],
|
|
739
|
-
rules: [e(Z).ruleAtPath(e(
|
|
739
|
+
rules: [e(Z).ruleAtPath(e(u), "company.address.country")]
|
|
740
740
|
}, null, 8, ["label", "modelValue", "items", "rules"])
|
|
741
741
|
]),
|
|
742
742
|
x("div", Wt, [
|
|
743
|
-
x("div", zt,
|
|
743
|
+
x("div", zt, L(e(f)("connect.store.setting.stripe.title")), 1),
|
|
744
744
|
r(Ot, {
|
|
745
|
-
"model-value": (le = e(
|
|
746
|
-
"onUpdate:modelValue": l[13] || (l[13] = (s) => e(
|
|
745
|
+
"model-value": (le = e(n)) == null ? void 0 : le.stripe,
|
|
746
|
+
"onUpdate:modelValue": l[13] || (l[13] = (s) => e(n).stripe = s)
|
|
747
747
|
}, null, 8, ["model-value"])
|
|
748
748
|
])
|
|
749
749
|
])) : A("", !0)
|
|
@@ -770,65 +770,65 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
770
770
|
setup(v, { emit: _ }) {
|
|
771
771
|
const a = v, f = _;
|
|
772
772
|
fe(() => {
|
|
773
|
-
if (
|
|
774
|
-
const t = b.value.reduce((
|
|
775
|
-
const
|
|
776
|
-
if (!
|
|
777
|
-
const { systemCode: S, taxCode: l } =
|
|
778
|
-
return y.value ||
|
|
773
|
+
if (n.value.length !== b.value.length) {
|
|
774
|
+
const t = b.value.reduce((c, y) => {
|
|
775
|
+
const d = oe.systemDefaultCode(y.name);
|
|
776
|
+
if (!d) return c;
|
|
777
|
+
const { systemCode: S, taxCode: l } = d;
|
|
778
|
+
return y.value || c.push({ systemCode: S, taxCode: l }), c;
|
|
779
779
|
}, []);
|
|
780
|
-
|
|
780
|
+
u(t);
|
|
781
781
|
}
|
|
782
782
|
});
|
|
783
783
|
function i() {
|
|
784
|
-
return
|
|
784
|
+
return oe.groupedTaxOptions();
|
|
785
785
|
}
|
|
786
|
-
const b =
|
|
786
|
+
const b = j(() => i().map((t) => ({
|
|
787
787
|
name: t.code,
|
|
788
|
-
value: (
|
|
789
|
-
(
|
|
788
|
+
value: (n.value || []).find(
|
|
789
|
+
(c) => t.options.some((y) => y.feedmeTaxCode === c)
|
|
790
790
|
),
|
|
791
|
-
options: t.options.map((
|
|
792
|
-
label: `${
|
|
793
|
-
value:
|
|
791
|
+
options: t.options.map((c) => ({
|
|
792
|
+
label: `${c.name} (${it(c.rate)}%)`,
|
|
793
|
+
value: c.feedmeTaxCode
|
|
794
794
|
}))
|
|
795
|
-
}))),
|
|
795
|
+
}))), n = j(() => a.modelValue.map((t) => oe.generateCode(t)));
|
|
796
796
|
function m(t) {
|
|
797
|
-
const
|
|
797
|
+
const c = i().find(
|
|
798
798
|
(l) => l.options.some((F) => F.feedmeTaxCode === t)
|
|
799
|
-
), y =
|
|
799
|
+
), y = c == null ? void 0 : c.options.find((l) => l.feedmeTaxCode === t);
|
|
800
800
|
if (!y) return;
|
|
801
|
-
const { systemCode:
|
|
802
|
-
|
|
801
|
+
const { systemCode: d, taxCode: S } = y;
|
|
802
|
+
u([{ systemCode: d, taxCode: S }]);
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
const
|
|
804
|
+
function u(t) {
|
|
805
|
+
const c = ue.clone(a.modelValue);
|
|
806
806
|
t.forEach((y) => {
|
|
807
|
-
const
|
|
808
|
-
(F) => F.options.some((w) => w.feedmeTaxCode ===
|
|
809
|
-
), S = (
|
|
810
|
-
(F) => S.some((w) =>
|
|
807
|
+
const d = i().find(
|
|
808
|
+
(F) => F.options.some((w) => w.feedmeTaxCode === oe.generateCode(y))
|
|
809
|
+
), S = (d == null ? void 0 : d.options) || [], l = c.findIndex(
|
|
810
|
+
(F) => S.some((w) => oe.generateCode(w) === oe.generateCode(F))
|
|
811
811
|
);
|
|
812
|
-
l >= 0 ?
|
|
813
|
-
}), f("update:modelValue",
|
|
812
|
+
l >= 0 ? c.splice(l, 1, y) : c.push(y);
|
|
813
|
+
}), f("update:modelValue", c);
|
|
814
814
|
}
|
|
815
|
-
return (t,
|
|
816
|
-
const y = h("FmRadio"),
|
|
817
|
-
return g(!0), D(
|
|
815
|
+
return (t, c) => {
|
|
816
|
+
const y = h("FmRadio"), d = h("FmRadioGroup");
|
|
817
|
+
return g(!0), D(X, null, re(e(b), (S) => (g(), D("div", {
|
|
818
818
|
key: S.name,
|
|
819
819
|
class: "flex items-start"
|
|
820
820
|
}, [
|
|
821
|
-
r(
|
|
821
|
+
r(d, {
|
|
822
822
|
modelValue: S.value,
|
|
823
823
|
"onUpdate:modelValue": [
|
|
824
824
|
(l) => S.value = l,
|
|
825
|
-
|
|
825
|
+
c[0] || (c[0] = (l) => {
|
|
826
826
|
m(l);
|
|
827
827
|
})
|
|
828
828
|
]
|
|
829
829
|
}, {
|
|
830
830
|
default: T(() => [
|
|
831
|
-
(g(!0), D(
|
|
831
|
+
(g(!0), D(X, null, re(S.options, (l, F) => (g(), I(y, {
|
|
832
832
|
key: F,
|
|
833
833
|
value: l.value,
|
|
834
834
|
label: l.label
|
|
@@ -865,15 +865,15 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
865
865
|
}, Zt = {
|
|
866
866
|
key: 0,
|
|
867
867
|
class: "space-y-24 pr-12"
|
|
868
|
-
}, Qt = { class: "space-y-8" },
|
|
868
|
+
}, Qt = { class: "space-y-8" }, eo = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, to = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, oo = /* @__PURE__ */ x("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Credit", -1), no = /* @__PURE__ */ x("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Taxes", -1), lo = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, ao = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary !mb-[-16px]" }, so = { class: "space-y-8" }, ro = { class: "flex items-center justify-between" }, io = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, uo = { class: "space-y-8" }, co = { class: "flex items-center gap-8" }, mo = /* @__PURE__ */ ee({
|
|
869
869
|
__name: "EditBundleSheet",
|
|
870
870
|
emits: ["update"],
|
|
871
871
|
setup(v, { expose: _, emit: a }) {
|
|
872
|
-
const f = a, { t: i } = be(), b = $e(),
|
|
872
|
+
const f = a, { t: i } = be(), b = $e(), n = R(!1), m = R([]), u = R({
|
|
873
873
|
category: 0,
|
|
874
874
|
index: -1,
|
|
875
875
|
originalCategoryIndex: void 0
|
|
876
|
-
}), t = R(ue.cloneDeep(Se)),
|
|
876
|
+
}), t = R(ue.cloneDeep(Se)), c = R(), y = Oe, d = j(() => {
|
|
877
877
|
const p = y.safeParse(t.value);
|
|
878
878
|
return p.success ? [] : p.error.errors;
|
|
879
879
|
}), S = [
|
|
@@ -895,130 +895,134 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
895
895
|
accessorFn: (p) => p.description,
|
|
896
896
|
cell(p) {
|
|
897
897
|
var C;
|
|
898
|
-
const
|
|
899
|
-
return
|
|
900
|
-
"onUpdate:modelValue": (
|
|
898
|
+
const o = p.row.original;
|
|
899
|
+
return o.collectible.type == "VOUCHER" || o.selectedReward == null ? o.description : Ke(ze.FmStepperField, {
|
|
900
|
+
"onUpdate:modelValue": (k) => {
|
|
901
901
|
t.value.titles = t.value.titles.map(
|
|
902
|
-
(
|
|
902
|
+
(E) => E.id == o.collectible._id ? { ...E, dayToExpire: k } : E
|
|
903
903
|
);
|
|
904
904
|
},
|
|
905
|
-
modelValue: ((C =
|
|
905
|
+
modelValue: ((C = o.selectedReward) == null ? void 0 : C.extra) ?? 0,
|
|
906
906
|
appendText: "day(s)",
|
|
907
|
+
helperState: J(d.value, "titles"),
|
|
908
|
+
helperText: G(d.value, "titles"),
|
|
909
|
+
max: 9999,
|
|
910
|
+
rules: [(k) => k <= 9999 || "Maximum 9999 days allowed"],
|
|
907
911
|
showSteppers: !1,
|
|
908
912
|
disabled: !!t.value.stripePriceId
|
|
909
913
|
});
|
|
910
914
|
}
|
|
911
915
|
}
|
|
912
|
-
], l = R([]), F =
|
|
913
|
-
const
|
|
916
|
+
], l = R([]), F = j(() => b.bundleRewards.map((p) => {
|
|
917
|
+
const o = w.value.find((k) => k.id == p._id), C = p.type === "VOUCHER" ? `${p.options.maxUse} use(s), ${dt(p.options.validityOption || {})}` : "No expiry";
|
|
914
918
|
return {
|
|
915
919
|
collectible: p,
|
|
916
920
|
description: C,
|
|
917
|
-
selectedReward:
|
|
921
|
+
selectedReward: o
|
|
918
922
|
};
|
|
919
|
-
})), w =
|
|
920
|
-
var p,
|
|
923
|
+
})), w = j(() => {
|
|
924
|
+
var p, o;
|
|
921
925
|
return [
|
|
922
926
|
...((p = t.value) == null ? void 0 : p.titles.map((C) => ({
|
|
923
927
|
id: C.id,
|
|
924
928
|
extra: C.dayToExpire
|
|
925
929
|
}))) ?? [],
|
|
926
|
-
...((
|
|
930
|
+
...((o = t.value) == null ? void 0 : o.vouchers.map((C) => ({
|
|
927
931
|
id: C,
|
|
928
932
|
extra: void 0
|
|
929
933
|
}))) ?? []
|
|
930
934
|
];
|
|
931
|
-
}), N =
|
|
935
|
+
}), N = j(
|
|
932
936
|
() => t.value.stripePriceId && t.value.subscriptionValidity ? t.value.subscriptionValidity : 0
|
|
933
937
|
);
|
|
934
938
|
function W(p) {
|
|
935
939
|
t.value.subscriptionValidity = p;
|
|
936
|
-
for (const
|
|
937
|
-
|
|
940
|
+
for (const o of t.value.titles)
|
|
941
|
+
o.dayToExpire = p;
|
|
938
942
|
t.value.credit.free && (t.value.credit.free.day = p);
|
|
939
943
|
}
|
|
940
944
|
function Y() {
|
|
941
|
-
const p = F.value,
|
|
942
|
-
if (!(!
|
|
945
|
+
const p = F.value, o = t.value;
|
|
946
|
+
if (!(!o || !p))
|
|
943
947
|
for (let C = 0; C < p.length; C++) {
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
(H) => H.id ==
|
|
947
|
-
) < 0 &&
|
|
948
|
-
id:
|
|
948
|
+
const k = p[C];
|
|
949
|
+
q.value[C] ? k.collectible.type == "TITLE" ? o.titles.findIndex(
|
|
950
|
+
(H) => H.id == k.collectible._id
|
|
951
|
+
) < 0 && o.titles.push({
|
|
952
|
+
id: k.collectible._id,
|
|
949
953
|
dayToExpire: N.value
|
|
950
|
-
}) :
|
|
951
|
-
(H) => H ==
|
|
952
|
-
) < 0 &&
|
|
953
|
-
(K) => K !=
|
|
954
|
+
}) : o.vouchers.findIndex(
|
|
955
|
+
(H) => H == k.collectible._id
|
|
956
|
+
) < 0 && o.vouchers.push(k.collectible._id) : (o.titles = o.titles.filter((K) => K.id != k.collectible._id), o.vouchers = o.vouchers.filter(
|
|
957
|
+
(K) => K != k.collectible._id
|
|
954
958
|
));
|
|
955
959
|
}
|
|
956
960
|
}
|
|
957
|
-
const
|
|
958
|
-
we(
|
|
959
|
-
const z =
|
|
960
|
-
var p,
|
|
961
|
-
return (
|
|
962
|
-
}), le =
|
|
963
|
-
var p,
|
|
964
|
-
return (C = (
|
|
965
|
-
}), s =
|
|
966
|
-
var p,
|
|
961
|
+
const q = R({});
|
|
962
|
+
we(q, Y, { deep: !0 });
|
|
963
|
+
const z = j(() => {
|
|
964
|
+
var p, o;
|
|
965
|
+
return (o = (p = b.storeOption) == null ? void 0 : p.company) == null ? void 0 : o.sstRegNo;
|
|
966
|
+
}), le = j(() => {
|
|
967
|
+
var p, o, C;
|
|
968
|
+
return (C = (o = (p = b.storeOption) == null ? void 0 : p.inclusiveTaxes) == null ? void 0 : o[0]) != null && C.inclusive ? "Inclusive" : "Exclusive";
|
|
969
|
+
}), s = j(() => {
|
|
970
|
+
var p, o, C;
|
|
967
971
|
return mt(
|
|
968
|
-
|
|
972
|
+
oe.fullTax,
|
|
969
973
|
He(t.value.taxes),
|
|
970
974
|
t.value.price,
|
|
971
975
|
Number(t.value.credit.normal),
|
|
972
976
|
((p = b.storeOption) == null ? void 0 : p.inclusiveTaxes) ?? [],
|
|
973
|
-
(C = (
|
|
977
|
+
(C = (o = b.storeOption) == null ? void 0 : o.company) != null && C.sstRegNo ? oe.taxSystem.map((k) => k.code) : []
|
|
974
978
|
);
|
|
975
|
-
}), $ =
|
|
976
|
-
(
|
|
979
|
+
}), $ = j(() => s.value.reduce(
|
|
980
|
+
(o, C) => o.add(C.total),
|
|
977
981
|
rt()
|
|
978
|
-
).toFormat()), U =
|
|
979
|
-
var
|
|
982
|
+
).toFormat()), U = j(() => {
|
|
983
|
+
var k;
|
|
980
984
|
const p = pt(
|
|
981
985
|
s.value,
|
|
982
986
|
t.value.price,
|
|
983
|
-
((
|
|
987
|
+
((k = b.storeOption) == null ? void 0 : k.inclusiveTaxes) ?? []
|
|
984
988
|
);
|
|
985
989
|
t.value.priceWithTaxes = p;
|
|
986
|
-
const
|
|
990
|
+
const o = Gt(p, !1), C = Number(o.replace(/[^\d.-]/g, ""));
|
|
987
991
|
return Number.isNaN(C) ? 0 : C;
|
|
988
992
|
});
|
|
989
993
|
function M() {
|
|
990
994
|
t.value.taxTotals = s.value, f("update", Oe.parse(Xe(t.value)));
|
|
991
995
|
}
|
|
992
|
-
function
|
|
996
|
+
function P() {
|
|
993
997
|
return ue.cloneDeep(Se);
|
|
994
998
|
}
|
|
995
|
-
function O(p,
|
|
996
|
-
|
|
999
|
+
function O(p, o) {
|
|
1000
|
+
n.value = p, p && o && (c.value = void 0, m.value = o.categories, t.value = o.bundle || P(), u.value.category = o.category, u.value.index = o.index, u.value.originalCategoryIndex = o.category, q.value = F.value.reduce((C, k, E) => (C[E] = !!k.selectedReward, C), {}));
|
|
997
1001
|
}
|
|
998
1002
|
return _({
|
|
999
1003
|
showSheet: O,
|
|
1000
|
-
bundleImage:
|
|
1001
|
-
target:
|
|
1004
|
+
bundleImage: c,
|
|
1005
|
+
target: u,
|
|
1002
1006
|
data: t
|
|
1003
|
-
}), (p,
|
|
1004
|
-
const C = h("FmSwitch"),
|
|
1007
|
+
}), (p, o) => {
|
|
1008
|
+
const C = h("FmSwitch"), k = h("FmHelperText"), E = h("FmTextField"), K = h("FmSelect"), H = h("FmStepperField"), ie = h("FmMenuItem"), ge = h("FmTable"), ce = h("FmButton"), ve = h("FmSideSheet");
|
|
1005
1009
|
return g(), I(ve, {
|
|
1006
|
-
"max-width":
|
|
1007
|
-
modelValue: e(
|
|
1008
|
-
"onUpdate:modelValue":
|
|
1009
|
-
header: e(
|
|
1010
|
+
"max-width": 768,
|
|
1011
|
+
modelValue: e(n),
|
|
1012
|
+
"onUpdate:modelValue": o[20] || (o[20] = (ae) => ne(n) ? n.value = ae : null),
|
|
1013
|
+
header: e(u).index != -1 ? e(i)("connect.store.bundle.edit.title") : e(i)("connect.store.bundle.edit.create")
|
|
1010
1014
|
}, {
|
|
1011
1015
|
"side-sheet-footer": T(() => [
|
|
1012
|
-
x("div",
|
|
1016
|
+
x("div", co, [
|
|
1013
1017
|
r(ce, {
|
|
1014
|
-
label: e(
|
|
1018
|
+
label: e(u).index != -1 ? "Save" : "Add",
|
|
1015
1019
|
onClick: M,
|
|
1016
|
-
disabled: e(
|
|
1020
|
+
disabled: e(d).length > 0,
|
|
1017
1021
|
loading: e(xe)().isLoading
|
|
1018
1022
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
1019
1023
|
r(ce, {
|
|
1020
1024
|
label: "Cancel",
|
|
1021
|
-
onClick:
|
|
1025
|
+
onClick: o[19] || (o[19] = (ae) => O(!1)),
|
|
1022
1026
|
variant: "tertiary"
|
|
1023
1027
|
})
|
|
1024
1028
|
])
|
|
@@ -1031,31 +1035,31 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1031
1035
|
x("div", Qt, [
|
|
1032
1036
|
e(B.Config).getCountry().code == "MY" && ((ae = e(b).payoutAccount) == null ? void 0 : ae.status) == "APPROVED" && ((Pe = e(b).payoutAccount) != null && Pe.enable) ? (g(), I(C, {
|
|
1033
1037
|
key: 0,
|
|
1034
|
-
"onUpdate:modelValue":
|
|
1035
|
-
e(t).isFeedvibe = V, e(t).isFeedvibe && (e(t).credit.normal = 0, e(t).coinPrice = 0, e(t).titles = [],
|
|
1038
|
+
"onUpdate:modelValue": o[0] || (o[0] = (V) => {
|
|
1039
|
+
e(t).isFeedvibe = V, e(t).isFeedvibe && (e(t).credit.normal = 0, e(t).coinPrice = 0, e(t).titles = [], q.value = {});
|
|
1036
1040
|
}),
|
|
1037
1041
|
"label-placement": "right",
|
|
1038
1042
|
"model-value": e(t).isFeedvibe || !1,
|
|
1039
1043
|
label: "Feedvibe Campaign",
|
|
1040
1044
|
sublabel: "Bundle will be appear for Feedvibe campaign use"
|
|
1041
1045
|
}, null, 8, ["model-value"])) : A("", !0),
|
|
1042
|
-
e(t).isFeedvibe ? (g(), I(
|
|
1046
|
+
e(t).isFeedvibe ? (g(), I(k, {
|
|
1043
1047
|
key: 1,
|
|
1044
1048
|
text: "There will be a 15% charge for FeedVibe bundles sold in the FeedVibe app",
|
|
1045
1049
|
state: "warning"
|
|
1046
1050
|
})) : A("", !0)
|
|
1047
1051
|
]),
|
|
1048
|
-
x("div",
|
|
1049
|
-
r(
|
|
1052
|
+
x("div", eo, L(e(i)("connect.store.bundle.edit.basicInformation")), 1),
|
|
1053
|
+
r(E, {
|
|
1050
1054
|
label: e(i)("connect.store.bundle.edit.bundleName"),
|
|
1051
1055
|
modelValue: e(t).name,
|
|
1052
|
-
"onUpdate:modelValue":
|
|
1053
|
-
"helper-state": e(
|
|
1054
|
-
"helper-text": e(
|
|
1056
|
+
"onUpdate:modelValue": o[1] || (o[1] = (V) => e(t).name = V),
|
|
1057
|
+
"helper-state": e(J)(e(d), "name"),
|
|
1058
|
+
"helper-text": e(G)(e(d), "name")
|
|
1055
1059
|
}, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
|
|
1056
1060
|
r(K, {
|
|
1057
|
-
modelValue: e(
|
|
1058
|
-
"onUpdate:modelValue":
|
|
1061
|
+
modelValue: e(u).category,
|
|
1062
|
+
"onUpdate:modelValue": o[2] || (o[2] = (V) => e(u).category = V),
|
|
1059
1063
|
label: "Store Category",
|
|
1060
1064
|
items: e(m).map((V, Le) => ({ label: V, value: Le }))
|
|
1061
1065
|
}, null, 8, ["modelValue", "items"]),
|
|
@@ -1064,28 +1068,28 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1064
1068
|
class: "w-1/2 xs:w-2/3",
|
|
1065
1069
|
"aspect-ratio": "16/9",
|
|
1066
1070
|
thumbnail: e(t).image ?? void 0,
|
|
1067
|
-
file: e(
|
|
1068
|
-
"onUpdate:file":
|
|
1069
|
-
|
|
1071
|
+
file: e(c) ?? void 0,
|
|
1072
|
+
"onUpdate:file": o[3] || (o[3] = (V) => {
|
|
1073
|
+
c.value = V;
|
|
1070
1074
|
}),
|
|
1071
|
-
"helper-state": e(
|
|
1072
|
-
"helper-text": e(
|
|
1075
|
+
"helper-state": e(J)(e(d), "image"),
|
|
1076
|
+
"helper-text": e(G)(e(d), "image")
|
|
1073
1077
|
}, null, 8, ["label", "thumbnail", "file", "helper-state", "helper-text"]),
|
|
1074
1078
|
r(H, {
|
|
1075
1079
|
"model-value": e(B.Dinero).fromFdoDinero(e(t).price).toUnit(),
|
|
1076
1080
|
label: e(i)("connect.store.bundle.edit.bundlePrice"),
|
|
1077
1081
|
min: 0,
|
|
1078
1082
|
"max-fraction-digits": 2,
|
|
1079
|
-
"onUpdate:modelValue":
|
|
1083
|
+
"onUpdate:modelValue": o[4] || (o[4] = (V) => {
|
|
1080
1084
|
e(t).price.amount = V * 10 ** e(t).price.precision;
|
|
1081
1085
|
}),
|
|
1082
1086
|
"is-currency": !0,
|
|
1083
1087
|
"show-steppers": !1,
|
|
1084
|
-
"helper-text": e(
|
|
1085
|
-
"helper-state": e(
|
|
1088
|
+
"helper-text": e(G)(e(d), "price") || `${e(B.Dinero).fromNumber({ number: 1 }).toFormat(!0)} = ${e(B.Dinero).fromNumber({ number: 1 }).toUnit()} credit`,
|
|
1089
|
+
"helper-state": e(J)(e(d), "price")
|
|
1086
1090
|
}, {
|
|
1087
1091
|
prepend: T(() => [
|
|
1088
|
-
de(
|
|
1092
|
+
de(L(e(B.Dinero).defaultCurrency()), 1)
|
|
1089
1093
|
]),
|
|
1090
1094
|
_: 1
|
|
1091
1095
|
}, 8, ["model-value", "label", "helper-text", "helper-state"]),
|
|
@@ -1094,16 +1098,16 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1094
1098
|
label: e(i)("connect.store.bundle.edit.bundleValue"),
|
|
1095
1099
|
min: 0,
|
|
1096
1100
|
"max-fraction-digits": 2,
|
|
1097
|
-
"onUpdate:modelValue":
|
|
1101
|
+
"onUpdate:modelValue": o[5] || (o[5] = (V) => {
|
|
1098
1102
|
e(t).originalPrice || (e(t).originalPrice = e(B.Dinero).zero().toObject()), e(t).originalPrice.amount = V * 10 ** e(t).originalPrice.precision;
|
|
1099
1103
|
}),
|
|
1100
1104
|
"is-currency": !0,
|
|
1101
1105
|
"show-steppers": !1,
|
|
1102
|
-
"helper-text": e(
|
|
1103
|
-
"helper-state": e(
|
|
1106
|
+
"helper-text": e(G)(e(d), "originalPrice") || e(i)("connect.store.bundle.edit.originalPriceHelper"),
|
|
1107
|
+
"helper-state": e(J)(e(d), "originalPrice")
|
|
1104
1108
|
}, {
|
|
1105
1109
|
prepend: T(() => [
|
|
1106
|
-
de(
|
|
1110
|
+
de(L(e(B.Dinero).defaultCurrency()), 1)
|
|
1107
1111
|
]),
|
|
1108
1112
|
_: 1
|
|
1109
1113
|
}, 8, ["model-value", "label", "helper-text", "helper-state"]),
|
|
@@ -1112,26 +1116,26 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1112
1116
|
"model-value": e(t).coinPrice ?? null,
|
|
1113
1117
|
label: e(i)("connect.store.bundle.edit.pointNeeded"),
|
|
1114
1118
|
min: 0,
|
|
1115
|
-
"onUpdate:modelValue":
|
|
1119
|
+
"onUpdate:modelValue": o[6] || (o[6] = (V) => {
|
|
1116
1120
|
V > 0 && e(t).credit.normal > 0 && (e(t).credit.normal = 0), e(t).coinPrice = V;
|
|
1117
1121
|
}),
|
|
1118
1122
|
"show-steppers": !1,
|
|
1119
|
-
"helper-state": e(
|
|
1120
|
-
"helper-text": e(
|
|
1123
|
+
"helper-state": e(J)(e(d), "coinPrice"),
|
|
1124
|
+
"helper-text": e(G)(e(d), "coinPrice")
|
|
1121
1125
|
}, {
|
|
1122
1126
|
append: T(() => [
|
|
1123
1127
|
de(" point(s) ")
|
|
1124
1128
|
]),
|
|
1125
1129
|
_: 1
|
|
1126
1130
|
}, 8, ["model-value", "label", "helper-state", "helper-text"])),
|
|
1127
|
-
(Te = e(b).storeOption) != null && Te.stripe && !e(t).isFeedvibe ? (g(), D(
|
|
1128
|
-
x("div",
|
|
1129
|
-
r(
|
|
1131
|
+
(Te = e(b).storeOption) != null && Te.stripe && !e(t).isFeedvibe ? (g(), D(X, { key: 1 }, [
|
|
1132
|
+
x("div", to, L(e(i)("connect.store.bundle.edit.subscriptionSettings")), 1),
|
|
1133
|
+
r(E, {
|
|
1130
1134
|
label: e(i)("connect.store.bundle.edit.stripePriceId"),
|
|
1131
1135
|
modelValue: e(t).stripePriceId,
|
|
1132
|
-
"onUpdate:modelValue":
|
|
1133
|
-
"helper-state": e(
|
|
1134
|
-
"helper-text": e(
|
|
1136
|
+
"onUpdate:modelValue": o[7] || (o[7] = (V) => e(t).stripePriceId = V),
|
|
1137
|
+
"helper-state": e(J)(e(d), "stripePriceId"),
|
|
1138
|
+
"helper-text": e(G)(e(d), "stripePriceId")
|
|
1135
1139
|
}, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
|
|
1136
1140
|
e(t).stripePriceId ? (g(), I(H, {
|
|
1137
1141
|
key: 0,
|
|
@@ -1140,19 +1144,19 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1140
1144
|
"onUpdate:modelValue": W,
|
|
1141
1145
|
label: e(i)("connect.store.bundle.edit.subscriptionValidity"),
|
|
1142
1146
|
"show-steppers": !1,
|
|
1143
|
-
"helper-state": e(
|
|
1144
|
-
"helper-text": e(
|
|
1147
|
+
"helper-state": e(J)(e(d), "subscriptionValidity"),
|
|
1148
|
+
"helper-text": e(G)(e(d), "subscriptionValidity")
|
|
1145
1149
|
}, null, 8, ["model-value", "label", "helper-state", "helper-text"])) : A("", !0)
|
|
1146
1150
|
], 64)) : A("", !0),
|
|
1147
|
-
e(t).isFeedvibe ? A("", !0) : (g(), D(
|
|
1148
|
-
|
|
1151
|
+
e(t).isFeedvibe ? A("", !0) : (g(), D(X, { key: 2 }, [
|
|
1152
|
+
oo,
|
|
1149
1153
|
r(H, {
|
|
1150
1154
|
modelValue: e(t).credit.normal,
|
|
1151
|
-
"onUpdate:modelValue":
|
|
1155
|
+
"onUpdate:modelValue": o[8] || (o[8] = (V) => e(t).credit.normal = V),
|
|
1152
1156
|
label: "Normal credit",
|
|
1153
1157
|
"show-steppers": !1,
|
|
1154
|
-
"helper-state": e(
|
|
1155
|
-
"helper-text": e(
|
|
1158
|
+
"helper-state": e(J)(e(d), "credit.normal"),
|
|
1159
|
+
"helper-text": e(G)(e(d), "credit.normal")
|
|
1156
1160
|
}, {
|
|
1157
1161
|
append: T(() => [
|
|
1158
1162
|
de(" credit ")
|
|
@@ -1162,7 +1166,7 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1162
1166
|
r(H, {
|
|
1163
1167
|
"model-value": ((Ue = e(t).credit.free) == null ? void 0 : Ue.amount) ?? null,
|
|
1164
1168
|
min: 0,
|
|
1165
|
-
"onUpdate:modelValue":
|
|
1169
|
+
"onUpdate:modelValue": o[9] || (o[9] = (V) => {
|
|
1166
1170
|
e(t).credit.free || (e(t).credit.free = {
|
|
1167
1171
|
amount: 0,
|
|
1168
1172
|
day: 1
|
|
@@ -1170,8 +1174,8 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1170
1174
|
}),
|
|
1171
1175
|
label: "Free credit",
|
|
1172
1176
|
"show-steppers": !1,
|
|
1173
|
-
"helper-state": e(
|
|
1174
|
-
"helper-text": e(
|
|
1177
|
+
"helper-state": e(J)(e(d), "credit.free.amount"),
|
|
1178
|
+
"helper-text": e(G)(e(d), "credit.free.amount")
|
|
1175
1179
|
}, {
|
|
1176
1180
|
append: T(() => [
|
|
1177
1181
|
de(" credit ")
|
|
@@ -1183,7 +1187,7 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1183
1187
|
disabled: !!e(t).stripePriceId,
|
|
1184
1188
|
"model-value": ((Ie = e(t).credit.free) == null ? void 0 : Ie.day) ?? null,
|
|
1185
1189
|
min: 0,
|
|
1186
|
-
"onUpdate:modelValue":
|
|
1190
|
+
"onUpdate:modelValue": o[10] || (o[10] = (V) => {
|
|
1187
1191
|
e(t).credit.free || (e(t).credit.free = {
|
|
1188
1192
|
amount: 0,
|
|
1189
1193
|
day: 1
|
|
@@ -1191,8 +1195,8 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1191
1195
|
}),
|
|
1192
1196
|
label: "Free credit valid for",
|
|
1193
1197
|
"show-steppers": !1,
|
|
1194
|
-
"helper-state": e(
|
|
1195
|
-
"helper-text": e(
|
|
1198
|
+
"helper-state": e(J)(e(d), "credit.free.day"),
|
|
1199
|
+
"helper-text": e(G)(e(d), "credit.free.day")
|
|
1196
1200
|
}, {
|
|
1197
1201
|
append: T(() => [
|
|
1198
1202
|
de(" day(s) ")
|
|
@@ -1200,13 +1204,13 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1200
1204
|
_: 1
|
|
1201
1205
|
}, 8, ["disabled", "model-value", "helper-state", "helper-text"])) : A("", !0)
|
|
1202
1206
|
], 64)),
|
|
1203
|
-
e(z) ? (g(), D(
|
|
1204
|
-
|
|
1207
|
+
e(z) ? (g(), D(X, { key: 3 }, [
|
|
1208
|
+
no,
|
|
1205
1209
|
r(Xt, {
|
|
1206
1210
|
modelValue: e(t).taxes,
|
|
1207
|
-
"onUpdate:modelValue":
|
|
1211
|
+
"onUpdate:modelValue": o[11] || (o[11] = (V) => e(t).taxes = V)
|
|
1208
1212
|
}, null, 8, ["modelValue"]),
|
|
1209
|
-
r(
|
|
1213
|
+
r(E, {
|
|
1210
1214
|
label: `Tax Charged (${e(le)})`,
|
|
1211
1215
|
"model-value": e($),
|
|
1212
1216
|
disabled: ""
|
|
@@ -1217,20 +1221,20 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1217
1221
|
"model-value": e(U),
|
|
1218
1222
|
disabled: !0
|
|
1219
1223
|
}, null, 8, ["model-value"]),
|
|
1220
|
-
x("div",
|
|
1221
|
-
x("div",
|
|
1222
|
-
x("div",
|
|
1223
|
-
x("div",
|
|
1224
|
+
x("div", lo, L(e(i)("connect.store.bundle.edit.bundleReward.title")), 1),
|
|
1225
|
+
x("div", ao, L(e(i)("connect.store.bundle.edit.bundleReward.description")), 1),
|
|
1226
|
+
x("div", so, [
|
|
1227
|
+
x("div", ro, [
|
|
1224
1228
|
r(at, {
|
|
1225
1229
|
label: `Reward type: ${e(l).length == 0 ? "All" : e(l)[0].name}`
|
|
1226
1230
|
}, {
|
|
1227
1231
|
default: T(() => [
|
|
1228
1232
|
r(ie, {
|
|
1229
|
-
onClick:
|
|
1233
|
+
onClick: o[12] || (o[12] = (V) => l.value = []),
|
|
1230
1234
|
label: "All"
|
|
1231
1235
|
}),
|
|
1232
1236
|
r(ie, {
|
|
1233
|
-
onClick:
|
|
1237
|
+
onClick: o[13] || (o[13] = (V) => l.value = [
|
|
1234
1238
|
{
|
|
1235
1239
|
id: "type",
|
|
1236
1240
|
value: "VOUCHER",
|
|
@@ -1240,7 +1244,7 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1240
1244
|
label: e(me).VOUCHER.name
|
|
1241
1245
|
}, null, 8, ["label"]),
|
|
1242
1246
|
r(ie, {
|
|
1243
|
-
onClick:
|
|
1247
|
+
onClick: o[14] || (o[14] = (V) => l.value = [
|
|
1244
1248
|
{
|
|
1245
1249
|
id: "type",
|
|
1246
1250
|
value: "TITLE",
|
|
@@ -1254,8 +1258,8 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1254
1258
|
}, 8, ["label"])
|
|
1255
1259
|
]),
|
|
1256
1260
|
r(ge, {
|
|
1257
|
-
modelValue: e(
|
|
1258
|
-
"onUpdate:modelValue":
|
|
1261
|
+
modelValue: e(q),
|
|
1262
|
+
"onUpdate:modelValue": o[15] || (o[15] = (V) => ne(q) ? q.value = V : null),
|
|
1259
1263
|
selection: "multiple",
|
|
1260
1264
|
"column-filter": e(l),
|
|
1261
1265
|
"column-defs": S,
|
|
@@ -1264,30 +1268,30 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1264
1268
|
),
|
|
1265
1269
|
"hide-footer": e(F).length <= 10
|
|
1266
1270
|
}, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"]),
|
|
1267
|
-
r(
|
|
1268
|
-
text: e(
|
|
1269
|
-
state: e(
|
|
1271
|
+
r(k, {
|
|
1272
|
+
text: e(G)(e(d), "titles"),
|
|
1273
|
+
state: e(J)(e(d), "titles")
|
|
1270
1274
|
}, null, 8, ["text", "state"])
|
|
1271
1275
|
]),
|
|
1272
|
-
x("div",
|
|
1273
|
-
x("div",
|
|
1276
|
+
x("div", io, L(e(i)("connect.store.bundle.edit.advanceSetting")), 1),
|
|
1277
|
+
x("div", uo, [
|
|
1274
1278
|
r(C, {
|
|
1275
1279
|
"model-value": e(t).internal ?? !1,
|
|
1276
|
-
"onUpdate:modelValue":
|
|
1280
|
+
"onUpdate:modelValue": o[16] || (o[16] = (V) => e(t).internal = V),
|
|
1277
1281
|
"label-placement": "right",
|
|
1278
1282
|
label: e(i)("connect.store.bundle.edit.internalBundle"),
|
|
1279
1283
|
sublabel: e(i)("connect.store.bundle.edit.internalBundleDescription")
|
|
1280
1284
|
}, null, 8, ["model-value", "label", "sublabel"]),
|
|
1281
1285
|
r(C, {
|
|
1282
1286
|
"model-value": e(t).hideInPos ?? !1,
|
|
1283
|
-
"onUpdate:modelValue":
|
|
1287
|
+
"onUpdate:modelValue": o[17] || (o[17] = (V) => e(t).hideInPos = V),
|
|
1284
1288
|
"label-placement": "right",
|
|
1285
1289
|
label: e(i)("connect.store.bundle.edit.hideInPos"),
|
|
1286
1290
|
sublabel: e(i)("connect.store.bundle.edit.hideInPosDescription")
|
|
1287
1291
|
}, null, 8, ["model-value", "label", "sublabel"]),
|
|
1288
1292
|
r(H, {
|
|
1289
1293
|
"model-value": ((Be = (De = e(t).config) == null ? void 0 : De.options) == null ? void 0 : Be.maxPerUser) || null,
|
|
1290
|
-
"onUpdate:modelValue":
|
|
1294
|
+
"onUpdate:modelValue": o[18] || (o[18] = (V) => e(ue).set(e(t), "config.options.maxPerUser", V)),
|
|
1291
1295
|
label: e(i)("connect.store.bundle.edit.maxPerUser"),
|
|
1292
1296
|
"show-steppers": !1,
|
|
1293
1297
|
placeholder: "Unlimited"
|
|
@@ -1300,19 +1304,19 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1300
1304
|
}, 8, ["modelValue", "header"]);
|
|
1301
1305
|
};
|
|
1302
1306
|
}
|
|
1303
|
-
}),
|
|
1307
|
+
}), po = { class: "flex gap-8 items-center flex-wrap" }, yo = { class: "flex items-center gap-8" }, fo = /* @__PURE__ */ ee({
|
|
1304
1308
|
__name: "SendBundleSheet",
|
|
1305
1309
|
emits: ["success"],
|
|
1306
1310
|
setup(v, { expose: _, emit: a }) {
|
|
1307
|
-
const { minor: f } = Ee, i = R(), b = R(""),
|
|
1311
|
+
const { minor: f } = Ee, i = R(), b = R(""), n = R(""), m = R([]), u = R(!1), t = R();
|
|
1308
1312
|
R(!0);
|
|
1309
|
-
function
|
|
1310
|
-
|
|
1313
|
+
function c(F) {
|
|
1314
|
+
u.value = !0, b.value = null, n.value = "", i.value = F.bundle;
|
|
1311
1315
|
}
|
|
1312
1316
|
function y() {
|
|
1313
|
-
|
|
1317
|
+
u.value = !1;
|
|
1314
1318
|
}
|
|
1315
|
-
async function
|
|
1319
|
+
async function d(F) {
|
|
1316
1320
|
const w = await ut.read({
|
|
1317
1321
|
limit: 25,
|
|
1318
1322
|
skip: 0,
|
|
@@ -1340,8 +1344,8 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1340
1344
|
const N = {
|
|
1341
1345
|
bundle: i.value._id,
|
|
1342
1346
|
member: b.value,
|
|
1343
|
-
source:
|
|
1344
|
-
ref: `ADMIN:${(/* @__PURE__ */ new Date()).toISOString()}:${
|
|
1347
|
+
source: ot.enum.ADMIN,
|
|
1348
|
+
ref: `ADMIN:${(/* @__PURE__ */ new Date()).toISOString()}:${n.value}`,
|
|
1345
1349
|
withCoin: !1
|
|
1346
1350
|
};
|
|
1347
1351
|
await _e.sendBundle(N), y();
|
|
@@ -1352,7 +1356,7 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1352
1356
|
}
|
|
1353
1357
|
);
|
|
1354
1358
|
}
|
|
1355
|
-
const l =
|
|
1359
|
+
const l = j(() => {
|
|
1356
1360
|
var w, N, W;
|
|
1357
1361
|
const F = [];
|
|
1358
1362
|
return ((w = i.value) == null ? void 0 : w.price.amount) > 0 && F.push(
|
|
@@ -1360,37 +1364,37 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1360
1364
|
), (W = i.value) != null && W.coinPrice && F.push(`${i.value.coinPrice} point(s)`), F.join(" or ");
|
|
1361
1365
|
});
|
|
1362
1366
|
return _({
|
|
1363
|
-
showSheet:
|
|
1367
|
+
showSheet: c,
|
|
1364
1368
|
hideSheet: y
|
|
1365
1369
|
}), fe(async () => {
|
|
1366
|
-
await
|
|
1370
|
+
await d("");
|
|
1367
1371
|
}), (F, w) => {
|
|
1368
|
-
const N = h("FmCardMedia"), W = h("FmCardHeader"), Y = h("FmChip"),
|
|
1372
|
+
const N = h("FmCardMedia"), W = h("FmCardHeader"), Y = h("FmChip"), q = h("FmCardSection"), z = h("FmCard"), le = h("FmSelect"), s = h("FmTextField"), $ = h("FmForm"), U = h("FmButton"), M = h("FmSideSheet");
|
|
1369
1373
|
return g(), I(M, {
|
|
1370
1374
|
"max-width": 560,
|
|
1371
1375
|
"dismiss-away": !0,
|
|
1372
1376
|
header: "Send bundle to member",
|
|
1373
|
-
modelValue: e(
|
|
1377
|
+
modelValue: e(u),
|
|
1374
1378
|
"onUpdate:modelValue": [
|
|
1375
|
-
w[4] || (w[4] = (
|
|
1376
|
-
w[5] || (w[5] = (
|
|
1379
|
+
w[4] || (w[4] = (P) => ne(u) ? u.value = P : null),
|
|
1380
|
+
w[5] || (w[5] = (P) => u.value = P)
|
|
1377
1381
|
]
|
|
1378
1382
|
}, {
|
|
1379
1383
|
"side-sheet-footer": T(() => [
|
|
1380
|
-
x("div",
|
|
1384
|
+
x("div", yo, [
|
|
1381
1385
|
r(U, {
|
|
1382
1386
|
label: "Send",
|
|
1383
1387
|
loading: e(xe)().isLoading,
|
|
1384
1388
|
onClick: w[2] || (w[2] = async () => {
|
|
1385
|
-
var
|
|
1386
|
-
return (
|
|
1389
|
+
var P;
|
|
1390
|
+
return (P = e(t)) == null ? void 0 : P.validateInputs();
|
|
1387
1391
|
})
|
|
1388
1392
|
}, null, 8, ["loading"]),
|
|
1389
1393
|
r(U, {
|
|
1390
1394
|
label: "Cancel",
|
|
1391
1395
|
type: "button",
|
|
1392
1396
|
variant: "tertiary",
|
|
1393
|
-
onClick: w[3] || (w[3] = (
|
|
1397
|
+
onClick: w[3] || (w[3] = (P) => u.value = !1)
|
|
1394
1398
|
})
|
|
1395
1399
|
])
|
|
1396
1400
|
]),
|
|
@@ -1409,14 +1413,14 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1409
1413
|
variant: "outlined"
|
|
1410
1414
|
}, {
|
|
1411
1415
|
default: T(() => {
|
|
1412
|
-
var
|
|
1416
|
+
var P, O;
|
|
1413
1417
|
return [
|
|
1414
|
-
(
|
|
1418
|
+
(P = e(i)) != null && P.image ? (g(), I(N, {
|
|
1415
1419
|
key: 0,
|
|
1416
1420
|
width: "100",
|
|
1417
1421
|
src: (O = e(i)) == null ? void 0 : O.image
|
|
1418
1422
|
}, null, 8, ["src"])) : A("", !0),
|
|
1419
|
-
r(
|
|
1423
|
+
r(q, { class: "flex flex-col gap-16 justify-between" }, {
|
|
1420
1424
|
default: T(() => {
|
|
1421
1425
|
var p;
|
|
1422
1426
|
return [
|
|
@@ -1425,20 +1429,20 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1425
1429
|
title: (p = e(i)) == null ? void 0 : p.name,
|
|
1426
1430
|
subtitle: e(l)
|
|
1427
1431
|
}, null, 8, ["title", "subtitle"]),
|
|
1428
|
-
r(
|
|
1432
|
+
r(q, { class: "p-0" }, {
|
|
1429
1433
|
default: T(() => {
|
|
1430
|
-
var
|
|
1434
|
+
var o, C, k, E, K, H, ie, ge, ce, ve, ae;
|
|
1431
1435
|
return [
|
|
1432
|
-
x("div",
|
|
1433
|
-
(
|
|
1436
|
+
x("div", po, [
|
|
1437
|
+
(o = e(i)) != null && o.isFeedvibe ? (g(), I(Y, {
|
|
1434
1438
|
key: 0,
|
|
1435
1439
|
label: "Feedvibe"
|
|
1436
1440
|
})) : A("", !0),
|
|
1437
|
-
(
|
|
1441
|
+
(k = (C = e(i)) == null ? void 0 : C.titles) != null && k.length ? (g(), I(Y, {
|
|
1438
1442
|
key: 1,
|
|
1439
1443
|
label: `${e(i).titles.length} title(s)`
|
|
1440
1444
|
}, null, 8, ["label"])) : A("", !0),
|
|
1441
|
-
(K = (
|
|
1445
|
+
(K = (E = e(i)) == null ? void 0 : E.vouchers) != null && K.length ? (g(), I(Y, {
|
|
1442
1446
|
key: 2,
|
|
1443
1447
|
label: `${e(i).vouchers.length} voucher(s)`
|
|
1444
1448
|
}, null, 8, ["label"])) : A("", !0),
|
|
@@ -1461,20 +1465,20 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1461
1465
|
}),
|
|
1462
1466
|
r(le, {
|
|
1463
1467
|
modelValue: e(b),
|
|
1464
|
-
"onUpdate:modelValue": w[0] || (w[0] = (
|
|
1468
|
+
"onUpdate:modelValue": w[0] || (w[0] = (P) => ne(b) ? b.value = P : null),
|
|
1465
1469
|
label: "Select member",
|
|
1466
1470
|
searchable: "",
|
|
1467
1471
|
items: e(m),
|
|
1468
|
-
onSearch:
|
|
1469
|
-
rules: [(
|
|
1472
|
+
onSearch: d,
|
|
1473
|
+
rules: [(P) => !!P > 0 || "Member is required"],
|
|
1470
1474
|
"helper-text": "Type to search member"
|
|
1471
1475
|
}, null, 8, ["modelValue", "items", "rules"]),
|
|
1472
1476
|
r(s, {
|
|
1473
|
-
modelValue: e(
|
|
1474
|
-
"onUpdate:modelValue": w[1] || (w[1] = (
|
|
1477
|
+
modelValue: e(n),
|
|
1478
|
+
"onUpdate:modelValue": w[1] || (w[1] = (P) => ne(n) ? n.value = P : null),
|
|
1475
1479
|
label: "Reference (optional)",
|
|
1476
1480
|
rules: [
|
|
1477
|
-
(
|
|
1481
|
+
(P) => P.length < 50 || "Reference must be less than 50 characters"
|
|
1478
1482
|
]
|
|
1479
1483
|
}, null, 8, ["modelValue", "rules"])
|
|
1480
1484
|
]),
|
|
@@ -1486,11 +1490,11 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1486
1490
|
};
|
|
1487
1491
|
}
|
|
1488
1492
|
});
|
|
1489
|
-
var
|
|
1490
|
-
const
|
|
1493
|
+
var bo = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedme.cc" };
|
|
1494
|
+
const go = { class: "px-24 flex flex-col gap-y-16" }, vo = { class: "flex gap-8 items-center" }, ho = { class: "fm-typo-en-body-lg-600" }, _o = { class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24" }, xo = /* @__PURE__ */ x("img", {
|
|
1491
1495
|
src: We,
|
|
1492
1496
|
class: "aspect-square w-[150px]"
|
|
1493
|
-
}, null, -1),
|
|
1497
|
+
}, null, -1), Co = { class: "flex flex-col gap-16 text-center" }, Fo = { class: "fm-typo-en-title-sm-800" }, Vo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, en = /* @__PURE__ */ ee({
|
|
1494
1498
|
__name: "Store",
|
|
1495
1499
|
setup(v) {
|
|
1496
1500
|
const _ = {
|
|
@@ -1509,16 +1513,16 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1509
1513
|
value: "create_category",
|
|
1510
1514
|
isPrimary: !0,
|
|
1511
1515
|
prependIcon: "add"
|
|
1512
|
-
},
|
|
1516
|
+
}, n = R(), m = ct(), u = $e(), { global: t, minor: c } = Ee, y = Ae(), d = j(() => u.sortedStoreCategories), S = j(() => u.sortedStoreCategories.map((s) => s.name)), l = R(), F = R();
|
|
1513
1517
|
async function w(s) {
|
|
1514
1518
|
var $;
|
|
1515
|
-
s === "setting" ? ($ = l.value) == null || $.showSheet(!0,
|
|
1519
|
+
s === "setting" ? ($ = l.value) == null || $.showSheet(!0, u.storeOption) : s === "create_category" ? W(-1) : s === "create_reward" ? await m.push({ name: Ze["$connect-STORE_REWARDS"] }) : s == "payout" && window.open(bo.paymentPortalUrl, "_blank");
|
|
1516
1520
|
}
|
|
1517
1521
|
async function N(s) {
|
|
1518
|
-
await
|
|
1522
|
+
await c(
|
|
1519
1523
|
async () => {
|
|
1520
1524
|
var $;
|
|
1521
|
-
await _e.updateStore(s), await
|
|
1525
|
+
await _e.updateStore(s), await u.readMemberStore(), ($ = l.value) == null || $.showSheet(!1);
|
|
1522
1526
|
},
|
|
1523
1527
|
{
|
|
1524
1528
|
message: a("connect.store.setting.update.message"),
|
|
@@ -1528,7 +1532,7 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1528
1532
|
}
|
|
1529
1533
|
async function W(s = -1) {
|
|
1530
1534
|
var $, U;
|
|
1531
|
-
if ((!
|
|
1535
|
+
if ((!u.storeOption || !u.storeOption.company) && await he.confirm(
|
|
1532
1536
|
a("connect.store.category.setup.title"),
|
|
1533
1537
|
a("connect.store.category.setup.button"),
|
|
1534
1538
|
a("connect.store.category.setup.action"),
|
|
@@ -1539,19 +1543,19 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1539
1543
|
title: s == -1 ? a("connect.store.category.add") : a("connect.store.category.edit"),
|
|
1540
1544
|
contentComponent: $t,
|
|
1541
1545
|
contentComponentProps: {
|
|
1542
|
-
initialValue: ((U =
|
|
1546
|
+
initialValue: ((U = d.value[s]) == null ? void 0 : U.name) ?? "",
|
|
1543
1547
|
action: s == -1 ? "add" : "edit"
|
|
1544
1548
|
}
|
|
1545
1549
|
}).onPrimary(async (M) => {
|
|
1546
1550
|
M === null && !await he.remove(
|
|
1547
1551
|
a("connect.store.category.remove.confirm"),
|
|
1548
1552
|
a("connect.store.category.remove.title")
|
|
1549
|
-
) || await
|
|
1553
|
+
) || await c(
|
|
1550
1554
|
async () => {
|
|
1551
|
-
const
|
|
1555
|
+
const P = s == -1 ? [...d.value, { name: M, bundles: [] }] : [...d.value].map((O, p) => p == s ? { ...O, name: M } : O).filter((O) => O.name !== null);
|
|
1552
1556
|
await _e.updateStoreBundle({
|
|
1553
|
-
categories:
|
|
1554
|
-
}), await
|
|
1557
|
+
categories: P
|
|
1558
|
+
}), await u.readMemberStore();
|
|
1555
1559
|
},
|
|
1556
1560
|
{
|
|
1557
1561
|
message: M === null ? a("connect.store.category.update.deleting") : s == -1 ? a("connect.store.category.update.creating") : a("connect.store.category.update.updating"),
|
|
@@ -1561,11 +1565,14 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1561
1565
|
});
|
|
1562
1566
|
}
|
|
1563
1567
|
async function Y(s, $, U, M) {
|
|
1564
|
-
var p,
|
|
1565
|
-
$ ?? ($ = (p = F.value) == null ? void 0 : p.target.category), U ?? (U = (
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1568
|
-
|
|
1568
|
+
var p, o, C;
|
|
1569
|
+
$ ?? ($ = (p = F.value) == null ? void 0 : p.target.category), U ?? (U = (o = F.value) == null ? void 0 : o.target.index), M ?? (M = (C = F.value) == null ? void 0 : C.target.originalCategoryIndex);
|
|
1570
|
+
const P = Ne(d.value);
|
|
1571
|
+
for (const k of P)
|
|
1572
|
+
for (const E of k.bundles)
|
|
1573
|
+
console.log(E, "bundle in payload"), "pf_vouchers" in E && delete E.pf_vouchers;
|
|
1574
|
+
$ != M && (P[M].bundles.splice(U, 1), U = P[$].bundles.length), console.log($, U, M, "ci, bi, originalCategoryIndex");
|
|
1575
|
+
const O = P[$];
|
|
1569
1576
|
if (!O) {
|
|
1570
1577
|
Ge.error("Unexpected error", 2e3);
|
|
1571
1578
|
return;
|
|
@@ -1579,19 +1586,19 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1579
1586
|
O.bundles.splice(U, 1);
|
|
1580
1587
|
} else
|
|
1581
1588
|
U == -1 ? O.bundles.push(s) : O.bundles[U] = s;
|
|
1582
|
-
await
|
|
1589
|
+
await c(
|
|
1583
1590
|
async () => {
|
|
1584
|
-
var
|
|
1591
|
+
var k, E;
|
|
1585
1592
|
if (s != null) {
|
|
1586
|
-
const K = (
|
|
1593
|
+
const K = (k = F.value) == null ? void 0 : k.bundleImage;
|
|
1587
1594
|
K === null && s.image ? (await Fe.delete(s.image), s.image = null) : K && (s.image = await Fe.update(
|
|
1588
1595
|
Fe.bundleImagePath(void 0, K),
|
|
1589
1596
|
K
|
|
1590
1597
|
));
|
|
1591
1598
|
}
|
|
1592
1599
|
await _e.updateStoreBundle({
|
|
1593
|
-
categories:
|
|
1594
|
-
}), await
|
|
1600
|
+
categories: P
|
|
1601
|
+
}), await u.readMemberStore(), await u.readMembership(), await u.readRewards(), (E = F.value) == null || E.showSheet(!1);
|
|
1595
1602
|
},
|
|
1596
1603
|
{
|
|
1597
1604
|
message: `${s == null ? "Deleting" : U == -1 ? "Creating" : "Updating"} bundle`,
|
|
@@ -1599,7 +1606,7 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1599
1606
|
}
|
|
1600
1607
|
);
|
|
1601
1608
|
}
|
|
1602
|
-
function
|
|
1609
|
+
function q(s) {
|
|
1603
1610
|
var $;
|
|
1604
1611
|
($ = F.value) == null || $.showSheet(!0, {
|
|
1605
1612
|
...s,
|
|
@@ -1609,7 +1616,7 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1609
1616
|
const z = R([]);
|
|
1610
1617
|
function le(s) {
|
|
1611
1618
|
var $;
|
|
1612
|
-
($ =
|
|
1619
|
+
($ = n.value) == null || $.showSheet({
|
|
1613
1620
|
bundle: s
|
|
1614
1621
|
});
|
|
1615
1622
|
}
|
|
@@ -1617,7 +1624,7 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1617
1624
|
var s, $;
|
|
1618
1625
|
await t(async () => {
|
|
1619
1626
|
var U, M;
|
|
1620
|
-
if (await
|
|
1627
|
+
if (await u.readMemberStore(), await u.readMembership(), await u.readRewards(), await u.readPayoutAccount(), (U = m.currentRoute.value.query) != null && U.action) {
|
|
1621
1628
|
switch ((M = m.currentRoute.value.query) == null ? void 0 : M.action) {
|
|
1622
1629
|
case "update_setting":
|
|
1623
1630
|
w("setting");
|
|
@@ -1629,10 +1636,10 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1629
1636
|
y.open({
|
|
1630
1637
|
title: "Select category",
|
|
1631
1638
|
contentComponent: Ut
|
|
1632
|
-
}).onPrimary((
|
|
1633
|
-
y.close(),
|
|
1639
|
+
}).onPrimary((P) => {
|
|
1640
|
+
y.close(), q({
|
|
1634
1641
|
categories: S.value,
|
|
1635
|
-
category:
|
|
1642
|
+
category: P,
|
|
1636
1643
|
index: -1,
|
|
1637
1644
|
bundle: {
|
|
1638
1645
|
...ue.cloneDeep(Se),
|
|
@@ -1648,51 +1655,51 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1648
1655
|
}
|
|
1649
1656
|
m.replace({ query: {} });
|
|
1650
1657
|
}
|
|
1651
|
-
}), z.value = [f, i, b], (((s =
|
|
1658
|
+
}), z.value = [f, i, b], (((s = u.payoutAccount) == null ? void 0 : s.status) != "APPROVED" || (($ = u.payoutAccount) == null ? void 0 : $.enable) != !0) && (z.value = [
|
|
1652
1659
|
_,
|
|
1653
1660
|
f,
|
|
1654
1661
|
i,
|
|
1655
1662
|
b
|
|
1656
1663
|
]);
|
|
1657
1664
|
}), (s, $) => {
|
|
1658
|
-
const U = h("FmPageHead"), M = h("FmButton"),
|
|
1659
|
-
return g(), D(
|
|
1665
|
+
const U = h("FmPageHead"), M = h("FmButton"), P = h("FmCard");
|
|
1666
|
+
return g(), D(X, null, [
|
|
1660
1667
|
r(U, {
|
|
1661
1668
|
title: e(a)("connect.store.title"),
|
|
1662
1669
|
actions: e(z),
|
|
1663
1670
|
"onClick:action": w
|
|
1664
1671
|
}, null, 8, ["title", "actions"]),
|
|
1665
|
-
x("div",
|
|
1666
|
-
e(
|
|
1667
|
-
(g(!0), D(
|
|
1672
|
+
x("div", go, [
|
|
1673
|
+
e(d) && e(d).length > 0 ? (g(), D(X, { key: 0 }, [
|
|
1674
|
+
(g(!0), D(X, null, re(e(d), (O, p) => (g(), D("div", {
|
|
1668
1675
|
key: O.name,
|
|
1669
1676
|
class: "space-y-8 py-12"
|
|
1670
1677
|
}, [
|
|
1671
|
-
x("div",
|
|
1672
|
-
x("div",
|
|
1678
|
+
x("div", vo, [
|
|
1679
|
+
x("div", ho, L(O.name), 1),
|
|
1673
1680
|
r(ke, { json: O }, null, 8, ["json"]),
|
|
1674
1681
|
r(M, {
|
|
1675
1682
|
icon: "edit",
|
|
1676
1683
|
size: "md",
|
|
1677
1684
|
variant: "tertiary",
|
|
1678
|
-
onClick: (
|
|
1685
|
+
onClick: (o) => W(p)
|
|
1679
1686
|
}, null, 8, ["onClick"])
|
|
1680
1687
|
]),
|
|
1681
|
-
x("div",
|
|
1682
|
-
(g(!0), D(
|
|
1683
|
-
bundle:
|
|
1684
|
-
key:
|
|
1685
|
-
onEdit: (
|
|
1686
|
-
bundle:
|
|
1688
|
+
x("div", _o, [
|
|
1689
|
+
(g(!0), D(X, null, re(O.bundles, (o, C) => (g(), I(Ct, {
|
|
1690
|
+
bundle: o,
|
|
1691
|
+
key: o._id,
|
|
1692
|
+
onEdit: (k) => q({
|
|
1693
|
+
bundle: o,
|
|
1687
1694
|
category: p,
|
|
1688
1695
|
index: C,
|
|
1689
1696
|
categories: e(S)
|
|
1690
1697
|
}),
|
|
1691
|
-
onDelete: (
|
|
1698
|
+
onDelete: (k) => Y(null, p, C),
|
|
1692
1699
|
onSend: le
|
|
1693
1700
|
}, null, 8, ["bundle", "onEdit", "onDelete"]))), 128)),
|
|
1694
1701
|
r(Ft, {
|
|
1695
|
-
onCreate: (
|
|
1702
|
+
onCreate: (o) => q({
|
|
1696
1703
|
category: p,
|
|
1697
1704
|
index: -1,
|
|
1698
1705
|
categories: e(S)
|
|
@@ -1700,21 +1707,21 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1700
1707
|
}, null, 8, ["onCreate"])
|
|
1701
1708
|
])
|
|
1702
1709
|
]))), 128)),
|
|
1703
|
-
r(
|
|
1710
|
+
r(mo, {
|
|
1704
1711
|
ref_key: "bundleSheetRef",
|
|
1705
1712
|
ref: F,
|
|
1706
1713
|
onUpdate: Y
|
|
1707
1714
|
}, null, 512)
|
|
1708
|
-
], 64)) : (g(), I(
|
|
1715
|
+
], 64)) : (g(), I(P, {
|
|
1709
1716
|
key: 1,
|
|
1710
1717
|
variant: "outlined",
|
|
1711
1718
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
1712
1719
|
}, {
|
|
1713
1720
|
default: T(() => [
|
|
1714
|
-
|
|
1715
|
-
x("div",
|
|
1716
|
-
x("div",
|
|
1717
|
-
x("div",
|
|
1721
|
+
xo,
|
|
1722
|
+
x("div", Co, [
|
|
1723
|
+
x("div", Fo, L(e(a)("connect.store.bundle.title")), 1),
|
|
1724
|
+
x("div", Vo, L(e(a)("connect.store.bundle.description")), 1)
|
|
1718
1725
|
]),
|
|
1719
1726
|
r(M, {
|
|
1720
1727
|
variant: "primary",
|
|
@@ -1730,9 +1737,9 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1730
1737
|
ref: l,
|
|
1731
1738
|
onUpdate: N
|
|
1732
1739
|
}, null, 512),
|
|
1733
|
-
r(
|
|
1740
|
+
r(fo, {
|
|
1734
1741
|
ref_key: "sendBundleSheetRef",
|
|
1735
|
-
ref:
|
|
1742
|
+
ref: n
|
|
1736
1743
|
}, null, 512)
|
|
1737
1744
|
])
|
|
1738
1745
|
], 64);
|
|
@@ -1740,5 +1747,5 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1740
1747
|
}
|
|
1741
1748
|
});
|
|
1742
1749
|
export {
|
|
1743
|
-
|
|
1750
|
+
en as default
|
|
1744
1751
|
};
|