@feedmepos/mf-connect 0.1.38-beta.61 → 0.1.38-beta.63

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 (108) hide show
  1. package/dist/{Analytic-CM7mh-iO.js → Analytic-99208ZGh.js} +14 -14
  2. package/dist/{App-CeCzzsDu.js → App-BkTi1rTp.js} +7 -7
  3. package/dist/{AuditLogs-VWx8DFKA.js → AuditLogs-BqKgDkGp.js} +9 -9
  4. package/dist/{Bin-vUuol_I9.js → Bin-C_vWkAOc.js} +8 -8
  5. package/dist/Broadcast-_s9fmcsY.js +267 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CV-zhJ15.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CgDMf3Yl.js} +6 -6
  7. package/dist/{Card-CeIeGET1.js → Card-RfSe4_GI.js} +17 -17
  8. package/dist/{Collections-CF_OcAL3.js → Collections-DgWI87e9.js} +7 -7
  9. package/dist/Credit-DBy_Xcpq.js +261 -0
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-0DMFuBoG.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D5T444y0.js} +203 -199
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BZfchHlT.js → EffectSheet.vue_vue_type_style_index_0_lang-BwSXXdG-.js} +6 -6
  12. package/dist/Experience-DBg5cZxJ.js +260 -0
  13. package/dist/{FileSaver.min-lgg_oBvT.js → FileSaver.min-Bzi1BTgf.js} +1 -1
  14. package/dist/Game-CSilatA5.js +331 -0
  15. package/dist/{GenerateMaterial-B5A7mx2y.js → GenerateMaterial-7DLj60E8.js} +6 -6
  16. package/dist/{Grab-BgiMqwvj.js → Grab-CM0RcU3-.js} +9 -9
  17. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DZ8DHrQ_.js → ImageInput.vue_vue_type_script_setup_true_lang-D3lV7JVV.js} +1 -1
  18. package/dist/{Index-B85ops8K.js → Index-DIpMb8rL.js} +10 -10
  19. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-B5rIjxYd.js → LottieAnimation.vue_vue_type_script_setup_true_lang-D6L3PiGD.js} +1 -1
  20. package/dist/{MainLayout-CXGVkD-W.js → MainLayout-C0Bq_pRh.js} +1 -1
  21. package/dist/{Marketing-Bnijl7lA.js → Marketing-CiOCRSE8.js} +4 -4
  22. package/dist/{MarketingMaterialEdit-BlUKwSoP.js → MarketingMaterialEdit-BHJPku7e.js} +4 -4
  23. package/dist/{Member-sT853g51.js → Member-Blcc8M5S.js} +11 -11
  24. package/dist/{MemberList-DYT5_fSP.js → MemberList--Ua0eKo0.js} +25 -25
  25. package/dist/{MemberTransactions-Cqce5ebe.js → MemberTransactions-C0_OArai.js} +1 -1
  26. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Dq0Hswj8.js → MessageInput.vue_vue_type_script_setup_true_lang-CO8MuZju.js} +9834 -9724
  27. package/dist/Mission-Dp7QTUdu.js +335 -0
  28. package/dist/{Overview-B0rwrHR1.js → Overview-B-puEtTe.js} +18 -18
  29. package/dist/Point-BMUeLRXE.js +263 -0
  30. package/dist/Promotion-CZjW5Eny.js +397 -0
  31. package/dist/{Queue-SVqRUlD_.js → Queue-CZ8a1tcg.js} +10 -10
  32. package/dist/{Record-BTjg4ihy.js → Record-BJXOqe51.js} +9 -9
  33. package/dist/{Reward-DW58VMRO.js → Reward-CYaP48K9.js} +16 -16
  34. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-s1RI55Rc.js → RewardGroup.vue_vue_type_script_setup_true_lang-Bvq4GrL1.js} +11 -11
  35. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Os17lXBX.js → RuleGroup.vue_vue_type_script_setup_true_lang-DnfvXZOL.js} +14 -14
  36. package/dist/{Segment-Dny8pxP1.js → Segment-D4vjzSgr.js} +24 -24
  37. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Czx7rqiq.js → SelectItems.vue_vue_type_script_setup_true_lang-iDaC99DI.js} +2 -2
  38. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-EgVxUG_N.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-mkt1o9sO.js} +12 -12
  39. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CO0fgI3K.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-UHTvMbYY.js} +4 -4
  40. package/dist/{Setting-CjcnxK34.js → Setting-BxTVlSNI.js} +13 -13
  41. package/dist/{SettingAdvertisements-CIyDF4C8.js → SettingAdvertisements-DvuFXOGs.js} +11 -11
  42. package/dist/{Store-B8k5YVqU.js → Store-xF8dYQbN.js} +20 -20
  43. package/dist/{StoreRewards-BW08rwpL.js → StoreRewards-BxW_FxY3.js} +14 -14
  44. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BfFSfE2H.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DvPC3YQN.js} +19 -19
  45. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CZkKjUNQ.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CDgL0WOA.js} +1 -1
  46. package/dist/{Tier-DKzu4tYw.js → Tier-C73TRPVo.js} +23 -23
  47. package/dist/{Title-BK-TXatJ.js → Title-DD4gP_Kc.js} +20 -20
  48. package/dist/{Transaction-Duayg1jd.js → Transaction-BGheiJ8F.js} +2 -2
  49. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BAR9h1TV.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-ne1fn7b7.js} +6 -6
  50. package/dist/{Voucher-BEVAkNeJ.js → Voucher-CRatGWk7.js} +164 -142
  51. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DvFy9Z6X.js → VoucherEditor.vue_vue_type_script_setup_true_lang-2_F9hEkK.js} +12 -12
  52. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CU_Sx2PM.js → ZodTextField.vue_vue_type_script_setup_true_lang-DNEs_60Z.js} +2 -2
  53. package/dist/{app-IvbII0ql.js → app-UaX9LGGa.js} +7966 -7880
  54. package/dist/app.js +1 -1
  55. package/dist/{business-BFIwFfkq.js → business-bUX6raMw.js} +1 -1
  56. package/dist/{campaign-RuIwxc4y.js → campaign-BwqSJn1x.js} +8 -8
  57. package/dist/{campaign-w9j4I4jn.js → campaign-DUDuTel5.js} +2 -2
  58. package/dist/{campaign.enum-IHLsfdik.js → campaign.enum-1k6333ca.js} +1 -1
  59. package/dist/{campaign.fn-B_P1MkRV.js → campaign.fn-CgJi24jv.js} +31 -31
  60. package/dist/{collectible.enum-CUgSjO08.js → collectible.enum-DkQ5IEM4.js} +1 -1
  61. package/dist/{collection.fn-CrfnNb41.js → collection.fn-Cc4UF4PF.js} +2 -2
  62. package/dist/{dto-jwO_sX9I.js → dto-BauGrz7j.js} +4 -4
  63. package/dist/duplicateCampaign-C1zAMcB8.js +51 -0
  64. package/dist/{effect--0g8PNyt.js → effect-BzcguSGr.js} +1 -1
  65. package/dist/{email-addresses-HtsxvXw9.js → email-addresses-BxvYeGJM.js} +2 -2
  66. package/dist/{export-CFEwMRmd.js → export-CtEjDYVF.js} +2 -2
  67. package/dist/{helper-CCfb24PO.js → helper-B9MQjEoz.js} +1 -1
  68. package/dist/{index-BZEM0T2A.js → index-BhKOx9rm.js} +1 -1
  69. package/dist/{index-Bflu4Rft.js → index-Bx_lUMxi.js} +3 -3
  70. package/dist/{index-wzSeRJAd.js → index-CJIGs8yP.js} +1 -1
  71. package/dist/{index-CkuPY85X.js → index-COST516f.js} +1 -1
  72. package/dist/{index-BR3UbZ0F.js → index-CR8jJQP8.js} +1 -1
  73. package/dist/{index-CZPcwcUo.js → index-CRGgyR29.js} +3 -3
  74. package/dist/{index-DpjYgKTN.js → index-Cr9kGG1v.js} +1 -1
  75. package/dist/{index-CppLPpqB.js → index-Cvcgqzy5.js} +3 -3
  76. package/dist/{index-DDYH-IEX.js → index-DJqWLQvn.js} +1 -1
  77. package/dist/{index-CR3f3BXQ.js → index-DNrDjbLS.js} +1023 -1023
  78. package/dist/{index-B-AMMFfT.js → index-DYDOXl_b.js} +4 -4
  79. package/dist/{index-DdZdHioZ.js → index-hOEO4SV6.js} +6 -6
  80. package/dist/{index-Dic_WcAL.js → index-lbAEZ5CZ.js} +1 -1
  81. package/dist/{index.esm2017-CUnjzfU-.js → index.esm2017-6u5qxmWE.js} +1 -1
  82. package/dist/{loading-CivgDw5C.js → loading-Cpe50hSj.js} +2 -2
  83. package/dist/{lodash-BSbv_9TG.js → lodash-Bdhnyywe.js} +1 -1
  84. package/dist/{membership-j2w1YUO-.js → membership-C_VLzMwg.js} +3 -3
  85. package/dist/{money-DL-x8hiT.js → money-C2cELkXt.js} +1 -1
  86. package/dist/{number-D1yoFGEr.js → number-BFQi0hyw.js} +1 -1
  87. package/dist/objectid-WFNy_Dkj.js +145 -0
  88. package/dist/{plugins-P-V4XWmW.js → plugins-CTcRVNU6.js} +3 -3
  89. package/dist/{reward-BqMlBQRu.js → reward-zY_9dHpb.js} +1 -1
  90. package/dist/{rule-CztsLdki.js → rule-UZYsfn59.js} +3 -3
  91. package/dist/{rule-builder-DANv7Rmz.js → rule-builder-BW49BaXF.js} +1 -1
  92. package/dist/{template-Dbz3FhHK.js → template-CjZH_5cu.js} +6 -6
  93. package/dist/{timezone-BgVqObBq.js → timezone-CQrMBJum.js} +2 -2
  94. package/dist/{trigger-CbriUibd.js → trigger-BHqKZjrT.js} +5 -5
  95. package/dist/{usePagination-DtNK7W0U.js → usePagination-HabuQYCy.js} +1 -1
  96. package/dist/{user-CVapqHfr.js → user-YZUgk9lA.js} +1 -1
  97. package/dist/{vue-i18n-tpDAnnmD.js → vue-i18n-C1KlZBjR.js} +252 -252
  98. package/dist/{xlsx-EewcN2uY.js → xlsx-CMv5r9NR.js} +1 -1
  99. package/dist/{zod-D-wiCQRJ.js → zod-jH-8jgB1.js} +1 -1
  100. package/package.json +3 -3
  101. package/dist/Broadcast-6VXz4-IG.js +0 -233
  102. package/dist/Credit-BUqGOyp_.js +0 -226
  103. package/dist/Experience-BxiFH_uV.js +0 -225
  104. package/dist/Game-BzYW0LfY.js +0 -300
  105. package/dist/Mission-Q5_sGgrm.js +0 -304
  106. package/dist/Point-BGYFMvev.js +0 -228
  107. package/dist/Promotion-0acd63nA.js +0 -364
  108. package/dist/objectid-CHab6j3r.js +0 -145
@@ -0,0 +1,335 @@
1
+ import { defineComponent as W, ref as v, computed as G, h as m, onMounted as J, resolveComponent as d, openBlock as u, createElementBlock as S, Fragment as k, createVNode as c, unref as t, createElementVNode as i, withCtx as F, renderList as Q, createBlock as I, resolveDynamicComponent as X, toDisplayString as g } from "vue";
2
+ import { _ as Y } from "./campaign-CpzFl8Vr.js";
3
+ import { u as Z } from "./loading-Cpe50hSj.js";
4
+ import { a as ee, b as D, c as K } from "./campaign-BwqSJn1x.js";
5
+ import { c as oe, p as te } from "./duplicateCampaign-C1zAMcB8.js";
6
+ import { a as ne, p as ae } from "./plugins-CTcRVNU6.js";
7
+ import { u as ie } from "./business-bUX6raMw.js";
8
+ import { u as se } from "./campaign-DUDuTel5.js";
9
+ import { useDialog as re, components as y } from "@feedmepos/ui-library";
10
+ import { _ as ce } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
+ import { u as le } from "./template-CjZH_5cu.js";
12
+ import { _ as me } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-D5T444y0.js";
13
+ import { s as de } from "./index-CuvNtC_M.js";
14
+ import { u as pe } from "./vue-i18n-C1KlZBjR.js";
15
+ import { _ as ue } from "./SendCollectionSheet.vue_vue_type_script_setup_true_lang-mkt1o9sO.js";
16
+ import { c as _ } from "./index-Cr9kGG1v.js";
17
+ const ge = { class: "px-24 flex flex-col gap-y-16" }, fe = { class: "flex items-center justify-between w-full" }, ye = { class: "flex gap-8 overflow-x-auto" }, _e = { class: "space-y-8" }, he = { class: "flex w-full gap-4 items-center" }, we = { class: "space-y-4" }, Ce = { class: "fm-typo-en-body-lg-600" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ve = { class: "flex items-center gap-8" }, Se = { class: "flex flex-col gap-16 text-center" }, ke = { class: "fm-typo-en-title-sm-800" }, Fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He = /* @__PURE__ */ W({
18
+ __name: "Mission",
19
+ setup(Ie) {
20
+ const { t: a } = pe(), N = {
21
+ label: a("connect.program.common.actions.create", {
22
+ type: a("connect.program.mission.title").toLowerCase()
23
+ }),
24
+ value: "create",
25
+ isPrimary: !0,
26
+ prependIcon: "add"
27
+ }, L = re(), O = le("MISSION", L), R = ie(), p = se(), { global: A, minor: V } = Z, l = v({
28
+ searchKey: "",
29
+ location: []
30
+ });
31
+ function U(e) {
32
+ const o = l.value.location;
33
+ return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((s) => {
34
+ var r;
35
+ return (r = e == null ? void 0 : e.targetLocation) == null ? void 0 : r.includes(s);
36
+ }) : e.targetLocation.includes(o);
37
+ }
38
+ const f = G(
39
+ () => p.campaigns.mission.filter((e) => U(e))
40
+ ), T = [
41
+ {
42
+ header: a("connect.program.common.table.title"),
43
+ accessorKey: "name",
44
+ // accessorFn: (v) => v.name,
45
+ cell(e) {
46
+ return m("div", { class: "flex items-center justify-between gap-4" }, [
47
+ m("div", { class: "flex items-center" }, [
48
+ m(
49
+ y.FmTooltip,
50
+ {
51
+ content: e.row.original._id,
52
+ onClick: (o) => {
53
+ o.stopPropagation(), ne(e.row.original._id);
54
+ }
55
+ },
56
+ [
57
+ m(y.FmIcon, {
58
+ name: "info",
59
+ outline: !0,
60
+ size: "sm"
61
+ })
62
+ ]
63
+ )
64
+ ]),
65
+ m("div", { class: "flex-1" }, e.row.original.name)
66
+ ]);
67
+ }
68
+ },
69
+ {
70
+ header: a("connect.campaign.mission.type"),
71
+ accessorFn: (e) => de(e.mission.type)
72
+ //v.effect,
73
+ },
74
+ {
75
+ header: a("connect.program.common.table.status"),
76
+ accessorFn: (e) => ee(e),
77
+ cell(e) {
78
+ return D(e.row.original);
79
+ }
80
+ },
81
+ {
82
+ header: a("connect.program.common.table.summary"),
83
+ accessorFn: (e) => K(e)
84
+ //v.effect,
85
+ },
86
+ {
87
+ header: a("connect.campaign.mission.received"),
88
+ accessorFn: (e) => {
89
+ var o;
90
+ return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
91
+ }
92
+ },
93
+ {
94
+ header: a("connect.program.common.table.actions"),
95
+ cell(e) {
96
+ return m("div", { class: "flex items-center gap-8" }, [
97
+ m(y.FmButton, {
98
+ variant: "tertiary",
99
+ icon: "content_copy",
100
+ iconColor: "neutral-gray-400",
101
+ onClick: async (o) => {
102
+ o.stopPropagation(), await P(e.row.original);
103
+ }
104
+ }),
105
+ m(y.FmButton, {
106
+ variant: "tertiary",
107
+ icon: "send",
108
+ iconColor: "neutral-gray-400",
109
+ onClick: (o) => {
110
+ o.stopPropagation(), j(e.row.original);
111
+ }
112
+ }),
113
+ m(y.FmButton, {
114
+ variant: "tertiary",
115
+ icon: "delete",
116
+ iconColor: "neutral-gray-400",
117
+ onClick: (o) => {
118
+ o.stopPropagation(), M(e.row.original);
119
+ }
120
+ })
121
+ ]);
122
+ }
123
+ }
124
+ ], w = v(), B = v();
125
+ async function M(e) {
126
+ await ae.remove(
127
+ a("connect.program.common.remove.confirm", { name: e.name })
128
+ ) && await V(
129
+ async () => {
130
+ await _.delete(e._id), await p.read("MISSION");
131
+ },
132
+ {
133
+ message: a("connect.program.common.remove.removing", { name: e.name }),
134
+ successMessage: a("connect.program.common.remove.removed", {
135
+ name: e.name
136
+ })
137
+ }
138
+ );
139
+ }
140
+ async function h(e) {
141
+ e ? await o() : O.open(async (s) => {
142
+ await o(s);
143
+ });
144
+ async function o(s) {
145
+ var r;
146
+ (r = w.value) == null || r.showSheet(
147
+ !0,
148
+ "MISSION",
149
+ e ? await _.readById(e._id) : void 0,
150
+ s
151
+ );
152
+ }
153
+ }
154
+ async function P(e) {
155
+ var r;
156
+ if (!await oe(e.name))
157
+ return;
158
+ const o = await _.readById(e._id), s = te(o);
159
+ (r = w.value) == null || r.showSheet(
160
+ !0,
161
+ "MISSION",
162
+ s,
163
+ o.template
164
+ );
165
+ }
166
+ async function $(e) {
167
+ e.campaign._id && e.campaign.rewards.some((o) => o.type === "VOUCHER") && await new Promise((o) => {
168
+ L.open({
169
+ title: "Confirmation",
170
+ message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
171
+ primaryActions: { text: "Update all", close: !0 },
172
+ secondaryActions: { text: "Update future only", close: !0 }
173
+ }).onPrimary(async () => {
174
+ var s;
175
+ e.updateCollections = !0, (s = window.top) == null || s.postMessage("updateAllVoucher", "*"), o();
176
+ }).onSecondary(async () => {
177
+ o();
178
+ });
179
+ }), await V(
180
+ async () => {
181
+ e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await p.read("MISSION");
182
+ },
183
+ {
184
+ message: a(
185
+ e.campaign._id ? "connect.program.common.update.updating" : "connect.program.common.update.creating",
186
+ { type: "Mission" }
187
+ ),
188
+ successMessage: a("connect.program.common.update.success", {
189
+ type: "Mission",
190
+ action: e.campaign._id ? "updated" : "created"
191
+ })
192
+ }
193
+ );
194
+ }
195
+ function j(e) {
196
+ var o;
197
+ (o = B.value) == null || o.showSheet({
198
+ campaign: e
199
+ });
200
+ }
201
+ return J(async () => {
202
+ await A(async () => {
203
+ await p.read("MISSION"), console.log(f);
204
+ });
205
+ }), (e, o) => {
206
+ const s = d("FmPageHead"), r = d("FmSearch"), E = d("FmTable"), C = d("FmButton"), H = d("FmListItem"), q = d("FmList"), z = d("FmCard");
207
+ return u(), S(k, null, [
208
+ c(s, {
209
+ title: t(a)("connect.campaign.mission.title"),
210
+ actions: t(f).length > 0 ? [N] : [],
211
+ "onClick:action": o[0] || (o[0] = () => h())
212
+ }, null, 8, ["title", "actions"]),
213
+ i("div", ge, [
214
+ c(r, {
215
+ modelValue: t(l).searchKey,
216
+ "onUpdate:modelValue": o[1] || (o[1] = (n) => t(l).searchKey = n),
217
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
218
+ placeholder: t(a)("connect.program.common.search"),
219
+ collapsible: ""
220
+ }, null, 8, ["modelValue", "placeholder"]),
221
+ t(p).campaigns.mission && t(p).campaigns.mission.length > 0 ? (u(), S(k, { key: 0 }, [
222
+ i("div", fe, [
223
+ i("div", ye, [
224
+ c(ce, {
225
+ label: `${t(a)("connect.program.common.location")}: `,
226
+ "right-icon": "keyboard_arrow_down",
227
+ modelValue: t(l).location,
228
+ "onUpdate:modelValue": o[2] || (o[2] = (n) => t(l).location = n),
229
+ icon: "storefront",
230
+ "show-item-label": !0,
231
+ items: t(R).locationOptions
232
+ }, null, 8, ["label", "modelValue", "items"])
233
+ ]),
234
+ c(r, {
235
+ modelValue: t(l).searchKey,
236
+ "onUpdate:modelValue": o[3] || (o[3] = (n) => t(l).searchKey = n),
237
+ class: "xs:hidden sm:hidden",
238
+ placeholder: "search",
239
+ collapsible: ""
240
+ }, null, 8, ["modelValue"])
241
+ ]),
242
+ c(E, {
243
+ class: "xs:hidden sm:hidden",
244
+ "row-data": t(f),
245
+ "column-defs": T,
246
+ "search-value": t(l).searchKey,
247
+ "column-filter": [],
248
+ onRowClick: o[4] || (o[4] = (n) => h(n.original)),
249
+ "hide-footer": t(f).length < 10
250
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
251
+ c(q, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
252
+ default: F(() => [
253
+ (u(!0), S(k, null, Q(t(f).filter(
254
+ (n) => n.name.toLowerCase().includes(t(l).searchKey.toLowerCase())
255
+ ), (n) => (u(), I(H, {
256
+ key: n._id.toString(),
257
+ onClick: (x) => h(n),
258
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
259
+ }, {
260
+ default: F(() => {
261
+ var x;
262
+ return [
263
+ i("div", _e, [
264
+ i("div", he, [
265
+ (u(), I(X(t(D)(n))))
266
+ ]),
267
+ i("div", we, [
268
+ i("div", Ce, g(n.name), 1),
269
+ i("div", xe, g(t(K)(n)), 1)
270
+ ]),
271
+ i("div", be, g(t(a)("connect.campaign.mission.received")) + " : " + g(((x = n == null ? void 0 : n.pf_collectible) == null ? void 0 : x.currentReceive) ?? 0), 1)
272
+ ]),
273
+ i("div", ve, [
274
+ c(C, {
275
+ icon: "content_copy",
276
+ "icon-color": "neutral-gray-400",
277
+ variant: "tertiary",
278
+ onClick: async (b) => {
279
+ b.stopPropagation(), await P(n);
280
+ }
281
+ }, null, 8, ["onClick"]),
282
+ c(C, {
283
+ icon: "delete",
284
+ "icon-color": "neutral-gray-400",
285
+ variant: "tertiary",
286
+ onClick: (b) => (b.stopPropagation(), M(n))
287
+ }, null, 8, ["onClick"])
288
+ ])
289
+ ];
290
+ }),
291
+ _: 2
292
+ }, 1032, ["onClick"]))), 128))
293
+ ]),
294
+ _: 1
295
+ })
296
+ ], 64)) : (u(), I(z, {
297
+ key: 1,
298
+ variant: "outlined",
299
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
300
+ }, {
301
+ default: F(() => [
302
+ o[6] || (o[6] = i("img", {
303
+ src: Y,
304
+ class: "aspect-square w-[150px]"
305
+ }, null, -1)),
306
+ i("div", Se, [
307
+ i("div", ke, g(t(a)("connect.campaign.mission.createProgram")), 1),
308
+ i("div", Fe, g(t(a)("connect.campaign.mission.description")), 1)
309
+ ]),
310
+ c(C, {
311
+ variant: "primary",
312
+ label: t(a)("connect.campaign.mission.create"),
313
+ icon: "add",
314
+ onClick: o[5] || (o[5] = (n) => h())
315
+ }, null, 8, ["label"])
316
+ ]),
317
+ _: 1
318
+ })),
319
+ c(me, {
320
+ ref_key: "sheetRef",
321
+ ref: w,
322
+ "onSubmit:modelValue": $
323
+ }, null, 512),
324
+ c(ue, {
325
+ ref_key: "sendCollectionSheetRef",
326
+ ref: B
327
+ }, null, 512)
328
+ ])
329
+ ], 64);
330
+ };
331
+ }
332
+ });
333
+ export {
334
+ He as default
335
+ };
@@ -1,27 +1,27 @@
1
1
  import { defineComponent as q, resolveComponent as w, openBlock as C, createElementBlock as B, Fragment as Y, createVNode as c, withCtx as V, createElementVNode as a, toDisplayString as O, unref as r, renderSlot as ve, ref as F, computed as G, watch as ie, createBlock as j, isRef as J, resolveDynamicComponent as ne, renderList as re, normalizeClass as de, createTextVNode as ce, createCommentVNode as z, h as te, onMounted as _e } from "vue";
2
2
  import { _ as ge } from "./campaign-CpzFl8Vr.js";
3
- import { u as Z } from "./vue-i18n-tpDAnnmD.js";
4
- import { u as ue } from "./loading-CivgDw5C.js";
5
- import { c as we, p as K } from "./plugins-P-V4XWmW.js";
3
+ import { u as Z } from "./vue-i18n-C1KlZBjR.js";
4
+ import { u as ue } from "./loading-Cpe50hSj.js";
5
+ import { c as we, p as K } from "./plugins-CTcRVNU6.js";
6
6
  import { J as X } from "./JsonViewer-v8_C7l5N.js";
7
- import { Z as N } from "./zod-D-wiCQRJ.js";
7
+ import { Z as N } from "./zod-jH-8jgB1.js";
8
8
  import { u as W } from "./app-wDQR6dpb.js";
9
- import { u as Q, _ as ye } from "./RewardGroup.vue_vue_type_script_setup_true_lang-s1RI55Rc.js";
10
- import { u as me } from "./reward-BqMlBQRu.js";
11
- import { a as be, b as xe } from "./index-DdZdHioZ.js";
12
- import { l as le, c as se } from "./index-B-AMMFfT.js";
13
- import "./index-Bflu4Rft.js";
14
- import "./index-CR3f3BXQ.js";
15
- import "./index-CZPcwcUo.js";
16
- import { C as fe } from "./membership-j2w1YUO-.js";
17
- import { t as ee } from "./helper-CCfb24PO.js";
9
+ import { u as Q, _ as ye } from "./RewardGroup.vue_vue_type_script_setup_true_lang-Bvq4GrL1.js";
10
+ import { u as me } from "./reward-zY_9dHpb.js";
11
+ import { a as be, b as xe } from "./index-hOEO4SV6.js";
12
+ import { l as le, c as se } from "./index-DYDOXl_b.js";
13
+ import "./index-Bx_lUMxi.js";
14
+ import "./index-DNrDjbLS.js";
15
+ import "./index-CRGgyR29.js";
16
+ import { C as fe } from "./membership-C_VLzMwg.js";
17
+ import { t as ee } from "./helper-B9MQjEoz.js";
18
18
  import { c as H } from "./object-qECH92oz.js";
19
19
  import { useDialog as Ce, components as oe } from "@feedmepos/ui-library";
20
- import { _ as Re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CU_Sx2PM.js";
21
- import { a as Se, _ as Fe, b as ke } from "./trigger-CbriUibd.js";
22
- import { O as $e } from "./objectid-CHab6j3r.js";
23
- import { r as pe } from "./index-DDYH-IEX.js";
24
- import { u as Pe } from "./business-BFIwFfkq.js";
20
+ import { _ as Re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DNEs_60Z.js";
21
+ import { a as Se, _ as Fe, b as ke } from "./trigger-BHqKZjrT.js";
22
+ import { O as $e } from "./objectid-WFNy_Dkj.js";
23
+ import { r as pe } from "./index-DJqWLQvn.js";
24
+ import { u as Pe } from "./business-bUX6raMw.js";
25
25
  const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, Te = { class: "flex-1" }, Ue = { class: "flex items-center gap-8" }, Ae = { class: "fm-typo-en-title-sm-800" }, Le = { class: "flex gap-8 items-center" }, Ee = { class: "space-y-4 hidden xs:!block border-b border-fm-color-neutral-gray-100 px-16 flex-1 pb-24" }, Be = { class: "flex items-center justify-between" }, Oe = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, je = { class: "flex-1 space-y-4" }, De = { class: "fm-typo-en-body-lg-600" }, Ge = /* @__PURE__ */ q({
26
26
  __name: "ReferralRewadGroupCard",
27
27
  props: {
@@ -0,0 +1,263 @@
1
+ import { defineComponent as H, ref as I, computed as q, h as x, onMounted as z, resolveComponent as m, openBlock as d, createElementBlock as v, Fragment as k, createVNode as s, unref as o, withCtx as h, createElementVNode as n, toDisplayString as u, renderList as G, createBlock as F, resolveDynamicComponent as J } from "vue";
2
+ import { _ as Q } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as W, components as V } from "@feedmepos/ui-library";
4
+ import { p as X } from "./plugins-CTcRVNU6.js";
5
+ import { u as Y } from "./loading-Cpe50hSj.js";
6
+ import { u as Z } from "./business-bUX6raMw.js";
7
+ import { u as ee } from "./campaign-DUDuTel5.js";
8
+ import { a as te, b as $, c as N } from "./campaign-BwqSJn1x.js";
9
+ import { c as oe, p as ae } from "./duplicateCampaign-C1zAMcB8.js";
10
+ import { _ as ne } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
+ import { _ as ie } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-D5T444y0.js";
12
+ import { u as se } from "./template-CjZH_5cu.js";
13
+ import { u as re } from "./vue-i18n-C1KlZBjR.js";
14
+ import { c as f } from "./index-Cr9kGG1v.js";
15
+ const le = { class: "flex items-center" }, ce = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, me = { class: "px-24 flex flex-col gap-y-16" }, pe = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, ue = { class: "space-y-8" }, fe = { class: "flex w-full gap-4 items-center" }, ge = { class: "space-y-4" }, ye = { class: "fm-typo-en-body-lg-600" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, he = { class: "flex items-center gap-8" }, Ce = { class: "flex flex-col gap-16 text-center" }, we = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ae = /* @__PURE__ */ H({
16
+ __name: "Point",
17
+ setup(xe) {
18
+ const { t: i } = re(), D = {
19
+ label: i("connect.program.common.actions.create", {
20
+ type: i("connect.program.point.title").toLowerCase()
21
+ }),
22
+ value: "create",
23
+ isPrimary: !0,
24
+ prependIcon: "add"
25
+ }, K = se("COIN", W()), C = Z(), p = ee(), { global: O, minor: S } = Y, l = I({
26
+ searchKey: "",
27
+ location: []
28
+ });
29
+ function A(e) {
30
+ const t = l.value.location;
31
+ return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((c) => {
32
+ var r;
33
+ return (r = e == null ? void 0 : e.targetLocation) == null ? void 0 : r.includes(c);
34
+ }) : e.targetLocation.includes(t);
35
+ }
36
+ const g = q(
37
+ () => p.campaigns.point.filter((e) => A(e))
38
+ ), R = [
39
+ {
40
+ header: i("connect.program.common.table.title"),
41
+ accessorFn: (e) => e.name
42
+ },
43
+ {
44
+ header: i("connect.program.common.table.status"),
45
+ accessorFn: (e) => te(e),
46
+ cell(e) {
47
+ return $(e.row.original);
48
+ }
49
+ },
50
+ {
51
+ header: i("connect.program.common.table.summary"),
52
+ accessorFn: (e) => N(e)
53
+ },
54
+ {
55
+ header: i("connect.program.common.table.actions"),
56
+ cell(e) {
57
+ return x("div", { class: "flex items-center gap-8 justify-end" }, [
58
+ x(V.FmButton, {
59
+ variant: "tertiary",
60
+ icon: "content_copy",
61
+ iconColor: "neutral-gray-400",
62
+ onClick: async (t) => {
63
+ t.stopPropagation(), await P(e.row.original);
64
+ }
65
+ }),
66
+ x(V.FmButton, {
67
+ variant: "tertiary",
68
+ icon: "delete",
69
+ iconColor: "neutral-gray-400",
70
+ onClick: (t) => {
71
+ t.stopPropagation(), L(e.row.original);
72
+ }
73
+ })
74
+ ]);
75
+ }
76
+ }
77
+ ], w = I();
78
+ async function L(e) {
79
+ await X.remove(`Are you sure you want to remove ${e.name}?`) && await S(
80
+ async () => {
81
+ await f.delete(e._id), await p.read("COIN");
82
+ },
83
+ {
84
+ message: `Removing ${e.name}`,
85
+ successMessage: `Removed ${e.name} successfully`
86
+ }
87
+ );
88
+ }
89
+ async function y(e) {
90
+ e ? await t() : K.open(async (c) => {
91
+ await t(c);
92
+ });
93
+ async function t(c) {
94
+ var r;
95
+ (r = w.value) == null || r.showSheet(
96
+ !0,
97
+ "COIN",
98
+ e ? await f.readById(e._id) : void 0,
99
+ c
100
+ );
101
+ }
102
+ }
103
+ async function P(e) {
104
+ var r;
105
+ if (!await oe(e.name))
106
+ return;
107
+ const t = await f.readById(e._id), c = ae(t, {
108
+ keepCollectible: !0
109
+ });
110
+ (r = w.value) == null || r.showSheet(
111
+ !0,
112
+ "COIN",
113
+ c,
114
+ t.template
115
+ );
116
+ }
117
+ async function U(e) {
118
+ await S(
119
+ async () => {
120
+ e.campaign._id ? await f.update(e.campaign._id, e) : await f.create(e), await p.read("COIN");
121
+ },
122
+ {
123
+ message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
124
+ successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
125
+ }
126
+ );
127
+ }
128
+ return z(async () => {
129
+ await O(async () => {
130
+ await p.read("COIN");
131
+ });
132
+ }), (e, t) => {
133
+ const c = m("FmPill"), r = m("FmPageHead"), B = m("FmSearch"), j = m("FmTable"), b = m("FmButton"), T = m("FmListItem"), E = m("FmList"), M = m("FmCard");
134
+ return d(), v(k, null, [
135
+ s(r, {
136
+ title: o(i)("connect.program.point.title"),
137
+ actions: o(g).length > 0 && o(C).isPremium ? [D] : [],
138
+ "onClick:action": t[0] || (t[0] = () => y())
139
+ }, {
140
+ title: h(() => [
141
+ n("div", le, [
142
+ n("span", ce, u(o(i)("connect.program.point.title")), 1),
143
+ s(c, { variant: "premium" })
144
+ ])
145
+ ]),
146
+ _: 1
147
+ }, 8, ["title", "actions"]),
148
+ n("div", me, [
149
+ s(B, {
150
+ modelValue: o(l).searchKey,
151
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => o(l).searchKey = a),
152
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
153
+ placeholder: "search",
154
+ collapsible: ""
155
+ }, null, 8, ["modelValue"]),
156
+ o(p).campaigns.point && o(p).campaigns.point.length > 0 ? (d(), v(k, { key: 0 }, [
157
+ n("div", pe, [
158
+ n("div", de, [
159
+ s(ne, {
160
+ label: `${o(i)("connect.common.location")}: `,
161
+ "right-icon": "keyboard_arrow_down",
162
+ modelValue: o(l).location,
163
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => o(l).location = a),
164
+ icon: "storefront",
165
+ "show-item-label": !0,
166
+ items: o(C).locationOptions
167
+ }, null, 8, ["label", "modelValue", "items"])
168
+ ]),
169
+ s(B, {
170
+ modelValue: o(l).searchKey,
171
+ "onUpdate:modelValue": t[3] || (t[3] = (a) => o(l).searchKey = a),
172
+ class: "xs:hidden sm:hidden",
173
+ placeholder: "search",
174
+ collapsible: ""
175
+ }, null, 8, ["modelValue"])
176
+ ]),
177
+ s(j, {
178
+ class: "xs:hidden sm:hidden",
179
+ "row-data": o(g),
180
+ "column-defs": R,
181
+ "search-value": o(l).searchKey,
182
+ "column-filter": [],
183
+ onRowClick: t[4] || (t[4] = (a) => y(a.original)),
184
+ "hide-footer": o(g).length < 10
185
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
186
+ s(E, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
187
+ default: h(() => [
188
+ (d(!0), v(k, null, G(o(g).filter(
189
+ (a) => a.name.toLowerCase().includes(o(l).searchKey.toLowerCase())
190
+ ), (a) => (d(), F(T, {
191
+ key: a._id.toString(),
192
+ onClick: (_) => y(a),
193
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
194
+ }, {
195
+ default: h(() => [
196
+ n("div", ue, [
197
+ n("div", fe, [
198
+ (d(), F(J(o($)(a))))
199
+ ]),
200
+ n("div", ge, [
201
+ n("div", ye, u(a.name), 1),
202
+ n("div", _e, u(o(N)(a)), 1)
203
+ ])
204
+ ]),
205
+ n("div", he, [
206
+ s(b, {
207
+ icon: "content_copy",
208
+ "icon-color": "neutral-gray-400",
209
+ variant: "tertiary",
210
+ onClick: async (_) => {
211
+ _.stopPropagation(), await P(a);
212
+ }
213
+ }, null, 8, ["onClick"]),
214
+ s(b, {
215
+ icon: "delete",
216
+ "icon-color": "neutral-gray-400",
217
+ variant: "tertiary",
218
+ onClick: (_) => (_.stopPropagation(), L(a))
219
+ }, null, 8, ["onClick"])
220
+ ])
221
+ ]),
222
+ _: 2
223
+ }, 1032, ["onClick"]))), 128))
224
+ ]),
225
+ _: 1
226
+ })
227
+ ], 64)) : (d(), F(M, {
228
+ key: 1,
229
+ variant: "outlined",
230
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
231
+ }, {
232
+ default: h(() => [
233
+ t[6] || (t[6] = n("img", {
234
+ src: Q,
235
+ class: "aspect-square w-[150px]"
236
+ }, null, -1)),
237
+ n("div", Ce, [
238
+ n("div", we, u(o(i)("connect.program.point.empty_state.title")), 1),
239
+ n("div", be, u(o(i)("connect.program.point.empty_state.description")), 1)
240
+ ]),
241
+ s(b, {
242
+ variant: "primary",
243
+ label: "Create point program",
244
+ disabled: !o(C).isPremium,
245
+ icon: "add",
246
+ onClick: t[5] || (t[5] = (a) => y())
247
+ }, null, 8, ["disabled"])
248
+ ]),
249
+ _: 1
250
+ })),
251
+ s(ie, {
252
+ ref_key: "sheetRef",
253
+ ref: w,
254
+ "onSubmit:modelValue": U
255
+ }, null, 512)
256
+ ])
257
+ ], 64);
258
+ };
259
+ }
260
+ });
261
+ export {
262
+ Ae as default
263
+ };