@feedmepos/mf-connect 0.1.0-beta.3 → 0.1.0-beta.31

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 (99) hide show
  1. package/dist/Analytic-C-QC9ivZ.js +424 -0
  2. package/dist/{App-gzbM97vW.js → App-NASVRSh2.js} +397 -384
  3. package/dist/{Broadcast-BwYZkTs0.js → Broadcast-Cffg7nbY.js} +32 -32
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DIh9rz6T.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CA4kVwMl.js} +8 -8
  5. package/dist/Card-CmYFb1_Y.js +897 -0
  6. package/dist/{Collections-Df6tlo8S.js → Collections-CibvGIpU.js} +4 -4
  7. package/dist/{Credit-BPel8vA9.js → Credit-Ck6i9ySs.js} +14 -14
  8. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B35zbHHI.js +2198 -0
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BT8ucS5G.js → EffectSheet.vue_vue_type_style_index_0_lang-CQV77_cx.js} +8 -8
  11. package/dist/{Experience-CPpz1Zwx.js → Experience-CWUX2QvS.js} +8 -8
  12. package/dist/{Game-ByLblISC.js → Game-D3cdZrlc.js} +15 -15
  13. package/dist/Index-CWLZiYXT.js +255 -0
  14. package/dist/Marketing-Bol8eY5d.js +20070 -0
  15. package/dist/{Member-CCc_FEZY.js → Member-Cso-T2Xk.js} +4 -4
  16. package/dist/MemberList-Bqns9wko.js +1045 -0
  17. package/dist/{MemberTransactions-DD5ahSbY.js → MemberTransactions-zNw-30Xu.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DSPvWk4C.js → MessageInput.vue_vue_type_script_setup_true_lang-BLS5fNr6.js} +2 -2
  19. package/dist/{Mission-VH4057I-.js → Mission-C0-K0A_5.js} +98 -86
  20. package/dist/Overview-fZ9NvFKz.js +1024 -0
  21. package/dist/{Point-Bu3IlpH4.js → Point-D3gGhQlP.js} +23 -23
  22. package/dist/{Promotion-B45AOHis.js → Promotion-COCJIfu-.js} +53 -47
  23. package/dist/Record-C0a4Cn1U.js +209 -0
  24. package/dist/Reward-D0G4CBYd.js +411 -0
  25. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-zSOwxAcS.js +151 -0
  26. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-AmIdaAeX.js +1639 -0
  27. package/dist/Segment-eBM3aveX.js +567 -0
  28. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BgMuKAjE.js +181 -0
  29. package/dist/{Setting-CF09eRQJ.js → Setting-Dfye6fs5.js} +8 -8
  30. package/dist/Store-rQfwc8d6.js +1745 -0
  31. package/dist/{StoreRewards-0iGExjqQ.js → StoreRewards-DVTNMWdG.js} +12 -12
  32. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-3dvBoXz2.js +957 -0
  33. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BEfxin47.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DxGIUrmO.js} +1 -1
  34. package/dist/{Tier-IaeWe7rM.js → Tier-DekrYu5l.js} +327 -317
  35. package/dist/{Title-DD67Zxh5.js → Title-oAWsBqoM.js} +199 -183
  36. package/dist/{Transaction-BsPDnLzB.js → Transaction-Ss2XCksi.js} +2 -2
  37. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-BMIqnBts.js +130 -0
  38. package/dist/{Voucher-M7JfcKo0.js → Voucher-CjPJxdw8.js} +31 -31
  39. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DlWCpoOp.js +419 -0
  40. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-k0lprU2i.js → ZodTextField.vue_vue_type_script_setup_true_lang-FXQNhMrv.js} +1 -1
  41. package/dist/{app-HFICF0vL.js → app-C_zlbFNe.js} +1285 -1283
  42. package/dist/{app-DwujUNP-.js → app-WUJQRyEM.js} +1 -1
  43. package/dist/app.js +1 -1
  44. package/dist/{business-BaF1QJXa.js → business-C0e_E2xp.js} +1 -1
  45. package/dist/{campaign-CTDtmAE9.js → campaign-iWzbtNA5.js} +2 -2
  46. package/dist/collectible.enum-QITAo8Jg.js +19 -0
  47. package/dist/{collection.fn-DMW03W4R.js → collection.fn-R3hvasuZ.js} +2 -2
  48. package/dist/{dto-gpaNZHzQ.js → dto-D_tjJ72q.js} +78 -86
  49. package/dist/{effect-CBUmtwet.js → effect-_bpW5fmr.js} +9 -9
  50. package/dist/email-addresses-DUKn8uD0.js +705 -0
  51. package/dist/{export-Bdh_PbsW.js → export-CEBWZ8ko.js} +3 -3
  52. package/dist/{helper-Cu9elRvl.js → helper-CuF45pbY.js} +1 -1
  53. package/dist/{index-NXiDu42U.js → index-BO8RnVxy.js} +1 -1
  54. package/dist/{index-CArqG03W.js → index-BPc3wxOE.js} +39 -35
  55. package/dist/index-BXTQ6onZ.js +1067 -0
  56. package/dist/index-C4aPU80a.js +38 -0
  57. package/dist/{index-At6yms5t.js → index-CBzSPD25.js} +30 -26
  58. package/dist/{index-Ch6XwPzF.js → index-CR0ZVZQG.js} +1 -1
  59. package/dist/{index-DrGrOgZB.js → index-CXFwMV0s.js} +13 -1
  60. package/dist/index-CsaQJMAR.js +66 -0
  61. package/dist/{index-Dfdg2Q3E.js → index-Dh6xIUXJ.js} +1 -1
  62. package/dist/{index-ogzk-Mj4.js → index-LMvyNoHf.js} +1 -1
  63. package/dist/{index-Crw-Vgo5.js → index-S6sFiBxK.js} +1500 -1479
  64. package/dist/index-SpDFfOz_.js +54 -0
  65. package/dist/{index-CtH2S49l.js → index-Urbp7cdO.js} +203 -195
  66. package/dist/index-pHbs1GrF.js +29000 -0
  67. package/dist/{index.esm2017-CeJpvUbA.js → index.esm2017-BunOalUj.js} +33 -33
  68. package/dist/{loading-Cn8ml_vy.js → loading-CYFsZ9UB.js} +591 -597
  69. package/dist/{membership-CX4AKMlH.js → membership-C9089j0H.js} +51 -43
  70. package/dist/money-D-zGFohv.js +15 -0
  71. package/dist/number-UFl4zW6h.js +12 -0
  72. package/dist/objectid-BKIyQ5iE.js +145 -0
  73. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  74. package/dist/reward-LYKGLzXz.js +36 -0
  75. package/dist/{rule-Cv83Y59R.js → rule-BUUKmR4_.js} +180 -177
  76. package/dist/{rule-builder-Dew4yB5Q.js → rule-builder-9JUuOcMH.js} +1 -1
  77. package/dist/style.css +1 -1
  78. package/dist/{template-CSnbgM1o.js → template-CkXuF0cN.js} +5 -5
  79. package/dist/trigger-DjAx9efN.js +114 -0
  80. package/dist/user-DbsZta3D.js +54 -0
  81. package/dist/{vue-i18n-CNH_IhVd.js → vue-i18n-yYO72Mbp.js} +2 -2
  82. package/dist/{xlsx-D4DUZHix.js → xlsx-Dagi6ArS.js} +1 -1
  83. package/package.json +8 -7
  84. package/dist/Analytic-BC5BA6pN.js +0 -622
  85. package/dist/Card-CBYQGKwY.js +0 -825
  86. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-PsrS7I0r.js +0 -2809
  87. package/dist/Marketing-D0vm80e_.js +0 -316
  88. package/dist/MemberList-CrnipE9y.js +0 -1733
  89. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Ijc2OYh9.js +0 -1753
  90. package/dist/Segment-ZWsp48aC.js +0 -437
  91. package/dist/Store-B_G6Dhmq.js +0 -1511
  92. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CaxUr9zl.js +0 -890
  93. package/dist/index-8MaN7rez.js +0 -762
  94. package/dist/index-BjdHxGDn.js +0 -298
  95. package/dist/index-CuvNtC_M.js +0 -61
  96. package/dist/index-RP0XOPRL.js +0 -29193
  97. package/dist/money-BTejgvKu.js +0 -15
  98. package/dist/number-Cen5TucC.js +0 -12
  99. package/dist/user-Bm4KttFq.js +0 -37
@@ -0,0 +1,424 @@
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-pHbs1GrF.js";
4
+ import { F as ne, C as oe } from "./dto-D_tjJ72q.js";
5
+ import { useRouter as se } from "vue-router";
6
+ import { c as R } from "./index-BO8RnVxy.js";
7
+ import { _ as re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-FXQNhMrv.js";
8
+ import { Z as ie } from "./zod-Bg2FbC-D.js";
9
+ import { J as ue } from "./JsonViewer-v8_C7l5N.js";
10
+ import { u as ce } from "./loading-CYFsZ9UB.js";
11
+ import { useSnackbar as me } from "@feedmepos/ui-library";
12
+ import { u as de } from "./app-wDQR6dpb.js";
13
+ import { g as pe } from "./object-qECH92oz.js";
14
+ import { u as ve } from "./campaign-iWzbtNA5.js";
15
+ import { u as fe } from "./membership-C9089j0H.js";
16
+ import { u as ye } from "./vue-i18n-yYO72Mbp.js";
17
+ const ge = { class: "ml-32 flex flex-col" }, _e = /* @__PURE__ */ j({
18
+ __name: "CampaignCard",
19
+ props: {
20
+ title: {},
21
+ items: {},
22
+ modelValue: {}
23
+ },
24
+ emits: ["update:model-value"],
25
+ setup(U, { emit: b }) {
26
+ const c = U, v = b, S = (o) => {
27
+ o ? p.value = c.items.map((a) => a.value) : p.value = [], r.value = o, v("update:model-value", p.value);
28
+ }, g = (o) => {
29
+ p.value = o, r.value = o.length === c.items.length, v("update:model-value", o);
30
+ }, r = y(!1), p = y([]);
31
+ return X(
32
+ () => c.modelValue,
33
+ () => {
34
+ p.value = c.modelValue.filter(
35
+ (o) => c.items.find((a) => a.value === o)
36
+ );
37
+ }
38
+ ), I(() => {
39
+ p.value = c.modelValue.filter(
40
+ (o) => c.items.find((a) => a.value === o)
41
+ );
42
+ }), (o, a) => {
43
+ const _ = x("FmCheckbox"), n = x("FmCard");
44
+ return d(), A(n, {
45
+ variant: "outlined",
46
+ class: "p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3"
47
+ }, {
48
+ default: L(() => [
49
+ h(_, {
50
+ "model-value": t(r),
51
+ value: "1",
52
+ label: c.title,
53
+ indeterminate: t(p).length > 0,
54
+ "onUpdate:modelValue": S
55
+ }, null, 8, ["model-value", "label", "indeterminate"]),
56
+ i("div", ge, [
57
+ (d(!0), k($, null, D(c.items, (l, u) => (d(), A(_, {
58
+ key: u,
59
+ "model-value": t(p),
60
+ label: l.label,
61
+ value: l.value,
62
+ "onUpdate:modelValue": g
63
+ }, null, 8, ["model-value", "label", "value"]))), 128))
64
+ ])
65
+ ]),
66
+ _: 1
67
+ });
68
+ };
69
+ }
70
+ }), 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({
71
+ __name: "LinkCampaign",
72
+ props: {
73
+ modelValue: {
74
+ type: Array,
75
+ required: !0
76
+ },
77
+ campaigns: {
78
+ type: Object,
79
+ required: !0
80
+ }
81
+ },
82
+ emits: ["update:model-value"],
83
+ setup(U, { emit: b }) {
84
+ const c = y(""), v = y([]), S = U, g = b, r = G(() => Object.entries(S.campaigns).reduce((o, [a, _]) => {
85
+ const n = _.filter(
86
+ (l) => l.label.toLowerCase().includes(c.value.toLowerCase())
87
+ );
88
+ return n.length > 0 && (o[a] = n), o;
89
+ }, {}));
90
+ function p(o, a) {
91
+ v.value = v.value.filter(
92
+ (_) => !a.map((n) => n.value).includes(_)
93
+ ), v.value = [.../* @__PURE__ */ new Set([...v.value, ...o])], g("update:model-value", v.value);
94
+ }
95
+ return I(() => {
96
+ v.value = S.modelValue;
97
+ }), (o, a) => {
98
+ const _ = x("FmTextField");
99
+ return d(), k($, null, [
100
+ h(ue, { json: U.campaigns }, null, 8, ["json"]),
101
+ i("div", he, [
102
+ i("div", be, [
103
+ i("div", xe, O(t(v).length) + " campaign(s) linked ", 1),
104
+ h(_, {
105
+ modelValue: t(c),
106
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => T(c) ? c.value = n : null),
107
+ "prepend-icon": "search",
108
+ placeholder: "Search",
109
+ class: "w-full"
110
+ }, null, 8, ["modelValue"])
111
+ ]),
112
+ i("div", Ce, [
113
+ (d(!0), k($, null, D(t(r), (n, l) => (d(), A(_e, {
114
+ "model-value": t(v),
115
+ title: l,
116
+ items: n,
117
+ "onUpdate:modelValue": (u) => p(u, n)
118
+ }, null, 8, ["model-value", "title", "items", "onUpdate:modelValue"]))), 256))
119
+ ])
120
+ ])
121
+ ], 64);
122
+ };
123
+ }
124
+ }), Ve = { class: "flex items-center gap-x-8" }, Se = {
125
+ key: 0,
126
+ class: "space-y-16 pr-12"
127
+ }, 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({
128
+ __name: "AnalyticSheet",
129
+ emits: ["success"],
130
+ setup(U, { expose: b, emit: c }) {
131
+ const v = c, S = de();
132
+ me();
133
+ const g = y(!1), r = y(!1), p = {
134
+ name: "",
135
+ campaigns: []
136
+ }, o = y(""), a = y({ ...p }), _ = ne.superRefine((s, e) => {
137
+ }), n = y([]), l = y(null), { global: u, minor: w } = ce, P = G(() => {
138
+ const s = _.safeParse(a.value);
139
+ return s.success ? [] : s.error.errors;
140
+ });
141
+ function M(s) {
142
+ var e;
143
+ 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 });
144
+ }
145
+ function F() {
146
+ g.value = !1, l.value = null;
147
+ }
148
+ function K() {
149
+ r.value = !0;
150
+ }
151
+ async function W() {
152
+ const s = await R.readAll({
153
+ limit: 1e3,
154
+ skip: 0,
155
+ sortBy: "_id",
156
+ search: "",
157
+ descending: !0
158
+ });
159
+ n.value = s.resources.filter(
160
+ (e) => !["MEMBERSHIP", "REWARD_POOL"].includes(e.type) && !["ISSUE_REWARD"].includes("event" in e ? e == null ? void 0 : e.event.type : "")
161
+ );
162
+ }
163
+ const N = G(() => {
164
+ const s = (m) => m.map((C) => ({
165
+ label: C.name,
166
+ value: C._id
167
+ }));
168
+ return pe(
169
+ n.value,
170
+ (m) => oe.formattedType(m.type),
171
+ s
172
+ );
173
+ }), q = G(() => Object.entries(N.value).reduce(
174
+ (s, [e, m]) => {
175
+ const C = m.filter((B) => {
176
+ var E, f;
177
+ return (f = (E = a.value) == null ? void 0 : E.campaigns) == null ? void 0 : f.includes(B.value);
178
+ }).filter(
179
+ (B) => B.label.toLowerCase().includes(o.value.toLowerCase())
180
+ );
181
+ return C.length > 0 && (s[e] = C), s;
182
+ },
183
+ {}
184
+ ));
185
+ function J(s) {
186
+ var m, C;
187
+ const e = (m = a.value.campaigns) == null ? void 0 : m.indexOf(s);
188
+ e != null && e > -1 && ((C = a.value.campaigns) == null || C.splice(e, 1));
189
+ }
190
+ async function Z() {
191
+ _.safeParse(a.value).success && await w(
192
+ async () => {
193
+ var e;
194
+ l.value ? await R.updateGroup(
195
+ (e = l.value) == null ? void 0 : e._id,
196
+ a.value
197
+ ) : await R.createGroup(a.value), v("success"), F();
198
+ },
199
+ {
200
+ message: "Saving group",
201
+ successMessage: "Group saved"
202
+ }
203
+ );
204
+ }
205
+ async function z() {
206
+ await w(
207
+ async () => {
208
+ var s;
209
+ await R.deleteGroup((s = l.value) == null ? void 0 : s._id), v("success"), F();
210
+ },
211
+ {
212
+ message: "Deleting group",
213
+ successMessage: "Group deleted"
214
+ }
215
+ );
216
+ }
217
+ return I(async () => {
218
+ await W();
219
+ }), b({
220
+ showSheet: M,
221
+ hideSheet: F
222
+ }), (s, e) => {
223
+ const m = x("FmButton"), C = x("FmTextField"), B = x("FmList"), E = x("FmSideSheet");
224
+ return d(), A(E, {
225
+ modelValue: t(g),
226
+ "onUpdate:modelValue": e[7] || (e[7] = (f) => T(g) ? g.value = f : null),
227
+ header: t(l) ? "Edit group" : "Add group",
228
+ "dismiss-away": "",
229
+ "close-button": !0,
230
+ "max-width": 550
231
+ }, Y({
232
+ "side-sheet-footer": L(() => [
233
+ i("div", Pe, [
234
+ t(r) ? V("", !0) : (d(), k($, { key: 0 }, [
235
+ h(m, {
236
+ label: "Submit",
237
+ onClick: Z,
238
+ disabled: t(P).length > 0 || t(S).isLoading
239
+ }, null, 8, ["disabled"]),
240
+ h(m, {
241
+ label: "Cancel",
242
+ onClick: e[4] || (e[4] = (f) => F()),
243
+ variant: "tertiary"
244
+ }),
245
+ t(l) ? (d(), A(m, {
246
+ key: 0,
247
+ label: "Delete",
248
+ variant: "plain",
249
+ class: "ml-auto fm-color-system-error-300",
250
+ onClick: e[5] || (e[5] = (f) => z())
251
+ })) : V("", !0)
252
+ ], 64)),
253
+ t(r) ? (d(), A(m, {
254
+ key: 1,
255
+ label: "Confirm",
256
+ onClick: e[6] || (e[6] = (f) => r.value = !1)
257
+ })) : V("", !0)
258
+ ])
259
+ ]),
260
+ default: L(() => [
261
+ t(r) ? V("", !0) : (d(), k("div", Se, [
262
+ e[9] || (e[9] = i("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1)),
263
+ h(re, {
264
+ modelValue: t(a).name,
265
+ "onUpdate:modelValue": e[1] || (e[1] = (f) => t(a).name = f),
266
+ label: "Name",
267
+ schema: t(ie).typeAtPath(t(_), "name")
268
+ }, null, 8, ["modelValue", "schema"]),
269
+ e[10] || (e[10] = i("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1)),
270
+ i("div", we, [
271
+ i("div", Fe, O(t(a).campaigns.length) + " campaign(s) linked ", 1),
272
+ h(C, {
273
+ modelValue: t(o),
274
+ "onUpdate:modelValue": e[2] || (e[2] = (f) => T(o) ? o.value = f : null),
275
+ "prepend-icon": "search",
276
+ placeholder: "Search",
277
+ class: "w-auto"
278
+ }, null, 8, ["modelValue"])
279
+ ]),
280
+ h(m, {
281
+ variant: "plain",
282
+ icon: "link",
283
+ label: "Link Campaign",
284
+ onClick: K
285
+ })
286
+ ])),
287
+ t(r) ? (d(), A(ke, {
288
+ key: 1,
289
+ modelValue: t(a).campaigns,
290
+ "onUpdate:modelValue": e[3] || (e[3] = (f) => t(a).campaigns = f),
291
+ campaigns: t(N)
292
+ }, null, 8, ["modelValue", "campaigns"])) : V("", !0),
293
+ i("div", Ae, [
294
+ t(r) ? V("", !0) : (d(!0), k($, { key: 0 }, D(t(q), (f, Q) => (d(), k("div", null, [
295
+ i("div", $e, O(Q), 1),
296
+ h(B, { separator: !0 }, {
297
+ default: L(() => [
298
+ (d(!0), k($, null, D(f, (H) => (d(), k("div", Ue, [
299
+ i("div", null, O(H.label), 1),
300
+ i("div", null, [
301
+ h(m, {
302
+ icon: "delete",
303
+ onClick: (Re) => J(H.value),
304
+ variant: "tertiary"
305
+ }, null, 8, ["onClick"])
306
+ ])
307
+ ]))), 256))
308
+ ]),
309
+ _: 2
310
+ }, 1024)
311
+ ]))), 256))
312
+ ])
313
+ ]),
314
+ _: 2
315
+ }, [
316
+ t(r) ? {
317
+ name: "side-sheet-header",
318
+ fn: L(() => [
319
+ i("div", Ve, [
320
+ h(m, {
321
+ icon: "arrow_back",
322
+ variant: "tertiary",
323
+ onClick: e[0] || (e[0] = (f) => r.value = !1)
324
+ }),
325
+ e[8] || (e[8] = ee("Link campaign "))
326
+ ])
327
+ ]),
328
+ key: "0"
329
+ } : void 0
330
+ ]), 1032, ["modelValue", "header"]);
331
+ };
332
+ }
333
+ }), Ge = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Me = { class: "space-y-16" }, Be = { class: "flex items-center justify-end" }, Ye = /* @__PURE__ */ j({
334
+ __name: "Analytic",
335
+ setup(U) {
336
+ const { t: b } = ye(), c = {
337
+ label: b("connect.analytic.addGroup"),
338
+ value: "create",
339
+ isPrimary: !0,
340
+ prependIcon: "add"
341
+ }, v = ve(), S = y(), g = y([]), r = y(""), p = te({
342
+ totalCampaign: 0,
343
+ totalProgram: 0,
344
+ totalMember: 0
345
+ }), o = y("1");
346
+ b("connect.analytic.summary.totalCampaign"), b("connect.analytic.summary.totalProgram"), b("connect.analytic.summary.totalMember");
347
+ function a(l) {
348
+ var u;
349
+ o.value = (/* @__PURE__ */ new Date()).toISOString(), (u = S.value) == null || u.showSheet(l);
350
+ }
351
+ async function _() {
352
+ await v.readGroups();
353
+ const l = await R.readAllGrouped({
354
+ limit: 100,
355
+ skip: 0,
356
+ sortBy: "_id",
357
+ search: "",
358
+ descending: !0
359
+ });
360
+ g.value = l.resources;
361
+ }
362
+ G(() => g.value.filter((l) => {
363
+ var u;
364
+ return l.name.includes(r.value) || ((u = l.pf_campaigns) == null ? void 0 : u.filter((w) => w.name.includes(r.value)).length);
365
+ }));
366
+ const n = fe();
367
+ return se(), y(!0), G(() => {
368
+ var l, u, w, P;
369
+ 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(
370
+ (M) => M.bundles.some((F) => F.isFeedvibe)
371
+ ) ? 3 : 2 : 1;
372
+ }), ae(async () => {
373
+ await n.readMemberStore(), await n.readMembership(), await n.readPayoutAccount();
374
+ }), (l, u) => {
375
+ const w = x("FmPageHead"), P = x("FmSearch"), M = x("FmCard");
376
+ return x("FmButton"), x("FmIcon"), d(), k($, null, [
377
+ h(w, {
378
+ title: t(b)("connect.analytic.title"),
379
+ actions: t(g).length > 0 ? [c] : [],
380
+ "onClick:action": u[0] || (u[0] = (F) => a())
381
+ }, null, 8, ["title", "actions"]),
382
+ i("div", Ge, [
383
+ i("div", Me, [
384
+ i("div", Be, [
385
+ h(P, {
386
+ class: "xs:hidden",
387
+ modelValue: t(r),
388
+ "onUpdate:modelValue": u[1] || (u[1] = (F) => T(r) ? r.value = F : null),
389
+ placeholder: t(b)("connect.analytic.search"),
390
+ collapsible: ""
391
+ }, null, 8, ["modelValue", "placeholder"])
392
+ ]),
393
+ V("", !0)
394
+ ]),
395
+ V("", !0),
396
+ t(g).length ? V("", !0) : (d(), A(M, {
397
+ key: 1,
398
+ variant: "outlined",
399
+ class: "flex flex-col gap-y-24 items-center p-16"
400
+ }, {
401
+ default: L(() => u[7] || (u[7] = [
402
+ i("img", {
403
+ src: le,
404
+ class: "w-[150px]"
405
+ }, null, -1),
406
+ i("div", { class: "fm-typo-en-title-sm-800 text-center" }, " Analytics Dashboard Temporarily Unavailable ", -1),
407
+ 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)
408
+ ])),
409
+ _: 1
410
+ })),
411
+ V("", !0),
412
+ h(Le, {
413
+ ref_key: "sheetRef",
414
+ ref: S,
415
+ onSuccess: _
416
+ }, null, 512)
417
+ ])
418
+ ], 64);
419
+ };
420
+ }
421
+ });
422
+ export {
423
+ Ye as default
424
+ };