@feedmepos/mf-connect 0.1.57-prod → 0.1.58-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 (128) hide show
  1. package/package.json +1 -1
  2. package/dist/Analytic-BqvhYgCU.js +0 -427
  3. package/dist/App-Dtl_D0cH.js +0 -4630
  4. package/dist/Bin-y4ikpgPS.js +0 -166
  5. package/dist/Broadcast-DSROFwe4.js +0 -233
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CcsG6vOP.js +0 -121
  7. package/dist/Card-BiSEPsZb.js +0 -911
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-CX-nN7Xj.js +0 -458
  10. package/dist/Credit-IiV9b4cB.js +0 -228
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CoGes8YL.js +0 -2194
  13. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-sGh_SMCH.js +0 -348
  14. package/dist/Experience-Cf-EMhKy.js +0 -229
  15. package/dist/FileSaver.min-NlMItPOc.js +0 -74
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  17. package/dist/Game-C8mfJn6W.js +0 -284
  18. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +0 -144
  19. package/dist/Index-DkvO1AoT.js +0 -259
  20. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  21. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
  22. package/dist/MainLayout-B1aJoR95.js +0 -41
  23. package/dist/Marketing-xJTIo3RF.js +0 -319
  24. package/dist/Member-DZkYoKW8.js +0 -279
  25. package/dist/MemberList-CAYEJnf3.js +0 -1607
  26. package/dist/MemberOverview-wL_ailso.js +0 -58
  27. package/dist/MemberTransactions-Dc5aAQ69.js +0 -45
  28. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BSvlPzw8.js +0 -60553
  29. package/dist/Mission-C_NbNWZw.js +0 -302
  30. package/dist/Overview-DyxEwEfe.js +0 -1079
  31. package/dist/Point-CsEWk61V.js +0 -232
  32. package/dist/Promotion--pWgy9Dx.js +0 -289
  33. package/dist/Queue-k3qAQR7B.js +0 -260
  34. package/dist/Record-D5F5JyVA.js +0 -341
  35. package/dist/Reward-3FSrq5mX.js +0 -442
  36. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Dzj7a7UY.js +0 -150
  37. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DRl_Gjfx.js +0 -1763
  38. package/dist/Segment-BWJn6ODR.js +0 -882
  39. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BKsV_zcr.js +0 -181
  40. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-C3efGNC_.js +0 -188
  41. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cj7c2V3h.js +0 -147
  42. package/dist/Setting-UiTXazZV.js +0 -1936
  43. package/dist/Store-BrvmHPCX.js +0 -1842
  44. package/dist/StoreRewards-D_7fr-Ef.js +0 -423
  45. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BXy0L5AH.js +0 -995
  46. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DumcDlBs.js +0 -139
  47. package/dist/Tier-C4wvx8F7.js +0 -895
  48. package/dist/Title-CPHT85Uj.js +0 -566
  49. package/dist/Transaction-6Ig2W00P.js +0 -39
  50. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DknFkIJh.js +0 -130
  51. package/dist/Voucher-Bbl-7gZ5.js +0 -384
  52. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-xsswRZG8.js +0 -419
  53. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B5J6Hd8G.js +0 -56
  54. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  55. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  56. package/dist/app-BDVZwARN.js +0 -7057
  57. package/dist/app-CAEhNFRG.js +0 -57962
  58. package/dist/app-wDQR6dpb.js +0 -39
  59. package/dist/app.js +0 -6
  60. package/dist/business-6C_ol5wd.js +0 -82
  61. package/dist/campaign-B13G6pZ3.js +0 -1810
  62. package/dist/campaign-CpzFl8Vr.js +0 -4
  63. package/dist/campaign-DrQp6qBu.js +0 -94
  64. package/dist/campaign.enum-DnTrlaNC.js +0 -20
  65. package/dist/campaign.fn-BZse90_k.js +0 -758
  66. package/dist/collectible.enum-633Me0yR.js +0 -19
  67. package/dist/collection.fn-C96855j5.js +0 -26
  68. package/dist/dto-2bMujqmZ.js +0 -216
  69. package/dist/effect-C7lAJwKh.js +0 -78
  70. package/dist/email-addresses-3ayN-9jv.js +0 -705
  71. package/dist/export-BNbDV7SC.js +0 -97
  72. package/dist/feedme.ico +0 -0
  73. package/dist/helper-CsfZ__dQ.js +0 -71
  74. package/dist/index-BLSAz0gK.js +0 -32
  75. package/dist/index-BY9I3Cer.js +0 -3
  76. package/dist/index-BdnRNcVO.js +0 -146
  77. package/dist/index-BmyNfpfG.js +0 -30076
  78. package/dist/index-CSBRkhKy.js +0 -38
  79. package/dist/index-Cf_fcvoS.js +0 -54
  80. package/dist/index-CqrO13uj.js +0 -76
  81. package/dist/index-CuvNtC_M.js +0 -61
  82. package/dist/index-D4kdSzs9.js +0 -3070
  83. package/dist/index-DcJq7tl4.js +0 -32269
  84. package/dist/index-DdjSIwSL.js +0 -44
  85. package/dist/index-LKr2k8J2.js +0 -8861
  86. package/dist/index-XAxwm-1v.js +0 -2130
  87. package/dist/index-b82LrGSB.js +0 -121
  88. package/dist/index-tcAb0W5F.js +0 -31
  89. package/dist/index-vh86FiIQ.js +0 -10
  90. package/dist/index.esm2017-BklqmujQ.js +0 -3069
  91. package/dist/loading-OXARGiqO.js +0 -71
  92. package/dist/lodash-B5I3zXaY.js +0 -3678
  93. package/dist/membership-D1Vb1rUo.js +0 -235
  94. package/dist/moment-D7p2TMB-.js +0 -2583
  95. package/dist/money-BpyAytEq.js +0 -15
  96. package/dist/number-C-PtPOOj.js +0 -12
  97. package/dist/object-qECH92oz.js +0 -26
  98. package/dist/objectId-dwaoBfJX.js +0 -7
  99. package/dist/objectid-BrLIKTmQ.js +0 -145
  100. package/dist/plugins-CjPWhNb2.js +0 -208
  101. package/dist/reward-DonQFzvW.js +0 -36
  102. package/dist/rule-AtNPBnbE.js +0 -1951
  103. package/dist/rule-builder-C0Q-3g6T.js +0 -102
  104. package/dist/style.css +0 -4
  105. package/dist/template-CNjE7eht.js +0 -190
  106. package/dist/tier-BJDhpH6X.js +0 -4
  107. package/dist/tiers/tier=1.png +0 -0
  108. package/dist/tiers/tier=2.png +0 -0
  109. package/dist/tiers/tier=3.png +0 -0
  110. package/dist/tiers/tier=4.png +0 -0
  111. package/dist/timezone-CYbdI3q2.js +0 -1151
  112. package/dist/titles/type=diamond.png +0 -0
  113. package/dist/titles/type=drinks.png +0 -0
  114. package/dist/titles/type=food.png +0 -0
  115. package/dist/titles/type=heart.png +0 -0
  116. package/dist/titles/type=medal.png +0 -0
  117. package/dist/titles/type=spend.png +0 -0
  118. package/dist/titles/type=thank-you.png +0 -0
  119. package/dist/titles/type=thumbs-up.png +0 -0
  120. package/dist/titles/type=years.png +0 -0
  121. package/dist/trigger-Bdi6n80h.js +0 -144
  122. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  123. package/dist/type_drinks-D6jnpvwV.js +0 -4
  124. package/dist/usePagination-Ds-cuHop.js +0 -223
  125. package/dist/user-BwGm78n8.js +0 -54
  126. package/dist/vue-i18n-D1nTd69a.js +0 -2365
  127. package/dist/xlsx-DF5iW3wh.js +0 -15491
  128. package/dist/zod-Bg2FbC-D.js +0 -90
@@ -1,97 +0,0 @@
1
- import { defineComponent as C, ref as F, computed as g, resolveComponent as s, openBlock as u, createBlock as m, unref as d, withCtx as c, createVNode as p, normalizeClass as i, createCommentVNode as V, createElementVNode as k, toDisplayString as b, renderSlot as q, createElementBlock as S, Fragment as I, renderList as M } from "vue";
2
- const B = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, z = /* @__PURE__ */ C({
3
- __name: "ChipMenu",
4
- props: {
5
- modelValue: {
6
- type: Object,
7
- required: !1
8
- },
9
- label: {
10
- type: String,
11
- required: !0
12
- },
13
- showItemLabel: {
14
- type: Boolean,
15
- default: !1
16
- },
17
- placement: {
18
- type: String,
19
- required: !1,
20
- default: "bottom-end"
21
- },
22
- class: {
23
- type: String,
24
- required: !1
25
- },
26
- disabled: {
27
- type: Boolean,
28
- required: !1
29
- },
30
- items: {
31
- type: Array,
32
- required: !1
33
- },
34
- icon: {
35
- type: String,
36
- required: !1
37
- }
38
- },
39
- emits: ["update:model-value"],
40
- setup(a, { emit: f }) {
41
- const e = a, v = f, r = F(!1), y = g(
42
- () => {
43
- var n, t;
44
- return (t = (n = e.items) == null ? void 0 : n.find((o) => o.value === e.modelValue)) == null ? void 0 : t.label;
45
- }
46
- );
47
- return (n, t) => {
48
- const o = s("FmIcon"), _ = s("FmChip"), h = s("FmMenuItem"), w = s("FmMenu");
49
- return u(), m(w, {
50
- placement: a.placement || "bottom-end",
51
- disabled: a.disabled == !0,
52
- "model-value": d(r),
53
- onMenuChanged: t[0] || (t[0] = (l) => r.value = l)
54
- }, {
55
- "menu-button": c(() => [
56
- p(_, {
57
- label: e.label,
58
- class: i(e.class || "text-fm-color-neutral-gray-400 cursor-pointer")
59
- }, {
60
- default: c(() => [
61
- e.icon ? (u(), m(o, {
62
- key: 0,
63
- name: e.icon,
64
- class: i(e.class),
65
- outline: "",
66
- size: "sm"
67
- }, null, 8, ["name", "class"])) : V("", !0),
68
- k("div", B, b(e.label) + " " + b(a.showItemLabel ? d(y) : ""), 1),
69
- p(o, {
70
- name: d(r) ? "keyboard_arrow_up" : "keyboard_arrow_down",
71
- class: i(e.class),
72
- outline: "",
73
- size: "sm"
74
- }, null, 8, ["name", "class"])
75
- ]),
76
- _: 1
77
- }, 8, ["label", "class"])
78
- ]),
79
- default: c(() => [
80
- q(n.$slots, "default", {}, () => [
81
- (u(!0), S(I, null, M(e.items ?? [], (l) => (u(), m(h, {
82
- key: l.value,
83
- value: l.value,
84
- label: l.label,
85
- "model-value": e.modelValue === l.value,
86
- "onUpdate:modelValue": (x) => v("update:model-value", l.value)
87
- }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
88
- ])
89
- ]),
90
- _: 3
91
- }, 8, ["placement", "disabled", "model-value"]);
92
- };
93
- }
94
- });
95
- export {
96
- z as _
97
- };
@@ -1,458 +0,0 @@
1
- var te = Object.defineProperty;
2
- var ae = (g, i, d) => i in g ? te(g, i, { enumerable: !0, configurable: !0, writable: !0, value: d }) : g[i] = d;
3
- var K = (g, i, d) => ae(g, typeof i != "symbol" ? i + "" : i, d);
4
- import { defineComponent as H, ref as f, computed as J, watch as T, resolveComponent as u, openBlock as x, createBlock as z, unref as o, isRef as j, withCtx as I, createElementVNode as h, createVNode as r, createElementBlock as R, Fragment as N, renderList as le, createCommentVNode as U, onMounted as ne, h as Y } from "vue";
5
- import { h as G } from "./moment-D7p2TMB-.js";
6
- import { components as se } from "@feedmepos/ui-library";
7
- import "./index-DcJq7tl4.js";
8
- import { J as re } from "./JsonViewer-v8_C7l5N.js";
9
- import { u as Q } from "./loading-OXARGiqO.js";
10
- import { u as ie } from "./app-wDQR6dpb.js";
11
- import { useRoute as W, useRouter as ue } from "vue-router";
12
- import { c as P } from "./index-b82LrGSB.js";
13
- import { e as p } from "./index-vh86FiIQ.js";
14
- import { u as $, w as de } from "./xlsx-DF5iW3wh.js";
15
- import { g as ce } from "./user-BwGm78n8.js";
16
- import { u as me, _ as pe } from "./usePagination-Ds-cuHop.js";
17
- import { a as fe } from "./plugins-CjPWhNb2.js";
18
- import { m as ge } from "./index-BdnRNcVO.js";
19
- import { o as Ce } from "./objectId-dwaoBfJX.js";
20
- const be = { class: "space-y-16" }, ve = { class: "gap-16 grid grid-cols-2" }, he = { class: "flex items-center gap-8" }, ye = /* @__PURE__ */ H({
21
- __name: "CreateCollectionSheet",
22
- emits: ["success"],
23
- setup(g, { expose: i, emit: d }) {
24
- const { minor: S } = Q, w = W(), F = f(), k = f(!1), q = d, C = f(!1);
25
- function D(s) {
26
- C.value = s, s && (a.value = {
27
- quantity: 1,
28
- code: "",
29
- codeConfig: {
30
- length: 8,
31
- charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
32
- prefix: "",
33
- suffix: "",
34
- pattern: "########"
35
- }
36
- });
37
- }
38
- const a = f({
39
- quantity: 1,
40
- code: "",
41
- codeConfig: {
42
- length: 8,
43
- charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
44
- prefix: "",
45
- suffix: "",
46
- pattern: "########"
47
- }
48
- }), E = [
49
- {
50
- label: "Bulk codes",
51
- value: "bulk",
52
- sublabel: "Bulk generate unique codes"
53
- },
54
- {
55
- label: "Custom code",
56
- value: "single",
57
- sublabel: "Enter your own custom codes"
58
- }
59
- ], B = [
60
- {
61
- label: "Alphanumeric",
62
- value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
63
- },
64
- {
65
- label: "Alphabetic",
66
- value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
67
- },
68
- { label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
69
- { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
70
- { label: "Numbers", value: "0123456789" },
71
- { label: "Custom", value: "" }
72
- ], y = f(B[0].value), c = f("bulk"), V = f(!1), A = J(() => w.params.id);
73
- async function n(s) {
74
- var e;
75
- await ((e = F.value) == null ? void 0 : e.validateInputs()), k.value && await S(
76
- async () => {
77
- await P.createCollectionByCampaignId(A.value, s), await q("success");
78
- },
79
- {
80
- message: "Creating claim(s)",
81
- successMessage: "Claim(s) created"
82
- }
83
- );
84
- }
85
- i({
86
- showSheet: D
87
- }), T(
88
- () => c.value,
89
- (s, e) => {
90
- 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 = "########");
91
- }
92
- );
93
- function l(s) {
94
- if (c.value !== "single") return !1;
95
- const e = s.split(`
96
- `).map((v) => v.trim()).filter(Boolean);
97
- return new Set(e).size !== e.length;
98
- }
99
- function b(s) {
100
- return /[ \t]/.test(s);
101
- }
102
- return T(
103
- () => a.value.codeConfig.length,
104
- (s, e) => {
105
- s != e && (a.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(s))));
106
- }
107
- ), T(
108
- () => a.value.codeConfig.pattern,
109
- (s, e) => {
110
- s != e && (a.value.codeConfig.length = (a.value.codeConfig.pattern.match(/#/g) || []).length);
111
- }
112
- ), (s, e) => {
113
- const v = u("FmRadio"), M = u("FmRadioGroup"), m = u("FmSwitch"), L = u("FmStepperField"), X = u("FmSelect"), _ = u("FmTextField"), Z = u("FmTextarea"), ee = u("FmForm"), O = u("FmButton"), oe = u("FmSideSheet");
114
- return x(), z(oe, {
115
- "max-width": 560,
116
- "dismiss-away": !0,
117
- header: "Create collection",
118
- modelValue: o(C),
119
- "onUpdate:modelValue": [
120
- e[14] || (e[14] = (t) => j(C) ? C.value = t : null),
121
- e[15] || (e[15] = (t) => C.value = t)
122
- ]
123
- }, {
124
- "side-sheet-footer": I(() => [
125
- h("div", he, [
126
- r(O, {
127
- label: "Save",
128
- onClick: e[12] || (e[12] = (t) => n(o(a))),
129
- loading: o(ie)().isLoading
130
- }, null, 8, ["loading"]),
131
- r(O, {
132
- label: "Cancel",
133
- type: "button",
134
- variant: "tertiary",
135
- onClick: e[13] || (e[13] = (t) => C.value = !1)
136
- })
137
- ])
138
- ]),
139
- default: I(() => [
140
- r(re, { json: o(a) }, null, 8, ["json"]),
141
- r(ee, {
142
- ref_key: "form",
143
- ref: F,
144
- class: "space-y-40",
145
- onValidationSuccess: e[10] || (e[10] = (t) => k.value = !0),
146
- onValidationFailed: e[11] || (e[11] = (t) => k.value = !1)
147
- }, {
148
- default: I(() => [
149
- h("div", null, [
150
- e[16] || (e[16] = h("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
151
- r(M, {
152
- modelValue: o(c),
153
- "onUpdate:modelValue": e[0] || (e[0] = (t) => j(c) ? c.value = t : null),
154
- inline: !1
155
- }, {
156
- default: I(() => [
157
- (x(), R(N, null, le(E, (t) => r(v, {
158
- key: t.value,
159
- value: t.value,
160
- label: t.label,
161
- sublabel: t.sublabel
162
- }, null, 8, ["value", "label", "sublabel"])), 64))
163
- ]),
164
- _: 1
165
- }, 8, ["modelValue"])
166
- ]),
167
- h("div", be, [
168
- e[17] || (e[17] = h("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
169
- o(c) === "bulk" ? (x(), R(N, { key: 0 }, [
170
- r(m, {
171
- "model-value": o(V),
172
- "label-placement": "right",
173
- value: "true",
174
- label: "Advance code setting",
175
- required: !0,
176
- "onUpdate:modelValue": e[1] || (e[1] = () => V.value = !o(V))
177
- }, null, 8, ["model-value"]),
178
- o(V) ? (x(), R(N, { key: 0 }, [
179
- r(L, {
180
- modelValue: o(a).codeConfig.length,
181
- "onUpdate:modelValue": e[2] || (e[2] = (t) => o(a).codeConfig.length = t),
182
- label: "Code length",
183
- max: 16,
184
- min: 1,
185
- rules: [
186
- (t) => Number(t) >= 1 || "Code length must at least 1",
187
- (t) => Number(t) <= 16 || "Code length must less than 16"
188
- ],
189
- required: !0
190
- }, null, 8, ["modelValue", "rules"]),
191
- r(X, {
192
- label: "Charset",
193
- "model-value": o(y),
194
- items: B,
195
- "helper-text": o(a).codeConfig.charset.length > 62 ? `${o(a).codeConfig.charset.substring(0, 62)}...` : o(a).codeConfig.charset,
196
- "onUpdate:modelValue": e[3] || (e[3] = (t) => {
197
- y.value = t, o(a).codeConfig.charset = t;
198
- })
199
- }, null, 8, ["model-value", "helper-text"]),
200
- o(y) === "" ? (x(), z(_, {
201
- key: 0,
202
- modelValue: o(a).codeConfig.charset,
203
- "onUpdate:modelValue": e[4] || (e[4] = (t) => o(a).codeConfig.charset = t),
204
- label: "Custom Charset",
205
- required: ""
206
- }, null, 8, ["modelValue"])) : U("", !0),
207
- h("div", ve, [
208
- r(_, {
209
- modelValue: o(a).codeConfig.prefix,
210
- "onUpdate:modelValue": e[5] || (e[5] = (t) => o(a).codeConfig.prefix = t),
211
- label: "Prefix (Optional)"
212
- }, null, 8, ["modelValue"]),
213
- r(_, {
214
- modelValue: o(a).codeConfig.suffix,
215
- "onUpdate:modelValue": e[6] || (e[6] = (t) => o(a).codeConfig.suffix = t),
216
- label: "Suffix (Optional)"
217
- }, null, 8, ["modelValue"])
218
- ]),
219
- r(_, {
220
- modelValue: o(a).codeConfig.pattern,
221
- "onUpdate:modelValue": e[7] || (e[7] = (t) => o(a).codeConfig.pattern = t),
222
- label: "Pattern",
223
- required: !0
224
- }, null, 8, ["modelValue"])
225
- ], 64)) : U("", !0),
226
- r(_, {
227
- modelValue: o(a).quantity,
228
- "onUpdate:modelValue": e[8] || (e[8] = (t) => o(a).quantity = t),
229
- label: "Number of code",
230
- rules: [
231
- (t) => t >= 1 || "Quantity cannot be less than 1",
232
- (t) => t <= 1e4 || "Quantity cannot more than 10,000"
233
- ],
234
- required: !0,
235
- "helper-text": `${o(a).quantity} claim will be created`
236
- }, null, 8, ["modelValue", "rules", "helper-text"])
237
- ], 64)) : U("", !0),
238
- o(c) !== "bulk" ? (x(), z(Z, {
239
- key: 1,
240
- modelValue: o(a).code,
241
- "onUpdate:modelValue": e[9] || (e[9] = (t) => o(a).code = t),
242
- label: "Custom Code",
243
- rules: [
244
- (t) => o(c) != "single" || !!t || "Custom code is required",
245
- (t) => !l(t) || "Custom code must be unique",
246
- (t) => !b(t) || "Custom code must not contain space"
247
- ],
248
- placeholder: "(For multiple codes, please enter in the new row.)"
249
- }, null, 8, ["modelValue", "rules"])) : U("", !0)
250
- ])
251
- ]),
252
- _: 1
253
- }, 512)
254
- ]),
255
- _: 1
256
- }, 8, ["modelValue"]);
257
- };
258
- }
259
- });
260
- class xe {
261
- constructor() {
262
- K(this, "data", []);
263
- }
264
- addRecord(i) {
265
- this.data.push(i);
266
- }
267
- buildExcel() {
268
- const i = $.book_new(), d = $.json_to_sheet(this.data);
269
- return $.book_append_sheet(i, d, "Collection"), i;
270
- }
271
- }
272
- const Ve = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Se = { class: "flex items-center justify-end py-4 xs:hidden" }, ze = /* @__PURE__ */ H({
273
- __name: "Collections",
274
- setup(g) {
275
- const i = ue(), d = W(), S = f(), w = J(() => d.params.id), F = f(!1), { custom: k } = Q, q = [
276
- {
277
- header: "ID/Code",
278
- accessorKey: "_id",
279
- cell(n) {
280
- return Y("div", { class: "flex items-center" }, [
281
- Y(se.FmIcon, {
282
- name: "content_copy",
283
- outline: !0,
284
- size: "sm",
285
- class: "cursor-pointer mr-4",
286
- onClick: (l) => {
287
- l.preventDefault(), l.stopPropagation(), fe(
288
- n.row.original.code || n.row.original._id.toString()
289
- );
290
- }
291
- }),
292
- Y(
293
- "div",
294
- { class: "pr-2 text-ellipsis overflow-hidden" },
295
- n.row.original.code || n.row.original._id.toString()
296
- )
297
- ]);
298
- }
299
- },
300
- {
301
- header: "User",
302
- accessorKey: "user",
303
- enableSorting: !1,
304
- cell(n) {
305
- const l = n.row.original.pf_user;
306
- return ce(l);
307
- }
308
- },
309
- {
310
- header: "Phone",
311
- accessorFn: (n) => {
312
- var l;
313
- return ((l = n.pf_user) == null ? void 0 : l.phoneNumber) || "-";
314
- },
315
- accessorKey: "pf_user.phoneNumber"
316
- },
317
- {
318
- header: "Balance",
319
- accessorKey: "balance"
320
- },
321
- {
322
- header: "Created at",
323
- accessorKey: "_id",
324
- accessorFn: (n) => G(Ce(n._id.toString())).format("DD MMM YYYY")
325
- },
326
- {
327
- header: "Nearest expired at",
328
- accessorKey: "expiryBalance",
329
- accessorFn: (n) => {
330
- var l;
331
- return n.expiryBalance && n.expiryBalance.length ? G((l = n.expiryBalance) == null ? void 0 : l[0].expiredAt).format("DD MMM YYYY") : "Never expires";
332
- }
333
- }
334
- ], C = {
335
- "$connect-STORE_REWARD_COLLECTIONS": ge.readCollectionsByRewardId,
336
- "$connect-CAMPAIGN_VOUCHER_COLLECTIONS": P.readCollectionsByCampaignId
337
- }, D = (n) => {
338
- const l = C[d.name];
339
- return (b) => l(n, b);
340
- }, { tableMeta: a, rowData: E, onSort: B, debouncedFetchData: y, onSearch: c } = me(D(w.value));
341
- async function V() {
342
- var n;
343
- await y(), (n = S.value) == null || n.showSheet(!1);
344
- }
345
- async function A() {
346
- F.value || k(
347
- async () => {
348
- var s;
349
- const n = new xe(), l = (await P.readCollectionsByCampaignId(w.value, {
350
- limit: 1,
351
- skip: 0,
352
- sortBy: p.sortBy,
353
- descending: p.descending
354
- })).meta.totalResources ?? 0, b = p.rowsPerPage;
355
- for (let e = 0; e < l; e += b) {
356
- const v = {
357
- ...p,
358
- limit: b,
359
- skip: p.page - 1,
360
- sortBy: p.sortBy,
361
- descending: p.descending
362
- }, M = await P.readCollectionsByCampaignId(
363
- w.value,
364
- v
365
- );
366
- for await (const m of M.resources) {
367
- const L = {
368
- Id: (m == null ? void 0 : m.code) || ((s = m._id) == null ? void 0 : s.toString()) || "",
369
- Balance: (m == null ? void 0 : m.balance) || 0
370
- };
371
- n.addRecord(L);
372
- }
373
- p.page++;
374
- }
375
- await de(
376
- n.buildExcel(),
377
- `members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
378
- {
379
- bookType: "xlsx",
380
- bookSST: !1,
381
- type: "array"
382
- }
383
- ), p.page = 1;
384
- },
385
- {
386
- isLoading: F
387
- }
388
- );
389
- }
390
- return ne(async () => {
391
- await y();
392
- }), (n, l) => {
393
- const b = u("FmPageHead"), s = u("FmSearch");
394
- return x(), R(N, null, [
395
- r(b, {
396
- title: "Collections",
397
- "back-button": !0,
398
- actions: [
399
- { label: "Export", value: "export", isPrimary: !1 },
400
- {
401
- label: "Create collection",
402
- value: "create",
403
- isPrimary: !0
404
- }
405
- ],
406
- "onClick:back": l[0] || (l[0] = (e) => o(i).back()),
407
- "onClick:action": l[1] || (l[1] = (e) => {
408
- var v;
409
- e === "create" && ((v = o(S)) == null || v.showSheet(!0)), e === "export" && A();
410
- })
411
- }),
412
- h("div", Ve, [
413
- r(s, {
414
- class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
415
- modelValue: o(a).searchValue,
416
- "onUpdate:modelValue": [
417
- l[2] || (l[2] = (e) => o(a).searchValue = e),
418
- o(c)
419
- ],
420
- placeholder: "Search",
421
- collapsible: ""
422
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
423
- h("div", Se, [
424
- r(s, {
425
- modelValue: o(a).searchValue,
426
- "onUpdate:modelValue": [
427
- l[3] || (l[3] = (e) => o(a).searchValue = e),
428
- o(c)
429
- ],
430
- placeholder: "Search",
431
- collapsible: ""
432
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
433
- ]),
434
- r(pe, {
435
- loading: o(a).isLoading,
436
- "row-data": o(E),
437
- "column-defs": q,
438
- "row-count": o(a).totalRows,
439
- "page-count": o(a).pageCount,
440
- "page-index": o(a).pageIndex,
441
- "page-size": o(a).pageSize,
442
- "shrink-at": !1,
443
- onSortChange: o(B),
444
- onPageChange: l[4] || (l[4] = (e) => o(y)({ pageSize: e.pageSize, pageIndex: e.pageIndex }))
445
- }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
446
- r(ye, {
447
- ref_key: "sheetRef",
448
- ref: S,
449
- onSuccess: V
450
- }, null, 512)
451
- ])
452
- ], 64);
453
- };
454
- }
455
- });
456
- export {
457
- ze as default
458
- };