@feedmepos/mf-connect 0.0.7 → 0.0.8

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 (67) hide show
  1. package/dist/{Analytic-D-E67IbN.js → Analytic-BxRuK2P2.js} +8 -8
  2. package/dist/{Broadcast-NjpOa4PK.js → Broadcast-BqGojAWW.js} +8 -8
  3. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-7KnDJ-sV.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B-VzcVMS.js} +8 -8
  4. package/dist/{Card-BOEkf7wo.js → Card-Dlj5jQp4.js} +54 -54
  5. package/dist/{Collections-sLYCpBxu.js → Collections-DvdDRozp.js} +181 -186
  6. package/dist/{Credit-DU2_9ex7.js → Credit-BeHm7_2S.js} +8 -8
  7. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CBO6OHrM.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsbgHsah.js} +170 -160
  8. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CTvGOX7T.js → EffectSheet.vue_vue_type_style_index_0_lang-hwXvdiut.js} +2999 -2978
  9. package/dist/{Experience-DGNdVxuU.js → Experience-CtDY9u4Y.js} +8 -8
  10. package/dist/{Game-B1i79HLc.js → Game-DjaYuqcb.js} +8 -8
  11. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DzdMpEl_.js → ImageInput.vue_vue_type_script_setup_true_lang-Bq5-Gl9N.js} +1 -1
  12. package/dist/{MainLayout-CfgDdm6k.js → MainLayout-B-iAZM2k.js} +1 -1
  13. package/dist/{Marketing-CBre7DEM.js → Marketing-BJJltAh-.js} +6 -6
  14. package/dist/{Member-BfvuL8GL.js → Member-eJ9Pdi5w.js} +2 -2
  15. package/dist/{MemberList-CQ17Q4V7.js → MemberList-CrhMqUfJ.js} +12 -12
  16. package/dist/{MemberTransactions-Cviim4GX.js → MemberTransactions-DRET8mSQ.js} +2 -2
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-j31pc2Wx.js → MessageInput.vue_vue_type_script_setup_true_lang-D-ttMwn2.js} +2 -2
  18. package/dist/{Point-9ta-6dJv.js → Point-DPTOgJbC.js} +8 -8
  19. package/dist/{Promotion-CBmH5FNG.js → Promotion-wzkRuNqO.js} +9 -9
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-r9Q-pOrs.js → RuleGroup.vue_vue_type_script_setup_true_lang-Z06eB5i5.js} +12 -12
  21. package/dist/{Segment-ZUtFZM5W.js → Segment-DnsPrP7Q.js} +10 -10
  22. package/dist/{Setting-TQdqaKPQ.js → Setting-CXuZu0-m.js} +9 -9
  23. package/dist/{Store-DX1ALcTQ.js → Store-4Um9keEp.js} +12 -12
  24. package/dist/{StoreRewards-Bd1ZFUQM.js → StoreRewards-B-UFeyQM.js} +10 -10
  25. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-D0L-LkOm.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BAyotuXd.js} +5 -5
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C0xL6Ua_.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-I_XFpctY.js} +1 -1
  27. package/dist/Tier-C6KVsxGO.js +818 -0
  28. package/dist/{Title-YJtGygMA.js → Title-DuN1ahIM.js} +236 -236
  29. package/dist/{Transaction-DmvmaPk6.js → Transaction-DdfX7Xfe.js} +1 -1
  30. package/dist/{Voucher-D88gJYa3.js → Voucher-DarXrxZr.js} +99 -94
  31. package/dist/{app-g6ra_l_x.js → app-CxBTTB31.js} +1266 -1251
  32. package/dist/app.js +1 -1
  33. package/dist/{campaign-DdY0vnwY.js → campaign-B0aXkadj.js} +7 -7
  34. package/dist/dto-BtdVC-Ab.js +1093 -0
  35. package/dist/{effect-CghM-w8z.js → effect-BUN6rkQM.js} +1 -1
  36. package/dist/{helper-xWsMhdHl.js → helper-Cpq3x8K5.js} +1 -1
  37. package/dist/{index-CVSXd2FW.js → index-0GYrZr4L.js} +138 -132
  38. package/dist/{index-Dz8i7yJ_.js → index-8clzk3uX.js} +1 -1
  39. package/dist/{index-D71HFulf.js → index-BTntbYTS.js} +1 -1
  40. package/dist/{index-B4ootZIL.js → index-BvnZdJBY.js} +2 -2
  41. package/dist/{index-Cl-b6jYW.js → index-C6NgUSl2.js} +1 -1
  42. package/dist/{index-Bp8rb1uM.js → index-CK9yJMj7.js} +34 -34
  43. package/dist/{index-BSF_A6Bx.js → index-D2Juhkdw.js} +2 -2
  44. package/dist/{index-C5UTq5_2.js → index-DDSLx7vu.js} +2 -2
  45. package/dist/{index-gLwPyXKM.js → index-Dg-PMgXV.js} +1 -1
  46. package/dist/index-DysVCkrx.js +1735 -0
  47. package/dist/libs/packages/core/src/campaign/campaign.enum.d.ts +6 -0
  48. package/dist/libs/packages/core/src/campaign/campaign.fn.d.ts +2 -0
  49. package/dist/libs/packages/core/src/template/templates.d.ts +7 -0
  50. package/dist/{loading-DClM7b3o.js → loading-Cxp7sI5p.js} +2 -2
  51. package/dist/{lodash-wTDGx83S.js → lodash-DsT1nK-T.js} +1 -1
  52. package/dist/{membership-BEDm55VI.js → membership-DtD45RXh.js} +4 -4
  53. package/dist/{money-CPy2C0LJ.js → money-CFI1TMCS.js} +1 -1
  54. package/dist/{number-ROACK3bi.js → number-BBtf4fYz.js} +1 -1
  55. package/dist/packages/connect/src/api/index.d.ts +3 -0
  56. package/dist/packages/connect/src/api/settings/index.d.ts +1 -1
  57. package/dist/packages/connect/src/main.d.ts +1 -1
  58. package/dist/{plugins-CJou3ejy.js → plugins-B_d-WFtN.js} +4 -4
  59. package/dist/{rule-Cp7qN96m.js → rule-CB9Qlcx1.js} +2 -2
  60. package/dist/{rule-builder-OR4oX_mq.js → rule-builder-BIKcA4Bg.js} +1 -1
  61. package/dist/{template-Dk2sky27.js → template-qlb46PGl.js} +5 -5
  62. package/dist/{usePagination-DRHXkOF-.js → usePagination-CX66ab1Y.js} +1 -1
  63. package/dist/{xlsx-C5St1Lch.js → xlsx-DMaFso0k.js} +1 -1
  64. package/package.json +2 -2
  65. package/dist/Tier-DAUABM7F.js +0 -818
  66. package/dist/dto-BQHDb7XC.js +0 -353
  67. package/dist/index-CPU_mtDw.js +0 -1742
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as p, ref as d, resolveComponent as n, openBlock as t, createElementBlock as f, Fragment as v, createVNode as c, createElementVNode as b, unref as a, createBlock as s, resolveDynamicComponent as m, createCommentVNode as k } from "vue";
2
- import { _ as x, a as C } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-D0L-LkOm.js";
2
+ import { _ as x, a as C } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-BAyotuXd.js";
3
3
  const F = { class: "px-24 flex flex-col gap-y-32 pb-24" }, B = /* @__PURE__ */ p({
4
4
  __name: "Transaction",
5
5
  setup(T) {
@@ -1,29 +1,29 @@
1
- import { defineComponent as N, ref as g, watch as H, onMounted as D, resolveComponent as d, openBlock as _, createBlock as U, unref as o, isRef as O, withCtx as V, createElementVNode as l, createVNode as i, toDisplayString as I, computed as Q, createElementBlock as B, Fragment as A, renderList as W, resolveDynamicComponent as Z, h as y } from "vue";
1
+ import { defineComponent as N, ref as g, watch as T, onMounted as D, resolveComponent as p, openBlock as _, createBlock as U, unref as o, isRef as H, withCtx as V, createElementVNode as l, createVNode as r, toDisplayString as I, computed as Q, createElementBlock as B, Fragment as A, renderList as W, resolveDynamicComponent as Z, h as y } from "vue";
2
2
  import { _ as Y } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as ee, components as S } from "@feedmepos/ui-library";
4
- import { p as z, c as ae } from "./plugins-CJou3ejy.js";
3
+ import { useDialog as ee, components as x } from "@feedmepos/ui-library";
4
+ import { p as j, c as ae } from "./plugins-B_d-WFtN.js";
5
5
  import { useCoreStore as oe } from "@feedmepos/mf-common";
6
- import { u as q } from "./loading-DClM7b3o.js";
7
- import { u as te, J as ne, a as se, R as le } from "./app-g6ra_l_x.js";
8
- import { u as ie } from "./campaign-DdY0vnwY.js";
9
- import { g as K, b as j } from "./dto-BQHDb7XC.js";
10
- import { u as re } from "./template-Dk2sky27.js";
11
- import { _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CBO6OHrM.js";
6
+ import { u as q } from "./loading-Cxp7sI5p.js";
7
+ import { u as te, J as ne, a as se, R as le } from "./app-CxBTTB31.js";
8
+ import { u as ie } from "./campaign-B0aXkadj.js";
9
+ import { g as K, b as z } from "./dto-BtdVC-Ab.js";
10
+ import { u as re } from "./template-qlb46PGl.js";
11
+ import { _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsbgHsah.js";
12
12
  import { _ as ue } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
13
- import { l as me } from "./lodash-wTDGx83S.js";
14
- import { m as de } from "./index-gLwPyXKM.js";
15
- import { c as x } from "./index-D71HFulf.js";
13
+ import { l as me } from "./lodash-DsT1nK-T.js";
14
+ import { m as de } from "./index-Dg-PMgXV.js";
15
+ import { c as S } from "./index-BTntbYTS.js";
16
16
  import { useRouter as pe } from "vue-router";
17
17
  const fe = { class: "space-y-16" }, he = { class: "fm-typo-en-body-md-600" }, ge = { class: "flex items-center justify-end" }, ye = { class: "flex items-center gap-8" }, ve = /* @__PURE__ */ N({
18
18
  __name: "SendVoucherSheet",
19
19
  emits: ["success"],
20
20
  setup(X, { expose: L, emit: F }) {
21
- const { minor: M } = q, k = g(""), r = g({}), P = F, p = g(!1), m = g([]);
22
- function u(e) {
23
- p.value = !0, k.value = e.campaignId;
21
+ const { minor: M } = q, k = g(""), i = g({}), P = F, f = g(!1), u = g([]);
22
+ function m(e) {
23
+ f.value = !0, k.value = e.campaignId, u.value = [];
24
24
  }
25
25
  function v() {
26
- p.value = !1;
26
+ f.value = !1;
27
27
  }
28
28
  const $ = [
29
29
  {
@@ -41,34 +41,39 @@ const fe = { class: "space-y-16" }, he = { class: "fm-typo-en-body-md-600" }, ge
41
41
  pageIndex: 0,
42
42
  totalRows: 0,
43
43
  isLoading: !1
44
- }), f = g([]), b = async (e) => {
45
- s.value.isLoading = !0, f.value = [];
44
+ }), d = g([]), b = async (e) => {
45
+ s.value.isLoading = !0, d.value = [];
46
46
  const a = await de.read({
47
47
  limit: e.pageSize,
48
- skip: e.pageIndex * e.pageSize,
48
+ skip: e.pageIndex,
49
49
  sortBy: "_id",
50
50
  search: s.value.searchValue,
51
51
  descending: !1
52
52
  });
53
- f.value = a.resources, s.value.totalRows = a.meta.totalResources ?? 0, s.value.pageCount = a.meta.totalPages ?? 0, s.value.isLoading = !1, r.value = {}, m.value.forEach((t) => {
54
- const c = f.value.findIndex((C) => C._id == t);
55
- c > -1 && (console.log(c, "fetch member index"), r.value[c] = !0);
53
+ d.value = a.resources, s.value.totalRows = a.meta.totalResources ?? 0, s.value.pageCount = a.meta.totalPages ?? 0, s.value.isLoading = !1, i.value = {}, u.value.forEach((t) => {
54
+ const c = d.value.findIndex((C) => C._id == t);
55
+ c > -1 && (console.log(c, "fetch member index"), i.value[c] = !0);
56
56
  });
57
57
  };
58
58
  function w() {
59
- f.value.length > 0 && (m.value = m.value.filter(
60
- (e) => f.value.some((a) => a._id != e)
59
+ d.value.length > 0 && (u.value = u.value.filter(
60
+ (e) => !d.value.some((a) => a._id === e) || // Keep if not in current page
61
+ Object.entries(i.value).some(
62
+ ([a, t]) => t && d.value[a]._id === e
63
+ // Keep if selected in current page
64
+ )
61
65
  ));
62
- for (const [e, a] of Object.entries(r.value)) {
63
- const t = f.value[e]._id;
64
- m.value.includes(t) || m.value.push(t);
65
- }
66
+ for (const [e, a] of Object.entries(i.value))
67
+ if (a) {
68
+ const t = d.value[e]._id;
69
+ u.value.includes(t) || u.value.push(t);
70
+ }
66
71
  }
67
72
  async function E(e) {
68
- m.value.length < 1 || await M(
73
+ u.value.length < 1 || await M(
69
74
  async () => {
70
- await x.sendCollection(k.value, {
71
- memberId: m.value
75
+ await S.sendCollection(k.value, {
76
+ memberId: u.value
72
77
  }), await P("success"), v();
73
78
  },
74
79
  {
@@ -77,49 +82,49 @@ const fe = { class: "space-y-16" }, he = { class: "fm-typo-en-body-md-600" }, ge
77
82
  }
78
83
  );
79
84
  }
80
- return H(r, w, { deep: !0 }), H(
85
+ return T(i, w, { deep: !0 }), T(
81
86
  () => s.value.searchValue,
82
87
  me.debounce(async () => {
83
88
  await b({ pageSize: 10, pageIndex: 0 });
84
89
  }, 500)
85
90
  ), L({
86
- showSheet: u,
91
+ showSheet: m,
87
92
  hideSheet: v
88
93
  }), D(async () => {
89
94
  await b(s.value);
90
95
  }), (e, a) => {
91
- const t = d("FmSearch"), c = d("FmTable"), C = d("FmButton"), R = d("FmSideSheet");
96
+ const t = p("FmSearch"), c = p("FmTable"), C = p("FmButton"), R = p("FmSideSheet");
92
97
  return _(), U(R, {
93
98
  "max-width": 560,
94
99
  "dismiss-away": !0,
95
100
  header: "Send voucher to",
96
- modelValue: o(p),
101
+ modelValue: o(f),
97
102
  "onUpdate:modelValue": [
98
- a[3] || (a[3] = (h) => O(p) ? p.value = h : null),
99
- a[4] || (a[4] = (h) => p.value = h)
103
+ a[3] || (a[3] = (h) => H(f) ? f.value = h : null),
104
+ a[4] || (a[4] = (h) => f.value = h)
100
105
  ]
101
106
  }, {
102
107
  "side-sheet-footer": V(() => [
103
108
  l("div", ye, [
104
- i(C, {
109
+ r(C, {
105
110
  label: "Send",
106
111
  loading: o(te)().isLoading,
107
112
  onClick: E
108
113
  }, null, 8, ["loading"]),
109
- i(C, {
114
+ r(C, {
110
115
  label: "Cancel",
111
116
  type: "button",
112
117
  variant: "tertiary",
113
- onClick: a[2] || (a[2] = (h) => p.value = !1)
118
+ onClick: a[2] || (a[2] = (h) => f.value = !1)
114
119
  })
115
120
  ])
116
121
  ]),
117
122
  default: V(() => [
118
- i(ne, { json: o(m) }, null, 8, ["json"]),
123
+ r(ne, { json: o(u) }, null, 8, ["json"]),
119
124
  l("div", fe, [
120
- l("div", he, I(o(m).length) + " members selected ", 1),
125
+ l("div", he, I(o(u).length) + " members selected ", 1),
121
126
  l("div", ge, [
122
- i(t, {
127
+ r(t, {
123
128
  class: "mt-4",
124
129
  modelValue: o(s).searchValue,
125
130
  "onUpdate:modelValue": a[0] || (a[0] = (h) => o(s).searchValue = h),
@@ -127,13 +132,13 @@ const fe = { class: "space-y-16" }, he = { class: "fm-typo-en-body-md-600" }, ge
127
132
  collapsible: ""
128
133
  }, null, 8, ["modelValue"])
129
134
  ]),
130
- i(c, {
131
- modelValue: o(r),
132
- "onUpdate:modelValue": a[1] || (a[1] = (h) => O(r) ? r.value = h : null),
135
+ r(c, {
136
+ modelValue: o(i),
137
+ "onUpdate:modelValue": a[1] || (a[1] = (h) => H(i) ? i.value = h : null),
133
138
  class: "xs:hidden",
134
139
  selection: "multiple",
135
140
  loading: o(s).isLoading,
136
- "row-data": o(f),
141
+ "row-data": o(d),
137
142
  "column-defs": $,
138
143
  "page-size": o(s).pageSize,
139
144
  "page-count": o(s).pageCount,
@@ -148,7 +153,7 @@ const fe = { class: "space-y-16" }, he = { class: "fm-typo-en-body-md-600" }, ge
148
153
  }
149
154
  });
150
155
  var _e = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
151
- const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-center justify-between w-full" }, Ce = { class: "flex gap-8 overflow-x-auto" }, Se = { class: "space-y-8" }, xe = { class: "flex w-full gap-4 items-center" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fe = { class: "space-y-4" }, ke = { class: "fm-typo-en-body-lg-600" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ue = /* @__PURE__ */ l("img", {
156
+ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-center justify-between w-full" }, Ce = { class: "flex gap-8 overflow-x-auto" }, xe = { class: "space-y-8" }, Se = { class: "flex w-full gap-4 items-center" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fe = { class: "space-y-4" }, ke = { class: "fm-typo-en-body-lg-600" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ue = /* @__PURE__ */ l("img", {
152
157
  src: Y,
153
158
  class: "aspect-square w-[150px]"
154
159
  }, null, -1), Ie = /* @__PURE__ */ l("div", { class: "flex flex-col gap-16 text-center" }, [
@@ -162,12 +167,12 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
162
167
  value: "create",
163
168
  isPrimary: !0,
164
169
  prependIcon: "add"
165
- }, F = ee(), M = re("VOUCHER", F), k = se(), r = ie(), { global: P, minor: p } = q, m = pe(), u = g({
170
+ }, F = ee(), M = re("VOUCHER", F), k = se(), i = ie(), { global: P, minor: f } = q, u = pe(), m = g({
166
171
  searchKey: "",
167
172
  location: null
168
173
  }), v = Q(
169
- () => r.campaigns.voucher.filter(
170
- (e) => !u.value.location || !e.targetLocation || e.targetLocation.includes(u.value.location)
174
+ () => i.campaigns.voucher.filter(
175
+ (e) => !m.value.location || !e.targetLocation || e.targetLocation.includes(m.value.location)
171
176
  )
172
177
  ), $ = [
173
178
  {
@@ -182,7 +187,7 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
182
187
  },
183
188
  {
184
189
  header: "Summary",
185
- accessorFn: (e) => j(e)
190
+ accessorFn: (e) => z(e)
186
191
  },
187
192
  {
188
193
  header: "Quota",
@@ -202,19 +207,19 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
202
207
  header: "Actions",
203
208
  cell(e) {
204
209
  return y("div", { class: "flex items-center justify-end" }, [
205
- y(S.FmButton, {
210
+ y(x.FmButton, {
206
211
  icon: "visibility",
207
212
  variant: "tertiary",
208
213
  iconColor: "neutral-gray-400",
209
214
  onClick: async (a) => {
210
- a.stopPropagation(), await m.push({
215
+ a.stopPropagation(), await u.push({
211
216
  name: le["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
212
217
  params: { id: e.row.original._id }
213
218
  });
214
219
  }
215
220
  }),
216
221
  y(
217
- S.FmMenu,
222
+ x.FmMenu,
218
223
  {
219
224
  placement: "bottom-end",
220
225
  onClick: (a) => {
@@ -222,7 +227,7 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
222
227
  }
223
228
  },
224
229
  {
225
- "menu-button": () => y(S.FmButton, {
230
+ "menu-button": () => y(x.FmButton, {
226
231
  icon: "more_vert",
227
232
  iconColor: "neutral-gray-400",
228
233
  variant: "tertiary"
@@ -230,7 +235,7 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
230
235
  default: () => {
231
236
  const a = [
232
237
  y(
233
- S.FmMenuItem,
238
+ x.FmMenuItem,
234
239
  {
235
240
  onClick: async (t) => {
236
241
  t.stopPropagation(), b(e.row.original);
@@ -248,21 +253,21 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
248
253
  )
249
254
  ];
250
255
  return e.row.original.event.type === "SIMPLE_CLAIM" && (a.unshift(
251
- y(S.FmMenuItem, {
256
+ y(x.FmMenuItem, {
252
257
  label: "Send",
253
258
  onClick: async (t) => {
254
259
  var c;
255
- t.stopPropagation(), (c = f.value) == null || c.showSheet({
260
+ t.stopPropagation(), (c = d.value) == null || c.showSheet({
256
261
  campaignId: e.row.original._id
257
262
  });
258
263
  }
259
264
  })
260
265
  ), a.unshift(
261
- y(S.FmMenuItem, {
266
+ y(x.FmMenuItem, {
262
267
  label: "Share",
263
268
  onClick: async (t) => {
264
269
  if (t.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
265
- return await z.confirm(
270
+ return await j.confirm(
266
271
  "Cannot share a voucher that is not a simple claim.",
267
272
  "Share Voucher",
268
273
  "OK"
@@ -282,11 +287,11 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
282
287
  ]);
283
288
  }
284
289
  }
285
- ], s = g(), f = g();
290
+ ], s = g(), d = g();
286
291
  async function b(e) {
287
- await z.remove(`Are you sure you want to remove ${e.name}?`) && await p(
292
+ await j.remove(`Are you sure you want to remove ${e.name}?`) && await f(
288
293
  async () => {
289
- await x.delete(e._id), await r.read("VOUCHER");
294
+ await S.delete(e._id), await i.read("VOUCHER");
290
295
  },
291
296
  {
292
297
  message: `Removing ${e.name}`,
@@ -303,7 +308,7 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
303
308
  (c = s.value) == null || c.showSheet(
304
309
  !0,
305
310
  "VOUCHER",
306
- e ? await x.readById(e._id) : void 0,
311
+ e ? await S.readById(e._id) : void 0,
307
312
  t
308
313
  );
309
314
  }
@@ -321,9 +326,9 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
321
326
  }).onSecondary(async () => {
322
327
  a();
323
328
  });
324
- }), await p(
329
+ }), await f(
325
330
  async () => {
326
- e.campaign._id ? await x.update(e.campaign._id, e) : await x.create(e), await r.read("VOUCHER");
331
+ e.campaign._id ? await S.update(e.campaign._id, e) : await S.create(e), await i.read("VOUCHER");
327
332
  },
328
333
  {
329
334
  message: `${e.campaign._id ? "Updating" : "Creating"} voucher`,
@@ -333,30 +338,30 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
333
338
  }
334
339
  return D(async () => {
335
340
  await P(async () => {
336
- await r.read("VOUCHER");
341
+ await i.read("VOUCHER");
337
342
  });
338
343
  }), (e, a) => {
339
- const t = d("FmPageHead"), c = d("FmSearch"), C = d("FmTable"), R = d("FmButton"), h = d("FmListItem"), G = d("FmList"), J = d("FmCard");
344
+ const t = p("FmPageHead"), c = p("FmSearch"), C = p("FmTable"), R = p("FmButton"), h = p("FmListItem"), G = p("FmList"), J = p("FmCard");
340
345
  return _(), B(A, null, [
341
- i(t, {
346
+ r(t, {
342
347
  title: "Voucher",
343
348
  actions: o(v).length > 0 ? [L] : [],
344
349
  "onClick:action": a[0] || (a[0] = () => w())
345
350
  }, null, 8, ["actions"]),
346
351
  l("div", be, [
347
- i(c, {
348
- modelValue: o(u).searchKey,
349
- "onUpdate:modelValue": a[1] || (a[1] = (n) => o(u).searchKey = n),
352
+ r(c, {
353
+ modelValue: o(m).searchKey,
354
+ "onUpdate:modelValue": a[1] || (a[1] = (n) => o(m).searchKey = n),
350
355
  class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
351
356
  placeholder: "search",
352
357
  collapsible: ""
353
358
  }, null, 8, ["modelValue"]),
354
- o(r).campaigns.voucher && o(r).campaigns.voucher.length > 0 ? (_(), B(A, { key: 0 }, [
359
+ o(i).campaigns.voucher && o(i).campaigns.voucher.length > 0 ? (_(), B(A, { key: 0 }, [
355
360
  l("div", we, [
356
361
  l("div", Ce, [
357
- i(ue, {
358
- modelValue: o(u).location,
359
- "onUpdate:modelValue": a[2] || (a[2] = (n) => o(u).location = n),
362
+ r(ue, {
363
+ modelValue: o(m).location,
364
+ "onUpdate:modelValue": a[2] || (a[2] = (n) => o(m).location = n),
360
365
  label: "Location: ",
361
366
  "show-item-label": !0,
362
367
  icon: "storefront",
@@ -364,48 +369,48 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
364
369
  items: o(k).locationItems
365
370
  }, null, 8, ["modelValue", "items"])
366
371
  ]),
367
- i(c, {
368
- modelValue: o(u).searchKey,
369
- "onUpdate:modelValue": a[3] || (a[3] = (n) => o(u).searchKey = n),
372
+ r(c, {
373
+ modelValue: o(m).searchKey,
374
+ "onUpdate:modelValue": a[3] || (a[3] = (n) => o(m).searchKey = n),
370
375
  class: "xs:hidden",
371
376
  placeholder: "search",
372
377
  collapsible: ""
373
378
  }, null, 8, ["modelValue"])
374
379
  ]),
375
- i(C, {
380
+ r(C, {
376
381
  class: "xs:hidden",
377
382
  "row-data": o(v),
378
383
  "column-defs": $,
379
- "search-value": o(u).searchKey,
384
+ "search-value": o(m).searchKey,
380
385
  "column-filter": [],
381
386
  onRowClick: a[4] || (a[4] = (n) => w(n.original)),
382
387
  "hide-footer": o(v).length < 10
383
388
  }, null, 8, ["row-data", "search-value", "hide-footer"]),
384
- i(G, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
389
+ r(G, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
385
390
  default: V(() => [
386
391
  (_(!0), B(A, null, W(o(v).filter(
387
- (n) => n.name.toLowerCase().includes(o(u).searchKey.toLowerCase())
392
+ (n) => n.name.toLowerCase().includes(o(m).searchKey.toLowerCase())
388
393
  ), (n) => (_(), U(h, {
389
394
  key: n._id.toString(),
390
- onClick: (T) => w(n),
395
+ onClick: (O) => w(n),
391
396
  class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
392
397
  }, {
393
398
  default: V(() => [
394
- l("div", Se, [
395
- l("div", xe, [
399
+ l("div", xe, [
400
+ l("div", Se, [
396
401
  (_(), U(Z(o(K)(n)))),
397
402
  l("div", Ve, I(n.currentReceive ?? 0) + " used ", 1)
398
403
  ]),
399
404
  l("div", Fe, [
400
405
  l("div", ke, I(n.name), 1),
401
- l("div", Re, I(o(j)(n)), 1)
406
+ l("div", Re, I(o(z)(n)), 1)
402
407
  ])
403
408
  ]),
404
- i(R, {
409
+ r(R, {
405
410
  icon: "delete",
406
411
  "icon-color": "neutral-gray-400",
407
412
  variant: "tertiary",
408
- onClick: (T) => (T.stopPropagation(), b(n))
413
+ onClick: (O) => (O.stopPropagation(), b(n))
409
414
  }, null, 8, ["onClick"])
410
415
  ]),
411
416
  _: 2
@@ -421,7 +426,7 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
421
426
  default: V(() => [
422
427
  Ue,
423
428
  Ie,
424
- i(R, {
429
+ r(R, {
425
430
  variant: "primary",
426
431
  label: "Create voucher campaign",
427
432
  icon: "add",
@@ -430,14 +435,14 @@ const be = { class: "px-24 flex flex-col gap-y-16" }, we = { class: "flex items-
430
435
  ]),
431
436
  _: 1
432
437
  })),
433
- i(ce, {
438
+ r(ce, {
434
439
  ref_key: "sheetRef",
435
440
  ref: s,
436
441
  "onSubmit:modelValue": E
437
442
  }, null, 512),
438
- i(ve, {
443
+ r(ve, {
439
444
  ref_key: "sendVoucherSheetRef",
440
- ref: f
445
+ ref: d
441
446
  }, null, 512)
442
447
  ])
443
448
  ], 64);