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

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-B1sVRUgU.js → App-BX2UE7QI.js} +40 -37
  2. package/dist/{AuditLogs-jIv5rADu.js → AuditLogs-Crhi9QVp.js} +10 -10
  3. package/dist/{Bin-BFb2FxJL.js → Bin-xPurvadn.js} +8 -8
  4. package/dist/{Broadcast-C-yR1YzE.js → Broadcast-CUYyGJY-.js} +11 -11
  5. package/dist/{CampaignAnalytic-D2Udb-1I.js → CampaignAnalytic-BfUdUO6Y.js} +6 -6
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-pp80jczz.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BoXhFyzX.js} +7 -7
  7. package/dist/Card-CISdGnSl.js +1060 -0
  8. package/dist/{Collections-DoDZlLT5.js → Collections-N7QyYqC-.js} +8 -8
  9. package/dist/{Credit-D-ss0yae.js → Credit-DpgSuzmF.js} +12 -12
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DbkQVmGE.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ber_smZ-.js} +32 -32
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-B8LawUFT.js → EffectSheet.vue_vue_type_style_index_0_lang-CoJVTW3E.js} +6 -6
  12. package/dist/{Experience-OMwgCv-k.js → Experience-DO7c3BW8.js} +12 -12
  13. package/dist/{FileSaver.min-Ck08usZi.js → FileSaver.min-Bjq1OZ_L.js} +1 -1
  14. package/dist/{Game-S5m1kti2.js → Game-BHtJD6LM.js} +13 -13
  15. package/dist/GiftCardSetup-Dg-kNVsD.js +633 -0
  16. package/dist/{Grab-CgVDlh8N.js → Grab-BOMxmAcZ.js} +9 -9
  17. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-B9JaZNoF.js → ImageInput.vue_vue_type_script_setup_true_lang-bEHeJol7.js} +1 -1
  18. package/dist/{Index-BZRQSQt3.js → Index-S2H2GVM8.js} +10 -10
  19. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CZp2vyhp.js → LocationPicker.vue_vue_type_script_setup_true_lang-cgXkx7R_.js} +1 -1
  20. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-D9iMrk0m.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CQQJuVCF.js} +1 -1
  21. package/dist/{LoyaltyDashboard-CkJsz_FM.js → LoyaltyDashboard-CbwiKazp.js} +7 -7
  22. package/dist/{MainLayout-y2AvCI7H.js → MainLayout-CPS8NNOv.js} +3 -3
  23. package/dist/{Marketing-CdekCDN6.js → Marketing-zIfCm74o.js} +4 -4
  24. package/dist/{MarketingMaterialEdit-r3xPXa_W.js → MarketingMaterialEdit-D8Gj0bOa.js} +6 -6
  25. package/dist/{Member-D4O-38yG.js → Member-Wf4LUqGi.js} +12 -12
  26. package/dist/{MemberList-ABpFaISm.js → MemberList-CzLYfaf5.js} +26 -26
  27. package/dist/{MemberTransactions-DK-x6c7P.js → MemberTransactions-CeaEuCte.js} +1 -1
  28. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DGPNmiR9.js → MessageInput.vue_vue_type_script_setup_true_lang-BDqO9M6_.js} +10 -10
  29. package/dist/{Mission-5RhDQ1MF.js → Mission-B4UV0vB0.js} +13 -13
  30. package/dist/{Overview-B52hUVqf.js → Overview-DIX5ot1i.js} +19 -19
  31. package/dist/{Overview-0ukOrJQs.js → Overview-Ddua14pp.js} +3 -3
  32. package/dist/{Point-TSd4Uvmd.js → Point-CIFEhEU0.js} +12 -12
  33. package/dist/{Promotion-BBpfsz8N.js → Promotion-DJRRCgsu.js} +13 -13
  34. package/dist/{Queue-BgnYKxGG.js → Queue-PxS_JYvd.js} +11 -11
  35. package/dist/{Record-CAtURV9U.js → Record-DbOoWfsG.js} +9 -9
  36. package/dist/{Review-CuSrZB-m.js → Review-BmUzIF6a.js} +2 -2
  37. package/dist/{ReviewFacebookCallback-DQTVwxJo.js → ReviewFacebookCallback-ABDk27W_.js} +5 -5
  38. package/dist/{ReviewGoogleCallback-Dn1bMM23.js → ReviewGoogleCallback-JiGhuvNs.js} +5 -5
  39. package/dist/{Reward-GArpJo5Q.js → Reward-C9JJh35t.js} +16 -16
  40. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CuOxAvxV.js → RewardGroup.vue_vue_type_script_setup_true_lang-CoHS8BGv.js} +12 -12
  41. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BZTg3pTi.js → RuleGroup.vue_vue_type_script_setup_true_lang-CH_hNR0X.js} +15 -15
  42. package/dist/{Segment-BNoD4VPH.js → Segment-BDF6homc.js} +25 -25
  43. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-JrfOr5Px.js → SelectItems.vue_vue_type_script_setup_true_lang-CotltnlA.js} +2 -2
  44. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BY8aFZsB.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dm1Rm5yj.js} +13 -13
  45. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-KVaH8rrU.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bu3TFRAU.js} +4 -4
  46. package/dist/{Setting-CRYXwRFL.js → Setting-I1UmwNUM.js} +14 -14
  47. package/dist/{SettingAdvertisements-Cqp6piIi.js → SettingAdvertisements-BTSCR7Ca.js} +12 -12
  48. package/dist/{Settings-DNkUFLud.js → Settings-F8t7rjZL.js} +5 -5
  49. package/dist/Store-DH9SeWMt.js +2615 -0
  50. package/dist/{StoreRewards-DDlMWlTG.js → StoreRewards-EkAXltsf.js} +15 -15
  51. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Zedck9Xi.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CXQyU9vZ.js} +21 -21
  52. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C3RBFu6J.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-lnEbqNTU.js} +2 -2
  53. package/dist/{Tier-t2Ce3rxu.js → Tier-DuKpa1Ma.js} +25 -25
  54. package/dist/{Title-CdI511i0.js → Title-DlupKRiB.js} +22 -22
  55. package/dist/Transaction-jCh6b6-e.js +45 -0
  56. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DsZxEZw9.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DOvKneyI.js} +6 -6
  57. package/dist/{Voucher-D1QRj4Ps.js → Voucher-QOyU02Mg.js} +14 -14
  58. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BVCNUWYO.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DH3SHPmi.js} +12 -12
  59. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-W_7pFEAG.js → ZodTextField.vue_vue_type_script_setup_true_lang-DA98LDj7.js} +2 -2
  60. package/dist/{app-D4yjN_fQ.js → app-CNi4ejgf.js} +522 -357
  61. package/dist/app.js +1 -1
  62. package/dist/{business-Dq1_o57i.js → business-D_DxmzRi.js} +1 -1
  63. package/dist/{campaign-CNkbWJTf.js → campaign-CQOgVXhK.js} +2 -2
  64. package/dist/{campaign-B7NIPxHs.js → campaign-DgLtIuZl.js} +7 -7
  65. package/dist/{campaign.fn-qKzOoBBQ.js → campaign.fn-DaygvaVk.js} +83 -83
  66. package/dist/{collection.fn-BNRVdqye.js → collection.fn-C2FPUyIL.js} +2 -2
  67. package/dist/{duplicateCampaign-D29czqvn.js → duplicateCampaign-C1GvaB0K.js} +2 -2
  68. package/dist/{effect-B0ikJb6x.js → effect-CZW6UzGQ.js} +1 -1
  69. package/dist/{email-addresses-D0ZUpClg.js → email-addresses-C0rpNk69.js} +2 -2
  70. package/dist/{export-Cr4mjkQZ.js → export-BljjhGlT.js} +3 -3
  71. package/dist/{helper-ClPuPdgQ.js → helper-BNVm1awI.js} +1 -1
  72. package/dist/{index-BcHiQWdr.js → index--l25G-H2.js} +2 -2
  73. package/dist/{index-B2hKSeR1.js → index-20y5ETqa.js} +1 -1
  74. package/dist/{index-By93YZmr.js → index-B3VxErFJ.js} +11 -6
  75. package/dist/{index-DfMsF_gT.js → index-BLcxRCDQ.js} +4 -4
  76. package/dist/{index-Dpk1tAhn.js → index-BTMG_CZc.js} +2 -2
  77. package/dist/{index-DpSlYwDW.js → index-Bl2Io2q7.js} +2 -2
  78. package/dist/{index-CuHNDW6e.js → index-C41OQn3b.js} +1 -1
  79. package/dist/{index-CnckzYTa.js → index-CP9JOHTI.js} +1 -1
  80. package/dist/{index-CFk1uqb8.js → index-CTDIDrHN.js} +1 -1
  81. package/dist/{index-DL7_OC7M.js → index-ChPTYhTe.js} +1 -1
  82. package/dist/{index-GjzeMN4u.js → index-ClMqJYPu.js} +480 -480
  83. package/dist/{index-Dyc5Dpgs.js → index-CuSyySq9.js} +1 -1
  84. package/dist/{index-DiqNx6FV.js → index-IL6JQ0Uk.js} +1 -1
  85. package/dist/{index-C8cXXcLk.js → index-JlyOHqyG.js} +19 -13
  86. package/dist/{index-BOfM9FNu.js → index-_RZ5EbvD.js} +7 -7
  87. package/dist/{index-BrP_OwGm.js → index-aRRiC6b9.js} +7 -7
  88. package/dist/{index-nuptxtNP.js → index-jN921Dx6.js} +3 -3
  89. package/dist/{index-CuPBtB3W.js → index-sBl1JAut.js} +1 -1
  90. package/dist/{index.esm2017-D3pI9NTE.js → index.esm2017-D2J5P0Jx.js} +1 -1
  91. package/dist/{loading-DLrpThuY.js → loading-fSLeqKr_.js} +1 -1
  92. package/dist/{lodash-BIVtqtkS.js → lodash-CanxPAR4.js} +1 -1
  93. package/dist/{membership-PNg3pIQf.js → membership-BrdyfO2y.js} +2 -2
  94. package/dist/{money-Ck2sBYbh.js → money-W_YTwyxP.js} +1 -1
  95. package/dist/{number-dfEMJDkz.js → number-j1vVuQpy.js} +1 -1
  96. package/dist/{objectid-Bz-UKgI1.js → objectid-DhwxE2Ct.js} +9 -9
  97. package/dist/{plugins-D4_SIsjZ.js → plugins-2XgEvjxm.js} +3 -3
  98. package/dist/{reward-UzeAq0jY.js → reward-Bk3FZbGj.js} +1 -1
  99. package/dist/{rule-6OCvKihv.js → rule-M9AijHS0.js} +3 -3
  100. package/dist/{rule-builder-VwyrN58i.js → rule-builder-C4yj8l-c.js} +1 -1
  101. package/dist/{template-DtwmJYOa.js → template-BguoWqRC.js} +6 -6
  102. package/dist/{timezone-CHqOZvJX.js → timezone-DdkTIxnK.js} +1 -1
  103. package/dist/{transaction.fn-rUQ2fYVQ.js → transaction.fn-BpfxFtTu.js} +1 -1
  104. package/dist/{trigger-BT3dj5qY.js → trigger-C7MXRREg.js} +5 -5
  105. package/dist/{useMarketingMaterialActions-Dgq_G1qO.js → useMarketingMaterialActions-CgJpHDNv.js} +3 -3
  106. package/dist/{usePagination-a1XSuIrr.js → usePagination-Csc19YZ0.js} +1 -1
  107. package/dist/{user-CFls8m-e.js → user-DCwNBNr2.js} +1 -1
  108. package/dist/{vue-i18n-CzEcAXx-.js → vue-i18n-BIpsBqfV.js} +397 -397
  109. package/dist/{xlsx-DKPe4AfX.js → xlsx-Esg-74Jx.js} +1 -1
  110. package/dist/{zod-D2Q81R3d.js → zod-D9ri6sIU.js} +1 -1
  111. package/package.json +1 -1
  112. package/dist/Card-CzzNo7nk.js +0 -996
  113. package/dist/GiftCardSetup-CR8NpUJv.js +0 -542
  114. package/dist/Store-Dnt8VDQA.js +0 -2413
  115. package/dist/Transaction-C2BHJU7_.js +0 -39
@@ -1,542 +0,0 @@
1
- import { defineComponent as Ne, computed as b, ref as d, onMounted as De, resolveComponent as _, openBlock as c, createElementBlock as m, createElementVNode as o, createVNode as a, toDisplayString as r, unref as e, withCtx as k, isRef as f, Fragment as L, renderList as I, normalizeClass as ue, createCommentVNode as h, withDirectives as Ve, withKeys as ke, vModelText as Ee, createBlock as Y, createTextVNode as me } from "vue";
2
- import { u as Te } from "./loading-DLrpThuY.js";
3
- import { u as Fe } from "./app-wDQR6dpb.js";
4
- import { n as $, f as E } from "./plugins-D4_SIsjZ.js";
5
- import "./index-CuHNDW6e.js";
6
- import { g as Z } from "./index-DL7_OC7M.js";
7
- import { p as j, q as Me, G as H, r as ee } from "./index-GjzeMN4u.js";
8
- import { u as Ue } from "./vue-i18n-CzEcAXx-.js";
9
- import { useRouter as Pe, useRoute as Oe } from "vue-router";
10
- import { R as Se } from "./app-D4yjN_fQ.js";
11
- const Re = { class: "px-24 pb-40" }, Le = { class: "flex items-start gap-12 py-24" }, Ie = { class: "flex flex-col gap-4" }, $e = { class: "fm-typo-en-title-md-800 text-fm-color-typo-primary" }, He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ge = { class: "flex flex-col gap-16 max-w-[860px]" }, Be = { class: "flex gap-12" }, Xe = { class: "flex flex-col gap-4" }, je = { class: "fm-typo-en-body-lg-600" }, ze = { class: "flex gap-12" }, Ke = { class: "flex flex-col gap-4" }, qe = { class: "fm-typo-en-body-lg-600" }, Je = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Qe = { class: "flex flex-wrap gap-12" }, We = ["src"], Ye = { class: "flex gap-12" }, Ze = { class: "flex flex-col gap-4" }, et = { class: "fm-typo-en-body-lg-600" }, tt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ot = { class: "flex flex-col gap-8" }, nt = ["onClick"], lt = {
12
- key: 0,
13
- class: "w-[9px] h-[9px] rounded-full bg-fm-color-primary"
14
- }, st = { class: "flex-1" }, at = { class: "block fm-typo-en-body-md-600" }, rt = { class: "block fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-2" }, dt = {
15
- key: 0,
16
- class: "grid sm:grid-cols-2 gap-16"
17
- }, ct = { class: "flex items-center gap-16 p-16 rounded-md bg-fm-color-neutral-gray-100" }, it = { class: "flex flex-col gap-2 flex-1 min-w-0" }, ut = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, mt = { class: "fm-typo-en-body-lg-600 truncate" }, ft = { class: "flex gap-12" }, pt = { class: "flex flex-col gap-4" }, vt = { class: "fm-typo-en-body-lg-600" }, gt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, yt = { class: "flex flex-col gap-8" }, xt = { class: "fm-typo-en-body-md-600" }, bt = { class: "flex flex-wrap gap-8" }, _t = { class: "flex items-start gap-8" }, Ct = { class: "flex items-center rounded-md border-1 border-fm-color-neutral-gray-300 overflow-hidden" }, ht = ["placeholder"], At = {
18
- key: 0,
19
- class: "flex flex-wrap gap-8"
20
- }, wt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Nt = { class: "text-fm-color-primary" }, Dt = { class: "flex items-center gap-12 p-16 rounded-md border-1 border-fm-color-neutral-gray-300" }, Vt = { class: "flex-1" }, kt = { class: "fm-typo-en-body-md-600" }, Et = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Tt = {
21
- key: 1,
22
- class: "flex gap-16"
23
- }, Ft = {
24
- key: 2,
25
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-error"
26
- }, Mt = { class: "flex gap-12" }, Ut = { class: "flex flex-col gap-4" }, Pt = { class: "fm-typo-en-body-lg-600" }, Ot = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, St = {
27
- key: 0,
28
- class: "flex items-start gap-12 p-16 rounded-md bg-fm-color-system-info-100"
29
- }, Rt = { class: "flex-1 fm-typo-en-body-md-400 text-fm-color-typo-primary" }, Lt = { class: "flex items-center gap-12" }, It = { class: "fm-typo-en-body-md-500" }, $t = { class: "flex flex-col gap-8" }, Ht = { class: "fm-typo-en-body-md-600" }, Gt = { class: "flex flex-wrap gap-8" }, Bt = { class: "flex gap-12" }, Xt = { class: "flex flex-col gap-4" }, jt = { class: "fm-typo-en-body-lg-600" }, zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Kt = { class: "flex flex-wrap items-center gap-8" }, qt = {
30
- key: 1,
31
- class: "flex items-center gap-8 fm-typo-en-body-md-400"
32
- }, Jt = ["href"], Qt = { class: "flex items-center justify-end gap-8 pt-8" }, co = /* @__PURE__ */ Ne({
33
- __name: "GiftCardSetup",
34
- setup(Wt) {
35
- const { t: n } = Ue(), { global: fe, minor: z } = Te, pe = Pe(), ve = Oe(), T = b(() => ve.params.id || null), G = b(() => !!T.value), A = d(""), y = d([]);
36
- let te = /* @__PURE__ */ new Set();
37
- const oe = /* @__PURE__ */ new Set(), C = d("DEFAULT"), F = d(16), M = d(j().charset), U = d("GC"), P = d(""), ne = d(0), K = [10, 20, 30, 50, 100], i = d([]), w = d(""), x = d(!1), N = d(10), D = d(100), le = d(!1), O = d(!0), B = d(
38
- "EMAIL_OR_PHONE"
39
- ), v = d("NONE"), S = d(""), V = d(""), se = b(
40
- () => C.value === "ADVANCED" ? {
41
- ...j(),
42
- length: Number(F.value),
43
- charset: M.value,
44
- prefix: U.value,
45
- suffix: P.value
46
- } : j()
47
- ), ge = b(() => (ne.value, Me(se.value))), ae = b(
48
- () => i.value.length >= H
49
- );
50
- function re(s) {
51
- if (i.value.includes(s)) {
52
- i.value = i.value.filter((t) => t !== s);
53
- return;
54
- }
55
- if (ae.value) {
56
- $.error(
57
- n("connect.store.giftCard.maxAmounts", {
58
- max: H
59
- })
60
- );
61
- return;
62
- }
63
- i.value = [...i.value, s].sort((t, u) => t - u);
64
- }
65
- function de() {
66
- const s = Number(w.value);
67
- if (!Number.isInteger(s) || s <= 0) {
68
- $.error(n("connect.store.giftCard.invalidAmount"));
69
- return;
70
- }
71
- if (s > ee) {
72
- $.error(
73
- n("connect.store.giftCard.amountTooLarge", { max: ee })
74
- );
75
- return;
76
- }
77
- if (i.value.includes(s)) {
78
- w.value = "";
79
- return;
80
- }
81
- if (ae.value) {
82
- $.error(
83
- n("connect.store.giftCard.maxAmounts", {
84
- max: H
85
- })
86
- );
87
- return;
88
- }
89
- i.value = [...i.value, s].sort((t, u) => t - u), w.value = "";
90
- }
91
- const q = b(() => i.value.length === 0 && !x.value ? n("connect.store.giftCard.errorNoAmount") : x.value && Number(N.value) > Number(D.value) ? n("connect.store.giftCard.errorRange") : null), ye = b(
92
- () => A.value.trim() ? null : n("connect.store.giftCard.errorNoName")
93
- ), J = b(() => ye.value ?? q.value);
94
- async function xe(s) {
95
- await z(
96
- async () => {
97
- const t = await E.update(
98
- E.bundleImagePath(void 0, s),
99
- s
100
- );
101
- y.value = [...y.value, t];
102
- },
103
- {
104
- message: n("connect.store.giftCard.uploading"),
105
- successMessage: n("connect.store.giftCard.uploaded")
106
- }
107
- );
108
- }
109
- async function be(s) {
110
- if (y.value = y.value.filter((t) => t !== s), te.has(s)) {
111
- oe.add(s);
112
- return;
113
- }
114
- try {
115
- await E.delete(s);
116
- } catch {
117
- }
118
- }
119
- async function _e(s) {
120
- await z(
121
- async () => {
122
- V.value = await E.update(
123
- E.bundleImagePath(void 0, s),
124
- s
125
- ), v.value = "DOCUMENT";
126
- },
127
- {
128
- message: n("connect.store.giftCard.uploading"),
129
- successMessage: n("connect.store.giftCard.uploaded")
130
- }
131
- );
132
- }
133
- function Ce() {
134
- return {
135
- name: A.value.trim(),
136
- designs: y.value,
137
- numberFormat: se.value,
138
- denominations: i.value.map(Number),
139
- anyAmount: x.value ? {
140
- enabled: !0,
141
- min: Number(N.value),
142
- max: Number(D.value)
143
- } : null,
144
- recipientContactMethod: B.value,
145
- allowPersonalMessage: O.value,
146
- termsAndConditions: v.value === "TEXT" && S.value || null,
147
- termsDocumentUrl: v.value === "DOCUMENT" && V.value || null
148
- };
149
- }
150
- function he(s) {
151
- var p, g, R;
152
- A.value = s.name, y.value = [...s.designs ?? []], te = new Set(y.value), i.value = [...s.denominations ?? []], x.value = !!((p = s.anyAmount) != null && p.enabled), N.value = ((g = s.anyAmount) == null ? void 0 : g.min) ?? 10, D.value = ((R = s.anyAmount) == null ? void 0 : R.max) ?? 100, B.value = s.recipientContactMethod, O.value = s.allowPersonalMessage ?? !0;
153
- const t = s.numberFormat, u = !t || t.prefix === "GC" && Number(t.length) === 16;
154
- C.value = u ? "DEFAULT" : "ADVANCED", F.value = Number((t == null ? void 0 : t.length) ?? 16), M.value = (t == null ? void 0 : t.charset) ?? j().charset, U.value = (t == null ? void 0 : t.prefix) ?? "GC", P.value = (t == null ? void 0 : t.suffix) ?? "", s.termsDocumentUrl ? (v.value = "DOCUMENT", V.value = s.termsDocumentUrl) : s.termsAndConditions && (v.value = "TEXT", S.value = s.termsAndConditions);
155
- }
156
- function Q() {
157
- pe.push({ name: Se["$connect-STORE"] });
158
- }
159
- async function Ae() {
160
- if (J.value) {
161
- $.error(J.value);
162
- return;
163
- }
164
- await z(
165
- async () => {
166
- const s = Ce();
167
- T.value ? await Z.updateProgram(T.value, s) : await Z.createProgram(s), await Promise.allSettled(
168
- [...oe].map((t) => E.delete(t))
169
- ), Q();
170
- },
171
- {
172
- message: G.value ? n("connect.store.giftCard.saving") : n("connect.store.giftCard.creating"),
173
- successMessage: G.value ? n("connect.store.giftCard.saved") : n("connect.store.giftCard.created")
174
- }
175
- );
176
- }
177
- return De(async () => {
178
- T.value && await fe(async () => {
179
- he(await Z.readProgram(T.value));
180
- });
181
- }), (s, t) => {
182
- const u = _("FmButton"), p = _("FmTextField"), g = _("FmCard"), R = _("FmDropField"), W = _("FmChip"), ce = _("FmSwitch"), ie = _("FmIcon"), we = _("FmTextarea");
183
- return c(), m("div", Re, [
184
- o("div", Le, [
185
- a(u, {
186
- icon: "arrow_back",
187
- variant: "tertiary",
188
- onClick: Q
189
- }),
190
- o("div", Ie, [
191
- o("h1", $e, r(e(G) ? e(n)("connect.store.giftCard.editTitle") : e(n)("connect.store.giftCard.createTitle")), 1),
192
- o("p", He, r(e(n)("connect.store.giftCard.pageSubtitle")), 1)
193
- ])
194
- ]),
195
- o("div", Ge, [
196
- a(g, {
197
- variant: "outlined",
198
- class: "p-24 flex flex-col gap-16"
199
- }, {
200
- default: k(() => [
201
- o("div", Be, [
202
- 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)),
203
- o("div", Xe, [
204
- o("div", je, r(e(n)("connect.store.giftCard.name")), 1)
205
- ])
206
- ]),
207
- a(p, {
208
- modelValue: e(A),
209
- "onUpdate:modelValue": t[0] || (t[0] = (l) => f(A) ? A.value = l : null),
210
- placeholder: e(n)("connect.store.giftCard.namePlaceholder")
211
- }, null, 8, ["modelValue", "placeholder"])
212
- ]),
213
- _: 1
214
- }),
215
- a(g, {
216
- variant: "outlined",
217
- class: "p-24 flex flex-col gap-16"
218
- }, {
219
- default: k(() => [
220
- o("div", ze, [
221
- 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)),
222
- o("div", Ke, [
223
- o("div", qe, r(e(n)("connect.store.giftCard.design")), 1),
224
- o("div", Je, r(e(n)("connect.store.giftCard.designHint")), 1)
225
- ])
226
- ]),
227
- o("div", Qe, [
228
- (c(!0), m(L, null, I(e(y), (l) => (c(), m("div", {
229
- key: l,
230
- class: "relative w-[160px] aspect-video rounded-md overflow-hidden border-1 border-fm-color-neutral-gray-300"
231
- }, [
232
- o("img", {
233
- src: l,
234
- alt: "",
235
- class: "w-full h-full object-cover"
236
- }, null, 8, We),
237
- a(u, {
238
- icon: "close",
239
- variant: "tertiary",
240
- class: "absolute top-2 right-2",
241
- onClick: (X) => be(l)
242
- }, null, 8, ["onClick"])
243
- ]))), 128)),
244
- a(R, {
245
- accept: ".png, .jpg, .jpeg, .gif",
246
- "max-file-size": 5e6,
247
- onFileUpload: xe
248
- })
249
- ])
250
- ]),
251
- _: 1
252
- }),
253
- a(g, {
254
- variant: "outlined",
255
- class: "p-24 flex flex-col gap-16"
256
- }, {
257
- default: k(() => [
258
- o("div", Ye, [
259
- 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)),
260
- o("div", Ze, [
261
- o("div", et, r(e(n)("connect.store.giftCard.numberSettings")), 1),
262
- o("div", tt, r(e(n)("connect.store.giftCard.numberSettingsHint")), 1)
263
- ])
264
- ]),
265
- o("div", ot, [
266
- (c(), m(L, null, I(["DEFAULT", "ADVANCED"], (l) => o("button", {
267
- key: l,
268
- type: "button",
269
- class: ue([
270
- "flex gap-12 items-start text-left p-16 rounded-md border-1 transition-colors",
271
- e(C) === l ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
272
- ]),
273
- onClick: (X) => C.value = l
274
- }, [
275
- o("span", {
276
- class: ue([
277
- "w-[18px] h-[18px] rounded-full border-1 flex-none mt-2 grid place-items-center",
278
- e(C) === l ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
279
- ])
280
- }, [
281
- e(C) === l ? (c(), m("span", lt)) : h("", !0)
282
- ], 2),
283
- o("span", st, [
284
- o("span", at, r(l === "DEFAULT" ? e(n)("connect.store.giftCard.numberDefault") : e(n)("connect.store.giftCard.numberAdvanced")), 1),
285
- o("span", rt, r(l === "DEFAULT" ? e(n)("connect.store.giftCard.numberDefaultHint") : e(n)("connect.store.giftCard.numberAdvancedHint")), 1)
286
- ])
287
- ], 10, nt)), 64))
288
- ]),
289
- e(C) === "ADVANCED" ? (c(), m("div", dt, [
290
- a(p, {
291
- modelValue: e(F),
292
- "onUpdate:modelValue": t[1] || (t[1] = (l) => f(F) ? F.value = l : null),
293
- type: "number",
294
- label: e(n)("connect.store.giftCard.length")
295
- }, null, 8, ["modelValue", "label"]),
296
- a(p, {
297
- modelValue: e(M),
298
- "onUpdate:modelValue": t[2] || (t[2] = (l) => f(M) ? M.value = l : null),
299
- label: e(n)("connect.store.giftCard.charset")
300
- }, null, 8, ["modelValue", "label"]),
301
- a(p, {
302
- modelValue: e(U),
303
- "onUpdate:modelValue": t[3] || (t[3] = (l) => f(U) ? U.value = l : null),
304
- label: e(n)("connect.store.giftCard.prefix")
305
- }, null, 8, ["modelValue", "label"]),
306
- a(p, {
307
- modelValue: e(P),
308
- "onUpdate:modelValue": t[4] || (t[4] = (l) => f(P) ? P.value = l : null),
309
- label: e(n)("connect.store.giftCard.suffix")
310
- }, null, 8, ["modelValue", "label"])
311
- ])) : h("", !0),
312
- o("div", ct, [
313
- o("div", it, [
314
- o("span", ut, r(e(n)("connect.store.giftCard.exampleNumber")), 1),
315
- o("span", mt, r(e(ge)), 1)
316
- ]),
317
- a(u, {
318
- label: e(n)("connect.store.giftCard.regenerate"),
319
- icon: "refresh",
320
- variant: "secondary",
321
- onClick: t[5] || (t[5] = (l) => ne.value++)
322
- }, null, 8, ["label"])
323
- ])
324
- ]),
325
- _: 1
326
- }),
327
- a(g, {
328
- variant: "outlined",
329
- class: "p-24 flex flex-col gap-16"
330
- }, {
331
- default: k(() => [
332
- o("div", ft, [
333
- 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)),
334
- o("div", pt, [
335
- o("div", vt, r(e(n)("connect.store.giftCard.amount")), 1),
336
- o("div", gt, r(e(n)("connect.store.giftCard.amountHint", {
337
- max: e(H)
338
- })), 1)
339
- ])
340
- ]),
341
- o("div", yt, [
342
- o("div", xt, r(e(n)("connect.store.giftCard.popularAmounts")), 1),
343
- o("div", bt, [
344
- (c(), m(L, null, I(K, (l) => a(W, {
345
- key: l,
346
- label: `RM ${l}`,
347
- selectable: "",
348
- selected: e(i).includes(l),
349
- onClick: (X) => re(l)
350
- }, null, 8, ["label", "selected", "onClick"])), 64))
351
- ])
352
- ]),
353
- o("div", _t, [
354
- o("div", Ct, [
355
- 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)),
356
- Ve(o("input", {
357
- "onUpdate:modelValue": t[6] || (t[6] = (l) => f(w) ? w.value = l : null),
358
- type: "number",
359
- class: "px-12 py-8 outline-none fm-typo-en-body-md-400 w-[140px]",
360
- placeholder: e(n)("connect.store.giftCard.custom"),
361
- onKeyup: ke(de, ["enter"])
362
- }, null, 40, ht), [
363
- [Ee, e(w)]
364
- ])
365
- ]),
366
- a(u, {
367
- label: e(n)("connect.store.giftCard.addAmount"),
368
- variant: "secondary",
369
- onClick: de
370
- }, null, 8, ["label"])
371
- ]),
372
- e(i).some((l) => !K.includes(l)) ? (c(), m("div", At, [
373
- (c(!0), m(L, null, I(e(i).filter(
374
- (l) => !K.includes(l)
375
- ), (l) => (c(), Y(W, {
376
- key: l,
377
- label: `RM ${l}`,
378
- removable: "",
379
- onRemove: (X) => re(l)
380
- }, null, 8, ["label", "onRemove"]))), 128))
381
- ])) : h("", !0),
382
- o("div", wt, [
383
- me(r(e(n)("connect.store.giftCard.selected")) + " ", 1),
384
- o("span", Nt, r(e(i).length), 1),
385
- me(" / " + r(e(H)), 1)
386
- ]),
387
- o("div", Dt, [
388
- a(ce, {
389
- modelValue: e(x),
390
- "onUpdate:modelValue": t[7] || (t[7] = (l) => f(x) ? x.value = l : null)
391
- }, null, 8, ["modelValue"]),
392
- o("div", Vt, [
393
- o("div", kt, r(e(n)("connect.store.giftCard.anyAmount")), 1),
394
- o("div", Et, r(e(n)("connect.store.giftCard.anyAmountHint")), 1)
395
- ])
396
- ]),
397
- e(x) ? (c(), m("div", Tt, [
398
- a(p, {
399
- modelValue: e(N),
400
- "onUpdate:modelValue": t[8] || (t[8] = (l) => f(N) ? N.value = l : null),
401
- type: "number",
402
- label: e(n)("connect.store.giftCard.min"),
403
- class: "flex-1"
404
- }, null, 8, ["modelValue", "label"]),
405
- a(p, {
406
- modelValue: e(D),
407
- "onUpdate:modelValue": t[9] || (t[9] = (l) => f(D) ? D.value = l : null),
408
- type: "number",
409
- label: e(n)("connect.store.giftCard.max"),
410
- "helper-text": `Up to RM${e(ee)}`,
411
- class: "flex-1"
412
- }, null, 8, ["modelValue", "label", "helper-text"])
413
- ])) : h("", !0),
414
- e(q) ? (c(), m("div", Ft, r(e(q)), 1)) : h("", !0)
415
- ]),
416
- _: 1
417
- }),
418
- a(g, {
419
- variant: "outlined",
420
- class: "p-24 flex flex-col gap-16"
421
- }, {
422
- default: k(() => [
423
- o("div", Mt, [
424
- 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)),
425
- o("div", Ut, [
426
- o("div", Pt, r(e(n)("connect.store.giftCard.sending")), 1),
427
- o("div", Ot, r(e(n)("connect.store.giftCard.sendingHint")), 1)
428
- ])
429
- ]),
430
- e(le) ? h("", !0) : (c(), m("div", St, [
431
- a(ie, {
432
- name: "info",
433
- class: "text-fm-color-system-info-400 flex-none"
434
- }),
435
- o("div", Rt, r(e(n)("connect.store.giftCard.broadcastNotice")), 1),
436
- a(u, {
437
- icon: "close",
438
- variant: "tertiary",
439
- onClick: t[10] || (t[10] = (l) => le.value = !0)
440
- })
441
- ])),
442
- o("div", Lt, [
443
- a(ce, {
444
- modelValue: e(O),
445
- "onUpdate:modelValue": t[11] || (t[11] = (l) => f(O) ? O.value = l : null)
446
- }, null, 8, ["modelValue"]),
447
- o("span", It, r(e(n)("connect.store.giftCard.personalMessage")), 1)
448
- ]),
449
- o("div", $t, [
450
- o("div", Ht, r(e(n)("connect.store.giftCard.contactMethod")), 1),
451
- o("div", Gt, [
452
- (c(!0), m(L, null, I([
453
- { value: "EMAIL", label: e(n)("connect.store.giftCard.email") },
454
- { value: "PHONE", label: e(n)("connect.store.giftCard.phone") },
455
- {
456
- value: "EMAIL_OR_PHONE",
457
- label: e(n)("connect.store.giftCard.emailOrPhone")
458
- }
459
- ], (l) => (c(), Y(W, {
460
- key: l.value,
461
- label: l.label,
462
- selectable: "",
463
- selected: e(B) === l.value,
464
- onClick: (X) => B.value = l.value
465
- }, null, 8, ["label", "selected", "onClick"]))), 128))
466
- ])
467
- ])
468
- ]),
469
- _: 1
470
- }),
471
- a(g, {
472
- variant: "outlined",
473
- class: "p-24 flex flex-col gap-16"
474
- }, {
475
- default: k(() => [
476
- o("div", Bt, [
477
- 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)),
478
- o("div", Xt, [
479
- o("div", jt, r(e(n)("connect.store.giftCard.terms")), 1),
480
- o("div", zt, r(e(n)("connect.store.giftCard.termsHint")), 1)
481
- ])
482
- ]),
483
- o("div", Kt, [
484
- a(u, {
485
- label: e(n)("connect.store.giftCard.enterText"),
486
- icon: "edit",
487
- variant: "secondary",
488
- onClick: t[12] || (t[12] = (l) => v.value = "TEXT")
489
- }, null, 8, ["label"]),
490
- a(R, {
491
- accept: ".pdf, .doc, .docx",
492
- "max-file-size": 5e6,
493
- onFileUpload: _e
494
- })
495
- ]),
496
- e(v) === "TEXT" ? (c(), Y(we, {
497
- key: 0,
498
- modelValue: e(S),
499
- "onUpdate:modelValue": t[13] || (t[13] = (l) => f(S) ? S.value = l : null),
500
- rows: 5,
501
- placeholder: e(n)("connect.store.giftCard.termsPlaceholder")
502
- }, null, 8, ["modelValue", "placeholder"])) : e(v) === "DOCUMENT" && e(V) ? (c(), m("div", qt, [
503
- a(ie, {
504
- name: "description",
505
- class: "text-fm-color-typo-secondary"
506
- }),
507
- o("a", {
508
- href: e(V),
509
- target: "_blank",
510
- rel: "noopener",
511
- class: "text-fm-color-typo-info underline"
512
- }, r(e(n)("connect.store.giftCard.viewDocument")), 9, Jt),
513
- a(u, {
514
- icon: "close",
515
- variant: "tertiary",
516
- onClick: t[14] || (t[14] = (l) => (V.value = "", v.value = "NONE"))
517
- })
518
- ])) : h("", !0)
519
- ]),
520
- _: 1
521
- }),
522
- o("div", Qt, [
523
- a(u, {
524
- label: e(n)("connect.common.cancel"),
525
- variant: "tertiary",
526
- onClick: Q
527
- }, null, 8, ["label"]),
528
- a(u, {
529
- label: e(G) ? e(n)("connect.common.save") : e(n)("connect.store.giftCard.addGiftCard"),
530
- loading: e(Fe)().isLoading,
531
- disabled: !!e(J),
532
- onClick: Ae
533
- }, null, 8, ["label", "loading", "disabled"])
534
- ])
535
- ])
536
- ]);
537
- };
538
- }
539
- });
540
- export {
541
- co as default
542
- };