@feedmepos/mf-connect 0.0.39-prod → 0.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/Analytic-DSD9TsKr.js +622 -0
  2. package/dist/{App-X3fNEBF3.js → App-D8a5eW51.js} +250 -249
  3. package/dist/Broadcast-C8jgMe6g.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CRYS_tzZ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-pG8WvV4I.js} +20 -20
  5. package/dist/Card-C1K7ULPo.js +825 -0
  6. package/dist/Collections-lMrdPUuM.js +453 -0
  7. package/dist/Credit-CJfU5tP4.js +220 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DoZyevfa.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYoaa_-x.js} +1042 -1011
  9. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CzEtOmp0.js +345 -0
  10. package/dist/Experience-Bp2ki8gU.js +221 -0
  11. package/dist/Game-BpTf6ebE.js +255 -0
  12. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  13. package/dist/{MainLayout-DpZC6o3R.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +19 -53
  14. package/dist/MainLayout-B1aJoR95.js +41 -0
  15. package/dist/Marketing-BiKE2gxA.js +316 -0
  16. package/dist/Member-BSWyy32a.js +69 -0
  17. package/dist/MemberList-CHlGREyR.js +1733 -0
  18. package/dist/MemberOverview-wL_ailso.js +58 -0
  19. package/dist/{MemberTransactions-DueaXBCy.js → MemberTransactions-BzHiXCnp.js} +1 -1
  20. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-e-zWg08J.js +432 -0
  21. package/dist/Mission-8IGT3T2C.js +261 -0
  22. package/dist/Point-CbbJ6ohd.js +222 -0
  23. package/dist/Promotion-BYXCJa_S.js +247 -0
  24. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-_RX1J0Br.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bruh-umZ.js} +557 -557
  25. package/dist/Segment-DXDNM0yd.js +437 -0
  26. package/dist/Setting-CLpvvZTv.js +1901 -0
  27. package/dist/Store-C6-P6bwc.js +1511 -0
  28. package/dist/StoreRewards-CUM2irXK.js +401 -0
  29. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CLFiuO5k.js → StoreTransactions.vue_vue_type_script_setup_true_lang-JaRdmqif.js} +10 -10
  30. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CoMQBL4P.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DEb4OBcX.js} +1 -1
  31. package/dist/{Tier-CftEoP_R.js → Tier-DZTDxWBo.js} +481 -453
  32. package/dist/{Title-BsavXbYh.js → Title-C2Dr5ceK.js} +314 -295
  33. package/dist/Transaction-BL4mS29d.js +39 -0
  34. package/dist/Voucher-Cx0r2-df.js +490 -0
  35. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-DWuAODUF.js +56 -0
  36. package/dist/{app-BNmAx3zq.js → app-B_xuZ5HB.js} +1 -1
  37. package/dist/app-wE5HTF_Y.js +5762 -0
  38. package/dist/app.js +5 -3
  39. package/dist/{business-DGL4Ayx0.js → business-DSv8zM8C.js} +1 -1
  40. package/dist/{campaign-D94sS1kM.js → campaign-7y5qquHZ.js} +5 -3
  41. package/dist/{collection.fn-BHJ1ISqO.js → collection.fn-BxVZQAx0.js} +2 -2
  42. package/dist/dto-Ew1QwLci.js +2778 -0
  43. package/dist/{effect-CFRICzlM.js → effect-BzPh8fRI.js} +9 -9
  44. package/dist/{export-w2o9NYcy.js → export-C9tDplkA.js} +3 -3
  45. package/dist/{helper-CUDWQ8vq.js → helper-Sz7oQ0F4.js} +1 -1
  46. package/dist/{index-BGuLhEym.js → index-BQm0C3Jm.js} +3 -3
  47. package/dist/{index-BjwyxNSp.js → index-C-SOz7jt.js} +1 -1
  48. package/dist/{index-BcWJcD9f.js → index-C0lpADCo.js} +1 -1
  49. package/dist/{index-DIq2KVis.js → index-C3_4GUiI.js} +1 -1
  50. package/dist/{index-BPEV5Tzg.js → index-D-2nFLsg.js} +59 -47
  51. package/dist/{index-CFMBSL24.js → index-DBMaUGYI.js} +2 -2
  52. package/dist/{index-CpwFQFTV.js → index-DH_1nOJ_.js} +3 -3
  53. package/dist/index-Dy4pmQpt.js +29193 -0
  54. package/dist/{index-BQ6isIeo.js → index-_3qBsogG.js} +1 -1
  55. package/dist/index-gIRszcHf.js +3 -0
  56. package/dist/{index-VjUw31dN.js → index-tv4t0Pnh.js} +1 -1
  57. package/dist/{index-tZ1aqhks.js → index-z0IfdrZk.js} +319 -281
  58. package/dist/{index.esm2017-zciuPty-.js → index.esm2017-BnKJDxUo.js} +55 -55
  59. package/dist/{loading-GuXe5bYG.js → loading-Ds-yFYhc.js} +469 -460
  60. package/dist/{membership-BHWJVI3e.js → membership-DaiVw9qF.js} +3 -3
  61. package/dist/money-BHtBdZoz.js +15 -0
  62. package/dist/number-CZhcB8ef.js +12 -0
  63. package/dist/{rule-MgNa_8FF.js → rule-Cd2M6Ri2.js} +2 -2
  64. package/dist/{rule-builder-BsBCWzq_.js → rule-builder-B6og27Q1.js} +1 -1
  65. package/dist/style.css +1 -1
  66. package/dist/{template-D6k3lusq.js → template-DouRWBpv.js} +63 -63
  67. package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
  68. package/dist/vue-i18n-BTlOChXs.js +2365 -0
  69. package/dist/{xlsx-ClrA4KOh.js → xlsx-SahfXQ70.js} +517 -517
  70. package/dist/zod-Bg2FbC-D.js +90 -0
  71. package/package.json +7 -4
  72. package/dist/Analytic-DMFueUju.js +0 -620
  73. package/dist/Broadcast-YIfWIXeA.js +0 -216
  74. package/dist/Card-BIxlgQm7.js +0 -824
  75. package/dist/Collections-M6DaHM2W.js +0 -441
  76. package/dist/Credit-BtRy-xoY.js +0 -214
  77. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D5DNTBSQ.js +0 -344
  78. package/dist/Experience-DGm1lnqj.js +0 -211
  79. package/dist/Game-B8-lG7qq.js +0 -250
  80. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
  81. package/dist/Marketing-DtG3AIWr.js +0 -309
  82. package/dist/Member-K443-9Vy.js +0 -92
  83. package/dist/MemberList-CYXHXFTL.js +0 -1735
  84. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  85. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Bk2HLVmt.js +0 -203
  86. package/dist/Mission-CN5umXXA.js +0 -248
  87. package/dist/Point-XAm6H2p_.js +0 -220
  88. package/dist/Promotion-DsrA4KiE.js +0 -244
  89. package/dist/Segment-CZGGHoAu.js +0 -435
  90. package/dist/Setting-BjfxLKyp.js +0 -1870
  91. package/dist/Store-D_B-vhh3.js +0 -1513
  92. package/dist/StoreRewards-BjHffUKj.js +0 -429
  93. package/dist/Transaction-CdxzoKDG.js +0 -36
  94. package/dist/Voucher-B_9Nv1Mr.js +0 -485
  95. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
  96. package/dist/app--1Ks5Hms.js +0 -2974
  97. package/dist/dto-X0Eeujxx.js +0 -1151
  98. package/dist/index-BPNG8N-w.js +0 -11
  99. package/dist/index-DWM9MWGj.js +0 -28058
  100. package/dist/money-CrttVpCp.js +0 -15
  101. package/dist/number-CIndGU4O.js +0 -12
@@ -0,0 +1,261 @@
1
+ import { defineComponent as $, ref as V, computed as E, h as m, onMounted as A, resolveComponent as r, openBlock as d, createElementBlock as h, Fragment as b, createVNode as c, unref as t, createElementVNode as s, withCtx as w, renderList as H, createBlock as x, resolveDynamicComponent as q, toDisplayString as p } from "vue";
2
+ import { _ as z } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as G, components as v } from "@feedmepos/ui-library";
4
+ import { a as J, p as Q, u as W } from "./loading-Ds-yFYhc.js";
5
+ import { u as X } from "./business-DSv8zM8C.js";
6
+ import { u as Y } from "./campaign-7y5qquHZ.js";
7
+ import { g as L, b as M } from "./dto-Ew1QwLci.js";
8
+ import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
+ import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYoaa_-x.js";
10
+ import { u as oe } from "./template-DouRWBpv.js";
11
+ import { s as te } from "./index-CuvNtC_M.js";
12
+ import { u as ne } from "./vue-i18n-BTlOChXs.js";
13
+ import { c as _ } from "./index-C-SOz7jt.js";
14
+ const ae = { 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" }, re = { class: "flex w-full gap-4 items-center" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ $({
15
+ __name: "Mission",
16
+ setup(_e) {
17
+ const { t: n } = ne(), B = {
18
+ label: n("connect.program.common.actions.create", {
19
+ type: n("connect.program.mission.title").toLowerCase()
20
+ }),
21
+ value: "create",
22
+ isPrimary: !0,
23
+ prependIcon: "add"
24
+ }, K = oe("MISSION", G()), N = X(), l = Y(), { global: P, minor: C } = W, i = V({
25
+ searchKey: "",
26
+ location: null
27
+ }), u = E(
28
+ () => l.campaigns.mission.filter(
29
+ (e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
30
+ )
31
+ ), R = [
32
+ {
33
+ header: n("connect.program.common.table.title"),
34
+ accessorKey: "name",
35
+ // accessorFn: (v) => v.name,
36
+ cell(e) {
37
+ return m("div", { class: "flex items-center justify-between gap-4" }, [
38
+ m("div", { class: "flex items-center" }, [
39
+ m(
40
+ v.FmTooltip,
41
+ {
42
+ content: e.row.original._id,
43
+ onClick: (o) => {
44
+ o.stopPropagation(), J(e.row.original._id);
45
+ }
46
+ },
47
+ [
48
+ m(v.FmIcon, {
49
+ name: "info",
50
+ outline: !0,
51
+ size: "sm"
52
+ })
53
+ ]
54
+ )
55
+ ]),
56
+ m("div", { class: "flex-1" }, e.row.original.name)
57
+ ]);
58
+ }
59
+ },
60
+ {
61
+ header: n("connect.campaign.mission.type"),
62
+ accessorFn: (e) => te(e.mission.type)
63
+ //v.effect,
64
+ },
65
+ {
66
+ header: n("connect.program.common.table.status"),
67
+ cell(e) {
68
+ return L(e.row.original);
69
+ }
70
+ },
71
+ {
72
+ header: n("connect.program.common.table.summary"),
73
+ accessorFn: (e) => M(e)
74
+ //v.effect,
75
+ },
76
+ {
77
+ header: n("connect.campaign.mission.received"),
78
+ accessorFn: (e) => {
79
+ var o;
80
+ return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
81
+ }
82
+ },
83
+ {
84
+ header: n("connect.program.common.table.actions"),
85
+ cell(e) {
86
+ return m(v.FmButton, {
87
+ variant: "tertiary",
88
+ icon: "delete",
89
+ iconColor: "neutral-gray-400",
90
+ onClick: (o) => {
91
+ o.stopPropagation(), F(e.row.original);
92
+ }
93
+ });
94
+ }
95
+ }
96
+ ], S = V();
97
+ async function F(e) {
98
+ await Q.remove(
99
+ n("connect.program.common.remove.confirm", { name: e.name })
100
+ ) && await C(
101
+ async () => {
102
+ await _.delete(e._id), await l.read("MISSION");
103
+ },
104
+ {
105
+ message: n("connect.program.common.remove.removing", { name: e.name }),
106
+ successMessage: n("connect.program.common.remove.removed", {
107
+ name: e.name
108
+ })
109
+ }
110
+ );
111
+ }
112
+ async function y(e) {
113
+ e ? await o() : K.open(async (f) => {
114
+ await o(f);
115
+ });
116
+ async function o(f) {
117
+ var g;
118
+ (g = S.value) == null || g.showSheet(
119
+ !0,
120
+ "MISSION",
121
+ e ? await _.readById(e._id) : void 0,
122
+ f
123
+ );
124
+ }
125
+ }
126
+ async function T(e) {
127
+ await C(
128
+ async () => {
129
+ e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await l.read("MISSION");
130
+ },
131
+ {
132
+ message: n(
133
+ e.campaign._id ? "connect.program.common.update.updating" : "connect.program.common.update.creating",
134
+ { type: "Mission" }
135
+ ),
136
+ successMessage: n("connect.program.common.update.success", {
137
+ type: "Mission",
138
+ action: e.campaign._id ? "updated" : "created"
139
+ })
140
+ }
141
+ );
142
+ }
143
+ return A(async () => {
144
+ await P(async () => {
145
+ await l.read("MISSION"), console.log(u);
146
+ });
147
+ }), (e, o) => {
148
+ const f = r("FmPageHead"), g = r("FmSearch"), O = r("FmTable"), k = r("FmButton"), j = r("FmListItem"), D = r("FmList"), U = r("FmCard");
149
+ return d(), h(b, null, [
150
+ c(f, {
151
+ title: t(n)("connect.campaign.mission.title"),
152
+ actions: t(u).length > 0 ? [B] : [],
153
+ "onClick:action": o[0] || (o[0] = () => y())
154
+ }, null, 8, ["title", "actions"]),
155
+ s("div", ae, [
156
+ c(g, {
157
+ modelValue: t(i).searchKey,
158
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
159
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
160
+ placeholder: t(n)("connect.program.common.search"),
161
+ collapsible: ""
162
+ }, null, 8, ["modelValue", "placeholder"]),
163
+ t(l).campaigns.mission && t(l).campaigns.mission.length > 0 ? (d(), h(b, { key: 0 }, [
164
+ s("div", se, [
165
+ s("div", ie, [
166
+ c(Z, {
167
+ modelValue: t(i).location,
168
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
169
+ label: t(n)("connect.program.common.location"),
170
+ "show-item-label": !0,
171
+ icon: "storefront",
172
+ placement: "bottom-start",
173
+ items: t(N).locationItems
174
+ }, null, 8, ["modelValue", "label", "items"])
175
+ ]),
176
+ c(g, {
177
+ modelValue: t(i).searchKey,
178
+ "onUpdate:modelValue": o[3] || (o[3] = (a) => t(i).searchKey = a),
179
+ class: "xs:hidden",
180
+ placeholder: "search",
181
+ collapsible: ""
182
+ }, null, 8, ["modelValue"])
183
+ ]),
184
+ c(O, {
185
+ class: "xs:hidden",
186
+ "row-data": t(u),
187
+ "column-defs": R,
188
+ "search-value": t(i).searchKey,
189
+ "column-filter": [],
190
+ onRowClick: o[4] || (o[4] = (a) => y(a.original)),
191
+ "hide-footer": t(u).length < 10
192
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
193
+ c(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
194
+ default: w(() => [
195
+ (d(!0), h(b, null, H(t(u).filter(
196
+ (a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
197
+ ), (a) => (d(), x(j, {
198
+ key: a._id.toString(),
199
+ onClick: (I) => y(a),
200
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
201
+ }, {
202
+ default: w(() => [
203
+ s("div", ce, [
204
+ s("div", re, [
205
+ (d(), x(q(t(L)(a)))),
206
+ s("div", le, p(a.currentReceive ?? 0) + " used ", 1)
207
+ ]),
208
+ s("div", me, [
209
+ s("div", de, p(a.name), 1),
210
+ s("div", pe, p(t(M)(a)), 1)
211
+ ]),
212
+ s("div", ue, " Token received: " + p(a.currentReceive ?? 0), 1)
213
+ ]),
214
+ c(k, {
215
+ icon: "delete",
216
+ "icon-color": "neutral-gray-400",
217
+ variant: "tertiary",
218
+ onClick: (I) => (I.stopPropagation(), F(a))
219
+ }, null, 8, ["onClick"])
220
+ ]),
221
+ _: 2
222
+ }, 1032, ["onClick"]))), 128))
223
+ ]),
224
+ _: 1
225
+ })
226
+ ], 64)) : (d(), x(U, {
227
+ key: 1,
228
+ variant: "outlined",
229
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
230
+ }, {
231
+ default: w(() => [
232
+ o[6] || (o[6] = s("img", {
233
+ src: z,
234
+ class: "aspect-square w-[150px]"
235
+ }, null, -1)),
236
+ s("div", fe, [
237
+ s("div", ge, p(t(n)("connect.campaign.mission.createProgram")), 1),
238
+ s("div", ye, p(t(n)("connect.campaign.mission.description")), 1)
239
+ ]),
240
+ c(k, {
241
+ variant: "primary",
242
+ label: t(n)("connect.campaign.mission.create"),
243
+ icon: "add",
244
+ onClick: o[5] || (o[5] = (a) => y())
245
+ }, null, 8, ["label"])
246
+ ]),
247
+ _: 1
248
+ })),
249
+ c(ee, {
250
+ ref_key: "sheetRef",
251
+ ref: S,
252
+ "onSubmit:modelValue": T
253
+ }, null, 512)
254
+ ])
255
+ ], 64);
256
+ };
257
+ }
258
+ });
259
+ export {
260
+ Be as default
261
+ };
@@ -0,0 +1,222 @@
1
+ import { defineComponent as j, ref as V, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as h, Fragment as b, createVNode as r, unref as t, withCtx as g, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as w, resolveDynamicComponent as q } from "vue";
2
+ import { _ as z } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
+ import { p as Q, u as W } from "./loading-Ds-yFYhc.js";
5
+ import { u as X } from "./business-DSv8zM8C.js";
6
+ import { u as Y } from "./campaign-7y5qquHZ.js";
7
+ import { g as I, b as P } from "./dto-Ew1QwLci.js";
8
+ import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
+ import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYoaa_-x.js";
10
+ import { u as te } from "./template-DouRWBpv.js";
11
+ import { u as oe } from "./vue-i18n-BTlOChXs.js";
12
+ import { c as _ } from "./index-C-SOz7jt.js";
13
+ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, se = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { 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" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { 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 = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ j({
14
+ __name: "Point",
15
+ setup(he) {
16
+ const { t: s } = oe(), B = {
17
+ label: s("connect.program.common.actions.create", {
18
+ type: s("connect.program.point.title").toLowerCase()
19
+ }),
20
+ value: "create",
21
+ isPrimary: !0,
22
+ prependIcon: "add"
23
+ }, $ = te("COIN", G()), x = X(), m = Y(), { global: K, minor: C } = W, i = V({
24
+ searchKey: "",
25
+ location: null
26
+ }), u = A(
27
+ () => m.campaigns.point.filter(
28
+ (e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
29
+ )
30
+ ), N = [
31
+ {
32
+ header: s("connect.program.common.table.title"),
33
+ accessorFn: (e) => e.name
34
+ },
35
+ {
36
+ header: s("connect.program.common.table.status"),
37
+ cell(e) {
38
+ return I(e.row.original);
39
+ }
40
+ },
41
+ {
42
+ header: s("connect.program.common.table.summary"),
43
+ accessorFn: (e) => P(e)
44
+ },
45
+ {
46
+ header: s("connect.program.common.table.actions"),
47
+ cell(e) {
48
+ return E(J.FmButton, {
49
+ variant: "tertiary",
50
+ icon: "delete",
51
+ iconColor: "neutral-gray-400",
52
+ onClick: (o) => {
53
+ o.stopPropagation(), F(e.row.original);
54
+ }
55
+ });
56
+ }
57
+ }
58
+ ], v = V();
59
+ async function F(e) {
60
+ await Q.remove(`Are you sure you want to remove ${e.name}?`) && await C(
61
+ async () => {
62
+ await _.delete(e._id), await m.read("COIN");
63
+ },
64
+ {
65
+ message: `Removing ${e.name}`,
66
+ successMessage: `Removed ${e.name} successfully`
67
+ }
68
+ );
69
+ }
70
+ async function f(e) {
71
+ e ? await o() : $.open(async (p) => {
72
+ await o(p);
73
+ });
74
+ async function o(p) {
75
+ var y;
76
+ (y = v.value) == null || y.showSheet(
77
+ !0,
78
+ "COIN",
79
+ e ? await _.readById(e._id) : void 0,
80
+ p
81
+ );
82
+ }
83
+ }
84
+ async function R(e) {
85
+ await C(
86
+ async () => {
87
+ e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await m.read("COIN");
88
+ },
89
+ {
90
+ message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
91
+ successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
92
+ }
93
+ );
94
+ }
95
+ return M(async () => {
96
+ await K(async () => {
97
+ await m.read("COIN");
98
+ });
99
+ }), (e, o) => {
100
+ const p = l("FmPill"), y = l("FmPageHead"), k = l("FmSearch"), O = l("FmTable"), S = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
101
+ return d(), h(b, null, [
102
+ r(y, {
103
+ title: t(s)("connect.program.point.title"),
104
+ actions: t(u).length > 0 ? [B] : [],
105
+ "onClick:action": o[0] || (o[0] = () => f())
106
+ }, {
107
+ title: g(() => [
108
+ n("div", ae, [
109
+ n("span", ne, c(t(s)("connect.program.point.title")), 1),
110
+ r(p, { variant: "premium" })
111
+ ])
112
+ ]),
113
+ _: 1
114
+ }, 8, ["title", "actions"]),
115
+ n("div", se, [
116
+ r(k, {
117
+ modelValue: t(i).searchKey,
118
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
119
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
120
+ placeholder: "search",
121
+ collapsible: ""
122
+ }, null, 8, ["modelValue"]),
123
+ t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), h(b, { key: 0 }, [
124
+ n("div", ie, [
125
+ n("div", re, [
126
+ r(Z, {
127
+ modelValue: t(i).location,
128
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
129
+ label: "Location: ",
130
+ "show-item-label": !0,
131
+ icon: "storefront",
132
+ placement: "bottom-start",
133
+ items: t(x).locationItems
134
+ }, null, 8, ["modelValue", "items"])
135
+ ]),
136
+ r(k, {
137
+ modelValue: t(i).searchKey,
138
+ "onUpdate:modelValue": o[3] || (o[3] = (a) => t(i).searchKey = a),
139
+ class: "xs:hidden",
140
+ placeholder: "search",
141
+ collapsible: ""
142
+ }, null, 8, ["modelValue"])
143
+ ]),
144
+ r(O, {
145
+ class: "xs:hidden",
146
+ "row-data": t(u),
147
+ "column-defs": N,
148
+ "search-value": t(i).searchKey,
149
+ "column-filter": [],
150
+ onRowClick: o[4] || (o[4] = (a) => f(a.original)),
151
+ "hide-footer": t(u).length < 10
152
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
153
+ r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
154
+ default: g(() => [
155
+ (d(!0), h(b, null, H(t(u).filter(
156
+ (a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
157
+ ), (a) => (d(), w(U, {
158
+ key: a._id.toString(),
159
+ onClick: (L) => f(a),
160
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
161
+ }, {
162
+ default: g(() => [
163
+ n("div", le, [
164
+ n("div", ce, [
165
+ (d(), w(q(t(I)(a)))),
166
+ n("div", me, c(t(s)("program.point.used", { count: a.currentReceive ?? 0 })), 1)
167
+ ]),
168
+ n("div", de, [
169
+ n("div", pe, c(a.name), 1),
170
+ n("div", ue, c(t(P)(a)), 1)
171
+ ]),
172
+ n("div", fe, " Point received: " + c(a.currentReceive ?? 0), 1)
173
+ ]),
174
+ r(S, {
175
+ icon: "delete",
176
+ "icon-color": "neutral-gray-400",
177
+ variant: "tertiary",
178
+ onClick: (L) => (L.stopPropagation(), F(a))
179
+ }, null, 8, ["onClick"])
180
+ ]),
181
+ _: 2
182
+ }, 1032, ["onClick"]))), 128))
183
+ ]),
184
+ _: 1
185
+ })
186
+ ], 64)) : (d(), w(T, {
187
+ key: 1,
188
+ variant: "outlined",
189
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
190
+ }, {
191
+ default: g(() => [
192
+ o[6] || (o[6] = n("img", {
193
+ src: z,
194
+ class: "aspect-square w-[150px]"
195
+ }, null, -1)),
196
+ n("div", ye, [
197
+ n("div", ge, c(t(s)("connect.program.point.empty_state.title")), 1),
198
+ n("div", _e, c(t(s)("connect.program.point.empty_state.description")), 1)
199
+ ]),
200
+ r(S, {
201
+ variant: "primary",
202
+ label: "Create point program",
203
+ disabled: !t(x).isPremium,
204
+ icon: "add",
205
+ onClick: o[5] || (o[5] = (a) => f())
206
+ }, null, 8, ["disabled"])
207
+ ]),
208
+ _: 1
209
+ })),
210
+ r(ee, {
211
+ ref_key: "sheetRef",
212
+ ref: v,
213
+ "onSubmit:modelValue": R
214
+ }, null, 512)
215
+ ])
216
+ ], 64);
217
+ };
218
+ }
219
+ });
220
+ export {
221
+ Be as default
222
+ };