@feedmepos/mf-connect 0.0.16-beta.10 → 0.0.16-beta.12

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 (85) hide show
  1. package/dist/{Analytic-BVk0jPDU.js → Analytic-DIc9BYb0.js} +32 -20
  2. package/dist/{App-BbAalq1k.js → App-BzzL9_Jw.js} +33 -27
  3. package/dist/Broadcast-dVPgK5QV.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DiU3MnH0.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-TnEPvafD.js} +18 -11
  5. package/dist/{Card-B5in1RMa.js → Card-Bj2Yd2pr.js} +178 -158
  6. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  7. package/dist/Collections-Fkb_zzqZ.js +453 -0
  8. package/dist/{Credit-Bc9EzdsC.js → Credit-DHn9OkE8.js} +78 -69
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C1ZXQski.js +2788 -0
  10. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D6mWny8y.js +344 -0
  11. package/dist/{Experience-CgKak5ik.js → Experience-DX3aJihS.js} +64 -55
  12. package/dist/{Game-QhfKqrN_.js → Game-CcVQvETd.js} +54 -45
  13. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  14. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  15. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +18737 -0
  16. package/dist/MainLayout-B1aJoR95.js +41 -0
  17. package/dist/{Marketing-CSx4N7UJ.js → Marketing-B9kykWEh.js} +79 -72
  18. package/dist/{Member-CY6WMD8D.js → Member-RoJSCSC5.js} +25 -22
  19. package/dist/{MemberList-8iRwm7Sz.js → MemberList-BUDxqMEK.js} +321 -307
  20. package/dist/{MemberTransactions-CknqkWO3.js → MemberTransactions-Bh_tT1Rp.js} +1 -1
  21. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Cj3-JHOX.js +432 -0
  22. package/dist/{Mission-BTy1p7lU.js → Mission-DDvgCLy0.js} +50 -40
  23. package/dist/{Point-A6B_ggSy.js → Point-BbPkt4kF.js} +67 -58
  24. package/dist/Promotion-DEo-lxpX.js +221 -0
  25. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BGjeTeqS.js +1751 -0
  26. package/dist/{Segment-CFVXtyEj.js → Segment-DAcpZWIN.js} +145 -130
  27. package/dist/{Setting-Jmtw-_DV.js → Setting-CgXohUPt.js} +167 -154
  28. package/dist/{Store-DQypT-7e.js → Store-BVyHbQ8o.js} +504 -489
  29. package/dist/{StoreRewards-M-utm0iI.js → StoreRewards-sccMDbkj.js} +124 -108
  30. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-B60mQ5kq.js → StoreTransactions.vue_vue_type_script_setup_true_lang--sdQ_l8g.js} +131 -123
  31. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CXlkvt2u.js +139 -0
  32. package/dist/{Tier-D1jymeLK.js → Tier--P27XXbB.js} +144 -125
  33. package/dist/{Title-DN9DIP2k.js → Title-B27S3SxD.js} +107 -90
  34. package/dist/{Transaction-BAJvAoU6.js → Transaction-CYTtwwHY.js} +2 -2
  35. package/dist/Voucher-BZ8PKgO5.js +488 -0
  36. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js +55 -0
  37. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  38. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  39. package/dist/app-CnKzqAcN.js +53428 -0
  40. package/dist/app-FfENBuoE.js +5381 -0
  41. package/dist/app-wDQR6dpb.js +39 -0
  42. package/dist/app.js +2 -1
  43. package/dist/business-CXyP9G7A.js +78 -0
  44. package/dist/campaign-0aM2KYOy.js +96 -0
  45. package/dist/campaign-CpzFl8Vr.js +4 -0
  46. package/dist/collection.fn-FicQhH1t.js +26 -0
  47. package/dist/dto-BiYLkVdL.js +1169 -0
  48. package/dist/effect-Cg-eNEjg.js +61 -0
  49. package/dist/{export-DjeNY5Pc.js → export-D7BuObOL.js} +19 -16
  50. package/dist/helper-DvD-D7c7.js +71 -0
  51. package/dist/index-B1Q0GAWp.js +95 -0
  52. package/dist/index-B4UZgSB-.js +28058 -0
  53. package/dist/index-B6c-fUij.js +203 -0
  54. package/dist/index-BP_5cfKa.js +38 -0
  55. package/dist/index-BRXg5Si1.js +2071 -0
  56. package/dist/index-BuDwICBJ.js +761 -0
  57. package/dist/index-CDMC-8iO.js +94 -0
  58. package/dist/index-CcZt3OrE.js +73 -0
  59. package/dist/index-CuvNtC_M.js +61 -0
  60. package/dist/index-DA-fzkRR.js +1737 -0
  61. package/dist/index-Dbd4WA4r.js +61 -0
  62. package/dist/index-Dkeb_9ER.js +8832 -0
  63. package/dist/index-DmdKoKk_.js +298 -0
  64. package/dist/index-G-88ujCM.js +3 -0
  65. package/dist/loading-uCNeZibp.js +32697 -0
  66. package/dist/lodash-B5I3zXaY.js +3678 -0
  67. package/dist/membership-DFRO9TyM.js +221 -0
  68. package/dist/moment-BWErdI6_.js +2578 -0
  69. package/dist/money-OtkT4Pzp.js +15 -0
  70. package/dist/number-Cg3NCouc.js +12 -0
  71. package/dist/object-qECH92oz.js +26 -0
  72. package/dist/objectId-dwaoBfJX.js +7 -0
  73. package/dist/rule-Ch2HRiGw.js +1973 -0
  74. package/dist/rule-builder-B_M9yvEe.js +89 -0
  75. package/dist/template-1o0LbOoJ.js +190 -0
  76. package/dist/usePagination-BeF5K3M7.js +223 -0
  77. package/dist/vue-i18n-AtGIa4qH.js +2365 -0
  78. package/dist/xlsx-pChq0adn.js +15491 -0
  79. package/dist/zod-W_PvIofQ.js +90 -0
  80. package/package.json +3 -3
  81. package/dist/Collections-CFCZ9YIG.js +0 -4
  82. package/dist/MainLayout-JbHzENFy.js +0 -4
  83. package/dist/app-BpzzygYP.js +0 -87765
  84. package/dist/money-DKGIIplY.js +0 -15
  85. package/dist/number-tPodRxTN.js +0 -12
@@ -1,13 +1,28 @@
1
- import { defineComponent as U, onMounted as N, openBlock as u, createElementBlock as b, createElementVNode as n, toDisplayString as x, unref as t, createVNode as l, createCommentVNode as G, ref as w, computed as j, resolveComponent as c, createBlock as P, isRef as J, createSlots as W, withCtx as f, Fragment as R, h as I, reactive as Q, watch as X, onBeforeMount as ee, renderList as te } from "vue";
2
- import { a5 as ae, a6 as E, a2 as ne, U as B, a3 as oe, a0 as se, $ as k, a as le, k as ie, d as re, Z as me, p as de, u as ce, b as ue, B as pe, a7 as ge, m as fe, j as ye, e as ve } from "./app-BpzzygYP.js";
1
+ import { defineComponent as A, onMounted as N, openBlock as u, createElementBlock as b, createElementVNode as a, toDisplayString as x, unref as t, createVNode as l, createCommentVNode as G, ref as w, computed as j, resolveComponent as c, createBlock as B, isRef as J, createSlots as W, withCtx as g, Fragment as I, h as R, reactive as Q, watch as X, onBeforeMount as ee, renderList as te } from "vue";
2
+ import { _ as oe } from "./campaign-CpzFl8Vr.js";
3
+ import { F as E, p as ae, u as ne } from "./loading-uCNeZibp.js";
3
4
  import { components as L } from "@feedmepos/ui-library";
4
- const _e = ae.extend({
5
+ import { l as se } from "./lodash-B5I3zXaY.js";
6
+ import { u as le } from "./vue-i18n-AtGIa4qH.js";
7
+ import { Z as re } from "./zod-W_PvIofQ.js";
8
+ import { a as ie } from "./index-DA-fzkRR.js";
9
+ import { u as me } from "./app-wDQR6dpb.js";
10
+ import { R as de } from "./rule-builder-B_M9yvEe.js";
11
+ import { _ as ce } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js";
12
+ import { _ as ue } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BGjeTeqS.js";
13
+ import { h as P } from "./moment-BWErdI6_.js";
14
+ import { u as pe, _ as fe } from "./usePagination-BeF5K3M7.js";
15
+ import { s as k } from "./membership-DFRO9TyM.js";
16
+ import { o as ge } from "./objectId-dwaoBfJX.js";
17
+ import { u as ye } from "./business-CXyP9G7A.js";
18
+ import { m as ve } from "./index-CcZt3OrE.js";
19
+ const _e = ie.extend({
5
20
  _id: E.optional(),
6
21
  business: E.optional()
7
22
  }), he = { class: "space-y-16 pr-12" }, be = { class: "fm-typo-en-title-md-800" }, Se = { class: "flex space-x-8" }, xe = { class: "fm-typo-en-title-md-800 text-fm-color-primary" }, we = { class: "text-fm-color-typo-secondary" }, Fe = {
8
23
  key: 0,
9
24
  class: "w-full flex flex-col gap-16 items-center pt-16"
10
- }, Ce = /* @__PURE__ */ U({
25
+ }, Ce = /* @__PURE__ */ A({
11
26
  __name: "ReviewSegment",
12
27
  props: {
13
28
  title: {},
@@ -17,78 +32,78 @@ const _e = ae.extend({
17
32
  const y = D, v = [
18
33
  {
19
34
  header: "Name",
20
- accessorFn: (o) => o.name
35
+ accessorFn: (n) => n.name
21
36
  },
22
37
  {
23
38
  header: "Customer Since",
24
- accessorFn: (o) => B(se(o._id.toString())).format("DD MMM YYYY")
39
+ accessorFn: (n) => P(ge(n._id.toString())).format("DD MMM YYYY")
25
40
  },
26
41
  {
27
42
  header: "Birthday",
28
- accessorFn: (o) => B(o.birthday).format("DD MMM YYYY")
43
+ accessorFn: (n) => P(n.birthday).format("DD MMM YYYY")
29
44
  },
30
45
  {
31
46
  header: "Last Visit",
32
- accessorFn: (o) => B(o.stats.lastVisit).format("DD MMM YYYY")
47
+ accessorFn: (n) => P(n.stats.lastVisit).format("DD MMM YYYY")
33
48
  }
34
- ], _ = async (o) => y.segment._id ? await k.paginateSegmentUsers(y.segment._id, {
35
- limit: i.value.pageSize,
36
- skip: o.pageIndex ?? 0,
49
+ ], _ = async (n) => y.segment._id ? await k.paginateSegmentUsers(y.segment._id, {
50
+ limit: r.value.pageSize,
51
+ skip: n.pageIndex ?? 0,
37
52
  sortBy: "_id",
38
- search: o.searchValue,
53
+ search: n.searchValue,
39
54
  descending: !0
40
- }) : { resources: [], meta: { totalResources: 0, totalPages: 0 } }, { tableMeta: i, rowData: d, onSort: F, debouncedFetchData: r, onSearch: s } = ne(_);
55
+ }) : { resources: [], meta: { totalResources: 0, totalPages: 0 } }, { tableMeta: r, rowData: d, onSort: F, debouncedFetchData: i, onSearch: s } = pe(_);
41
56
  return N(async () => {
42
- await r();
43
- }), (o, m) => (u(), b("div", he, [
44
- n("div", be, x(y.title), 1),
45
- n("div", Se, [
46
- n("div", xe, x(o.segment.members.length), 1),
47
- n("div", we, [
48
- m[1] || (m[1] = n("div", null, "contacts in your segment", -1)),
49
- n("div", null, "as of " + x(t(B)(o.segment.lastUpdated).format("DD MMM YYYY")), 1)
57
+ await i();
58
+ }), (n, m) => (u(), b("div", he, [
59
+ a("div", be, x(y.title), 1),
60
+ a("div", Se, [
61
+ a("div", xe, x(n.segment.members.length), 1),
62
+ a("div", we, [
63
+ m[1] || (m[1] = a("div", null, "contacts in your segment", -1)),
64
+ a("div", null, "as of " + x(t(P)(n.segment.lastUpdated).format("DD MMM YYYY")), 1)
50
65
  ])
51
66
  ]),
52
- l(oe, {
53
- loading: t(i).isLoading,
67
+ l(fe, {
68
+ loading: t(r).isLoading,
54
69
  "row-data": t(d),
55
- "row-count": t(i).totalRows,
70
+ "row-count": t(r).totalRows,
56
71
  "column-defs": v,
57
- "page-size": t(i).pageSize,
58
- "page-count": t(i).pageCount,
59
- "page-index": t(i).pageIndex,
72
+ "page-size": t(r).pageSize,
73
+ "page-count": t(r).pageCount,
74
+ "page-index": t(r).pageIndex,
60
75
  onSortChange: t(F),
61
- onPageChange: m[0] || (m[0] = (S) => t(r)({ pageSize: S.pageSize, pageIndex: S.pageIndex }))
76
+ onPageChange: m[0] || (m[0] = (S) => t(i)({ pageSize: S.pageSize, pageIndex: S.pageIndex }))
62
77
  }, null, 8, ["loading", "row-data", "row-count", "page-size", "page-count", "page-index", "onSortChange"]),
63
78
  t(d).length == 0 ? (u(), b("div", Fe, m[2] || (m[2] = [
64
- n("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1),
65
- n("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1)
79
+ a("div", { class: "fm-typo-en-body-lg-600" }, "No data found", -1),
80
+ a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " No data to show at the current moment. ", -1)
66
81
  ]))) : G("", !0)
67
82
  ]));
68
83
  }
69
84
  }), ke = { class: "flex items-center gap-x-8" }, Me = {
70
85
  key: 0,
71
86
  class: "space-y-16 pr-12"
72
- }, Ie = { class: "flex items-center gap-8" }, Re = /* @__PURE__ */ U({
87
+ }, Re = { class: "flex items-center gap-8" }, Ie = /* @__PURE__ */ A({
73
88
  __name: "SegmentSheet",
74
89
  emits: ["update:model-value"],
75
90
  setup(D, { expose: y, emit: v }) {
76
- const _ = le(), i = w(!1), d = w(!1), F = {
91
+ const _ = me(), r = w(!1), d = w(!1), F = {
77
92
  name: "",
78
- rule: ie.scaffoldGroup(),
93
+ rule: de.scaffoldGroup(),
79
94
  members: []
80
- }, r = _e, s = w(F), o = j(() => {
81
- const a = r.safeParse(s.value);
82
- return a.success ? [] : a.error.errors;
95
+ }, i = _e, s = w(F), n = j(() => {
96
+ const o = i.safeParse(s.value);
97
+ return o.success ? [] : o.error.errors;
83
98
  });
84
- function m(a) {
85
- i.value = !0, d.value = !1, a ? s.value = { ...a } : s.value = { ...F };
99
+ function m(o) {
100
+ r.value = !0, d.value = !1, o ? s.value = { ...o } : s.value = { ...F };
86
101
  }
87
102
  function S() {
88
- i.value = !1;
103
+ r.value = !1;
89
104
  }
90
105
  async function $() {
91
- r.safeParse(s.value).success && (d.value = !0);
106
+ i.safeParse(s.value).success && (d.value = !0);
92
107
  }
93
108
  function Y() {
94
109
  d.value = !1;
@@ -102,34 +117,34 @@ const _e = ae.extend({
102
117
  return y({
103
118
  showSheet: m,
104
119
  hideSheet: S
105
- }), (a, e) => {
120
+ }), (o, e) => {
106
121
  const h = c("FmButton"), V = c("FmSideSheet");
107
- return u(), P(V, {
108
- modelValue: t(i),
109
- "onUpdate:modelValue": e[5] || (e[5] = (p) => J(i) ? i.value = p : null),
122
+ return u(), B(V, {
123
+ modelValue: t(r),
124
+ "onUpdate:modelValue": e[5] || (e[5] = (p) => J(r) ? r.value = p : null),
110
125
  header: "Add segment",
111
126
  "dismiss-away": "",
112
127
  "close-button": !0,
113
128
  "max-width": 1100
114
129
  }, W({
115
- "side-sheet-footer": f(() => [
116
- n("div", Ie, [
117
- t(d) ? (u(), b(R, { key: 0 }, [
130
+ "side-sheet-footer": g(() => [
131
+ a("div", Re, [
132
+ t(d) ? (u(), b(I, { key: 0 }, [
118
133
  l(h, {
119
134
  label: "Save Segment",
120
135
  onClick: C,
121
136
  loading: t(_).isLoading,
122
- disabled: t(o).length > 0 || t(_).isLoading
137
+ disabled: t(n).length > 0 || t(_).isLoading
123
138
  }, null, 8, ["loading", "disabled"]),
124
139
  l(h, {
125
140
  label: "Cancel",
126
141
  onClick: e[3] || (e[3] = (p) => Y()),
127
142
  variant: "tertiary"
128
143
  })
129
- ], 64)) : (u(), b(R, { key: 1 }, [
144
+ ], 64)) : (u(), b(I, { key: 1 }, [
130
145
  l(h, {
131
146
  label: "Review Segment",
132
- disabled: t(o).length > 0 || t(_).isLoading,
147
+ disabled: t(n).length > 0 || t(_).isLoading,
133
148
  onClick: $
134
149
  }, null, 8, ["disabled"]),
135
150
  l(h, {
@@ -140,22 +155,22 @@ const _e = ae.extend({
140
155
  ], 64))
141
156
  ])
142
157
  ]),
143
- default: f(() => {
158
+ default: g(() => {
144
159
  var p;
145
160
  return [
146
- t(d) ? (u(), P(Ce, {
161
+ t(d) ? (u(), B(Ce, {
147
162
  key: 1,
148
163
  title: t(s).name,
149
164
  segment: t(s)
150
165
  }, null, 8, ["title", "segment"])) : (u(), b("div", Me, [
151
- l(re, {
166
+ l(ce, {
152
167
  modelValue: t(s).name,
153
168
  "onUpdate:modelValue": e[1] || (e[1] = (M) => t(s).name = M),
154
169
  label: "Segment title",
155
- schema: t(me).typeAtPath(t(r), "name")
170
+ schema: t(re).typeAtPath(t(i), "name")
156
171
  }, null, 8, ["modelValue", "schema"]),
157
- e[7] || (e[7] = n("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
158
- l(de, {
172
+ e[7] || (e[7] = a("div", { class: "fm-typo-en-title-sm-800" }, "Segment Filter", -1)),
173
+ l(ue, {
159
174
  "trigger-type": "MEMBERSHIP_JOINED",
160
175
  includeOnly: "user",
161
176
  "model-value": (p = t(s)) == null ? void 0 : p.rule,
@@ -170,14 +185,14 @@ const _e = ae.extend({
170
185
  }, [
171
186
  t(d) ? {
172
187
  name: "side-sheet-header",
173
- fn: f(() => [
174
- n("div", ke, [
188
+ fn: g(() => [
189
+ a("div", ke, [
175
190
  l(h, {
176
191
  icon: "arrow_back",
177
192
  variant: "tertiary",
178
193
  onClick: e[0] || (e[0] = (p) => d.value = !1)
179
194
  }),
180
- e[6] || (e[6] = n("div", null, "Review segment", -1))
195
+ e[6] || (e[6] = a("div", null, "Review segment", -1))
181
196
  ])
182
197
  ]),
183
198
  key: "0"
@@ -185,30 +200,30 @@ const _e = ae.extend({
185
200
  ]), 1032, ["modelValue"]);
186
201
  };
187
202
  }
188
- }), $e = { class: "flex items-center" }, Ve = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Be = { class: "px-24 flex flex-col gap-y-16" }, Pe = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, De = { class: "fm-typo-en-body-md-600" }, Ye = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, Ae = /* @__PURE__ */ U({
203
+ }), $e = { class: "flex items-center" }, Ve = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Pe = { class: "px-24 flex flex-col gap-y-16" }, Be = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, De = { class: "fm-typo-en-body-md-600" }, Ye = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, et = /* @__PURE__ */ A({
189
204
  __name: "Segment",
190
205
  setup(D) {
191
- const { minor: y } = ve, { t: v } = ce(), _ = ue(), i = w(0), d = [
206
+ const { minor: y } = ne, { t: v } = le(), _ = ye(), r = w(0), d = [
192
207
  {
193
208
  header: v("connect.loyalty.segment.table.name"),
194
- accessorFn: (a) => a.name
209
+ accessorFn: (o) => o.name
195
210
  },
196
211
  {
197
212
  header: v("connect.loyalty.segment.table.total_customers"),
198
- accessorFn: (a) => a.memberCount ?? 0
213
+ accessorFn: (o) => o.memberCount ?? 0
199
214
  },
200
215
  {
201
216
  header: v("connect.loyalty.segment.table.customer_percentage"),
202
- accessorFn: (a) => ((a.memberCount ?? 0) * 100 / i.value).toFixed(2)
217
+ accessorFn: (o) => ((o.memberCount ?? 0) * 100 / r.value).toFixed(2)
203
218
  },
204
219
  {
205
220
  header: v("connect.loyalty.segment.table.actions"),
206
221
  meta: {
207
222
  maxWidth: "100px"
208
223
  },
209
- cell(a) {
210
- return I("div", { class: "flex items-center justify-end" }, [
211
- I(
224
+ cell(o) {
225
+ return R("div", { class: "flex items-center justify-end" }, [
226
+ R(
212
227
  L.FmMenu,
213
228
  {
214
229
  placement: "bottom-end",
@@ -217,21 +232,21 @@ const _e = ae.extend({
217
232
  }
218
233
  },
219
234
  {
220
- "menu-button": () => I(L.FmButton, {
235
+ "menu-button": () => R(L.FmButton, {
221
236
  icon: "more_vert",
222
237
  iconColor: "neutral-gray-400",
223
238
  variant: "tertiary"
224
239
  }),
225
240
  default: () => [
226
- I(
241
+ R(
227
242
  L.FmMenuItem,
228
243
  {
229
244
  onClick: async (e) => {
230
- e.stopPropagation(), $(a.row.original);
245
+ e.stopPropagation(), $(o.row.original);
231
246
  }
232
247
  },
233
248
  {
234
- label: I(
249
+ label: R(
235
250
  "div",
236
251
  {
237
252
  class: "text-fm-color-typo-error fm-typo-en-body-md-400"
@@ -246,23 +261,23 @@ const _e = ae.extend({
246
261
  ]);
247
262
  }
248
263
  }
249
- ], F = Q({ searchKey: "", columnFilters: [] }), r = w({
264
+ ], F = Q({ searchKey: "", columnFilters: [] }), i = w({
250
265
  searchValue: "",
251
266
  pageSize: 10,
252
267
  pageCount: 0,
253
268
  pageIndex: 0,
254
269
  totalRows: 0,
255
270
  isLoading: !1
256
- }), s = w([]), o = w(null), m = async (a) => {
257
- s.value = [], r.value.isLoading = !0;
271
+ }), s = w([]), n = w(null), m = async (o) => {
272
+ s.value = [], i.value.isLoading = !0;
258
273
  const e = await k.readAll({
259
- limit: a.pageSize,
260
- skip: a.pageIndex ?? 0,
274
+ limit: o.pageSize,
275
+ skip: o.pageIndex ?? 0,
261
276
  sortBy: "_id",
262
- search: r.value.searchValue,
277
+ search: i.value.searchValue,
263
278
  descending: !0
264
279
  });
265
- s.value = e.resources, r.value.totalRows = e.meta.totalResources ?? 0, r.value.pageCount = e.meta.totalPages ?? 0, r.value.isLoading = !1;
280
+ s.value = e.resources, i.value.totalRows = e.meta.totalResources ?? 0, i.value.pageCount = e.meta.totalPages ?? 0, i.value.isLoading = !1;
266
281
  };
267
282
  async function S() {
268
283
  await y(
@@ -272,27 +287,27 @@ const _e = ae.extend({
272
287
  { message: "Refreshing segmentations" }
273
288
  );
274
289
  }
275
- async function $(a) {
276
- await pe.remove(`Are you sure you want to remove ${a.name}?`) && await y(
290
+ async function $(o) {
291
+ await ae.remove(`Are you sure you want to remove ${o.name}?`) && await y(
277
292
  async () => {
278
- await k.delete(a._id), await m({ pageSize: 10, pageIndex: 0 });
293
+ await k.delete(o._id), await m({ pageSize: 10, pageIndex: 0 });
279
294
  },
280
295
  {
281
- message: `Removing ${a.name}`,
282
- successMessage: `Removed ${a.name} successfully`
296
+ message: `Removing ${o.name}`,
297
+ successMessage: `Removed ${o.name} successfully`
283
298
  }
284
299
  );
285
300
  }
286
- async function Y(a) {
301
+ async function Y(o) {
287
302
  await y(
288
303
  async () => {
289
304
  var e;
290
- if (a._id) {
291
- const { members: h, _id: V, ...p } = a;
292
- await k.update(a._id, p);
305
+ if (o._id) {
306
+ const { members: h, _id: V, ...p } = o;
307
+ await k.update(o._id, p);
293
308
  } else
294
- await k.create(a);
295
- await m({ pageSize: 10, pageIndex: 0 }), (e = o.value) == null || e.hideSheet();
309
+ await k.create(o);
310
+ await m({ pageSize: 10, pageIndex: 0 }), (e = n.value) == null || e.hideSheet();
296
311
  },
297
312
  {
298
313
  message: "Saving segment",
@@ -300,9 +315,9 @@ const _e = ae.extend({
300
315
  }
301
316
  );
302
317
  }
303
- function C(a) {
318
+ function C(o) {
304
319
  var e;
305
- (e = o.value) == null || e.showSheet(a);
320
+ (e = n.value) == null || e.showSheet(o);
306
321
  }
307
322
  const z = j(() => _.isPremium ? [
308
323
  {
@@ -317,37 +332,37 @@ const _e = ae.extend({
317
332
  }
318
333
  ] : []);
319
334
  return X(
320
- () => r.value.searchValue,
321
- ge.debounce(() => {
335
+ () => i.value.searchValue,
336
+ se.debounce(() => {
322
337
  m({ pageSize: 10, pageIndex: 0 });
323
338
  }, 500)
324
339
  ), ee(async () => {
325
- const { meta: a } = await fe.read({
340
+ const { meta: o } = await ve.read({
326
341
  limit: 1,
327
342
  skip: 0,
328
343
  sortBy: "_id",
329
- search: r.value.searchValue,
344
+ search: i.value.searchValue,
330
345
  descending: !1
331
346
  });
332
- i.value = a.totalResources ?? 0, await m({ pageSize: 10, pageIndex: 0 }), await _.readPremium();
333
- }), (a, e) => {
347
+ r.value = o.totalResources ?? 0, await m({ pageSize: 10, pageIndex: 0 }), await _.readPremium();
348
+ }), (o, e) => {
334
349
  const h = c("FmPill"), V = c("FmPageHead"), p = c("FmTable"), M = c("FmIcon"), H = c("FmMenuItem"), O = c("FmMenu"), T = c("FmListItem"), K = c("FmList"), Z = c("FmButton"), q = c("FmCard");
335
- return u(), b(R, null, [
350
+ return u(), b(I, null, [
336
351
  l(V, {
337
352
  title: "Segments",
338
353
  actions: t(z),
339
- "onClick:action": e[0] || (e[0] = (g) => g === "add" ? C() : S())
354
+ "onClick:action": e[0] || (e[0] = (f) => f === "add" ? C() : S())
340
355
  }, {
341
- title: f(() => [
342
- n("div", $e, [
343
- n("span", Ve, x(t(v)("connect.loyalty.segment.title")), 1),
356
+ title: g(() => [
357
+ a("div", $e, [
358
+ a("span", Ve, x(t(v)("connect.loyalty.segment.title")), 1),
344
359
  l(h, { variant: "premium" })
345
360
  ])
346
361
  ]),
347
362
  _: 1
348
363
  }, 8, ["actions"]),
349
- n("div", Be, [
350
- t(s).length > 0 || t(r).searchValue ? (u(), b(R, { key: 0 }, [
364
+ a("div", Pe, [
365
+ t(s).length > 0 || t(i).searchValue ? (u(), b(I, { key: 0 }, [
351
366
  l(p, {
352
367
  class: "xs:hidden",
353
368
  "row-data": t(s),
@@ -355,34 +370,34 @@ const _e = ae.extend({
355
370
  "search-value": t(F).searchKey,
356
371
  "column-filter": [],
357
372
  "hide-footer": !0,
358
- onRowClick: e[1] || (e[1] = (g) => {
359
- C(g.original);
373
+ onRowClick: e[1] || (e[1] = (f) => {
374
+ C(f.original);
360
375
  })
361
376
  }, null, 8, ["row-data", "search-value"]),
362
377
  l(K, { class: "w-full hidden xs:block" }, {
363
- default: f(() => [
364
- (u(!0), b(R, null, te(t(s), (g) => (u(), P(T, {
365
- key: g._id.toString(),
378
+ default: g(() => [
379
+ (u(!0), b(I, null, te(t(s), (f) => (u(), B(T, {
380
+ key: f._id.toString(),
366
381
  tag: "label",
367
- onClick: (A) => C(g)
382
+ onClick: (U) => C(f)
368
383
  }, {
369
- default: f(() => [
370
- n("div", null, [
371
- n("div", Pe, x((g.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
372
- n("div", De, x(g.name), 1),
373
- n("div", Ye, x(((g.memberCount ?? 0) * 100 / t(i)).toFixed(2)) + "% of customers ", 1)
384
+ default: g(() => [
385
+ a("div", null, [
386
+ a("div", Be, x((f.memberCount ?? 0).toLocaleString()) + " total customers ", 1),
387
+ a("div", De, x(f.name), 1),
388
+ a("div", Ye, x(((f.memberCount ?? 0) * 100 / t(r)).toFixed(2)) + "% of customers ", 1)
374
389
  ])
375
390
  ]),
376
- append: f(() => [
391
+ append: g(() => [
377
392
  l(O, { "stop-click-propagation": !0 }, {
378
- "menu-button": f(() => [
393
+ "menu-button": g(() => [
379
394
  l(M, { name: "more_vert" })
380
395
  ]),
381
- default: f(() => [
396
+ default: g(() => [
382
397
  l(H, {
383
398
  class: "text-fm-color-typo-error fm-typo-en-body-md-400",
384
399
  label: "Remove",
385
- "onUpdate:modelValue": (A) => A && $(g)
400
+ "onUpdate:modelValue": (U) => U && $(f)
386
401
  }, null, 8, ["onUpdate:modelValue"])
387
402
  ]),
388
403
  _: 2
@@ -393,33 +408,33 @@ const _e = ae.extend({
393
408
  ]),
394
409
  _: 1
395
410
  })
396
- ], 64)) : (u(), P(q, {
411
+ ], 64)) : (u(), B(q, {
397
412
  key: 1,
398
413
  variant: "outlined",
399
414
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
400
415
  }, {
401
- default: f(() => [
402
- e[3] || (e[3] = n("img", {
403
- src: ye,
416
+ default: g(() => [
417
+ e[3] || (e[3] = a("img", {
418
+ src: oe,
404
419
  class: "aspect-square w-[150px]"
405
420
  }, null, -1)),
406
- e[4] || (e[4] = n("div", { class: "flex flex-col gap-16 text-center" }, [
407
- n("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
408
- n("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. ")
421
+ e[4] || (e[4] = a("div", { class: "flex flex-col gap-16 text-center" }, [
422
+ a("div", { class: "fm-typo-en-title-sm-800" }, "Create customer segments"),
423
+ a("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. ")
409
424
  ], -1)),
410
425
  l(Z, {
411
426
  variant: "primary",
412
427
  label: "Create segment",
413
428
  disabled: !t(_).isPremium,
414
429
  icon: "add",
415
- onClick: e[2] || (e[2] = (g) => C())
430
+ onClick: e[2] || (e[2] = (f) => C())
416
431
  }, null, 8, ["disabled"])
417
432
  ]),
418
433
  _: 1
419
434
  })),
420
- l(Re, {
435
+ l(Ie, {
421
436
  ref_key: "sheetRef",
422
- ref: o,
437
+ ref: n,
423
438
  "onUpdate:modelValue": Y
424
439
  }, null, 512)
425
440
  ])
@@ -428,5 +443,5 @@ const _e = ae.extend({
428
443
  }
429
444
  });
430
445
  export {
431
- Ae as default
446
+ et as default
432
447
  };