@feedmepos/mf-connect 0.1.47-prod → 0.1.49-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-AnuRQDA4.js → Analytic-ibBD_21m.js} +113 -113
- package/dist/{App-DP_jCyej.js → App-CDjwWK8a.js} +632 -622
- package/dist/{Bin-tL4lF6PB.js → Bin-DCaG0YGW.js} +9 -9
- package/dist/Broadcast-CbF3d_N7.js +233 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BgPJCH02.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BqYusgBO.js} +18 -18
- package/dist/{Card-Bi-ODgCc.js → Card-CDNE85po.js} +239 -239
- package/dist/{Collections-JHWotZ1I.js → Collections-DHn__E9U.js} +31 -31
- package/dist/Credit-DiTnwnFe.js +228 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-hxuYl-OQ.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BJEAsRON.js} +756 -753
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-ECkaQxuI.js → EffectSheet.vue_vue_type_style_index_0_lang-CU9XpMjd.js} +96 -96
- package/dist/Experience-CjMVeGsX.js +229 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/{Game-DUCx2Dl9.js → Game-D3gANFAo.js} +98 -92
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +144 -0
- package/dist/{Index-zynxjOOr.js → Index-DEF_a5Mu.js} +54 -54
- package/dist/{Marketing-BBHDVRkR.js → Marketing-BeED4Y7H.js} +24 -24
- package/dist/{Member-B09bj6C3.js → Member-CA4hnHJY.js} +63 -63
- package/dist/MemberList-CZtriA_Q.js +1606 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/{MemberTransactions-DERMSs7o.js → MemberTransactions-BVrvf4AM.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CAADF6vv.js → MessageInput.vue_vue_type_script_setup_true_lang-BqTDGnOG.js} +2286 -2220
- package/dist/{Mission-DAv0e_ZH.js → Mission-CDSMpqnG.js} +113 -107
- package/dist/{Overview-D0rBTEtP.js → Overview-ArineqY4.js} +337 -337
- package/dist/Point-51MD49EM.js +232 -0
- package/dist/{Promotion-BSPU5hP9.js → Promotion-BVrofYd6.js} +43 -43
- package/dist/{Queue-C5IFJ3iE.js → Queue-Q-aEeZ8w.js} +13 -13
- package/dist/{Record-CoFSrv7j.js → Record-DaVcschI.js} +10 -10
- package/dist/{Reward-COIOBOl-.js → Reward-DTtFuqOZ.js} +173 -173
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B9Tl7hqv.js → RewardGroup.vue_vue_type_script_setup_true_lang-P_gNd6ZP.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BzsYC3k2.js → RuleGroup.vue_vue_type_script_setup_true_lang-CVy_kDmy.js} +381 -381
- package/dist/{Segment-DF5SrucQ.js → Segment-DIy4RERw.js} +327 -327
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BSSfQu3F.js → SelectItems.vue_vue_type_script_setup_true_lang-D3KIZJLo.js} +14 -14
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DoL_gTKy.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-bSi6_uqi.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cijyol1Q.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BsNLkA2v.js} +3 -3
- package/dist/Setting-DGDgmP84.js +1936 -0
- package/dist/{Store-E2_0EIy8.js → Store-Dh2uVHGY.js} +238 -238
- package/dist/StoreRewards-DFF_0g59.js +423 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DuatzcJ8.js → StoreTransactions.vue_vue_type_script_setup_true_lang-PrFhYJXc.js} +186 -186
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D_r8I0h7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-VcU2Asjy.js} +1 -1
- package/dist/{Tier-CEEHsXkC.js → Tier-yKvE4mRW.js} +106 -106
- package/dist/{Title-BMAWlGeW.js → Title-DWWSC02W.js} +95 -95
- package/dist/{Transaction-CLsceq-O.js → Transaction-ru7M0PKE.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CFLekn9O.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BSkv6hMH.js} +6 -6
- package/dist/{Voucher-Cd293WYY.js → Voucher-DmuaThKv.js} +37 -37
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Db_aeyc1.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B8HHh8HU.js → ZodTextField.vue_vue_type_script_setup_true_lang-B5co0F__.js} +1 -1
- package/dist/app-DaFoFS2V.js +57962 -0
- package/dist/{app-aVXsWATU.js → app-ja_XST5q.js} +31 -31
- package/dist/app.js +1 -1
- package/dist/{business-DVlHPzaL.js → business-BSP_3iNl.js} +11 -8
- package/dist/{campaign-D9KeUWA7.js → campaign-C1hWNRWr.js} +2 -2
- package/dist/{campaign-l-u9A514.js → campaign-DMZnXtyb.js} +10 -10
- package/dist/{campaign.enum-Cud82tES.js → campaign.enum-Bfsz7Aon.js} +1 -1
- package/dist/campaign.fn-B-xvcbEb.js +758 -0
- package/dist/{collectible.enum-PrlUDScv.js → collectible.enum-BRkrN4Bi.js} +1 -1
- package/dist/{collection.fn-yR-xnV4g.js → collection.fn-D03AXdUn.js} +2 -2
- package/dist/{dto-Cua1OHMY.js → dto-DpRkSGg6.js} +4 -4
- package/dist/{effect-B5-eXNEr.js → effect-BW1-I1J4.js} +1 -1
- package/dist/{email-addresses-BeYh5fr5.js → email-addresses-BLVkwSkP.js} +1 -1
- package/dist/{export-BUF4_DUz.js → export-DOfDownW.js} +4 -4
- package/dist/{helper-CGwOThAl.js → helper-BzfjLXgi.js} +1 -1
- package/dist/{index-DlFVLRKG.js → index-BBi9jDD1.js} +3 -3
- package/dist/{index-Cx8-ipee.js → index-BJl_HxaB.js} +6 -6
- package/dist/{index-1BGPM6Uy.js → index-Ba5-z1MU.js} +1 -1
- package/dist/{index-BmL_b0IR.js → index-Bp8F6U9V.js} +1 -1
- package/dist/{index-C-d_4n-1.js → index-C6fpU8-G.js} +1 -1
- package/dist/{index-knuJv0ti.js → index-COoQSeE7.js} +4 -4
- package/dist/{index-aMDi62-C.js → index-DTnzjEWu.js} +1 -1
- package/dist/{index-BLdVWQId.js → index-DWBeauin.js} +3 -3
- package/dist/{index-Cl2iYM2F.js → index-Da1qz9oA.js} +1 -1
- package/dist/{index-CB8iWT_p.js → index-Dve1-uYX.js} +1 -1
- package/dist/{index-ng2IXlL1.js → index-P6ISAxfQ.js} +1 -1
- package/dist/{index-hX2mE0gQ.js → index-cpWgtd-c.js} +1 -1
- package/dist/{index-D5KIp8ZB.js → index-sFyvCun2.js} +1023 -1023
- package/dist/{index-DNTd-FNx.js → index-zyVYgteg.js} +2 -2
- package/dist/{index.esm2017-D8stWFci.js → index.esm2017-DT0awUwa.js} +40 -40
- package/dist/{loading-c4b7n9Xp.js → loading-CZH88Duq.js} +1 -1
- package/dist/{membership-oBIs4sbL.js → membership-GNRX1fEK.js} +3 -3
- package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
- package/dist/{money-AP24H0gk.js → money-Xe5mDYRC.js} +1 -1
- package/dist/{number-CwsAYC_2.js → number-CAjqc2Pu.js} +1 -1
- package/dist/objectid-BQJRv_jX.js +145 -0
- package/dist/{plugins-Dn7JDHi7.js → plugins-Z2YcDTj8.js} +2 -2
- package/dist/{reward-4wdoZeXw.js → reward-G656rbLJ.js} +1 -1
- package/dist/{rule-_OJza6tn.js → rule-BJ5blBZp.js} +4 -4
- package/dist/{rule-builder-DmlhHAED.js → rule-builder-CursBigG.js} +1 -1
- package/dist/{template-BSQLFHf4.js → template-BnyUm8is.js} +63 -63
- package/dist/timezone-B64-HrWi.js +1150 -0
- package/dist/{trigger-DC9tDnI2.js → trigger-C_ih51ky.js} +4 -4
- package/dist/usePagination-Ds-cuHop.js +223 -0
- package/dist/{user-CCVOptFD.js → user-BZc_OAUj.js} +1 -1
- package/dist/{vue-i18n--_Wu1nMj.js → vue-i18n-2D47GxQX.js} +401 -401
- package/dist/{xlsx-BVMaOi8M.js → xlsx-BEk5qawh.js} +226 -226
- package/package.json +5 -4
- package/dist/Broadcast-T2a5tN8R.js +0 -227
- package/dist/Credit-DQQCXqS0.js +0 -222
- package/dist/Experience-DzTV21vX.js +0 -223
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
- package/dist/MemberList-DLSLGQ02.js +0 -1606
- package/dist/MemberOverview-C2n9oJZh.js +0 -58
- package/dist/Point-BeBYi1BT.js +0 -226
- package/dist/Setting-Dt0sG_hk.js +0 -1936
- package/dist/StoreRewards-DuSsWnTE.js +0 -423
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Qc5cCqh5.js +0 -419
- package/dist/app-jRT7vsk_.js +0 -33357
- package/dist/campaign.fn-C-UojhHv.js +0 -758
- package/dist/objectid-CVDLTdni.js +0 -145
- package/dist/usePagination-JoYaROkV.js +0 -223
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
var te = Object.defineProperty;
|
|
2
2
|
var ae = (g, i, d) => i in g ? te(g, i, { enumerable: !0, configurable: !0, writable: !0, value: d }) : g[i] = d;
|
|
3
3
|
var K = (g, i, d) => ae(g, typeof i != "symbol" ? i + "" : i, d);
|
|
4
|
-
import { defineComponent as H, ref as f, computed as J, watch as T, resolveComponent as u, openBlock as x, createBlock as z, unref as o, isRef as j, withCtx as I, createElementVNode as
|
|
5
|
-
import { h as G } from "./moment-
|
|
4
|
+
import { defineComponent as H, ref as f, computed as J, watch as T, resolveComponent as u, openBlock as x, createBlock as z, unref as o, isRef as j, withCtx as I, createElementVNode as h, createVNode as r, createElementBlock as R, Fragment as N, renderList as le, createCommentVNode as U, onMounted as ne, h as Y } from "vue";
|
|
5
|
+
import { h as G } from "./moment-D7p2TMB-.js";
|
|
6
6
|
import { components as se } from "@feedmepos/ui-library";
|
|
7
|
-
import "./index-
|
|
7
|
+
import "./index-sFyvCun2.js";
|
|
8
8
|
import { J as re } from "./JsonViewer-v8_C7l5N.js";
|
|
9
|
-
import { u as Q } from "./loading-
|
|
9
|
+
import { u as Q } from "./loading-CZH88Duq.js";
|
|
10
10
|
import { u as ie } from "./app-wDQR6dpb.js";
|
|
11
11
|
import { useRoute as W, useRouter as ue } from "vue-router";
|
|
12
|
-
import { c as P } from "./index-
|
|
12
|
+
import { c as P } from "./index-Ba5-z1MU.js";
|
|
13
13
|
import { e as p } from "./index-vh86FiIQ.js";
|
|
14
|
-
import { u as $, w as de } from "./xlsx-
|
|
15
|
-
import { g as ce } from "./user-
|
|
16
|
-
import { u as me, _ as pe } from "./usePagination-
|
|
17
|
-
import { a as fe } from "./plugins-
|
|
18
|
-
import { m as ge } from "./index-
|
|
14
|
+
import { u as $, w as de } from "./xlsx-BEk5qawh.js";
|
|
15
|
+
import { g as ce } from "./user-BZc_OAUj.js";
|
|
16
|
+
import { u as me, _ as pe } from "./usePagination-Ds-cuHop.js";
|
|
17
|
+
import { a as fe } from "./plugins-Z2YcDTj8.js";
|
|
18
|
+
import { m as ge } from "./index-DTnzjEWu.js";
|
|
19
19
|
import { o as Ce } from "./objectId-dwaoBfJX.js";
|
|
20
|
-
const be =
|
|
20
|
+
const be = { class: "space-y-16" }, ve = { class: "gap-16 grid grid-cols-2" }, he = { class: "flex items-center gap-8" }, ye = /* @__PURE__ */ H({
|
|
21
21
|
__name: "CreateCollectionSheet",
|
|
22
22
|
emits: ["success"],
|
|
23
23
|
setup(g, { expose: i, emit: d }) {
|
|
@@ -93,7 +93,7 @@ const be = /* @__PURE__ */ v("div", { class: "fm-typo-en-body-lg-600" }, "Code t
|
|
|
93
93
|
function l(s) {
|
|
94
94
|
if (c.value !== "single") return !1;
|
|
95
95
|
const e = s.split(`
|
|
96
|
-
`).map((
|
|
96
|
+
`).map((v) => v.trim()).filter(Boolean);
|
|
97
97
|
return new Set(e).size !== e.length;
|
|
98
98
|
}
|
|
99
99
|
function b(s) {
|
|
@@ -110,7 +110,7 @@ const be = /* @__PURE__ */ v("div", { class: "fm-typo-en-body-lg-600" }, "Code t
|
|
|
110
110
|
s != e && (a.value.codeConfig.length = (a.value.codeConfig.pattern.match(/#/g) || []).length);
|
|
111
111
|
}
|
|
112
112
|
), (s, e) => {
|
|
113
|
-
const
|
|
113
|
+
const v = u("FmRadio"), M = u("FmRadioGroup"), m = u("FmSwitch"), L = u("FmStepperField"), X = u("FmSelect"), _ = u("FmTextField"), Z = u("FmTextarea"), ee = u("FmForm"), O = u("FmButton"), oe = u("FmSideSheet");
|
|
114
114
|
return x(), z(oe, {
|
|
115
115
|
"max-width": 560,
|
|
116
116
|
"dismiss-away": !0,
|
|
@@ -122,7 +122,7 @@ const be = /* @__PURE__ */ v("div", { class: "fm-typo-en-body-lg-600" }, "Code t
|
|
|
122
122
|
]
|
|
123
123
|
}, {
|
|
124
124
|
"side-sheet-footer": I(() => [
|
|
125
|
-
|
|
125
|
+
h("div", he, [
|
|
126
126
|
r(O, {
|
|
127
127
|
label: "Save",
|
|
128
128
|
onClick: e[12] || (e[12] = (t) => n(o(a))),
|
|
@@ -146,15 +146,15 @@ const be = /* @__PURE__ */ v("div", { class: "fm-typo-en-body-lg-600" }, "Code t
|
|
|
146
146
|
onValidationFailed: e[11] || (e[11] = (t) => k.value = !1)
|
|
147
147
|
}, {
|
|
148
148
|
default: I(() => [
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
h("div", null, [
|
|
150
|
+
e[16] || (e[16] = h("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
|
|
151
151
|
r(M, {
|
|
152
152
|
modelValue: o(c),
|
|
153
153
|
"onUpdate:modelValue": e[0] || (e[0] = (t) => j(c) ? c.value = t : null),
|
|
154
154
|
inline: !1
|
|
155
155
|
}, {
|
|
156
156
|
default: I(() => [
|
|
157
|
-
(x(), R(N, null, le(E, (t) => r(
|
|
157
|
+
(x(), R(N, null, le(E, (t) => r(v, {
|
|
158
158
|
key: t.value,
|
|
159
159
|
value: t.value,
|
|
160
160
|
label: t.label,
|
|
@@ -164,8 +164,8 @@ const be = /* @__PURE__ */ v("div", { class: "fm-typo-en-body-lg-600" }, "Code t
|
|
|
164
164
|
_: 1
|
|
165
165
|
}, 8, ["modelValue"])
|
|
166
166
|
]),
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
h("div", be, [
|
|
168
|
+
e[17] || (e[17] = h("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
|
|
169
169
|
o(c) === "bulk" ? (x(), R(N, { key: 0 }, [
|
|
170
170
|
r(m, {
|
|
171
171
|
"model-value": o(V),
|
|
@@ -204,7 +204,7 @@ const be = /* @__PURE__ */ v("div", { class: "fm-typo-en-body-lg-600" }, "Code t
|
|
|
204
204
|
label: "Custom Charset",
|
|
205
205
|
required: ""
|
|
206
206
|
}, null, 8, ["modelValue"])) : U("", !0),
|
|
207
|
-
|
|
207
|
+
h("div", ve, [
|
|
208
208
|
r(_, {
|
|
209
209
|
modelValue: o(a).codeConfig.prefix,
|
|
210
210
|
"onUpdate:modelValue": e[5] || (e[5] = (t) => o(a).codeConfig.prefix = t),
|
|
@@ -257,7 +257,7 @@ const be = /* @__PURE__ */ v("div", { class: "fm-typo-en-body-lg-600" }, "Code t
|
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
|
-
class
|
|
260
|
+
class xe {
|
|
261
261
|
constructor() {
|
|
262
262
|
K(this, "data", []);
|
|
263
263
|
}
|
|
@@ -269,7 +269,7 @@ class Se {
|
|
|
269
269
|
return $.book_append_sheet(i, d, "Collection"), i;
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
const
|
|
272
|
+
const Ve = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Se = { class: "flex items-center justify-end py-4 xs:hidden" }, ze = /* @__PURE__ */ H({
|
|
273
273
|
__name: "Collections",
|
|
274
274
|
setup(g) {
|
|
275
275
|
const i = ue(), d = W(), S = f(), w = J(() => d.params.id), F = f(!1), { custom: k } = Q, q = [
|
|
@@ -346,14 +346,14 @@ const we = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Fe = { class: "flex
|
|
|
346
346
|
F.value || k(
|
|
347
347
|
async () => {
|
|
348
348
|
var s;
|
|
349
|
-
const n = new
|
|
349
|
+
const n = new xe(), l = (await P.readCollectionsByCampaignId(w.value, {
|
|
350
350
|
limit: 1,
|
|
351
351
|
skip: 0,
|
|
352
352
|
sortBy: p.sortBy,
|
|
353
353
|
descending: p.descending
|
|
354
354
|
})).meta.totalResources ?? 0, b = p.rowsPerPage;
|
|
355
355
|
for (let e = 0; e < l; e += b) {
|
|
356
|
-
const
|
|
356
|
+
const v = {
|
|
357
357
|
...p,
|
|
358
358
|
limit: b,
|
|
359
359
|
skip: p.page - 1,
|
|
@@ -361,7 +361,7 @@ const we = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Fe = { class: "flex
|
|
|
361
361
|
descending: p.descending
|
|
362
362
|
}, M = await P.readCollectionsByCampaignId(
|
|
363
363
|
w.value,
|
|
364
|
-
|
|
364
|
+
v
|
|
365
365
|
);
|
|
366
366
|
for await (const m of M.resources) {
|
|
367
367
|
const L = {
|
|
@@ -405,11 +405,11 @@ const we = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Fe = { class: "flex
|
|
|
405
405
|
],
|
|
406
406
|
"onClick:back": l[0] || (l[0] = (e) => o(i).back()),
|
|
407
407
|
"onClick:action": l[1] || (l[1] = (e) => {
|
|
408
|
-
var
|
|
409
|
-
e === "create" && ((
|
|
408
|
+
var v;
|
|
409
|
+
e === "create" && ((v = o(S)) == null || v.showSheet(!0)), e === "export" && A();
|
|
410
410
|
})
|
|
411
411
|
}),
|
|
412
|
-
|
|
412
|
+
h("div", Ve, [
|
|
413
413
|
r(s, {
|
|
414
414
|
class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
|
|
415
415
|
modelValue: o(a).searchValue,
|
|
@@ -420,7 +420,7 @@ const we = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Fe = { class: "flex
|
|
|
420
420
|
placeholder: "Search",
|
|
421
421
|
collapsible: ""
|
|
422
422
|
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
423
|
-
|
|
423
|
+
h("div", Se, [
|
|
424
424
|
r(s, {
|
|
425
425
|
modelValue: o(a).searchValue,
|
|
426
426
|
"onUpdate:modelValue": [
|
|
@@ -443,7 +443,7 @@ const we = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Fe = { class: "flex
|
|
|
443
443
|
onSortChange: o(B),
|
|
444
444
|
onPageChange: l[4] || (l[4] = (e) => o(y)({ pageSize: e.pageSize, pageIndex: e.pageIndex }))
|
|
445
445
|
}, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
|
|
446
|
-
r(
|
|
446
|
+
r(ye, {
|
|
447
447
|
ref_key: "sheetRef",
|
|
448
448
|
ref: S,
|
|
449
449
|
onSuccess: V
|
|
@@ -454,5 +454,5 @@ const we = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Fe = { class: "flex
|
|
|
454
454
|
}
|
|
455
455
|
});
|
|
456
456
|
export {
|
|
457
|
-
|
|
457
|
+
ze as default
|
|
458
458
|
};
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { defineComponent as N, ref as L, computed as j, h as M, onMounted as H, resolveComponent as m, openBlock as d, createElementBlock as y, Fragment as h, createVNode as i, unref as t, createElementVNode as n, withCtx as C, renderList as q, createBlock as w, resolveDynamicComponent as O, toDisplayString as g, createCommentVNode as z } from "vue";
|
|
2
|
+
import { _ as G } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as J, components as Q } from "@feedmepos/ui-library";
|
|
4
|
+
import { p as W } from "./plugins-Z2YcDTj8.js";
|
|
5
|
+
import { u as X } from "./loading-CZH88Duq.js";
|
|
6
|
+
import { u as Y } from "./business-BSP_3iNl.js";
|
|
7
|
+
import { u as Z } from "./campaign-C1hWNRWr.js";
|
|
8
|
+
import { g as ee, a as S, b as V } from "./campaign-DMZnXtyb.js";
|
|
9
|
+
import { u as oe } from "./vue-i18n-2D47GxQX.js";
|
|
10
|
+
import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
|
|
11
|
+
import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BJEAsRON.js";
|
|
12
|
+
import { u as ne } from "./template-BnyUm8is.js";
|
|
13
|
+
import { c as _ } from "./index-Ba5-z1MU.js";
|
|
14
|
+
const re = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, le = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, ue = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { key: 0 }, Ie = /* @__PURE__ */ N({
|
|
15
|
+
__name: "Credit",
|
|
16
|
+
setup(ge) {
|
|
17
|
+
const { t: r } = oe(), B = {
|
|
18
|
+
label: r("connect.program.common.actions.create", {
|
|
19
|
+
type: r("connect.program.credit.title").toLowerCase()
|
|
20
|
+
}),
|
|
21
|
+
value: "create",
|
|
22
|
+
isPrimary: !0,
|
|
23
|
+
prependIcon: "add"
|
|
24
|
+
}, I = ne("CREDIT", J()), R = Y(), u = Z(), { global: D, minor: v } = X, s = L({
|
|
25
|
+
searchKey: "",
|
|
26
|
+
location: []
|
|
27
|
+
});
|
|
28
|
+
function T(e) {
|
|
29
|
+
const o = s.value.location;
|
|
30
|
+
return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((l) => {
|
|
31
|
+
var c;
|
|
32
|
+
return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
|
|
33
|
+
}) : e.targetLocation.includes(o);
|
|
34
|
+
}
|
|
35
|
+
const p = j(
|
|
36
|
+
() => u.campaigns.credit.filter((e) => T(e))
|
|
37
|
+
), E = [
|
|
38
|
+
{
|
|
39
|
+
header: r("connect.program.common.table.title"),
|
|
40
|
+
accessorFn: (e) => e.name
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
header: r("connect.program.common.table.status"),
|
|
44
|
+
accessorFn: (e) => ee(e),
|
|
45
|
+
cell(e) {
|
|
46
|
+
return S(e.row.original);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
header: r("connect.program.common.table.summary"),
|
|
51
|
+
accessorFn: (e) => V(e)
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
header: r("connect.program.common.table.actions"),
|
|
55
|
+
cell(e) {
|
|
56
|
+
return M(Q.FmButton, {
|
|
57
|
+
variant: "tertiary",
|
|
58
|
+
icon: "delete",
|
|
59
|
+
iconColor: "neutral-gray-400",
|
|
60
|
+
onClick: (o) => {
|
|
61
|
+
o.stopPropagation(), x(e.row.original);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
], b = L();
|
|
67
|
+
async function x(e) {
|
|
68
|
+
await W.remove(
|
|
69
|
+
r("connect.program.common.remove.confirm", { name: e.name })
|
|
70
|
+
) && await v(
|
|
71
|
+
async () => {
|
|
72
|
+
await _.delete(e._id), await u.read("CREDIT");
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
message: r("connect.program.common.remove.removing", { name: e.name }),
|
|
76
|
+
successMessage: r("connect.program.common.remove.removed", {
|
|
77
|
+
name: e.name
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
async function f(e) {
|
|
83
|
+
e ? await o() : I.open(async (l) => {
|
|
84
|
+
await o(l);
|
|
85
|
+
});
|
|
86
|
+
async function o(l) {
|
|
87
|
+
var c;
|
|
88
|
+
(c = b.value) == null || c.showSheet(
|
|
89
|
+
!0,
|
|
90
|
+
"CREDIT",
|
|
91
|
+
e ? await _.readById(e._id) : void 0,
|
|
92
|
+
l
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function K(e) {
|
|
97
|
+
await v(
|
|
98
|
+
async () => {
|
|
99
|
+
e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await u.read("CREDIT");
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
message: `${e.campaign._id ? "Updating" : "Creating"} credit program`,
|
|
103
|
+
successMessage: `Credit program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
return H(async () => {
|
|
108
|
+
await D(async () => {
|
|
109
|
+
await u.read("CREDIT");
|
|
110
|
+
});
|
|
111
|
+
}), (e, o) => {
|
|
112
|
+
const l = m("FmPageHead"), c = m("FmSearch"), $ = m("FmTable"), F = m("FmButton"), P = m("FmListItem"), U = m("FmList"), A = m("FmCard");
|
|
113
|
+
return d(), y(h, null, [
|
|
114
|
+
i(l, {
|
|
115
|
+
title: t(r)("connect.program.credit.title"),
|
|
116
|
+
actions: t(p).length > 0 ? [B] : [],
|
|
117
|
+
"onClick:action": o[0] || (o[0] = () => f())
|
|
118
|
+
}, null, 8, ["title", "actions"]),
|
|
119
|
+
n("div", re, [
|
|
120
|
+
i(c, {
|
|
121
|
+
modelValue: t(s).searchKey,
|
|
122
|
+
"onUpdate:modelValue": o[1] || (o[1] = (a) => t(s).searchKey = a),
|
|
123
|
+
class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
|
|
124
|
+
placeholder: "search",
|
|
125
|
+
collapsible: ""
|
|
126
|
+
}, null, 8, ["modelValue"]),
|
|
127
|
+
t(u).campaigns.credit && t(u).campaigns.credit.length > 0 ? (d(), y(h, { key: 0 }, [
|
|
128
|
+
n("div", se, [
|
|
129
|
+
n("div", ie, [
|
|
130
|
+
i(te, {
|
|
131
|
+
label: `${t(r)("connect.common.location")}: `,
|
|
132
|
+
"right-icon": "keyboard_arrow_down",
|
|
133
|
+
modelValue: t(s).location,
|
|
134
|
+
"onUpdate:modelValue": o[2] || (o[2] = (a) => t(s).location = a),
|
|
135
|
+
icon: "storefront",
|
|
136
|
+
"show-item-label": !0,
|
|
137
|
+
items: t(R).locationOptions
|
|
138
|
+
}, null, 8, ["label", "modelValue", "items"])
|
|
139
|
+
]),
|
|
140
|
+
i(c, {
|
|
141
|
+
modelValue: t(s).searchKey,
|
|
142
|
+
"onUpdate:modelValue": o[3] || (o[3] = (a) => t(s).searchKey = a),
|
|
143
|
+
class: "xs:hidden",
|
|
144
|
+
placeholder: "search",
|
|
145
|
+
collapsible: ""
|
|
146
|
+
}, null, 8, ["modelValue"])
|
|
147
|
+
]),
|
|
148
|
+
i($, {
|
|
149
|
+
class: "xs:hidden",
|
|
150
|
+
"row-data": t(p),
|
|
151
|
+
"column-defs": E,
|
|
152
|
+
"search-value": t(s).searchKey,
|
|
153
|
+
"column-filter": [],
|
|
154
|
+
onRowClick: o[4] || (o[4] = (a) => f(a.original)),
|
|
155
|
+
"hide-footer": t(p).length < 10
|
|
156
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
157
|
+
i(U, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
|
|
158
|
+
default: C(() => [
|
|
159
|
+
(d(!0), y(h, null, q(t(p).filter(
|
|
160
|
+
(a) => a.name.toLowerCase().includes(t(s).searchKey.toLowerCase())
|
|
161
|
+
), (a) => (d(), w(P, {
|
|
162
|
+
key: a._id.toString(),
|
|
163
|
+
onClick: (k) => f(a),
|
|
164
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
165
|
+
}, {
|
|
166
|
+
default: C(() => [
|
|
167
|
+
n("div", ce, [
|
|
168
|
+
n("div", le, [
|
|
169
|
+
(d(), w(O(t(S)(a)))),
|
|
170
|
+
n("div", me, g(a.currentReceive ?? 0) + " used ", 1)
|
|
171
|
+
]),
|
|
172
|
+
n("div", de, [
|
|
173
|
+
n("div", ue, g(a.name), 1),
|
|
174
|
+
n("div", pe, g(t(V)(a)), 1)
|
|
175
|
+
]),
|
|
176
|
+
n("div", fe, " Credit received: " + g(a.currentReceive ?? 0), 1)
|
|
177
|
+
]),
|
|
178
|
+
i(F, {
|
|
179
|
+
icon: "delete",
|
|
180
|
+
"icon-color": "neutral-gray-400",
|
|
181
|
+
variant: "tertiary",
|
|
182
|
+
onClick: (k) => (k.stopPropagation(), x(a))
|
|
183
|
+
}, null, 8, ["onClick"])
|
|
184
|
+
]),
|
|
185
|
+
_: 2
|
|
186
|
+
}, 1032, ["onClick"]))), 128))
|
|
187
|
+
]),
|
|
188
|
+
_: 1
|
|
189
|
+
}),
|
|
190
|
+
t(p).length == 0 ? (d(), y("div", ye, [...o[6] || (o[6] = [
|
|
191
|
+
n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
|
|
192
|
+
])])) : z("", !0)
|
|
193
|
+
], 64)) : (d(), w(A, {
|
|
194
|
+
key: 1,
|
|
195
|
+
variant: "outlined",
|
|
196
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
197
|
+
}, {
|
|
198
|
+
default: C(() => [
|
|
199
|
+
o[7] || (o[7] = n("img", {
|
|
200
|
+
src: G,
|
|
201
|
+
class: "aspect-square w-[150px]"
|
|
202
|
+
}, null, -1)),
|
|
203
|
+
o[8] || (o[8] = n("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
204
|
+
n("div", { class: "fm-typo-en-title-sm-800" }, "Create your credit program"),
|
|
205
|
+
n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credits are virtual money that customers can use to pay for their purchases, similar to cash within your store. ")
|
|
206
|
+
], -1)),
|
|
207
|
+
i(F, {
|
|
208
|
+
variant: "primary",
|
|
209
|
+
label: "Create credit program",
|
|
210
|
+
icon: "add",
|
|
211
|
+
onClick: o[5] || (o[5] = (a) => f())
|
|
212
|
+
})
|
|
213
|
+
]),
|
|
214
|
+
_: 1
|
|
215
|
+
})),
|
|
216
|
+
i(ae, {
|
|
217
|
+
ref_key: "sheetRef",
|
|
218
|
+
ref: b,
|
|
219
|
+
"onSubmit:modelValue": K
|
|
220
|
+
}, null, 512)
|
|
221
|
+
])
|
|
222
|
+
], 64);
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
export {
|
|
227
|
+
Ie as default
|
|
228
|
+
};
|