@feedmepos/mf-connect 0.1.82-prod → 0.1.84-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-D850nvXy.js → Analytic---kwMsJh.js} +11 -11
  2. package/dist/{App-Dwp2SQFt.js → App-Dz1QFoj1.js} +7 -7
  3. package/dist/{Bin-t3dMVk18.js → Bin-CRYowBLt.js} +8 -8
  4. package/dist/Broadcast-C8_buAc0.js +265 -0
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CFa7asTL.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CYY2JwZP.js} +6 -6
  6. package/dist/{Card-DueuT99c.js → Card-DePqhNID.js} +19 -19
  7. package/dist/{Collections-D50oEyeZ.js → Collections-RwrRqA0j.js} +8 -8
  8. package/dist/Credit-C8PUzFqm.js +259 -0
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DysfUOSp.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CgUd84nn.js} +245 -241
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-L0-aFhRw.js → EffectSheet.vue_vue_type_style_index_0_lang-DnPaODeO.js} +6 -6
  11. package/dist/Experience-DhtTPHu-.js +258 -0
  12. package/dist/{FileSaver.min-DH3eS7yi.js → FileSaver.min-BWjfwA9o.js} +1 -1
  13. package/dist/Game-CYj7LBJv.js +329 -0
  14. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BIKcbIag.js → ImageInput.vue_vue_type_script_setup_true_lang-CUltj6id.js} +1 -1
  15. package/dist/{Index-BucLJQqP.js → Index-D8AcIz6r.js} +10 -10
  16. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CIoZurPE.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CpUmN6FR.js} +1 -1
  17. package/dist/{MainLayout-DYGrSfgc.js → MainLayout-DkxA5idl.js} +1 -1
  18. package/dist/{Marketing-CsAIdNjF.js → Marketing-4h6RtJ9w.js} +6 -6
  19. package/dist/{Member-D4HF_VGN.js → Member-Mi1lEgxG.js} +11 -11
  20. package/dist/{MemberList-CPoA4ovd.js → MemberList-Cd7SXI7d.js} +27 -27
  21. package/dist/{MemberTransactions-AMv9NeIb.js → MemberTransactions-aM_CTN3-.js} +1 -1
  22. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DhhSwnK0.js → MessageInput.vue_vue_type_script_setup_true_lang-LkKXfpQ8.js} +9864 -9759
  23. package/dist/Mission-BbZXMfe2.js +333 -0
  24. package/dist/{Overview-ByO2p2Wx.js → Overview-tjz1RxkD.js} +19 -19
  25. package/dist/Point-DqSlh8lv.js +261 -0
  26. package/dist/Promotion-FNZOyKDM.js +390 -0
  27. package/dist/{Queue-BD29Mmbf.js → Queue-BGr-V2dv.js} +11 -11
  28. package/dist/{Record-CNLiN6YR.js → Record-YSp6Ra7G.js} +9 -9
  29. package/dist/{Reward-Ceo3M1yD.js → Reward-CfWeF_XY.js} +16 -16
  30. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJWQEL9W.js → RewardGroup.vue_vue_type_script_setup_true_lang-BdT11T69.js} +12 -12
  31. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CWuWGs6r.js → RuleGroup.vue_vue_type_script_setup_true_lang-D7pC5cM-.js} +15 -15
  32. package/dist/{Segment-BOQUlP-m.js → Segment-B8kCEI6G.js} +25 -25
  33. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BcXeiz0p.js → SelectItems.vue_vue_type_script_setup_true_lang-iK1tNyZN.js} +2 -2
  34. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CJ--FC-i.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cd9_IVCK.js} +12 -12
  35. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-9emjG6Nc.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CDNCuGzR.js} +4 -4
  36. package/dist/{Setting-CWapXD31.js → Setting-DRK1-tm8.js} +14 -14
  37. package/dist/{SettingAdvertisements-QEf2eyem.js → SettingAdvertisements-CPBFpIuM.js} +12 -12
  38. package/dist/{Store-Bfm2olbH.js → Store-CF55C7mv.js} +22 -22
  39. package/dist/{StoreRewards-DNDkyxxn.js → StoreRewards-hF8rcPIS.js} +15 -15
  40. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-zKLbY4Qb.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BYugGARP.js} +20 -20
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D3-wIOQ7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BSOpqCbD.js} +1 -1
  42. package/dist/{Tier-uC45o2AK.js → Tier-RKT4ClDE.js} +22 -22
  43. package/dist/{Title-zDjlDJCB.js → Title-vFFh4BdE.js} +20 -20
  44. package/dist/{Transaction-Bo9FEjMQ.js → Transaction-BHeWenhg.js} +2 -2
  45. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BR5F0bWS.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-iKbV9AAj.js} +6 -6
  46. package/dist/{Voucher-B7BTa4Vt.js → Voucher-C6ywMiLW.js} +162 -141
  47. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CjrjJW7x.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DHlpDIkL.js} +12 -12
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DeAkLgaX.js → ZodTextField.vue_vue_type_script_setup_true_lang-BHhDgBiv.js} +2 -2
  49. package/dist/{app-CkUBXnib.js → app-P5wZqN7K.js} +961 -875
  50. package/dist/app.js +1 -1
  51. package/dist/{business-C8P05bjQ.js → business-B35Wh7fa.js} +1 -1
  52. package/dist/{campaign-DcLhSQVQ.js → campaign-CdGwiufg.js} +1 -1
  53. package/dist/{campaign-CyYAvl3p.js → campaign-CxeRf6Kf.js} +8 -8
  54. package/dist/{campaign.enum-h6B-mP82.js → campaign.enum-G61yFqyz.js} +1 -1
  55. package/dist/{campaign.fn-CStjDAoU.js → campaign.fn-DBGVgh7k.js} +128 -128
  56. package/dist/{collectible.enum-DT-wjl-a.js → collectible.enum-CmO4wF4e.js} +1 -1
  57. package/dist/{collection.fn-14o3RW2e.js → collection.fn-BZtvtGPA.js} +2 -2
  58. package/dist/{dto-Bv09Baex.js → dto-BmjMkp1Z.js} +4 -4
  59. package/dist/{effect-CF0s7QWQ.js → effect-eEYO0AvV.js} +1 -1
  60. package/dist/{email-addresses-B5qrHbxg.js → email-addresses-sloQNBJG.js} +2 -2
  61. package/dist/{export-B6nvdBmg.js → export-CmGCO7dx.js} +3 -3
  62. package/dist/{helper-B4-2ut7E.js → helper-CW7xMPjC.js} +1 -1
  63. package/dist/{index-D5xt8OjL.js → index-639mCQ6J.js} +1 -1
  64. package/dist/{index-CR8brl_k.js → index-B5KXKlhV.js} +1 -1
  65. package/dist/{index-DG_Ej3ec.js → index-B6dK27Ud.js} +3 -3
  66. package/dist/{index-B-y0UTZw.js → index-BD00XsAg.js} +6 -6
  67. package/dist/{index-DesSizn4.js → index-C7X2wMHZ.js} +3 -3
  68. package/dist/{index-BebGg-0n.js → index-CK4IRu1N.js} +1 -1
  69. package/dist/{index-Ct90ybe0.js → index-CLoMa41m.js} +1 -1
  70. package/dist/{index-DVb99_67.js → index-CmdjTQSX.js} +1 -1
  71. package/dist/{index-DzQjej5Y.js → index-CqtPReHP.js} +4 -4
  72. package/dist/{index-DIQ2MyWF.js → index-DCzBwaDb.js} +4 -4
  73. package/dist/{index-HhVIn4Bn.js → index-DF11MBlC.js} +1 -1
  74. package/dist/{index-DRX9TTMn.js → index-DzgPdiHK.js} +3 -3
  75. package/dist/{index-XDg25M5a.js → index-INxinXgP.js} +1 -1
  76. package/dist/{index.esm2017-1A2eV8x_.js → index.esm2017-CFPCtvwG.js} +1 -1
  77. package/dist/{loading-B0_BwPgo.js → loading-D77DfZBP.js} +1 -1
  78. package/dist/{lodash-DxIglhqk.js → lodash-B8BR1gR7.js} +1 -1
  79. package/dist/{membership-H_whlbUP.js → membership-B5p556SC.js} +3 -3
  80. package/dist/{money-DEE8QW6m.js → money-CRPmLrb_.js} +1 -1
  81. package/dist/{number-BmN5A4Cu.js → number-bJoTVZNO.js} +1 -1
  82. package/dist/objectid-DCHsjF9h.js +145 -0
  83. package/dist/{plugins-DTrOHd7d.js → plugins-DQdMt5nO.js} +3 -3
  84. package/dist/{reward-CsJhkkaT.js → reward-DeTD3TQ1.js} +1 -1
  85. package/dist/{rule-ByMxYH4c.js → rule-DSuuXRg3.js} +3 -3
  86. package/dist/{rule-builder-DwGwUlV1.js → rule-builder-D8rRlIOO.js} +1 -1
  87. package/dist/template-HTjC1_ed.js +236 -0
  88. package/dist/{timezone-Bpe-fhwZ.js → timezone-CWcYmamV.js} +2 -2
  89. package/dist/{trigger-CEprJYiD.js → trigger-BZa0mW7v.js} +5 -5
  90. package/dist/{usePagination-Du6qS5aj.js → usePagination-Abs8KbO-.js} +1 -1
  91. package/dist/{user-Be8HNWuo.js → user-B94fPQnM.js} +1 -1
  92. package/dist/{vue-i18n-fg0FtbNR.js → vue-i18n-D5HHFPRa.js} +296 -296
  93. package/dist/{xlsx-CSQJ3YWk.js → xlsx-BsqWVudt.js} +1 -1
  94. package/dist/{zod-BB7zZ5ec.js → zod-Bp867gMI.js} +1 -1
  95. package/package.json +1 -1
  96. package/dist/Broadcast-DORnkgZc.js +0 -232
  97. package/dist/Credit-CIWSRGuJ.js +0 -225
  98. package/dist/Experience-qABtjxNP.js +0 -224
  99. package/dist/Game-D67q1zKd.js +0 -299
  100. package/dist/Mission-CRinLn7e.js +0 -303
  101. package/dist/Point-4JqzbNgP.js +0 -227
  102. package/dist/Promotion-DlWVF6hF.js +0 -358
  103. package/dist/objectid-B8LZDZOt.js +0 -145
  104. package/dist/template-Bdwy6QXF.js +0 -188
@@ -0,0 +1,333 @@
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-D77DfZBP.js";
4
+ import { g as ee, a as D, b as K } from "./campaign-CxeRf6Kf.js";
5
+ import { c as oe, p as te, u as ne } from "./template-HTjC1_ed.js";
6
+ import { a as ae, p as ie } from "./plugins-DQdMt5nO.js";
7
+ import { u as se } from "./business-B35Wh7fa.js";
8
+ import { u as re, c as y } from "./campaign-CdGwiufg.js";
9
+ import { useDialog as ce, components as _ } from "@feedmepos/ui-library";
10
+ import { _ as le } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
+ import { _ as me } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CgUd84nn.js";
12
+ import { s as de } from "./index-CuvNtC_M.js";
13
+ import { u as pe } from "./vue-i18n-D5HHFPRa.js";
14
+ import { _ as ue } from "./SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cd9_IVCK.js";
15
+ 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" }, je = /* @__PURE__ */ W({
16
+ __name: "Mission",
17
+ setup(Ie) {
18
+ const { t: a } = pe(), N = {
19
+ label: a("connect.program.common.actions.create", {
20
+ type: a("connect.program.mission.title").toLowerCase()
21
+ }),
22
+ value: "create",
23
+ isPrimary: !0,
24
+ prependIcon: "add"
25
+ }, L = ce(), O = ne("MISSION", L), R = se(), p = re(), { global: A, minor: V } = Z, l = v({
26
+ searchKey: "",
27
+ location: []
28
+ });
29
+ function U(e) {
30
+ const o = l.value.location;
31
+ return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((s) => {
32
+ var r;
33
+ return (r = e == null ? void 0 : e.targetLocation) == null ? void 0 : r.includes(s);
34
+ }) : e.targetLocation.includes(o);
35
+ }
36
+ const f = G(
37
+ () => p.campaigns.mission.filter((e) => U(e))
38
+ ), T = [
39
+ {
40
+ header: a("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
+ _.FmTooltip,
48
+ {
49
+ content: e.row.original._id,
50
+ onClick: (o) => {
51
+ o.stopPropagation(), ae(e.row.original._id);
52
+ }
53
+ },
54
+ [
55
+ m(_.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: a("connect.campaign.mission.type"),
69
+ accessorFn: (e) => de(e.mission.type)
70
+ //v.effect,
71
+ },
72
+ {
73
+ header: a("connect.program.common.table.status"),
74
+ accessorFn: (e) => ee(e),
75
+ cell(e) {
76
+ return D(e.row.original);
77
+ }
78
+ },
79
+ {
80
+ header: a("connect.program.common.table.summary"),
81
+ accessorFn: (e) => K(e)
82
+ //v.effect,
83
+ },
84
+ {
85
+ header: a("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: a("connect.program.common.table.actions"),
93
+ cell(e) {
94
+ return m("div", { class: "flex items-center gap-8" }, [
95
+ m(_.FmButton, {
96
+ variant: "tertiary",
97
+ icon: "content_copy",
98
+ iconColor: "neutral-gray-400",
99
+ onClick: async (o) => {
100
+ o.stopPropagation(), await P(e.row.original);
101
+ }
102
+ }),
103
+ m(_.FmButton, {
104
+ variant: "tertiary",
105
+ icon: "send",
106
+ iconColor: "neutral-gray-400",
107
+ onClick: (o) => {
108
+ o.stopPropagation(), j(e.row.original);
109
+ }
110
+ }),
111
+ m(_.FmButton, {
112
+ variant: "tertiary",
113
+ icon: "delete",
114
+ iconColor: "neutral-gray-400",
115
+ onClick: (o) => {
116
+ o.stopPropagation(), M(e.row.original);
117
+ }
118
+ })
119
+ ]);
120
+ }
121
+ }
122
+ ], w = v(), B = v();
123
+ async function M(e) {
124
+ await ie.remove(
125
+ a("connect.program.common.remove.confirm", { name: e.name })
126
+ ) && await V(
127
+ async () => {
128
+ await y.delete(e._id), await p.read("MISSION");
129
+ },
130
+ {
131
+ message: a("connect.program.common.remove.removing", { name: e.name }),
132
+ successMessage: a("connect.program.common.remove.removed", {
133
+ name: e.name
134
+ })
135
+ }
136
+ );
137
+ }
138
+ async function h(e) {
139
+ e ? await o() : O.open(async (s) => {
140
+ await o(s);
141
+ });
142
+ async function o(s) {
143
+ var r;
144
+ (r = w.value) == null || r.showSheet(
145
+ !0,
146
+ "MISSION",
147
+ e ? await y.readById(e._id) : void 0,
148
+ s
149
+ );
150
+ }
151
+ }
152
+ async function P(e) {
153
+ var r;
154
+ if (!await oe(e.name))
155
+ return;
156
+ const o = await y.readById(e._id), s = te(o);
157
+ (r = w.value) == null || r.showSheet(
158
+ !0,
159
+ "MISSION",
160
+ s,
161
+ o.template
162
+ );
163
+ }
164
+ async function $(e) {
165
+ e.campaign._id && e.campaign.rewards.some((o) => o.type === "VOUCHER") && await new Promise((o) => {
166
+ L.open({
167
+ title: "Confirmation",
168
+ message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
169
+ primaryActions: { text: "Update all", close: !0 },
170
+ secondaryActions: { text: "Update future only", close: !0 }
171
+ }).onPrimary(async () => {
172
+ var s;
173
+ e.updateCollections = !0, (s = window.top) == null || s.postMessage("updateAllVoucher", "*"), o();
174
+ }).onSecondary(async () => {
175
+ o();
176
+ });
177
+ }), await V(
178
+ async () => {
179
+ e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await p.read("MISSION");
180
+ },
181
+ {
182
+ message: a(
183
+ e.campaign._id ? "connect.program.common.update.updating" : "connect.program.common.update.creating",
184
+ { type: "Mission" }
185
+ ),
186
+ successMessage: a("connect.program.common.update.success", {
187
+ type: "Mission",
188
+ action: e.campaign._id ? "updated" : "created"
189
+ })
190
+ }
191
+ );
192
+ }
193
+ function j(e) {
194
+ var o;
195
+ (o = B.value) == null || o.showSheet({
196
+ campaign: e
197
+ });
198
+ }
199
+ return J(async () => {
200
+ await A(async () => {
201
+ await p.read("MISSION"), console.log(f);
202
+ });
203
+ }), (e, o) => {
204
+ const s = d("FmPageHead"), r = d("FmSearch"), E = d("FmTable"), C = d("FmButton"), H = d("FmListItem"), q = d("FmList"), z = d("FmCard");
205
+ return u(), S(k, null, [
206
+ c(s, {
207
+ title: t(a)("connect.campaign.mission.title"),
208
+ actions: t(f).length > 0 ? [N] : [],
209
+ "onClick:action": o[0] || (o[0] = () => h())
210
+ }, null, 8, ["title", "actions"]),
211
+ i("div", ge, [
212
+ c(r, {
213
+ modelValue: t(l).searchKey,
214
+ "onUpdate:modelValue": o[1] || (o[1] = (n) => t(l).searchKey = n),
215
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
216
+ placeholder: t(a)("connect.program.common.search"),
217
+ collapsible: ""
218
+ }, null, 8, ["modelValue", "placeholder"]),
219
+ t(p).campaigns.mission && t(p).campaigns.mission.length > 0 ? (u(), S(k, { key: 0 }, [
220
+ i("div", fe, [
221
+ i("div", ye, [
222
+ c(le, {
223
+ label: `${t(a)("connect.program.common.location")}: `,
224
+ "right-icon": "keyboard_arrow_down",
225
+ modelValue: t(l).location,
226
+ "onUpdate:modelValue": o[2] || (o[2] = (n) => t(l).location = n),
227
+ icon: "storefront",
228
+ "show-item-label": !0,
229
+ items: t(R).locationOptions
230
+ }, null, 8, ["label", "modelValue", "items"])
231
+ ]),
232
+ c(r, {
233
+ modelValue: t(l).searchKey,
234
+ "onUpdate:modelValue": o[3] || (o[3] = (n) => t(l).searchKey = n),
235
+ class: "xs:hidden sm:hidden",
236
+ placeholder: "search",
237
+ collapsible: ""
238
+ }, null, 8, ["modelValue"])
239
+ ]),
240
+ c(E, {
241
+ class: "xs:hidden sm:hidden",
242
+ "row-data": t(f),
243
+ "column-defs": T,
244
+ "search-value": t(l).searchKey,
245
+ "column-filter": [],
246
+ onRowClick: o[4] || (o[4] = (n) => h(n.original)),
247
+ "hide-footer": t(f).length < 10
248
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
249
+ c(q, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
250
+ default: F(() => [
251
+ (u(!0), S(k, null, Q(t(f).filter(
252
+ (n) => n.name.toLowerCase().includes(t(l).searchKey.toLowerCase())
253
+ ), (n) => (u(), I(H, {
254
+ key: n._id.toString(),
255
+ onClick: (x) => h(n),
256
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
257
+ }, {
258
+ default: F(() => {
259
+ var x;
260
+ return [
261
+ i("div", _e, [
262
+ i("div", he, [
263
+ (u(), I(X(t(D)(n))))
264
+ ]),
265
+ i("div", we, [
266
+ i("div", Ce, g(n.name), 1),
267
+ i("div", xe, g(t(K)(n)), 1)
268
+ ]),
269
+ 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)
270
+ ]),
271
+ i("div", ve, [
272
+ c(C, {
273
+ icon: "content_copy",
274
+ "icon-color": "neutral-gray-400",
275
+ variant: "tertiary",
276
+ onClick: async (b) => {
277
+ b.stopPropagation(), await P(n);
278
+ }
279
+ }, null, 8, ["onClick"]),
280
+ c(C, {
281
+ icon: "delete",
282
+ "icon-color": "neutral-gray-400",
283
+ variant: "tertiary",
284
+ onClick: (b) => (b.stopPropagation(), M(n))
285
+ }, null, 8, ["onClick"])
286
+ ])
287
+ ];
288
+ }),
289
+ _: 2
290
+ }, 1032, ["onClick"]))), 128))
291
+ ]),
292
+ _: 1
293
+ })
294
+ ], 64)) : (u(), I(z, {
295
+ key: 1,
296
+ variant: "outlined",
297
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
298
+ }, {
299
+ default: F(() => [
300
+ o[6] || (o[6] = i("img", {
301
+ src: Y,
302
+ class: "aspect-square w-[150px]"
303
+ }, null, -1)),
304
+ i("div", Se, [
305
+ i("div", ke, g(t(a)("connect.campaign.mission.createProgram")), 1),
306
+ i("div", Fe, g(t(a)("connect.campaign.mission.description")), 1)
307
+ ]),
308
+ c(C, {
309
+ variant: "primary",
310
+ label: t(a)("connect.campaign.mission.create"),
311
+ icon: "add",
312
+ onClick: o[5] || (o[5] = (n) => h())
313
+ }, null, 8, ["label"])
314
+ ]),
315
+ _: 1
316
+ })),
317
+ c(me, {
318
+ ref_key: "sheetRef",
319
+ ref: w,
320
+ "onSubmit:modelValue": $
321
+ }, null, 512),
322
+ c(ue, {
323
+ ref_key: "sendCollectionSheetRef",
324
+ ref: B
325
+ }, null, 512)
326
+ ])
327
+ ], 64);
328
+ };
329
+ }
330
+ });
331
+ export {
332
+ je as default
333
+ };
@@ -1,28 +1,28 @@
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-fg0FtbNR.js";
4
- import { u as ue } from "./loading-B0_BwPgo.js";
5
- import { c as we, p as K } from "./plugins-DTrOHd7d.js";
3
+ import { u as Z } from "./vue-i18n-D5HHFPRa.js";
4
+ import { u as ue } from "./loading-D77DfZBP.js";
5
+ import { c as we, p as K } from "./plugins-DQdMt5nO.js";
6
6
  import { J as X } from "./JsonViewer-v8_C7l5N.js";
7
- import { Z as N } from "./zod-BB7zZ5ec.js";
7
+ import { Z as N } from "./zod-Bp867gMI.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-CJWQEL9W.js";
10
- import { u as me } from "./reward-CsJhkkaT.js";
11
- import { l as le, c as se } from "./index-DzQjej5Y.js";
12
- import "./index-DesSizn4.js";
13
- import { a as be, b as xe } from "./index-B-y0UTZw.js";
14
- import "./index-Ct90ybe0.js";
15
- import "./index-DG_Ej3ec.js";
16
- import "./index-DIQ2MyWF.js";
17
- import { C as fe } from "./membership-H_whlbUP.js";
18
- import { t as ee } from "./helper-B4-2ut7E.js";
9
+ import { u as Q, _ as ye } from "./RewardGroup.vue_vue_type_script_setup_true_lang-BdT11T69.js";
10
+ import { u as me } from "./reward-DeTD3TQ1.js";
11
+ import { l as le, c as se } from "./index-CqtPReHP.js";
12
+ import "./index-C7X2wMHZ.js";
13
+ import { a as be, b as xe } from "./index-BD00XsAg.js";
14
+ import "./index-CLoMa41m.js";
15
+ import "./index-B6dK27Ud.js";
16
+ import "./index-DCzBwaDb.js";
17
+ import { C as fe } from "./membership-B5p556SC.js";
18
+ import { t as ee } from "./helper-CW7xMPjC.js";
19
19
  import { c as H } from "./object-qECH92oz.js";
20
20
  import { useDialog as Ce, components as oe } from "@feedmepos/ui-library";
21
- import { _ as Re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DeAkLgaX.js";
22
- import { a as Se, _ as Fe, b as ke } from "./trigger-CEprJYiD.js";
23
- import { O as $e } from "./objectid-B8LZDZOt.js";
24
- import { r as pe } from "./index-BebGg-0n.js";
25
- import { u as Pe } from "./business-C8P05bjQ.js";
21
+ import { _ as Re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BHhDgBiv.js";
22
+ import { a as Se, _ as Fe, b as ke } from "./trigger-BZa0mW7v.js";
23
+ import { O as $e } from "./objectid-DCHsjF9h.js";
24
+ import { r as pe } from "./index-CK4IRu1N.js";
25
+ import { u as Pe } from "./business-B35Wh7fa.js";
26
26
  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({
27
27
  __name: "ReferralRewadGroupCard",
28
28
  props: {
@@ -0,0 +1,261 @@
1
+ import { defineComponent as H, ref as I, computed as q, h as x, onMounted as z, resolveComponent as m, openBlock as p, 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-DQdMt5nO.js";
5
+ import { u as Y } from "./loading-D77DfZBP.js";
6
+ import { u as Z } from "./business-B35Wh7fa.js";
7
+ import { u as ee, c as f } from "./campaign-CdGwiufg.js";
8
+ import { g as te, a as $, b as N } from "./campaign-CxeRf6Kf.js";
9
+ import { u as oe, c as ae, p as ne } from "./template-HTjC1_ed.js";
10
+ import { _ as ie } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
+ import { _ as se } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CgUd84nn.js";
12
+ import { u as re } from "./vue-i18n-D5HHFPRa.js";
13
+ 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" }, de = { class: "flex items-center justify-between w-full" }, pe = { 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" }, Ke = /* @__PURE__ */ H({
14
+ __name: "Point",
15
+ setup(xe) {
16
+ const { t: i } = re(), D = {
17
+ label: i("connect.program.common.actions.create", {
18
+ type: i("connect.program.point.title").toLowerCase()
19
+ }),
20
+ value: "create",
21
+ isPrimary: !0,
22
+ prependIcon: "add"
23
+ }, K = oe("COIN", W()), C = Z(), d = ee(), { global: O, minor: S } = Y, l = I({
24
+ searchKey: "",
25
+ location: []
26
+ });
27
+ function A(e) {
28
+ const t = l.value.location;
29
+ return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((c) => {
30
+ var r;
31
+ return (r = e == null ? void 0 : e.targetLocation) == null ? void 0 : r.includes(c);
32
+ }) : e.targetLocation.includes(t);
33
+ }
34
+ const g = q(
35
+ () => d.campaigns.point.filter((e) => A(e))
36
+ ), R = [
37
+ {
38
+ header: i("connect.program.common.table.title"),
39
+ accessorFn: (e) => e.name
40
+ },
41
+ {
42
+ header: i("connect.program.common.table.status"),
43
+ accessorFn: (e) => te(e),
44
+ cell(e) {
45
+ return $(e.row.original);
46
+ }
47
+ },
48
+ {
49
+ header: i("connect.program.common.table.summary"),
50
+ accessorFn: (e) => N(e)
51
+ },
52
+ {
53
+ header: i("connect.program.common.table.actions"),
54
+ cell(e) {
55
+ return x("div", { class: "flex items-center gap-8 justify-end" }, [
56
+ x(V.FmButton, {
57
+ variant: "tertiary",
58
+ icon: "content_copy",
59
+ iconColor: "neutral-gray-400",
60
+ onClick: async (t) => {
61
+ t.stopPropagation(), await P(e.row.original);
62
+ }
63
+ }),
64
+ x(V.FmButton, {
65
+ variant: "tertiary",
66
+ icon: "delete",
67
+ iconColor: "neutral-gray-400",
68
+ onClick: (t) => {
69
+ t.stopPropagation(), L(e.row.original);
70
+ }
71
+ })
72
+ ]);
73
+ }
74
+ }
75
+ ], w = I();
76
+ async function L(e) {
77
+ await X.remove(`Are you sure you want to remove ${e.name}?`) && await S(
78
+ async () => {
79
+ await f.delete(e._id), await d.read("COIN");
80
+ },
81
+ {
82
+ message: `Removing ${e.name}`,
83
+ successMessage: `Removed ${e.name} successfully`
84
+ }
85
+ );
86
+ }
87
+ async function y(e) {
88
+ e ? await t() : K.open(async (c) => {
89
+ await t(c);
90
+ });
91
+ async function t(c) {
92
+ var r;
93
+ (r = w.value) == null || r.showSheet(
94
+ !0,
95
+ "COIN",
96
+ e ? await f.readById(e._id) : void 0,
97
+ c
98
+ );
99
+ }
100
+ }
101
+ async function P(e) {
102
+ var r;
103
+ if (!await ae(e.name))
104
+ return;
105
+ const t = await f.readById(e._id), c = ne(t, {
106
+ keepCollectible: !0
107
+ });
108
+ (r = w.value) == null || r.showSheet(
109
+ !0,
110
+ "COIN",
111
+ c,
112
+ t.template
113
+ );
114
+ }
115
+ async function U(e) {
116
+ await S(
117
+ async () => {
118
+ e.campaign._id ? await f.update(e.campaign._id, e) : await f.create(e), await d.read("COIN");
119
+ },
120
+ {
121
+ message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
122
+ successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
123
+ }
124
+ );
125
+ }
126
+ return z(async () => {
127
+ await O(async () => {
128
+ await d.read("COIN");
129
+ });
130
+ }), (e, t) => {
131
+ 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");
132
+ return p(), v(k, null, [
133
+ s(r, {
134
+ title: o(i)("connect.program.point.title"),
135
+ actions: o(g).length > 0 && o(C).isPremium ? [D] : [],
136
+ "onClick:action": t[0] || (t[0] = () => y())
137
+ }, {
138
+ title: h(() => [
139
+ n("div", le, [
140
+ n("span", ce, u(o(i)("connect.program.point.title")), 1),
141
+ s(c, { variant: "premium" })
142
+ ])
143
+ ]),
144
+ _: 1
145
+ }, 8, ["title", "actions"]),
146
+ n("div", me, [
147
+ s(B, {
148
+ modelValue: o(l).searchKey,
149
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => o(l).searchKey = a),
150
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
151
+ placeholder: "search",
152
+ collapsible: ""
153
+ }, null, 8, ["modelValue"]),
154
+ o(d).campaigns.point && o(d).campaigns.point.length > 0 ? (p(), v(k, { key: 0 }, [
155
+ n("div", de, [
156
+ n("div", pe, [
157
+ s(ie, {
158
+ label: `${o(i)("connect.common.location")}: `,
159
+ "right-icon": "keyboard_arrow_down",
160
+ modelValue: o(l).location,
161
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => o(l).location = a),
162
+ icon: "storefront",
163
+ "show-item-label": !0,
164
+ items: o(C).locationOptions
165
+ }, null, 8, ["label", "modelValue", "items"])
166
+ ]),
167
+ s(B, {
168
+ modelValue: o(l).searchKey,
169
+ "onUpdate:modelValue": t[3] || (t[3] = (a) => o(l).searchKey = a),
170
+ class: "xs:hidden sm:hidden",
171
+ placeholder: "search",
172
+ collapsible: ""
173
+ }, null, 8, ["modelValue"])
174
+ ]),
175
+ s(j, {
176
+ class: "xs:hidden sm:hidden",
177
+ "row-data": o(g),
178
+ "column-defs": R,
179
+ "search-value": o(l).searchKey,
180
+ "column-filter": [],
181
+ onRowClick: t[4] || (t[4] = (a) => y(a.original)),
182
+ "hide-footer": o(g).length < 10
183
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
184
+ s(E, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
185
+ default: h(() => [
186
+ (p(!0), v(k, null, G(o(g).filter(
187
+ (a) => a.name.toLowerCase().includes(o(l).searchKey.toLowerCase())
188
+ ), (a) => (p(), F(T, {
189
+ key: a._id.toString(),
190
+ onClick: (_) => y(a),
191
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
192
+ }, {
193
+ default: h(() => [
194
+ n("div", ue, [
195
+ n("div", fe, [
196
+ (p(), F(J(o($)(a))))
197
+ ]),
198
+ n("div", ge, [
199
+ n("div", ye, u(a.name), 1),
200
+ n("div", _e, u(o(N)(a)), 1)
201
+ ])
202
+ ]),
203
+ n("div", he, [
204
+ s(b, {
205
+ icon: "content_copy",
206
+ "icon-color": "neutral-gray-400",
207
+ variant: "tertiary",
208
+ onClick: async (_) => {
209
+ _.stopPropagation(), await P(a);
210
+ }
211
+ }, null, 8, ["onClick"]),
212
+ s(b, {
213
+ icon: "delete",
214
+ "icon-color": "neutral-gray-400",
215
+ variant: "tertiary",
216
+ onClick: (_) => (_.stopPropagation(), L(a))
217
+ }, null, 8, ["onClick"])
218
+ ])
219
+ ]),
220
+ _: 2
221
+ }, 1032, ["onClick"]))), 128))
222
+ ]),
223
+ _: 1
224
+ })
225
+ ], 64)) : (p(), F(M, {
226
+ key: 1,
227
+ variant: "outlined",
228
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
229
+ }, {
230
+ default: h(() => [
231
+ t[6] || (t[6] = n("img", {
232
+ src: Q,
233
+ class: "aspect-square w-[150px]"
234
+ }, null, -1)),
235
+ n("div", Ce, [
236
+ n("div", we, u(o(i)("connect.program.point.empty_state.title")), 1),
237
+ n("div", be, u(o(i)("connect.program.point.empty_state.description")), 1)
238
+ ]),
239
+ s(b, {
240
+ variant: "primary",
241
+ label: "Create point program",
242
+ disabled: !o(C).isPremium,
243
+ icon: "add",
244
+ onClick: t[5] || (t[5] = (a) => y())
245
+ }, null, 8, ["disabled"])
246
+ ]),
247
+ _: 1
248
+ })),
249
+ s(se, {
250
+ ref_key: "sheetRef",
251
+ ref: w,
252
+ "onSubmit:modelValue": U
253
+ }, null, 512)
254
+ ])
255
+ ], 64);
256
+ };
257
+ }
258
+ });
259
+ export {
260
+ Ke as default
261
+ };