@feedmepos/mf-connect 0.1.46-prod → 0.1.47-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 (89) hide show
  1. package/dist/{Analytic--PTYdTCz.js → Analytic-AnuRQDA4.js} +11 -11
  2. package/dist/{App-CCFCux3P.js → App-DP_jCyej.js} +6 -6
  3. package/dist/{Bin-D3mLTCYx.js → Bin-tL4lF6PB.js} +8 -8
  4. package/dist/{Broadcast-17Aiufxx.js → Broadcast-T2a5tN8R.js} +9 -9
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CMVquBaq.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BgPJCH02.js} +6 -6
  6. package/dist/{Card-Bx26e5ll.js → Card-Bi-ODgCc.js} +16 -16
  7. package/dist/{Collections-B_lm_p0s.js → Collections-JHWotZ1I.js} +7 -7
  8. package/dist/{Credit-Bfdh01Hf.js → Credit-DQQCXqS0.js} +9 -9
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DWNvRorl.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-hxuYl-OQ.js} +29 -29
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CkYlghNU.js → EffectSheet.vue_vue_type_style_index_0_lang-ECkaQxuI.js} +6 -6
  11. package/dist/{Experience-DScp4H4M.js → Experience-DzTV21vX.js} +9 -9
  12. package/dist/{Game-Cn2BXwaA.js → Game-DUCx2Dl9.js} +10 -10
  13. package/dist/{Index-BATr5dcp.js → Index-zynxjOOr.js} +10 -10
  14. package/dist/{Marketing-B6lhSaKk.js → Marketing-BBHDVRkR.js} +6 -6
  15. package/dist/{Member-Cr_Ehw_n.js → Member-B09bj6C3.js} +10 -10
  16. package/dist/{MemberList-B5ogB2E6.js → MemberList-DLSLGQ02.js} +25 -25
  17. package/dist/{MemberTransactions-YlC-iE41.js → MemberTransactions-DERMSs7o.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-nTBRadZx.js → MessageInput.vue_vue_type_script_setup_true_lang-CAADF6vv.js} +8 -8
  19. package/dist/{Mission-Bddme86f.js → Mission-DAv0e_ZH.js} +10 -10
  20. package/dist/{Overview-BGOM1IKg.js → Overview-D0rBTEtP.js} +18 -18
  21. package/dist/{Point-vcnTW6lY.js → Point-BeBYi1BT.js} +9 -9
  22. package/dist/{Promotion-DuCvytdc.js → Promotion-BSPU5hP9.js} +10 -10
  23. package/dist/{Queue-Cuw7WTP_.js → Queue-C5IFJ3iE.js} +10 -10
  24. package/dist/{Record-Dc6BPAGi.js → Record-CoFSrv7j.js} +8 -8
  25. package/dist/{Reward-8MFxn8we.js → Reward-COIOBOl-.js} +15 -15
  26. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-8k-usg9S.js → RewardGroup.vue_vue_type_script_setup_true_lang-B9Tl7hqv.js} +11 -11
  27. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DRCwMmo5.js → RuleGroup.vue_vue_type_script_setup_true_lang-BzsYC3k2.js} +591 -580
  28. package/dist/{Segment-BJm5XtlX.js → Segment-DF5SrucQ.js} +227 -227
  29. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-B2LYvXlN.js → SelectItems.vue_vue_type_script_setup_true_lang-BSSfQu3F.js} +2 -2
  30. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CaFLnq7P.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DoL_gTKy.js} +11 -11
  31. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DLAqn-0P.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cijyol1Q.js} +3 -3
  32. package/dist/{Setting-CUyfrLYA.js → Setting-Dt0sG_hk.js} +11 -11
  33. package/dist/{Store-DdBnVwnq.js → Store-E2_0EIy8.js} +19 -19
  34. package/dist/{StoreRewards-B_yzVh4Z.js → StoreRewards-DuSsWnTE.js} +13 -13
  35. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BPPoaGqc.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DuatzcJ8.js} +19 -19
  36. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D0ae_2E5.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-D_r8I0h7.js} +1 -1
  37. package/dist/{Tier-BpQ8DXK4.js → Tier-CEEHsXkC.js} +20 -20
  38. package/dist/{Title-D6jghz1v.js → Title-BMAWlGeW.js} +19 -19
  39. package/dist/{Transaction-BQWs-6G7.js → Transaction-CLsceq-O.js} +2 -2
  40. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C2dJuE64.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CFLekn9O.js} +6 -6
  41. package/dist/{Voucher-DnL_66X2.js → Voucher-Cd293WYY.js} +13 -13
  42. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-naUCARDO.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Qc5cCqh5.js} +10 -10
  43. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-yj2c4i_u.js → ZodTextField.vue_vue_type_script_setup_true_lang-B8HHh8HU.js} +1 -1
  44. package/dist/{app-Cemiie6P.js → app-aVXsWATU.js} +30 -30
  45. package/dist/{app-Cwax62X-.js → app-jRT7vsk_.js} +1 -1
  46. package/dist/app.js +1 -1
  47. package/dist/{business-BTJVFnrW.js → business-DVlHPzaL.js} +1 -1
  48. package/dist/{campaign-C34w0eci.js → campaign-D9KeUWA7.js} +2 -2
  49. package/dist/{campaign-XX6bwpYj.js → campaign-l-u9A514.js} +9 -9
  50. package/dist/{campaign.enum-CTMwHgAV.js → campaign.enum-Cud82tES.js} +1 -1
  51. package/dist/{campaign.fn-nJl0vZum.js → campaign.fn-C-UojhHv.js} +140 -140
  52. package/dist/{collectible.enum-DpJV0kLI.js → collectible.enum-PrlUDScv.js} +1 -1
  53. package/dist/{collection.fn-D5beOWlp.js → collection.fn-yR-xnV4g.js} +2 -2
  54. package/dist/{dto-CCxjvwZe.js → dto-Cua1OHMY.js} +4 -4
  55. package/dist/{effect-B9ryfTOn.js → effect-B5-eXNEr.js} +1 -1
  56. package/dist/{email-addresses-Bn80jSud.js → email-addresses-BeYh5fr5.js} +1 -1
  57. package/dist/{export-CLB408ho.js → export-BUF4_DUz.js} +3 -3
  58. package/dist/{helper-DgoAVTVe.js → helper-CGwOThAl.js} +1 -1
  59. package/dist/{index-DsgbkezN.js → index-1BGPM6Uy.js} +1 -1
  60. package/dist/{index-JY8MjiBK.js → index-BLdVWQId.js} +3 -3
  61. package/dist/{index-Djq2lySj.js → index-BmL_b0IR.js} +1 -1
  62. package/dist/{index-FMcRNPk_.js → index-C-d_4n-1.js} +1 -1
  63. package/dist/{index-eiHOH5QM.js → index-CB8iWT_p.js} +1 -1
  64. package/dist/{index-D90Ba87K.js → index-Cl2iYM2F.js} +1 -1
  65. package/dist/{index-DCrV9spQ.js → index-Cx8-ipee.js} +6 -6
  66. package/dist/{index-B2BKFdEy.js → index-D5KIp8ZB.js} +1023 -1023
  67. package/dist/{index-t_4aIo1w.js → index-DNTd-FNx.js} +2 -2
  68. package/dist/{index-KYo_FgI8.js → index-DlFVLRKG.js} +3 -3
  69. package/dist/{index-B9wdSOIQ.js → index-aMDi62-C.js} +1 -1
  70. package/dist/{index-bkL81TwC.js → index-hX2mE0gQ.js} +1 -1
  71. package/dist/{index-Blmkh0Ui.js → index-knuJv0ti.js} +4 -4
  72. package/dist/{index-DUtQaOO2.js → index-ng2IXlL1.js} +1 -1
  73. package/dist/{index.esm2017-toVKAoKi.js → index.esm2017-D8stWFci.js} +1 -1
  74. package/dist/{loading-vrEcUlJa.js → loading-c4b7n9Xp.js} +1 -1
  75. package/dist/{membership-ChiyKtoA.js → membership-oBIs4sbL.js} +3 -3
  76. package/dist/{money-tOAuywfS.js → money-AP24H0gk.js} +1 -1
  77. package/dist/{number-DiXSJR50.js → number-CwsAYC_2.js} +1 -1
  78. package/dist/{objectid-C856JGM4.js → objectid-CVDLTdni.js} +5 -5
  79. package/dist/{plugins-p8ID0wqZ.js → plugins-Dn7JDHi7.js} +2 -2
  80. package/dist/{reward-Bo4HsVNH.js → reward-4wdoZeXw.js} +1 -1
  81. package/dist/{rule-LDThYbT7.js → rule-_OJza6tn.js} +3 -3
  82. package/dist/rule-builder-DmlhHAED.js +93 -0
  83. package/dist/{template-C6cnCLah.js → template-BSQLFHf4.js} +4 -4
  84. package/dist/{trigger-ZyJEZVxL.js → trigger-DC9tDnI2.js} +4 -4
  85. package/dist/{user-WDNaXiRu.js → user-CCVOptFD.js} +1 -1
  86. package/dist/{vue-i18n-BWI3POch.js → vue-i18n--_Wu1nMj.js} +201 -201
  87. package/dist/{xlsx-JDV04zZH.js → xlsx-BVMaOi8M.js} +1 -1
  88. package/package.json +1 -1
  89. package/dist/rule-builder-7iBcFApT.js +0 -89
@@ -1,42 +1,42 @@
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";
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 l, 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-p8ID0wqZ.js";
4
- import { u as Re } from "./loading-vrEcUlJa.js";
5
- import { FmButtonVariant as ae, useSnackbar as Ae, components as X } from "@feedmepos/ui-library";
3
+ import { n as $e, p as Ae } from "./plugins-Dn7JDHi7.js";
4
+ import { u as Re } from "./loading-c4b7n9Xp.js";
5
+ import { FmButtonVariant as ae, useSnackbar as De, components as X } from "@feedmepos/ui-library";
6
6
  import { u as xe, _ as be } from "./usePagination-JoYaROkV.js";
7
- import { u as we } from "./vue-i18n-BWI3POch.js";
8
- import { i as De, j as A, c as fe } from "./index-Blmkh0Ui.js";
9
- import "./index-t_4aIo1w.js";
10
- import "./index-DCrV9spQ.js";
11
- import "./index-DUtQaOO2.js";
12
- import "./index-KYo_FgI8.js";
13
- import { u as ne, w as Fe } from "./xlsx-JDV04zZH.js";
14
- import { e as Pe, M as Ne } from "./email-addresses-Bn80jSud.js";
15
- import { Z as Be } from "./zod-Bg2FbC-D.js";
16
- import { u as Ve } from "./app-wDQR6dpb.js";
17
- import { F as ye, z as Ye } from "./index-B2BKFdEy.js";
18
- import { R as ge } from "./rule-builder-7iBcFApT.js";
19
- import { _ as Ue } from "./ZodTextField.vue_vue_type_script_setup_true_lang-yj2c4i_u.js";
20
- import { _ as Le } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DRCwMmo5.js";
21
- import { u as ze, v as Oe, w as je } from "./index.esm2017-toVKAoKi.js";
22
- import { F as qe } from "./FileSaver.min-NlMItPOc.js";
7
+ import { u as we } from "./vue-i18n--_Wu1nMj.js";
8
+ import { i as Pe, j as R, c as fe } from "./index-knuJv0ti.js";
9
+ import "./index-DNTd-FNx.js";
10
+ import "./index-Cx8-ipee.js";
11
+ import "./index-ng2IXlL1.js";
12
+ import "./index-DlFVLRKG.js";
13
+ import { u as ne, w as Fe } from "./xlsx-BVMaOi8M.js";
14
+ import { e as Ne, M as Be } from "./email-addresses-BeYh5fr5.js";
15
+ import { Z as Ve } from "./zod-Bg2FbC-D.js";
16
+ import { u as Ye } from "./app-wDQR6dpb.js";
17
+ import { F as ye, z as Ue } from "./index-D5KIp8ZB.js";
18
+ import { R as ge } from "./rule-builder-DmlhHAED.js";
19
+ import { _ as Le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-B8HHh8HU.js";
20
+ import { _ as ze } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BzsYC3k2.js";
21
+ import { u as Oe, v as je, w as qe } from "./index.esm2017-D8stWFci.js";
22
+ import { F as He } 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-ChiyKtoA.js";
25
- import { o as Ge } from "./objectId-dwaoBfJX.js";
26
- import { u as ke } from "./business-BTJVFnrW.js";
27
- import { f as Je } from "./number-DiXSJR50.js";
28
- import { t as Qe } from "./money-tOAuywfS.js";
29
- import "./index-D90Ba87K.js";
30
- import { useRouter as We } from "vue-router";
31
- import { m as ve } from "./index-FMcRNPk_.js";
32
- import { R as _e } from "./app-Cemiie6P.js";
33
- const Ke = De.extend({
24
+ import { s as N, u as Ge } from "./membership-oBIs4sbL.js";
25
+ import { o as Je } from "./objectId-dwaoBfJX.js";
26
+ import { u as ke } from "./business-DVlHPzaL.js";
27
+ import { f as Qe } from "./number-CwsAYC_2.js";
28
+ import { t as We } from "./money-AP24H0gk.js";
29
+ import "./index-Cl2iYM2F.js";
30
+ import { useRouter as Ke } from "vue-router";
31
+ import { m as _e } from "./index-C-d_4n-1.js";
32
+ import { R as ve } from "./app-aVXsWATU.js";
33
+ const Ze = Pe.extend({
34
34
  _id: ye.optional(),
35
35
  business: ye.optional(),
36
- file: Ye.any().nullish()
36
+ file: Ue.any().nullish()
37
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
+ var Xe = { 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 et = { class: "flex flex-col space-y-16" }, tt = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Upload File", -1), ot = {
40
40
  key: 0,
41
41
  class: /* @__PURE__ */ re([
42
42
  "p-16 pl-24 space-x-8",
@@ -44,21 +44,21 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
44
44
  "flex items-center",
45
45
  "justify-between"
46
46
  ])
47
- }, ot = { class: "flex justify-end" }, at = {
47
+ }, at = { class: "flex justify-end" }, nt = {
48
48
  key: 1,
49
49
  class: /* @__PURE__ */ re([
50
50
  "flex items-center",
51
51
  "border border-fm-color-neutral-gray-300",
52
52
  "p-16 space-x-16 rounded-md"
53
53
  ])
54
- }, nt = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, st = /* @__PURE__ */ ee({
54
+ }, st = { class: "fm-typo-en-body-lg-400 flex-1 truncate" }, lt = /* @__PURE__ */ ee({
55
55
  __name: "ImportSegment",
56
56
  props: {
57
57
  importFile: {}
58
58
  },
59
59
  emits: ["update:file"],
60
- setup(e, { emit: v }) {
61
- const _ = e, F = v, { t: m } = we(), y = z(null), f = z(null), w = ["Id"], l = [
60
+ setup(e, { emit: _ }) {
61
+ const v = e, k = _, { t: m } = we(), y = z(null), f = z(null), w = ["Id"], s = [
62
62
  {
63
63
  label: "CSV",
64
64
  icon: "csv",
@@ -71,12 +71,12 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
71
71
  }
72
72
  ];
73
73
  async function n() {
74
- if (_.importFile)
74
+ if (v.importFile)
75
75
  try {
76
- const h = ze(void 0, Ze.importFilesBucketUrl), S = Oe(h, _.importFile), x = await je(S);
76
+ const h = Oe(void 0, Xe.importFilesBucketUrl), S = je(h, v.importFile), x = await qe(S);
77
77
  window.open(x, "_blank");
78
78
  } catch (h) {
79
- console.log(h);
79
+ console.log(h), $e.error("Failed to download uploaded file");
80
80
  }
81
81
  }
82
82
  async function c(h) {
@@ -85,7 +85,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
85
85
  const S = new Blob([w.join(",")], {
86
86
  type: "text/csv;charset=utf-8;"
87
87
  });
88
- qe.saveAs(S, "ImportSegmentTemplate.csv");
88
+ He.saveAs(S, "ImportSegmentTemplate.csv");
89
89
  break;
90
90
  case "xlsx":
91
91
  const x = ne.aoa_to_sheet([w]), I = ne.book_new();
@@ -93,19 +93,19 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
93
93
  break;
94
94
  }
95
95
  }
96
- function k(h) {
97
- y.value = h, F("update:file", y.value);
96
+ function F(h) {
97
+ y.value = h, k("update:file", y.value);
98
98
  }
99
99
  function $(h) {
100
100
  var x, I;
101
101
  const S = ((I = (x = h.target) == null ? void 0 : x.files) == null ? void 0 : I[0]) ?? null;
102
- k(S);
102
+ F(S);
103
103
  }
104
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, [
105
+ const x = b("FmButton"), I = b("FmMenuItem"), d = b("FmMenu"), r = b("FmDropField");
106
+ return p(), C("div", et, [
107
+ tt,
108
+ h.importFile ? (p(), C("div", ot, [
109
109
  i(x, {
110
110
  label: t(m)("View uploaded file"),
111
111
  variant: t(ae).Plain,
@@ -113,9 +113,9 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
113
113
  onClick: n
114
114
  }, null, 8, ["label", "variant"])
115
115
  ])) : le("", !0),
116
- s("div", null, [
117
- s("div", ot, [
118
- i(u, { class: "" }, {
116
+ l("div", null, [
117
+ l("div", at, [
118
+ i(d, { class: "" }, {
119
119
  "menu-button": E(() => [
120
120
  i(x, {
121
121
  variant: "tertiary",
@@ -124,7 +124,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
124
124
  })
125
125
  ]),
126
126
  default: E(() => [
127
- (p(), C(O, null, ie(l, (g) => i(I, {
127
+ (p(), C(O, null, ie(s, (g) => i(I, {
128
128
  key: g.value,
129
129
  icon: g.icon,
130
130
  label: g.label,
@@ -135,13 +135,13 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
135
135
  _: 1
136
136
  })
137
137
  ]),
138
- y.value ? (p(), C("div", at, [
138
+ y.value ? (p(), C("div", nt, [
139
139
  i(x, {
140
140
  variant: t(ae).Tertiary,
141
141
  "prepend-icon": "attach_file"
142
142
  }, null, 8, ["variant"]),
143
- s("p", nt, D(y.value.name), 1),
144
- s("label", {
143
+ l("p", st, D(y.value.name), 1),
144
+ l("label", {
145
145
  ref_key: "fileLabelRef",
146
146
  ref: f,
147
147
  htmlFor: "file"
@@ -154,7 +154,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
154
154
  return (g = f.value) == null ? void 0 : g.click();
155
155
  })
156
156
  }, null, 8, ["variant", "label"]),
157
- s("input", {
157
+ l("input", {
158
158
  id: "file",
159
159
  accept: ".csv",
160
160
  class: "hidden",
@@ -165,7 +165,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
165
165
  ], 512)
166
166
  ])) : (p(), J(r, {
167
167
  key: 0,
168
- onFileUpload: S[0] || (S[0] = (g) => k(g)),
168
+ onFileUpload: S[0] || (S[0] = (g) => F(g)),
169
169
  accept: ".csv, .xlsx",
170
170
  "max-file-size": 2e7
171
171
  }))
@@ -173,14 +173,14 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
173
173
  ]);
174
174
  };
175
175
  }
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({
176
+ }), it = { class: "space-y-16 pr-12" }, rt = { class: "fm-typo-en-title-md-800" }, ct = { class: "flex space-x-8" }, dt = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, ut = { class: "text-fm-color-typo-secondary" }, pt = /* @__PURE__ */ l("div", null, "contacts in your segment", -1), mt = /* @__PURE__ */ ee({
177
177
  __name: "ReviewSegment",
178
178
  props: {
179
179
  title: {},
180
180
  segment: {}
181
181
  },
182
182
  setup(e) {
183
- const v = e, _ = [
183
+ const _ = e, v = [
184
184
  {
185
185
  header: "Name",
186
186
  accessorFn: (n) => n.name
@@ -191,7 +191,7 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
191
191
  },
192
192
  {
193
193
  header: "Customer Since",
194
- accessorFn: (n) => G(Ge(n._id.toString())).format("DD MMM YYYY")
194
+ accessorFn: (n) => G(Je(n._id.toString())).format("DD MMM YYYY")
195
195
  },
196
196
  {
197
197
  header: "Phone",
@@ -206,9 +206,9 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
206
206
  accessorFn: (n) => G(n.stats.lastVisit).format("DD MMM YYYY")
207
207
  }
208
208
  ];
209
- async function F(n) {
210
- return v.segment._id ? (console.log(n), await N.paginateSegmentUsers(
211
- v.segment._id,
209
+ async function k(n) {
210
+ return _.segment._id ? (console.log(n), await N.paginateSegmentUsers(
211
+ _.segment._id,
212
212
  n
213
213
  )) : {
214
214
  resources: [],
@@ -221,71 +221,71 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
221
221
  }
222
222
  };
223
223
  }
224
- const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: w, onSearch: l } = xe(F);
224
+ const { tableMeta: m, rowData: y, onSort: f, debouncedFetchData: w, onSearch: s } = xe(k);
225
225
  return Se(async () => {
226
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,
233
- s("div", null, "as of " + D(t(G)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
227
+ }), (n, c) => (p(), C("div", it, [
228
+ l("div", rt, D(_.title), 1),
229
+ l("div", ct, [
230
+ l("div", dt, D(n.segment.members.length), 1),
231
+ l("div", ut, [
232
+ pt,
233
+ l("div", null, "as of " + D(t(G)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
234
234
  ])
235
235
  ]),
236
236
  i(be, {
237
237
  loading: t(m).isLoading,
238
238
  "row-data": t(y),
239
239
  "row-count": t(m).totalRows,
240
- "column-defs": _,
240
+ "column-defs": v,
241
241
  "page-size": t(m).pageSize,
242
242
  "page-count": t(m).pageCount,
243
243
  "page-index": t(m).pageIndex,
244
244
  onSortChange: t(f),
245
- onPageChange: c[0] || (c[0] = (k) => t(w)({ pageSize: k.pageSize, pageIndex: k.pageIndex }))
245
+ onPageChange: c[0] || (c[0] = (F) => t(w)({ pageSize: F.pageSize, pageIndex: F.pageIndex }))
246
246
  }, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"])
247
247
  ]));
248
248
  }
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({
249
+ }), ft = { class: "space-y-24" }, yt = { class: "grid grid-cols-2 gap-16" }, gt = { class: "fm-typo-en-title-sm-800" }, _t = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, vt = /* @__PURE__ */ ee({
250
250
  __name: "SegmentTypeOption",
251
251
  props: {
252
252
  modelValue: {},
253
253
  errorText: {}
254
254
  },
255
255
  emits: ["update:model-value"],
256
- setup(e, { emit: v }) {
257
- const _ = e, F = v, m = [
256
+ setup(e, { emit: _ }) {
257
+ const v = e, k = _, m = [
258
258
  {
259
259
  label: "Dynamic",
260
260
  sublabel: "Segment statistics are based on rules configured and will be recalculated automatically when rule changes.",
261
- value: A.enum.DYNAMIC
261
+ value: R.enum.DYNAMIC
262
262
  },
263
263
  {
264
264
  label: "Static",
265
265
  sublabel: "Segment statistics are based on imported data and will not be recalculated.",
266
- value: A.enum.STATIC
266
+ value: R.enum.STATIC
267
267
  }
268
268
  ];
269
269
  function y(f) {
270
- f !== _.modelValue && F("update:model-value", f);
270
+ f !== v.modelValue && k("update:model-value", f);
271
271
  }
272
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, {
273
+ const s = b("FmCard"), n = b("FmHelperText");
274
+ return p(), C("div", ft, [
275
+ l("div", yt, [
276
+ (p(), C(O, null, ie(m, (c) => i(s, {
277
277
  variant: "outlined",
278
278
  class: re(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
279
279
  "col-span-2": m.length == 1,
280
280
  "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": f.modelValue === c.value,
281
281
  "hover:bg-fm-color-opacity-sm": f.modelValue !== c.value
282
282
  }]),
283
- onClick: (k) => y(c.value),
283
+ onClick: (F) => y(c.value),
284
284
  key: c.value
285
285
  }, {
286
286
  default: E(() => [
287
- s("div", yt, D(c.label), 1),
288
- s("div", gt, D(c.sublabel), 1)
287
+ l("div", gt, D(c.label), 1),
288
+ l("div", _t, D(c.sublabel), 1)
289
289
  ]),
290
290
  _: 2
291
291
  }, 1032, ["class", "onClick"])), 64))
@@ -299,61 +299,61 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
299
299
  ]);
300
300
  };
301
301
  }
302
- }), _t = { class: "flex items-center gap-x-8" }, ht = /* @__PURE__ */ s("div", null, "Review segment", -1), St = {
302
+ }), ht = { class: "flex items-center gap-x-8" }, St = /* @__PURE__ */ l("div", null, "Review segment", -1), xt = {
303
303
  key: 0,
304
304
  class: "space-y-16 pr-12"
305
- }, xt = { class: "flex flex-col space-y-16" }, bt = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1), wt = {
305
+ }, bt = { class: "flex flex-col space-y-16" }, wt = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Type", -1), Ft = {
306
306
  key: 0,
307
307
  class: "flex flex-col space-y-16"
308
- }, Ft = /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1), kt = {
308
+ }, kt = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1), Ct = {
309
309
  key: 1,
310
310
  class: "flex flex-col space-y-16"
311
- }, Ct = {
311
+ }, It = {
312
312
  key: 2,
313
313
  class: "flex flex-col space-y-16"
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({
314
+ }, Mt = /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Segment Status", -1), Tt = { class: "flex items-center gap-8" }, Et = /* @__PURE__ */ ee({
315
315
  __name: "SegmentSheet",
316
316
  emits: ["update:model-value"],
317
- setup(e, { expose: v, emit: _ }) {
318
- const F = Ve(), m = z(!1), y = z(!1), f = {
317
+ setup(e, { expose: _, emit: v }) {
318
+ const k = Ye(), m = z(!1), y = z(!1), f = {
319
319
  name: "",
320
320
  isActive: !0,
321
- type: A.enum.DYNAMIC,
321
+ type: R.enum.DYNAMIC,
322
322
  rule: ge.scaffoldGroup(),
323
323
  members: []
324
- }, w = Ke, l = z(f), n = ce(() => {
325
- const u = w.safeParse(l.value);
326
- return u.success ? [] : u.error.errors;
324
+ }, w = Ze, s = z(f), n = ce(() => {
325
+ const d = w.safeParse(s.value);
326
+ return d.success ? [] : d.error.errors;
327
327
  });
328
- function c(u) {
329
- m.value = !0, y.value = !1, u ? l.value = {
330
- ...u,
331
- isActive: u.isActive !== !1,
332
- type: u.type ?? (u.importFile ? A.enum.STATIC : A.enum.DYNAMIC)
333
- } : l.value = { ...f };
328
+ function c(d) {
329
+ m.value = !0, y.value = !1, d ? s.value = {
330
+ ...d,
331
+ isActive: d.isActive !== !1,
332
+ type: d.type ?? (d.importFile ? R.enum.STATIC : R.enum.DYNAMIC)
333
+ } : s.value = { ...f };
334
334
  }
335
- function k() {
335
+ function F() {
336
336
  m.value = !1;
337
337
  }
338
338
  async function $() {
339
- w.safeParse(l.value).success && (y.value = !0);
339
+ w.safeParse(s.value).success && (y.value = !0);
340
340
  }
341
- function h() {
342
- y.value = !1;
341
+ function h(d) {
342
+ d === R.enum.STATIC ? F() : y.value = !1;
343
343
  }
344
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);
345
+ s.value.type === R.enum.STATIC ? (s.value.rule = ge.scaffoldGroup(), s.value.isActive = !0) : s.value.file = void 0, I("update:model-value", s.value);
346
346
  }
347
- async function x(u) {
348
- l.value.type = u;
347
+ async function x(d) {
348
+ s.value.type = d;
349
349
  }
350
350
  Se(async () => {
351
351
  });
352
- const I = _;
353
- return v({
352
+ const I = v;
353
+ return _({
354
354
  showSheet: c,
355
- hideSheet: k
356
- }), (u, r) => {
355
+ hideSheet: F
356
+ }), (d, r) => {
357
357
  const g = b("FmButton"), U = b("FmSwitch"), o = b("FmSideSheet");
358
358
  return p(), J(o, {
359
359
  modelValue: t(m),
@@ -364,28 +364,28 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
364
364
  "max-width": 1100
365
365
  }, Me({
366
366
  "side-sheet-footer": E(() => [
367
- s("div", Mt, [
368
- t(y) || t(l).type === t(A).enum.STATIC ? (p(), C(O, { key: 0 }, [
367
+ l("div", Tt, [
368
+ t(y) || t(s).type === t(R).enum.STATIC ? (p(), C(O, { key: 0 }, [
369
369
  i(g, {
370
370
  label: "Save Segment",
371
371
  onClick: S,
372
- loading: t(F).isLoading,
373
- disabled: t(n).length > 0 || t(F).isLoading
372
+ loading: t(k).isLoading,
373
+ disabled: t(n).length > 0 || t(k).isLoading
374
374
  }, null, 8, ["loading", "disabled"]),
375
375
  i(g, {
376
376
  label: "Cancel",
377
- onClick: r[6] || (r[6] = (a) => h()),
377
+ onClick: r[6] || (r[6] = (a) => h(t(s).type)),
378
378
  variant: "tertiary"
379
379
  })
380
380
  ], 64)) : (p(), C(O, { key: 1 }, [
381
381
  i(g, {
382
382
  label: "Review Segment",
383
- disabled: t(n).length > 0 || t(F).isLoading,
383
+ disabled: t(n).length > 0 || t(k).isLoading,
384
384
  onClick: $
385
385
  }, null, 8, ["disabled"]),
386
386
  i(g, {
387
387
  label: "Cancel",
388
- onClick: r[7] || (r[7] = (a) => k()),
388
+ onClick: r[7] || (r[7] = (a) => F()),
389
389
  variant: "tertiary"
390
390
  })
391
391
  ], 64))
@@ -394,49 +394,49 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
394
394
  default: E(() => {
395
395
  var a;
396
396
  return [
397
- t(y) ? (p(), J(pt, {
397
+ t(y) ? (p(), J(mt, {
398
398
  key: 1,
399
- title: t(l).name,
400
- segment: t(l)
401
- }, null, 8, ["title", "segment"])) : (p(), C("div", St, [
402
- i(Ue, {
403
- modelValue: t(l).name,
404
- "onUpdate:modelValue": r[1] || (r[1] = (d) => t(l).name = d),
399
+ title: t(s).name,
400
+ segment: t(s)
401
+ }, null, 8, ["title", "segment"])) : (p(), C("div", xt, [
402
+ i(Le, {
403
+ modelValue: t(s).name,
404
+ "onUpdate:modelValue": r[1] || (r[1] = (u) => t(s).name = u),
405
405
  label: "Segment title",
406
- schema: t(Be).typeAtPath(t(w), "name")
406
+ schema: t(Ve).typeAtPath(t(w), "name")
407
407
  }, null, 8, ["modelValue", "schema"]),
408
- s("div", xt, [
409
- bt,
408
+ l("div", bt, [
409
+ wt,
410
410
  i(vt, {
411
- "model-value": t(l).type,
412
- "onUpdate:modelValue": r[2] || (r[2] = (d) => {
413
- x(d);
411
+ "model-value": t(s).type,
412
+ "onUpdate:modelValue": r[2] || (r[2] = (u) => {
413
+ x(u);
414
414
  })
415
415
  }, null, 8, ["model-value"])
416
416
  ]),
417
- t(l).type === t(A).enum.DYNAMIC ? (p(), C("div", wt, [
418
- Ft,
419
- i(Le, {
417
+ t(s).type === t(R).enum.DYNAMIC ? (p(), C("div", Ft, [
418
+ kt,
419
+ i(ze, {
420
420
  "trigger-type": "MEMBERSHIP_JOINED",
421
421
  includeOnly: "user",
422
- "model-value": (a = t(l)) == null ? void 0 : a.rule,
423
- "onUpdate:modelValue": r[3] || (r[3] = (d) => {
424
- t(l).rule = d;
422
+ "model-value": (a = t(s)) == null ? void 0 : a.rule,
423
+ "onUpdate:modelValue": r[3] || (r[3] = (u) => {
424
+ t(s).rule = u;
425
425
  })
426
426
  }, null, 8, ["model-value"])
427
- ])) : (p(), C("div", kt, [
428
- i(st, {
429
- importFile: t(l).importFile,
430
- "onUpdate:file": r[4] || (r[4] = (d) => {
431
- t(l).file = d;
427
+ ])) : (p(), C("div", Ct, [
428
+ i(lt, {
429
+ importFile: t(s).importFile,
430
+ "onUpdate:file": r[4] || (r[4] = (u) => {
431
+ t(s).file = u;
432
432
  })
433
433
  }, null, 8, ["importFile"])
434
434
  ])),
435
- t(l).type === t(A).enum.DYNAMIC ? (p(), C("div", Ct, [
436
- It,
435
+ t(s).type === t(R).enum.DYNAMIC ? (p(), C("div", It, [
436
+ Mt,
437
437
  i(U, {
438
- "model-value": t(l).isActive ?? !0,
439
- "onUpdate:modelValue": r[5] || (r[5] = (d) => t(l).isActive = d),
438
+ "model-value": t(s).isActive ?? !0,
439
+ "onUpdate:modelValue": r[5] || (r[5] = (u) => t(s).isActive = u),
440
440
  label: "Active",
441
441
  sublabel: "When enabled, this will recalculate the segment statistics daily.",
442
442
  "label-placement": "right"
@@ -450,13 +450,13 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
450
450
  t(y) ? {
451
451
  name: "side-sheet-header",
452
452
  fn: E(() => [
453
- s("div", _t, [
453
+ l("div", ht, [
454
454
  i(g, {
455
455
  icon: "arrow_back",
456
456
  variant: "tertiary",
457
457
  onClick: r[0] || (r[0] = (a) => y.value = !1)
458
458
  }),
459
- ht
459
+ St
460
460
  ])
461
461
  ]),
462
462
  key: "0"
@@ -464,20 +464,20 @@ const Xe = { class: "flex flex-col space-y-16" }, et = /* @__PURE__ */ s("div",
464
464
  ]), 1032, ["modelValue"]);
465
465
  };
466
466
  }
467
- }), he = He(), Et = ke();
467
+ }), he = Ge(), $t = ke();
468
468
  function se(e) {
469
- const v = G(e);
470
- return v.isValid() ? v.format("DD/MM/YYYY") : "";
469
+ const _ = G(e);
470
+ return _.isValid() ? _.format("DD/MM/YYYY") : "";
471
471
  }
472
- const $t = {
472
+ const At = {
473
473
  mapMemberExportRow: (e) => {
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
+ var n, c, F, $, h, S, x, I, d, r, g, U, o, a, u, P, A, B, V, j, q, H, te, M, Q, de, ue, pe;
475
+ const _ = ce(() => $t.locations.map((T) => ({
476
476
  label: T.name,
477
477
  value: T._id
478
- }))), _ = (n = Pe.parseOneAddress(
478
+ }))), v = (n = Ne.parseOneAddress(
479
479
  e == null ? void 0 : e.email
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(
480
+ )) != null && n.domain.includes("feedmepos.com") ? void 0 : e.email, k = (F = ((c = e == null ? void 0 : e.collection) == null ? void 0 : c.TITLE) || []) == null ? void 0 : F.reduce(
481
481
  (T, L) => {
482
482
  var K, Z;
483
483
  const W = (Z = (K = he.sortedTitles) == null ? void 0 : K.find(
@@ -495,29 +495,29 @@ const $t = {
495
495
  return T[L.name] = W ? G(W).format("DD/MM/YYYY") : "", T;
496
496
  },
497
497
  {}
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(
498
+ ), y = ((S = (h = ($ = e.collection) == null ? void 0 : $.CREDIT) == null ? void 0 : h.at(0)) == null ? void 0 : S.balance) || 0, f = ((r = (d = (I = (x = e.collection) == null ? void 0 : x.CREDIT) == null ? void 0 : I.at(0)) == null ? void 0 : d.expiryBalance) == null ? void 0 : r.reduce(
499
499
  (T, L) => T + L.amount,
500
500
  0
501
- )) || 0, w = Je(y, 2);
501
+ )) || 0, w = Qe(y, 2);
502
502
  return {
503
503
  ID: e._id.toString(),
504
504
  Name: ((g = e.name) == null ? void 0 : g.trim()) || "",
505
505
  Phone: ((U = e == null ? void 0 : e.phoneNumber) == null ? void 0 : U.trim()) || "",
506
- Email: _ || "",
506
+ Email: v || "",
507
507
  Gender: e.gender || "",
508
508
  CardNo: e.cardNo || "",
509
509
  Birthday: e != null && e.birthday ? se(e == null ? void 0 : e.birthday) : "",
510
510
  Credit: parseFloat((Number(w) - Number(f)).toFixed(2)),
511
511
  FreeCredit: Number(f.toFixed(2)),
512
512
  TotalCredit: Number(w),
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,
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
+ Exp: e != null && e.collection ? ((u = (a = (o = e.collection) == null ? void 0 : o.POINT) == null ? void 0 : a.at(0)) == null ? void 0 : u.balance) ?? 0 : 0,
514
+ 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,
515
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,
516
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(","),
517
+ Titles: k.join(","),
518
518
  ...m,
519
519
  TotalTransaction: e.stats.visitCount,
520
- AvgSpent: Qe(Number(e.stats.avgBillSize || 0)).toFormat(
520
+ AvgSpent: We(Number(e.stats.avgBillSize || 0)).toFormat(
521
521
  !1
522
522
  ),
523
523
  TotalSpent: e.stats.avgBillSize * e.stats.visitCount,
@@ -526,28 +526,28 @@ const $t = {
526
526
  LastSeasonTierEarned: ((de = e.stats) == null ? void 0 : de.lastSeasonTierEarned) || 0,
527
527
  LastSeasonPointEarned: ((ue = e.stats) == null ? void 0 : ue.lastSeasonPointEarned) || 0,
528
528
  JoinedAt: se(e.joinAt || void 0),
529
- JoinedAtLocation: e.location && ((pe = v.value.find((T) => T.value == e.location)) == null ? void 0 : pe.label) || "-",
529
+ JoinedAtLocation: e.location && ((pe = _.value.find((T) => T.value == e.location)) == null ? void 0 : pe.label) || "-",
530
530
  VisitFrequency: `${Number(
531
531
  Math.ceil(e.stats.avgVisitFrequency).toFixed(0)
532
532
  )}`
533
533
  };
534
534
  }
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", {
535
+ }, Rt = { class: "flex items-center" }, Dt = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Pt = { class: "px-24 flex flex-col gap-y-16" }, Nt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Bt = { class: "fm-typo-en-body-md-600" }, Vt = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Yt = /* @__PURE__ */ l("img", {
536
536
  src: Ee,
537
537
  class: "aspect-square w-[150px]"
538
- }, null, -1), Yt = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
539
- /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
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. ")
541
- ], -1), ho = /* @__PURE__ */ ee({
538
+ }, null, -1), Ut = /* @__PURE__ */ l("div", { class: "flex flex-col gap-16 text-center" }, [
539
+ /* @__PURE__ */ l("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
540
+ /* @__PURE__ */ l("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. ")
541
+ ], -1), So = /* @__PURE__ */ ee({
542
542
  __name: "Segment",
543
543
  setup(e) {
544
- const { minor: v } = Re, { t: _ } = we(), F = ke(), { mapMemberExportRow: m } = $t, y = Ae(), f = We(), w = z(0), l = [
544
+ const { minor: _ } = Re, { t: v } = we(), k = ke(), { mapMemberExportRow: m } = At, y = De(), f = Ke(), w = z(0), s = [
545
545
  {
546
- header: _("connect.loyalty.segment.table.name"),
546
+ header: v("connect.loyalty.segment.table.name"),
547
547
  accessorFn: (o) => o.name
548
548
  },
549
549
  {
550
- header: _("connect.loyalty.segment.table.status"),
550
+ header: v("connect.loyalty.segment.table.status"),
551
551
  enableSorting: !1,
552
552
  cell(o) {
553
553
  const a = o.row.original.isActive === !1 ? "Inactive" : "Active";
@@ -559,15 +559,15 @@ const $t = {
559
559
  }
560
560
  },
561
561
  {
562
- header: _("connect.loyalty.segment.table.total_customers"),
562
+ header: v("connect.loyalty.segment.table.total_customers"),
563
563
  accessorFn: (o) => o.memberCount ?? 0
564
564
  },
565
565
  {
566
- header: _("connect.loyalty.segment.table.customer_percentage"),
566
+ header: v("connect.loyalty.segment.table.customer_percentage"),
567
567
  accessorFn: (o) => ((o.memberCount ?? 0) * 100 / w.value).toFixed(2)
568
568
  },
569
569
  {
570
- header: _("connect.loyalty.segment.table.actions"),
570
+ header: v("connect.loyalty.segment.table.actions"),
571
571
  meta: {
572
572
  maxWidth: "100px"
573
573
  },
@@ -628,11 +628,11 @@ const $t = {
628
628
  ]);
629
629
  }
630
630
  }
631
- ], n = z(null), { tableMeta: c, rowData: k, debouncedFetchData: $ } = xe(
631
+ ], n = z(null), { tableMeta: c, rowData: F, debouncedFetchData: $ } = xe(
632
632
  N.readAll
633
633
  );
634
634
  async function h() {
635
- await v(
635
+ await _(
636
636
  async () => {
637
637
  await N.refreshSegments(), await $({ pageSize: 10, pageIndex: 0 });
638
638
  },
@@ -640,7 +640,7 @@ const $t = {
640
640
  );
641
641
  }
642
642
  async function S(o) {
643
- await $e.remove(`Are you sure you want to remove ${o.name}?`) && await v(
643
+ await Ae.remove(`Are you sure you want to remove ${o.name}?`) && await _(
644
644
  async () => {
645
645
  await N.delete(o._id), await $({ pageSize: 10, pageIndex: 0 });
646
646
  },
@@ -657,18 +657,18 @@ const $t = {
657
657
  rowsPerPage: 1e3,
658
658
  page: 1,
659
659
  rowsNumber: 0
660
- }, d = new Ne(), P = (await ve.read({
660
+ }, u = new Be(), P = (await _e.read({
661
661
  limit: 1,
662
662
  skip: 0,
663
663
  sortBy: a.sortBy,
664
664
  descending: a.descending
665
- })).meta.totalResources ?? 0, R = a.rowsPerPage;
666
- await v(
665
+ })).meta.totalResources ?? 0, A = a.rowsPerPage;
666
+ await _(
667
667
  async () => {
668
- for (let B = 0; B < P; B += R) {
668
+ for (let B = 0; B < P; B += A) {
669
669
  const V = {
670
670
  ...a,
671
- limit: R,
671
+ limit: A,
672
672
  skip: a.page - 1,
673
673
  sortBy: a.sortBy,
674
674
  descending: a.descending
@@ -678,12 +678,12 @@ const $t = {
678
678
  );
679
679
  for (const q of j.resources) {
680
680
  const H = m(q);
681
- d.addRecord(H);
681
+ u.addRecord(H);
682
682
  }
683
683
  a.page++;
684
684
  }
685
685
  await Fe(
686
- d.buildExcel(),
686
+ u.buildExcel(),
687
687
  `[${o.name}]-members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
688
688
  {
689
689
  bookType: "xlsx",
@@ -699,17 +699,17 @@ const $t = {
699
699
  );
700
700
  }
701
701
  async function I(o) {
702
- await v(
702
+ await _(
703
703
  async () => {
704
704
  var a;
705
- if (o.type === A.enum.STATIC) {
706
- const d = new FormData();
707
- if (d.append("file", o.file), o._id) {
708
- const { members: P, _id: R, file: B, ...V } = o;
709
- d.append("segment", JSON.stringify(V)), await N.updateStatic(o._id, d);
705
+ if (o.type === R.enum.STATIC) {
706
+ const u = new FormData();
707
+ if (u.append("file", o.file), o._id) {
708
+ const { members: P, _id: A, file: B, ...V } = o;
709
+ u.append("segment", JSON.stringify(V)), await N.updateStatic(o._id, u);
710
710
  } else {
711
- const { file: P, ...R } = o;
712
- d.append("segment", JSON.stringify(R)), await N.createStatic(d);
711
+ const { file: P, ...A } = o;
712
+ u.append("segment", JSON.stringify(A)), await N.createStatic(u);
713
713
  }
714
714
  o.file && y.open({
715
715
  type: "info",
@@ -717,14 +717,14 @@ const $t = {
717
717
  action: "View",
718
718
  onAction: async () => {
719
719
  await f.push({
720
- name: _e["$connect-QUEUE"],
720
+ name: ve["$connect-QUEUE"],
721
721
  query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
722
722
  });
723
723
  }
724
724
  });
725
725
  } else if (o._id) {
726
- const { members: d, _id: P, ...R } = o;
727
- await N.update(o._id, R);
726
+ const { members: u, _id: P, ...A } = o;
727
+ await N.update(o._id, A);
728
728
  } else
729
729
  await N.create(o);
730
730
  await $({ pageSize: 10, pageIndex: 0 }), (a = n.value) == null || a.hideSheet();
@@ -735,16 +735,16 @@ const $t = {
735
735
  }
736
736
  );
737
737
  }
738
- function u(o) {
738
+ function d(o) {
739
739
  var a;
740
740
  (a = n.value) == null || a.showSheet(o);
741
741
  }
742
742
  const r = {
743
- label: _("connect.navigation.queue"),
743
+ label: v("connect.navigation.queue"),
744
744
  value: "queue",
745
745
  isPrimary: !1,
746
746
  prependIcon: "work_history"
747
- }, g = ce(() => F.isPremium ? [
747
+ }, g = ce(() => k.isPremium ? [
748
748
  r,
749
749
  {
750
750
  label: "Refresh segments",
@@ -761,30 +761,30 @@ const $t = {
761
761
  function U(o) {
762
762
  switch (o) {
763
763
  case "add":
764
- u();
764
+ d();
765
765
  break;
766
766
  case "refresh":
767
767
  h();
768
768
  break;
769
769
  case "queue":
770
770
  f.push({
771
- name: _e["$connect-QUEUE"],
771
+ name: ve["$connect-QUEUE"],
772
772
  query: { type: [fe.enum.SEGMENTATION_IMPORTED] }
773
773
  });
774
774
  break;
775
775
  }
776
776
  }
777
777
  return Te(async () => {
778
- const { meta: o } = await ve.read({
778
+ const { meta: o } = await _e.read({
779
779
  limit: 1,
780
780
  skip: 0,
781
781
  sortBy: "_id",
782
782
  search: void 0,
783
783
  descending: !1
784
784
  });
785
- w.value = o.totalResources ?? 0, await $({ pageSize: 10, pageIndex: 0 }), await F.readPremium(), await F.readLocations();
785
+ w.value = o.totalResources ?? 0, await $({ pageSize: 10, pageIndex: 0 }), await k.readPremium(), await k.readLocations();
786
786
  }), (o, a) => {
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");
787
+ const u = b("FmPill"), P = b("FmPageHead"), A = b("FmIcon"), B = b("FmMenuItem"), V = b("FmMenu"), j = b("FmListItem"), q = b("FmList"), H = b("FmButton"), te = b("FmCard");
788
788
  return p(), C(O, null, [
789
789
  i(P, {
790
790
  title: "Segments",
@@ -792,47 +792,47 @@ const $t = {
792
792
  "onClick:action": a[0] || (a[0] = (M) => U(M))
793
793
  }, {
794
794
  title: E(() => [
795
- s("div", Rt, [
796
- s("span", At, D(t(_)("connect.loyalty.segment.title")), 1),
797
- i(d, { variant: "premium" })
795
+ l("div", Rt, [
796
+ l("span", Dt, D(t(v)("connect.loyalty.segment.title")), 1),
797
+ i(u, { variant: "premium" })
798
798
  ])
799
799
  ]),
800
800
  _: 1
801
801
  }, 8, ["actions"]),
802
- s("div", Dt, [
803
- t(k).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), C(O, { key: 0 }, [
802
+ l("div", Pt, [
803
+ t(F).length > 0 || t(c).searchValue || t(c).isLoading ? (p(), C(O, { key: 0 }, [
804
804
  i(be, {
805
805
  loading: t(c).isLoading,
806
- "row-data": t(k),
806
+ "row-data": t(F),
807
807
  "row-count": t(c).totalRows,
808
- "column-defs": l,
808
+ "column-defs": s,
809
809
  "shrink-at": !1,
810
810
  "page-count": t(c).pageCount,
811
811
  "page-index": t(c).pageIndex,
812
812
  "page-size": t(c).pageSize,
813
813
  onRowClick: a[1] || (a[1] = (M) => {
814
- u(M.original);
814
+ d(M.original);
815
815
  }),
816
816
  onPageChange: t($)
817
817
  }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onPageChange"]),
818
818
  i(q, { class: "w-full hidden xs:block" }, {
819
819
  default: E(() => [
820
- (p(!0), C(O, null, ie(t(k), (M) => (p(), J(j, {
820
+ (p(!0), C(O, null, ie(t(F), (M) => (p(), J(j, {
821
821
  key: M._id.toString(),
822
822
  tag: "label",
823
- onClick: (Q) => u(M)
823
+ onClick: (Q) => d(M)
824
824
  }, {
825
825
  default: E(() => [
826
- s("div", null, [
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)
826
+ l("div", null, [
827
+ l("div", Nt, D((M.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
828
+ l("div", Bt, D(M.name), 1),
829
+ l("div", Vt, D(((M.memberCount ?? 0) * 100 / t(w)).toFixed(2)) + "% of customers ", 1)
830
830
  ])
831
831
  ]),
832
832
  append: E(() => [
833
833
  i(V, { "stop-click-propagation": !0 }, {
834
834
  "menu-button": E(() => [
835
- i(R, { name: "more_vert" })
835
+ i(A, { name: "more_vert" })
836
836
  ]),
837
837
  default: E(() => [
838
838
  i(B, {
@@ -855,19 +855,19 @@ const $t = {
855
855
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
856
856
  }, {
857
857
  default: E(() => [
858
- Vt,
859
858
  Yt,
859
+ Ut,
860
860
  i(H, {
861
861
  variant: "primary",
862
862
  label: "Create segment",
863
- disabled: !t(F).isPremium,
863
+ disabled: !t(k).isPremium,
864
864
  icon: "add",
865
- onClick: a[2] || (a[2] = (M) => u())
865
+ onClick: a[2] || (a[2] = (M) => d())
866
866
  }, null, 8, ["disabled"])
867
867
  ]),
868
868
  _: 1
869
869
  })),
870
- i(Tt, {
870
+ i(Et, {
871
871
  ref_key: "sheetRef",
872
872
  ref: n,
873
873
  "onUpdate:modelValue": I
@@ -878,5 +878,5 @@ const $t = {
878
878
  }
879
879
  });
880
880
  export {
881
- ho as default
881
+ So as default
882
882
  };