@feedmepos/mf-connect 0.1.12-prod → 0.1.14-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 (82) hide show
  1. package/dist/{Analytic-D_0-S9bm.js → Analytic-MRp7gtO3.js} +9 -9
  2. package/dist/{App-CRUf3Y0S.js → App-BU3B2A-F.js} +6 -6
  3. package/dist/{Broadcast-B0pjSEvx.js → Broadcast-DmciJlSU.js} +38 -37
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-k3T8QO9-.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DJPOgBXj.js} +7 -7
  5. package/dist/{Card-DK6dhPcq.js → Card-Dq2cAgTi.js} +15 -15
  6. package/dist/Collections-B4x4VH1a.js +445 -0
  7. package/dist/{Credit-B2QhAnU7.js → Credit-CVdT1KBU.js} +57 -56
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CWMtJS9Z.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BmjXu-U7.js} +27 -27
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C09W42uh.js → EffectSheet.vue_vue_type_style_index_0_lang-A_uosv-g.js} +6 -6
  10. package/dist/{Experience-4j5Hoeig.js → Experience-CEeXWbue.js} +39 -38
  11. package/dist/{Game-Dvc5v56r.js → Game-mx5c5ZhV.js} +46 -45
  12. package/dist/{Index-vWNoadSH.js → Index-DQ1qadwz.js} +9 -9
  13. package/dist/{Marketing-DkkAcFb4.js → Marketing-CciBZijv.js} +5 -5
  14. package/dist/{Member-CM1b1duv.js → Member-C51SlKxj.js} +4 -4
  15. package/dist/{MemberList-b2Rlocct.js → MemberList-D1x731cU.js} +14 -14
  16. package/dist/{MemberTransactions-Fj2nJ4Ur.js → MemberTransactions-BpoTQHFQ.js} +1 -1
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BZKudA25.js → MessageInput.vue_vue_type_script_setup_true_lang-DZu24zwy.js} +2 -2
  18. package/dist/{Mission-KLaXikD6.js → Mission-LpCnpKYD.js} +35 -34
  19. package/dist/{Overview-BUc3n5O3.js → Overview-DxvOqUao.js} +17 -17
  20. package/dist/{Point-hB9FCAw0.js → Point-BmI7y6h6.js} +51 -50
  21. package/dist/{Promotion-3yLTsHvx.js → Promotion-MHaOqrwu.js} +34 -33
  22. package/dist/{Record-BZlaZcFg.js → Record-75BxMATe.js} +6 -6
  23. package/dist/{Reward-CyO0pKoa.js → Reward-8VfyFuEt.js} +14 -14
  24. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-UYD9G3y0.js → RewardGroup.vue_vue_type_script_setup_true_lang-D12_r-9X.js} +11 -11
  25. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DUKyzpZK.js → RuleGroup.vue_vue_type_script_setup_true_lang-BIdBxvN7.js} +13 -13
  26. package/dist/{Segment-BXV6-vOS.js → Segment-I9FUibZy.js} +13 -13
  27. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-3pUUUAKD.js → SelectItems.vue_vue_type_script_setup_true_lang-BGeR0-AG.js} +2 -2
  28. package/dist/{Setting-CFZdsnpN.js → Setting-B8V2I0EZ.js} +8 -8
  29. package/dist/{Store-7vr-PeY6.js → Store-CQkGNSSm.js} +424 -417
  30. package/dist/{StoreRewards-Cqth7AIJ.js → StoreRewards-DOtjveqw.js} +12 -12
  31. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-D0L5FGVd.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Cf9IsQXS.js} +251 -245
  32. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B79xzd2T.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DPmeW62s.js} +1 -1
  33. package/dist/{Tier-im_GyLWx.js → Tier-DAj_5abZ.js} +19 -19
  34. package/dist/{Title-BhudgeSH.js → Title-DryO4wcO.js} +19 -19
  35. package/dist/{Transaction-CnugRki7.js → Transaction-DpibVFU-.js} +2 -2
  36. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-m-_fdbTx.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DoiPRPPo.js} +6 -6
  37. package/dist/{Voucher-WB5QSvGY.js → Voucher-CSc0_dGX.js} +56 -55
  38. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DK0pDVj1.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DRnVggfC.js} +10 -10
  39. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DWV8fnLD.js → ZodTextField.vue_vue_type_script_setup_true_lang-BzBcsSYS.js} +1 -1
  40. package/dist/{app-C3K2hDWf.js → app-BoQTcBOD.js} +1798 -794
  41. package/dist/{app-NqsHFVEk.js → app-BzPle2EI.js} +1 -1
  42. package/dist/app.js +1 -1
  43. package/dist/{business-CcRzjtxz.js → business-H9a63ymR.js} +1 -1
  44. package/dist/{campaign-B67A_7OK.js → campaign-CR-16mwD.js} +2 -2
  45. package/dist/{campaign.enum-ByK4gMba.js → campaign.enum-DcaetYuk.js} +1 -1
  46. package/dist/{campaign.fn-DzGsXCdF.js → campaign.fn-BqGZqM77.js} +142 -142
  47. package/dist/{collectible.enum-BqASpzzd.js → collectible.enum-YKtiwQbt.js} +1 -1
  48. package/dist/{collection.fn-D2WvxL88.js → collection.fn-CI8lSAsC.js} +2 -2
  49. package/dist/{dto-Dw255bzd.js → dto-BBLfD0Lh.js} +17 -16
  50. package/dist/{effect-BxPu1FzR.js → effect-36H79d0n.js} +1 -1
  51. package/dist/{email-addresses-DcK0Q2zA.js → email-addresses-drrACeqJ.js} +1 -1
  52. package/dist/{export-7jK-Ioe-.js → export-BgnO3lJs.js} +3 -3
  53. package/dist/{helper-lXhemocG.js → helper-CcV9DZXq.js} +1 -1
  54. package/dist/{index-CQL21tjK.js → index-6RqtavHk.js} +9 -7
  55. package/dist/{index-C8XNjc5V.js → index-B5ii6hOh.js} +1 -1
  56. package/dist/{index-1l0_N69H.js → index-BEDXujqZ.js} +1 -1
  57. package/dist/{index-D_uxupsH.js → index-BPbhXWRp.js} +7 -7
  58. package/dist/{index-D42yBguK.js → index-BRTpdfj3.js} +3 -3
  59. package/dist/{index-DG2-DF-P.js → index-CB1CnEOn.js} +1 -1
  60. package/dist/{index-BhchMLq2.js → index-CibFRBGu.js} +2 -2
  61. package/dist/{index-DtMb1Vde.js → index-Cidu1YZP.js} +3 -3
  62. package/dist/{index-D2P6nwsu.js → index-DLAAi9ur.js} +3039 -3036
  63. package/dist/{index-BC2jOmNm.js → index-DydNNBhY.js} +1 -1
  64. package/dist/{index-96KcJ-Wb.js → index-ZycLk3NR.js} +1 -1
  65. package/dist/{index-B9BSm7oO.js → index-mgoYj6L9.js} +1 -1
  66. package/dist/{index.esm2017-D1A8aO1S.js → index.esm2017-QS_XhcBp.js} +1 -1
  67. package/dist/{loading-D2WV28Cg.js → loading-LktVwV5k.js} +4 -4
  68. package/dist/{membership-YYMIuLdo.js → membership-7ETvXph3.js} +3 -3
  69. package/dist/{money-JypeKzEz.js → money-BYszknw8.js} +1 -1
  70. package/dist/{number-B2nrtMri.js → number-Dmd4vT4F.js} +1 -1
  71. package/dist/objectid-BQtSeCVi.js +145 -0
  72. package/dist/{reward-DkpMRLGx.js → reward-DJGOX-D1.js} +1 -1
  73. package/dist/{rule-Bpwn27Yr.js → rule-D7jM4gdg.js} +3 -3
  74. package/dist/{rule-builder-BQ6QcxJ2.js → rule-builder-FO9UeYUJ.js} +1 -1
  75. package/dist/{template-C-b_3Q0G.js → template-C4Ddrpk1.js} +4 -4
  76. package/dist/{trigger-DE5iEB5A.js → trigger-w7Q4qOMB.js} +4 -4
  77. package/dist/{usePagination-C_YZGKWk.js → usePagination-PH1OvyZM.js} +1 -1
  78. package/dist/{user-VhJqEOJm.js → user-DRPXRVy2.js} +1 -1
  79. package/dist/{vue-i18n-BfBJ65t0.js → vue-i18n-B49HKiTU.js} +169 -169
  80. package/package.json +6 -6
  81. package/dist/Collections-C7dc9NQd.js +0 -435
  82. package/dist/objectid-9TjXs_6J.js +0 -145
@@ -0,0 +1,445 @@
1
+ var oe = Object.defineProperty;
2
+ var te = (g, u, c) => u in g ? oe(g, u, { enumerable: !0, configurable: !0, writable: !0, value: c }) : g[u] = c;
3
+ var O = (g, u, c) => te(g, typeof u != "symbol" ? u + "" : u, c);
4
+ import { defineComponent as H, ref as f, computed as J, watch as K, resolveComponent as d, openBlock as h, createBlock as T, unref as o, isRef as j, withCtx as I, createElementVNode as C, createVNode as r, createElementBlock as R, Fragment as P, renderList as ae, createCommentVNode as U, onMounted as le, h as z } from "vue";
5
+ import { h as G } from "./moment-BWErdI6_.js";
6
+ import { components as ne } from "@feedmepos/ui-library";
7
+ import { u as Q, a as se } from "./loading-LktVwV5k.js";
8
+ import { J as re } from "./JsonViewer-v8_C7l5N.js";
9
+ import { u as ie } from "./app-wDQR6dpb.js";
10
+ import { useRoute as W, useRouter as ue } from "vue-router";
11
+ import { c as N } from "./index-B5ii6hOh.js";
12
+ import { e as p } from "./index-vh86FiIQ.js";
13
+ import { u as Y, a as de, _ as ce, w as me } from "./usePagination-PH1OvyZM.js";
14
+ import { g as pe } from "./user-DRPXRVy2.js";
15
+ import { m as fe } from "./index-DydNNBhY.js";
16
+ import { o as ge } from "./objectId-dwaoBfJX.js";
17
+ const be = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1), Ce = { class: "space-y-16" }, ve = /* @__PURE__ */ C("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1), he = { class: "gap-16 grid grid-cols-2" }, ye = { class: "flex items-center gap-8" }, xe = /* @__PURE__ */ H({
18
+ __name: "CreateCollectionSheet",
19
+ emits: ["success"],
20
+ setup(g, { expose: u, emit: c }) {
21
+ const { minor: S } = Q, w = W(), F = f(), k = f(!1), q = c, b = f(!1);
22
+ function D(s) {
23
+ b.value = s, s && (a.value = {
24
+ quantity: 1,
25
+ code: "",
26
+ codeConfig: {
27
+ length: 8,
28
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
29
+ prefix: "",
30
+ suffix: "",
31
+ pattern: "########"
32
+ }
33
+ });
34
+ }
35
+ const a = f({
36
+ quantity: 1,
37
+ code: "",
38
+ codeConfig: {
39
+ length: 8,
40
+ charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
41
+ prefix: "",
42
+ suffix: "",
43
+ pattern: "########"
44
+ }
45
+ }), E = [
46
+ {
47
+ label: "Bulk codes",
48
+ value: "bulk",
49
+ sublabel: "Bulk generate unique codes"
50
+ },
51
+ {
52
+ label: "Custom code",
53
+ value: "single",
54
+ sublabel: "Enter your own custom codes"
55
+ }
56
+ ], B = [
57
+ {
58
+ label: "Alphanumeric",
59
+ value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
60
+ },
61
+ {
62
+ label: "Alphabetic",
63
+ value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
64
+ },
65
+ { label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
66
+ { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
67
+ { label: "Numbers", value: "0123456789" },
68
+ { label: "Custom", value: "" }
69
+ ], v = f(B[0].value), m = f("bulk"), y = f(!1), A = J(() => w.params.id);
70
+ async function n(s) {
71
+ var e;
72
+ await ((e = F.value) == null ? void 0 : e.validateInputs()), k.value && await S(
73
+ async () => {
74
+ await N.createCollectionByCampaignId(A.value, s), await q("success");
75
+ },
76
+ {
77
+ message: "Creating claim(s)",
78
+ successMessage: "Claim(s) created"
79
+ }
80
+ );
81
+ }
82
+ u({
83
+ showSheet: D
84
+ }), K(
85
+ () => m.value,
86
+ (s, e) => {
87
+ e != s && (a.value.code = "", a.value.codeConfig.length = 8, a.value.codeConfig.charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", a.value.codeConfig.prefix = "", a.value.codeConfig.suffix = "", a.value.codeConfig.pattern = "########");
88
+ }
89
+ );
90
+ function l(s) {
91
+ if (m.value !== "single") return !1;
92
+ const e = s.split(`
93
+ `).map((i) => i.trim()).filter(Boolean);
94
+ return new Set(e).size !== e.length;
95
+ }
96
+ return K(
97
+ () => a.value.codeConfig.length,
98
+ (s, e) => {
99
+ s != e && (a.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(s))));
100
+ }
101
+ ), (s, e) => {
102
+ const i = d("FmRadio"), x = d("FmRadioGroup"), M = d("FmSwitch"), V = d("FmStepperField"), L = d("FmSelect"), _ = d("FmTextField"), X = d("FmTextarea"), Z = d("FmForm"), $ = d("FmButton"), ee = d("FmSideSheet");
103
+ return h(), T(ee, {
104
+ "max-width": 560,
105
+ "dismiss-away": !0,
106
+ header: "Create collection",
107
+ modelValue: o(b),
108
+ "onUpdate:modelValue": [
109
+ e[14] || (e[14] = (t) => j(b) ? b.value = t : null),
110
+ e[15] || (e[15] = (t) => b.value = t)
111
+ ]
112
+ }, {
113
+ "side-sheet-footer": I(() => [
114
+ C("div", ye, [
115
+ r($, {
116
+ label: "Save",
117
+ onClick: e[12] || (e[12] = (t) => n(o(a))),
118
+ loading: o(ie)().isLoading
119
+ }, null, 8, ["loading"]),
120
+ r($, {
121
+ label: "Cancel",
122
+ type: "button",
123
+ variant: "tertiary",
124
+ onClick: e[13] || (e[13] = (t) => b.value = !1)
125
+ })
126
+ ])
127
+ ]),
128
+ default: I(() => [
129
+ r(re, { json: o(a) }, null, 8, ["json"]),
130
+ r(Z, {
131
+ ref_key: "form",
132
+ ref: F,
133
+ class: "space-y-40",
134
+ onValidationSuccess: e[10] || (e[10] = (t) => k.value = !0),
135
+ onValidationFailed: e[11] || (e[11] = (t) => k.value = !1)
136
+ }, {
137
+ default: I(() => [
138
+ C("div", null, [
139
+ be,
140
+ r(x, {
141
+ modelValue: o(m),
142
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => j(m) ? m.value = t : null),
143
+ inline: !1
144
+ }, {
145
+ default: I(() => [
146
+ (h(), R(P, null, ae(E, (t) => r(i, {
147
+ key: t.value,
148
+ value: t.value,
149
+ label: t.label,
150
+ sublabel: t.sublabel
151
+ }, null, 8, ["value", "label", "sublabel"])), 64))
152
+ ]),
153
+ _: 1
154
+ }, 8, ["modelValue"])
155
+ ]),
156
+ C("div", Ce, [
157
+ ve,
158
+ o(m) === "bulk" ? (h(), R(P, { key: 0 }, [
159
+ r(M, {
160
+ "model-value": o(y),
161
+ "label-placement": "right",
162
+ value: "true",
163
+ label: "Advance code setting",
164
+ required: !0,
165
+ "onUpdate:modelValue": e[1] || (e[1] = () => y.value = !o(y))
166
+ }, null, 8, ["model-value"]),
167
+ o(y) ? (h(), R(P, { key: 0 }, [
168
+ r(V, {
169
+ modelValue: o(a).codeConfig.length,
170
+ "onUpdate:modelValue": e[2] || (e[2] = (t) => o(a).codeConfig.length = t),
171
+ label: "Code length",
172
+ max: 16,
173
+ min: 1,
174
+ rules: [
175
+ (t) => Number(t) >= 1 || "Code length must at least 1",
176
+ (t) => Number(t) <= 16 || "Code length must less than 16"
177
+ ],
178
+ required: !0
179
+ }, null, 8, ["modelValue", "rules"]),
180
+ r(L, {
181
+ label: "Charset",
182
+ "model-value": o(v),
183
+ items: B,
184
+ "helper-text": o(a).codeConfig.charset.length > 62 ? `${o(a).codeConfig.charset.substring(0, 62)}...` : o(a).codeConfig.charset,
185
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => {
186
+ v.value = t, o(a).codeConfig.charset = t;
187
+ })
188
+ }, null, 8, ["model-value", "helper-text"]),
189
+ o(v) === "" ? (h(), T(_, {
190
+ key: 0,
191
+ modelValue: o(a).codeConfig.charset,
192
+ "onUpdate:modelValue": e[4] || (e[4] = (t) => o(a).codeConfig.charset = t),
193
+ label: "Custom Charset",
194
+ required: ""
195
+ }, null, 8, ["modelValue"])) : U("", !0),
196
+ C("div", he, [
197
+ r(_, {
198
+ modelValue: o(a).codeConfig.prefix,
199
+ "onUpdate:modelValue": e[5] || (e[5] = (t) => o(a).codeConfig.prefix = t),
200
+ label: "Prefix (Optional)"
201
+ }, null, 8, ["modelValue"]),
202
+ r(_, {
203
+ modelValue: o(a).codeConfig.suffix,
204
+ "onUpdate:modelValue": e[6] || (e[6] = (t) => o(a).codeConfig.suffix = t),
205
+ label: "Suffix (Optional)"
206
+ }, null, 8, ["modelValue"])
207
+ ]),
208
+ r(_, {
209
+ modelValue: o(a).codeConfig.pattern,
210
+ "onUpdate:modelValue": e[7] || (e[7] = (t) => o(a).codeConfig.pattern = t),
211
+ label: "Pattern",
212
+ required: !0
213
+ }, null, 8, ["modelValue"])
214
+ ], 64)) : U("", !0),
215
+ r(_, {
216
+ modelValue: o(a).quantity,
217
+ "onUpdate:modelValue": e[8] || (e[8] = (t) => o(a).quantity = t),
218
+ label: "Number of code",
219
+ rules: [
220
+ (t) => t >= 1 || "Quantity cannot be less than 1",
221
+ (t) => t <= 1e4 || "Quantity cannot more than 10,000"
222
+ ],
223
+ required: !0,
224
+ "helper-text": `${o(a).quantity} claim will be created`
225
+ }, null, 8, ["modelValue", "rules", "helper-text"])
226
+ ], 64)) : U("", !0),
227
+ o(m) !== "bulk" ? (h(), T(X, {
228
+ key: 1,
229
+ modelValue: o(a).code,
230
+ "onUpdate:modelValue": e[9] || (e[9] = (t) => o(a).code = t),
231
+ label: "Custom Code",
232
+ rules: [
233
+ (t) => o(m) != "single" || !!t || "Custom code is required",
234
+ (t) => !l(t) || "Custom code must be unique"
235
+ ],
236
+ placeholder: "(For multiple codes, please enter in the new row.)"
237
+ }, null, 8, ["modelValue", "rules"])) : U("", !0)
238
+ ])
239
+ ]),
240
+ _: 1
241
+ }, 512)
242
+ ]),
243
+ _: 1
244
+ }, 8, ["modelValue"]);
245
+ };
246
+ }
247
+ });
248
+ class Ve {
249
+ constructor() {
250
+ O(this, "data", []);
251
+ }
252
+ addRecord(u) {
253
+ this.data.push(u);
254
+ }
255
+ buildExcel() {
256
+ const u = Y.book_new(), c = Y.json_to_sheet(this.data);
257
+ return Y.book_append_sheet(u, c, "Collection"), u;
258
+ }
259
+ }
260
+ const Se = { class: "px-24 flex flex-col gap-y-32 pb-24" }, we = { class: "flex items-center justify-end py-4 xs:hidden" }, Le = /* @__PURE__ */ H({
261
+ __name: "Collections",
262
+ setup(g) {
263
+ const u = ue(), c = W(), S = f(), w = J(() => c.params.id), F = f(!1), { custom: k } = Q, q = [
264
+ {
265
+ header: "ID/Code",
266
+ accessorKey: "_id",
267
+ cell(n) {
268
+ return z("div", { class: "flex items-center" }, [
269
+ z(ne.FmIcon, {
270
+ name: "content_copy",
271
+ outline: !0,
272
+ size: "sm",
273
+ class: "cursor-pointer mr-4",
274
+ onClick: (l) => {
275
+ l.preventDefault(), l.stopPropagation(), se(
276
+ n.row.original.code || n.row.original._id.toString()
277
+ );
278
+ }
279
+ }),
280
+ z(
281
+ "div",
282
+ { class: "pr-2 text-ellipsis overflow-hidden" },
283
+ n.row.original.code || n.row.original._id.toString()
284
+ )
285
+ ]);
286
+ }
287
+ },
288
+ {
289
+ header: "User",
290
+ accessorKey: "user",
291
+ enableSorting: !1,
292
+ cell(n) {
293
+ const l = n.row.original.pf_user;
294
+ return pe(l);
295
+ }
296
+ },
297
+ {
298
+ header: "Phone",
299
+ accessorFn: (n) => {
300
+ var l;
301
+ return ((l = n.pf_user) == null ? void 0 : l.phoneNumber) || "-";
302
+ },
303
+ accessorKey: "pf_user.phoneNumber"
304
+ },
305
+ {
306
+ header: "Balance",
307
+ accessorKey: "balance"
308
+ },
309
+ {
310
+ header: "Created at",
311
+ accessorKey: "_id",
312
+ accessorFn: (n) => G(ge(n._id.toString())).format("DD MMM YYYY")
313
+ },
314
+ {
315
+ header: "Nearest expired at",
316
+ accessorKey: "expiryBalance",
317
+ accessorFn: (n) => {
318
+ var l;
319
+ return n.expiryBalance && n.expiryBalance.length ? G((l = n.expiryBalance) == null ? void 0 : l[0].expiredAt).format("DD MMM YYYY") : "Never expires";
320
+ }
321
+ }
322
+ ], b = {
323
+ "$connect-STORE_REWARD_COLLECTIONS": fe.readCollectionsByRewardId,
324
+ "$connect-CAMPAIGN_VOUCHER_COLLECTIONS": N.readCollectionsByCampaignId
325
+ }, D = (n) => {
326
+ const l = b[c.name];
327
+ return (s) => l(n, s);
328
+ }, { tableMeta: a, rowData: E, onSort: B, debouncedFetchData: v, onSearch: m } = de(D(w.value));
329
+ async function y() {
330
+ var n;
331
+ await v(), (n = S.value) == null || n.showSheet(!1);
332
+ }
333
+ async function A() {
334
+ F.value || k(
335
+ async () => {
336
+ var e;
337
+ const n = new Ve(), l = (await N.readCollectionsByCampaignId(w.value, {
338
+ limit: 1,
339
+ skip: 0,
340
+ sortBy: p.sortBy,
341
+ descending: p.descending
342
+ })).meta.totalResources ?? 0, s = p.rowsPerPage;
343
+ for (let i = 0; i < l; i += s) {
344
+ const x = {
345
+ ...p,
346
+ limit: s,
347
+ skip: (p.page - 1) * p.rowsPerPage,
348
+ sortBy: p.sortBy,
349
+ descending: p.descending
350
+ }, M = await N.readCollectionsByCampaignId(
351
+ w.value,
352
+ x
353
+ );
354
+ for await (const V of M.resources) {
355
+ const L = {
356
+ Id: (V == null ? void 0 : V.code) || ((e = V._id) == null ? void 0 : e.toString()) || ""
357
+ };
358
+ n.addRecord(L);
359
+ }
360
+ p.page++;
361
+ }
362
+ await me(
363
+ n.buildExcel(),
364
+ `members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
365
+ {
366
+ bookType: "xlsx",
367
+ bookSST: !1,
368
+ type: "array"
369
+ }
370
+ ), p.page = 1;
371
+ },
372
+ {
373
+ isLoading: F
374
+ }
375
+ );
376
+ }
377
+ return le(async () => {
378
+ await v();
379
+ }), (n, l) => {
380
+ const s = d("FmPageHead"), e = d("FmSearch");
381
+ return h(), R(P, null, [
382
+ r(s, {
383
+ title: "Collections",
384
+ "back-button": !0,
385
+ actions: [
386
+ { label: "Export", value: "export", isPrimary: !1 },
387
+ {
388
+ label: "Create collection",
389
+ value: "create",
390
+ isPrimary: !0
391
+ }
392
+ ],
393
+ "onClick:back": l[0] || (l[0] = (i) => o(u).back()),
394
+ "onClick:action": l[1] || (l[1] = (i) => {
395
+ var x;
396
+ i === "create" && ((x = o(S)) == null || x.showSheet(!0)), i === "export" && A();
397
+ })
398
+ }),
399
+ C("div", Se, [
400
+ r(e, {
401
+ class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
402
+ modelValue: o(a).searchValue,
403
+ "onUpdate:modelValue": [
404
+ l[2] || (l[2] = (i) => o(a).searchValue = i),
405
+ o(m)
406
+ ],
407
+ placeholder: "Search",
408
+ collapsible: ""
409
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
410
+ C("div", we, [
411
+ r(e, {
412
+ modelValue: o(a).searchValue,
413
+ "onUpdate:modelValue": [
414
+ l[3] || (l[3] = (i) => o(a).searchValue = i),
415
+ o(m)
416
+ ],
417
+ placeholder: "Search",
418
+ collapsible: ""
419
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
420
+ ]),
421
+ r(ce, {
422
+ loading: o(a).isLoading,
423
+ "row-data": o(E),
424
+ "column-defs": q,
425
+ "row-count": o(a).totalRows,
426
+ "page-count": o(a).pageCount,
427
+ "page-index": o(a).pageIndex,
428
+ "page-size": o(a).pageSize,
429
+ "shrink-at": !1,
430
+ onSortChange: o(B),
431
+ onPageChange: l[4] || (l[4] = (i) => o(v)({ pageSize: i.pageSize, pageIndex: i.pageIndex }))
432
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
433
+ r(xe, {
434
+ ref_key: "sheetRef",
435
+ ref: S,
436
+ onSuccess: y
437
+ }, null, 512)
438
+ ])
439
+ ], 64);
440
+ };
441
+ }
442
+ });
443
+ export {
444
+ Le as default
445
+ };