@feedmepos/mf-connect 0.1.40-prod → 0.1.41-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-GrWPdz7w.js → Analytic-D3uKv5m4.js} +11 -11
- package/dist/{App-3Dd6lNBQ.js → App-Dn9fC3Vl.js} +6 -6
- package/dist/{Bin-DfJGrDgS.js → Bin-CPNXWOZO.js} +8 -8
- package/dist/{Broadcast-BplRlmcw.js → Broadcast-F91h37Bm.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DYke9Otb.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dn7bIPFU.js} +6 -6
- package/dist/{Card-C_LLJLY2.js → Card-BFsGFDNE.js} +16 -16
- package/dist/{Collections-BHX4X9kc.js → Collections-5x3LjHAT.js} +7 -7
- package/dist/{Credit-B9cltJj7.js → Credit-M1s0eL07.js} +9 -9
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cbpwd9fT.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ylc1NsHz.js} +29 -29
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-EJdhi8EI.js → EffectSheet.vue_vue_type_style_index_0_lang-CCLNpdBC.js} +6 -6
- package/dist/{Experience-IeufajTS.js → Experience-B07AdG0x.js} +9 -9
- package/dist/{Game-DIotzX_I.js → Game-VqOk6uyr.js} +10 -10
- package/dist/{Index-0EBdP8WS.js → Index-D2aj8xc2.js} +10 -10
- package/dist/{Marketing-DpNDT3HJ.js → Marketing-CFuQnD5y.js} +6 -6
- package/dist/{Member-BBtNLOZw.js → Member-XWrRlttD.js} +10 -10
- package/dist/{MemberList-BQnJv4EM.js → MemberList-UHl_gpXc.js} +25 -25
- package/dist/{MemberTransactions-C0nd7IYT.js → MemberTransactions-CN16DQV-.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C3Do2QuS.js → MessageInput.vue_vue_type_script_setup_true_lang-DaJErcrg.js} +4 -4
- package/dist/{Mission-DSvRP9Qn.js → Mission-iehwOvgI.js} +10 -10
- package/dist/{Overview-CvcjfGFj.js → Overview-BinJS4N2.js} +18 -18
- package/dist/{Point-vB2s19G8.js → Point-CbbAl0NF.js} +9 -9
- package/dist/{Promotion-Cc_vuskd.js → Promotion-CEFZMGjY.js} +10 -10
- package/dist/{Queue-BjwqDcRZ.js → Queue-ooxr1TCf.js} +10 -10
- package/dist/{Record-C_pRWG_j.js → Record-CVDBbAKR.js} +8 -8
- package/dist/{Reward-DkLiFQdP.js → Reward-DrizZ7Im.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-kQFS1Ccm.js → RewardGroup.vue_vue_type_script_setup_true_lang-DcaqBf6A.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CZkIPjTc.js → RuleGroup.vue_vue_type_script_setup_true_lang-DxVh8nqX.js} +13 -13
- package/dist/{Segment-DQA6MrU0.js → Segment-1X1semdj.js} +22 -22
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-YkEC6qpK.js → SelectItems.vue_vue_type_script_setup_true_lang-Cvgm_9Ku.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DKv57j3m.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DoNsVoDr.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D2lDO-TF.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C9UQaid2.js} +3 -3
- package/dist/{Setting-BoQUl6lw.js → Setting-0h-iRv0U.js} +11 -11
- package/dist/{Store-CbMxxSOE.js → Store-Te2IOs8m.js} +218 -218
- package/dist/{StoreRewards-Bjewm_Jo.js → StoreRewards-4735EfrW.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-C36NtLDC.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DOke6CyB.js} +19 -19
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DZin_mhN.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BfNWBP8X.js} +1 -1
- package/dist/{Tier-vRI9_k9l.js → Tier-BDIryG9z.js} +20 -20
- package/dist/{Title-COlCAWzd.js → Title-DJS_wqfU.js} +19 -19
- package/dist/{Transaction-D_b10kJo.js → Transaction-BaKwnftk.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-uaVAHCG0.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Ch0QLPaD.js} +6 -6
- package/dist/{Voucher-YL6VW3yF.js → Voucher-CROyl49n.js} +13 -13
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-EJxNHeJh.js → VoucherEditor.vue_vue_type_script_setup_true_lang-ZFoMPVmy.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B3UgiZPC.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bhz8JPpv.js} +1 -1
- package/dist/{app-DtX_naD3.js → app-4oteOCHe.js} +30 -30
- package/dist/{app-VDqFJGNS.js → app-D9bbDgvv.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-CLU2Q1bF.js → business-BshVoLh2.js} +1 -1
- package/dist/{campaign-3tvdSZZ5.js → campaign-B-p-DZ0n.js} +9 -9
- package/dist/{campaign-CuEWe6qx.js → campaign-WtNLNBxD.js} +2 -2
- package/dist/{campaign.enum-Bu3qnidx.js → campaign.enum-CZdrbmDj.js} +1 -1
- package/dist/{campaign.fn-C_PsOzU_.js → campaign.fn-BPJQ-IBU.js} +52 -52
- package/dist/{collectible.enum-Dm7Tur8Q.js → collectible.enum-Cl2lNAS4.js} +1 -1
- package/dist/{collection.fn-x61GjA4A.js → collection.fn-CYeIDXKF.js} +2 -2
- package/dist/{dto-CS04rZNL.js → dto-DnvchynI.js} +4 -4
- package/dist/{effect-CdfCfywZ.js → effect-Ctow_mOd.js} +1 -1
- package/dist/{email-addresses-B1dyqybF.js → email-addresses-_2Ox__VM.js} +1 -1
- package/dist/{export-DmqpR5gW.js → export-CkFPj3iw.js} +3 -3
- package/dist/{helper-DFGXkAbM.js → helper-CgyjZO6x.js} +1 -1
- package/dist/{index-BrSxpCce.js → index--rWvMOZW.js} +1 -1
- package/dist/{index-C9MPG7dK.js → index-BBh-2GN6.js} +1 -1
- package/dist/{index-DEUc6hUA.js → index-BNTYlMEV.js} +1 -1
- package/dist/{index-BbNhpD5n.js → index-CG-hKk6_.js} +1 -1
- package/dist/{index-mP4Ezz2G.js → index-CHBVlx2V.js} +6 -6
- package/dist/{index-CB01tEr2.js → index-CTbEjWKR.js} +1 -1
- package/dist/{index-MVJfcvxX.js → index-CemCbz10.js} +4 -4
- package/dist/{index-Cs7YWUZq.js → index-ChccrEQ3.js} +3 -3
- package/dist/{index-Dp5rWjCs.js → index-D3Tx7Uvd.js} +1 -1
- package/dist/{index-DSdIFnGi.js → index-DGHazzUR.js} +1 -1
- package/dist/{index-BSfJZagg.js → index-DQTDMFeT.js} +1 -1
- package/dist/{index-CbWXPOY8.js → index-DcPwQDSI.js} +3 -3
- package/dist/{index-CcSJRdIK.js → index-Q5rLPsei.js} +2 -2
- package/dist/{index-Bx1zpKOC.js → index-QqY2qqoC.js} +3 -3
- package/dist/{index.esm2017-o1sZmdsg.js → index.esm2017-BhJ3N6J8.js} +1 -1
- package/dist/{loading-74TLcUKp.js → loading-vpGcXw3h.js} +1 -1
- package/dist/{membership-Dd9z8DUX.js → membership-BIAh4gr8.js} +3 -3
- package/dist/{money-DDBtMAtj.js → money-BKAHQOy5.js} +1 -1
- package/dist/{number-D8m8fU5I.js → number-BvZWZSlX.js} +1 -1
- package/dist/{objectid-BmO4JyLT.js → objectid-DTQ3WM_Q.js} +6 -6
- package/dist/{plugins-YlYWZa8S.js → plugins-gqusBaTE.js} +2 -2
- package/dist/{reward-CMU1GyKk.js → reward-DE3BtnPo.js} +1 -1
- package/dist/{rule-sf1i3XjU.js → rule-Bp2r0-Fe.js} +3 -3
- package/dist/{rule-builder-ByNE0WCn.js → rule-builder-CGXIZuHx.js} +1 -1
- package/dist/{template-CHRfW1I-.js → template-DNfTf3wL.js} +4 -4
- package/dist/{trigger-Df4E0ytZ.js → trigger-CREXpdkj.js} +4 -4
- package/dist/{user-DX39-nm4.js → user-aHtXh33q.js} +1 -1
- package/dist/{vue-i18n-Dj8uhIhh.js → vue-i18n-DiZ9Dq7g.js} +230 -230
- package/dist/{xlsx-_q0F7foF.js → xlsx-Cp4-ONzH.js} +1 -1
- package/package.json +1 -1
|
@@ -1,37 +1,37 @@
|
|
|
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 B, createVNode as i, createCommentVNode as M, toDisplayString as L, unref as e, Fragment as X, renderList as re, ref 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 B, createVNode as i, createCommentVNode as M, toDisplayString as L, unref as e, Fragment as X, renderList as re, ref as U, isRef as oe, reactive as Ke, onMounted as fe, watch as we, toRaw as He, createTextVNode as de, h as qe } from "vue";
|
|
2
2
|
import { _ as Ye } from "./tier-BJDhpH6X.js";
|
|
3
3
|
import { useDialog as Me, useDialogChild as Oe, components as We } from "@feedmepos/ui-library";
|
|
4
|
-
import { c as D, e as he, S as ze } from "./index-
|
|
5
|
-
import { u as Ee } from "./loading-
|
|
6
|
-
import { u as ke, C as me } from "./membership-
|
|
4
|
+
import { c as D, e as he, S as ze } from "./index-DcPwQDSI.js";
|
|
5
|
+
import { u as Ee } from "./loading-vpGcXw3h.js";
|
|
6
|
+
import { u as ke, C as me } from "./membership-BIAh4gr8.js";
|
|
7
7
|
import { a as Je, c as De } from "./object-qECH92oz.js";
|
|
8
8
|
import { _ as ue } from "./lodash-B5I3zXaY.js";
|
|
9
|
-
import { c as se } from "./index-
|
|
10
|
-
import { u as be } from "./vue-i18n-
|
|
9
|
+
import { c as se } from "./index-QqY2qqoC.js";
|
|
10
|
+
import { u as be } from "./vue-i18n-DiZ9Dq7g.js";
|
|
11
11
|
import { Z, g as J, a as G } from "./zod-Bg2FbC-D.js";
|
|
12
|
-
import { z as Q, R as Ge } from "./app-
|
|
13
|
-
import { m as Xe, n as Ze, o as Qe, p as Ae, q as et } from "./index-
|
|
12
|
+
import { z as Q, R as Ge } from "./app-4oteOCHe.js";
|
|
13
|
+
import { m as Xe, n as Ze, o as Qe, p as Ae, q as et } from "./index-CemCbz10.js";
|
|
14
14
|
import { u as Se } from "./app-wDQR6dpb.js";
|
|
15
|
-
import { _ as te } from "./ZodTextField.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { a as tt, p as xe, n as nt, f as Fe } from "./plugins-
|
|
15
|
+
import { _ as te } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Bhz8JPpv.js";
|
|
16
|
+
import { a as tt, p as xe, n as nt, f as Fe } from "./plugins-gqusBaTE.js";
|
|
17
17
|
import { J as Pe } from "./JsonViewer-v8_C7l5N.js";
|
|
18
|
-
import { _ as ot } from "./index-
|
|
18
|
+
import { _ as ot } from "./index-Q5rLPsei.js";
|
|
19
19
|
import { _ as at } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
20
20
|
import { _ as lt } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
|
|
21
|
-
import { z as st, a as rt } from "./money-
|
|
22
|
-
import { F as it } from "./number-
|
|
23
|
-
import { t as dt } from "./helper-
|
|
24
|
-
import "./index
|
|
25
|
-
import "./index-
|
|
26
|
-
import "./index-
|
|
27
|
-
import "./index-
|
|
28
|
-
import { m as ut } from "./index-
|
|
29
|
-
import { m as Ce } from "./index-
|
|
21
|
+
import { z as st, a as rt } from "./money-BKAHQOy5.js";
|
|
22
|
+
import { F as it } from "./number-BvZWZSlX.js";
|
|
23
|
+
import { t as dt } from "./helper-CgyjZO6x.js";
|
|
24
|
+
import "./index--rWvMOZW.js";
|
|
25
|
+
import "./index-CHBVlx2V.js";
|
|
26
|
+
import "./index-BNTYlMEV.js";
|
|
27
|
+
import "./index-ChccrEQ3.js";
|
|
28
|
+
import { m as ut } from "./index-DGHazzUR.js";
|
|
29
|
+
import { m as Ce } from "./index-D3Tx7Uvd.js";
|
|
30
30
|
import { useRouter as ct } from "vue-router";
|
|
31
31
|
function je(v) {
|
|
32
32
|
return se.DineroFactory(v).toUnit();
|
|
33
33
|
}
|
|
34
|
-
function mt(v, _,
|
|
34
|
+
function mt(v, _, a, f, r = [], b = []) {
|
|
35
35
|
const o = ot.compact(
|
|
36
36
|
_.map((t) => v.find((c) => c.systemCode === t.systemCode && c.taxCode === t.taxCode)).filter((t) => !!t && b.includes(t.systemCode))
|
|
37
37
|
), m = o.reduce(
|
|
@@ -64,7 +64,7 @@ function mt(v, _, l, f, r = [], b = []) {
|
|
|
64
64
|
level: 0,
|
|
65
65
|
type: {
|
|
66
66
|
type: "BY_AMOUNT",
|
|
67
|
-
amount: se.DineroFactory(
|
|
67
|
+
amount: se.DineroFactory(a).subtract(se.Dinero.fromNumber({ number: f }).toObject()).toObject()
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
},
|
|
@@ -85,10 +85,10 @@ function mt(v, _, l, f, r = [], b = []) {
|
|
|
85
85
|
}).convertPrecision(2).toObject()
|
|
86
86
|
}));
|
|
87
87
|
}
|
|
88
|
-
function pt(v, _,
|
|
88
|
+
function pt(v, _, a) {
|
|
89
89
|
return v ? v.reduce((f, r) => {
|
|
90
90
|
var b;
|
|
91
|
-
return (b =
|
|
91
|
+
return (b = a.find((o) => o.systemCode === r.systemCode)) != null && b.inclusive || (f = se.DineroFactory(f.toObject()).add(r.total)), f;
|
|
92
92
|
}, se.DineroFactory(_)).toObject() : se.DineroFactory(_).toObject();
|
|
93
93
|
}
|
|
94
94
|
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 = {
|
|
@@ -101,16 +101,16 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
101
101
|
},
|
|
102
102
|
emits: ["edit", "delete", "send"],
|
|
103
103
|
setup(v, { emit: _ }) {
|
|
104
|
-
const
|
|
104
|
+
const a = v, f = _, r = j(() => {
|
|
105
105
|
const o = [];
|
|
106
|
-
return
|
|
107
|
-
`${D.Config.getCountry().currency.symbol}${je(
|
|
108
|
-
),
|
|
106
|
+
return a.bundle.price.amount > 0 && o.push(
|
|
107
|
+
`${D.Config.getCountry().currency.symbol}${je(a.bundle.price)}`
|
|
108
|
+
), a.bundle.coinPrice && o.push(`${a.bundle.coinPrice} point(s)`), o.join(" or ");
|
|
109
109
|
}), b = j(() => {
|
|
110
110
|
var m, u;
|
|
111
111
|
const o = [];
|
|
112
|
-
if (
|
|
113
|
-
const t =
|
|
112
|
+
if (a.bundle.titles.length > 0 && o.push(`${a.bundle.titles.length} title(s)`), a.bundle.vouchers.length > 0 && o.push(`${a.bundle.vouchers.length} voucher(s)`), a.bundle.credit.normal || (m = a.bundle.credit.free) != null && m.amount) {
|
|
113
|
+
const t = a.bundle.credit.normal + (((u = a.bundle.credit.free) == null ? void 0 : u.amount) ?? 0);
|
|
114
114
|
o.push(`${t} credit(s)`);
|
|
115
115
|
}
|
|
116
116
|
return o;
|
|
@@ -151,18 +151,18 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
151
151
|
]),
|
|
152
152
|
default: T(() => [
|
|
153
153
|
i(y, {
|
|
154
|
-
onClick: m[0] || (m[0] = (
|
|
154
|
+
onClick: m[0] || (m[0] = (l) => f("edit", v.bundle)),
|
|
155
155
|
icon: "edit",
|
|
156
156
|
label: "Edit"
|
|
157
157
|
}),
|
|
158
158
|
v.bundle.stripePriceId ? M("", !0) : (g(), I(y, {
|
|
159
159
|
key: 0,
|
|
160
|
-
onClick: m[1] || (m[1] = (
|
|
160
|
+
onClick: m[1] || (m[1] = (l) => f("send", v.bundle)),
|
|
161
161
|
icon: "send",
|
|
162
162
|
label: "Send"
|
|
163
163
|
})),
|
|
164
164
|
i(y, {
|
|
165
|
-
onClick: m[2] || (m[2] = (
|
|
165
|
+
onClick: m[2] || (m[2] = (l) => f("delete", v.bundle)),
|
|
166
166
|
icon: "delete"
|
|
167
167
|
}, {
|
|
168
168
|
label: T(() => [
|
|
@@ -178,9 +178,9 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
178
178
|
x("div", ht, L(v.bundle.name), 1),
|
|
179
179
|
x("div", _t, L(e(r) || "Free"), 1),
|
|
180
180
|
x("div", xt, [
|
|
181
|
-
(g(!0), B(X, null, re(e(b), (
|
|
181
|
+
(g(!0), B(X, null, re(e(b), (l, S) => (g(), I(t, {
|
|
182
182
|
key: S,
|
|
183
|
-
label:
|
|
183
|
+
label: l
|
|
184
184
|
}, null, 8, ["label"]))), 128))
|
|
185
185
|
])
|
|
186
186
|
]),
|
|
@@ -192,7 +192,7 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
192
192
|
__name: "AddBundleCard",
|
|
193
193
|
emits: ["create"],
|
|
194
194
|
setup(v, { emit: _ }) {
|
|
195
|
-
const { t:
|
|
195
|
+
const { t: a } = be(), f = _;
|
|
196
196
|
return (r, b) => {
|
|
197
197
|
const o = h("FmButton"), m = h("FmCard");
|
|
198
198
|
return g(), I(m, {
|
|
@@ -202,7 +202,7 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
202
202
|
default: T(() => [
|
|
203
203
|
i(o, {
|
|
204
204
|
onClick: b[0] || (b[0] = (u) => f("create")),
|
|
205
|
-
label: e(
|
|
205
|
+
label: e(a)("connect.store.actions.addBundle"),
|
|
206
206
|
icon: "add",
|
|
207
207
|
variant: "secondary"
|
|
208
208
|
}, null, 8, ["label"])
|
|
@@ -224,7 +224,7 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
224
224
|
}
|
|
225
225
|
},
|
|
226
226
|
setup(v) {
|
|
227
|
-
const { t: _ } = be(),
|
|
227
|
+
const { t: _ } = be(), a = v, f = Me(), { emitData: r, emitAction: b } = Oe(), o = U(a.initialValue), m = Q.string().min(1);
|
|
228
228
|
function u() {
|
|
229
229
|
r(o.value), b("primary"), f.close();
|
|
230
230
|
}
|
|
@@ -236,7 +236,7 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
236
236
|
return g(), B("div", Ft, [
|
|
237
237
|
i(d, {
|
|
238
238
|
modelValue: e(o),
|
|
239
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
239
|
+
"onUpdate:modelValue": y[0] || (y[0] = (l) => oe(o) ? o.value = l : null),
|
|
240
240
|
label: e(_)("connect.store.category.label"),
|
|
241
241
|
rules: [e(Z).toRule(e(m))]
|
|
242
242
|
}, null, 8, ["modelValue", "label", "rules"]),
|
|
@@ -253,7 +253,7 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
253
253
|
i(V, {
|
|
254
254
|
label: e(_)("connect.common.cancel"),
|
|
255
255
|
variant: "tertiary",
|
|
256
|
-
onClick: y[1] || (y[1] = (
|
|
256
|
+
onClick: y[1] || (y[1] = (l) => e(f).close())
|
|
257
257
|
}, null, 8, ["label"]),
|
|
258
258
|
i(V, {
|
|
259
259
|
label: v.action == "edit" ? e(_)("connect.common.edit") : e(_)("connect.common.add"),
|
|
@@ -268,7 +268,7 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
268
268
|
}), Pt = { class: "space-y-16" }, $t = /* @__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({
|
|
269
269
|
__name: "SelectCategoryDialog",
|
|
270
270
|
setup(v) {
|
|
271
|
-
const { emitData: _, emitAction:
|
|
271
|
+
const { emitData: _, emitAction: a } = Oe(), f = ke(), r = U(), b = j(
|
|
272
272
|
() => f.sortedStoreCategories.map((o, m) => ({
|
|
273
273
|
label: o.name,
|
|
274
274
|
value: m
|
|
@@ -292,11 +292,11 @@ const yt = { class: "relative h-[120px] aspect-video flex items-center justify-c
|
|
|
292
292
|
i(t, {
|
|
293
293
|
variant: "tertiary",
|
|
294
294
|
label: "Cancel",
|
|
295
|
-
onClick: m[2] || (m[2] = (c) => e(
|
|
295
|
+
onClick: m[2] || (m[2] = (c) => e(a)("tertiary"))
|
|
296
296
|
}),
|
|
297
297
|
i(t, {
|
|
298
298
|
label: "Select",
|
|
299
|
-
onClick: m[3] || (m[3] = (c) => e(
|
|
299
|
+
onClick: m[3] || (m[3] = (c) => e(a)("primary")),
|
|
300
300
|
disabled: e(r) == null
|
|
301
301
|
}, null, 8, ["disabled"])
|
|
302
302
|
])
|
|
@@ -484,12 +484,12 @@ const Rt = {
|
|
|
484
484
|
const v = D.Country.getCountryFlattenTaxes(pe().code);
|
|
485
485
|
return ye.taxSystem.map((_) => ({
|
|
486
486
|
code: _.code,
|
|
487
|
-
options: v.map((
|
|
487
|
+
options: v.map((a) => ({ ...a, feedmeTaxCode: ye.generateCode(a) })).filter((a) => a.systemCode === _.code)
|
|
488
488
|
}));
|
|
489
489
|
},
|
|
490
490
|
systemDefaultCode(v) {
|
|
491
|
-
const _ = ye.groupedTaxOptions().find((
|
|
492
|
-
return _ == null ? void 0 : _.options.find((
|
|
491
|
+
const _ = ye.groupedTaxOptions().find((a) => a.code === v);
|
|
492
|
+
return _ == null ? void 0 : _.options.find((a) => a.default);
|
|
493
493
|
},
|
|
494
494
|
generateCode(v) {
|
|
495
495
|
return `${v.systemCode}/${v.taxCode}`;
|
|
@@ -505,9 +505,9 @@ const Rt = {
|
|
|
505
505
|
},
|
|
506
506
|
emits: ["update:model-value"],
|
|
507
507
|
setup(v, { emit: _ }) {
|
|
508
|
-
const
|
|
508
|
+
const a = v, f = ne.taxSystem, r = _, b = U(a.modelValue);
|
|
509
509
|
function o(c, y) {
|
|
510
|
-
const d = ue.clone(
|
|
510
|
+
const d = ue.clone(a.modelValue), V = d.findIndex((l) => l.systemCode === c);
|
|
511
511
|
V >= 0 ? d[V].inclusive = y : d.push({
|
|
512
512
|
systemCode: c,
|
|
513
513
|
inclusive: y
|
|
@@ -515,7 +515,7 @@ const Rt = {
|
|
|
515
515
|
}
|
|
516
516
|
function m() {
|
|
517
517
|
return f.map((c) => {
|
|
518
|
-
const y =
|
|
518
|
+
const y = a.modelValue ? a.modelValue.find((d) => d.systemCode === c.code) : !1;
|
|
519
519
|
return {
|
|
520
520
|
label: c.name,
|
|
521
521
|
config: {
|
|
@@ -532,26 +532,26 @@ const Rt = {
|
|
|
532
532
|
return `${c} ${y ? "Inclusive" : "Exclusive"}`;
|
|
533
533
|
}
|
|
534
534
|
return fe(() => {
|
|
535
|
-
|
|
535
|
+
a.modelValue.length || o(f[0].code, !1);
|
|
536
536
|
}), we(
|
|
537
|
-
() =>
|
|
537
|
+
() => a.modelValue,
|
|
538
538
|
(c, y) => {
|
|
539
539
|
c != y && !c.length && o(f[0].code, !1);
|
|
540
540
|
}
|
|
541
541
|
), (c, y) => {
|
|
542
542
|
const d = h("FmSwitch");
|
|
543
|
-
return g(!0), B(X, null, re(e(u), (V,
|
|
543
|
+
return g(!0), B(X, null, re(e(u), (V, l) => {
|
|
544
544
|
var S;
|
|
545
|
-
return g(), B("div", { key:
|
|
545
|
+
return g(), B("div", { key: l }, [
|
|
546
546
|
i(d, {
|
|
547
|
-
"model-value": ((S = e(b)[
|
|
547
|
+
"model-value": ((S = e(b)[l]) == null ? void 0 : S.inclusive) || !1,
|
|
548
548
|
"label-placement": "left",
|
|
549
549
|
"onUpdate:modelValue": (w) => V.input(w)
|
|
550
550
|
}, {
|
|
551
551
|
label: T(() => {
|
|
552
552
|
var w;
|
|
553
553
|
return [
|
|
554
|
-
x("div", null, L(t(V.label, ((w = e(b)[
|
|
554
|
+
x("div", null, L(t(V.label, ((w = e(b)[l]) == null ? void 0 : w.inclusive) || !1)), 1)
|
|
555
555
|
];
|
|
556
556
|
}),
|
|
557
557
|
_: 2
|
|
@@ -572,9 +572,9 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
572
572
|
},
|
|
573
573
|
emits: ["update:modelValue"],
|
|
574
574
|
setup(v, { emit: _ }) {
|
|
575
|
-
const
|
|
575
|
+
const a = v, f = _, r = U(!1);
|
|
576
576
|
we(r, (o, m) => {
|
|
577
|
-
m != o && (!
|
|
577
|
+
m != o && (!a.modelValue && o ? f("update:modelValue", {
|
|
578
578
|
apiKey: "",
|
|
579
579
|
webhookSecret: ""
|
|
580
580
|
}) : o || f("update:modelValue", void 0));
|
|
@@ -584,7 +584,7 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
584
584
|
return `https://marketing${o ? "-dev" : ""}${u}.feedmeapi.com/stripe/${ze.getBusinessId()}/webhook`;
|
|
585
585
|
});
|
|
586
586
|
return fe(() => {
|
|
587
|
-
r.value = !!
|
|
587
|
+
r.value = !!a.modelValue;
|
|
588
588
|
}), (o, m) => {
|
|
589
589
|
const u = h("FmSwitch"), t = h("FmTextField"), c = h("FmButton");
|
|
590
590
|
return g(), B("div", Nt, [
|
|
@@ -594,11 +594,11 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
594
594
|
value: "true",
|
|
595
595
|
label: "Enable Stripe"
|
|
596
596
|
}, null, 8, ["modelValue"]),
|
|
597
|
-
|
|
597
|
+
a.modelValue ? (g(), B("div", Dt, [
|
|
598
598
|
i(t, {
|
|
599
599
|
label: "API Key",
|
|
600
|
-
modelValue:
|
|
601
|
-
"onUpdate:modelValue": m[1] || (m[1] = (y) =>
|
|
600
|
+
modelValue: a.modelValue.apiKey,
|
|
601
|
+
"onUpdate:modelValue": m[1] || (m[1] = (y) => a.modelValue.apiKey = y),
|
|
602
602
|
"helper-text": "Go to Stripe Dashboard get your API Key and paste here."
|
|
603
603
|
}, null, 8, ["modelValue"]),
|
|
604
604
|
i(t, {
|
|
@@ -617,8 +617,8 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
617
617
|
_: 1
|
|
618
618
|
}, 8, ["model-value"]),
|
|
619
619
|
i(t, {
|
|
620
|
-
modelValue:
|
|
621
|
-
"onUpdate:modelValue": m[3] || (m[3] = (y) =>
|
|
620
|
+
modelValue: a.modelValue.webhookSecret,
|
|
621
|
+
"onUpdate:modelValue": m[3] || (m[3] = (y) => a.modelValue.webhookSecret = y),
|
|
622
622
|
label: "Webhook Secret",
|
|
623
623
|
"helper-text": `Copy the webhook signing secret from your Stripe account and paste
|
|
624
624
|
here.`
|
|
@@ -636,8 +636,8 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
636
636
|
}, jt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Lt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Kt = { class: "grid grid-cols-2 gap-x-16 gap-y-16" }, Ht = { class: "space-y-4" }, qt = { class: "fm-typo-en-body-lg-400" }, Yt = { class: "space-y-16" }, Wt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, zt = { class: "flex items-center gap-8" }, Jt = /* @__PURE__ */ ee({
|
|
637
637
|
__name: "StoreSettingSheet",
|
|
638
638
|
emits: ["update"],
|
|
639
|
-
setup(v, { expose: _, emit:
|
|
640
|
-
const { t: f } = be(), r =
|
|
639
|
+
setup(v, { expose: _, emit: a }) {
|
|
640
|
+
const { t: f } = be(), r = a, b = U(!1), o = U(), m = U(!1), u = Xe.extend({
|
|
641
641
|
company: Ze.extend({
|
|
642
642
|
name: Q.string().min(1, "Company name is required"),
|
|
643
643
|
regNo: Q.string().min(1, "Registration number is required"),
|
|
@@ -676,18 +676,18 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
676
676
|
inclusiveTaxes: []
|
|
677
677
|
};
|
|
678
678
|
}
|
|
679
|
-
function d(V,
|
|
680
|
-
b.value = V, V && (o.value =
|
|
679
|
+
function d(V, l) {
|
|
680
|
+
b.value = V, V && (o.value = l != null && l.company ? l : y());
|
|
681
681
|
}
|
|
682
682
|
return _({
|
|
683
683
|
showSheet: d,
|
|
684
684
|
data: o
|
|
685
|
-
}), (V,
|
|
685
|
+
}), (V, l) => {
|
|
686
686
|
const S = h("FmIcon"), w = h("FmMenuItem"), A = h("FmMenu"), Y = h("FmSelect"), W = h("FmButton"), K = h("FmSideSheet");
|
|
687
687
|
return g(), I(K, {
|
|
688
688
|
"max-width": 560,
|
|
689
689
|
modelValue: e(b),
|
|
690
|
-
"onUpdate:modelValue":
|
|
690
|
+
"onUpdate:modelValue": l[15] || (l[15] = (z) => oe(b) ? b.value = z : null),
|
|
691
691
|
header: e(f)("connect.store.setting.title")
|
|
692
692
|
}, {
|
|
693
693
|
"side-sheet-footer": T(() => [
|
|
@@ -700,7 +700,7 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
700
700
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
701
701
|
i(W, {
|
|
702
702
|
label: e(f)("connect.common.cancel"),
|
|
703
|
-
onClick:
|
|
703
|
+
onClick: l[14] || (l[14] = (z) => d(!1)),
|
|
704
704
|
variant: "tertiary"
|
|
705
705
|
}, null, 8, ["label"])
|
|
706
706
|
])
|
|
@@ -713,13 +713,13 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
713
713
|
x("div", Ot, L(e(f)("connect.store.setting.company.legal_info")), 1),
|
|
714
714
|
i(te, {
|
|
715
715
|
modelValue: e(o).company.name,
|
|
716
|
-
"onUpdate:modelValue":
|
|
716
|
+
"onUpdate:modelValue": l[0] || (l[0] = (s) => e(o).company.name = s),
|
|
717
717
|
label: e(f)("connect.store.setting.company.name"),
|
|
718
718
|
schema: e(Z).typeAtPath(e(u), "company.name")
|
|
719
719
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
720
720
|
i(te, {
|
|
721
721
|
modelValue: e(o).company.regNo,
|
|
722
|
-
"onUpdate:modelValue":
|
|
722
|
+
"onUpdate:modelValue": l[1] || (l[1] = (s) => e(o).company.regNo = s),
|
|
723
723
|
label: e(f)("connect.store.setting.company.reg_no"),
|
|
724
724
|
schema: e(Z).typeAtPath(e(u), "company.regNo")
|
|
725
725
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
@@ -727,8 +727,8 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
727
727
|
key: 0,
|
|
728
728
|
modelValue: e(o).company.sstRegNo,
|
|
729
729
|
"onUpdate:modelValue": [
|
|
730
|
-
|
|
731
|
-
|
|
730
|
+
l[2] || (l[2] = (s) => e(o).company.sstRegNo = s),
|
|
731
|
+
l[3] || (l[3] = (s) => s ? null : e(o).inclusiveTaxes = [])
|
|
732
732
|
],
|
|
733
733
|
label: e(f)("connect.store.setting.company.tax_reg_no"),
|
|
734
734
|
schema: e(Z).typeAtPath(e(u), "company.sstRegNo")
|
|
@@ -737,38 +737,38 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
737
737
|
x("div", jt, L(e(f)("connect.store.setting.company.tax")), 1),
|
|
738
738
|
i(It, {
|
|
739
739
|
modelValue: e(o).inclusiveTaxes,
|
|
740
|
-
"onUpdate:modelValue":
|
|
740
|
+
"onUpdate:modelValue": l[4] || (l[4] = (s) => e(o).inclusiveTaxes = s)
|
|
741
741
|
}, null, 8, ["modelValue"])
|
|
742
742
|
])) : M("", !0),
|
|
743
743
|
i(te, {
|
|
744
744
|
modelValue: e(o).company.phoneNo,
|
|
745
|
-
"onUpdate:modelValue":
|
|
745
|
+
"onUpdate:modelValue": l[5] || (l[5] = (s) => e(o).company.phoneNo = s),
|
|
746
746
|
label: e(f)("connect.store.setting.company.phone"),
|
|
747
747
|
schema: e(Z).typeAtPath(e(u), "company.phoneNo")
|
|
748
748
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
749
749
|
x("div", Lt, L(e(f)("connect.store.setting.company.address.title")), 1),
|
|
750
750
|
i(te, {
|
|
751
751
|
modelValue: e(o).company.address.line1,
|
|
752
|
-
"onUpdate:modelValue":
|
|
752
|
+
"onUpdate:modelValue": l[6] || (l[6] = (s) => e(o).company.address.line1 = s),
|
|
753
753
|
label: e(f)("connect.store.setting.company.address.line1"),
|
|
754
754
|
schema: e(Z).typeAtPath(e(u), "company.address.line1")
|
|
755
755
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
756
756
|
i(te, {
|
|
757
757
|
modelValue: e(o).company.address.line2,
|
|
758
|
-
"onUpdate:modelValue":
|
|
758
|
+
"onUpdate:modelValue": l[7] || (l[7] = (s) => e(o).company.address.line2 = s),
|
|
759
759
|
label: e(f)("connect.store.setting.company.address.line2"),
|
|
760
760
|
schema: e(Z).typeAtPath(e(u), "company.address.line2")
|
|
761
761
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
762
762
|
x("div", Kt, [
|
|
763
763
|
i(te, {
|
|
764
764
|
modelValue: e(o).company.address.city,
|
|
765
|
-
"onUpdate:modelValue":
|
|
765
|
+
"onUpdate:modelValue": l[8] || (l[8] = (s) => e(o).company.address.city = s),
|
|
766
766
|
label: e(f)("connect.store.setting.company.address.city"),
|
|
767
767
|
schema: e(Z).typeAtPath(e(u), "company.address.city")
|
|
768
768
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
769
769
|
i(te, {
|
|
770
770
|
modelValue: e(o).company.address.postcode,
|
|
771
|
-
"onUpdate:modelValue":
|
|
771
|
+
"onUpdate:modelValue": l[9] || (l[9] = (s) => e(o).company.address.postcode = s),
|
|
772
772
|
label: e(f)("connect.store.setting.company.address.postcode"),
|
|
773
773
|
schema: e(Z).typeAtPath(e(u), "company.address.postcode")
|
|
774
774
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
@@ -781,9 +781,9 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
781
781
|
"menu-button": T(() => [
|
|
782
782
|
i(te, {
|
|
783
783
|
modelValue: e(o).company.address.state,
|
|
784
|
-
"onUpdate:modelValue":
|
|
784
|
+
"onUpdate:modelValue": l[10] || (l[10] = (s) => e(o).company.address.state = s),
|
|
785
785
|
schema: e(Z).typeAtPath(e(u), "company.address.state"),
|
|
786
|
-
onFocusChanged:
|
|
786
|
+
onFocusChanged: l[11] || (l[11] = (s) => m.value = s)
|
|
787
787
|
}, {
|
|
788
788
|
append: T(() => [
|
|
789
789
|
i(S, {
|
|
@@ -796,8 +796,8 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
796
796
|
default: T(() => [
|
|
797
797
|
(g(!0), B(X, null, re(e(Rt)[e(D.Config).getCountry().code].stateItems.filter(
|
|
798
798
|
(s) => {
|
|
799
|
-
var
|
|
800
|
-
return s.label.toLowerCase().includes(((
|
|
799
|
+
var $, R;
|
|
800
|
+
return s.label.toLowerCase().includes(((R = ($ = e(o)) == null ? void 0 : $.company) == null ? void 0 : R.address.state.toLowerCase()) ?? "");
|
|
801
801
|
}
|
|
802
802
|
) || [], (s) => (g(), I(w, {
|
|
803
803
|
key: s.value,
|
|
@@ -814,7 +814,7 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
814
814
|
i(Y, {
|
|
815
815
|
label: e(f)("connect.store.setting.company.address.country"),
|
|
816
816
|
modelValue: e(o).company.address.country,
|
|
817
|
-
"onUpdate:modelValue":
|
|
817
|
+
"onUpdate:modelValue": l[12] || (l[12] = (s) => e(o).company.address.country = s),
|
|
818
818
|
items: [
|
|
819
819
|
{
|
|
820
820
|
label: e(D.Config).getCountry().name,
|
|
@@ -828,7 +828,7 @@ const Nt = { class: "space-y-8" }, Dt = {
|
|
|
828
828
|
x("div", Wt, L(e(f)("connect.store.setting.stripe.title")), 1),
|
|
829
829
|
i(At, {
|
|
830
830
|
"model-value": (ae = e(o)) == null ? void 0 : ae.stripe,
|
|
831
|
-
"onUpdate:modelValue":
|
|
831
|
+
"onUpdate:modelValue": l[13] || (l[13] = (s) => e(o).stripe = s)
|
|
832
832
|
}, null, 8, ["model-value"])
|
|
833
833
|
])
|
|
834
834
|
])) : M("", !0)
|
|
@@ -853,14 +853,14 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
853
853
|
},
|
|
854
854
|
emits: ["update:modelValue"],
|
|
855
855
|
setup(v, { emit: _ }) {
|
|
856
|
-
const
|
|
856
|
+
const a = v, f = _;
|
|
857
857
|
fe(() => {
|
|
858
858
|
if (o.value.length !== b.value.length) {
|
|
859
859
|
const t = b.value.reduce((c, y) => {
|
|
860
860
|
const d = ne.systemDefaultCode(y.name);
|
|
861
861
|
if (!d) return c;
|
|
862
|
-
const { systemCode: V, taxCode:
|
|
863
|
-
return y.value || c.push({ systemCode: V, taxCode:
|
|
862
|
+
const { systemCode: V, taxCode: l } = d;
|
|
863
|
+
return y.value || c.push({ systemCode: V, taxCode: l }), c;
|
|
864
864
|
}, []);
|
|
865
865
|
u(t);
|
|
866
866
|
}
|
|
@@ -877,24 +877,24 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
877
877
|
label: `${c.name} (${it(c.rate)}%)`,
|
|
878
878
|
value: c.feedmeTaxCode
|
|
879
879
|
}))
|
|
880
|
-
}))), o = j(() =>
|
|
880
|
+
}))), o = j(() => a.modelValue.map((t) => ne.generateCode(t)));
|
|
881
881
|
function m(t) {
|
|
882
882
|
const c = r().find(
|
|
883
|
-
(
|
|
884
|
-
), y = c == null ? void 0 : c.options.find((
|
|
883
|
+
(l) => l.options.some((S) => S.feedmeTaxCode === t)
|
|
884
|
+
), y = c == null ? void 0 : c.options.find((l) => l.feedmeTaxCode === t);
|
|
885
885
|
if (!y) return;
|
|
886
886
|
const { systemCode: d, taxCode: V } = y;
|
|
887
887
|
u([{ systemCode: d, taxCode: V }]);
|
|
888
888
|
}
|
|
889
889
|
function u(t) {
|
|
890
|
-
const c = ue.clone(
|
|
890
|
+
const c = ue.clone(a.modelValue);
|
|
891
891
|
t.forEach((y) => {
|
|
892
892
|
const d = r().find(
|
|
893
893
|
(S) => S.options.some((w) => w.feedmeTaxCode === ne.generateCode(y))
|
|
894
|
-
), V = (d == null ? void 0 : d.options) || [],
|
|
894
|
+
), V = (d == null ? void 0 : d.options) || [], l = c.findIndex(
|
|
895
895
|
(S) => V.some((w) => ne.generateCode(w) === ne.generateCode(S))
|
|
896
896
|
);
|
|
897
|
-
|
|
897
|
+
l >= 0 ? c.splice(l, 1, y) : c.push(y);
|
|
898
898
|
}), f("update:modelValue", c);
|
|
899
899
|
}
|
|
900
900
|
return (t, c) => {
|
|
@@ -906,17 +906,17 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
906
906
|
i(d, {
|
|
907
907
|
modelValue: V.value,
|
|
908
908
|
"onUpdate:modelValue": [
|
|
909
|
-
(
|
|
910
|
-
c[0] || (c[0] = (
|
|
911
|
-
m(
|
|
909
|
+
(l) => V.value = l,
|
|
910
|
+
c[0] || (c[0] = (l) => {
|
|
911
|
+
m(l);
|
|
912
912
|
})
|
|
913
913
|
]
|
|
914
914
|
}, {
|
|
915
915
|
default: T(() => [
|
|
916
|
-
(g(!0), B(X, null, re(V.options, (
|
|
916
|
+
(g(!0), B(X, null, re(V.options, (l, S) => (g(), I(y, {
|
|
917
917
|
key: S,
|
|
918
|
-
value:
|
|
919
|
-
label:
|
|
918
|
+
value: l.value,
|
|
919
|
+
label: l.label
|
|
920
920
|
}, null, 8, ["value", "label"]))), 128))
|
|
921
921
|
]),
|
|
922
922
|
_: 2
|
|
@@ -953,12 +953,12 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
953
953
|
}, Qt = { class: "space-y-8" }, en = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, tn = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, nn = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, on = /* @__PURE__ */ x("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Taxes", -1), an = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, ln = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary !mb-[-16px]" }, sn = { class: "space-y-8" }, rn = { class: "flex items-center justify-between" }, dn = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, un = { class: "space-y-8" }, cn = { class: "flex items-center gap-8" }, mn = /* @__PURE__ */ ee({
|
|
954
954
|
__name: "EditBundleSheet",
|
|
955
955
|
emits: ["update"],
|
|
956
|
-
setup(v, { expose: _, emit:
|
|
957
|
-
const f =
|
|
956
|
+
setup(v, { expose: _, emit: a }) {
|
|
957
|
+
const f = a, { t: r } = be(), b = ke(), o = U(!1), m = U([]), u = U({
|
|
958
958
|
category: 0,
|
|
959
959
|
index: -1,
|
|
960
960
|
originalCategoryIndex: void 0
|
|
961
|
-
}), t =
|
|
961
|
+
}), t = U(ue.cloneDeep(Ve)), c = U(), y = Ae, d = j(() => {
|
|
962
962
|
const p = y.safeParse(t.value);
|
|
963
963
|
return p.success ? [] : p.error.errors;
|
|
964
964
|
}), V = [
|
|
@@ -982,9 +982,9 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
982
982
|
var C;
|
|
983
983
|
const n = p.row.original;
|
|
984
984
|
return n.collectible.type == "VOUCHER" || n.selectedReward == null ? n.description : qe(We.FmStepperField, {
|
|
985
|
-
"onUpdate:modelValue": (
|
|
985
|
+
"onUpdate:modelValue": (P) => {
|
|
986
986
|
t.value.titles = t.value.titles.map(
|
|
987
|
-
(E) => E.id == n.collectible._id ? { ...E, dayToExpire:
|
|
987
|
+
(E) => E.id == n.collectible._id ? { ...E, dayToExpire: P } : E
|
|
988
988
|
);
|
|
989
989
|
},
|
|
990
990
|
modelValue: ((C = n.selectedReward) == null ? void 0 : C.extra) ?? 0,
|
|
@@ -992,14 +992,14 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
992
992
|
helperState: J(d.value, "titles"),
|
|
993
993
|
helperText: G(d.value, "titles"),
|
|
994
994
|
max: 9999,
|
|
995
|
-
rules: [(
|
|
995
|
+
rules: [(P) => P <= 9999 || "Maximum 9999 days allowed"],
|
|
996
996
|
showSteppers: !1,
|
|
997
997
|
disabled: !!t.value.stripePriceId
|
|
998
998
|
});
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
|
-
],
|
|
1002
|
-
const n = w.value.find((
|
|
1001
|
+
], l = U([]), S = j(() => b.bundleRewards.map((p) => {
|
|
1002
|
+
const n = w.value.find((P) => P.id == p._id), C = p.type === "VOUCHER" ? `${p.options.maxUse} use(s), ${dt(
|
|
1003
1003
|
p.options.validityOption || {}
|
|
1004
1004
|
)}` : "No expiry";
|
|
1005
1005
|
return {
|
|
@@ -1032,20 +1032,20 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1032
1032
|
const p = S.value, n = t.value;
|
|
1033
1033
|
if (!(!n || !p))
|
|
1034
1034
|
for (let C = 0; C < p.length; C++) {
|
|
1035
|
-
const
|
|
1036
|
-
K.value[C] ?
|
|
1037
|
-
(H) => H.id ==
|
|
1035
|
+
const P = p[C];
|
|
1036
|
+
K.value[C] ? P.collectible.type == "TITLE" ? n.titles.findIndex(
|
|
1037
|
+
(H) => H.id == P.collectible._id
|
|
1038
1038
|
) < 0 && n.titles.push({
|
|
1039
|
-
id:
|
|
1039
|
+
id: P.collectible._id,
|
|
1040
1040
|
dayToExpire: A.value
|
|
1041
1041
|
}) : n.vouchers.findIndex(
|
|
1042
|
-
(H) => H ==
|
|
1043
|
-
) < 0 && n.vouchers.push(
|
|
1044
|
-
(q) => q !=
|
|
1042
|
+
(H) => H == P.collectible._id
|
|
1043
|
+
) < 0 && n.vouchers.push(P.collectible._id) : (n.titles = n.titles.filter((q) => q.id != P.collectible._id), n.vouchers = n.vouchers.filter(
|
|
1044
|
+
(q) => q != P.collectible._id
|
|
1045
1045
|
));
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
|
-
const K =
|
|
1048
|
+
const K = U({});
|
|
1049
1049
|
we(K, W, { deep: !0 });
|
|
1050
1050
|
const z = j(() => {
|
|
1051
1051
|
var p, n;
|
|
@@ -1061,17 +1061,17 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1061
1061
|
t.value.price,
|
|
1062
1062
|
Number(t.value.credit.normal),
|
|
1063
1063
|
((p = b.storeOption) == null ? void 0 : p.inclusiveTaxes) ?? [],
|
|
1064
|
-
(C = (n = b.storeOption) == null ? void 0 : n.company) != null && C.sstRegNo ? ne.taxSystem.map((
|
|
1064
|
+
(C = (n = b.storeOption) == null ? void 0 : n.company) != null && C.sstRegNo ? ne.taxSystem.map((P) => P.code) : []
|
|
1065
1065
|
);
|
|
1066
|
-
}),
|
|
1066
|
+
}), $ = j(() => s.value.reduce(
|
|
1067
1067
|
(n, C) => n.add(C.total),
|
|
1068
1068
|
rt()
|
|
1069
|
-
).toFormat()),
|
|
1070
|
-
var
|
|
1069
|
+
).toFormat()), R = j(() => {
|
|
1070
|
+
var P;
|
|
1071
1071
|
const p = pt(
|
|
1072
1072
|
s.value,
|
|
1073
1073
|
t.value.price,
|
|
1074
|
-
((
|
|
1074
|
+
((P = b.storeOption) == null ? void 0 : P.inclusiveTaxes) ?? []
|
|
1075
1075
|
);
|
|
1076
1076
|
t.value.priceWithTaxes = p;
|
|
1077
1077
|
const n = Gt(p, !1), C = Number(n.replace(/[^\d.-]/g, ""));
|
|
@@ -1080,11 +1080,11 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1080
1080
|
function O() {
|
|
1081
1081
|
t.value.taxTotals = s.value, f("update", Ae.parse(Je(t.value)));
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function k() {
|
|
1084
1084
|
return ue.cloneDeep(Ve);
|
|
1085
1085
|
}
|
|
1086
1086
|
function N(p, n) {
|
|
1087
|
-
o.value = p, p && n && (c.value = void 0, m.value = n.categories, t.value = n.bundle ||
|
|
1087
|
+
o.value = p, p && n && (c.value = void 0, m.value = n.categories, t.value = n.bundle || k(), u.value.category = n.category, u.value.index = n.index, u.value.originalCategoryIndex = n.category, K.value = S.value.reduce((C, P, E) => (C[E] = !!P.selectedReward, C), {}));
|
|
1088
1088
|
}
|
|
1089
1089
|
return _({
|
|
1090
1090
|
showSheet: N,
|
|
@@ -1092,7 +1092,7 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1092
1092
|
target: u,
|
|
1093
1093
|
data: t
|
|
1094
1094
|
}), (p, n) => {
|
|
1095
|
-
const C = h("FmSwitch"),
|
|
1095
|
+
const C = h("FmSwitch"), P = h("FmHelperText"), E = h("FmTextField"), q = h("FmSelect"), H = h("FmStepperField"), ie = h("FmMenuItem"), ge = h("FmTable"), ce = h("FmButton"), ve = h("FmSideSheet");
|
|
1096
1096
|
return g(), I(ve, {
|
|
1097
1097
|
"max-width": 768,
|
|
1098
1098
|
modelValue: e(o),
|
|
@@ -1130,7 +1130,7 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1130
1130
|
label: "Feedvibe Campaign",
|
|
1131
1131
|
sublabel: "Bundle will be appear for Feedvibe campaign use"
|
|
1132
1132
|
}, null, 8, ["model-value"])) : M("", !0),
|
|
1133
|
-
e(t).isFeedvibe ? (g(), I(
|
|
1133
|
+
e(t).isFeedvibe ? (g(), I(P, {
|
|
1134
1134
|
key: 1,
|
|
1135
1135
|
text: "There will be a 15% charge for FeedVibe bundles sold in the FeedVibe app",
|
|
1136
1136
|
state: "warning"
|
|
@@ -1301,13 +1301,13 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1301
1301
|
}, null, 8, ["modelValue"]),
|
|
1302
1302
|
i(E, {
|
|
1303
1303
|
label: `Tax Charged (${e(ae)})`,
|
|
1304
|
-
"model-value": e(
|
|
1304
|
+
"model-value": e($),
|
|
1305
1305
|
disabled: ""
|
|
1306
1306
|
}, null, 8, ["label", "model-value"])
|
|
1307
1307
|
], 64)) : M("", !0),
|
|
1308
1308
|
i(H, {
|
|
1309
1309
|
label: "Total Price",
|
|
1310
|
-
"model-value": e(
|
|
1310
|
+
"model-value": e(R),
|
|
1311
1311
|
disabled: !0
|
|
1312
1312
|
}, null, 8, ["model-value"]),
|
|
1313
1313
|
x("div", an, L(e(r)("connect.store.bundle.edit.bundleReward.title")), 1),
|
|
@@ -1315,15 +1315,15 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1315
1315
|
x("div", sn, [
|
|
1316
1316
|
x("div", rn, [
|
|
1317
1317
|
i(lt, {
|
|
1318
|
-
label: `Reward type: ${e(
|
|
1318
|
+
label: `Reward type: ${e(l).length == 0 ? "All" : e(l)[0].name}`
|
|
1319
1319
|
}, {
|
|
1320
1320
|
default: T(() => [
|
|
1321
1321
|
i(ie, {
|
|
1322
|
-
onClick: n[12] || (n[12] = (F) =>
|
|
1322
|
+
onClick: n[12] || (n[12] = (F) => l.value = []),
|
|
1323
1323
|
label: "All"
|
|
1324
1324
|
}),
|
|
1325
1325
|
i(ie, {
|
|
1326
|
-
onClick: n[13] || (n[13] = (F) =>
|
|
1326
|
+
onClick: n[13] || (n[13] = (F) => l.value = [
|
|
1327
1327
|
{
|
|
1328
1328
|
id: "type",
|
|
1329
1329
|
value: "VOUCHER",
|
|
@@ -1333,7 +1333,7 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1333
1333
|
label: e(me).VOUCHER.name
|
|
1334
1334
|
}, null, 8, ["label"]),
|
|
1335
1335
|
i(ie, {
|
|
1336
|
-
onClick: n[14] || (n[14] = (F) =>
|
|
1336
|
+
onClick: n[14] || (n[14] = (F) => l.value = [
|
|
1337
1337
|
{
|
|
1338
1338
|
id: "type",
|
|
1339
1339
|
value: "TITLE",
|
|
@@ -1350,14 +1350,14 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1350
1350
|
modelValue: e(K),
|
|
1351
1351
|
"onUpdate:modelValue": n[15] || (n[15] = (F) => oe(K) ? K.value = F : null),
|
|
1352
1352
|
selection: "multiple",
|
|
1353
|
-
"column-filter": e(
|
|
1353
|
+
"column-filter": e(l),
|
|
1354
1354
|
"column-defs": V,
|
|
1355
1355
|
"row-data": e(S).filter(
|
|
1356
1356
|
(F) => !e(t).isFeedvibe || F.collectible.type == "VOUCHER"
|
|
1357
1357
|
),
|
|
1358
1358
|
"hide-footer": e(S).length <= 10
|
|
1359
1359
|
}, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"]),
|
|
1360
|
-
i(
|
|
1360
|
+
i(P, {
|
|
1361
1361
|
text: e(G)(e(d), "titles"),
|
|
1362
1362
|
state: e(J)(e(d), "titles")
|
|
1363
1363
|
}, null, 8, ["text", "state"])
|
|
@@ -1396,9 +1396,9 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1396
1396
|
}), pn = { class: "flex gap-8 items-center flex-wrap" }, yn = { class: "flex items-center gap-8" }, fn = /* @__PURE__ */ ee({
|
|
1397
1397
|
__name: "SendBundleSheet",
|
|
1398
1398
|
emits: ["success"],
|
|
1399
|
-
setup(v, { expose: _, emit:
|
|
1400
|
-
const { minor: f } = Ee, r =
|
|
1401
|
-
|
|
1399
|
+
setup(v, { expose: _, emit: a }) {
|
|
1400
|
+
const { minor: f } = Ee, r = U(), b = U(""), o = U(""), m = U([]), u = U(!1), t = U();
|
|
1401
|
+
U(!0);
|
|
1402
1402
|
function c(S) {
|
|
1403
1403
|
u.value = !0, b.value = null, o.value = "", r.value = S.bundle;
|
|
1404
1404
|
}
|
|
@@ -1445,7 +1445,7 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1445
1445
|
}
|
|
1446
1446
|
);
|
|
1447
1447
|
}
|
|
1448
|
-
const
|
|
1448
|
+
const l = j(() => {
|
|
1449
1449
|
var w, A, Y;
|
|
1450
1450
|
const S = [];
|
|
1451
1451
|
return ((w = r.value) == null ? void 0 : w.price.amount) > 0 && S.push(
|
|
@@ -1458,37 +1458,37 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1458
1458
|
}), fe(async () => {
|
|
1459
1459
|
await d("");
|
|
1460
1460
|
}), (S, w) => {
|
|
1461
|
-
const A = h("FmCardMedia"), Y = h("FmCardHeader"), W = h("FmChip"), K = h("FmCardSection"), z = h("FmCard"), ae = h("FmSelect"), s = h("FmTextField"),
|
|
1461
|
+
const A = h("FmCardMedia"), Y = h("FmCardHeader"), W = h("FmChip"), K = h("FmCardSection"), z = h("FmCard"), ae = h("FmSelect"), s = h("FmTextField"), $ = h("FmForm"), R = h("FmButton"), O = h("FmSideSheet");
|
|
1462
1462
|
return g(), I(O, {
|
|
1463
1463
|
"max-width": 560,
|
|
1464
1464
|
"dismiss-away": !0,
|
|
1465
1465
|
header: "Send bundle to member",
|
|
1466
1466
|
modelValue: e(u),
|
|
1467
1467
|
"onUpdate:modelValue": [
|
|
1468
|
-
w[4] || (w[4] = (
|
|
1469
|
-
w[5] || (w[5] = (
|
|
1468
|
+
w[4] || (w[4] = (k) => oe(u) ? u.value = k : null),
|
|
1469
|
+
w[5] || (w[5] = (k) => u.value = k)
|
|
1470
1470
|
]
|
|
1471
1471
|
}, {
|
|
1472
1472
|
"side-sheet-footer": T(() => [
|
|
1473
1473
|
x("div", yn, [
|
|
1474
|
-
i(
|
|
1474
|
+
i(R, {
|
|
1475
1475
|
label: "Send",
|
|
1476
1476
|
loading: e(Se)().isLoading,
|
|
1477
1477
|
onClick: w[2] || (w[2] = async () => {
|
|
1478
|
-
var
|
|
1479
|
-
return (
|
|
1478
|
+
var k;
|
|
1479
|
+
return (k = e(t)) == null ? void 0 : k.validateInputs();
|
|
1480
1480
|
})
|
|
1481
1481
|
}, null, 8, ["loading"]),
|
|
1482
|
-
i(
|
|
1482
|
+
i(R, {
|
|
1483
1483
|
label: "Cancel",
|
|
1484
1484
|
type: "button",
|
|
1485
1485
|
variant: "tertiary",
|
|
1486
|
-
onClick: w[3] || (w[3] = (
|
|
1486
|
+
onClick: w[3] || (w[3] = (k) => u.value = !1)
|
|
1487
1487
|
})
|
|
1488
1488
|
])
|
|
1489
1489
|
]),
|
|
1490
1490
|
default: T(() => [
|
|
1491
|
-
i(
|
|
1491
|
+
i($, {
|
|
1492
1492
|
class: "space-y-16",
|
|
1493
1493
|
ref_key: "form",
|
|
1494
1494
|
ref: t,
|
|
@@ -1502,9 +1502,9 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1502
1502
|
variant: "outlined"
|
|
1503
1503
|
}, {
|
|
1504
1504
|
default: T(() => {
|
|
1505
|
-
var
|
|
1505
|
+
var k, N;
|
|
1506
1506
|
return [
|
|
1507
|
-
(
|
|
1507
|
+
(k = e(r)) != null && k.image ? (g(), I(A, {
|
|
1508
1508
|
key: 0,
|
|
1509
1509
|
width: "100",
|
|
1510
1510
|
src: (N = e(r)) == null ? void 0 : N.image
|
|
@@ -1516,18 +1516,18 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1516
1516
|
i(Y, {
|
|
1517
1517
|
class: "p-0",
|
|
1518
1518
|
title: (p = e(r)) == null ? void 0 : p.name,
|
|
1519
|
-
subtitle: e(
|
|
1519
|
+
subtitle: e(l)
|
|
1520
1520
|
}, null, 8, ["title", "subtitle"]),
|
|
1521
1521
|
i(K, { class: "p-0" }, {
|
|
1522
1522
|
default: T(() => {
|
|
1523
|
-
var n, C,
|
|
1523
|
+
var n, C, P, E, q, H, ie, ge, ce, ve, le;
|
|
1524
1524
|
return [
|
|
1525
1525
|
x("div", pn, [
|
|
1526
1526
|
(n = e(r)) != null && n.isFeedvibe ? (g(), I(W, {
|
|
1527
1527
|
key: 0,
|
|
1528
1528
|
label: "Feedvibe"
|
|
1529
1529
|
})) : M("", !0),
|
|
1530
|
-
(
|
|
1530
|
+
(P = (C = e(r)) == null ? void 0 : C.titles) != null && P.length ? (g(), I(W, {
|
|
1531
1531
|
key: 1,
|
|
1532
1532
|
label: `${e(r).titles.length} title(s)`
|
|
1533
1533
|
}, null, 8, ["label"])) : M("", !0),
|
|
@@ -1554,20 +1554,20 @@ const Xt = /* @__PURE__ */ ee({
|
|
|
1554
1554
|
}),
|
|
1555
1555
|
i(ae, {
|
|
1556
1556
|
modelValue: e(b),
|
|
1557
|
-
"onUpdate:modelValue": w[0] || (w[0] = (
|
|
1557
|
+
"onUpdate:modelValue": w[0] || (w[0] = (k) => oe(b) ? b.value = k : null),
|
|
1558
1558
|
label: "Select member",
|
|
1559
1559
|
searchable: "",
|
|
1560
1560
|
items: e(m),
|
|
1561
1561
|
onSearch: d,
|
|
1562
|
-
rules: [(
|
|
1562
|
+
rules: [(k) => !!k > 0 || "Member is required"],
|
|
1563
1563
|
"helper-text": "Type to search member"
|
|
1564
1564
|
}, null, 8, ["modelValue", "items", "rules"]),
|
|
1565
1565
|
i(s, {
|
|
1566
1566
|
modelValue: e(o),
|
|
1567
|
-
"onUpdate:modelValue": w[1] || (w[1] = (
|
|
1567
|
+
"onUpdate:modelValue": w[1] || (w[1] = (k) => oe(o) ? o.value = k : null),
|
|
1568
1568
|
label: "Reference (optional)",
|
|
1569
1569
|
rules: [
|
|
1570
|
-
(
|
|
1570
|
+
(k) => k.length < 50 || "Reference must be less than 50 characters"
|
|
1571
1571
|
]
|
|
1572
1572
|
}, null, 8, ["modelValue", "rules"])
|
|
1573
1573
|
]),
|
|
@@ -1590,131 +1590,131 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1590
1590
|
label: "Setup payout account",
|
|
1591
1591
|
value: "payout",
|
|
1592
1592
|
isPrimary: !1
|
|
1593
|
-
}, { t:
|
|
1594
|
-
label:
|
|
1593
|
+
}, { t: a } = be(), f = {
|
|
1594
|
+
label: a("connect.store.actions.setting"),
|
|
1595
1595
|
value: "setting",
|
|
1596
1596
|
isPrimary: !1
|
|
1597
1597
|
}, r = {
|
|
1598
|
-
label:
|
|
1598
|
+
label: a("connect.store.actions.manageReward"),
|
|
1599
1599
|
value: "create_reward"
|
|
1600
1600
|
}, b = {
|
|
1601
|
-
label:
|
|
1601
|
+
label: a("connect.store.actions.addCategory"),
|
|
1602
1602
|
value: "create_category",
|
|
1603
1603
|
isPrimary: !0,
|
|
1604
1604
|
prependIcon: "add"
|
|
1605
|
-
}, o =
|
|
1605
|
+
}, o = U(), m = ct(), u = ke(), { global: t, minor: c } = Ee, y = Me(), d = j(() => u.sortedStoreCategories), V = j(() => u.sortedStoreCategories.map((s) => s.name)), l = U(), S = U();
|
|
1606
1606
|
async function w(s) {
|
|
1607
|
-
var
|
|
1608
|
-
s === "setting" ? (
|
|
1607
|
+
var $;
|
|
1608
|
+
s === "setting" ? ($ = l.value) == null || $.showSheet(!0, u.storeOption) : s === "create_category" ? Y(-1) : s === "create_reward" ? await m.push({ name: Ge["$connect-STORE_REWARDS"] }) : s == "payout" && window.open(bn.paymentPortalUrl, "_blank");
|
|
1609
1609
|
}
|
|
1610
1610
|
async function A(s) {
|
|
1611
1611
|
await c(
|
|
1612
1612
|
async () => {
|
|
1613
|
-
var
|
|
1614
|
-
await Ce.updateStore(s), await u.readMemberStore(), (
|
|
1613
|
+
var $;
|
|
1614
|
+
await Ce.updateStore(s), await u.readMemberStore(), ($ = l.value) == null || $.showSheet(!1);
|
|
1615
1615
|
},
|
|
1616
1616
|
{
|
|
1617
|
-
message:
|
|
1618
|
-
successMessage:
|
|
1617
|
+
message: a("connect.store.setting.update.message"),
|
|
1618
|
+
successMessage: a("connect.store.setting.update.success")
|
|
1619
1619
|
}
|
|
1620
1620
|
);
|
|
1621
1621
|
}
|
|
1622
1622
|
async function Y(s = -1) {
|
|
1623
|
-
var
|
|
1623
|
+
var $, R;
|
|
1624
1624
|
if ((!u.storeOption || !u.storeOption.company) && await xe.confirm(
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1625
|
+
a("connect.store.category.setup.title"),
|
|
1626
|
+
a("connect.store.category.setup.button"),
|
|
1627
|
+
a("connect.store.category.setup.action"),
|
|
1628
|
+
a("connect.common.cancel")
|
|
1629
1629
|
))
|
|
1630
|
-
return (
|
|
1630
|
+
return ($ = l.value) == null ? void 0 : $.showSheet(!0);
|
|
1631
1631
|
y.open({
|
|
1632
|
-
title: s == -1 ?
|
|
1632
|
+
title: s == -1 ? a("connect.store.category.add") : a("connect.store.category.edit"),
|
|
1633
1633
|
contentComponent: kt,
|
|
1634
1634
|
contentComponentProps: {
|
|
1635
|
-
initialValue: ((
|
|
1635
|
+
initialValue: ((R = d.value[s]) == null ? void 0 : R.name) ?? "",
|
|
1636
1636
|
action: s == -1 ? "add" : "edit"
|
|
1637
1637
|
}
|
|
1638
1638
|
}).onPrimary(async (O) => {
|
|
1639
1639
|
O === null && !await xe.remove(
|
|
1640
|
-
|
|
1641
|
-
|
|
1640
|
+
a("connect.store.category.remove.confirm"),
|
|
1641
|
+
a("connect.store.category.remove.title")
|
|
1642
1642
|
) || await c(
|
|
1643
1643
|
async () => {
|
|
1644
|
-
const
|
|
1644
|
+
const k = s == -1 ? [...d.value, { name: O, bundles: [] }] : [...d.value].map((N, p) => p == s ? { ...N, name: O } : N).filter((N) => N.name !== null);
|
|
1645
1645
|
await Ce.updateStoreBundle({
|
|
1646
|
-
categories:
|
|
1646
|
+
categories: k
|
|
1647
1647
|
}), await u.readMemberStore();
|
|
1648
1648
|
},
|
|
1649
1649
|
{
|
|
1650
|
-
message: O === null ?
|
|
1651
|
-
successMessage: O === null ?
|
|
1650
|
+
message: O === null ? a("connect.store.category.update.deleting") : s == -1 ? a("connect.store.category.update.creating") : a("connect.store.category.update.updating"),
|
|
1651
|
+
successMessage: O === null ? a("connect.store.category.update.success.deleted") : s == -1 ? a("connect.store.category.update.success.created") : a("connect.store.category.update.success.updated")
|
|
1652
1652
|
}
|
|
1653
1653
|
);
|
|
1654
1654
|
});
|
|
1655
1655
|
}
|
|
1656
|
-
async function W(s,
|
|
1656
|
+
async function W(s, $, R, O) {
|
|
1657
1657
|
var p, n, C;
|
|
1658
|
-
|
|
1659
|
-
const
|
|
1660
|
-
for (const
|
|
1661
|
-
for (const E of
|
|
1658
|
+
$ ?? ($ = (p = S.value) == null ? void 0 : p.target.category), R ?? (R = (n = S.value) == null ? void 0 : n.target.index), O ?? (O = (C = S.value) == null ? void 0 : C.target.originalCategoryIndex);
|
|
1659
|
+
const k = De(d.value);
|
|
1660
|
+
for (const P of k)
|
|
1661
|
+
for (const E of P.bundles)
|
|
1662
1662
|
console.log(E, "bundle in payload"), "pf_vouchers" in E && delete E.pf_vouchers;
|
|
1663
|
-
|
|
1664
|
-
const N =
|
|
1663
|
+
$ != O && O != null && (k[O].bundles.splice(R, 1), R = k[$].bundles.length);
|
|
1664
|
+
const N = k[$];
|
|
1665
1665
|
if (!N) {
|
|
1666
1666
|
nt.error("Unexpected error", 2e3);
|
|
1667
1667
|
return;
|
|
1668
1668
|
}
|
|
1669
1669
|
if (s == null) {
|
|
1670
1670
|
if (await xe.remove(
|
|
1671
|
-
"
|
|
1672
|
-
"
|
|
1671
|
+
a("connect.store.bundle.delete.confirm"),
|
|
1672
|
+
a("connect.store.bundle.delete.title")
|
|
1673
1673
|
) == !1)
|
|
1674
1674
|
return;
|
|
1675
|
-
N.bundles.splice(
|
|
1675
|
+
N.bundles.splice(R, 1);
|
|
1676
1676
|
} else
|
|
1677
|
-
|
|
1677
|
+
R == -1 ? N.bundles.push(s) : N.bundles[R] = s;
|
|
1678
1678
|
await c(
|
|
1679
1679
|
async () => {
|
|
1680
|
-
var
|
|
1680
|
+
var P, E;
|
|
1681
1681
|
if (s != null) {
|
|
1682
|
-
const q = (
|
|
1682
|
+
const q = (P = S.value) == null ? void 0 : P.bundleImage;
|
|
1683
1683
|
q === null && s.image ? (await Fe.delete(s.image), s.image = null) : q && (s.image = await Fe.update(
|
|
1684
1684
|
Fe.bundleImagePath(void 0, q),
|
|
1685
1685
|
q
|
|
1686
1686
|
));
|
|
1687
1687
|
}
|
|
1688
1688
|
await Ce.updateStoreBundle({
|
|
1689
|
-
categories:
|
|
1689
|
+
categories: k
|
|
1690
1690
|
}), await u.readMemberStore(), await u.readMembership(), await u.readRewards(), (E = S.value) == null || E.showSheet(!1);
|
|
1691
1691
|
},
|
|
1692
1692
|
{
|
|
1693
|
-
message: `${s == null ? "Deleting" :
|
|
1694
|
-
successMessage: `Bundle ${s == null ? "deleted" :
|
|
1693
|
+
message: `${s == null ? "Deleting" : R == -1 ? "Creating" : "Updating"} bundle`,
|
|
1694
|
+
successMessage: `Bundle ${s == null ? "deleted" : R == -1 ? "created" : "updated"} successfully`
|
|
1695
1695
|
}
|
|
1696
1696
|
);
|
|
1697
1697
|
}
|
|
1698
1698
|
function K(s) {
|
|
1699
|
-
var
|
|
1700
|
-
(
|
|
1699
|
+
var $;
|
|
1700
|
+
($ = S.value) == null || $.showSheet(!0, {
|
|
1701
1701
|
...s,
|
|
1702
1702
|
bundle: s.bundle ? De(s.bundle) : void 0
|
|
1703
1703
|
});
|
|
1704
1704
|
}
|
|
1705
|
-
const z =
|
|
1705
|
+
const z = U([]);
|
|
1706
1706
|
function ae(s) {
|
|
1707
|
-
var
|
|
1708
|
-
(
|
|
1707
|
+
var $;
|
|
1708
|
+
($ = o.value) == null || $.showSheet({
|
|
1709
1709
|
bundle: s
|
|
1710
1710
|
});
|
|
1711
1711
|
}
|
|
1712
1712
|
return fe(async () => {
|
|
1713
|
-
var
|
|
1713
|
+
var $, R;
|
|
1714
1714
|
await t(async () => {
|
|
1715
|
-
var O,
|
|
1715
|
+
var O, k;
|
|
1716
1716
|
if (await u.readMemberStore(), await u.readMembership(), await u.readRewards(), await u.readPayoutAccount(), (O = m.currentRoute.value.query) != null && O.action) {
|
|
1717
|
-
switch ((
|
|
1717
|
+
switch ((k = m.currentRoute.value.query) == null ? void 0 : k.action) {
|
|
1718
1718
|
case "update_setting":
|
|
1719
1719
|
w("setting");
|
|
1720
1720
|
break;
|
|
@@ -1745,18 +1745,18 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1745
1745
|
m.replace({ query: {} });
|
|
1746
1746
|
}
|
|
1747
1747
|
});
|
|
1748
|
-
const s = ((
|
|
1748
|
+
const s = (($ = u.payoutAccount) == null ? void 0 : $.status) === "APPROVED" && ((R = u.payoutAccount) == null ? void 0 : R.enable) === !0;
|
|
1749
1749
|
z.value = [
|
|
1750
1750
|
...s ? [] : [_],
|
|
1751
1751
|
f,
|
|
1752
1752
|
r,
|
|
1753
1753
|
b
|
|
1754
1754
|
];
|
|
1755
|
-
}), (s,
|
|
1756
|
-
const
|
|
1755
|
+
}), (s, $) => {
|
|
1756
|
+
const R = h("FmPageHead"), O = h("FmButton"), k = h("FmCard");
|
|
1757
1757
|
return g(), B(X, null, [
|
|
1758
|
-
i(
|
|
1759
|
-
title: e(
|
|
1758
|
+
i(R, {
|
|
1759
|
+
title: e(a)("connect.store.title"),
|
|
1760
1760
|
actions: e(z),
|
|
1761
1761
|
"onClick:action": w
|
|
1762
1762
|
}, null, 8, ["title", "actions"]),
|
|
@@ -1780,13 +1780,13 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1780
1780
|
(g(!0), B(X, null, re(N.bundles, (n, C) => (g(), I(Ct, {
|
|
1781
1781
|
bundle: n,
|
|
1782
1782
|
key: n._id,
|
|
1783
|
-
onEdit: (
|
|
1783
|
+
onEdit: (P) => K({
|
|
1784
1784
|
bundle: n,
|
|
1785
1785
|
category: p,
|
|
1786
1786
|
index: C,
|
|
1787
1787
|
categories: e(V)
|
|
1788
1788
|
}),
|
|
1789
|
-
onDelete: (
|
|
1789
|
+
onDelete: (P) => W(null, p, C),
|
|
1790
1790
|
onSend: ae
|
|
1791
1791
|
}, null, 8, ["bundle", "onEdit", "onDelete"]))), 128)),
|
|
1792
1792
|
i(St, {
|
|
@@ -1803,7 +1803,7 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1803
1803
|
ref: S,
|
|
1804
1804
|
onUpdate: W
|
|
1805
1805
|
}, null, 512)
|
|
1806
|
-
], 64)) : (g(), I(
|
|
1806
|
+
], 64)) : (g(), I(k, {
|
|
1807
1807
|
key: 1,
|
|
1808
1808
|
variant: "outlined",
|
|
1809
1809
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
@@ -1811,21 +1811,21 @@ const gn = { class: "px-24 flex flex-col gap-y-16" }, vn = { class: "flex gap-8
|
|
|
1811
1811
|
default: T(() => [
|
|
1812
1812
|
xn,
|
|
1813
1813
|
x("div", Cn, [
|
|
1814
|
-
x("div", Sn, L(e(
|
|
1815
|
-
x("div", Fn, L(e(
|
|
1814
|
+
x("div", Sn, L(e(a)("connect.store.bundle.title")), 1),
|
|
1815
|
+
x("div", Fn, L(e(a)("connect.store.bundle.description")), 1)
|
|
1816
1816
|
]),
|
|
1817
1817
|
i(O, {
|
|
1818
1818
|
variant: "primary",
|
|
1819
|
-
label: e(
|
|
1819
|
+
label: e(a)("connect.store.actions.addCategory"),
|
|
1820
1820
|
icon: "add",
|
|
1821
|
-
onClick:
|
|
1821
|
+
onClick: $[0] || ($[0] = (N) => Y(-1))
|
|
1822
1822
|
}, null, 8, ["label"])
|
|
1823
1823
|
]),
|
|
1824
1824
|
_: 1
|
|
1825
1825
|
})),
|
|
1826
1826
|
i(Jt, {
|
|
1827
1827
|
ref_key: "settingSheetRef",
|
|
1828
|
-
ref:
|
|
1828
|
+
ref: l,
|
|
1829
1829
|
onUpdate: A
|
|
1830
1830
|
}, null, 512),
|
|
1831
1831
|
i(fn, {
|