@feedmepos/mf-connect 0.1.0-beta.8 → 0.1.0-beta.80

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 (127) hide show
  1. package/dist/Analytic-C84B4MSt.js +427 -0
  2. package/dist/{App-SRz4257n.js → App-CnbbBVSn.js} +441 -420
  3. package/dist/AuditLogs-KOxiG5Q0.js +1887 -0
  4. package/dist/Bin-BBSQDzD4.js +166 -0
  5. package/dist/{Broadcast-DmkrJGp2.js → Broadcast-DlvPEqW7.js} +56 -54
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CZXSxA9u.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-M1Za3MaN.js} +14 -10
  7. package/dist/Card-BluWm_EY.js +905 -0
  8. package/dist/Collections-DtHJpxRT.js +464 -0
  9. package/dist/{Credit-CcNrq9qk.js → Credit-Be2pcBVn.js} +36 -34
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  11. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-sqq_sO_a.js +2182 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BIZDiLns.js → EffectSheet.vue_vue_type_style_index_0_lang-CBsYx54P.js} +49 -49
  14. package/dist/{Experience-DNsQLzDH.js → Experience-CLPyvgs0.js} +32 -30
  15. package/dist/FileSaver.min-NlMItPOc.js +74 -0
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
  17. package/dist/Game-5kEG7o4J.js +278 -0
  18. package/dist/Index-BSZi21Wo.js +259 -0
  19. package/dist/Marketing-CE1Sq3Pb.js +20071 -0
  20. package/dist/Member-DaBqmOYX.js +287 -0
  21. package/dist/MemberList-jIriR6B0.js +1606 -0
  22. package/dist/MemberTransactions-BGEZwpPO.js +45 -0
  23. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-GCEQCVOt.js → MessageInput.vue_vue_type_script_setup_true_lang-CSlafowP.js} +152 -137
  24. package/dist/Mission-BOByUsYC.js +296 -0
  25. package/dist/Overview-BQQs8TsL.js +1079 -0
  26. package/dist/{Point-Ck8EG_3k.js → Point-BuRBh_HC.js} +55 -53
  27. package/dist/Promotion-Py2WWNt0.js +289 -0
  28. package/dist/Queue-On8_svkl.js +260 -0
  29. package/dist/Record-CSWkHs9Y.js +341 -0
  30. package/dist/Reward-BLVyFkAH.js +442 -0
  31. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BW8kuoLt.js +150 -0
  32. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DC8JEmEC.js +1728 -0
  33. package/dist/Segment-BjBskgf9.js +880 -0
  34. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CrVw6j2M.js +181 -0
  35. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-oaAVUxO4.js +188 -0
  36. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CKOTgzL-.js +147 -0
  37. package/dist/Setting-CAMlhgGd.js +1932 -0
  38. package/dist/Store-0qvNbHne.js +1842 -0
  39. package/dist/StoreRewards-CjcHvUNa.js +423 -0
  40. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CdZ7QIaf.js +1029 -0
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrzmjYmU.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-vJaZIDrx.js} +1 -1
  42. package/dist/{Tier-CJ9-d8Zg.js → Tier-D_pHKGSv.js} +350 -334
  43. package/dist/{Title-DZCpvg4q.js → Title-DgdtJ87h.js} +245 -222
  44. package/dist/{Transaction-DpnTxlbf.js → Transaction-CKlLWcjS.js} +2 -2
  45. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-2GOvljvv.js +130 -0
  46. package/dist/Voucher-Cg6zQSAy.js +354 -0
  47. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-rpjQkheM.js +419 -0
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-SukfoJpU.js → ZodTextField.vue_vue_type_script_setup_true_lang-BRdY-P8U.js} +1 -1
  49. package/dist/{app-DzAexOqx.js → app-CScRp4SA.js} +2709 -1265
  50. package/dist/app-jGYefKeR.js +33357 -0
  51. package/dist/app.js +1 -1
  52. package/dist/business-DYhO4gjc.js +79 -0
  53. package/dist/campaign-BgXy1Ngd.js +1810 -0
  54. package/dist/{campaign-winsqufa.js → campaign-CZ5pMrUu.js} +2 -2
  55. package/dist/campaign.enum-CWBDlzqp.js +20 -0
  56. package/dist/campaign.fn-HHZ5mQKe.js +758 -0
  57. package/dist/collectible.enum-MvoLHpuA.js +19 -0
  58. package/dist/{collection.fn-CI5Llblg.js → collection.fn-BHUoLJPj.js} +2 -2
  59. package/dist/dto-DXdR0em1.js +214 -0
  60. package/dist/{effect-CdkrIYgX.js → effect-HLuo1A_f.js} +33 -16
  61. package/dist/email-addresses-DU4ehcHM.js +705 -0
  62. package/dist/{export-DGxfief1.js → export-BDRHAxZr.js} +5 -5
  63. package/dist/{helper-B8RqcTNu.js → helper-JhFOw8n-.js} +1 -1
  64. package/dist/{index-OzicErwL.js → index-BG_GpbnZ.js} +24 -21
  65. package/dist/{index-Cw_aXFH6.js → index-BZWr1bgh.js} +269 -173
  66. package/dist/{loading-DuEFUCwF.js → index-Bs-tzd5F.js} +4609 -4886
  67. package/dist/{index-wzdbEEcZ.js → index-C2nNcNjw.js} +1 -1
  68. package/dist/index-CIF8DeC8.js +54 -0
  69. package/dist/{index-HZC9LLAX.js → index-CqT8uK3R.js} +48 -4
  70. package/dist/index-CsaQJMAR.js +66 -0
  71. package/dist/{index-9w43_U1v.js → index-DVj1MyZp.js} +1506 -1480
  72. package/dist/{index-CZgQVRsm.js → index-GmHsjd7O.js} +1 -1
  73. package/dist/index-QDEKR2Rj.js +115 -0
  74. package/dist/{index-A34xEz20.js → index-cYKPj4fA.js} +2246 -871
  75. package/dist/index-eRBO4PzZ.js +56 -0
  76. package/dist/index-fS6fmvFv.js +29556 -0
  77. package/dist/index-l8E6r07W.js +32 -0
  78. package/dist/index-vh86FiIQ.js +10 -0
  79. package/dist/{index.esm2017-CppSMh_U.js → index.esm2017-B-YrQ0sw.js} +206 -206
  80. package/dist/loading-C09t0mFj.js +71 -0
  81. package/dist/{membership-nsMtWeTC.js → membership-tHAn3VRs.js} +80 -66
  82. package/dist/money-DYVCca49.js +15 -0
  83. package/dist/number-VYuUME2F.js +12 -0
  84. package/dist/objectid-BTO4csVa.js +145 -0
  85. package/dist/plugins-CXgvBDMF.js +208 -0
  86. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  87. package/dist/reward-DX9TZrk4.js +36 -0
  88. package/dist/{rule-CPIMqt1h.js → rule-CbCZqulx.js} +185 -178
  89. package/dist/{rule-builder-CSs5XRKP.js → rule-builder-J8K_fjI-.js} +1 -1
  90. package/dist/style.css +1 -1
  91. package/dist/{template-CJZoYavu.js → template-BtYJpEBa.js} +5 -5
  92. package/dist/trigger-D6dpZFSN.js +144 -0
  93. package/dist/user-C0QvWk-o.js +54 -0
  94. package/dist/vue-i18n-cz2_cPSz.js +2365 -0
  95. package/dist/{xlsx-BZlnYinX.js → xlsx-BIPQrY49.js} +1 -1
  96. package/package.json +11 -7
  97. package/dist/Analytic-5QztrYSp.js +0 -622
  98. package/dist/Card-BsjFTVsH.js +0 -825
  99. package/dist/Collections-7wqZHOax.js +0 -453
  100. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cuklmxur.js +0 -2813
  101. package/dist/Game-DlzDerT7.js +0 -255
  102. package/dist/Marketing-BqhpaG4o.js +0 -316
  103. package/dist/Member-AFgZcdtz.js +0 -69
  104. package/dist/MemberList-BKgrLz2C.js +0 -1733
  105. package/dist/MemberTransactions-BwT3zE2a.js +0 -38
  106. package/dist/Mission-BTAia7AS.js +0 -261
  107. package/dist/Promotion-0v3kvsK3.js +0 -247
  108. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BkFm7tXq.js +0 -1753
  109. package/dist/Segment-BenLupqV.js +0 -437
  110. package/dist/Setting-0fpREqpJ.js +0 -1901
  111. package/dist/Store-BDGwe4ar.js +0 -1511
  112. package/dist/StoreRewards-TDZt9H1V.js +0 -401
  113. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BqpsMcl1.js +0 -890
  114. package/dist/Voucher-DsP_rh8I.js +0 -490
  115. package/dist/app-Cg2pTZJK.js +0 -53428
  116. package/dist/business-Cw_qGw8y.js +0 -78
  117. package/dist/dto-ozu1smC3.js +0 -2770
  118. package/dist/index-BLACZ3-L.js +0 -206
  119. package/dist/index-BaozRfWB.js +0 -762
  120. package/dist/index-CjVmULNd.js +0 -99
  121. package/dist/index-CuvNtC_M.js +0 -61
  122. package/dist/index-DAEmawcj.js +0 -298
  123. package/dist/index-Oxr-mU6h.js +0 -29193
  124. package/dist/money-BGZPFtUc.js +0 -15
  125. package/dist/number-4J0xvXP9.js +0 -12
  126. package/dist/user-Bm4KttFq.js +0 -37
  127. package/dist/vue-i18n-CCyiVzOE.js +0 -2365
@@ -0,0 +1,427 @@
1
+ import { defineComponent as j, ref as y, watch as X, onMounted as I, resolveComponent as x, openBlock as d, createBlock as A, withCtx as L, createVNode as h, unref as t, createElementVNode as i, createElementBlock as k, Fragment as $, renderList as D, computed as G, toDisplayString as O, isRef as T, createSlots as Y, createCommentVNode as V, createTextVNode as ee, reactive as te, onBeforeMount as ae } from "vue";
2
+ import { _ as le } from "./campaign-CpzFl8Vr.js";
3
+ import "./index-fS6fmvFv.js";
4
+ import "./campaign-BgXy1Ngd.js";
5
+ import { useRouter as ne } from "vue-router";
6
+ import { c as R } from "./index-QDEKR2Rj.js";
7
+ import { _ as oe } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BRdY-P8U.js";
8
+ import { Z as se } from "./zod-Bg2FbC-D.js";
9
+ import { F as re } from "./dto-DXdR0em1.js";
10
+ import { J as ie } from "./JsonViewer-v8_C7l5N.js";
11
+ import "./index-Bs-tzd5F.js";
12
+ import { useSnackbar as ue } from "@feedmepos/ui-library";
13
+ import { u as ce } from "./app-wDQR6dpb.js";
14
+ import { u as me } from "./loading-C09t0mFj.js";
15
+ import { C as de } from "./campaign.fn-HHZ5mQKe.js";
16
+ import { g as pe } from "./object-qECH92oz.js";
17
+ import { u as ve } from "./campaign-CZ5pMrUu.js";
18
+ import { u as fe } from "./membership-tHAn3VRs.js";
19
+ import { u as ye } from "./vue-i18n-cz2_cPSz.js";
20
+ const ge = { class: "ml-32 flex flex-col" }, _e = /* @__PURE__ */ j({
21
+ __name: "CampaignCard",
22
+ props: {
23
+ title: {},
24
+ items: {},
25
+ modelValue: {}
26
+ },
27
+ emits: ["update:model-value"],
28
+ setup(U, { emit: b }) {
29
+ const c = U, v = b, S = (o) => {
30
+ o ? p.value = c.items.map((a) => a.value) : p.value = [], r.value = o, v("update:model-value", p.value);
31
+ }, g = (o) => {
32
+ p.value = o, r.value = o.length === c.items.length, v("update:model-value", o);
33
+ }, r = y(!1), p = y([]);
34
+ return X(
35
+ () => c.modelValue,
36
+ () => {
37
+ p.value = c.modelValue.filter(
38
+ (o) => c.items.find((a) => a.value === o)
39
+ );
40
+ }
41
+ ), I(() => {
42
+ p.value = c.modelValue.filter(
43
+ (o) => c.items.find((a) => a.value === o)
44
+ );
45
+ }), (o, a) => {
46
+ const _ = x("FmCheckbox"), n = x("FmCard");
47
+ return d(), A(n, {
48
+ variant: "outlined",
49
+ class: "p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3"
50
+ }, {
51
+ default: L(() => [
52
+ h(_, {
53
+ "model-value": t(r),
54
+ value: "1",
55
+ label: c.title,
56
+ indeterminate: t(p).length > 0,
57
+ "onUpdate:modelValue": S
58
+ }, null, 8, ["model-value", "label", "indeterminate"]),
59
+ i("div", ge, [
60
+ (d(!0), k($, null, D(c.items, (l, u) => (d(), A(_, {
61
+ key: u,
62
+ "model-value": t(p),
63
+ label: l.label,
64
+ value: l.value,
65
+ "onUpdate:modelValue": g
66
+ }, null, 8, ["model-value", "label", "value"]))), 128))
67
+ ])
68
+ ]),
69
+ _: 1
70
+ });
71
+ };
72
+ }
73
+ }), he = { class: "space-y-16" }, be = { class: "flex items-center" }, xe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary w-[300px]" }, Ce = { class: "space-y-[40px]" }, ke = /* @__PURE__ */ j({
74
+ __name: "LinkCampaign",
75
+ props: {
76
+ modelValue: {
77
+ type: Array,
78
+ required: !0
79
+ },
80
+ campaigns: {
81
+ type: Object,
82
+ required: !0
83
+ }
84
+ },
85
+ emits: ["update:model-value"],
86
+ setup(U, { emit: b }) {
87
+ const c = y(""), v = y([]), S = U, g = b, r = G(() => Object.entries(S.campaigns).reduce((o, [a, _]) => {
88
+ const n = _.filter(
89
+ (l) => l.label.toLowerCase().includes(c.value.toLowerCase())
90
+ );
91
+ return n.length > 0 && (o[a] = n), o;
92
+ }, {}));
93
+ function p(o, a) {
94
+ v.value = v.value.filter(
95
+ (_) => !a.map((n) => n.value).includes(_)
96
+ ), v.value = [.../* @__PURE__ */ new Set([...v.value, ...o])], g("update:model-value", v.value);
97
+ }
98
+ return I(() => {
99
+ v.value = S.modelValue;
100
+ }), (o, a) => {
101
+ const _ = x("FmTextField");
102
+ return d(), k($, null, [
103
+ h(ie, { json: U.campaigns }, null, 8, ["json"]),
104
+ i("div", he, [
105
+ i("div", be, [
106
+ i("div", xe, O(t(v).length) + " campaign(s) linked ", 1),
107
+ h(_, {
108
+ modelValue: t(c),
109
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => T(c) ? c.value = n : null),
110
+ "prepend-icon": "search",
111
+ placeholder: "Search",
112
+ class: "w-full"
113
+ }, null, 8, ["modelValue"])
114
+ ]),
115
+ i("div", Ce, [
116
+ (d(!0), k($, null, D(t(r), (n, l) => (d(), A(_e, {
117
+ "model-value": t(v),
118
+ title: l,
119
+ items: n,
120
+ "onUpdate:modelValue": (u) => p(u, n)
121
+ }, null, 8, ["model-value", "title", "items", "onUpdate:modelValue"]))), 256))
122
+ ])
123
+ ])
124
+ ], 64);
125
+ };
126
+ }
127
+ }), Ve = { class: "flex items-center gap-x-8" }, Se = {
128
+ key: 0,
129
+ class: "space-y-16 pr-12"
130
+ }, we = { class: "flex items-center gap-x-16" }, Fe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ae = { class: "mt-16" }, $e = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600 py-8 px-16 bg-gray-100" }, Ue = { class: "flex justify-between items-center py-8 px-16 border-b-1" }, Pe = { class: "flex items-center gap-8" }, Le = /* @__PURE__ */ j({
131
+ __name: "AnalyticSheet",
132
+ emits: ["success"],
133
+ setup(U, { expose: b, emit: c }) {
134
+ const v = c, S = ce();
135
+ ue();
136
+ const g = y(!1), r = y(!1), p = {
137
+ name: "",
138
+ campaigns: []
139
+ }, o = y(""), a = y({ ...p }), _ = re.superRefine((s, e) => {
140
+ }), n = y([]), l = y(null), { global: u, minor: w } = me, P = G(() => {
141
+ const s = _.safeParse(a.value);
142
+ return s.success ? [] : s.error.errors;
143
+ });
144
+ function M(s) {
145
+ var e;
146
+ g.value = !0, s ? (l.value = { ...s }, a.value = { ...s, campaigns: (e = s.pf_campaigns) == null ? void 0 : e.map((m) => m._id) }) : (l.value = null, a.value = { ...p });
147
+ }
148
+ function F() {
149
+ g.value = !1, l.value = null;
150
+ }
151
+ function K() {
152
+ r.value = !0;
153
+ }
154
+ async function W() {
155
+ const s = await R.readAll({
156
+ limit: 1e3,
157
+ skip: 0,
158
+ sortBy: "_id",
159
+ search: "",
160
+ descending: !0
161
+ });
162
+ n.value = s.resources.filter(
163
+ (e) => !["MEMBERSHIP", "REWARD_POOL"].includes(e.type) && !["ISSUE_REWARD"].includes("event" in e ? e == null ? void 0 : e.event.type : "")
164
+ );
165
+ }
166
+ const N = G(() => {
167
+ const s = (m) => m.map((C) => ({
168
+ label: C.name,
169
+ value: C._id
170
+ }));
171
+ return pe(
172
+ n.value,
173
+ (m) => de.formattedType(m.type),
174
+ s
175
+ );
176
+ }), q = G(() => Object.entries(N.value).reduce(
177
+ (s, [e, m]) => {
178
+ const C = m.filter((B) => {
179
+ var E, f;
180
+ return (f = (E = a.value) == null ? void 0 : E.campaigns) == null ? void 0 : f.includes(B.value);
181
+ }).filter(
182
+ (B) => B.label.toLowerCase().includes(o.value.toLowerCase())
183
+ );
184
+ return C.length > 0 && (s[e] = C), s;
185
+ },
186
+ {}
187
+ ));
188
+ function J(s) {
189
+ var m, C;
190
+ const e = (m = a.value.campaigns) == null ? void 0 : m.indexOf(s);
191
+ e != null && e > -1 && ((C = a.value.campaigns) == null || C.splice(e, 1));
192
+ }
193
+ async function Z() {
194
+ _.safeParse(a.value).success && await w(
195
+ async () => {
196
+ var e;
197
+ l.value ? await R.updateGroup(
198
+ (e = l.value) == null ? void 0 : e._id,
199
+ a.value
200
+ ) : await R.createGroup(a.value), v("success"), F();
201
+ },
202
+ {
203
+ message: "Saving group",
204
+ successMessage: "Group saved"
205
+ }
206
+ );
207
+ }
208
+ async function z() {
209
+ await w(
210
+ async () => {
211
+ var s;
212
+ await R.deleteGroup((s = l.value) == null ? void 0 : s._id), v("success"), F();
213
+ },
214
+ {
215
+ message: "Deleting group",
216
+ successMessage: "Group deleted"
217
+ }
218
+ );
219
+ }
220
+ return I(async () => {
221
+ await W();
222
+ }), b({
223
+ showSheet: M,
224
+ hideSheet: F
225
+ }), (s, e) => {
226
+ const m = x("FmButton"), C = x("FmTextField"), B = x("FmList"), E = x("FmSideSheet");
227
+ return d(), A(E, {
228
+ modelValue: t(g),
229
+ "onUpdate:modelValue": e[7] || (e[7] = (f) => T(g) ? g.value = f : null),
230
+ header: t(l) ? "Edit group" : "Add group",
231
+ "dismiss-away": "",
232
+ "close-button": !0,
233
+ "max-width": 550
234
+ }, Y({
235
+ "side-sheet-footer": L(() => [
236
+ i("div", Pe, [
237
+ t(r) ? V("", !0) : (d(), k($, { key: 0 }, [
238
+ h(m, {
239
+ label: "Submit",
240
+ onClick: Z,
241
+ disabled: t(P).length > 0 || t(S).isLoading
242
+ }, null, 8, ["disabled"]),
243
+ h(m, {
244
+ label: "Cancel",
245
+ onClick: e[4] || (e[4] = (f) => F()),
246
+ variant: "tertiary"
247
+ }),
248
+ t(l) ? (d(), A(m, {
249
+ key: 0,
250
+ label: "Delete",
251
+ variant: "plain",
252
+ class: "ml-auto fm-color-system-error-300",
253
+ onClick: e[5] || (e[5] = (f) => z())
254
+ })) : V("", !0)
255
+ ], 64)),
256
+ t(r) ? (d(), A(m, {
257
+ key: 1,
258
+ label: "Confirm",
259
+ onClick: e[6] || (e[6] = (f) => r.value = !1)
260
+ })) : V("", !0)
261
+ ])
262
+ ]),
263
+ default: L(() => [
264
+ t(r) ? V("", !0) : (d(), k("div", Se, [
265
+ e[9] || (e[9] = i("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1)),
266
+ h(oe, {
267
+ modelValue: t(a).name,
268
+ "onUpdate:modelValue": e[1] || (e[1] = (f) => t(a).name = f),
269
+ label: "Name",
270
+ schema: t(se).typeAtPath(t(_), "name")
271
+ }, null, 8, ["modelValue", "schema"]),
272
+ e[10] || (e[10] = i("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1)),
273
+ i("div", we, [
274
+ i("div", Fe, O(t(a).campaigns.length) + " campaign(s) linked ", 1),
275
+ h(C, {
276
+ modelValue: t(o),
277
+ "onUpdate:modelValue": e[2] || (e[2] = (f) => T(o) ? o.value = f : null),
278
+ "prepend-icon": "search",
279
+ placeholder: "Search",
280
+ class: "w-auto"
281
+ }, null, 8, ["modelValue"])
282
+ ]),
283
+ h(m, {
284
+ variant: "plain",
285
+ icon: "link",
286
+ label: "Link Campaign",
287
+ onClick: K
288
+ })
289
+ ])),
290
+ t(r) ? (d(), A(ke, {
291
+ key: 1,
292
+ modelValue: t(a).campaigns,
293
+ "onUpdate:modelValue": e[3] || (e[3] = (f) => t(a).campaigns = f),
294
+ campaigns: t(N)
295
+ }, null, 8, ["modelValue", "campaigns"])) : V("", !0),
296
+ i("div", Ae, [
297
+ t(r) ? V("", !0) : (d(!0), k($, { key: 0 }, D(t(q), (f, Q) => (d(), k("div", null, [
298
+ i("div", $e, O(Q), 1),
299
+ h(B, { separator: !0 }, {
300
+ default: L(() => [
301
+ (d(!0), k($, null, D(f, (H) => (d(), k("div", Ue, [
302
+ i("div", null, O(H.label), 1),
303
+ i("div", null, [
304
+ h(m, {
305
+ icon: "delete",
306
+ onClick: (Re) => J(H.value),
307
+ variant: "tertiary"
308
+ }, null, 8, ["onClick"])
309
+ ])
310
+ ]))), 256))
311
+ ]),
312
+ _: 2
313
+ }, 1024)
314
+ ]))), 256))
315
+ ])
316
+ ]),
317
+ _: 2
318
+ }, [
319
+ t(r) ? {
320
+ name: "side-sheet-header",
321
+ fn: L(() => [
322
+ i("div", Ve, [
323
+ h(m, {
324
+ icon: "arrow_back",
325
+ variant: "tertiary",
326
+ onClick: e[0] || (e[0] = (f) => r.value = !1)
327
+ }),
328
+ e[8] || (e[8] = ee("Link campaign "))
329
+ ])
330
+ ]),
331
+ key: "0"
332
+ } : void 0
333
+ ]), 1032, ["modelValue", "header"]);
334
+ };
335
+ }
336
+ }), Ge = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Me = { class: "space-y-16" }, Be = { class: "flex items-center justify-end" }, at = /* @__PURE__ */ j({
337
+ __name: "Analytic",
338
+ setup(U) {
339
+ const { t: b } = ye(), c = {
340
+ label: b("connect.analytic.addGroup"),
341
+ value: "create",
342
+ isPrimary: !0,
343
+ prependIcon: "add"
344
+ }, v = ve(), S = y(), g = y([]), r = y(""), p = te({
345
+ totalCampaign: 0,
346
+ totalProgram: 0,
347
+ totalMember: 0
348
+ }), o = y("1");
349
+ b("connect.analytic.summary.totalCampaign"), b("connect.analytic.summary.totalProgram"), b("connect.analytic.summary.totalMember");
350
+ function a(l) {
351
+ var u;
352
+ o.value = (/* @__PURE__ */ new Date()).toISOString(), (u = S.value) == null || u.showSheet(l);
353
+ }
354
+ async function _() {
355
+ await v.readGroups();
356
+ const l = await R.readAllGrouped({
357
+ limit: 100,
358
+ skip: 0,
359
+ sortBy: "_id",
360
+ search: "",
361
+ descending: !0
362
+ });
363
+ g.value = l.resources;
364
+ }
365
+ G(() => g.value.filter((l) => {
366
+ var u;
367
+ return l.name.includes(r.value) || ((u = l.pf_campaigns) == null ? void 0 : u.filter((w) => w.name.includes(r.value)).length);
368
+ }));
369
+ const n = fe();
370
+ return ne(), y(!0), G(() => {
371
+ var l, u, w, P;
372
+ return !n.storeOption || !n.storeOption.company ? -1 : !n.payoutAccount || !n.payoutAccount.enable || n.payoutAccount.status != "APPROVED" ? 0 : (u = (l = n.store) == null ? void 0 : l.categories) != null && u.length ? (P = (w = n.store) == null ? void 0 : w.categories) != null && P.some(
373
+ (M) => M.bundles.some((F) => F.isFeedvibe)
374
+ ) ? 3 : 2 : 1;
375
+ }), ae(async () => {
376
+ await n.readMemberStore(), await n.readMembership(), await n.readPayoutAccount();
377
+ }), (l, u) => {
378
+ const w = x("FmPageHead"), P = x("FmSearch"), M = x("FmCard");
379
+ return x("FmButton"), x("FmIcon"), d(), k($, null, [
380
+ h(w, {
381
+ title: t(b)("connect.analytic.title"),
382
+ actions: t(g).length > 0 ? [c] : [],
383
+ "onClick:action": u[0] || (u[0] = (F) => a())
384
+ }, null, 8, ["title", "actions"]),
385
+ i("div", Ge, [
386
+ i("div", Me, [
387
+ i("div", Be, [
388
+ h(P, {
389
+ class: "xs:hidden",
390
+ modelValue: t(r),
391
+ "onUpdate:modelValue": u[1] || (u[1] = (F) => T(r) ? r.value = F : null),
392
+ placeholder: t(b)("connect.analytic.search"),
393
+ collapsible: ""
394
+ }, null, 8, ["modelValue", "placeholder"])
395
+ ]),
396
+ V("", !0)
397
+ ]),
398
+ V("", !0),
399
+ t(g).length ? V("", !0) : (d(), A(M, {
400
+ key: 1,
401
+ variant: "outlined",
402
+ class: "flex flex-col gap-y-24 items-center p-16"
403
+ }, {
404
+ default: L(() => u[7] || (u[7] = [
405
+ i("img", {
406
+ src: le,
407
+ class: "w-[150px]"
408
+ }, null, -1),
409
+ i("div", { class: "fm-typo-en-title-sm-800 text-center" }, " Analytics Dashboard Temporarily Unavailable ", -1),
410
+ i("div", { class: "fm-typo-body-en-md-400 text-center text-fm-color-typo-secondary" }, " We apologize for the inconvenience. The analytics dashboard is currently under maintenance to improve your experience. Please check back later for updates on system availability. ", -1)
411
+ ])),
412
+ _: 1
413
+ })),
414
+ V("", !0),
415
+ h(Le, {
416
+ ref_key: "sheetRef",
417
+ ref: S,
418
+ onSuccess: _
419
+ }, null, 512)
420
+ ])
421
+ ], 64);
422
+ };
423
+ }
424
+ });
425
+ export {
426
+ at as default
427
+ };