@feedmepos/mf-connect 0.1.81-prod → 0.1.83-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 (104) hide show
  1. package/dist/{Analytic-D4C4cuzb.js → Analytic-1OYb8L9c.js} +11 -11
  2. package/dist/{App-BKC-UTfE.js → App-oQ4_lEV2.js} +7 -7
  3. package/dist/{Bin-B23fmL4B.js → Bin-CQ8CYWAf.js} +8 -8
  4. package/dist/Broadcast-BLq5lca6.js +265 -0
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BEr6i1H7.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-0BKgyMxn.js} +6 -6
  6. package/dist/{Card-CjmquMQ8.js → Card-BbcMCzvO.js} +19 -19
  7. package/dist/{Collections-e324VpKx.js → Collections-0LOyEUoF.js} +8 -8
  8. package/dist/Credit-Crrc3MSu.js +259 -0
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bsz4DfR2.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-NtZKuPgi.js} +245 -241
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CLcPRqzn.js → EffectSheet.vue_vue_type_style_index_0_lang-DQaMkTla.js} +6 -6
  11. package/dist/Experience-DJiUmONI.js +258 -0
  12. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-CFEGc8v5.js} +1 -1
  13. package/dist/Game-ChHy4S4P.js +329 -0
  14. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BpNCfgI8.js → ImageInput.vue_vue_type_script_setup_true_lang-BBavh70d.js} +1 -1
  15. package/dist/{Index-Dq_dt4zZ.js → Index-CL5auUCN.js} +10 -10
  16. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-H5IjhmOA.js} +1 -1
  17. package/dist/{MainLayout-B1aJoR95.js → MainLayout-Bf4G5U5F.js} +1 -1
  18. package/dist/{Marketing-Z2EXHTDq.js → Marketing-cNwSm-dt.js} +6 -6
  19. package/dist/{Member-BZq2ZPU1.js → Member-fT7a7zFo.js} +11 -11
  20. package/dist/{MemberList-DamLQWem.js → MemberList-gEN36Erj.js} +27 -27
  21. package/dist/{MemberTransactions-BfGIKXWt.js → MemberTransactions-C4YgiUw-.js} +1 -1
  22. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BMLAp7P0.js → MessageInput.vue_vue_type_script_setup_true_lang-BNDrmYqp.js} +9 -9
  23. package/dist/Mission-Bz9P2pjX.js +333 -0
  24. package/dist/{Overview-DKNSKwjw.js → Overview-BG3Z7Daz.js} +19 -19
  25. package/dist/Point-BBeSJ5p5.js +261 -0
  26. package/dist/Promotion-VmaOESn2.js +390 -0
  27. package/dist/{Queue-CnHJt7BI.js → Queue-DKtUhOBh.js} +11 -11
  28. package/dist/{Record-asuDl00z.js → Record-Cb45m9I8.js} +9 -9
  29. package/dist/{Reward-BqemiBwU.js → Reward-D_uvCEMe.js} +16 -16
  30. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B98IW85o.js → RewardGroup.vue_vue_type_script_setup_true_lang-yUUMGEUJ.js} +12 -12
  31. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CVnNlpHa.js → RuleGroup.vue_vue_type_script_setup_true_lang-CIb7igvo.js} +15 -15
  32. package/dist/{Segment-Q86KMN-k.js → Segment-BJ8XUyeG.js} +25 -25
  33. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CCjoSgCt.js → SelectItems.vue_vue_type_script_setup_true_lang-ht4qyiQM.js} +2 -2
  34. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CttKxzGJ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DC6OQ7Zb.js} +12 -12
  35. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D_pLIyjo.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-i_BRgBRC.js} +4 -4
  36. package/dist/{Setting-D-H3wwqK.js → Setting-CS1wSxO9.js} +14 -14
  37. package/dist/{SettingAdvertisements-CLys7tUI.js → SettingAdvertisements-CWP7VthZ.js} +12 -12
  38. package/dist/{Store-CDTaq9Cl.js → Store-cy0uZfSE.js} +22 -22
  39. package/dist/{StoreRewards-BDbL39N5.js → StoreRewards-DDAvmlEn.js} +15 -15
  40. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BnagjBBu.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CevWXAb6.js} +20 -20
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Dk7yazat.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CPJ4fCu-.js} +1 -1
  42. package/dist/{Tier-BpDxFiVl.js → Tier-CUT_0eYp.js} +22 -22
  43. package/dist/{Title-BC8toEO3.js → Title-DcelZU7H.js} +20 -20
  44. package/dist/{Transaction-Ci7D5pSG.js → Transaction-CwcJnFIO.js} +2 -2
  45. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DfKxwLyD.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BuDS-vUd.js} +6 -6
  46. package/dist/{Voucher-vnKyiKiV.js → Voucher-z6o5rwFx.js} +162 -141
  47. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CCg8d72J.js → VoucherEditor.vue_vue_type_script_setup_true_lang-FVdeM5pH.js} +12 -12
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-JTpA5O1m.js → ZodTextField.vue_vue_type_script_setup_true_lang-BGuVeHZU.js} +2 -2
  49. package/dist/{app-1E5G1GpN.js → app-BUFlIAB5.js} +13926 -11655
  50. package/dist/app.js +1 -1
  51. package/dist/{business-BUpIHd4Z.js → business-CEL6Cxr7.js} +1 -1
  52. package/dist/{campaign-CZx-8rcc.js → campaign-Bz3O-DFr.js} +1 -1
  53. package/dist/{campaign-D_l_eCaG.js → campaign-CfB7ZWIg.js} +8 -8
  54. package/dist/{campaign.enum-DzMJ_QtT.js → campaign.enum-CCKHGvL9.js} +1 -1
  55. package/dist/{campaign.fn-BfLZqPyL.js → campaign.fn-Cu0sRSpP.js} +154 -154
  56. package/dist/{collectible.enum-CQB3E2Fm.js → collectible.enum-DeWSJ9OK.js} +1 -1
  57. package/dist/{collection.fn-DkJHn6mL.js → collection.fn-hPDt2qvz.js} +2 -2
  58. package/dist/{dto-DUY1vguv.js → dto-BKwcpb4T.js} +4 -4
  59. package/dist/{effect-CpXEk9Dk.js → effect-D070CPN_.js} +1 -1
  60. package/dist/{email-addresses-CVWW3Trx.js → email-addresses-C0fE6EMy.js} +2 -2
  61. package/dist/{export-1cM7yPV3.js → export-CG1ypExs.js} +3 -3
  62. package/dist/{helper-DZwCmt7C.js → helper-C9NBolO7.js} +1 -1
  63. package/dist/{index-BkpYy6m3.js → index-4gCsL8Hl.js} +6 -6
  64. package/dist/{index-Iwu0Pf7N.js → index-6rFsv3Yg.js} +1 -1
  65. package/dist/{index-DcCaSh1B.js → index-B30LtrWw.js} +1 -1
  66. package/dist/{index-DxGLhSm4.js → index-B613auFn.js} +1 -1
  67. package/dist/{index-CL_mVbcg.js → index-BGi7UFjn.js} +1 -1
  68. package/dist/{index-Cu69tDgg.js → index-BXSp11TE.js} +4 -4
  69. package/dist/{index-BWqzh2C4.js → index-CM-qkxMr.js} +11329 -10472
  70. package/dist/{index-UX1BjWKt.js → index-CZoTFXja.js} +3 -3
  71. package/dist/{index-CJQk_hJX.js → index-D7AT7i0e.js} +3 -3
  72. package/dist/{index-yPNsQag2.js → index-DDMr6_UT.js} +4 -4
  73. package/dist/{index-BhGXbniw.js → index-DGNPGZh4.js} +1 -1
  74. package/dist/{index-DikxFmIA.js → index-DLnZyneY.js} +1 -1
  75. package/dist/{index-CnqIH2O9.js → index-DcfdUpTw.js} +1 -1
  76. package/dist/{index.esm2017-DGkosyWY.js → index.esm2017-D0u5JnGx.js} +1 -1
  77. package/dist/{loading-BeO6W824.js → loading-Rn4BXFlo.js} +1 -1
  78. package/dist/{lodash-B5I3zXaY.js → lodash-Ds-QoR_N.js} +1 -1
  79. package/dist/{membership-CdkNnSzC.js → membership-BjklIT2n.js} +3 -3
  80. package/dist/{money-BmJpJ3UM.js → money-DMyZXL-e.js} +1 -1
  81. package/dist/{number-DNxJZHn4.js → number-Cyny8l0t.js} +1 -1
  82. package/dist/{objectid-Dz4U2FAo.js → objectid-Bs1Sha1n.js} +11 -11
  83. package/dist/{plugins-BWUWdHwy.js → plugins-BdQ8LmZm.js} +3 -3
  84. package/dist/{reward-Cg4x-YOj.js → reward-ZGs3fpY1.js} +1 -1
  85. package/dist/{rule-SBzFsmzN.js → rule-BH0ICJcx.js} +3 -3
  86. package/dist/{rule-builder-C12N5APu.js → rule-builder-D2sz7Xd9.js} +1 -1
  87. package/dist/template-_QJbP7yG.js +236 -0
  88. package/dist/{timezone-BdnFtiYJ.js → timezone-ulqdIvC-.js} +2 -2
  89. package/dist/{trigger-ZZWC4YWG.js → trigger-BiXZCT3j.js} +5 -5
  90. package/dist/{usePagination-Ds-cuHop.js → usePagination-Ck7buuI_.js} +1 -1
  91. package/dist/{user-DZARAXiI.js → user-BWTfkoD6.js} +1 -1
  92. package/dist/{vue-i18n-DOqqi883.js → vue-i18n-CmMTYitu.js} +2 -2
  93. package/dist/{xlsx-BQxGGmFn.js → xlsx-BF8PJO-P.js} +1 -1
  94. package/dist/{zod-D_MtMi4T.js → zod-C5iXeYjP.js} +1 -1
  95. package/package.json +2 -1
  96. package/dist/Broadcast-C9kxxthU.js +0 -232
  97. package/dist/Credit-7GDoQ6Ch.js +0 -225
  98. package/dist/Experience-_gbPd2cN.js +0 -224
  99. package/dist/Game-BotH7q2X.js +0 -299
  100. package/dist/Mission-DZBOFfZE.js +0 -303
  101. package/dist/Point-BTCdwbGb.js +0 -227
  102. package/dist/Promotion-BqWbXRrK.js +0 -358
  103. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  104. package/dist/template-B1S6b9tH.js +0 -188
@@ -1,299 +0,0 @@
1
- import { defineComponent as z, ref as k, computed as W, onMounted as J, resolveComponent as c, openBlock as f, createElementBlock as F, Fragment as S, createVNode as s, unref as o, withCtx as w, createElementVNode as n, toDisplayString as g, renderList as Q, createBlock as P, resolveDynamicComponent as X, h as m } from "vue";
2
- import { _ as Y } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as Z, components as x } from "@feedmepos/ui-library";
4
- import { a as ee, p as te } from "./plugins-BWUWdHwy.js";
5
- import { u as oe } from "./loading-BeO6W824.js";
6
- import { u as ae } from "./business-BUpIHd4Z.js";
7
- import { u as ne, c as C } from "./campaign-CZx-8rcc.js";
8
- import { a as E, b as K, g as se } from "./campaign-D_l_eCaG.js";
9
- import { _ as ie } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
10
- import { _ as re } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bsz4DfR2.js";
11
- import { u as le } from "./template-B1S6b9tH.js";
12
- import { u as ce } from "./vue-i18n-DOqqi883.js";
13
- import { _ as me } from "./SendCollectionSheet.vue_vue_type_script_setup_true_lang-CttKxzGJ.js";
14
- const de = { class: "flex items-center" }, ue = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, pe = { class: "px-24 flex flex-col gap-y-16" }, fe = { class: "flex items-center justify-between w-full" }, ge = { class: "flex gap-8 overflow-x-auto" }, ye = { class: "space-y-8" }, _e = { class: "flex w-full gap-4 items-center" }, he = { class: "space-y-4" }, we = { class: "fm-typo-en-body-lg-600" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ve = { class: "flex flex-col gap-16 text-center" }, be = { class: "fm-typo-en-title-sm-800" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Te = /* @__PURE__ */ z({
15
- __name: "Game",
16
- setup(Fe) {
17
- const { t: d } = ce(), M = {
18
- label: d("connect.program.common.actions.create", {
19
- type: d("connect.program.game.title").toLowerCase()
20
- }),
21
- value: "create",
22
- isPrimary: !0,
23
- prependIcon: "add"
24
- }, V = Z(), U = le("GAME", V), y = ae(), u = ne(), { global: G, minor: L } = oe, l = k({
25
- searchKey: "",
26
- location: []
27
- });
28
- function T(e) {
29
- const t = l.value.location;
30
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((i) => {
31
- var r;
32
- return (r = e == null ? void 0 : e.targetLocation) == null ? void 0 : r.includes(i);
33
- }) : e.targetLocation.includes(t);
34
- }
35
- const _ = W(
36
- () => u.campaigns.token.filter((e) => T(e))
37
- ), I = [
38
- {
39
- header: "Program title",
40
- accessorKey: "name",
41
- // accessorFn: (v) => v.name,
42
- cell(e) {
43
- return m("div", { class: "flex items-center justify-between gap-4" }, [
44
- m("div", { class: "flex items-center" }, [
45
- m(
46
- x.FmTooltip,
47
- {
48
- content: e.row.original._id,
49
- onClick: (t) => {
50
- t.stopPropagation(), ee(e.row.original._id);
51
- }
52
- },
53
- [
54
- m(x.FmIcon, {
55
- name: "info",
56
- outline: !0,
57
- size: "sm"
58
- })
59
- ]
60
- )
61
- ]),
62
- m("div", { class: "flex-1" }, e.row.original.name)
63
- ]);
64
- }
65
- },
66
- {
67
- header: "Status",
68
- accessorFn: (e) => se(e),
69
- cell(e) {
70
- return E(e.row.original);
71
- }
72
- },
73
- {
74
- header: "Summary",
75
- accessorFn: (e) => K(e)
76
- //v.effect,
77
- },
78
- {
79
- header: "Token received",
80
- accessorFn: (e) => {
81
- var t;
82
- return ((t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.currentReceive) ?? 0;
83
- }
84
- },
85
- {
86
- header: "Actions",
87
- cell(e) {
88
- return m("div", { class: "flex items-center gap-8" }, [
89
- m(x.FmButton, {
90
- variant: "tertiary",
91
- icon: "send",
92
- iconColor: "neutral-gray-400",
93
- onClick: (t) => {
94
- t.stopPropagation(), j(e.row.original);
95
- }
96
- }),
97
- m(x.FmButton, {
98
- variant: "tertiary",
99
- icon: "delete",
100
- iconColor: "neutral-gray-400",
101
- onClick: (t) => {
102
- t.stopPropagation(), B(e.row.original);
103
- }
104
- })
105
- ]);
106
- }
107
- }
108
- ], A = k(), R = k();
109
- async function B(e) {
110
- await te.remove(`Are you sure you want to remove ${e.name}?`) && await L(
111
- async () => {
112
- await C.delete(e._id), await u.read("GAME");
113
- },
114
- {
115
- message: `Removing ${e.name}`,
116
- successMessage: `Removed ${e.name} successfully`
117
- }
118
- );
119
- }
120
- async function h(e) {
121
- e ? await t() : U.open(async (i) => {
122
- await t(i);
123
- });
124
- async function t(i) {
125
- var r;
126
- (r = A.value) == null || r.showSheet(
127
- !0,
128
- "GAME",
129
- e ? await C.readById(e._id) : void 0,
130
- i
131
- );
132
- }
133
- }
134
- async function D(e) {
135
- var t, i, r;
136
- e.campaign._id && ((r = (i = (t = e.campaign) == null ? void 0 : t.game) == null ? void 0 : i.rewards) != null && r.some(
137
- (p) => p.type === "VOUCHER"
138
- )) && await new Promise((p) => {
139
- V.open({
140
- title: "Confirmation",
141
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
142
- primaryActions: { text: "Update all", close: !0 },
143
- secondaryActions: { text: "Update future only", close: !0 }
144
- }).onPrimary(async () => {
145
- e.updateCollections = !0, p();
146
- }).onSecondary(async () => {
147
- p();
148
- });
149
- }), await L(
150
- async () => {
151
- e.campaign._id ? await C.update(e.campaign._id, e) : await C.create(e), await u.read("GAME");
152
- },
153
- {
154
- message: `${e.campaign._id ? "Updating" : "Creating"} game program`,
155
- successMessage: `Game program ${e.campaign._id ? "updated" : "created"} successfully`
156
- }
157
- );
158
- }
159
- function j(e) {
160
- var t;
161
- (t = R.value) == null || t.showSheet({
162
- campaign: e
163
- });
164
- }
165
- return J(async () => {
166
- await G(async () => {
167
- await u.read("GAME"), await y.readPremium();
168
- });
169
- }), (e, t) => {
170
- const i = c("FmPill"), r = c("FmPageHead"), v = c("FmSearch"), p = c("FmTable"), $ = c("FmButton"), H = c("FmListItem"), N = c("FmList"), O = c("FmCard");
171
- return f(), F(S, null, [
172
- s(r, {
173
- actions: o(_).length > 0 && o(y).isPremium ? [M] : [],
174
- "onClick:action": t[0] || (t[0] = () => h())
175
- }, {
176
- title: w(() => [
177
- n("div", de, [
178
- n("span", ue, g(o(d)("connect.program.game.title")), 1),
179
- s(i, { variant: "premium" })
180
- ])
181
- ]),
182
- _: 1
183
- }, 8, ["actions"]),
184
- n("div", pe, [
185
- s(v, {
186
- modelValue: o(l).searchKey,
187
- "onUpdate:modelValue": t[1] || (t[1] = (a) => o(l).searchKey = a),
188
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
189
- placeholder: "search",
190
- collapsible: ""
191
- }, null, 8, ["modelValue"]),
192
- o(u).campaigns.token && o(u).campaigns.token.length > 0 ? (f(), F(S, { key: 0 }, [
193
- n("div", fe, [
194
- n("div", ge, [
195
- s(ie, {
196
- label: `${o(d)("connect.common.location")}: `,
197
- "right-icon": "keyboard_arrow_down",
198
- modelValue: o(l).location,
199
- "onUpdate:modelValue": t[2] || (t[2] = (a) => o(l).location = a),
200
- icon: "storefront",
201
- "show-item-label": !0,
202
- items: o(y).locationOptions
203
- }, null, 8, ["label", "modelValue", "items"])
204
- ]),
205
- s(v, {
206
- modelValue: o(l).searchKey,
207
- "onUpdate:modelValue": t[3] || (t[3] = (a) => o(l).searchKey = a),
208
- class: "xs:hidden sm:hidden",
209
- placeholder: "search",
210
- collapsible: ""
211
- }, null, 8, ["modelValue"])
212
- ]),
213
- s(p, {
214
- class: "xs:hidden sm:hidden",
215
- "row-data": o(_),
216
- "column-defs": I,
217
- "search-value": o(l).searchKey,
218
- "column-filter": [],
219
- onRowClick: t[4] || (t[4] = (a) => h(a.original)),
220
- "hide-footer": o(_).length < 10
221
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
222
- s(N, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
223
- default: w(() => [
224
- (f(!0), F(S, null, Q(o(_).filter(
225
- (a) => a.name.toLowerCase().includes(o(l).searchKey.toLowerCase())
226
- ), (a) => (f(), P(H, {
227
- key: a._id.toString(),
228
- onClick: (b) => h(a),
229
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
230
- }, {
231
- default: w(() => {
232
- var b;
233
- return [
234
- n("div", ye, [
235
- n("div", _e, [
236
- (f(), P(X(o(E)(a))))
237
- ]),
238
- n("div", he, [
239
- n("div", we, g(a.name), 1),
240
- n("div", xe, g(o(K)(a)), 1)
241
- ]),
242
- n("div", Ce, g(o(d)("connect.program.game.token_received", {
243
- count: ((b = e.pf_collectible) == null ? void 0 : b.currentReceive) ?? 0
244
- })), 1)
245
- ]),
246
- s($, {
247
- icon: "delete",
248
- "icon-color": "neutral-gray-400",
249
- variant: "tertiary",
250
- onClick: (q) => (q.stopPropagation(), B(a))
251
- }, null, 8, ["onClick"])
252
- ];
253
- }),
254
- _: 2
255
- }, 1032, ["onClick"]))), 128))
256
- ]),
257
- _: 1
258
- })
259
- ], 64)) : (f(), P(O, {
260
- key: 1,
261
- variant: "outlined",
262
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
263
- }, {
264
- default: w(() => [
265
- t[6] || (t[6] = n("img", {
266
- src: Y,
267
- class: "aspect-square w-[150px]"
268
- }, null, -1)),
269
- n("div", ve, [
270
- n("div", be, g(o(d)("connect.program.game.empty_state.title")), 1),
271
- n("div", ke, g(o(d)("connect.program.game.empty_state.description")), 1)
272
- ]),
273
- s($, {
274
- variant: "primary",
275
- label: "Create game program",
276
- icon: "add",
277
- disabled: !o(y).isPremium,
278
- onClick: t[5] || (t[5] = (a) => h())
279
- }, null, 8, ["disabled"])
280
- ]),
281
- _: 1
282
- })),
283
- s(re, {
284
- ref_key: "sheetRef",
285
- ref: A,
286
- "onSubmit:modelValue": D
287
- }, null, 512),
288
- s(me, {
289
- ref_key: "sendCollectionSheetRef",
290
- ref: R
291
- }, null, 512)
292
- ])
293
- ], 64);
294
- };
295
- }
296
- });
297
- export {
298
- Te as default
299
- };
@@ -1,303 +0,0 @@
1
- import { defineComponent as z, ref as x, computed as W, h as m, onMounted as G, resolveComponent as d, openBlock as u, createElementBlock as b, Fragment as C, createVNode as r, unref as t, createElementVNode as s, withCtx as v, renderList as J, createBlock as S, resolveDynamicComponent as Q, toDisplayString as f } from "vue";
2
- import { _ as X } from "./campaign-CpzFl8Vr.js";
3
- import { u as Y } from "./loading-BeO6W824.js";
4
- import { g as Z, a as B, b as P } from "./campaign-D_l_eCaG.js";
5
- import { a as ee, p as oe } from "./plugins-BWUWdHwy.js";
6
- import { u as te } from "./business-BUpIHd4Z.js";
7
- import { u as ne, c as _ } from "./campaign-CZx-8rcc.js";
8
- import { useDialog as ae, components as h } from "@feedmepos/ui-library";
9
- import { _ as se } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
10
- import { u as ie } from "./template-B1S6b9tH.js";
11
- import { _ as re } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bsz4DfR2.js";
12
- import { s as ce } from "./index-CuvNtC_M.js";
13
- import { u as le } from "./vue-i18n-DOqqi883.js";
14
- import { _ as me } from "./SendCollectionSheet.vue_vue_type_script_setup_true_lang-CttKxzGJ.js";
15
- const de = { class: "px-24 flex flex-col gap-y-16" }, pe = { class: "flex items-center justify-between w-full" }, ue = { class: "flex gap-8 overflow-x-auto" }, fe = { class: "space-y-8" }, ge = { class: "flex w-full gap-4 items-center" }, ye = { class: "space-y-4" }, _e = { class: "fm-typo-en-body-lg-600" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, we = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xe = { class: "flex flex-col gap-16 text-center" }, be = { class: "fm-typo-en-title-sm-800" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ue = /* @__PURE__ */ z({
16
- __name: "Mission",
17
- setup(ve) {
18
- const { t: n } = le(), K = {
19
- label: n("connect.program.common.actions.create", {
20
- type: n("connect.program.mission.title").toLowerCase()
21
- }),
22
- value: "create",
23
- isPrimary: !0,
24
- prependIcon: "add"
25
- }, F = ae(), R = ie("MISSION", F), A = te(), p = ne(), { global: N, minor: k } = Y, c = x({
26
- searchKey: "",
27
- location: []
28
- });
29
- function O(e) {
30
- const o = c.value.location;
31
- return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((i) => {
32
- var l;
33
- return (l = e == null ? void 0 : e.targetLocation) == null ? void 0 : l.includes(i);
34
- }) : e.targetLocation.includes(o);
35
- }
36
- const g = W(
37
- () => p.campaigns.mission.filter((e) => O(e))
38
- ), U = [
39
- {
40
- header: n("connect.program.common.table.title"),
41
- accessorKey: "name",
42
- // accessorFn: (v) => v.name,
43
- cell(e) {
44
- return m("div", { class: "flex items-center justify-between gap-4" }, [
45
- m("div", { class: "flex items-center" }, [
46
- m(
47
- h.FmTooltip,
48
- {
49
- content: e.row.original._id,
50
- onClick: (o) => {
51
- o.stopPropagation(), ee(e.row.original._id);
52
- }
53
- },
54
- [
55
- m(h.FmIcon, {
56
- name: "info",
57
- outline: !0,
58
- size: "sm"
59
- })
60
- ]
61
- )
62
- ]),
63
- m("div", { class: "flex-1" }, e.row.original.name)
64
- ]);
65
- }
66
- },
67
- {
68
- header: n("connect.campaign.mission.type"),
69
- accessorFn: (e) => ce(e.mission.type)
70
- //v.effect,
71
- },
72
- {
73
- header: n("connect.program.common.table.status"),
74
- accessorFn: (e) => Z(e),
75
- cell(e) {
76
- return B(e.row.original);
77
- }
78
- },
79
- {
80
- header: n("connect.program.common.table.summary"),
81
- accessorFn: (e) => P(e)
82
- //v.effect,
83
- },
84
- {
85
- header: n("connect.campaign.mission.received"),
86
- accessorFn: (e) => {
87
- var o;
88
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
89
- }
90
- },
91
- {
92
- header: n("connect.program.common.table.actions"),
93
- cell(e) {
94
- return m("div", { class: "flex items-center gap-8" }, [
95
- m(h.FmButton, {
96
- variant: "tertiary",
97
- icon: "send",
98
- iconColor: "neutral-gray-400",
99
- onClick: (o) => {
100
- o.stopPropagation(), $(e.row.original);
101
- }
102
- }),
103
- m(h.FmButton, {
104
- variant: "tertiary",
105
- icon: "delete",
106
- iconColor: "neutral-gray-400",
107
- onClick: (o) => {
108
- o.stopPropagation(), V(e.row.original);
109
- }
110
- })
111
- ]);
112
- }
113
- }
114
- ], I = x(), L = x();
115
- async function V(e) {
116
- await oe.remove(
117
- n("connect.program.common.remove.confirm", { name: e.name })
118
- ) && await k(
119
- async () => {
120
- await _.delete(e._id), await p.read("MISSION");
121
- },
122
- {
123
- message: n("connect.program.common.remove.removing", { name: e.name }),
124
- successMessage: n("connect.program.common.remove.removed", {
125
- name: e.name
126
- })
127
- }
128
- );
129
- }
130
- async function y(e) {
131
- e ? await o() : R.open(async (i) => {
132
- await o(i);
133
- });
134
- async function o(i) {
135
- var l;
136
- (l = I.value) == null || l.showSheet(
137
- !0,
138
- "MISSION",
139
- e ? await _.readById(e._id) : void 0,
140
- i
141
- );
142
- }
143
- }
144
- async function T(e) {
145
- e.campaign._id && e.campaign.rewards.some((o) => o.type === "VOUCHER") && await new Promise((o) => {
146
- F.open({
147
- title: "Confirmation",
148
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
149
- primaryActions: { text: "Update all", close: !0 },
150
- secondaryActions: { text: "Update future only", close: !0 }
151
- }).onPrimary(async () => {
152
- var i;
153
- e.updateCollections = !0, (i = window.top) == null || i.postMessage("updateAllVoucher", "*"), o();
154
- }).onSecondary(async () => {
155
- o();
156
- });
157
- }), await k(
158
- async () => {
159
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await p.read("MISSION");
160
- },
161
- {
162
- message: n(
163
- e.campaign._id ? "connect.program.common.update.updating" : "connect.program.common.update.creating",
164
- { type: "Mission" }
165
- ),
166
- successMessage: n("connect.program.common.update.success", {
167
- type: "Mission",
168
- action: e.campaign._id ? "updated" : "created"
169
- })
170
- }
171
- );
172
- }
173
- function $(e) {
174
- var o;
175
- (o = L.value) == null || o.showSheet({
176
- campaign: e
177
- });
178
- }
179
- return G(async () => {
180
- await N(async () => {
181
- await p.read("MISSION"), console.log(g);
182
- });
183
- }), (e, o) => {
184
- const i = d("FmPageHead"), l = d("FmSearch"), D = d("FmTable"), M = d("FmButton"), j = d("FmListItem"), E = d("FmList"), H = d("FmCard");
185
- return u(), b(C, null, [
186
- r(i, {
187
- title: t(n)("connect.campaign.mission.title"),
188
- actions: t(g).length > 0 ? [K] : [],
189
- "onClick:action": o[0] || (o[0] = () => y())
190
- }, null, 8, ["title", "actions"]),
191
- s("div", de, [
192
- r(l, {
193
- modelValue: t(c).searchKey,
194
- "onUpdate:modelValue": o[1] || (o[1] = (a) => t(c).searchKey = a),
195
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
196
- placeholder: t(n)("connect.program.common.search"),
197
- collapsible: ""
198
- }, null, 8, ["modelValue", "placeholder"]),
199
- t(p).campaigns.mission && t(p).campaigns.mission.length > 0 ? (u(), b(C, { key: 0 }, [
200
- s("div", pe, [
201
- s("div", ue, [
202
- r(se, {
203
- label: `${t(n)("connect.program.common.location")}: `,
204
- "right-icon": "keyboard_arrow_down",
205
- modelValue: t(c).location,
206
- "onUpdate:modelValue": o[2] || (o[2] = (a) => t(c).location = a),
207
- icon: "storefront",
208
- "show-item-label": !0,
209
- items: t(A).locationOptions
210
- }, null, 8, ["label", "modelValue", "items"])
211
- ]),
212
- r(l, {
213
- modelValue: t(c).searchKey,
214
- "onUpdate:modelValue": o[3] || (o[3] = (a) => t(c).searchKey = a),
215
- class: "xs:hidden sm:hidden",
216
- placeholder: "search",
217
- collapsible: ""
218
- }, null, 8, ["modelValue"])
219
- ]),
220
- r(D, {
221
- class: "xs:hidden sm:hidden",
222
- "row-data": t(g),
223
- "column-defs": U,
224
- "search-value": t(c).searchKey,
225
- "column-filter": [],
226
- onRowClick: o[4] || (o[4] = (a) => y(a.original)),
227
- "hide-footer": t(g).length < 10
228
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
229
- r(E, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
230
- default: v(() => [
231
- (u(!0), b(C, null, J(t(g).filter(
232
- (a) => a.name.toLowerCase().includes(t(c).searchKey.toLowerCase())
233
- ), (a) => (u(), S(j, {
234
- key: a._id.toString(),
235
- onClick: (w) => y(a),
236
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
237
- }, {
238
- default: v(() => {
239
- var w;
240
- return [
241
- s("div", fe, [
242
- s("div", ge, [
243
- (u(), S(Q(t(B)(a))))
244
- ]),
245
- s("div", ye, [
246
- s("div", _e, f(a.name), 1),
247
- s("div", he, f(t(P)(a)), 1)
248
- ]),
249
- s("div", we, f(t(n)("connect.campaign.mission.received")) + " : " + f(((w = a == null ? void 0 : a.pf_collectible) == null ? void 0 : w.currentReceive) ?? 0), 1)
250
- ]),
251
- r(M, {
252
- icon: "delete",
253
- "icon-color": "neutral-gray-400",
254
- variant: "tertiary",
255
- onClick: (q) => (q.stopPropagation(), V(a))
256
- }, null, 8, ["onClick"])
257
- ];
258
- }),
259
- _: 2
260
- }, 1032, ["onClick"]))), 128))
261
- ]),
262
- _: 1
263
- })
264
- ], 64)) : (u(), S(H, {
265
- key: 1,
266
- variant: "outlined",
267
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
268
- }, {
269
- default: v(() => [
270
- o[6] || (o[6] = s("img", {
271
- src: X,
272
- class: "aspect-square w-[150px]"
273
- }, null, -1)),
274
- s("div", xe, [
275
- s("div", be, f(t(n)("connect.campaign.mission.createProgram")), 1),
276
- s("div", Ce, f(t(n)("connect.campaign.mission.description")), 1)
277
- ]),
278
- r(M, {
279
- variant: "primary",
280
- label: t(n)("connect.campaign.mission.create"),
281
- icon: "add",
282
- onClick: o[5] || (o[5] = (a) => y())
283
- }, null, 8, ["label"])
284
- ]),
285
- _: 1
286
- })),
287
- r(re, {
288
- ref_key: "sheetRef",
289
- ref: I,
290
- "onSubmit:modelValue": T
291
- }, null, 512),
292
- r(me, {
293
- ref_key: "sendCollectionSheetRef",
294
- ref: L
295
- }, null, 512)
296
- ])
297
- ], 64);
298
- };
299
- }
300
- });
301
- export {
302
- Ue as default
303
- };