@feedmepos/mf-connect 0.1.38-beta.2 → 0.1.39-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 (110) hide show
  1. package/dist/Analytic-D8WCDkga.js +427 -0
  2. package/dist/{App-D11A2JY1.js → App-CTnXtg1W.js} +352 -364
  3. package/dist/{Bin-9wV4Ah3M.js → Bin-BY6-bvFj.js} +8 -8
  4. package/dist/{Broadcast-I3BtSk8V.js → Broadcast-5VTEIQAr.js} +40 -40
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-XJqTXbKr.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BuAQxEM4.js} +18 -18
  6. package/dist/{Card-CqALG5RM.js → Card-8ivdV-Qz.js} +159 -159
  7. package/dist/{Collections-rg3SzoUb.js → Collections-CFszRHmE.js} +91 -103
  8. package/dist/{Credit-BNn1sYZv.js → Credit-DFslY__4.js} +74 -74
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-PJ8q72XH.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BvCLYtJ3.js} +488 -489
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Sww7KNle.js → EffectSheet.vue_vue_type_style_index_0_lang-Ci_bp7GH.js} +94 -94
  11. package/dist/{Experience-D_Qm8SUj.js → Experience-BxfiZNlY.js} +41 -41
  12. package/dist/{Game-CKXgXm6Q.js → Game-0FZJcLmj.js} +31 -31
  13. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
  14. package/dist/{Index-D4DGfUHd.js → Index-ByeKKbuM.js} +10 -10
  15. package/dist/Marketing-C7F4abzg.js +319 -0
  16. package/dist/{Member-B55vWHDd.js → Member-DP0fLSIV.js} +64 -64
  17. package/dist/MemberList-DFW2bMbr.js +1606 -0
  18. package/dist/MemberOverview-C2n9oJZh.js +58 -0
  19. package/dist/{MemberTransactions-CP5EI-W0.js → MemberTransactions-CW62fvgx.js} +1 -1
  20. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-iJXNbgsB.js +455 -0
  21. package/dist/{Mission-CFvhROuB.js → Mission-DEgQHJw6.js} +21 -21
  22. package/dist/{Overview-4273yNwL.js → Overview-5jDtZKi8.js} +335 -335
  23. package/dist/{Point-B_-_C919.js → Point-D2lB1-xB.js} +41 -41
  24. package/dist/{Promotion-D2S3COxk.js → Promotion-Diz1gIa0.js} +42 -42
  25. package/dist/{Queue-BmS1Oi-C.js → Queue-DIAuq7HG.js} +51 -51
  26. package/dist/{Record-DRBl0M8g.js → Record-T608yda1.js} +9 -9
  27. package/dist/{Reward-8056NmfK.js → Reward-fZzHrHCW.js} +173 -173
  28. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJ_WC2gV.js → RewardGroup.vue_vue_type_script_setup_true_lang-YOKVfimM.js} +11 -11
  29. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DqNQl_nz.js → RuleGroup.vue_vue_type_script_setup_true_lang-C3_lmBe5.js} +431 -431
  30. package/dist/Segment-DDQIzsrk.js +882 -0
  31. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-4nNkkklE.js → SelectItems.vue_vue_type_script_setup_true_lang-B5oUf91Q.js} +2 -2
  32. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dnf2oxOG.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-C2U6Kzvx.js} +11 -11
  33. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLYP-5U9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BRmqgxES.js} +3 -3
  34. package/dist/{Setting-BrJfYoru.js → Setting-CQNyXmp4.js} +432 -432
  35. package/dist/{Store-Bpl_4yZW.js → Store-CIA1Rtsg.js} +210 -210
  36. package/dist/StoreRewards-D5zlE6cE.js +423 -0
  37. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BkTYngJ_.js +995 -0
  38. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-QucRaI08.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-D8l3fQyz.js} +1 -1
  39. package/dist/{Tier-_LnXg3n6.js → Tier-jFXVOje_.js} +106 -106
  40. package/dist/{Title-B7AGStvx.js → Title-DVpZ1YMK.js} +131 -133
  41. package/dist/{Transaction-Chxv6V7u.js → Transaction-BF_wmok6.js} +2 -2
  42. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CzXNmobp.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cex1Z43W.js} +6 -6
  43. package/dist/{Voucher-C5z2kOq9.js → Voucher-CaBMU5w0.js} +37 -37
  44. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BXt2fLOD.js +419 -0
  45. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BlXzEWA6.js → ZodTextField.vue_vue_type_script_setup_true_lang-CtHjWpUe.js} +1 -1
  46. package/dist/{app-BVojNX0w.js → app-CPhyKlyf.js} +1 -1
  47. package/dist/{app-7cvPyHJ7.js → app-DuIzRGvb.js} +124 -161
  48. package/dist/app.js +3 -4
  49. package/dist/{business-CmxV69wT.js → business-TTvv3aTz.js} +1 -1
  50. package/dist/{campaign-Dq5C_no-.js → campaign-BiMCoAzx.js} +3 -5
  51. package/dist/{campaign-CT_cNJEL.js → campaign-CjEVStN1.js} +9 -9
  52. package/dist/{campaign.enum-dp7yHKzF.js → campaign.enum-DpYmj9jp.js} +1 -1
  53. package/dist/campaign.fn-DJ6J98jS.js +758 -0
  54. package/dist/{collectible.enum-DxbB4DxT.js → collectible.enum-Cgmm_s-C.js} +1 -1
  55. package/dist/{collection.fn-CNZRdUgy.js → collection.fn-BsYCNgfJ.js} +2 -2
  56. package/dist/{dto-CT9zZbv9.js → dto-DgmHIlZ2.js} +4 -4
  57. package/dist/{effect-FIlOEC4H.js → effect-DnAVIDFy.js} +1 -1
  58. package/dist/{email-addresses-Ba7xImfX.js → email-addresses-CMRgb6Uv.js} +1 -1
  59. package/dist/{export-uzjZFNF9.js → export-DtarK6IJ.js} +3 -3
  60. package/dist/{helper-D4sAZde0.js → helper-BKZghMbF.js} +1 -1
  61. package/dist/{index-l2F5MnLF.js → index-2OAcPmuQ.js} +1 -1
  62. package/dist/{index-BI3m1Ehv.js → index-B0YZKHyu.js} +3 -3
  63. package/dist/{index-CH3z92VV.js → index-B5oXFFlO.js} +1 -1
  64. package/dist/{index-CvBcve-r.js → index-BQ3KHJXX.js} +1 -1
  65. package/dist/{index-B9pl4zRZ.js → index-B_893fH7.js} +79 -179
  66. package/dist/{index-CNJLP3D5.js → index-BoR-BOFw.js} +1 -1
  67. package/dist/{index-DNxa8Rqx.js → index-C7rl1eHp.js} +449 -516
  68. package/dist/{index-BXz54M1s.js → index-CBcbwf0k.js} +1 -1
  69. package/dist/{index-CS3Jmojj.js → index-CIztuDE4.js} +2462 -2453
  70. package/dist/{index-D5rvMvzx.js → index-CK67enPK.js} +1 -1
  71. package/dist/index-CuvNtC_M.js +61 -0
  72. package/dist/index-D2uZzjpn.js +44 -0
  73. package/dist/{index-CUfS9Kp1.js → index-DWdAUovq.js} +9 -9
  74. package/dist/{index-CONvJfKv.js → index-DkWcEDHA.js} +1 -1
  75. package/dist/{index-BjU8LVUC.js → index-VHu8hYtE.js} +385 -376
  76. package/dist/{index.esm2017-ATcsD5N4.js → index.esm2017-DkwLmmR_.js} +127 -127
  77. package/dist/{loading-BWGQSrCB.js → loading-BFkEqWR6.js} +1 -1
  78. package/dist/{membership-Cc4OZ8-U.js → membership-D0eN3i_T.js} +3 -3
  79. package/dist/{money-D7p8nfun.js → money-DS9ZQwSP.js} +1 -1
  80. package/dist/{number-CMJjC4qz.js → number-C8Gt93v9.js} +1 -1
  81. package/dist/objectid-Cr99eTPd.js +145 -0
  82. package/dist/{plugins-eQis66QR.js → plugins-DK_ue6Xa.js} +2 -2
  83. package/dist/{reward-DrnzbG20.js → reward-CW2dSLDW.js} +1 -1
  84. package/dist/{rule-CtRxkYXB.js → rule-CebKyXSm.js} +3 -3
  85. package/dist/{rule-builder-Di9RIYHF.js → rule-builder-kQq14RfN.js} +17 -17
  86. package/dist/style.css +1 -1
  87. package/dist/{template-C3UfY0v5.js → template-CxUxlb6-.js} +64 -64
  88. package/dist/{trigger-C9U7Zgad.js → trigger-RqJo06KA.js} +4 -4
  89. package/dist/{usePagination-BeF5K3M7.js → usePagination-JoYaROkV.js} +85 -85
  90. package/dist/{user-D7n9yYmO.js → user-DhV5Iy52.js} +1 -1
  91. package/dist/{vue-i18n-Bz45zC04.js → vue-i18n-BtvUK9hI.js} +419 -419
  92. package/dist/{xlsx-D4S4qbcZ.js → xlsx-WnLDq4qn.js} +381 -381
  93. package/package.json +3 -9
  94. package/dist/Analytic-BjSfI2Ff.js +0 -761
  95. package/dist/AuditLogs-DWCFYoRg.js +0 -1887
  96. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +0 -58
  97. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
  98. package/dist/Marketing-Dn9A1vgH.js +0 -20073
  99. package/dist/MemberList-BWTG9Ohy.js +0 -1606
  100. package/dist/MemberOverview-wL_ailso.js +0 -58
  101. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-D--_An-f.js +0 -60279
  102. package/dist/Segment-Bzq-pyhc.js +0 -882
  103. package/dist/StoreRewards-Cu7n7Pjz.js +0 -423
  104. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-T3Wo2maC.js +0 -1029
  105. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DdGMrk2C.js +0 -419
  106. package/dist/campaign.fn-BYZgKDN7.js +0 -758
  107. package/dist/index-CsaQJMAR.js +0 -66
  108. package/dist/index-CwsMG2cV.js +0 -56
  109. package/dist/objectid-D5T27iny.js +0 -145
  110. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
@@ -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 ne } from "./campaign-CpzFl8Vr.js";
3
+ import "./index-VHu8hYtE.js";
4
+ import "./campaign-CjEVStN1.js";
5
+ import { useRouter as le } from "vue-router";
6
+ import { c as R } from "./index-CK67enPK.js";
7
+ import { _ as oe } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CtHjWpUe.js";
8
+ import { Z as se } from "./zod-Bg2FbC-D.js";
9
+ import { F as re } from "./dto-DgmHIlZ2.js";
10
+ import { J as ie } from "./JsonViewer-v8_C7l5N.js";
11
+ import "./index-CIztuDE4.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-BFkEqWR6.js";
15
+ import { C as de } from "./campaign.fn-DJ6J98jS.js";
16
+ import { g as pe } from "./object-qECH92oz.js";
17
+ import { u as ve } from "./campaign-BiMCoAzx.js";
18
+ import { u as fe } from "./membership-D0eN3i_T.js";
19
+ import { u as ye } from "./vue-i18n-BtvUK9hI.js";
20
+ const _e = { class: "ml-32 flex flex-col" }, ge = /* @__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 u = U, v = b, S = (o) => {
30
+ o ? p.value = u.items.map((a) => a.value) : p.value = [], r.value = o, v("update:model-value", p.value);
31
+ }, _ = (o) => {
32
+ p.value = o, r.value = o.length === u.items.length, v("update:model-value", o);
33
+ }, r = y(!1), p = y([]);
34
+ return X(
35
+ () => u.modelValue,
36
+ () => {
37
+ p.value = u.modelValue.filter(
38
+ (o) => u.items.find((a) => a.value === o)
39
+ );
40
+ }
41
+ ), I(() => {
42
+ p.value = u.modelValue.filter(
43
+ (o) => u.items.find((a) => a.value === o)
44
+ );
45
+ }), (o, a) => {
46
+ const g = x("FmCheckbox"), l = x("FmCard");
47
+ return d(), A(l, {
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(g, {
53
+ "model-value": t(r),
54
+ value: "1",
55
+ label: u.title,
56
+ indeterminate: t(p).length > 0,
57
+ "onUpdate:modelValue": S
58
+ }, null, 8, ["model-value", "label", "indeterminate"]),
59
+ i("div", _e, [
60
+ (d(!0), k($, null, D(u.items, (n, c) => (d(), A(g, {
61
+ key: c,
62
+ "model-value": t(p),
63
+ label: n.label,
64
+ value: n.value,
65
+ "onUpdate:modelValue": _
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 u = y(""), v = y([]), S = U, _ = b, r = G(() => Object.entries(S.campaigns).reduce((o, [a, g]) => {
88
+ const l = g.filter(
89
+ (n) => n.label.toLowerCase().includes(u.value.toLowerCase())
90
+ );
91
+ return l.length > 0 && (o[a] = l), o;
92
+ }, {}));
93
+ function p(o, a) {
94
+ v.value = v.value.filter(
95
+ (g) => !a.map((l) => l.value).includes(g)
96
+ ), v.value = [.../* @__PURE__ */ new Set([...v.value, ...o])], _("update:model-value", v.value);
97
+ }
98
+ return I(() => {
99
+ v.value = S.modelValue;
100
+ }), (o, a) => {
101
+ const g = 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(g, {
108
+ modelValue: t(u),
109
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => T(u) ? u.value = l : 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), (l, n) => (d(), A(ge, {
117
+ "model-value": t(v),
118
+ title: n,
119
+ items: l,
120
+ "onUpdate:modelValue": (c) => p(c, l)
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 = /* @__PURE__ */ i("div", { class: "fm-typo-en-title-sm-800" }, "Group detail", -1), Fe = /* @__PURE__ */ i("div", { class: "fm-typo-en-title-sm-800" }, "Link campaign", -1), Ae = { class: "flex items-center gap-x-16" }, $e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ue = { class: "mt-16" }, Pe = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600 py-8 px-16 bg-gray-100" }, Le = { class: "flex justify-between items-center py-8 px-16 border-b-1" }, Ge = { class: "flex items-center gap-8" }, Me = /* @__PURE__ */ j({
131
+ __name: "AnalyticSheet",
132
+ emits: ["success"],
133
+ setup(U, { expose: b, emit: u }) {
134
+ const v = u, S = ce();
135
+ ue();
136
+ const _ = y(!1), r = y(!1), p = {
137
+ name: "",
138
+ campaigns: []
139
+ }, o = y(""), a = y({ ...p }), g = re.superRefine((s, e) => {
140
+ }), l = y([]), n = y(null), { global: c, minor: w } = me, P = G(() => {
141
+ const s = g.safeParse(a.value);
142
+ return s.success ? [] : s.error.errors;
143
+ });
144
+ function M(s) {
145
+ var e;
146
+ _.value = !0, s ? (n.value = { ...s }, a.value = { ...s, campaigns: (e = s.pf_campaigns) == null ? void 0 : e.map((m) => m._id) }) : (n.value = null, a.value = { ...p });
147
+ }
148
+ function F() {
149
+ _.value = !1, n.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
+ l.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
+ l.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
+ g.safeParse(a.value).success && await w(
195
+ async () => {
196
+ var e;
197
+ n.value ? await R.updateGroup(
198
+ (e = n.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 = n.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(_),
229
+ "onUpdate:modelValue": e[7] || (e[7] = (f) => T(_) ? _.value = f : null),
230
+ header: t(n) ? "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", Ge, [
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(n) ? (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
+ we,
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(g), "name")
271
+ }, null, 8, ["modelValue", "schema"]),
272
+ Fe,
273
+ i("div", Ae, [
274
+ i("div", $e, 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", Ue, [
297
+ t(r) ? V("", !0) : (d(!0), k($, { key: 0 }, D(t(q), (f, Q) => (d(), k("div", null, [
298
+ i("div", Pe, O(Q), 1),
299
+ h(B, { separator: !0 }, {
300
+ default: L(() => [
301
+ (d(!0), k($, null, D(f, (H) => (d(), k("div", Le, [
302
+ i("div", null, O(H.label), 1),
303
+ i("div", null, [
304
+ h(m, {
305
+ icon: "delete",
306
+ onClick: (je) => 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
+ ee("Link campaign ")
329
+ ])
330
+ ]),
331
+ key: "0"
332
+ } : void 0
333
+ ]), 1032, ["modelValue", "header"]);
334
+ };
335
+ }
336
+ }), Be = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Re = { class: "space-y-16" }, Ee = { class: "flex items-center justify-end" }, Oe = /* @__PURE__ */ i("img", {
337
+ src: ne,
338
+ class: "w-[150px]"
339
+ }, null, -1), De = /* @__PURE__ */ i("div", { class: "fm-typo-en-title-sm-800 text-center" }, " Analytics Dashboard Temporarily Unavailable ", -1), Te = /* @__PURE__ */ 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), rt = /* @__PURE__ */ j({
340
+ __name: "Analytic",
341
+ setup(U) {
342
+ const { t: b } = ye(), u = {
343
+ label: b("connect.analytic.addGroup"),
344
+ value: "create",
345
+ isPrimary: !0,
346
+ prependIcon: "add"
347
+ }, v = ve(), S = y(), _ = y([]), r = y(""), p = te({
348
+ totalCampaign: 0,
349
+ totalProgram: 0,
350
+ totalMember: 0
351
+ }), o = y("1");
352
+ b("connect.analytic.summary.totalCampaign"), b("connect.analytic.summary.totalProgram"), b("connect.analytic.summary.totalMember");
353
+ function a(n) {
354
+ var c;
355
+ o.value = (/* @__PURE__ */ new Date()).toISOString(), (c = S.value) == null || c.showSheet(n);
356
+ }
357
+ async function g() {
358
+ await v.readGroups();
359
+ const n = await R.readAllGrouped({
360
+ limit: 100,
361
+ skip: 0,
362
+ sortBy: "_id",
363
+ search: "",
364
+ descending: !0
365
+ });
366
+ _.value = n.resources;
367
+ }
368
+ G(() => _.value.filter((n) => {
369
+ var c;
370
+ return n.name.includes(r.value) || ((c = n.pf_campaigns) == null ? void 0 : c.filter((w) => w.name.includes(r.value)).length);
371
+ }));
372
+ const l = fe();
373
+ return le(), y(!0), G(() => {
374
+ var n, c, w, P;
375
+ return !l.storeOption || !l.storeOption.company ? -1 : !l.payoutAccount || !l.payoutAccount.enable || l.payoutAccount.status != "APPROVED" ? 0 : (c = (n = l.store) == null ? void 0 : n.categories) != null && c.length ? (P = (w = l.store) == null ? void 0 : w.categories) != null && P.some(
376
+ (M) => M.bundles.some((F) => F.isFeedvibe)
377
+ ) ? 3 : 2 : 1;
378
+ }), ae(async () => {
379
+ await l.readMemberStore(), await l.readMembership(), await l.readPayoutAccount();
380
+ }), (n, c) => {
381
+ const w = x("FmPageHead"), P = x("FmSearch"), M = x("FmCard");
382
+ return x("FmButton"), x("FmIcon"), d(), k($, null, [
383
+ h(w, {
384
+ title: t(b)("connect.analytic.title"),
385
+ actions: t(_).length > 0 ? [u] : [],
386
+ "onClick:action": c[0] || (c[0] = (F) => a())
387
+ }, null, 8, ["title", "actions"]),
388
+ i("div", Be, [
389
+ i("div", Re, [
390
+ i("div", Ee, [
391
+ h(P, {
392
+ class: "xs:hidden",
393
+ modelValue: t(r),
394
+ "onUpdate:modelValue": c[1] || (c[1] = (F) => T(r) ? r.value = F : null),
395
+ placeholder: t(b)("connect.analytic.search"),
396
+ collapsible: ""
397
+ }, null, 8, ["modelValue", "placeholder"])
398
+ ]),
399
+ V("", !0)
400
+ ]),
401
+ V("", !0),
402
+ t(_).length ? V("", !0) : (d(), A(M, {
403
+ key: 1,
404
+ variant: "outlined",
405
+ class: "flex flex-col gap-y-24 items-center p-16"
406
+ }, {
407
+ default: L(() => [
408
+ Oe,
409
+ De,
410
+ Te
411
+ ]),
412
+ _: 1
413
+ })),
414
+ V("", !0),
415
+ h(Me, {
416
+ ref_key: "sheetRef",
417
+ ref: S,
418
+ onSuccess: g
419
+ }, null, 512)
420
+ ])
421
+ ], 64);
422
+ };
423
+ }
424
+ });
425
+ export {
426
+ rt as default
427
+ };