@feedmepos/mf-connect 0.1.2-prod → 0.1.4-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.
Files changed (87) hide show
  1. package/dist/Analytic-07T9poLx.js +423 -0
  2. package/dist/{App-CRTD0U-N.js → App-C6MukSCT.js} +276 -275
  3. package/dist/Broadcast-CzsgeZNO.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C5zUv0Zx.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BirunpzI.js} +8 -8
  5. package/dist/Card-DQnyWZZf.js +824 -0
  6. package/dist/{Collections-BgbWoLWI.js → Collections-BV7CSqRw.js} +4 -4
  7. package/dist/Credit-CxsbYGLZ.js +220 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C137bE1q.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BKSZYxvb.js} +918 -901
  9. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-DpsrI-Z3.js +345 -0
  10. package/dist/Experience-eMUbhq7h.js +221 -0
  11. package/dist/Game-CxAG2ViS.js +255 -0
  12. package/dist/Marketing-CozMj2Y5.js +316 -0
  13. package/dist/Member-DM1dj3F5.js +69 -0
  14. package/dist/{MemberList-ISy05wGZ.js → MemberList-DNjK9BbG.js} +14 -14
  15. package/dist/{MemberTransactions-CXvhJngX.js → MemberTransactions-CsjN3LZA.js} +1 -1
  16. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Ca1LO__F.js → MessageInput.vue_vue_type_script_setup_true_lang-DVQE9v2R.js} +2 -2
  17. package/dist/Mission-BugvTPPH.js +261 -0
  18. package/dist/Point-D8BjGtqT.js +222 -0
  19. package/dist/Promotion-mc9KBzoJ.js +253 -0
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-D1eQ3i5D.js → RuleGroup.vue_vue_type_script_setup_true_lang-B2H3D_kZ.js} +15 -15
  21. package/dist/Segment-DZRFA-Pb.js +565 -0
  22. package/dist/Setting-DxNhR44e.js +1871 -0
  23. package/dist/Store-CdkJWpjV.js +1530 -0
  24. package/dist/StoreRewards-Cdturia8.js +400 -0
  25. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-nhS5Dhhk.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D7GcOiUM.js} +10 -10
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DWlpmE56.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-nuCOrrLE.js} +1 -1
  27. package/dist/{Tier-DLrOmrnK.js → Tier-I_MMd39Y.js} +470 -445
  28. package/dist/{Title-MHQuel7h.js → Title-DK5gmUvo.js} +298 -282
  29. package/dist/Transaction-BXpTIMS_.js +39 -0
  30. package/dist/Voucher-BQ5h2G0I.js +490 -0
  31. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-eAP99wyg.js +141 -0
  32. package/dist/app-CL2Wxzv5.js +5639 -0
  33. package/dist/{app-BjOpRVdv.js → app-DTAyCT-G.js} +1 -1
  34. package/dist/app.js +4 -3
  35. package/dist/{business-DveMDDHY.js → business-B9OUlaFZ.js} +1 -1
  36. package/dist/{campaign-CMb05XLt.js → campaign-CNbUA51l.js} +2 -2
  37. package/dist/{collection.fn-BjaBPYMU.js → collection.fn-D_i45T4Q.js} +2 -2
  38. package/dist/dto-B4208_es.js +2770 -0
  39. package/dist/{effect-CxAdSlyD.js → effect-Ye_yr8et.js} +1 -1
  40. package/dist/{email-addresses-Dtr5OALQ.js → email-addresses-Gm7Dyaxy.js} +1 -1
  41. package/dist/{export-DuBekrcg.js → export-Buee5oUV.js} +3 -3
  42. package/dist/{helper-DL6hnmtJ.js → helper-BBlHhMFc.js} +1 -1
  43. package/dist/{index-raYm7Ew2.js → index-BxJgFvym.js} +2 -2
  44. package/dist/{index-gcsOy_cD.js → index-ByaM-yoc.js} +91 -86
  45. package/dist/{index-DISwCnfH.js → index-C0QHb5SL.js} +2 -2
  46. package/dist/{index-Cibwzgac.js → index-C363BG5A.js} +3 -3
  47. package/dist/{index-BZAlqAaJ.js → index-CLL3no-v.js} +1 -1
  48. package/dist/{index-CAQpU5Rv.js → index-ChSVaFk3.js} +1 -1
  49. package/dist/{index-BSIUoSG3.js → index-Co9n8I_5.js} +3 -3
  50. package/dist/index-CoGNKU8v.js +3 -0
  51. package/dist/{index-Dx4pkNRc.js → index-DHGcUMVN.js} +1 -1
  52. package/dist/{index-CgPlJqkX.js → index-DWWtZSrm.js} +1 -1
  53. package/dist/{index-CGHNWhkM.js → index-DdVZgYE4.js} +258 -256
  54. package/dist/{index-BBBytzpn.js → index-Dx3HwWcb.js} +1 -1
  55. package/dist/{index.esm2017-Bs9CWbrs.js → index.esm2017-Dd02dg_O.js} +38 -38
  56. package/dist/{loading-Dj5bx8fg.js → loading-Or1ZDzDS.js} +11 -11
  57. package/dist/{membership-B2avlZoN.js → membership-B8h5ku-v.js} +3 -3
  58. package/dist/{money-CNSWtAf-.js → money-CmsKAJBT.js} +1 -1
  59. package/dist/{number-BA58pjU6.js → number-iEhp7Uai.js} +1 -1
  60. package/dist/{rule-BWazFYuZ.js → rule-BORkgSMK.js} +3 -3
  61. package/dist/{rule-builder-RIloDQBn.js → rule-builder-DEfkSr68.js} +1 -1
  62. package/dist/{template-u01r84LY.js → template-C_Y7bhlI.js} +4 -4
  63. package/dist/{usePagination--B6Wt7C1.js → usePagination-Ci8-uZvb.js} +1 -1
  64. package/dist/vue-i18n-BXzrZRP6.js +2365 -0
  65. package/package.json +7 -4
  66. package/dist/Analytic-AqWU_lJy.js +0 -620
  67. package/dist/Broadcast-utWSrzP9.js +0 -216
  68. package/dist/Card-x6qnEaIt.js +0 -823
  69. package/dist/Credit-CojzmUnh.js +0 -214
  70. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-8l3Dt_Lo.js +0 -344
  71. package/dist/Experience-CPjovKWF.js +0 -211
  72. package/dist/Game-DWcjPfZP.js +0 -250
  73. package/dist/Marketing-CwoI0pFF.js +0 -309
  74. package/dist/Member-oRcVGr20.js +0 -92
  75. package/dist/Mission-Y8s5MQIC.js +0 -248
  76. package/dist/Point-0Fw3qLIW.js +0 -220
  77. package/dist/Promotion-vqM23NPX.js +0 -244
  78. package/dist/Segment-lgzMRCyd.js +0 -564
  79. package/dist/Setting-CFGB53S0.js +0 -1870
  80. package/dist/Store-fJlew3HJ.js +0 -1533
  81. package/dist/StoreRewards-DWq34E4p.js +0 -429
  82. package/dist/Transaction-CYqMFEzc.js +0 -36
  83. package/dist/Voucher-B0QCX_nG.js +0 -485
  84. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
  85. package/dist/app-SOHUUM08.js +0 -2974
  86. package/dist/dto-CY7JrHkZ.js +0 -1145
  87. package/dist/index-BMxu_XL-.js +0 -11
@@ -0,0 +1,255 @@
1
+ import { defineComponent as D, ref as A, computed as H, onMounted as N, resolveComponent as r, openBlock as d, createElementBlock as x, Fragment as v, createVNode as i, unref as t, withCtx as h, createElementVNode as n, toDisplayString as l, renderList as q, createBlock as b, resolveDynamicComponent as z, h as p } from "vue";
2
+ import { _ as J } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as O, components as C } from "@feedmepos/ui-library";
4
+ import { u as Q, a as W, p as X } from "./loading-Or1ZDzDS.js";
5
+ import { u as Y } from "./business-B9OUlaFZ.js";
6
+ import { u as Z } from "./campaign-CNbUA51l.js";
7
+ import { g as B, a as $ } from "./dto-B4208_es.js";
8
+ import { _ as ee } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
+ import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BKSZYxvb.js";
10
+ import { u as oe } from "./template-C_Y7bhlI.js";
11
+ import { u as ae } from "./vue-i18n-BXzrZRP6.js";
12
+ import { c as w } from "./index-DWWtZSrm.js";
13
+ const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, le = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "space-y-4" }, ue = { class: "fm-typo-en-body-lg-600" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = /* @__PURE__ */ n("img", {
14
+ src: J,
15
+ class: "aspect-square w-[150px]"
16
+ }, null, -1), _e = { class: "flex flex-col gap-16 text-center" }, he = { class: "fm-typo-en-title-sm-800" }, we = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ee = /* @__PURE__ */ D({
17
+ __name: "Game",
18
+ setup(xe) {
19
+ const { t: c } = ae(), E = {
20
+ label: c("connect.program.common.actions.create", {
21
+ type: c("connect.program.game.title").toLowerCase()
22
+ }),
23
+ value: "create",
24
+ isPrimary: !0,
25
+ prependIcon: "add"
26
+ }, K = oe("GAME", O()), f = Y(), m = Z(), { global: M, minor: k } = Q, s = A({
27
+ searchKey: "",
28
+ location: null
29
+ }), g = H(
30
+ () => m.campaigns.token.filter(
31
+ (e) => !s.value.location || !e.targetLocation || e.targetLocation.includes(s.value.location)
32
+ )
33
+ ), R = [
34
+ {
35
+ header: "Program title",
36
+ accessorKey: "name",
37
+ // accessorFn: (v) => v.name,
38
+ cell(e) {
39
+ return p("div", { class: "flex items-center justify-between gap-4" }, [
40
+ p("div", { class: "flex items-center" }, [
41
+ p(
42
+ C.FmTooltip,
43
+ {
44
+ content: e.row.original._id,
45
+ onClick: (o) => {
46
+ o.stopPropagation(), W(e.row.original._id);
47
+ }
48
+ },
49
+ [
50
+ p(C.FmIcon, {
51
+ name: "info",
52
+ outline: !0,
53
+ size: "sm"
54
+ })
55
+ ]
56
+ )
57
+ ]),
58
+ p("div", { class: "flex-1" }, e.row.original.name)
59
+ ]);
60
+ }
61
+ },
62
+ {
63
+ header: "Status",
64
+ cell(e) {
65
+ return B(e.row.original);
66
+ }
67
+ },
68
+ {
69
+ header: "Summary",
70
+ accessorFn: (e) => $(e)
71
+ //v.effect,
72
+ },
73
+ {
74
+ header: "Token received",
75
+ accessorFn: (e) => {
76
+ var o;
77
+ return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
78
+ }
79
+ },
80
+ {
81
+ header: "Actions",
82
+ cell(e) {
83
+ return p(C.FmButton, {
84
+ variant: "tertiary",
85
+ icon: "delete",
86
+ iconColor: "neutral-gray-400",
87
+ onClick: (o) => {
88
+ o.stopPropagation(), S(e.row.original);
89
+ }
90
+ });
91
+ }
92
+ }
93
+ ], F = A();
94
+ async function S(e) {
95
+ await X.remove(`Are you sure you want to remove ${e.name}?`) && await k(
96
+ async () => {
97
+ await w.delete(e._id), await m.read("GAME");
98
+ },
99
+ {
100
+ message: `Removing ${e.name}`,
101
+ successMessage: `Removed ${e.name} successfully`
102
+ }
103
+ );
104
+ }
105
+ async function y(e) {
106
+ e ? await o() : K.open(async (u) => {
107
+ await o(u);
108
+ });
109
+ async function o(u) {
110
+ var _;
111
+ (_ = F.value) == null || _.showSheet(
112
+ !0,
113
+ "GAME",
114
+ e ? await w.readById(e._id) : void 0,
115
+ u
116
+ );
117
+ }
118
+ }
119
+ async function G(e) {
120
+ await k(
121
+ async () => {
122
+ e.campaign._id ? await w.update(e.campaign._id, e) : await w.create(e), await m.read("GAME");
123
+ },
124
+ {
125
+ message: `${e.campaign._id ? "Updating" : "Creating"} game program`,
126
+ successMessage: `Game program ${e.campaign._id ? "updated" : "created"} successfully`
127
+ }
128
+ );
129
+ }
130
+ return N(async () => {
131
+ await M(async () => {
132
+ await m.read("GAME"), await f.readPremium();
133
+ });
134
+ }), (e, o) => {
135
+ const u = r("FmPill"), _ = r("FmPageHead"), L = r("FmSearch"), I = r("FmTable"), P = r("FmButton"), T = r("FmListItem"), U = r("FmList"), j = r("FmCard");
136
+ return d(), x(v, null, [
137
+ i(_, {
138
+ actions: t(g).length > 0 && t(f).isPremium ? [E] : [],
139
+ "onClick:action": o[0] || (o[0] = () => y())
140
+ }, {
141
+ title: h(() => [
142
+ n("div", ne, [
143
+ n("span", se, l(t(c)("connect.program.game.title")), 1),
144
+ i(u, { variant: "premium" })
145
+ ])
146
+ ]),
147
+ _: 1
148
+ }, 8, ["actions"]),
149
+ n("div", ie, [
150
+ i(L, {
151
+ modelValue: t(s).searchKey,
152
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => t(s).searchKey = a),
153
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
154
+ placeholder: "search",
155
+ collapsible: ""
156
+ }, null, 8, ["modelValue"]),
157
+ t(m).campaigns.token && t(m).campaigns.token.length > 0 ? (d(), x(v, { key: 0 }, [
158
+ n("div", re, [
159
+ n("div", le, [
160
+ i(ee, {
161
+ modelValue: t(s).location,
162
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => t(s).location = a),
163
+ label: "Location: ",
164
+ "show-item-label": !0,
165
+ icon: "storefront",
166
+ placement: "bottom-start",
167
+ items: t(f).locationItems
168
+ }, null, 8, ["modelValue", "items"])
169
+ ]),
170
+ i(L, {
171
+ modelValue: t(s).searchKey,
172
+ "onUpdate:modelValue": o[3] || (o[3] = (a) => t(s).searchKey = a),
173
+ class: "xs:hidden",
174
+ placeholder: "search",
175
+ collapsible: ""
176
+ }, null, 8, ["modelValue"])
177
+ ]),
178
+ i(I, {
179
+ class: "xs:hidden",
180
+ "row-data": t(g),
181
+ "column-defs": R,
182
+ "search-value": t(s).searchKey,
183
+ "column-filter": [],
184
+ onRowClick: o[4] || (o[4] = (a) => y(a.original)),
185
+ "hide-footer": t(g).length < 10
186
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
187
+ i(U, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
188
+ default: h(() => [
189
+ (d(!0), x(v, null, q(t(g).filter(
190
+ (a) => a.name.toLowerCase().includes(t(s).searchKey.toLowerCase())
191
+ ), (a) => (d(), b(T, {
192
+ key: a._id.toString(),
193
+ onClick: (V) => y(a),
194
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
195
+ }, {
196
+ default: h(() => [
197
+ n("div", ce, [
198
+ n("div", me, [
199
+ (d(), b(z(t(B)(a)))),
200
+ n("div", de, l(a.currentReceive ?? 0) + " used ", 1)
201
+ ]),
202
+ n("div", pe, [
203
+ n("div", ue, l(a.name), 1),
204
+ n("div", fe, l(t($)(a)), 1)
205
+ ]),
206
+ n("div", ge, l(t(c)("program.game.token_received", {
207
+ count: a.currentReceive ?? 0
208
+ })), 1)
209
+ ]),
210
+ i(P, {
211
+ icon: "delete",
212
+ "icon-color": "neutral-gray-400",
213
+ variant: "tertiary",
214
+ onClick: (V) => (V.stopPropagation(), S(a))
215
+ }, null, 8, ["onClick"])
216
+ ]),
217
+ _: 2
218
+ }, 1032, ["onClick"]))), 128))
219
+ ]),
220
+ _: 1
221
+ })
222
+ ], 64)) : (d(), b(j, {
223
+ key: 1,
224
+ variant: "outlined",
225
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
226
+ }, {
227
+ default: h(() => [
228
+ ye,
229
+ n("div", _e, [
230
+ n("div", he, l(t(c)("connect.program.game.empty_state.title")), 1),
231
+ n("div", we, l(t(c)("connect.program.game.empty_state.description")), 1)
232
+ ]),
233
+ i(P, {
234
+ variant: "primary",
235
+ label: "Create game program",
236
+ icon: "add",
237
+ disabled: !t(f).isPremium,
238
+ onClick: o[5] || (o[5] = (a) => y())
239
+ }, null, 8, ["disabled"])
240
+ ]),
241
+ _: 1
242
+ })),
243
+ i(te, {
244
+ ref_key: "sheetRef",
245
+ ref: F,
246
+ "onSubmit:modelValue": G
247
+ }, null, 512)
248
+ ])
249
+ ], 64);
250
+ };
251
+ }
252
+ });
253
+ export {
254
+ Ee as default
255
+ };
@@ -0,0 +1,316 @@
1
+ import { openBlock as m, createElementBlock as p, defineComponent as z, ref as S, onMounted as Y, computed as H, h as J, resolveComponent as c, Fragment as x, createVNode as i, unref as r, createElementVNode as s, withCtx as F, renderList as $, createBlock as B, toDisplayString as f, createCommentVNode as j } from "vue";
2
+ import { _ as q } from "./campaign-CpzFl8Vr.js";
3
+ import { components as G } from "@feedmepos/ui-library";
4
+ import { p as X, u as Q } from "./loading-Or1ZDzDS.js";
5
+ import { defineStore as W } from "pinia";
6
+ import { F as C } from "./index-CLL3no-v.js";
7
+ import { useCoreStore as Z } from "@feedmepos/mf-common";
8
+ import { g as h, S as ee, b as te } from "./index-Co9n8I_5.js";
9
+ import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
+ import { u as ae } from "./campaign-CNbUA51l.js";
11
+ import { h as oe } from "./moment-BWErdI6_.js";
12
+ import { u as re } from "./vue-i18n-BXzrZRP6.js";
13
+ var se = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", marketingV1Portal: "https://marketing-v1.feedme.cc" };
14
+ const y = () => {
15
+ const o = ee.getBusinessId();
16
+ if (!o) throw new Error("Invalid business ID");
17
+ return te(`businesses/${o}/marketing-materials/`, {
18
+ url: se.backendUrl,
19
+ noIdRequired: !0
20
+ });
21
+ }, L = {
22
+ async read() {
23
+ return h(await y().get(""));
24
+ },
25
+ async createMarketing(o) {
26
+ return h(await y().post("", o));
27
+ },
28
+ // add id
29
+ async updateMarketing(o, t) {
30
+ return h(
31
+ await y().put(o, t)
32
+ );
33
+ },
34
+ async deleteMarketing(o) {
35
+ return h(await y().delete(o));
36
+ }
37
+ }, I = W("mf-connect-marketing", {
38
+ state: () => {
39
+ var o, t;
40
+ return {
41
+ marketing: [],
42
+ defaultMarketing: {
43
+ _id: void 0,
44
+ business: ((t = (o = Z().currentBusiness) == null ? void 0 : o.value) == null ? void 0 : t._id) ?? "",
45
+ name: "",
46
+ campaign: null,
47
+ keywords: "",
48
+ image: "",
49
+ headline: {
50
+ content: "",
51
+ key: void 0
52
+ },
53
+ assets: [
54
+ {
55
+ platform: C.enum.FACEBOOK,
56
+ contents: [
57
+ {
58
+ type: "POST",
59
+ size: {
60
+ width: 1920,
61
+ height: 1080
62
+ },
63
+ images: []
64
+ },
65
+ {
66
+ type: "STORY",
67
+ size: {
68
+ width: 1080,
69
+ height: 1920
70
+ },
71
+ images: []
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ platform: C.enum.INSTAGRAM,
77
+ contents: [
78
+ {
79
+ type: "POST",
80
+ size: {
81
+ width: 1080,
82
+ height: 1080
83
+ },
84
+ images: []
85
+ },
86
+ {
87
+ type: "STORY",
88
+ size: {
89
+ width: 1080,
90
+ height: 1920
91
+ },
92
+ images: []
93
+ },
94
+ {
95
+ type: "REEL",
96
+ size: {
97
+ width: 1080,
98
+ height: 1920
99
+ },
100
+ images: []
101
+ }
102
+ ]
103
+ },
104
+ {
105
+ platform: C.enum.BRAND_APP,
106
+ contents: [
107
+ {
108
+ type: "IMAGE",
109
+ size: {
110
+ width: 1080,
111
+ height: 1920
112
+ },
113
+ images: []
114
+ }
115
+ ]
116
+ }
117
+ ],
118
+ captions: [{ language: "en", content: "" }]
119
+ }
120
+ };
121
+ },
122
+ actions: {
123
+ async readMarketingMaterial() {
124
+ const o = await L.read();
125
+ this.marketing = o;
126
+ }
127
+ },
128
+ getters: {
129
+ state(o) {
130
+ return o;
131
+ }
132
+ }
133
+ }), ie = {};
134
+ function le(o, t) {
135
+ return m(), p("div");
136
+ }
137
+ const ce = /* @__PURE__ */ ne(ie, [["render", le]]), me = { class: "px-24 flex flex-col gap-y-16" }, de = { class: "flex items-center justify-between w-full" }, pe = { class: "space-y-8" }, ue = { class: "fm-typo-en-body-lg-600" }, ge = { class: "fm-typo-en-body-lg-600" }, fe = { key: 0 }, he = /* @__PURE__ */ s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1), ye = [
138
+ he
139
+ ], ke = /* @__PURE__ */ s("img", {
140
+ src: q,
141
+ class: "w-[150px]"
142
+ }, null, -1), _e = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary w-4/6 text-center" }, Be = /* @__PURE__ */ z({
143
+ __name: "Marketing",
144
+ setup(o) {
145
+ const { t } = re(), O = {
146
+ label: t("connect.marketing.create"),
147
+ value: "create",
148
+ isPrimary: !0,
149
+ prependIcon: "add"
150
+ }, k = S(!1), _ = I(), b = ae(), { global: N, minor: U } = Q;
151
+ Y(async () => {
152
+ await N(async () => {
153
+ await b.read(), await _.readMarketingMaterial();
154
+ });
155
+ });
156
+ const d = H(() => _.marketing.filter(
157
+ (n) => n.name.includes(l.value.searchKey.toLowerCase())
158
+ )), u = S(
159
+ I().defaultMarketing
160
+ ), D = [
161
+ {
162
+ header: t("connect.marketing.table.name"),
163
+ accessorFn: (n) => n.name
164
+ },
165
+ {
166
+ header: t("connect.marketing.table.campaign"),
167
+ accessorFn: (n) => {
168
+ var e;
169
+ return n.campaign === null || n.campaign === void 0 ? "-" : (e = b.campaigns.all.find(
170
+ (v) => v._id === n.campaign
171
+ )) == null ? void 0 : e.name;
172
+ }
173
+ },
174
+ {
175
+ header: t("connect.marketing.table.createdDate"),
176
+ accessorFn: (n) => {
177
+ const e = new Date(
178
+ parseInt(n._id.toString().substring(0, 8), 16) * 1e3
179
+ );
180
+ return oe(e).format("DD MMM YYYY");
181
+ }
182
+ },
183
+ {
184
+ header: t("connect.marketing.table.actions"),
185
+ cell(n) {
186
+ return J(G.FmButton, {
187
+ variant: "tertiary",
188
+ icon: "delete",
189
+ iconColor: "neutral-gray-400",
190
+ onClick: (e) => {
191
+ e.stopPropagation(), V(n.row.original);
192
+ }
193
+ });
194
+ }
195
+ }
196
+ ];
197
+ async function V(n) {
198
+ await X.remove(
199
+ t("marketing.delete.confirm", { name: n.name })
200
+ ) && await U(
201
+ async () => {
202
+ await L.deleteMarketing(n._id), await _.readMarketingMaterial();
203
+ },
204
+ {
205
+ message: t("marketing.delete.removing", { name: n.name }),
206
+ successMessage: t("marketing.delete.success", { name: n.name })
207
+ }
208
+ );
209
+ }
210
+ async function g(n) {
211
+ n ? u.value = JSON.parse(JSON.stringify(n)) : u.value = JSON.parse(
212
+ JSON.stringify(I().defaultMarketing)
213
+ ), k.value = !0;
214
+ }
215
+ const l = S({
216
+ searchKey: ""
217
+ });
218
+ return (n, e) => {
219
+ const v = c("FmPageHead"), P = c("FmSearch"), E = c("FmTable"), T = c("FmButton"), K = c("FmListItem"), A = c("FmList"), R = c("FmCard");
220
+ return m(), p(x, null, [
221
+ i(v, {
222
+ title: r(t)("connect.marketing.title"),
223
+ class: "xs:hidden",
224
+ actions: r(d).length > 0 ? [O] : [],
225
+ "onClick:action": e[0] || (e[0] = () => g())
226
+ }, null, 8, ["title", "actions"]),
227
+ s("div", me, [
228
+ i(P, {
229
+ modelValue: l.value.searchKey,
230
+ "onUpdate:modelValue": e[1] || (e[1] = (a) => l.value.searchKey = a),
231
+ placeholder: r(t)("connect.marketing.search"),
232
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
233
+ collapsible: ""
234
+ }, null, 8, ["modelValue", "placeholder"]),
235
+ i(ce, {
236
+ modelValue: u.value,
237
+ "onUpdate:modelValue": e[2] || (e[2] = (a) => u.value = a),
238
+ "is-open": k.value,
239
+ "onUpdate:isOpen": e[3] || (e[3] = (a) => k.value = a)
240
+ }, null, 8, ["modelValue", "is-open"]),
241
+ r(d).length > 0 ? (m(), p(x, { key: 0 }, [
242
+ s("div", de, [
243
+ i(P, {
244
+ modelValue: l.value.searchKey,
245
+ "onUpdate:modelValue": e[4] || (e[4] = (a) => l.value.searchKey = a),
246
+ class: "xs:hidden",
247
+ placeholder: r(t)("connect.marketing.search"),
248
+ collapsible: ""
249
+ }, null, 8, ["modelValue", "placeholder"])
250
+ ]),
251
+ i(E, {
252
+ class: "xs:hidden",
253
+ "row-data": r(d),
254
+ "column-defs": D,
255
+ "search-value": l.value.searchKey,
256
+ "column-filter": [],
257
+ onRowClick: e[5] || (e[5] = (a) => g(a.original)),
258
+ "hide-footer": !0
259
+ }, null, 8, ["row-data", "search-value"]),
260
+ i(A, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
261
+ default: F(() => [
262
+ (m(!0), p(x, null, $(r(d).filter(
263
+ (a) => a.name.toLowerCase().includes(l.value.searchKey.toLowerCase())
264
+ ), (a) => (m(), B(K, {
265
+ key: a._id.toString(),
266
+ onClick: (w) => g(a),
267
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
268
+ }, {
269
+ default: F(() => {
270
+ var w;
271
+ return [
272
+ s("div", pe, [
273
+ s("div", ue, f(a.name), 1),
274
+ s("div", ge, f(a.campaign === null || a.campaign === void 0 ? "-" : (w = r(b).campaigns.all.find(
275
+ (M) => M._id === a.campaign
276
+ )) == null ? void 0 : w.name), 1)
277
+ ]),
278
+ i(T, {
279
+ icon: "delete",
280
+ "icon-color": "neutral-gray-400",
281
+ variant: "tertiary",
282
+ onClick: (M) => (M.stopPropagation(), V(a))
283
+ }, null, 8, ["onClick"])
284
+ ];
285
+ }),
286
+ _: 2
287
+ }, 1032, ["onClick"]))), 128))
288
+ ]),
289
+ _: 1
290
+ }),
291
+ r(d).length == 0 ? (m(), p("div", fe, ye)) : j("", !0)
292
+ ], 64)) : (m(), B(R, {
293
+ key: 1,
294
+ variant: "outlined",
295
+ class: "w-full justify-center items-center flex flex-col p-[24px] gap-[24px]"
296
+ }, {
297
+ default: F(() => [
298
+ ke,
299
+ s("p", _e, f(r(t)("connect.marketing.emptyState.title")), 1),
300
+ s("p", be, f(r(t)("connect.marketing.emptyState.description")), 1),
301
+ i(T, {
302
+ label: r(t)("connect.marketing.emptyState.action"),
303
+ "prepend-icon": "add",
304
+ onClick: e[6] || (e[6] = (a) => g())
305
+ }, null, 8, ["label"])
306
+ ]),
307
+ _: 1
308
+ }))
309
+ ])
310
+ ], 64);
311
+ };
312
+ }
313
+ });
314
+ export {
315
+ Be as default
316
+ };
@@ -0,0 +1,69 @@
1
+ import { defineComponent as f, computed as T, ref as d, watch as k, resolveComponent as s, openBlock as _, createElementBlock as B, Fragment as E, createVNode as b, unref as n, createElementVNode as y, createBlock as A, createCommentVNode as L } from "vue";
2
+ import "./index-CoGNKU8v.js";
3
+ import { u as M } from "./vue-i18n-BXzrZRP6.js";
4
+ import { useRouter as N } from "vue-router";
5
+ import { m as Y } from "./index-Dx3HwWcb.js";
6
+ import { R as i } from "./app-CL2Wxzv5.js";
7
+ const h = { class: "px-24 flex flex-col gap-y-16 pb-24" }, g = /* @__PURE__ */ f({
8
+ __name: "Member",
9
+ setup(w) {
10
+ const e = N(), { t: p } = M(), o = [
11
+ {
12
+ label: p("connect.loyalty.member.tabs.member_list"),
13
+ value: i["$connect-LOYALTY_MEMBER_LIST"],
14
+ actions: []
15
+ }
16
+ ], r = T(() => {
17
+ var a, c, m;
18
+ return e.currentRoute.value.name != i["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? {
19
+ title: u.value.label,
20
+ actions: u.value.actions,
21
+ description: void 0
22
+ } : (u.value = o[1], {
23
+ backButton: !0,
24
+ title: p("connect.loyalty.member.title"),
25
+ actions: [],
26
+ description: `${(a = l.value) == null ? void 0 : a.name} (${(c = l.value) == null ? void 0 : c._id}) (${(m = l.value) == null ? void 0 : m.phoneNumber})`,
27
+ onBackButton: async () => {
28
+ await e.push({ name: i["$connect-LOYALTY_MEMBER_LIST"] });
29
+ }
30
+ });
31
+ }), u = d(
32
+ o.find((t) => t.value === e.currentRoute.value.name) ?? o[0]
33
+ ), l = d();
34
+ async function v(t) {
35
+ await e.push({ name: t });
36
+ }
37
+ return k(
38
+ () => e.currentRoute.value.name,
39
+ async (t) => {
40
+ u.value = o.find((c) => c.value === t) ?? o[0];
41
+ const a = e.currentRoute.value.params.id;
42
+ a && (l.value = await Y.readById(a)), await e.push({ name: t });
43
+ }
44
+ ), (t, a) => {
45
+ const c = s("FmPageHead"), m = s("FmTabs"), R = s("RouterView");
46
+ return _(), B(E, null, [
47
+ b(c, {
48
+ actions: n(r).actions,
49
+ title: n(r).title,
50
+ description: n(r).description,
51
+ "back-button": n(r).backButton,
52
+ "onClick:back": n(r).onBackButton
53
+ }, null, 8, ["actions", "title", "description", "back-button", "onClick:back"]),
54
+ y("div", h, [
55
+ n(e).currentRoute.value.name != n(i)["$connect-LOYALTY_MEMBER_TRANSACTIONS"] ? (_(), A(m, {
56
+ key: 0,
57
+ "model-value": n(u).value,
58
+ items: o,
59
+ "onUpdate:modelValue": v
60
+ }, null, 8, ["model-value"])) : L("", !0),
61
+ b(R)
62
+ ])
63
+ ], 64);
64
+ };
65
+ }
66
+ });
67
+ export {
68
+ g as default
69
+ };
@@ -1,26 +1,26 @@
1
1
  import { defineComponent as ue, computed as Y, ref as X, resolveComponent as F, openBlock as y, createElementBlock as N, Fragment as ee, createElementVNode as a, unref as t, createBlock as j, createCommentVNode as ae, createVNode as g, renderList as se, withCtx as ne, createTextVNode as fe, toDisplayString as A, withDirectives as Pe, vShow as Oe, onMounted as Re, isRef as Ze, h as oe } from "vue";
2
2
  import { h as x } from "./moment-BWErdI6_.js";
3
3
  import { useDialog as be, components as ce } from "@feedmepos/ui-library";
4
- import { e as et, M as tt } from "./email-addresses-Dtr5OALQ.js";
5
- import { a as ot, _ as nt, w as at } from "./usePagination--B6Wt7C1.js";
6
- import "./index-BMxu_XL-.js";
7
- import { p as Ee, b as De, u as Ye } from "./loading-Dj5bx8fg.js";
8
- import { u as ye, C as Be, s as st } from "./membership-B2avlZoN.js";
9
- import { c as it } from "./index-BSIUoSG3.js";
4
+ import { e as et, M as tt } from "./email-addresses-Gm7Dyaxy.js";
5
+ import { a as ot, _ as nt, w as at } from "./usePagination-Ci8-uZvb.js";
6
+ import "./index-CoGNKU8v.js";
7
+ import { p as Ee, b as De, u as Ye } from "./loading-Or1ZDzDS.js";
8
+ import { u as ye, C as Be, s as st } from "./membership-B8h5ku-v.js";
9
+ import { c as it } from "./index-Co9n8I_5.js";
10
10
  import { _ as Ue } from "./lodash-B5I3zXaY.js";
11
11
  import { D as rt } from "./type_drinks-D6jnpvwV.js";
12
- import { F as lt, a as ct, b as dt, c as mt } from "./index-raYm7Ew2.js";
13
- import { F as ut } from "./index-Cibwzgac.js";
14
- import { C as pe } from "./collection.fn-BjaBPYMU.js";
12
+ import { F as lt, a as ct, b as dt, c as mt } from "./index-BxJgFvym.js";
13
+ import { F as ut } from "./index-C363BG5A.js";
14
+ import { C as pe } from "./collection.fn-D_i45T4Q.js";
15
15
  import { defineStore as pt } from "pinia";
16
- import { u as Le } from "./business-DveMDDHY.js";
17
- import { m as J } from "./index-BBBytzpn.js";
16
+ import { u as Le } from "./business-B9OUlaFZ.js";
17
+ import { m as J } from "./index-Dx3HwWcb.js";
18
18
  import { o as ze } from "./objectId-dwaoBfJX.js";
19
- import { f as me } from "./number-BA58pjU6.js";
20
- import { t as ft } from "./money-CNSWtAf-.js";
19
+ import { f as me } from "./number-iEhp7Uai.js";
20
+ import { t as ft } from "./money-CmsKAJBT.js";
21
21
  import { g as bt, a as yt, b as vt } from "./user-Bm4KttFq.js";
22
22
  import { useRouter as xt } from "vue-router";
23
- import { R as gt } from "./app-SOHUUM08.js";
23
+ import { R as gt } from "./app-CL2Wxzv5.js";
24
24
  const _t = { class: "flex flex-col" }, ht = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800 mb-8" }, "Member tiering", -1), Ct = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Member Card", -1), St = /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800 mt-16 mb-8" }, "Titles", -1), Ft = { key: 1 }, Tt = /* @__PURE__ */ a("div", { class: "flex flex-nowrap gap-4 items-center" }, [
25
25
  /* @__PURE__ */ a("div", { class: "flex-1" }, "Title"),
26
26
  /* @__PURE__ */ a("div", { class: "flex-1" }, "Expires in days"),
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as i, ref as p, resolveComponent as _, openBlock as l, createElementBlock as d, createVNode as f, unref as e, createBlock as r, createCommentVNode as v } from "vue";
2
- import { _ as b, a as k } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-nhS5Dhhk.js";
2
+ import { _ as b, a as k } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-D7GcOiUM.js";
3
3
  import { useRouter as x } from "vue-router";
4
4
  const C = { class: "flex flex-col gap-y-32 pb-24" }, N = /* @__PURE__ */ i({
5
5
  __name: "MemberTransactions",