@feedmepos/mf-connect 0.0.39-prod → 0.1.0-beta.2

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 (101) hide show
  1. package/dist/Analytic-DSD9TsKr.js +622 -0
  2. package/dist/{App-X3fNEBF3.js → App-D8a5eW51.js} +250 -249
  3. package/dist/Broadcast-C8jgMe6g.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CRYS_tzZ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-pG8WvV4I.js} +20 -20
  5. package/dist/Card-C1K7ULPo.js +825 -0
  6. package/dist/Collections-lMrdPUuM.js +453 -0
  7. package/dist/Credit-CJfU5tP4.js +220 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DoZyevfa.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYoaa_-x.js} +1042 -1011
  9. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CzEtOmp0.js +345 -0
  10. package/dist/Experience-Bp2ki8gU.js +221 -0
  11. package/dist/Game-BpTf6ebE.js +255 -0
  12. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  13. package/dist/{MainLayout-DpZC6o3R.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +19 -53
  14. package/dist/MainLayout-B1aJoR95.js +41 -0
  15. package/dist/Marketing-BiKE2gxA.js +316 -0
  16. package/dist/Member-BSWyy32a.js +69 -0
  17. package/dist/MemberList-CHlGREyR.js +1733 -0
  18. package/dist/MemberOverview-wL_ailso.js +58 -0
  19. package/dist/{MemberTransactions-DueaXBCy.js → MemberTransactions-BzHiXCnp.js} +1 -1
  20. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-e-zWg08J.js +432 -0
  21. package/dist/Mission-8IGT3T2C.js +261 -0
  22. package/dist/Point-CbbJ6ohd.js +222 -0
  23. package/dist/Promotion-BYXCJa_S.js +247 -0
  24. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-_RX1J0Br.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bruh-umZ.js} +557 -557
  25. package/dist/Segment-DXDNM0yd.js +437 -0
  26. package/dist/Setting-CLpvvZTv.js +1901 -0
  27. package/dist/Store-C6-P6bwc.js +1511 -0
  28. package/dist/StoreRewards-CUM2irXK.js +401 -0
  29. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CLFiuO5k.js → StoreTransactions.vue_vue_type_script_setup_true_lang-JaRdmqif.js} +10 -10
  30. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CoMQBL4P.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DEb4OBcX.js} +1 -1
  31. package/dist/{Tier-CftEoP_R.js → Tier-DZTDxWBo.js} +481 -453
  32. package/dist/{Title-BsavXbYh.js → Title-C2Dr5ceK.js} +314 -295
  33. package/dist/Transaction-BL4mS29d.js +39 -0
  34. package/dist/Voucher-Cx0r2-df.js +490 -0
  35. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-DWuAODUF.js +56 -0
  36. package/dist/{app-BNmAx3zq.js → app-B_xuZ5HB.js} +1 -1
  37. package/dist/app-wE5HTF_Y.js +5762 -0
  38. package/dist/app.js +5 -3
  39. package/dist/{business-DGL4Ayx0.js → business-DSv8zM8C.js} +1 -1
  40. package/dist/{campaign-D94sS1kM.js → campaign-7y5qquHZ.js} +5 -3
  41. package/dist/{collection.fn-BHJ1ISqO.js → collection.fn-BxVZQAx0.js} +2 -2
  42. package/dist/dto-Ew1QwLci.js +2778 -0
  43. package/dist/{effect-CFRICzlM.js → effect-BzPh8fRI.js} +9 -9
  44. package/dist/{export-w2o9NYcy.js → export-C9tDplkA.js} +3 -3
  45. package/dist/{helper-CUDWQ8vq.js → helper-Sz7oQ0F4.js} +1 -1
  46. package/dist/{index-BGuLhEym.js → index-BQm0C3Jm.js} +3 -3
  47. package/dist/{index-BjwyxNSp.js → index-C-SOz7jt.js} +1 -1
  48. package/dist/{index-BcWJcD9f.js → index-C0lpADCo.js} +1 -1
  49. package/dist/{index-DIq2KVis.js → index-C3_4GUiI.js} +1 -1
  50. package/dist/{index-BPEV5Tzg.js → index-D-2nFLsg.js} +59 -47
  51. package/dist/{index-CFMBSL24.js → index-DBMaUGYI.js} +2 -2
  52. package/dist/{index-CpwFQFTV.js → index-DH_1nOJ_.js} +3 -3
  53. package/dist/index-Dy4pmQpt.js +29193 -0
  54. package/dist/{index-BQ6isIeo.js → index-_3qBsogG.js} +1 -1
  55. package/dist/index-gIRszcHf.js +3 -0
  56. package/dist/{index-VjUw31dN.js → index-tv4t0Pnh.js} +1 -1
  57. package/dist/{index-tZ1aqhks.js → index-z0IfdrZk.js} +319 -281
  58. package/dist/{index.esm2017-zciuPty-.js → index.esm2017-BnKJDxUo.js} +55 -55
  59. package/dist/{loading-GuXe5bYG.js → loading-Ds-yFYhc.js} +469 -460
  60. package/dist/{membership-BHWJVI3e.js → membership-DaiVw9qF.js} +3 -3
  61. package/dist/money-BHtBdZoz.js +15 -0
  62. package/dist/number-CZhcB8ef.js +12 -0
  63. package/dist/{rule-MgNa_8FF.js → rule-Cd2M6Ri2.js} +2 -2
  64. package/dist/{rule-builder-BsBCWzq_.js → rule-builder-B6og27Q1.js} +1 -1
  65. package/dist/style.css +1 -1
  66. package/dist/{template-D6k3lusq.js → template-DouRWBpv.js} +63 -63
  67. package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
  68. package/dist/vue-i18n-BTlOChXs.js +2365 -0
  69. package/dist/{xlsx-ClrA4KOh.js → xlsx-SahfXQ70.js} +517 -517
  70. package/dist/zod-Bg2FbC-D.js +90 -0
  71. package/package.json +7 -4
  72. package/dist/Analytic-DMFueUju.js +0 -620
  73. package/dist/Broadcast-YIfWIXeA.js +0 -216
  74. package/dist/Card-BIxlgQm7.js +0 -824
  75. package/dist/Collections-M6DaHM2W.js +0 -441
  76. package/dist/Credit-BtRy-xoY.js +0 -214
  77. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D5DNTBSQ.js +0 -344
  78. package/dist/Experience-DGm1lnqj.js +0 -211
  79. package/dist/Game-B8-lG7qq.js +0 -250
  80. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
  81. package/dist/Marketing-DtG3AIWr.js +0 -309
  82. package/dist/Member-K443-9Vy.js +0 -92
  83. package/dist/MemberList-CYXHXFTL.js +0 -1735
  84. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  85. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Bk2HLVmt.js +0 -203
  86. package/dist/Mission-CN5umXXA.js +0 -248
  87. package/dist/Point-XAm6H2p_.js +0 -220
  88. package/dist/Promotion-DsrA4KiE.js +0 -244
  89. package/dist/Segment-CZGGHoAu.js +0 -435
  90. package/dist/Setting-BjfxLKyp.js +0 -1870
  91. package/dist/Store-D_B-vhh3.js +0 -1513
  92. package/dist/StoreRewards-BjHffUKj.js +0 -429
  93. package/dist/Transaction-CdxzoKDG.js +0 -36
  94. package/dist/Voucher-B_9Nv1Mr.js +0 -485
  95. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
  96. package/dist/app--1Ks5Hms.js +0 -2974
  97. package/dist/dto-X0Eeujxx.js +0 -1151
  98. package/dist/index-BPNG8N-w.js +0 -11
  99. package/dist/index-DWM9MWGj.js +0 -28058
  100. package/dist/money-CrttVpCp.js +0 -15
  101. package/dist/number-CIndGU4O.js +0 -12
@@ -1,344 +0,0 @@
1
- import { defineComponent as O, ref as R, onMounted as J, computed as z, resolveComponent as y, openBlock as s, createElementBlock as x, renderSlot as K, toDisplayString as S, createCommentVNode as f, createBlock as p, unref as e, isRef as H, createVNode as b, normalizeClass as q, watch as Q, withCtx as F, resolveDynamicComponent as k, Fragment as W, createElementVNode as A, createTextVNode as X } from "vue";
2
- import { z as _ } from "./app--1Ks5Hms.js";
3
- import { Z as d } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
4
- import { g as ee, h as te } from "./index-BQ6isIeo.js";
5
- import { s as C } from "./effect-CFRICzlM.js";
6
- import { p as le } from "./loading-GuXe5bYG.js";
7
- import { I as oe } from "./app-BNmAx3zq.js";
8
- const ae = { class: "flex flex-col gap-8" }, ne = {
9
- key: 0,
10
- class: "fm-typo-en-body-lg-600"
11
- }, se = { key: 1 }, ie = {
12
- key: 2,
13
- class: "space-y-16"
14
- }, de = /* @__PURE__ */ O({
15
- __name: "ValidityInput",
16
- props: {
17
- label: {
18
- type: String
19
- },
20
- disabled: {
21
- type: Boolean,
22
- default: !1
23
- },
24
- type: {
25
- type: String,
26
- default: void 0
27
- },
28
- modelValue: {
29
- type: Object,
30
- required: !0
31
- },
32
- forCredit: {
33
- type: Boolean,
34
- default: !1
35
- },
36
- helperText: {
37
- type: String
38
- }
39
- },
40
- emits: ["update:model-value"],
41
- setup(t, { emit: h }) {
42
- var g, P;
43
- const n = t, c = h, a = [
44
- { label: "Date Range", value: "range" },
45
- { label: "Custom", value: "custom" }
46
- ], u = R(!1);
47
- J(() => {
48
- u.value = n.modelValue && Object.entries(n.modelValue).filter(
49
- ([r, i]) => r != "followFirstReceive" && i != null
50
- ).length > 0;
51
- });
52
- const l = R(
53
- n.type ? a.find((r) => r.value === n.type) : (g = n.modelValue) != null && g.validBefore || (P = n.modelValue) != null && P.validAfter ? a[0] : a[1]
54
- ), w = z(
55
- () => n.forCredit ? ee : te
56
- ), v = z(() => {
57
- const r = w.value.safeParse(n.modelValue);
58
- return r.success ? [] : r.error.errors;
59
- });
60
- function o(r) {
61
- c("update:model-value", r);
62
- }
63
- function U(r) {
64
- var i, D;
65
- if (r.value == "range")
66
- return o({
67
- followFirstReceive: (i = n.modelValue) == null ? void 0 : i.followFirstReceive,
68
- validAfter: void 0,
69
- validBefore: void 0
70
- });
71
- if (r.value == "custom")
72
- return u.value = !1, o({
73
- validForDay: (D = n.modelValue) == null ? void 0 : D.validForDay
74
- });
75
- }
76
- return (r, i) => {
77
- var T, I, E, M, $, j, N, L;
78
- const D = y("FmButtonGroup"), G = y("FmSimpleDateRangePicker"), Z = y("FmSwitch"), Y = y("FmStepperField"), B = y("FmHelperText");
79
- return s(), x("div", ae, [
80
- K(r.$slots, "label", {}, () => [
81
- t.label ? (s(), x("div", ne, S(t.label), 1)) : f("", !0)
82
- ]),
83
- t.type ? f("", !0) : (s(), p(D, {
84
- key: 0,
85
- modelValue: e(l),
86
- "onUpdate:modelValue": [
87
- i[0] || (i[0] = (m) => H(l) ? l.value = m : null),
88
- i[1] || (i[1] = (m) => U(m))
89
- ],
90
- items: a
91
- }, null, 8, ["modelValue"])),
92
- e(l).value === "range" ? (s(), x("div", se, [
93
- b(G, {
94
- "model-value": {
95
- startDate: (T = t.modelValue) != null && T.validAfter ? new Date((I = t.modelValue) == null ? void 0 : I.validAfter).toISOString() : null,
96
- endDate: (E = t.modelValue) != null && E.validAfter ? new Date(((M = t.modelValue) == null ? void 0 : M.validBefore) || "").toISOString() : null
97
- },
98
- "onUpdate:modelValue": i[2] || (i[2] = (m) => {
99
- var V;
100
- o({
101
- followFirstReceive: (V = n.modelValue) == null ? void 0 : V.followFirstReceive,
102
- validAfter: new Date(m.startDate).toISOString(),
103
- validBefore: new Date(m.endDate).toISOString()
104
- });
105
- })
106
- }, null, 8, ["model-value"])
107
- ])) : e(l).value === "custom" ? (s(), x("div", ie, [
108
- b(Z, {
109
- "model-value": e(u),
110
- label: "Expires",
111
- "label-placement": "right",
112
- "onUpdate:modelValue": i[3] || (i[3] = (m) => {
113
- var V;
114
- u.value = m, o({
115
- validForDay: m ? 1 : void 0,
116
- followFirstReceive: (V = n.modelValue) == null ? void 0 : V.followFirstReceive
117
- });
118
- })
119
- }, null, 8, ["model-value"]),
120
- e(u) ? (s(), p(Y, {
121
- key: 0,
122
- label: "After (days)",
123
- class: q([{
124
- "opacity-50 pointer-events-none": !e(u)
125
- }, "mt-[-4px]"]),
126
- "max-fraction-digits": 0,
127
- disabled: !e(u),
128
- "show-steppers": !1,
129
- max: 99999,
130
- "append-text": "day(s)",
131
- "model-value": (($ = n.modelValue) == null ? void 0 : $.validForDay) ?? null,
132
- "onUpdate:modelValue": i[4] || (i[4] = (m) => {
133
- var V;
134
- return o({
135
- validForDay: m == null ? void 0 : parseInt(m.toString()),
136
- followFirstReceive: (V = n.modelValue) == null ? void 0 : V.followFirstReceive
137
- });
138
- })
139
- }, null, 8, ["class", "disabled", "model-value"])) : f("", !0)
140
- ])) : f("", !0),
141
- ((j = n.modelValue) == null ? void 0 : j.followFirstReceive) === !0 && e(u) ? (s(), p(B, {
142
- key: 3,
143
- text: "Expiry follows the first receive"
144
- })) : f("", !0),
145
- b(B, {
146
- text: t.helperText || (((N = n.modelValue) == null ? void 0 : N.validForDay) === 0 ? "Expires on the same day" : e(d).helperText(e(v), "")),
147
- state: t.helperText ? "error" : ((L = n.modelValue) == null ? void 0 : L.validForDay) === 0 ? "warning" : e(d).helperState(e(v), "")
148
- }, null, 8, ["text", "state"])
149
- ]);
150
- };
151
- }
152
- }), re = { class: "space-y-8" }, he = /* @__PURE__ */ O({
153
- __name: "CollectibleOptionInput",
154
- props: {
155
- modelValue: {
156
- type: Object
157
- },
158
- noCampaign: {
159
- type: Boolean
160
- },
161
- schema: {
162
- type: Object,
163
- default: () => _.any()
164
- },
165
- isMission: {
166
- type: Boolean,
167
- default: !1
168
- }
169
- },
170
- emits: ["update:model-value"],
171
- setup(t, { emit: h }) {
172
- const n = t, c = h, a = R(n.modelValue ?? {});
173
- return Q(a, () => c("update:model-value", a.value)), (u, l) => {
174
- const w = y("FmSwitch"), v = y("FmStepperField");
175
- return s(), x("div", re, [
176
- t.isMission ? f("", !0) : (s(), p(w, {
177
- key: 0,
178
- label: "Enable Transfer",
179
- "label-placement": "right",
180
- modelValue: e(a).enableTransfer,
181
- "onUpdate:modelValue": l[0] || (l[0] = (o) => e(a).enableTransfer = o)
182
- }, null, 8, ["modelValue"])),
183
- t.noCampaign ? f("", !0) : (s(), x("div", {
184
- key: 1,
185
- class: q(["grid gap-16", t.isMission ? "" : "grid-cols-2"])
186
- }, [
187
- b(v, {
188
- modelValue: e(a).maxPerUser,
189
- "onUpdate:modelValue": l[1] || (l[1] = (o) => e(a).maxPerUser = o),
190
- "show-steppers": !1,
191
- rules: [e(d).ruleAtPath(t.schema, "maxPerUser")]
192
- }, {
193
- label: F(() => [
194
- (s(), p(k(
195
- e(d).toInputLabel(
196
- e(d).typeAtPath(t.schema, "maxPerUser"),
197
- "Max per user"
198
- )
199
- )))
200
- ]),
201
- _: 1
202
- }, 8, ["modelValue", "rules"]),
203
- t.isMission ? f("", !0) : (s(), p(v, {
204
- key: 0,
205
- modelValue: e(a).maxReceive,
206
- "onUpdate:modelValue": l[2] || (l[2] = (o) => e(a).maxReceive = o),
207
- "show-steppers": !1,
208
- rules: [e(d).ruleAtPath(t.schema, "maxReceive")]
209
- }, {
210
- label: F(() => [
211
- (s(), p(k(
212
- e(d).toInputLabel(
213
- e(d).typeAtPath(t.schema, "maxReceive"),
214
- "Max distribute"
215
- )
216
- )))
217
- ]),
218
- _: 1
219
- }, 8, ["modelValue", "rules"]))
220
- ], 2)),
221
- t.isMission ? f("", !0) : (s(), x(W, { key: 2 }, [
222
- b(v, {
223
- modelValue: e(a).maxUse,
224
- "onUpdate:modelValue": l[3] || (l[3] = (o) => e(a).maxUse = o),
225
- "append-text": "use(s)",
226
- "show-steppers": !1,
227
- rules: [e(d).ruleAtPath(t.schema, "maxUse")]
228
- }, {
229
- label: F(() => [
230
- (s(), p(k(
231
- e(d).toInputLabel(
232
- e(d).typeAtPath(t.schema, "maxUse"),
233
- "Usage count"
234
- )
235
- )))
236
- ]),
237
- _: 1
238
- }, 8, ["modelValue", "rules"]),
239
- e(a).maxUse && e(a).maxUse > 1 ? (s(), p(v, {
240
- key: 0,
241
- modelValue: e(a).cooldown,
242
- "onUpdate:modelValue": l[4] || (l[4] = (o) => e(a).cooldown = o),
243
- "append-text": "minute(s)",
244
- "show-steppers": !1,
245
- rules: [e(d).ruleAtPath(t.schema, "cooldown")]
246
- }, {
247
- label: F(() => [
248
- (s(), p(k(
249
- e(d).toInputLabel(
250
- e(d).typeAtPath(t.schema, "cooldown"),
251
- "Cooldown"
252
- )
253
- )))
254
- ]),
255
- _: 1
256
- }, 8, ["modelValue", "rules"])) : f("", !0),
257
- b(de, {
258
- modelValue: e(a).validityOption,
259
- "onUpdate:modelValue": l[5] || (l[5] = (o) => e(a).validityOption = o),
260
- label: "Validity option"
261
- }, null, 8, ["modelValue"])
262
- ], 64))
263
- ]);
264
- };
265
- }
266
- }), ue = { class: "space-y-8" }, me = /* @__PURE__ */ A("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Configure the discount you want to offer your customer. ", -1), pe = {
267
- key: 1,
268
- class: "border-1 rounded-md flex gap-16 items-center justify-between px-16 py-12"
269
- }, ce = { class: "fm-typo-en-body-lg-400" }, fe = { class: "text-fm-color-typo-secondary" }, ge = /* @__PURE__ */ O({
270
- __name: "EffectSheet",
271
- props: {
272
- modelValue: { type: Object },
273
- canSetAutoApply: {
274
- type: Boolean
275
- }
276
- },
277
- emits: ["update:model-value"],
278
- setup(t, { emit: h }) {
279
- const n = h, c = R(!1);
280
- async function a(u) {
281
- u.stopPropagation(), await le.remove("Are you sure you want to remove this effect?") && n("update:model-value", null);
282
- }
283
- return (u, l) => {
284
- const w = y("FmButton"), v = y("FmSideSheet");
285
- return s(), p(v, {
286
- "max-width": 550,
287
- header: "Apply discount",
288
- modelValue: e(c),
289
- "onUpdate:modelValue": [
290
- l[2] || (l[2] = (o) => H(c) ? c.value = o : null),
291
- l[3] || (l[3] = (o) => c.value = o)
292
- ]
293
- }, {
294
- "side-sheet-button": F(() => {
295
- var o, U, g;
296
- return [
297
- A("div", ue, [
298
- me,
299
- t.modelValue ? (s(), x("div", pe, [
300
- A("div", ce, [
301
- A("div", null, S((o = e(C)(t.modelValue)) == null ? void 0 : o.type), 1),
302
- A("div", fe, S((U = e(C)(t.modelValue)) == null ? void 0 : U.adjustment) + " with " + S((g = e(C)(t.modelValue)) == null ? void 0 : g.requirements), 1)
303
- ]),
304
- b(w, {
305
- icon: "delete",
306
- "icon-color": "neutral-gray-400",
307
- variant: "tertiary",
308
- onClick: a
309
- })
310
- ])) : (s(), p(w, {
311
- key: 0,
312
- label: "Apply discount",
313
- icon: "add",
314
- "icon-color": "primary",
315
- variant: "secondary",
316
- class: "border-fm-color-primary text-fm-color-primary"
317
- }))
318
- ])
319
- ];
320
- }),
321
- "side-sheet-footer": F(() => [
322
- X(S(void 0))
323
- ]),
324
- default: F(() => [
325
- b(e(oe), {
326
- class: "fm-effect-sheet",
327
- title: "",
328
- "can-set-auto-apply": t.canSetAutoApply,
329
- "disable-effects": t.canSetAutoApply ? ["PAYMENT"] : void 0,
330
- "initial-value": t.modelValue,
331
- onOnConfirm: l[0] || (l[0] = (o) => (n("update:model-value", o), c.value = !1)),
332
- onOnCancel: l[1] || (l[1] = (o) => c.value = !1)
333
- }, null, 8, ["can-set-auto-apply", "disable-effects", "initial-value"])
334
- ]),
335
- _: 1
336
- }, 8, ["modelValue"]);
337
- };
338
- }
339
- });
340
- export {
341
- ge as _,
342
- he as a,
343
- de as b
344
- };
@@ -1,211 +0,0 @@
1
- import { defineComponent as O, ref as k, computed as U, onMounted as A, resolveComponent as i, openBlock as c, createElementBlock as g, Fragment as _, createVNode as r, unref as a, createElementVNode as n, withCtx as h, renderList as D, createBlock as x, resolveDynamicComponent as j, toDisplayString as f, h as M } from "vue";
2
- import { _ as H } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as q, components as z } from "@feedmepos/ui-library";
4
- import { u as G, p as J } from "./loading-GuXe5bYG.js";
5
- import { u as Q } from "./business-DGL4Ayx0.js";
6
- import { u as W } from "./campaign-D94sS1kM.js";
7
- import { g as S, b as V } from "./dto-X0Eeujxx.js";
8
- import { _ as X } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as Y } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DoZyevfa.js";
10
- import { u as Z } from "./template-D6k3lusq.js";
11
- import { c as y } from "./index-BjwyxNSp.js";
12
- const ee = { class: "px-24 flex flex-col gap-y-16" }, te = { class: "flex items-center justify-between w-full" }, oe = { class: "flex gap-8 overflow-x-auto" }, ae = { class: "space-y-8" }, ne = { class: "flex w-full gap-4 items-center" }, se = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, re = { class: "space-y-4" }, ie = { class: "fm-typo-en-body-lg-600" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = /* @__PURE__ */ n("img", {
13
- src: H,
14
- class: "aspect-square w-[150px]"
15
- }, null, -1), de = /* @__PURE__ */ n("div", { class: "flex flex-col gap-16 text-center" }, [
16
- /* @__PURE__ */ n("div", { class: "fm-typo-en-title-sm-800" }, "Create experience program"),
17
- /* @__PURE__ */ n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Experience help customers gain membership tiers. The more they interact and spend, the higher their membership level, unlocking more rewards and benefits. ")
18
- ], -1), Fe = /* @__PURE__ */ O({
19
- __name: "Experience",
20
- setup(pe) {
21
- const L = {
22
- label: "Create campaign",
23
- value: "create",
24
- isPrimary: !0,
25
- prependIcon: "add"
26
- }, P = Z("POINT", q()), I = Q(), l = W(), { global: T, minor: w } = G, s = k({
27
- searchKey: "",
28
- location: null
29
- }), p = U(
30
- () => l.campaigns.experience.filter(
31
- (e) => !s.value.location || !e.targetLocation || e.targetLocation.includes(s.value.location)
32
- )
33
- ), B = [
34
- {
35
- header: "Program title",
36
- accessorFn: (e) => e.name
37
- },
38
- {
39
- header: "Status",
40
- cell(e) {
41
- return S(e.row.original);
42
- }
43
- },
44
- {
45
- header: "Summary",
46
- accessorFn: (e) => V(e)
47
- //v.effect,
48
- },
49
- {
50
- header: "Actions",
51
- cell(e) {
52
- return M(z.FmButton, {
53
- variant: "tertiary",
54
- icon: "delete",
55
- iconColor: "neutral-gray-400",
56
- onClick: (o) => {
57
- o.stopPropagation(), v(e.row.original);
58
- }
59
- });
60
- }
61
- }
62
- ], b = k();
63
- async function v(e) {
64
- await J.remove(`Are you sure you want to remove ${e.name}?`) && await w(
65
- async () => {
66
- await y.delete(e._id), await l.read("POINT");
67
- },
68
- {
69
- message: `Removing ${e.name}`,
70
- successMessage: `Removed ${e.name} successfully`
71
- }
72
- );
73
- }
74
- async function u(e) {
75
- e ? await o() : P.open(async (m) => {
76
- await o(m);
77
- });
78
- async function o(m) {
79
- var d;
80
- (d = b.value) == null || d.showSheet(
81
- !0,
82
- "POINT",
83
- e ? await y.readById(e._id) : void 0,
84
- m
85
- );
86
- }
87
- }
88
- async function $(e) {
89
- await w(
90
- async () => {
91
- e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await l.read("POINT");
92
- },
93
- {
94
- message: `${e.campaign._id ? "Updating" : "Creating"} experience program`,
95
- successMessage: `Experience program ${e.campaign._id ? "updated" : "created"} successfully`
96
- }
97
- );
98
- }
99
- return A(async () => {
100
- await T(async () => {
101
- await l.read("POINT");
102
- });
103
- }), (e, o) => {
104
- const m = i("FmPageHead"), d = i("FmSearch"), E = i("FmTable"), C = i("FmButton"), K = i("FmListItem"), N = i("FmList"), R = i("FmCard");
105
- return c(), g(_, null, [
106
- r(m, {
107
- title: "Experience",
108
- actions: a(p).length > 0 ? [L] : [],
109
- "onClick:action": o[0] || (o[0] = () => u())
110
- }, null, 8, ["actions"]),
111
- n("div", ee, [
112
- r(d, {
113
- modelValue: a(s).searchKey,
114
- "onUpdate:modelValue": o[1] || (o[1] = (t) => a(s).searchKey = t),
115
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
116
- placeholder: "search",
117
- collapsible: ""
118
- }, null, 8, ["modelValue"]),
119
- a(l).campaigns.experience && a(l).campaigns.experience.length > 0 ? (c(), g(_, { key: 0 }, [
120
- n("div", te, [
121
- n("div", oe, [
122
- r(X, {
123
- modelValue: a(s).location,
124
- "onUpdate:modelValue": o[2] || (o[2] = (t) => a(s).location = t),
125
- label: "Location: ",
126
- "show-item-label": !0,
127
- icon: "storefront",
128
- placement: "bottom-start",
129
- items: a(I).locationItems
130
- }, null, 8, ["modelValue", "items"])
131
- ]),
132
- r(d, {
133
- modelValue: a(s).searchKey,
134
- "onUpdate:modelValue": o[3] || (o[3] = (t) => a(s).searchKey = t),
135
- class: "xs:hidden",
136
- placeholder: "search",
137
- collapsible: ""
138
- }, null, 8, ["modelValue"])
139
- ]),
140
- r(E, {
141
- class: "xs:hidden",
142
- "row-data": a(p),
143
- "column-defs": B,
144
- "search-value": a(s).searchKey,
145
- "column-filter": [],
146
- onRowClick: o[4] || (o[4] = (t) => u(t.original)),
147
- "hide-footer": a(p).length < 10
148
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
149
- r(N, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
150
- default: h(() => [
151
- (c(!0), g(_, null, D(a(p).filter(
152
- (t) => t.name.toLowerCase().includes(a(s).searchKey.toLowerCase())
153
- ), (t) => (c(), x(K, {
154
- key: t._id.toString(),
155
- onClick: (F) => u(t),
156
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
157
- }, {
158
- default: h(() => [
159
- n("div", ae, [
160
- n("div", ne, [
161
- (c(), x(j(a(S)(t)))),
162
- n("div", se, f(t.currentReceive ?? 0) + " used ", 1)
163
- ]),
164
- n("div", re, [
165
- n("div", ie, f(t.name), 1),
166
- n("div", le, f(a(V)(t)), 1)
167
- ]),
168
- n("div", ce, " Experience received: " + f(t.currentReceive ?? 0), 1)
169
- ]),
170
- r(C, {
171
- icon: "delete",
172
- "icon-color": "neutral-gray-400",
173
- variant: "tertiary",
174
- onClick: (F) => (F.stopPropagation(), v(t))
175
- }, null, 8, ["onClick"])
176
- ]),
177
- _: 2
178
- }, 1032, ["onClick"]))), 128))
179
- ]),
180
- _: 1
181
- })
182
- ], 64)) : (c(), x(R, {
183
- key: 1,
184
- variant: "outlined",
185
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
186
- }, {
187
- default: h(() => [
188
- me,
189
- de,
190
- r(C, {
191
- variant: "primary",
192
- label: "Create experience program",
193
- icon: "add",
194
- onClick: o[5] || (o[5] = (t) => u())
195
- })
196
- ]),
197
- _: 1
198
- })),
199
- r(Y, {
200
- ref_key: "sheetRef",
201
- ref: b,
202
- "onSubmit:modelValue": $
203
- }, null, 512)
204
- ])
205
- ], 64);
206
- };
207
- }
208
- });
209
- export {
210
- Fe as default
211
- };