@feedmepos/mf-connect 0.1.38-beta.71 → 0.1.38-beta.72

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 (133) hide show
  1. package/package.json +1 -1
  2. package/dist/Analytic-BY0xqCru.js +0 -761
  3. package/dist/App-n6-XqhU7.js +0 -4638
  4. package/dist/AuditLogs-Dml3WjdH.js +0 -1991
  5. package/dist/Bin-DaPZyWm-.js +0 -166
  6. package/dist/Broadcast-hLmkBNne.js +0 -267
  7. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BahnNhzD.js +0 -121
  8. package/dist/Card-C_Fm3E0s.js +0 -909
  9. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  10. package/dist/Collections-DAUsUa0c.js +0 -540
  11. package/dist/Credit-DklbckuQ.js +0 -261
  12. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-vpnaCdLI.js +0 -3167
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-e1ZWGrXS.js +0 -351
  16. package/dist/Experience-D3Ve8dCI.js +0 -260
  17. package/dist/FileSaver.min-Bg15HHd0.js +0 -74
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  19. package/dist/Game-BJzRdZNg.js +0 -331
  20. package/dist/GenerateMaterial-pDWgptXt.js +0 -589
  21. package/dist/Grab-B0D8SpcD.js +0 -301
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-DkI3qMHv.js +0 -145
  23. package/dist/Index-ysSM8-pd.js +0 -259
  24. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  25. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-C7bEzQ4b.js +0 -18737
  26. package/dist/MainLayout-Kt1Wiz87.js +0 -41
  27. package/dist/Marketing-CFS6ff03.js +0 -145
  28. package/dist/MarketingMaterialEdit-BDYr5Rlw.js +0 -746
  29. package/dist/Member-Dgb3QBKF.js +0 -280
  30. package/dist/MemberList-CfcQUvN8.js +0 -1605
  31. package/dist/MemberOverview-wL_ailso.js +0 -58
  32. package/dist/MemberTransactions-BVwGdpXo.js +0 -45
  33. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Dj3h51yH.js +0 -60798
  34. package/dist/Mission-B9K8-Wrt.js +0 -335
  35. package/dist/Overview-DJgKxAvU.js +0 -1078
  36. package/dist/Point-lev1_Nit.js +0 -263
  37. package/dist/Promotion-De9e8yPj.js +0 -397
  38. package/dist/Queue-DH_F0Ekd.js +0 -259
  39. package/dist/Record-CH2AZqzF.js +0 -341
  40. package/dist/Reward-BUgOAjd4.js +0 -442
  41. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-KTaTLjjw.js +0 -149
  42. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-rs5kKp_v.js +0 -1912
  43. package/dist/Segment-DL6O--Aw.js +0 -881
  44. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-ZUGDMD5J.js +0 -181
  45. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CIeyrheH.js +0 -188
  46. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BAtXxIjO.js +0 -147
  47. package/dist/Setting-DOA80XlJ.js +0 -1999
  48. package/dist/SettingAdvertisements-Dl0eisXq.js +0 -263
  49. package/dist/Store-fni1Xblz.js +0 -1995
  50. package/dist/StoreRewards-CLMO-kNi.js +0 -534
  51. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BlBovyiT.js +0 -1034
  52. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jYcuAa.js +0 -7005
  53. package/dist/Tier-B0_DiVNv.js +0 -969
  54. package/dist/Title-twptCzpk.js +0 -567
  55. package/dist/Transaction-CTX5I6gO.js +0 -39
  56. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Bp-rIgz4.js +0 -130
  57. package/dist/Voucher-C7Kxmzjr.js +0 -422
  58. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-lZQTZUUU.js +0 -421
  59. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BlBEFfgu.js +0 -56
  60. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  61. package/dist/app-D5GVWKxc.js +0 -59071
  62. package/dist/app-wDQR6dpb.js +0 -39
  63. package/dist/app.js +0 -7
  64. package/dist/business-BvNsRlY4.js +0 -82
  65. package/dist/campaign-CpzFl8Vr.js +0 -4
  66. package/dist/campaign-DRErhSfb.js +0 -100
  67. package/dist/campaign-MN_o01w6.js +0 -253
  68. package/dist/campaign.enum-BtfwwLCf.js +0 -26
  69. package/dist/campaign.fn-BgSGxLPo.js +0 -776
  70. package/dist/collectible.enum-CV2tpD2C.js +0 -19
  71. package/dist/collection.fn-BYjqObg7.js +0 -26
  72. package/dist/dto-CyhnIGn-.js +0 -222
  73. package/dist/duplicateCampaign-jOZ1UznM.js +0 -51
  74. package/dist/effect-NKfquhhR.js +0 -89
  75. package/dist/email-addresses-EmFJeFmB.js +0 -705
  76. package/dist/export-B70Bp6s8.js +0 -96
  77. package/dist/feedme.ico +0 -0
  78. package/dist/helper-DiSstsUa.js +0 -86
  79. package/dist/index-5FmmWAib.js +0 -30289
  80. package/dist/index-B09KKPb4.js +0 -3419
  81. package/dist/index-BgP5ZHK6.js +0 -31
  82. package/dist/index-C46EHygk.js +0 -3
  83. package/dist/index-CD7Ji4Nw.js +0 -56
  84. package/dist/index-CHXlBh7-.js +0 -32
  85. package/dist/index-Cr2243n7.js +0 -2423
  86. package/dist/index-CrDg9PFk.js +0 -8912
  87. package/dist/index-CuvNtC_M.js +0 -61
  88. package/dist/index-DK45XoFG.js +0 -54
  89. package/dist/index-Qg_bzaF2.js +0 -76
  90. package/dist/index-bAmlAkpk.js +0 -124
  91. package/dist/index-nTpkh7pU.js +0 -28897
  92. package/dist/index-tvZKdKVU.js +0 -36
  93. package/dist/index-vh86FiIQ.js +0 -10
  94. package/dist/index.esm2017-B8fYlj6l.js +0 -3069
  95. package/dist/loading-DVr3dbZ1.js +0 -215
  96. package/dist/lodash-BNr1VEn2.js +0 -3678
  97. package/dist/membership-LEuPDIbe.js +0 -235
  98. package/dist/moment-D7p2TMB-.js +0 -2583
  99. package/dist/money-CogUwiv6.js +0 -15
  100. package/dist/number-C5wGUTN5.js +0 -12
  101. package/dist/object-qECH92oz.js +0 -26
  102. package/dist/objectId-dwaoBfJX.js +0 -7
  103. package/dist/objectid-DbUENFHd.js +0 -145
  104. package/dist/plugins-BxKrsjEx.js +0 -1817
  105. package/dist/remy-D_Deb3ue.js +0 -13
  106. package/dist/reward-CM4Wx2zA.js +0 -36
  107. package/dist/rule-CMMr2GMg.js +0 -1969
  108. package/dist/rule-builder-D5QsmOxi.js +0 -102
  109. package/dist/style.css +0 -13
  110. package/dist/template-BDKqBasy.js +0 -188
  111. package/dist/tier-BJDhpH6X.js +0 -4
  112. package/dist/tiers/tier=1.png +0 -0
  113. package/dist/tiers/tier=2.png +0 -0
  114. package/dist/tiers/tier=3.png +0 -0
  115. package/dist/tiers/tier=4.png +0 -0
  116. package/dist/timezone-DuaWQsQ2.js +0 -1154
  117. package/dist/titles/type=diamond.png +0 -0
  118. package/dist/titles/type=drinks.png +0 -0
  119. package/dist/titles/type=food.png +0 -0
  120. package/dist/titles/type=heart.png +0 -0
  121. package/dist/titles/type=medal.png +0 -0
  122. package/dist/titles/type=spend.png +0 -0
  123. package/dist/titles/type=thank-you.png +0 -0
  124. package/dist/titles/type=thumbs-up.png +0 -0
  125. package/dist/titles/type=years.png +0 -0
  126. package/dist/trigger-IcyZcRow.js +0 -213
  127. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  128. package/dist/type_drinks-D6jnpvwV.js +0 -4
  129. package/dist/usePagination-D8OEDsCt.js +0 -223
  130. package/dist/user-u3blYzG2.js +0 -55
  131. package/dist/vue-i18n-DfD8ZY6j.js +0 -2365
  132. package/dist/xlsx-Bgf4_JHr.js +0 -15491
  133. package/dist/zod-9J33xiFS.js +0 -91
@@ -1,534 +0,0 @@
1
- import { defineComponent as W, ref as V, computed as G, onMounted as Y, resolveComponent as b, openBlock as w, createBlock as C, unref as e, isRef as Q, withCtx as F, createElementVNode as s, createVNode as u, createElementBlock as P, createTextVNode as X, resolveDynamicComponent as M, toDisplayString as B, Fragment as q, createCommentVNode as $, h as v } from "vue";
2
- import { _ as ee } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as z, components as O } from "@feedmepos/ui-library";
4
- import "./index-C46EHygk.js";
5
- import { m as N, u as te } from "./loading-DVr3dbZ1.js";
6
- import { C as J, u as oe } from "./membership-LEuPDIbe.js";
7
- import { p as I, f as K } from "./plugins-BxKrsjEx.js";
8
- import { u as ae } from "./vue-i18n-DfD8ZY6j.js";
9
- import { F as ne } from "./index-CrDg9PFk.js";
10
- import { c as se } from "./object-qECH92oz.js";
11
- import { u as Z } from "./app-wDQR6dpb.js";
12
- import { u as re } from "./business-BvNsRlY4.js";
13
- import { useCoreStore as ie } from "@feedmepos/mf-common";
14
- import { Z as x } from "./zod-9J33xiFS.js";
15
- import { _ as le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BlBEFfgu.js";
16
- import { _ as de } from "./ImageInput.vue_vue_type_script_setup_true_lang-DkI3qMHv.js";
17
- import { _ as ce } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jYcuAa.js";
18
- import { _ as me, a as pe } from "./EffectSheet.vue_vue_type_style_index_0_lang-e1ZWGrXS.js";
19
- import { i as ue, F as fe, h as j, t as ye } from "./helper-DiSstsUa.js";
20
- import { useRouter as we } from "vue-router";
21
- import { R as A } from "./app-D5GVWKxc.js";
22
- const ge = {
23
- key: 0,
24
- class: "flex flex-col space-y-16 pr-12"
25
- }, ve = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, be = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, Re = { class: "flex items-center gap-8" }, _e = /* @__PURE__ */ W({
26
- __name: "EditRewardSheet",
27
- emits: ["update"],
28
- setup(L, { expose: r, emit: E }) {
29
- const S = E, y = re(), m = ie(), g = V(!1), a = V(), R = V(), T = V(!1), f = ne, p = G(
30
- () => {
31
- var l;
32
- return J[((l = a.value) == null ? void 0 : l.type) || "VOUCHER"];
33
- }
34
- ), D = G(() => {
35
- const l = f.safeParse(a.value);
36
- return l.success ? [] : l.error.errors;
37
- });
38
- function H() {
39
- const l = f.safeParse(a.value);
40
- if (l.success) {
41
- const n = { ...l.data };
42
- T.value && (n.capabilities = fe), S("update", n);
43
- }
44
- }
45
- function k(l, n, t = {
46
- isStoreReward: !1,
47
- type: "VOUCHER"
48
- }) {
49
- g.value = l, l && (R.value = void 0, T.value = t.isFeedvibe ?? !1, a.value = n || ue(t.type, {
50
- business: m.currentBusiness.value._id,
51
- noCampaign: t.isStoreReward == !0
52
- }));
53
- }
54
- return Y(async () => {
55
- await y.readLocations();
56
- }), r({
57
- showSheet: k,
58
- data: a,
59
- rewardImage: R
60
- }), (l, n) => {
61
- const t = b("FmTextarea"), o = b("FmHelperText"), c = b("FmButton"), _ = b("FmSideSheet");
62
- return w(), C(_, {
63
- "max-width": 560,
64
- modelValue: e(g),
65
- "onUpdate:modelValue": n[7] || (n[7] = (d) => Q(g) ? g.value = d : null),
66
- header: "Store setting"
67
- }, {
68
- "side-sheet-footer": F(() => [
69
- s("div", Re, [
70
- u(c, {
71
- label: "Submit",
72
- onClick: H,
73
- disabled: e(D).length > 0 || e(Z)().isLoading,
74
- loading: e(Z)().isLoading
75
- }, null, 8, ["disabled", "loading"]),
76
- u(c, {
77
- label: "Cancel",
78
- onClick: n[6] || (n[6] = (d) => k(!1)),
79
- variant: "tertiary"
80
- })
81
- ])
82
- ]),
83
- default: F(() => {
84
- var d, h, U;
85
- return [
86
- e(a) ? (w(), P("div", ge, [
87
- s("div", ve, [
88
- n[8] || (n[8] = X(" Reward information ", -1)),
89
- (w(), C(M(e(p).chip())))
90
- ]),
91
- u(le, {
92
- modelValue: e(a).name,
93
- "onUpdate:modelValue": n[0] || (n[0] = (i) => e(a).name = i),
94
- label: `${e(p).name} name`,
95
- schema: e(x).typeAtPath(e(f), "name", [e(a).type])
96
- }, null, 8, ["modelValue", "label", "schema"]),
97
- u(t, {
98
- class: "!mb-[-16px]",
99
- modelValue: e(a).description,
100
- "onUpdate:modelValue": n[1] || (n[1] = (i) => e(a).description = i),
101
- rules: [e(x).ruleAtPath(e(f), "description", [e(a).type])]
102
- }, {
103
- label: F(() => [
104
- (w(), C(M(
105
- e(x).toInputLabel(
106
- e(x).typeAtPath(e(f), "description", [e(a).type]),
107
- `${e(p).name} description`
108
- )
109
- )))
110
- ]),
111
- _: 1
112
- }, 8, ["modelValue", "rules"]),
113
- s("div", be, [
114
- s("div", null, B(e(p).name) + " description should not exceed 200 characters. ", 1),
115
- s("div", null, B(((d = e(a).description) == null ? void 0 : d.length) ?? 0) + "/200", 1)
116
- ]),
117
- u(de, {
118
- class: "w-1/2 xs:w-2/3",
119
- "aspect-ratio": "16/9",
120
- file: e(R) ?? void 0,
121
- thumbnail: e(a).image ?? void 0,
122
- "onUpdate:file": n[2] || (n[2] = async (i) => {
123
- R.value = i, i || (e(a).image = null);
124
- })
125
- }, {
126
- label: F(() => [
127
- (w(), C(M(
128
- e(x).toInputLabel(
129
- e(x).typeAtPath(e(f), "image", [e(a).type]),
130
- `${e(p).name} image`
131
- )
132
- )))
133
- ]),
134
- _: 1
135
- }, 8, ["file", "thumbnail"]),
136
- e(a).type === "VOUCHER" ? (w(), P(q, { key: 0 }, [
137
- n[9] || (n[9] = s("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1)),
138
- u(me, {
139
- "model-value": e(a).extras.effect,
140
- "onUpdate:modelValue": n[3] || (n[3] = (i) => {
141
- e(a).extras.effect = i;
142
- })
143
- }, null, 8, ["model-value"]),
144
- e(a).extras.effect == null ? (w(), C(o, {
145
- key: 0,
146
- class: "!mt-8",
147
- text: "Effect is required",
148
- state: "error"
149
- })) : $("", !0),
150
- n[10] || (n[10] = s("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1)),
151
- u(pe, {
152
- "model-value": e(a).options,
153
- "no-campaign": e(a).noCampaign,
154
- "onUpdate:modelValue": n[4] || (n[4] = (i) => e(a).options = i),
155
- schema: e(x).typeAtPath(e(f), "options", ["VOUCHER"])
156
- }, null, 8, ["model-value", "no-campaign", "schema"])
157
- ], 64)) : $("", !0),
158
- n[11] || (n[11] = s("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1)),
159
- e(a).type === "VOUCHER" ? (w(), C(ce, {
160
- key: 1,
161
- "model-value": ((U = (h = e(a).extras) == null ? void 0 : h.targetLocation) == null ? void 0 : U.map(String)) ?? null,
162
- type: "select",
163
- "onUpdate:modelValue": n[5] || (n[5] = (i) => {
164
- e(a).extras.targetLocation = i;
165
- }),
166
- rules: [
167
- e(x).ruleAtPath(e(f), "extras.targetLocation", ["VOUCHER"])
168
- ]
169
- }, null, 8, ["model-value", "rules"])) : $("", !0)
170
- ])) : $("", !0)
171
- ];
172
- }),
173
- _: 1
174
- }, 8, ["modelValue"]);
175
- };
176
- }
177
- }), xe = { class: "flex flex-nowrap gap-x-2 grow h-full" }, Ce = { class: "flex flex-col grow p-24" }, Fe = { class: "grow pb-16 pr-16 pt-6 w-full" }, he = { class: "gap-24 grid grid-cols-1 lg:grid-cols-2" }, Ee = /* @__PURE__ */ W({
178
- __name: "RewardTypeDialog",
179
- props: {
180
- onOk: {
181
- type: Function,
182
- required: !0
183
- }
184
- },
185
- setup(L) {
186
- const r = z(), E = L;
187
- function S(y) {
188
- E.onOk(y), r.close();
189
- }
190
- return (y, m) => {
191
- const g = b("FmCard");
192
- return w(), C(g, { class: "max-w-6xl" }, {
193
- default: F(() => [
194
- s("div", xe, [
195
- s("div", Ce, [
196
- m[4] || (m[4] = s("div", { class: "space-y-4" }, [
197
- s("div", { class: "fm-typo-en-title-sm-800" }, "Store rewards"),
198
- s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, " Select a reward type to get started. ")
199
- ], -1)),
200
- s("div", Fe, [
201
- s("div", he, [
202
- u(g, {
203
- variant: "outlined",
204
- class: "box-border cursor-pointer h-full p-16 scroll-p-4 space-y-8",
205
- onClick: m[0] || (m[0] = (a) => S("general"))
206
- }, {
207
- default: F(() => [...m[2] || (m[2] = [
208
- s("div", { class: "fm-typo-en-title-sm-800" }, "General Reward", -1),
209
- s("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " A standard voucher reward that can be freely edited and managed. ", -1)
210
- ])]),
211
- _: 1
212
- }),
213
- u(g, {
214
- variant: "outlined",
215
- class: "box-border cursor-pointer h-full p-16 scroll-p-4 space-y-8",
216
- onClick: m[1] || (m[1] = (a) => S("feedvibe"))
217
- }, {
218
- default: F(() => [...m[3] || (m[3] = [
219
- s("div", { class: "fm-typo-en-title-sm-800" }, "FeedVibe Reward", -1),
220
- s("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " A locked reward for FeedVibe bundles. Cannot be edited or deleted after creation. ", -1)
221
- ])]),
222
- _: 1
223
- })
224
- ])
225
- ])
226
- ])
227
- ])
228
- ]),
229
- _: 1
230
- });
231
- };
232
- }
233
- }), Se = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-center justify-between w-full" }, Oe = { class: "flex flex-col gap-16 text-center" }, Te = { class: "fm-typo-en-title-sm-800" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xe = /* @__PURE__ */ W({
234
- __name: "StoreRewards",
235
- setup(L) {
236
- const { t: r } = ae(), E = z(), S = {
237
- label: r("connect.storeRewards.create"),
238
- value: "create",
239
- isPrimary: !0,
240
- prependIcon: "add"
241
- }, y = oe(), { global: m, minor: g } = te, a = we(), R = V({
242
- searchKey: "",
243
- columnFilters: []
244
- }), T = [
245
- {
246
- header: r("connect.storeRewards.table.name"),
247
- accessorFn: (t) => t.name,
248
- cell(t) {
249
- const o = t.row.original, c = j(
250
- o.capabilities,
251
- "STORE_BUNDLE:FEEDVIBE",
252
- "selectable",
253
- !1
254
- );
255
- return v("div", { class: "flex items-center gap-8" }, [
256
- v("span", {}, o.name),
257
- ...c ? [
258
- v(O.FmChip, {
259
- label: "Feedvibe",
260
- class: "text-fm-color-primary bg-fm-color-system-warning-100",
261
- compact: !0
262
- })
263
- ] : []
264
- ]);
265
- }
266
- },
267
- {
268
- id: "type",
269
- header: r("connect.storeRewards.table.type"),
270
- accessorFn: (t) => t.type,
271
- cell(t) {
272
- return J[t.row.original.type].chip();
273
- }
274
- },
275
- {
276
- header: r("connect.storeRewards.table.validity"),
277
- accessorFn: (t) => ye(
278
- "validityOption" in t.options ? t.options.validityOption || {} : {}
279
- )
280
- },
281
- {
282
- header: r("connect.storeRewards.table.used"),
283
- meta: {
284
- textAlign: "left"
285
- },
286
- accessorFn: (t) => t.currentReceive ?? 0
287
- },
288
- {
289
- header: r("connect.storeRewards.table.actions"),
290
- cell(t) {
291
- return v("div", { class: "flex items-center justify-end gap-4" }, [
292
- v(
293
- O.FmMenu,
294
- {
295
- placement: "bottom-end",
296
- onClick: (o) => {
297
- o.stopPropagation();
298
- }
299
- },
300
- {
301
- "menu-button": () => v(O.FmButton, {
302
- icon: "more_vert",
303
- iconColor: "neutral-gray-400",
304
- variant: "tertiary"
305
- }),
306
- default: () => [
307
- v(O.FmMenuItem, {
308
- label: "View collections",
309
- onClick: async (o) => {
310
- o.stopPropagation(), D(t.row.original._id);
311
- }
312
- }),
313
- ...j(
314
- t.row.original.capabilities,
315
- "STORE_BUNDLE:FEEDVIBE",
316
- "deletable"
317
- ) ? [
318
- v(
319
- O.FmMenuItem,
320
- {
321
- onClick: async (o) => {
322
- o.stopPropagation(), H(t.row.original);
323
- }
324
- },
325
- {
326
- label: v(
327
- "div",
328
- {
329
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
330
- },
331
- "Remove"
332
- )
333
- }
334
- )
335
- ] : []
336
- ]
337
- }
338
- )
339
- ]);
340
- }
341
- }
342
- ], f = G(
343
- () => y.bundleRewards.filter((t) => t.type == "VOUCHER")
344
- ), p = V();
345
- function D(t) {
346
- a.push({
347
- name: A["$connect-STORE_REWARD_COLLECTIONS"],
348
- params: { id: t }
349
- });
350
- }
351
- async function H(t) {
352
- if (t.type === "TITLE") {
353
- await I.confirm(
354
- r("connect.storeRewards.remove.message"),
355
- r("connect.storeRewards.remove.title"),
356
- r("connect.storeRewards.remove.action")
357
- ) && await a.push({ name: A["$connect-PROGRAM_TITLE"] });
358
- return;
359
- }
360
- await I.remove(
361
- r("connect.storeRewards.delete.confirm"),
362
- r("connect.storeRewards.delete.title")
363
- ) && await g(
364
- async () => {
365
- await N.deleteReward(t._id), await y.readMembership(), await y.readRewards();
366
- },
367
- {
368
- message: r("connect.storeRewards.delete.message"),
369
- successMessage: r("connect.storeRewards.delete.success")
370
- }
371
- );
372
- }
373
- function k() {
374
- return new Promise((t) => {
375
- E.open({
376
- title: "Create reward",
377
- dialogComponent: v(Ee, {
378
- onOk: (o) => {
379
- t(o);
380
- }
381
- })
382
- }).onClose(() => {
383
- t(null);
384
- });
385
- });
386
- }
387
- async function l(t) {
388
- var c, _;
389
- const o = t ? se(y.bundleRewards.find((d) => d._id === t)) : void 0;
390
- if (o && !j(
391
- o.capabilities,
392
- "STORE_BUNDLE:FEEDVIBE",
393
- "editable"
394
- )) {
395
- await I.confirm(
396
- "This reward is managed by FeedVibe and cannot be edited.",
397
- "Cannot edit reward",
398
- "OK"
399
- );
400
- return;
401
- }
402
- if ((o == null ? void 0 : o.type) === "TITLE") {
403
- await I.confirm(
404
- "You cannot edit a title here, please edit it at the Program > Title section.",
405
- "Update reward",
406
- "Go to title section"
407
- ) && await a.push({ name: A["$connect-PROGRAM_TITLE"] });
408
- return;
409
- }
410
- if (!o) {
411
- const d = await k();
412
- if (!d) return;
413
- (c = p.value) == null || c.showSheet(!0, void 0, {
414
- isStoreReward: !0,
415
- type: "VOUCHER",
416
- isFeedvibe: d === "feedvibe"
417
- });
418
- return;
419
- }
420
- (_ = p.value) == null || _.showSheet(!0, o, {
421
- isStoreReward: !0,
422
- type: "VOUCHER"
423
- });
424
- }
425
- async function n(t) {
426
- let o = !1;
427
- t._id && t.type === "VOUCHER" && await new Promise((c) => {
428
- E.open({
429
- title: "Confirmation",
430
- message: r("connect.campaign.voucher.updateConfirm.message"),
431
- primaryActions: {
432
- text: r("connect.campaign.voucher.updateConfirm.updateAll"),
433
- close: !0
434
- },
435
- secondaryActions: {
436
- text: r("connect.campaign.voucher.updateConfirm.updateFuture"),
437
- close: !0
438
- }
439
- }).onPrimary(async () => {
440
- o = !0, c();
441
- }).onSecondary(async () => {
442
- c();
443
- });
444
- }), await g(
445
- async () => {
446
- var c, _, d, h;
447
- (c = p.value) != null && c.rewardImage && t.image ? await K.delete(t.image) : (_ = p.value) != null && _.rewardImage && (t.image = await K.update(
448
- t.image || K.collectibleImagePath(
449
- void 0,
450
- p.value.rewardImage
451
- ),
452
- (d = p.value) == null ? void 0 : d.rewardImage
453
- )), t._id ? await N.updateReward(t._id, {
454
- ...t,
455
- updateCollection: o
456
- }) : await N.createReward(t), await y.readRewards(), (h = p.value) == null || h.showSheet(!1);
457
- },
458
- {
459
- message: "Updating reward",
460
- successMessage: "Reward updated successfully"
461
- }
462
- );
463
- }
464
- return Y(async () => {
465
- await m(async () => {
466
- await y.readMembership(), await y.readRewards();
467
- });
468
- }), (t, o) => {
469
- const c = b("FmPageHead"), _ = b("FmSearch"), d = b("FmTable"), h = b("FmButton"), U = b("FmCard");
470
- return w(), P(q, null, [
471
- u(c, {
472
- title: e(r)("connect.storeRewards.title"),
473
- description: e(r)("connect.storeRewards.description"),
474
- actions: [S],
475
- "back-button": !0,
476
- "onClick:action": o[0] || (o[0] = () => l()),
477
- "onClick:back": o[1] || (o[1] = () => e(a).push({ name: e(A)["$connect-STORE"] }))
478
- }, null, 8, ["title", "description", "actions"]),
479
- s("div", Se, [
480
- e(f) && e(f).length > 0 ? (w(), P(q, { key: 0 }, [
481
- s("div", Ve, [
482
- o[6] || (o[6] = s("div", { class: "flex gap-8" }, null, -1)),
483
- u(_, {
484
- modelValue: e(R).searchKey,
485
- "onUpdate:modelValue": o[2] || (o[2] = (i) => e(R).searchKey = i),
486
- class: "",
487
- placeholder: "search",
488
- collapsible: ""
489
- }, null, 8, ["modelValue"])
490
- ]),
491
- u(d, {
492
- "row-data": e(f),
493
- "column-defs": T,
494
- "search-value": e(R).searchKey,
495
- "column-filter": e(R).columnFilters,
496
- onRowClick: o[3] || (o[3] = (i) => l(i.original._id)),
497
- "hide-footer": e(f).length < 10
498
- }, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
499
- ], 64)) : (w(), C(U, {
500
- key: 1,
501
- variant: "outlined",
502
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
503
- }, {
504
- default: F(() => [
505
- o[7] || (o[7] = s("img", {
506
- src: ee,
507
- class: "aspect-square w-[150px]"
508
- }, null, -1)),
509
- s("div", Oe, [
510
- s("div", Te, B(e(r)("connect.storeRewards.empty.title")), 1),
511
- s("div", ke, B(e(r)("connect.storeRewards.empty.description")), 1)
512
- ]),
513
- u(h, {
514
- variant: "primary",
515
- label: e(r)("connect.storeRewards.empty.action"),
516
- onClick: o[4] || (o[4] = (i) => l()),
517
- icon: "add"
518
- }, null, 8, ["label"])
519
- ]),
520
- _: 1
521
- })),
522
- u(_e, {
523
- ref_key: "rewardSheetRef",
524
- ref: p,
525
- onUpdate: o[5] || (o[5] = (i) => n(i))
526
- }, null, 512)
527
- ])
528
- ], 64);
529
- };
530
- }
531
- });
532
- export {
533
- Xe as default
534
- };