@feedmepos/mf-connect 0.1.98-beta.45 → 0.1.98-beta.47

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 (115) hide show
  1. package/dist/{App-BX2UE7QI.js → App-JFPlzU0L.js} +8 -8
  2. package/dist/{AuditLogs-Crhi9QVp.js → AuditLogs-Bk6QCZgp.js} +10 -10
  3. package/dist/{Bin-xPurvadn.js → Bin-CHi79olc.js} +8 -8
  4. package/dist/{Broadcast-CUYyGJY-.js → Broadcast-DSicPemE.js} +11 -11
  5. package/dist/{CampaignAnalytic-BfUdUO6Y.js → CampaignAnalytic-B3czdnvb.js} +6 -6
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BoXhFyzX.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CkC0A-ix.js} +7 -7
  7. package/dist/{Card-CISdGnSl.js → Card-Begf7uD_.js} +20 -20
  8. package/dist/{Collections-N7QyYqC-.js → Collections-BSmTzG4a.js} +8 -8
  9. package/dist/{Credit-DpgSuzmF.js → Credit-BqZ9lr6S.js} +12 -12
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ber_smZ-.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-qMqks3fR.js} +32 -32
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CoJVTW3E.js → EffectSheet.vue_vue_type_style_index_0_lang-Ck2PxSye.js} +6 -6
  12. package/dist/{Experience-DO7c3BW8.js → Experience-i0bu7uAI.js} +12 -12
  13. package/dist/{FileSaver.min-Bjq1OZ_L.js → FileSaver.min-Ck6lXfKM.js} +1 -1
  14. package/dist/{Game-BHtJD6LM.js → Game-Be02GnjR.js} +13 -13
  15. package/dist/GiftCardSetup-DPN3NhND.js +662 -0
  16. package/dist/{Grab-BOMxmAcZ.js → Grab-BKIYI2d-.js} +9 -9
  17. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-bEHeJol7.js → ImageInput.vue_vue_type_script_setup_true_lang-BqylTCHX.js} +1 -1
  18. package/dist/{Index-S2H2GVM8.js → Index-BD_l8T_M.js} +10 -10
  19. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-cgXkx7R_.js → LocationPicker.vue_vue_type_script_setup_true_lang-Cch5RizQ.js} +1 -1
  20. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CQQJuVCF.js → LottieAnimation.vue_vue_type_script_setup_true_lang-D3psJutm.js} +1 -1
  21. package/dist/{LoyaltyDashboard-CbwiKazp.js → LoyaltyDashboard-D0eq0Gaw.js} +7 -7
  22. package/dist/{MainLayout-CPS8NNOv.js → MainLayout-C96xSNND.js} +3 -3
  23. package/dist/{Marketing-zIfCm74o.js → Marketing-Bg6DFKg5.js} +4 -4
  24. package/dist/{MarketingMaterialEdit-D8Gj0bOa.js → MarketingMaterialEdit-BYbWgB2R.js} +6 -6
  25. package/dist/Member-B4NAFx8G.js +573 -0
  26. package/dist/MemberImportHistory-Bw-M3Zx-.js +185 -0
  27. package/dist/{MemberList-CzLYfaf5.js → MemberList-DXpa6_Rb.js} +26 -26
  28. package/dist/{MemberTransactions-CeaEuCte.js → MemberTransactions-DEzFrc9e.js} +1 -1
  29. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BDqO9M6_.js → MessageInput.vue_vue_type_script_setup_true_lang-CFpMazFG.js} +9 -9
  30. package/dist/{Mission-B4UV0vB0.js → Mission-CWeWfTdC.js} +13 -13
  31. package/dist/{Overview-Ddua14pp.js → Overview-CPMN5kuM.js} +3 -3
  32. package/dist/{Overview-DIX5ot1i.js → Overview-De06lJt0.js} +19 -19
  33. package/dist/{Point-CIFEhEU0.js → Point-XfVYDIbj.js} +12 -12
  34. package/dist/{Promotion-DJRRCgsu.js → Promotion-Q646p6RE.js} +13 -13
  35. package/dist/{Queue-PxS_JYvd.js → Queue-BNfc0ySV.js} +11 -11
  36. package/dist/{Record-DbOoWfsG.js → Record-Dx5pZmpm.js} +9 -9
  37. package/dist/{Review-BmUzIF6a.js → Review-BX5Z5ivr.js} +2 -2
  38. package/dist/{ReviewFacebookCallback-ABDk27W_.js → ReviewFacebookCallback-B6GFP04-.js} +5 -5
  39. package/dist/{ReviewGoogleCallback-JiGhuvNs.js → ReviewGoogleCallback-BWgxTbuf.js} +5 -5
  40. package/dist/{Reward-C9JJh35t.js → Reward-DOImZVUL.js} +16 -16
  41. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CoHS8BGv.js → RewardGroup.vue_vue_type_script_setup_true_lang-8fuZmrBK.js} +12 -12
  42. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CH_hNR0X.js → RuleGroup.vue_vue_type_script_setup_true_lang-C9kWB5Zw.js} +15 -15
  43. package/dist/{Segment-BDF6homc.js → Segment-BndDCfLd.js} +25 -25
  44. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CotltnlA.js → SelectItems.vue_vue_type_script_setup_true_lang-DV1X7e-_.js} +2 -2
  45. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dm1Rm5yj.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-O9ohGQxg.js} +13 -13
  46. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bu3TFRAU.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-D2knZbHq.js} +4 -4
  47. package/dist/{Setting-I1UmwNUM.js → Setting-DPm0lJmq.js} +14 -14
  48. package/dist/{SettingAdvertisements-BTSCR7Ca.js → SettingAdvertisements-DdPGyRNI.js} +12 -12
  49. package/dist/{Settings-F8t7rjZL.js → Settings-BQPDUWyz.js} +5 -5
  50. package/dist/{Store-DH9SeWMt.js → Store-Cw-c2Wgl.js} +24 -24
  51. package/dist/{StoreRewards-EkAXltsf.js → StoreRewards-CYkHL-h6.js} +15 -15
  52. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CXQyU9vZ.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DClGeare.js} +21 -21
  53. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-lnEbqNTU.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DekQ8_F8.js} +2 -2
  54. package/dist/{Tier-DuKpa1Ma.js → Tier-B7QmbFn8.js} +25 -25
  55. package/dist/{Title-DlupKRiB.js → Title-CRM_l4YE.js} +22 -22
  56. package/dist/{Transaction-jCh6b6-e.js → Transaction-C1jXS8Le.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DOvKneyI.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-yPF04Hth.js} +6 -6
  58. package/dist/{Voucher-QOyU02Mg.js → Voucher-Cfh_Wudx.js} +14 -14
  59. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DH3SHPmi.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BkiXzbFh.js} +12 -12
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DA98LDj7.js → ZodTextField.vue_vue_type_script_setup_true_lang-BEFynSZm.js} +2 -2
  61. package/dist/{app-CNi4ejgf.js → app-CEWVaJEZ.js} +502 -447
  62. package/dist/app.js +1 -1
  63. package/dist/{business-D_DxmzRi.js → business-DWLMb2lG.js} +5 -5
  64. package/dist/{campaign-CQOgVXhK.js → campaign-DRJO5ydK.js} +2 -2
  65. package/dist/{campaign-DgLtIuZl.js → campaign-DwYJGuSz.js} +7 -7
  66. package/dist/{campaign.fn-DaygvaVk.js → campaign.fn-CPfN51jT.js} +38 -38
  67. package/dist/{collection.fn-C2FPUyIL.js → collection.fn-j4_hDjjy.js} +2 -2
  68. package/dist/{duplicateCampaign-C1GvaB0K.js → duplicateCampaign-CQ-yfh9b.js} +2 -2
  69. package/dist/{effect-CZW6UzGQ.js → effect-DU8lcl8m.js} +1 -1
  70. package/dist/{email-addresses-C0rpNk69.js → email-addresses-DUpMDrGS.js} +2 -2
  71. package/dist/{export-BljjhGlT.js → export-BFMh5l4w.js} +3 -3
  72. package/dist/{helper-BNVm1awI.js → helper-DSvUKuiG.js} +1 -1
  73. package/dist/{index-BTMG_CZc.js → index--mkEqsYz.js} +5 -4
  74. package/dist/{index-B3VxErFJ.js → index-B-tBxRw2.js} +1 -1
  75. package/dist/{index-_RZ5EbvD.js → index-BVWwOMHO.js} +7 -7
  76. package/dist/{index-ChPTYhTe.js → index-C69TnizM.js} +1 -1
  77. package/dist/{index-BLcxRCDQ.js → index-CDyGueuB.js} +13 -13
  78. package/dist/{index-Bl2Io2q7.js → index-CWEtTfxy.js} +2 -2
  79. package/dist/index-CWbvBvE3.js +137 -0
  80. package/dist/{index-ClMqJYPu.js → index-CrKfbYDf.js} +1194 -1150
  81. package/dist/{index--l25G-H2.js → index-CuyxKvmh.js} +2 -2
  82. package/dist/{index-jN921Dx6.js → index-CvVrgPmm.js} +3 -3
  83. package/dist/{index-CuSyySq9.js → index-CvaF2wtX.js} +1 -1
  84. package/dist/{index-CP9JOHTI.js → index-D-swy6qD.js} +1 -1
  85. package/dist/{index-CTDIDrHN.js → index-D8_jwrSU.js} +14 -14
  86. package/dist/{index-20y5ETqa.js → index-DCbCuJXP.js} +1 -1
  87. package/dist/{index-C41OQn3b.js → index-DD3Jlx01.js} +1 -1
  88. package/dist/{index-IL6JQ0Uk.js → index-DLZ_cPwd.js} +1 -1
  89. package/dist/{index-aRRiC6b9.js → index-rZdY3BW8.js} +7 -7
  90. package/dist/{index.esm2017-D2J5P0Jx.js → index.esm2017-B2wpsz6n.js} +1 -1
  91. package/dist/{loading-fSLeqKr_.js → loading-BHHf9MeD.js} +1 -1
  92. package/dist/{lodash-CanxPAR4.js → lodash-zHycpMIs.js} +1 -1
  93. package/dist/member-import-MTwvl8TG.js +143 -0
  94. package/dist/{membership-BrdyfO2y.js → membership-Ctqa96gd.js} +2 -2
  95. package/dist/{money-W_YTwyxP.js → money-C9m7TfMA.js} +1 -1
  96. package/dist/{number-j1vVuQpy.js → number-ng88zCwj.js} +1 -1
  97. package/dist/{objectid-DhwxE2Ct.js → objectid-BTsufz4u.js} +6 -6
  98. package/dist/{plugins-2XgEvjxm.js → plugins-MY2whJpz.js} +3 -3
  99. package/dist/{reward-Bk3FZbGj.js → reward-DiiV8MQE.js} +1 -1
  100. package/dist/{rule-M9AijHS0.js → rule-C31n55fZ.js} +3 -3
  101. package/dist/{rule-builder-C4yj8l-c.js → rule-builder-BVEerrEc.js} +1 -1
  102. package/dist/{template-BguoWqRC.js → template-CtcRYRZb.js} +6 -6
  103. package/dist/{timezone-DdkTIxnK.js → timezone-Ck4iMIrt.js} +1 -1
  104. package/dist/{transaction.fn-BpfxFtTu.js → transaction.fn-BI0-LgQG.js} +1 -1
  105. package/dist/{trigger-C7MXRREg.js → trigger-_5hAtyky.js} +5 -5
  106. package/dist/{useMarketingMaterialActions-CgJpHDNv.js → useMarketingMaterialActions-CX9qJp_O.js} +3 -3
  107. package/dist/{usePagination-Csc19YZ0.js → usePagination-DZKDMzEh.js} +1 -1
  108. package/dist/{user-DCwNBNr2.js → user-C-Db5JiY.js} +1 -1
  109. package/dist/{vue-i18n-BIpsBqfV.js → vue-i18n-BbF7bmsx.js} +204 -204
  110. package/dist/{xlsx-Esg-74Jx.js → xlsx-CzpvTfCU.js} +1 -1
  111. package/dist/{zod-D9ri6sIU.js → zod-HtL78lno.js} +1 -1
  112. package/package.json +1 -1
  113. package/dist/GiftCardSetup-Dg-kNVsD.js +0 -633
  114. package/dist/Member-Wf4LUqGi.js +0 -281
  115. package/dist/index-sBl1JAut.js +0 -85
@@ -1,633 +0,0 @@
1
- import { defineComponent as Ge, computed as g, ref as c, onMounted as Xe, resolveComponent as w, openBlock as d, createElementBlock as m, createElementVNode as o, createVNode as r, toDisplayString as s, unref as e, withCtx as T, isRef as y, Fragment as G, renderList as X, normalizeClass as Ce, createCommentVNode as _, withDirectives as Be, withKeys as je, vModelText as ze, createBlock as ne, createTextVNode as le } from "vue";
2
- import { u as qe } from "./loading-fSLeqKr_.js";
3
- import { u as Ke } from "./app-wDQR6dpb.js";
4
- import { n as E, f as S } from "./plugins-2XgEvjxm.js";
5
- import "./index-C41OQn3b.js";
6
- import { g as ae } from "./index-ChPTYhTe.js";
7
- import { c as We } from "./index-B3VxErFJ.js";
8
- import { S as Ze } from "./index-BTMG_CZc.js";
9
- import { p as W, q as Qe, G as B, r as se } from "./index-ClMqJYPu.js";
10
- import { u as Ye } from "./vue-i18n-BIpsBqfV.js";
11
- import { useRouter as Je, useRoute as et } from "vue-router";
12
- import { R as tt } from "./app-CNi4ejgf.js";
13
- var ot = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
14
- const nt = { class: "px-24 pb-40" }, lt = { class: "flex items-start gap-12 py-24" }, at = { class: "flex flex-col gap-4" }, st = { class: "fm-typo-en-title-md-800 text-fm-color-typo-primary" }, rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ct = { class: "flex flex-col gap-16 max-w-[860px]" }, it = { class: "flex gap-12" }, dt = { class: "flex flex-col gap-4" }, ut = { class: "fm-typo-en-body-lg-600" }, mt = { class: "flex gap-12" }, ft = { class: "flex flex-col gap-4" }, pt = { class: "fm-typo-en-body-lg-600" }, vt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gt = { class: "flex flex-wrap gap-12" }, yt = ["src"], xt = { class: "absolute top-4 right-4 flex gap-4" }, bt = { class: "flex gap-12" }, _t = { class: "flex flex-col gap-4" }, Ct = { class: "fm-typo-en-body-lg-600" }, ht = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, At = { class: "flex flex-col gap-8" }, wt = ["onClick"], kt = {
15
- key: 0,
16
- class: "w-[9px] h-[9px] rounded-full bg-fm-color-primary"
17
- }, Dt = { class: "flex-1" }, Ut = { class: "block fm-typo-en-body-md-600" }, Nt = { class: "block fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-2" }, Ft = {
18
- key: 0,
19
- class: "grid sm:grid-cols-2 gap-16"
20
- }, Vt = { class: "flex items-center gap-16 p-16 rounded-md bg-fm-color-neutral-gray-100" }, Tt = { class: "flex flex-col gap-2 flex-1 min-w-0" }, Et = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, St = { class: "fm-typo-en-body-lg-600 truncate" }, Mt = { class: "flex gap-12" }, Pt = { class: "flex flex-col gap-4" }, It = { class: "fm-typo-en-body-lg-600" }, Lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $t = { class: "flex flex-col gap-8" }, Rt = { class: "fm-typo-en-body-md-600" }, Ht = { class: "flex flex-wrap gap-8" }, Ot = { class: "flex items-start gap-8" }, Gt = { class: "flex items-center rounded-md border-1 border-fm-color-neutral-gray-300 overflow-hidden" }, Xt = ["placeholder"], Bt = {
21
- key: 0,
22
- class: "flex flex-wrap gap-8"
23
- }, jt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, zt = { class: "text-fm-color-primary" }, qt = { class: "flex items-center gap-12 p-16 rounded-md border-1 border-fm-color-neutral-gray-300" }, Kt = { class: "flex-1" }, Wt = { class: "fm-typo-en-body-md-600" }, Zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qt = {
24
- key: 1,
25
- class: "flex gap-16"
26
- }, Yt = {
27
- key: 2,
28
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-error"
29
- }, Jt = { class: "flex gap-12" }, eo = { class: "flex flex-col gap-4" }, to = { class: "fm-typo-en-body-lg-600" }, oo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, no = {
30
- key: 0,
31
- class: "flex items-start gap-12 p-16 rounded-md bg-fm-color-system-info-100"
32
- }, lo = { class: "flex-1 fm-typo-en-body-md-400 text-fm-color-typo-primary" }, ao = { class: "flex items-center gap-12" }, so = { class: "fm-typo-en-body-md-500" }, ro = { class: "flex flex-col gap-8" }, co = { class: "fm-typo-en-body-md-600" }, io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, uo = { class: "flex flex-wrap gap-8" }, mo = {
33
- key: 0,
34
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
35
- }, fo = {
36
- key: 1,
37
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-error"
38
- }, po = { class: "flex gap-12" }, vo = { class: "flex flex-col gap-4" }, go = { class: "fm-typo-en-body-lg-600" }, yo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xo = { class: "flex flex-wrap items-center gap-8" }, bo = {
39
- key: 1,
40
- class: "flex items-center gap-8 fm-typo-en-body-md-400"
41
- }, _o = ["href"], Co = { class: "flex items-center justify-end gap-8 pt-8" }, he = 5e6, Po = /* @__PURE__ */ Ge({
42
- __name: "GiftCardSetup",
43
- setup(ho) {
44
- const { t: n } = Ye(), { global: Ae, minor: j } = qe, we = Je(), ke = et(), M = g(() => ke.params.id || null), z = g(() => !!M.value), D = c(""), v = c([]), re = c(null), Z = c(null);
45
- let ce = /* @__PURE__ */ new Set();
46
- const ie = /* @__PURE__ */ new Set(), De = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/gif"]), k = c("DEFAULT"), P = c(16), I = c(W().charset), L = c("GC"), $ = c(""), de = c(0), Q = [10, 20, 30, 50, 100], u = c([]), U = c(""), C = c(!1), N = c(10), F = c(100), ue = c(!1), R = c(!0), x = c(["SMS"]), Y = c({
47
- SMS: !0,
48
- WHATSAPP: !1,
49
- EMAIL: !1
50
- }), me = g(
51
- () => ["SMS", "WHATSAPP", "EMAIL"].map((l) => ({
52
- value: l,
53
- label: n(`connect.store.giftCard.channel${l}`),
54
- available: Y.value[l]
55
- }))
56
- ), fe = g(
57
- () => me.value.filter((l) => !l.available).map((l) => l.label)
58
- ), Ue = `${ot.licensePortalUrl}settings?businessId=${Ze.businessId}`;
59
- function Ne(l) {
60
- !Y.value[l] && !x.value.includes(l) || (x.value = x.value.includes(l) ? x.value.filter((t) => t !== l) : [...x.value, l]);
61
- }
62
- async function Fe() {
63
- try {
64
- Y.value = await We.readBroadcastChannels();
65
- } catch (l) {
66
- console.error("Failed to load notification channel status", l);
67
- }
68
- }
69
- const b = c("NONE"), H = c(""), V = c(""), pe = g(
70
- () => k.value === "ADVANCED" ? {
71
- ...W(),
72
- length: Number(P.value),
73
- charset: I.value,
74
- prefix: L.value,
75
- suffix: $.value
76
- } : W()
77
- ), Ve = g(() => (de.value, Qe(pe.value))), ve = g(
78
- () => u.value.length >= B
79
- );
80
- function ge(l) {
81
- if (u.value.includes(l)) {
82
- u.value = u.value.filter((t) => t !== l);
83
- return;
84
- }
85
- if (ve.value) {
86
- E.error(
87
- n("connect.store.giftCard.maxAmounts", {
88
- max: B
89
- })
90
- );
91
- return;
92
- }
93
- u.value = [...u.value, l].sort((t, i) => t - i);
94
- }
95
- function ye() {
96
- const l = Number(U.value);
97
- if (!Number.isInteger(l) || l <= 0) {
98
- E.error(n("connect.store.giftCard.invalidAmount"));
99
- return;
100
- }
101
- if (l > se) {
102
- E.error(
103
- n("connect.store.giftCard.amountTooLarge", { max: se })
104
- );
105
- return;
106
- }
107
- if (u.value.includes(l)) {
108
- U.value = "";
109
- return;
110
- }
111
- if (ve.value) {
112
- E.error(
113
- n("connect.store.giftCard.maxAmounts", {
114
- max: B
115
- })
116
- );
117
- return;
118
- }
119
- u.value = [...u.value, l].sort((t, i) => t - i), U.value = "";
120
- }
121
- const J = g(() => u.value.length === 0 && !C.value ? n("connect.store.giftCard.errorNoAmount") : C.value && Number(N.value) > Number(F.value) ? n("connect.store.giftCard.errorRange") : null), Te = g(
122
- () => D.value.trim() ? null : n("connect.store.giftCard.errorNoName")
123
- ), ee = g(
124
- () => x.value.length ? null : n("connect.store.giftCard.errorNoChannel")
125
- ), te = g(
126
- () => Te.value ?? J.value ?? ee.value
127
- );
128
- async function Ee(l) {
129
- be(l) && await j(
130
- async () => {
131
- const t = await xe(l);
132
- v.value = [...v.value, t];
133
- },
134
- {
135
- message: n("connect.store.giftCard.uploading"),
136
- successMessage: n("connect.store.giftCard.uploaded")
137
- }
138
- );
139
- }
140
- function xe(l) {
141
- return S.update(
142
- S.bundleImagePath(void 0, l),
143
- l
144
- );
145
- }
146
- function be(l) {
147
- const t = De.has(l.type) && l.size <= he;
148
- return t || E.error(n("connect.store.giftCard.invalidDesignFile")), t;
149
- }
150
- function Se(l) {
151
- var t;
152
- Z.value = l, (t = re.value) == null || t.click();
153
- }
154
- async function Me(l) {
155
- var p;
156
- const t = l.target, i = Z.value, f = (p = t.files) == null ? void 0 : p[0];
157
- t.value = "", Z.value = null, !(i === null || !f || !be(f)) && await j(
158
- async () => {
159
- const h = v.value[i];
160
- if (!h) return;
161
- const A = await xe(f);
162
- v.value = v.value.map(
163
- (q, K) => K === i ? A : q
164
- ), await _e(h);
165
- },
166
- {
167
- message: n("connect.store.giftCard.uploading"),
168
- successMessage: n("connect.store.giftCard.uploaded")
169
- }
170
- );
171
- }
172
- async function Pe(l) {
173
- v.value = v.value.filter((t) => t !== l), await _e(l);
174
- }
175
- async function _e(l) {
176
- if (ce.has(l)) {
177
- ie.add(l);
178
- return;
179
- }
180
- try {
181
- await S.delete(l);
182
- } catch {
183
- }
184
- }
185
- async function Ie(l) {
186
- await j(
187
- async () => {
188
- V.value = await S.update(
189
- S.bundleImagePath(void 0, l),
190
- l
191
- ), b.value = "DOCUMENT";
192
- },
193
- {
194
- message: n("connect.store.giftCard.uploading"),
195
- successMessage: n("connect.store.giftCard.uploaded")
196
- }
197
- );
198
- }
199
- function Le() {
200
- return {
201
- name: D.value.trim(),
202
- designs: v.value,
203
- numberFormat: pe.value,
204
- denominations: u.value.map(Number),
205
- anyAmount: C.value ? {
206
- enabled: !0,
207
- min: Number(N.value),
208
- max: Number(F.value)
209
- } : null,
210
- channels: x.value,
211
- allowPersonalMessage: R.value,
212
- termsAndConditions: b.value === "TEXT" && H.value || null,
213
- termsDocumentUrl: b.value === "DOCUMENT" && V.value || null
214
- };
215
- }
216
- function $e(l) {
217
- var f, p, h, A;
218
- D.value = l.name, v.value = [...l.designs ?? []], ce = new Set(v.value), u.value = [...l.denominations ?? []], C.value = !!((f = l.anyAmount) != null && f.enabled), N.value = ((p = l.anyAmount) == null ? void 0 : p.min) ?? 10, F.value = ((h = l.anyAmount) == null ? void 0 : h.max) ?? 100, x.value = (A = l.channels) != null && A.length ? [...l.channels] : ["SMS"], R.value = l.allowPersonalMessage ?? !0;
219
- const t = l.numberFormat, i = !t || t.prefix === "GC" && Number(t.length) === 16;
220
- k.value = i ? "DEFAULT" : "ADVANCED", P.value = Number((t == null ? void 0 : t.length) ?? 16), I.value = (t == null ? void 0 : t.charset) ?? W().charset, L.value = (t == null ? void 0 : t.prefix) ?? "GC", $.value = (t == null ? void 0 : t.suffix) ?? "", l.termsDocumentUrl ? (b.value = "DOCUMENT", V.value = l.termsDocumentUrl) : l.termsAndConditions && (b.value = "TEXT", H.value = l.termsAndConditions);
221
- }
222
- function oe() {
223
- we.push({ name: tt["$connect-STORE"] });
224
- }
225
- async function Re() {
226
- if (te.value) {
227
- E.error(te.value);
228
- return;
229
- }
230
- await j(
231
- async () => {
232
- const l = Le();
233
- M.value ? await ae.updateProgram(M.value, l) : await ae.createProgram(l), await Promise.allSettled(
234
- [...ie].map((t) => S.delete(t))
235
- ), oe();
236
- },
237
- {
238
- message: z.value ? n("connect.store.giftCard.saving") : n("connect.store.giftCard.creating"),
239
- successMessage: z.value ? n("connect.store.giftCard.saved") : n("connect.store.giftCard.created")
240
- }
241
- );
242
- }
243
- return Xe(async () => {
244
- await Ae(async () => {
245
- await Fe(), M.value && $e(await ae.readProgram(M.value));
246
- });
247
- }), (l, t) => {
248
- const i = w("FmButton"), f = w("FmTextField"), p = w("FmCard"), h = w("FmDropField"), A = w("FmChip"), q = w("FmSwitch"), K = w("FmIcon"), He = w("FmTextarea");
249
- return d(), m("div", nt, [
250
- o("div", lt, [
251
- r(i, {
252
- icon: "arrow_back",
253
- variant: "tertiary",
254
- onClick: oe
255
- }),
256
- o("div", at, [
257
- o("h1", st, s(e(z) ? e(n)("connect.store.giftCard.editTitle") : e(n)("connect.store.giftCard.createTitle")), 1),
258
- o("p", rt, s(e(n)("connect.store.giftCard.pageSubtitle")), 1)
259
- ])
260
- ]),
261
- o("div", ct, [
262
- r(p, {
263
- variant: "outlined",
264
- class: "p-24 flex flex-col gap-16"
265
- }, {
266
- default: T(() => [
267
- o("div", it, [
268
- t[15] || (t[15] = o("span", { class: "w-[18px] h-[18px] rounded-sm flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary fm-typo-en-body-sm-600" }, " 1 ", -1)),
269
- o("div", dt, [
270
- o("div", ut, s(e(n)("connect.store.giftCard.name")), 1)
271
- ])
272
- ]),
273
- r(f, {
274
- modelValue: e(D),
275
- "onUpdate:modelValue": t[0] || (t[0] = (a) => y(D) ? D.value = a : null),
276
- placeholder: e(n)("connect.store.giftCard.namePlaceholder")
277
- }, null, 8, ["modelValue", "placeholder"])
278
- ]),
279
- _: 1
280
- }),
281
- r(p, {
282
- variant: "outlined",
283
- class: "p-24 flex flex-col gap-16"
284
- }, {
285
- default: T(() => [
286
- o("div", mt, [
287
- t[16] || (t[16] = o("span", { class: "w-[18px] h-[18px] rounded-sm flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary fm-typo-en-body-sm-600" }, " 2 ", -1)),
288
- o("div", ft, [
289
- o("div", pt, s(e(n)("connect.store.giftCard.design")), 1),
290
- o("div", vt, s(e(n)("connect.store.giftCard.designHint")), 1)
291
- ])
292
- ]),
293
- o("div", gt, [
294
- o("input", {
295
- ref_key: "designInput",
296
- ref: re,
297
- type: "file",
298
- accept: ".png,.jpg,.jpeg,.gif",
299
- class: "hidden",
300
- onChange: Me
301
- }, null, 544),
302
- (d(!0), m(G, null, X(e(v), (a, O) => (d(), m("div", {
303
- key: a,
304
- class: "relative w-[160px] aspect-video rounded-md overflow-hidden border-1 border-fm-color-neutral-gray-300"
305
- }, [
306
- o("img", {
307
- src: a,
308
- alt: "",
309
- class: "w-full h-full object-cover"
310
- }, null, 8, yt),
311
- o("div", xt, [
312
- r(i, {
313
- icon: "edit",
314
- variant: "secondary",
315
- "aria-label": e(n)("connect.common.edit"),
316
- title: e(n)("connect.common.edit"),
317
- onClick: (Oe) => Se(O)
318
- }, null, 8, ["aria-label", "title", "onClick"]),
319
- r(i, {
320
- icon: "delete",
321
- variant: "destructive",
322
- "aria-label": e(n)("connect.common.remove"),
323
- title: e(n)("connect.common.remove"),
324
- onClick: (Oe) => Pe(a)
325
- }, null, 8, ["aria-label", "title", "onClick"])
326
- ])
327
- ]))), 128)),
328
- r(h, {
329
- accept: ".png, .jpg, .jpeg, .gif",
330
- "max-file-size": he,
331
- onFileUpload: Ee
332
- })
333
- ])
334
- ]),
335
- _: 1
336
- }),
337
- r(p, {
338
- variant: "outlined",
339
- class: "p-24 flex flex-col gap-16"
340
- }, {
341
- default: T(() => [
342
- o("div", bt, [
343
- t[17] || (t[17] = o("span", { class: "w-[18px] h-[18px] rounded-sm flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary fm-typo-en-body-sm-600" }, " 3 ", -1)),
344
- o("div", _t, [
345
- o("div", Ct, s(e(n)("connect.store.giftCard.numberSettings")), 1),
346
- o("div", ht, s(e(n)("connect.store.giftCard.numberSettingsHint")), 1)
347
- ])
348
- ]),
349
- o("div", At, [
350
- (d(), m(G, null, X(["DEFAULT", "ADVANCED"], (a) => o("button", {
351
- key: a,
352
- type: "button",
353
- class: Ce([
354
- "flex gap-12 items-start text-left p-16 rounded-md border-1 transition-colors",
355
- e(k) === a ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
356
- ]),
357
- onClick: (O) => k.value = a
358
- }, [
359
- o("span", {
360
- class: Ce([
361
- "w-[18px] h-[18px] rounded-full border-1 flex-none mt-2 grid place-items-center",
362
- e(k) === a ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
363
- ])
364
- }, [
365
- e(k) === a ? (d(), m("span", kt)) : _("", !0)
366
- ], 2),
367
- o("span", Dt, [
368
- o("span", Ut, s(a === "DEFAULT" ? e(n)("connect.store.giftCard.numberDefault") : e(n)("connect.store.giftCard.numberAdvanced")), 1),
369
- o("span", Nt, s(a === "DEFAULT" ? e(n)("connect.store.giftCard.numberDefaultHint") : e(n)("connect.store.giftCard.numberAdvancedHint")), 1)
370
- ])
371
- ], 10, wt)), 64))
372
- ]),
373
- e(k) === "ADVANCED" ? (d(), m("div", Ft, [
374
- r(f, {
375
- modelValue: e(P),
376
- "onUpdate:modelValue": t[1] || (t[1] = (a) => y(P) ? P.value = a : null),
377
- type: "number",
378
- label: e(n)("connect.store.giftCard.length")
379
- }, null, 8, ["modelValue", "label"]),
380
- r(f, {
381
- modelValue: e(I),
382
- "onUpdate:modelValue": t[2] || (t[2] = (a) => y(I) ? I.value = a : null),
383
- label: e(n)("connect.store.giftCard.charset")
384
- }, null, 8, ["modelValue", "label"]),
385
- r(f, {
386
- modelValue: e(L),
387
- "onUpdate:modelValue": t[3] || (t[3] = (a) => y(L) ? L.value = a : null),
388
- label: e(n)("connect.store.giftCard.prefix")
389
- }, null, 8, ["modelValue", "label"]),
390
- r(f, {
391
- modelValue: e($),
392
- "onUpdate:modelValue": t[4] || (t[4] = (a) => y($) ? $.value = a : null),
393
- label: e(n)("connect.store.giftCard.suffix")
394
- }, null, 8, ["modelValue", "label"])
395
- ])) : _("", !0),
396
- o("div", Vt, [
397
- o("div", Tt, [
398
- o("span", Et, s(e(n)("connect.store.giftCard.exampleNumber")), 1),
399
- o("span", St, s(e(Ve)), 1)
400
- ]),
401
- r(i, {
402
- label: e(n)("connect.store.giftCard.regenerate"),
403
- icon: "refresh",
404
- variant: "secondary",
405
- onClick: t[5] || (t[5] = (a) => de.value++)
406
- }, null, 8, ["label"])
407
- ])
408
- ]),
409
- _: 1
410
- }),
411
- r(p, {
412
- variant: "outlined",
413
- class: "p-24 flex flex-col gap-16"
414
- }, {
415
- default: T(() => [
416
- o("div", Mt, [
417
- t[18] || (t[18] = o("span", { class: "w-[18px] h-[18px] rounded-sm flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary fm-typo-en-body-sm-600" }, " 4 ", -1)),
418
- o("div", Pt, [
419
- o("div", It, s(e(n)("connect.store.giftCard.amount")), 1),
420
- o("div", Lt, s(e(n)("connect.store.giftCard.amountHint", {
421
- max: e(B)
422
- })), 1)
423
- ])
424
- ]),
425
- o("div", $t, [
426
- o("div", Rt, s(e(n)("connect.store.giftCard.popularAmounts")), 1),
427
- o("div", Ht, [
428
- (d(), m(G, null, X(Q, (a) => r(A, {
429
- key: a,
430
- label: `RM ${a}`,
431
- selectable: "",
432
- selected: e(u).includes(a),
433
- onClick: (O) => ge(a)
434
- }, null, 8, ["label", "selected", "onClick"])), 64))
435
- ])
436
- ]),
437
- o("div", Ot, [
438
- o("div", Gt, [
439
- t[19] || (t[19] = o("span", { class: "px-12 py-8 bg-fm-color-neutral-gray-100 fm-typo-en-body-md-500 text-fm-color-typo-secondary" }, " RM ", -1)),
440
- Be(o("input", {
441
- "onUpdate:modelValue": t[6] || (t[6] = (a) => y(U) ? U.value = a : null),
442
- type: "number",
443
- class: "px-12 py-8 outline-none fm-typo-en-body-md-400 w-[140px]",
444
- placeholder: e(n)("connect.store.giftCard.custom"),
445
- onKeyup: je(ye, ["enter"])
446
- }, null, 40, Xt), [
447
- [ze, e(U)]
448
- ])
449
- ]),
450
- r(i, {
451
- label: e(n)("connect.store.giftCard.addAmount"),
452
- variant: "secondary",
453
- onClick: ye
454
- }, null, 8, ["label"])
455
- ]),
456
- e(u).some((a) => !Q.includes(a)) ? (d(), m("div", Bt, [
457
- (d(!0), m(G, null, X(e(u).filter(
458
- (a) => !Q.includes(a)
459
- ), (a) => (d(), ne(A, {
460
- key: a,
461
- label: `RM ${a}`,
462
- removable: "",
463
- onChipClosed: (O) => ge(a)
464
- }, null, 8, ["label", "onChipClosed"]))), 128))
465
- ])) : _("", !0),
466
- o("div", jt, [
467
- le(s(e(n)("connect.store.giftCard.selected")) + " ", 1),
468
- o("span", zt, s(e(u).length), 1),
469
- le(" / " + s(e(B)), 1)
470
- ]),
471
- o("div", qt, [
472
- r(q, {
473
- modelValue: e(C),
474
- "onUpdate:modelValue": t[7] || (t[7] = (a) => y(C) ? C.value = a : null)
475
- }, null, 8, ["modelValue"]),
476
- o("div", Kt, [
477
- o("div", Wt, s(e(n)("connect.store.giftCard.anyAmount")), 1),
478
- o("div", Zt, s(e(n)("connect.store.giftCard.anyAmountHint")), 1)
479
- ])
480
- ]),
481
- e(C) ? (d(), m("div", Qt, [
482
- r(f, {
483
- modelValue: e(N),
484
- "onUpdate:modelValue": t[8] || (t[8] = (a) => y(N) ? N.value = a : null),
485
- type: "number",
486
- label: e(n)("connect.store.giftCard.min"),
487
- class: "flex-1"
488
- }, null, 8, ["modelValue", "label"]),
489
- r(f, {
490
- modelValue: e(F),
491
- "onUpdate:modelValue": t[9] || (t[9] = (a) => y(F) ? F.value = a : null),
492
- type: "number",
493
- label: e(n)("connect.store.giftCard.max"),
494
- "helper-text": `Up to RM${e(se)}`,
495
- class: "flex-1"
496
- }, null, 8, ["modelValue", "label", "helper-text"])
497
- ])) : _("", !0),
498
- e(J) ? (d(), m("div", Yt, s(e(J)), 1)) : _("", !0)
499
- ]),
500
- _: 1
501
- }),
502
- r(p, {
503
- variant: "outlined",
504
- class: "p-24 flex flex-col gap-16"
505
- }, {
506
- default: T(() => [
507
- o("div", Jt, [
508
- t[20] || (t[20] = o("span", { class: "w-[18px] h-[18px] rounded-sm flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary fm-typo-en-body-sm-600" }, " 5 ", -1)),
509
- o("div", eo, [
510
- o("div", to, s(e(n)("connect.store.giftCard.sending")), 1),
511
- o("div", oo, s(e(n)("connect.store.giftCard.sendingHint")), 1)
512
- ])
513
- ]),
514
- e(ue) ? _("", !0) : (d(), m("div", no, [
515
- r(K, {
516
- name: "info",
517
- class: "text-fm-color-system-info-400 flex-none"
518
- }),
519
- o("div", lo, s(e(n)("connect.store.giftCard.broadcastNotice")), 1),
520
- r(i, {
521
- icon: "close",
522
- variant: "tertiary",
523
- onClick: t[10] || (t[10] = (a) => ue.value = !0)
524
- })
525
- ])),
526
- o("div", ao, [
527
- r(q, {
528
- modelValue: e(R),
529
- "onUpdate:modelValue": t[11] || (t[11] = (a) => y(R) ? R.value = a : null)
530
- }, null, 8, ["modelValue"]),
531
- o("span", so, s(e(n)("connect.store.giftCard.personalMessage")), 1)
532
- ]),
533
- o("div", ro, [
534
- o("div", co, s(e(n)("connect.store.giftCard.channels")), 1),
535
- o("div", io, s(e(n)("connect.store.giftCard.channelsHint")), 1),
536
- o("div", uo, [
537
- (d(!0), m(G, null, X(e(me), (a) => (d(), ne(A, {
538
- key: a.value,
539
- label: a.label,
540
- selectable: "",
541
- selected: e(x).includes(a.value),
542
- disabled: !a.available && !e(x).includes(a.value),
543
- onClick: (O) => Ne(a.value)
544
- }, null, 8, ["label", "selected", "disabled", "onClick"]))), 128))
545
- ]),
546
- e(fe).length ? (d(), m("div", mo, [
547
- le(s(e(n)("connect.store.giftCard.channelUnavailable", {
548
- channels: e(fe).join(", ")
549
- })) + " ", 1),
550
- o("a", {
551
- href: Ue,
552
- target: "_blank",
553
- rel: "noopener",
554
- class: "underline fm-typo-en-body-md-600 text-fm-color-primary"
555
- }, s(e(n)("connect.store.giftCard.channelConfigure")), 1)
556
- ])) : _("", !0),
557
- e(ee) ? (d(), m("div", fo, s(e(ee)), 1)) : _("", !0)
558
- ])
559
- ]),
560
- _: 1
561
- }),
562
- r(p, {
563
- variant: "outlined",
564
- class: "p-24 flex flex-col gap-16"
565
- }, {
566
- default: T(() => [
567
- o("div", po, [
568
- t[21] || (t[21] = o("span", { class: "w-[18px] h-[18px] rounded-sm flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary fm-typo-en-body-sm-600" }, " 6 ", -1)),
569
- o("div", vo, [
570
- o("div", go, s(e(n)("connect.store.giftCard.terms")), 1),
571
- o("div", yo, s(e(n)("connect.store.giftCard.termsHint")), 1)
572
- ])
573
- ]),
574
- o("div", xo, [
575
- r(i, {
576
- label: e(n)("connect.store.giftCard.enterText"),
577
- icon: "edit",
578
- variant: "secondary",
579
- onClick: t[12] || (t[12] = (a) => b.value = "TEXT")
580
- }, null, 8, ["label"]),
581
- r(h, {
582
- accept: ".pdf, .doc, .docx",
583
- "max-file-size": 5e6,
584
- onFileUpload: Ie
585
- })
586
- ]),
587
- e(b) === "TEXT" ? (d(), ne(He, {
588
- key: 0,
589
- modelValue: e(H),
590
- "onUpdate:modelValue": t[13] || (t[13] = (a) => y(H) ? H.value = a : null),
591
- rows: 5,
592
- placeholder: e(n)("connect.store.giftCard.termsPlaceholder")
593
- }, null, 8, ["modelValue", "placeholder"])) : e(b) === "DOCUMENT" && e(V) ? (d(), m("div", bo, [
594
- r(K, {
595
- name: "description",
596
- class: "text-fm-color-typo-secondary"
597
- }),
598
- o("a", {
599
- href: e(V),
600
- target: "_blank",
601
- rel: "noopener",
602
- class: "text-fm-color-typo-info underline"
603
- }, s(e(n)("connect.store.giftCard.viewDocument")), 9, _o),
604
- r(i, {
605
- icon: "close",
606
- variant: "tertiary",
607
- onClick: t[14] || (t[14] = (a) => (V.value = "", b.value = "NONE"))
608
- })
609
- ])) : _("", !0)
610
- ]),
611
- _: 1
612
- }),
613
- o("div", Co, [
614
- r(i, {
615
- label: e(n)("connect.common.cancel"),
616
- variant: "tertiary",
617
- onClick: oe
618
- }, null, 8, ["label"]),
619
- r(i, {
620
- label: e(z) ? e(n)("connect.common.save") : e(n)("connect.store.giftCard.addGiftCard"),
621
- loading: e(Ke)().isLoading,
622
- disabled: !!e(te),
623
- onClick: Re
624
- }, null, 8, ["label", "loading", "disabled"])
625
- ])
626
- ])
627
- ]);
628
- };
629
- }
630
- });
631
- export {
632
- Po as default
633
- };