@feedmepos/mf-connect 0.1.37-prod → 0.1.38-beta.2
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-BjSfI2Ff.js +761 -0
- package/dist/{App-Bpo0XZSs.js → App-D11A2JY1.js} +364 -352
- package/dist/AuditLogs-DWCFYoRg.js +1887 -0
- package/dist/{Bin-ohZ2CZZR.js → Bin-9wV4Ah3M.js} +8 -8
- package/dist/{Broadcast-D5x0_-zC.js → Broadcast-I3BtSk8V.js} +40 -40
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CYb38NXA.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-XJqTXbKr.js} +18 -18
- package/dist/{Card-BM-Lrm5y.js → Card-CqALG5RM.js} +159 -159
- package/dist/{Collections-Cr4aoJer.js → Collections-rg3SzoUb.js} +103 -91
- package/dist/{Credit-DzDVFv4H.js → Credit-BNn1sYZv.js} +74 -74
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bs8o9n1V.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-PJ8q72XH.js} +491 -488
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-koqrPPqM.js → EffectSheet.vue_vue_type_style_index_0_lang-Sww7KNle.js} +91 -89
- package/dist/{Experience-CjaDdbvZ.js → Experience-D_Qm8SUj.js} +41 -41
- package/dist/{FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js → FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js} +2 -6
- package/dist/{Game-BuiTygow.js → Game-CKXgXm6Q.js} +31 -31
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
- package/dist/{Index-CQGzUU-w.js → Index-D4DGfUHd.js} +10 -10
- package/dist/Marketing-Dn9A1vgH.js +20073 -0
- package/dist/Member-B55vWHDd.js +279 -0
- package/dist/MemberList-BWTG9Ohy.js +1606 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/{MemberTransactions-DzG1fY0c.js → MemberTransactions-CP5EI-W0.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-D--_An-f.js +60279 -0
- package/dist/{Mission-BtypT2uF.js → Mission-CFvhROuB.js} +21 -21
- package/dist/{Overview-Be7bUtRO.js → Overview-4273yNwL.js} +335 -335
- package/dist/{Point-Bw4lnLqp.js → Point-B_-_C919.js} +41 -41
- package/dist/Promotion-D2S3COxk.js +289 -0
- package/dist/{Queue-CpPEVgn8.js → Queue-BmS1Oi-C.js} +52 -52
- package/dist/{Record-DQq4P69i.js → Record-DRBl0M8g.js} +9 -9
- package/dist/{Reward-DJH0eM8u.js → Reward-8056NmfK.js} +173 -173
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-_kw_PR0h.js → RewardGroup.vue_vue_type_script_setup_true_lang-CJ_WC2gV.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CRGep1RK.js → RuleGroup.vue_vue_type_script_setup_true_lang-DqNQl_nz.js} +635 -548
- package/dist/Segment-Bzq-pyhc.js +882 -0
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Dx6Ew9Z_.js → SelectItems.vue_vue_type_script_setup_true_lang-4nNkkklE.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B60_8Toi.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dnf2oxOG.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BCaJ3xKT.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLYP-5U9.js} +3 -3
- package/dist/{Setting-GRIUo7vg.js → Setting-BrJfYoru.js} +432 -432
- package/dist/{Store-H0UDQpln.js → Store-Bpl_4yZW.js} +211 -211
- package/dist/StoreRewards-Cu7n7Pjz.js +423 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-T3Wo2maC.js +1029 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jL1oGS.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-QucRaI08.js} +1 -1
- package/dist/{Tier-CJufQcIz.js → Tier-_LnXg3n6.js} +106 -106
- package/dist/{Title-BBMgGUld.js → Title-B7AGStvx.js} +133 -131
- package/dist/{Transaction-DsucPnfp.js → Transaction-Chxv6V7u.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CwOcZEQX.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CzXNmobp.js} +6 -6
- package/dist/{Voucher-BPvxKO_w.js → Voucher-C5z2kOq9.js} +153 -123
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DdGMrk2C.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DMs4XKXM.js → ZodTextField.vue_vue_type_script_setup_true_lang-BlXzEWA6.js} +1 -1
- package/dist/{app-D3MT1deX.js → app-7cvPyHJ7.js} +164 -125
- package/dist/{app-Bo0JpadQ.js → app-BVojNX0w.js} +1 -1
- package/dist/app.js +4 -3
- package/dist/business-CmxV69wT.js +79 -0
- package/dist/{campaign-Z3l7BoMg.js → campaign-CT_cNJEL.js} +9 -9
- package/dist/{campaign-j1c3ou7l.js → campaign-Dq5C_no-.js} +5 -3
- package/dist/{campaign.enum-CVXPc5Pd.js → campaign.enum-dp7yHKzF.js} +1 -1
- package/dist/campaign.fn-BYZgKDN7.js +758 -0
- package/dist/{collectible.enum-CDSikBAy.js → collectible.enum-DxbB4DxT.js} +1 -1
- package/dist/{collection.fn-Bz38mGMa.js → collection.fn-CNZRdUgy.js} +2 -2
- package/dist/{dto-D648NN4s.js → dto-CT9zZbv9.js} +4 -4
- package/dist/{effect-DbMAmVSR.js → effect-FIlOEC4H.js} +1 -1
- package/dist/{email-addresses-KOVDrRiK.js → email-addresses-Ba7xImfX.js} +1 -1
- package/dist/{export-cTZf8Avd.js → export-uzjZFNF9.js} +3 -3
- package/dist/{helper-BYyfcLqw.js → helper-D4sAZde0.js} +1 -1
- package/dist/{index-BIaCtk8e.js → index-B9pl4zRZ.js} +192 -79
- package/dist/{index-B4MqsaBz.js → index-BI3m1Ehv.js} +3 -3
- package/dist/{index-E-0tTd0_.js → index-BXz54M1s.js} +1 -1
- package/dist/{index-BMl2KZts.js → index-BjU8LVUC.js} +11447 -10969
- package/dist/index-CH3z92VV.js +31 -0
- package/dist/{index-BTb8I_eB.js → index-CNJLP3D5.js} +1 -1
- package/dist/{index-BrKXRxe_.js → index-CONvJfKv.js} +1 -1
- package/dist/index-CS3Jmojj.js +32260 -0
- package/dist/{index-CTPMbFf5.js → index-CUfS9Kp1.js} +10 -9
- package/dist/index-CsaQJMAR.js +66 -0
- package/dist/{index-nF9iYTlh.js → index-CvBcve-r.js} +1 -1
- package/dist/index-CwsMG2cV.js +56 -0
- package/dist/{index-B3p0hmIV.js → index-D5rvMvzx.js} +1 -1
- package/dist/{index-CvoShC5J.js → index-DNxa8Rqx.js} +536 -461
- package/dist/{index-DPBHiqsJ.js → index-l2F5MnLF.js} +1 -1
- package/dist/{index.esm2017-DFYwde30.js → index.esm2017-ATcsD5N4.js} +127 -127
- package/dist/{loading-vUArhX_O.js → loading-BWGQSrCB.js} +1 -1
- package/dist/{membership-BHKv29yt.js → membership-Cc4OZ8-U.js} +3 -3
- package/dist/{money-Bl3_QRkE.js → money-D7p8nfun.js} +1 -1
- package/dist/{number-hh_S9w7k.js → number-CMJjC4qz.js} +1 -1
- package/dist/objectid-D5T27iny.js +145 -0
- package/dist/{plugins-CVes2wzE.js → plugins-eQis66QR.js} +2 -2
- package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
- package/dist/{reward-ANZOdWzf.js → reward-DrnzbG20.js} +1 -1
- package/dist/{rule-BvFk5bQg.js → rule-CtRxkYXB.js} +3 -3
- package/dist/{rule-builder-BSN777PN.js → rule-builder-Di9RIYHF.js} +17 -17
- package/dist/style.css +1 -1
- package/dist/{template-Dh9lDLs_.js → template-C3UfY0v5.js} +64 -64
- package/dist/{trigger-C7THbt7R.js → trigger-C9U7Zgad.js} +7 -7
- package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
- package/dist/{user-DtNR9JY2.js → user-D7n9yYmO.js} +1 -1
- package/dist/{vue-i18n-BWyHnm4m.js → vue-i18n-Bz45zC04.js} +387 -387
- package/dist/{xlsx-7u9SB0oa.js → xlsx-D4S4qbcZ.js} +226 -226
- package/package.json +9 -3
- package/dist/Analytic-CavR2bzs.js +0 -427
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
- package/dist/Marketing-BSspYuhg.js +0 -319
- package/dist/Member-B4S0UNGq.js +0 -287
- package/dist/MemberList-CfnUJ3mh.js +0 -1606
- package/dist/MemberOverview-C2n9oJZh.js +0 -58
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-hZUWLTWj.js +0 -455
- package/dist/Promotion-Bg6x0rAh.js +0 -255
- package/dist/Segment-BLB4VWNJ.js +0 -882
- package/dist/StoreRewards--TNIFaCo.js +0 -423
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CfB8tA5l.js +0 -995
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Bg-9YqLP.js +0 -419
- package/dist/business-DMALI7ZO.js +0 -78
- package/dist/campaign.fn-rsRhHYZP.js +0 -758
- package/dist/index-BsCGyJMY.js +0 -29566
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-DFKmjCG1.js +0 -44
- package/dist/index-Dbd4WA4r.js +0 -61
- package/dist/objectid-CEyMlMge.js +0 -145
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
import { defineComponent as G, ref as F, computed as N, onMounted as q, resolveComponent as v, openBlock as d, createBlock as x, unref as e, isRef as Y, withCtx as S, createElementVNode as l, createVNode as m, createElementBlock as O, createTextVNode as z, resolveDynamicComponent as H, toDisplayString as P, Fragment as j, createCommentVNode as U, h as C } from "vue";
|
|
2
|
-
import { _ as J } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { useDialog as Q, components as $ } from "@feedmepos/ui-library";
|
|
4
|
-
import "./index-BTb8I_eB.js";
|
|
5
|
-
import { u as X } from "./loading-vUArhX_O.js";
|
|
6
|
-
import { C as Z, u as ee } from "./membership-BHKv29yt.js";
|
|
7
|
-
import { p as M, f as B } from "./plugins-CVes2wzE.js";
|
|
8
|
-
import { u as te } from "./vue-i18n-BWyHnm4m.js";
|
|
9
|
-
import { F as oe } from "./index-CTPMbFf5.js";
|
|
10
|
-
import { c as ae } from "./object-qECH92oz.js";
|
|
11
|
-
import { u as K } from "./app-wDQR6dpb.js";
|
|
12
|
-
import { u as ne } from "./business-DMALI7ZO.js";
|
|
13
|
-
import { useCoreStore as se } from "@feedmepos/mf-common";
|
|
14
|
-
import { Z as R } from "./zod-Bg2FbC-D.js";
|
|
15
|
-
import { _ as ie } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DMs4XKXM.js";
|
|
16
|
-
import { _ as re } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
17
|
-
import { _ as le } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jL1oGS.js";
|
|
18
|
-
import { _ as ce, a as me } from "./EffectSheet.vue_vue_type_style_index_0_lang-koqrPPqM.js";
|
|
19
|
-
import { i as de, t as ue } from "./helper-BYyfcLqw.js";
|
|
20
|
-
import { useRouter as pe } from "vue-router";
|
|
21
|
-
import { m as D } from "./index-DPBHiqsJ.js";
|
|
22
|
-
import { R as k } from "./app-D3MT1deX.js";
|
|
23
|
-
const fe = {
|
|
24
|
-
key: 0,
|
|
25
|
-
class: "flex flex-col space-y-16 pr-12"
|
|
26
|
-
}, ye = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, ge = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, we = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), _e = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1), ve = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), Re = { class: "flex items-center gap-8" }, be = /* @__PURE__ */ G({
|
|
27
|
-
__name: "EditRewardSheet",
|
|
28
|
-
emits: ["update"],
|
|
29
|
-
setup(W, { expose: n, emit: T }) {
|
|
30
|
-
const A = T, y = ne(), I = se(), b = F(!1), o = F(), g = F(), u = oe, p = N(
|
|
31
|
-
() => {
|
|
32
|
-
var r;
|
|
33
|
-
return Z[((r = o.value) == null ? void 0 : r.type) || "VOUCHER"];
|
|
34
|
-
}
|
|
35
|
-
), w = N(() => {
|
|
36
|
-
const r = u.safeParse(o.value);
|
|
37
|
-
return r.success ? [] : r.error.errors;
|
|
38
|
-
});
|
|
39
|
-
function L() {
|
|
40
|
-
const r = u.safeParse(o.value);
|
|
41
|
-
r.success && A("update", r.data);
|
|
42
|
-
}
|
|
43
|
-
function V(r, s, t = {
|
|
44
|
-
isStoreReward: !1,
|
|
45
|
-
type: "VOUCHER"
|
|
46
|
-
}) {
|
|
47
|
-
b.value = r, r && (g.value = void 0, o.value = s || de(t.type, {
|
|
48
|
-
business: I.currentBusiness.value._id,
|
|
49
|
-
noCampaign: t.isStoreReward == !0
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
return q(async () => {
|
|
53
|
-
await y.readLocations();
|
|
54
|
-
}), n({
|
|
55
|
-
showSheet: V,
|
|
56
|
-
data: o,
|
|
57
|
-
rewardImage: g
|
|
58
|
-
}), (r, s) => {
|
|
59
|
-
const t = v("FmTextarea"), a = v("FmHelperText"), c = v("FmButton"), _ = v("FmSideSheet");
|
|
60
|
-
return d(), x(_, {
|
|
61
|
-
"max-width": 560,
|
|
62
|
-
modelValue: e(b),
|
|
63
|
-
"onUpdate:modelValue": s[7] || (s[7] = (f) => Y(b) ? b.value = f : null),
|
|
64
|
-
header: "Store setting"
|
|
65
|
-
}, {
|
|
66
|
-
"side-sheet-footer": S(() => [
|
|
67
|
-
l("div", Re, [
|
|
68
|
-
m(c, {
|
|
69
|
-
label: "Submit",
|
|
70
|
-
onClick: L,
|
|
71
|
-
disabled: e(w).length > 0 || e(K)().isLoading,
|
|
72
|
-
loading: e(K)().isLoading
|
|
73
|
-
}, null, 8, ["disabled", "loading"]),
|
|
74
|
-
m(c, {
|
|
75
|
-
label: "Cancel",
|
|
76
|
-
onClick: s[6] || (s[6] = (f) => V(!1)),
|
|
77
|
-
variant: "tertiary"
|
|
78
|
-
})
|
|
79
|
-
])
|
|
80
|
-
]),
|
|
81
|
-
default: S(() => {
|
|
82
|
-
var f, h, E;
|
|
83
|
-
return [
|
|
84
|
-
e(o) ? (d(), O("div", fe, [
|
|
85
|
-
l("div", ye, [
|
|
86
|
-
z(" Reward information "),
|
|
87
|
-
(d(), x(H(e(p).chip())))
|
|
88
|
-
]),
|
|
89
|
-
m(ie, {
|
|
90
|
-
modelValue: e(o).name,
|
|
91
|
-
"onUpdate:modelValue": s[0] || (s[0] = (i) => e(o).name = i),
|
|
92
|
-
label: `${e(p).name} name`,
|
|
93
|
-
schema: e(R).typeAtPath(e(u), "name", [e(o).type])
|
|
94
|
-
}, null, 8, ["modelValue", "label", "schema"]),
|
|
95
|
-
m(t, {
|
|
96
|
-
class: "!mb-[-16px]",
|
|
97
|
-
modelValue: e(o).description,
|
|
98
|
-
"onUpdate:modelValue": s[1] || (s[1] = (i) => e(o).description = i),
|
|
99
|
-
rules: [e(R).ruleAtPath(e(u), "description", [e(o).type])]
|
|
100
|
-
}, {
|
|
101
|
-
label: S(() => [
|
|
102
|
-
(d(), x(H(
|
|
103
|
-
e(R).toInputLabel(
|
|
104
|
-
e(R).typeAtPath(e(u), "description", [e(o).type]),
|
|
105
|
-
`${e(p).name} description`
|
|
106
|
-
)
|
|
107
|
-
)))
|
|
108
|
-
]),
|
|
109
|
-
_: 1
|
|
110
|
-
}, 8, ["modelValue", "rules"]),
|
|
111
|
-
l("div", ge, [
|
|
112
|
-
l("div", null, P(e(p).name) + " description should not exceed 200 characters. ", 1),
|
|
113
|
-
l("div", null, P(((f = e(o).description) == null ? void 0 : f.length) ?? 0) + "/200", 1)
|
|
114
|
-
]),
|
|
115
|
-
m(re, {
|
|
116
|
-
class: "w-1/2 xs:w-2/3",
|
|
117
|
-
"aspect-ratio": "16/9",
|
|
118
|
-
file: e(g) ?? void 0,
|
|
119
|
-
thumbnail: e(o).image ?? void 0,
|
|
120
|
-
"onUpdate:file": s[2] || (s[2] = async (i) => {
|
|
121
|
-
g.value = i, i || (e(o).image = null);
|
|
122
|
-
})
|
|
123
|
-
}, {
|
|
124
|
-
label: S(() => [
|
|
125
|
-
(d(), x(H(
|
|
126
|
-
e(R).toInputLabel(
|
|
127
|
-
e(R).typeAtPath(e(u), "image", [e(o).type]),
|
|
128
|
-
`${e(p).name} image`
|
|
129
|
-
)
|
|
130
|
-
)))
|
|
131
|
-
]),
|
|
132
|
-
_: 1
|
|
133
|
-
}, 8, ["file", "thumbnail"]),
|
|
134
|
-
e(o).type === "VOUCHER" ? (d(), O(j, { key: 0 }, [
|
|
135
|
-
we,
|
|
136
|
-
m(ce, {
|
|
137
|
-
"model-value": e(o).extras.effect,
|
|
138
|
-
"onUpdate:modelValue": s[3] || (s[3] = (i) => {
|
|
139
|
-
e(o).extras.effect = i;
|
|
140
|
-
})
|
|
141
|
-
}, null, 8, ["model-value"]),
|
|
142
|
-
e(o).extras.effect == null ? (d(), x(a, {
|
|
143
|
-
key: 0,
|
|
144
|
-
class: "!mt-8",
|
|
145
|
-
text: "Effect is required",
|
|
146
|
-
state: "error"
|
|
147
|
-
})) : U("", !0),
|
|
148
|
-
_e,
|
|
149
|
-
m(me, {
|
|
150
|
-
"model-value": e(o).options,
|
|
151
|
-
"no-campaign": e(o).noCampaign,
|
|
152
|
-
"onUpdate:modelValue": s[4] || (s[4] = (i) => e(o).options = i),
|
|
153
|
-
schema: e(R).typeAtPath(e(u), "options", ["VOUCHER"])
|
|
154
|
-
}, null, 8, ["model-value", "no-campaign", "schema"])
|
|
155
|
-
], 64)) : U("", !0),
|
|
156
|
-
ve,
|
|
157
|
-
e(o).type === "VOUCHER" ? (d(), x(le, {
|
|
158
|
-
key: 1,
|
|
159
|
-
"model-value": ((E = (h = e(o).extras) == null ? void 0 : h.targetLocation) == null ? void 0 : E.map(String)) ?? null,
|
|
160
|
-
type: "select",
|
|
161
|
-
"onUpdate:modelValue": s[5] || (s[5] = (i) => {
|
|
162
|
-
e(o).extras.targetLocation = i;
|
|
163
|
-
}),
|
|
164
|
-
rules: [
|
|
165
|
-
e(R).ruleAtPath(e(u), "extras.targetLocation", ["VOUCHER"])
|
|
166
|
-
]
|
|
167
|
-
}, null, 8, ["model-value", "rules"])) : U("", !0)
|
|
168
|
-
])) : U("", !0)
|
|
169
|
-
];
|
|
170
|
-
}),
|
|
171
|
-
_: 1
|
|
172
|
-
}, 8, ["modelValue"]);
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
}), he = { class: "px-24 flex flex-col gap-y-16" }, xe = { class: "flex items-center justify-between w-full" }, Ce = /* @__PURE__ */ l("div", { class: "flex gap-8" }, null, -1), Se = /* @__PURE__ */ l("img", {
|
|
176
|
-
src: J,
|
|
177
|
-
class: "aspect-square w-[150px]"
|
|
178
|
-
}, null, -1), Fe = { class: "flex flex-col gap-16 text-center" }, Ve = { class: "fm-typo-en-title-sm-800" }, Ee = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Je = /* @__PURE__ */ G({
|
|
179
|
-
__name: "StoreRewards",
|
|
180
|
-
setup(W) {
|
|
181
|
-
const { t: n } = te(), T = Q(), A = {
|
|
182
|
-
label: n("connect.storeRewards.create"),
|
|
183
|
-
value: "create",
|
|
184
|
-
isPrimary: !0,
|
|
185
|
-
prependIcon: "add"
|
|
186
|
-
}, y = ee(), { global: I, minor: b } = X, o = pe(), g = F({
|
|
187
|
-
searchKey: "",
|
|
188
|
-
columnFilters: []
|
|
189
|
-
}), u = [
|
|
190
|
-
{
|
|
191
|
-
header: n("connect.storeRewards.table.name"),
|
|
192
|
-
accessorFn: (t) => t.name
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
id: "type",
|
|
196
|
-
header: n("connect.storeRewards.table.type"),
|
|
197
|
-
accessorFn: (t) => t.type,
|
|
198
|
-
cell(t) {
|
|
199
|
-
return Z[t.row.original.type].chip();
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
header: n("connect.storeRewards.table.validity"),
|
|
204
|
-
accessorFn: (t) => ue(
|
|
205
|
-
"validityOption" in t.options ? t.options.validityOption || {} : {}
|
|
206
|
-
)
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
header: n("connect.storeRewards.table.used"),
|
|
210
|
-
meta: {
|
|
211
|
-
textAlign: "left"
|
|
212
|
-
},
|
|
213
|
-
accessorFn: (t) => t.currentReceive ?? 0
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
header: n("connect.storeRewards.table.actions"),
|
|
217
|
-
cell(t) {
|
|
218
|
-
return C("div", { class: "flex items-center justify-end gap-4" }, [
|
|
219
|
-
C(
|
|
220
|
-
$.FmMenu,
|
|
221
|
-
{
|
|
222
|
-
placement: "bottom-end",
|
|
223
|
-
onClick: (a) => {
|
|
224
|
-
a.stopPropagation();
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"menu-button": () => C($.FmButton, {
|
|
229
|
-
icon: "more_vert",
|
|
230
|
-
iconColor: "neutral-gray-400",
|
|
231
|
-
variant: "tertiary"
|
|
232
|
-
}),
|
|
233
|
-
default: () => [
|
|
234
|
-
C($.FmMenuItem, {
|
|
235
|
-
label: "View collections",
|
|
236
|
-
onClick: async (a) => {
|
|
237
|
-
a.stopPropagation(), L(t.row.original._id);
|
|
238
|
-
}
|
|
239
|
-
}),
|
|
240
|
-
// h(components.FmMenuItem, {
|
|
241
|
-
// label: 'View transactions',
|
|
242
|
-
// onClick: async (event: Event) => {
|
|
243
|
-
// event.stopPropagation();
|
|
244
|
-
// onViewTransactions(props.row.original._id as string);
|
|
245
|
-
// },
|
|
246
|
-
// }),
|
|
247
|
-
C(
|
|
248
|
-
$.FmMenuItem,
|
|
249
|
-
{
|
|
250
|
-
onClick: async (a) => {
|
|
251
|
-
a.stopPropagation(), V(t.row.original);
|
|
252
|
-
}
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
label: C(
|
|
256
|
-
"div",
|
|
257
|
-
{
|
|
258
|
-
class: "text-fm-color-typo-error fm-typo-en-body-md-400"
|
|
259
|
-
},
|
|
260
|
-
"Remove"
|
|
261
|
-
)
|
|
262
|
-
}
|
|
263
|
-
)
|
|
264
|
-
]
|
|
265
|
-
}
|
|
266
|
-
)
|
|
267
|
-
]);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
], p = N(
|
|
271
|
-
() => y.bundleRewards.filter((t) => t.type == "VOUCHER")
|
|
272
|
-
), w = F();
|
|
273
|
-
function L(t) {
|
|
274
|
-
o.push({
|
|
275
|
-
name: k["$connect-STORE_REWARD_COLLECTIONS"],
|
|
276
|
-
params: { id: t }
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
async function V(t) {
|
|
280
|
-
if (t.type === "TITLE") {
|
|
281
|
-
await M.confirm(
|
|
282
|
-
n("connect.storeRewards.remove.message"),
|
|
283
|
-
n("connect.storeRewards.remove.title"),
|
|
284
|
-
n("connect.storeRewards.remove.action")
|
|
285
|
-
) && await o.push({ name: k["$connect-PROGRAM_TITLE"] });
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
await M.remove(
|
|
289
|
-
n("connect.storeRewards.delete.confirm"),
|
|
290
|
-
n("connect.storeRewards.delete.title")
|
|
291
|
-
) && await b(
|
|
292
|
-
async () => {
|
|
293
|
-
await D.deleteReward(t._id), await y.readMembership(), await y.readRewards();
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
message: n("connect.storeRewards.delete.message"),
|
|
297
|
-
successMessage: n("connect.storeRewards.delete.success")
|
|
298
|
-
}
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
async function r(t) {
|
|
302
|
-
var c;
|
|
303
|
-
const a = t ? ae(y.bundleRewards.find((_) => _._id === t)) : void 0;
|
|
304
|
-
if ((a == null ? void 0 : a.type) === "TITLE") {
|
|
305
|
-
await M.confirm(
|
|
306
|
-
"You cannot edit a title here, please edit it at the Program > Title section.",
|
|
307
|
-
"Update reward",
|
|
308
|
-
"Go to title section"
|
|
309
|
-
) && await o.push({ name: k["$connect-PROGRAM_TITLE"] });
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
(c = w.value) == null || c.showSheet(!0, a, {
|
|
313
|
-
isStoreReward: !0,
|
|
314
|
-
type: "VOUCHER"
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
async function s(t) {
|
|
318
|
-
let a = !1;
|
|
319
|
-
t._id && t.type === "VOUCHER" && await new Promise((c) => {
|
|
320
|
-
T.open({
|
|
321
|
-
title: "Confirmation",
|
|
322
|
-
message: n("connect.campaign.voucher.updateConfirm.message"),
|
|
323
|
-
primaryActions: {
|
|
324
|
-
text: n("connect.campaign.voucher.updateConfirm.updateAll"),
|
|
325
|
-
close: !0
|
|
326
|
-
},
|
|
327
|
-
secondaryActions: {
|
|
328
|
-
text: n("connect.campaign.voucher.updateConfirm.updateFuture"),
|
|
329
|
-
close: !0
|
|
330
|
-
}
|
|
331
|
-
}).onPrimary(async () => {
|
|
332
|
-
a = !0, c();
|
|
333
|
-
}).onSecondary(async () => {
|
|
334
|
-
c();
|
|
335
|
-
});
|
|
336
|
-
}), await b(
|
|
337
|
-
async () => {
|
|
338
|
-
var c, _, f, h;
|
|
339
|
-
(c = w.value) != null && c.rewardImage && t.image ? await B.delete(t.image) : (_ = w.value) != null && _.rewardImage && (t.image = await B.update(
|
|
340
|
-
t.image || B.collectibleImagePath(
|
|
341
|
-
void 0,
|
|
342
|
-
w.value.rewardImage
|
|
343
|
-
),
|
|
344
|
-
(f = w.value) == null ? void 0 : f.rewardImage
|
|
345
|
-
)), t._id ? await D.updateReward(t._id, {
|
|
346
|
-
...t,
|
|
347
|
-
updateCollection: a
|
|
348
|
-
}) : await D.createReward(t), await y.readRewards(), (h = w.value) == null || h.showSheet(!1);
|
|
349
|
-
},
|
|
350
|
-
{
|
|
351
|
-
message: "Updating reward",
|
|
352
|
-
successMessage: "Reward updated successfully"
|
|
353
|
-
}
|
|
354
|
-
);
|
|
355
|
-
}
|
|
356
|
-
return q(async () => {
|
|
357
|
-
await I(async () => {
|
|
358
|
-
await y.readMembership(), await y.readRewards();
|
|
359
|
-
});
|
|
360
|
-
}), (t, a) => {
|
|
361
|
-
const c = v("FmPageHead"), _ = v("FmSearch"), f = v("FmTable"), h = v("FmButton"), E = v("FmCard");
|
|
362
|
-
return d(), O(j, null, [
|
|
363
|
-
m(c, {
|
|
364
|
-
title: e(n)("connect.storeRewards.title"),
|
|
365
|
-
description: e(n)("connect.storeRewards.description"),
|
|
366
|
-
actions: [A],
|
|
367
|
-
"back-button": !0,
|
|
368
|
-
"onClick:action": a[0] || (a[0] = () => r()),
|
|
369
|
-
"onClick:back": a[1] || (a[1] = () => e(o).push({ name: e(k)["$connect-STORE"] }))
|
|
370
|
-
}, null, 8, ["title", "description", "actions"]),
|
|
371
|
-
l("div", he, [
|
|
372
|
-
e(p) && e(p).length > 0 ? (d(), O(j, { key: 0 }, [
|
|
373
|
-
l("div", xe, [
|
|
374
|
-
Ce,
|
|
375
|
-
m(_, {
|
|
376
|
-
modelValue: e(g).searchKey,
|
|
377
|
-
"onUpdate:modelValue": a[2] || (a[2] = (i) => e(g).searchKey = i),
|
|
378
|
-
class: "",
|
|
379
|
-
placeholder: "search",
|
|
380
|
-
collapsible: ""
|
|
381
|
-
}, null, 8, ["modelValue"])
|
|
382
|
-
]),
|
|
383
|
-
m(f, {
|
|
384
|
-
"row-data": e(p),
|
|
385
|
-
"column-defs": u,
|
|
386
|
-
"search-value": e(g).searchKey,
|
|
387
|
-
"column-filter": e(g).columnFilters,
|
|
388
|
-
onRowClick: a[3] || (a[3] = (i) => r(i.original._id)),
|
|
389
|
-
"hide-footer": e(p).length < 10
|
|
390
|
-
}, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
|
|
391
|
-
], 64)) : (d(), x(E, {
|
|
392
|
-
key: 1,
|
|
393
|
-
variant: "outlined",
|
|
394
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
395
|
-
}, {
|
|
396
|
-
default: S(() => [
|
|
397
|
-
Se,
|
|
398
|
-
l("div", Fe, [
|
|
399
|
-
l("div", Ve, P(e(n)("connect.storeRewards.empty.title")), 1),
|
|
400
|
-
l("div", Ee, P(e(n)("connect.storeRewards.empty.description")), 1)
|
|
401
|
-
]),
|
|
402
|
-
m(h, {
|
|
403
|
-
variant: "primary",
|
|
404
|
-
label: e(n)("connect.storeRewards.empty.action"),
|
|
405
|
-
onClick: a[4] || (a[4] = (i) => r()),
|
|
406
|
-
icon: "add"
|
|
407
|
-
}, null, 8, ["label"])
|
|
408
|
-
]),
|
|
409
|
-
_: 1
|
|
410
|
-
})),
|
|
411
|
-
m(be, {
|
|
412
|
-
ref_key: "rewardSheetRef",
|
|
413
|
-
ref: w,
|
|
414
|
-
onUpdate: a[5] || (a[5] = (i) => s(i))
|
|
415
|
-
}, null, 512)
|
|
416
|
-
])
|
|
417
|
-
], 64);
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
export {
|
|
422
|
-
Je as default
|
|
423
|
-
};
|