@feedmepos/mf-connect 0.0.16-beta.11 → 0.0.16-beta.13
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-Gq7PoNer.js → Analytic-B8FGU0B7.js} +32 -32
- package/dist/App-BXAJ1Z_T.js +6260 -0
- package/dist/{Broadcast-DU3JnBwZ.js → Broadcast-DvmjAtxH.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0I8IZIR.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dvp3mOEx.js} +8 -8
- package/dist/Card-DblSxqRr.js +825 -0
- package/dist/{Collections-B1SC1rr7.js → Collections-C4KRnnWW.js} +4 -4
- package/dist/{Credit-BgwI8DR3.js → Credit-C5MbDbWr.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-2MKUx_As.js} +718 -718
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DPgu45MD.js → EffectSheet.vue_vue_type_style_index_0_lang-CCsxDg45.js} +8 -8
- package/dist/{Experience-C2Q-zqV6.js → Experience-CmDLg17p.js} +8 -8
- package/dist/{Game-DU2pZDGk.js → Game-5zvjlfuj.js} +8 -8
- package/dist/{Marketing-DWiTQp9I.js → Marketing-BVpimsBU.js} +5 -5
- package/dist/Member-BkOqtn9n.js +69 -0
- package/dist/{MemberList-DzMdajIf.js → MemberList-3IvxRInu.js} +105 -105
- package/dist/{MemberTransactions-Bciankuu.js → MemberTransactions-DRpV77Pn.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DH25Hfk3.js → MessageInput.vue_vue_type_script_setup_true_lang-CBvpHaAl.js} +2 -2
- package/dist/{Mission-KzwRlaA5.js → Mission-9fJLMJKS.js} +8 -8
- package/dist/{Point-CSKvZXHc.js → Point-7O6IdhWH.js} +8 -8
- package/dist/Promotion-XqpFw0IZ.js +247 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-4zIO3oCr.js → RuleGroup.vue_vue_type_script_setup_true_lang-1Fko0V0J.js} +14 -14
- package/dist/{Segment-2Q0PonBb.js → Segment-DMaHcJT_.js} +8 -8
- package/dist/{Setting-Df5vVRt4.js → Setting-DQh2aqfD.js} +8 -8
- package/dist/{Store-C0WXCKs6.js → Store-WvEUlY9N.js} +393 -393
- package/dist/{StoreRewards-eSSIO0nk.js → StoreRewards-D50uR2b9.js} +11 -11
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BjnCRKGX.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Cm0lHUkP.js} +6 -6
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-b0xTcoEp.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BnjVkkS1.js} +1 -1
- package/dist/{Tier-v-1FkRU-.js → Tier-CqNKi52t.js} +14 -14
- package/dist/{Title-CQ2JWqBW.js → Title-CzBp5ig0.js} +14 -14
- package/dist/{Transaction-0OouN_6s.js → Transaction-EKIwyavj.js} +2 -2
- package/dist/{Voucher-CL0cgogx.js → Voucher-Dhpzn8gs.js} +11 -11
- package/dist/{app-Bd19eW7X.js → app-3-6LVz11.js} +27 -24
- package/dist/app-DM-4iSsh.js +53428 -0
- package/dist/app.js +1 -1
- package/dist/{business-dQh3AEot.js → business-Wk7ElvEz.js} +1 -1
- package/dist/{campaign-BOl8AgKA.js → campaign-tHUDB7cm.js} +2 -2
- package/dist/{collection.fn-B_YsXmrP.js → collection.fn-DS11Xpbu.js} +2 -2
- package/dist/dto-B8X9qnLh.js +1169 -0
- package/dist/{effect-C2jCStXO.js → effect-BH3AL4S6.js} +9 -9
- package/dist/{export-BtZc3Yzh.js → export-DAAmj_h9.js} +3 -3
- package/dist/{helper-8oGsrM56.js → helper-BSKllptD.js} +1 -1
- package/dist/index-5FIs0G8O.js +29193 -0
- package/dist/{index-HoacsZDk.js → index-B0Pw9YQd.js} +46 -39
- package/dist/{index-C_0IFnwi.js → index-BH-mOC5-.js} +5 -5
- package/dist/{index-C7oeXRUl.js → index-BO94KhQO.js} +1 -1
- package/dist/{index-DCixRRvz.js → index-BgIWS3vT.js} +5 -5
- package/dist/{index-CZKYIefW.js → index-CIBWHBM-.js} +2 -2
- package/dist/{index-Di-kWSmf.js → index-CPxCpRFW.js} +3 -3
- package/dist/{index-DYDhH9bi.js → index-CoYSYku2.js} +1 -1
- package/dist/{index-DwKqFNF6.js → index-DOFTUTiA.js} +1 -1
- package/dist/{index-DFgt4-VW.js → index-DmxAa1MA.js} +1 -1
- package/dist/{index-UTQHDUdW.js → index-Z7d84hDW.js} +7 -2
- package/dist/{index-6FkKY3q0.js → index-vIwngIP9.js} +1 -1
- package/dist/index.esm2017-jX1Q0DsS.js +3069 -0
- package/dist/loading-DeWfPgai.js +29843 -0
- package/dist/{membership-Ccrx9R6r.js → membership-oIubaesw.js} +3 -3
- package/dist/money-D-3GphEZ.js +15 -0
- package/dist/number-D_Fi0beD.js +12 -0
- package/dist/{rule-DJ07h3Gh.js → rule-C37bqQrm.js} +314 -343
- package/dist/{rule-builder-DJ-acvVD.js → rule-builder-DPQJ8Tbv.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-clxvNnbF.js → template-CIStnXhd.js} +4 -4
- package/dist/tslib.es6-BCqqvLQ_.js +44 -0
- package/dist/vue-i18n-jf-SfrQy.js +2365 -0
- package/dist/{xlsx-BB366cdN.js → xlsx-C91dwH9k.js} +1903 -1903
- package/package.json +12 -12
- package/dist/App-Cikl5jnp.js +0 -177
- package/dist/Card-hIeQ5XUH.js +0 -825
- package/dist/Member-BEXKBFry.js +0 -69
- package/dist/Promotion-IiwPhx8p.js +0 -221
- package/dist/app-CfS25Z66.js +0 -34797
- package/dist/dto-B8NfyVPG.js +0 -1169
- package/dist/index-Dn0jdj0o.js +0 -28058
- package/dist/loading-D_AN6p24.js +0 -32697
- package/dist/money-waD-f-Zz.js +0 -15
- package/dist/number-CwTGGsh9.js +0 -12
- package/dist/vue-i18n-BxwiXSkp.js +0 -2365
package/dist/Card-hIeQ5XUH.js
DELETED
|
@@ -1,825 +0,0 @@
|
|
|
1
|
-
import { defineComponent as ee, ref as b, computed as L, watch as ye, onMounted as te, resolveComponent as f, openBlock as _, createBlock as F, unref as t, isRef as Q, withCtx as C, createElementVNode as m, createVNode as p, createElementBlock as R, Fragment as B, renderList as Z, createCommentVNode as D, normalizeClass as he, createSlots as Se, h as Y, toDisplayString as X, withModifiers as ke } from "vue";
|
|
2
|
-
import { _ as Ce } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { h as re } from "./moment-BWErdI6_.js";
|
|
4
|
-
import { useDialog as xe, components as Ee } from "@feedmepos/ui-library";
|
|
5
|
-
import { p as we, u as ne, f as le } from "./loading-D_AN6p24.js";
|
|
6
|
-
import { u as Ae } from "./app-wDQR6dpb.js";
|
|
7
|
-
import { u as oe } from "./membership-Ccrx9R6r.js";
|
|
8
|
-
import { _ as pe } from "./index-C_0IFnwi.js";
|
|
9
|
-
import { m as ae } from "./index-C7oeXRUl.js";
|
|
10
|
-
import { _ as de } from "./ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js";
|
|
11
|
-
import "./index-CZKYIefW.js";
|
|
12
|
-
import "./index-DYDhH9bi.js";
|
|
13
|
-
import { l as De } from "./index-DCixRRvz.js";
|
|
14
|
-
import "./index-Di-kWSmf.js";
|
|
15
|
-
import "./index-HoacsZDk.js";
|
|
16
|
-
import "./index-DFgt4-VW.js";
|
|
17
|
-
import { g as Fe } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
18
|
-
import { a as Re } from "./object-qECH92oz.js";
|
|
19
|
-
import { u as Ve } from "./business-dQh3AEot.js";
|
|
20
|
-
import { w as Me } from "./xlsx-BB366cdN.js";
|
|
21
|
-
import { e as Ie, C as Oe } from "./export-BtZc3Yzh.js";
|
|
22
|
-
import { u as Te, _ as Pe } from "./usePagination-BeF5K3M7.js";
|
|
23
|
-
import { u as Ne } from "./vue-i18n-BxwiXSkp.js";
|
|
24
|
-
import { o as Ue } from "./objectId-dwaoBfJX.js";
|
|
25
|
-
const Be = { class: "space-y-16" }, He = { class: "gap-16 grid grid-cols-2" }, Le = { class: "space-y-16" }, je = {
|
|
26
|
-
key: 0,
|
|
27
|
-
class: "flex flex-col gap-[16px] w-full"
|
|
28
|
-
}, $e = { class: "flex flex-col gap-[8px]" }, Ge = ["src"], ze = { class: "flex pt-[24px] gap-[24px]" }, qe = ["src", "onClick", "alt"], Ke = { class: "flex items-center gap-8" }, Ye = /* @__PURE__ */ ee({
|
|
29
|
-
__name: "CreateCardSheet",
|
|
30
|
-
emits: ["success", "export"],
|
|
31
|
-
setup(e, { expose: r, emit: V }) {
|
|
32
|
-
const { minor: I } = ne, h = oe(), E = b(), v = b(!1), c = V, y = b(!1);
|
|
33
|
-
function j(l) {
|
|
34
|
-
y.value = l, l && (i.value = {
|
|
35
|
-
quantity: 1,
|
|
36
|
-
code: "",
|
|
37
|
-
codeConfig: {
|
|
38
|
-
length: 12,
|
|
39
|
-
charset: "1234567890",
|
|
40
|
-
prefix: "",
|
|
41
|
-
suffix: "",
|
|
42
|
-
pattern: "####-####-####-####"
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
const i = b({
|
|
47
|
-
quantity: 1,
|
|
48
|
-
code: "",
|
|
49
|
-
codeConfig: {
|
|
50
|
-
length: 12,
|
|
51
|
-
charset: "1234567890",
|
|
52
|
-
prefix: "",
|
|
53
|
-
suffix: "",
|
|
54
|
-
pattern: "####-####-####-####"
|
|
55
|
-
},
|
|
56
|
-
setCardOnBind: !1,
|
|
57
|
-
bundle: void 0
|
|
58
|
-
}), k = [
|
|
59
|
-
{
|
|
60
|
-
label: "Bulk number",
|
|
61
|
-
value: "bulk",
|
|
62
|
-
sublabel: "Bulk generate unique number"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
label: "Custom number",
|
|
66
|
-
value: "single",
|
|
67
|
-
sublabel: "Enter your own custom number"
|
|
68
|
-
}
|
|
69
|
-
], H = [
|
|
70
|
-
{
|
|
71
|
-
label: "Alphanumeric",
|
|
72
|
-
value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
label: "Alphabetic",
|
|
76
|
-
value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
77
|
-
},
|
|
78
|
-
{ label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
|
|
79
|
-
{ label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
|
|
80
|
-
{ label: "Numbers", value: "0123456789" },
|
|
81
|
-
{ label: "Custom", value: "" }
|
|
82
|
-
], O = b(H[0].value), x = b("bulk"), w = b(0), N = L(
|
|
83
|
-
() => {
|
|
84
|
-
var l;
|
|
85
|
-
return (l = h.membership.design) == null ? void 0 : l[w.value];
|
|
86
|
-
}
|
|
87
|
-
), u = b(!1), s = L(
|
|
88
|
-
() => h.sortedStoreCategories.flatMap((l) => l.bundles)
|
|
89
|
-
);
|
|
90
|
-
async function o(l) {
|
|
91
|
-
var M, T;
|
|
92
|
-
if (await ((M = E.value) == null ? void 0 : M.validateInputs()), !v.value) return;
|
|
93
|
-
l.design = (T = N.value) == null ? void 0 : T.image;
|
|
94
|
-
const n = await we.confirm(
|
|
95
|
-
"",
|
|
96
|
-
"Do you want to export generated card(s)?",
|
|
97
|
-
"Export",
|
|
98
|
-
"Generate and without export"
|
|
99
|
-
);
|
|
100
|
-
console.log(n), await I(
|
|
101
|
-
async () => {
|
|
102
|
-
const U = await ae.createCards(l);
|
|
103
|
-
console.log(U), await c("success"), n && await c("export", U);
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
message: "Creating card(s)",
|
|
107
|
-
successMessage: "Card(s) created"
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
return r({
|
|
112
|
-
showSheet: j
|
|
113
|
-
}), ye(
|
|
114
|
-
() => i.value.codeConfig.length,
|
|
115
|
-
(l, n) => {
|
|
116
|
-
l != n && (i.value.codeConfig.pattern = "#".repeat(Number(l)));
|
|
117
|
-
}
|
|
118
|
-
), te(async () => {
|
|
119
|
-
await h.readMemberStore();
|
|
120
|
-
}), (l, n) => {
|
|
121
|
-
const M = f("FmRadio"), T = f("FmRadioGroup"), U = f("FmSwitch"), g = f("FmStepperField"), G = f("FmSelect"), P = f("FmTextField"), ge = f("FmTextarea"), z = f("FmButton"), be = f("FmForm"), ve = f("FmSideSheet");
|
|
122
|
-
return _(), F(ve, {
|
|
123
|
-
"max-width": 560,
|
|
124
|
-
"dismiss-away": !0,
|
|
125
|
-
header: "Create collection",
|
|
126
|
-
modelValue: t(y),
|
|
127
|
-
"onUpdate:modelValue": [
|
|
128
|
-
n[19] || (n[19] = (A) => Q(y) ? y.value = A : null),
|
|
129
|
-
n[20] || (n[20] = (A) => y.value = A)
|
|
130
|
-
]
|
|
131
|
-
}, {
|
|
132
|
-
"side-sheet-footer": C(() => [
|
|
133
|
-
m("div", Ke, [
|
|
134
|
-
p(z, {
|
|
135
|
-
label: "Save",
|
|
136
|
-
onClick: n[17] || (n[17] = (A) => o(t(i))),
|
|
137
|
-
loading: t(Ae)().isLoading
|
|
138
|
-
}, null, 8, ["loading"]),
|
|
139
|
-
p(z, {
|
|
140
|
-
label: "Cancel",
|
|
141
|
-
type: "button",
|
|
142
|
-
variant: "tertiary",
|
|
143
|
-
onClick: n[18] || (n[18] = (A) => y.value = !1)
|
|
144
|
-
})
|
|
145
|
-
])
|
|
146
|
-
]),
|
|
147
|
-
default: C(() => [
|
|
148
|
-
p(be, {
|
|
149
|
-
ref_key: "form",
|
|
150
|
-
ref: E,
|
|
151
|
-
class: "space-y-40",
|
|
152
|
-
onValidationSuccess: n[15] || (n[15] = (A) => v.value = !0),
|
|
153
|
-
onValidationFailed: n[16] || (n[16] = (A) => v.value = !1)
|
|
154
|
-
}, {
|
|
155
|
-
default: C(() => {
|
|
156
|
-
var A, se, ie;
|
|
157
|
-
return [
|
|
158
|
-
m("div", null, [
|
|
159
|
-
n[21] || (n[21] = m("div", { class: "fm-typo-en-body-lg-600" }, "Number type", -1)),
|
|
160
|
-
p(T, {
|
|
161
|
-
modelValue: t(x),
|
|
162
|
-
"onUpdate:modelValue": n[0] || (n[0] = (a) => Q(x) ? x.value = a : null),
|
|
163
|
-
inline: !1
|
|
164
|
-
}, {
|
|
165
|
-
default: C(() => [
|
|
166
|
-
(_(), R(B, null, Z(k, (a) => p(M, {
|
|
167
|
-
key: a.value,
|
|
168
|
-
value: a.value,
|
|
169
|
-
label: a.label,
|
|
170
|
-
sublabel: a.sublabel
|
|
171
|
-
}, null, 8, ["value", "label", "sublabel"])), 64))
|
|
172
|
-
]),
|
|
173
|
-
_: 1
|
|
174
|
-
}, 8, ["modelValue"])
|
|
175
|
-
]),
|
|
176
|
-
m("div", Be, [
|
|
177
|
-
n[22] || (n[22] = m("div", { class: "fm-typo-en-body-lg-600" }, "Number Settings", -1)),
|
|
178
|
-
t(x) === "bulk" ? (_(), R(B, { key: 0 }, [
|
|
179
|
-
p(U, {
|
|
180
|
-
"model-value": t(u),
|
|
181
|
-
"label-placement": "right",
|
|
182
|
-
value: "true",
|
|
183
|
-
label: "Advance number setting",
|
|
184
|
-
required: !0,
|
|
185
|
-
"onUpdate:modelValue": n[1] || (n[1] = () => u.value = !t(u))
|
|
186
|
-
}, null, 8, ["model-value"]),
|
|
187
|
-
t(u) ? (_(), R(B, { key: 0 }, [
|
|
188
|
-
p(g, {
|
|
189
|
-
"model-value": t(i).codeConfig.length || null,
|
|
190
|
-
"onUpdate:modelValue": n[2] || (n[2] = (a) => t(i).codeConfig.length = a),
|
|
191
|
-
label: "Code length",
|
|
192
|
-
rules: [(a) => Number(a) >= 1 || "Code length must at least 1"],
|
|
193
|
-
required: !0
|
|
194
|
-
}, null, 8, ["model-value", "rules"]),
|
|
195
|
-
p(G, {
|
|
196
|
-
label: "Charset",
|
|
197
|
-
"model-value": t(O),
|
|
198
|
-
items: H,
|
|
199
|
-
"helper-text": t(i).codeConfig.charset.length > 62 ? `${t(i).codeConfig.charset.substring(0, 62)}...` : t(i).codeConfig.charset,
|
|
200
|
-
"onUpdate:modelValue": n[3] || (n[3] = (a) => {
|
|
201
|
-
O.value = a, t(i).codeConfig.charset = a;
|
|
202
|
-
})
|
|
203
|
-
}, null, 8, ["model-value", "helper-text"]),
|
|
204
|
-
t(O) === "" ? (_(), F(P, {
|
|
205
|
-
key: 0,
|
|
206
|
-
modelValue: t(i).codeConfig.charset,
|
|
207
|
-
"onUpdate:modelValue": n[4] || (n[4] = (a) => t(i).codeConfig.charset = a),
|
|
208
|
-
label: "Custom Charset",
|
|
209
|
-
required: ""
|
|
210
|
-
}, null, 8, ["modelValue"])) : D("", !0),
|
|
211
|
-
m("div", He, [
|
|
212
|
-
p(P, {
|
|
213
|
-
modelValue: t(i).codeConfig.prefix,
|
|
214
|
-
"onUpdate:modelValue": n[5] || (n[5] = (a) => t(i).codeConfig.prefix = a),
|
|
215
|
-
label: "Prefix (Optional)"
|
|
216
|
-
}, null, 8, ["modelValue"]),
|
|
217
|
-
p(P, {
|
|
218
|
-
modelValue: t(i).codeConfig.suffix,
|
|
219
|
-
"onUpdate:modelValue": n[6] || (n[6] = (a) => t(i).codeConfig.suffix = a),
|
|
220
|
-
label: "Suffix (Optional)"
|
|
221
|
-
}, null, 8, ["modelValue"])
|
|
222
|
-
]),
|
|
223
|
-
p(P, {
|
|
224
|
-
modelValue: t(i).codeConfig.pattern,
|
|
225
|
-
"onUpdate:modelValue": n[7] || (n[7] = (a) => t(i).codeConfig.pattern = a),
|
|
226
|
-
label: "Pattern",
|
|
227
|
-
required: !0
|
|
228
|
-
}, null, 8, ["modelValue"])
|
|
229
|
-
], 64)) : D("", !0),
|
|
230
|
-
p(P, {
|
|
231
|
-
modelValue: t(i).quantity,
|
|
232
|
-
"onUpdate:modelValue": n[8] || (n[8] = (a) => t(i).quantity = a),
|
|
233
|
-
label: "Number of code",
|
|
234
|
-
rules: [
|
|
235
|
-
(a) => a >= 1 || "Quantity cannot be less than 1",
|
|
236
|
-
(a) => a <= 1e4 || "Quantity cannot more than 10,000"
|
|
237
|
-
],
|
|
238
|
-
required: !0,
|
|
239
|
-
"helper-text": `${t(i).quantity} card will be created`
|
|
240
|
-
}, null, 8, ["modelValue", "rules", "helper-text"])
|
|
241
|
-
], 64)) : D("", !0),
|
|
242
|
-
t(x) !== "bulk" ? (_(), F(ge, {
|
|
243
|
-
key: 1,
|
|
244
|
-
modelValue: t(i).code,
|
|
245
|
-
"onUpdate:modelValue": n[9] || (n[9] = (a) => t(i).code = a),
|
|
246
|
-
label: "Custom Card Number",
|
|
247
|
-
rules: [(a) => t(x) != "single" || !!a || "Custom code is required"],
|
|
248
|
-
placeholder: "(For multiple numbers, please enter in the new row.)"
|
|
249
|
-
}, null, 8, ["modelValue", "rules"])) : D("", !0)
|
|
250
|
-
]),
|
|
251
|
-
m("div", Le, [
|
|
252
|
-
n[23] || (n[23] = m("div", { class: "fm-typo-en-body-lg-600" }, "Card Settings", -1)),
|
|
253
|
-
p(U, {
|
|
254
|
-
"label-placement": "right",
|
|
255
|
-
label: "Set card number on bind",
|
|
256
|
-
"model-value": t(i).setCardOnBind || !1,
|
|
257
|
-
"onUpdate:modelValue": n[10] || (n[10] = (a) => t(i).setCardOnBind = a)
|
|
258
|
-
}, null, 8, ["model-value"]),
|
|
259
|
-
p(pe, {
|
|
260
|
-
label: "Activate bundle on bind",
|
|
261
|
-
placeholder: "Select bundle",
|
|
262
|
-
items: t(s).filter((a) => !a.stripePriceId).map((a) => ({ label: a.name, value: a._id })),
|
|
263
|
-
modelValue: t(i).bundle,
|
|
264
|
-
"onUpdate:modelValue": n[12] || (n[12] = (a) => t(i).bundle = a)
|
|
265
|
-
}, {
|
|
266
|
-
append: C(() => [
|
|
267
|
-
t(i).bundle ? (_(), F(z, {
|
|
268
|
-
key: 0,
|
|
269
|
-
icon: "link_off",
|
|
270
|
-
variant: "plain",
|
|
271
|
-
onClick: n[11] || (n[11] = (a) => t(i).bundle = void 0)
|
|
272
|
-
})) : D("", !0)
|
|
273
|
-
]),
|
|
274
|
-
_: 1
|
|
275
|
-
}, 8, ["items", "modelValue"]),
|
|
276
|
-
(se = (A = t(h).store) == null ? void 0 : A.stripe) != null && se.apiKey ? (_(), F(pe, {
|
|
277
|
-
key: 0,
|
|
278
|
-
label: "Linked subscription bundle",
|
|
279
|
-
placeholder: "Select bundle",
|
|
280
|
-
items: t(s).filter((a) => a.stripePriceId).map((a) => ({ label: a.name, value: a._id })),
|
|
281
|
-
modelValue: t(i).subscriptionBundle,
|
|
282
|
-
"onUpdate:modelValue": n[14] || (n[14] = (a) => t(i).subscriptionBundle = a)
|
|
283
|
-
}, {
|
|
284
|
-
append: C(() => [
|
|
285
|
-
t(i).subscriptionBundle ? (_(), F(z, {
|
|
286
|
-
key: 0,
|
|
287
|
-
icon: "link_off",
|
|
288
|
-
variant: "plain",
|
|
289
|
-
onClick: n[13] || (n[13] = (a) => t(i).subscriptionBundle = void 0)
|
|
290
|
-
})) : D("", !0)
|
|
291
|
-
]),
|
|
292
|
-
_: 1
|
|
293
|
-
}, 8, ["items", "modelValue"])) : D("", !0)
|
|
294
|
-
]),
|
|
295
|
-
t(h).membership.design ? (_(), R("div", je, [
|
|
296
|
-
m("div", $e, [
|
|
297
|
-
n[24] || (n[24] = m("p", { class: "fm-typo-en-title-sm-800" }, "Design preview", -1)),
|
|
298
|
-
m("img", {
|
|
299
|
-
src: (ie = t(N)) == null ? void 0 : ie.image,
|
|
300
|
-
class: "aspect-[16/9]"
|
|
301
|
-
}, null, 8, Ge),
|
|
302
|
-
m("div", ze, [
|
|
303
|
-
(_(!0), R(B, null, Z(t(h).membership.design, (a, q) => (_(), R("img", {
|
|
304
|
-
src: a.image,
|
|
305
|
-
key: `image_${q}`,
|
|
306
|
-
class: he(["w-[112px] h-[63px] cursor-pointer", `${t(w) === q ? "border-[2px] border-fm-color-primary" : ""}`]),
|
|
307
|
-
onClick: (ut) => w.value = q,
|
|
308
|
-
alt: `ai_image_predict_${q}`,
|
|
309
|
-
style: { objectFit: "cover" }
|
|
310
|
-
}, null, 10, qe))), 128))
|
|
311
|
-
])
|
|
312
|
-
])
|
|
313
|
-
])) : D("", !0)
|
|
314
|
-
];
|
|
315
|
-
}),
|
|
316
|
-
_: 1
|
|
317
|
-
}, 512)
|
|
318
|
-
]),
|
|
319
|
-
_: 1
|
|
320
|
-
}, 8, ["modelValue"]);
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
var W = { env: { npm_package_dependencies_change_case: "^5.4.4", TERM_PROGRAM: "vscode", npm_config__feedmepos_payment_model_registry: "https://npm.pkg.github.com/", npm_config__feedmepos_mf_core_ui_registry: "https://registry.npm.org/", NODE: "/opt/homebrew/Cellar/node@18/18.20.4/bin/node", npm_package_pnpm_overrides__feedmepos_mf_common: "1.15.0-beta.6", npm_package_dependencies_vue3_lottie: "^3.3.0", INIT_CWD: "/Users/binbinliao/project/marketing-services/packages/connect", npm_package_dependencies__feedmepos_mf_core_ui: "1.0.15", npm_package_dependencies_axios: "^1.7.2", npm_package_dependencies_moment: "^2.30.1", npm_package_devDependencies_typescript: "^5.4.5", TERM: "xterm-256color", SHELL: "/bin/zsh", npm_package_devDependencies_vite: "^5.3.1", TMPDIR: "/var/folders/59/2m_9ylk979b57yvk040bv3f00000gn/T/", HOMEBREW_REPOSITORY: "/opt/homebrew", TERM_PROGRAM_VERSION: "0.44.11", npm_package_exports___style: "./dist/style.css", npm_package_dependencies__feedmepos_custom_attributes: "0.0.0-rc.3", npm_package_scripts_dev: "vite", npm_package_devDependencies__vitejs_plugin_vue: "^5.0.5", CURSOR_TRACE_ID: "52362449dcd2413da89572bdfa64a41f", ORIGINAL_XDG_CURRENT_DESKTOP: "undefined", MallocNanoZone: "0", npm_package_dependencies_uuid: "^10.0.0", npm_package_scripts_build_only_prod: "pnpm build:mf:prod", npm_config_registry: "https://registry.npmjs.org/", npm_package_dependencies_dayjs: "^1.11.11", npm_package_dependencies_xlsx: "^0.18.5", USER: "binbinliao", npm_package_license: "UNLICENSED", npm_package_scripts_build_dev: "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --mode development", npm_package_dependencies__feedmepos_mf_common: "1.15.0-beta.6", npm_package_dependencies_email_addresses: "^5.0.0", npm_package_dependencies_fabric: "^6.4.2", COMMAND_MODE: "unix2003", npm_package_dependencies_rrule: "^2.8.1", PNPM_SCRIPT_SRC_DIR: "/Users/binbinliao/project/marketing-services/packages/connect", npm_package_exports___import: "./dist/app.js", npm_package_scripts_build_dts: "vue-tsc --declaration --noEmit false --emitDeclarationOnly -p tsconfig.json --outDir ./dist && mv ./dist/src/* dist", npm_package_scripts_build_mf_dev: "vite build --mode fmmf", SSH_AUTH_SOCK: "/private/tmp/com.apple.launchd.9sZlN4i7p7/Listeners", npm_package_dependencies_lodash: "^4.17.21", __CF_USER_TEXT_ENCODING: "0x1F5:0x0:0x0", npm_package_devDependencies_postcss: "^8.4.38", npm_execpath: "/opt/homebrew/lib/node_modules/pnpm/bin/pnpm.cjs", npm_package_module: "./dist/app.js", npm_package_dependencies__feedmepos_core: "^2.10.4", npm_config_frozen_lockfile: "", npm_package_scripts_build_types: "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.json --outDir dist --composite false", PATH: "/Users/binbinliao/project/marketing-services/packages/connect/node_modules/.bin:/opt/homebrew/lib/node_modules/pnpm/dist/node-gyp-bin:/Users/binbinliao/project/marketing-services/packages/connect/node_modules/.bin:/opt/homebrew/lib/node_modules/pnpm/dist/node-gyp-bin:/opt/homebrew/opt/node@18/bin:/opt/homebrew/lib/ruby/gems/3.3.0/bin:/Users/binbinliao/development/flutter/flutter/bin:/opt/homebrew/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/binbinliao/.codeium/windsurf/bin:/opt/homebrew/sbin", npm_config__feedmepos_ordering_registry: "https://npm.pkg.github.com/", LaunchInstanceID: "4CD6DC2E-A6A7-47B9-B24E-725171A78527", npm_package_dependencies_vite_plugin_vue_devtools: "^7.6.4", npm_package_dependencies_vue: "^3.5.13", __CFBundleIdentifier: "com.todesktop.230313mzl4w4u92", PWD: "/Users/binbinliao/project/marketing-services/packages/connect", npm_package_devDependencies_tailwindcss: "^3.4.4", npm_command: "run-script", npm_package_scripts_preview: "vite preview", npm_package_devDependencies__types_lodash: "^4.17.5", npm_package_scripts_deploy_dev: "pnpm run build-only:dev && pnpm publish --no-git-checks .", npm_package_dependencies_cross_env: "^7.0.3", npm_lifecycle_event: "build:mf:dev", LANG: "en_US.UTF-8", npm_package_name: "@feedmepos/mf-connect", NODE_PATH: "/Users/binbinliao/project/marketing-services/packages/connect/node_modules/.pnpm/vite@5.3.4_@types+node@18.19.41/node_modules/vite/bin/node_modules:/Users/binbinliao/project/marketing-services/packages/connect/node_modules/.pnpm/vite@5.3.4_@types+node@18.19.41/node_modules/vite/node_modules:/Users/binbinliao/project/marketing-services/packages/connect/node_modules/.pnpm/vite@5.3.4_@types+node@18.19.41/node_modules:/Users/binbinliao/project/marketing-services/packages/connect/node_modules/.pnpm/node_modules", npm_package_exports___types: "./dist/packages/connect/src/app.d.ts", npm_package_scripts_build: "vue-tsc && vite build", XPC_FLAGS: "0x0", VSCODE_GIT_ASKPASS_EXTRA_ARGS: "", npm_package_dependencies_bson_objectid: "^2.0.4", npm_package_scripts_build_prod: "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --mode production", npm_package_dependencies_vue_i18n: "10.0.5", npm_config_node_gyp: "/opt/homebrew/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js", XPC_SERVICE_NAME: "application.com.todesktop.230313mzl4w4u92.30648850.30648856", npm_package_version: "0.0.16-beta.10", VSCODE_INJECTION: "1", npm_package_dependencies_pinia: "^2.1.7", npm_package_devDependencies_autoprefixer: "^10.4.19", npm_config__feedmepos_inventory_components_registry: "https://npm.pkg.github.com/", HOME: "/Users/binbinliao", SHLVL: "3", npm_package_type: "module", VSCODE_GIT_ASKPASS_MAIN: "/Applications/Cursor.app/Contents/Resources/app/extensions/git/dist/askpass-main.js", npm_package_dependencies__feedmepos_menu: "1.0.34", npm_package_dependencies_dotenv: "^16.4.5", HOMEBREW_PREFIX: "/opt/homebrew", npm_package_dependencies__types_qrcode: "^1.5.5", npm_package_dependencies_zod_i18n_map: "^2.27.0", npm_package_dependencies_firebase: "^10.12.2", LOGNAME: "binbinliao", npm_package_scripts_build_only_dev: "pnpm build:mf:dev", npm_package_dependencies_unplugin_auto_import: "^0.17.6", npm_package_dependencies_zod: "3.22.4", npm_lifecycle_script: "vite build --mode fmmf", VSCODE_GIT_IPC_HANDLE: "/var/folders/59/2m_9ylk979b57yvk040bv3f00000gn/T/vscode-git-913fa051ae.sock", XDG_DATA_DIRS: "/usr/local/share:/usr/share:/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/contrib/terminal/browser/media/fish_xdg_data", npm_package_devDependencies_unlayer_types: "^1.111.0", npm_config__feedmepos_core_registry: "https://npm.pkg.github.com/", npm_package_devDependencies__types_uuid: "^9.0.8", npm_config_user_agent: "pnpm/9.6.0 npm/? node/v18.20.4 darwin arm64", INFOPATH: "/opt/homebrew/share/info:", HOMEBREW_CELLAR: "/opt/homebrew/Cellar", VSCODE_GIT_ASKPASS_NODE: "/Applications/Cursor.app/Contents/Frameworks/Cursor Helper (Plugin).app/Contents/MacOS/Cursor Helper (Plugin)", GIT_ASKPASS: "/Applications/Cursor.app/Contents/Resources/app/extensions/git/dist/askpass.sh", npm_package_devDependencies__types_node: "^18.19.36", npm_package_files_0: "dist", npm_package_scripts_build_mf_prod: "vite build --mode fmmf:prod", SECURITYSESSIONID: "186a3", npm_package_scripts_deploy_prod: "pnpm run build-only:prod && pnpm publish --no-git-checks .", npm_package_dependencies__feedmepos_ui_library: "1.3.5", npm_package_dependencies_vue_router: "^4.3.3", npm_package_dependencies_i18next: "^24.2.1", COLORTERM: "truecolor", npm_package_dependencies_qrcode: "^1.5.3", npm_package_devDependencies_vue_tsc: "^2.0.21", npm_node_execpath: "/opt/homebrew/Cellar/node@18/18.20.4/bin/node", NODE_ENV: "production", FEEDME_NAMESPACE: "dev", FIREBASE_API_KEY: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", FIREBASE_AUTH_DOMAIN: "feedme-dev-4c3ef.firebaseapp.com", FIREBASE_DATABASE_URL: "https://feedme-dev-4c3ef.firebaseio.com", FIREBASE_PROJECT_ID: "feedme-dev-4c3ef", FIREBASE_STORAGE_BUCKET: "feedme-dev-4c3ef.appspot.com", FIREBASE_MESSAGING_SENDER_ID: "458797803788", FIREBASE_APP_ID: "1:458797803788:web:37f2af2926a84288f0c129", FIREBASE_MEASUREMENT_ID: "G-J2QG09D2Q7", ASSET_STORAGE_BUCKET: "feedme-dev-4c3ef.appspot.com", AUTH_URL: "https://portal-v2-dev.feedmeapi.com/", SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/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", MEMBER_APP_URL: "member.feedmedev.cc", CRM_APP_URL: "crm.feedmedev.cc", MARKETING_V1_PORTAL: "https://marketing-v1.feedmedev.cc", CLIENT_ID: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4", PAYMENT_PORTAL_URL: "https://portal.feedmedev.cc/payment/payout-account" } }, J = Math.floor(Math.random() * 16777215), ce = d.index = parseInt(Math.random() * 16777215, 10), me = (typeof W > "u" || typeof W.pid != "number" ? Math.floor(Math.random() * 1e5) : W.pid) % 65535, ue = (() => {
|
|
325
|
-
try {
|
|
326
|
-
return _Buffer;
|
|
327
|
-
} catch {
|
|
328
|
-
try {
|
|
329
|
-
return Buffer;
|
|
330
|
-
} catch {
|
|
331
|
-
return null;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
})(), K = function(e) {
|
|
335
|
-
return !!(e != null && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e));
|
|
336
|
-
}, fe = [];
|
|
337
|
-
for (var S = 0; S < 256; S++)
|
|
338
|
-
fe[S] = (S <= 15 ? "0" : "") + S.toString(16);
|
|
339
|
-
var _e = new RegExp("^[0-9a-fA-F]{24}$"), $ = [];
|
|
340
|
-
S = 0;
|
|
341
|
-
for (; S < 10; ) $[48 + S] = S++;
|
|
342
|
-
for (; S < 16; ) $[55 + S] = $[87 + S] = S++;
|
|
343
|
-
function d(e) {
|
|
344
|
-
if (!(this instanceof d)) return new d(e);
|
|
345
|
-
if (e && (e instanceof d || e._bsontype === "ObjectID"))
|
|
346
|
-
return e;
|
|
347
|
-
if (this._bsontype = "ObjectID", e == null || typeof e == "number") {
|
|
348
|
-
this.id = this.generate(e);
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
var r = d.isValid(e);
|
|
352
|
-
if (!r && e != null)
|
|
353
|
-
throw new Error(
|
|
354
|
-
"Argument passed in must be a single String of 12 bytes or a string of 24 hex characters"
|
|
355
|
-
);
|
|
356
|
-
if (r && typeof e == "string" && e.length === 24)
|
|
357
|
-
return d.createFromHexString(e);
|
|
358
|
-
if (e != null && e.length === 12)
|
|
359
|
-
this.id = e;
|
|
360
|
-
else {
|
|
361
|
-
if (e != null && typeof e.toHexString == "function")
|
|
362
|
-
return e;
|
|
363
|
-
throw new Error(
|
|
364
|
-
"Argument passed in must be a single String of 12 bytes or a string of 24 hex characters"
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
var Xe = d;
|
|
369
|
-
d.default = d;
|
|
370
|
-
d.createFromTime = function(e) {
|
|
371
|
-
return e = parseInt(e, 10) % 4294967295, new d(Je(8, e) + "0000000000000000");
|
|
372
|
-
};
|
|
373
|
-
d.createFromHexString = function(e) {
|
|
374
|
-
if (typeof e > "u" || e != null && e.length !== 24)
|
|
375
|
-
throw new Error(
|
|
376
|
-
"Argument passed in must be a single String of 12 bytes or a string of 24 hex characters"
|
|
377
|
-
);
|
|
378
|
-
for (var r = "", V = 0; V < 24; )
|
|
379
|
-
r += String.fromCharCode($[e.charCodeAt(V++)] << 4 | $[e.charCodeAt(V++)]);
|
|
380
|
-
return new d(r);
|
|
381
|
-
};
|
|
382
|
-
d.isValid = function(e) {
|
|
383
|
-
return e == null ? !1 : typeof e == "number" ? !0 : typeof e == "string" ? e.length === 12 || e.length === 24 && _e.test(e) : e instanceof d ? !0 : K(e) ? d.isValid(e.toString("hex")) : typeof e.toHexString == "function" && ue && (e.id instanceof ue || typeof e.id == "string") ? e.id.length === 12 || e.id.length === 24 && _e.test(e.id) : !1;
|
|
384
|
-
};
|
|
385
|
-
d.prototype = {
|
|
386
|
-
constructor: d,
|
|
387
|
-
/**
|
|
388
|
-
* Return the ObjectID id as a 24 byte hex string representation
|
|
389
|
-
*
|
|
390
|
-
* @return {String} return the 24 byte hex string representation.
|
|
391
|
-
* @api public
|
|
392
|
-
*/
|
|
393
|
-
toHexString: function() {
|
|
394
|
-
if (!this.id || !this.id.length)
|
|
395
|
-
throw new Error(
|
|
396
|
-
"invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [" + JSON.stringify(this.id) + "]"
|
|
397
|
-
);
|
|
398
|
-
if (this.id.length === 24)
|
|
399
|
-
return this.id;
|
|
400
|
-
if (K(this.id))
|
|
401
|
-
return this.id.toString("hex");
|
|
402
|
-
for (var e = "", r = 0; r < this.id.length; r++)
|
|
403
|
-
e += fe[this.id.charCodeAt(r)];
|
|
404
|
-
return e;
|
|
405
|
-
},
|
|
406
|
-
/**
|
|
407
|
-
* Compares the equality of this ObjectID with `otherID`.
|
|
408
|
-
*
|
|
409
|
-
* @param {Object} otherId ObjectID instance to compare against.
|
|
410
|
-
* @return {Boolean} the result of comparing two ObjectID's
|
|
411
|
-
* @api public
|
|
412
|
-
*/
|
|
413
|
-
equals: function(e) {
|
|
414
|
-
return e instanceof d ? this.toString() === e.toString() : typeof e == "string" && d.isValid(e) && e.length === 12 && K(this.id) ? e === this.id.toString("binary") : typeof e == "string" && d.isValid(e) && e.length === 24 ? e.toLowerCase() === this.toHexString() : typeof e == "string" && d.isValid(e) && e.length === 12 ? e === this.id : e != null && (e instanceof d || e.toHexString) ? e.toHexString() === this.toHexString() : !1;
|
|
415
|
-
},
|
|
416
|
-
/**
|
|
417
|
-
* Returns the generation date (accurate up to the second) that this ID was generated.
|
|
418
|
-
*
|
|
419
|
-
* @return {Date} the generation date
|
|
420
|
-
* @api public
|
|
421
|
-
*/
|
|
422
|
-
getTimestamp: function() {
|
|
423
|
-
var e = /* @__PURE__ */ new Date(), r;
|
|
424
|
-
return K(this.id) ? r = this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24 : r = this.id.charCodeAt(3) | this.id.charCodeAt(2) << 8 | this.id.charCodeAt(1) << 16 | this.id.charCodeAt(0) << 24, e.setTime(Math.floor(r) * 1e3), e;
|
|
425
|
-
},
|
|
426
|
-
/**
|
|
427
|
-
* Generate a 12 byte id buffer used in ObjectID's
|
|
428
|
-
*
|
|
429
|
-
* @method
|
|
430
|
-
* @param {number} [time] optional parameter allowing to pass in a second based timestamp.
|
|
431
|
-
* @return {string} return the 12 byte id buffer string.
|
|
432
|
-
*/
|
|
433
|
-
generate: function(e) {
|
|
434
|
-
typeof e != "number" && (e = ~~(Date.now() / 1e3)), e = parseInt(e, 10) % 4294967295;
|
|
435
|
-
var r = We();
|
|
436
|
-
return String.fromCharCode(
|
|
437
|
-
e >> 24 & 255,
|
|
438
|
-
e >> 16 & 255,
|
|
439
|
-
e >> 8 & 255,
|
|
440
|
-
e & 255,
|
|
441
|
-
J >> 16 & 255,
|
|
442
|
-
J >> 8 & 255,
|
|
443
|
-
J & 255,
|
|
444
|
-
me >> 8 & 255,
|
|
445
|
-
me & 255,
|
|
446
|
-
r >> 16 & 255,
|
|
447
|
-
r >> 8 & 255,
|
|
448
|
-
r & 255
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
|
-
};
|
|
452
|
-
function We() {
|
|
453
|
-
return ce = (ce + 1) % 16777215;
|
|
454
|
-
}
|
|
455
|
-
function Je(e, r) {
|
|
456
|
-
return r = r.toString(16), r.length === e ? r : "00000000".substring(r.length, e) + r;
|
|
457
|
-
}
|
|
458
|
-
var Qe = Symbol && Symbol.for && Symbol.for("nodejs.util.inspect.custom") || "inspect";
|
|
459
|
-
d.prototype[Qe] = function() {
|
|
460
|
-
return "ObjectID(" + this + ")";
|
|
461
|
-
};
|
|
462
|
-
d.prototype.toJSON = d.prototype.toHexString;
|
|
463
|
-
d.prototype.toString = d.prototype.toHexString;
|
|
464
|
-
const Ze = /* @__PURE__ */ Fe(Xe), et = {
|
|
465
|
-
key: 0,
|
|
466
|
-
class: "grid grid-cols-1 gap-8"
|
|
467
|
-
}, tt = { class: "flex items-center gap-8" }, nt = { class: "flex items-center gap-8" }, ot = 5, at = /* @__PURE__ */ ee({
|
|
468
|
-
__name: "CardDesignSheet",
|
|
469
|
-
emits: ["success"],
|
|
470
|
-
setup(e, { expose: r, emit: V }) {
|
|
471
|
-
const { minor: I } = ne, h = oe(), E = xe(), v = b(!1);
|
|
472
|
-
b(), b(!1);
|
|
473
|
-
const c = b(), y = b(null);
|
|
474
|
-
L(() => {
|
|
475
|
-
var u, s;
|
|
476
|
-
return Math.min((((s = (u = c.value) == null ? void 0 : u.design) == null ? void 0 : s.length) ?? 0) + 1, ot);
|
|
477
|
-
});
|
|
478
|
-
const j = V, i = L(() => {
|
|
479
|
-
var u, s;
|
|
480
|
-
return ((s = (u = h.membership) == null ? void 0 : u.design) == null ? void 0 : s.filter((o) => o.image)) || [];
|
|
481
|
-
}), k = b(!1);
|
|
482
|
-
function H(u) {
|
|
483
|
-
k.value = u;
|
|
484
|
-
}
|
|
485
|
-
function O() {
|
|
486
|
-
v.value = !0;
|
|
487
|
-
}
|
|
488
|
-
async function x() {
|
|
489
|
-
await I(
|
|
490
|
-
async () => {
|
|
491
|
-
var o;
|
|
492
|
-
const u = Re(c.value), s = De.parse(u);
|
|
493
|
-
if (s.design = (s == null ? void 0 : s.design) || [], y.value) {
|
|
494
|
-
const l = Ze().toHexString(), n = await le.update(
|
|
495
|
-
le.designPath(l, y.value),
|
|
496
|
-
y.value
|
|
497
|
-
);
|
|
498
|
-
(o = s.design) == null || o.push({
|
|
499
|
-
_id: l,
|
|
500
|
-
image: n
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
await ae.update(s), await N(), await j("success"), y.value = null, v.value = !1;
|
|
504
|
-
},
|
|
505
|
-
{
|
|
506
|
-
message: "Saving card design",
|
|
507
|
-
successMessage: "Card design saved"
|
|
508
|
-
}
|
|
509
|
-
);
|
|
510
|
-
}
|
|
511
|
-
async function w(u, s) {
|
|
512
|
-
u ? y.value = u : s && E.open({
|
|
513
|
-
title: "Delete Design",
|
|
514
|
-
message: "Are you sure you want to delete this design?",
|
|
515
|
-
primaryActions: { text: "Delete", close: !0 },
|
|
516
|
-
secondaryActions: { text: "Cancel", close: !1 }
|
|
517
|
-
}).onPrimary(async () => {
|
|
518
|
-
var l, n;
|
|
519
|
-
const o = (l = c.value.design) == null ? void 0 : l.findIndex((M) => M._id == s);
|
|
520
|
-
console.log(o), o !== -1 && ((n = c.value.design) == null || n.splice(o, 1)), await x();
|
|
521
|
-
}).onSecondary(() => {
|
|
522
|
-
E.close();
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
async function N() {
|
|
526
|
-
await h.readMembership(), c.value = h.membership;
|
|
527
|
-
}
|
|
528
|
-
return r({
|
|
529
|
-
showSheet: H
|
|
530
|
-
}), te(async () => {
|
|
531
|
-
await N(), i.value.length || (v.value = !0);
|
|
532
|
-
}), (u, s) => {
|
|
533
|
-
const o = f("FmButton"), l = f("FmSideSheet");
|
|
534
|
-
return _(), F(l, {
|
|
535
|
-
"max-width": 560,
|
|
536
|
-
"dismiss-away": !0,
|
|
537
|
-
header: "Manage Design",
|
|
538
|
-
modelValue: t(k),
|
|
539
|
-
"onUpdate:modelValue": [
|
|
540
|
-
s[2] || (s[2] = (n) => Q(k) ? k.value = n : null),
|
|
541
|
-
s[3] || (s[3] = (n) => k.value = n)
|
|
542
|
-
]
|
|
543
|
-
}, Se({
|
|
544
|
-
default: C(() => [
|
|
545
|
-
t(v) ? D("", !0) : (_(), R("div", et, [
|
|
546
|
-
(_(!0), R(B, null, Z(t(i), (n) => (_(), F(de, {
|
|
547
|
-
key: String(n._id),
|
|
548
|
-
"image-fit": "cover",
|
|
549
|
-
label: "",
|
|
550
|
-
"aspect-ratio": "16/9",
|
|
551
|
-
thumbnail: n.image,
|
|
552
|
-
accept: ".png, .jpg, .jpeg, .gif",
|
|
553
|
-
"recommended-size": "Recommended 16:9 ratio / 1280px x 720px",
|
|
554
|
-
file: void 0,
|
|
555
|
-
"delete-button": !1
|
|
556
|
-
}, {
|
|
557
|
-
"delete-button": C(() => [
|
|
558
|
-
p(o, {
|
|
559
|
-
class: "!text-neutral-50 !bg-neutral-700",
|
|
560
|
-
icon: "delete",
|
|
561
|
-
variant: "tertiary",
|
|
562
|
-
onClick: (M) => w(null, n._id)
|
|
563
|
-
}, null, 8, ["onClick"])
|
|
564
|
-
]),
|
|
565
|
-
_: 2
|
|
566
|
-
}, 1032, ["thumbnail"]))), 128))
|
|
567
|
-
])),
|
|
568
|
-
t(v) ? (_(), F(de, {
|
|
569
|
-
key: 1,
|
|
570
|
-
"image-fit": "cover",
|
|
571
|
-
label: "",
|
|
572
|
-
"aspect-ratio": "16/9",
|
|
573
|
-
accept: ".png, .jpg, .jpeg, .gif",
|
|
574
|
-
"recommended-size": "Recommended 16:9 ratio / 1280px x 720px",
|
|
575
|
-
"onUpdate:file": w
|
|
576
|
-
})) : D("", !0)
|
|
577
|
-
]),
|
|
578
|
-
_: 2
|
|
579
|
-
}, [
|
|
580
|
-
t(v) ? {
|
|
581
|
-
name: "side-sheet-footer",
|
|
582
|
-
fn: C(() => [
|
|
583
|
-
m("div", nt, [
|
|
584
|
-
p(o, {
|
|
585
|
-
label: "Save",
|
|
586
|
-
onClick: x,
|
|
587
|
-
disabled: !t(y)
|
|
588
|
-
}, null, 8, ["disabled"]),
|
|
589
|
-
p(o, {
|
|
590
|
-
label: "Cancel",
|
|
591
|
-
type: "button",
|
|
592
|
-
variant: "tertiary",
|
|
593
|
-
onClick: s[1] || (s[1] = (n) => v.value = !1)
|
|
594
|
-
})
|
|
595
|
-
])
|
|
596
|
-
]),
|
|
597
|
-
key: "1"
|
|
598
|
-
} : {
|
|
599
|
-
name: "side-sheet-footer",
|
|
600
|
-
fn: C(() => [
|
|
601
|
-
m("div", tt, [
|
|
602
|
-
p(o, {
|
|
603
|
-
label: "Add Design",
|
|
604
|
-
onClick: O
|
|
605
|
-
}),
|
|
606
|
-
p(o, {
|
|
607
|
-
label: "Cancel",
|
|
608
|
-
type: "button",
|
|
609
|
-
variant: "tertiary",
|
|
610
|
-
onClick: s[0] || (s[0] = (n) => k.value = !1)
|
|
611
|
-
})
|
|
612
|
-
])
|
|
613
|
-
]),
|
|
614
|
-
key: "0"
|
|
615
|
-
}
|
|
616
|
-
]), 1032, ["modelValue"]);
|
|
617
|
-
};
|
|
618
|
-
}
|
|
619
|
-
}), st = { class: "flex items-center" }, it = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, rt = { class: "px-24 flex flex-col pb-24 gap-y-16" }, lt = { class: "flex items-center justify-end" }, pt = { class: "flex flex-col gap-16 text-center" }, dt = { class: "fm-typo-en-title-sm-800" }, ct = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, mt = { class: "flex gap-x-8" }, Ut = /* @__PURE__ */ ee({
|
|
620
|
-
__name: "Card",
|
|
621
|
-
setup(e) {
|
|
622
|
-
const { minor: r, global: V } = ne, I = b(), h = b(), E = Ve(), v = oe(), { t: c } = Ne(), y = L(
|
|
623
|
-
() => v.sortedStoreCategories.flatMap((s) => s.bundles)
|
|
624
|
-
), j = [
|
|
625
|
-
{
|
|
626
|
-
header: c("connect.loyalty.card.table.card_number"),
|
|
627
|
-
accessorFn: (s) => s.serialNumber
|
|
628
|
-
},
|
|
629
|
-
{
|
|
630
|
-
header: c("connect.loyalty.card.table.redeemed_by"),
|
|
631
|
-
accessorKey: "user",
|
|
632
|
-
enableSorting: !1,
|
|
633
|
-
cell(s) {
|
|
634
|
-
const o = s.row.original.pf_member;
|
|
635
|
-
return Y(
|
|
636
|
-
"div",
|
|
637
|
-
{
|
|
638
|
-
class: "flex items-center gap-x-8"
|
|
639
|
-
},
|
|
640
|
-
[
|
|
641
|
-
Y(Ee.FmAvatar, {
|
|
642
|
-
name: o != null && o.photoUrl || o == null ? void 0 : o.name,
|
|
643
|
-
src: (o == null ? void 0 : o.photoUrl) ?? void 0,
|
|
644
|
-
size: "sm"
|
|
645
|
-
}),
|
|
646
|
-
Y("span", { class: "fm-typo-en-body-sm-400" }, o == null ? void 0 : o.name)
|
|
647
|
-
]
|
|
648
|
-
);
|
|
649
|
-
}
|
|
650
|
-
},
|
|
651
|
-
{
|
|
652
|
-
header: c("connect.loyalty.card.table.phone"),
|
|
653
|
-
accessorFn: (s) => {
|
|
654
|
-
var o;
|
|
655
|
-
return ((o = s.pf_member) == null ? void 0 : o.phoneNumber) || "-";
|
|
656
|
-
},
|
|
657
|
-
accessorKey: "pf_member.phoneNumber"
|
|
658
|
-
},
|
|
659
|
-
{
|
|
660
|
-
header: c("connect.loyalty.card.table.created_at"),
|
|
661
|
-
accessorKey: "_id",
|
|
662
|
-
accessorFn: (s) => re(Ue(s._id.toString())).format("DD MMM YYYY hh:mmA")
|
|
663
|
-
},
|
|
664
|
-
{
|
|
665
|
-
header: c("connect.loyalty.card.table.bundle"),
|
|
666
|
-
accessorFn: (s) => {
|
|
667
|
-
var o;
|
|
668
|
-
return ((o = y.value.find((l) => l._id === s.bundle)) == null ? void 0 : o.name) || "-";
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
{
|
|
672
|
-
header: c("connect.loyalty.card.table.redeemed_at"),
|
|
673
|
-
accessorKey: "redeemedAt",
|
|
674
|
-
accessorFn: (s) => s.redeemedAt ? re(s.redeemedAt).format("DD MMM YYYY hh:mmA") : "-"
|
|
675
|
-
}
|
|
676
|
-
], { tableMeta: i, rowData: k, onSort: H, debouncedFetchData: O, onSearch: x } = Te(ae.readCards);
|
|
677
|
-
async function w() {
|
|
678
|
-
var s;
|
|
679
|
-
await O(), (s = I.value) == null || s.showSheet(!1);
|
|
680
|
-
}
|
|
681
|
-
const N = L(() => E.isPremium ? [
|
|
682
|
-
{
|
|
683
|
-
label: c("connect.loyalty.card.actions.create"),
|
|
684
|
-
value: "create",
|
|
685
|
-
isPrimary: !0
|
|
686
|
-
},
|
|
687
|
-
{
|
|
688
|
-
label: c("connect.loyalty.card.actions.manage_design"),
|
|
689
|
-
value: "design",
|
|
690
|
-
isPrimary: !0
|
|
691
|
-
}
|
|
692
|
-
] : []);
|
|
693
|
-
async function u(s) {
|
|
694
|
-
const o = new Oe(), l = s.map((n) => ({
|
|
695
|
-
CardNumber: n
|
|
696
|
-
}));
|
|
697
|
-
o.addRecords(l), await Me(
|
|
698
|
-
o.buildExcel(),
|
|
699
|
-
`cards-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
|
|
700
|
-
{
|
|
701
|
-
bookType: "xlsx",
|
|
702
|
-
bookSST: !1,
|
|
703
|
-
type: "array"
|
|
704
|
-
}
|
|
705
|
-
);
|
|
706
|
-
}
|
|
707
|
-
return te(async () => {
|
|
708
|
-
await V(async () => {
|
|
709
|
-
await E.readPremium(), await v.readMemberStore(), await v.readMembership(), await w();
|
|
710
|
-
});
|
|
711
|
-
}), (s, o) => {
|
|
712
|
-
const l = f("FmPill"), n = f("FmPageHead"), M = f("FmSearch"), T = f("FmButton"), U = f("FmCard");
|
|
713
|
-
return _(), R(B, null, [
|
|
714
|
-
p(n, {
|
|
715
|
-
title: t(c)("connect.loyalty.card.title"),
|
|
716
|
-
actions: t(N),
|
|
717
|
-
"onClick:action": o[0] || (o[0] = (g) => {
|
|
718
|
-
var G, P;
|
|
719
|
-
console.log(g), g === "design" && ((G = t(h)) == null || G.showSheet(!0)), g === "create" && ((P = t(I)) == null || P.showSheet(!0));
|
|
720
|
-
})
|
|
721
|
-
}, {
|
|
722
|
-
title: C(() => [
|
|
723
|
-
m("div", st, [
|
|
724
|
-
m("span", it, X(t(c)("connect.loyalty.card.title")), 1),
|
|
725
|
-
p(l, {
|
|
726
|
-
class: "ml-8",
|
|
727
|
-
variant: "premium"
|
|
728
|
-
})
|
|
729
|
-
])
|
|
730
|
-
]),
|
|
731
|
-
_: 1
|
|
732
|
-
}, 8, ["title", "actions"]),
|
|
733
|
-
m("div", rt, [
|
|
734
|
-
t(k).length > 0 || t(k).length <= 0 && t(i).searchValue || t(i).pageCount > 0 ? (_(), R(B, { key: 0 }, [
|
|
735
|
-
m("div", lt, [
|
|
736
|
-
p(M, {
|
|
737
|
-
class: "mt-4",
|
|
738
|
-
modelValue: t(i).searchValue,
|
|
739
|
-
"onUpdate:modelValue": [
|
|
740
|
-
o[1] || (o[1] = (g) => t(i).searchValue = g),
|
|
741
|
-
t(x)
|
|
742
|
-
],
|
|
743
|
-
placeholder: "Search",
|
|
744
|
-
collapsible: ""
|
|
745
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
746
|
-
p(T, {
|
|
747
|
-
icon: "ios_share",
|
|
748
|
-
variant: "tertiary",
|
|
749
|
-
onClick: ke(t(Ie), ["prevent"])
|
|
750
|
-
}, null, 8, ["onClick"])
|
|
751
|
-
]),
|
|
752
|
-
p(Pe, {
|
|
753
|
-
loading: t(i).isLoading,
|
|
754
|
-
"row-data": t(k),
|
|
755
|
-
"row-count": t(i).totalRows,
|
|
756
|
-
"column-defs": j,
|
|
757
|
-
"shrink-at": !1,
|
|
758
|
-
"page-count": t(i).pageCount,
|
|
759
|
-
"page-index": t(i).pageIndex,
|
|
760
|
-
"page-size": t(i).pageSize,
|
|
761
|
-
onSortChange: t(H),
|
|
762
|
-
onPageChange: o[2] || (o[2] = (g) => {
|
|
763
|
-
t(O)({
|
|
764
|
-
pageSize: g.pageSize,
|
|
765
|
-
pageIndex: g.pageIndex
|
|
766
|
-
});
|
|
767
|
-
})
|
|
768
|
-
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
|
|
769
|
-
], 64)) : (_(), F(U, {
|
|
770
|
-
key: 1,
|
|
771
|
-
variant: "outlined",
|
|
772
|
-
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
773
|
-
}, {
|
|
774
|
-
default: C(() => [
|
|
775
|
-
o[5] || (o[5] = m("img", {
|
|
776
|
-
src: Ce,
|
|
777
|
-
class: "aspect-square w-[150px]"
|
|
778
|
-
}, null, -1)),
|
|
779
|
-
m("div", pt, [
|
|
780
|
-
m("div", dt, X(t(c)("connect.loyalty.card.empty_state.title")), 1),
|
|
781
|
-
m("div", ct, X(t(c)("connect.loyalty.card.empty_state.description")), 1)
|
|
782
|
-
]),
|
|
783
|
-
m("div", mt, [
|
|
784
|
-
p(T, {
|
|
785
|
-
variant: "primary",
|
|
786
|
-
label: t(c)("connect.loyalty.card.actions.add"),
|
|
787
|
-
icon: "add",
|
|
788
|
-
disabled: !t(E).isPremium,
|
|
789
|
-
onClick: o[3] || (o[3] = () => {
|
|
790
|
-
var g;
|
|
791
|
-
return (g = t(I)) == null ? void 0 : g.showSheet(!0);
|
|
792
|
-
})
|
|
793
|
-
}, null, 8, ["label", "disabled"]),
|
|
794
|
-
p(T, {
|
|
795
|
-
variant: "secondary",
|
|
796
|
-
label: t(c)("connect.loyalty.card.actions.manage_design"),
|
|
797
|
-
disabled: !t(E).isPremium,
|
|
798
|
-
onClick: o[4] || (o[4] = () => {
|
|
799
|
-
var g;
|
|
800
|
-
return (g = t(h)) == null ? void 0 : g.showSheet(!0);
|
|
801
|
-
})
|
|
802
|
-
}, null, 8, ["label", "disabled"])
|
|
803
|
-
])
|
|
804
|
-
]),
|
|
805
|
-
_: 1
|
|
806
|
-
})),
|
|
807
|
-
p(Ye, {
|
|
808
|
-
ref_key: "sheetRef",
|
|
809
|
-
ref: I,
|
|
810
|
-
onSuccess: w,
|
|
811
|
-
onExport: u
|
|
812
|
-
}, null, 512),
|
|
813
|
-
p(at, {
|
|
814
|
-
ref_key: "designSheetRef",
|
|
815
|
-
ref: h,
|
|
816
|
-
onSuccess: w
|
|
817
|
-
}, null, 512)
|
|
818
|
-
])
|
|
819
|
-
], 64);
|
|
820
|
-
};
|
|
821
|
-
}
|
|
822
|
-
});
|
|
823
|
-
export {
|
|
824
|
-
Ut as default
|
|
825
|
-
};
|