@feedmepos/mf-connect 0.1.38-beta.9 → 0.1.38-beta.92

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 (161) hide show
  1. package/dist/{Analytic-3MN2saaU.js → Analytic-CWhVZ2N2.js} +31 -32
  2. package/dist/{App-Co8X5Wdy.js → App-BzHDZ550.js} +741 -728
  3. package/dist/AuditLogs-DjJOfxWr.js +2013 -0
  4. package/dist/{Bin-8a56ZDib.js → Bin-H9Mc0kOX.js} +10 -10
  5. package/dist/Broadcast-BlKv9pTl.js +266 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BVXlfq31.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Bfpr1EuT.js} +6 -6
  7. package/dist/{Card-B8_09LJu.js → Card-ByEYCMZi.js} +145 -140
  8. package/dist/Collections-BjlqpQR0.js +540 -0
  9. package/dist/Credit-DyBVTpfr.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  12. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DP50lRfA.js +3120 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BCQxJpVP.js +351 -0
  15. package/dist/Experience-Cf6lxdu_.js +259 -0
  16. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-BIgeA5yw.js} +1 -1
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-CCgsa5as.js +330 -0
  20. package/dist/Grab-oIvB2uUc.js +300 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-BuiY288K.js} +49 -48
  22. package/dist/{Index-DLF71mx_.js → Index--bmiSYq2.js} +54 -54
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-BQMZvHq2.js +48 -0
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Bj6wuosW.js} +1 -1
  25. package/dist/{MainLayout-B1aJoR95.js → MainLayout-DTva8da3.js} +1 -1
  26. package/dist/Marketing-D-5rvdRJ.js +236 -0
  27. package/dist/MarketingMaterialEdit-CZvsnFG5.js +1036 -0
  28. package/dist/{Member-Bkw4aqtv.js → Member-CxKA1iM1.js} +38 -37
  29. package/dist/{MemberList-a3PdVYB3.js → MemberList-CmBZ6w5v.js} +485 -489
  30. package/dist/{MemberTransactions-CPDBd-n3.js → MemberTransactions-Dc9uE1Jy.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-pbN8pN1m.js → MessageInput.vue_vue_type_script_setup_true_lang-DiOsNoiJ.js} +10392 -9967
  32. package/dist/Mission-D9ruHJsQ.js +334 -0
  33. package/dist/{Overview-De97NDoe.js → Overview-B4eiwvqi.js} +34 -34
  34. package/dist/Point-MXmcuDtD.js +262 -0
  35. package/dist/Promotion-CBoCcEhJ.js +397 -0
  36. package/dist/{Queue-ISVZxCE2.js → Queue-if5Lji0q.js} +18 -18
  37. package/dist/{Record-2FMByNC6.js → Record-XLXvSqlF.js} +15 -14
  38. package/dist/Review-BKIkmxLd.js +621 -0
  39. package/dist/ReviewFacebookCallback-B6TIL_H7.js +243 -0
  40. package/dist/ReviewGoogleCallback-D3sQbfuc.js +213 -0
  41. package/dist/{Reward-DPRyQ37x.js → Reward-DaymLqOP.js} +16 -16
  42. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Ba7-3bL-.js → RewardGroup.vue_vue_type_script_setup_true_lang-cGyeUFlK.js} +13 -14
  43. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BOJdm376.js +1912 -0
  44. package/dist/Segment-o7srzt8o.js +1015 -0
  45. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DZbyDVid.js → SelectItems.vue_vue_type_script_setup_true_lang-DnA83SVT.js} +23 -23
  46. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-ioMFYIwK.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-RKn_DhW0.js} +12 -12
  47. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-mzGtatEl.js +226 -0
  48. package/dist/Setting-Clbp5X2E.js +2039 -0
  49. package/dist/SettingAdvertisements-D9KTw00Q.js +264 -0
  50. package/dist/Store-DApDz7rO.js +1996 -0
  51. package/dist/StoreRewards-DTraNhDh.js +537 -0
  52. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BusvWI37.js +1130 -0
  53. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D5HOiiLG.js +7007 -0
  54. package/dist/{Tier-CwRj0oJ1.js → Tier-BWiO5an3.js} +562 -480
  55. package/dist/{Title-EII5OxSP.js → Title-Dur74Of5.js} +151 -149
  56. package/dist/{Transaction-1MTkAfej.js → Transaction-x3fZwXdy.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BlQVWQHJ.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-9XLlfUdp.js} +7 -7
  58. package/dist/Voucher-DH7x7NAS.js +421 -0
  59. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CNn4GR2l.js +421 -0
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CTeGK4bk.js → ZodTextField.vue_vue_type_script_setup_true_lang-W-qWPW20.js} +2 -2
  61. package/dist/app-IRmnrMb8.js +59647 -0
  62. package/dist/app.js +1 -1
  63. package/dist/{business-DjnN-J4U.js → business-BZG7VHN8.js} +11 -8
  64. package/dist/campaign-BUvMmYOk.js +219 -0
  65. package/dist/campaign-BeRxvBzZ.js +254 -0
  66. package/dist/campaign.enum-BmFHrnub.js +26 -0
  67. package/dist/campaign.fn-B0sgTkC-.js +776 -0
  68. package/dist/{collectible.enum-r6N115Lu.js → collectible.enum-J0aolcpF.js} +1 -1
  69. package/dist/{collection.fn-CSsfVv26.js → collection.fn-BOhZm8S0.js} +2 -2
  70. package/dist/dto-CSNH3rWF.js +222 -0
  71. package/dist/duplicateCampaign-CAOL6p7n.js +51 -0
  72. package/dist/effect-DTL3F8d_.js +89 -0
  73. package/dist/{email-addresses-D8uheCCF.js → email-addresses-Bw8rSTHa.js} +2 -2
  74. package/dist/{export-Ver6WiX6.js → export-CY5VAxnU.js} +4 -4
  75. package/dist/{helper-Bg4xoFbh.js → helper-1sIKNm6C.js} +22 -7
  76. package/dist/{index-Dn_bmcns.js → index-BX_igCG6.js} +3 -3
  77. package/dist/index-B_-tEYD0.js +3625 -0
  78. package/dist/{index-BZZ4iF4-.js → index-BultP2zY.js} +23 -12
  79. package/dist/index-CAIsxBzT.js +48 -0
  80. package/dist/index-CVbL8J7-.js +85 -0
  81. package/dist/index-CuvNtC_M.js +61 -0
  82. package/dist/{index-D4JOeJJJ.js → index-D4Bx6J2q.js} +1 -1
  83. package/dist/{index-hJUxCNsF.js → index-DO2AYnVc.js} +1 -1
  84. package/dist/index-DPmqQmoC.js +30289 -0
  85. package/dist/{index-CNhr0_Zx.js → index-DoupH575.js} +617 -191
  86. package/dist/{index-Bb0CHeNx.js → index-DpXwZYX4.js} +3 -3
  87. package/dist/{index-BPQyQc4q.js → index-Gr5htFUW.js} +1 -1
  88. package/dist/index-KC-9_cY4.js +8910 -0
  89. package/dist/index-nMxh2OZ2.js +28900 -0
  90. package/dist/{index.esm2017-hK1Mi9yY.js → index.esm2017-0cVB_6L1.js} +122 -122
  91. package/dist/{loading-kIQFOTwH.js → loading-BUAN8WyV.js} +4 -3
  92. package/dist/{lodash-B5I3zXaY.js → lodash-C7OD0MNW.js} +1 -1
  93. package/dist/{membership--xR-HZoa.js → membership-CZkPkDiM.js} +38 -18
  94. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  95. package/dist/{money-c-ITXnlg.js → money-CdTox5sS.js} +1 -1
  96. package/dist/{number-DfZSBLOY.js → number-CxHO_EhJ.js} +1 -1
  97. package/dist/objectid-DL2GZe9v.js +145 -0
  98. package/dist/{campaign-BpJ1O6KS.js → plugins-BR4hQ6yY.js} +677 -699
  99. package/dist/remy-D_Deb3ue.js +13 -0
  100. package/dist/{reward-CE0ifMHS.js → reward-DWwwkcS3.js} +1 -1
  101. package/dist/{rule-DrjdmpaB.js → rule-CY_w8dsS.js} +505 -487
  102. package/dist/rule-builder-DMdUBkxB.js +102 -0
  103. package/dist/string-Gcy5IM_H.js +32 -0
  104. package/dist/style.css +11 -2
  105. package/dist/template-tuIzBpOC.js +188 -0
  106. package/dist/timezone-Dt3UFIE2.js +1156 -0
  107. package/dist/trigger-B9pWO76n.js +213 -0
  108. package/dist/useMarketingMaterialActions-C7XoKutU.js +96 -0
  109. package/dist/usePagination-Dvqiv0Ms.js +220 -0
  110. package/dist/{user-Cl3IotYV.js → user-DlrL0A8u.js} +15 -14
  111. package/dist/{vue-i18n-DKh0SMhL.js → vue-i18n-B2srUL0h.js} +449 -449
  112. package/dist/{xlsx-BDBzdOuM.js → xlsx-B9pnBbNc.js} +1 -1
  113. package/dist/{zod-Bg2FbC-D.js → zod-CO0ds3MB.js} +32 -31
  114. package/package.json +14 -6
  115. package/dist/AuditLogs-DTq6IAuc.js +0 -1887
  116. package/dist/Broadcast-UreS5Kiq.js +0 -227
  117. package/dist/Collections-B0I5ULxR.js +0 -465
  118. package/dist/Credit-B4Ad8DWP.js +0 -222
  119. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  120. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DjgACf9F.js +0 -2185
  121. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-y5JnuIev.js +0 -347
  122. package/dist/Experience-xO5KpTTm.js +0 -223
  123. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  124. package/dist/Game-ChgrVvz5.js +0 -278
  125. package/dist/Marketing-BlmRXSGl.js +0 -20073
  126. package/dist/Mission-B07wK0HX.js +0 -296
  127. package/dist/Point-Ckj9QIeH.js +0 -226
  128. package/dist/Promotion-aGNCOeRN.js +0 -289
  129. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DWj-421v.js +0 -1751
  130. package/dist/Segment-CRMNJ11X.js +0 -882
  131. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cfp8XXdO.js +0 -147
  132. package/dist/Setting-c0FWRZsD.js +0 -1936
  133. package/dist/Store-Bm1_15s8.js +0 -1842
  134. package/dist/StoreRewards-BCQHHfay.js +0 -423
  135. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CfTF2l-D.js +0 -1029
  136. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-rvhoxo0w.js +0 -139
  137. package/dist/Voucher-CYvjCb-v.js +0 -384
  138. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-63Jr71dJ.js +0 -419
  139. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  140. package/dist/app-BJLHk8ao.js +0 -33357
  141. package/dist/app-BzIk1ojT.js +0 -7086
  142. package/dist/campaign-BHNS5kXt.js +0 -96
  143. package/dist/campaign.enum-CJDWE_Om.js +0 -20
  144. package/dist/campaign.fn-C0HQE9uh.js +0 -758
  145. package/dist/dto-Byq51uVH.js +0 -214
  146. package/dist/effect-Do3yTM-_.js +0 -78
  147. package/dist/index-B1V9UnI9.js +0 -76
  148. package/dist/index-BM9CWjC6.js +0 -38
  149. package/dist/index-CsaQJMAR.js +0 -66
  150. package/dist/index-D6VxioBg.js +0 -30038
  151. package/dist/index-DGKlRWn3.js +0 -32260
  152. package/dist/index-DLKyOu7W.js +0 -8861
  153. package/dist/index-DyYF6HYL.js +0 -121
  154. package/dist/index-UXtH44XQ.js +0 -3120
  155. package/dist/objectid-DKbha9-x.js +0 -145
  156. package/dist/plugins-DtakupKW.js +0 -208
  157. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  158. package/dist/rule-builder-B_hCyq3x.js +0 -89
  159. package/dist/template-WI4a-lFY.js +0 -190
  160. package/dist/trigger-DieDHht3.js +0 -144
  161. package/dist/usePagination-BeF5K3M7.js +0 -223
@@ -1,8 +1,8 @@
1
- import { defineComponent as N, computed as f, ref as V, onMounted as H, resolveComponent as _, openBlock as c, createElementBlock as u, createVNode as i, withCtx as S, createElementVNode as p, toDisplayString as q, normalizeClass as A, Fragment as x, renderList as j, createCommentVNode as B } from "vue";
2
- import { J as D } from "./app-BJLHk8ao.js";
3
- import "./index-DGKlRWn3.js";
1
+ import { defineComponent as N, computed as f, ref as V, onMounted as H, resolveComponent as _, openBlock as c, createElementBlock as u, createVNode as i, withCtx as F, createElementVNode as p, toDisplayString as q, normalizeClass as A, Fragment as x, renderList as S, createCommentVNode as B } from "vue";
2
+ import { F as D } from "./app-IRmnrMb8.js";
3
+ import "./index-DPmqQmoC.js";
4
4
  import { c as E } from "./object-qECH92oz.js";
5
- const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 items-center w-full" }, T = { class: "flex grow items-center" }, $ = { class: "grow text-fm-color-typo-secondary" }, z = { key: 0 }, K = { class: "px-16" }, X = /* @__PURE__ */ N({
5
+ const M = { class: "flex flex-col flex-nowrap" }, T = { class: "flex gap-16 items-center w-full" }, $ = { class: "flex grow items-center" }, z = { class: "grow text-fm-color-typo-secondary" }, K = { key: 0 }, J = { class: "px-16" }, X = /* @__PURE__ */ N({
6
6
  __name: "SelectItems",
7
7
  props: {
8
8
  initialValue: {
@@ -22,8 +22,8 @@ const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 item
22
22
  default: 380
23
23
  }
24
24
  },
25
- setup(F, { expose: O }) {
26
- const m = F, b = D(), w = f(() => b.menu.value || {
25
+ setup(j, { expose: O }) {
26
+ const m = j, b = D(), w = f(() => b.menu.value || {
27
27
  _id: "",
28
28
  modules: {
29
29
  catalog: [],
@@ -78,7 +78,7 @@ const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 item
78
78
  return n ? Object.entries(C.value).reduce((e, [t, l]) => {
79
79
  if (l.name.toLowerCase().includes(n))
80
80
  return e[t] = l, e;
81
- const a = Object.entries(l.items).reduce((d, [h, o]) => (o.name.toLowerCase().includes(n) && (d[h] = o), d), {});
81
+ const a = Object.entries(l.items).reduce((d, [g, o]) => (o.name.toLowerCase().includes(n) && (d[g] = o), d), {});
82
82
  return Object.keys(a).length > 0 && (e[t] = { ...l, items: a }), e;
83
83
  }, {}) : C.value;
84
84
  }), s = V({}), y = V(""), G = f(() => Object.values(s.value).filter((n) => !!n).length);
@@ -88,12 +88,12 @@ const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 item
88
88
  H(async () => {
89
89
  await b.store.getMenu(), I(m.initialValue);
90
90
  });
91
- function g(n) {
91
+ function h(n) {
92
92
  const e = Object.keys(v.value[n].items), t = e.filter((l) => s.value[l]);
93
93
  return t.length ? t.length === e.length ? !0 : null : !1;
94
94
  }
95
95
  function U(n) {
96
- const e = Object.keys(v.value[n].items), t = g(n), l = E(s.value);
96
+ const e = Object.keys(v.value[n].items), t = h(n), l = E(s.value);
97
97
  for (const a of e)
98
98
  l[a] = t !== !0;
99
99
  s.value = l;
@@ -107,21 +107,21 @@ const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 item
107
107
  m.onComplete(n);
108
108
  }
109
109
  }), (n, e) => {
110
- const t = _("fm-button"), l = _("FmTextField"), a = _("fm-list-item"), d = _("fm-checkbox"), h = _("fm-list");
111
- return c(), u("div", J, [
110
+ const t = _("fm-button"), l = _("FmTextField"), a = _("fm-list-item"), d = _("fm-checkbox"), g = _("fm-list");
111
+ return c(), u("div", M, [
112
112
  i(a, {
113
113
  tag: "div",
114
114
  clickable: !1
115
115
  }, {
116
- default: S(() => [
117
- p("div", M, [
118
- p("div", T, [
116
+ default: F(() => [
117
+ p("div", T, [
118
+ p("div", $, [
119
119
  i(t, {
120
120
  icon: "sync",
121
121
  variant: "tertiary",
122
122
  onClick: e[0] || (e[0] = () => I([]))
123
123
  }),
124
- p("span", $, q(G.value) + " product(s) selected ", 1)
124
+ p("span", z, q(G.value) + " product(s) selected ", 1)
125
125
  ]),
126
126
  i(l, {
127
127
  modelValue: y.value,
@@ -134,18 +134,18 @@ const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 item
134
134
  ]),
135
135
  _: 1
136
136
  }),
137
- i(h, {
137
+ i(g, {
138
138
  class: A(["grow overflow-y-auto", `max-h-${m.maxHeight ? `[${m.maxHeight}px]` : "full"}`])
139
139
  }, {
140
- default: S(() => [
141
- (c(!0), u(x, null, j(v.value, (o) => (c(), u(x, {
140
+ default: F(() => [
141
+ (c(!0), u(x, null, S(v.value, (o) => (c(), u(x, {
142
142
  key: o.id
143
143
  }, [
144
- Object.keys(o.items).length > 0 ? (c(), u("div", z, [
145
- p("div", K, [
144
+ Object.keys(o.items).length > 0 ? (c(), u("div", K, [
145
+ p("div", J, [
146
146
  i(d, {
147
- "model-value": g(o.id) ?? !1,
148
- indeterminate: g(o.id) === null,
147
+ "model-value": h(o.id) ?? !1,
148
+ indeterminate: h(o.id) === null,
149
149
  label: o.name,
150
150
  value: "",
151
151
  name: "",
@@ -154,7 +154,7 @@ const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 item
154
154
  "onUpdate:modelValue": () => U(o.id)
155
155
  }, null, 8, ["model-value", "indeterminate", "label", "onUpdate:modelValue"])
156
156
  ]),
157
- (c(!0), u(x, null, j(o.items, (r) => (c(), u("div", {
157
+ (c(!0), u(x, null, S(o.items, (r) => (c(), u("div", {
158
158
  key: r.id,
159
159
  class: "pl-48"
160
160
  }, [
@@ -1,17 +1,17 @@
1
1
  import { defineComponent as L, ref as p, computed as C, onMounted as P, resolveComponent as i, openBlock as $, createBlock as D, unref as e, isRef as H, withCtx as S, createElementVNode as v, createVNode as c, toDisplayString as w } from "vue";
2
- import { u as O } from "./loading-kIQFOTwH.js";
3
- import { p as Z } from "./plugins-DtakupKW.js";
2
+ import { u as O } from "./loading-BUAN8WyV.js";
3
+ import { p as Z } from "./plugins-BR4hQ6yY.js";
4
4
  import { u as q } from "./app-wDQR6dpb.js";
5
- import { m as z } from "./index-B1V9UnI9.js";
6
- import "./index-CNhr0_Zx.js";
7
- import { b as G } from "./index-UXtH44XQ.js";
8
- import "./index-DLKyOu7W.js";
9
- import "./index-BM9CWjC6.js";
10
- import "./index-Bb0CHeNx.js";
11
- import { Z as d } from "./zod-Bg2FbC-D.js";
12
- import { z as Y } from "./app-BzIk1ojT.js";
13
- import { u as j } from "./vue-i18n-DKh0SMhL.js";
14
- import { c as J } from "./index-DyYF6HYL.js";
5
+ import { m as z } from "./index-CVbL8J7-.js";
6
+ import "./index-DoupH575.js";
7
+ import { b as G } from "./index-B_-tEYD0.js";
8
+ import "./index-KC-9_cY4.js";
9
+ import "./index-DPmqQmoC.js";
10
+ import "./index-DpXwZYX4.js";
11
+ import { Z as d } from "./zod-CO0ds3MB.js";
12
+ import { z as Y } from "./app-IRmnrMb8.js";
13
+ import { u as j } from "./vue-i18n-B2srUL0h.js";
14
+ import { c as J } from "./campaign-BUvMmYOk.js";
15
15
  const K = { class: "fm-typo-en-body-lg-600" }, Q = { class: "fm-typo-en-body-lg-400" }, W = { class: "flex items-center gap-8" }, fe = /* @__PURE__ */ L({
16
16
  __name: "SendCollectionSheet",
17
17
  emits: ["success"],
@@ -0,0 +1,226 @@
1
+ import { defineComponent as O, ref as p, computed as g, watch as T, onMounted as q, resolveComponent as x, openBlock as I, createBlock as G, unref as t, isRef as k, withCtx as z, createElementVNode as n, createVNode as s, toDisplayString as f, createElementBlock as H, createCommentVNode as K } from "vue";
2
+ import { J as Q } from "./JsonViewer-v8_C7l5N.js";
3
+ import { _ as F } from "./FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js";
4
+ import { u as W } from "./loading-BUAN8WyV.js";
5
+ import { u as X } from "./app-wDQR6dpb.js";
6
+ import { l as Y } from "./lodash-C7OD0MNW.js";
7
+ import { m as Z } from "./index-CVbL8J7-.js";
8
+ import { c as ee } from "./campaign-BUvMmYOk.js";
9
+ const ae = { class: "space-y-16" }, te = { class: "fm-typo-en-body-md-600" }, oe = { class: "flex items-center justify-end" }, le = {
10
+ key: 0,
11
+ class: "basis-72 bg-white flex items-center justify-between px-24 pt-6 border-t border-fm-color-border"
12
+ }, ne = { class: "flex gap-24 items-center justify-between xs:hidden xs:invisible" }, se = { class: "flex gap-8 items-center" }, ie = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, re = { class: "flex gap-8 items-center" }, ue = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary xs:mr-auto" }, de = { class: "flex gap-8" }, ce = { class: "flex items-center gap-8" }, Se = /* @__PURE__ */ O({
13
+ __name: "SendVoucherSheet",
14
+ emits: ["success"],
15
+ setup(me, { expose: M, emit: R }) {
16
+ const { minor: j } = W, h = p(""), r = p({}), N = R, m = p(!1), i = p([]);
17
+ function P(o) {
18
+ m.value = !0, h.value = o.campaignId, i.value = [];
19
+ }
20
+ function S() {
21
+ m.value = !1;
22
+ }
23
+ const B = [
24
+ {
25
+ header: "Name",
26
+ accessorFn: (o) => o.name || "No Profile"
27
+ },
28
+ {
29
+ header: "Phone",
30
+ accessorFn: (o) => o.phoneNumber || "-"
31
+ }
32
+ ], e = p({
33
+ searchValue: "",
34
+ pageSize: 10,
35
+ pageCount: 0,
36
+ pageIndex: 0,
37
+ totalRows: 0,
38
+ isLoading: !1
39
+ }), u = p([]), L = g(() => e.value.pageIndex + 1), _ = g(
40
+ () => e.value.pageIndex * e.value.pageSize
41
+ ), U = g(
42
+ () => Math.min(
43
+ _.value + e.value.pageSize,
44
+ e.value.totalRows
45
+ )
46
+ ), w = g(() => e.value.pageIndex > 0), C = g(
47
+ () => e.value.pageIndex < e.value.pageCount - 1
48
+ ), b = async (o) => {
49
+ e.value.pageSize = o.pageSize, e.value.pageIndex = o.pageIndex, e.value.isLoading = !0, u.value = [];
50
+ try {
51
+ const a = await Z.read({
52
+ limit: o.pageSize,
53
+ skip: o.pageIndex,
54
+ sortBy: "_id",
55
+ search: e.value.searchValue,
56
+ descending: !1
57
+ });
58
+ u.value = a.resources, e.value.totalRows = a.meta.totalResources ?? 0, e.value.pageCount = a.meta.totalPages ?? 0, r.value = {}, i.value.forEach((d) => {
59
+ const y = u.value.findIndex((c) => c._id == d);
60
+ y > -1 && (r.value[y] = !0);
61
+ });
62
+ } finally {
63
+ e.value.isLoading = !1;
64
+ }
65
+ }, $ = Y.debounce(async () => {
66
+ await b({ pageSize: e.value.pageSize, pageIndex: 0 });
67
+ }, 500), v = async (o) => {
68
+ await b({ pageSize: e.value.pageSize, pageIndex: o });
69
+ }, A = async (o) => {
70
+ await b({ pageSize: o, pageIndex: 0 });
71
+ };
72
+ function E() {
73
+ u.value.length > 0 && (i.value = i.value.filter(
74
+ (o) => !u.value.some((a) => a._id === o) || // Keep if not in current page
75
+ Object.entries(r.value).some(
76
+ ([a, d]) => d && u.value[a]._id === o
77
+ // Keep if selected in current page
78
+ )
79
+ ));
80
+ for (const [o, a] of Object.entries(r.value))
81
+ if (a) {
82
+ const d = u.value[o]._id;
83
+ i.value.includes(d) || i.value.push(d);
84
+ }
85
+ }
86
+ async function D(o) {
87
+ i.value.length < 1 || await j(
88
+ async () => {
89
+ await ee.sendCollection(h.value, {
90
+ memberId: i.value
91
+ }), await N("success"), S();
92
+ },
93
+ {
94
+ message: "Sending claim(s)",
95
+ successMessage: "Claim(s) created"
96
+ }
97
+ );
98
+ }
99
+ return T(r, E, { deep: !0 }), M({
100
+ showSheet: P,
101
+ hideSheet: S
102
+ }), q(async () => {
103
+ await b(e.value);
104
+ }), (o, a) => {
105
+ const d = x("FmSearch"), y = x("FmTable"), c = x("FmButton"), J = x("FmSideSheet");
106
+ return I(), G(J, {
107
+ "max-width": 560,
108
+ "dismiss-away": !0,
109
+ header: "Send voucher to",
110
+ modelValue: t(m),
111
+ "onUpdate:modelValue": [
112
+ a[8] || (a[8] = (l) => k(m) ? m.value = l : null),
113
+ a[9] || (a[9] = (l) => m.value = l)
114
+ ]
115
+ }, {
116
+ "side-sheet-footer": z(() => [
117
+ n("div", ce, [
118
+ s(c, {
119
+ label: "Send",
120
+ loading: t(X)().isLoading,
121
+ onClick: D
122
+ }, null, 8, ["loading"]),
123
+ s(c, {
124
+ label: "Cancel",
125
+ type: "button",
126
+ variant: "tertiary",
127
+ onClick: a[7] || (a[7] = (l) => m.value = !1)
128
+ })
129
+ ])
130
+ ]),
131
+ default: z(() => [
132
+ s(Q, { json: t(i) }, null, 8, ["json"]),
133
+ n("div", ae, [
134
+ n("div", te, f(t(i).length) + " members selected ", 1),
135
+ n("div", oe, [
136
+ s(d, {
137
+ class: "mt-4",
138
+ modelValue: t(e).searchValue,
139
+ "onUpdate:modelValue": [
140
+ a[0] || (a[0] = (l) => t(e).searchValue = l),
141
+ t($)
142
+ ],
143
+ placeholder: "Search Member",
144
+ collapsible: ""
145
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
146
+ ]),
147
+ s(y, {
148
+ modelValue: t(r),
149
+ "onUpdate:modelValue": a[1] || (a[1] = (l) => k(r) ? r.value = l : null),
150
+ selection: "multiple",
151
+ loading: t(e).isLoading,
152
+ "row-data": t(u),
153
+ "column-defs": B,
154
+ "page-size": t(e).pageSize,
155
+ "page-count": t(e).pageCount,
156
+ "fetch-fn": void 0,
157
+ "hide-footer": ""
158
+ }, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count"]),
159
+ t(e).totalRows > t(e).pageSize ? (I(), H("div", le, [
160
+ n("div", ne, [
161
+ n("div", se, [
162
+ a[10] || (a[10] = n("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, " Items per page: ", -1)),
163
+ s(F, {
164
+ items: [
165
+ { label: "10", value: 10 },
166
+ { label: "20", value: 20 },
167
+ { label: "50", value: 50 }
168
+ ],
169
+ value: t(e).pageSize,
170
+ "onUpdate:modelValue": A
171
+ }, null, 8, ["value"])
172
+ ]),
173
+ n("span", ie, f(t(_) + 1) + " - " + f(t(U)) + " of " + f(t(e).totalRows) + " items ", 1)
174
+ ]),
175
+ n("div", re, [
176
+ s(F, {
177
+ items: Array.from(Array(t(e).pageCount), (l, V) => ({
178
+ label: (V + 1).toString(),
179
+ value: V + 1
180
+ })),
181
+ value: t(L),
182
+ "onUpdate:modelValue": a[2] || (a[2] = (l) => v(l - 1))
183
+ }, null, 8, ["items", "value"]),
184
+ n("span", ue, " of " + f(t(e).pageCount) + " pages ", 1),
185
+ n("div", de, [
186
+ s(c, {
187
+ disabled: !t(w),
188
+ icon: "first_page",
189
+ "icon-color": "neutral-black",
190
+ variant: "tertiary",
191
+ onClick: a[3] || (a[3] = (l) => v(0))
192
+ }, null, 8, ["disabled"]),
193
+ s(c, {
194
+ disabled: !t(w),
195
+ icon: "chevron_left",
196
+ "icon-color": "neutral-black",
197
+ variant: "tertiary",
198
+ onClick: a[4] || (a[4] = (l) => v(t(e).pageIndex - 1))
199
+ }, null, 8, ["disabled"]),
200
+ s(c, {
201
+ disabled: !t(C),
202
+ icon: "chevron_right",
203
+ "icon-color": "neutral-black",
204
+ variant: "tertiary",
205
+ onClick: a[5] || (a[5] = (l) => v(t(e).pageIndex + 1))
206
+ }, null, 8, ["disabled"]),
207
+ s(c, {
208
+ disabled: !t(C),
209
+ icon: "last_page",
210
+ "icon-color": "neutral-black",
211
+ variant: "tertiary",
212
+ onClick: a[6] || (a[6] = (l) => v(t(e).pageCount - 1))
213
+ }, null, 8, ["disabled"])
214
+ ])
215
+ ])
216
+ ])) : K("", !0)
217
+ ])
218
+ ]),
219
+ _: 1
220
+ }, 8, ["modelValue"]);
221
+ };
222
+ }
223
+ });
224
+ export {
225
+ Se as _
226
+ };