@feedmepos/mf-connect 0.0.16-beta.1 → 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 (95) hide show
  1. package/dist/{Analytic-C-zZmF5N.js → Analytic-Gq7PoNer.js} +368 -365
  2. package/dist/App-Cikl5jnp.js +177 -0
  3. package/dist/Broadcast-DU3JnBwZ.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VWLBlxy1.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0I8IZIR.js} +20 -20
  5. package/dist/Card-hIeQ5XUH.js +825 -0
  6. package/dist/Collections-B1SC1rr7.js +453 -0
  7. package/dist/Credit-BgwI8DR3.js +216 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bz6TSmbW.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.js} +1026 -1022
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-AhWnHG02.js → EffectSheet.vue_vue_type_style_index_0_lang-DPgu45MD.js} +29 -29
  10. package/dist/Experience-C2Q-zqV6.js +221 -0
  11. package/dist/Game-DU2pZDGk.js +255 -0
  12. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  13. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  14. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DykNOOFD.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +1 -1
  15. package/dist/{MainLayout-D0AoA1tk.js → MainLayout-B1aJoR95.js} +2 -2
  16. package/dist/Marketing-DWiTQp9I.js +316 -0
  17. package/dist/Member-BEXKBFry.js +69 -0
  18. package/dist/MemberList-DzMdajIf.js +1733 -0
  19. package/dist/MemberOverview-wL_ailso.js +58 -0
  20. package/dist/{MemberTransactions-CTAx5jIV.js → MemberTransactions-Bciankuu.js} +1 -1
  21. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C-BtHxSc.js → MessageInput.vue_vue_type_script_setup_true_lang-DH25Hfk3.js} +46 -46
  22. package/dist/Mission-KzwRlaA5.js +259 -0
  23. package/dist/Point-CSKvZXHc.js +222 -0
  24. package/dist/Promotion-IiwPhx8p.js +221 -0
  25. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CrpJySSp.js → RuleGroup.vue_vue_type_script_setup_true_lang-4zIO3oCr.js} +545 -544
  26. package/dist/Segment-2Q0PonBb.js +447 -0
  27. package/dist/{Setting-Zrj5P_4m.js → Setting-Df5vVRt4.js} +600 -598
  28. package/dist/Store-C0WXCKs6.js +1503 -0
  29. package/dist/StoreRewards-eSSIO0nk.js +401 -0
  30. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DS4APaHw.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BjnCRKGX.js} +106 -108
  31. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-ZYjWlDJ1.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-b0xTcoEp.js} +1 -1
  32. package/dist/{Tier-DVWJyQ9S.js → Tier-v-1FkRU-.js} +464 -449
  33. package/dist/{Title-B5kX64vs.js → Title-CQ2JWqBW.js} +315 -299
  34. package/dist/Transaction-0OouN_6s.js +39 -0
  35. package/dist/Voucher-CL0cgogx.js +488 -0
  36. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  37. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  38. package/dist/app-Bd19eW7X.js +5381 -0
  39. package/dist/app-CfS25Z66.js +34797 -0
  40. package/dist/app-wDQR6dpb.js +39 -0
  41. package/dist/app.js +5 -3
  42. package/dist/business-dQh3AEot.js +78 -0
  43. package/dist/{campaign-BZJuknWK.js → campaign-BOl8AgKA.js} +12 -12
  44. package/dist/{collection.fn-DoCkZ6z4.js → collection.fn-B_YsXmrP.js} +2 -2
  45. package/dist/dto-B8NfyVPG.js +1169 -0
  46. package/dist/{effect-B8kmnKvY.js → effect-C2jCStXO.js} +1 -1
  47. package/dist/{export-Dm6LYnWo.js → export-BtZc3Yzh.js} +3 -3
  48. package/dist/{helper-DR4XK3nv.js → helper-8oGsrM56.js} +1 -1
  49. package/dist/{index-DcUrk07Q.js → index-6FkKY3q0.js} +3 -3
  50. package/dist/{index-Bu4_26qI.js → index-C7oeXRUl.js} +1 -1
  51. package/dist/{index-CuL5-ORK.js → index-CZKYIefW.js} +6 -7
  52. package/dist/{index-yxJMhfxj.js → index-C_0IFnwi.js} +5 -5
  53. package/dist/{index-BryrRq8O.js → index-DCixRRvz.js} +36 -30
  54. package/dist/{index-CkiYkbXb.js → index-DFgt4-VW.js} +1 -1
  55. package/dist/{index-CWf0mh3a.js → index-DYDhH9bi.js} +177 -168
  56. package/dist/{index-boor8e80.js → index-Di-kWSmf.js} +3 -3
  57. package/dist/{app-DkI7dYRN.js → index-Dn0jdj0o.js} +9665 -13024
  58. package/dist/index-DwKqFNF6.js +3 -0
  59. package/dist/{index-BobRgQrE.js → index-HoacsZDk.js} +2 -2
  60. package/dist/{index-BxkxVtgm.js → index-UTQHDUdW.js} +1 -1
  61. package/dist/{loading-BzV5acUX.js → loading-D_AN6p24.js} +6807 -6805
  62. package/dist/{lodash-mg4435Qq.js → lodash-B5I3zXaY.js} +1 -1
  63. package/dist/{membership-CqbsLHqx.js → membership-Ccrx9R6r.js} +3 -3
  64. package/dist/{money-DA_gtp3q.js → money-waD-f-Zz.js} +1 -1
  65. package/dist/{number-C388eyOu.js → number-CwTGGsh9.js} +1 -1
  66. package/dist/{rule-Clmr5y4j.js → rule-DJ07h3Gh.js} +2 -2
  67. package/dist/{rule-builder-BgqNbM-P.js → rule-builder-DJ-acvVD.js} +1 -1
  68. package/dist/style.css +1 -1
  69. package/dist/template-clxvNnbF.js +190 -0
  70. package/dist/{usePagination-o5fgsZwU.js → usePagination-BeF5K3M7.js} +86 -86
  71. package/dist/vue-i18n-BxwiXSkp.js +2365 -0
  72. package/dist/{xlsx-BRdh9e2p.js → xlsx-BB366cdN.js} +1945 -1945
  73. package/package.json +9 -5
  74. package/dist/Broadcast-X69Mtv3b.js +0 -216
  75. package/dist/Card-D0X3v1UF.js +0 -822
  76. package/dist/Collections-umR6Ehqf.js +0 -452
  77. package/dist/Credit-C1EWF7R0.js +0 -214
  78. package/dist/Experience-CqL8wyPm.js +0 -211
  79. package/dist/Game--kYe64EV.js +0 -250
  80. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BjOJ3XSL.js +0 -144
  81. package/dist/Marketing-CTCQ5ZmZ.js +0 -308
  82. package/dist/Member-DCduX7zP.js +0 -91
  83. package/dist/MemberList-B0EkXZJu.js +0 -1729
  84. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  85. package/dist/Mission-CVr9rS_D.js +0 -248
  86. package/dist/Point-BnZ6M74y.js +0 -220
  87. package/dist/Promotion-B0PUve5S.js +0 -218
  88. package/dist/Segment-B-XpkyM5.js +0 -445
  89. package/dist/Store-B2gywCt2.js +0 -1503
  90. package/dist/StoreRewards-D8410Q_-.js +0 -434
  91. package/dist/Transaction-CZBO4v4d.js +0 -36
  92. package/dist/Voucher-se-4JF9B.js +0 -481
  93. package/dist/app-B2ImSO3V.js +0 -53382
  94. package/dist/dto-BWpvRpK2.js +0 -1151
  95. package/dist/template-Dwp7heBA.js +0 -190
@@ -1,10 +1,10 @@
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-DkI7dYRN.js";
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
3
  import { Z as d } from "./zod-W_PvIofQ.js";
4
- import { g as ee, h as te } from "./index-CWf0mh3a.js";
5
- import { s as C } from "./effect-B8kmnKvY.js";
6
- import { p as le } from "./loading-BzV5acUX.js";
7
- import { E as oe } from "./app-B2ImSO3V.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
8
  const ae = { class: "flex flex-col gap-8" }, ne = {
9
9
  key: 0,
10
10
  class: "fm-typo-en-body-lg-600"
@@ -38,9 +38,9 @@ const ae = { class: "flex flex-col gap-8" }, ne = {
38
38
  }
39
39
  },
40
40
  emits: ["update:model-value"],
41
- setup(t, { emit: h }) {
42
- var g, P;
43
- const n = t, c = h, a = [
41
+ setup(t, { emit: g }) {
42
+ var S, P;
43
+ const n = t, c = g, a = [
44
44
  { label: "Date Range", value: "range" },
45
45
  { label: "Custom", value: "custom" }
46
46
  ], u = R(!1);
@@ -50,7 +50,7 @@ const ae = { class: "flex flex-col gap-8" }, ne = {
50
50
  ).length > 0;
51
51
  });
52
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]
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
54
  ), w = z(
55
55
  () => n.forCredit ? ee : te
56
56
  ), v = z(() => {
@@ -78,7 +78,7 @@ const ae = { class: "flex flex-col gap-8" }, ne = {
78
78
  const D = y("FmButtonGroup"), G = y("FmSimpleDateRangePicker"), Z = y("FmSwitch"), Y = y("FmStepperField"), B = y("FmHelperText");
79
79
  return s(), x("div", ae, [
80
80
  K(r.$slots, "label", {}, () => [
81
- t.label ? (s(), x("div", ne, S(t.label), 1)) : f("", !0)
81
+ t.label ? (s(), x("div", ne, A(t.label), 1)) : f("", !0)
82
82
  ]),
83
83
  t.type ? f("", !0) : (s(), p(D, {
84
84
  key: 0,
@@ -149,7 +149,7 @@ const ae = { class: "flex flex-col gap-8" }, ne = {
149
149
  ]);
150
150
  };
151
151
  }
152
- }), re = { class: "space-y-8" }, he = /* @__PURE__ */ O({
152
+ }), re = { class: "space-y-8" }, we = /* @__PURE__ */ O({
153
153
  __name: "CollectibleOptionInput",
154
154
  props: {
155
155
  modelValue: {
@@ -168,8 +168,8 @@ const ae = { class: "flex flex-col gap-8" }, ne = {
168
168
  }
169
169
  },
170
170
  emits: ["update:model-value"],
171
- setup(t, { emit: h }) {
172
- const n = t, c = h, a = R(n.modelValue ?? {});
171
+ setup(t, { emit: g }) {
172
+ const n = t, c = g, a = R(n.modelValue ?? {});
173
173
  return Q(a, () => c("update:model-value", a.value)), (u, l) => {
174
174
  const w = y("FmSwitch"), v = y("FmStepperField");
175
175
  return s(), x("div", re, [
@@ -263,10 +263,10 @@ const ae = { class: "flex flex-col gap-8" }, ne = {
263
263
  ]);
264
264
  };
265
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 = {
266
+ }), ue = { class: "space-y-8" }, me = {
267
267
  key: 1,
268
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({
269
+ }, pe = { class: "fm-typo-en-body-lg-400" }, ce = { class: "text-fm-color-typo-secondary" }, ge = /* @__PURE__ */ O({
270
270
  __name: "EffectSheet",
271
271
  props: {
272
272
  modelValue: { type: Object },
@@ -275,8 +275,8 @@ const ae = { class: "flex flex-col gap-8" }, ne = {
275
275
  }
276
276
  },
277
277
  emits: ["update:model-value"],
278
- setup(t, { emit: h }) {
279
- const n = h, c = R(!1);
278
+ setup(t, { emit: g }) {
279
+ const n = g, c = R(!1);
280
280
  async function a(u) {
281
281
  u.stopPropagation(), await le.remove("Are you sure you want to remove this effect?") && n("update:model-value", null);
282
282
  }
@@ -292,14 +292,14 @@ const ae = { class: "flex flex-col gap-8" }, ne = {
292
292
  ]
293
293
  }, {
294
294
  "side-sheet-button": F(() => {
295
- var o, U, g;
295
+ var o, U, S;
296
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)
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
303
  ]),
304
304
  b(w, {
305
305
  icon: "delete",
@@ -318,9 +318,9 @@ const ae = { class: "flex flex-col gap-8" }, ne = {
318
318
  ])
319
319
  ];
320
320
  }),
321
- "side-sheet-footer": F(() => [
322
- X(S(void 0))
323
- ]),
321
+ "side-sheet-footer": F(() => l[5] || (l[5] = [
322
+ X(A(void 0))
323
+ ])),
324
324
  default: F(() => [
325
325
  b(e(oe), {
326
326
  class: "fm-effect-sheet",
@@ -339,6 +339,6 @@ const ae = { class: "flex flex-col gap-8" }, ne = {
339
339
  });
340
340
  export {
341
341
  ge as _,
342
- he as a,
342
+ we as a,
343
343
  de as b
344
344
  };
@@ -0,0 +1,221 @@
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({
14
+ __name: "Experience",
15
+ setup(ye) {
16
+ const { t: s } = Y(), I = {
17
+ label: s("connect.program.common.actions.create", {
18
+ type: s("connect.program.experience.title").toLowerCase()
19
+ }),
20
+ value: "create",
21
+ isPrimary: !0,
22
+ prependIcon: "add"
23
+ }, P = te("POINT", z()), B = W(), l = X(), { global: T, minor: v } = J, r = S({
24
+ searchKey: "",
25
+ location: null
26
+ }), f = E(
27
+ () => l.campaigns.experience.filter(
28
+ (e) => !r.value.location || !e.targetLocation || e.targetLocation.includes(r.value.location)
29
+ )
30
+ ), K = [
31
+ {
32
+ header: "Program title",
33
+ accessorFn: (e) => e.name
34
+ },
35
+ {
36
+ header: "Status",
37
+ cell(e) {
38
+ return L(e.row.original);
39
+ }
40
+ },
41
+ {
42
+ header: "Summary",
43
+ accessorFn: (e) => V(e)
44
+ //v.effect,
45
+ },
46
+ {
47
+ header: "Actions",
48
+ cell(e) {
49
+ return H(G.FmButton, {
50
+ variant: "tertiary",
51
+ icon: "delete",
52
+ iconColor: "neutral-gray-400",
53
+ onClick: (o) => {
54
+ o.stopPropagation(), C(e.row.original);
55
+ }
56
+ });
57
+ }
58
+ }
59
+ ], b = S();
60
+ async function C(e) {
61
+ await Q.remove(`Are you sure you want to remove ${e.name}?`) && await v(
62
+ async () => {
63
+ await g.delete(e._id), await l.read("POINT");
64
+ },
65
+ {
66
+ message: `Removing ${e.name}`,
67
+ successMessage: `Removed ${e.name} successfully`
68
+ }
69
+ );
70
+ }
71
+ async function y(e) {
72
+ e ? await o() : P.open(async (d) => {
73
+ await o(d);
74
+ });
75
+ async function o(d) {
76
+ var u;
77
+ (u = b.value) == null || u.showSheet(
78
+ !0,
79
+ "POINT",
80
+ e ? await g.readById(e._id) : void 0,
81
+ d
82
+ );
83
+ }
84
+ }
85
+ async function N(e) {
86
+ await v(
87
+ async () => {
88
+ e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await l.read("POINT");
89
+ },
90
+ {
91
+ message: s("program.common.update.updating", {
92
+ type: s("connect.program.experience.title")
93
+ }),
94
+ successMessage: s("program.common.update.success", {
95
+ type: s("connect.program.experience.title"),
96
+ action: e.campaign._id ? "updated" : "created"
97
+ })
98
+ }
99
+ );
100
+ }
101
+ return U(async () => {
102
+ await T(async () => {
103
+ await l.read("POINT");
104
+ });
105
+ }), (e, o) => {
106
+ const d = c("FmPageHead"), u = c("FmSearch"), R = c("FmTable"), F = c("FmButton"), $ = c("FmListItem"), O = c("FmList"), A = c("FmCard");
107
+ return m(), _(x, null, [
108
+ i(d, {
109
+ title: t(s)("connect.program.experience.title"),
110
+ actions: t(f).length > 0 ? [I] : [],
111
+ "onClick:action": o[0] || (o[0] = () => y())
112
+ }, null, 8, ["title", "actions"]),
113
+ n("div", oe, [
114
+ i(u, {
115
+ modelValue: t(r).searchKey,
116
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => t(r).searchKey = a),
117
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
118
+ placeholder: t(s)("connect.program.common.search"),
119
+ collapsible: ""
120
+ }, null, 8, ["modelValue", "placeholder"]),
121
+ t(l).campaigns.experience && t(l).campaigns.experience.length > 0 ? (m(), _(x, { key: 0 }, [
122
+ n("div", ae, [
123
+ n("div", ne, [
124
+ i(Z, {
125
+ modelValue: t(r).location,
126
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => t(r).location = a),
127
+ label: "Location: ",
128
+ "show-item-label": !0,
129
+ icon: "storefront",
130
+ placement: "bottom-start",
131
+ items: t(B).locationItems
132
+ }, null, 8, ["modelValue", "items"])
133
+ ]),
134
+ i(u, {
135
+ modelValue: t(r).searchKey,
136
+ "onUpdate:modelValue": o[3] || (o[3] = (a) => t(r).searchKey = a),
137
+ class: "xs:hidden",
138
+ placeholder: "search",
139
+ collapsible: ""
140
+ }, null, 8, ["modelValue"])
141
+ ]),
142
+ i(R, {
143
+ class: "xs:hidden",
144
+ "row-data": t(f),
145
+ "column-defs": K,
146
+ "search-value": t(r).searchKey,
147
+ "column-filter": [],
148
+ onRowClick: o[4] || (o[4] = (a) => y(a.original)),
149
+ "hide-footer": t(f).length < 10
150
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
151
+ i(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
152
+ default: h(() => [
153
+ (m(!0), _(x, null, j(t(f).filter(
154
+ (a) => a.name.toLowerCase().includes(t(r).searchKey.toLowerCase())
155
+ ), (a) => (m(), w($, {
156
+ key: a._id.toString(),
157
+ onClick: (k) => y(a),
158
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
159
+ }, {
160
+ default: h(() => [
161
+ n("div", se, [
162
+ n("div", re, [
163
+ (m(), w(M(t(L)(a)))),
164
+ n("div", ie, p(a.currentReceive ?? 0) + " used ", 1)
165
+ ]),
166
+ n("div", ce, [
167
+ n("div", le, p(a.name), 1),
168
+ n("div", me, p(t(V)(a)), 1)
169
+ ]),
170
+ n("div", pe, p(t(s)("program.experience.received", {
171
+ count: a.currentReceive ?? 0
172
+ })), 1)
173
+ ]),
174
+ i(F, {
175
+ icon: "delete",
176
+ "icon-color": "neutral-gray-400",
177
+ variant: "tertiary",
178
+ onClick: (k) => (k.stopPropagation(), C(a))
179
+ }, null, 8, ["onClick"])
180
+ ]),
181
+ _: 2
182
+ }, 1032, ["onClick"]))), 128))
183
+ ]),
184
+ _: 1
185
+ })
186
+ ], 64)) : (m(), w(A, {
187
+ key: 1,
188
+ variant: "outlined",
189
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
190
+ }, {
191
+ default: h(() => [
192
+ o[6] || (o[6] = n("img", {
193
+ src: q,
194
+ class: "aspect-square w-[150px]"
195
+ }, null, -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)
199
+ ]),
200
+ i(F, {
201
+ variant: "primary",
202
+ label: "Create experience program",
203
+ icon: "add",
204
+ onClick: o[5] || (o[5] = (a) => y())
205
+ })
206
+ ]),
207
+ _: 1
208
+ })),
209
+ i(ee, {
210
+ ref_key: "sheetRef",
211
+ ref: b,
212
+ "onSubmit:modelValue": N
213
+ }, null, 512)
214
+ ])
215
+ ], 64);
216
+ };
217
+ }
218
+ });
219
+ export {
220
+ Ve as default
221
+ };
@@ -0,0 +1,255 @@
1
+ import { defineComponent as D, ref as A, computed as H, onMounted as N, resolveComponent as r, openBlock as d, createElementBlock as x, Fragment as b, createVNode as i, unref as o, withCtx as h, createElementVNode as n, toDisplayString as l, renderList as q, createBlock as v, resolveDynamicComponent as z, h as p } from "vue";
2
+ import { _ as J } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as O, components as C } from "@feedmepos/ui-library";
4
+ import { u as Q, a as W, p as X } from "./loading-D_AN6p24.js";
5
+ import { u as Y } from "./business-dQh3AEot.js";
6
+ import { u as Z } from "./campaign-BOl8AgKA.js";
7
+ import { g as B, b as $ } from "./dto-B8NfyVPG.js";
8
+ import { _ as ee } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
+ import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.js";
10
+ import { u as oe } from "./template-clxvNnbF.js";
11
+ import { u as ae } from "./vue-i18n-BxwiXSkp.js";
12
+ import { c as w } from "./index-UTQHDUdW.js";
13
+ const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, le = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "space-y-4" }, ue = { class: "fm-typo-en-body-lg-600" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-16 text-center" }, _e = { class: "fm-typo-en-title-sm-800" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $e = /* @__PURE__ */ D({
14
+ __name: "Game",
15
+ setup(we) {
16
+ const { t: c } = ae(), E = {
17
+ label: c("connect.program.common.actions.create", {
18
+ type: c("connect.program.game.title").toLowerCase()
19
+ }),
20
+ value: "create",
21
+ isPrimary: !0,
22
+ prependIcon: "add"
23
+ }, K = oe("GAME", O()), f = Y(), m = Z(), { global: M, minor: k } = Q, s = A({
24
+ searchKey: "",
25
+ location: null
26
+ }), g = H(
27
+ () => m.campaigns.token.filter(
28
+ (e) => !s.value.location || !e.targetLocation || e.targetLocation.includes(s.value.location)
29
+ )
30
+ ), R = [
31
+ {
32
+ header: "Program title",
33
+ accessorKey: "name",
34
+ // accessorFn: (v) => v.name,
35
+ cell(e) {
36
+ return p("div", { class: "flex items-center justify-between gap-4" }, [
37
+ p("div", { class: "flex items-center" }, [
38
+ p(
39
+ C.FmTooltip,
40
+ {
41
+ content: e.row.original._id,
42
+ onClick: (t) => {
43
+ t.stopPropagation(), W(e.row.original._id);
44
+ }
45
+ },
46
+ [
47
+ p(C.FmIcon, {
48
+ name: "info",
49
+ outline: !0,
50
+ size: "sm"
51
+ })
52
+ ]
53
+ )
54
+ ]),
55
+ p("div", { class: "flex-1" }, e.row.original.name)
56
+ ]);
57
+ }
58
+ },
59
+ {
60
+ header: "Status",
61
+ cell(e) {
62
+ return B(e.row.original);
63
+ }
64
+ },
65
+ {
66
+ header: "Summary",
67
+ accessorFn: (e) => $(e)
68
+ //v.effect,
69
+ },
70
+ {
71
+ header: "Token received",
72
+ accessorFn: (e) => {
73
+ var t;
74
+ return ((t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.currentReceive) ?? 0;
75
+ }
76
+ },
77
+ {
78
+ header: "Actions",
79
+ cell(e) {
80
+ return p(C.FmButton, {
81
+ variant: "tertiary",
82
+ icon: "delete",
83
+ iconColor: "neutral-gray-400",
84
+ onClick: (t) => {
85
+ t.stopPropagation(), S(e.row.original);
86
+ }
87
+ });
88
+ }
89
+ }
90
+ ], F = A();
91
+ async function S(e) {
92
+ await X.remove(`Are you sure you want to remove ${e.name}?`) && await k(
93
+ async () => {
94
+ await w.delete(e._id), await m.read("GAME");
95
+ },
96
+ {
97
+ message: `Removing ${e.name}`,
98
+ successMessage: `Removed ${e.name} successfully`
99
+ }
100
+ );
101
+ }
102
+ async function y(e) {
103
+ e ? await t() : K.open(async (u) => {
104
+ await t(u);
105
+ });
106
+ async function t(u) {
107
+ var _;
108
+ (_ = F.value) == null || _.showSheet(
109
+ !0,
110
+ "GAME",
111
+ e ? await w.readById(e._id) : void 0,
112
+ u
113
+ );
114
+ }
115
+ }
116
+ async function G(e) {
117
+ await k(
118
+ async () => {
119
+ e.campaign._id ? await w.update(e.campaign._id, e) : await w.create(e), await m.read("GAME");
120
+ },
121
+ {
122
+ message: `${e.campaign._id ? "Updating" : "Creating"} game program`,
123
+ successMessage: `Game program ${e.campaign._id ? "updated" : "created"} successfully`
124
+ }
125
+ );
126
+ }
127
+ return N(async () => {
128
+ await M(async () => {
129
+ await m.read("GAME"), await f.readPremium();
130
+ });
131
+ }), (e, t) => {
132
+ const u = r("FmPill"), _ = r("FmPageHead"), L = r("FmSearch"), I = r("FmTable"), P = r("FmButton"), T = r("FmListItem"), U = r("FmList"), j = r("FmCard");
133
+ return d(), x(b, null, [
134
+ i(_, {
135
+ actions: o(g).length > 0 && o(f).isPremium ? [E] : [],
136
+ "onClick:action": t[0] || (t[0] = () => y())
137
+ }, {
138
+ title: h(() => [
139
+ n("div", ne, [
140
+ n("span", se, l(o(c)("connect.program.game.title")), 1),
141
+ i(u, { variant: "premium" })
142
+ ])
143
+ ]),
144
+ _: 1
145
+ }, 8, ["actions"]),
146
+ n("div", ie, [
147
+ i(L, {
148
+ modelValue: o(s).searchKey,
149
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => o(s).searchKey = a),
150
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
151
+ placeholder: "search",
152
+ collapsible: ""
153
+ }, null, 8, ["modelValue"]),
154
+ o(m).campaigns.token && o(m).campaigns.token.length > 0 ? (d(), x(b, { key: 0 }, [
155
+ n("div", re, [
156
+ n("div", le, [
157
+ i(ee, {
158
+ modelValue: o(s).location,
159
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => o(s).location = a),
160
+ label: "Location: ",
161
+ "show-item-label": !0,
162
+ icon: "storefront",
163
+ placement: "bottom-start",
164
+ items: o(f).locationItems
165
+ }, null, 8, ["modelValue", "items"])
166
+ ]),
167
+ i(L, {
168
+ modelValue: o(s).searchKey,
169
+ "onUpdate:modelValue": t[3] || (t[3] = (a) => o(s).searchKey = a),
170
+ class: "xs:hidden",
171
+ placeholder: "search",
172
+ collapsible: ""
173
+ }, null, 8, ["modelValue"])
174
+ ]),
175
+ i(I, {
176
+ class: "xs:hidden",
177
+ "row-data": o(g),
178
+ "column-defs": R,
179
+ "search-value": o(s).searchKey,
180
+ "column-filter": [],
181
+ onRowClick: t[4] || (t[4] = (a) => y(a.original)),
182
+ "hide-footer": o(g).length < 10
183
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
184
+ i(U, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
185
+ default: h(() => [
186
+ (d(!0), x(b, null, q(o(g).filter(
187
+ (a) => a.name.toLowerCase().includes(o(s).searchKey.toLowerCase())
188
+ ), (a) => (d(), v(T, {
189
+ key: a._id.toString(),
190
+ onClick: (V) => y(a),
191
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
192
+ }, {
193
+ default: h(() => [
194
+ n("div", ce, [
195
+ n("div", me, [
196
+ (d(), v(z(o(B)(a)))),
197
+ n("div", de, l(a.currentReceive ?? 0) + " used ", 1)
198
+ ]),
199
+ n("div", pe, [
200
+ n("div", ue, l(a.name), 1),
201
+ n("div", fe, l(o($)(a)), 1)
202
+ ]),
203
+ n("div", ge, l(o(c)("program.game.token_received", {
204
+ count: a.currentReceive ?? 0
205
+ })), 1)
206
+ ]),
207
+ i(P, {
208
+ icon: "delete",
209
+ "icon-color": "neutral-gray-400",
210
+ variant: "tertiary",
211
+ onClick: (V) => (V.stopPropagation(), S(a))
212
+ }, null, 8, ["onClick"])
213
+ ]),
214
+ _: 2
215
+ }, 1032, ["onClick"]))), 128))
216
+ ]),
217
+ _: 1
218
+ })
219
+ ], 64)) : (d(), v(j, {
220
+ key: 1,
221
+ variant: "outlined",
222
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
223
+ }, {
224
+ default: h(() => [
225
+ t[6] || (t[6] = n("img", {
226
+ src: J,
227
+ class: "aspect-square w-[150px]"
228
+ }, null, -1)),
229
+ n("div", ye, [
230
+ n("div", _e, l(o(c)("connect.program.game.empty_state.title")), 1),
231
+ n("div", he, l(o(c)("connect.program.game.empty_state.description")), 1)
232
+ ]),
233
+ i(P, {
234
+ variant: "primary",
235
+ label: "Create game program",
236
+ icon: "add",
237
+ disabled: !o(f).isPremium,
238
+ onClick: t[5] || (t[5] = (a) => y())
239
+ }, null, 8, ["disabled"])
240
+ ]),
241
+ _: 1
242
+ })),
243
+ i(te, {
244
+ ref_key: "sheetRef",
245
+ ref: F,
246
+ "onSubmit:modelValue": G
247
+ }, null, 512)
248
+ ])
249
+ ], 64);
250
+ };
251
+ }
252
+ });
253
+ export {
254
+ $e as default
255
+ };