@feedmepos/mf-connect 0.0.8 → 0.0.9

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 (77) hide show
  1. package/dist/{Analytic-BxRuK2P2.js → Analytic-CwaN0mge.js} +68 -69
  2. package/dist/{Broadcast-BqGojAWW.js → Broadcast-Cjx5xzUC.js} +27 -28
  3. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B-VzcVMS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D4mO5aik.js} +34 -34
  4. package/dist/Card-DbY6YaXk.js +827 -0
  5. package/dist/{Collections-DvdDRozp.js → Collections-DRN2gzwh.js} +158 -168
  6. package/dist/{Credit-BeHm7_2S.js → Credit-DOcrzykJ.js} +11 -12
  7. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsbgHsah.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CUxfXaro.js} +359 -333
  8. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-hwXvdiut.js → EffectSheet.vue_vue_type_style_index_0_lang-EF_rHfwT.js} +5 -5
  9. package/dist/{Experience-CtDY9u4Y.js → Experience-aQj-3H2Y.js} +11 -12
  10. package/dist/{Game-DjaYuqcb.js → Game-Cnje-m_M.js} +22 -23
  11. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-Bq5-Gl9N.js → ImageInput.vue_vue_type_script_setup_true_lang-CG-GBVMP.js} +8 -8
  12. package/dist/{MainLayout-B-iAZM2k.js → MainLayout-Cxl9yLPs.js} +1 -1
  13. package/dist/{Marketing-BJJltAh-.js → Marketing-BYUcbcMU.js} +19 -20
  14. package/dist/{Member-eJ9Pdi5w.js → Member-D7K9fm_Q.js} +2 -2
  15. package/dist/MemberList-DbXkxUzF.js +1717 -0
  16. package/dist/{MemberTransactions-DRET8mSQ.js → MemberTransactions-DED1SYwX.js} +4 -4
  17. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-CLqIp5wR.js +203 -0
  18. package/dist/{Point-DPTOgJbC.js → Point-CQm8whVQ.js} +11 -12
  19. package/dist/{Promotion-wzkRuNqO.js → Promotion-DzVXy_C9.js} +42 -44
  20. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Z06eB5i5.js → RuleGroup.vue_vue_type_script_setup_true_lang-CeS6KlhP.js} +12 -12
  21. package/dist/Segment-D3o0D3Uv.js +407 -0
  22. package/dist/{Setting-CXuZu0-m.js → Setting-pCzenLoL.js} +17 -18
  23. package/dist/{Store-4Um9keEp.js → Store-DEwEIFYD.js} +18 -19
  24. package/dist/{StoreRewards-B-UFeyQM.js → StoreRewards-D7vnZN4f.js} +86 -87
  25. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-ALzQU3th.js +793 -0
  26. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-I_XFpctY.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-GMIztWCj.js} +1 -1
  27. package/dist/{Tier-C6KVsxGO.js → Tier-BJbX5CPB.js} +401 -377
  28. package/dist/{Title-DuN1ahIM.js → Title-C9xV6rBg.js} +274 -248
  29. package/dist/Transaction-C8OHlhzR.js +36 -0
  30. package/dist/Voucher-eZwm7N1D.js +481 -0
  31. package/dist/{app-CxBTTB31.js → app-DgbDbhL-.js} +34 -34
  32. package/dist/app.js +1 -1
  33. package/dist/{campaign-B0aXkadj.js → campaign-BkvrUTEJ.js} +2 -2
  34. package/dist/{dto-BtdVC-Ab.js → dto-YYVhW73A.js} +52 -53
  35. package/dist/{effect-BUN6rkQM.js → effect-f7DAPYC8.js} +1 -1
  36. package/dist/export-BXbCXTfd.js +97 -0
  37. package/dist/{helper-Cpq3x8K5.js → helper-BhvQ9m6d.js} +1 -1
  38. package/dist/{index-D2Juhkdw.js → index-BhacKx5B.js} +85 -83
  39. package/dist/{index-DDSLx7vu.js → index-BsEqtUmY.js} +2 -2
  40. package/dist/{index-0GYrZr4L.js → index-CdtrQ9tR.js} +5 -5
  41. package/dist/{index-8clzk3uX.js → index-Cfo2A0Se.js} +1 -1
  42. package/dist/index-Cz5RZlYh.js +73 -0
  43. package/dist/{index-BTntbYTS.js → index-DQC_1tRF.js} +1 -1
  44. package/dist/{index-DysVCkrx.js → index-Dd3hrFcQ.js} +3 -3
  45. package/dist/{index-CK9yJMj7.js → index-FWp9M1yS.js} +5 -5
  46. package/dist/{index-C6NgUSl2.js → index-VmFlM704.js} +1 -1
  47. package/dist/{index-BvnZdJBY.js → index-oQLJE4Uw.js} +2 -2
  48. package/dist/libs/packages/core/src/collectible/collectible.dto.d.ts +6 -0
  49. package/dist/{plugins-B_d-WFtN.js → loading-DQaawbHE.js} +8204 -8108
  50. package/dist/{lodash-DsT1nK-T.js → lodash-DzdmTD20.js} +1 -1
  51. package/dist/{membership-DtD45RXh.js → membership-Dq2-b-S_.js} +3 -3
  52. package/dist/{money-CFI1TMCS.js → money-vzwOUBrp.js} +1 -1
  53. package/dist/{number-BBtf4fYz.js → number-CBzs6rfW.js} +1 -1
  54. package/dist/packages/connect/src/components/campaign/CampaignSummary.vue.d.ts +13 -0
  55. package/dist/packages/connect/src/composables/export.d.ts +11 -0
  56. package/dist/packages/connect/src/export/base.export.d.ts +7 -0
  57. package/dist/packages/connect/src/export/card.export.d.ts +5 -6
  58. package/dist/packages/connect/src/export/collection-transaction.export.d.ts +14 -0
  59. package/dist/packages/connect/src/export/index.d.ts +1 -0
  60. package/dist/packages/connect/src/export/store-transaction.export.d.ts +14 -0
  61. package/dist/packages/connect/src/helpers/user.d.ts +6 -0
  62. package/dist/{rule-CB9Qlcx1.js → rule-BR5rrmUV.js} +2 -2
  63. package/dist/{rule-builder-BIKcA4Bg.js → rule-builder-7GBNrPXt.js} +1 -1
  64. package/dist/{template-qlb46PGl.js → template-CETJ6lkf.js} +5 -5
  65. package/dist/{usePagination-CX66ab1Y.js → usePagination-DdZeE4Tt.js} +57 -56
  66. package/dist/user-Bm4KttFq.js +37 -0
  67. package/dist/{xlsx-DMaFso0k.js → xlsx-CDAKxZE_.js} +1 -1
  68. package/package.json +1 -1
  69. package/dist/Card-Dlj5jQp4.js +0 -792
  70. package/dist/MemberList-CrhMqUfJ.js +0 -1664
  71. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-D-ttMwn2.js +0 -166
  72. package/dist/Segment-DnsPrP7Q.js +0 -371
  73. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BAyotuXd.js +0 -660
  74. package/dist/Transaction-DdfX7Xfe.js +0 -34
  75. package/dist/Voucher-DarXrxZr.js +0 -454
  76. package/dist/index-Dg-PMgXV.js +0 -64
  77. package/dist/loading-Cxp7sI5p.js +0 -100
@@ -1,792 +0,0 @@
1
- var Ee = Object.defineProperty;
2
- var Se = (e, s, b) => s in e ? Ee(e, s, { enumerable: !0, configurable: !0, writable: !0, value: b }) : e[s] = b;
3
- var se = (e, s, b) => Se(e, typeof s != "symbol" ? s + "" : s, b);
4
- import { defineComponent as Q, ref as h, computed as F, watch as ke, onMounted as Z, resolveComponent as E, openBlock as _, createBlock as O, unref as n, isRef as z, withCtx as y, createElementVNode as g, createVNode as u, createElementBlock as x, Fragment as B, renderList as J, createCommentVNode as A, normalizeClass as Te, createSlots as Re, h as X } from "vue";
5
- import { h as ae } from "./moment-BWErdI6_.js";
6
- import { useDialog as Ae, components as ye } from "@feedmepos/ui-library";
7
- import { p as Ce, f as re } from "./plugins-B_d-WFtN.js";
8
- import { u as ce } from "./loading-Cxp7sI5p.js";
9
- import { u as Ie, g as Oe, a as Ne } from "./app-CxBTTB31.js";
10
- import { u as ee } from "./membership-DtD45RXh.js";
11
- import { _ as ie } from "./index-CK9yJMj7.js";
12
- import { m as ne } from "./index-C6NgUSl2.js";
13
- import { _ as le } from "./ImageInput.vue_vue_type_script_setup_true_lang-Bq5-Gl9N.js";
14
- import "./index-DDSLx7vu.js";
15
- import "./index-D2Juhkdw.js";
16
- import { h as xe } from "./index-0GYrZr4L.js";
17
- import "./index-DysVCkrx.js";
18
- import "./index-BvnZdJBY.js";
19
- import "./index-8clzk3uX.js";
20
- import { a as De } from "./object-qECH92oz.js";
21
- import { u as W, w as Ue } from "./xlsx-DMaFso0k.js";
22
- import { u as we, _ as He } from "./usePagination-CX66ab1Y.js";
23
- import { o as Be } from "./objectId-dwaoBfJX.js";
24
- class Fe {
25
- constructor() {
26
- se(this, "data", []);
27
- }
28
- addRecord(s) {
29
- this.data.push(s);
30
- }
31
- addRecords(s) {
32
- this.data.push(...s);
33
- }
34
- buildExcel() {
35
- const s = W.book_new(), b = W.json_to_sheet(this.data);
36
- return W.book_append_sheet(s, b, "Card(s)"), s;
37
- }
38
- }
39
- const Pe = /* @__PURE__ */ g("div", { class: "fm-typo-en-body-lg-600" }, "Number type", -1), Ve = { class: "space-y-16" }, Me = /* @__PURE__ */ g("div", { class: "fm-typo-en-body-lg-600" }, "Number Settings", -1), Ge = { class: "gap-16 grid grid-cols-2" }, Le = { class: "space-y-16" }, je = /* @__PURE__ */ g("div", { class: "fm-typo-en-body-lg-600" }, "Card Settings", -1), $e = {
40
- key: 0,
41
- class: "flex flex-col gap-[16px] w-full"
42
- }, Ke = { class: "flex flex-col gap-[8px]" }, Xe = /* @__PURE__ */ g("p", { class: "fm-typo-en-title-sm-800" }, "Design preview", -1), We = ["src"], Ye = { class: "flex pt-[24px] gap-[24px]" }, qe = ["src", "onClick", "alt"], ze = { class: "flex items-center gap-8" }, Je = /* @__PURE__ */ Q({
43
- __name: "CreateCardSheet",
44
- emits: ["success", "export"],
45
- setup(e, { expose: s, emit: b }) {
46
- const { minor: U } = ce, S = ee(), w = h(), k = h(!1), f = b, v = h(!1);
47
- function P(i) {
48
- v.value = i, i && (a.value = {
49
- quantity: 1,
50
- code: "",
51
- codeConfig: {
52
- length: 12,
53
- charset: "1234567890",
54
- prefix: "",
55
- suffix: "",
56
- pattern: "####-####-####-####"
57
- }
58
- });
59
- }
60
- const a = h({
61
- quantity: 1,
62
- code: "",
63
- codeConfig: {
64
- length: 12,
65
- charset: "1234567890",
66
- prefix: "",
67
- suffix: "",
68
- pattern: "####-####-####-####"
69
- },
70
- setCardOnBind: !1,
71
- bundle: void 0
72
- }), N = [
73
- {
74
- label: "Bulk number",
75
- value: "bulk",
76
- sublabel: "Bulk generate unique number"
77
- },
78
- {
79
- label: "Custom number",
80
- value: "single",
81
- sublabel: "Enter your own custom number"
82
- }
83
- ], D = [
84
- {
85
- label: "Alphanumeric",
86
- value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
87
- },
88
- {
89
- label: "Alphabetic",
90
- value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
91
- },
92
- { label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
93
- { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
94
- { label: "Numbers", value: "0123456789" },
95
- { label: "Custom", value: "" }
96
- ], H = h(D[0].value), R = h("bulk"), p = h(0), r = F(
97
- () => {
98
- var i;
99
- return (i = S.membership.design) == null ? void 0 : i[p.value];
100
- }
101
- ), m = h(!1), l = F(
102
- () => S.sortedStoreCategories.flatMap((i) => i.bundles)
103
- );
104
- async function c(i) {
105
- var C, L;
106
- if (await ((C = w.value) == null ? void 0 : C.validateInputs()), !k.value) return;
107
- i.design = (L = r.value) == null ? void 0 : L.image;
108
- const t = await Ce.confirm(
109
- "",
110
- "Do you want to export generated card(s)?",
111
- "Export",
112
- "Generate and without export"
113
- );
114
- console.log(t), await U(
115
- async () => {
116
- const V = await ne.createCards(i);
117
- console.log(V), await f("success"), t && await f("export", V);
118
- },
119
- {
120
- message: "Creating card(s)",
121
- successMessage: "Card(s) created"
122
- }
123
- );
124
- }
125
- return s({
126
- showSheet: P
127
- }), ke(
128
- () => a.value.codeConfig.length,
129
- (i, t) => {
130
- i != t && (a.value.codeConfig.pattern = "#".repeat(Number(i)));
131
- }
132
- ), Z(async () => {
133
- await S.readMemberStore();
134
- }), (i, t) => {
135
- const C = E("FmRadio"), L = E("FmRadioGroup"), V = E("FmSwitch"), fe = E("FmStepperField"), ge = E("FmSelect"), M = E("FmTextField"), be = E("FmTextarea"), j = E("FmButton"), he = E("FmForm"), ve = E("FmSideSheet");
136
- return _(), O(ve, {
137
- "max-width": 560,
138
- "dismiss-away": !0,
139
- header: "Create collection",
140
- modelValue: n(v),
141
- "onUpdate:modelValue": [
142
- t[19] || (t[19] = (I) => z(v) ? v.value = I : null),
143
- t[20] || (t[20] = (I) => v.value = I)
144
- ]
145
- }, {
146
- "side-sheet-footer": y(() => [
147
- g("div", ze, [
148
- u(j, {
149
- label: "Save",
150
- onClick: t[17] || (t[17] = (I) => c(n(a))),
151
- loading: n(Ie)().isLoading
152
- }, null, 8, ["loading"]),
153
- u(j, {
154
- label: "Cancel",
155
- type: "button",
156
- variant: "tertiary",
157
- onClick: t[18] || (t[18] = (I) => v.value = !1)
158
- })
159
- ])
160
- ]),
161
- default: y(() => [
162
- u(he, {
163
- ref_key: "form",
164
- ref: w,
165
- class: "space-y-40",
166
- onValidationSuccess: t[15] || (t[15] = (I) => k.value = !0),
167
- onValidationFailed: t[16] || (t[16] = (I) => k.value = !1)
168
- }, {
169
- default: y(() => {
170
- var I, te, oe;
171
- return [
172
- g("div", null, [
173
- Pe,
174
- u(L, {
175
- modelValue: n(R),
176
- "onUpdate:modelValue": t[0] || (t[0] = (o) => z(R) ? R.value = o : null),
177
- inline: !1
178
- }, {
179
- default: y(() => [
180
- (_(), x(B, null, J(N, (o) => u(C, {
181
- key: o.value,
182
- value: o.value,
183
- label: o.label,
184
- sublabel: o.sublabel
185
- }, null, 8, ["value", "label", "sublabel"])), 64))
186
- ]),
187
- _: 1
188
- }, 8, ["modelValue"])
189
- ]),
190
- g("div", Ve, [
191
- Me,
192
- n(R) === "bulk" ? (_(), x(B, { key: 0 }, [
193
- u(V, {
194
- "model-value": n(m),
195
- "label-placement": "right",
196
- value: "true",
197
- label: "Advance number setting",
198
- required: !0,
199
- "onUpdate:modelValue": t[1] || (t[1] = () => m.value = !n(m))
200
- }, null, 8, ["model-value"]),
201
- n(m) ? (_(), x(B, { key: 0 }, [
202
- u(fe, {
203
- "model-value": n(a).codeConfig.length || null,
204
- "onUpdate:modelValue": t[2] || (t[2] = (o) => n(a).codeConfig.length = o),
205
- label: "Code length",
206
- rules: [(o) => Number(o) >= 1 || "Code length must at least 1"],
207
- required: !0
208
- }, null, 8, ["model-value", "rules"]),
209
- u(ge, {
210
- label: "Charset",
211
- "model-value": n(H),
212
- items: D,
213
- "helper-text": n(a).codeConfig.charset.length > 62 ? `${n(a).codeConfig.charset.substring(0, 62)}...` : n(a).codeConfig.charset,
214
- "onUpdate:modelValue": t[3] || (t[3] = (o) => {
215
- H.value = o, n(a).codeConfig.charset = o;
216
- })
217
- }, null, 8, ["model-value", "helper-text"]),
218
- n(H) === "" ? (_(), O(M, {
219
- key: 0,
220
- modelValue: n(a).codeConfig.charset,
221
- "onUpdate:modelValue": t[4] || (t[4] = (o) => n(a).codeConfig.charset = o),
222
- label: "Custom Charset",
223
- required: ""
224
- }, null, 8, ["modelValue"])) : A("", !0),
225
- g("div", Ge, [
226
- u(M, {
227
- modelValue: n(a).codeConfig.prefix,
228
- "onUpdate:modelValue": t[5] || (t[5] = (o) => n(a).codeConfig.prefix = o),
229
- label: "Prefix (Optional)"
230
- }, null, 8, ["modelValue"]),
231
- u(M, {
232
- modelValue: n(a).codeConfig.suffix,
233
- "onUpdate:modelValue": t[6] || (t[6] = (o) => n(a).codeConfig.suffix = o),
234
- label: "Suffix (Optional)"
235
- }, null, 8, ["modelValue"])
236
- ]),
237
- u(M, {
238
- modelValue: n(a).codeConfig.pattern,
239
- "onUpdate:modelValue": t[7] || (t[7] = (o) => n(a).codeConfig.pattern = o),
240
- label: "Pattern",
241
- required: !0
242
- }, null, 8, ["modelValue"])
243
- ], 64)) : A("", !0),
244
- u(M, {
245
- modelValue: n(a).quantity,
246
- "onUpdate:modelValue": t[8] || (t[8] = (o) => n(a).quantity = o),
247
- label: "Number of code",
248
- rules: [
249
- (o) => o >= 1 || "Quantity cannot be less than 1",
250
- (o) => o <= 1e4 || "Quantity cannot more than 10,000"
251
- ],
252
- required: !0,
253
- "helper-text": `${n(a).quantity} card will be created`
254
- }, null, 8, ["modelValue", "rules", "helper-text"])
255
- ], 64)) : A("", !0),
256
- n(R) !== "bulk" ? (_(), O(be, {
257
- key: 1,
258
- modelValue: n(a).code,
259
- "onUpdate:modelValue": t[9] || (t[9] = (o) => n(a).code = o),
260
- label: "Custom Card Number",
261
- rules: [(o) => n(R) != "single" || !!o || "Custom code is required"],
262
- placeholder: "(For multiple numbers, please enter in the new row.)"
263
- }, null, 8, ["modelValue", "rules"])) : A("", !0)
264
- ]),
265
- g("div", Le, [
266
- je,
267
- u(V, {
268
- "label-placement": "right",
269
- label: "Set card number on bind",
270
- "model-value": n(a).setCardOnBind || !1,
271
- "onUpdate:modelValue": t[10] || (t[10] = (o) => n(a).setCardOnBind = o)
272
- }, null, 8, ["model-value"]),
273
- u(ie, {
274
- label: "Activate bundle on bind",
275
- placeholder: "Select bundle",
276
- items: n(l).filter((o) => !o.stripePriceId).map((o) => ({ label: o.name, value: o._id })),
277
- modelValue: n(a).bundle,
278
- "onUpdate:modelValue": t[12] || (t[12] = (o) => n(a).bundle = o)
279
- }, {
280
- append: y(() => [
281
- n(a).bundle ? (_(), O(j, {
282
- key: 0,
283
- icon: "link_off",
284
- variant: "plain",
285
- onClick: t[11] || (t[11] = (o) => n(a).bundle = void 0)
286
- })) : A("", !0)
287
- ]),
288
- _: 1
289
- }, 8, ["items", "modelValue"]),
290
- (te = (I = n(S).store) == null ? void 0 : I.stripe) != null && te.apiKey ? (_(), O(ie, {
291
- key: 0,
292
- label: "Linked subscription bundle",
293
- placeholder: "Select bundle",
294
- items: n(l).filter((o) => o.stripePriceId).map((o) => ({ label: o.name, value: o._id })),
295
- modelValue: n(a).subscriptionBundle,
296
- "onUpdate:modelValue": t[14] || (t[14] = (o) => n(a).subscriptionBundle = o)
297
- }, {
298
- append: y(() => [
299
- n(a).subscriptionBundle ? (_(), O(j, {
300
- key: 0,
301
- icon: "link_off",
302
- variant: "plain",
303
- onClick: t[13] || (t[13] = (o) => n(a).subscriptionBundle = void 0)
304
- })) : A("", !0)
305
- ]),
306
- _: 1
307
- }, 8, ["items", "modelValue"])) : A("", !0)
308
- ]),
309
- n(S).membership.design ? (_(), x("div", $e, [
310
- g("div", Ke, [
311
- Xe,
312
- g("img", {
313
- src: (oe = n(r)) == null ? void 0 : oe.image,
314
- class: "aspect-[16/9]"
315
- }, null, 8, We),
316
- g("div", Ye, [
317
- (_(!0), x(B, null, J(n(S).membership.design, (o, $) => (_(), x("img", {
318
- src: o.image,
319
- key: `image_${$}`,
320
- class: Te(["w-[112px] h-[63px] cursor-pointer", `${n(p) === $ ? "border-[2px] border-fm-color-primary" : ""}`]),
321
- onClick: (cn) => p.value = $,
322
- alt: `ai_image_predict_${$}`,
323
- style: { objectFit: "cover" }
324
- }, null, 10, qe))), 128))
325
- ])
326
- ])
327
- ])) : A("", !0)
328
- ];
329
- }),
330
- _: 1
331
- }, 512)
332
- ]),
333
- _: 1
334
- }, 8, ["modelValue"]);
335
- };
336
- }
337
- });
338
- var Y = { env: { GITHUB_STATE: "/home/runner/work/_temp/_runner_file_commands/save_state_ee2b1673-f198-4064-b4d7-05d8b8b0870f", npm_package_dependencies_zod: "3.22.4", npm_package_devDependencies__types_node: "^18.19.36", STATS_TRP: "true", DEPLOYMENT_BASEPATH: "/opt/runner", DOTNET_NOLOGO: "1", npm_package_dependencies_pinia: "^2.1.7", npm_package_dependencies_vite_plugin_vue_devtools: "^7.6.4", USER: "runner", npm_config_user_agent: "pnpm/9.14.3 npm/? node/v20.18.1 linux x64", CI: "true", npm_package_dependencies_vue: "^3.4.29", RUNNER_ENVIRONMENT: "github-hosted", GITHUB_ENV: "/home/runner/work/_temp/_runner_file_commands/set_env_ee2b1673-f198-4064-b4d7-05d8b8b0870f", PIPX_HOME: "/opt/pipx", npm_package_devDependencies_vite: "^5.3.1", npm_node_execpath: "/opt/hostedtoolcache/node/20.18.1/x64/bin/node", JAVA_HOME_8_X64: "/usr/lib/jvm/temurin-8-jdk-amd64", SHLVL: "1", npm_package_files_0: "dist", HOME: "/home/runner", RUNNER_TEMP: "/home/runner/work/_temp", GITHUB_EVENT_PATH: "/home/runner/work/_temp/_github_workflow/event.json", npm_package_scripts_build_mf_dev: "vite build --mode fmmf", npm_package_dependencies__types_qrcode: "^1.5.5", JAVA_HOME_11_X64: "/usr/lib/jvm/temurin-11-jdk-amd64", PIPX_BIN_DIR: "/opt/pipx_bin", GITHUB_REPOSITORY_OWNER: "feedmepos", npm_package_scripts_build_mf_prod: "vite build --mode fmmf:prod", npm_package_dependencies_change_case: "^5.4.4", NODE_OPTIONS: "--max-old-space-size=8096", GRADLE_HOME: "/usr/share/gradle-8.11.1", ANDROID_NDK_LATEST_HOME: "/usr/local/lib/android/sdk/ndk/27.2.12479018", JAVA_HOME_21_X64: "/usr/lib/jvm/temurin-21-jdk-amd64", STATS_RDCL: "true", GITHUB_RETENTION_DAYS: "90", npm_package_dependencies__feedmepos_mf_common: "1.8.37", npm_package_dependencies_fabric: "^6.4.2", GITHUB_REPOSITORY_OWNER_ID: "54831515", POWERSHELL_DISTRIBUTION_CHANNEL: "GitHub-Actions-ubuntu22", AZURE_EXTENSION_DIR: "/opt/az/azcliextensions", GITHUB_HEAD_REF: "", SYSTEMD_EXEC_PID: "478", npm_package_dependencies__feedmepos_ui_library: "1.2.56", npm_package_dependencies_dayjs: "^1.11.11", npm_package_dependencies_dotenv: "^16.4.5", npm_package_dependencies_moment: "^2.30.1", GITHUB_GRAPHQL_URL: "https://api.github.com/graphql", npm_package_scripts_build_only_dev: "pnpm build:mf:dev", npm_package_devDependencies_tailwindcss: "^3.4.4", npm_package_devDependencies_typescript: "^5.4.5", NVM_DIR: "/home/runner/.nvm", npm_package_scripts_build_dev: "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --mode development", npm_package_scripts_build_only_prod: "pnpm build:mf:prod && pnpm build:dts && pnpm build-types", npm_package_dependencies_xlsx: "^0.18.5", npm_package_devDependencies_vue_tsc: "^2.0.21", DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1", GOROOT_1_21_X64: "/opt/hostedtoolcache/go/1.21.13/x64", JAVA_HOME_17_X64: "/usr/lib/jvm/temurin-17-jdk-amd64", ImageVersion: "20241124.1.0", npm_package_scripts_dev: "vite", npm_package_scripts_build_prod: "cross-env NODE_OPTIONS=--max-old-space-size=4096 vite build --mode production", npm_package_dependencies_unplugin_auto_import: "^0.17.6", RUNNER_OS: "Linux", GITHUB_API_URL: "https://api.github.com", GOROOT_1_22_X64: "/opt/hostedtoolcache/go/1.22.9/x64", STORE_PATH: "/home/runner/setup-pnpm/node_modules/.bin/store/v3", SWIFT_PATH: "/usr/share/swift/usr/bin", npm_package_type: "module", RUNNER_USER: "runner", STATS_V3PS: "true", CHROMEWEBDRIVER: "/usr/local/share/chromedriver-linux64", GOROOT_1_23_X64: "/opt/hostedtoolcache/go/1.23.3/x64", JOURNAL_STREAM: "8:18584", GITHUB_WORKFLOW: "Publish mf-connect - production", _: "/home/runner/setup-pnpm/node_modules/.bin/pnpm", npm_package_module: "./dist/app.js", npm_package_devDependencies_autoprefixer: "^10.4.19", npm_package_devDependencies__types_uuid: "^9.0.8", npm_package_devDependencies_unlayer_types: "^1.111.0", npm_config_registry: "https://registry.npmjs.org/", ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE: "/opt/actionarchivecache", STATS_D: "false", GITHUB_RUN_ID: "12081660639", STATS_VMFE: "true", npm_package_dependencies_bson_objectid: "^2.0.4", npm_package_devDependencies__types_lodash: "^4.17.5", GITHUB_REF_TYPE: "branch", BOOTSTRAP_HASKELL_NONINTERACTIVE: "1", GITHUB_WORKFLOW_SHA: "ffe754b16b53f11aae737020ed72c8c4c4412d63", GITHUB_BASE_REF: "", ImageOS: "ubuntu22", npm_package_exports___import: "./dist/app.js", npm_package_devDependencies__vitejs_plugin_vue: "^5.0.5", GITHUB_WORKFLOW_REF: "feedmepos/marketing-services/.github/workflows/[PROD] publish-mf-connect.yml@refs/heads/main", PERFLOG_LOCATION_SETTING: "RUNNER_PERFLOG", GITHUB_ACTION_REPOSITORY: "", npm_package_dependencies_axios: "^1.7.2", npm_config_node_gyp: "/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.14.3/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js", PATH: "/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.14.3/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.14.3/node_modules/pnpm/dist/node-gyp-bin:/home/runner/setup-pnpm/node_modules/.bin:/opt/hostedtoolcache/node/20.18.1/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", ANT_HOME: "/usr/share/ant", DOTNET_MULTILEVEL_LOOKUP: "0", RUNNER_TRACKING_ID: "github_77aa348d-e348-4527-a0b8-3fdc2dfb480b", INVOCATION_ID: "1fd09bb9dabf47beb064eea8924de866", RUNNER_TOOL_CACHE: "/opt/hostedtoolcache", NODE: "/opt/hostedtoolcache/node/20.18.1/x64/bin/node", npm_package_name: "@feedmepos/mf-connect", npm_package_scripts_deploy_dev: "pnpm run build-only:dev && pnpm publish --no-git-checks .", npm_package_dependencies_cross_env: "^7.0.3", GITHUB_ACTION: "__run_5", GITHUB_RUN_NUMBER: "4", GITHUB_TRIGGERING_ACTOR: "qaijunse", RUNNER_ARCH: "X64", XDG_RUNTIME_DIR: "/run/user/1001", AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache", npm_package_scripts_deploy_prod: "pnpm run build-only:prod && pnpm publish --no-git-checks .", npm_config_frozen_lockfile: "", LANG: "C.UTF-8", VCPKG_INSTALLATION_ROOT: "/usr/local/share/vcpkg", npm_package_dependencies__feedmepos_mf_core_ui: "1.0.10", CONDA: "/usr/share/miniconda", RUNNER_NAME: "GitHub Actions 457", XDG_CONFIG_HOME: "/home/runner/.config", STATS_VMD: "true", GITHUB_REF_NAME: "main", GITHUB_REPOSITORY: "feedmepos/marketing-services", STATS_D_D: "false", npm_package_scripts_build_dts: "vue-tsc --declaration --noEmit false --emitDeclarationOnly -p tsconfig.json --outDir ./dist && mv ./dist/src/* dist", npm_package_scripts_build_types: "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.json --outDir dist --composite false", npm_package_dependencies__feedmepos_core: "^2.10.4", npm_lifecycle_script: "vite build --mode fmmf:prod", STATS_UE: "true", ANDROID_NDK_ROOT: "/usr/local/lib/android/sdk/ndk/27.2.12479018", GITHUB_ACTION_REF: "", DEBIAN_FRONTEND: "noninteractive", npm_package_dependencies_rrule: "^2.8.1", npm_package_dependencies_vue3_lottie: "^3.3.0", GITHUB_REPOSITORY_ID: "615151795", GITHUB_ACTIONS: "true", STATS_PIP: "false", NODE_PATH: "/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.pnpm/vite@5.3.4_@types+node@18.19.41/node_modules/vite/bin/node_modules:/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.pnpm/vite@5.3.4_@types+node@18.19.41/node_modules/vite/node_modules:/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.pnpm/vite@5.3.4_@types+node@18.19.41/node_modules:/home/runner/work/marketing-services/marketing-services/packages/connect/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.14.3/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.14.3/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.14.3/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.14.3/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.14.3/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.14.3/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules", npm_package_version: "0.0.8", npm_lifecycle_event: "build:mf:prod", GITHUB_REF_PROTECTED: "false", npm_package_scripts_build: "vue-tsc && vite build", npm_package_dependencies_uuid: "^10.0.0", GITHUB_WORKSPACE: "/home/runner/work/marketing-services/marketing-services", ACCEPT_EULA: "Y", GITHUB_JOB: "deploy", RUNNER_PERFLOG: "/home/runner/perflog", npm_package_dependencies_lodash: "^4.17.21", GITHUB_SHA: "ffe754b16b53f11aae737020ed72c8c4c4412d63", GITHUB_RUN_ATTEMPT: "1", STATS_D_TC: "true", npm_package_exports___style: "./dist/style.css", npm_package_dependencies_vue_router: "^4.3.3", GITHUB_REF: "refs/heads/main", GITHUB_ACTOR: "qaijunse", ANDROID_SDK_ROOT: "/usr/local/lib/android/sdk", npm_package_license: "UNLICENSED", npm_package_dependencies_email_addresses: "^5.0.0", LEIN_HOME: "/usr/local/lib/lein", npm_package_dependencies_firebase: "^10.12.2", npm_package_dependencies_qrcode: "^1.5.3", GITHUB_PATH: "/home/runner/work/_temp/_runner_file_commands/add_path_ee2b1673-f198-4064-b4d7-05d8b8b0870f", JAVA_HOME: "/usr/lib/jvm/temurin-11-jdk-amd64", PWD: "/home/runner/work/marketing-services/marketing-services/packages/connect", GITHUB_ACTOR_ID: "39590157", RUNNER_WORKSPACE: "/home/runner/work/marketing-services", npm_execpath: "/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@9.14.3/node_modules/pnpm/bin/pnpm.cjs", HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: "3650", STATS_TIS: "mining", GITHUB_EVENT_NAME: "workflow_dispatch", HOMEBREW_NO_AUTO_UPDATE: "1", ANDROID_HOME: "/usr/local/lib/android/sdk", GITHUB_SERVER_URL: "https://github.com", GECKOWEBDRIVER: "/usr/local/share/gecko_driver", LEIN_JAR: "/usr/local/lib/lein/self-installs/leiningen-2.11.2-standalone.jar", GHCUP_INSTALL_BASE_PREFIX: "/usr/local", GITHUB_OUTPUT: "/home/runner/work/_temp/_runner_file_commands/set_output_ee2b1673-f198-4064-b4d7-05d8b8b0870f", npm_package_exports___types: "./dist/packages/connect/src/app.d.ts", EDGEWEBDRIVER: "/usr/local/share/edge_driver", STATS_EXT: "true", PNPM_SCRIPT_SRC_DIR: "/home/runner/work/marketing-services/marketing-services/packages/connect", npm_package_devDependencies_postcss: "^8.4.38", npm_command: "run-script", ANDROID_NDK: "/usr/local/lib/android/sdk/ndk/27.2.12479018", SGX_AESM_ADDR: "1", CHROME_BIN: "/usr/bin/google-chrome", npm_package_scripts_preview: "vite preview", SELENIUM_JAR_PATH: "/usr/share/java/selenium-server.jar", PNPM_HOME: "/home/runner/setup-pnpm/node_modules/.bin", STATS_EXTP: "https://provjobdprod.z13.web.core.windows.net/settings/provjobdsettings-latest/provjobd.data", ANDROID_NDK_HOME: "/usr/local/lib/android/sdk/ndk/27.2.12479018", GITHUB_STEP_SUMMARY: "/home/runner/work/_temp/_runner_file_commands/step_summary_ee2b1673-f198-4064-b4d7-05d8b8b0870f", INIT_CWD: "/home/runner/work/marketing-services/marketing-services/packages/connect", NODE_ENV: "production", FEEDME_NAMESPACE: "dev", FIREBASE_API_KEY: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", FIREBASE_AUTH_DOMAIN: "feedme-dev-4c3ef.firebaseapp.com", FIREBASE_DATABASE_URL: "https://feedme-dev-4c3ef.firebaseio.com", FIREBASE_PROJECT_ID: "feedme-dev-4c3ef", FIREBASE_STORAGE_BUCKET: "feedme-dev-4c3ef.appspot.com", FIREBASE_MESSAGING_SENDER_ID: "458797803788", FIREBASE_APP_ID: "1:458797803788:web:37f2af2926a84288f0c129", FIREBASE_MEASUREMENT_ID: "G-J2QG09D2Q7", ASSET_STORAGE_BUCKET: "feedme-dev-4c3ef.appspot.com", AUTH_URL: "https://portal-v2-dev.feedmeapi.com/", SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/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", MEMBER_APP_URL: "member.feedmedev.cc", CRM_APP_URL: "crm.feedmedev.cc", MARKETING_V1_PORTAL: "https://marketing-v1.feedmedev.cc", CLIENT_ID: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" } }, q = Math.floor(Math.random() * 16777215), de = d.index = parseInt(Math.random() * 16777215, 10), pe = (typeof Y > "u" || typeof Y.pid != "number" ? Math.floor(Math.random() * 1e5) : Y.pid) % 65535, ue = (() => {
339
- try {
340
- return _Buffer;
341
- } catch {
342
- try {
343
- return Buffer;
344
- } catch {
345
- return null;
346
- }
347
- }
348
- })(), K = function(e) {
349
- return !!(e != null && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e));
350
- }, _e = [];
351
- for (var T = 0; T < 256; T++)
352
- _e[T] = (T <= 15 ? "0" : "") + T.toString(16);
353
- var me = new RegExp("^[0-9a-fA-F]{24}$"), G = [];
354
- T = 0;
355
- for (; T < 10; ) G[48 + T] = T++;
356
- for (; T < 16; ) G[55 + T] = G[87 + T] = T++;
357
- function d(e) {
358
- if (!(this instanceof d)) return new d(e);
359
- if (e && (e instanceof d || e._bsontype === "ObjectID"))
360
- return e;
361
- if (this._bsontype = "ObjectID", e == null || typeof e == "number") {
362
- this.id = this.generate(e);
363
- return;
364
- }
365
- var s = d.isValid(e);
366
- if (!s && e != null)
367
- throw new Error(
368
- "Argument passed in must be a single String of 12 bytes or a string of 24 hex characters"
369
- );
370
- if (s && typeof e == "string" && e.length === 24)
371
- return d.createFromHexString(e);
372
- if (e != null && e.length === 12)
373
- this.id = e;
374
- else {
375
- if (e != null && typeof e.toHexString == "function")
376
- return e;
377
- throw new Error(
378
- "Argument passed in must be a single String of 12 bytes or a string of 24 hex characters"
379
- );
380
- }
381
- }
382
- var Qe = d;
383
- d.default = d;
384
- d.createFromTime = function(e) {
385
- return e = parseInt(e, 10) % 4294967295, new d(en(8, e) + "0000000000000000");
386
- };
387
- d.createFromHexString = function(e) {
388
- if (typeof e > "u" || e != null && e.length !== 24)
389
- throw new Error(
390
- "Argument passed in must be a single String of 12 bytes or a string of 24 hex characters"
391
- );
392
- for (var s = "", b = 0; b < 24; )
393
- s += String.fromCharCode(G[e.charCodeAt(b++)] << 4 | G[e.charCodeAt(b++)]);
394
- return new d(s);
395
- };
396
- d.isValid = function(e) {
397
- return e == null ? !1 : typeof e == "number" ? !0 : typeof e == "string" ? e.length === 12 || e.length === 24 && me.test(e) : e instanceof d ? !0 : K(e) ? d.isValid(e.toString("hex")) : typeof e.toHexString == "function" && ue && (e.id instanceof ue || typeof e.id == "string") ? e.id.length === 12 || e.id.length === 24 && me.test(e.id) : !1;
398
- };
399
- d.prototype = {
400
- constructor: d,
401
- /**
402
- * Return the ObjectID id as a 24 byte hex string representation
403
- *
404
- * @return {String} return the 24 byte hex string representation.
405
- * @api public
406
- */
407
- toHexString: function() {
408
- if (!this.id || !this.id.length)
409
- throw new Error(
410
- "invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [" + JSON.stringify(this.id) + "]"
411
- );
412
- if (this.id.length === 24)
413
- return this.id;
414
- if (K(this.id))
415
- return this.id.toString("hex");
416
- for (var e = "", s = 0; s < this.id.length; s++)
417
- e += _e[this.id.charCodeAt(s)];
418
- return e;
419
- },
420
- /**
421
- * Compares the equality of this ObjectID with `otherID`.
422
- *
423
- * @param {Object} otherId ObjectID instance to compare against.
424
- * @return {Boolean} the result of comparing two ObjectID's
425
- * @api public
426
- */
427
- equals: function(e) {
428
- return e instanceof d ? this.toString() === e.toString() : typeof e == "string" && d.isValid(e) && e.length === 12 && K(this.id) ? e === this.id.toString("binary") : typeof e == "string" && d.isValid(e) && e.length === 24 ? e.toLowerCase() === this.toHexString() : typeof e == "string" && d.isValid(e) && e.length === 12 ? e === this.id : e != null && (e instanceof d || e.toHexString) ? e.toHexString() === this.toHexString() : !1;
429
- },
430
- /**
431
- * Returns the generation date (accurate up to the second) that this ID was generated.
432
- *
433
- * @return {Date} the generation date
434
- * @api public
435
- */
436
- getTimestamp: function() {
437
- var e = /* @__PURE__ */ new Date(), s;
438
- return K(this.id) ? s = this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24 : s = this.id.charCodeAt(3) | this.id.charCodeAt(2) << 8 | this.id.charCodeAt(1) << 16 | this.id.charCodeAt(0) << 24, e.setTime(Math.floor(s) * 1e3), e;
439
- },
440
- /**
441
- * Generate a 12 byte id buffer used in ObjectID's
442
- *
443
- * @method
444
- * @param {number} [time] optional parameter allowing to pass in a second based timestamp.
445
- * @return {string} return the 12 byte id buffer string.
446
- */
447
- generate: function(e) {
448
- typeof e != "number" && (e = ~~(Date.now() / 1e3)), e = parseInt(e, 10) % 4294967295;
449
- var s = Ze();
450
- return String.fromCharCode(
451
- e >> 24 & 255,
452
- e >> 16 & 255,
453
- e >> 8 & 255,
454
- e & 255,
455
- q >> 16 & 255,
456
- q >> 8 & 255,
457
- q & 255,
458
- pe >> 8 & 255,
459
- pe & 255,
460
- s >> 16 & 255,
461
- s >> 8 & 255,
462
- s & 255
463
- );
464
- }
465
- };
466
- function Ze() {
467
- return de = (de + 1) % 16777215;
468
- }
469
- function en(e, s) {
470
- return s = s.toString(16), s.length === e ? s : "00000000".substring(s.length, e) + s;
471
- }
472
- var nn = Symbol && Symbol.for && Symbol.for("nodejs.util.inspect.custom") || "inspect";
473
- d.prototype[nn] = function() {
474
- return "ObjectID(" + this + ")";
475
- };
476
- d.prototype.toJSON = d.prototype.toHexString;
477
- d.prototype.toString = d.prototype.toHexString;
478
- const tn = /* @__PURE__ */ Oe(Qe), on = {
479
- key: 0,
480
- class: "grid grid-cols-1 gap-8"
481
- }, sn = { class: "flex items-center gap-8" }, an = { class: "flex items-center gap-8" }, rn = 5, ln = /* @__PURE__ */ Q({
482
- __name: "CardDesignSheet",
483
- emits: ["success"],
484
- setup(e, { expose: s, emit: b }) {
485
- const { minor: U } = ce, S = ee(), w = Ae(), k = h(!1);
486
- h(), h(!1);
487
- const f = h(), v = h(null);
488
- F(() => {
489
- var m, l;
490
- return Math.min((((l = (m = f.value) == null ? void 0 : m.design) == null ? void 0 : l.length) ?? 0) + 1, rn);
491
- });
492
- const P = b, a = F(() => {
493
- var m, l;
494
- return ((l = (m = S.membership) == null ? void 0 : m.design) == null ? void 0 : l.filter((c) => c.image)) || [];
495
- }), N = h(!1);
496
- function D(m) {
497
- N.value = m;
498
- }
499
- function H() {
500
- k.value = !0;
501
- }
502
- async function R() {
503
- await U(
504
- async () => {
505
- var c;
506
- const m = De(f.value), l = xe.parse(m);
507
- if (l.design = (l == null ? void 0 : l.design) || [], v.value) {
508
- const i = tn().toHexString(), t = await re.update(
509
- re.designPath(i, v.value),
510
- v.value
511
- );
512
- (c = l.design) == null || c.push({
513
- _id: i,
514
- image: t
515
- });
516
- }
517
- await ne.update(l), await r(), await P("success"), v.value = null, k.value = !1;
518
- },
519
- {
520
- message: "Saving card design",
521
- successMessage: "Card design saved"
522
- }
523
- );
524
- }
525
- async function p(m, l) {
526
- m ? v.value = m : l && w.open({
527
- title: "Delete Design",
528
- message: "Are you sure you want to delete this design?",
529
- primaryActions: { text: "Delete", close: !0 },
530
- secondaryActions: { text: "Cancel", close: !1 }
531
- }).onPrimary(async () => {
532
- var i, t;
533
- const c = (i = f.value.design) == null ? void 0 : i.findIndex((C) => C._id == l);
534
- console.log(c), c !== -1 && ((t = f.value.design) == null || t.splice(c, 1)), await R();
535
- }).onSecondary(() => {
536
- w.close();
537
- });
538
- }
539
- async function r() {
540
- await S.readMembership(), f.value = S.membership;
541
- }
542
- return s({
543
- showSheet: D
544
- }), Z(async () => {
545
- await r(), a.value.length || (k.value = !0);
546
- }), (m, l) => {
547
- const c = E("FmButton"), i = E("FmSideSheet");
548
- return _(), O(i, {
549
- "max-width": 560,
550
- "dismiss-away": !0,
551
- header: "Manage Design",
552
- modelValue: n(N),
553
- "onUpdate:modelValue": [
554
- l[2] || (l[2] = (t) => z(N) ? N.value = t : null),
555
- l[3] || (l[3] = (t) => N.value = t)
556
- ]
557
- }, Re({
558
- default: y(() => [
559
- n(k) ? A("", !0) : (_(), x("div", on, [
560
- (_(!0), x(B, null, J(n(a), (t) => (_(), O(le, {
561
- key: String(t._id),
562
- "image-fit": "cover",
563
- label: "",
564
- "aspect-ratio": "16/9",
565
- thumbnail: t.image,
566
- accept: ".png, .jpg, .jpeg, .gif",
567
- "recommended-size": "Recommended 16:9 ratio / 1280px x 720px",
568
- file: void 0,
569
- "delete-button": !1
570
- }, {
571
- "delete-button": y(() => [
572
- u(c, {
573
- class: "!text-neutral-50 !bg-neutral-700",
574
- icon: "delete",
575
- variant: "tertiary",
576
- onClick: (C) => p(null, t._id)
577
- }, null, 8, ["onClick"])
578
- ]),
579
- _: 2
580
- }, 1032, ["thumbnail"]))), 128))
581
- ])),
582
- n(k) ? (_(), O(le, {
583
- key: 1,
584
- "image-fit": "cover",
585
- label: "",
586
- "aspect-ratio": "16/9",
587
- accept: ".png, .jpg, .jpeg, .gif",
588
- "recommended-size": "Recommended 16:9 ratio / 1280px x 720px",
589
- "onUpdate:file": p
590
- })) : A("", !0)
591
- ]),
592
- _: 2
593
- }, [
594
- n(k) ? {
595
- name: "side-sheet-footer",
596
- fn: y(() => [
597
- g("div", an, [
598
- u(c, {
599
- label: "Save",
600
- onClick: R,
601
- disabled: !n(v)
602
- }, null, 8, ["disabled"]),
603
- u(c, {
604
- label: "Cancel",
605
- type: "button",
606
- variant: "tertiary",
607
- onClick: l[1] || (l[1] = (t) => k.value = !1)
608
- })
609
- ])
610
- ]),
611
- key: "1"
612
- } : {
613
- name: "side-sheet-footer",
614
- fn: y(() => [
615
- g("div", sn, [
616
- u(c, {
617
- label: "Add Design",
618
- onClick: H
619
- }),
620
- u(c, {
621
- label: "Cancel",
622
- type: "button",
623
- variant: "tertiary",
624
- onClick: l[0] || (l[0] = (t) => N.value = !1)
625
- })
626
- ])
627
- ]),
628
- key: "0"
629
- }
630
- ]), 1032, ["modelValue"]);
631
- };
632
- }
633
- }), dn = { class: "flex items-center" }, pn = /* @__PURE__ */ g("span", { class: "fm-typo-en-title-sm-800" }, " Card ", -1), un = { class: "px-24 flex flex-col pb-24" }, mn = { class: "flex items-center justify-end py-4 xs:hidden" }, Hn = /* @__PURE__ */ Q({
634
- __name: "Card",
635
- setup(e) {
636
- const s = h(), b = h(), U = Ne(), S = ee(), w = F(
637
- () => S.sortedStoreCategories.flatMap((p) => p.bundles)
638
- ), k = [
639
- {
640
- header: "Card Number",
641
- accessorFn: (p) => p.serialNumber
642
- },
643
- {
644
- header: "Redeemed by",
645
- accessorKey: "user",
646
- enableSorting: !1,
647
- cell(p) {
648
- const r = p.row.original.pf_member;
649
- return X(
650
- "div",
651
- {
652
- class: "flex items-center gap-x-8"
653
- },
654
- [
655
- X(ye.FmAvatar, {
656
- name: r != null && r.photoUrl || r == null ? void 0 : r.name,
657
- src: (r == null ? void 0 : r.photoUrl) ?? void 0,
658
- size: "sm"
659
- }),
660
- X("span", { class: "fm-typo-en-body-sm-400" }, r == null ? void 0 : r.name)
661
- ]
662
- );
663
- }
664
- },
665
- {
666
- header: "Phone",
667
- accessorFn: (p) => {
668
- var r;
669
- return ((r = p.pf_member) == null ? void 0 : r.phoneNumber) || "-";
670
- }
671
- },
672
- {
673
- header: "Created at",
674
- accessorKey: "_id",
675
- accessorFn: (p) => ae(Be(p._id.toString())).format("DD MMM YYYY hh:mmA")
676
- },
677
- {
678
- header: "Bundle",
679
- accessorFn: (p) => {
680
- var r;
681
- return ((r = w.value.find((m) => m._id === p.bundle)) == null ? void 0 : r.name) || "-";
682
- }
683
- },
684
- {
685
- header: "Redeemed at",
686
- accessorFn: (p) => p.redeemedAt ? ae(p.redeemedAt).format("DD MMM YYYY hh:mmA") : "-"
687
- }
688
- ], { tableMeta: f, rowData: v, onSort: P, debouncedFetchData: a, onSearch: N } = we(ne.readCards);
689
- async function D() {
690
- var p;
691
- await a(), (p = s.value) == null || p.showSheet(!1);
692
- }
693
- const H = F(() => U.isPremium ? [
694
- {
695
- label: "Create cards",
696
- value: "create",
697
- isPrimary: !0
698
- },
699
- {
700
- label: "Manage Design",
701
- value: "design",
702
- isPrimary: !0
703
- }
704
- ] : []);
705
- async function R(p) {
706
- const r = new Fe(), m = p.map((l) => ({
707
- CardNumber: l
708
- }));
709
- r.addRecords(m), await Ue(
710
- r.buildExcel(),
711
- `cards-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
712
- {
713
- bookType: "xlsx",
714
- bookSST: !1,
715
- type: "array"
716
- }
717
- );
718
- }
719
- return Z(async () => {
720
- await U.readPremium(), await S.readMemberStore(), await S.readMembership(), await D();
721
- }), (p, r) => {
722
- const m = E("FmChip"), l = E("FmPageHead"), c = E("FmSearch");
723
- return _(), x(B, null, [
724
- u(l, {
725
- title: "Card",
726
- actions: n(H),
727
- "onClick:action": r[0] || (r[0] = (i) => {
728
- var t, C;
729
- console.log(i), i === "design" && ((t = n(b)) == null || t.showSheet(!0)), i === "create" && ((C = n(s)) == null || C.showSheet(!0));
730
- })
731
- }, {
732
- title: y(() => [
733
- g("div", dn, [
734
- pn,
735
- n(U).isPremium ? A("", !0) : (_(), O(m, {
736
- key: 0,
737
- class: "ml-8",
738
- label: "Premium"
739
- }))
740
- ])
741
- ]),
742
- _: 1
743
- }, 8, ["actions"]),
744
- g("div", un, [
745
- u(c, {
746
- class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
747
- modelValue: n(f).searchValue,
748
- "onUpdate:modelValue": r[1] || (r[1] = (i) => n(f).searchValue = i),
749
- placeholder: "Search",
750
- collapsible: ""
751
- }, null, 8, ["modelValue"]),
752
- g("div", mn, [
753
- u(c, {
754
- modelValue: n(f).searchValue,
755
- "onUpdate:modelValue": r[2] || (r[2] = (i) => n(f).searchValue = i),
756
- placeholder: "Search",
757
- collapsible: ""
758
- }, null, 8, ["modelValue"])
759
- ]),
760
- u(He, {
761
- loading: n(f).isLoading,
762
- "row-data": n(v),
763
- "row-count": n(f).totalRows,
764
- "column-defs": k,
765
- "shrink-at": !1,
766
- "page-count": n(f).pageCount,
767
- "page-index": n(f).pageIndex,
768
- "page-size": n(f).pageSize,
769
- onSortChange: n(P),
770
- onPageChange: r[3] || (r[3] = (i) => {
771
- n(a)({ pageSize: i.pageSize, pageIndex: i.pageIndex });
772
- })
773
- }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
774
- u(Je, {
775
- ref_key: "sheetRef",
776
- ref: s,
777
- onSuccess: D,
778
- onExport: R
779
- }, null, 512),
780
- u(ln, {
781
- ref_key: "designSheetRef",
782
- ref: b,
783
- onSuccess: D
784
- }, null, 512)
785
- ])
786
- ], 64);
787
- };
788
- }
789
- });
790
- export {
791
- Hn as default
792
- };