@feedmepos/mf-connect 0.1.38-beta.26 → 0.1.38-beta.27

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-GI7aYtUb.js → Analytic-Dgpp4zkU.js} +13 -13
  2. package/dist/{App-BoklLgkw.js → App-DNRzPvQb.js} +7 -7
  3. package/dist/{AuditLogs-DGAmSC_0.js → AuditLogs-BhG5wShL.js} +10 -10
  4. package/dist/{Bin-BiF3wXhU.js → Bin-BSmAVdOX.js} +8 -8
  5. package/dist/Broadcast-DZ-qedno.js +233 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BIGwoDq9.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BS5HDnfb.js} +6 -6
  7. package/dist/{Card-Bzm_iM7j.js → Card-CLTczC6l.js} +16 -16
  8. package/dist/{Collections-CZEDKF0v.js → Collections-CZIk5DSy.js} +6 -6
  9. package/dist/Credit-DGGU3d68.js +228 -0
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cz4ydsOk.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-FxEXBhTK.js} +32 -32
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-d67tWKfX.js → EffectSheet.vue_vue_type_style_index_0_lang-Bx_7FAYn.js} +6 -6
  12. package/dist/Experience-Dd0Xkp_z.js +229 -0
  13. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  14. package/dist/{Game-ooDjLDzG.js → Game-N6iQZPqM.js} +103 -97
  15. package/dist/{Grab-CHmDWK3s.js → Grab-Dn8pP3Vy.js} +10 -10
  16. package/dist/{Index-C9yMbuO8.js → Index-Do0nSsYj.js} +10 -10
  17. package/dist/{Marketing-BvgC-F4p.js → Marketing-BG8L2AVq.js} +6 -6
  18. package/dist/{Member-DP0Cm8yE.js → Member-HQWOfz1g.js} +10 -10
  19. package/dist/{MemberList-BYZ2NfAg.js → MemberList-jfgCK6k3.js} +25 -25
  20. package/dist/{MemberTransactions-DvG4SU0m.js → MemberTransactions-DYOBM90W.js} +1 -1
  21. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C3-IpjMr.js → MessageInput.vue_vue_type_script_setup_true_lang-DdaqUEEb.js} +7 -7
  22. package/dist/{Mission-CBOIiAhx.js → Mission-CkXM1dNO.js} +112 -106
  23. package/dist/{Overview-BqKRh6LC.js → Overview-BJWncUrN.js} +18 -18
  24. package/dist/Point-CfuVogKH.js +232 -0
  25. package/dist/{Promotion-D4HBy-As.js → Promotion-TtgchqMU.js} +11 -11
  26. package/dist/{Queue-BqzI56Vp.js → Queue-xaCqQVUP.js} +11 -11
  27. package/dist/{Record-WtLmMgjU.js → Record-D6z_Pywk.js} +8 -8
  28. package/dist/{Reward-yfsdyC-T.js → Reward-DBzn5tRP.js} +15 -15
  29. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DaB5piDf.js → RewardGroup.vue_vue_type_script_setup_true_lang-CRv8xHpU.js} +11 -11
  30. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DCKbSowE.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bd8pXLRT.js} +13 -13
  31. package/dist/{Segment-hOxwXwqZ.js → Segment-gxBRnKo7.js} +22 -22
  32. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-IfFZG5uK.js → SelectItems.vue_vue_type_script_setup_true_lang-DbC6xTWH.js} +2 -2
  33. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-C9FaS4EF.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BAraQhKS.js} +11 -11
  34. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CNd_-RAr.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CFnFyNya.js} +3 -3
  35. package/dist/{Setting-B7XBouh4.js → Setting-DX7hLnTQ.js} +11 -11
  36. package/dist/{Store-Dbg7gN9h.js → Store-C3GZXKuC.js} +19 -19
  37. package/dist/{StoreRewards-DoBjQyns.js → StoreRewards-CCWDGKLp.js} +13 -13
  38. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-C3_usDfP.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DNgDoMR9.js} +21 -21
  39. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C5BP2K1C.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DQmZE9_V.js} +1 -1
  40. package/dist/{Tier-Q9hjmprx.js → Tier-DbWQM6De.js} +20 -20
  41. package/dist/{Title-9h42ZNEa.js → Title-a2bTIZi0.js} +19 -19
  42. package/dist/{Transaction-B_NIJcmb.js → Transaction-f8XwfBob.js} +2 -2
  43. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-EZ42L0jN.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DUQ0fU5s.js} +6 -6
  44. package/dist/{Voucher-OjdoUYOe.js → Voucher-C7Dfsqk6.js} +14 -14
  45. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CgUFty-i.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C5fm0K4i.js} +10 -10
  46. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-D9V2WsTX.js → ZodTextField.vue_vue_type_script_setup_true_lang-A-h4HUTJ.js} +1 -1
  47. package/dist/{app-A-A8AXY4.js → app-BOG1dC8a.js} +32 -32
  48. package/dist/{app-psmMhnbB.js → app-jGPh064M.js} +1 -1
  49. package/dist/app.js +1 -1
  50. package/dist/{business-BkIoeq-Q.js → business--P6e14wH.js} +11 -8
  51. package/dist/{campaign-C0gfY75c.js → campaign-CR_hUukZ.js} +9 -9
  52. package/dist/{campaign-CERB2jjK.js → campaign-C_gQlNNb.js} +2 -2
  53. package/dist/{campaign.enum-jpIcwh1C.js → campaign.enum-Dj5o3Gnx.js} +1 -1
  54. package/dist/{campaign.fn-C3JAU897.js → campaign.fn-DQZ0W-EB.js} +3 -3
  55. package/dist/{collectible.enum-PLiXkPXk.js → collectible.enum-DQgguzyG.js} +1 -1
  56. package/dist/{collection.fn-BEgw5oag.js → collection.fn-1jzRWzrr.js} +2 -2
  57. package/dist/{dto-CzjctCKL.js → dto-C3jWvc1e.js} +4 -4
  58. package/dist/{effect-BzkBC2cZ.js → effect-dA2mpaCE.js} +1 -1
  59. package/dist/{email-addresses-BWQOZIxj.js → email-addresses-37_SE2AF.js} +1 -1
  60. package/dist/{export-Bqt9zope.js → export-Cn7Elq59.js} +3 -3
  61. package/dist/{helper-CnEOKaJw.js → helper-1FmJd7OP.js} +1 -1
  62. package/dist/{index-BMLcVoj2.js → index-B4j34swO.js} +1 -1
  63. package/dist/{index-DBN0XD-h.js → index-B9iL1w4-.js} +3 -3
  64. package/dist/{index-DFqn9RQx.js → index-BRALrcjU.js} +3 -3
  65. package/dist/{index-66ugkTKw.js → index-BcEhSpSd.js} +1 -1
  66. package/dist/{index-BD7Rc0qN.js → index-Bv04ElXo.js} +6 -6
  67. package/dist/{index-Cs3ZFd92.js → index-BwBDTG0U.js} +4 -4
  68. package/dist/{index-DnJuxEaY.js → index-C0TBodx0.js} +1 -1
  69. package/dist/{index-DfOMpXlE.js → index-C0uZD6Fb.js} +1 -1
  70. package/dist/{index-DEezTfBN.js → index-CCzzmRaK.js} +3 -3
  71. package/dist/{index-CeDl4txs.js → index-Cq9x3KEB.js} +1 -1
  72. package/dist/{index-DZLqscW5.js → index-DIup5B2H.js} +1 -1
  73. package/dist/{index-yOIVmjex.js → index-Da1osm0C.js} +1 -1
  74. package/dist/{index-D5aQKEmO.js → index-Oly5lYMA.js} +1 -1
  75. package/dist/{index-DIN-0kYC.js → index-YhB238q9.js} +2 -2
  76. package/dist/{index.esm2017-7gQUvseu.js → index.esm2017-pcImat1a.js} +1 -1
  77. package/dist/{loading-CJIHUxKM.js → loading-BIAeRmZo.js} +1 -1
  78. package/dist/{membership-DRnWUdOc.js → membership-D74wSltj.js} +3 -3
  79. package/dist/{money-I2p-gwmi.js → money-DQuZChef.js} +1 -1
  80. package/dist/{number-DldVO4aW.js → number-DORW-adL.js} +1 -1
  81. package/dist/{objectid-B_MkqbEB.js → objectid-CPqo6DS_.js} +5 -5
  82. package/dist/{plugins-D17305Np.js → plugins-BVLU2dc_.js} +2 -2
  83. package/dist/{reward-3PHDIRXM.js → reward-CsZQy2b1.js} +1 -1
  84. package/dist/{rule-BgMw4FoF.js → rule-CtYg9lgQ.js} +3 -3
  85. package/dist/{rule-builder-CmqmCe3P.js → rule-builder-TwHL3OPZ.js} +1 -1
  86. package/dist/{template-BR9R6E1B.js → template-DlLEQKFu.js} +4 -4
  87. package/dist/{timezone-CWS-nhUv.js → timezone-DGJqaz8e.js} +1 -1
  88. package/dist/{trigger-DsYBkR3I.js → trigger-B4JMJKDj.js} +4 -4
  89. package/dist/{user-B3SLxQOc.js → user-ZU2f1nbT.js} +1 -1
  90. package/dist/{vue-i18n-CttzNDMl.js → vue-i18n-BtpjMXUM.js} +2 -2
  91. package/dist/{xlsx-cNTfolRW.js → xlsx-BiJUMUcX.js} +1 -1
  92. package/package.json +1 -1
  93. package/dist/Broadcast-D5ypkyn0.js +0 -227
  94. package/dist/Credit-nieDAS9M.js +0 -222
  95. package/dist/Experience-CKeWLWIk.js +0 -223
  96. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  97. package/dist/Point-14thvTNE.js +0 -226
@@ -0,0 +1,228 @@
1
+ import { defineComponent as N, ref as L, computed as j, h as M, onMounted as H, resolveComponent as m, openBlock as d, createElementBlock as y, Fragment as h, createVNode as i, unref as t, createElementVNode as n, withCtx as C, renderList as q, createBlock as w, resolveDynamicComponent as O, toDisplayString as g, createCommentVNode as z } from "vue";
2
+ import { _ as G } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as J, components as Q } from "@feedmepos/ui-library";
4
+ import { p as W } from "./plugins-BVLU2dc_.js";
5
+ import { u as X } from "./loading-BIAeRmZo.js";
6
+ import { u as Y } from "./business--P6e14wH.js";
7
+ import { u as Z } from "./campaign-C_gQlNNb.js";
8
+ import { g as ee, a as S, b as V } from "./campaign-CR_hUukZ.js";
9
+ import { u as oe } from "./vue-i18n-BtpjMXUM.js";
10
+ import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
+ import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-FxEXBhTK.js";
12
+ import { u as ne } from "./template-DlLEQKFu.js";
13
+ import { c as _ } from "./index-C0uZD6Fb.js";
14
+ const re = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, le = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, ue = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { key: 0 }, Ie = /* @__PURE__ */ N({
15
+ __name: "Credit",
16
+ setup(ge) {
17
+ const { t: r } = oe(), B = {
18
+ label: r("connect.program.common.actions.create", {
19
+ type: r("connect.program.credit.title").toLowerCase()
20
+ }),
21
+ value: "create",
22
+ isPrimary: !0,
23
+ prependIcon: "add"
24
+ }, I = ne("CREDIT", J()), R = Y(), u = Z(), { global: D, minor: v } = X, s = L({
25
+ searchKey: "",
26
+ location: []
27
+ });
28
+ function T(e) {
29
+ const o = s.value.location;
30
+ return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((l) => {
31
+ var c;
32
+ return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
33
+ }) : e.targetLocation.includes(o);
34
+ }
35
+ const p = j(
36
+ () => u.campaigns.credit.filter((e) => T(e))
37
+ ), E = [
38
+ {
39
+ header: r("connect.program.common.table.title"),
40
+ accessorFn: (e) => e.name
41
+ },
42
+ {
43
+ header: r("connect.program.common.table.status"),
44
+ accessorFn: (e) => ee(e),
45
+ cell(e) {
46
+ return S(e.row.original);
47
+ }
48
+ },
49
+ {
50
+ header: r("connect.program.common.table.summary"),
51
+ accessorFn: (e) => V(e)
52
+ },
53
+ {
54
+ header: r("connect.program.common.table.actions"),
55
+ cell(e) {
56
+ return M(Q.FmButton, {
57
+ variant: "tertiary",
58
+ icon: "delete",
59
+ iconColor: "neutral-gray-400",
60
+ onClick: (o) => {
61
+ o.stopPropagation(), x(e.row.original);
62
+ }
63
+ });
64
+ }
65
+ }
66
+ ], b = L();
67
+ async function x(e) {
68
+ await W.remove(
69
+ r("connect.program.common.remove.confirm", { name: e.name })
70
+ ) && await v(
71
+ async () => {
72
+ await _.delete(e._id), await u.read("CREDIT");
73
+ },
74
+ {
75
+ message: r("connect.program.common.remove.removing", { name: e.name }),
76
+ successMessage: r("connect.program.common.remove.removed", {
77
+ name: e.name
78
+ })
79
+ }
80
+ );
81
+ }
82
+ async function f(e) {
83
+ e ? await o() : I.open(async (l) => {
84
+ await o(l);
85
+ });
86
+ async function o(l) {
87
+ var c;
88
+ (c = b.value) == null || c.showSheet(
89
+ !0,
90
+ "CREDIT",
91
+ e ? await _.readById(e._id) : void 0,
92
+ l
93
+ );
94
+ }
95
+ }
96
+ async function K(e) {
97
+ await v(
98
+ async () => {
99
+ e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await u.read("CREDIT");
100
+ },
101
+ {
102
+ message: `${e.campaign._id ? "Updating" : "Creating"} credit program`,
103
+ successMessage: `Credit program ${e.campaign._id ? "updated" : "created"} successfully`
104
+ }
105
+ );
106
+ }
107
+ return H(async () => {
108
+ await D(async () => {
109
+ await u.read("CREDIT");
110
+ });
111
+ }), (e, o) => {
112
+ const l = m("FmPageHead"), c = m("FmSearch"), $ = m("FmTable"), F = m("FmButton"), P = m("FmListItem"), U = m("FmList"), A = m("FmCard");
113
+ return d(), y(h, null, [
114
+ i(l, {
115
+ title: t(r)("connect.program.credit.title"),
116
+ actions: t(p).length > 0 ? [B] : [],
117
+ "onClick:action": o[0] || (o[0] = () => f())
118
+ }, null, 8, ["title", "actions"]),
119
+ n("div", re, [
120
+ i(c, {
121
+ modelValue: t(s).searchKey,
122
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => t(s).searchKey = a),
123
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
124
+ placeholder: "search",
125
+ collapsible: ""
126
+ }, null, 8, ["modelValue"]),
127
+ t(u).campaigns.credit && t(u).campaigns.credit.length > 0 ? (d(), y(h, { key: 0 }, [
128
+ n("div", se, [
129
+ n("div", ie, [
130
+ i(te, {
131
+ label: `${t(r)("connect.common.location")}: `,
132
+ "right-icon": "keyboard_arrow_down",
133
+ modelValue: t(s).location,
134
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => t(s).location = a),
135
+ icon: "storefront",
136
+ "show-item-label": !0,
137
+ items: t(R).locationOptions
138
+ }, null, 8, ["label", "modelValue", "items"])
139
+ ]),
140
+ i(c, {
141
+ modelValue: t(s).searchKey,
142
+ "onUpdate:modelValue": o[3] || (o[3] = (a) => t(s).searchKey = a),
143
+ class: "xs:hidden",
144
+ placeholder: "search",
145
+ collapsible: ""
146
+ }, null, 8, ["modelValue"])
147
+ ]),
148
+ i($, {
149
+ class: "xs:hidden",
150
+ "row-data": t(p),
151
+ "column-defs": E,
152
+ "search-value": t(s).searchKey,
153
+ "column-filter": [],
154
+ onRowClick: o[4] || (o[4] = (a) => f(a.original)),
155
+ "hide-footer": t(p).length < 10
156
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
157
+ i(U, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
158
+ default: C(() => [
159
+ (d(!0), y(h, null, q(t(p).filter(
160
+ (a) => a.name.toLowerCase().includes(t(s).searchKey.toLowerCase())
161
+ ), (a) => (d(), w(P, {
162
+ key: a._id.toString(),
163
+ onClick: (k) => f(a),
164
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
165
+ }, {
166
+ default: C(() => [
167
+ n("div", ce, [
168
+ n("div", le, [
169
+ (d(), w(O(t(S)(a)))),
170
+ n("div", me, g(a.currentReceive ?? 0) + " used ", 1)
171
+ ]),
172
+ n("div", de, [
173
+ n("div", ue, g(a.name), 1),
174
+ n("div", pe, g(t(V)(a)), 1)
175
+ ]),
176
+ n("div", fe, " Credit received: " + g(a.currentReceive ?? 0), 1)
177
+ ]),
178
+ i(F, {
179
+ icon: "delete",
180
+ "icon-color": "neutral-gray-400",
181
+ variant: "tertiary",
182
+ onClick: (k) => (k.stopPropagation(), x(a))
183
+ }, null, 8, ["onClick"])
184
+ ]),
185
+ _: 2
186
+ }, 1032, ["onClick"]))), 128))
187
+ ]),
188
+ _: 1
189
+ }),
190
+ t(p).length == 0 ? (d(), y("div", ye, [...o[6] || (o[6] = [
191
+ n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
192
+ ])])) : z("", !0)
193
+ ], 64)) : (d(), w(A, {
194
+ key: 1,
195
+ variant: "outlined",
196
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
197
+ }, {
198
+ default: C(() => [
199
+ o[7] || (o[7] = n("img", {
200
+ src: G,
201
+ class: "aspect-square w-[150px]"
202
+ }, null, -1)),
203
+ o[8] || (o[8] = n("div", { class: "flex flex-col gap-16 text-center" }, [
204
+ n("div", { class: "fm-typo-en-title-sm-800" }, "Create your credit program"),
205
+ n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credits are virtual money that customers can use to pay for their purchases, similar to cash within your store. ")
206
+ ], -1)),
207
+ i(F, {
208
+ variant: "primary",
209
+ label: "Create credit program",
210
+ icon: "add",
211
+ onClick: o[5] || (o[5] = (a) => f())
212
+ })
213
+ ]),
214
+ _: 1
215
+ })),
216
+ i(ae, {
217
+ ref_key: "sheetRef",
218
+ ref: b,
219
+ "onSubmit:modelValue": K
220
+ }, null, 512)
221
+ ])
222
+ ], 64);
223
+ };
224
+ }
225
+ });
226
+ export {
227
+ Ie as default
228
+ };
@@ -1,45 +1,45 @@
1
1
  import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, createCommentVNode, computed, onMounted, toDisplayString, createBlock, withCtx, Fragment, renderList, withModifiers, unref, isRef, createTextVNode, normalizeClass, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
2
2
  import { _ } from "./lodash-B5I3zXaY.js";
3
- import { z } from "./app-A-A8AXY4.js";
3
+ import { z } from "./app-BOG1dC8a.js";
4
4
  import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
5
- import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-C0gfY75c.js";
6
- import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-CzjctCKL.js";
7
- import { u as useMembershipStore } from "./membership-DRnWUdOc.js";
8
- import { u as useBusinessStore } from "./business-BkIoeq-Q.js";
9
- import "./index-DIN-0kYC.js";
10
- import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-CmqmCe3P.js";
5
+ import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-CR_hUukZ.js";
6
+ import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-C3jWvc1e.js";
7
+ import { u as useMembershipStore } from "./membership-D74wSltj.js";
8
+ import { u as useBusinessStore } from "./business--P6e14wH.js";
9
+ import "./index-YhB238q9.js";
10
+ import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-TwHL3OPZ.js";
11
11
  import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
12
12
  import { h as hooks } from "./moment-D7p2TMB-.js";
13
- import { f as featureVersionMapping } from "./campaign.enum-jpIcwh1C.js";
13
+ import { f as featureVersionMapping } from "./campaign.enum-Dj5o3Gnx.js";
14
14
  import { _ as _sfc_main$u } from "./ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js";
15
- import { b as _sfc_main$s, a as _sfc_main$v, _ as _sfc_main$x } from "./EffectSheet.vue_vue_type_style_index_0_lang-d67tWKfX.js";
16
- import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-C5BP2K1C.js";
17
- import { c as core, S as SvcConfig } from "./index-DEezTfBN.js";
18
- import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-D17305Np.js";
19
- import { C as Cb } from "./app-psmMhnbB.js";
20
- import { _ as _sfc_main$o } from "./SelectItems.vue_vue_type_script_setup_true_lang-IfFZG5uK.js";
15
+ import { b as _sfc_main$s, a as _sfc_main$v, _ as _sfc_main$x } from "./EffectSheet.vue_vue_type_style_index_0_lang-Bx_7FAYn.js";
16
+ import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DQmZE9_V.js";
17
+ import { c as core, S as SvcConfig } from "./index-CCzzmRaK.js";
18
+ import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-BVLU2dc_.js";
19
+ import { C as Cb } from "./app-jGPh064M.js";
20
+ import { _ as _sfc_main$o } from "./SelectItems.vue_vue_type_script_setup_true_lang-DbC6xTWH.js";
21
21
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-CHgC5LLL.js";
22
- import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-EZ42L0jN.js";
23
- import { _ as _sfc_main$p, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DCKbSowE.js";
24
- import { u as useI18n } from "./vue-i18n-CttzNDMl.js";
25
- import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-DsYBkR3I.js";
26
- import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-C3-IpjMr.js";
27
- import { C as CountryTimezone, m as moment } from "./timezone-CWS-nhUv.js";
28
- import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BgMw4FoF.js";
22
+ import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-DUQ0fU5s.js";
23
+ import { _ as _sfc_main$p, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Bd8pXLRT.js";
24
+ import { u as useI18n } from "./vue-i18n-BtpjMXUM.js";
25
+ import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-B4JMJKDj.js";
26
+ import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-DdaqUEEb.js";
27
+ import { C as CountryTimezone, m as moment } from "./timezone-DGJqaz8e.js";
28
+ import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-CtYg9lgQ.js";
29
29
  import { useCoreStore } from "@feedmepos/mf-common";
30
- import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-CgUFty-i.js";
31
- import { T as TEMPLATES } from "./index-BD7Rc0qN.js";
32
- import { v as FdoCreditLoyaltyReward, w as FdtoRandomReward, x as F_MISSION_TYPE, y as FdoThresholdCreditReward, z as FdtoThresholdReward, A as FdoMission } from "./index-Cs3ZFd92.js";
33
- import "./index-66ugkTKw.js";
34
- import "./index-DBN0XD-h.js";
35
- import { a as F_GAME_TYPE } from "./collectible.enum-PLiXkPXk.js";
36
- import { u as useLoading } from "./loading-CJIHUxKM.js";
37
- import { i as initCollectibleConfig } from "./helper-CnEOKaJw.js";
38
- import { C as CollectionUtils } from "./collection.fn-BEgw5oag.js";
30
+ import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-C5fm0K4i.js";
31
+ import { T as TEMPLATES } from "./index-Bv04ElXo.js";
32
+ import { v as FdoCreditLoyaltyReward, w as FdtoRandomReward, x as F_MISSION_TYPE, y as FdoThresholdCreditReward, z as FdtoThresholdReward, A as FdoMission } from "./index-BwBDTG0U.js";
33
+ import "./index-BcEhSpSd.js";
34
+ import "./index-B9iL1w4-.js";
35
+ import { a as F_GAME_TYPE } from "./collectible.enum-DQgguzyG.js";
36
+ import { u as useLoading } from "./loading-BIAeRmZo.js";
37
+ import { i as initCollectibleConfig } from "./helper-1FmJd7OP.js";
38
+ import { C as CollectionUtils } from "./collection.fn-1jzRWzrr.js";
39
39
  import { s as sentenceCase$1 } from "./index-CsaQJMAR.js";
40
- import "./index-DFqn9RQx.js";
40
+ import "./index-BRALrcjU.js";
41
41
  import { useDialog } from "@feedmepos/ui-library";
42
- import { u as useCampaignStore } from "./campaign-CERB2jjK.js";
42
+ import { u as useCampaignStore } from "./campaign-C_gQlNNb.js";
43
43
  import { a as cleanPF } from "./object-qECH92oz.js";
44
44
  function summarizeGrabDiscount(e) {
45
45
  if (!e)
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as P, ref as O, onMounted as Q, computed as H, resolveComponent as y, openBlock as s, createElementBlock as x, renderSlot as W, toDisplayString as w, createCommentVNode as v, createBlock as f, unref as e, isRef as q, createVNode as b, normalizeClass as G, watch as X, withCtx as F, resolveDynamicComponent as R, Fragment as _, createElementVNode as U, createTextVNode as ee } from "vue";
2
- import { z as te } from "./app-A-A8AXY4.js";
2
+ import { z as te } from "./app-BOG1dC8a.js";
3
3
  import { Z as u } from "./zod-Bg2FbC-D.js";
4
- import { g as le, f as oe } from "./index-DIN-0kYC.js";
5
- import { u as Z } from "./vue-i18n-CttzNDMl.js";
6
- import { s as C } from "./effect-BzkBC2cZ.js";
7
- import { p as ae } from "./plugins-D17305Np.js";
8
- import { e as ne } from "./app-psmMhnbB.js";
4
+ import { g as le, f as oe } from "./index-YhB238q9.js";
5
+ import { u as Z } from "./vue-i18n-BtpjMXUM.js";
6
+ import { s as C } from "./effect-dA2mpaCE.js";
7
+ import { p as ae } from "./plugins-BVLU2dc_.js";
8
+ import { e as ne } from "./app-jGPh064M.js";
9
9
  const ie = { class: "flex flex-col gap-8" }, se = {
10
10
  key: 0,
11
11
  class: "fm-typo-en-body-lg-600"
@@ -0,0 +1,229 @@
1
+ import { defineComponent as E, ref as S, computed as U, onMounted as j, resolveComponent as m, openBlock as p, createElementBlock as _, Fragment as x, createVNode as i, unref as o, createElementVNode as a, withCtx as h, renderList as M, createBlock as w, resolveDynamicComponent as H, toDisplayString as u, h as q } from "vue";
2
+ import { _ as z } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
+ import { p as Q } from "./plugins-BVLU2dc_.js";
5
+ import { u as W } from "./loading-BIAeRmZo.js";
6
+ import { u as X } from "./business--P6e14wH.js";
7
+ import { u as Y } from "./campaign-C_gQlNNb.js";
8
+ import { a as L, b as V, g as Z } from "./campaign-CR_hUukZ.js";
9
+ import { u as ee } from "./vue-i18n-BtpjMXUM.js";
10
+ import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
+ import { _ as oe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-FxEXBhTK.js";
12
+ import { u as ne } from "./template-DlLEQKFu.js";
13
+ import { c as g } from "./index-C0uZD6Fb.js";
14
+ const ae = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ie = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ie = /* @__PURE__ */ E({
15
+ __name: "Experience",
16
+ setup(_e) {
17
+ const { t: r } = ee(), P = {
18
+ label: r("connect.program.common.actions.create", {
19
+ type: r("connect.program.experience.title").toLowerCase()
20
+ }),
21
+ value: "create",
22
+ isPrimary: !0,
23
+ prependIcon: "add"
24
+ }, B = ne("POINT", G()), I = X(), d = Y(), { global: T, minor: v } = W, s = S({
25
+ searchKey: "",
26
+ location: []
27
+ });
28
+ function $(e) {
29
+ const t = s.value.location;
30
+ return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
31
+ var c;
32
+ return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
33
+ }) : e.targetLocation.includes(t);
34
+ }
35
+ const f = U(
36
+ () => d.campaigns.experience.filter((e) => $(e))
37
+ ), K = [
38
+ {
39
+ header: "Program title",
40
+ accessorFn: (e) => e.name
41
+ },
42
+ {
43
+ header: "Status",
44
+ accessorFn: (e) => Z(e),
45
+ cell(e) {
46
+ return L(e.row.original);
47
+ }
48
+ },
49
+ {
50
+ header: "Summary",
51
+ accessorFn: (e) => V(e)
52
+ //v.effect,
53
+ },
54
+ {
55
+ header: "Actions",
56
+ cell(e) {
57
+ return q(J.FmButton, {
58
+ variant: "tertiary",
59
+ icon: "delete",
60
+ iconColor: "neutral-gray-400",
61
+ onClick: (t) => {
62
+ t.stopPropagation(), C(e.row.original);
63
+ }
64
+ });
65
+ }
66
+ }
67
+ ], b = S();
68
+ async function C(e) {
69
+ await Q.remove(`Are you sure you want to remove ${e.name}?`) && await v(
70
+ async () => {
71
+ await g.delete(e._id), await d.read("POINT");
72
+ },
73
+ {
74
+ message: `Removing ${e.name}`,
75
+ successMessage: `Removed ${e.name} successfully`
76
+ }
77
+ );
78
+ }
79
+ async function y(e) {
80
+ e ? await t() : B.open(async (l) => {
81
+ await t(l);
82
+ });
83
+ async function t(l) {
84
+ var c;
85
+ (c = b.value) == null || c.showSheet(
86
+ !0,
87
+ "POINT",
88
+ e ? await g.readById(e._id) : void 0,
89
+ l
90
+ );
91
+ }
92
+ }
93
+ async function N(e) {
94
+ await v(
95
+ async () => {
96
+ e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await d.read("POINT");
97
+ },
98
+ {
99
+ message: r("connect.program.common.update.updating", {
100
+ type: r("connect.program.experience.title")
101
+ }),
102
+ successMessage: r("connect.program.common.update.success", {
103
+ type: r("connect.program.experience.title"),
104
+ action: e.campaign._id ? "updated" : "created"
105
+ })
106
+ }
107
+ );
108
+ }
109
+ return j(async () => {
110
+ await T(async () => {
111
+ await d.read("POINT");
112
+ });
113
+ }), (e, t) => {
114
+ const l = m("FmPageHead"), c = m("FmSearch"), R = m("FmTable"), F = m("FmButton"), A = m("FmListItem"), O = m("FmList"), D = m("FmCard");
115
+ return p(), _(x, null, [
116
+ i(l, {
117
+ title: o(r)("connect.program.experience.title"),
118
+ actions: o(f).length > 0 ? [P] : [],
119
+ "onClick:action": t[0] || (t[0] = () => y())
120
+ }, null, 8, ["title", "actions"]),
121
+ a("div", ae, [
122
+ i(c, {
123
+ modelValue: o(s).searchKey,
124
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => o(s).searchKey = n),
125
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
126
+ placeholder: o(r)("connect.program.common.search"),
127
+ collapsible: ""
128
+ }, null, 8, ["modelValue", "placeholder"]),
129
+ o(d).campaigns.experience && o(d).campaigns.experience.length > 0 ? (p(), _(x, { key: 0 }, [
130
+ a("div", re, [
131
+ a("div", se, [
132
+ i(te, {
133
+ label: `${o(r)("connect.common.location")}: `,
134
+ "right-icon": "keyboard_arrow_down",
135
+ modelValue: o(s).location,
136
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => o(s).location = n),
137
+ icon: "storefront",
138
+ "show-item-label": !0,
139
+ items: o(I).locationOptions
140
+ }, null, 8, ["label", "modelValue", "items"])
141
+ ]),
142
+ i(c, {
143
+ modelValue: o(s).searchKey,
144
+ "onUpdate:modelValue": t[3] || (t[3] = (n) => o(s).searchKey = n),
145
+ class: "xs:hidden",
146
+ placeholder: "search",
147
+ collapsible: ""
148
+ }, null, 8, ["modelValue"])
149
+ ]),
150
+ i(R, {
151
+ class: "xs:hidden",
152
+ "row-data": o(f),
153
+ "column-defs": K,
154
+ "search-value": o(s).searchKey,
155
+ "column-filter": [],
156
+ onRowClick: t[4] || (t[4] = (n) => y(n.original)),
157
+ "hide-footer": o(f).length < 10
158
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
159
+ i(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
160
+ default: h(() => [
161
+ (p(!0), _(x, null, M(o(f).filter(
162
+ (n) => n.name.toLowerCase().includes(o(s).searchKey.toLowerCase())
163
+ ), (n) => (p(), w(A, {
164
+ key: n._id.toString(),
165
+ onClick: (k) => y(n),
166
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
167
+ }, {
168
+ default: h(() => [
169
+ a("div", ie, [
170
+ a("div", ce, [
171
+ (p(), w(H(o(L)(n)))),
172
+ a("div", le, u(n.currentReceive ?? 0) + " used ", 1)
173
+ ]),
174
+ a("div", me, [
175
+ a("div", de, u(n.name), 1),
176
+ a("div", pe, u(o(V)(n)), 1)
177
+ ]),
178
+ a("div", ue, u(o(r)("connect.program.experience.received", {
179
+ count: n.currentReceive ?? 0
180
+ })), 1)
181
+ ]),
182
+ i(F, {
183
+ icon: "delete",
184
+ "icon-color": "neutral-gray-400",
185
+ variant: "tertiary",
186
+ onClick: (k) => (k.stopPropagation(), C(n))
187
+ }, null, 8, ["onClick"])
188
+ ]),
189
+ _: 2
190
+ }, 1032, ["onClick"]))), 128))
191
+ ]),
192
+ _: 1
193
+ })
194
+ ], 64)) : (p(), w(D, {
195
+ key: 1,
196
+ variant: "outlined",
197
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
198
+ }, {
199
+ default: h(() => [
200
+ t[6] || (t[6] = a("img", {
201
+ src: z,
202
+ class: "aspect-square w-[150px]"
203
+ }, null, -1)),
204
+ a("div", fe, [
205
+ a("div", ye, u(o(r)("connect.program.experience.empty_state.title")), 1),
206
+ a("div", ge, u(o(r)("connect.program.experience.empty_state.description")), 1)
207
+ ]),
208
+ i(F, {
209
+ variant: "primary",
210
+ label: "Create experience program",
211
+ icon: "add",
212
+ onClick: t[5] || (t[5] = (n) => y())
213
+ })
214
+ ]),
215
+ _: 1
216
+ })),
217
+ i(oe, {
218
+ ref_key: "sheetRef",
219
+ ref: b,
220
+ "onSubmit:modelValue": N
221
+ }, null, 512)
222
+ ])
223
+ ], 64);
224
+ };
225
+ }
226
+ });
227
+ export {
228
+ Ie as default
229
+ };