@feedmepos/mf-connect 0.1.90-prod → 0.1.91-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 (97) hide show
  1. package/dist/{Analytic-BMwxfYv_.js → Analytic-NC-USqGi.js} +11 -11
  2. package/dist/{App-D_SZawqp.js → App-7D_MZN0d.js} +7 -7
  3. package/dist/{Bin-Dd1a25j_.js → Bin-60inU7_9.js} +8 -8
  4. package/dist/{Broadcast-UAp6rjTh.js → Broadcast-BFMikTv0.js} +8 -8
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CFe8C9fR.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DrHHwGED.js} +7 -7
  6. package/dist/{Card-CQuGfckK.js → Card-vafU4dyU.js} +19 -19
  7. package/dist/{Collections-oWvNX_oo.js → Collections-BNSNZg7H.js} +8 -8
  8. package/dist/{Credit-tGCTd7QC.js → Credit-Cy6YPGph.js} +8 -8
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C7h5K6lN.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-7IXALR4_.js} +33 -33
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BvIk7GMj.js → EffectSheet.vue_vue_type_style_index_0_lang-7Tanljx6.js} +6 -6
  11. package/dist/{Experience-D6w2OyuS.js → Experience-BVneXtjz.js} +8 -8
  12. package/dist/{FileSaver.min-9I0Uce_o.js → FileSaver.min-DRZVt2c-.js} +1 -1
  13. package/dist/{Game-Bj8mS5qz.js → Game-leXiqv6v.js} +9 -9
  14. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-D3B7IMDV.js → ImageInput.vue_vue_type_script_setup_true_lang-bvPXAI2I.js} +1 -1
  15. package/dist/{Index-Dsexv-ef.js → Index-BU3ubcCK.js} +10 -10
  16. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CmB12mvX.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DmnST0XL.js} +1 -1
  17. package/dist/{MainLayout-o1wQv9lH.js → MainLayout-DfMxhjyZ.js} +1 -1
  18. package/dist/{Marketing-Dz0sk_DR.js → Marketing-DVZfv6KL.js} +6 -6
  19. package/dist/{Member-rFVgJTbb.js → Member-C1UGjz3K.js} +12 -12
  20. package/dist/{MemberList-BpnL4Fbw.js → MemberList-B51qk9PN.js} +27 -27
  21. package/dist/{MemberTransactions-ouq288EU.js → MemberTransactions-XeeZVSj7.js} +1 -1
  22. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-wSeJMwF7.js → MessageInput.vue_vue_type_script_setup_true_lang-BZFh4LbN.js} +9 -9
  23. package/dist/{Mission-D1KR53bD.js → Mission-_2ubnxed.js} +9 -9
  24. package/dist/{Overview-B5bzlo0A.js → Overview-Wtw2Gxca.js} +19 -19
  25. package/dist/{Point-DTifJVdo.js → Point-BWNPBISs.js} +8 -8
  26. package/dist/{Promotion-DAtAw5kG.js → Promotion-Cq1rta1U.js} +9 -9
  27. package/dist/{Queue-DBnvPuuW.js → Queue-BislCglv.js} +11 -11
  28. package/dist/{Record-DI-q_FuN.js → Record-DllYWBQs.js} +9 -9
  29. package/dist/{Reward-C9CxDqz_.js → Reward-DNnMSiIt.js} +16 -16
  30. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BBE5Ymqj.js → RewardGroup.vue_vue_type_script_setup_true_lang-CYgKBX4A.js} +12 -12
  31. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DNM6f0iG.js → RuleGroup.vue_vue_type_script_setup_true_lang-CBLDHomx.js} +15 -15
  32. package/dist/{Segment-B0Oy6ajr.js → Segment-BawFn2kF.js} +25 -25
  33. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Be6Ykmkc.js → SelectItems.vue_vue_type_script_setup_true_lang-DaF39TyG.js} +2 -2
  34. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-MARrd7Nr.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-vxFwpQoN.js} +13 -13
  35. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-w9sbHf1G.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BBddcORt.js} +4 -4
  36. package/dist/{Setting-BUfHh3b6.js → Setting-Gt-j2X-h.js} +14 -14
  37. package/dist/{SettingAdvertisements-D2qWdId7.js → SettingAdvertisements-CETtBWdy.js} +12 -12
  38. package/dist/{Store-mNM5AzFJ.js → Store-DxBaC_7y.js} +22 -22
  39. package/dist/StoreRewards-CbmzaAnf.js +537 -0
  40. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-tk42owGe.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CB6y-TEk.js} +21 -21
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C65gN2Gd.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Ckdg2H3D.js} +2 -2
  42. package/dist/{Tier-swAmEa8-.js → Tier-BRBr_4Vs.js} +22 -22
  43. package/dist/{Title-BQQBoFOx.js → Title-N1Aoum66.js} +21 -21
  44. package/dist/{Transaction-BCjSkDrw.js → Transaction-DzrBiUhw.js} +2 -2
  45. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-IDqjTwZt.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-xtnyUh_C.js} +6 -6
  46. package/dist/{Voucher-BAGLTdGv.js → Voucher-95IbNNON.js} +12 -12
  47. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-7CKmTEVm.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BOf9umaT.js} +12 -12
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B_0BhFd7.js → ZodTextField.vue_vue_type_script_setup_true_lang-vCA6xspO.js} +2 -2
  49. package/dist/{app-Dij-Gw3J.js → app-CSXjCxhe.js} +43 -43
  50. package/dist/app.js +1 -1
  51. package/dist/{business-BPttWtAG.js → business-B1gGiOi3.js} +1 -1
  52. package/dist/{campaign-DVQC46G6.js → campaign-CJ-3fIa_.js} +8 -8
  53. package/dist/{campaign-PkE8sv2w.js → campaign-CTPJV80W.js} +1 -1
  54. package/dist/{campaign.enum-D6sGv-i6.js → campaign.enum-C6mTkAc0.js} +1 -1
  55. package/dist/{campaign.fn-CKpORxQM.js → campaign.fn-Dnq8oOA7.js} +32 -32
  56. package/dist/{collectible.enum-MjUCS47s.js → collectible.enum-Bm9ym61N.js} +1 -1
  57. package/dist/{collection.fn-BgLy48_a.js → collection.fn-eGKUovTx.js} +2 -2
  58. package/dist/{dto-Cr1_4S0y.js → dto-BmlZ970m.js} +4 -4
  59. package/dist/{effect-CZOUmaXH.js → effect-Fi165HuU.js} +1 -1
  60. package/dist/{email-addresses-DgPF09-i.js → email-addresses-CkqIxXsD.js} +2 -2
  61. package/dist/{export-BGwLWDbw.js → export-BINxBZ3o.js} +3 -3
  62. package/dist/{helper-BpGjM57Y.js → helper-BJpoVem-.js} +1 -1
  63. package/dist/{index-8Mt35h00.js → index-BBTSDrdg.js} +3 -3
  64. package/dist/{index-CZbs1ScI.js → index-BazRPGxz.js} +1 -1
  65. package/dist/{index-Dx04wWQ2.js → index-C-7bzCQ9.js} +4 -4
  66. package/dist/{index-dSK3QWJX.js → index-CMnMUrQv.js} +1 -1
  67. package/dist/{index-CsjJKy32.js → index-Ceebw9zT.js} +1 -1
  68. package/dist/{index-DG88MQyX.js → index-CfEzixyr.js} +1 -1
  69. package/dist/{index-C2b2PGqB.js → index-Cg170bHf.js} +3 -3
  70. package/dist/{index-DVtnOY4x.js → index-D2lJ7rbj.js} +6 -6
  71. package/dist/{index-BzNxgycz.js → index-D_D_KuCj.js} +1 -1
  72. package/dist/{index-AGdd55s3.js → index-ShgzGUii.js} +3 -3
  73. package/dist/{index-qGQhKrNH.js → index-agtRTQ1_.js} +2 -2
  74. package/dist/{index-D3jQoHcb.js → index-elY0gYnL.js} +1 -1
  75. package/dist/{index-DjEcMAQl.js → index-msYk4Nww.js} +1 -1
  76. package/dist/{index.esm2017-BnCWqavv.js → index.esm2017-CFwZeNKo.js} +1 -1
  77. package/dist/{loading-kCbpDTvS.js → loading-CWsuOmex.js} +1 -1
  78. package/dist/{lodash-C4AZ3S-J.js → lodash-Cm9Z1YF2.js} +1 -1
  79. package/dist/{membership-D2-ldXWY.js → membership-DMInG-QR.js} +3 -3
  80. package/dist/{money-BueaFHxA.js → money-COObXSez.js} +1 -1
  81. package/dist/{number-DQbzn_l_.js → number-ZsyBuNFr.js} +1 -1
  82. package/dist/objectid-Tx-E_slw.js +145 -0
  83. package/dist/{plugins-D5Na7PGX.js → plugins-CvqTFq6l.js} +3 -3
  84. package/dist/{reward-DJqNxI9u.js → reward-BDSUzN0_.js} +1 -1
  85. package/dist/{rule-CHRKj3Qt.js → rule-BzWFD4lu.js} +3 -3
  86. package/dist/{rule-builder-CEZ2VxtL.js → rule-builder-y5PUkSk9.js} +1 -1
  87. package/dist/{template-BFhV6iql.js → template-CO3A7_3t.js} +7 -7
  88. package/dist/{timezone-BQhT-oxQ.js → timezone-ClbAM0Sw.js} +2 -2
  89. package/dist/{trigger-nhg31Cm2.js → trigger-DGoPndhx.js} +5 -5
  90. package/dist/{usePagination-z6Io9pE3.js → usePagination-COHUplyH.js} +1 -1
  91. package/dist/{user-uP7Z7WUa.js → user-CnDTKRSl.js} +1 -1
  92. package/dist/{vue-i18n-DYzNH5z4.js → vue-i18n-X1TYXdQD.js} +276 -276
  93. package/dist/{xlsx-DTeYpknU.js → xlsx-W_9bPRI8.js} +166 -166
  94. package/dist/{zod-YWGh4sc1.js → zod-D9xVg76J.js} +1 -1
  95. package/package.json +1 -1
  96. package/dist/StoreRewards-D4-c0EPM.js +0 -535
  97. package/dist/objectid-B_jNHjAd.js +0 -145
@@ -0,0 +1,537 @@
1
+ import { defineComponent as Z, ref as U, computed as q, onMounted as z, resolveComponent as C, openBlock as y, createBlock as E, unref as e, isRef as ee, withCtx as S, createElementVNode as n, createVNode as c, createElementBlock as L, createTextVNode as te, resolveDynamicComponent as N, toDisplayString as D, Fragment as W, createCommentVNode as I, h as x } from "vue";
2
+ import { _ as oe } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as J, components as $ } from "@feedmepos/ui-library";
4
+ import "./index-BazRPGxz.js";
5
+ import { u as ae } from "./loading-CWsuOmex.js";
6
+ import { C as Q, u as se } from "./membership-DMInG-QR.js";
7
+ import { p as P, f as K } from "./plugins-CvqTFq6l.js";
8
+ import { useCoreStore as X } from "@feedmepos/mf-common";
9
+ import { u as ne } from "./vue-i18n-X1TYXdQD.js";
10
+ import { F as re } from "./index-Cg170bHf.js";
11
+ import { c as ie } from "./object-qECH92oz.js";
12
+ import { u as Y } from "./app-wDQR6dpb.js";
13
+ import { u as le } from "./business-B1gGiOi3.js";
14
+ import { Z as h } from "./zod-D9xVg76J.js";
15
+ import { _ as de } from "./ZodTextField.vue_vue_type_script_setup_true_lang-vCA6xspO.js";
16
+ import { _ as ce } from "./ImageInput.vue_vue_type_script_setup_true_lang-bvPXAI2I.js";
17
+ import { _ as me } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-Ckdg2H3D.js";
18
+ import { _ as pe, a as ue } from "./EffectSheet.vue_vue_type_style_index_0_lang-7Tanljx6.js";
19
+ import { i as fe, F as ye, h as j, t as we } from "./helper-BJpoVem-.js";
20
+ import { useRouter as ge } from "vue-router";
21
+ import { m as G } from "./index-D_D_KuCj.js";
22
+ import { R as B } from "./app-CSXjCxhe.js";
23
+ const ve = {
24
+ key: 0,
25
+ class: "flex flex-col space-y-16 pr-12"
26
+ }, be = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, Re = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, _e = { class: "flex items-center gap-8" }, xe = /* @__PURE__ */ Z({
27
+ __name: "EditRewardSheet",
28
+ emits: ["update"],
29
+ setup(H, { expose: r, emit: T }) {
30
+ const k = T, u = le(), l = X(), w = U(!1), s = U(), F = U(), V = U(!1), g = re, v = q(
31
+ () => {
32
+ var d;
33
+ return Q[((d = s.value) == null ? void 0 : d.type) || "VOUCHER"];
34
+ }
35
+ ), b = q(() => {
36
+ const d = g.safeParse(s.value);
37
+ return d.success ? [] : d.error.errors;
38
+ });
39
+ function M() {
40
+ const d = g.safeParse(s.value);
41
+ if (d.success) {
42
+ const a = { ...d.data };
43
+ V.value && (a.capabilities = ye), k("update", a);
44
+ }
45
+ }
46
+ function A(d, a, O = {
47
+ isStoreReward: !1,
48
+ type: "VOUCHER"
49
+ }) {
50
+ w.value = d, d && (F.value = void 0, V.value = O.isFeedvibe ?? !1, s.value = a || fe(O.type, {
51
+ business: l.currentBusiness.value._id,
52
+ noCampaign: O.isStoreReward == !0
53
+ }));
54
+ }
55
+ return z(async () => {
56
+ await u.readLocations();
57
+ }), r({
58
+ showSheet: A,
59
+ data: s,
60
+ rewardImage: F
61
+ }), (d, a) => {
62
+ const O = C("FmTextarea"), t = C("FmHelperText"), o = C("FmButton"), m = C("FmSideSheet");
63
+ return y(), E(m, {
64
+ "max-width": 560,
65
+ modelValue: e(w),
66
+ "onUpdate:modelValue": a[7] || (a[7] = (p) => ee(w) ? w.value = p : null),
67
+ header: "Store setting"
68
+ }, {
69
+ "side-sheet-footer": S(() => [
70
+ n("div", _e, [
71
+ c(o, {
72
+ label: "Submit",
73
+ onClick: M,
74
+ disabled: e(b).length > 0 || e(Y)().isLoading,
75
+ loading: e(Y)().isLoading
76
+ }, null, 8, ["disabled", "loading"]),
77
+ c(o, {
78
+ label: "Cancel",
79
+ onClick: a[6] || (a[6] = (p) => A(!1)),
80
+ variant: "tertiary"
81
+ })
82
+ ])
83
+ ]),
84
+ default: S(() => {
85
+ var p, R, _;
86
+ return [
87
+ e(s) ? (y(), L("div", ve, [
88
+ n("div", be, [
89
+ a[8] || (a[8] = te(" Reward information ", -1)),
90
+ (y(), E(N(e(v).chip())))
91
+ ]),
92
+ c(de, {
93
+ modelValue: e(s).name,
94
+ "onUpdate:modelValue": a[0] || (a[0] = (i) => e(s).name = i),
95
+ label: `${e(v).name} name`,
96
+ schema: e(h).typeAtPath(e(g), "name", [e(s).type])
97
+ }, null, 8, ["modelValue", "label", "schema"]),
98
+ c(O, {
99
+ class: "!mb-[-16px]",
100
+ modelValue: e(s).description,
101
+ "onUpdate:modelValue": a[1] || (a[1] = (i) => e(s).description = i),
102
+ rules: [e(h).ruleAtPath(e(g), "description", [e(s).type])]
103
+ }, {
104
+ label: S(() => [
105
+ (y(), E(N(
106
+ e(h).toInputLabel(
107
+ e(h).typeAtPath(e(g), "description", [e(s).type]),
108
+ `${e(v).name} description`
109
+ )
110
+ )))
111
+ ]),
112
+ _: 1
113
+ }, 8, ["modelValue", "rules"]),
114
+ n("div", Re, [
115
+ n("div", null, D(e(v).name) + " description should not exceed 200 characters. ", 1),
116
+ n("div", null, D(((p = e(s).description) == null ? void 0 : p.length) ?? 0) + "/200", 1)
117
+ ]),
118
+ c(ce, {
119
+ class: "w-1/2 xs:w-2/3",
120
+ "aspect-ratio": "16/9",
121
+ file: e(F) ?? void 0,
122
+ thumbnail: e(s).image ?? void 0,
123
+ "onUpdate:file": a[2] || (a[2] = async (i) => {
124
+ F.value = i, i || (e(s).image = null);
125
+ })
126
+ }, {
127
+ label: S(() => [
128
+ (y(), E(N(
129
+ e(h).toInputLabel(
130
+ e(h).typeAtPath(e(g), "image", [e(s).type]),
131
+ `${e(v).name} image`
132
+ )
133
+ )))
134
+ ]),
135
+ _: 1
136
+ }, 8, ["file", "thumbnail"]),
137
+ e(s).type === "VOUCHER" ? (y(), L(W, { key: 0 }, [
138
+ a[9] || (a[9] = n("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1)),
139
+ c(pe, {
140
+ "model-value": e(s).extras.effect,
141
+ "onUpdate:modelValue": a[3] || (a[3] = (i) => {
142
+ e(s).extras.effect = i;
143
+ })
144
+ }, null, 8, ["model-value"]),
145
+ e(s).extras.effect == null ? (y(), E(t, {
146
+ key: 0,
147
+ class: "!mt-8",
148
+ text: "Effect is required",
149
+ state: "error"
150
+ })) : I("", !0),
151
+ a[10] || (a[10] = n("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1)),
152
+ c(ue, {
153
+ "model-value": e(s).options,
154
+ "no-campaign": e(s).noCampaign,
155
+ "onUpdate:modelValue": a[4] || (a[4] = (i) => e(s).options = i),
156
+ schema: e(h).typeAtPath(e(g), "options", ["VOUCHER"])
157
+ }, null, 8, ["model-value", "no-campaign", "schema"])
158
+ ], 64)) : I("", !0),
159
+ a[11] || (a[11] = n("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1)),
160
+ e(s).type === "VOUCHER" ? (y(), E(me, {
161
+ key: 1,
162
+ "model-value": ((_ = (R = e(s).extras) == null ? void 0 : R.targetLocation) == null ? void 0 : _.map(String)) ?? null,
163
+ type: "select",
164
+ "onUpdate:modelValue": a[5] || (a[5] = (i) => {
165
+ e(s).extras.targetLocation = i;
166
+ }),
167
+ rules: [
168
+ e(h).ruleAtPath(e(g), "extras.targetLocation", ["VOUCHER"])
169
+ ]
170
+ }, null, 8, ["model-value", "rules"])) : I("", !0)
171
+ ])) : I("", !0)
172
+ ];
173
+ }),
174
+ _: 1
175
+ }, 8, ["modelValue"]);
176
+ };
177
+ }
178
+ }), Ce = { class: "flex flex-nowrap gap-x-2 grow h-full" }, Fe = { class: "flex flex-col grow p-24" }, he = { class: "grow pb-16 pr-16 pt-6 w-full" }, Ee = { class: "gap-24 grid grid-cols-1 lg:grid-cols-2" }, Se = /* @__PURE__ */ Z({
179
+ __name: "RewardTypeDialog",
180
+ props: {
181
+ onOk: {
182
+ type: Function,
183
+ required: !0
184
+ }
185
+ },
186
+ setup(H) {
187
+ const r = J(), T = H;
188
+ function k(u) {
189
+ T.onOk(u), r.close();
190
+ }
191
+ return (u, l) => {
192
+ const w = C("FmCard");
193
+ return y(), E(w, { class: "max-w-6xl" }, {
194
+ default: S(() => [
195
+ n("div", Ce, [
196
+ n("div", Fe, [
197
+ l[4] || (l[4] = n("div", { class: "space-y-4" }, [
198
+ n("div", { class: "fm-typo-en-title-sm-800" }, "Store rewards"),
199
+ n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, " Select a reward type to get started. ")
200
+ ], -1)),
201
+ n("div", he, [
202
+ n("div", Ee, [
203
+ c(w, {
204
+ variant: "outlined",
205
+ class: "box-border cursor-pointer h-full p-16 scroll-p-4 space-y-8",
206
+ onClick: l[0] || (l[0] = (s) => k("general"))
207
+ }, {
208
+ default: S(() => [...l[2] || (l[2] = [
209
+ n("div", { class: "fm-typo-en-title-sm-800" }, "General Reward", -1),
210
+ n("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)
211
+ ])]),
212
+ _: 1
213
+ }),
214
+ c(w, {
215
+ variant: "outlined",
216
+ class: "box-border cursor-pointer h-full p-16 scroll-p-4 space-y-8",
217
+ onClick: l[1] || (l[1] = (s) => k("feedvibe"))
218
+ }, {
219
+ default: S(() => [...l[3] || (l[3] = [
220
+ n("div", { class: "fm-typo-en-title-sm-800" }, "FeedVibe Reward", -1),
221
+ n("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)
222
+ ])]),
223
+ _: 1
224
+ })
225
+ ])
226
+ ])
227
+ ])
228
+ ])
229
+ ]),
230
+ _: 1
231
+ });
232
+ };
233
+ }
234
+ }), Ve = { class: "px-24 flex flex-col gap-y-16" }, Oe = { class: "flex items-center justify-between w-full" }, Te = { class: "flex flex-col gap-16 text-center" }, ke = { class: "fm-typo-en-title-sm-800" }, Ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, tt = /* @__PURE__ */ Z({
235
+ __name: "StoreRewards",
236
+ setup(H) {
237
+ const { t: r } = ne(), T = J(), k = {
238
+ label: r("connect.storeRewards.create"),
239
+ value: "create",
240
+ isPrimary: !0,
241
+ prependIcon: "add"
242
+ }, u = se(), l = X(), { global: w, minor: s } = ae, F = ge(), V = U({
243
+ searchKey: "",
244
+ columnFilters: []
245
+ }), g = [
246
+ {
247
+ header: r("connect.storeRewards.table.name"),
248
+ accessorFn: (t) => t.name,
249
+ cell(t) {
250
+ const o = t.row.original, m = j(
251
+ o.capabilities,
252
+ "STORE_BUNDLE:FEEDVIBE",
253
+ "selectable",
254
+ !1
255
+ );
256
+ return x("div", { class: "flex items-center gap-8" }, [
257
+ x("span", {}, o.name),
258
+ ...m ? [
259
+ x($.FmChip, {
260
+ label: "Feedvibe",
261
+ class: "text-fm-color-primary bg-fm-color-system-warning-100",
262
+ compact: !0
263
+ })
264
+ ] : []
265
+ ]);
266
+ }
267
+ },
268
+ {
269
+ id: "type",
270
+ header: r("connect.storeRewards.table.type"),
271
+ accessorFn: (t) => t.type,
272
+ cell(t) {
273
+ return Q[t.row.original.type].chip();
274
+ }
275
+ },
276
+ {
277
+ header: r("connect.storeRewards.table.validity"),
278
+ accessorFn: (t) => we(
279
+ "validityOption" in t.options ? t.options.validityOption || {} : {}
280
+ )
281
+ },
282
+ {
283
+ header: r("connect.storeRewards.table.used"),
284
+ meta: {
285
+ textAlign: "left"
286
+ },
287
+ accessorFn: (t) => t.currentReceive ?? 0
288
+ },
289
+ {
290
+ header: r("connect.storeRewards.table.actions"),
291
+ cell(t) {
292
+ return x("div", { class: "flex items-center justify-end gap-4" }, [
293
+ x(
294
+ $.FmMenu,
295
+ {
296
+ placement: "bottom-end",
297
+ onClick: (o) => {
298
+ o.stopPropagation();
299
+ }
300
+ },
301
+ {
302
+ "menu-button": () => x($.FmButton, {
303
+ icon: "more_vert",
304
+ iconColor: "neutral-gray-400",
305
+ variant: "tertiary"
306
+ }),
307
+ default: () => [
308
+ x($.FmMenuItem, {
309
+ label: "View collections",
310
+ onClick: async (o) => {
311
+ o.stopPropagation(), M(t.row.original._id);
312
+ }
313
+ }),
314
+ ...j(
315
+ t.row.original.capabilities,
316
+ "STORE_BUNDLE:FEEDVIBE",
317
+ "deletable"
318
+ ) ? [
319
+ x(
320
+ $.FmMenuItem,
321
+ {
322
+ onClick: async (o) => {
323
+ o.stopPropagation(), A(t.row.original);
324
+ }
325
+ },
326
+ {
327
+ label: x(
328
+ "div",
329
+ {
330
+ class: "text-fm-color-typo-error fm-typo-en-body-md-400"
331
+ },
332
+ "Remove"
333
+ )
334
+ }
335
+ )
336
+ ] : []
337
+ ]
338
+ }
339
+ )
340
+ ]);
341
+ }
342
+ }
343
+ ], v = q(
344
+ () => u.bundleRewards.filter((t) => t.type == "VOUCHER")
345
+ ), b = U();
346
+ function M(t) {
347
+ F.push({
348
+ name: B["$connect-STORE_REWARD_COLLECTIONS"],
349
+ params: { id: t }
350
+ });
351
+ }
352
+ async function A(t) {
353
+ if (t.type === "TITLE") {
354
+ await P.confirm(
355
+ r("connect.storeRewards.remove.message"),
356
+ r("connect.storeRewards.remove.title"),
357
+ r("connect.storeRewards.remove.action")
358
+ ) && await F.push({ name: B["$connect-PROGRAM_TITLE"] });
359
+ return;
360
+ }
361
+ await P.remove(
362
+ r("connect.storeRewards.delete.confirm"),
363
+ r("connect.storeRewards.delete.title")
364
+ ) && await s(
365
+ async () => {
366
+ await G.deleteReward(t._id), await u.readMembership(), await u.readRewards();
367
+ },
368
+ {
369
+ message: r("connect.storeRewards.delete.message"),
370
+ successMessage: r("connect.storeRewards.delete.success")
371
+ }
372
+ );
373
+ }
374
+ function d() {
375
+ return new Promise((t) => {
376
+ T.open({
377
+ title: "Create reward",
378
+ dialogComponent: x(Se, {
379
+ onOk: (o) => {
380
+ t(o);
381
+ }
382
+ })
383
+ }).onClose(() => {
384
+ t(null);
385
+ });
386
+ });
387
+ }
388
+ async function a(t) {
389
+ var R, _, i;
390
+ const o = t ? ie(u.bundleRewards.find((f) => f._id === t)) : void 0, m = ((R = l.sessionUser.value) == null ? void 0 : R.role.isAdmin) ?? !1, p = !!o && !j(
391
+ o.capabilities,
392
+ "STORE_BUNDLE:FEEDVIBE",
393
+ "editable"
394
+ );
395
+ if (p && !m) {
396
+ await P.confirm(
397
+ "This reward is managed by FeedVibe and cannot be edited.",
398
+ "Cannot edit reward",
399
+ "OK"
400
+ );
401
+ return;
402
+ }
403
+ if ((o == null ? void 0 : o.type) === "TITLE") {
404
+ await P.confirm(
405
+ "You cannot edit a title here, please edit it at the Program > Title section.",
406
+ "Update reward",
407
+ "Go to title section"
408
+ ) && await F.push({ name: B["$connect-PROGRAM_TITLE"] });
409
+ return;
410
+ }
411
+ if (!o) {
412
+ const f = await d();
413
+ if (!f) return;
414
+ (_ = b.value) == null || _.showSheet(!0, void 0, {
415
+ isStoreReward: !0,
416
+ type: "VOUCHER",
417
+ isFeedvibe: f === "feedvibe"
418
+ });
419
+ return;
420
+ }
421
+ (i = b.value) == null || i.showSheet(!0, o, {
422
+ isStoreReward: !0,
423
+ type: "VOUCHER",
424
+ // Preserve the FeedVibe lock when an admin edits a locked reward.
425
+ isFeedvibe: p
426
+ });
427
+ }
428
+ async function O(t) {
429
+ let o = !1;
430
+ t._id && t.type === "VOUCHER" && await new Promise((m) => {
431
+ T.open({
432
+ title: "Confirmation",
433
+ message: r("connect.campaign.voucher.updateConfirm.message"),
434
+ primaryActions: {
435
+ text: r("connect.campaign.voucher.updateConfirm.updateAll"),
436
+ close: !0
437
+ },
438
+ secondaryActions: {
439
+ text: r("connect.campaign.voucher.updateConfirm.updateFuture"),
440
+ close: !0
441
+ }
442
+ }).onPrimary(async () => {
443
+ o = !0, m();
444
+ }).onSecondary(async () => {
445
+ m();
446
+ });
447
+ }), await s(
448
+ async () => {
449
+ var m, p, R, _;
450
+ (m = b.value) != null && m.rewardImage && t.image ? await K.delete(t.image) : (p = b.value) != null && p.rewardImage && (t.image = await K.update(
451
+ t.image || K.collectibleImagePath(
452
+ void 0,
453
+ b.value.rewardImage
454
+ ),
455
+ (R = b.value) == null ? void 0 : R.rewardImage
456
+ )), t._id ? await G.updateReward(t._id, {
457
+ ...t,
458
+ updateCollection: o
459
+ }) : await G.createReward(t), await u.readRewards(), (_ = b.value) == null || _.showSheet(!1);
460
+ },
461
+ {
462
+ message: "Updating reward",
463
+ successMessage: "Reward updated successfully"
464
+ }
465
+ );
466
+ }
467
+ return z(async () => {
468
+ await w(async () => {
469
+ await u.readMembership(), await u.readRewards();
470
+ });
471
+ }), (t, o) => {
472
+ const m = C("FmPageHead"), p = C("FmSearch"), R = C("FmTable"), _ = C("FmButton"), i = C("FmCard");
473
+ return y(), L(W, null, [
474
+ c(m, {
475
+ title: e(r)("connect.storeRewards.title"),
476
+ description: e(r)("connect.storeRewards.description"),
477
+ actions: [k],
478
+ "back-button": !0,
479
+ "onClick:action": o[0] || (o[0] = () => a()),
480
+ "onClick:back": o[1] || (o[1] = () => e(F).push({ name: e(B)["$connect-STORE"] }))
481
+ }, null, 8, ["title", "description", "actions"]),
482
+ n("div", Ve, [
483
+ e(v) && e(v).length > 0 ? (y(), L(W, { key: 0 }, [
484
+ n("div", Oe, [
485
+ o[6] || (o[6] = n("div", { class: "flex gap-8" }, null, -1)),
486
+ c(p, {
487
+ modelValue: e(V).searchKey,
488
+ "onUpdate:modelValue": o[2] || (o[2] = (f) => e(V).searchKey = f),
489
+ class: "",
490
+ placeholder: "search",
491
+ collapsible: ""
492
+ }, null, 8, ["modelValue"])
493
+ ]),
494
+ c(R, {
495
+ "row-data": e(v),
496
+ "column-defs": g,
497
+ "search-value": e(V).searchKey,
498
+ "column-filter": e(V).columnFilters,
499
+ onRowClick: o[3] || (o[3] = (f) => a(f.original._id)),
500
+ "hide-footer": e(v).length < 10
501
+ }, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
502
+ ], 64)) : (y(), E(i, {
503
+ key: 1,
504
+ variant: "outlined",
505
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
506
+ }, {
507
+ default: S(() => [
508
+ o[7] || (o[7] = n("img", {
509
+ src: oe,
510
+ class: "aspect-square w-[150px]"
511
+ }, null, -1)),
512
+ n("div", Te, [
513
+ n("div", ke, D(e(r)("connect.storeRewards.empty.title")), 1),
514
+ n("div", Ue, D(e(r)("connect.storeRewards.empty.description")), 1)
515
+ ]),
516
+ c(_, {
517
+ variant: "primary",
518
+ label: e(r)("connect.storeRewards.empty.action"),
519
+ onClick: o[4] || (o[4] = (f) => a()),
520
+ icon: "add"
521
+ }, null, 8, ["label"])
522
+ ]),
523
+ _: 1
524
+ })),
525
+ c(xe, {
526
+ ref_key: "rewardSheetRef",
527
+ ref: b,
528
+ onUpdate: o[5] || (o[5] = (f) => O(f))
529
+ }, null, 512)
530
+ ])
531
+ ], 64);
532
+ };
533
+ }
534
+ });
535
+ export {
536
+ tt as default
537
+ };
@@ -1,32 +1,32 @@
1
1
  import { defineComponent as X, mergeModels as le, useModel as Se, computed as z, onMounted as ce, watch as ae, resolveComponent as P, openBlock as A, createBlock as J, withCtx as Z, createVNode as T, unref as s, ref as N, h as l, isRef as we, createElementVNode as C, createElementBlock as Y, Fragment as ee, renderList as ie, toDisplayString as H, createTextVNode as Ce, resolveDynamicComponent as De, onBeforeMount as Re } from "vue";
2
2
  import { components as w, useDialog as Te } from "@feedmepos/ui-library";
3
- import { r as ue } from "./index-Dx04wWQ2.js";
4
- import "./index-AGdd55s3.js";
5
- import { s as Ie } from "./index-dSK3QWJX.js";
3
+ import { r as ue } from "./index-C-7bzCQ9.js";
4
+ import "./index-ShgzGUii.js";
5
+ import { s as Ie } from "./index-CMnMUrQv.js";
6
6
  import { h as x } from "./moment-D7p2TMB-.js";
7
7
  import { _ as Q } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
8
8
  import { s as W } from "./index-CuvNtC_M.js";
9
- import { f as te } from "./number-DQbzn_l_.js";
10
- import { u as de } from "./business-BPttWtAG.js";
11
- import { _ as me, u as Fe } from "./usePagination-z6Io9pE3.js";
12
- import { a as oe, c as Ee, p as Ne } from "./plugins-D5Na7PGX.js";
13
- import { g as pe } from "./user-uP7Z7WUa.js";
14
- import { B as fe, e as Me } from "./export-BGwLWDbw.js";
15
- import { u as ge } from "./campaign-PkE8sv2w.js";
16
- import "./index-CZbs1ScI.js";
17
- import "./index-C2b2PGqB.js";
18
- import "./index-DVtnOY4x.js";
19
- import "./index-DG88MQyX.js";
20
- import "./index-8Mt35h00.js";
21
- import { u as he } from "./vue-i18n-DYzNH5z4.js";
9
+ import { f as te } from "./number-ZsyBuNFr.js";
10
+ import { u as de } from "./business-B1gGiOi3.js";
11
+ import { _ as me, u as Fe } from "./usePagination-COHUplyH.js";
12
+ import { a as oe, c as Ee, p as Ne } from "./plugins-CvqTFq6l.js";
13
+ import { g as pe } from "./user-CnDTKRSl.js";
14
+ import { B as fe, e as Me } from "./export-BINxBZ3o.js";
15
+ import { u as ge } from "./campaign-CTPJV80W.js";
16
+ import "./index-BazRPGxz.js";
17
+ import "./index-Cg170bHf.js";
18
+ import "./index-D2lJ7rbj.js";
19
+ import "./index-CfEzixyr.js";
20
+ import "./index-BBTSDrdg.js";
21
+ import { u as he } from "./vue-i18n-X1TYXdQD.js";
22
22
  import { o as $ } from "./objectId-dwaoBfJX.js";
23
- import { u as ve } from "./loading-kCbpDTvS.js";
24
- import { w as Ae } from "./xlsx-DTeYpknU.js";
23
+ import { u as ve } from "./loading-CWsuOmex.js";
24
+ import { w as Ae } from "./xlsx-W_9bPRI8.js";
25
25
  import { useRouter as Oe } from "vue-router";
26
- import { t as q } from "./index-D3jQoHcb.js";
27
- import { R as j } from "./app-Dij-Gw3J.js";
26
+ import { t as q } from "./index-elY0gYnL.js";
27
+ import { R as j } from "./app-CSXjCxhe.js";
28
28
  import { useCoreStore as ke } from "@feedmepos/mf-common";
29
- import { m as Pe } from "./index-BzNxgycz.js";
29
+ import { m as Pe } from "./index-D_D_KuCj.js";
30
30
  function Ve(c) {
31
31
  let m = "";
32
32
  switch (c) {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as N, ref as U, computed as w, watch as M, resolveComponent as v, openBlock as a, createElementBlock as i, Fragment as p, toDisplayString as F, createCommentVNode as T, createElementVNode as j, createVNode as h, unref as n, renderList as S, createBlock as k, isRef as $, withCtx as C } from "vue";
2
- import { u as q } from "./business-BPttWtAG.js";
3
- import { u as D } from "./vue-i18n-DYzNH5z4.js";
2
+ import { u as q } from "./business-B1gGiOi3.js";
3
+ import { u as D } from "./vue-i18n-X1TYXdQD.js";
4
4
  function K(l, s, o) {
5
5
  return l.some(
6
6
  o instanceof Function ? o : (u) => u === s