@feedmepos/mf-connect 0.1.0-beta.8 → 0.1.0-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 (101) hide show
  1. package/dist/Analytic-D1vIDmhJ.js +620 -0
  2. package/dist/{App-SRz4257n.js → App-DHrfWG8l.js} +249 -250
  3. package/dist/Broadcast-B2rxZAZi.js +216 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CZXSxA9u.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2a9rcXK.js} +20 -20
  5. package/dist/Card-Dr6pTTM0.js +824 -0
  6. package/dist/Collections-0tbg0MFt.js +441 -0
  7. package/dist/Credit-KbB_7Jq-.js +214 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cuklmxur.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-we7ADwFk.js} +999 -1018
  9. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-VBNyvZCJ.js +344 -0
  10. package/dist/Experience-C_Q9Iml8.js +211 -0
  11. package/dist/Game-BwODw7M6.js +250 -0
  12. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
  13. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → MainLayout-DpZC6o3R.js} +53 -19
  14. package/dist/Marketing-QOKTAS_T.js +309 -0
  15. package/dist/Member-d7RIGRm1.js +92 -0
  16. package/dist/MemberList-CK9629ew.js +1737 -0
  17. package/dist/MemberOverview-C2n9oJZh.js +58 -0
  18. package/dist/{MemberTransactions-BwT3zE2a.js → MemberTransactions-D-pnlXiP.js} +1 -1
  19. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-3VS7JnK6.js +203 -0
  20. package/dist/Mission-BAKDm4VZ.js +248 -0
  21. package/dist/Point-Puu0jKz0.js +220 -0
  22. package/dist/Promotion-DRIaUvJi.js +244 -0
  23. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BkFm7tXq.js → RuleGroup.vue_vue_type_script_setup_true_lang-DTdfYGya.js} +557 -557
  24. package/dist/Segment-DpBxGuuu.js +435 -0
  25. package/dist/Setting-DLB2ywCp.js +1870 -0
  26. package/dist/Store-8DO6ITWc.js +1513 -0
  27. package/dist/StoreRewards-DZfqUeYR.js +429 -0
  28. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BqpsMcl1.js → StoreTransactions.vue_vue_type_script_setup_true_lang-RTfozD01.js} +10 -10
  29. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrzmjYmU.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BGI78ycg.js} +1 -1
  30. package/dist/{Tier-CJ9-d8Zg.js → Tier-BnQRujpX.js} +453 -481
  31. package/dist/{Title-DZCpvg4q.js → Title-BPf1tUFx.js} +295 -314
  32. package/dist/Transaction-ese0oNrz.js +36 -0
  33. package/dist/Voucher--gtOZQx1.js +485 -0
  34. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
  35. package/dist/app-Bt59niI-.js +2974 -0
  36. package/dist/{app-Cg2pTZJK.js → app-DHE61XdR.js} +1 -1
  37. package/dist/app.js +3 -5
  38. package/dist/{business-Cw_qGw8y.js → business-BSo7EPan.js} +1 -1
  39. package/dist/{campaign-winsqufa.js → campaign-CsOje3Ap.js} +3 -5
  40. package/dist/{collection.fn-CI5Llblg.js → collection.fn-BYQfFJOr.js} +2 -2
  41. package/dist/dto-CfEXSCq6.js +1145 -0
  42. package/dist/{effect-CdkrIYgX.js → effect-Bn_ofYS3.js} +9 -9
  43. package/dist/{export-DGxfief1.js → export-CMR243CF.js} +3 -3
  44. package/dist/{helper-B8RqcTNu.js → helper-BqOQRtvW.js} +1 -1
  45. package/dist/index-BLDYTxnc.js +28058 -0
  46. package/dist/{index-Cw_aXFH6.js → index-BWnFs-Cb.js} +281 -299
  47. package/dist/{index-wzdbEEcZ.js → index-BaBNmzUb.js} +1 -1
  48. package/dist/{index-CjVmULNd.js → index-Boo5np6l.js} +1 -1
  49. package/dist/{index-HZC9LLAX.js → index-CC1GV8OW.js} +1 -1
  50. package/dist/{index-OzicErwL.js → index-CHO4_zsT.js} +1 -1
  51. package/dist/{index-DAEmawcj.js → index-DEZsrQ2f.js} +3 -3
  52. package/dist/{index-9w43_U1v.js → index-D_f2lmK2.js} +1 -1
  53. package/dist/{index-BaozRfWB.js → index-Da142OER.js} +66 -78
  54. package/dist/index-DbP04yeg.js +11 -0
  55. package/dist/{index-A34xEz20.js → index-DtPe-TEm.js} +3 -3
  56. package/dist/{index-BLACZ3-L.js → index-FvlaxwGB.js} +20 -20
  57. package/dist/{index.esm2017-CppSMh_U.js → index.esm2017-ePm--Atp.js} +55 -55
  58. package/dist/{loading-DuEFUCwF.js → loading-KNmEMBUB.js} +460 -469
  59. package/dist/{membership-nsMtWeTC.js → membership-DKoVIS1a.js} +3 -3
  60. package/dist/money-CkD3zl5C.js +15 -0
  61. package/dist/number-BDsGpOXm.js +12 -0
  62. package/dist/{rule-CPIMqt1h.js → rule-CzamI50_.js} +2 -2
  63. package/dist/{rule-builder-CSs5XRKP.js → rule-builder-DHf6wfaQ.js} +1 -1
  64. package/dist/style.css +1 -1
  65. package/dist/{template-CJZoYavu.js → template-CFAIPoD7.js} +63 -63
  66. package/dist/{usePagination-BeF5K3M7.js → usePagination-JoYaROkV.js} +85 -85
  67. package/dist/{xlsx-BZlnYinX.js → xlsx-BDJMaozs.js} +517 -517
  68. package/package.json +4 -7
  69. package/dist/Analytic-5QztrYSp.js +0 -622
  70. package/dist/Broadcast-DmkrJGp2.js +0 -223
  71. package/dist/Card-BsjFTVsH.js +0 -825
  72. package/dist/Collections-7wqZHOax.js +0 -453
  73. package/dist/Credit-CcNrq9qk.js +0 -220
  74. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BIZDiLns.js +0 -345
  75. package/dist/Experience-DNsQLzDH.js +0 -221
  76. package/dist/Game-DlzDerT7.js +0 -255
  77. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
  78. package/dist/MainLayout-B1aJoR95.js +0 -41
  79. package/dist/Marketing-BqhpaG4o.js +0 -316
  80. package/dist/Member-AFgZcdtz.js +0 -69
  81. package/dist/MemberList-BKgrLz2C.js +0 -1733
  82. package/dist/MemberOverview-wL_ailso.js +0 -58
  83. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-GCEQCVOt.js +0 -432
  84. package/dist/Mission-BTAia7AS.js +0 -261
  85. package/dist/Point-Ck8EG_3k.js +0 -222
  86. package/dist/Promotion-0v3kvsK3.js +0 -247
  87. package/dist/Segment-BenLupqV.js +0 -437
  88. package/dist/Setting-0fpREqpJ.js +0 -1901
  89. package/dist/Store-BDGwe4ar.js +0 -1511
  90. package/dist/StoreRewards-TDZt9H1V.js +0 -401
  91. package/dist/Transaction-DpnTxlbf.js +0 -39
  92. package/dist/Voucher-DsP_rh8I.js +0 -490
  93. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-SukfoJpU.js +0 -56
  94. package/dist/app-DzAexOqx.js +0 -5639
  95. package/dist/dto-ozu1smC3.js +0 -2770
  96. package/dist/index-CZgQVRsm.js +0 -3
  97. package/dist/index-Oxr-mU6h.js +0 -29193
  98. package/dist/money-BGZPFtUc.js +0 -15
  99. package/dist/number-4J0xvXP9.js +0 -12
  100. package/dist/vue-i18n-CCyiVzOE.js +0 -2365
  101. package/dist/zod-Bg2FbC-D.js +0 -90
@@ -0,0 +1,58 @@
1
+ import { defineComponent as d, resolveComponent as o, openBlock as r, createElementBlock as s, Fragment as a, createElementVNode as e, createVNode as c, withCtx as v, renderList as p, normalizeClass as _, toDisplayString as n, createCommentVNode as u } from "vue";
2
+ const y = { class: "bg-gradient-to-r from-orange-200 p-24 to-blue-200 via-pink-100 mx-[-24px]" }, b = /* @__PURE__ */ e("div", { class: "fm-typo-en-body-lg-600" }, "Member overview", -1), g = { class: "grid grid-cols-6 xs:grid-cols-2 gap-4 divide-x xs:divide-x-0" }, x = { class: "fm-typo-body-md-400 fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, f = { class: "fm-typo-en-title-sm-800" }, F = /* @__PURE__ */ d({
3
+ __name: "MemberOverview",
4
+ setup(k) {
5
+ const l = [
6
+ {
7
+ key: "Total member",
8
+ value: 4
9
+ },
10
+ {
11
+ key: "New member",
12
+ value: 2
13
+ },
14
+ {
15
+ key: "Member average spend",
16
+ value: 100
17
+ },
18
+ {
19
+ key: "Average visit time",
20
+ value: 567
21
+ },
22
+ {
23
+ key: "Member growth",
24
+ value: "100%"
25
+ },
26
+ { key: "Inactive member", value: 0 }
27
+ ];
28
+ return (h, C) => {
29
+ const i = o("FmCard");
30
+ return o("FmButton"), r(), s(a, null, [
31
+ e("div", y, [
32
+ c(i, {
33
+ variant: "outlined",
34
+ class: "flex flex-col gap-16 p-16"
35
+ }, {
36
+ default: v(() => [
37
+ b,
38
+ e("div", g, [
39
+ (r(), s(a, null, p(l, (t, m) => e("div", {
40
+ key: t.key,
41
+ class: _(["px-8", { "xs:!border-r": m % 2 == 0 }])
42
+ }, [
43
+ e("div", x, n(t.key), 1),
44
+ e("div", f, n(t.value), 1)
45
+ ], 2)), 64))
46
+ ])
47
+ ]),
48
+ _: 1
49
+ })
50
+ ]),
51
+ u("", !0)
52
+ ], 64);
53
+ };
54
+ }
55
+ });
56
+ export {
57
+ F as default
58
+ };
@@ -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-BqpsMcl1.js";
2
+ import { _ as b, a as k } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-RTfozD01.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",
@@ -0,0 +1,203 @@
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-KNmEMBUB.js";
3
+ import { r as B } from "./index-Da142OER.js";
4
+ const L = {
5
+ "user.name": {
6
+ name: "User name"
7
+ },
8
+ "user.birthday": {
9
+ name: "Birthday"
10
+ },
11
+ "user.joinAt": {
12
+ name: "Join at"
13
+ },
14
+ "user.expiringVouchers.days7": {
15
+ name: "Expiring vouchers in 7 days"
16
+ },
17
+ "user.expiringVouchers.days30": {
18
+ name: "Expiring vouchers in 30 days"
19
+ },
20
+ "user.expiringVouchers.days90": {
21
+ name: "Expiring vouchers in 90 days"
22
+ },
23
+ "user.tier": {
24
+ name: "User tier"
25
+ },
26
+ "user.point": {
27
+ name: "User experience"
28
+ },
29
+ "transaction.amount": {
30
+ name: "Reward amount"
31
+ },
32
+ "collectible.name": {
33
+ name: "Reward name"
34
+ }
35
+ }, O = { class: "space-y-0" }, $ = { class: "flex items-center gap-8 justify-between" }, I = /* @__PURE__ */ m("div", { class: "fm-typo-en-body-lg-400" }, "Add message", -1), N = { class: "relative" }, P = { class: "absolute bottom-[24px] right-[4px]" }, K = /* @__PURE__ */ M({
36
+ __name: "MessageInput",
37
+ props: {
38
+ modelValue: {
39
+ type: Object
40
+ },
41
+ triggerType: {
42
+ type: String,
43
+ default: () => "SCHEDULE"
44
+ },
45
+ helperText: {
46
+ type: String
47
+ },
48
+ helperState: {
49
+ type: String
50
+ },
51
+ variables: {
52
+ type: Object,
53
+ default: () => [
54
+ "user.name",
55
+ "user.birthday",
56
+ "user.joinAt",
57
+ "user.expiringVouchers.days7",
58
+ "user.expiringVouchers.days30",
59
+ "user.expiringVouchers.days90",
60
+ "user.tier",
61
+ "user.point",
62
+ "transaction.amount",
63
+ "collectible.name"
64
+ ]
65
+ },
66
+ placeholder: {
67
+ type: String
68
+ }
69
+ },
70
+ emits: ["update:model-value"],
71
+ setup(r, { emit: V }) {
72
+ const n = r, g = V;
73
+ function S() {
74
+ var t;
75
+ const a = {
76
+ user: {
77
+ name: "John Doe",
78
+ tier: 1,
79
+ point: 1283,
80
+ birthday: (/* @__PURE__ */ new Date("2000-10-02T16:00:00.000Z")).toLocaleDateString(),
81
+ joinAt: (/* @__PURE__ */ new Date("2024-06-14")).toLocaleDateString(),
82
+ expiringVouchers: { days7: 3, days30: 5, days90: 5 }
83
+ },
84
+ transaction: {
85
+ amount: 3
86
+ },
87
+ collectible: {
88
+ name: "RM10 Voucher"
89
+ }
90
+ }, e = B(
91
+ ((t = n.modelValue) == null ? void 0 : t.content) ?? "",
92
+ a
93
+ );
94
+ A.confirm(e, "Preview message", "OK");
95
+ }
96
+ function d(a) {
97
+ g("update:model-value", {
98
+ channel: "SMS",
99
+ content: a,
100
+ language: "en",
101
+ variables: n.variables
102
+ });
103
+ }
104
+ const _ = C(n.helperState || "none"), y = E(() => {
105
+ var t;
106
+ const a = ((t = n.modelValue) == null ? void 0 : t.content.replace(/{{([^}]+)}}/g, (s, o) => {
107
+ switch (o) {
108
+ case "user.name":
109
+ return "1234567890";
110
+ case "user.tier":
111
+ return "1";
112
+ case "user.point":
113
+ return "1000";
114
+ case "user.birthday":
115
+ return "01/01/2024";
116
+ case "user.joinAt":
117
+ return "01/01/2024";
118
+ case "user.expiringVouchers.days7":
119
+ case "user.expiringVouchers.days30":
120
+ case "user.expiringVouchers.days90":
121
+ return "5";
122
+ case "transaction.amount":
123
+ return "100";
124
+ case "collectible.name":
125
+ return "Voucher";
126
+ default:
127
+ return "...";
128
+ }
129
+ })) || "";
130
+ let e = 0;
131
+ for (let s = 0; s < a.length; s++) {
132
+ const o = a.charAt(s);
133
+ /[\u4e00-\u9fff\u3040-\u30ff\u3400-\u4dbf]/.test(o) || /[{}\\~\[\]|\^€]/.test(o) ? e += 2 : e += 1;
134
+ }
135
+ return `Character used: ${e} ≈ ${Math.ceil(e / 160)} SMS (Every 160 characters will be sent as 1 SMS)`;
136
+ });
137
+ return D(() => {
138
+ g("update:model-value", {
139
+ ...n.modelValue,
140
+ variables: n.variables
141
+ }), n.modelValue || d("");
142
+ }), (a, e) => {
143
+ var x;
144
+ const t = l("FmButton"), s = l("FmTextarea"), o = l("FmMenuItem"), w = l("FmMenu");
145
+ return p(), v("div", O, [
146
+ m("div", $, [
147
+ I,
148
+ c(t, {
149
+ icon: "visibility",
150
+ label: "Preview message",
151
+ variant: "plain",
152
+ onClick: S
153
+ })
154
+ ]),
155
+ m("div", N, [
156
+ c(s, {
157
+ "model-value": (x = r.modelValue) == null ? void 0 : x.content,
158
+ "onUpdate:modelValue": d,
159
+ "show-word-count": !0,
160
+ placeholder: r.placeholder,
161
+ "helper-state": u(_) || "none",
162
+ "helper-text": u(y)
163
+ }, {
164
+ "helper-text": h(() => [
165
+ F(T(u(y)), 1)
166
+ ]),
167
+ _: 1
168
+ }, 8, ["model-value", "placeholder", "helper-state", "helper-text"]),
169
+ m("div", P, [
170
+ c(w, { placement: "left-end" }, {
171
+ "menu-button": h(() => [
172
+ c(t, {
173
+ icon: "add",
174
+ variant: "tertiary",
175
+ size: "md"
176
+ })
177
+ ]),
178
+ default: h(() => [
179
+ (p(!0), v(j, null, k(r.variables.filter(
180
+ (i) => r.triggerType == "SCHEDULE" ? !i.startsWith("transaction.") : !0
181
+ ), (i) => {
182
+ var f;
183
+ return p(), U(o, {
184
+ key: i,
185
+ label: ((f = u(L)[i]) == null ? void 0 : f.name) || i,
186
+ onClick: (R) => {
187
+ var b;
188
+ return d(((b = r.modelValue) == null ? void 0 : b.content) + `{{${i}}}`);
189
+ }
190
+ }, null, 8, ["label", "onClick"]);
191
+ }), 128))
192
+ ]),
193
+ _: 1
194
+ })
195
+ ])
196
+ ])
197
+ ]);
198
+ };
199
+ }
200
+ });
201
+ export {
202
+ K as _
203
+ };
@@ -0,0 +1,248 @@
1
+ import { defineComponent as j, ref as I, computed as A, onMounted as D, resolveComponent as r, openBlock as c, createElementBlock as _, Fragment as h, createVNode as i, unref as a, createElementVNode as s, withCtx as w, renderList as E, createBlock as x, resolveDynamicComponent as H, toDisplayString as y, h as m } from "vue";
2
+ import { _ as q } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as z, components as C } from "@feedmepos/ui-library";
4
+ import { u as G, a as J, p as Q } from "./loading-KNmEMBUB.js";
5
+ import { u as W } from "./business-BSo7EPan.js";
6
+ import { u as X } from "./campaign-CsOje3Ap.js";
7
+ import { g as M, b as V } from "./dto-CfEXSCq6.js";
8
+ import { _ as Y } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
+ import { _ as Z } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-we7ADwFk.js";
10
+ import { u as ee } from "./template-CFAIPoD7.js";
11
+ import { s as oe } from "./index-CuvNtC_M.js";
12
+ import { c as g } from "./index-Boo5np6l.js";
13
+ const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ne = { class: "space-y-8" }, ie = { class: "flex w-full gap-4 items-center" }, re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, le = { class: "space-y-4" }, ce = { class: "fm-typo-en-body-lg-600" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = /* @__PURE__ */ s("img", {
14
+ src: q,
15
+ class: "aspect-square w-[150px]"
16
+ }, null, -1), pe = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
17
+ /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Create your mission program"),
18
+ /* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " The mission feature adds a fun element to shopping, encouraging customers to engage more. ")
19
+ ], -1), Ie = /* @__PURE__ */ j({
20
+ __name: "Mission",
21
+ setup(fe) {
22
+ const L = {
23
+ label: "Create campaign",
24
+ value: "create",
25
+ isPrimary: !0,
26
+ prependIcon: "add"
27
+ }, B = ee("MISSION", z()), $ = W(), l = X(), { global: K, minor: b } = G, n = I({
28
+ searchKey: "",
29
+ location: null
30
+ }), d = A(
31
+ () => l.campaigns.mission.filter(
32
+ (e) => !n.value.location || !e.targetLocation || e.targetLocation.includes(n.value.location)
33
+ )
34
+ ), R = [
35
+ {
36
+ header: "Program 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
+ C.FmTooltip,
44
+ {
45
+ content: e.row.original._id,
46
+ onClick: (o) => {
47
+ o.stopPropagation(), J(e.row.original._id);
48
+ }
49
+ },
50
+ [
51
+ m(C.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: "Mission type",
65
+ accessorFn: (e) => oe(e.mission.type)
66
+ //v.effect,
67
+ },
68
+ {
69
+ header: "Status",
70
+ cell(e) {
71
+ return M(e.row.original);
72
+ }
73
+ },
74
+ {
75
+ header: "Summary",
76
+ accessorFn: (e) => V(e)
77
+ //v.effect,
78
+ },
79
+ {
80
+ header: "Missions received",
81
+ accessorFn: (e) => {
82
+ var o;
83
+ return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
84
+ }
85
+ },
86
+ {
87
+ header: "Actions",
88
+ cell(e) {
89
+ return m(C.FmButton, {
90
+ variant: "tertiary",
91
+ icon: "delete",
92
+ iconColor: "neutral-gray-400",
93
+ onClick: (o) => {
94
+ o.stopPropagation(), S(e.row.original);
95
+ }
96
+ });
97
+ }
98
+ }
99
+ ], v = I();
100
+ async function S(e) {
101
+ await Q.remove(`Are you sure you want to remove ${e.name}?`) && await b(
102
+ async () => {
103
+ await g.delete(e._id), await l.read("MISSION");
104
+ },
105
+ {
106
+ message: `Removing ${e.name}`,
107
+ successMessage: `Removed ${e.name} successfully`
108
+ }
109
+ );
110
+ }
111
+ async function f(e) {
112
+ e ? await o() : B.open(async (u) => {
113
+ await o(u);
114
+ });
115
+ async function o(u) {
116
+ var p;
117
+ (p = v.value) == null || p.showSheet(
118
+ !0,
119
+ "MISSION",
120
+ e ? await g.readById(e._id) : void 0,
121
+ u
122
+ );
123
+ }
124
+ }
125
+ async function N(e) {
126
+ await b(
127
+ async () => {
128
+ e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await l.read("MISSION");
129
+ },
130
+ {
131
+ message: `${e.campaign._id ? "Updating" : "Creating"} Mission program`,
132
+ successMessage: `Mission program ${e.campaign._id ? "updated" : "created"} successfully`
133
+ }
134
+ );
135
+ }
136
+ return D(async () => {
137
+ await K(async () => {
138
+ await l.read("MISSION"), console.log(d);
139
+ });
140
+ }), (e, o) => {
141
+ const u = r("FmPageHead"), p = r("FmSearch"), P = r("FmTable"), F = r("FmButton"), T = r("FmListItem"), O = r("FmList"), U = r("FmCard");
142
+ return c(), _(h, null, [
143
+ i(u, {
144
+ title: "Mission",
145
+ actions: a(d).length > 0 ? [L] : [],
146
+ "onClick:action": o[0] || (o[0] = () => f())
147
+ }, null, 8, ["actions"]),
148
+ s("div", te, [
149
+ i(p, {
150
+ modelValue: a(n).searchKey,
151
+ "onUpdate:modelValue": o[1] || (o[1] = (t) => a(n).searchKey = t),
152
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
153
+ placeholder: "search",
154
+ collapsible: ""
155
+ }, null, 8, ["modelValue"]),
156
+ a(l).campaigns.mission && a(l).campaigns.mission.length > 0 ? (c(), _(h, { key: 0 }, [
157
+ s("div", ae, [
158
+ s("div", se, [
159
+ i(Y, {
160
+ modelValue: a(n).location,
161
+ "onUpdate:modelValue": o[2] || (o[2] = (t) => a(n).location = t),
162
+ label: "Location: ",
163
+ "show-item-label": !0,
164
+ icon: "storefront",
165
+ placement: "bottom-start",
166
+ items: a($).locationItems
167
+ }, null, 8, ["modelValue", "items"])
168
+ ]),
169
+ i(p, {
170
+ modelValue: a(n).searchKey,
171
+ "onUpdate:modelValue": o[3] || (o[3] = (t) => a(n).searchKey = t),
172
+ class: "xs:hidden",
173
+ placeholder: "search",
174
+ collapsible: ""
175
+ }, null, 8, ["modelValue"])
176
+ ]),
177
+ i(P, {
178
+ class: "xs:hidden",
179
+ "row-data": a(d),
180
+ "column-defs": R,
181
+ "search-value": a(n).searchKey,
182
+ "column-filter": [],
183
+ onRowClick: o[4] || (o[4] = (t) => f(t.original)),
184
+ "hide-footer": a(d).length < 10
185
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
186
+ i(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
187
+ default: w(() => [
188
+ (c(!0), _(h, null, E(a(d).filter(
189
+ (t) => t.name.toLowerCase().includes(a(n).searchKey.toLowerCase())
190
+ ), (t) => (c(), x(T, {
191
+ key: t._id.toString(),
192
+ onClick: (k) => f(t),
193
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
194
+ }, {
195
+ default: w(() => [
196
+ s("div", ne, [
197
+ s("div", ie, [
198
+ (c(), x(H(a(M)(t)))),
199
+ s("div", re, y(t.currentReceive ?? 0) + " used ", 1)
200
+ ]),
201
+ s("div", le, [
202
+ s("div", ce, y(t.name), 1),
203
+ s("div", me, y(a(V)(t)), 1)
204
+ ]),
205
+ s("div", de, " Token received: " + y(t.currentReceive ?? 0), 1)
206
+ ]),
207
+ i(F, {
208
+ icon: "delete",
209
+ "icon-color": "neutral-gray-400",
210
+ variant: "tertiary",
211
+ onClick: (k) => (k.stopPropagation(), S(t))
212
+ }, null, 8, ["onClick"])
213
+ ]),
214
+ _: 2
215
+ }, 1032, ["onClick"]))), 128))
216
+ ]),
217
+ _: 1
218
+ })
219
+ ], 64)) : (c(), x(U, {
220
+ key: 1,
221
+ variant: "outlined",
222
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
223
+ }, {
224
+ default: w(() => [
225
+ ue,
226
+ pe,
227
+ i(F, {
228
+ variant: "primary",
229
+ label: "Create Mission program",
230
+ icon: "add",
231
+ onClick: o[5] || (o[5] = (t) => f())
232
+ })
233
+ ]),
234
+ _: 1
235
+ })),
236
+ i(Z, {
237
+ ref_key: "sheetRef",
238
+ ref: v,
239
+ "onSubmit:modelValue": N
240
+ }, null, 512)
241
+ ])
242
+ ], 64);
243
+ };
244
+ }
245
+ });
246
+ export {
247
+ Ie as default
248
+ };