@feedmepos/mf-connect 0.0.8 → 0.0.9

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 (77) hide show
  1. package/dist/{Analytic-BxRuK2P2.js → Analytic-CwaN0mge.js} +68 -69
  2. package/dist/{Broadcast-BqGojAWW.js → Broadcast-Cjx5xzUC.js} +27 -28
  3. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B-VzcVMS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D4mO5aik.js} +34 -34
  4. package/dist/Card-DbY6YaXk.js +827 -0
  5. package/dist/{Collections-DvdDRozp.js → Collections-DRN2gzwh.js} +158 -168
  6. package/dist/{Credit-BeHm7_2S.js → Credit-DOcrzykJ.js} +11 -12
  7. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsbgHsah.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CUxfXaro.js} +359 -333
  8. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-hwXvdiut.js → EffectSheet.vue_vue_type_style_index_0_lang-EF_rHfwT.js} +5 -5
  9. package/dist/{Experience-CtDY9u4Y.js → Experience-aQj-3H2Y.js} +11 -12
  10. package/dist/{Game-DjaYuqcb.js → Game-Cnje-m_M.js} +22 -23
  11. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-Bq5-Gl9N.js → ImageInput.vue_vue_type_script_setup_true_lang-CG-GBVMP.js} +8 -8
  12. package/dist/{MainLayout-B-iAZM2k.js → MainLayout-Cxl9yLPs.js} +1 -1
  13. package/dist/{Marketing-BJJltAh-.js → Marketing-BYUcbcMU.js} +19 -20
  14. package/dist/{Member-eJ9Pdi5w.js → Member-D7K9fm_Q.js} +2 -2
  15. package/dist/MemberList-DbXkxUzF.js +1717 -0
  16. package/dist/{MemberTransactions-DRET8mSQ.js → MemberTransactions-DED1SYwX.js} +4 -4
  17. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-CLqIp5wR.js +203 -0
  18. package/dist/{Point-DPTOgJbC.js → Point-CQm8whVQ.js} +11 -12
  19. package/dist/{Promotion-wzkRuNqO.js → Promotion-DzVXy_C9.js} +42 -44
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Z06eB5i5.js → RuleGroup.vue_vue_type_script_setup_true_lang-CeS6KlhP.js} +12 -12
  21. package/dist/Segment-D3o0D3Uv.js +407 -0
  22. package/dist/{Setting-CXuZu0-m.js → Setting-pCzenLoL.js} +17 -18
  23. package/dist/{Store-4Um9keEp.js → Store-DEwEIFYD.js} +18 -19
  24. package/dist/{StoreRewards-B-UFeyQM.js → StoreRewards-D7vnZN4f.js} +86 -87
  25. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-ALzQU3th.js +793 -0
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-I_XFpctY.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-GMIztWCj.js} +1 -1
  27. package/dist/{Tier-C6KVsxGO.js → Tier-BJbX5CPB.js} +401 -377
  28. package/dist/{Title-DuN1ahIM.js → Title-C9xV6rBg.js} +274 -248
  29. package/dist/Transaction-C8OHlhzR.js +36 -0
  30. package/dist/Voucher-eZwm7N1D.js +481 -0
  31. package/dist/{app-CxBTTB31.js → app-DgbDbhL-.js} +34 -34
  32. package/dist/app.js +1 -1
  33. package/dist/{campaign-B0aXkadj.js → campaign-BkvrUTEJ.js} +2 -2
  34. package/dist/{dto-BtdVC-Ab.js → dto-YYVhW73A.js} +52 -53
  35. package/dist/{effect-BUN6rkQM.js → effect-f7DAPYC8.js} +1 -1
  36. package/dist/export-BXbCXTfd.js +97 -0
  37. package/dist/{helper-Cpq3x8K5.js → helper-BhvQ9m6d.js} +1 -1
  38. package/dist/{index-D2Juhkdw.js → index-BhacKx5B.js} +85 -83
  39. package/dist/{index-DDSLx7vu.js → index-BsEqtUmY.js} +2 -2
  40. package/dist/{index-0GYrZr4L.js → index-CdtrQ9tR.js} +5 -5
  41. package/dist/{index-8clzk3uX.js → index-Cfo2A0Se.js} +1 -1
  42. package/dist/index-Cz5RZlYh.js +73 -0
  43. package/dist/{index-BTntbYTS.js → index-DQC_1tRF.js} +1 -1
  44. package/dist/{index-DysVCkrx.js → index-Dd3hrFcQ.js} +3 -3
  45. package/dist/{index-CK9yJMj7.js → index-FWp9M1yS.js} +5 -5
  46. package/dist/{index-C6NgUSl2.js → index-VmFlM704.js} +1 -1
  47. package/dist/{index-BvnZdJBY.js → index-oQLJE4Uw.js} +2 -2
  48. package/dist/libs/packages/core/src/collectible/collectible.dto.d.ts +6 -0
  49. package/dist/{plugins-B_d-WFtN.js → loading-DQaawbHE.js} +8204 -8108
  50. package/dist/{lodash-DsT1nK-T.js → lodash-DzdmTD20.js} +1 -1
  51. package/dist/{membership-DtD45RXh.js → membership-Dq2-b-S_.js} +3 -3
  52. package/dist/{money-CFI1TMCS.js → money-vzwOUBrp.js} +1 -1
  53. package/dist/{number-BBtf4fYz.js → number-CBzs6rfW.js} +1 -1
  54. package/dist/packages/connect/src/components/campaign/CampaignSummary.vue.d.ts +13 -0
  55. package/dist/packages/connect/src/composables/export.d.ts +11 -0
  56. package/dist/packages/connect/src/export/base.export.d.ts +7 -0
  57. package/dist/packages/connect/src/export/card.export.d.ts +5 -6
  58. package/dist/packages/connect/src/export/collection-transaction.export.d.ts +14 -0
  59. package/dist/packages/connect/src/export/index.d.ts +1 -0
  60. package/dist/packages/connect/src/export/store-transaction.export.d.ts +14 -0
  61. package/dist/packages/connect/src/helpers/user.d.ts +6 -0
  62. package/dist/{rule-CB9Qlcx1.js → rule-BR5rrmUV.js} +2 -2
  63. package/dist/{rule-builder-BIKcA4Bg.js → rule-builder-7GBNrPXt.js} +1 -1
  64. package/dist/{template-qlb46PGl.js → template-CETJ6lkf.js} +5 -5
  65. package/dist/{usePagination-CX66ab1Y.js → usePagination-DdZeE4Tt.js} +57 -56
  66. package/dist/user-Bm4KttFq.js +37 -0
  67. package/dist/{xlsx-DMaFso0k.js → xlsx-CDAKxZE_.js} +1 -1
  68. package/package.json +1 -1
  69. package/dist/Card-Dlj5jQp4.js +0 -792
  70. package/dist/MemberList-CrhMqUfJ.js +0 -1664
  71. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-D-ttMwn2.js +0 -166
  72. package/dist/Segment-DnsPrP7Q.js +0 -371
  73. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BAyotuXd.js +0 -660
  74. package/dist/Transaction-DdfX7Xfe.js +0 -34
  75. package/dist/Voucher-DarXrxZr.js +0 -454
  76. package/dist/index-Dg-PMgXV.js +0 -64
  77. package/dist/loading-Cxp7sI5p.js +0 -100
@@ -1,454 +0,0 @@
1
- import { defineComponent as N, ref as g, watch as T, onMounted as D, resolveComponent as p, openBlock as _, createBlock as U, unref as o, isRef as H, withCtx as V, createElementVNode as l, createVNode as r, toDisplayString as I, computed as Q, createElementBlock as B, Fragment as A, renderList as W, resolveDynamicComponent as Z, h as y } from "vue";
2
- import { _ as Y } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as ee, components as x } from "@feedmepos/ui-library";
4
- import { p as j, c as ae } from "./plugins-B_d-WFtN.js";
5
- import { useCoreStore as oe } from "@feedmepos/mf-common";
6
- import { u as q } from "./loading-Cxp7sI5p.js";
7
- import { u as te, J as ne, a as se, R as le } from "./app-CxBTTB31.js";
8
- import { u as ie } from "./campaign-B0aXkadj.js";
9
- import { g as K, b as z } from "./dto-BtdVC-Ab.js";
10
- import { u as re } from "./template-qlb46PGl.js";
11
- import { _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsbgHsah.js";
12
- import { _ as ue } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
13
- import { l as me } from "./lodash-DsT1nK-T.js";
14
- import { m as de } from "./index-Dg-PMgXV.js";
15
- import { c as S } from "./index-BTntbYTS.js";
16
- import { useRouter as pe } from "vue-router";
17
- const fe = { class: "space-y-16" }, he = { class: "fm-typo-en-body-md-600" }, ge = { class: "flex items-center justify-end" }, ye = { class: "flex items-center gap-8" }, ve = /* @__PURE__ */ N({
18
- __name: "SendVoucherSheet",
19
- emits: ["success"],
20
- setup(X, { expose: L, emit: F }) {
21
- const { minor: M } = q, k = g(""), i = g({}), P = F, f = g(!1), u = g([]);
22
- function m(e) {
23
- f.value = !0, k.value = e.campaignId, u.value = [];
24
- }
25
- function v() {
26
- f.value = !1;
27
- }
28
- const $ = [
29
- {
30
- header: "Name",
31
- accessorFn: (e) => e.name || "No Profile"
32
- },
33
- {
34
- header: "Phone",
35
- accessorFn: (e) => e.phoneNumber || "-"
36
- }
37
- ], s = g({
38
- searchValue: "",
39
- pageSize: 10,
40
- pageCount: 0,
41
- pageIndex: 0,
42
- totalRows: 0,
43
- isLoading: !1
44
- }), d = g([]), b = async (e) => {
45
- s.value.isLoading = !0, d.value = [];
46
- const a = await de.read({
47
- limit: e.pageSize,
48
- skip: e.pageIndex,
49
- sortBy: "_id",
50
- search: s.value.searchValue,
51
- descending: !1
52
- });
53
- d.value = a.resources, s.value.totalRows = a.meta.totalResources ?? 0, s.value.pageCount = a.meta.totalPages ?? 0, s.value.isLoading = !1, i.value = {}, u.value.forEach((t) => {
54
- const c = d.value.findIndex((C) => C._id == t);
55
- c > -1 && (console.log(c, "fetch member index"), i.value[c] = !0);
56
- });
57
- };
58
- function w() {
59
- d.value.length > 0 && (u.value = u.value.filter(
60
- (e) => !d.value.some((a) => a._id === e) || // Keep if not in current page
61
- Object.entries(i.value).some(
62
- ([a, t]) => t && d.value[a]._id === e
63
- // Keep if selected in current page
64
- )
65
- ));
66
- for (const [e, a] of Object.entries(i.value))
67
- if (a) {
68
- const t = d.value[e]._id;
69
- u.value.includes(t) || u.value.push(t);
70
- }
71
- }
72
- async function E(e) {
73
- u.value.length < 1 || await M(
74
- async () => {
75
- await S.sendCollection(k.value, {
76
- memberId: u.value
77
- }), await P("success"), v();
78
- },
79
- {
80
- message: "Sending claim(s)",
81
- successMessage: "Claim(s) created"
82
- }
83
- );
84
- }
85
- return T(i, w, { deep: !0 }), T(
86
- () => s.value.searchValue,
87
- me.debounce(async () => {
88
- await b({ pageSize: 10, pageIndex: 0 });
89
- }, 500)
90
- ), L({
91
- showSheet: m,
92
- hideSheet: v
93
- }), D(async () => {
94
- await b(s.value);
95
- }), (e, a) => {
96
- const t = p("FmSearch"), c = p("FmTable"), C = p("FmButton"), R = p("FmSideSheet");
97
- return _(), U(R, {
98
- "max-width": 560,
99
- "dismiss-away": !0,
100
- header: "Send voucher to",
101
- modelValue: o(f),
102
- "onUpdate:modelValue": [
103
- a[3] || (a[3] = (h) => H(f) ? f.value = h : null),
104
- a[4] || (a[4] = (h) => f.value = h)
105
- ]
106
- }, {
107
- "side-sheet-footer": V(() => [
108
- l("div", ye, [
109
- r(C, {
110
- label: "Send",
111
- loading: o(te)().isLoading,
112
- onClick: E
113
- }, null, 8, ["loading"]),
114
- r(C, {
115
- label: "Cancel",
116
- type: "button",
117
- variant: "tertiary",
118
- onClick: a[2] || (a[2] = (h) => f.value = !1)
119
- })
120
- ])
121
- ]),
122
- default: V(() => [
123
- r(ne, { json: o(u) }, null, 8, ["json"]),
124
- l("div", fe, [
125
- l("div", he, I(o(u).length) + " members selected ", 1),
126
- l("div", ge, [
127
- r(t, {
128
- class: "mt-4",
129
- modelValue: o(s).searchValue,
130
- "onUpdate:modelValue": a[0] || (a[0] = (h) => o(s).searchValue = h),
131
- placeholder: "Search Member",
132
- collapsible: ""
133
- }, null, 8, ["modelValue"])
134
- ]),
135
- r(c, {
136
- modelValue: o(i),
137
- "onUpdate:modelValue": a[1] || (a[1] = (h) => H(i) ? i.value = h : null),
138
- class: "xs:hidden",
139
- selection: "multiple",
140
- loading: o(s).isLoading,
141
- "row-data": o(d),
142
- "column-defs": $,
143
- "page-size": o(s).pageSize,
144
- "page-count": o(s).pageCount,
145
- "hide-footer": o(s).totalRows <= o(s).pageSize,
146
- "fetch-fn": b
147
- }, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count", "hide-footer"])
148
- ])
149
- ]),
150
- _: 1
151
- }, 8, ["modelValue"]);
152
- };
153
- }
154
- });
155
- var _e = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
156
- const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-center justify-between w-full" }, Ce = { class: "flex gap-8 overflow-x-auto" }, xe = { class: "space-y-8" }, Se = { class: "flex w-full gap-4 items-center" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fe = { class: "space-y-4" }, ke = { class: "fm-typo-en-body-lg-600" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ue = /* @__PURE__ */ l("img", {
157
- src: Y,
158
- class: "aspect-square w-[150px]"
159
- }, null, -1), Ie = /* @__PURE__ */ l("div", { class: "flex flex-col gap-16 text-center" }, [
160
- /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Create voucher campaign"),
161
- /* @__PURE__ */ l("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " A digital coupon that users can redeem for discounts on future purchases. Users usually need to claim and apply the voucher to benefit from the discount. ")
162
- ], -1), Xe = /* @__PURE__ */ N({
163
- __name: "Voucher",
164
- setup(X) {
165
- const L = {
166
- label: "Create campaign",
167
- value: "create",
168
- isPrimary: !0,
169
- prependIcon: "add"
170
- }, F = ee(), M = re("VOUCHER", F), k = se(), i = ie(), { global: P, minor: f } = q, u = pe(), m = g({
171
- searchKey: "",
172
- location: null
173
- }), v = Q(
174
- () => i.campaigns.voucher.filter(
175
- (e) => !m.value.location || !e.targetLocation || e.targetLocation.includes(m.value.location)
176
- )
177
- ), $ = [
178
- {
179
- header: "Voucher title",
180
- accessorFn: (e) => e.name
181
- },
182
- {
183
- header: "Status",
184
- cell(e) {
185
- return K(e.row.original);
186
- }
187
- },
188
- {
189
- header: "Summary",
190
- accessorFn: (e) => z(e)
191
- },
192
- {
193
- header: "Quota",
194
- accessorFn: (e) => {
195
- var a;
196
- return ((a = e.pf_collectible) == null ? void 0 : a.options.maxReceive) ?? "Unlimited";
197
- }
198
- },
199
- {
200
- header: "Claimed",
201
- accessorFn: (e) => {
202
- var a;
203
- return ((a = e == null ? void 0 : e.pf_collectible) == null ? void 0 : a.currentReceive) ?? 0;
204
- }
205
- },
206
- {
207
- header: "Actions",
208
- cell(e) {
209
- return y("div", { class: "flex items-center justify-end" }, [
210
- y(x.FmButton, {
211
- icon: "visibility",
212
- variant: "tertiary",
213
- iconColor: "neutral-gray-400",
214
- onClick: async (a) => {
215
- a.stopPropagation(), await u.push({
216
- name: le["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
217
- params: { id: e.row.original._id }
218
- });
219
- }
220
- }),
221
- y(
222
- x.FmMenu,
223
- {
224
- placement: "bottom-end",
225
- onClick: (a) => {
226
- a.stopPropagation();
227
- }
228
- },
229
- {
230
- "menu-button": () => y(x.FmButton, {
231
- icon: "more_vert",
232
- iconColor: "neutral-gray-400",
233
- variant: "tertiary"
234
- }),
235
- default: () => {
236
- const a = [
237
- y(
238
- x.FmMenuItem,
239
- {
240
- onClick: async (t) => {
241
- t.stopPropagation(), b(e.row.original);
242
- }
243
- },
244
- {
245
- label: y(
246
- "div",
247
- {
248
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
249
- },
250
- "Remove"
251
- )
252
- }
253
- )
254
- ];
255
- return e.row.original.event.type === "SIMPLE_CLAIM" && (a.unshift(
256
- y(x.FmMenuItem, {
257
- label: "Send",
258
- onClick: async (t) => {
259
- var c;
260
- t.stopPropagation(), (c = d.value) == null || c.showSheet({
261
- campaignId: e.row.original._id
262
- });
263
- }
264
- })
265
- ), a.unshift(
266
- y(x.FmMenuItem, {
267
- label: "Share",
268
- onClick: async (t) => {
269
- if (t.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
270
- return await j.confirm(
271
- "Cannot share a voucher that is not a simple claim.",
272
- "Share Voucher",
273
- "OK"
274
- );
275
- await ae(
276
- `https://${oe().currentBusiness.value._id}.${_e.appUrl}/vouchers/${e.row.original._id}`,
277
- {
278
- successMessage: "Voucher link copied to clipboard"
279
- }
280
- );
281
- }
282
- })
283
- )), a;
284
- }
285
- }
286
- )
287
- ]);
288
- }
289
- }
290
- ], s = g(), d = g();
291
- async function b(e) {
292
- await j.remove(`Are you sure you want to remove ${e.name}?`) && await f(
293
- async () => {
294
- await S.delete(e._id), await i.read("VOUCHER");
295
- },
296
- {
297
- message: `Removing ${e.name}`,
298
- successMessage: `Removed ${e.name} successfully`
299
- }
300
- );
301
- }
302
- async function w(e) {
303
- e ? await a() : M.open(async (t) => {
304
- await a(t);
305
- });
306
- async function a(t) {
307
- var c;
308
- (c = s.value) == null || c.showSheet(
309
- !0,
310
- "VOUCHER",
311
- e ? await S.readById(e._id) : void 0,
312
- t
313
- );
314
- }
315
- }
316
- async function E(e) {
317
- e.campaign._id && await new Promise((a) => {
318
- F.open({
319
- title: "Confirmation",
320
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
321
- primaryActions: { text: "Update all", close: !0 },
322
- secondaryActions: { text: "Update future only", close: !0 }
323
- }).onPrimary(async () => {
324
- var t;
325
- e.updateCollections = !0, (t = window.top) == null || t.postMessage("updateAllVoucher", "*"), a();
326
- }).onSecondary(async () => {
327
- a();
328
- });
329
- }), await f(
330
- async () => {
331
- e.campaign._id ? await S.update(e.campaign._id, e) : await S.create(e), await i.read("VOUCHER");
332
- },
333
- {
334
- message: `${e.campaign._id ? "Updating" : "Creating"} voucher`,
335
- successMessage: `Voucher ${e.campaign._id ? "updated" : "created"} successfully`
336
- }
337
- );
338
- }
339
- return D(async () => {
340
- await P(async () => {
341
- await i.read("VOUCHER");
342
- });
343
- }), (e, a) => {
344
- const t = p("FmPageHead"), c = p("FmSearch"), C = p("FmTable"), R = p("FmButton"), h = p("FmListItem"), G = p("FmList"), J = p("FmCard");
345
- return _(), B(A, null, [
346
- r(t, {
347
- title: "Voucher",
348
- actions: o(v).length > 0 ? [L] : [],
349
- "onClick:action": a[0] || (a[0] = () => w())
350
- }, null, 8, ["actions"]),
351
- l("div", be, [
352
- r(c, {
353
- modelValue: o(m).searchKey,
354
- "onUpdate:modelValue": a[1] || (a[1] = (n) => o(m).searchKey = n),
355
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
356
- placeholder: "search",
357
- collapsible: ""
358
- }, null, 8, ["modelValue"]),
359
- o(i).campaigns.voucher && o(i).campaigns.voucher.length > 0 ? (_(), B(A, { key: 0 }, [
360
- l("div", we, [
361
- l("div", Ce, [
362
- r(ue, {
363
- modelValue: o(m).location,
364
- "onUpdate:modelValue": a[2] || (a[2] = (n) => o(m).location = n),
365
- label: "Location: ",
366
- "show-item-label": !0,
367
- icon: "storefront",
368
- placement: "bottom-start",
369
- items: o(k).locationItems
370
- }, null, 8, ["modelValue", "items"])
371
- ]),
372
- r(c, {
373
- modelValue: o(m).searchKey,
374
- "onUpdate:modelValue": a[3] || (a[3] = (n) => o(m).searchKey = n),
375
- class: "xs:hidden",
376
- placeholder: "search",
377
- collapsible: ""
378
- }, null, 8, ["modelValue"])
379
- ]),
380
- r(C, {
381
- class: "xs:hidden",
382
- "row-data": o(v),
383
- "column-defs": $,
384
- "search-value": o(m).searchKey,
385
- "column-filter": [],
386
- onRowClick: a[4] || (a[4] = (n) => w(n.original)),
387
- "hide-footer": o(v).length < 10
388
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
389
- r(G, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
390
- default: V(() => [
391
- (_(!0), B(A, null, W(o(v).filter(
392
- (n) => n.name.toLowerCase().includes(o(m).searchKey.toLowerCase())
393
- ), (n) => (_(), U(h, {
394
- key: n._id.toString(),
395
- onClick: (O) => w(n),
396
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
397
- }, {
398
- default: V(() => [
399
- l("div", xe, [
400
- l("div", Se, [
401
- (_(), U(Z(o(K)(n)))),
402
- l("div", Ve, I(n.currentReceive ?? 0) + " used ", 1)
403
- ]),
404
- l("div", Fe, [
405
- l("div", ke, I(n.name), 1),
406
- l("div", Re, I(o(z)(n)), 1)
407
- ])
408
- ]),
409
- r(R, {
410
- icon: "delete",
411
- "icon-color": "neutral-gray-400",
412
- variant: "tertiary",
413
- onClick: (O) => (O.stopPropagation(), b(n))
414
- }, null, 8, ["onClick"])
415
- ]),
416
- _: 2
417
- }, 1032, ["onClick"]))), 128))
418
- ]),
419
- _: 1
420
- })
421
- ], 64)) : (_(), U(J, {
422
- key: 1,
423
- variant: "outlined",
424
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
425
- }, {
426
- default: V(() => [
427
- Ue,
428
- Ie,
429
- r(R, {
430
- variant: "primary",
431
- label: "Create voucher campaign",
432
- icon: "add",
433
- onClick: a[5] || (a[5] = (n) => w())
434
- })
435
- ]),
436
- _: 1
437
- })),
438
- r(ce, {
439
- ref_key: "sheetRef",
440
- ref: s,
441
- "onSubmit:modelValue": E
442
- }, null, 512),
443
- r(ve, {
444
- ref_key: "sendVoucherSheetRef",
445
- ref: d
446
- }, null, 512)
447
- ])
448
- ], 64);
449
- };
450
- }
451
- });
452
- export {
453
- Xe as default
454
- };
@@ -1,64 +0,0 @@
1
- import { e as r, S as i, f as c, h as o } from "./app-CxBTTB31.js";
2
- const a = () => {
3
- if (!i.getBusinessId()) throw new Error("Invalid business ID");
4
- return c("users");
5
- }, n = () => {
6
- const e = i.getBusinessId();
7
- if (!e) throw new Error("Invalid business ID");
8
- return o(`businesses/${e}/membership`, {
9
- noIdRequired: !0
10
- });
11
- }, u = {
12
- async read(e) {
13
- const s = r(
14
- await a().get("", { params: e })
15
- );
16
- return {
17
- meta: s.meta,
18
- resources: s.resources
19
- };
20
- },
21
- async readById(e) {
22
- return r(await a().get(`${e}`));
23
- },
24
- async sendCredit(e, s) {
25
- return r(
26
- await n().post(
27
- `members/${e}/send-credit`,
28
- s
29
- )
30
- );
31
- },
32
- async deductCredit(e, s) {
33
- return r(
34
- await n().post(
35
- `members/${e}/deduct-credit`,
36
- s
37
- )
38
- );
39
- },
40
- async sendCoin(e, s) {
41
- return r(
42
- await n().post(
43
- `members/${e}/send-coin`,
44
- s
45
- )
46
- );
47
- },
48
- async deductCoin(e, s) {
49
- return r(
50
- await n().post(
51
- `members/${e}/deduct-coin`,
52
- s
53
- )
54
- );
55
- },
56
- async updateMember(e, s) {
57
- return r(
58
- await a().put(`${e}`, s)
59
- );
60
- }
61
- };
62
- export {
63
- u as m
64
- };
@@ -1,100 +0,0 @@
1
- import { u as h } from "./app-CxBTTB31.js";
2
- import { n as d } from "./plugins-B_d-WFtN.js";
3
- function y(e, s) {
4
- let a = "", r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
5
- const u = r.length;
6
- for (let l = 0; l < e; l++)
7
- a += r.charAt(Math.floor(Math.random() * u));
8
- return a;
9
- }
10
- const S = {
11
- alphabetOnly(e) {
12
- return e.replace(/[^a-zA-Z]/g, "");
13
- },
14
- alphaNumeric(e) {
15
- return e.replace(/[^a-zA-Z0-9]/g, "");
16
- },
17
- numericOnly(e) {
18
- return e.replace(/[^0-9]/g, "");
19
- },
20
- singularOrPlural(e, s, a) {
21
- const r = e > 1 ? a || `${s}s` : s;
22
- return `${e} ${r}`;
23
- }
24
- }, I = {
25
- title: (e) => e.replace(
26
- /\b\w+/g,
27
- (s) => s.charAt(0).toUpperCase() + s.substring(1).toLowerCase()
28
- )
29
- };
30
- async function p(e, s) {
31
- var u, l;
32
- let a = [];
33
- !s || !s.customId ? a.push(`${(/* @__PURE__ */ new Date()).toISOString()}_${y(6)}`) : typeof s.customId == "string" ? a.push(s.customId) : a = s.customId;
34
- const r = h();
35
- r.addLoadingQueues(
36
- a.map((t) => ({
37
- id: t,
38
- isGlobal: (s == null ? void 0 : s.isGlobal) || !1
39
- }))
40
- );
41
- try {
42
- const t = await e();
43
- return await ((u = s == null ? void 0 : s.onSuccess) == null ? void 0 : u.call(s, t)), t;
44
- } catch (t) {
45
- const m = t instanceof Error ? t.message : `${t}`;
46
- throw s != null && s.onError ? await s.onError(m) : d.error(m), t;
47
- } finally {
48
- r.resolveQueues(a), (l = s == null ? void 0 : s.onComplete) == null || l.call(s);
49
- }
50
- }
51
- const M = {
52
- checkIsLoading: (e) => h().loadingQueue.some((s) => s.id === e),
53
- global: async (e, s) => await p(
54
- async () => await e(),
55
- {
56
- isGlobal: !0,
57
- onSuccess: async (a) => {
58
- var r;
59
- await ((r = s == null ? void 0 : s.onSuccess) == null ? void 0 : r.call(s, a)), s != null && s.successMessage && d.success(s == null ? void 0 : s.successMessage);
60
- }
61
- }
62
- ),
63
- minor: async (e, s) => {
64
- var r;
65
- let a;
66
- return s != null && s.message && (a = d.info((r = s == null ? void 0 : s.message) == null ? void 0 : r.toString(), null, !0)), await p(
67
- async () => (s != null && s.isLoading && (s.isLoading.value = !0), await e()),
68
- {
69
- onSuccess: () => {
70
- s != null && s.successMessage && d.success((s == null ? void 0 : s.successMessage) || "Success");
71
- },
72
- onError: (u) => {
73
- const l = `${u}` || "Error";
74
- d.error(l);
75
- },
76
- onComplete: () => {
77
- s != null && s.isLoading && (s.isLoading.value = !1), a && d.close(a);
78
- },
79
- customId: s == null ? void 0 : s.customId
80
- }
81
- );
82
- },
83
- custom: async (e, s) => await p(
84
- async () => (s != null && s.isLoading && (s.isLoading.value = !0), await e()),
85
- {
86
- onSuccess: async () => {
87
- s != null && s.successMessage && d.success(s.successMessage);
88
- },
89
- onComplete: () => {
90
- s && s.isLoading && (s.isLoading.value = !1);
91
- },
92
- customId: s == null ? void 0 : s.customId
93
- }
94
- )
95
- };
96
- export {
97
- I as c,
98
- S as f,
99
- M as u
100
- };