@feedmepos/mf-connect 0.1.58-prod → 0.1.60-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 (129) hide show
  1. package/dist/Analytic-CB0xAr9Q.js +427 -0
  2. package/dist/App-fp_3oll7.js +4630 -0
  3. package/dist/Bin-CPEbn14A.js +166 -0
  4. package/dist/Broadcast-jKp2iB8c.js +233 -0
  5. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CmJG893h.js +121 -0
  6. package/dist/Card-BaPJkgd2.js +911 -0
  7. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  8. package/dist/Collections-Bqsg-ON3.js +458 -0
  9. package/dist/Credit-C9zIva1h.js +228 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSMV8OwA.js +2194 -0
  12. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Doyw0pvU.js +348 -0
  13. package/dist/Experience-CCI_oesa.js +229 -0
  14. package/dist/FileSaver.min-NlMItPOc.js +74 -0
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  16. package/dist/Game-CRMVz1JP.js +284 -0
  17. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +144 -0
  18. package/dist/Index-szNiSnjR.js +259 -0
  19. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  20. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
  21. package/dist/MainLayout-B1aJoR95.js +41 -0
  22. package/dist/Marketing-AvEiNiD9.js +319 -0
  23. package/dist/Member-DIZwt6Hh.js +279 -0
  24. package/dist/MemberList-dxteIRWn.js +1607 -0
  25. package/dist/MemberOverview-wL_ailso.js +58 -0
  26. package/dist/MemberTransactions-Q3phmXfI.js +45 -0
  27. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BLk8rX-T.js +60553 -0
  28. package/dist/Mission-CZjySlcS.js +302 -0
  29. package/dist/Overview-BXbWEDy3.js +1079 -0
  30. package/dist/Point-CgjNc_Qn.js +232 -0
  31. package/dist/Promotion-COYo3qLi.js +289 -0
  32. package/dist/Queue-BLIStJth.js +260 -0
  33. package/dist/Record-BWoTvVEE.js +341 -0
  34. package/dist/Reward-Dq6GxHMP.js +442 -0
  35. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CR1feHth.js +150 -0
  36. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DuYYfbOH.js +1763 -0
  37. package/dist/Segment-CUfn6k5R.js +882 -0
  38. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CxycOqNJ.js +181 -0
  39. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C7jqrfEj.js +188 -0
  40. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CMmdbYH4.js +147 -0
  41. package/dist/Setting-CC5AiQSy.js +1928 -0
  42. package/dist/SettingAdvertisements-DHQTaMC1.js +262 -0
  43. package/dist/Store-CEgv5aOD.js +1842 -0
  44. package/dist/StoreRewards-Dtzk_YG2.js +423 -0
  45. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cwt8pmoM.js +995 -0
  46. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BEU2u1-a.js +139 -0
  47. package/dist/Tier-1xqQvWzc.js +895 -0
  48. package/dist/Title-Da-G8plz.js +566 -0
  49. package/dist/Transaction-B0vuVZFZ.js +39 -0
  50. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-e4-wNfrg.js +130 -0
  51. package/dist/Voucher-DLFjkXLu.js +384 -0
  52. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-5X7dGFD9.js +419 -0
  53. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BPTrvEwa.js +56 -0
  54. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  55. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  56. package/dist/app-Do_C3F_N.js +7094 -0
  57. package/dist/app-o7Kvv5aK.js +57962 -0
  58. package/dist/app-wDQR6dpb.js +39 -0
  59. package/dist/app.js +6 -0
  60. package/dist/business-BDi-QTa5.js +82 -0
  61. package/dist/campaign-BHqizYy6.js +1810 -0
  62. package/dist/campaign-CpzFl8Vr.js +4 -0
  63. package/dist/campaign-DNXI3K9c.js +94 -0
  64. package/dist/campaign.enum-BXDwYoeA.js +20 -0
  65. package/dist/campaign.fn-Rws4mJa5.js +758 -0
  66. package/dist/collectible.enum-cMc4fL1T.js +19 -0
  67. package/dist/collection.fn-F8FZ7Dnr.js +26 -0
  68. package/dist/dto-CAtf1jq0.js +216 -0
  69. package/dist/effect-Dhg1ZIrL.js +78 -0
  70. package/dist/email-addresses-BZJZwglQ.js +705 -0
  71. package/dist/export-B6yvRuct.js +97 -0
  72. package/dist/feedme.ico +0 -0
  73. package/dist/helper-VoErinsY.js +71 -0
  74. package/dist/index-B0Pzwzkd.js +31 -0
  75. package/dist/index-Bq6FwMwW.js +32 -0
  76. package/dist/index-BvE6Sbog.js +3 -0
  77. package/dist/index-BysJoGFD.js +146 -0
  78. package/dist/index-C8m_F_I4.js +121 -0
  79. package/dist/index-CQZinjc9.js +54 -0
  80. package/dist/index-Cq7s1Pk2.js +76 -0
  81. package/dist/index-CuvNtC_M.js +61 -0
  82. package/dist/index-DOGrOlB8.js +8859 -0
  83. package/dist/index-Di23nMJ7.js +38 -0
  84. package/dist/index-Dkyb4P6T.js +30076 -0
  85. package/dist/index-DvZiQOtl.js +3077 -0
  86. package/dist/index-Ved5V90A.js +2155 -0
  87. package/dist/index-d4A3r8kv.js +32269 -0
  88. package/dist/index-vh86FiIQ.js +10 -0
  89. package/dist/index-y7IqG-tl.js +44 -0
  90. package/dist/index.esm2017-CRTpUsW5.js +3069 -0
  91. package/dist/loading-CoUrS63J.js +71 -0
  92. package/dist/lodash-B5I3zXaY.js +3678 -0
  93. package/dist/membership-BiQwBHAA.js +235 -0
  94. package/dist/moment-D7p2TMB-.js +2583 -0
  95. package/dist/money-CA3gpWD3.js +15 -0
  96. package/dist/number-CgmVpwHm.js +12 -0
  97. package/dist/object-qECH92oz.js +26 -0
  98. package/dist/objectId-dwaoBfJX.js +7 -0
  99. package/dist/objectid-C80eoTvt.js +145 -0
  100. package/dist/plugins-BkWtR_R5.js +208 -0
  101. package/dist/reward-D7SKofYj.js +36 -0
  102. package/dist/rule-Cpxty5PH.js +1951 -0
  103. package/dist/rule-builder-d_TMgXEC.js +102 -0
  104. package/dist/style.css +4 -0
  105. package/dist/template-BB7bab5R.js +190 -0
  106. package/dist/tier-BJDhpH6X.js +4 -0
  107. package/dist/tiers/tier=1.png +0 -0
  108. package/dist/tiers/tier=2.png +0 -0
  109. package/dist/tiers/tier=3.png +0 -0
  110. package/dist/tiers/tier=4.png +0 -0
  111. package/dist/timezone-Dj3UaenF.js +1151 -0
  112. package/dist/titles/type=diamond.png +0 -0
  113. package/dist/titles/type=drinks.png +0 -0
  114. package/dist/titles/type=food.png +0 -0
  115. package/dist/titles/type=heart.png +0 -0
  116. package/dist/titles/type=medal.png +0 -0
  117. package/dist/titles/type=spend.png +0 -0
  118. package/dist/titles/type=thank-you.png +0 -0
  119. package/dist/titles/type=thumbs-up.png +0 -0
  120. package/dist/titles/type=years.png +0 -0
  121. package/dist/trigger-ZVR5eR1H.js +144 -0
  122. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  123. package/dist/type_drinks-D6jnpvwV.js +4 -0
  124. package/dist/usePagination-Ds-cuHop.js +223 -0
  125. package/dist/user-DjRqnFsC.js +54 -0
  126. package/dist/vue-i18n-BlCNfIcP.js +2365 -0
  127. package/dist/xlsx-CtNr_GAa.js +15491 -0
  128. package/dist/zod-Bg2FbC-D.js +90 -0
  129. package/package.json +1 -1
@@ -0,0 +1,348 @@
1
+ import { defineComponent as P, ref as O, onMounted as Q, computed as H, resolveComponent as y, openBlock as i, createElementBlock as x, renderSlot as W, toDisplayString as w, createCommentVNode as v, createBlock as c, unref as e, isRef as q, createVNode as F, normalizeClass as G, watch as X, withCtx as b, resolveDynamicComponent as D, Fragment as _, createElementVNode as U, createTextVNode as ee } from "vue";
2
+ import { z as te } from "./app-Do_C3F_N.js";
3
+ import { Z as u } from "./zod-Bg2FbC-D.js";
4
+ import { f as le, g as oe } from "./index-DOGrOlB8.js";
5
+ import { u as Z } from "./vue-i18n-BlCNfIcP.js";
6
+ import { s as R } from "./effect-Dhg1ZIrL.js";
7
+ import { p as ae } from "./plugins-BkWtR_R5.js";
8
+ import { e as ne } from "./app-o7Kvv5aK.js";
9
+ const ie = { class: "flex flex-col gap-8" }, de = {
10
+ key: 0,
11
+ class: "fm-typo-en-body-lg-600"
12
+ }, se = { key: 1 }, me = {
13
+ key: 2,
14
+ class: "space-y-16"
15
+ }, re = /* @__PURE__ */ P({
16
+ __name: "ValidityInput",
17
+ props: {
18
+ label: {
19
+ type: String
20
+ },
21
+ disabled: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ type: {
26
+ type: String,
27
+ default: void 0
28
+ },
29
+ modelValue: {
30
+ type: Object,
31
+ required: !0
32
+ },
33
+ forCredit: {
34
+ type: Boolean,
35
+ default: !1
36
+ },
37
+ helperText: {
38
+ type: String
39
+ }
40
+ },
41
+ emits: ["update:model-value"],
42
+ setup(t, { emit: g }) {
43
+ var A, B;
44
+ const { t: s } = Z(), l = t, S = g, o = [
45
+ { label: s("connect.template.validity_option.date_range"), value: "range" },
46
+ { label: s("connect.template.validity_option.custom"), value: "custom" }
47
+ ], a = O(!1);
48
+ Q(() => {
49
+ a.value = l.modelValue && Object.entries(l.modelValue).filter(
50
+ ([p, r]) => p != "followFirstReceive" && r != null
51
+ ).length > 0;
52
+ });
53
+ const n = O(
54
+ l.type ? o.find((p) => p.value === l.type) : (A = l.modelValue) != null && A.validBefore || (B = l.modelValue) != null && B.validAfter ? o[0] : o[1]
55
+ ), h = H(
56
+ () => l.forCredit ? le : oe
57
+ ), m = H(() => {
58
+ const p = h.value.safeParse(l.modelValue);
59
+ return p.success ? [] : p.error.errors;
60
+ });
61
+ function d(p) {
62
+ S("update:model-value", p);
63
+ }
64
+ function C(p) {
65
+ var r, k;
66
+ if (p.value == "range")
67
+ return d({
68
+ followFirstReceive: (r = l.modelValue) == null ? void 0 : r.followFirstReceive,
69
+ validAfter: void 0,
70
+ validBefore: void 0
71
+ });
72
+ if (p.value == "custom")
73
+ return a.value = !1, d({
74
+ validForDay: (k = l.modelValue) == null ? void 0 : k.validForDay
75
+ });
76
+ }
77
+ return (p, r) => {
78
+ var I, $, j, E, M, N, L, z;
79
+ const k = y("FmButtonGroup"), Y = y("FmSimpleDateRangePicker"), J = y("FmSwitch"), K = y("FmStepperField"), T = y("FmHelperText");
80
+ return i(), x("div", ie, [
81
+ W(p.$slots, "label", {}, () => [
82
+ t.label ? (i(), x("div", de, w(t.label), 1)) : v("", !0)
83
+ ]),
84
+ t.type ? v("", !0) : (i(), c(k, {
85
+ key: 0,
86
+ modelValue: e(n),
87
+ "onUpdate:modelValue": [
88
+ r[0] || (r[0] = (f) => q(n) ? n.value = f : null),
89
+ r[1] || (r[1] = (f) => C(f))
90
+ ],
91
+ items: o
92
+ }, null, 8, ["modelValue"])),
93
+ e(n).value === "range" ? (i(), x("div", se, [
94
+ F(Y, {
95
+ "model-value": {
96
+ startDate: (I = t.modelValue) != null && I.validAfter ? new Date(($ = t.modelValue) == null ? void 0 : $.validAfter).toISOString() : null,
97
+ endDate: (j = t.modelValue) != null && j.validAfter ? new Date(((E = t.modelValue) == null ? void 0 : E.validBefore) || "").toISOString() : null
98
+ },
99
+ "onUpdate:modelValue": r[2] || (r[2] = (f) => {
100
+ var V;
101
+ d({
102
+ followFirstReceive: (V = l.modelValue) == null ? void 0 : V.followFirstReceive,
103
+ validAfter: new Date(f.startDate).toISOString(),
104
+ validBefore: new Date(f.endDate).toISOString()
105
+ });
106
+ })
107
+ }, null, 8, ["model-value"])
108
+ ])) : e(n).value === "custom" ? (i(), x("div", me, [
109
+ t.forCredit ? v("", !0) : (i(), c(J, {
110
+ key: 0,
111
+ "model-value": e(a),
112
+ label: e(s)("connect.template.validity_option.expire"),
113
+ "label-placement": "right",
114
+ "onUpdate:modelValue": r[3] || (r[3] = (f) => {
115
+ var V;
116
+ a.value = f, d({
117
+ validForDay: f ? 1 : void 0,
118
+ followFirstReceive: (V = l.modelValue) == null ? void 0 : V.followFirstReceive
119
+ });
120
+ })
121
+ }, null, 8, ["model-value", "label"])),
122
+ e(a) || t.forCredit ? (i(), c(K, {
123
+ key: 1,
124
+ label: e(s)("connect.template.validity_option.after_day"),
125
+ class: G([{
126
+ "opacity-50 pointer-events-none": !e(a) && !t.forCredit
127
+ }, "mt-[-4px]"]),
128
+ "max-fraction-digits": 0,
129
+ disabled: !e(a) && !t.forCredit,
130
+ "show-steppers": !1,
131
+ max: 99999,
132
+ "append-text": e(s)("connect.template.validity_option.days"),
133
+ "model-value": ((M = l.modelValue) == null ? void 0 : M.validForDay) ?? null,
134
+ "onUpdate:modelValue": r[4] || (r[4] = (f) => {
135
+ var V;
136
+ return d({
137
+ validForDay: f == null ? void 0 : parseInt(f.toString()),
138
+ followFirstReceive: (V = l.modelValue) == null ? void 0 : V.followFirstReceive
139
+ });
140
+ })
141
+ }, null, 8, ["label", "class", "disabled", "append-text", "model-value"])) : v("", !0)
142
+ ])) : v("", !0),
143
+ ((N = l.modelValue) == null ? void 0 : N.followFirstReceive) === !0 && e(a) ? (i(), c(T, {
144
+ key: 3,
145
+ text: e(s)("connect.template.validity_option.expire_follow_first_receive")
146
+ }, null, 8, ["text"])) : v("", !0),
147
+ F(T, {
148
+ text: t.helperText || (((L = l.modelValue) == null ? void 0 : L.validForDay) === 0 ? e(s)("connect.template.validity_option.expires_on_same_day") : e(u).helperText(e(m), "")),
149
+ state: t.helperText ? "error" : ((z = l.modelValue) == null ? void 0 : z.validForDay) === 0 ? "warning" : e(u).helperState(e(m), "")
150
+ }, null, 8, ["text", "state"])
151
+ ]);
152
+ };
153
+ }
154
+ }), ue = { class: "space-y-8" }, he = /* @__PURE__ */ P({
155
+ __name: "CollectibleOptionInput",
156
+ props: {
157
+ modelValue: {
158
+ type: Object
159
+ },
160
+ noCampaign: {
161
+ type: Boolean
162
+ },
163
+ schema: {
164
+ type: Object,
165
+ default: () => te.any()
166
+ },
167
+ isMission: {
168
+ type: Boolean,
169
+ default: !1
170
+ }
171
+ },
172
+ emits: ["update:model-value"],
173
+ setup(t, { emit: g }) {
174
+ const { t: s } = Z(), l = t, S = g, o = O(l.modelValue ?? {});
175
+ return X(o, () => S("update:model-value", o.value)), (a, n) => {
176
+ const h = y("FmSwitch"), m = y("FmStepperField");
177
+ return i(), x("div", ue, [
178
+ t.isMission ? v("", !0) : (i(), c(h, {
179
+ key: 0,
180
+ label: e(s)("connect.template.enable_transfer"),
181
+ "label-placement": "right",
182
+ modelValue: e(o).enableTransfer,
183
+ "onUpdate:modelValue": n[0] || (n[0] = (d) => e(o).enableTransfer = d)
184
+ }, null, 8, ["label", "modelValue"])),
185
+ t.noCampaign ? v("", !0) : (i(), x("div", {
186
+ key: 1,
187
+ class: G(["grid gap-16", t.isMission ? "" : "grid-cols-2"])
188
+ }, [
189
+ F(m, {
190
+ modelValue: e(o).maxPerUser,
191
+ "onUpdate:modelValue": n[1] || (n[1] = (d) => e(o).maxPerUser = d),
192
+ "show-steppers": !1,
193
+ rules: [e(u).ruleAtPath(t.schema, "maxPerUser")],
194
+ "helper-text": e(s)("connect.template.leave_empty_unlimited")
195
+ }, {
196
+ label: b(() => [
197
+ (i(), c(D(
198
+ e(u).toInputLabel(
199
+ e(u).typeAtPath(t.schema, "maxPerUser"),
200
+ e(s)("connect.template.max_per_user")
201
+ )
202
+ )))
203
+ ]),
204
+ _: 1
205
+ }, 8, ["modelValue", "rules", "helper-text"]),
206
+ t.isMission ? v("", !0) : (i(), c(m, {
207
+ key: 0,
208
+ modelValue: e(o).maxReceive,
209
+ "onUpdate:modelValue": n[2] || (n[2] = (d) => e(o).maxReceive = d),
210
+ "show-steppers": !1,
211
+ rules: [e(u).ruleAtPath(t.schema, "maxReceive")],
212
+ "helper-text": e(s)("connect.template.leave_empty_unlimited")
213
+ }, {
214
+ label: b(() => [
215
+ (i(), c(D(
216
+ e(u).toInputLabel(
217
+ e(u).typeAtPath(t.schema, "maxReceive"),
218
+ e(s)("connect.template.max_distribute")
219
+ )
220
+ )))
221
+ ]),
222
+ _: 1
223
+ }, 8, ["modelValue", "rules", "helper-text"]))
224
+ ], 2)),
225
+ t.isMission ? v("", !0) : (i(), x(_, { key: 2 }, [
226
+ F(m, {
227
+ modelValue: e(o).maxUse,
228
+ "onUpdate:modelValue": n[3] || (n[3] = (d) => e(o).maxUse = d),
229
+ "append-text": "use(s)",
230
+ "show-steppers": !1,
231
+ rules: [e(u).ruleAtPath(t.schema, "maxUse")]
232
+ }, {
233
+ label: b(() => [
234
+ (i(), c(D(
235
+ e(u).toInputLabel(
236
+ e(u).typeAtPath(t.schema, "maxUse"),
237
+ e(s)("connect.template.usage_count")
238
+ )
239
+ )))
240
+ ]),
241
+ _: 1
242
+ }, 8, ["modelValue", "rules"]),
243
+ e(o).maxUse && e(o).maxUse > 1 ? (i(), c(m, {
244
+ key: 0,
245
+ modelValue: e(o).cooldown,
246
+ "onUpdate:modelValue": n[4] || (n[4] = (d) => e(o).cooldown = d),
247
+ "append-text": "minute(s)",
248
+ "show-steppers": !1,
249
+ rules: [e(u).ruleAtPath(t.schema, "cooldown")]
250
+ }, {
251
+ label: b(() => [
252
+ (i(), c(D(
253
+ e(u).toInputLabel(
254
+ e(u).typeAtPath(t.schema, "cooldown"),
255
+ e(s)("connect.template.cooldown")
256
+ )
257
+ )))
258
+ ]),
259
+ _: 1
260
+ }, 8, ["modelValue", "rules"])) : v("", !0),
261
+ F(re, {
262
+ modelValue: e(o).validityOption,
263
+ "onUpdate:modelValue": n[5] || (n[5] = (d) => e(o).validityOption = d),
264
+ label: e(s)("connect.template.validity_option.title")
265
+ }, null, 8, ["modelValue", "label"])
266
+ ], 64))
267
+ ]);
268
+ };
269
+ }
270
+ }), pe = { class: "space-y-8" }, ce = {
271
+ key: 1,
272
+ class: "border-1 rounded-md flex gap-16 items-center justify-between px-16 py-12"
273
+ }, fe = { class: "fm-typo-en-body-lg-400" }, ve = { class: "text-fm-color-typo-secondary" }, Ae = /* @__PURE__ */ P({
274
+ __name: "EffectSheet",
275
+ props: {
276
+ modelValue: { type: Object },
277
+ canSetAutoApply: {
278
+ type: Boolean
279
+ }
280
+ },
281
+ emits: ["update:model-value"],
282
+ setup(t, { emit: g }) {
283
+ const s = g, l = O(!1);
284
+ async function S(o) {
285
+ o.stopPropagation(), await ae.remove("Are you sure you want to remove this effect?") && s("update:model-value", null);
286
+ }
287
+ return (o, a) => {
288
+ const n = y("FmButton"), h = y("FmSideSheet");
289
+ return i(), c(h, {
290
+ "max-width": 550,
291
+ header: "Apply discount",
292
+ modelValue: e(l),
293
+ "onUpdate:modelValue": [
294
+ a[2] || (a[2] = (m) => q(l) ? l.value = m : null),
295
+ a[3] || (a[3] = (m) => l.value = m)
296
+ ]
297
+ }, {
298
+ "side-sheet-button": b(() => {
299
+ var m, d, C, A;
300
+ return [
301
+ U("div", pe, [
302
+ a[4] || (a[4] = U("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Configure the discount you want to offer your customer. ", -1)),
303
+ t.modelValue ? (i(), x("div", ce, [
304
+ U("div", fe, [
305
+ U("div", null, w((m = e(R)(t.modelValue)) == null ? void 0 : m.type), 1),
306
+ U("div", ve, w((d = e(R)(t.modelValue)) == null ? void 0 : d.adjustment) + " with " + w((C = e(R)(t.modelValue)) == null ? void 0 : C.requirements) + " " + w((A = e(R)(t.modelValue)) == null ? void 0 : A.maxCap), 1)
307
+ ]),
308
+ F(n, {
309
+ icon: "delete",
310
+ "icon-color": "neutral-gray-400",
311
+ variant: "tertiary",
312
+ onClick: S
313
+ })
314
+ ])) : (i(), c(n, {
315
+ key: 0,
316
+ label: "Apply discount",
317
+ icon: "add",
318
+ "icon-color": "primary",
319
+ variant: "secondary",
320
+ class: "border-fm-color-primary text-fm-color-primary"
321
+ }))
322
+ ])
323
+ ];
324
+ }),
325
+ "side-sheet-footer": b(() => [...a[5] || (a[5] = [
326
+ ee(w(void 0), -1)
327
+ ])]),
328
+ default: b(() => [
329
+ F(e(ne), {
330
+ class: "fm-effect-sheet",
331
+ title: "",
332
+ "can-set-auto-apply": t.canSetAutoApply,
333
+ "disable-effects": t.canSetAutoApply ? ["PAYMENT"] : void 0,
334
+ "initial-value": t.modelValue,
335
+ onOnConfirm: a[0] || (a[0] = (m) => (s("update:model-value", m), l.value = !1)),
336
+ onOnCancel: a[1] || (a[1] = (m) => l.value = !1)
337
+ }, null, 8, ["can-set-auto-apply", "disable-effects", "initial-value"])
338
+ ]),
339
+ _: 1
340
+ }, 8, ["modelValue"]);
341
+ };
342
+ }
343
+ });
344
+ export {
345
+ Ae as _,
346
+ he as a,
347
+ re as b
348
+ };
@@ -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-BkWtR_R5.js";
5
+ import { u as W } from "./loading-CoUrS63J.js";
6
+ import { u as X } from "./business-BDi-QTa5.js";
7
+ import { u as Y } from "./campaign-DNXI3K9c.js";
8
+ import { a as L, b as V, g as Z } from "./campaign-BHqizYy6.js";
9
+ import { u as ee } from "./vue-i18n-BlCNfIcP.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-CSMV8OwA.js";
12
+ import { u as ne } from "./template-BB7bab5R.js";
13
+ import { c as g } from "./index-C8m_F_I4.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
+ };
@@ -0,0 +1,74 @@
1
+ import { c as s } from "./_commonjsHelpers-BkfeUUK-.js";
2
+ var E = { exports: {} };
3
+ (function(h, j) {
4
+ (function(p, i) {
5
+ i();
6
+ })(s, function() {
7
+ function p(e, t) {
8
+ return typeof t > "u" ? t = { autoBom: !1 } : typeof t != "object" && (console.warn("Deprecated: Expected third argument to be a object"), t = { autoBom: !t }), t.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type) ? new Blob(["\uFEFF", e], { type: e.type }) : e;
9
+ }
10
+ function i(e, t, r) {
11
+ var n = new XMLHttpRequest();
12
+ n.open("GET", e), n.responseType = "blob", n.onload = function() {
13
+ u(n.response, t, r);
14
+ }, n.onerror = function() {
15
+ console.error("could not download file");
16
+ }, n.send();
17
+ }
18
+ function v(e) {
19
+ var t = new XMLHttpRequest();
20
+ t.open("HEAD", e, !1);
21
+ try {
22
+ t.send();
23
+ } catch {
24
+ }
25
+ return 200 <= t.status && 299 >= t.status;
26
+ }
27
+ function l(e) {
28
+ try {
29
+ e.dispatchEvent(new MouseEvent("click"));
30
+ } catch {
31
+ var t = document.createEvent("MouseEvents");
32
+ t.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), e.dispatchEvent(t);
33
+ }
34
+ }
35
+ var a = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof s == "object" && s.global === s ? s : void 0, w = a.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), u = a.saveAs || (typeof window != "object" || window !== a ? function() {
36
+ } : "download" in HTMLAnchorElement.prototype && !w ? function(e, t, r) {
37
+ var n = a.URL || a.webkitURL, o = document.createElement("a");
38
+ t = t || e.name || "download", o.download = t, o.rel = "noopener", typeof e == "string" ? (o.href = e, o.origin === location.origin ? l(o) : v(o.href) ? i(e, t, r) : l(o, o.target = "_blank")) : (o.href = n.createObjectURL(e), setTimeout(function() {
39
+ n.revokeObjectURL(o.href);
40
+ }, 4e4), setTimeout(function() {
41
+ l(o);
42
+ }, 0));
43
+ } : "msSaveOrOpenBlob" in navigator ? function(e, t, r) {
44
+ if (t = t || e.name || "download", typeof e != "string") navigator.msSaveOrOpenBlob(p(e, r), t);
45
+ else if (v(e)) i(e, t, r);
46
+ else {
47
+ var n = document.createElement("a");
48
+ n.href = e, n.target = "_blank", setTimeout(function() {
49
+ l(n);
50
+ });
51
+ }
52
+ } : function(e, t, r, n) {
53
+ if (n = n || open("", "_blank"), n && (n.document.title = n.document.body.innerText = "downloading..."), typeof e == "string") return i(e, t, r);
54
+ var o = e.type === "application/octet-stream", b = /constructor/i.test(a.HTMLElement) || a.safari, m = /CriOS\/[\d]+/.test(navigator.userAgent);
55
+ if ((m || o && b || w) && typeof FileReader < "u") {
56
+ var d = new FileReader();
57
+ d.onloadend = function() {
58
+ var c = d.result;
59
+ c = m ? c : c.replace(/^data:[^;]*;/, "data:attachment/file;"), n ? n.location.href = c : location = c, n = null;
60
+ }, d.readAsDataURL(e);
61
+ } else {
62
+ var y = a.URL || a.webkitURL, f = y.createObjectURL(e);
63
+ n ? n.location = f : location.href = f, n = null, setTimeout(function() {
64
+ y.revokeObjectURL(f);
65
+ }, 4e4);
66
+ }
67
+ });
68
+ a.saveAs = u.saveAs = u, h.exports = u;
69
+ });
70
+ })(E);
71
+ var R = E.exports;
72
+ export {
73
+ R as F
74
+ };