@feedmepos/mf-connect 0.1.111-prod → 0.1.113-beta.3

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 (162) hide show
  1. package/README.md +66 -1
  2. package/dist/{App-D3pYl3WL.js → App-YfpYV7C0.js} +738 -689
  3. package/dist/AuditLogs-kD0_HO_p.js +2016 -0
  4. package/dist/{Bin-DOZqpbYH.js → Bin-Dr-Xp3pn.js} +8 -8
  5. package/dist/Broadcast-CEbHu2xA.js +306 -0
  6. package/dist/{CampaignAnalytic-cFKvCgxX.js → CampaignAnalytic-DDiGxPwp.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B0eVEubS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cc_Yho9-.js} +49 -32
  8. package/dist/Card-BUnwg0eM.js +1086 -0
  9. package/dist/{Collections-9QK5hbLo.js → Collections-CKyBkKq2.js} +197 -185
  10. package/dist/{Credit-8Ouy4O9a.js → Credit-CJOXWLV1.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CJA-yunY.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DmEBLeNI.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ce5R4Un6.js +4442 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Dv0q3B8m.js → EffectSheet.vue_vue_type_style_index_0_lang-CMFmlqfF.js} +32 -32
  14. package/dist/{Experience-DMh4hR1S.js → Experience-C_Am5CTY.js} +32 -31
  15. package/dist/{FileSaver.min-Bx9mdUgJ.js → FileSaver.min-CueAGbjq.js} +1 -1
  16. package/dist/{Game-CL0TZvg1.js → Game-B6GO_LVU.js} +19 -18
  17. package/dist/GiftCardSetup-CVLDDpI2.js +748 -0
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Bz5kIfoM.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-isfGhKO1.js} +7 -7
  19. package/dist/{Goals-Dz5Vp-lj.js → Goals-BX-sMV2V.js} +4 -4
  20. package/dist/Grab-Bh335Srh.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CaPDI3vY.js → ImageInput.vue_vue_type_script_setup_true_lang-srSgUY3e.js} +1 -1
  22. package/dist/{Index-kH8aAegB.js → Index-CyXRbwcm.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CFrgC3Ka.js → LocationPicker.vue_vue_type_script_setup_true_lang-S3GB2Ems.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DPIFLdBc.js → LottieAnimation.vue_vue_type_script_setup_true_lang-ZlWHXwXZ.js} +1 -1
  25. package/dist/{LoyaltyDashboard-BBxEoWol.js → LoyaltyDashboard-DrTq8oiu.js} +15 -15
  26. package/dist/MainLayout-KbKkpX5n.js +4 -0
  27. package/dist/{MainLayout-2BLwDyHQ.js → MainLayout.vue_vue_type_script_setup_true_lang-2D5ate_s.js} +5 -4
  28. package/dist/{Marketing-C4OnSV-c.js → Marketing-DQT1MWQg.js} +4 -4
  29. package/dist/MarketingMaterialEdit-fSqr53-M.js +1037 -0
  30. package/dist/{Member-CT9WwxP0.js → Member-DwDUCzlv.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-C7yznkUn.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DaQ4Lw8f.js} +43 -49
  32. package/dist/{MemberImportHistory-B__BFID7.js → MemberImportHistory-D4ezvJGZ.js} +7 -7
  33. package/dist/{MemberList-DgLI4wty.js → MemberList-DFieV7Qk.js} +103 -105
  34. package/dist/{MemberTransactions-UFx_DZYe.js → MemberTransactions-BPOXyAuC.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BFjZA8Y6.js → MessageInput.vue_vue_type_script_setup_true_lang-DhfsgDd4.js} +4821 -4690
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Df9bxbUl.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CX8bk_IQ.js} +1 -1
  37. package/dist/{Mission-CawzGzDu.js → Mission-nErb05Es.js} +22 -21
  38. package/dist/{Overview-D19oSo24.js → Overview-7G31a7B-.js} +58 -56
  39. package/dist/{Overview-CAtTlEVa.js → Overview-DuJr_hAg.js} +145 -144
  40. package/dist/{Point-BPAGmKAj.js → Point-PWDLemD4.js} +22 -21
  41. package/dist/{Promotion-B0Uf9vjL.js → Promotion-N80Tj8M6.js} +137 -131
  42. package/dist/{Queue-CJEAFss_.js → Queue-M7ZpgiMT.js} +49 -47
  43. package/dist/{Record-s6hSQG2P.js → Record-NhxrdvWv.js} +9 -9
  44. package/dist/{Review-DhNCbAOm.js → Review-DiAaAzIG.js} +2 -2
  45. package/dist/ReviewFacebookCallback-JdyxFbNl.js +225 -0
  46. package/dist/{ReviewGoogleCallback-D8ENWii2.js → ReviewGoogleCallback-BXbI3Bsh.js} +5 -5
  47. package/dist/{Reward-BT00QsXL.js → Reward-yTaOqOT8.js} +29 -29
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DaZDGhbm.js → RewardGroup.vue_vue_type_script_setup_true_lang-BWPfjZ9K.js} +26 -24
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cz2H9MKe.js +1923 -0
  50. package/dist/{Segment-BuGhX9zg.js → Segment-DE9Bcd6R.js} +287 -287
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DB718_4P.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-pmv0cb4J.js} +37 -35
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CkgXxy0C.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BeWwkTix.js} +4 -4
  53. package/dist/Setting-C0JAxIRT.js +574 -0
  54. package/dist/{SettingAdvertisements-aqFErKAr.js → SettingAdvertisements-DxueyKU8.js} +12 -12
  55. package/dist/Settings-Cs46AcxZ.js +286 -0
  56. package/dist/Store-DqQae9nE.js +2629 -0
  57. package/dist/{StoreRewards-D2pTL2oA.js → StoreRewards-JxSUsOzJ.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-qgrBtUNX.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D7ifzgsI.js +7007 -0
  60. package/dist/{Tier-OyE8oH2r.js → Tier-DWhgWush.js} +2576 -686
  61. package/dist/{Title-DAl7CKL_.js → Title-DUNeMdz8.js} +104 -101
  62. package/dist/Transaction-DAv-LVhC.js +45 -0
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C0yHxQVr.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cih-9IoW.js} +26 -26
  64. package/dist/{Voucher-D2QGWSxs.js → Voucher-uLTq9RSK.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bt2YB745.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BevVL_Kx.js} +16 -16
  66. package/dist/WhatsappAccount-BpXQ4q0P.js +158 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-EssnbsgT.js +39 -0
  68. package/dist/WhatsappBot-DB4NRZMd.js +589 -0
  69. package/dist/WhatsappBotLogs-DDN4H_bv.js +372 -0
  70. package/dist/WhatsappBotSettings-Bkv1VNwF.js +387 -0
  71. package/dist/WhatsappBotTickets-DAKgnE6T.js +162 -0
  72. package/dist/WhatsappLayout-DSnq84Uo.js +21 -0
  73. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-1BvxPD-k.js +195 -0
  74. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BzCL64Jo.js → ZodTextField.vue_vue_type_script_setup_true_lang-CR-F0x1r.js} +2 -2
  75. package/dist/{app-QxosLNkH.js → app-Devzv4gO.js} +12854 -9732
  76. package/dist/app.js +4 -3
  77. package/dist/base.export-CCSMkvAm.js +75 -0
  78. package/dist/browser-BSAOEeIM.js +1478 -0
  79. package/dist/{business-CbqG6NXr.js → business-BjAmUqNA.js} +1 -1
  80. package/dist/campaign-C5c47GqT.js +400 -0
  81. package/dist/{campaign-Rj7oDBnN.js → campaign-CTe-T5Gd.js} +31 -25
  82. package/dist/{campaign.enum-B7vdNYKd.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  83. package/dist/campaign.fn-DxAO8A5b.js +776 -0
  84. package/dist/{collectible.enum-BsQseg7-.js → collectible.enum-Liy2wH3s.js} +1 -1
  85. package/dist/{collection.fn-EbUIyB1X.js → collection.fn-C9l-OtNt.js} +2 -2
  86. package/dist/currency-mwm4AWXK.js +7 -0
  87. package/dist/duplicateCampaign-BbC4AwQ1.js +51 -0
  88. package/dist/{effect-B_91OlcX.js → effect-D8ba9z0K.js} +1 -1
  89. package/dist/{email-addresses-DXnYZG-e.js → email-addresses-BR5J6_Jz.js} +2 -2
  90. package/dist/feature-flag-C-5NdFW8.js +868 -0
  91. package/dist/feature-flag-CNcU4_3r.js +50 -0
  92. package/dist/google-BQK68wbe.js +5 -0
  93. package/dist/{helper-_uhiXya1.js → helper-D9cEaMIv.js} +1 -1
  94. package/dist/index-0H82-X0n.js +80 -0
  95. package/dist/{index-Cp7oHMm3.js → index-B1jP-_Z_.js} +691 -229
  96. package/dist/{index-BZ2b0Pk6.js → index-B7HH6vKF.js} +8 -7
  97. package/dist/{index-tbo0pMIu.js → index-BFaZp6Et.js} +29 -15
  98. package/dist/index-B_gzo75q.js +53 -0
  99. package/dist/{index-DlQJZNwD.js → index-BfoDdVQS.js} +22 -6
  100. package/dist/{index-CDm0BWa3.js → index-BvY2hQac.js} +1 -1
  101. package/dist/index-Byg4ztr-.js +902 -0
  102. package/dist/{index-BWgc2-Qz.js → index-CZfqqrVu.js} +4 -3
  103. package/dist/index-C_H8jFYf.js +2743 -0
  104. package/dist/{index-xuFTeVrb.js → index-CmzjBrHR.js} +11 -9
  105. package/dist/{index-BBihP1s2.js → index-Ct6YjTIW.js} +2 -2
  106. package/dist/{index-Df4l6y-S.js → index-D34iYRdc.js} +1900 -2121
  107. package/dist/{index-DuhRCI0L.js → index-D4k1G2oE.js} +4 -4
  108. package/dist/{index-uuNGb1nv.js → index-DnepoNWn.js} +8028 -10766
  109. package/dist/index-Drmh0FT-.js +14571 -0
  110. package/dist/{index-DlGnYR5y.js → index-DtcUCknS.js} +2700 -2613
  111. package/dist/{index-C_1iqF1Q.js → index-DwTBiVts.js} +1 -1
  112. package/dist/{index-CWUmrVo_.js → index-OvnHt5x5.js} +800 -793
  113. package/dist/index-RwNlbTO8.js +115 -0
  114. package/dist/{index-CzYxnDWP.js → index-VqAbYyHH.js} +11 -6
  115. package/dist/{index-DzBzClHP.js → index-yGSko6Eq.js} +1 -1
  116. package/dist/{index.esm2017-B72iWwk_.js → index.esm2017-DLb2VyCT.js} +156 -156
  117. package/dist/{loading-rIhCiB_S.js → loading-CUNk5u1d.js} +1 -1
  118. package/dist/{lodash-B6fOjfjd.js → lodash-BJXravls.js} +1 -1
  119. package/dist/{member-import-CbHn7zss.js → member-import-DjYoddBi.js} +6 -5
  120. package/dist/{membership-DkJN7jyQ.js → membership-ByJUFP8f.js} +3 -3
  121. package/dist/{money-ChbDx6Nq.js → money-Bf2IEMJJ.js} +1 -1
  122. package/dist/{number-9TEd27Ku.js → number-CRBHrRUL.js} +1 -1
  123. package/dist/objectid-58gyOvdR.js +145 -0
  124. package/dist/{onboarding-BN3MKVRs.js → onboarding-CQ3lw7eY.js} +25 -25
  125. package/dist/{onboardingSetup-D9xhdgS3.js → onboardingSetup-CsdZKGFk.js} +2 -2
  126. package/dist/{plugins-CCibSJZa.js → plugins-iTZLbJGy.js} +3 -3
  127. package/dist/{MarketingMaterialEdit-DFhpsI2-.js → remy-icon-BhUGu2NI.js} +2 -1031
  128. package/dist/{reward-DjasF-NL.js → reward-DTN6JpEd.js} +1 -1
  129. package/dist/{rule-DqeChj0e.js → rule-BYACNQOL.js} +572 -492
  130. package/dist/style.css +1 -1
  131. package/dist/template--Vr0PCjB.js +188 -0
  132. package/dist/{timezone-D0nC1LDx.js → timezone-DwzjOED-.js} +1 -1
  133. package/dist/{transaction.fn-BkF4Ad2z.js → transaction.fn-DapYe3n7.js} +2 -2
  134. package/dist/{trigger-CxpXoQJO.js → trigger-D8r76yb0.js} +18 -18
  135. package/dist/{useMarketingMaterialActions-p0-fyMkm.js → useMarketingMaterialActions-CdMmibPE.js} +3 -3
  136. package/dist/{usePagination-CrC-1v4L.js → usePagination-BRcQJkO1.js} +1 -1
  137. package/dist/useWhatsappAccount-BOJ8fz84.js +62 -0
  138. package/dist/{user-CrylHgF1.js → user-vBZFKqXQ.js} +1 -1
  139. package/dist/vue-i18n-Cw6fF11e.js +2365 -0
  140. package/dist/{xlsx-CJNYF7-l.js → xlsx-Muy_Rjhk.js} +440 -440
  141. package/dist/{zod-Dzn9S95S.js → zod-CCPTOeUz.js} +1 -1
  142. package/package.json +12 -3
  143. package/dist/Broadcast-DZ4SP99P.js +0 -271
  144. package/dist/Card-B5ni027Q.js +0 -911
  145. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYxswo-Z.js +0 -2430
  146. package/dist/ReviewFacebookCallback-DeZqcpJo.js +0 -238
  147. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BvxbKSkB.js +0 -1882
  148. package/dist/Setting-BOWPp05N.js +0 -2036
  149. package/dist/Settings-DekXvE-R.js +0 -179
  150. package/dist/Store-DpVlMuau.js +0 -1998
  151. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CNDv6eiZ.js +0 -1009
  152. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-C-C3RSeW.js +0 -142
  153. package/dist/Transaction-mvKzTgLx.js +0 -39
  154. package/dist/campaign-Co4Lq-Wz.js +0 -228
  155. package/dist/campaign.fn-DolD3lYJ.js +0 -776
  156. package/dist/export-D0hWZSfH.js +0 -97
  157. package/dist/google-C3S8u0mT.js +0 -4
  158. package/dist/index-aCuOvuEC.js +0 -45
  159. package/dist/objectid-CGol1NeA.js +0 -145
  160. package/dist/rule-builder-DT854ycI.js +0 -102
  161. package/dist/template-BeCVA0-N.js +0 -236
  162. package/dist/vue-i18n-BjtkXdmG.js +0 -2365
@@ -0,0 +1,2629 @@
1
+ import { defineComponent as Y, computed as D, resolveComponent as v, openBlock as m, createBlock as R, withCtx as I, createElementVNode as n, toDisplayString as w, createVNode as l, createCommentVNode as M, createElementBlock as T, unref as e, Fragment as z, renderList as ce, ref as O, isRef as be, reactive as lt, onMounted as Ne, watch as We, toRaw as it, createTextVNode as ee, h as rt, normalizeStyle as tt, normalizeClass as we } from "vue";
2
+ import { _ as ct } from "./tier-BJDhpH6X.js";
3
+ import { useDialog as Ye, useDialogChild as Je, components as dt } from "@feedmepos/ui-library";
4
+ import { c as q, e as Le, S as He } from "./index-OvnHt5x5.js";
5
+ import { u as ot } from "./loading-CUNk5u1d.js";
6
+ import { u as Xe, C as Ie } from "./membership-ByJUFP8f.js";
7
+ import { t as ut, u as mt, v as pt, w as Qe, x as ft, y as yt } from "./index-D34iYRdc.js";
8
+ import { a as gt, c as qe } from "./object-BYyQ0PZp.js";
9
+ import { _ as pe } from "./lodash-BJXravls.js";
10
+ import { c as _e } from "./index-DnepoNWn.js";
11
+ import { u as ve } from "./vue-i18n-Cw6fF11e.js";
12
+ import { Z as ie, g as ae, a as se } from "./zod-CCPTOeUz.js";
13
+ import { z as re, R as Ae } from "./app-Devzv4gO.js";
14
+ import { u as je } from "./app-wDQR6dpb.js";
15
+ import { _ as ye } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CR-F0x1r.js";
16
+ import { c as bt, p as Ee, n as vt, f as Ge } from "./plugins-iTZLbJGy.js";
17
+ import { J as Ze } from "./JsonViewer-v8_C7l5N.js";
18
+ import { _ as ht } from "./index-DtcUCknS.js";
19
+ import { _ as xt } from "./ImageInput.vue_vue_type_script_setup_true_lang-srSgUY3e.js";
20
+ import { _ as _t } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
21
+ import { z as Ct, a as St } from "./money-Bf2IEMJJ.js";
22
+ import { f as Ft } from "./currency-mwm4AWXK.js";
23
+ import { F as wt } from "./number-CRBHrRUL.js";
24
+ import { a as $t, t as kt } from "./helper-D9cEaMIv.js";
25
+ import "./index-BvY2hQac.js";
26
+ import "./index-B1jP-_Z_.js";
27
+ import "./index-Byg4ztr-.js";
28
+ import "./index-B7HH6vKF.js";
29
+ import "./index-RwNlbTO8.js";
30
+ import "./index-CZfqqrVu.js";
31
+ import { m as Pt } from "./index-Ct6YjTIW.js";
32
+ import { m as De } from "./index-BfoDdVQS.js";
33
+ import { g as Ke } from "./index-B_gzo75q.js";
34
+ import { u as Vt } from "./business-BjAmUqNA.js";
35
+ import { useRouter as Tt } from "vue-router";
36
+ function nt(b) {
37
+ return _e.DineroFactory(b).toUnit();
38
+ }
39
+ function at(b, a, d, g, c = [], x = []) {
40
+ const o = ht.compact(
41
+ a.map((t) => b.find((r) => r.systemCode === t.systemCode && r.taxCode === t.taxCode)).filter((t) => !!t && x.includes(t.systemCode))
42
+ ), i = o.reduce(
43
+ (t, r) => {
44
+ var p;
45
+ return Object.assign(t, {
46
+ [r.taxCode]: {
47
+ inclusive: ((p = c.find((y) => y.systemCode === r.systemCode)) == null ? void 0 : p.inclusive) || !1,
48
+ adjustment: {
49
+ level: 1,
50
+ type: {
51
+ type: "BY_MULTIPLIER",
52
+ amount: {
53
+ amount: r.rate.amount,
54
+ precision: r.rate.precision,
55
+ currency: "MYR"
56
+ }
57
+ }
58
+ }
59
+ }
60
+ });
61
+ },
62
+ {}
63
+ ), f = _e.Calculator.calculate({
64
+ items: {
65
+ 0: {
66
+ quantity: 1,
67
+ adjustments: {
68
+ price: {
69
+ level: 0,
70
+ type: {
71
+ type: "BY_AMOUNT",
72
+ amount: _e.DineroFactory(d).subtract(_e.Dinero.fromNumber({ number: g }).toObject()).toObject()
73
+ }
74
+ }
75
+ },
76
+ taxes: i
77
+ }
78
+ },
79
+ adjustments: {},
80
+ roundToNearest: 0
81
+ });
82
+ return o.map((t) => ({
83
+ setting: t,
84
+ systemCode: t.systemCode,
85
+ name: t.name,
86
+ taxCode: t.taxCode,
87
+ rate: t.rate,
88
+ total: _e.DineroFactory({
89
+ ...f.items[0].taxes[t.taxCode].amount
90
+ }).convertPrecision(2).toObject()
91
+ }));
92
+ }
93
+ function st(b, a, d) {
94
+ return b ? b.reduce((g, c) => {
95
+ var x;
96
+ return (x = d.find((o) => o.systemCode === c.systemCode)) != null && x.inclusive || (g = _e.DineroFactory(g.toObject()).add(c.total)), g;
97
+ }, _e.DineroFactory(a)).toObject() : _e.DineroFactory(a).toObject();
98
+ }
99
+ const Rt = { class: "flex justify-between items-start gap-4 w-full" }, It = { class: "fm-typo-en-body-lg-600 text-left pt-4 break-words line-clamp-2" }, Ut = { class: "flex-shrink-0 -mr-8 -mt-8" }, Et = { class: "relative h-[120px] aspect-video flex mx-auto items-center justify-center border rounded-md border-fm-color-neutral-gray-300" }, Dt = ["src"], Bt = {
100
+ key: 2,
101
+ class: "absolute top-2 left-2"
102
+ }, Nt = { class: "flex flex-col gap-8 flex-1 text-left w-full" }, Mt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ot = { class: "flex gap-8 items-center flex-wrap" }, Lt = /* @__PURE__ */ Y({
103
+ __name: "StoreBundleCard",
104
+ props: {
105
+ bundle: { type: Object, required: !0 }
106
+ },
107
+ emits: ["edit", "delete", "send"],
108
+ setup(b, { emit: a }) {
109
+ const d = b, g = a, c = D(() => {
110
+ const o = [];
111
+ return d.bundle.price.amount > 0 && o.push(
112
+ `${q.Config.getCountry().currency.symbol}${nt(d.bundle.price)}`
113
+ ), d.bundle.coinPrice && o.push(`${d.bundle.coinPrice} point(s)`), o.join(" or ");
114
+ }), x = D(() => {
115
+ var i, f;
116
+ const o = [];
117
+ if (d.bundle.titles.length > 0 && o.push(`${d.bundle.titles.length} title(s)`), d.bundle.vouchers.length > 0 && o.push(`${d.bundle.vouchers.length} voucher(s)`), d.bundle.credit.normal || (i = d.bundle.credit.free) != null && i.amount) {
118
+ const t = d.bundle.credit.normal + (((f = d.bundle.credit.free) == null ? void 0 : f.amount) ?? 0);
119
+ o.push(`${t} credit(s)`);
120
+ }
121
+ return o;
122
+ });
123
+ return (o, i) => {
124
+ const f = v("FmButton"), t = v("FmMenuItem"), r = v("FmMenu"), p = v("FmIcon"), y = v("FmChip"), $ = v("FmCard");
125
+ return m(), R($, {
126
+ variant: "outlined",
127
+ class: "flex flex-col gap-y-8 p-16 min-h-[240px] h-full"
128
+ }, {
129
+ default: I(() => [
130
+ n("div", Rt, [
131
+ n("div", It, w(b.bundle.name), 1),
132
+ n("div", Ut, [
133
+ l(r, { placement: "bottom-end" }, {
134
+ "menu-button": I(() => [
135
+ l(f, {
136
+ icon: "more_vert",
137
+ variant: "tertiary"
138
+ })
139
+ ]),
140
+ default: I(() => [
141
+ l(t, {
142
+ onClick: i[0] || (i[0] = (u) => g("edit", b.bundle)),
143
+ icon: "edit",
144
+ label: "Edit"
145
+ }),
146
+ b.bundle.stripePriceId ? M("", !0) : (m(), R(t, {
147
+ key: 0,
148
+ onClick: i[1] || (i[1] = (u) => g("send", b.bundle)),
149
+ icon: "send",
150
+ label: "Send"
151
+ })),
152
+ l(t, {
153
+ onClick: i[2] || (i[2] = (u) => g("delete", b.bundle)),
154
+ icon: "delete"
155
+ }, {
156
+ label: I(() => [...i[3] || (i[3] = [
157
+ n("div", { class: "text-fm-color-typo-error fm-typo-en-body-md-400" }, " Delete ", -1)
158
+ ])]),
159
+ _: 1
160
+ })
161
+ ]),
162
+ _: 1
163
+ })
164
+ ])
165
+ ]),
166
+ n("div", Et, [
167
+ b.bundle.image ? (m(), T("img", {
168
+ key: 1,
169
+ src: b.bundle.image,
170
+ class: "w-full h-full object-contain aspect-video"
171
+ }, null, 8, Dt)) : (m(), R(p, {
172
+ key: 0,
173
+ name: "image",
174
+ outline: !0,
175
+ size: "md",
176
+ class: "text-fm-color-neutral-gray-200"
177
+ })),
178
+ b.bundle.isFeedvibe ? (m(), T("div", Bt, [
179
+ l(y, {
180
+ label: "Feedvibe",
181
+ class: "text-fm-color-primary bg-fm-color-system-warning-100",
182
+ compact: ""
183
+ })
184
+ ])) : M("", !0)
185
+ ]),
186
+ n("div", Nt, [
187
+ n("div", Mt, w(e(c) || "Free"), 1),
188
+ n("div", Ot, [
189
+ (m(!0), T(z, null, ce(e(x), (u, F) => (m(), R(y, {
190
+ key: F,
191
+ label: u
192
+ }, null, 8, ["label"]))), 128))
193
+ ])
194
+ ])
195
+ ]),
196
+ _: 1
197
+ });
198
+ };
199
+ }
200
+ }), At = /* @__PURE__ */ Y({
201
+ __name: "AddBundleCard",
202
+ emits: ["create"],
203
+ setup(b, { emit: a }) {
204
+ const { t: d } = ve(), g = a;
205
+ return (c, x) => {
206
+ const o = v("FmButton"), i = v("FmCard");
207
+ return m(), R(i, {
208
+ variant: "outlined",
209
+ class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
210
+ }, {
211
+ default: I(() => [
212
+ l(o, {
213
+ onClick: x[0] || (x[0] = (f) => g("create")),
214
+ label: e(d)("connect.store.actions.addBundle"),
215
+ icon: "add",
216
+ variant: "secondary"
217
+ }, null, 8, ["label"])
218
+ ]),
219
+ _: 1
220
+ });
221
+ };
222
+ }
223
+ }), jt = { class: "space-y-16" }, qt = { class: "flex w-full justify-between pb-16" }, Gt = { class: "flex items-center justify-end gap-8" }, Kt = /* @__PURE__ */ Y({
224
+ __name: "CategoryDialog",
225
+ props: {
226
+ action: {
227
+ type: String,
228
+ default: () => "add"
229
+ },
230
+ initialValue: {
231
+ type: String,
232
+ default: () => ""
233
+ }
234
+ },
235
+ setup(b) {
236
+ const { t: a } = ve(), d = b, g = Ye(), { emitData: c, emitAction: x } = Je(), o = O(d.initialValue), i = re.string().min(1);
237
+ function f() {
238
+ c(o.value), x("primary"), g.close();
239
+ }
240
+ function t() {
241
+ c(null), x("primary"), g.close();
242
+ }
243
+ return (r, p) => {
244
+ const y = v("FmTextField"), $ = v("FmButton");
245
+ return m(), T("div", jt, [
246
+ l(y, {
247
+ modelValue: e(o),
248
+ "onUpdate:modelValue": p[0] || (p[0] = (u) => be(o) ? o.value = u : null),
249
+ label: e(a)("connect.store.category.label"),
250
+ rules: [e(ie).toRule(e(i))]
251
+ }, null, 8, ["modelValue", "label", "rules"]),
252
+ n("div", qt, [
253
+ n("div", null, [
254
+ b.action == "edit" ? (m(), R($, {
255
+ key: 0,
256
+ onClick: t,
257
+ label: e(a)("connect.common.delete"),
258
+ variant: "destructive"
259
+ }, null, 8, ["label"])) : M("", !0)
260
+ ]),
261
+ n("div", Gt, [
262
+ l($, {
263
+ label: e(a)("connect.common.cancel"),
264
+ variant: "tertiary",
265
+ onClick: p[1] || (p[1] = (u) => e(g).close())
266
+ }, null, 8, ["label"]),
267
+ l($, {
268
+ label: b.action == "edit" ? e(a)("connect.common.edit") : e(a)("connect.common.add"),
269
+ disabled: !e(o),
270
+ onClick: f
271
+ }, null, 8, ["label", "disabled"])
272
+ ])
273
+ ])
274
+ ]);
275
+ };
276
+ }
277
+ }), Ht = { class: "space-y-16" }, zt = { class: "flex items-center justify-end gap-8 pb-16" }, Wt = /* @__PURE__ */ Y({
278
+ __name: "SelectCategoryDialog",
279
+ setup(b) {
280
+ const { emitData: a, emitAction: d } = Je(), g = Xe(), c = O(), x = D(
281
+ () => g.sortedStoreCategories.map((o, i) => ({
282
+ label: o.name,
283
+ value: i
284
+ }))
285
+ );
286
+ return (o, i) => {
287
+ const f = v("FmSelect"), t = v("FmButton");
288
+ return m(), T("div", Ht, [
289
+ i[4] || (i[4] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Select a category to create FeedMe CNY 2025 bundle ", -1)),
290
+ l(f, {
291
+ placeholder: "Select a category",
292
+ items: e(x),
293
+ modelValue: e(c),
294
+ "onUpdate:modelValue": [
295
+ i[0] || (i[0] = (r) => be(c) ? c.value = r : null),
296
+ i[1] || (i[1] = (r) => e(a)(r))
297
+ ],
298
+ label: "Category"
299
+ }, null, 8, ["items", "modelValue"]),
300
+ n("div", zt, [
301
+ l(t, {
302
+ variant: "tertiary",
303
+ label: "Cancel",
304
+ onClick: i[2] || (i[2] = (r) => e(d)("tertiary"))
305
+ }),
306
+ l(t, {
307
+ label: "Select",
308
+ onClick: i[3] || (i[3] = (r) => e(d)("primary")),
309
+ disabled: e(c) == null
310
+ }, null, 8, ["disabled"])
311
+ ])
312
+ ]);
313
+ };
314
+ }
315
+ });
316
+ function ge(b) {
317
+ return b.states.map((a) => ({ label: a, value: a }));
318
+ }
319
+ const Yt = {
320
+ [Le.F_COUNTRY.enum.MY]: {
321
+ states: [
322
+ "Johor",
323
+ "Kedah",
324
+ "Kelantan",
325
+ "Kuala Lumpur",
326
+ "Labuan",
327
+ "Melaka",
328
+ "Negeri Sembilan",
329
+ "Pahang",
330
+ "Perak",
331
+ "Perlis",
332
+ "Pulau Pinang",
333
+ "Putrajaya",
334
+ "Sabah",
335
+ "Sarawak",
336
+ "Selangor",
337
+ "Terengganu"
338
+ ],
339
+ get stateItems() {
340
+ return ge(this);
341
+ }
342
+ },
343
+ [Le.F_COUNTRY.enum.SG]: {
344
+ states: [],
345
+ get stateItems() {
346
+ return ge(this);
347
+ }
348
+ },
349
+ JP: {
350
+ states: [],
351
+ get stateItems() {
352
+ return ge(this);
353
+ }
354
+ },
355
+ AE: {
356
+ states: [],
357
+ get stateItems() {
358
+ return ge(this);
359
+ }
360
+ },
361
+ AU: {
362
+ states: [],
363
+ get stateItems() {
364
+ return ge(this);
365
+ }
366
+ },
367
+ MO: {
368
+ states: [],
369
+ get stateItems() {
370
+ return ge(this);
371
+ }
372
+ },
373
+ VN: {
374
+ states: [],
375
+ get stateItems() {
376
+ return ge(this);
377
+ }
378
+ },
379
+ [Le.F_COUNTRY.enum.ID]: {
380
+ states: [
381
+ "Aceh",
382
+ "Bali",
383
+ "Bangka-Belitung",
384
+ "Banten",
385
+ "Bengkulu",
386
+ "Central Java",
387
+ "Central Sulawesi",
388
+ "Daerah Istimewa Yogyakarta",
389
+ "East Java",
390
+ "East Kalimantan",
391
+ "East Nusa Tenggara",
392
+ "Gorontalo",
393
+ "Jakarta Raya",
394
+ "Jambi",
395
+ "Kalimantan Tengah",
396
+ "Lampung",
397
+ "Maluku",
398
+ "Maluku Utara",
399
+ "North Sulawesi",
400
+ "North Sumatra",
401
+ "Nusa Tenggara Barat",
402
+ "Papua",
403
+ "Riau",
404
+ "Riau Islands",
405
+ "South Kalimantan",
406
+ "South Sulawesi",
407
+ "South Sumatra",
408
+ "Sulawesi Barat",
409
+ "Sulawesi Tenggara",
410
+ "West Java",
411
+ "West Kalimantan",
412
+ "West Papua",
413
+ "West Sumatra"
414
+ ],
415
+ get stateItems() {
416
+ return ge(this);
417
+ }
418
+ },
419
+ [Le.F_COUNTRY.enum.TH]: {
420
+ states: [
421
+ "Bangkok",
422
+ "Amnat Charoen",
423
+ "Ang Thong",
424
+ "Bueng Kan",
425
+ "Buri Ram",
426
+ "Chachoengsao",
427
+ "Chai Nat",
428
+ "Chaiyaphum",
429
+ "Chanthaburi",
430
+ "Chiang Mai",
431
+ "Chiang Rai",
432
+ "Chonburi",
433
+ "Chumphon",
434
+ "Kalasin",
435
+ "Kamphaeng Phet",
436
+ "Kanchanaburi",
437
+ "Khon Kaen",
438
+ "Krabi",
439
+ "Lampang",
440
+ "Lamphun",
441
+ "Loei",
442
+ "Lopburi",
443
+ "Mae Hong Son",
444
+ "Maha Sarakham",
445
+ "Mukdahan",
446
+ "Nakhon Nayok",
447
+ "Nakhon Pathom",
448
+ "Nakhon Phanom",
449
+ "Nakhon Ratchasima",
450
+ "Nakhon Sawan",
451
+ "Nakhon Si Thammarat",
452
+ "Nan",
453
+ "Narathiwat",
454
+ "Nong Bua Lamphu",
455
+ "Nong Khai",
456
+ "Nonthaburi",
457
+ "Pathum Thani",
458
+ "Pattani",
459
+ "Phang Nga",
460
+ "Phatthalung",
461
+ "Phayao",
462
+ "Phetchabun",
463
+ "Phetchaburi",
464
+ "Phichit",
465
+ "Phitsanulok",
466
+ "Phra Nakhon Si Ayutthaya",
467
+ "Phrae",
468
+ "Phuket",
469
+ "Prachinburi",
470
+ "Prachuap Khiri Khan",
471
+ "Ranong",
472
+ "Ratchaburi",
473
+ "Rayong",
474
+ "Roi Et",
475
+ "Sa Kaeo",
476
+ "Sakon Nakhon",
477
+ "Samut Prakan",
478
+ "Samut Sakhon",
479
+ "Samut Songkhram",
480
+ "Saraburi",
481
+ "Satun",
482
+ "Sing Buri",
483
+ "Sisaket",
484
+ "Songkhla",
485
+ "Sukhothai",
486
+ "Suphan Buri",
487
+ "Surat Thani",
488
+ "Surin",
489
+ "Tak",
490
+ "Trang",
491
+ "Trat",
492
+ "Ubon Ratchathani",
493
+ "Udon Thani",
494
+ "Uthai Thani",
495
+ "Uttaradit",
496
+ "Yala",
497
+ "Yasothon"
498
+ ],
499
+ get stateItems() {
500
+ return ge(this);
501
+ }
502
+ }
503
+ }, Ue = () => q.Config.getCountry(), Be = {
504
+ get fullCurrency() {
505
+ return Ue().currency;
506
+ },
507
+ get currency() {
508
+ return Ue().currency.code;
509
+ },
510
+ get fullTax() {
511
+ return q.Country.getCountryFlattenTaxes(Ue().code);
512
+ },
513
+ get taxSystem() {
514
+ return Ue().taxSystems;
515
+ },
516
+ taxInclusion(b) {
517
+ return Be.taxSystem.map((a) => ({
518
+ systemCode: a.code,
519
+ inclusive: b !== void 0 ? b : !1
520
+ }));
521
+ },
522
+ groupedTaxOptions() {
523
+ const b = q.Country.getCountryFlattenTaxes(Ue().code);
524
+ return Be.taxSystem.map((a) => ({
525
+ code: a.code,
526
+ options: b.map((d) => ({ ...d, feedmeTaxCode: Be.generateCode(d) })).filter((d) => d.systemCode === a.code)
527
+ }));
528
+ },
529
+ systemDefaultCode(b) {
530
+ const a = Be.groupedTaxOptions().find((d) => d.code === b);
531
+ return a == null ? void 0 : a.options.find((d) => d.default);
532
+ },
533
+ generateCode(b) {
534
+ return `${b.systemCode}/${b.taxCode}`;
535
+ }
536
+ }, Z = Be, Jt = /* @__PURE__ */ Y({
537
+ __name: "TaxInclusiveSetting",
538
+ props: {
539
+ modelValue: {
540
+ type: Array,
541
+ required: !0,
542
+ default: () => []
543
+ }
544
+ },
545
+ emits: ["update:model-value"],
546
+ setup(b, { emit: a }) {
547
+ const d = b, g = Z.taxSystem, c = a, x = O(d.modelValue);
548
+ function o(r, p) {
549
+ const y = pe.clone(d.modelValue), $ = y.findIndex((u) => u.systemCode === r);
550
+ $ >= 0 ? y[$].inclusive = p : y.push({
551
+ systemCode: r,
552
+ inclusive: p
553
+ }), x.value = y, c("update:model-value", y);
554
+ }
555
+ function i() {
556
+ return g.map((r) => {
557
+ const p = d.modelValue ? d.modelValue.find((y) => y.systemCode === r.code) : !1;
558
+ return {
559
+ label: r.name,
560
+ config: {
561
+ value: p ? p.inclusive : !1
562
+ },
563
+ input: (y) => {
564
+ o(r.code, y);
565
+ }
566
+ };
567
+ });
568
+ }
569
+ const f = lt(i());
570
+ function t(r, p) {
571
+ return `${r} ${p ? "Inclusive" : "Exclusive"}`;
572
+ }
573
+ return Ne(() => {
574
+ d.modelValue.length || o(g[0].code, !1);
575
+ }), We(
576
+ () => d.modelValue,
577
+ (r, p) => {
578
+ r != p && !r.length && o(g[0].code, !1);
579
+ }
580
+ ), (r, p) => {
581
+ const y = v("FmSwitch");
582
+ return m(!0), T(z, null, ce(e(f), ($, u) => {
583
+ var F;
584
+ return m(), T("div", { key: u }, [
585
+ l(y, {
586
+ "model-value": ((F = e(x)[u]) == null ? void 0 : F.inclusive) || !1,
587
+ "label-placement": "left",
588
+ "onUpdate:modelValue": (k) => $.input(k)
589
+ }, {
590
+ label: I(() => {
591
+ var k;
592
+ return [
593
+ n("div", null, w(t($.label, ((k = e(x)[u]) == null ? void 0 : k.inclusive) || !1)), 1)
594
+ ];
595
+ }),
596
+ _: 2
597
+ }, 1032, ["model-value", "onUpdate:modelValue"])
598
+ ]);
599
+ }), 128);
600
+ };
601
+ }
602
+ });
603
+ var Xt = { mode: "development", appMode: "mf" };
604
+ const Zt = { class: "space-y-8" }, Qt = {
605
+ key: 0,
606
+ class: "space-y-16"
607
+ }, eo = /* @__PURE__ */ Y({
608
+ __name: "StripeSetting",
609
+ props: {
610
+ modelValue: {}
611
+ },
612
+ emits: ["update:modelValue"],
613
+ setup(b, { emit: a }) {
614
+ const d = b, g = a, c = O(!1);
615
+ We(c, (o, i) => {
616
+ i != o && (!d.modelValue && o ? g("update:modelValue", {
617
+ apiKey: "",
618
+ webhookSecret: ""
619
+ }) : o || g("update:modelValue", void 0));
620
+ });
621
+ const x = D(() => {
622
+ const o = Xt.mode === "development", i = q.Config.getCountry().code.toLowerCase(), f = i != "my" ? `.${i}` : "";
623
+ return `https://marketing${o ? "-dev" : ""}${f}.feedmeapi.com/stripe/${He.getBusinessId()}/webhook`;
624
+ });
625
+ return Ne(() => {
626
+ c.value = !!d.modelValue;
627
+ }), (o, i) => {
628
+ const f = v("FmSwitch"), t = v("FmTextField"), r = v("FmButton");
629
+ return m(), T("div", Zt, [
630
+ l(f, {
631
+ modelValue: e(c),
632
+ "onUpdate:modelValue": i[0] || (i[0] = (p) => be(c) ? c.value = p : null),
633
+ value: "true",
634
+ label: "Enable Stripe"
635
+ }, null, 8, ["modelValue"]),
636
+ d.modelValue ? (m(), T("div", Qt, [
637
+ l(t, {
638
+ label: "API Key",
639
+ modelValue: d.modelValue.apiKey,
640
+ "onUpdate:modelValue": i[1] || (i[1] = (p) => d.modelValue.apiKey = p),
641
+ "helper-text": "Go to Stripe Dashboard get your API Key and paste here."
642
+ }, null, 8, ["modelValue"]),
643
+ l(t, {
644
+ label: "Webhook URL",
645
+ "model-value": e(x),
646
+ readonly: "",
647
+ "helper-text": "Copy this URL to your Stripe dashboard"
648
+ }, {
649
+ append: I(() => [
650
+ l(r, {
651
+ icon: "content_copy",
652
+ variant: "tertiary",
653
+ onClick: i[2] || (i[2] = (p) => e(bt)(e(x)))
654
+ })
655
+ ]),
656
+ _: 1
657
+ }, 8, ["model-value"]),
658
+ l(t, {
659
+ modelValue: d.modelValue.webhookSecret,
660
+ "onUpdate:modelValue": i[3] || (i[3] = (p) => d.modelValue.webhookSecret = p),
661
+ label: "Webhook Secret",
662
+ "helper-text": `Copy the webhook signing secret from your Stripe account and paste
663
+ here.`
664
+ }, null, 8, ["modelValue"])
665
+ ])) : M("", !0)
666
+ ]);
667
+ };
668
+ }
669
+ }), to = {
670
+ key: 0,
671
+ class: "space-y-16 pr-12"
672
+ }, oo = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, no = {
673
+ key: 1,
674
+ class: "space-y-16"
675
+ }, ao = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, so = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, lo = { class: "grid grid-cols-2 gap-x-16 gap-y-16" }, io = { class: "space-y-4" }, ro = { class: "fm-typo-en-body-lg-400" }, co = { class: "space-y-16" }, uo = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, mo = { class: "flex items-center gap-8" }, po = /* @__PURE__ */ Y({
676
+ __name: "StoreSettingSheet",
677
+ emits: ["update"],
678
+ setup(b, { expose: a, emit: d }) {
679
+ const { t: g } = ve(), c = d, x = O(!1), o = O(), i = O(!1), f = ut.extend({
680
+ company: mt.extend({
681
+ name: re.string().min(1, "Company name is required"),
682
+ regNo: re.string().min(1, "Registration number is required"),
683
+ address: pt.extend({
684
+ line1: re.string().min(1, "Line 1 is required"),
685
+ line2: re.string().optional(),
686
+ state: re.string().min(1, "State is required"),
687
+ city: re.string().min(1, "City is required"),
688
+ postcode: re.string().min(1, "Postcode is required"),
689
+ country: re.string().min(1, "Country is required")
690
+ }),
691
+ phoneNo: re.string().min(1, "Phone number is required"),
692
+ sstRegNo: re.string().optional()
693
+ })
694
+ }), t = D(() => f.safeParse(o.value).success);
695
+ function r() {
696
+ const $ = f.safeParse(o.value);
697
+ $.success && c("update", $.data);
698
+ }
699
+ function p() {
700
+ return {
701
+ company: {
702
+ name: "",
703
+ address: {
704
+ line1: "",
705
+ line2: "",
706
+ city: "",
707
+ postcode: "",
708
+ state: "",
709
+ country: q.Config.getCountry().name
710
+ },
711
+ phoneNo: "",
712
+ regNo: "",
713
+ sstRegNo: ""
714
+ },
715
+ inclusiveTaxes: []
716
+ };
717
+ }
718
+ function y($, u) {
719
+ x.value = $, $ && (o.value = u != null && u.company ? pe.cloneDeep(u) : p());
720
+ }
721
+ return a({
722
+ showSheet: y,
723
+ data: o
724
+ }), ($, u) => {
725
+ const F = v("FmIcon"), k = v("FmMenuItem"), N = v("FmMenu"), te = v("FmSelect"), oe = v("FmButton"), H = v("FmSideSheet");
726
+ return m(), R(H, {
727
+ "max-width": 560,
728
+ modelValue: e(x),
729
+ "onUpdate:modelValue": u[15] || (u[15] = (le) => be(x) ? x.value = le : null),
730
+ header: e(g)("connect.store.setting.title")
731
+ }, {
732
+ "side-sheet-footer": I(() => [
733
+ n("div", mo, [
734
+ l(oe, {
735
+ label: e(g)("connect.common.save"),
736
+ onClick: r,
737
+ disabled: !e(t) || e(je)().isLoading,
738
+ loading: e(je)().isLoading
739
+ }, null, 8, ["label", "disabled", "loading"]),
740
+ l(oe, {
741
+ label: e(g)("connect.common.cancel"),
742
+ onClick: u[14] || (u[14] = (le) => y(!1)),
743
+ variant: "tertiary"
744
+ }, null, 8, ["label"])
745
+ ])
746
+ ]),
747
+ default: I(() => {
748
+ var le, de;
749
+ return [
750
+ l(Ze, { json: e(o) }, null, 8, ["json"]),
751
+ e(o) && e(o).company ? (m(), T("div", to, [
752
+ n("div", oo, w(e(g)("connect.store.setting.company.legal_info")), 1),
753
+ l(ye, {
754
+ modelValue: e(o).company.name,
755
+ "onUpdate:modelValue": u[0] || (u[0] = (V) => e(o).company.name = V),
756
+ label: e(g)("connect.store.setting.company.name"),
757
+ schema: e(ie).typeAtPath(e(f), "company.name")
758
+ }, null, 8, ["modelValue", "label", "schema"]),
759
+ l(ye, {
760
+ modelValue: e(o).company.regNo,
761
+ "onUpdate:modelValue": u[1] || (u[1] = (V) => e(o).company.regNo = V),
762
+ label: e(g)("connect.store.setting.company.reg_no"),
763
+ schema: e(ie).typeAtPath(e(f), "company.regNo")
764
+ }, null, 8, ["modelValue", "label", "schema"]),
765
+ e(q.Config).getCountry().taxSystems.length ? (m(), R(ye, {
766
+ key: 0,
767
+ modelValue: e(o).company.sstRegNo,
768
+ "onUpdate:modelValue": [
769
+ u[2] || (u[2] = (V) => e(o).company.sstRegNo = V),
770
+ u[3] || (u[3] = (V) => V ? null : e(o).inclusiveTaxes = [])
771
+ ],
772
+ label: e(g)("connect.store.setting.company.tax_reg_no"),
773
+ schema: e(ie).typeAtPath(e(f), "company.sstRegNo")
774
+ }, null, 8, ["modelValue", "label", "schema"])) : M("", !0),
775
+ (le = e(o).company) != null && le.sstRegNo && e(o).inclusiveTaxes ? (m(), T("div", no, [
776
+ n("div", ao, w(e(g)("connect.store.setting.company.tax")), 1),
777
+ l(Jt, {
778
+ modelValue: e(o).inclusiveTaxes,
779
+ "onUpdate:modelValue": u[4] || (u[4] = (V) => e(o).inclusiveTaxes = V)
780
+ }, null, 8, ["modelValue"])
781
+ ])) : M("", !0),
782
+ l(ye, {
783
+ modelValue: e(o).company.phoneNo,
784
+ "onUpdate:modelValue": u[5] || (u[5] = (V) => e(o).company.phoneNo = V),
785
+ label: e(g)("connect.store.setting.company.phone"),
786
+ schema: e(ie).typeAtPath(e(f), "company.phoneNo")
787
+ }, null, 8, ["modelValue", "label", "schema"]),
788
+ n("div", so, w(e(g)("connect.store.setting.company.address.title")), 1),
789
+ l(ye, {
790
+ modelValue: e(o).company.address.line1,
791
+ "onUpdate:modelValue": u[6] || (u[6] = (V) => e(o).company.address.line1 = V),
792
+ label: e(g)("connect.store.setting.company.address.line1"),
793
+ schema: e(ie).typeAtPath(e(f), "company.address.line1")
794
+ }, null, 8, ["modelValue", "label", "schema"]),
795
+ l(ye, {
796
+ modelValue: e(o).company.address.line2,
797
+ "onUpdate:modelValue": u[7] || (u[7] = (V) => e(o).company.address.line2 = V),
798
+ label: e(g)("connect.store.setting.company.address.line2"),
799
+ schema: e(ie).typeAtPath(e(f), "company.address.line2")
800
+ }, null, 8, ["modelValue", "label", "schema"]),
801
+ n("div", lo, [
802
+ l(ye, {
803
+ modelValue: e(o).company.address.city,
804
+ "onUpdate:modelValue": u[8] || (u[8] = (V) => e(o).company.address.city = V),
805
+ label: e(g)("connect.store.setting.company.address.city"),
806
+ schema: e(ie).typeAtPath(e(f), "company.address.city")
807
+ }, null, 8, ["modelValue", "label", "schema"]),
808
+ l(ye, {
809
+ modelValue: e(o).company.address.postcode,
810
+ "onUpdate:modelValue": u[9] || (u[9] = (V) => e(o).company.address.postcode = V),
811
+ label: e(g)("connect.store.setting.company.address.postcode"),
812
+ schema: e(ie).typeAtPath(e(f), "company.address.postcode")
813
+ }, null, 8, ["modelValue", "label", "schema"]),
814
+ n("div", io, [
815
+ n("div", ro, w(e(g)("connect.store.setting.company.address.state")), 1),
816
+ l(N, {
817
+ placement: "top-end",
818
+ "model-value": e(i)
819
+ }, {
820
+ "menu-button": I(() => [
821
+ l(ye, {
822
+ modelValue: e(o).company.address.state,
823
+ "onUpdate:modelValue": u[10] || (u[10] = (V) => e(o).company.address.state = V),
824
+ schema: e(ie).typeAtPath(e(f), "company.address.state"),
825
+ onFocusChanged: u[11] || (u[11] = (V) => i.value = V)
826
+ }, {
827
+ append: I(() => [
828
+ l(F, {
829
+ name: e(i) ? "keyboard_arrow_up" : "keyboard_arrow_down"
830
+ }, null, 8, ["name"])
831
+ ]),
832
+ _: 1
833
+ }, 8, ["modelValue", "schema"])
834
+ ]),
835
+ default: I(() => [
836
+ (m(!0), T(z, null, ce(e(Yt)[e(q.Config).getCountry().code].stateItems.filter(
837
+ (V) => {
838
+ var he, fe;
839
+ return V.label.toLowerCase().includes(((fe = (he = e(o)) == null ? void 0 : he.company) == null ? void 0 : fe.address.state.toLowerCase()) ?? "");
840
+ }
841
+ ) || [], (V) => (m(), R(k, {
842
+ key: V.value,
843
+ "model-value": e(o).company.address.state === V.value,
844
+ label: V.label,
845
+ onClick: () => {
846
+ e(o).company.address.state = V.value, i.value = !1;
847
+ }
848
+ }, null, 8, ["model-value", "label", "onClick"]))), 128))
849
+ ]),
850
+ _: 1
851
+ }, 8, ["model-value"])
852
+ ]),
853
+ l(te, {
854
+ label: e(g)("connect.store.setting.company.address.country"),
855
+ modelValue: e(o).company.address.country,
856
+ "onUpdate:modelValue": u[12] || (u[12] = (V) => e(o).company.address.country = V),
857
+ items: [
858
+ {
859
+ label: e(q.Config).getCountry().name,
860
+ value: e(q.Config).getCountry().name
861
+ }
862
+ ],
863
+ rules: [e(ie).ruleAtPath(e(f), "company.address.country")]
864
+ }, null, 8, ["label", "modelValue", "items", "rules"])
865
+ ]),
866
+ n("div", co, [
867
+ n("div", uo, w(e(g)("connect.store.setting.stripe.title")), 1),
868
+ l(eo, {
869
+ "model-value": (de = e(o)) == null ? void 0 : de.stripe,
870
+ "onUpdate:modelValue": u[13] || (u[13] = (V) => e(o).stripe = V)
871
+ }, null, 8, ["model-value"])
872
+ ])
873
+ ])) : M("", !0)
874
+ ];
875
+ }),
876
+ _: 1
877
+ }, 8, ["modelValue", "header"]);
878
+ };
879
+ }
880
+ }), fo = /* @__PURE__ */ Y({
881
+ __name: "TaxVariantSetting",
882
+ props: {
883
+ modelValue: {
884
+ type: Array,
885
+ required: !0,
886
+ default: () => []
887
+ }
888
+ },
889
+ emits: ["update:modelValue"],
890
+ setup(b, { emit: a }) {
891
+ const d = b, g = a;
892
+ Ne(() => {
893
+ if (o.value.length !== x.value.length) {
894
+ const t = x.value.reduce((r, p) => {
895
+ const y = Z.systemDefaultCode(p.name);
896
+ if (!y) return r;
897
+ const { systemCode: $, taxCode: u } = y;
898
+ return p.value || r.push({ systemCode: $, taxCode: u }), r;
899
+ }, []);
900
+ f(t);
901
+ }
902
+ });
903
+ function c() {
904
+ return Z.groupedTaxOptions();
905
+ }
906
+ const x = D(() => c().map((t) => ({
907
+ name: t.code,
908
+ value: (o.value || []).find(
909
+ (r) => t.options.some((p) => p.feedmeTaxCode === r)
910
+ ),
911
+ options: t.options.map((r) => ({
912
+ label: `${r.name} (${wt(r.rate)}%)`,
913
+ value: r.feedmeTaxCode
914
+ }))
915
+ }))), o = D(() => d.modelValue.map((t) => Z.generateCode(t)));
916
+ function i(t) {
917
+ const r = c().find(
918
+ (u) => u.options.some((F) => F.feedmeTaxCode === t)
919
+ ), p = r == null ? void 0 : r.options.find((u) => u.feedmeTaxCode === t);
920
+ if (!p) return;
921
+ const { systemCode: y, taxCode: $ } = p;
922
+ f([{ systemCode: y, taxCode: $ }]);
923
+ }
924
+ function f(t) {
925
+ const r = pe.clone(d.modelValue);
926
+ t.forEach((p) => {
927
+ const y = c().find(
928
+ (F) => F.options.some((k) => k.feedmeTaxCode === Z.generateCode(p))
929
+ ), $ = (y == null ? void 0 : y.options) || [], u = r.findIndex(
930
+ (F) => $.some((k) => Z.generateCode(k) === Z.generateCode(F))
931
+ );
932
+ u >= 0 ? r.splice(u, 1, p) : r.push(p);
933
+ }), g("update:modelValue", r);
934
+ }
935
+ return (t, r) => {
936
+ const p = v("FmRadio"), y = v("FmRadioGroup");
937
+ return m(!0), T(z, null, ce(e(x), ($) => (m(), T("div", {
938
+ key: $.name,
939
+ class: "flex items-start"
940
+ }, [
941
+ l(y, {
942
+ modelValue: $.value,
943
+ "onUpdate:modelValue": [
944
+ (u) => $.value = u,
945
+ r[0] || (r[0] = (u) => {
946
+ i(u);
947
+ })
948
+ ]
949
+ }, {
950
+ default: I(() => [
951
+ (m(!0), T(z, null, ce($.options, (u, F) => (m(), R(p, {
952
+ key: F,
953
+ value: u.value,
954
+ label: u.label
955
+ }, null, 8, ["value", "label"]))), 128))
956
+ ]),
957
+ _: 2
958
+ }, 1032, ["modelValue", "onUpdate:modelValue"])
959
+ ]))), 128);
960
+ };
961
+ }
962
+ }), ze = {
963
+ get _id() {
964
+ return (/* @__PURE__ */ new Date()).toISOString();
965
+ },
966
+ name: "",
967
+ price: q.Dinero.zero().toObject(),
968
+ originalPrice: q.Dinero.zero().toObject(),
969
+ vouchers: [],
970
+ credit: {
971
+ normal: 0,
972
+ free: {
973
+ amount: 0,
974
+ day: 0
975
+ }
976
+ },
977
+ config: {
978
+ options: {}
979
+ },
980
+ titles: [],
981
+ taxes: [],
982
+ taxTotals: [],
983
+ internal: !1,
984
+ priceWithTaxes: Ct()
985
+ }, yo = {
986
+ key: 0,
987
+ class: "space-y-24 pr-12"
988
+ }, go = { class: "space-y-8" }, bo = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, vo = { class: "flex items-center gap-8" }, ho = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, xo = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, _o = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, Co = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary !mb-[-16px]" }, So = { class: "space-y-8" }, Fo = { class: "flex items-center justify-between" }, wo = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, $o = { class: "space-y-8" }, ko = { class: "flex items-center gap-8" }, Po = /* @__PURE__ */ Y({
989
+ __name: "EditBundleSheet",
990
+ emits: ["update"],
991
+ setup(b, { expose: a, emit: d }) {
992
+ const g = d, { t: c } = ve(), x = Xe(), o = O(!1), i = O([]), f = O({
993
+ category: 0,
994
+ index: -1,
995
+ originalCategoryIndex: void 0
996
+ }), t = O(pe.cloneDeep(ze)), r = O(), p = Qe, y = D(() => {
997
+ const S = p.safeParse(t.value);
998
+ return S.success ? [] : S.error.errors;
999
+ }), $ = [
1000
+ {
1001
+ header: "Reward title",
1002
+ accessorFn: (S) => S.collectible.name,
1003
+ enableSorting: !0
1004
+ },
1005
+ {
1006
+ id: "type",
1007
+ header: "Reward type",
1008
+ accessorFn: (S) => S.collectible.type,
1009
+ cell(S) {
1010
+ return Ie[S.row.original.collectible.type].chip();
1011
+ }
1012
+ },
1013
+ {
1014
+ header: "Description",
1015
+ accessorFn: (S) => S.description,
1016
+ cell(S) {
1017
+ var P;
1018
+ const s = S.row.original;
1019
+ return s.collectible.type == "VOUCHER" || s.selectedReward == null ? s.description : rt(dt.FmStepperField, {
1020
+ "onUpdate:modelValue": (B) => {
1021
+ t.value.titles = t.value.titles.map(
1022
+ (W) => W.id == s.collectible._id ? { ...W, dayToExpire: B } : W
1023
+ );
1024
+ },
1025
+ modelValue: ((P = s.selectedReward) == null ? void 0 : P.extra) ?? 0,
1026
+ appendText: "day(s)",
1027
+ helperState: ae(y.value, "titles"),
1028
+ helperText: se(y.value, "titles"),
1029
+ max: 9999,
1030
+ rules: [(B) => B <= 9999 || "Maximum 9999 days allowed"],
1031
+ showSteppers: !1,
1032
+ disabled: !!t.value.stripePriceId
1033
+ });
1034
+ }
1035
+ }
1036
+ ], u = O([]), F = D(() => {
1037
+ var s;
1038
+ const S = (s = t.value) != null && s.isFeedvibe ? "STORE_BUNDLE:FEEDVIBE" : "STORE_BUNDLE:DEFAULT";
1039
+ return x.bundleRewards.filter((P) => {
1040
+ var B;
1041
+ return (B = t.value) != null && B.isFeedvibe && P.type !== "VOUCHER" ? !1 : $t(P.capabilities, S);
1042
+ }).map((P) => {
1043
+ const B = k.value.find((J) => J.id == P._id), W = P.type === "VOUCHER" ? `${P.options.maxUse} use(s), ${kt(
1044
+ P.options.validityOption || {}
1045
+ )}` : "No expiry";
1046
+ return {
1047
+ collectible: P,
1048
+ description: W,
1049
+ selectedReward: B
1050
+ };
1051
+ });
1052
+ }), k = D(() => {
1053
+ var S, s;
1054
+ return [
1055
+ ...((S = t.value) == null ? void 0 : S.titles.map((P) => ({
1056
+ id: P.id,
1057
+ extra: P.dayToExpire
1058
+ }))) ?? [],
1059
+ ...((s = t.value) == null ? void 0 : s.vouchers.map((P) => ({
1060
+ id: P,
1061
+ extra: void 0
1062
+ }))) ?? []
1063
+ ];
1064
+ }), N = D(
1065
+ () => t.value.stripePriceId && t.value.subscriptionValidity ? t.value.subscriptionValidity : 0
1066
+ );
1067
+ function te(S) {
1068
+ t.value.subscriptionValidity = S;
1069
+ for (const s of t.value.titles)
1070
+ s.dayToExpire = S;
1071
+ t.value.credit.free && (t.value.credit.free.day = S);
1072
+ }
1073
+ function oe() {
1074
+ const S = F.value, s = t.value;
1075
+ if (!(!s || !S))
1076
+ for (let P = 0; P < S.length; P++) {
1077
+ const B = S[P];
1078
+ H.value[P] ? B.collectible.type == "TITLE" ? s.titles.findIndex(
1079
+ (L) => L.id == B.collectible._id
1080
+ ) < 0 && s.titles.push({
1081
+ id: B.collectible._id,
1082
+ dayToExpire: N.value
1083
+ }) : s.vouchers.findIndex(
1084
+ (L) => L == B.collectible._id
1085
+ ) < 0 && s.vouchers.push(B.collectible._id) : (s.titles = s.titles.filter((J) => J.id != B.collectible._id), s.vouchers = s.vouchers.filter(
1086
+ (J) => J != B.collectible._id
1087
+ ));
1088
+ }
1089
+ }
1090
+ const H = O({});
1091
+ We(H, oe, { deep: !0 });
1092
+ const le = D(() => {
1093
+ var S, s;
1094
+ return (s = (S = x.storeOption) == null ? void 0 : S.company) == null ? void 0 : s.sstRegNo;
1095
+ }), de = D(() => {
1096
+ var S, s, P;
1097
+ return (P = (s = (S = x.storeOption) == null ? void 0 : S.inclusiveTaxes) == null ? void 0 : s[0]) != null && P.inclusive ? "Inclusive" : "Exclusive";
1098
+ }), V = D(() => {
1099
+ var S, s, P;
1100
+ return at(
1101
+ Z.fullTax,
1102
+ it(t.value.taxes),
1103
+ t.value.price,
1104
+ Number(t.value.credit.normal),
1105
+ ((S = x.storeOption) == null ? void 0 : S.inclusiveTaxes) ?? [],
1106
+ (P = (s = x.storeOption) == null ? void 0 : s.company) != null && P.sstRegNo ? Z.taxSystem.map((B) => B.code) : []
1107
+ );
1108
+ }), he = D(() => V.value.reduce(
1109
+ (s, P) => s.add(P.total),
1110
+ St()
1111
+ ).toFormat()), fe = D(() => {
1112
+ var B;
1113
+ const S = st(
1114
+ V.value,
1115
+ t.value.price,
1116
+ ((B = x.storeOption) == null ? void 0 : B.inclusiveTaxes) ?? []
1117
+ );
1118
+ t.value.priceWithTaxes = S;
1119
+ const s = Ft(S, !1), P = Number(s.replace(/[^\d.-]/g, ""));
1120
+ return Number.isNaN(P) ? 0 : P;
1121
+ });
1122
+ function Te() {
1123
+ t.value.taxTotals = V.value, g("update", Qe.parse(gt(t.value)));
1124
+ }
1125
+ function A() {
1126
+ return pe.cloneDeep(ze);
1127
+ }
1128
+ function Ce(S, s) {
1129
+ o.value = S, S && s && (r.value = void 0, i.value = s.categories, t.value = s.bundle || A(), f.value.category = s.category, f.value.index = s.index, f.value.originalCategoryIndex = s.category, H.value = F.value.reduce((P, B, W) => (P[W] = !!B.selectedReward, P), {}));
1130
+ }
1131
+ return a({
1132
+ showSheet: Ce,
1133
+ bundleImage: r,
1134
+ target: f,
1135
+ data: t
1136
+ }), (S, s) => {
1137
+ const P = v("FmSwitch"), B = v("FmHelperText"), W = v("FmTextField"), J = v("FmSelect"), L = v("FmStepperField"), $e = v("FmPill"), xe = v("FmMenuItem"), ke = v("FmTable"), ue = v("FmButton"), Pe = v("FmSideSheet");
1138
+ return m(), R(Pe, {
1139
+ "max-width": 768,
1140
+ modelValue: e(o),
1141
+ "onUpdate:modelValue": s[21] || (s[21] = (Se) => be(o) ? o.value = Se : null),
1142
+ header: e(f).index != -1 ? e(c)("connect.store.bundle.edit.title") : e(c)("connect.store.bundle.edit.create")
1143
+ }, {
1144
+ "side-sheet-footer": I(() => [
1145
+ n("div", ko, [
1146
+ l(ue, {
1147
+ label: e(f).index != -1 ? "Save" : "Add",
1148
+ onClick: Te,
1149
+ disabled: e(y).length > 0,
1150
+ loading: e(je)().isLoading
1151
+ }, null, 8, ["label", "disabled", "loading"]),
1152
+ l(ue, {
1153
+ label: "Cancel",
1154
+ onClick: s[20] || (s[20] = (Se) => Ce(!1)),
1155
+ variant: "tertiary"
1156
+ })
1157
+ ])
1158
+ ]),
1159
+ default: I(() => {
1160
+ var Se, Re, Ve, Me, Oe, h, C, U, G, K;
1161
+ return [
1162
+ l(Ze, { json: e(t) }, null, 8, ["json"]),
1163
+ e(t) ? (m(), T("div", yo, [
1164
+ n("div", go, [
1165
+ e(q.Config).getCountry().code == "MY" && ((Se = e(x).payoutAccount) == null ? void 0 : Se.status) == "APPROVED" && ((Re = e(x).payoutAccount) != null && Re.enable) ? (m(), R(P, {
1166
+ key: 0,
1167
+ "onUpdate:modelValue": s[0] || (s[0] = (_) => {
1168
+ e(t).isFeedvibe = _, e(t).isFeedvibe && (e(t).credit.normal = 0, e(t).coinPrice = 0, e(t).titles = [], H.value = {}, e(t).hideInPos = !0, e(t).internal = !0);
1169
+ }),
1170
+ "label-placement": "right",
1171
+ "model-value": e(t).isFeedvibe || !1,
1172
+ label: "Feedvibe Campaign",
1173
+ sublabel: "Bundle will be appear for Feedvibe campaign use"
1174
+ }, null, 8, ["model-value"])) : M("", !0),
1175
+ e(t).isFeedvibe ? (m(), R(B, {
1176
+ key: 1,
1177
+ text: "There will be a 15% charge for FeedVibe bundles sold in the FeedVibe app. FeedVibe bundles only show up in the FeedVibe app and cannot be sold in the POS and mini program. For more information, please contact support.",
1178
+ state: "warning"
1179
+ })) : M("", !0)
1180
+ ]),
1181
+ n("div", bo, w(e(c)("connect.store.bundle.edit.basicInformation")), 1),
1182
+ l(W, {
1183
+ label: e(c)("connect.store.bundle.edit.bundleName"),
1184
+ modelValue: e(t).name,
1185
+ "onUpdate:modelValue": s[1] || (s[1] = (_) => e(t).name = _),
1186
+ "helper-state": e(ae)(e(y), "name"),
1187
+ "helper-text": e(se)(e(y), "name")
1188
+ }, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
1189
+ l(J, {
1190
+ modelValue: e(f).category,
1191
+ "onUpdate:modelValue": s[2] || (s[2] = (_) => e(f).category = _),
1192
+ label: "Store Category",
1193
+ items: e(i).map((_, Q) => ({ label: _, value: Q }))
1194
+ }, null, 8, ["modelValue", "items"]),
1195
+ l(xt, {
1196
+ label: e(c)("connect.store.bundle.edit.bundleImage"),
1197
+ class: "w-1/2 xs:w-2/3",
1198
+ "aspect-ratio": "16/9",
1199
+ thumbnail: e(t).image ?? void 0,
1200
+ file: e(r) ?? void 0,
1201
+ "onUpdate:file": s[3] || (s[3] = (_) => {
1202
+ r.value = _;
1203
+ }),
1204
+ "helper-state": e(ae)(e(y), "image"),
1205
+ "helper-text": e(se)(e(y), "image")
1206
+ }, null, 8, ["label", "thumbnail", "file", "helper-state", "helper-text"]),
1207
+ l(L, {
1208
+ "model-value": e(q.Dinero).fromFdoDinero(e(t).price).toUnit(),
1209
+ label: e(c)("connect.store.bundle.edit.bundlePrice"),
1210
+ min: 0,
1211
+ "max-fraction-digits": 2,
1212
+ "onUpdate:modelValue": s[4] || (s[4] = (_) => {
1213
+ e(t).price.amount = _ * 10 ** e(t).price.precision;
1214
+ }),
1215
+ "is-currency": !0,
1216
+ "show-steppers": !1,
1217
+ "helper-text": e(se)(e(y), "price") || `${e(q.Dinero).fromNumber({ number: 1 }).toFormat(
1218
+ !0
1219
+ )} = ${e(q.Dinero).fromNumber({ number: 1 }).toUnit()} credit`,
1220
+ "helper-state": e(ae)(e(y), "price")
1221
+ }, {
1222
+ prepend: I(() => [
1223
+ ee(w(e(q.Dinero).defaultCurrency()), 1)
1224
+ ]),
1225
+ _: 1
1226
+ }, 8, ["model-value", "label", "helper-text", "helper-state"]),
1227
+ l(L, {
1228
+ "model-value": e(q.Dinero).fromFdoDinero(e(t).originalPrice).toUnit(),
1229
+ label: e(c)("connect.store.bundle.edit.bundleValue"),
1230
+ min: 0,
1231
+ "max-fraction-digits": 2,
1232
+ "onUpdate:modelValue": s[5] || (s[5] = (_) => {
1233
+ e(t).originalPrice || (e(t).originalPrice = e(q.Dinero).zero().toObject()), e(t).originalPrice.amount = _ * 10 ** e(t).originalPrice.precision;
1234
+ }),
1235
+ "is-currency": !0,
1236
+ "show-steppers": !1,
1237
+ "helper-text": e(se)(e(y), "originalPrice") || e(c)("connect.store.bundle.edit.originalPriceHelper"),
1238
+ "helper-state": e(ae)(e(y), "originalPrice")
1239
+ }, {
1240
+ prepend: I(() => [
1241
+ ee(w(e(q.Dinero).defaultCurrency()), 1)
1242
+ ]),
1243
+ _: 1
1244
+ }, 8, ["model-value", "label", "helper-text", "helper-state"]),
1245
+ e(t).isFeedvibe ? M("", !0) : (m(), R(L, {
1246
+ key: 0,
1247
+ "model-value": e(t).coinPrice ?? null,
1248
+ label: e(c)("connect.store.bundle.edit.pointNeeded"),
1249
+ min: 0,
1250
+ "onUpdate:modelValue": s[6] || (s[6] = (_) => {
1251
+ _ > 0 && e(t).credit.normal > 0 && (e(t).credit.normal = 0), e(t).coinPrice = _;
1252
+ }),
1253
+ "show-steppers": !1,
1254
+ "helper-state": e(ae)(e(y), "coinPrice"),
1255
+ "helper-text": e(se)(e(y), "coinPrice")
1256
+ }, {
1257
+ label: I(() => [
1258
+ n("div", vo, [
1259
+ ee(w(e(c)("connect.store.bundle.edit.pointNeeded")) + " ", 1),
1260
+ l($e, { variant: "premium" })
1261
+ ])
1262
+ ]),
1263
+ append: I(() => [...s[22] || (s[22] = [
1264
+ ee(" point(s) ", -1)
1265
+ ])]),
1266
+ _: 1
1267
+ }, 8, ["model-value", "label", "helper-state", "helper-text"])),
1268
+ (Ve = e(x).storeOption) != null && Ve.stripe && !e(t).isFeedvibe ? (m(), T(z, { key: 1 }, [
1269
+ n("div", ho, w(e(c)("connect.store.bundle.edit.subscriptionSettings")), 1),
1270
+ l(W, {
1271
+ label: e(c)("connect.store.bundle.edit.stripePriceId"),
1272
+ modelValue: e(t).stripePriceId,
1273
+ "onUpdate:modelValue": s[7] || (s[7] = (_) => e(t).stripePriceId = _),
1274
+ "helper-state": e(ae)(e(y), "stripePriceId"),
1275
+ "helper-text": e(se)(e(y), "stripePriceId")
1276
+ }, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
1277
+ e(t).stripePriceId ? (m(), R(L, {
1278
+ key: 0,
1279
+ "model-value": e(t).subscriptionValidity ?? null,
1280
+ min: 1,
1281
+ "onUpdate:modelValue": te,
1282
+ label: e(c)("connect.store.bundle.edit.subscriptionValidity"),
1283
+ "show-steppers": !1,
1284
+ "helper-state": e(ae)(e(y), "subscriptionValidity"),
1285
+ "helper-text": e(se)(e(y), "subscriptionValidity")
1286
+ }, null, 8, ["model-value", "label", "helper-state", "helper-text"])) : M("", !0)
1287
+ ], 64)) : M("", !0),
1288
+ e(t).isFeedvibe ? M("", !0) : (m(), T(z, { key: 2 }, [
1289
+ n("div", xo, w(e(c)("connect.store.bundle.edit.credit")), 1),
1290
+ l(L, {
1291
+ modelValue: e(t).credit.normal,
1292
+ "onUpdate:modelValue": s[8] || (s[8] = (_) => e(t).credit.normal = _),
1293
+ label: e(c)("connect.store.bundle.edit.normalCredit"),
1294
+ "show-steppers": !1,
1295
+ "helper-state": e(ae)(e(y), "credit.normal"),
1296
+ "helper-text": e(se)(e(y), "credit.normal")
1297
+ }, {
1298
+ append: I(() => [...s[23] || (s[23] = [
1299
+ ee(" credit ", -1)
1300
+ ])]),
1301
+ _: 1
1302
+ }, 8, ["modelValue", "label", "helper-state", "helper-text"]),
1303
+ l(L, {
1304
+ "model-value": ((Me = e(t).credit.free) == null ? void 0 : Me.amount) ?? null,
1305
+ min: 0,
1306
+ "onUpdate:modelValue": s[9] || (s[9] = (_) => {
1307
+ e(t).credit.free || (e(t).credit.free = {
1308
+ amount: 0,
1309
+ day: 1
1310
+ }), e(t).credit.free.amount = _;
1311
+ }),
1312
+ label: e(c)("connect.store.bundle.edit.freeCredit"),
1313
+ "show-steppers": !1,
1314
+ "helper-state": e(ae)(e(y), "credit.free.amount"),
1315
+ "helper-text": e(se)(e(y), "credit.free.amount")
1316
+ }, {
1317
+ append: I(() => [...s[24] || (s[24] = [
1318
+ ee(" credit ", -1)
1319
+ ])]),
1320
+ _: 1
1321
+ }, 8, ["model-value", "label", "helper-state", "helper-text"]),
1322
+ (Oe = e(t).credit.free) != null && Oe.amount ? (m(), R(L, {
1323
+ key: 0,
1324
+ disabled: !!e(t).stripePriceId,
1325
+ "model-value": ((h = e(t).credit.free) == null ? void 0 : h.day) ?? null,
1326
+ min: 0,
1327
+ max: 9999,
1328
+ "onUpdate:modelValue": s[10] || (s[10] = (_) => {
1329
+ e(t).credit.free || (e(t).credit.free = {
1330
+ amount: 0,
1331
+ day: 1
1332
+ }), e(t).credit.free.day = e(N) || _;
1333
+ }),
1334
+ label: "Free credit valid for",
1335
+ "show-steppers": !1,
1336
+ "helper-state": e(ae)(e(y), "credit.free.day"),
1337
+ "helper-text": e(se)(e(y), "credit.free.day")
1338
+ }, {
1339
+ append: I(() => [...s[25] || (s[25] = [
1340
+ ee(" day(s) ", -1)
1341
+ ])]),
1342
+ _: 1
1343
+ }, 8, ["disabled", "model-value", "helper-state", "helper-text"])) : M("", !0)
1344
+ ], 64)),
1345
+ e(le) ? (m(), T(z, { key: 3 }, [
1346
+ s[26] || (s[26] = n("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Taxes", -1)),
1347
+ l(fo, {
1348
+ modelValue: e(t).taxes,
1349
+ "onUpdate:modelValue": s[11] || (s[11] = (_) => e(t).taxes = _)
1350
+ }, null, 8, ["modelValue"]),
1351
+ l(W, {
1352
+ label: `Tax Charged (${e(de)})`,
1353
+ "model-value": e(he),
1354
+ disabled: ""
1355
+ }, null, 8, ["label", "model-value"])
1356
+ ], 64)) : M("", !0),
1357
+ l(L, {
1358
+ label: "Total Price",
1359
+ "model-value": e(fe),
1360
+ disabled: !0
1361
+ }, null, 8, ["model-value"]),
1362
+ n("div", _o, w(e(c)("connect.store.bundle.edit.bundleReward.title")), 1),
1363
+ n("div", Co, w(e(c)("connect.store.bundle.edit.bundleReward.description")), 1),
1364
+ n("div", So, [
1365
+ n("div", Fo, [
1366
+ l(_t, {
1367
+ label: `Reward type: ${e(u).length == 0 ? "All" : e(u)[0].name}`
1368
+ }, {
1369
+ default: I(() => [
1370
+ l(xe, {
1371
+ onClick: s[12] || (s[12] = (_) => u.value = []),
1372
+ label: "All"
1373
+ }),
1374
+ l(xe, {
1375
+ onClick: s[13] || (s[13] = (_) => u.value = [
1376
+ {
1377
+ id: "type",
1378
+ value: "VOUCHER",
1379
+ name: e(Ie).VOUCHER.name
1380
+ }
1381
+ ]),
1382
+ label: e(Ie).VOUCHER.name
1383
+ }, null, 8, ["label"]),
1384
+ l(xe, {
1385
+ onClick: s[14] || (s[14] = (_) => u.value = [
1386
+ {
1387
+ id: "type",
1388
+ value: "TITLE",
1389
+ name: e(Ie).TITLE.name
1390
+ }
1391
+ ]),
1392
+ label: e(Ie).TITLE.name
1393
+ }, null, 8, ["label"])
1394
+ ]),
1395
+ _: 1
1396
+ }, 8, ["label"])
1397
+ ]),
1398
+ l(ke, {
1399
+ modelValue: e(H),
1400
+ "onUpdate:modelValue": s[15] || (s[15] = (_) => be(H) ? H.value = _ : null),
1401
+ selection: "multiple",
1402
+ "column-filter": e(u),
1403
+ "column-defs": $,
1404
+ "row-data": e(F),
1405
+ "hide-footer": e(F).length <= 10
1406
+ }, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"]),
1407
+ l(B, {
1408
+ text: e(se)(e(y), "titles"),
1409
+ state: e(ae)(e(y), "titles")
1410
+ }, null, 8, ["text", "state"])
1411
+ ]),
1412
+ n("div", wo, w(e(c)("connect.store.bundle.edit.advanceSetting")), 1),
1413
+ n("div", $o, [
1414
+ e(t).isFeedvibe ? M("", !0) : (m(), T(z, { key: 0 }, [
1415
+ l(P, {
1416
+ "model-value": e(t).internal ?? !1,
1417
+ "onUpdate:modelValue": s[16] || (s[16] = (_) => e(t).internal = _),
1418
+ "label-placement": "right",
1419
+ label: e(c)("connect.store.bundle.edit.internalBundle"),
1420
+ sublabel: e(c)("connect.store.bundle.edit.internalBundleDescription")
1421
+ }, null, 8, ["model-value", "label", "sublabel"]),
1422
+ l(P, {
1423
+ "model-value": e(t).hideInPos ?? !1,
1424
+ "onUpdate:modelValue": s[17] || (s[17] = (_) => e(t).hideInPos = _),
1425
+ "label-placement": "right",
1426
+ label: e(c)("connect.store.bundle.edit.hideInPos"),
1427
+ sublabel: e(c)("connect.store.bundle.edit.hideInPosDescription")
1428
+ }, null, 8, ["model-value", "label", "sublabel"])
1429
+ ], 64)),
1430
+ l(L, {
1431
+ "model-value": ((U = (C = e(t).config) == null ? void 0 : C.options) == null ? void 0 : U.maxPerUser) || null,
1432
+ "onUpdate:modelValue": s[18] || (s[18] = (_) => e(pe).set(e(t), "config.options.maxPerUser", _)),
1433
+ label: e(c)("connect.store.bundle.edit.maxPerUser"),
1434
+ "show-steppers": !1,
1435
+ placeholder: e(c)("connect.store.bundle.edit.unlimited")
1436
+ }, null, 8, ["model-value", "label", "placeholder"]),
1437
+ l(L, {
1438
+ "model-value": ((K = (G = e(t).config) == null ? void 0 : G.options) == null ? void 0 : K.maxReceive) || null,
1439
+ "onUpdate:modelValue": s[19] || (s[19] = (_) => e(pe).set(e(t), "config.options.maxReceive", _)),
1440
+ label: e(c)("connect.store.bundle.edit.maxReceive"),
1441
+ "show-steppers": !1,
1442
+ placeholder: e(c)("connect.store.bundle.edit.unlimited")
1443
+ }, null, 8, ["model-value", "label", "placeholder"])
1444
+ ])
1445
+ ])) : M("", !0)
1446
+ ];
1447
+ }),
1448
+ _: 1
1449
+ }, 8, ["modelValue", "header"]);
1450
+ };
1451
+ }
1452
+ }), Vo = { class: "flex gap-8 items-center flex-wrap" }, To = { class: "flex items-center gap-8" }, Ro = /* @__PURE__ */ Y({
1453
+ __name: "SendBundleSheet",
1454
+ emits: ["success"],
1455
+ setup(b, { expose: a, emit: d }) {
1456
+ const { minor: g } = ot, c = O(), x = O(""), o = O(""), i = O([]), f = O(!1), t = O();
1457
+ O(!0);
1458
+ function r(F) {
1459
+ f.value = !0, x.value = null, o.value = "", c.value = F.bundle;
1460
+ }
1461
+ function p() {
1462
+ f.value = !1;
1463
+ }
1464
+ async function y(F) {
1465
+ const k = await Pt.read({
1466
+ limit: 25,
1467
+ skip: 0,
1468
+ sortBy: "_id",
1469
+ search: F,
1470
+ descending: !1
1471
+ });
1472
+ i.value = k.resources.map((N) => ({
1473
+ label: `${N.name} (${N.phoneNumber})`,
1474
+ value: N._id
1475
+ })), await new Promise((N) => setTimeout(N, 100));
1476
+ }
1477
+ async function $() {
1478
+ if (!c.value || !x.value) return;
1479
+ const F = i.value.find(
1480
+ (N) => N.value === x.value
1481
+ );
1482
+ await Ee.confirm(
1483
+ `Are you sure you want to send bundle ${c.value.name} to ${F == null ? void 0 : F.label}?`,
1484
+ "Confirm",
1485
+ "Confirm",
1486
+ "Cancel"
1487
+ ) && await g(
1488
+ async () => {
1489
+ const N = {
1490
+ bundle: c.value._id,
1491
+ member: x.value,
1492
+ source: ft.enum.ADMIN,
1493
+ ref: `ADMIN:${(/* @__PURE__ */ new Date()).toISOString()}:${o.value}`,
1494
+ withCoin: !1
1495
+ };
1496
+ await De.sendBundle(N), p();
1497
+ },
1498
+ {
1499
+ message: "Sending bundle",
1500
+ successMessage: "Bundle sent"
1501
+ }
1502
+ );
1503
+ }
1504
+ const u = D(() => {
1505
+ var k, N, te;
1506
+ const F = [];
1507
+ return ((k = c.value) == null ? void 0 : k.price.amount) > 0 && F.push(
1508
+ `${q.Config.getCountry().currency.symbol}${nt((N = c.value) == null ? void 0 : N.price)}`
1509
+ ), (te = c.value) != null && te.coinPrice && F.push(`${c.value.coinPrice} point(s)`), F.join(" or ");
1510
+ });
1511
+ return a({
1512
+ showSheet: r,
1513
+ hideSheet: p
1514
+ }), Ne(async () => {
1515
+ await y("");
1516
+ }), (F, k) => {
1517
+ const N = v("FmCardMedia"), te = v("FmCardHeader"), oe = v("FmChip"), H = v("FmCardSection"), le = v("FmCard"), de = v("FmSelect"), V = v("FmTextField"), he = v("FmForm"), fe = v("FmButton"), Te = v("FmSideSheet");
1518
+ return m(), R(Te, {
1519
+ "max-width": 560,
1520
+ "dismiss-away": !0,
1521
+ header: "Send bundle to member",
1522
+ modelValue: e(f),
1523
+ "onUpdate:modelValue": [
1524
+ k[4] || (k[4] = (A) => be(f) ? f.value = A : null),
1525
+ k[5] || (k[5] = (A) => f.value = A)
1526
+ ]
1527
+ }, {
1528
+ "side-sheet-footer": I(() => [
1529
+ n("div", To, [
1530
+ l(fe, {
1531
+ label: "Send",
1532
+ loading: e(je)().isLoading,
1533
+ onClick: k[2] || (k[2] = async () => {
1534
+ var A;
1535
+ return (A = e(t)) == null ? void 0 : A.validateInputs();
1536
+ })
1537
+ }, null, 8, ["loading"]),
1538
+ l(fe, {
1539
+ label: "Cancel",
1540
+ type: "button",
1541
+ variant: "tertiary",
1542
+ onClick: k[3] || (k[3] = (A) => f.value = !1)
1543
+ })
1544
+ ])
1545
+ ]),
1546
+ default: I(() => [
1547
+ l(he, {
1548
+ class: "space-y-16",
1549
+ ref_key: "form",
1550
+ ref: t,
1551
+ onValidationSuccess: $,
1552
+ blameFormChildOnValidationFailed: ""
1553
+ }, {
1554
+ default: I(() => [
1555
+ l(le, {
1556
+ class: "max-w-[700px]",
1557
+ horizontal: "",
1558
+ variant: "outlined"
1559
+ }, {
1560
+ default: I(() => {
1561
+ var A, Ce;
1562
+ return [
1563
+ (A = e(c)) != null && A.image ? (m(), R(N, {
1564
+ key: 0,
1565
+ width: "100",
1566
+ src: (Ce = e(c)) == null ? void 0 : Ce.image
1567
+ }, null, 8, ["src"])) : M("", !0),
1568
+ l(H, { class: "flex flex-col gap-16 justify-between" }, {
1569
+ default: I(() => {
1570
+ var S;
1571
+ return [
1572
+ l(te, {
1573
+ class: "p-0",
1574
+ title: (S = e(c)) == null ? void 0 : S.name,
1575
+ subtitle: e(u)
1576
+ }, null, 8, ["title", "subtitle"]),
1577
+ l(H, { class: "p-0" }, {
1578
+ default: I(() => {
1579
+ var s, P, B, W, J, L, $e, xe, ke, ue, Pe;
1580
+ return [
1581
+ n("div", Vo, [
1582
+ (s = e(c)) != null && s.isFeedvibe ? (m(), R(oe, {
1583
+ key: 0,
1584
+ label: "Feedvibe"
1585
+ })) : M("", !0),
1586
+ (B = (P = e(c)) == null ? void 0 : P.titles) != null && B.length ? (m(), R(oe, {
1587
+ key: 1,
1588
+ label: `${e(c).titles.length} title(s)`
1589
+ }, null, 8, ["label"])) : M("", !0),
1590
+ (J = (W = e(c)) == null ? void 0 : W.vouchers) != null && J.length ? (m(), R(oe, {
1591
+ key: 2,
1592
+ label: `${e(c).vouchers.length} voucher(s)`
1593
+ }, null, 8, ["label"])) : M("", !0),
1594
+ ($e = (L = e(c)) == null ? void 0 : L.credit) != null && $e.normal || (ue = (ke = (xe = e(c)) == null ? void 0 : xe.credit) == null ? void 0 : ke.free) != null && ue.amount ? (m(), R(oe, {
1595
+ key: 3,
1596
+ label: `${(e(c).credit.normal || 0) + (((Pe = e(c).credit.free) == null ? void 0 : Pe.amount) || 0)} credit(s)`
1597
+ }, null, 8, ["label"])) : M("", !0)
1598
+ ])
1599
+ ];
1600
+ }),
1601
+ _: 1
1602
+ })
1603
+ ];
1604
+ }),
1605
+ _: 1
1606
+ })
1607
+ ];
1608
+ }),
1609
+ _: 1
1610
+ }),
1611
+ l(de, {
1612
+ modelValue: e(x),
1613
+ "onUpdate:modelValue": k[0] || (k[0] = (A) => be(x) ? x.value = A : null),
1614
+ label: "Select member",
1615
+ searchable: "",
1616
+ items: e(i),
1617
+ onSearch: y,
1618
+ rules: [(A) => !!A > 0 || "Member is required"],
1619
+ "helper-text": "Type to search member"
1620
+ }, null, 8, ["modelValue", "items", "rules"]),
1621
+ l(V, {
1622
+ modelValue: e(o),
1623
+ "onUpdate:modelValue": k[1] || (k[1] = (A) => be(o) ? o.value = A : null),
1624
+ label: "Reference (optional)",
1625
+ rules: [
1626
+ (A) => A.length < 50 || "Reference must be less than 50 characters"
1627
+ ]
1628
+ }, null, 8, ["modelValue", "rules"])
1629
+ ]),
1630
+ _: 1
1631
+ }, 512)
1632
+ ]),
1633
+ _: 1
1634
+ }, 8, ["modelValue"]);
1635
+ };
1636
+ }
1637
+ }), Io = { class: "flex items-center gap-8" }, Uo = { class: "flex-shrink-0 -mr-8 -mt-8" }, Eo = ["title"], Do = ["src"], Bo = { class: "relative flex items-center gap-6 min-w-0" }, No = { class: "fm-typo-en-body-sm-600 tracking-[0.08em] truncate" }, Mo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Oo = {
1638
+ key: 0,
1639
+ class: "flex items-center gap-6"
1640
+ }, Lo = "linear-gradient(135deg,#FF9455,#B25300)", Ao = /* @__PURE__ */ Y({
1641
+ __name: "GiftCardProgramCard",
1642
+ props: {
1643
+ program: {},
1644
+ disabled: { type: Boolean }
1645
+ },
1646
+ emits: ["edit", "setLive", "deactivate"],
1647
+ setup(b, { emit: a }) {
1648
+ const d = b, g = a, c = D(() => yt(d.program)), x = D(() => {
1649
+ const { denominations: f, anyAmount: t } = c.value, r = [], p = [
1650
+ ...f,
1651
+ ...t ? [t.min, t.max] : []
1652
+ ];
1653
+ if (p.length) {
1654
+ const y = Math.min(...p), $ = Math.max(...p);
1655
+ r.push(y === $ ? `RM${y}` : `RM${y}–RM${$}`);
1656
+ }
1657
+ return t && r.push("Any amount"), r.join(" · ");
1658
+ }), o = D(() => {
1659
+ var f;
1660
+ return ((f = d.program.designs) == null ? void 0 : f[0]) ?? null;
1661
+ }), i = D(() => {
1662
+ const f = d.program.numberFormat, t = (f == null ? void 0 : f.prefix) ?? "GC", r = Math.max(4, Math.min(Number((f == null ? void 0 : f.length) ?? 12), 16));
1663
+ return `${t}${"•".repeat(r)}`;
1664
+ });
1665
+ return (f, t) => {
1666
+ const r = v("FmChip"), p = v("FmButton"), y = v("FmMenuItem"), $ = v("FmMenu"), u = v("FmIcon"), F = v("FmCard");
1667
+ return m(), R(F, {
1668
+ variant: "outlined",
1669
+ class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px]"
1670
+ }, {
1671
+ default: I(() => [
1672
+ n("div", Io, [
1673
+ l(r, {
1674
+ label: "Gift card",
1675
+ variant: "neutral",
1676
+ compact: ""
1677
+ }),
1678
+ l(r, {
1679
+ label: b.program.active ? "Live" : "Inactive",
1680
+ variant: b.program.active ? "success" : "neutral",
1681
+ compact: ""
1682
+ }, null, 8, ["label", "variant"]),
1683
+ t[4] || (t[4] = n("div", { class: "flex-1" }, null, -1)),
1684
+ n("div", Uo, [
1685
+ l($, { placement: "bottom-end" }, {
1686
+ "menu-button": I(() => [
1687
+ l(p, {
1688
+ icon: "more_vert",
1689
+ variant: "tertiary"
1690
+ })
1691
+ ]),
1692
+ default: I(() => [
1693
+ l(y, {
1694
+ onClick: t[0] || (t[0] = (k) => g("edit")),
1695
+ icon: "edit",
1696
+ label: "Edit"
1697
+ }),
1698
+ b.program.active ? (m(), R(y, {
1699
+ key: 1,
1700
+ onClick: t[2] || (t[2] = (k) => g("deactivate")),
1701
+ icon: "pause_circle",
1702
+ label: "Set inactive"
1703
+ })) : (m(), R(y, {
1704
+ key: 0,
1705
+ onClick: t[1] || (t[1] = (k) => g("setLive")),
1706
+ icon: "check_circle",
1707
+ label: "Set live"
1708
+ }))
1709
+ ]),
1710
+ _: 1
1711
+ })
1712
+ ])
1713
+ ]),
1714
+ n("div", {
1715
+ class: "fm-typo-en-body-lg-600 truncate",
1716
+ title: b.program.name
1717
+ }, w(b.program.name), 9, Eo),
1718
+ n("div", {
1719
+ class: "relative h-[120px] aspect-[1.586/1] mx-auto rounded-md overflow-hidden flex flex-col p-8 text-fm-color-typo-white",
1720
+ style: tt({ background: Lo })
1721
+ }, [
1722
+ e(o) ? (m(), T("img", {
1723
+ key: 0,
1724
+ src: e(o),
1725
+ alt: "",
1726
+ class: "absolute inset-0 w-full h-full object-cover"
1727
+ }, null, 8, Do)) : M("", !0),
1728
+ t[6] || (t[6] = n("div", { class: "relative flex items-start justify-between gap-4" }, [
1729
+ n("span", { class: "fm-typo-en-body-sm-600" }, "FeedMe"),
1730
+ n("span", { class: "fm-typo-en-body-sm-600 uppercase tracking-[0.1em] opacity-90 whitespace-nowrap" }, " Gift Card ")
1731
+ ], -1)),
1732
+ t[7] || (t[7] = n("div", { class: "flex-1" }, null, -1)),
1733
+ n("div", Bo, [
1734
+ t[5] || (t[5] = n("span", { class: "w-[20px] h-[14px] rounded-sm flex-none bg-gradient-to-br from-[#F4D479] to-[#C99B3B]" }, null, -1)),
1735
+ n("span", No, w(e(i)), 1)
1736
+ ])
1737
+ ], 4),
1738
+ n("div", Mo, w(e(x)), 1),
1739
+ t[9] || (t[9] = n("div", { class: "flex-1" }, null, -1)),
1740
+ b.program.active ? (m(), T("div", Oo, [
1741
+ l(u, {
1742
+ name: "check",
1743
+ size: "sm",
1744
+ class: "text-fm-color-system-success-400"
1745
+ }),
1746
+ t[8] || (t[8] = n("span", { class: "fm-typo-en-body-sm-600 text-fm-color-system-success-400" }, " Live to customers ", -1))
1747
+ ])) : (m(), R(p, {
1748
+ key: 1,
1749
+ label: "Set live",
1750
+ variant: "secondary",
1751
+ size: "md",
1752
+ disabled: b.disabled,
1753
+ onClick: t[3] || (t[3] = (k) => g("setLive"))
1754
+ }, null, 8, ["disabled"]))
1755
+ ]),
1756
+ _: 1
1757
+ });
1758
+ };
1759
+ }
1760
+ }), jo = { class: "rounded-lg border-1 border-fm-color-primary p-24 flex flex-col gap-16" }, qo = { class: "flex items-start gap-16" }, Go = { class: "w-40 h-40 rounded-md flex-none grid place-items-center bg-fm-color-primary" }, Ko = { class: "flex flex-col gap-4" }, Ho = { class: "fm-typo-en-body-lg-600" }, zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Wo = { class: "rounded-md border-1 border-fm-color-neutral-gray-200" }, Yo = { class: "flex-1 min-w-0" }, Jo = { class: "fm-typo-en-body-md-600" }, Xo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Zo = /* @__PURE__ */ Y({
1761
+ __name: "StoreOnboarding",
1762
+ props: {
1763
+ settingStatus: {},
1764
+ payoutStatus: {},
1765
+ requiresPayout: { type: Boolean, default: !0 }
1766
+ },
1767
+ emits: ["setupStoreSetting", "setupPayout"],
1768
+ setup(b, { emit: a }) {
1769
+ const { t: d } = ve(), g = b, c = a, x = D(() => [
1770
+ {
1771
+ key: "payout",
1772
+ title: d("connect.store.onboarding.payoutTitle"),
1773
+ description: d("connect.store.onboarding.payoutDescription"),
1774
+ status: g.payoutStatus,
1775
+ action: "setupPayout"
1776
+ },
1777
+ {
1778
+ key: "setting",
1779
+ title: d("connect.store.onboarding.settingTitle"),
1780
+ description: d("connect.store.onboarding.settingDescription"),
1781
+ status: g.settingStatus,
1782
+ action: "setupStoreSetting"
1783
+ }
1784
+ ].filter((i) => i.key !== "payout" || g.requiresPayout));
1785
+ return (o, i) => {
1786
+ const f = v("FmIcon"), t = v("FmChip"), r = v("FmButton");
1787
+ return m(), T("div", jo, [
1788
+ n("div", qo, [
1789
+ n("span", Go, [
1790
+ l(f, {
1791
+ name: "warning",
1792
+ class: "text-fm-color-typo-white"
1793
+ })
1794
+ ]),
1795
+ n("div", Ko, [
1796
+ n("div", Ho, w(e(d)("connect.store.onboarding.title")), 1),
1797
+ n("div", zo, w(e(d)("connect.store.onboarding.description")), 1)
1798
+ ])
1799
+ ]),
1800
+ n("div", Wo, [
1801
+ (m(!0), T(z, null, ce(e(x), (p, y) => (m(), T("div", {
1802
+ key: p.key,
1803
+ class: we(["flex items-center gap-16 p-16", y > 0 ? "border-t-1 border-fm-color-neutral-gray-200" : ""])
1804
+ }, [
1805
+ n("span", {
1806
+ class: we([
1807
+ "w-24 h-24 rounded-sm flex-none grid place-items-center fm-typo-en-body-sm-600",
1808
+ p.status === "COMPLETE" ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-primary-oats text-fm-color-primary"
1809
+ ])
1810
+ }, [
1811
+ p.status === "COMPLETE" ? (m(), R(f, {
1812
+ key: 0,
1813
+ name: "check",
1814
+ size: "sm"
1815
+ })) : (m(), T(z, { key: 1 }, [
1816
+ ee(w(y + 1), 1)
1817
+ ], 64))
1818
+ ], 2),
1819
+ n("div", Yo, [
1820
+ n("div", Jo, w(p.title), 1),
1821
+ n("div", Xo, w(p.description), 1)
1822
+ ]),
1823
+ l(t, {
1824
+ label: e(d)(
1825
+ p.status === "COMPLETE" ? "connect.store.onboarding.complete" : p.status === "PENDING" ? "connect.store.onboarding.pendingApproval" : "connect.store.onboarding.incomplete"
1826
+ ),
1827
+ variant: "plain",
1828
+ class: we(
1829
+ p.status === "COMPLETE" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100"
1830
+ ),
1831
+ compact: ""
1832
+ }, null, 8, ["label", "class"]),
1833
+ p.status !== "COMPLETE" ? (m(), R(r, {
1834
+ key: 0,
1835
+ class: "flex-none",
1836
+ label: e(d)(
1837
+ p.status === "PENDING" ? "connect.store.onboarding.editDetails" : "connect.store.onboarding.setupNow"
1838
+ ),
1839
+ variant: "primary",
1840
+ onClick: ($) => p.action === "setupPayout" ? c("setupPayout") : c("setupStoreSetting")
1841
+ }, null, 8, ["label", "onClick"])) : M("", !0)
1842
+ ], 2))), 128))
1843
+ ])
1844
+ ]);
1845
+ };
1846
+ }
1847
+ }), Qo = { class: "rounded-lg bg-fm-color-system-success-100 p-16 flex items-start gap-16" }, en = { class: "w-40 h-40 rounded-md flex-none grid place-items-center bg-fm-color-system-success-400" }, tn = { class: "flex-1 flex flex-col gap-4" }, on = { class: "fm-typo-en-body-lg-600" }, nn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, an = /* @__PURE__ */ Y({
1848
+ __name: "StoreAllSet",
1849
+ emits: ["dismiss"],
1850
+ setup(b, { emit: a }) {
1851
+ const { t: d } = ve(), g = a;
1852
+ return (c, x) => {
1853
+ const o = v("FmIcon"), i = v("FmButton");
1854
+ return m(), T("div", Qo, [
1855
+ n("span", en, [
1856
+ l(o, {
1857
+ name: "check_circle",
1858
+ class: "text-fm-color-typo-white"
1859
+ })
1860
+ ]),
1861
+ n("div", tn, [
1862
+ n("div", on, w(e(d)("connect.store.allSet.title")), 1),
1863
+ n("div", nn, w(e(d)("connect.store.allSet.description")), 1)
1864
+ ]),
1865
+ l(i, {
1866
+ class: "flex-none",
1867
+ icon: "close",
1868
+ size: "md",
1869
+ variant: "tertiary",
1870
+ onClick: x[0] || (x[0] = (f) => g("dismiss"))
1871
+ })
1872
+ ]);
1873
+ };
1874
+ }
1875
+ }), sn = { class: "space-y-16" }, ln = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rn = { class: "space-y-8" }, cn = { class: "h-8 rounded-full bg-fm-color-neutral-gray-200 overflow-hidden" }, dn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, un = { class: "space-y-8" }, mn = { class: "flex-1 min-w-0" }, pn = { class: "fm-typo-en-body-md-600" }, fn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, yn = { class: "flex items-center justify-end gap-8 pb-16" }, gn = /* @__PURE__ */ Y({
1876
+ __name: "StoreSetupDialog",
1877
+ props: {
1878
+ settingStatus: {},
1879
+ payoutStatus: {},
1880
+ requiresPayout: { type: Boolean, default: !0 }
1881
+ },
1882
+ setup(b) {
1883
+ const { t: a } = ve(), d = b, g = Ye(), { emitData: c, emitAction: x } = Je(), o = D(() => [
1884
+ {
1885
+ key: "payout",
1886
+ title: a("connect.store.onboarding.payoutTitle"),
1887
+ description: a("connect.store.onboarding.payoutDescription"),
1888
+ status: d.payoutStatus,
1889
+ action: "setupPayout",
1890
+ actionLabel: a(
1891
+ d.payoutStatus === "PENDING" ? "connect.store.onboarding.editDetails" : "connect.store.onboarding.payoutAction"
1892
+ )
1893
+ },
1894
+ {
1895
+ key: "setting",
1896
+ title: a("connect.store.onboarding.settingTitle"),
1897
+ description: a("connect.store.onboarding.settingDescription"),
1898
+ status: d.settingStatus,
1899
+ action: "setupStoreSetting",
1900
+ actionLabel: a("connect.store.onboarding.settingTitle")
1901
+ }
1902
+ ].filter((p) => p.key !== "payout" || d.requiresPayout)), i = D(
1903
+ () => o.value.filter((r) => r.status === "COMPLETE").length
1904
+ ), f = D(
1905
+ () => o.value.find((r) => r.status !== "COMPLETE")
1906
+ );
1907
+ function t() {
1908
+ f.value && (c(f.value.action), x("primary"), g.close());
1909
+ }
1910
+ return (r, p) => {
1911
+ const y = v("FmIcon"), $ = v("FmChip"), u = v("FmButton");
1912
+ return m(), T("div", sn, [
1913
+ n("div", ln, w(e(a)("connect.store.setupDialog.description")), 1),
1914
+ n("div", rn, [
1915
+ n("div", cn, [
1916
+ n("div", {
1917
+ class: "h-full rounded-full bg-fm-color-primary transition-all",
1918
+ style: tt({ width: `${e(i) / e(o).length * 100}%` })
1919
+ }, null, 4)
1920
+ ]),
1921
+ n("div", dn, w(e(a)("connect.store.setupDialog.progress", {
1922
+ done: e(i),
1923
+ total: e(o).length
1924
+ })), 1)
1925
+ ]),
1926
+ n("div", un, [
1927
+ (m(!0), T(z, null, ce(e(o), (F, k) => {
1928
+ var N;
1929
+ return m(), T("div", {
1930
+ key: F.key,
1931
+ class: we([
1932
+ "rounded-md border-1 p-16 flex items-center gap-16",
1933
+ F.key === ((N = e(f)) == null ? void 0 : N.key) ? "border-fm-color-primary" : "border-fm-color-neutral-gray-200"
1934
+ ])
1935
+ }, [
1936
+ n("span", {
1937
+ class: we([
1938
+ "w-24 h-24 rounded-sm flex-none grid place-items-center fm-typo-en-body-sm-600",
1939
+ F.status === "COMPLETE" ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-primary-oats text-fm-color-primary"
1940
+ ])
1941
+ }, [
1942
+ F.status === "COMPLETE" ? (m(), R(y, {
1943
+ key: 0,
1944
+ name: "check",
1945
+ size: "sm"
1946
+ })) : (m(), T(z, { key: 1 }, [
1947
+ ee(w(k + 1), 1)
1948
+ ], 64))
1949
+ ], 2),
1950
+ n("div", mn, [
1951
+ n("div", pn, w(F.title), 1),
1952
+ n("div", fn, w(F.description), 1)
1953
+ ]),
1954
+ l($, {
1955
+ label: e(a)(
1956
+ F.status === "COMPLETE" ? "connect.store.onboarding.complete" : F.status === "PENDING" ? "connect.store.onboarding.pendingApproval" : "connect.store.onboarding.incomplete"
1957
+ ),
1958
+ variant: "plain",
1959
+ class: we(
1960
+ F.status === "COMPLETE" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100"
1961
+ ),
1962
+ compact: ""
1963
+ }, null, 8, ["label", "class"])
1964
+ ], 2);
1965
+ }), 128))
1966
+ ]),
1967
+ n("div", yn, [
1968
+ l(u, {
1969
+ label: e(a)("connect.common.cancel"),
1970
+ variant: "tertiary",
1971
+ onClick: p[0] || (p[0] = (F) => e(g).close())
1972
+ }, null, 8, ["label"]),
1973
+ e(f) ? (m(), R(u, {
1974
+ key: 0,
1975
+ label: e(f).actionLabel,
1976
+ variant: "primary",
1977
+ onClick: t
1978
+ }, null, 8, ["label"])) : M("", !0)
1979
+ ])
1980
+ ]);
1981
+ };
1982
+ }
1983
+ });
1984
+ function bn(b, a, d = !0) {
1985
+ let g = "INCOMPLETE";
1986
+ (a == null ? void 0 : a.status) === "APPROVED" && a.enable ? g = "COMPLETE" : (a == null ? void 0 : a.status) === "PENDING" && (g = "PENDING");
1987
+ const c = d;
1988
+ return {
1989
+ settingStatus: b ? "COMPLETE" : "INCOMPLETE",
1990
+ payoutStatus: g,
1991
+ requiresPayout: c,
1992
+ complete: b && (!c || g === "COMPLETE")
1993
+ };
1994
+ }
1995
+ const vn = { class: "grid lg:grid-cols-2 gap-32 items-center" }, hn = { class: "flex flex-col gap-16" }, xn = { class: "flex flex-col gap-8" }, _n = { class: "fm-typo-en-title-md-800" }, Cn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary max-w-[460px]" }, Sn = { class: "flex flex-col gap-16" }, Fn = { class: "w-40 h-40 rounded-md flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary" }, wn = { class: "flex flex-col gap-2" }, $n = { class: "fm-typo-en-body-md-600" }, kn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pn = { class: "flex items-center gap-16 pt-8" }, Vn = { class: "relative rounded-lg overflow-hidden aspect-[4/3] flex items-end justify-center bg-gradient-to-br from-[#FFF3E6] to-[#FDE6D0]" }, Tn = { class: "absolute inset-0 grid place-items-center" }, Rn = { class: "relative w-[68%] max-w-[320px]" }, In = { class: "relative w-full aspect-[1.586/1] rounded-lg p-16 flex flex-col justify-between text-fm-color-typo-white bg-gradient-to-br from-[#C98A4B] to-[#A96A2E] rotate-[-3deg]" }, Un = { class: "flex flex-col" }, En = { class: "fm-typo-en-body-sm-400 uppercase tracking-[0.12em] opacity-90" }, Dn = /* @__PURE__ */ Y({
1996
+ __name: "GiftCardUpsell",
1997
+ props: {
1998
+ premium: { type: Boolean }
1999
+ },
2000
+ emits: ["upgrade", "comparePlans", "create"],
2001
+ setup(b, { emit: a }) {
2002
+ const { t: d } = ve(), g = a, c = [
2003
+ {
2004
+ icon: "send",
2005
+ title: "connect.store.giftCard.benefitGiftTitle",
2006
+ description: "connect.store.giftCard.benefitGiftDescription"
2007
+ },
2008
+ {
2009
+ icon: "bar_chart",
2010
+ title: "connect.store.giftCard.benefitSalesTitle",
2011
+ description: "connect.store.giftCard.benefitSalesDescription"
2012
+ },
2013
+ {
2014
+ icon: "favorite",
2015
+ title: "connect.store.giftCard.benefitLoyaltyTitle",
2016
+ description: "connect.store.giftCard.benefitLoyaltyDescription"
2017
+ }
2018
+ ];
2019
+ return (x, o) => {
2020
+ const i = v("FmIcon"), f = v("FmButton"), t = v("FmCard");
2021
+ return m(), R(t, {
2022
+ variant: "outlined",
2023
+ class: "p-24"
2024
+ }, {
2025
+ default: I(() => [
2026
+ n("div", vn, [
2027
+ n("div", hn, [
2028
+ n("span", {
2029
+ class: we([
2030
+ "self-start inline-flex items-center gap-4 px-8 py-4 rounded-sm fm-typo-en-body-sm-600 tracking-[0.05em]",
2031
+ b.premium ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-secondary-blueberry text-fm-color-typo-white uppercase"
2032
+ ])
2033
+ }, [
2034
+ l(i, {
2035
+ name: b.premium ? "check" : "stars",
2036
+ size: "sm"
2037
+ }, null, 8, ["name"]),
2038
+ ee(" " + w(b.premium ? e(d)("connect.store.giftCard.includedInPlan") : e(d)("connect.store.giftCard.premium")), 1)
2039
+ ], 2),
2040
+ n("div", xn, [
2041
+ n("div", _n, w(e(d)("connect.store.giftCard.upsellTitle")), 1),
2042
+ n("div", Cn, w(e(d)("connect.store.giftCard.upsellDescription")), 1)
2043
+ ]),
2044
+ n("div", Sn, [
2045
+ (m(), T(z, null, ce(c, (r) => n("div", {
2046
+ key: r.icon,
2047
+ class: "flex items-start gap-12"
2048
+ }, [
2049
+ n("span", Fn, [
2050
+ l(i, {
2051
+ name: r.icon
2052
+ }, null, 8, ["name"])
2053
+ ]),
2054
+ n("div", wn, [
2055
+ n("div", $n, w(e(d)(r.title)), 1),
2056
+ n("div", kn, w(e(d)(r.description)), 1)
2057
+ ])
2058
+ ])), 64))
2059
+ ]),
2060
+ n("div", Pn, [
2061
+ b.premium ? (m(), R(f, {
2062
+ key: 0,
2063
+ label: e(d)("connect.store.giftCard.createGiftCard"),
2064
+ variant: "primary",
2065
+ icon: "add",
2066
+ onClick: o[0] || (o[0] = (r) => g("create"))
2067
+ }, null, 8, ["label"])) : (m(), T(z, { key: 1 }, [
2068
+ l(f, {
2069
+ label: e(d)("connect.store.giftCard.upgrade"),
2070
+ variant: "primary",
2071
+ onClick: o[1] || (o[1] = (r) => g("upgrade"))
2072
+ }, null, 8, ["label"]),
2073
+ n("button", {
2074
+ type: "button",
2075
+ class: "inline-flex items-center gap-4 fm-typo-en-body-md-600 text-fm-color-typo-primary",
2076
+ onClick: o[2] || (o[2] = (r) => g("comparePlans"))
2077
+ }, [
2078
+ ee(w(e(d)("connect.store.giftCard.comparePlans")) + " ", 1),
2079
+ l(i, {
2080
+ name: "chevron_right",
2081
+ size: "sm"
2082
+ })
2083
+ ])
2084
+ ], 64))
2085
+ ])
2086
+ ]),
2087
+ n("div", Vn, [
2088
+ n("div", Tn, [
2089
+ n("div", Rn, [
2090
+ o[6] || (o[6] = n("div", { class: "absolute -left-[14%] top-[6%] w-full aspect-[1.586/1] rounded-lg bg-gradient-to-br from-[#3A3A3C] to-[#1C1C1E] rotate-[-8deg]" }, null, -1)),
2091
+ n("div", In, [
2092
+ o[5] || (o[5] = n("span", { class: "fm-typo-en-body-md-600" }, "FeedMe", -1)),
2093
+ n("div", Un, [
2094
+ n("span", En, w(e(d)("connect.store.giftCard.giftCardLabel")), 1),
2095
+ o[4] || (o[4] = n("span", { class: "fm-typo-en-title-md-800" }, "RM100", -1))
2096
+ ])
2097
+ ])
2098
+ ])
2099
+ ]),
2100
+ b.premium ? M("", !0) : (m(), T("button", {
2101
+ key: 0,
2102
+ type: "button",
2103
+ class: "relative mb-24 inline-flex items-center gap-8 px-16 py-8 rounded-full bg-fm-color-neutral-black text-fm-color-typo-white fm-typo-en-body-sm-600",
2104
+ onClick: o[3] || (o[3] = (r) => g("upgrade"))
2105
+ }, [
2106
+ l(i, {
2107
+ name: "lock",
2108
+ size: "sm"
2109
+ }),
2110
+ ee(" " + w(e(d)("connect.store.giftCard.unlockNow")), 1)
2111
+ ]))
2112
+ ])
2113
+ ])
2114
+ ]),
2115
+ _: 1
2116
+ });
2117
+ };
2118
+ }
2119
+ });
2120
+ var et = { 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/" };
2121
+ const Bn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary max-w-[640px]" }, Nn = { class: "px-24 flex flex-col gap-y-16" }, Mn = { class: "space-y-8 py-12" }, On = { class: "flex gap-8 items-center" }, Ln = { class: "fm-typo-en-body-lg-600" }, An = {
2122
+ key: 1,
2123
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
2124
+ }, jn = {
2125
+ key: 1,
2126
+ class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24"
2127
+ }, qn = { class: "flex gap-8 items-center" }, Gn = { class: "fm-typo-en-body-lg-600" }, Kn = { class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24" }, Hn = { class: "flex flex-col gap-16 text-center" }, zn = { class: "fm-typo-en-title-sm-800" }, Wn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ta = /* @__PURE__ */ Y({
2128
+ __name: "Store",
2129
+ setup(b) {
2130
+ const { t: a } = ve(), d = {
2131
+ label: a("connect.store.actions.setting"),
2132
+ value: "setting",
2133
+ isPrimary: !1
2134
+ }, g = {
2135
+ label: a("connect.store.actions.manageReward"),
2136
+ value: "create_reward"
2137
+ }, c = {
2138
+ label: a("connect.store.actions.addCategory"),
2139
+ value: "create_category",
2140
+ isPrimary: !0,
2141
+ prependIcon: "add"
2142
+ }, x = O(), o = Tt(), i = Xe(), { global: f, minor: t } = ot, r = Ye(), p = D(() => i.sortedStoreCategories), y = D(() => i.sortedStoreCategories.map((h) => h.name)), $ = O(), u = O(), F = Vt(), k = O([]), N = D(() => F.isPremium), te = D(() => {
2143
+ var h;
2144
+ return !!((h = i.storeOption) != null && h.company);
2145
+ }), oe = O(!1), H = D(
2146
+ () => bn(
2147
+ te.value,
2148
+ i.payoutAccount,
2149
+ !oe.value || N.value
2150
+ )
2151
+ ), le = D(() => !H.value.complete), de = O(!1);
2152
+ function V() {
2153
+ return `connect.store.allSetDismissed.${He.getBusinessId()}`;
2154
+ }
2155
+ function he() {
2156
+ try {
2157
+ return localStorage.getItem(V()) === "1";
2158
+ } catch {
2159
+ return !1;
2160
+ }
2161
+ }
2162
+ function fe() {
2163
+ de.value = !0;
2164
+ try {
2165
+ localStorage.setItem(V(), "1");
2166
+ } catch {
2167
+ }
2168
+ }
2169
+ const Te = {
2170
+ name: Ae["$connect-TRANSACTION"],
2171
+ query: { tab: "store" }
2172
+ };
2173
+ function A() {
2174
+ window.open(
2175
+ `${et.licensePortalUrl}business/${He.businessId}/settings`,
2176
+ "_blank"
2177
+ );
2178
+ }
2179
+ function Ce() {
2180
+ window.open("https://feedme.ai/pricing", "_blank", "noopener");
2181
+ }
2182
+ async function S() {
2183
+ if (N.value)
2184
+ try {
2185
+ k.value = await Ke.readPrograms();
2186
+ } catch {
2187
+ k.value = [];
2188
+ }
2189
+ }
2190
+ function s() {
2191
+ o.push({ name: Ae["$connect-STORE_GIFT_CARD_SETUP"] });
2192
+ }
2193
+ function P(h) {
2194
+ o.push({
2195
+ name: Ae["$connect-STORE_GIFT_CARD_SETUP"],
2196
+ params: { id: String(h._id) }
2197
+ });
2198
+ }
2199
+ async function B(h) {
2200
+ await Ee.confirm(
2201
+ `Set "${h.name}" live? Only one gift card can be live at a time, so any other will be set inactive.`,
2202
+ "Set live",
2203
+ "Set live",
2204
+ "Cancel"
2205
+ ) && await t(
2206
+ async () => {
2207
+ await Ke.activateProgram(String(h._id)), await S();
2208
+ },
2209
+ { message: "Setting live", successMessage: "Gift card is live" }
2210
+ );
2211
+ }
2212
+ async function W(h) {
2213
+ await t(
2214
+ async () => {
2215
+ await Ke.deactivateProgram(String(h._id)), await S();
2216
+ },
2217
+ { message: "Updating gift card", successMessage: "Gift card set inactive" }
2218
+ );
2219
+ }
2220
+ function J() {
2221
+ r.open({
2222
+ title: a("connect.store.setupDialog.title"),
2223
+ contentComponent: gn,
2224
+ contentComponentProps: {
2225
+ settingStatus: H.value.settingStatus,
2226
+ payoutStatus: H.value.payoutStatus,
2227
+ requiresPayout: H.value.requiresPayout
2228
+ }
2229
+ }).onPrimary((h) => {
2230
+ L(h === "setupPayout" ? "payout" : "setting");
2231
+ });
2232
+ }
2233
+ async function L(h) {
2234
+ var C;
2235
+ h === "setting" ? (C = $.value) == null || C.showSheet(!0, i.storeOption) : h === "create_category" ? ue(-1) : h === "create_reward" ? await o.push({ name: Ae["$connect-STORE_REWARDS"] }) : h == "payout" && window.open(et.paymentPortalUrl, "_blank");
2236
+ }
2237
+ function $e(h, C) {
2238
+ var Q;
2239
+ const U = !!((Q = C.company) != null && Q.sstRegNo), G = C.inclusiveTaxes ?? [], K = Z.taxSystem.map((E) => E.code), _ = U ? G.flatMap((E) => {
2240
+ console.log(E, "inclusive tax");
2241
+ const j = Z.systemDefaultCode(E.systemCode);
2242
+ return j ? [{ systemCode: E.systemCode, taxCode: j.taxCode }] : [];
2243
+ }) : [];
2244
+ return console.log([
2245
+ ["hasSstRegNo", U],
2246
+ ["defaultTaxCodes", _],
2247
+ ["inclusiveTaxes", G],
2248
+ ["taxSystemCodes", K]
2249
+ ]), h.map((E) => ({
2250
+ ...E,
2251
+ bundles: E.bundles.map((j) => {
2252
+ const { pf_vouchers: ne, ...X } = j;
2253
+ if (!U)
2254
+ return {
2255
+ ...X,
2256
+ taxes: [],
2257
+ taxTotals: [],
2258
+ priceWithTaxes: { ...X.price }
2259
+ };
2260
+ const me = _, Fe = at(
2261
+ Z.fullTax,
2262
+ me,
2263
+ X.price,
2264
+ Number(X.credit.normal),
2265
+ G,
2266
+ K
2267
+ );
2268
+ return {
2269
+ ...X,
2270
+ taxes: me,
2271
+ taxTotals: Fe,
2272
+ priceWithTaxes: st(
2273
+ Fe,
2274
+ X.price,
2275
+ G
2276
+ )
2277
+ };
2278
+ })
2279
+ }));
2280
+ }
2281
+ async function xe(h, C, U) {
2282
+ const G = !U && !!C, K = !!U && !C;
2283
+ let _;
2284
+ if (G) {
2285
+ const E = Z.taxSystem[0] ? Z.systemDefaultCode(Z.taxSystem[0].code) : void 0, j = E ? `${E.name} (${E.taxCode})` : a("connect.store.taxPropagation.defaultTax");
2286
+ _ = a("connect.store.taxPropagation.addConfirm", {
2287
+ taxCode: j
2288
+ });
2289
+ } else K ? _ = a("connect.store.taxPropagation.removeConfirm") : _ = a("connect.store.taxPropagation.updateConfirm");
2290
+ await Ee.confirm(
2291
+ _,
2292
+ a("connect.store.taxPropagation.title"),
2293
+ a("connect.store.taxPropagation.confirm"),
2294
+ a("connect.common.cancel")
2295
+ ) && await t(
2296
+ async () => {
2297
+ const E = qe(i.sortedStoreCategories), j = $e(E, h);
2298
+ await De.updateStoreBundle({ categories: j }), await i.readMemberStore(), await i.readMembership(), await i.readRewards();
2299
+ },
2300
+ {
2301
+ message: a("connect.store.taxPropagation.updating"),
2302
+ successMessage: a("connect.store.taxPropagation.success")
2303
+ }
2304
+ );
2305
+ }
2306
+ async function ke(h) {
2307
+ var j, ne, X, me;
2308
+ const C = ((ne = (j = i.storeOption) == null ? void 0 : j.company) == null ? void 0 : ne.sstRegNo) ?? "", U = pe.cloneDeep(
2309
+ ((X = i.storeOption) == null ? void 0 : X.inclusiveTaxes) ?? []
2310
+ ), G = ((me = h.company) == null ? void 0 : me.sstRegNo) ?? "";
2311
+ await t(
2312
+ async () => {
2313
+ var Fe;
2314
+ await De.updateStore(h), await i.readMemberStore(), (Fe = $.value) == null || Fe.showSheet(!1);
2315
+ },
2316
+ {
2317
+ message: a("connect.store.setting.update.message"),
2318
+ successMessage: a("connect.store.setting.update.success")
2319
+ }
2320
+ );
2321
+ const K = C !== G, _ = !pe.isEqual(
2322
+ U,
2323
+ h.inclusiveTaxes ?? []
2324
+ );
2325
+ !(K || _) || i.sortedStoreCategories.flatMap(
2326
+ (Fe) => Fe.bundles
2327
+ ).length === 0 || await xe(h, G, C);
2328
+ }
2329
+ async function ue(h = -1) {
2330
+ var C;
2331
+ if (!te.value) {
2332
+ J();
2333
+ return;
2334
+ }
2335
+ r.open({
2336
+ title: h == -1 ? a("connect.store.category.add") : a("connect.store.category.edit"),
2337
+ contentComponent: Kt,
2338
+ contentComponentProps: {
2339
+ initialValue: ((C = p.value[h]) == null ? void 0 : C.name) ?? "",
2340
+ action: h == -1 ? "add" : "edit"
2341
+ }
2342
+ }).onPrimary(async (U) => {
2343
+ U === null && !await Ee.remove(
2344
+ a("connect.store.category.remove.confirm"),
2345
+ a("connect.store.category.remove.title")
2346
+ ) || await t(
2347
+ async () => {
2348
+ const G = h == -1 ? [...p.value, { name: U, bundles: [] }] : [...p.value].map((K, _) => _ == h ? { ...K, name: U } : K).filter((K) => K.name !== null);
2349
+ await De.updateStoreBundle({
2350
+ categories: G
2351
+ }), await i.readMemberStore();
2352
+ },
2353
+ {
2354
+ message: U === null ? a("connect.store.category.update.deleting") : h == -1 ? a("connect.store.category.update.creating") : a("connect.store.category.update.updating"),
2355
+ successMessage: U === null ? a("connect.store.category.update.success.deleted") : h == -1 ? a("connect.store.category.update.success.created") : a("connect.store.category.update.success.updated")
2356
+ }
2357
+ );
2358
+ });
2359
+ }
2360
+ function Pe() {
2361
+ const h = qe(p.value);
2362
+ for (const C of h)
2363
+ for (const U of C.bundles)
2364
+ "pf_vouchers" in U && delete U.pf_vouchers;
2365
+ return h;
2366
+ }
2367
+ async function Se(h) {
2368
+ var U;
2369
+ const C = (U = u.value) == null ? void 0 : U.bundleImage;
2370
+ C === null && h.image ? (await Ge.delete(h.image), h.image = null) : C && (h.image = await Ge.update(
2371
+ Ge.bundleImagePath(void 0, C),
2372
+ C
2373
+ ));
2374
+ }
2375
+ async function Re(h, C, U, G) {
2376
+ var j, ne, X;
2377
+ C ?? (C = (j = u.value) == null ? void 0 : j.target.category), U ?? (U = (ne = u.value) == null ? void 0 : ne.target.index), G ?? (G = (X = u.value) == null ? void 0 : X.target.originalCategoryIndex);
2378
+ const K = Pe();
2379
+ C != G && G != null && (K[G].bundles.splice(U, 1), U = K[C].bundles.length);
2380
+ const _ = K[C];
2381
+ if (!_) {
2382
+ vt.error("Unexpected error", 2e3);
2383
+ return;
2384
+ }
2385
+ if (h == null) {
2386
+ if (await Ee.remove(
2387
+ a("connect.store.bundle.delete.confirm"),
2388
+ a("connect.store.bundle.delete.title")
2389
+ ) == !1)
2390
+ return;
2391
+ _.bundles.splice(U, 1);
2392
+ } else
2393
+ U == -1 ? _.bundles.push(h) : _.bundles[U] = h;
2394
+ let Q = "Updating", E = "updated";
2395
+ h === null ? (Q = "Deleting", E = "deleted") : U === -1 && (Q = "Creating", E = "created"), await t(
2396
+ async () => {
2397
+ var me;
2398
+ h != null && await Se(h), await De.updateStoreBundle({
2399
+ categories: K
2400
+ }), await i.readMemberStore(), await i.readMembership(), await i.readRewards(), (me = u.value) == null || me.showSheet(!1);
2401
+ },
2402
+ {
2403
+ message: `${Q} bundle`,
2404
+ successMessage: `Bundle ${E} successfully`
2405
+ }
2406
+ );
2407
+ }
2408
+ function Ve(h) {
2409
+ var C;
2410
+ if (!te.value) {
2411
+ J();
2412
+ return;
2413
+ }
2414
+ (C = u.value) == null || C.showSheet(!0, {
2415
+ ...h,
2416
+ bundle: h.bundle ? qe(h.bundle) : void 0
2417
+ });
2418
+ }
2419
+ const Me = D(() => [
2420
+ d,
2421
+ g,
2422
+ c
2423
+ ]);
2424
+ function Oe(h) {
2425
+ var C;
2426
+ (C = x.value) == null || C.showSheet({
2427
+ bundle: h
2428
+ });
2429
+ }
2430
+ return Ne(async () => {
2431
+ await f(async () => {
2432
+ var h, C;
2433
+ if (await i.readMemberStore(), await i.readMembership(), await i.readRewards(), await i.readPayoutAccount(), await F.readPremium(), oe.value = !0, de.value = he(), await S(), (h = o.currentRoute.value.query) != null && h.action) {
2434
+ switch ((C = o.currentRoute.value.query) == null ? void 0 : C.action) {
2435
+ case "update_setting":
2436
+ L("setting");
2437
+ break;
2438
+ case "create_category":
2439
+ ue(-1);
2440
+ break;
2441
+ case "create_feedvibe_bundle":
2442
+ r.open({
2443
+ title: "Select category",
2444
+ contentComponent: Wt
2445
+ }).onPrimary((U) => {
2446
+ r.close(), Ve({
2447
+ categories: y.value,
2448
+ category: U,
2449
+ index: -1,
2450
+ bundle: {
2451
+ ...pe.cloneDeep(ze),
2452
+ isFeedvibe: !0,
2453
+ price: q.Dinero.fromNumber({
2454
+ number: 10,
2455
+ precision: 2
2456
+ }).toObject()
2457
+ }
2458
+ });
2459
+ }).onTertiary(() => r.close());
2460
+ break;
2461
+ }
2462
+ o.replace({ query: {} });
2463
+ }
2464
+ });
2465
+ }), (h, C) => {
2466
+ const U = v("RouterLink"), G = v("FmPageHead"), K = v("FmPill"), _ = v("FmButton"), Q = v("FmCard");
2467
+ return m(), T(z, null, [
2468
+ l(G, {
2469
+ title: e(a)("connect.store.title"),
2470
+ actions: e(Me),
2471
+ "onClick:action": L
2472
+ }, {
2473
+ description: I(() => [
2474
+ n("span", Bn, w(e(a)("connect.store.description")), 1),
2475
+ l(U, {
2476
+ to: Te,
2477
+ class: "ml-8 fm-typo-en-link-md-600 text-fm-color-primary"
2478
+ }, {
2479
+ default: I(() => [
2480
+ ee(w(e(a)("connect.store.viewTransactions")), 1)
2481
+ ]),
2482
+ _: 1
2483
+ })
2484
+ ]),
2485
+ _: 1
2486
+ }, 8, ["title", "actions"]),
2487
+ n("div", Nn, [
2488
+ e(le) ? (m(), R(Zo, {
2489
+ key: 0,
2490
+ class: "mt-12",
2491
+ "setting-status": e(H).settingStatus,
2492
+ "payout-status": e(H).payoutStatus,
2493
+ "requires-payout": e(H).requiresPayout,
2494
+ onSetupStoreSetting: C[0] || (C[0] = (E) => L("setting")),
2495
+ onSetupPayout: C[1] || (C[1] = (E) => L("payout"))
2496
+ }, null, 8, ["setting-status", "payout-status", "requires-payout"])) : e(de) ? M("", !0) : (m(), R(an, {
2497
+ key: 1,
2498
+ class: "mt-12",
2499
+ onDismiss: fe
2500
+ })),
2501
+ n("div", Mn, [
2502
+ n("div", On, [
2503
+ n("div", Ln, w(e(a)("connect.store.giftCard.title")), 1),
2504
+ l(K, {
2505
+ variant: "premium",
2506
+ label: e(a)("connect.store.giftCard.new")
2507
+ }, null, 8, ["label"]),
2508
+ e(N) && e(k).length ? (m(), R(_, {
2509
+ key: 0,
2510
+ icon: "edit",
2511
+ size: "md",
2512
+ variant: "tertiary",
2513
+ onClick: C[2] || (C[2] = (E) => P(e(k)[0]))
2514
+ })) : M("", !0),
2515
+ C[4] || (C[4] = n("div", { class: "flex-1" }, null, -1)),
2516
+ e(N) && e(k).length ? (m(), T("div", An, w(e(a)("connect.store.giftCard.oneLiveHint")), 1)) : M("", !0)
2517
+ ]),
2518
+ !e(N) || !e(k).length ? (m(), R(Dn, {
2519
+ key: 0,
2520
+ premium: e(N),
2521
+ onUpgrade: A,
2522
+ onComparePlans: Ce,
2523
+ onCreate: s
2524
+ }, null, 8, ["premium"])) : (m(), T("div", jn, [
2525
+ (m(!0), T(z, null, ce(e(k), (E) => (m(), R(Ao, {
2526
+ key: String(E._id),
2527
+ program: E,
2528
+ onEdit: (j) => P(E),
2529
+ onSetLive: (j) => B(E),
2530
+ onDeactivate: (j) => W(E)
2531
+ }, null, 8, ["program", "onEdit", "onSetLive", "onDeactivate"]))), 128)),
2532
+ l(Q, {
2533
+ variant: "outlined",
2534
+ class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
2535
+ }, {
2536
+ default: I(() => [
2537
+ l(_, {
2538
+ label: e(a)("connect.store.giftCard.addGiftCard"),
2539
+ icon: "add",
2540
+ variant: "secondary",
2541
+ onClick: s
2542
+ }, null, 8, ["label"])
2543
+ ]),
2544
+ _: 1
2545
+ })
2546
+ ]))
2547
+ ]),
2548
+ e(p) && e(p).length > 0 ? (m(), T(z, { key: 2 }, [
2549
+ (m(!0), T(z, null, ce(e(p), (E, j) => (m(), T("div", {
2550
+ key: E.name,
2551
+ class: "space-y-8 py-12"
2552
+ }, [
2553
+ n("div", qn, [
2554
+ n("div", Gn, w(E.name), 1),
2555
+ l(Ze, { json: E }, null, 8, ["json"]),
2556
+ l(_, {
2557
+ icon: "edit",
2558
+ size: "md",
2559
+ variant: "tertiary",
2560
+ onClick: (ne) => ue(j)
2561
+ }, null, 8, ["onClick"])
2562
+ ]),
2563
+ n("div", Kn, [
2564
+ (m(!0), T(z, null, ce(E.bundles, (ne, X) => (m(), R(Lt, {
2565
+ bundle: ne,
2566
+ key: ne._id,
2567
+ onEdit: (me) => Ve({
2568
+ bundle: ne,
2569
+ category: j,
2570
+ index: X,
2571
+ categories: e(y)
2572
+ }),
2573
+ onDelete: (me) => Re(null, j, X),
2574
+ onSend: Oe
2575
+ }, null, 8, ["bundle", "onEdit", "onDelete"]))), 128)),
2576
+ l(At, {
2577
+ onCreate: (ne) => Ve({
2578
+ category: j,
2579
+ index: -1,
2580
+ categories: e(y)
2581
+ })
2582
+ }, null, 8, ["onCreate"])
2583
+ ])
2584
+ ]))), 128)),
2585
+ l(Po, {
2586
+ ref_key: "bundleSheetRef",
2587
+ ref: u,
2588
+ onUpdate: Re
2589
+ }, null, 512)
2590
+ ], 64)) : (m(), R(Q, {
2591
+ key: 3,
2592
+ variant: "outlined",
2593
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
2594
+ }, {
2595
+ default: I(() => [
2596
+ C[5] || (C[5] = n("img", {
2597
+ src: ct,
2598
+ class: "aspect-square w-[150px]"
2599
+ }, null, -1)),
2600
+ n("div", Hn, [
2601
+ n("div", zn, w(e(a)("connect.store.bundle.title")), 1),
2602
+ n("div", Wn, w(e(a)("connect.store.bundle.description")), 1)
2603
+ ]),
2604
+ l(_, {
2605
+ variant: "primary",
2606
+ label: e(a)("connect.store.actions.addCategory"),
2607
+ icon: "add",
2608
+ onClick: C[3] || (C[3] = (E) => ue(-1))
2609
+ }, null, 8, ["label"])
2610
+ ]),
2611
+ _: 1
2612
+ })),
2613
+ l(po, {
2614
+ ref_key: "settingSheetRef",
2615
+ ref: $,
2616
+ onUpdate: ke
2617
+ }, null, 512),
2618
+ l(Ro, {
2619
+ ref_key: "sendBundleSheetRef",
2620
+ ref: x
2621
+ }, null, 512)
2622
+ ])
2623
+ ], 64);
2624
+ };
2625
+ }
2626
+ });
2627
+ export {
2628
+ Ta as default
2629
+ };