@feedmepos/mf-connect 0.1.32-prod → 0.1.34-prod

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/{Analytic-DRJEtVnN.js → Analytic-DrqtMm_3.js} +11 -11
  2. package/dist/{App-C1IuGBAJ.js → App-DDODApKk.js} +6 -6
  3. package/dist/{Bin-CM9cU-iH.js → Bin-Dnxjyw7S.js} +8 -8
  4. package/dist/{Broadcast-1Fy8Nob5.js → Broadcast-B_-4eCTz.js} +9 -9
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DiAEDcl5.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-hdBANCwp.js} +6 -6
  6. package/dist/{Card-CnuSjjCj.js → Card-CJCHgCQ5.js} +16 -16
  7. package/dist/{Collections-DAj_A1iu.js → Collections-DfFIqKEH.js} +7 -7
  8. package/dist/{Credit-DLH2GYYz.js → Credit-C_oIN0On.js} +9 -9
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C4Sy1K8q.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-fhkxwj0Z.js} +29 -29
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-D4--kNds.js → EffectSheet.vue_vue_type_style_index_0_lang-BWBAp7gL.js} +6 -6
  11. package/dist/{Experience-Dgyi4U-L.js → Experience-VFljrhnh.js} +9 -9
  12. package/dist/{Game-VKYjF7hq.js → Game-DQc95My6.js} +10 -10
  13. package/dist/{Index-B0BkKPLD.js → Index-CVKFs0Uj.js} +10 -10
  14. package/dist/{Marketing-Bzl7m10d.js → Marketing-C-GE-2ln.js} +6 -6
  15. package/dist/{Member-CDmDoJFr.js → Member-DcoSmfmv.js} +10 -10
  16. package/dist/{MemberList-C4l_Q9y1.js → MemberList-Boy_sG9l.js} +25 -25
  17. package/dist/{MemberTransactions-SUlFwOov.js → MemberTransactions-BhDEhN0w.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Buj3xx1j.js → MessageInput.vue_vue_type_script_setup_true_lang-DOiX6Yt3.js} +28 -26
  19. package/dist/{Mission-BriLVrc4.js → Mission-D3sdzhB4.js} +10 -10
  20. package/dist/{Overview-AklJfO0G.js → Overview-CVdReBLD.js} +18 -18
  21. package/dist/{Point-B7VnNPaG.js → Point-DcXXzHZs.js} +9 -9
  22. package/dist/{Promotion-hlKzzWJD.js → Promotion-CzcbwuEh.js} +10 -10
  23. package/dist/{Queue-gOxy9cBG.js → Queue-MjMygLp1.js} +10 -10
  24. package/dist/{Record-BwWXqFv6.js → Record-At0Dj4gY.js} +8 -8
  25. package/dist/{Reward-JKh-M0oD.js → Reward-DC0x4FEN.js} +15 -15
  26. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DFogiHWh.js → RewardGroup.vue_vue_type_script_setup_true_lang-D1GoJQhG.js} +11 -11
  27. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CTOfCYsE.js → RuleGroup.vue_vue_type_script_setup_true_lang-AT5tq19G.js} +13 -13
  28. package/dist/{Segment-BlMx0eoR.js → Segment-C2po2wdg.js} +202 -200
  29. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DCsFcqQ5.js → SelectItems.vue_vue_type_script_setup_true_lang-CO58zH4S.js} +2 -2
  30. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-G01kJeLd.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BfxWBP9G.js} +11 -11
  31. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-gUoBLfVo.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BlFxpXt4.js} +3 -3
  32. package/dist/{Setting-CoKP6Z-F.js → Setting-DoLFVHlm.js} +11 -11
  33. package/dist/{Store-CxUagz23.js → Store-iR0ry7X0.js} +19 -19
  34. package/dist/{StoreRewards-CLSQgaNo.js → StoreRewards-DxCPZd_r.js} +13 -13
  35. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-V4rH3vAQ.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DGrprMs_.js} +18 -18
  36. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DJ7incG7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BPh5Z6N1.js} +1 -1
  37. package/dist/{Tier-DwTL1xNM.js → Tier-BbDMN5iw.js} +20 -20
  38. package/dist/{Title-DhBL_eYK.js → Title-rFztfYBl.js} +19 -19
  39. package/dist/{Transaction-CRskHsNr.js → Transaction-DqwIBdqB.js} +2 -2
  40. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DoE7rDgi.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-etvjAEmB.js} +6 -6
  41. package/dist/{Voucher-CxDqASF5.js → Voucher-QZqmL2ku.js} +12 -12
  42. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-wkihtNI3.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DosYUfSg.js} +10 -10
  43. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BeLTXjOv.js → ZodTextField.vue_vue_type_script_setup_true_lang-CiKS3594.js} +1 -1
  44. package/dist/{app-CTFwjMxq.js → app-Ctt8QudR.js} +1 -1
  45. package/dist/{app-QgT2HXjv.js → app-DLw8SHFr.js} +30 -30
  46. package/dist/app.js +1 -1
  47. package/dist/{business-DhCzKu3V.js → business-B9JsEDll.js} +1 -1
  48. package/dist/{campaign-CFggCOe6.js → campaign-BSrd2yzm.js} +9 -9
  49. package/dist/{campaign-DAgovrbX.js → campaign-DWBnBQOZ.js} +2 -2
  50. package/dist/{campaign.enum-pZr63pXN.js → campaign.enum-BHXpCUgq.js} +1 -1
  51. package/dist/{campaign.fn-CM_t1wNu.js → campaign.fn-C4HWXHAh.js} +135 -135
  52. package/dist/{collectible.enum-fbWiJ-v2.js → collectible.enum-CvE2W3m5.js} +1 -1
  53. package/dist/{collection.fn-BrbSJ0dj.js → collection.fn-Cno-e9JK.js} +2 -2
  54. package/dist/{dto-BcLrcoo_.js → dto-DI4XRSoe.js} +4 -4
  55. package/dist/{effect-WVUo2VX0.js → effect-DnzUKj4J.js} +1 -1
  56. package/dist/{email-addresses-B8YBttOp.js → email-addresses-Bap6VvPm.js} +1 -1
  57. package/dist/{export-FilTnKIf.js → export-CmvfcNtI.js} +3 -3
  58. package/dist/{helper-A-JE89j8.js → helper-ZuuMoaSo.js} +1 -1
  59. package/dist/{index-DvM-OpLR.js → index-0XngMu-Y.js} +4 -4
  60. package/dist/{index-C1vwtNMj.js → index-0z1sEcNu.js} +6 -6
  61. package/dist/{index-BPCfLPV5.js → index-B1-mRj9-.js} +1 -1
  62. package/dist/{index-CX4Q-ODj.js → index-BjeOhXhZ.js} +1 -1
  63. package/dist/{index-BSavh-ab.js → index-BmXc9-5B.js} +3 -3
  64. package/dist/{index-OehNKdCW.js → index-CTxXsCTb.js} +1 -1
  65. package/dist/{index-CyqffI0r.js → index-Cbb81yjL.js} +1 -1
  66. package/dist/{index-CzbdA0d3.js → index-CsjZT9kD.js} +1 -1
  67. package/dist/{index-DFS6jDHm.js → index-DE7rGgsK.js} +3 -3
  68. package/dist/{index-FsTLGrIL.js → index-D__yMgTW.js} +1 -1
  69. package/dist/{index-CK_9lnGD.js → index-PX4G4FW9.js} +3 -3
  70. package/dist/{index-DI956UFg.js → index-iDyqvmDo.js} +1 -1
  71. package/dist/{index-CzH8ux-h.js → index-iKn7X4oS.js} +2 -2
  72. package/dist/{index.esm2017-CScWJGpE.js → index.esm2017-D13LPLo8.js} +1 -1
  73. package/dist/{loading-CXZ39_xw.js → loading-cvwsVDDF.js} +1 -1
  74. package/dist/{membership-Bg_pBT1C.js → membership-Ctmy5tHm.js} +3 -3
  75. package/dist/{money-D4vhiGvs.js → money-DqsPUHKT.js} +1 -1
  76. package/dist/{number-p3U-wKsr.js → number-DtGonzF6.js} +1 -1
  77. package/dist/{objectid-C_k8DXMk.js → objectid-llTGs8je.js} +3 -3
  78. package/dist/{plugins-BzCgGFW_.js → plugins-Be0jgH3O.js} +2 -2
  79. package/dist/{reward-DL7dVgek.js → reward-CJQ9SaLe.js} +1 -1
  80. package/dist/{rule-iUlMzG59.js → rule-DHiWaxVy.js} +3 -3
  81. package/dist/{rule-builder-DZEGo8FL.js → rule-builder-RQcKZGI9.js} +1 -1
  82. package/dist/{template-FZF9V1B2.js → template-Ts3TnX2X.js} +4 -4
  83. package/dist/{trigger-woPb5C0Z.js → trigger-bvzPuRvJ.js} +4 -4
  84. package/dist/{user-CoOoRDFP.js → user-By9M-sOs.js} +1 -1
  85. package/dist/{vue-i18n-5r8XYctA.js → vue-i18n-AhTvM7em.js} +165 -165
  86. package/dist/{xlsx-Cx714TFU.js → xlsx-DIxZ85BX.js} +1 -1
  87. package/package.json +1 -1
@@ -1,40 +1,42 @@
1
- import { defineComponent as ee, ref as z, resolveComponent as w, openBlock as p, createElementBlock as k, createVNode as i, unref as t, createCommentVNode as le, createElementVNode as s, withCtx as E, Fragment as O, renderList as ie, createBlock as J, toDisplayString as D, normalizeClass as re, onMounted as xe, computed as ce, isRef as Me, createSlots as Ie, h as Y, onBeforeMount as Te } from "vue";
1
+ import { defineComponent as ee, ref as z, resolveComponent as b, openBlock as p, createElementBlock as C, createVNode as i, unref as t, createCommentVNode as le, createElementVNode as s, withCtx as E, Fragment as O, renderList as ie, createBlock as J, toDisplayString as D, normalizeClass as re, onMounted as Se, computed as ce, isRef as Ie, createSlots as Me, h as Y, onBeforeMount as Te } from "vue";
2
2
  import { _ as Ee } from "./campaign-CpzFl8Vr.js";
3
- import { p as $e } from "./plugins-BzCgGFW_.js";
4
- import { u as Ae } from "./loading-CXZ39_xw.js";
5
- import { FmButtonVariant as ae, useSnackbar as Re, components as X } from "@feedmepos/ui-library";
6
- import { u as Se, _ as we } from "./usePagination-JoYaROkV.js";
7
- import { u as Fe } from "./vue-i18n-5r8XYctA.js";
8
- import { i as De, j as R, c as fe } from "./index-DvM-OpLR.js";
9
- import "./index-CzH8ux-h.js";
10
- import "./index-C1vwtNMj.js";
11
- import "./index-CzbdA0d3.js";
12
- import "./index-CK_9lnGD.js";
13
- import { u as ne, w as be } from "./xlsx-Cx714TFU.js";
14
- import { e as Pe, M as Ne } from "./email-addresses-B8YBttOp.js";
3
+ import { p as $e } from "./plugins-Be0jgH3O.js";
4
+ import { u as Re } from "./loading-cvwsVDDF.js";
5
+ import { FmButtonVariant as ae, useSnackbar as Ae, components as X } from "@feedmepos/ui-library";
6
+ import { u as xe, _ as be } from "./usePagination-JoYaROkV.js";
7
+ import { u as we } from "./vue-i18n-AhTvM7em.js";
8
+ import { i as De, j as A, c as fe } from "./index-0XngMu-Y.js";
9
+ import "./index-iKn7X4oS.js";
10
+ import "./index-0z1sEcNu.js";
11
+ import "./index-CsjZT9kD.js";
12
+ import "./index-PX4G4FW9.js";
13
+ import { u as ne, w as Fe } from "./xlsx-DIxZ85BX.js";
14
+ import { e as Pe, M as Ne } from "./email-addresses-Bap6VvPm.js";
15
15
  import { Z as Be } from "./zod-Bg2FbC-D.js";
16
16
  import { u as Ve } from "./app-wDQR6dpb.js";
17
- import { F as ye, z as Ye } from "./index-DFS6jDHm.js";
18
- import { R as ge } from "./rule-builder-DZEGo8FL.js";
19
- import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BeLTXjOv.js";
20
- import { _ as Ue } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CTOfCYsE.js";
21
- import { u as ze, v as Oe, w as je } from "./index.esm2017-CScWJGpE.js";
17
+ import { F as ye, z as Ye } from "./index-DE7rGgsK.js";
18
+ import { R as ge } from "./rule-builder-RQcKZGI9.js";
19
+ import { _ as Ue } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CiKS3594.js";
20
+ import { _ as Le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-AT5tq19G.js";
21
+ import { u as ze, v as Oe, w as je } from "./index.esm2017-D13LPLo8.js";
22
22
  import { F as qe } from "./FileSaver.min-NlMItPOc.js";
23
23
  import { h as G } from "./moment-BWErdI6_.js";
24
- import { s as N, u as He } from "./membership-Bg_pBT1C.js";
24
+ import { s as N, u as He } from "./membership-Ctmy5tHm.js";
25
25
  import { o as Ge } from "./objectId-dwaoBfJX.js";
26
- import { u as Ce } from "./business-DhCzKu3V.js";
27
- import { f as Je } from "./number-p3U-wKsr.js";
28
- import { t as Qe } from "./money-D4vhiGvs.js";
29
- import "./index-CyqffI0r.js";
26
+ import { u as ke } from "./business-B9JsEDll.js";
27
+ import { f as Je } from "./number-DtGonzF6.js";
28
+ import { t as Qe } from "./money-DqsPUHKT.js";
29
+ import "./index-Cbb81yjL.js";
30
30
  import { useRouter as We } from "vue-router";
31
- import { m as ve } from "./index-FsTLGrIL.js";
32
- import { R as _e } from "./app-QgT2HXjv.js";
33
- const Ze = De.extend({
31
+ import { m as ve } from "./index-D__yMgTW.js";
32
+ import { R as _e } from "./app-DLw8SHFr.js";
33
+ const Ke = De.extend({
34
34
  _id: ye.optional(),
35
35
  business: ye.optional(),
36
36
  file: Ye.any().nullish()
37
- }), Ke = { class: "flex flex-col space-y-16" }, Xe = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1), et = {
37
+ });
38
+ var Ze = { firebase: { apiKey: "AIzaSyA_isPR1-9bX7UmRiJIhsIRNNwdn6DdmW4", authDomain: "feedme-253402.firebaseapp.com", databaseURL: "https://feedme-253402.firebaseio.com", projectId: "feedme-253402", storageBucket: "image.feedme.cc", messagingSenderId: "128512026847", appId: "1:128512026847:web:7c5c8ab7e8b90502dc616a", measurementId: "G-LTKS7N2HQS" }, assetBucketUrl: "static.feedme.cc", importFilesBucketUrl: "feedme-253402.appspot.com", clientId: "d5f8840d63dbb758b6c4ee2a5e8b013d15dd25e242c457481326062b83962476" };
39
+ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1), tt = {
38
40
  key: 0,
39
41
  class: /* @__PURE__ */ re([
40
42
  "p-16 pl-24 space-x-8",
@@ -42,21 +44,21 @@ const Ze = De.extend({
42
44
  "flex items-center",
43
45
  "justify-between"
44
46
  ])
45
- }, tt = { class: "flex justify-end" }, ot = {
47
+ }, ot = { class: "flex justify-end" }, at = {
46
48
  key: 1,
47
49
  class: /* @__PURE__ */ re([
48
50
  "flex items-center",
49
51
  "border border-fm-color-neutral-gray-300",
50
52
  "p-16 space-x-16 rounded-md"
51
53
  ])
52
- }, at = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, nt = /* @__PURE__ */ ee({
54
+ }, nt = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, st = /* @__PURE__ */ ee({
53
55
  __name: "ImportSegment",
54
56
  props: {
55
57
  importFile: {}
56
58
  },
57
59
  emits: ["update:file"],
58
60
  setup(e, { emit: v }) {
59
- const _ = e, b = v, { t: m } = Fe(), y = z(null), f = z(null), F = ["Id"], l = [
61
+ const _ = e, F = v, { t: m } = we(), y = z(null), f = z(null), w = ["Id"], l = [
60
62
  {
61
63
  label: "CSV",
62
64
  icon: "csv",
@@ -71,8 +73,8 @@ const Ze = De.extend({
71
73
  async function n() {
72
74
  if (_.importFile)
73
75
  try {
74
- const h = ze(), x = Oe(h, _.importFile), S = await je(x);
75
- window.open(S, "_blank");
76
+ const h = ze(void 0, Ze.importFilesBucketUrl), S = Oe(h, _.importFile), x = await je(S);
77
+ window.open(x, "_blank");
76
78
  } catch (h) {
77
79
  console.log(h);
78
80
  }
@@ -80,31 +82,31 @@ const Ze = De.extend({
80
82
  async function c(h) {
81
83
  switch (h) {
82
84
  case "csv":
83
- const x = new Blob([F.join(",")], {
85
+ const S = new Blob([w.join(",")], {
84
86
  type: "text/csv;charset=utf-8;"
85
87
  });
86
- qe.saveAs(x, "ImportSegmentTemplate.csv");
88
+ qe.saveAs(S, "ImportSegmentTemplate.csv");
87
89
  break;
88
90
  case "xlsx":
89
- const S = ne.aoa_to_sheet([F]), M = ne.book_new();
90
- ne.book_append_sheet(M, S, "Sheet1"), be(M, "ImportSegmentTemplate.xlsx");
91
+ const x = ne.aoa_to_sheet([w]), I = ne.book_new();
92
+ ne.book_append_sheet(I, x, "Sheet1"), Fe(I, "ImportSegmentTemplate.xlsx");
91
93
  break;
92
94
  }
93
95
  }
94
- function C(h) {
95
- y.value = h, b("update:file", y.value);
96
+ function k(h) {
97
+ y.value = h, F("update:file", y.value);
96
98
  }
97
99
  function $(h) {
98
- var S, M;
99
- const x = ((M = (S = h.target) == null ? void 0 : S.files) == null ? void 0 : M[0]) ?? null;
100
- C(x);
100
+ var x, I;
101
+ const S = ((I = (x = h.target) == null ? void 0 : x.files) == null ? void 0 : I[0]) ?? null;
102
+ k(S);
101
103
  }
102
- return (h, x) => {
103
- const S = w("FmButton"), M = w("FmMenuItem"), u = w("FmMenu"), r = w("FmDropField");
104
- return p(), k("div", Ke, [
105
- Xe,
106
- h.importFile ? (p(), k("div", et, [
107
- i(S, {
104
+ return (h, S) => {
105
+ const x = b("FmButton"), I = b("FmMenuItem"), u = b("FmMenu"), r = b("FmDropField");
106
+ return p(), C("div", Xe, [
107
+ et,
108
+ h.importFile ? (p(), C("div", tt, [
109
+ i(x, {
108
110
  label: t(m)("View uploaded file"),
109
111
  variant: t(ae).Plain,
110
112
  icon: "file_present",
@@ -112,42 +114,42 @@ const Ze = De.extend({
112
114
  }, null, 8, ["label", "variant"])
113
115
  ])) : le("", !0),
114
116
  s("div", null, [
115
- s("div", tt, [
117
+ s("div", ot, [
116
118
  i(u, { class: "" }, {
117
119
  "menu-button": E(() => [
118
- i(S, {
120
+ i(x, {
119
121
  variant: "tertiary",
120
122
  icon: "download",
121
123
  label: "Download Template"
122
124
  })
123
125
  ]),
124
126
  default: E(() => [
125
- (p(), k(O, null, ie(l, (g) => i(M, {
127
+ (p(), C(O, null, ie(l, (g) => i(I, {
126
128
  key: g.value,
127
129
  icon: g.icon,
128
130
  label: g.label,
129
- onClick: (L) => c(g.value),
131
+ onClick: (U) => c(g.value),
130
132
  selectable: ""
131
133
  }, null, 8, ["icon", "label", "onClick"])), 64))
132
134
  ]),
133
135
  _: 1
134
136
  })
135
137
  ]),
136
- y.value ? (p(), k("div", ot, [
137
- i(S, {
138
+ y.value ? (p(), C("div", at, [
139
+ i(x, {
138
140
  variant: t(ae).Tertiary,
139
141
  "prepend-icon": "attach_file"
140
142
  }, null, 8, ["variant"]),
141
- s("p", at, D(y.value.name), 1),
143
+ s("p", nt, D(y.value.name), 1),
142
144
  s("label", {
143
145
  ref_key: "fileLabelRef",
144
146
  ref: f,
145
147
  htmlFor: "file"
146
148
  }, [
147
- i(S, {
149
+ i(x, {
148
150
  variant: t(ae).Plain,
149
151
  label: t(m)("Replace File"),
150
- onClick: x[1] || (x[1] = () => {
152
+ onClick: S[1] || (S[1] = () => {
151
153
  var g;
152
154
  return (g = f.value) == null ? void 0 : g.click();
153
155
  })
@@ -163,7 +165,7 @@ const Ze = De.extend({
163
165
  ], 512)
164
166
  ])) : (p(), J(r, {
165
167
  key: 0,
166
- onFileUpload: x[0] || (x[0] = (g) => C(g)),
168
+ onFileUpload: S[0] || (S[0] = (g) => k(g)),
167
169
  accept: ".csv, .xlsx",
168
170
  "max-file-size": 2e7
169
171
  }))
@@ -171,7 +173,7 @@ const Ze = De.extend({
171
173
  ]);
172
174
  };
173
175
  }
174
- }), st = { class: "space-y-16 pr-12" }, lt = { class: "fm-typo-en-title-md-800" }, it = { class: "flex space-x-8" }, rt = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, ct = { class: "text-fm-color-typo-secondary" }, dt = /* @__PURE__ */ s("div", null, "contacts in your segment", -1), ut = /* @__PURE__ */ ee({
176
+ }), lt = { class: "space-y-16 pr-12" }, it = { class: "fm-typo-en-title-md-800" }, rt = { class: "flex space-x-8" }, ct = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, dt = { class: "text-fm-color-typo-secondary" }, ut = /* @__PURE__ */ s("div", null, "contacts in your segment", -1), pt = /* @__PURE__ */ ee({
175
177
  __name: "ReviewSegment",
176
178
  props: {
177
179
  title: {},
@@ -204,7 +206,7 @@ const Ze = De.extend({
204
206
  accessorFn: (n) => G(n.stats.lastVisit).format("DD MMM YYYY")
205
207
  }
206
208
  ];
207
- async function b(n) {
209
+ async function F(n) {
208
210
  return v.segment._id ? (console.log(n), await N.paginateSegmentUsers(
209
211
  v.segment._id,
210
212
  n
@@ -219,19 +221,19 @@ const Ze = De.extend({
219
221
  }
220
222
  };
221
223
  }
222
- const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: F, onSearch: l } = Se(b);
223
- return xe(async () => {
224
- await F();
225
- }), (n, c) => (p(), k("div", st, [
226
- s("div", lt, D(v.title), 1),
227
- s("div", it, [
228
- s("div", rt, D(n.segment.members.length), 1),
229
- s("div", ct, [
230
- dt,
224
+ const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: w, onSearch: l } = xe(F);
225
+ return Se(async () => {
226
+ await w();
227
+ }), (n, c) => (p(), C("div", lt, [
228
+ s("div", it, D(v.title), 1),
229
+ s("div", rt, [
230
+ s("div", ct, D(n.segment.members.length), 1),
231
+ s("div", dt, [
232
+ ut,
231
233
  s("div", null, "as of " + D(t(G)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
232
234
  ])
233
235
  ]),
234
- i(we, {
236
+ i(be, {
235
237
  loading: t(m).isLoading,
236
238
  "row-data": t(y),
237
239
  "row-count": t(m).totalRows,
@@ -240,11 +242,11 @@ const Ze = De.extend({
240
242
  "page-count": t(m).pageCount,
241
243
  "page-index": t(m).pageIndex,
242
244
  onSortChange: t(f),
243
- onPageChange: c[0] || (c[0] = (C) => t(F)({ pageSize: C.pageSize, pageIndex: C.pageIndex }))
245
+ onPageChange: c[0] || (c[0] = (k) => t(w)({ pageSize: k.pageSize, pageIndex: k.pageIndex }))
244
246
  }, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
245
247
  ]));
246
248
  }
247
- }), pt = { class: "space-y-24" }, mt = { class: "grid grid-cols-2 gap-16" }, ft = { class: "fm-typo-en-title-sm-800" }, yt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, gt = /* @__PURE__ */ ee({
249
+ }), mt = { class: "space-y-24" }, ft = { class: "grid grid-cols-2 gap-16" }, yt = { class: "fm-typo-en-title-sm-800" }, gt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, vt = /* @__PURE__ */ ee({
248
250
  __name: "SegmentTypeOption",
249
251
  props: {
250
252
  modelValue: {},
@@ -252,38 +254,38 @@ const Ze = De.extend({
252
254
  },
253
255
  emits: ["update:model-value"],
254
256
  setup(e, { emit: v }) {
255
- const _ = e, b = v, m = [
257
+ const _ = e, F = v, m = [
256
258
  {
257
259
  label: "Dynamic",
258
260
  sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
259
- value: R.enum.DYNAMIC
261
+ value: A.enum.DYNAMIC
260
262
  },
261
263
  {
262
264
  label: "Static",
263
265
  sublabel: "Segment statistics are based on imported data and will not be recalculated.",
264
- value: R.enum.STATIC
266
+ value: A.enum.STATIC
265
267
  }
266
268
  ];
267
269
  function y(f) {
268
- f !== _.modelValue && b("update:model-value", f);
270
+ f !== _.modelValue && F("update:model-value", f);
269
271
  }
270
- return (f, F) => {
271
- const l = w("FmCard"), n = w("FmHelperText");
272
- return p(), k("div", pt, [
273
- s("div", mt, [
274
- (p(), k(O, null, ie(m, (c) => i(l, {
272
+ return (f, w) => {
273
+ const l = b("FmCard"), n = b("FmHelperText");
274
+ return p(), C("div", mt, [
275
+ s("div", ft, [
276
+ (p(), C(O, null, ie(m, (c) => i(l, {
275
277
  variant: "outlined",
276
278
  class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
277
279
  "col-span-2": m.length == 1,
278
280
  "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": f.modelValue === c.value,
279
281
  "hover:bg-fm-color-opacity-sm": f.modelValue !== c.value
280
282
  }]),
281
- onClick: (C) => y(c.value),
283
+ onClick: (k) => y(c.value),
282
284
  key: c.value
283
285
  }, {
284
286
  default: E(() => [
285
- s("div", ft, D(c.label), 1),
286
- s("div", yt, D(c.sublabel), 1)
287
+ s("div", yt, D(c.label), 1),
288
+ s("div", gt, D(c.sublabel), 1)
287
289
  ]),
288
290
  _: 2
289
291
  }, 1032, ["class", "onClick"])), 64))
@@ -297,93 +299,93 @@ const Ze = De.extend({
297
299
  ]);
298
300
  };
299
301
  }
300
- }), vt = { class: "flex items-center gap-x-8" }, _t = /* @__PURE__ */ s("div", null, "Review segment", -1), ht = {
302
+ }), _t = { class: "flex items-center gap-x-8" }, ht = /* @__PURE__ */ s("div", null, "Review segment", -1), St = {
301
303
  key: 0,
302
304
  class: "space-y-16 pr-12"
303
- }, xt = { class: "flex flex-col space-y-16" }, St = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1), wt = {
305
+ }, xt = { class: "flex flex-col space-y-16" }, bt = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1), wt = {
304
306
  key: 0,
305
307
  class: "flex flex-col space-y-16"
306
- }, Ft = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1), bt = {
308
+ }, Ft = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1), kt = {
307
309
  key: 1,
308
310
  class: "flex flex-col space-y-16"
309
311
  }, Ct = {
310
312
  key: 2,
311
313
  class: "flex flex-col space-y-16"
312
- }, kt = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1), Mt = { class: "flex items-center gap-8" }, It = /* @__PURE__ */ ee({
314
+ }, It = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1), Mt = { class: "flex items-center gap-8" }, Tt = /* @__PURE__ */ ee({
313
315
  __name: "SegmentSheet",
314
316
  emits: ["update:model-value"],
315
317
  setup(e, { expose: v, emit: _ }) {
316
- const b = Ve(), m = z(!1), y = z(!1), f = {
318
+ const F = Ve(), m = z(!1), y = z(!1), f = {
317
319
  name: "",
318
320
  isActive: !0,
319
- type: R.enum.DYNAMIC,
321
+ type: A.enum.DYNAMIC,
320
322
  rule: ge.scaffoldGroup(),
321
323
  members: []
322
- }, F = Ze, l = z(f), n = ce(() => {
323
- const u = F.safeParse(l.value);
324
+ }, w = Ke, l = z(f), n = ce(() => {
325
+ const u = w.safeParse(l.value);
324
326
  return u.success ? [] : u.error.errors;
325
327
  });
326
328
  function c(u) {
327
329
  m.value = !0, y.value = !1, u ? l.value = {
328
330
  ...u,
329
331
  isActive: u.isActive !== !1,
330
- type: u.type ?? (u.importFile ? R.enum.STATIC : R.enum.DYNAMIC)
332
+ type: u.type ?? (u.importFile ? A.enum.STATIC : A.enum.DYNAMIC)
331
333
  } : l.value = { ...f };
332
334
  }
333
- function C() {
335
+ function k() {
334
336
  m.value = !1;
335
337
  }
336
338
  async function $() {
337
- F.safeParse(l.value).success && (y.value = !0);
339
+ w.safeParse(l.value).success && (y.value = !0);
338
340
  }
339
341
  function h() {
340
342
  y.value = !1;
341
343
  }
342
- async function x() {
343
- l.value.type === R.enum.STATIC ? (l.value.rule = ge.scaffoldGroup(), l.value.isActive = !0) : l.value.file = void 0, M("update:model-value", l.value);
344
+ async function S() {
345
+ l.value.type === A.enum.STATIC ? (l.value.rule = ge.scaffoldGroup(), l.value.isActive = !0) : l.value.file = void 0, I("update:model-value", l.value);
344
346
  }
345
- async function S(u) {
347
+ async function x(u) {
346
348
  l.value.type = u;
347
349
  }
348
- xe(async () => {
350
+ Se(async () => {
349
351
  });
350
- const M = _;
352
+ const I = _;
351
353
  return v({
352
354
  showSheet: c,
353
- hideSheet: C
355
+ hideSheet: k
354
356
  }), (u, r) => {
355
- const g = w("FmButton"), L = w("FmSwitch"), o = w("FmSideSheet");
357
+ const g = b("FmButton"), U = b("FmSwitch"), o = b("FmSideSheet");
356
358
  return p(), J(o, {
357
359
  modelValue: t(m),
358
- "onUpdate:modelValue": r[8] || (r[8] = (a) => Me(m) ? m.value = a : null),
360
+ "onUpdate:modelValue": r[8] || (r[8] = (a) => Ie(m) ? m.value = a : null),
359
361
  header: "Add segment",
360
362
  "dismiss-away": "",
361
363
  "close-button": !0,
362
364
  "max-width": 1100
363
- }, Ie({
365
+ }, Me({
364
366
  "side-sheet-footer": E(() => [
365
367
  s("div", Mt, [
366
- t(y) || t(l).type === t(R).enum.STATIC ? (p(), k(O, { key: 0 }, [
368
+ t(y) || t(l).type === t(A).enum.STATIC ? (p(), C(O, { key: 0 }, [
367
369
  i(g, {
368
370
  label: "Save Segment",
369
- onClick: x,
370
- loading: t(b).isLoading,
371
- disabled: t(n).length > 0 || t(b).isLoading
371
+ onClick: S,
372
+ loading: t(F).isLoading,
373
+ disabled: t(n).length > 0 || t(F).isLoading
372
374
  }, null, 8, ["loading", "disabled"]),
373
375
  i(g, {
374
376
  label: "Cancel",
375
377
  onClick: r[6] || (r[6] = (a) => h()),
376
378
  variant: "tertiary"
377
379
  })
378
- ], 64)) : (p(), k(O, { key: 1 }, [
380
+ ], 64)) : (p(), C(O, { key: 1 }, [
379
381
  i(g, {
380
382
  label: "Review Segment",
381
- disabled: t(n).length > 0 || t(b).isLoading,
383
+ disabled: t(n).length > 0 || t(F).isLoading,
382
384
  onClick: $
383
385
  }, null, 8, ["disabled"]),
384
386
  i(g, {
385
387
  label: "Cancel",
386
- onClick: r[7] || (r[7] = (a) => C()),
388
+ onClick: r[7] || (r[7] = (a) => k()),
387
389
  variant: "tertiary"
388
390
  })
389
391
  ], 64))
@@ -392,29 +394,29 @@ const Ze = De.extend({
392
394
  default: E(() => {
393
395
  var a;
394
396
  return [
395
- t(y) ? (p(), J(ut, {
397
+ t(y) ? (p(), J(pt, {
396
398
  key: 1,
397
399
  title: t(l).name,
398
400
  segment: t(l)
399
- }, null, 8, ["title", "segment"])) : (p(), k("div", ht, [
400
- i(Le, {
401
+ }, null, 8, ["title", "segment"])) : (p(), C("div", St, [
402
+ i(Ue, {
401
403
  modelValue: t(l).name,
402
404
  "onUpdate:modelValue": r[1] || (r[1] = (d) => t(l).name = d),
403
405
  label: "Segment title",
404
- schema: t(Be).typeAtPath(t(F), "name")
406
+ schema: t(Be).typeAtPath(t(w), "name")
405
407
  }, null, 8, ["modelValue", "schema"]),
406
408
  s("div", xt, [
407
- St,
408
- i(gt, {
409
+ bt,
410
+ i(vt, {
409
411
  "model-value": t(l).type,
410
412
  "onUpdate:modelValue": r[2] || (r[2] = (d) => {
411
- S(d);
413
+ x(d);
412
414
  })
413
415
  }, null, 8, ["model-value"])
414
416
  ]),
415
- t(l).type === t(R).enum.DYNAMIC ? (p(), k("div", wt, [
417
+ t(l).type === t(A).enum.DYNAMIC ? (p(), C("div", wt, [
416
418
  Ft,
417
- i(Ue, {
419
+ i(Le, {
418
420
  "trigger-type": "MEMBERSHIP_JOINED",
419
421
  includeOnly: "user",
420
422
  "model-value": (a = t(l)) == null ? void 0 : a.rule,
@@ -422,17 +424,17 @@ const Ze = De.extend({
422
424
  t(l).rule = d;
423
425
  })
424
426
  }, null, 8, ["model-value"])
425
- ])) : (p(), k("div", bt, [
426
- i(nt, {
427
+ ])) : (p(), C("div", kt, [
428
+ i(st, {
427
429
  importFile: t(l).importFile,
428
430
  "onUpdate:file": r[4] || (r[4] = (d) => {
429
431
  t(l).file = d;
430
432
  })
431
433
  }, null, 8, ["importFile"])
432
434
  ])),
433
- t(l).type === t(R).enum.DYNAMIC ? (p(), k("div", Ct, [
434
- kt,
435
- i(L, {
435
+ t(l).type === t(A).enum.DYNAMIC ? (p(), C("div", Ct, [
436
+ It,
437
+ i(U, {
436
438
  "model-value": t(l).isActive ?? !0,
437
439
  "onUpdate:modelValue": r[5] || (r[5] = (d) => t(l).isActive = d),
438
440
  label: "Active",
@@ -448,13 +450,13 @@ const Ze = De.extend({
448
450
  t(y) ? {
449
451
  name: "side-sheet-header",
450
452
  fn: E(() => [
451
- s("div", vt, [
453
+ s("div", _t, [
452
454
  i(g, {
453
455
  icon: "arrow_back",
454
456
  variant: "tertiary",
455
457
  onClick: r[0] || (r[0] = (a) => y.value = !1)
456
458
  }),
457
- _t
459
+ ht
458
460
  ])
459
461
  ]),
460
462
  key: "0"
@@ -462,57 +464,57 @@ const Ze = De.extend({
462
464
  ]), 1032, ["modelValue"]);
463
465
  };
464
466
  }
465
- }), he = He(), Tt = Ce();
467
+ }), he = He(), Et = ke();
466
468
  function se(e) {
467
469
  const v = G(e);
468
470
  return v.isValid() ? v.format("DD/MM/YYYY") : "";
469
471
  }
470
- const Et = {
472
+ const $t = {
471
473
  mapMemberExportRow: (e) => {
472
- var n, c, C, $, h, x, S, M, u, r, g, L, o, a, d, P, A, B, V, j, q, H, te, I, Q, de, ue, pe;
473
- const v = ce(() => Tt.locations.map((T) => ({
474
+ var n, c, k, $, h, S, x, I, u, r, g, U, o, a, d, P, R, B, V, j, q, H, te, M, Q, de, ue, pe;
475
+ const v = ce(() => Et.locations.map((T) => ({
474
476
  label: T.name,
475
477
  value: T._id
476
478
  }))), _ = (n = Pe.parseOneAddress(
477
479
  e == null ? void 0 : e.email
478
- )) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email, b = (C = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : C.reduce(
479
- (T, U) => {
480
- var Z, K;
481
- const W = (K = (Z = he.sortedTitles) == null ? void 0 : Z.find(
482
- (oe) => oe._id === U.collectible
483
- )) == null ? void 0 : K.name;
484
- return !W || U.balance <= 0 || T.push(W), T;
480
+ )) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email, F = (k = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : k.reduce(
481
+ (T, L) => {
482
+ var K, Z;
483
+ const W = (Z = (K = he.sortedTitles) == null ? void 0 : K.find(
484
+ (oe) => oe._id === L.collectible
485
+ )) == null ? void 0 : Z.name;
486
+ return !W || L.balance <= 0 || T.push(W), T;
485
487
  },
486
488
  []
487
489
  ), m = (he.sortedTitles || []).reduce(
488
- (T, U) => {
489
- var Z, K, oe, me;
490
- const W = (me = (oe = (K = (((Z = e == null ? void 0 : e.collection) == null ? void 0 : Z.TITLE) || []).find(
491
- (ke) => ke.collectible === U._id
492
- )) == null ? void 0 : K.expiryBalance) == null ? void 0 : oe[0]) == null ? void 0 : me.expiredAt;
493
- return T[U.name] = W ? G(W).format("DD/MM/YYYY") : "", T;
490
+ (T, L) => {
491
+ var K, Z, oe, me;
492
+ const W = (me = (oe = (Z = (((K = e == null ? void 0 : e.collection) == null ? void 0 : K.TITLE) || []).find(
493
+ (Ce) => Ce.collectible === L._id
494
+ )) == null ? void 0 : Z.expiryBalance) == null ? void 0 : oe[0]) == null ? void 0 : me.expiredAt;
495
+ return T[L.name] = W ? G(W).format("DD/MM/YYYY") : "", T;
494
496
  },
495
497
  {}
496
- ), y = ((x = (h = ($ = e.collection) == null ? void 0 : $.CREDIT) == null ? void 0 : h.at(0)) == null ? void 0 : x.balance) || 0, f = ((r = (u = (M = (S = e.collection) == null ? void 0 : S.CREDIT) == null ? void 0 : M.at(0)) == null ? void 0 : u.expiryBalance) == null ? void 0 : r.reduce(
497
- (T, U) => T + U.amount,
498
+ ), y = ((S = (h = ($ = e.collection) == null ? void 0 : $.CREDIT) == null ? void 0 : h.at(0)) == null ? void 0 : S.balance) || 0, f = ((r = (u = (I = (x = e.collection) == null ? void 0 : x.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : u.expiryBalance) == null ? void 0 : r.reduce(
499
+ (T, L) => T + L.amount,
498
500
  0
499
- )) || 0, F = Je(y, 2);
501
+ )) || 0, w = Je(y, 2);
500
502
  return {
501
503
  ID: e._id.toString(),
502
504
  Name: ((g = e.name) == null ? void 0 : g.trim()) || "",
503
- Phone: ((L = e == null ? void 0 : e.phoneNumber) == null ? void 0 : L.trim()) || "",
505
+ Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
504
506
  Email: _ || "",
505
507
  Gender: e.gender || "",
506
508
  CardNo: e.cardNo || "",
507
509
  Birthday: e != null && e.birthday ? se(e == null ? void 0 : e.birthday) : "",
508
- Credit: parseFloat((Number(F) - Number(f)).toFixed(2)),
510
+ Credit: parseFloat((Number(w) - Number(f)).toFixed(2)),
509
511
  FreeCredit: Number(f.toFixed(2)),
510
- TotalCredit: Number(F),
512
+ TotalCredit: Number(w),
511
513
  Exp: e != null && e.collection ? ((d = (a = (o = e.collection) == null ? void 0 : o.POINT) == null ? void 0 : a.at(0)) == null ? void 0 : d.balance) ?? 0 : 0,
512
- Point: e != null && e.collection ? ((B = (A = (P = e.collection) == null ? void 0 : P.COIN) == null ? void 0 : A.at(0)) == null ? void 0 : B.balance) ?? 0 : 0,
514
+ Point: e != null && e.collection ? ((B = (R = (P = e.collection) == null ? void 0 : P.COIN) == null ? void 0 : R.at(0)) == null ? void 0 : B.balance) ?? 0 : 0,
513
515
  Level: e != null && e.collection ? ((q = (j = (V = e.collection) == null ? void 0 : V.TIER) == null ? void 0 : j.at(0)) == null ? void 0 : q.balance) ?? 0 : 0,
514
- Tier: e != null && e.collection ? ((I = (te = (H = e.collection) == null ? void 0 : H.TIER) == null ? void 0 : te.at(0)) == null ? void 0 : I.balance) ?? 0 : 0,
515
- Titles: b.join(","),
516
+ Tier: e != null && e.collection ? ((M = (te = (H = e.collection) == null ? void 0 : H.TIER) == null ? void 0 : te.at(0)) == null ? void 0 : M.balance) ?? 0 : 0,
517
+ Titles: F.join(","),
516
518
  ...m,
517
519
  TotalTransaction: e.stats.visitCount,
518
520
  AvgSpent: Qe(Number(e.stats.avgBillSize || 0)).toFormat(
@@ -530,16 +532,16 @@ const Et = {
530
532
  )}`
531
533
  };
532
534
  }
533
- }, $t = { class: "flex items-center" }, At = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Rt = { class: "px-24 flex flex-col gap-y-16" }, Dt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Pt = { class: "fm-typo-en-body-md-600" }, Nt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Bt = /* @__PURE__ */ s("img", {
535
+ }, Rt = { class: "flex items-center" }, At = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Dt = { class: "px-24 flex flex-col gap-y-16" }, Pt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Nt = { class: "fm-typo-en-body-md-600" }, Bt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Vt = /* @__PURE__ */ s("img", {
534
536
  src: Ee,
535
537
  class: "aspect-square w-[150px]"
536
- }, null, -1), Vt = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
538
+ }, null, -1), Yt = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
537
539
  /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
538
540
  /* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Segments allow you to categorize your customers based on various criteria, enabling targeted marketing and personalized experiences. ")
539
- ], -1), _o = /* @__PURE__ */ ee({
541
+ ], -1), ho = /* @__PURE__ */ ee({
540
542
  __name: "Segment",
541
543
  setup(e) {
542
- const { minor: v } = Ae, { t: _ } = Fe(), b = Ce(), { mapMemberExportRow: m } = Et, y = Re(), f = We(), F = z(0), l = [
544
+ const { minor: v } = Re, { t: _ } = we(), F = ke(), { mapMemberExportRow: m } = $t, y = Ae(), f = We(), w = z(0), l = [
543
545
  {
544
546
  header: _("connect.loyalty.segment.table.name"),
545
547
  accessorFn: (o) => o.name
@@ -562,7 +564,7 @@ const Et = {
562
564
  },
563
565
  {
564
566
  header: _("connect.loyalty.segment.table.customer_percentage"),
565
- accessorFn: (o) => ((o.memberCount ?? 0) * 100 / F.value).toFixed(2)
567
+ accessorFn: (o) => ((o.memberCount ?? 0) * 100 / w.value).toFixed(2)
566
568
  },
567
569
  {
568
570
  header: _("connect.loyalty.segment.table.actions"),
@@ -590,7 +592,7 @@ const Et = {
590
592
  X.FmMenuItem,
591
593
  {
592
594
  onClick: async (a) => {
593
- a.stopPropagation(), S(o.row.original);
595
+ a.stopPropagation(), x(o.row.original);
594
596
  }
595
597
  },
596
598
  {
@@ -607,7 +609,7 @@ const Et = {
607
609
  X.FmMenuItem,
608
610
  {
609
611
  onClick: async (a) => {
610
- a.stopPropagation(), x(o.row.original);
612
+ a.stopPropagation(), S(o.row.original);
611
613
  }
612
614
  },
613
615
  {
@@ -626,7 +628,7 @@ const Et = {
626
628
  ]);
627
629
  }
628
630
  }
629
- ], n = z(null), { tableMeta: c, rowData: C, debouncedFetchData: $ } = Se(
631
+ ], n = z(null), { tableMeta: c, rowData: k, debouncedFetchData: $ } = xe(
630
632
  N.readAll
631
633
  );
632
634
  async function h() {
@@ -637,7 +639,7 @@ const Et = {
637
639
  { message: "Refreshing segmentations" }
638
640
  );
639
641
  }
640
- async function x(o) {
642
+ async function S(o) {
641
643
  await $e.remove(`Are you sure you want to remove ${o.name}?`) && await v(
642
644
  async () => {
643
645
  await N.delete(o._id), await $({ pageSize: 10, pageIndex: 0 });
@@ -648,7 +650,7 @@ const Et = {
648
650
  }
649
651
  );
650
652
  }
651
- async function S(o) {
653
+ async function x(o) {
652
654
  const a = {
653
655
  sortBy: "_id",
654
656
  descending: !1,
@@ -660,13 +662,13 @@ const Et = {
660
662
  skip: 0,
661
663
  sortBy: a.sortBy,
662
664
  descending: a.descending
663
- })).meta.totalResources ?? 0, A = a.rowsPerPage;
665
+ })).meta.totalResources ?? 0, R = a.rowsPerPage;
664
666
  await v(
665
667
  async () => {
666
- for (let B = 0; B < P; B += A) {
668
+ for (let B = 0; B < P; B += R) {
667
669
  const V = {
668
670
  ...a,
669
- limit: A,
671
+ limit: R,
670
672
  skip: a.page - 1,
671
673
  sortBy: a.sortBy,
672
674
  descending: a.descending
@@ -680,7 +682,7 @@ const Et = {
680
682
  }
681
683
  a.page++;
682
684
  }
683
- await be(
685
+ await Fe(
684
686
  d.buildExcel(),
685
687
  `[${o.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
686
688
  {
@@ -696,18 +698,18 @@ const Et = {
696
698
  }
697
699
  );
698
700
  }
699
- async function M(o) {
701
+ async function I(o) {
700
702
  await v(
701
703
  async () => {
702
704
  var a;
703
- if (o.type === R.enum.STATIC) {
705
+ if (o.type === A.enum.STATIC) {
704
706
  const d = new FormData();
705
707
  if (d.append("file", o.file), o._id) {
706
- const { members: P, _id: A, file: B, ...V } = o;
708
+ const { members: P, _id: R, file: B, ...V } = o;
707
709
  d.append("segment", JSON.stringify(V)), await N.updateStatic(o._id, d);
708
710
  } else {
709
- const { file: P, ...A } = o;
710
- d.append("segment", JSON.stringify(A)), await N.createStatic(d);
711
+ const { file: P, ...R } = o;
712
+ d.append("segment", JSON.stringify(R)), await N.createStatic(d);
711
713
  }
712
714
  o.file && y.open({
713
715
  type: "info",
@@ -721,8 +723,8 @@ const Et = {
721
723
  }
722
724
  });
723
725
  } else if (o._id) {
724
- const { members: d, _id: P, ...A } = o;
725
- await N.update(o._id, A);
726
+ const { members: d, _id: P, ...R } = o;
727
+ await N.update(o._id, R);
726
728
  } else
727
729
  await N.create(o);
728
730
  await $({ pageSize: 10, pageIndex: 0 }), (a = n.value) == null || a.hideSheet();
@@ -742,7 +744,7 @@ const Et = {
742
744
  value: "queue",
743
745
  isPrimary: !1,
744
746
  prependIcon: "work_history"
745
- }, g = ce(() => b.isPremium ? [
747
+ }, g = ce(() => F.isPremium ? [
746
748
  r,
747
749
  {
748
750
  label: "Refresh segments",
@@ -756,7 +758,7 @@ const Et = {
756
758
  prependIcon: "add"
757
759
  }
758
760
  ] : []);
759
- function L(o) {
761
+ function U(o) {
760
762
  switch (o) {
761
763
  case "add":
762
764
  u();
@@ -780,63 +782,63 @@ const Et = {
780
782
  search: void 0,
781
783
  descending: !1
782
784
  });
783
- F.value = o.totalResources ?? 0, await $({ pageSize: 10, pageIndex: 0 }), await b.readPremium(), await b.readLocations();
785
+ w.value = o.totalResources ?? 0, await $({ pageSize: 10, pageIndex: 0 }), await F.readPremium(), await F.readLocations();
784
786
  }), (o, a) => {
785
- const d = w("FmPill"), P = w("FmPageHead"), A = w("FmIcon"), B = w("FmMenuItem"), V = w("FmMenu"), j = w("FmListItem"), q = w("FmList"), H = w("FmButton"), te = w("FmCard");
786
- return p(), k(O, null, [
787
+ const d = b("FmPill"), P = b("FmPageHead"), R = b("FmIcon"), B = b("FmMenuItem"), V = b("FmMenu"), j = b("FmListItem"), q = b("FmList"), H = b("FmButton"), te = b("FmCard");
788
+ return p(), C(O, null, [
787
789
  i(P, {
788
790
  title: "Segments",
789
791
  actions: t(g),
790
- "onClick:action": a[0] || (a[0] = (I) => L(I))
792
+ "onClick:action": a[0] || (a[0] = (M) => U(M))
791
793
  }, {
792
794
  title: E(() => [
793
- s("div", $t, [
795
+ s("div", Rt, [
794
796
  s("span", At, D(t(_)("connect.loyalty.segment.title")), 1),
795
797
  i(d, { variant: "premium" })
796
798
  ])
797
799
  ]),
798
800
  _: 1
799
801
  }, 8, ["actions"]),
800
- s("div", Rt, [
801
- t(C).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), k(O, { key: 0 }, [
802
- i(we, {
802
+ s("div", Dt, [
803
+ t(k).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), C(O, { key: 0 }, [
804
+ i(be, {
803
805
  loading: t(c).isLoading,
804
- "row-data": t(C),
806
+ "row-data": t(k),
805
807
  "row-count": t(c).totalRows,
806
808
  "column-defs": l,
807
809
  "shrink-at": !1,
808
810
  "page-count": t(c).pageCount,
809
811
  "page-index": t(c).pageIndex,
810
812
  "page-size": t(c).pageSize,
811
- onRowClick: a[1] || (a[1] = (I) => {
812
- u(I.original);
813
+ onRowClick: a[1] || (a[1] = (M) => {
814
+ u(M.original);
813
815
  }),
814
816
  onPageChange: t($)
815
817
  }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
816
818
  i(q, { class: "w-full hidden xs:block" }, {
817
819
  default: E(() => [
818
- (p(!0), k(O, null, ie(t(C), (I) => (p(), J(j, {
819
- key: I._id.toString(),
820
+ (p(!0), C(O, null, ie(t(k), (M) => (p(), J(j, {
821
+ key: M._id.toString(),
820
822
  tag: "label",
821
- onClick: (Q) => u(I)
823
+ onClick: (Q) => u(M)
822
824
  }, {
823
825
  default: E(() => [
824
826
  s("div", null, [
825
- s("div", Dt, D((I.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
826
- s("div", Pt, D(I.name), 1),
827
- s("div", Nt, D(((I.memberCount ?? 0) * 100 / t(F)).toFixed(2)) + "% of customers ", 1)
827
+ s("div", Pt, D((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
828
+ s("div", Nt, D(M.name), 1),
829
+ s("div", Bt, D(((M.memberCount ?? 0) * 100 / t(w)).toFixed(2)) + "% of customers ", 1)
828
830
  ])
829
831
  ]),
830
832
  append: E(() => [
831
833
  i(V, { "stop-click-propagation": !0 }, {
832
834
  "menu-button": E(() => [
833
- i(A, { name: "more_vert" })
835
+ i(R, { name: "more_vert" })
834
836
  ]),
835
837
  default: E(() => [
836
838
  i(B, {
837
839
  class: "text-fm-color-typo-error fm-typo-en-body-md-400",
838
840
  label: "Remove",
839
- "onUpdate:modelValue": (Q) => Q && x(I)
841
+ "onUpdate:modelValue": (Q) => Q && S(M)
840
842
  }, null, 8, ["onUpdate:modelValue"])
841
843
  ]),
842
844
  _: 2
@@ -853,22 +855,22 @@ const Et = {
853
855
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
854
856
  }, {
855
857
  default: E(() => [
856
- Bt,
857
858
  Vt,
859
+ Yt,
858
860
  i(H, {
859
861
  variant: "primary",
860
862
  label: "Create segment",
861
- disabled: !t(b).isPremium,
863
+ disabled: !t(F).isPremium,
862
864
  icon: "add",
863
- onClick: a[2] || (a[2] = (I) => u())
865
+ onClick: a[2] || (a[2] = (M) => u())
864
866
  }, null, 8, ["disabled"])
865
867
  ]),
866
868
  _: 1
867
869
  })),
868
- i(It, {
870
+ i(Tt, {
869
871
  ref_key: "sheetRef",
870
872
  ref: n,
871
- "onUpdate:modelValue": M
873
+ "onUpdate:modelValue": I
872
874
  }, null, 512)
873
875
  ])
874
876
  ], 64);
@@ -876,5 +878,5 @@ const Et = {
876
878
  }
877
879
  });
878
880
  export {
879
- _o as default
881
+ ho as default
880
882
  };