@feedmepos/mf-connect 0.1.0-beta.4 → 0.1.0-beta.41

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 (106) hide show
  1. package/dist/Analytic-C7iDpCvx.js +426 -0
  2. package/dist/{App-BnQwjxIr.js → App-rOEspgIk.js} +397 -384
  3. package/dist/{Broadcast-y1kP18mo.js → Broadcast-CI61-FqI.js} +32 -32
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dj0JUMOk.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BL_KxlIX.js} +6 -8
  5. package/dist/Card-CUzEZnUC.js +894 -0
  6. package/dist/{Collections-DPfbZMg1.js → Collections-zYhQfAph.js} +28 -34
  7. package/dist/{Credit-QleM_b6q.js → Credit-D6G2xUEu.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-CxxmBzPu.js +2209 -0
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-2hRTF1EJ.js → EffectSheet.vue_vue_type_style_index_0_lang-Drd0ZjdQ.js} +8 -8
  11. package/dist/{Experience-DGKj8ChY.js → Experience-Cqn6cpA4.js} +8 -8
  12. package/dist/{Game-BxRdzSma.js → Game-CGrL5xmK.js} +15 -15
  13. package/dist/Index-CCcuCcmL.js +255 -0
  14. package/dist/Marketing-DhZHedDV.js +20070 -0
  15. package/dist/{Member-CteeBDi2.js → Member-CB8o8wLL.js} +4 -4
  16. package/dist/MemberList-D6zRpcwU.js +1554 -0
  17. package/dist/MemberTransactions-HCaDl8dN.js +45 -0
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CZ2M8huU.js → MessageInput.vue_vue_type_script_setup_true_lang-CqlGFgwF.js} +2 -2
  19. package/dist/{Mission-CZgXBa09.js → Mission-CexuwCSV.js} +98 -86
  20. package/dist/Overview-CZk3IHyA.js +1063 -0
  21. package/dist/{Point-C2vzEfRP.js → Point-DJ_sLiid.js} +23 -23
  22. package/dist/{Promotion-337OT0sP.js → Promotion-CWBpjPXQ.js} +53 -47
  23. package/dist/Record-CwT9Pmjn.js +337 -0
  24. package/dist/Reward-DhOIXKAB.js +432 -0
  25. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-UP4KtCK2.js +149 -0
  26. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BNw-CED0.js +1637 -0
  27. package/dist/Segment-BE7Bt2tH.js +566 -0
  28. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CDyT_cSb.js +181 -0
  29. package/dist/{Setting-DVK2594u.js → Setting-D1k2xVYx.js} +609 -586
  30. package/dist/Store-BzoJ_ZBZ.js +1743 -0
  31. package/dist/{StoreRewards-BpEmNueE.js → StoreRewards-OAPmCssF.js} +12 -12
  32. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BIr5Zzij.js +1099 -0
  33. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DT48bSiH.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C2fU1byp.js} +1 -1
  34. package/dist/{Tier-BwvOhyXR.js → Tier-IHJ7dlTI.js} +325 -317
  35. package/dist/{Title-DRPdKYRO.js → Title-C4KcQWk_.js} +197 -183
  36. package/dist/{Transaction-BnLvacwW.js → Transaction-B7SWRleT.js} +2 -2
  37. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DOXLpM1y.js +130 -0
  38. package/dist/{Voucher-BQL8J_EA.js → Voucher-Dzh-oh1p.js} +40 -40
  39. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DeTWCZF1.js +419 -0
  40. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B316b_ta.js → ZodTextField.vue_vue_type_script_setup_true_lang-rBa59HC1.js} +1 -1
  41. package/dist/{app-BVaQwBvq.js → app-BkSGMADw.js} +1 -1
  42. package/dist/{app-zO552-Dl.js → app-ZePrUEIY.js} +1183 -1154
  43. package/dist/app.js +1 -1
  44. package/dist/{business-BSl6NSdS.js → business-CG7GnAu5.js} +1 -1
  45. package/dist/campaign-BSH9FJHx.js +1810 -0
  46. package/dist/{campaign-CxN6mq_l.js → campaign-DFvmN5Ky.js} +2 -2
  47. package/dist/campaign.enum-CBlGXHp0.js +20 -0
  48. package/dist/campaign.fn-BszsH1EQ.js +758 -0
  49. package/dist/collectible.enum-Sd3QSyrd.js +19 -0
  50. package/dist/{collection.fn-C-2dyWp9.js → collection.fn-CIFllkyx.js} +2 -2
  51. package/dist/dto-DG2Ckvh4.js +214 -0
  52. package/dist/{effect-D8y0J47O.js → effect-CWSFIfZh.js} +9 -9
  53. package/dist/email-addresses-BCNsQNXA.js +705 -0
  54. package/dist/{export-BxTrifKO.js → export-DKe01mG4.js} +3 -3
  55. package/dist/{helper-bEmZlTwA.js → helper-Et1Q6YUA.js} +1 -1
  56. package/dist/{index-DHTYWfTs.js → index-Bk281EIF.js} +207 -195
  57. package/dist/{index-B2qriSSk.js → index-CHAvEqB_.js} +1 -1
  58. package/dist/index-CMEY40F9.js +32 -0
  59. package/dist/index-CsaQJMAR.js +66 -0
  60. package/dist/{index-C_WyKCqN.js → index-D4FT-dGm.js} +1 -1
  61. package/dist/{index-JBp0chol.js → index-D_sLK5cZ.js} +1500 -1479
  62. package/dist/{index-Dnv999nc.js → index-Dkl_Y2Ir.js} +1 -1
  63. package/dist/{index-Ckz-D_AP.js → index-Dlv6dpg5.js} +2188 -931
  64. package/dist/index-DrRQsR1a.js +44 -0
  65. package/dist/{index-DuYb25dY.js → index-DzZDUZ8E.js} +37 -4
  66. package/dist/index-F1sEdtX3.js +54 -0
  67. package/dist/index-RFzgIvoM.js +29000 -0
  68. package/dist/{index-BFWCbVq2.js → index-RhGXDJ8R.js} +1 -1
  69. package/dist/index-vh86FiIQ.js +10 -0
  70. package/dist/{index.esm2017-Tw7KabwI.js → index.esm2017-COLDuQQ-.js} +1 -1
  71. package/dist/{loading-60xYxow_.js → loading-DxppIZmv.js} +1714 -1720
  72. package/dist/{membership-43FU3EmV.js → membership-DIBN0bog.js} +52 -44
  73. package/dist/money-L7YJDctU.js +15 -0
  74. package/dist/number-BAUL1NQ9.js +12 -0
  75. package/dist/objectid-BXKVeU2w.js +145 -0
  76. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  77. package/dist/reward-Qjelc0jm.js +36 -0
  78. package/dist/{rule-DlHrKp8K.js → rule-BAqQRjqc.js} +180 -177
  79. package/dist/{rule-builder-CU8P8b8U.js → rule-builder-D2hQiWL6.js} +1 -1
  80. package/dist/style.css +1 -1
  81. package/dist/{template-9StyN-b7.js → template-NVFsa0l_.js} +5 -5
  82. package/dist/trigger-qeiGHLZs.js +114 -0
  83. package/dist/{xlsx-CrRvm5Vs.js → usePagination-De7j-UtU.js} +3183 -2962
  84. package/dist/user-CKVD-V1i.js +54 -0
  85. package/dist/{vue-i18n-UKlvivrG.js → vue-i18n-CTdcKDi0.js} +2 -2
  86. package/package.json +8 -7
  87. package/dist/Analytic-BtldByrt.js +0 -622
  88. package/dist/Card-kW7k8kOl.js +0 -825
  89. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BtI2rY4y.js +0 -2813
  90. package/dist/Marketing-CG4GQdax.js +0 -316
  91. package/dist/MemberList-CANkPyR0.js +0 -1733
  92. package/dist/MemberTransactions-CcCa21fY.js +0 -38
  93. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dh3naMXv.js +0 -1753
  94. package/dist/Segment-Clstp5D-.js +0 -437
  95. package/dist/Store-PnpBvIoo.js +0 -1511
  96. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CrDhK2dt.js +0 -890
  97. package/dist/dto-B20bsdh6.js +0 -2770
  98. package/dist/index-BUCjM4jq.js +0 -29193
  99. package/dist/index-Ceu2PcnH.js +0 -206
  100. package/dist/index-CuvNtC_M.js +0 -61
  101. package/dist/index-D3DAgTFI.js +0 -762
  102. package/dist/index-Kjelmo0Y.js +0 -298
  103. package/dist/money-CmR3-qMz.js +0 -15
  104. package/dist/number-CZlrO6Sq.js +0 -12
  105. package/dist/usePagination-BeF5K3M7.js +0 -223
  106. package/dist/user-Bm4KttFq.js +0 -37
@@ -0,0 +1,426 @@
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-RFzgIvoM.js";
4
+ import "./campaign-BSH9FJHx.js";
5
+ import { useRouter as ne } from "vue-router";
6
+ import { c as R } from "./index-D4FT-dGm.js";
7
+ import { _ as oe } from "./ZodTextField.vue_vue_type_script_setup_true_lang-rBa59HC1.js";
8
+ import { Z as se } from "./zod-Bg2FbC-D.js";
9
+ import { F as re } from "./dto-DG2Ckvh4.js";
10
+ import { J as ie } from "./JsonViewer-v8_C7l5N.js";
11
+ import { u as ue } from "./loading-DxppIZmv.js";
12
+ import { useSnackbar as ce } from "@feedmepos/ui-library";
13
+ import { u as me } from "./app-wDQR6dpb.js";
14
+ import { C as de } from "./campaign.fn-BszsH1EQ.js";
15
+ import { g as pe } from "./object-qECH92oz.js";
16
+ import { u as ve } from "./campaign-DFvmN5Ky.js";
17
+ import { u as fe } from "./membership-DIBN0bog.js";
18
+ import { u as ye } from "./vue-i18n-CTdcKDi0.js";
19
+ const ge = { class: "ml-32 flex flex-col" }, _e = /* @__PURE__ */ j({
20
+ __name: "CampaignCard",
21
+ props: {
22
+ title: {},
23
+ items: {},
24
+ modelValue: {}
25
+ },
26
+ emits: ["update:model-value"],
27
+ setup(U, { emit: b }) {
28
+ const c = U, v = b, S = (o) => {
29
+ o ? p.value = c.items.map((a) => a.value) : p.value = [], r.value = o, v("update:model-value", p.value);
30
+ }, g = (o) => {
31
+ p.value = o, r.value = o.length === c.items.length, v("update:model-value", o);
32
+ }, r = y(!1), p = y([]);
33
+ return X(
34
+ () => c.modelValue,
35
+ () => {
36
+ p.value = c.modelValue.filter(
37
+ (o) => c.items.find((a) => a.value === o)
38
+ );
39
+ }
40
+ ), I(() => {
41
+ p.value = c.modelValue.filter(
42
+ (o) => c.items.find((a) => a.value === o)
43
+ );
44
+ }), (o, a) => {
45
+ const _ = x("FmCheckbox"), n = x("FmCard");
46
+ return d(), A(n, {
47
+ variant: "outlined",
48
+ class: "p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3"
49
+ }, {
50
+ default: L(() => [
51
+ h(_, {
52
+ "model-value": t(r),
53
+ value: "1",
54
+ label: c.title,
55
+ indeterminate: t(p).length > 0,
56
+ "onUpdate:modelValue": S
57
+ }, null, 8, ["model-value", "label", "indeterminate"]),
58
+ i("div", ge, [
59
+ (d(!0), k($, null, D(c.items, (l, u) => (d(), A(_, {
60
+ key: u,
61
+ "model-value": t(p),
62
+ label: l.label,
63
+ value: l.value,
64
+ "onUpdate:modelValue": g
65
+ }, null, 8, ["model-value", "label", "value"]))), 128))
66
+ ])
67
+ ]),
68
+ _: 1
69
+ });
70
+ };
71
+ }
72
+ }), 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({
73
+ __name: "LinkCampaign",
74
+ props: {
75
+ modelValue: {
76
+ type: Array,
77
+ required: !0
78
+ },
79
+ campaigns: {
80
+ type: Object,
81
+ required: !0
82
+ }
83
+ },
84
+ emits: ["update:model-value"],
85
+ setup(U, { emit: b }) {
86
+ const c = y(""), v = y([]), S = U, g = b, r = G(() => Object.entries(S.campaigns).reduce((o, [a, _]) => {
87
+ const n = _.filter(
88
+ (l) => l.label.toLowerCase().includes(c.value.toLowerCase())
89
+ );
90
+ return n.length > 0 && (o[a] = n), o;
91
+ }, {}));
92
+ function p(o, a) {
93
+ v.value = v.value.filter(
94
+ (_) => !a.map((n) => n.value).includes(_)
95
+ ), v.value = [.../* @__PURE__ */ new Set([...v.value, ...o])], g("update:model-value", v.value);
96
+ }
97
+ return I(() => {
98
+ v.value = S.modelValue;
99
+ }), (o, a) => {
100
+ const _ = x("FmTextField");
101
+ return d(), k($, null, [
102
+ h(ie, { json: U.campaigns }, null, 8, ["json"]),
103
+ i("div", he, [
104
+ i("div", be, [
105
+ i("div", xe, O(t(v).length) + " campaign(s) linked ", 1),
106
+ h(_, {
107
+ modelValue: t(c),
108
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => T(c) ? c.value = n : null),
109
+ "prepend-icon": "search",
110
+ placeholder: "Search",
111
+ class: "w-full"
112
+ }, null, 8, ["modelValue"])
113
+ ]),
114
+ i("div", Ce, [
115
+ (d(!0), k($, null, D(t(r), (n, l) => (d(), A(_e, {
116
+ "model-value": t(v),
117
+ title: l,
118
+ items: n,
119
+ "onUpdate:modelValue": (u) => p(u, n)
120
+ }, null, 8, ["model-value", "title", "items", "onUpdate:modelValue"]))), 256))
121
+ ])
122
+ ])
123
+ ], 64);
124
+ };
125
+ }
126
+ }), Ve = { class: "flex items-center gap-x-8" }, Se = {
127
+ key: 0,
128
+ class: "space-y-16 pr-12"
129
+ }, 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({
130
+ __name: "AnalyticSheet",
131
+ emits: ["success"],
132
+ setup(U, { expose: b, emit: c }) {
133
+ const v = c, S = me();
134
+ ce();
135
+ const g = y(!1), r = y(!1), p = {
136
+ name: "",
137
+ campaigns: []
138
+ }, o = y(""), a = y({ ...p }), _ = re.superRefine((s, e) => {
139
+ }), n = y([]), l = y(null), { global: u, minor: w } = ue, P = G(() => {
140
+ const s = _.safeParse(a.value);
141
+ return s.success ? [] : s.error.errors;
142
+ });
143
+ function M(s) {
144
+ var e;
145
+ 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 });
146
+ }
147
+ function F() {
148
+ g.value = !1, l.value = null;
149
+ }
150
+ function K() {
151
+ r.value = !0;
152
+ }
153
+ async function W() {
154
+ const s = await R.readAll({
155
+ limit: 1e3,
156
+ skip: 0,
157
+ sortBy: "_id",
158
+ search: "",
159
+ descending: !0
160
+ });
161
+ n.value = s.resources.filter(
162
+ (e) => !["MEMBERSHIP", "REWARD_POOL"].includes(e.type) && !["ISSUE_REWARD"].includes("event" in e ? e == null ? void 0 : e.event.type : "")
163
+ );
164
+ }
165
+ const N = G(() => {
166
+ const s = (m) => m.map((C) => ({
167
+ label: C.name,
168
+ value: C._id
169
+ }));
170
+ return pe(
171
+ n.value,
172
+ (m) => de.formattedType(m.type),
173
+ s
174
+ );
175
+ }), q = G(() => Object.entries(N.value).reduce(
176
+ (s, [e, m]) => {
177
+ const C = m.filter((B) => {
178
+ var E, f;
179
+ return (f = (E = a.value) == null ? void 0 : E.campaigns) == null ? void 0 : f.includes(B.value);
180
+ }).filter(
181
+ (B) => B.label.toLowerCase().includes(o.value.toLowerCase())
182
+ );
183
+ return C.length > 0 && (s[e] = C), s;
184
+ },
185
+ {}
186
+ ));
187
+ function J(s) {
188
+ var m, C;
189
+ const e = (m = a.value.campaigns) == null ? void 0 : m.indexOf(s);
190
+ e != null && e > -1 && ((C = a.value.campaigns) == null || C.splice(e, 1));
191
+ }
192
+ async function Z() {
193
+ _.safeParse(a.value).success && await w(
194
+ async () => {
195
+ var e;
196
+ l.value ? await R.updateGroup(
197
+ (e = l.value) == null ? void 0 : e._id,
198
+ a.value
199
+ ) : await R.createGroup(a.value), v("success"), F();
200
+ },
201
+ {
202
+ message: "Saving group",
203
+ successMessage: "Group saved"
204
+ }
205
+ );
206
+ }
207
+ async function z() {
208
+ await w(
209
+ async () => {
210
+ var s;
211
+ await R.deleteGroup((s = l.value) == null ? void 0 : s._id), v("success"), F();
212
+ },
213
+ {
214
+ message: "Deleting group",
215
+ successMessage: "Group deleted"
216
+ }
217
+ );
218
+ }
219
+ return I(async () => {
220
+ await W();
221
+ }), b({
222
+ showSheet: M,
223
+ hideSheet: F
224
+ }), (s, e) => {
225
+ const m = x("FmButton"), C = x("FmTextField"), B = x("FmList"), E = x("FmSideSheet");
226
+ return d(), A(E, {
227
+ modelValue: t(g),
228
+ "onUpdate:modelValue": e[7] || (e[7] = (f) => T(g) ? g.value = f : null),
229
+ header: t(l) ? "Edit group" : "Add group",
230
+ "dismiss-away": "",
231
+ "close-button": !0,
232
+ "max-width": 550
233
+ }, Y({
234
+ "side-sheet-footer": L(() => [
235
+ i("div", Pe, [
236
+ t(r) ? V("", !0) : (d(), k($, { key: 0 }, [
237
+ h(m, {
238
+ label: "Submit",
239
+ onClick: Z,
240
+ disabled: t(P).length > 0 || t(S).isLoading
241
+ }, null, 8, ["disabled"]),
242
+ h(m, {
243
+ label: "Cancel",
244
+ onClick: e[4] || (e[4] = (f) => F()),
245
+ variant: "tertiary"
246
+ }),
247
+ t(l) ? (d(), A(m, {
248
+ key: 0,
249
+ label: "Delete",
250
+ variant: "plain",
251
+ class: "ml-auto fm-color-system-error-300",
252
+ onClick: e[5] || (e[5] = (f) => z())
253
+ })) : V("", !0)
254
+ ], 64)),
255
+ t(r) ? (d(), A(m, {
256
+ key: 1,
257
+ label: "Confirm",
258
+ onClick: e[6] || (e[6] = (f) => r.value = !1)
259
+ })) : V("", !0)
260
+ ])
261
+ ]),
262
+ default: L(() => [
263
+ t(r) ? V("", !0) : (d(), k("div", Se, [
264
+ e[9] || (e[9] = i("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1)),
265
+ h(oe, {
266
+ modelValue: t(a).name,
267
+ "onUpdate:modelValue": e[1] || (e[1] = (f) => t(a).name = f),
268
+ label: "Name",
269
+ schema: t(se).typeAtPath(t(_), "name")
270
+ }, null, 8, ["modelValue", "schema"]),
271
+ e[10] || (e[10] = i("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1)),
272
+ i("div", we, [
273
+ i("div", Fe, O(t(a).campaigns.length) + " campaign(s) linked ", 1),
274
+ h(C, {
275
+ modelValue: t(o),
276
+ "onUpdate:modelValue": e[2] || (e[2] = (f) => T(o) ? o.value = f : null),
277
+ "prepend-icon": "search",
278
+ placeholder: "Search",
279
+ class: "w-auto"
280
+ }, null, 8, ["modelValue"])
281
+ ]),
282
+ h(m, {
283
+ variant: "plain",
284
+ icon: "link",
285
+ label: "Link Campaign",
286
+ onClick: K
287
+ })
288
+ ])),
289
+ t(r) ? (d(), A(ke, {
290
+ key: 1,
291
+ modelValue: t(a).campaigns,
292
+ "onUpdate:modelValue": e[3] || (e[3] = (f) => t(a).campaigns = f),
293
+ campaigns: t(N)
294
+ }, null, 8, ["modelValue", "campaigns"])) : V("", !0),
295
+ i("div", Ae, [
296
+ t(r) ? V("", !0) : (d(!0), k($, { key: 0 }, D(t(q), (f, Q) => (d(), k("div", null, [
297
+ i("div", $e, O(Q), 1),
298
+ h(B, { separator: !0 }, {
299
+ default: L(() => [
300
+ (d(!0), k($, null, D(f, (H) => (d(), k("div", Ue, [
301
+ i("div", null, O(H.label), 1),
302
+ i("div", null, [
303
+ h(m, {
304
+ icon: "delete",
305
+ onClick: (Re) => J(H.value),
306
+ variant: "tertiary"
307
+ }, null, 8, ["onClick"])
308
+ ])
309
+ ]))), 256))
310
+ ]),
311
+ _: 2
312
+ }, 1024)
313
+ ]))), 256))
314
+ ])
315
+ ]),
316
+ _: 2
317
+ }, [
318
+ t(r) ? {
319
+ name: "side-sheet-header",
320
+ fn: L(() => [
321
+ i("div", Ve, [
322
+ h(m, {
323
+ icon: "arrow_back",
324
+ variant: "tertiary",
325
+ onClick: e[0] || (e[0] = (f) => r.value = !1)
326
+ }),
327
+ e[8] || (e[8] = ee("Link campaign "))
328
+ ])
329
+ ]),
330
+ key: "0"
331
+ } : void 0
332
+ ]), 1032, ["modelValue", "header"]);
333
+ };
334
+ }
335
+ }), Ge = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Me = { class: "space-y-16" }, Be = { class: "flex items-center justify-end" }, tt = /* @__PURE__ */ j({
336
+ __name: "Analytic",
337
+ setup(U) {
338
+ const { t: b } = ye(), c = {
339
+ label: b("connect.analytic.addGroup"),
340
+ value: "create",
341
+ isPrimary: !0,
342
+ prependIcon: "add"
343
+ }, v = ve(), S = y(), g = y([]), r = y(""), p = te({
344
+ totalCampaign: 0,
345
+ totalProgram: 0,
346
+ totalMember: 0
347
+ }), o = y("1");
348
+ b("connect.analytic.summary.totalCampaign"), b("connect.analytic.summary.totalProgram"), b("connect.analytic.summary.totalMember");
349
+ function a(l) {
350
+ var u;
351
+ o.value = (/* @__PURE__ */ new Date()).toISOString(), (u = S.value) == null || u.showSheet(l);
352
+ }
353
+ async function _() {
354
+ await v.readGroups();
355
+ const l = await R.readAllGrouped({
356
+ limit: 100,
357
+ skip: 0,
358
+ sortBy: "_id",
359
+ search: "",
360
+ descending: !0
361
+ });
362
+ g.value = l.resources;
363
+ }
364
+ G(() => g.value.filter((l) => {
365
+ var u;
366
+ return l.name.includes(r.value) || ((u = l.pf_campaigns) == null ? void 0 : u.filter((w) => w.name.includes(r.value)).length);
367
+ }));
368
+ const n = fe();
369
+ return ne(), y(!0), G(() => {
370
+ var l, u, w, P;
371
+ 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(
372
+ (M) => M.bundles.some((F) => F.isFeedvibe)
373
+ ) ? 3 : 2 : 1;
374
+ }), ae(async () => {
375
+ await n.readMemberStore(), await n.readMembership(), await n.readPayoutAccount();
376
+ }), (l, u) => {
377
+ const w = x("FmPageHead"), P = x("FmSearch"), M = x("FmCard");
378
+ return x("FmButton"), x("FmIcon"), d(), k($, null, [
379
+ h(w, {
380
+ title: t(b)("connect.analytic.title"),
381
+ actions: t(g).length > 0 ? [c] : [],
382
+ "onClick:action": u[0] || (u[0] = (F) => a())
383
+ }, null, 8, ["title", "actions"]),
384
+ i("div", Ge, [
385
+ i("div", Me, [
386
+ i("div", Be, [
387
+ h(P, {
388
+ class: "xs:hidden",
389
+ modelValue: t(r),
390
+ "onUpdate:modelValue": u[1] || (u[1] = (F) => T(r) ? r.value = F : null),
391
+ placeholder: t(b)("connect.analytic.search"),
392
+ collapsible: ""
393
+ }, null, 8, ["modelValue", "placeholder"])
394
+ ]),
395
+ V("", !0)
396
+ ]),
397
+ V("", !0),
398
+ t(g).length ? V("", !0) : (d(), A(M, {
399
+ key: 1,
400
+ variant: "outlined",
401
+ class: "flex flex-col gap-y-24 items-center p-16"
402
+ }, {
403
+ default: L(() => u[7] || (u[7] = [
404
+ i("img", {
405
+ src: le,
406
+ class: "w-[150px]"
407
+ }, null, -1),
408
+ i("div", { class: "fm-typo-en-title-sm-800 text-center" }, " Analytics Dashboard Temporarily Unavailable ", -1),
409
+ 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)
410
+ ])),
411
+ _: 1
412
+ })),
413
+ V("", !0),
414
+ h(Le, {
415
+ ref_key: "sheetRef",
416
+ ref: S,
417
+ onSuccess: _
418
+ }, null, 512)
419
+ ])
420
+ ], 64);
421
+ };
422
+ }
423
+ });
424
+ export {
425
+ tt as default
426
+ };