@feedmepos/mf-connect 0.1.3-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-DvtYt9h5.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-DoH4RX_Y.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-C5-k8WkG.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-DCbvlp5V.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-CMefeirT.js → MemberList-DNjK9BbG.js} +14 -14
  15. package/dist/{MemberTransactions-B9oYdzjR.js → MemberTransactions-CsjN3LZA.js} +1 -1
  16. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-B0T7ze7r.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-BGM1doWM.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-JumDBZLs.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D7GcOiUM.js} +10 -10
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BtBCggcN.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-nuCOrrLE.js} +1 -1
  27. package/dist/{Tier-ms8r2E7c.js → Tier-I_MMd39Y.js} +470 -445
  28. package/dist/{Title-BBKoBs46.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-CGgrMOc_.js → app-DTAyCT-G.js} +1 -1
  34. package/dist/app.js +4 -3
  35. package/dist/{business-DeMUnCNX.js → business-B9OUlaFZ.js} +1 -1
  36. package/dist/{campaign-CBszI6An.js → campaign-CNbUA51l.js} +2 -2
  37. package/dist/{collection.fn-D4Qgx1aW.js → collection.fn-D_i45T4Q.js} +2 -2
  38. package/dist/dto-B4208_es.js +2770 -0
  39. package/dist/{effect-2p4_SGbQ.js → effect-Ye_yr8et.js} +1 -1
  40. package/dist/{email-addresses-Bc9od2gA.js → email-addresses-Gm7Dyaxy.js} +1 -1
  41. package/dist/{export-BK6FgeQO.js → export-Buee5oUV.js} +3 -3
  42. package/dist/{helper-DUkKW7uc.js → helper-BBlHhMFc.js} +1 -1
  43. package/dist/{index-BWWnWRpt.js → index-BxJgFvym.js} +2 -2
  44. package/dist/{index-g4L04WYz.js → index-ByaM-yoc.js} +91 -86
  45. package/dist/{index-B9f-K1No.js → index-C0QHb5SL.js} +2 -2
  46. package/dist/{index-M1SmasnI.js → index-C363BG5A.js} +3 -3
  47. package/dist/{index-Ci8tkzSn.js → index-CLL3no-v.js} +1 -1
  48. package/dist/{index-Cvbyv9Hx.js → index-ChSVaFk3.js} +1 -1
  49. package/dist/{index-D4HYMbSu.js → index-Co9n8I_5.js} +3 -3
  50. package/dist/index-CoGNKU8v.js +3 -0
  51. package/dist/{index-BFcrfL4W.js → index-DHGcUMVN.js} +1 -1
  52. package/dist/{index-CTmiZrHu.js → index-DWWtZSrm.js} +1 -1
  53. package/dist/{index-DRaETKbn.js → index-DdVZgYE4.js} +258 -256
  54. package/dist/{index-AZ8cKg9n.js → index-Dx3HwWcb.js} +1 -1
  55. package/dist/{index.esm2017-kvuav0Sd.js → index.esm2017-Dd02dg_O.js} +38 -38
  56. package/dist/{loading-MNCADfHc.js → loading-Or1ZDzDS.js} +11 -11
  57. package/dist/{membership-CsbTF-DX.js → membership-B8h5ku-v.js} +3 -3
  58. package/dist/{money-Lo7kavmu.js → money-CmsKAJBT.js} +1 -1
  59. package/dist/{number-BviV2K5O.js → number-iEhp7Uai.js} +1 -1
  60. package/dist/{rule-DKrUrnrM.js → rule-BORkgSMK.js} +3 -3
  61. package/dist/{rule-builder-DjPniLk6.js → rule-builder-DEfkSr68.js} +1 -1
  62. package/dist/{template-DteMEC9C.js → template-C_Y7bhlI.js} +4 -4
  63. package/dist/{usePagination-BKTq-UbV.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-DiPWt78u.js +0 -423
  67. package/dist/Broadcast-Dv4XcvBh.js +0 -216
  68. package/dist/Card-DDvwlZF0.js +0 -823
  69. package/dist/Credit-BDQIr_FJ.js +0 -214
  70. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BQzgcn4V.js +0 -344
  71. package/dist/Experience-B9H3tOF0.js +0 -211
  72. package/dist/Game-cy3_ppLO.js +0 -250
  73. package/dist/Marketing-CWXV2n5F.js +0 -309
  74. package/dist/Member-DyTX22Zk.js +0 -92
  75. package/dist/Mission-DxSO3iES.js +0 -248
  76. package/dist/Point-C5UtlqkX.js +0 -220
  77. package/dist/Promotion-DhSGTj-R.js +0 -244
  78. package/dist/Segment-BzI6Ykxp.js +0 -564
  79. package/dist/Setting-SRUWwF9w.js +0 -1870
  80. package/dist/Store-CIrn_7Mh.js +0 -1533
  81. package/dist/StoreRewards-BYc0vgnr.js +0 -429
  82. package/dist/Transaction-IZL9-6fe.js +0 -36
  83. package/dist/Voucher-CIWulmcc.js +0 -485
  84. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
  85. package/dist/app-BQvluJk_.js +0 -2974
  86. package/dist/dto-Dtvg93Bz.js +0 -1145
  87. package/dist/index-UR1Lxi0C.js +0 -11
@@ -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-JumDBZLs.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",
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as M, ref as C, computed as E, onMounted as D, resolveComponent as l, openBlock as p, createElementBlock as v, createElementVNode as m, createVNode as c, unref as u, withCtx as h, createTextVNode as F, toDisplayString as T, Fragment as j, renderList as k, createBlock as U } from "vue";
2
- import { p as A } from "./loading-MNCADfHc.js";
3
- import { r as B } from "./index-g4L04WYz.js";
2
+ import { p as A } from "./loading-Or1ZDzDS.js";
3
+ import { r as B } from "./index-ByaM-yoc.js";
4
4
  const L = {
5
5
  "user.name": {
6
6
  name: "User name"
@@ -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 w, createVNode as i, unref as o, createElementVNode as s, withCtx as b, 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-Or1ZDzDS.js";
5
+ import { u as X } from "./business-B9OUlaFZ.js";
6
+ import { u as Y } from "./campaign-CNbUA51l.js";
7
+ import { g as L, a as M } from "./dto-B4208_es.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-BKSZYxvb.js";
10
+ import { u as oe } from "./template-C_Y7bhlI.js";
11
+ import { s as te } from "./index-CuvNtC_M.js";
12
+ import { u as ne } from "./vue-i18n-BXzrZRP6.js";
13
+ import { c as _ } from "./index-DWWtZSrm.js";
14
+ const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ce = { class: "flex gap-8 overflow-x-auto" }, ie = { 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 = /* @__PURE__ */ s("img", {
15
+ src: z,
16
+ class: "aspect-square w-[150px]"
17
+ }, null, -1), ge = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ke = /* @__PURE__ */ $({
18
+ __name: "Mission",
19
+ setup(he) {
20
+ const { t: n } = ne(), B = {
21
+ label: n("connect.program.common.actions.create", {
22
+ type: n("connect.program.mission.title").toLowerCase()
23
+ }),
24
+ value: "create",
25
+ isPrimary: !0,
26
+ prependIcon: "add"
27
+ }, K = oe("MISSION", G()), N = X(), l = Y(), { global: P, minor: C } = W, c = V({
28
+ searchKey: "",
29
+ location: null
30
+ }), u = E(
31
+ () => l.campaigns.mission.filter(
32
+ (e) => !c.value.location || !e.targetLocation || e.targetLocation.includes(c.value.location)
33
+ )
34
+ ), R = [
35
+ {
36
+ header: n("connect.program.common.table.title"),
37
+ accessorKey: "name",
38
+ // accessorFn: (v) => v.name,
39
+ cell(e) {
40
+ return m("div", { class: "flex items-center justify-between gap-4" }, [
41
+ m("div", { class: "flex items-center" }, [
42
+ m(
43
+ v.FmTooltip,
44
+ {
45
+ content: e.row.original._id,
46
+ onClick: (t) => {
47
+ t.stopPropagation(), J(e.row.original._id);
48
+ }
49
+ },
50
+ [
51
+ m(v.FmIcon, {
52
+ name: "info",
53
+ outline: !0,
54
+ size: "sm"
55
+ })
56
+ ]
57
+ )
58
+ ]),
59
+ m("div", { class: "flex-1" }, e.row.original.name)
60
+ ]);
61
+ }
62
+ },
63
+ {
64
+ header: n("connect.campaign.mission.type"),
65
+ accessorFn: (e) => te(e.mission.type)
66
+ //v.effect,
67
+ },
68
+ {
69
+ header: n("connect.program.common.table.status"),
70
+ cell(e) {
71
+ return L(e.row.original);
72
+ }
73
+ },
74
+ {
75
+ header: n("connect.program.common.table.summary"),
76
+ accessorFn: (e) => M(e)
77
+ //v.effect,
78
+ },
79
+ {
80
+ header: n("connect.campaign.mission.received"),
81
+ accessorFn: (e) => {
82
+ var t;
83
+ return ((t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.currentReceive) ?? 0;
84
+ }
85
+ },
86
+ {
87
+ header: n("connect.program.common.table.actions"),
88
+ cell(e) {
89
+ return m(v.FmButton, {
90
+ variant: "tertiary",
91
+ icon: "delete",
92
+ iconColor: "neutral-gray-400",
93
+ onClick: (t) => {
94
+ t.stopPropagation(), F(e.row.original);
95
+ }
96
+ });
97
+ }
98
+ }
99
+ ], S = V();
100
+ async function F(e) {
101
+ await Q.remove(
102
+ n("connect.program.common.remove.confirm", { name: e.name })
103
+ ) && await C(
104
+ async () => {
105
+ await _.delete(e._id), await l.read("MISSION");
106
+ },
107
+ {
108
+ message: n("connect.program.common.remove.removing", { name: e.name }),
109
+ successMessage: n("connect.program.common.remove.removed", {
110
+ name: e.name
111
+ })
112
+ }
113
+ );
114
+ }
115
+ async function y(e) {
116
+ e ? await t() : K.open(async (f) => {
117
+ await t(f);
118
+ });
119
+ async function t(f) {
120
+ var g;
121
+ (g = S.value) == null || g.showSheet(
122
+ !0,
123
+ "MISSION",
124
+ e ? await _.readById(e._id) : void 0,
125
+ f
126
+ );
127
+ }
128
+ }
129
+ async function T(e) {
130
+ await C(
131
+ async () => {
132
+ e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await l.read("MISSION");
133
+ },
134
+ {
135
+ message: n(
136
+ e.campaign._id ? "connect.program.common.update.updating" : "connect.program.common.update.creating",
137
+ { type: "Mission" }
138
+ ),
139
+ successMessage: n("connect.program.common.update.success", {
140
+ type: "Mission",
141
+ action: e.campaign._id ? "updated" : "created"
142
+ })
143
+ }
144
+ );
145
+ }
146
+ return A(async () => {
147
+ await P(async () => {
148
+ await l.read("MISSION"), console.log(u);
149
+ });
150
+ }), (e, t) => {
151
+ const f = r("FmPageHead"), g = r("FmSearch"), O = r("FmTable"), k = r("FmButton"), j = r("FmListItem"), D = r("FmList"), U = r("FmCard");
152
+ return d(), h(w, null, [
153
+ i(f, {
154
+ title: o(n)("connect.campaign.mission.title"),
155
+ actions: o(u).length > 0 ? [B] : [],
156
+ "onClick:action": t[0] || (t[0] = () => y())
157
+ }, null, 8, ["title", "actions"]),
158
+ s("div", ae, [
159
+ i(g, {
160
+ modelValue: o(c).searchKey,
161
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => o(c).searchKey = a),
162
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
163
+ placeholder: o(n)("connect.program.common.search"),
164
+ collapsible: ""
165
+ }, null, 8, ["modelValue", "placeholder"]),
166
+ o(l).campaigns.mission && o(l).campaigns.mission.length > 0 ? (d(), h(w, { key: 0 }, [
167
+ s("div", se, [
168
+ s("div", ce, [
169
+ i(Z, {
170
+ modelValue: o(c).location,
171
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => o(c).location = a),
172
+ label: o(n)("connect.program.common.location"),
173
+ "show-item-label": !0,
174
+ icon: "storefront",
175
+ placement: "bottom-start",
176
+ items: o(N).locationItems
177
+ }, null, 8, ["modelValue", "label", "items"])
178
+ ]),
179
+ i(g, {
180
+ modelValue: o(c).searchKey,
181
+ "onUpdate:modelValue": t[3] || (t[3] = (a) => o(c).searchKey = a),
182
+ class: "xs:hidden",
183
+ placeholder: "search",
184
+ collapsible: ""
185
+ }, null, 8, ["modelValue"])
186
+ ]),
187
+ i(O, {
188
+ class: "xs:hidden",
189
+ "row-data": o(u),
190
+ "column-defs": R,
191
+ "search-value": o(c).searchKey,
192
+ "column-filter": [],
193
+ onRowClick: t[4] || (t[4] = (a) => y(a.original)),
194
+ "hide-footer": o(u).length < 10
195
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
196
+ i(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
197
+ default: b(() => [
198
+ (d(!0), h(w, null, H(o(u).filter(
199
+ (a) => a.name.toLowerCase().includes(o(c).searchKey.toLowerCase())
200
+ ), (a) => (d(), x(j, {
201
+ key: a._id.toString(),
202
+ onClick: (I) => y(a),
203
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
204
+ }, {
205
+ default: b(() => [
206
+ s("div", ie, [
207
+ s("div", re, [
208
+ (d(), x(q(o(L)(a)))),
209
+ s("div", le, p(a.currentReceive ?? 0) + " used ", 1)
210
+ ]),
211
+ s("div", me, [
212
+ s("div", de, p(a.name), 1),
213
+ s("div", pe, p(o(M)(a)), 1)
214
+ ]),
215
+ s("div", ue, " Token received: " + p(a.currentReceive ?? 0), 1)
216
+ ]),
217
+ i(k, {
218
+ icon: "delete",
219
+ "icon-color": "neutral-gray-400",
220
+ variant: "tertiary",
221
+ onClick: (I) => (I.stopPropagation(), F(a))
222
+ }, null, 8, ["onClick"])
223
+ ]),
224
+ _: 2
225
+ }, 1032, ["onClick"]))), 128))
226
+ ]),
227
+ _: 1
228
+ })
229
+ ], 64)) : (d(), x(U, {
230
+ key: 1,
231
+ variant: "outlined",
232
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
233
+ }, {
234
+ default: b(() => [
235
+ fe,
236
+ s("div", ge, [
237
+ s("div", ye, p(o(n)("connect.campaign.mission.createProgram")), 1),
238
+ s("div", _e, p(o(n)("connect.campaign.mission.description")), 1)
239
+ ]),
240
+ i(k, {
241
+ variant: "primary",
242
+ label: o(n)("connect.campaign.mission.create"),
243
+ icon: "add",
244
+ onClick: t[5] || (t[5] = (a) => y())
245
+ }, null, 8, ["label"])
246
+ ]),
247
+ _: 1
248
+ })),
249
+ i(ee, {
250
+ ref_key: "sheetRef",
251
+ ref: S,
252
+ "onSubmit:modelValue": T
253
+ }, null, 512)
254
+ ])
255
+ ], 64);
256
+ };
257
+ }
258
+ });
259
+ export {
260
+ Ke 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 w, createVNode as r, unref as t, withCtx as _, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as b, 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-Or1ZDzDS.js";
5
+ import { u as X } from "./business-B9OUlaFZ.js";
6
+ import { u as Y } from "./campaign-CNbUA51l.js";
7
+ import { g as I, a as P } from "./dto-B4208_es.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-BKSZYxvb.js";
10
+ import { u as te } from "./template-C_Y7bhlI.js";
11
+ import { u as oe } from "./vue-i18n-BXzrZRP6.js";
12
+ import { c as g } from "./index-DWWtZSrm.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 = /* @__PURE__ */ n("img", {
14
+ src: z,
15
+ class: "aspect-square w-[150px]"
16
+ }, null, -1), _e = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $e = /* @__PURE__ */ j({
17
+ __name: "Point",
18
+ setup(we) {
19
+ const { t: s } = oe(), B = {
20
+ label: s("connect.program.common.actions.create", {
21
+ type: s("connect.program.point.title").toLowerCase()
22
+ }),
23
+ value: "create",
24
+ isPrimary: !0,
25
+ prependIcon: "add"
26
+ }, $ = te("COIN", G()), x = X(), m = Y(), { global: K, minor: C } = W, i = V({
27
+ searchKey: "",
28
+ location: null
29
+ }), u = A(
30
+ () => m.campaigns.point.filter(
31
+ (e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
32
+ )
33
+ ), N = [
34
+ {
35
+ header: s("connect.program.common.table.title"),
36
+ accessorFn: (e) => e.name
37
+ },
38
+ {
39
+ header: s("connect.program.common.table.status"),
40
+ cell(e) {
41
+ return I(e.row.original);
42
+ }
43
+ },
44
+ {
45
+ header: s("connect.program.common.table.summary"),
46
+ accessorFn: (e) => P(e)
47
+ },
48
+ {
49
+ header: s("connect.program.common.table.actions"),
50
+ cell(e) {
51
+ return E(J.FmButton, {
52
+ variant: "tertiary",
53
+ icon: "delete",
54
+ iconColor: "neutral-gray-400",
55
+ onClick: (a) => {
56
+ a.stopPropagation(), F(e.row.original);
57
+ }
58
+ });
59
+ }
60
+ }
61
+ ], v = V();
62
+ async function F(e) {
63
+ await Q.remove(`Are you sure you want to remove ${e.name}?`) && await C(
64
+ async () => {
65
+ await g.delete(e._id), await m.read("COIN");
66
+ },
67
+ {
68
+ message: `Removing ${e.name}`,
69
+ successMessage: `Removed ${e.name} successfully`
70
+ }
71
+ );
72
+ }
73
+ async function f(e) {
74
+ e ? await a() : $.open(async (p) => {
75
+ await a(p);
76
+ });
77
+ async function a(p) {
78
+ var y;
79
+ (y = v.value) == null || y.showSheet(
80
+ !0,
81
+ "COIN",
82
+ e ? await g.readById(e._id) : void 0,
83
+ p
84
+ );
85
+ }
86
+ }
87
+ async function R(e) {
88
+ await C(
89
+ async () => {
90
+ e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await m.read("COIN");
91
+ },
92
+ {
93
+ message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
94
+ successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
95
+ }
96
+ );
97
+ }
98
+ return M(async () => {
99
+ await K(async () => {
100
+ await m.read("COIN");
101
+ });
102
+ }), (e, a) => {
103
+ 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");
104
+ return d(), h(w, null, [
105
+ r(y, {
106
+ title: t(s)("connect.program.point.title"),
107
+ actions: t(u).length > 0 ? [B] : [],
108
+ "onClick:action": a[0] || (a[0] = () => f())
109
+ }, {
110
+ title: _(() => [
111
+ n("div", ae, [
112
+ n("span", ne, c(t(s)("connect.program.point.title")), 1),
113
+ r(p, { variant: "premium" })
114
+ ])
115
+ ]),
116
+ _: 1
117
+ }, 8, ["title", "actions"]),
118
+ n("div", se, [
119
+ r(k, {
120
+ modelValue: t(i).searchKey,
121
+ "onUpdate:modelValue": a[1] || (a[1] = (o) => t(i).searchKey = o),
122
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
123
+ placeholder: "search",
124
+ collapsible: ""
125
+ }, null, 8, ["modelValue"]),
126
+ t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), h(w, { key: 0 }, [
127
+ n("div", ie, [
128
+ n("div", re, [
129
+ r(Z, {
130
+ modelValue: t(i).location,
131
+ "onUpdate:modelValue": a[2] || (a[2] = (o) => t(i).location = o),
132
+ label: "Location: ",
133
+ "show-item-label": !0,
134
+ icon: "storefront",
135
+ placement: "bottom-start",
136
+ items: t(x).locationItems
137
+ }, null, 8, ["modelValue", "items"])
138
+ ]),
139
+ r(k, {
140
+ modelValue: t(i).searchKey,
141
+ "onUpdate:modelValue": a[3] || (a[3] = (o) => t(i).searchKey = o),
142
+ class: "xs:hidden",
143
+ placeholder: "search",
144
+ collapsible: ""
145
+ }, null, 8, ["modelValue"])
146
+ ]),
147
+ r(O, {
148
+ class: "xs:hidden",
149
+ "row-data": t(u),
150
+ "column-defs": N,
151
+ "search-value": t(i).searchKey,
152
+ "column-filter": [],
153
+ onRowClick: a[4] || (a[4] = (o) => f(o.original)),
154
+ "hide-footer": t(u).length < 10
155
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
156
+ r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
157
+ default: _(() => [
158
+ (d(!0), h(w, null, H(t(u).filter(
159
+ (o) => o.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
160
+ ), (o) => (d(), b(U, {
161
+ key: o._id.toString(),
162
+ onClick: (L) => f(o),
163
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
164
+ }, {
165
+ default: _(() => [
166
+ n("div", le, [
167
+ n("div", ce, [
168
+ (d(), b(q(t(I)(o)))),
169
+ n("div", me, c(t(s)("program.point.used", { count: o.currentReceive ?? 0 })), 1)
170
+ ]),
171
+ n("div", de, [
172
+ n("div", pe, c(o.name), 1),
173
+ n("div", ue, c(t(P)(o)), 1)
174
+ ]),
175
+ n("div", fe, " Point received: " + c(o.currentReceive ?? 0), 1)
176
+ ]),
177
+ r(S, {
178
+ icon: "delete",
179
+ "icon-color": "neutral-gray-400",
180
+ variant: "tertiary",
181
+ onClick: (L) => (L.stopPropagation(), F(o))
182
+ }, null, 8, ["onClick"])
183
+ ]),
184
+ _: 2
185
+ }, 1032, ["onClick"]))), 128))
186
+ ]),
187
+ _: 1
188
+ })
189
+ ], 64)) : (d(), b(T, {
190
+ key: 1,
191
+ variant: "outlined",
192
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
193
+ }, {
194
+ default: _(() => [
195
+ ye,
196
+ n("div", _e, [
197
+ n("div", ge, c(t(s)("connect.program.point.empty_state.title")), 1),
198
+ n("div", he, 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: a[5] || (a[5] = (o) => 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
+ $e as default
222
+ };