@feedmepos/mf-connect 0.0.16-beta.10 → 0.0.16-beta.11

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 (86) hide show
  1. package/dist/{Analytic-BVk0jPDU.js → Analytic-Gq7PoNer.js} +32 -20
  2. package/dist/{App-BbAalq1k.js → App-Cikl5jnp.js} +33 -27
  3. package/dist/Broadcast-DU3JnBwZ.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DiU3MnH0.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0I8IZIR.js} +18 -11
  5. package/dist/Card-hIeQ5XUH.js +825 -0
  6. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  7. package/dist/Collections-B1SC1rr7.js +453 -0
  8. package/dist/{Credit-Bc9EzdsC.js → Credit-BgwI8DR3.js} +78 -69
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.js +2788 -0
  10. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-DPgu45MD.js +344 -0
  11. package/dist/{Experience-CgKak5ik.js → Experience-C2Q-zqV6.js} +64 -55
  12. package/dist/{Game-QhfKqrN_.js → Game-DU2pZDGk.js} +54 -45
  13. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  14. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  15. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
  16. package/dist/MainLayout-B1aJoR95.js +41 -0
  17. package/dist/{Marketing-CSx4N7UJ.js → Marketing-DWiTQp9I.js} +79 -72
  18. package/dist/{Member-CY6WMD8D.js → Member-BEXKBFry.js} +25 -22
  19. package/dist/{MemberList-8iRwm7Sz.js → MemberList-DzMdajIf.js} +321 -307
  20. package/dist/{MemberTransactions-CknqkWO3.js → MemberTransactions-Bciankuu.js} +1 -1
  21. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DH25Hfk3.js +432 -0
  22. package/dist/{Mission-BTy1p7lU.js → Mission-KzwRlaA5.js} +50 -40
  23. package/dist/{Point-A6B_ggSy.js → Point-CSKvZXHc.js} +67 -58
  24. package/dist/Promotion-IiwPhx8p.js +221 -0
  25. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-4zIO3oCr.js +1751 -0
  26. package/dist/{Segment-CFVXtyEj.js → Segment-2Q0PonBb.js} +145 -130
  27. package/dist/{Setting-Jmtw-_DV.js → Setting-Df5vVRt4.js} +167 -154
  28. package/dist/{Store-DQypT-7e.js → Store-C0WXCKs6.js} +504 -489
  29. package/dist/{StoreRewards-M-utm0iI.js → StoreRewards-eSSIO0nk.js} +124 -108
  30. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-B60mQ5kq.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BjnCRKGX.js} +131 -123
  31. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-b0xTcoEp.js +139 -0
  32. package/dist/{Tier-D1jymeLK.js → Tier-v-1FkRU-.js} +144 -125
  33. package/dist/{Title-DN9DIP2k.js → Title-CQ2JWqBW.js} +107 -90
  34. package/dist/{Transaction-BAJvAoU6.js → Transaction-0OouN_6s.js} +2 -2
  35. package/dist/Voucher-CL0cgogx.js +488 -0
  36. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js +55 -0
  37. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  38. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  39. package/dist/app-Bd19eW7X.js +5381 -0
  40. package/dist/app-CfS25Z66.js +34797 -0
  41. package/dist/app-wDQR6dpb.js +39 -0
  42. package/dist/app.js +2 -1
  43. package/dist/business-dQh3AEot.js +78 -0
  44. package/dist/campaign-BOl8AgKA.js +96 -0
  45. package/dist/campaign-CpzFl8Vr.js +4 -0
  46. package/dist/collection.fn-B_YsXmrP.js +26 -0
  47. package/dist/dto-B8NfyVPG.js +1169 -0
  48. package/dist/effect-C2jCStXO.js +61 -0
  49. package/dist/{export-DjeNY5Pc.js → export-BtZc3Yzh.js} +19 -16
  50. package/dist/helper-8oGsrM56.js +71 -0
  51. package/dist/index-6FkKY3q0.js +73 -0
  52. package/dist/index-C7oeXRUl.js +95 -0
  53. package/dist/index-CZKYIefW.js +203 -0
  54. package/dist/index-C_0IFnwi.js +2071 -0
  55. package/dist/index-CuvNtC_M.js +61 -0
  56. package/dist/index-DCixRRvz.js +761 -0
  57. package/dist/index-DFgt4-VW.js +38 -0
  58. package/dist/index-DYDhH9bi.js +8832 -0
  59. package/dist/index-Dbd4WA4r.js +61 -0
  60. package/dist/index-Di-kWSmf.js +1737 -0
  61. package/dist/index-Dn0jdj0o.js +28058 -0
  62. package/dist/index-DwKqFNF6.js +3 -0
  63. package/dist/index-HoacsZDk.js +291 -0
  64. package/dist/index-UTQHDUdW.js +94 -0
  65. package/dist/loading-D_AN6p24.js +32697 -0
  66. package/dist/lodash-B5I3zXaY.js +3678 -0
  67. package/dist/membership-Ccrx9R6r.js +221 -0
  68. package/dist/moment-BWErdI6_.js +2578 -0
  69. package/dist/money-waD-f-Zz.js +15 -0
  70. package/dist/number-CwTGGsh9.js +12 -0
  71. package/dist/object-qECH92oz.js +26 -0
  72. package/dist/objectId-dwaoBfJX.js +7 -0
  73. package/dist/rule-DJ07h3Gh.js +1973 -0
  74. package/dist/rule-builder-DJ-acvVD.js +89 -0
  75. package/dist/template-clxvNnbF.js +190 -0
  76. package/dist/usePagination-BeF5K3M7.js +223 -0
  77. package/dist/vue-i18n-BxwiXSkp.js +2365 -0
  78. package/dist/xlsx-BB366cdN.js +15491 -0
  79. package/dist/zod-W_PvIofQ.js +90 -0
  80. package/package.json +2 -2
  81. package/dist/Card-B5in1RMa.js +0 -805
  82. package/dist/Collections-CFCZ9YIG.js +0 -4
  83. package/dist/MainLayout-JbHzENFy.js +0 -4
  84. package/dist/app-BpzzygYP.js +0 -87765
  85. package/dist/money-DKGIIplY.js +0 -15
  86. package/dist/number-tPodRxTN.js +0 -12
@@ -0,0 +1,344 @@
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 A, 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 h, createTextVNode as X } from "vue";
2
+ import { z as _ } from "./app-Bd19eW7X.js";
3
+ import { Z as d } from "./zod-W_PvIofQ.js";
4
+ import { g as ee, h as te } from "./index-DYDhH9bi.js";
5
+ import { s as C } from "./effect-C2jCStXO.js";
6
+ import { p as le } from "./loading-D_AN6p24.js";
7
+ import { s as oe } from "./app-CfS25Z66.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: g }) {
42
+ var S, P;
43
+ const n = t, c = g, 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) : (S = n.modelValue) != null && S.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, E, I, 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, A(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((E = t.modelValue) == null ? void 0 : E.validAfter).toISOString() : null,
96
+ endDate: (I = t.modelValue) != null && I.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" }, we = /* @__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: g }) {
172
+ const n = t, c = g, 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 = {
267
+ key: 1,
268
+ class: "border-1 rounded-md flex gap-16 items-center justify-between px-16 py-12"
269
+ }, pe = { class: "fm-typo-en-body-lg-400" }, ce = { 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: g }) {
279
+ const n = g, 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, S;
296
+ return [
297
+ h("div", ue, [
298
+ l[4] || (l[4] = h("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Configure the discount you want to offer your customer. ", -1)),
299
+ t.modelValue ? (s(), x("div", me, [
300
+ h("div", pe, [
301
+ h("div", null, A((o = e(C)(t.modelValue)) == null ? void 0 : o.type), 1),
302
+ h("div", ce, A((U = e(C)(t.modelValue)) == null ? void 0 : U.adjustment) + " with " + A((S = e(C)(t.modelValue)) == null ? void 0 : S.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(() => l[5] || (l[5] = [
322
+ X(A(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
+ we as a,
343
+ de as b
344
+ };
@@ -1,24 +1,33 @@
1
- import { defineComponent as A, ref as S, computed as D, onMounted as E, resolveComponent as l, openBlock as m, createElementBlock as _, Fragment as x, createVNode as c, unref as t, createElementVNode as n, withCtx as h, renderList as M, createBlock as w, resolveDynamicComponent as U, toDisplayString as d, h as H } from "vue";
2
- import { u as q, M as z, b as G, h as J, N as Q, v as L, w as V, j as W, y as X, e as Y, B as Z, c as g } from "./app-BpzzygYP.js";
3
- import { useDialog as ee, components as te } from "@feedmepos/ui-library";
4
- const oe = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-center justify-between w-full" }, ne = { class: "flex gap-8 overflow-x-auto" }, se = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, le = { class: "space-y-4" }, ie = { class: "fm-typo-en-body-lg-600" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "flex flex-col gap-16 text-center" }, ue = { class: "fm-typo-en-title-sm-800" }, ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, he = /* @__PURE__ */ A({
1
+ import { defineComponent as D, ref as S, computed as E, onMounted as U, resolveComponent as c, openBlock as m, createElementBlock as _, Fragment as x, createVNode as i, unref as t, createElementVNode as n, withCtx as h, renderList as j, createBlock as w, resolveDynamicComponent as M, toDisplayString as p, h as H } from "vue";
2
+ import { _ as q } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as z, components as G } from "@feedmepos/ui-library";
4
+ import { u as J, p as Q } from "./loading-D_AN6p24.js";
5
+ import { u as W } from "./business-dQh3AEot.js";
6
+ import { u as X } from "./campaign-BOl8AgKA.js";
7
+ import { g as L, b as V } from "./dto-B8NfyVPG.js";
8
+ import { u as Y } from "./vue-i18n-BxwiXSkp.js";
9
+ import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
10
+ import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.js";
11
+ import { u as te } from "./template-clxvNnbF.js";
12
+ import { c as g } from "./index-UTQHDUdW.js";
13
+ const oe = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-center justify-between w-full" }, ne = { class: "flex gap-8 overflow-x-auto" }, se = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, ie = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ce = { class: "space-y-4" }, le = { class: "fm-typo-en-body-lg-600" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "flex flex-col gap-16 text-center" }, ue = { class: "fm-typo-en-title-sm-800" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = /* @__PURE__ */ D({
5
14
  __name: "Experience",
6
- setup(fe) {
7
- const { t: s } = q(), I = {
15
+ setup(ye) {
16
+ const { t: s } = Y(), I = {
8
17
  label: s("connect.program.common.actions.create", {
9
18
  type: s("connect.program.experience.title").toLowerCase()
10
19
  }),
11
20
  value: "create",
12
21
  isPrimary: !0,
13
22
  prependIcon: "add"
14
- }, P = z("POINT", ee()), B = G(), i = J(), { global: T, minor: v } = Y, r = S({
23
+ }, P = te("POINT", z()), B = W(), l = X(), { global: T, minor: v } = J, r = S({
15
24
  searchKey: "",
16
25
  location: null
17
- }), y = D(
18
- () => i.campaigns.experience.filter(
26
+ }), f = E(
27
+ () => l.campaigns.experience.filter(
19
28
  (e) => !r.value.location || !e.targetLocation || e.targetLocation.includes(r.value.location)
20
29
  )
21
- ), N = [
30
+ ), K = [
22
31
  {
23
32
  header: "Program title",
24
33
  accessorFn: (e) => e.name
@@ -37,7 +46,7 @@ const oe = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
37
46
  {
38
47
  header: "Actions",
39
48
  cell(e) {
40
- return H(te.FmButton, {
49
+ return H(G.FmButton, {
41
50
  variant: "tertiary",
42
51
  icon: "delete",
43
52
  iconColor: "neutral-gray-400",
@@ -49,9 +58,9 @@ const oe = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
49
58
  }
50
59
  ], b = S();
51
60
  async function C(e) {
52
- await Z.remove(`Are you sure you want to remove ${e.name}?`) && await v(
61
+ await Q.remove(`Are you sure you want to remove ${e.name}?`) && await v(
53
62
  async () => {
54
- await g.delete(e._id), await i.read("POINT");
63
+ await g.delete(e._id), await l.read("POINT");
55
64
  },
56
65
  {
57
66
  message: `Removing ${e.name}`,
@@ -59,24 +68,24 @@ const oe = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
59
68
  }
60
69
  );
61
70
  }
62
- async function f(e) {
63
- e ? await o() : P.open(async (p) => {
64
- await o(p);
71
+ async function y(e) {
72
+ e ? await o() : P.open(async (d) => {
73
+ await o(d);
65
74
  });
66
- async function o(p) {
75
+ async function o(d) {
67
76
  var u;
68
77
  (u = b.value) == null || u.showSheet(
69
78
  !0,
70
79
  "POINT",
71
80
  e ? await g.readById(e._id) : void 0,
72
- p
81
+ d
73
82
  );
74
83
  }
75
84
  }
76
- async function K(e) {
85
+ async function N(e) {
77
86
  await v(
78
87
  async () => {
79
- e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await i.read("POINT");
88
+ e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await l.read("POINT");
80
89
  },
81
90
  {
82
91
  message: s("program.common.update.updating", {
@@ -89,30 +98,30 @@ const oe = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
89
98
  }
90
99
  );
91
100
  }
92
- return E(async () => {
101
+ return U(async () => {
93
102
  await T(async () => {
94
- await i.read("POINT");
103
+ await l.read("POINT");
95
104
  });
96
105
  }), (e, o) => {
97
- const p = l("FmPageHead"), u = l("FmSearch"), R = l("FmTable"), F = l("FmButton"), $ = l("FmListItem"), O = l("FmList"), j = l("FmCard");
106
+ const d = c("FmPageHead"), u = c("FmSearch"), R = c("FmTable"), F = c("FmButton"), $ = c("FmListItem"), O = c("FmList"), A = c("FmCard");
98
107
  return m(), _(x, null, [
99
- c(p, {
108
+ i(d, {
100
109
  title: t(s)("connect.program.experience.title"),
101
- actions: t(y).length > 0 ? [I] : [],
102
- "onClick:action": o[0] || (o[0] = () => f())
110
+ actions: t(f).length > 0 ? [I] : [],
111
+ "onClick:action": o[0] || (o[0] = () => y())
103
112
  }, null, 8, ["title", "actions"]),
104
113
  n("div", oe, [
105
- c(u, {
114
+ i(u, {
106
115
  modelValue: t(r).searchKey,
107
116
  "onUpdate:modelValue": o[1] || (o[1] = (a) => t(r).searchKey = a),
108
117
  class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
109
118
  placeholder: t(s)("connect.program.common.search"),
110
119
  collapsible: ""
111
120
  }, null, 8, ["modelValue", "placeholder"]),
112
- t(i).campaigns.experience && t(i).campaigns.experience.length > 0 ? (m(), _(x, { key: 0 }, [
121
+ t(l).campaigns.experience && t(l).campaigns.experience.length > 0 ? (m(), _(x, { key: 0 }, [
113
122
  n("div", ae, [
114
123
  n("div", ne, [
115
- c(Q, {
124
+ i(Z, {
116
125
  modelValue: t(r).location,
117
126
  "onUpdate:modelValue": o[2] || (o[2] = (a) => t(r).location = a),
118
127
  label: "Location: ",
@@ -122,7 +131,7 @@ const oe = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
122
131
  items: t(B).locationItems
123
132
  }, null, 8, ["modelValue", "items"])
124
133
  ]),
125
- c(u, {
134
+ i(u, {
126
135
  modelValue: t(r).searchKey,
127
136
  "onUpdate:modelValue": o[3] || (o[3] = (a) => t(r).searchKey = a),
128
137
  class: "xs:hidden",
@@ -130,39 +139,39 @@ const oe = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
130
139
  collapsible: ""
131
140
  }, null, 8, ["modelValue"])
132
141
  ]),
133
- c(R, {
142
+ i(R, {
134
143
  class: "xs:hidden",
135
- "row-data": t(y),
136
- "column-defs": N,
144
+ "row-data": t(f),
145
+ "column-defs": K,
137
146
  "search-value": t(r).searchKey,
138
147
  "column-filter": [],
139
- onRowClick: o[4] || (o[4] = (a) => f(a.original)),
140
- "hide-footer": t(y).length < 10
148
+ onRowClick: o[4] || (o[4] = (a) => y(a.original)),
149
+ "hide-footer": t(f).length < 10
141
150
  }, null, 8, ["row-data", "search-value", "hide-footer"]),
142
- c(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
151
+ i(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
143
152
  default: h(() => [
144
- (m(!0), _(x, null, M(t(y).filter(
153
+ (m(!0), _(x, null, j(t(f).filter(
145
154
  (a) => a.name.toLowerCase().includes(t(r).searchKey.toLowerCase())
146
155
  ), (a) => (m(), w($, {
147
156
  key: a._id.toString(),
148
- onClick: (k) => f(a),
157
+ onClick: (k) => y(a),
149
158
  class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
150
159
  }, {
151
160
  default: h(() => [
152
161
  n("div", se, [
153
162
  n("div", re, [
154
- (m(), w(U(t(L)(a)))),
155
- n("div", ce, d(a.currentReceive ?? 0) + " used ", 1)
163
+ (m(), w(M(t(L)(a)))),
164
+ n("div", ie, p(a.currentReceive ?? 0) + " used ", 1)
156
165
  ]),
157
- n("div", le, [
158
- n("div", ie, d(a.name), 1),
159
- n("div", me, d(t(V)(a)), 1)
166
+ n("div", ce, [
167
+ n("div", le, p(a.name), 1),
168
+ n("div", me, p(t(V)(a)), 1)
160
169
  ]),
161
- n("div", de, d(t(s)("program.experience.received", {
170
+ n("div", pe, p(t(s)("program.experience.received", {
162
171
  count: a.currentReceive ?? 0
163
172
  })), 1)
164
173
  ]),
165
- c(F, {
174
+ i(F, {
166
175
  icon: "delete",
167
176
  "icon-color": "neutral-gray-400",
168
177
  variant: "tertiary",
@@ -174,33 +183,33 @@ const oe = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
174
183
  ]),
175
184
  _: 1
176
185
  })
177
- ], 64)) : (m(), w(j, {
186
+ ], 64)) : (m(), w(A, {
178
187
  key: 1,
179
188
  variant: "outlined",
180
189
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
181
190
  }, {
182
191
  default: h(() => [
183
192
  o[6] || (o[6] = n("img", {
184
- src: W,
193
+ src: q,
185
194
  class: "aspect-square w-[150px]"
186
195
  }, null, -1)),
187
- n("div", pe, [
188
- n("div", ue, d(t(s)("connect.program.experience.empty_state.title")), 1),
189
- n("div", ye, d(t(s)("connect.program.experience.empty_state.description")), 1)
196
+ n("div", de, [
197
+ n("div", ue, p(t(s)("connect.program.experience.empty_state.title")), 1),
198
+ n("div", fe, p(t(s)("connect.program.experience.empty_state.description")), 1)
190
199
  ]),
191
- c(F, {
200
+ i(F, {
192
201
  variant: "primary",
193
202
  label: "Create experience program",
194
203
  icon: "add",
195
- onClick: o[5] || (o[5] = (a) => f())
204
+ onClick: o[5] || (o[5] = (a) => y())
196
205
  })
197
206
  ]),
198
207
  _: 1
199
208
  })),
200
- c(X, {
209
+ i(ee, {
201
210
  ref_key: "sheetRef",
202
211
  ref: b,
203
- "onSubmit:modelValue": K
212
+ "onSubmit:modelValue": N
204
213
  }, null, 512)
205
214
  ])
206
215
  ], 64);
@@ -208,5 +217,5 @@ const oe = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-
208
217
  }
209
218
  });
210
219
  export {
211
- he as default
220
+ Ve as default
212
221
  };