@feedmepos/mf-connect 0.1.98-beta.8 → 0.1.98-beta.80

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 (167) hide show
  1. package/dist/{App-DsB2o1oB.js → App-DievprEi.js} +853 -683
  2. package/dist/{AuditLogs-BcfgiYnJ.js → AuditLogs-DrdqOhZL.js} +16 -13
  3. package/dist/{Bin-DMr7K8Kj.js → Bin-Ci2k3z77.js} +8 -8
  4. package/dist/Broadcast-CpDMAG1o.js +306 -0
  5. package/dist/CampaignAnalytic-uRyGaLaN.js +1830 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CwGoEBsW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DtGe2Og1.js} +8 -5
  7. package/dist/Card-tb98Kyr-.js +1086 -0
  8. package/dist/{Collections-B0uGC2FE.js → Collections-P1S5WjnJ.js} +14 -13
  9. package/dist/Credit-DwK7JYf-.js +286 -0
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-Cyk0iIsd.js +53 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-8r29jKh9.js +4432 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DJLxGk7W.js → EffectSheet.vue_vue_type_style_index_0_lang-BML_-v8I.js} +36 -36
  13. package/dist/Experience-BejtRlOj.js +288 -0
  14. package/dist/{FileSaver.min-BlA0oZEC.js → FileSaver.min-C-hmBaHm.js} +1 -1
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  16. package/dist/Game-n8qL896g.js +356 -0
  17. package/dist/GiftCardSetup-Bgsfcu7N.js +736 -0
  18. package/dist/GoalPickerPanel.vue_vue_type_script_setup_true_lang-CzL68PPP.js +424 -0
  19. package/dist/Goals-BB8LJlq3.js +247 -0
  20. package/dist/{Grab-DmmwrGzk.js → Grab-COq3Ujst.js} +33 -32
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DNtLW0yQ.js → ImageInput.vue_vue_type_script_setup_true_lang-BmLclEyi.js} +1 -1
  22. package/dist/{Index-m7l4insz.js → Index-BdkIinaE.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-B9sJ-M20.js → LocationPicker.vue_vue_type_script_setup_true_lang-DsWv3DVb.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Dsg2sWjF.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DvOzGF8c.js} +1 -1
  25. package/dist/LoyaltyDashboard-D4Jtpw0n.js +2911 -0
  26. package/dist/MainLayout-Ca-Xm3eZ.js +143 -0
  27. package/dist/{Marketing-C9pSIdBU.js → Marketing-Cpe4s7NZ.js} +7 -6
  28. package/dist/{MarketingMaterialEdit-BEF2T9LR.js → MarketingMaterialEdit-nTeS9VVx.js} +15 -14
  29. package/dist/Member-DgGZ4Cdg.js +654 -0
  30. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-_O3B-FIA.js +1281 -0
  31. package/dist/MemberImportHistory-rdlbDVWU.js +187 -0
  32. package/dist/MemberList-BC4aRJTt.js +334 -0
  33. package/dist/{MemberTransactions-CAut1TQb.js → MemberTransactions-BFfdTttp.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-1AuHixPC.js → MessageInput.vue_vue_type_script_setup_true_lang-DXajAQy9.js} +5928 -5644
  35. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-8xVDzdO3.js +40 -0
  36. package/dist/Mission-BWCNKTjU.js +363 -0
  37. package/dist/Overview--Q7vzhNK.js +1316 -0
  38. package/dist/{Overview-DOJj4XvO.js → Overview-i02Wnyjn.js} +23 -20
  39. package/dist/Point-CiWxqny5.js +297 -0
  40. package/dist/Promotion-B0G9qfBm.js +426 -0
  41. package/dist/{Queue-55G2gtP5.js → Queue-YfwgYmzH.js} +16 -13
  42. package/dist/{Record-DNPI02c6.js → Record-CCuwrPKW.js} +9 -9
  43. package/dist/Review-ymsfdh7Q.js +45 -0
  44. package/dist/ReviewFacebookCallback-DyDExWvP.js +238 -0
  45. package/dist/ReviewGoogleCallback-DNyg3n2S.js +213 -0
  46. package/dist/{Reward-CnP8R2pS.js → Reward-BKIb0ezH.js} +28 -28
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BN71h9IK.js → RewardGroup.vue_vue_type_script_setup_true_lang-DPaaNgpr.js} +26 -23
  48. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CtB9Ls5-.js → RuleGroup.vue_vue_type_script_setup_true_lang-BLFLybFn.js} +198 -186
  49. package/dist/{Segment-CxiQnnyj.js → Segment-D5_pp7fh.js} +278 -276
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B1vj5f7T.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BLLjIA-D.js} +45 -42
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-cWx0G3nM.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BRIcZwnU.js} +4 -4
  52. package/dist/Setting-CD78gIMU.js +574 -0
  53. package/dist/{SettingAdvertisements-Vt7w1WN3.js → SettingAdvertisements-C2AIT4s4.js} +12 -12
  54. package/dist/Settings-DI_tryQV.js +230 -0
  55. package/dist/Store-BV2JTRNZ.js +2615 -0
  56. package/dist/{StoreRewards-DILeipMG.js → StoreRewards-Bk55YXyO.js} +15 -15
  57. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BZZ1fqwg.js +1331 -0
  58. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C7lVeybl.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BrEzWVrH.js} +2 -2
  59. package/dist/{Tier-BAZ1xuKL.js → Tier-CO2K30Ew.js} +2576 -757
  60. package/dist/{Title-CcNAt47f.js → Title-qProQh3T.js} +41 -37
  61. package/dist/Transaction-qL5L-fE_.js +45 -0
  62. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-hUjQVZ_U.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Co1BPScS.js} +26 -26
  63. package/dist/Voucher-VFD1LY9Y.js +837 -0
  64. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CTQDxc5l.js → VoucherEditor.vue_vue_type_script_setup_true_lang-9QyTl7iq.js} +118 -124
  65. package/dist/WhatsappAccount-CxSGqm7H.js +325 -0
  66. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D8L6izf0.js +96 -0
  67. package/dist/WhatsappBot-C4Oz7Xwv.js +441 -0
  68. package/dist/WhatsappBotSettings-CKqaWzwE.js +136 -0
  69. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DuRKA4cj.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bcsi94dw.js} +2 -2
  70. package/dist/{app-Z-UKRG5V.js → app-BEYzXWZO.js} +50954 -42517
  71. package/dist/app.js +1 -1
  72. package/dist/base.export-S_82Elmg.js +75 -0
  73. package/dist/browser-BSAOEeIM.js +1478 -0
  74. package/dist/{business-C7EF6cKC.js → business-DH7djUl8.js} +5 -5
  75. package/dist/campaign-DlHDgoFX.js +100 -0
  76. package/dist/campaign-k_WHxsOR.js +400 -0
  77. package/dist/{campaign.enum-BNN2gLFY.js → campaign.enum-Dx-Zo68Q.js} +1 -1
  78. package/dist/{campaign.fn-Bd34dVnx.js → campaign.fn-B-4JRzft.js} +67 -67
  79. package/dist/{collectible.enum-DO9HdJGH.js → collectible.enum-Liy2wH3s.js} +1 -1
  80. package/dist/collection.fn-zQwWDzZT.js +26 -0
  81. package/dist/currency-CQVHXBFe.js +7 -0
  82. package/dist/{duplicateCampaign-2ODeDw3a.js → duplicateCampaign-YTXMbJTj.js} +11 -11
  83. package/dist/{effect-BcB8IlTI.js → effect-CQkVLHWi.js} +1 -1
  84. package/dist/{email-addresses-BcTeU4Sh.js → email-addresses-BIoVbPGC.js} +209 -201
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/{helper-BSgrCJRv.js → helper-BCkTvF4m.js} +1 -1
  87. package/dist/{index-CoHWpylO.js → index-B-bQnb0_.js} +2115 -2557
  88. package/dist/index-BAJOC43K.js +14550 -0
  89. package/dist/{index-HXiYGO4_.js → index-BFIHEBnX.js} +6343 -7693
  90. package/dist/{index-VlFWaBrg.js → index-BJIQe3QJ.js} +1 -1
  91. package/dist/{index-BpI-BI4H.js → index-BJkRTH5T.js} +4 -4
  92. package/dist/index-BOJogkKQ.js +172 -0
  93. package/dist/{index-BoYEqLif.js → index-BRPajAkE.js} +1517 -263
  94. package/dist/{index-CsoBDon4.js → index-BTkxgos0.js} +1590 -1523
  95. package/dist/index-BUP4aHq8.js +32438 -0
  96. package/dist/index-BYvnqARr.js +902 -0
  97. package/dist/{index-hlyg-wxV.js → index-Bonq819P.js} +1 -1
  98. package/dist/{index-CIBPhxlC.js → index-C6mOI2Pp.js} +105 -123
  99. package/dist/{index-Bf6jNZit.js → index-CDIe15AY.js} +24 -9
  100. package/dist/index-CTrcdIkt.js +137 -0
  101. package/dist/index-C_H8jFYf.js +2743 -0
  102. package/dist/index-CpnchVe1.js +74 -0
  103. package/dist/index-D5AR7A5e.js +151 -0
  104. package/dist/index-D7-Q86HI.js +54 -0
  105. package/dist/index-DdOj8Hew.js +53 -0
  106. package/dist/{index-iMPtFp54.js → index-Dvqguh2B.js} +10 -9
  107. package/dist/{index-Bm0QPucw.js → index-hAKRfE-4.js} +14 -14
  108. package/dist/index-o2Ga_qaX.js +39 -0
  109. package/dist/{index.esm2017-CM7OnEyP.js → index.esm2017-D0fhMMPG.js} +128 -128
  110. package/dist/{loading-CSXr0Yqz.js → loading-C686AMVG.js} +1 -1
  111. package/dist/{lodash-Bh7XKI-R.js → lodash-CANlWUWW.js} +1 -1
  112. package/dist/member-import-UzJ6ByIS.js +188 -0
  113. package/dist/membership-DCVzFaFy.js +274 -0
  114. package/dist/{money-BZIST_m9.js → money-DuazwoX7.js} +1 -1
  115. package/dist/{number-DXLR2w95.js → number-B2HFiV0g.js} +1 -1
  116. package/dist/objectid-Bq-oVMdP.js +145 -0
  117. package/dist/onboarding-BxvNxz-9.js +131 -0
  118. package/dist/onboardingSetup-CcvKmyx8.js +17 -0
  119. package/dist/{plugins-4FlbwoES.js → plugins-C39O5j42.js} +13 -12
  120. package/dist/remy-Qz_pNsUS.js +13 -0
  121. package/dist/{reward-DUbl79bZ.js → reward-HYt-2nxt.js} +1 -1
  122. package/dist/{rule-BQUoZ4l_.js → rule-3xNIYM7z.js} +337 -275
  123. package/dist/style.css +1 -1
  124. package/dist/{template-BoiSG7G7.js → template-D37Z_b0m.js} +6 -6
  125. package/dist/timezone-JwnQgpaU.js +20 -0
  126. package/dist/transaction.fn-C5vswLI_.js +71 -0
  127. package/dist/{trigger-D5g5m6tT.js → trigger-Bc6s2cvq.js} +17 -17
  128. package/dist/useMarketingMaterialActions-DMGyAXcy.js +96 -0
  129. package/dist/{usePagination-DHePBBoR.js → usePagination-DLOOwiiY.js} +1 -1
  130. package/dist/{user-C_ToSo-g.js → user-CTIGugVF.js} +1 -1
  131. package/dist/{vue-i18n-BcYh6_51.js → vue-i18n-Dpic36zz.js} +287 -287
  132. package/dist/{xlsx-h4G1C-xj.js → xlsx-CT9_1SFr.js} +786 -786
  133. package/dist/{zod-CgigfJar.js → zod-CGVrMcDl.js} +1 -1
  134. package/package.json +10 -6
  135. package/dist/Broadcast-C9akM-TB.js +0 -266
  136. package/dist/Card-DRkIYs0M.js +0 -910
  137. package/dist/Credit-V5YA_hGx.js +0 -260
  138. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  139. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CYQMXARx.js +0 -3377
  140. package/dist/Experience-WTWy5yY6.js +0 -259
  141. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  142. package/dist/Game-BwOfTCW5.js +0 -330
  143. package/dist/LoyaltyDashboard-CJdhYiea.js +0 -1082
  144. package/dist/MainLayout-Du5kZOtA.js +0 -41
  145. package/dist/Member-DUV_vbPI.js +0 -280
  146. package/dist/MemberList-Ye4nOk-i.js +0 -1601
  147. package/dist/Mission-BBmCGpt8.js +0 -334
  148. package/dist/Point-Bzg6hi6o.js +0 -262
  149. package/dist/Promotion-BMXIp_ef.js +0 -397
  150. package/dist/Review-CYNPPxYU.js +0 -1141
  151. package/dist/ReviewFacebookCallback-0SUkKAaC.js +0 -243
  152. package/dist/ReviewGoogleCallback-BZEzx68n.js +0 -208
  153. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-C4vohf6c.js +0 -181
  154. package/dist/Setting-jHAjccod.js +0 -2047
  155. package/dist/Store-Cu-hKmVa.js +0 -1996
  156. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CGz6CTWA.js +0 -1130
  157. package/dist/Transaction-D7DO3dKQ.js +0 -39
  158. package/dist/Voucher-Cq-n1CaC.js +0 -421
  159. package/dist/campaign--MjoY1Mn.js +0 -219
  160. package/dist/campaign-DHBuP4UA.js +0 -277
  161. package/dist/export-CjB7qxZ9.js +0 -97
  162. package/dist/index-BIAjmMga.js +0 -85
  163. package/dist/index-Bv4MBLQ5.js +0 -52
  164. package/dist/index-hbyCVNa7.js +0 -30289
  165. package/dist/membership-CfredTm3.js +0 -255
  166. package/dist/objectid-Dg4ZodlT.js +0 -145
  167. package/dist/useMarketingMaterialActions-B-Jlw2Z9.js +0 -107
@@ -0,0 +1,2615 @@
1
+ import { defineComponent as X, computed as E, resolveComponent as v, openBlock as m, createBlock as R, withCtx as I, createElementVNode as n, toDisplayString as F, createVNode as i, createCommentVNode as M, createElementBlock as T, unref as e, Fragment as W, renderList as de, ref as O, isRef as ve, reactive as at, onMounted as De, watch as He, toRaw as st, createTextVNode as le, h as lt, normalizeStyle as Qe, normalizeClass as $e } from "vue";
2
+ import { _ as it } from "./tier-BJDhpH6X.js";
3
+ import { useDialog as ze, useDialogChild as We, components as rt } from "@feedmepos/ui-library";
4
+ import { c as K, e as Me, S as Ge } from "./index-BUP4aHq8.js";
5
+ import { u as et } from "./loading-C686AMVG.js";
6
+ import { u as Ye, C as Te } from "./membership-DCVzFaFy.js";
7
+ import { l as ct, m as dt, n as ut, o as Xe, p as mt, q as pt } from "./index-B-bQnb0_.js";
8
+ import { a as ft, c as Ae } from "./object-BYyQ0PZp.js";
9
+ import { _ as pe } from "./lodash-CANlWUWW.js";
10
+ import { c as Ce } from "./index-BFIHEBnX.js";
11
+ import { u as he } from "./vue-i18n-Dpic36zz.js";
12
+ import { Z as re, g as ae, a as se } from "./zod-CGVrMcDl.js";
13
+ import { z as ce, R as Oe } from "./app-BEYzXWZO.js";
14
+ import { u as Le } from "./app-wDQR6dpb.js";
15
+ import { _ as ge } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Bcsi94dw.js";
16
+ import { c as yt, p as Ie, n as gt, f as je } from "./plugins-C39O5j42.js";
17
+ import { J as Je } from "./JsonViewer-v8_C7l5N.js";
18
+ import { _ as bt } from "./index-BTkxgos0.js";
19
+ import { _ as vt } from "./ImageInput.vue_vue_type_script_setup_true_lang-BmLclEyi.js";
20
+ import { _ as ht } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
21
+ import { z as xt, a as _t } from "./money-DuazwoX7.js";
22
+ import { f as Ct } from "./currency-CQVHXBFe.js";
23
+ import { F as St } from "./number-B2HFiV0g.js";
24
+ import { a as Ft, t as wt } from "./helper-BCkTvF4m.js";
25
+ import "./index-Bonq819P.js";
26
+ import "./index-BRPajAkE.js";
27
+ import "./index-BYvnqARr.js";
28
+ import "./index-Dvqguh2B.js";
29
+ import "./index-o2Ga_qaX.js";
30
+ import "./index-BOJogkKQ.js";
31
+ import { m as $t } from "./index-CTrcdIkt.js";
32
+ import { m as Ue } from "./index-CDIe15AY.js";
33
+ import { g as qe } from "./index-DdOj8Hew.js";
34
+ import { u as kt } from "./business-DH7djUl8.js";
35
+ import { useRouter as Pt } from "vue-router";
36
+ function tt(b) {
37
+ return Ce.DineroFactory(b).toUnit();
38
+ }
39
+ function ot(b, a, c, g, d = [], h = []) {
40
+ const o = bt.compact(
41
+ a.map((t) => b.find((r) => r.systemCode === t.systemCode && r.taxCode === t.taxCode)).filter((t) => !!t && h.includes(t.systemCode))
42
+ ), l = o.reduce(
43
+ (t, r) => {
44
+ var p;
45
+ return Object.assign(t, {
46
+ [r.taxCode]: {
47
+ inclusive: ((p = d.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 = Ce.Calculator.calculate({
64
+ items: {
65
+ 0: {
66
+ quantity: 1,
67
+ adjustments: {
68
+ price: {
69
+ level: 0,
70
+ type: {
71
+ type: "BY_AMOUNT",
72
+ amount: Ce.DineroFactory(c).subtract(Ce.Dinero.fromNumber({ number: g }).toObject()).toObject()
73
+ }
74
+ }
75
+ },
76
+ taxes: l
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: Ce.DineroFactory({
89
+ ...f.items[0].taxes[t.taxCode].amount
90
+ }).convertPrecision(2).toObject()
91
+ }));
92
+ }
93
+ function nt(b, a, c) {
94
+ return b ? b.reduce((g, d) => {
95
+ var h;
96
+ return (h = c.find((o) => o.systemCode === d.systemCode)) != null && h.inclusive || (g = Ce.DineroFactory(g.toObject()).add(d.total)), g;
97
+ }, Ce.DineroFactory(a)).toObject() : Ce.DineroFactory(a).toObject();
98
+ }
99
+ const Vt = { class: "flex justify-between items-start gap-4 w-full" }, Tt = { class: "fm-typo-en-body-lg-600 text-left pt-4 break-words line-clamp-2" }, Rt = { class: "flex-shrink-0 -mr-8 -mt-8" }, It = { class: "relative h-[120px] aspect-video flex mx-auto items-center justify-center border rounded-md border-fm-color-neutral-gray-300" }, Ut = ["src"], Et = {
100
+ key: 2,
101
+ class: "absolute top-2 left-2"
102
+ }, Dt = { class: "flex flex-col gap-8 flex-1 text-left w-full" }, Bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Nt = { class: "flex gap-8 items-center flex-wrap" }, Mt = /* @__PURE__ */ X({
103
+ __name: "StoreBundleCard",
104
+ props: {
105
+ bundle: { type: Object, required: !0 }
106
+ },
107
+ emits: ["edit", "delete", "send"],
108
+ setup(b, { emit: a }) {
109
+ const c = b, g = a, d = E(() => {
110
+ const o = [];
111
+ return c.bundle.price.amount > 0 && o.push(
112
+ `${K.Config.getCountry().currency.symbol}${tt(c.bundle.price)}`
113
+ ), c.bundle.coinPrice && o.push(`${c.bundle.coinPrice} point(s)`), o.join(" or ");
114
+ }), h = E(() => {
115
+ var l, f;
116
+ const o = [];
117
+ if (c.bundle.titles.length > 0 && o.push(`${c.bundle.titles.length} title(s)`), c.bundle.vouchers.length > 0 && o.push(`${c.bundle.vouchers.length} voucher(s)`), c.bundle.credit.normal || (l = c.bundle.credit.free) != null && l.amount) {
118
+ const t = c.bundle.credit.normal + (((f = c.bundle.credit.free) == null ? void 0 : f.amount) ?? 0);
119
+ o.push(`${t} credit(s)`);
120
+ }
121
+ return o;
122
+ });
123
+ return (o, l) => {
124
+ const f = v("FmButton"), t = v("FmMenuItem"), r = v("FmMenu"), p = v("FmIcon"), y = v("FmChip"), w = v("FmCard");
125
+ return m(), R(w, {
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", Vt, [
131
+ n("div", Tt, F(b.bundle.name), 1),
132
+ n("div", Rt, [
133
+ i(r, { placement: "bottom-end" }, {
134
+ "menu-button": I(() => [
135
+ i(f, {
136
+ icon: "more_vert",
137
+ variant: "tertiary"
138
+ })
139
+ ]),
140
+ default: I(() => [
141
+ i(t, {
142
+ onClick: l[0] || (l[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: l[1] || (l[1] = (u) => g("send", b.bundle)),
149
+ icon: "send",
150
+ label: "Send"
151
+ })),
152
+ i(t, {
153
+ onClick: l[2] || (l[2] = (u) => g("delete", b.bundle)),
154
+ icon: "delete"
155
+ }, {
156
+ label: I(() => [...l[3] || (l[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", It, [
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, Ut)) : (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", Et, [
179
+ i(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", Dt, [
187
+ n("div", Bt, F(e(d) || "Free"), 1),
188
+ n("div", Nt, [
189
+ (m(!0), T(W, null, de(e(h), (u, S) => (m(), R(y, {
190
+ key: S,
191
+ label: u
192
+ }, null, 8, ["label"]))), 128))
193
+ ])
194
+ ])
195
+ ]),
196
+ _: 1
197
+ });
198
+ };
199
+ }
200
+ }), Ot = /* @__PURE__ */ X({
201
+ __name: "AddBundleCard",
202
+ emits: ["create"],
203
+ setup(b, { emit: a }) {
204
+ const { t: c } = he(), g = a;
205
+ return (d, h) => {
206
+ const o = v("FmButton"), l = v("FmCard");
207
+ return m(), R(l, {
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
+ i(o, {
213
+ onClick: h[0] || (h[0] = (f) => g("create")),
214
+ label: e(c)("connect.store.actions.addBundle"),
215
+ icon: "add",
216
+ variant: "secondary"
217
+ }, null, 8, ["label"])
218
+ ]),
219
+ _: 1
220
+ });
221
+ };
222
+ }
223
+ }), Lt = { class: "space-y-16" }, At = { class: "flex w-full justify-between pb-16" }, jt = { class: "flex items-center justify-end gap-8" }, qt = /* @__PURE__ */ X({
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 } = he(), c = b, g = ze(), { emitData: d, emitAction: h } = We(), o = O(c.initialValue), l = ce.string().min(1);
237
+ function f() {
238
+ d(o.value), h("primary"), g.close();
239
+ }
240
+ function t() {
241
+ d(null), h("primary"), g.close();
242
+ }
243
+ return (r, p) => {
244
+ const y = v("FmTextField"), w = v("FmButton");
245
+ return m(), T("div", Lt, [
246
+ i(y, {
247
+ modelValue: e(o),
248
+ "onUpdate:modelValue": p[0] || (p[0] = (u) => ve(o) ? o.value = u : null),
249
+ label: e(a)("connect.store.category.label"),
250
+ rules: [e(re).toRule(e(l))]
251
+ }, null, 8, ["modelValue", "label", "rules"]),
252
+ n("div", At, [
253
+ n("div", null, [
254
+ b.action == "edit" ? (m(), R(w, {
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", jt, [
262
+ i(w, {
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
+ i(w, {
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
+ }), Gt = { class: "space-y-16" }, Kt = { class: "flex items-center justify-end gap-8 pb-16" }, Ht = /* @__PURE__ */ X({
278
+ __name: "SelectCategoryDialog",
279
+ setup(b) {
280
+ const { emitData: a, emitAction: c } = We(), g = Ye(), d = O(), h = E(
281
+ () => g.sortedStoreCategories.map((o, l) => ({
282
+ label: o.name,
283
+ value: l
284
+ }))
285
+ );
286
+ return (o, l) => {
287
+ const f = v("FmSelect"), t = v("FmButton");
288
+ return m(), T("div", Gt, [
289
+ l[4] || (l[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
+ i(f, {
291
+ placeholder: "Select a category",
292
+ items: e(h),
293
+ modelValue: e(d),
294
+ "onUpdate:modelValue": [
295
+ l[0] || (l[0] = (r) => ve(d) ? d.value = r : null),
296
+ l[1] || (l[1] = (r) => e(a)(r))
297
+ ],
298
+ label: "Category"
299
+ }, null, 8, ["items", "modelValue"]),
300
+ n("div", Kt, [
301
+ i(t, {
302
+ variant: "tertiary",
303
+ label: "Cancel",
304
+ onClick: l[2] || (l[2] = (r) => e(c)("tertiary"))
305
+ }),
306
+ i(t, {
307
+ label: "Select",
308
+ onClick: l[3] || (l[3] = (r) => e(c)("primary")),
309
+ disabled: e(d) == null
310
+ }, null, 8, ["disabled"])
311
+ ])
312
+ ]);
313
+ };
314
+ }
315
+ });
316
+ function be(b) {
317
+ return b.states.map((a) => ({ label: a, value: a }));
318
+ }
319
+ const zt = {
320
+ [Me.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 be(this);
341
+ }
342
+ },
343
+ [Me.F_COUNTRY.enum.SG]: {
344
+ states: [],
345
+ get stateItems() {
346
+ return be(this);
347
+ }
348
+ },
349
+ JP: {
350
+ states: [],
351
+ get stateItems() {
352
+ return be(this);
353
+ }
354
+ },
355
+ AE: {
356
+ states: [],
357
+ get stateItems() {
358
+ return be(this);
359
+ }
360
+ },
361
+ AU: {
362
+ states: [],
363
+ get stateItems() {
364
+ return be(this);
365
+ }
366
+ },
367
+ MO: {
368
+ states: [],
369
+ get stateItems() {
370
+ return be(this);
371
+ }
372
+ },
373
+ VN: {
374
+ states: [],
375
+ get stateItems() {
376
+ return be(this);
377
+ }
378
+ },
379
+ [Me.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 be(this);
417
+ }
418
+ },
419
+ [Me.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 be(this);
501
+ }
502
+ }
503
+ }, Re = () => K.Config.getCountry(), Ee = {
504
+ get fullCurrency() {
505
+ return Re().currency;
506
+ },
507
+ get currency() {
508
+ return Re().currency.code;
509
+ },
510
+ get fullTax() {
511
+ return K.Country.getCountryFlattenTaxes(Re().code);
512
+ },
513
+ get taxSystem() {
514
+ return Re().taxSystems;
515
+ },
516
+ taxInclusion(b) {
517
+ return Ee.taxSystem.map((a) => ({
518
+ systemCode: a.code,
519
+ inclusive: b !== void 0 ? b : !1
520
+ }));
521
+ },
522
+ groupedTaxOptions() {
523
+ const b = K.Country.getCountryFlattenTaxes(Re().code);
524
+ return Ee.taxSystem.map((a) => ({
525
+ code: a.code,
526
+ options: b.map((c) => ({ ...c, feedmeTaxCode: Ee.generateCode(c) })).filter((c) => c.systemCode === a.code)
527
+ }));
528
+ },
529
+ systemDefaultCode(b) {
530
+ const a = Ee.groupedTaxOptions().find((c) => c.code === b);
531
+ return a == null ? void 0 : a.options.find((c) => c.default);
532
+ },
533
+ generateCode(b) {
534
+ return `${b.systemCode}/${b.taxCode}`;
535
+ }
536
+ }, Q = Ee, Wt = /* @__PURE__ */ X({
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 c = b, g = Q.taxSystem, d = a, h = O(c.modelValue);
548
+ function o(r, p) {
549
+ const y = pe.clone(c.modelValue), w = y.findIndex((u) => u.systemCode === r);
550
+ w >= 0 ? y[w].inclusive = p : y.push({
551
+ systemCode: r,
552
+ inclusive: p
553
+ }), h.value = y, d("update:model-value", y);
554
+ }
555
+ function l() {
556
+ return g.map((r) => {
557
+ const p = c.modelValue ? c.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 = at(l());
570
+ function t(r, p) {
571
+ return `${r} ${p ? "Inclusive" : "Exclusive"}`;
572
+ }
573
+ return De(() => {
574
+ c.modelValue.length || o(g[0].code, !1);
575
+ }), He(
576
+ () => c.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(W, null, de(e(f), (w, u) => {
583
+ var S;
584
+ return m(), T("div", { key: u }, [
585
+ i(y, {
586
+ "model-value": ((S = e(h)[u]) == null ? void 0 : S.inclusive) || !1,
587
+ "label-placement": "left",
588
+ "onUpdate:modelValue": ($) => w.input($)
589
+ }, {
590
+ label: I(() => {
591
+ var $;
592
+ return [
593
+ n("div", null, F(t(w.label, (($ = e(h)[u]) == null ? void 0 : $.inclusive) || !1)), 1)
594
+ ];
595
+ }),
596
+ _: 2
597
+ }, 1032, ["model-value", "onUpdate:modelValue"])
598
+ ]);
599
+ }), 128);
600
+ };
601
+ }
602
+ });
603
+ var Yt = { mode: "development", appMode: "mf" };
604
+ const Jt = { class: "space-y-8" }, Xt = {
605
+ key: 0,
606
+ class: "space-y-16"
607
+ }, Zt = /* @__PURE__ */ X({
608
+ __name: "StripeSetting",
609
+ props: {
610
+ modelValue: {}
611
+ },
612
+ emits: ["update:modelValue"],
613
+ setup(b, { emit: a }) {
614
+ const c = b, g = a, d = O(!1);
615
+ He(d, (o, l) => {
616
+ l != o && (!c.modelValue && o ? g("update:modelValue", {
617
+ apiKey: "",
618
+ webhookSecret: ""
619
+ }) : o || g("update:modelValue", void 0));
620
+ });
621
+ const h = E(() => {
622
+ const o = Yt.mode === "development", l = K.Config.getCountry().code.toLowerCase(), f = l != "my" ? `.${l}` : "";
623
+ return `https://marketing${o ? "-dev" : ""}${f}.feedmeapi.com/stripe/${Ge.getBusinessId()}/webhook`;
624
+ });
625
+ return De(() => {
626
+ d.value = !!c.modelValue;
627
+ }), (o, l) => {
628
+ const f = v("FmSwitch"), t = v("FmTextField"), r = v("FmButton");
629
+ return m(), T("div", Jt, [
630
+ i(f, {
631
+ modelValue: e(d),
632
+ "onUpdate:modelValue": l[0] || (l[0] = (p) => ve(d) ? d.value = p : null),
633
+ value: "true",
634
+ label: "Enable Stripe"
635
+ }, null, 8, ["modelValue"]),
636
+ c.modelValue ? (m(), T("div", Xt, [
637
+ i(t, {
638
+ label: "API Key",
639
+ modelValue: c.modelValue.apiKey,
640
+ "onUpdate:modelValue": l[1] || (l[1] = (p) => c.modelValue.apiKey = p),
641
+ "helper-text": "Go to Stripe Dashboard get your API Key and paste here."
642
+ }, null, 8, ["modelValue"]),
643
+ i(t, {
644
+ label: "Webhook URL",
645
+ "model-value": e(h),
646
+ readonly: "",
647
+ "helper-text": "Copy this URL to your Stripe dashboard"
648
+ }, {
649
+ append: I(() => [
650
+ i(r, {
651
+ icon: "content_copy",
652
+ variant: "tertiary",
653
+ onClick: l[2] || (l[2] = (p) => e(yt)(e(h)))
654
+ })
655
+ ]),
656
+ _: 1
657
+ }, 8, ["model-value"]),
658
+ i(t, {
659
+ modelValue: c.modelValue.webhookSecret,
660
+ "onUpdate:modelValue": l[3] || (l[3] = (p) => c.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
+ }), Qt = {
670
+ key: 0,
671
+ class: "space-y-16 pr-12"
672
+ }, eo = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, to = {
673
+ key: 1,
674
+ class: "space-y-16"
675
+ }, oo = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, no = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, ao = { class: "grid grid-cols-2 gap-x-16 gap-y-16" }, so = { class: "space-y-4" }, lo = { class: "fm-typo-en-body-lg-400" }, io = { class: "space-y-16" }, ro = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, co = { class: "flex items-center gap-8" }, uo = /* @__PURE__ */ X({
676
+ __name: "StoreSettingSheet",
677
+ emits: ["update"],
678
+ setup(b, { expose: a, emit: c }) {
679
+ const { t: g } = he(), d = c, h = O(!1), o = O(), l = O(!1), f = ct.extend({
680
+ company: dt.extend({
681
+ name: ce.string().min(1, "Company name is required"),
682
+ regNo: ce.string().min(1, "Registration number is required"),
683
+ address: ut.extend({
684
+ line1: ce.string().min(1, "Line 1 is required"),
685
+ line2: ce.string().optional(),
686
+ state: ce.string().min(1, "State is required"),
687
+ city: ce.string().min(1, "City is required"),
688
+ postcode: ce.string().min(1, "Postcode is required"),
689
+ country: ce.string().min(1, "Country is required")
690
+ }),
691
+ phoneNo: ce.string().min(1, "Phone number is required"),
692
+ sstRegNo: ce.string().optional()
693
+ })
694
+ }), t = E(() => f.safeParse(o.value).success);
695
+ function r() {
696
+ const w = f.safeParse(o.value);
697
+ w.success && d("update", w.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: K.Config.getCountry().name
710
+ },
711
+ phoneNo: "",
712
+ regNo: "",
713
+ sstRegNo: ""
714
+ },
715
+ inclusiveTaxes: []
716
+ };
717
+ }
718
+ function y(w, u) {
719
+ h.value = w, w && (o.value = u != null && u.company ? pe.cloneDeep(u) : p());
720
+ }
721
+ return a({
722
+ showSheet: y,
723
+ data: o
724
+ }), (w, u) => {
725
+ const S = v("FmIcon"), $ = v("FmMenuItem"), N = v("FmMenu"), ue = v("FmSelect"), oe = v("FmButton"), z = v("FmSideSheet");
726
+ return m(), R(z, {
727
+ "max-width": 560,
728
+ modelValue: e(h),
729
+ "onUpdate:modelValue": u[15] || (u[15] = (te) => ve(h) ? h.value = te : null),
730
+ header: e(g)("connect.store.setting.title")
731
+ }, {
732
+ "side-sheet-footer": I(() => [
733
+ n("div", co, [
734
+ i(oe, {
735
+ label: e(g)("connect.common.save"),
736
+ onClick: r,
737
+ disabled: !e(t) || e(Le)().isLoading,
738
+ loading: e(Le)().isLoading
739
+ }, null, 8, ["label", "disabled", "loading"]),
740
+ i(oe, {
741
+ label: e(g)("connect.common.cancel"),
742
+ onClick: u[14] || (u[14] = (te) => y(!1)),
743
+ variant: "tertiary"
744
+ }, null, 8, ["label"])
745
+ ])
746
+ ]),
747
+ default: I(() => {
748
+ var te, me;
749
+ return [
750
+ i(Je, { json: e(o) }, null, 8, ["json"]),
751
+ e(o) && e(o).company ? (m(), T("div", Qt, [
752
+ n("div", eo, F(e(g)("connect.store.setting.company.legal_info")), 1),
753
+ i(ge, {
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(re).typeAtPath(e(f), "company.name")
758
+ }, null, 8, ["modelValue", "label", "schema"]),
759
+ i(ge, {
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(re).typeAtPath(e(f), "company.regNo")
764
+ }, null, 8, ["modelValue", "label", "schema"]),
765
+ e(K.Config).getCountry().taxSystems.length ? (m(), R(ge, {
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(re).typeAtPath(e(f), "company.sstRegNo")
774
+ }, null, 8, ["modelValue", "label", "schema"])) : M("", !0),
775
+ (te = e(o).company) != null && te.sstRegNo && e(o).inclusiveTaxes ? (m(), T("div", to, [
776
+ n("div", oo, F(e(g)("connect.store.setting.company.tax")), 1),
777
+ i(Wt, {
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
+ i(ge, {
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(re).typeAtPath(e(f), "company.phoneNo")
787
+ }, null, 8, ["modelValue", "label", "schema"]),
788
+ n("div", no, F(e(g)("connect.store.setting.company.address.title")), 1),
789
+ i(ge, {
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(re).typeAtPath(e(f), "company.address.line1")
794
+ }, null, 8, ["modelValue", "label", "schema"]),
795
+ i(ge, {
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(re).typeAtPath(e(f), "company.address.line2")
800
+ }, null, 8, ["modelValue", "label", "schema"]),
801
+ n("div", ao, [
802
+ i(ge, {
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(re).typeAtPath(e(f), "company.address.city")
807
+ }, null, 8, ["modelValue", "label", "schema"]),
808
+ i(ge, {
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(re).typeAtPath(e(f), "company.address.postcode")
813
+ }, null, 8, ["modelValue", "label", "schema"]),
814
+ n("div", so, [
815
+ n("div", lo, F(e(g)("connect.store.setting.company.address.state")), 1),
816
+ i(N, {
817
+ placement: "top-end",
818
+ "model-value": e(l)
819
+ }, {
820
+ "menu-button": I(() => [
821
+ i(ge, {
822
+ modelValue: e(o).company.address.state,
823
+ "onUpdate:modelValue": u[10] || (u[10] = (V) => e(o).company.address.state = V),
824
+ schema: e(re).typeAtPath(e(f), "company.address.state"),
825
+ onFocusChanged: u[11] || (u[11] = (V) => l.value = V)
826
+ }, {
827
+ append: I(() => [
828
+ i(S, {
829
+ name: e(l) ? "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(W, null, de(e(zt)[e(K.Config).getCountry().code].stateItems.filter(
837
+ (V) => {
838
+ var xe, fe;
839
+ return V.label.toLowerCase().includes(((fe = (xe = e(o)) == null ? void 0 : xe.company) == null ? void 0 : fe.address.state.toLowerCase()) ?? "");
840
+ }
841
+ ) || [], (V) => (m(), R($, {
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, l.value = !1;
847
+ }
848
+ }, null, 8, ["model-value", "label", "onClick"]))), 128))
849
+ ]),
850
+ _: 1
851
+ }, 8, ["model-value"])
852
+ ]),
853
+ i(ue, {
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(K.Config).getCountry().name,
860
+ value: e(K.Config).getCountry().name
861
+ }
862
+ ],
863
+ rules: [e(re).ruleAtPath(e(f), "company.address.country")]
864
+ }, null, 8, ["label", "modelValue", "items", "rules"])
865
+ ]),
866
+ n("div", io, [
867
+ n("div", ro, F(e(g)("connect.store.setting.stripe.title")), 1),
868
+ i(Zt, {
869
+ "model-value": (me = e(o)) == null ? void 0 : me.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
+ }), mo = /* @__PURE__ */ X({
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 c = b, g = a;
892
+ De(() => {
893
+ if (o.value.length !== h.value.length) {
894
+ const t = h.value.reduce((r, p) => {
895
+ const y = Q.systemDefaultCode(p.name);
896
+ if (!y) return r;
897
+ const { systemCode: w, taxCode: u } = y;
898
+ return p.value || r.push({ systemCode: w, taxCode: u }), r;
899
+ }, []);
900
+ f(t);
901
+ }
902
+ });
903
+ function d() {
904
+ return Q.groupedTaxOptions();
905
+ }
906
+ const h = E(() => d().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} (${St(r.rate)}%)`,
913
+ value: r.feedmeTaxCode
914
+ }))
915
+ }))), o = E(() => c.modelValue.map((t) => Q.generateCode(t)));
916
+ function l(t) {
917
+ const r = d().find(
918
+ (u) => u.options.some((S) => S.feedmeTaxCode === t)
919
+ ), p = r == null ? void 0 : r.options.find((u) => u.feedmeTaxCode === t);
920
+ if (!p) return;
921
+ const { systemCode: y, taxCode: w } = p;
922
+ f([{ systemCode: y, taxCode: w }]);
923
+ }
924
+ function f(t) {
925
+ const r = pe.clone(c.modelValue);
926
+ t.forEach((p) => {
927
+ const y = d().find(
928
+ (S) => S.options.some(($) => $.feedmeTaxCode === Q.generateCode(p))
929
+ ), w = (y == null ? void 0 : y.options) || [], u = r.findIndex(
930
+ (S) => w.some(($) => Q.generateCode($) === Q.generateCode(S))
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(W, null, de(e(h), (w) => (m(), T("div", {
938
+ key: w.name,
939
+ class: "flex items-start"
940
+ }, [
941
+ i(y, {
942
+ modelValue: w.value,
943
+ "onUpdate:modelValue": [
944
+ (u) => w.value = u,
945
+ r[0] || (r[0] = (u) => {
946
+ l(u);
947
+ })
948
+ ]
949
+ }, {
950
+ default: I(() => [
951
+ (m(!0), T(W, null, de(w.options, (u, S) => (m(), R(p, {
952
+ key: S,
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
+ }), Ke = {
963
+ get _id() {
964
+ return (/* @__PURE__ */ new Date()).toISOString();
965
+ },
966
+ name: "",
967
+ price: K.Dinero.zero().toObject(),
968
+ originalPrice: K.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: xt()
985
+ }, po = {
986
+ key: 0,
987
+ class: "space-y-24 pr-12"
988
+ }, fo = { class: "space-y-8" }, yo = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, go = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, bo = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, vo = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, ho = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary !mb-[-16px]" }, xo = { class: "space-y-8" }, _o = { class: "flex items-center justify-between" }, Co = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, So = { class: "space-y-8" }, Fo = { class: "flex items-center gap-8" }, wo = /* @__PURE__ */ X({
989
+ __name: "EditBundleSheet",
990
+ emits: ["update"],
991
+ setup(b, { expose: a, emit: c }) {
992
+ const g = c, { t: d } = he(), h = Ye(), o = O(!1), l = O([]), f = O({
993
+ category: 0,
994
+ index: -1,
995
+ originalCategoryIndex: void 0
996
+ }), t = O(pe.cloneDeep(Ke)), r = O(), p = Xe, y = E(() => {
997
+ const C = p.safeParse(t.value);
998
+ return C.success ? [] : C.error.errors;
999
+ }), w = [
1000
+ {
1001
+ header: "Reward title",
1002
+ accessorFn: (C) => C.collectible.name,
1003
+ enableSorting: !0
1004
+ },
1005
+ {
1006
+ id: "type",
1007
+ header: "Reward type",
1008
+ accessorFn: (C) => C.collectible.type,
1009
+ cell(C) {
1010
+ return Te[C.row.original.collectible.type].chip();
1011
+ }
1012
+ },
1013
+ {
1014
+ header: "Description",
1015
+ accessorFn: (C) => C.description,
1016
+ cell(C) {
1017
+ var k;
1018
+ const s = C.row.original;
1019
+ return s.collectible.type == "VOUCHER" || s.selectedReward == null ? s.description : lt(rt.FmStepperField, {
1020
+ "onUpdate:modelValue": (D) => {
1021
+ t.value.titles = t.value.titles.map(
1022
+ (J) => J.id == s.collectible._id ? { ...J, dayToExpire: D } : J
1023
+ );
1024
+ },
1025
+ modelValue: ((k = s.selectedReward) == null ? void 0 : k.extra) ?? 0,
1026
+ appendText: "day(s)",
1027
+ helperState: ae(y.value, "titles"),
1028
+ helperText: se(y.value, "titles"),
1029
+ max: 9999,
1030
+ rules: [(D) => D <= 9999 || "Maximum 9999 days allowed"],
1031
+ showSteppers: !1,
1032
+ disabled: !!t.value.stripePriceId
1033
+ });
1034
+ }
1035
+ }
1036
+ ], u = O([]), S = E(() => {
1037
+ var s;
1038
+ const C = (s = t.value) != null && s.isFeedvibe ? "STORE_BUNDLE:FEEDVIBE" : "STORE_BUNDLE:DEFAULT";
1039
+ return h.bundleRewards.filter((k) => {
1040
+ var D;
1041
+ return (D = t.value) != null && D.isFeedvibe && k.type !== "VOUCHER" ? !1 : Ft(k.capabilities, C);
1042
+ }).map((k) => {
1043
+ const D = $.value.find((Z) => Z.id == k._id), J = k.type === "VOUCHER" ? `${k.options.maxUse} use(s), ${wt(
1044
+ k.options.validityOption || {}
1045
+ )}` : "No expiry";
1046
+ return {
1047
+ collectible: k,
1048
+ description: J,
1049
+ selectedReward: D
1050
+ };
1051
+ });
1052
+ }), $ = E(() => {
1053
+ var C, s;
1054
+ return [
1055
+ ...((C = t.value) == null ? void 0 : C.titles.map((k) => ({
1056
+ id: k.id,
1057
+ extra: k.dayToExpire
1058
+ }))) ?? [],
1059
+ ...((s = t.value) == null ? void 0 : s.vouchers.map((k) => ({
1060
+ id: k,
1061
+ extra: void 0
1062
+ }))) ?? []
1063
+ ];
1064
+ }), N = E(
1065
+ () => t.value.stripePriceId && t.value.subscriptionValidity ? t.value.subscriptionValidity : 0
1066
+ );
1067
+ function ue(C) {
1068
+ t.value.subscriptionValidity = C;
1069
+ for (const s of t.value.titles)
1070
+ s.dayToExpire = C;
1071
+ t.value.credit.free && (t.value.credit.free.day = C);
1072
+ }
1073
+ function oe() {
1074
+ const C = S.value, s = t.value;
1075
+ if (!(!s || !C))
1076
+ for (let k = 0; k < C.length; k++) {
1077
+ const D = C[k];
1078
+ z.value[k] ? D.collectible.type == "TITLE" ? s.titles.findIndex(
1079
+ (A) => A.id == D.collectible._id
1080
+ ) < 0 && s.titles.push({
1081
+ id: D.collectible._id,
1082
+ dayToExpire: N.value
1083
+ }) : s.vouchers.findIndex(
1084
+ (A) => A == D.collectible._id
1085
+ ) < 0 && s.vouchers.push(D.collectible._id) : (s.titles = s.titles.filter((Z) => Z.id != D.collectible._id), s.vouchers = s.vouchers.filter(
1086
+ (Z) => Z != D.collectible._id
1087
+ ));
1088
+ }
1089
+ }
1090
+ const z = O({});
1091
+ He(z, oe, { deep: !0 });
1092
+ const te = E(() => {
1093
+ var C, s;
1094
+ return (s = (C = h.storeOption) == null ? void 0 : C.company) == null ? void 0 : s.sstRegNo;
1095
+ }), me = E(() => {
1096
+ var C, s, k;
1097
+ return (k = (s = (C = h.storeOption) == null ? void 0 : C.inclusiveTaxes) == null ? void 0 : s[0]) != null && k.inclusive ? "Inclusive" : "Exclusive";
1098
+ }), V = E(() => {
1099
+ var C, s, k;
1100
+ return ot(
1101
+ Q.fullTax,
1102
+ st(t.value.taxes),
1103
+ t.value.price,
1104
+ Number(t.value.credit.normal),
1105
+ ((C = h.storeOption) == null ? void 0 : C.inclusiveTaxes) ?? [],
1106
+ (k = (s = h.storeOption) == null ? void 0 : s.company) != null && k.sstRegNo ? Q.taxSystem.map((D) => D.code) : []
1107
+ );
1108
+ }), xe = E(() => V.value.reduce(
1109
+ (s, k) => s.add(k.total),
1110
+ _t()
1111
+ ).toFormat()), fe = E(() => {
1112
+ var D;
1113
+ const C = nt(
1114
+ V.value,
1115
+ t.value.price,
1116
+ ((D = h.storeOption) == null ? void 0 : D.inclusiveTaxes) ?? []
1117
+ );
1118
+ t.value.priceWithTaxes = C;
1119
+ const s = Ct(C, !1), k = Number(s.replace(/[^\d.-]/g, ""));
1120
+ return Number.isNaN(k) ? 0 : k;
1121
+ });
1122
+ function Ve() {
1123
+ t.value.taxTotals = V.value, g("update", Xe.parse(ft(t.value)));
1124
+ }
1125
+ function j() {
1126
+ return pe.cloneDeep(Ke);
1127
+ }
1128
+ function Se(C, s) {
1129
+ o.value = C, C && s && (r.value = void 0, l.value = s.categories, t.value = s.bundle || j(), f.value.category = s.category, f.value.index = s.index, f.value.originalCategoryIndex = s.category, z.value = S.value.reduce((k, D, J) => (k[J] = !!D.selectedReward, k), {}));
1130
+ }
1131
+ return a({
1132
+ showSheet: Se,
1133
+ bundleImage: r,
1134
+ target: f,
1135
+ data: t
1136
+ }), (C, s) => {
1137
+ const k = v("FmSwitch"), D = v("FmHelperText"), J = v("FmTextField"), Z = v("FmSelect"), A = v("FmStepperField"), _e = v("FmMenuItem"), ke = v("FmTable"), Fe = v("FmButton"), ye = v("FmSideSheet");
1138
+ return m(), R(ye, {
1139
+ "max-width": 768,
1140
+ modelValue: e(o),
1141
+ "onUpdate:modelValue": s[21] || (s[21] = (ie) => ve(o) ? o.value = ie : null),
1142
+ header: e(f).index != -1 ? e(d)("connect.store.bundle.edit.title") : e(d)("connect.store.bundle.edit.create")
1143
+ }, {
1144
+ "side-sheet-footer": I(() => [
1145
+ n("div", Fo, [
1146
+ i(Fe, {
1147
+ label: e(f).index != -1 ? "Save" : "Add",
1148
+ onClick: Ve,
1149
+ disabled: e(y).length > 0,
1150
+ loading: e(Le)().isLoading
1151
+ }, null, 8, ["label", "disabled", "loading"]),
1152
+ i(Fe, {
1153
+ label: "Cancel",
1154
+ onClick: s[20] || (s[20] = (ie) => Se(!1)),
1155
+ variant: "tertiary"
1156
+ })
1157
+ ])
1158
+ ]),
1159
+ default: I(() => {
1160
+ var ie, Pe, Be, Ne, x, P, B, H, q, L;
1161
+ return [
1162
+ i(Je, { json: e(t) }, null, 8, ["json"]),
1163
+ e(t) ? (m(), T("div", po, [
1164
+ n("div", fo, [
1165
+ e(K.Config).getCountry().code == "MY" && ((ie = e(h).payoutAccount) == null ? void 0 : ie.status) == "APPROVED" && ((Pe = e(h).payoutAccount) != null && Pe.enable) ? (m(), R(k, {
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 = [], z.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(D, {
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", yo, F(e(d)("connect.store.bundle.edit.basicInformation")), 1),
1182
+ i(J, {
1183
+ label: e(d)("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
+ i(Z, {
1190
+ modelValue: e(f).category,
1191
+ "onUpdate:modelValue": s[2] || (s[2] = (_) => e(f).category = _),
1192
+ label: "Store Category",
1193
+ items: e(l).map((_, U) => ({ label: _, value: U }))
1194
+ }, null, 8, ["modelValue", "items"]),
1195
+ i(vt, {
1196
+ label: e(d)("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
+ i(A, {
1208
+ "model-value": e(K.Dinero).fromFdoDinero(e(t).price).toUnit(),
1209
+ label: e(d)("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(K.Dinero).fromNumber({ number: 1 }).toFormat(
1218
+ !0
1219
+ )} = ${e(K.Dinero).fromNumber({ number: 1 }).toUnit()} credit`,
1220
+ "helper-state": e(ae)(e(y), "price")
1221
+ }, {
1222
+ prepend: I(() => [
1223
+ le(F(e(K.Dinero).defaultCurrency()), 1)
1224
+ ]),
1225
+ _: 1
1226
+ }, 8, ["model-value", "label", "helper-text", "helper-state"]),
1227
+ i(A, {
1228
+ "model-value": e(K.Dinero).fromFdoDinero(e(t).originalPrice).toUnit(),
1229
+ label: e(d)("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(K.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(d)("connect.store.bundle.edit.originalPriceHelper"),
1238
+ "helper-state": e(ae)(e(y), "originalPrice")
1239
+ }, {
1240
+ prepend: I(() => [
1241
+ le(F(e(K.Dinero).defaultCurrency()), 1)
1242
+ ]),
1243
+ _: 1
1244
+ }, 8, ["model-value", "label", "helper-text", "helper-state"]),
1245
+ e(t).isFeedvibe ? M("", !0) : (m(), R(A, {
1246
+ key: 0,
1247
+ "model-value": e(t).coinPrice ?? null,
1248
+ label: e(d)("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
+ append: I(() => [...s[22] || (s[22] = [
1258
+ le(" point(s) ", -1)
1259
+ ])]),
1260
+ _: 1
1261
+ }, 8, ["model-value", "label", "helper-state", "helper-text"])),
1262
+ (Be = e(h).storeOption) != null && Be.stripe && !e(t).isFeedvibe ? (m(), T(W, { key: 1 }, [
1263
+ n("div", go, F(e(d)("connect.store.bundle.edit.subscriptionSettings")), 1),
1264
+ i(J, {
1265
+ label: e(d)("connect.store.bundle.edit.stripePriceId"),
1266
+ modelValue: e(t).stripePriceId,
1267
+ "onUpdate:modelValue": s[7] || (s[7] = (_) => e(t).stripePriceId = _),
1268
+ "helper-state": e(ae)(e(y), "stripePriceId"),
1269
+ "helper-text": e(se)(e(y), "stripePriceId")
1270
+ }, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
1271
+ e(t).stripePriceId ? (m(), R(A, {
1272
+ key: 0,
1273
+ "model-value": e(t).subscriptionValidity ?? null,
1274
+ min: 1,
1275
+ "onUpdate:modelValue": ue,
1276
+ label: e(d)("connect.store.bundle.edit.subscriptionValidity"),
1277
+ "show-steppers": !1,
1278
+ "helper-state": e(ae)(e(y), "subscriptionValidity"),
1279
+ "helper-text": e(se)(e(y), "subscriptionValidity")
1280
+ }, null, 8, ["model-value", "label", "helper-state", "helper-text"])) : M("", !0)
1281
+ ], 64)) : M("", !0),
1282
+ e(t).isFeedvibe ? M("", !0) : (m(), T(W, { key: 2 }, [
1283
+ n("div", bo, F(e(d)("connect.store.bundle.edit.credit")), 1),
1284
+ i(A, {
1285
+ modelValue: e(t).credit.normal,
1286
+ "onUpdate:modelValue": s[8] || (s[8] = (_) => e(t).credit.normal = _),
1287
+ label: e(d)("connect.store.bundle.edit.normalCredit"),
1288
+ "show-steppers": !1,
1289
+ "helper-state": e(ae)(e(y), "credit.normal"),
1290
+ "helper-text": e(se)(e(y), "credit.normal")
1291
+ }, {
1292
+ append: I(() => [...s[23] || (s[23] = [
1293
+ le(" credit ", -1)
1294
+ ])]),
1295
+ _: 1
1296
+ }, 8, ["modelValue", "label", "helper-state", "helper-text"]),
1297
+ i(A, {
1298
+ "model-value": ((Ne = e(t).credit.free) == null ? void 0 : Ne.amount) ?? null,
1299
+ min: 0,
1300
+ "onUpdate:modelValue": s[9] || (s[9] = (_) => {
1301
+ e(t).credit.free || (e(t).credit.free = {
1302
+ amount: 0,
1303
+ day: 1
1304
+ }), e(t).credit.free.amount = _;
1305
+ }),
1306
+ label: e(d)("connect.store.bundle.edit.freeCredit"),
1307
+ "show-steppers": !1,
1308
+ "helper-state": e(ae)(e(y), "credit.free.amount"),
1309
+ "helper-text": e(se)(e(y), "credit.free.amount")
1310
+ }, {
1311
+ append: I(() => [...s[24] || (s[24] = [
1312
+ le(" credit ", -1)
1313
+ ])]),
1314
+ _: 1
1315
+ }, 8, ["model-value", "label", "helper-state", "helper-text"]),
1316
+ (x = e(t).credit.free) != null && x.amount ? (m(), R(A, {
1317
+ key: 0,
1318
+ disabled: !!e(t).stripePriceId,
1319
+ "model-value": ((P = e(t).credit.free) == null ? void 0 : P.day) ?? null,
1320
+ min: 0,
1321
+ max: 9999,
1322
+ "onUpdate:modelValue": s[10] || (s[10] = (_) => {
1323
+ e(t).credit.free || (e(t).credit.free = {
1324
+ amount: 0,
1325
+ day: 1
1326
+ }), e(t).credit.free.day = e(N) || _;
1327
+ }),
1328
+ label: "Free credit valid for",
1329
+ "show-steppers": !1,
1330
+ "helper-state": e(ae)(e(y), "credit.free.day"),
1331
+ "helper-text": e(se)(e(y), "credit.free.day")
1332
+ }, {
1333
+ append: I(() => [...s[25] || (s[25] = [
1334
+ le(" day(s) ", -1)
1335
+ ])]),
1336
+ _: 1
1337
+ }, 8, ["disabled", "model-value", "helper-state", "helper-text"])) : M("", !0)
1338
+ ], 64)),
1339
+ e(te) ? (m(), T(W, { key: 3 }, [
1340
+ s[26] || (s[26] = n("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Taxes", -1)),
1341
+ i(mo, {
1342
+ modelValue: e(t).taxes,
1343
+ "onUpdate:modelValue": s[11] || (s[11] = (_) => e(t).taxes = _)
1344
+ }, null, 8, ["modelValue"]),
1345
+ i(J, {
1346
+ label: `Tax Charged (${e(me)})`,
1347
+ "model-value": e(xe),
1348
+ disabled: ""
1349
+ }, null, 8, ["label", "model-value"])
1350
+ ], 64)) : M("", !0),
1351
+ i(A, {
1352
+ label: "Total Price",
1353
+ "model-value": e(fe),
1354
+ disabled: !0
1355
+ }, null, 8, ["model-value"]),
1356
+ n("div", vo, F(e(d)("connect.store.bundle.edit.bundleReward.title")), 1),
1357
+ n("div", ho, F(e(d)("connect.store.bundle.edit.bundleReward.description")), 1),
1358
+ n("div", xo, [
1359
+ n("div", _o, [
1360
+ i(ht, {
1361
+ label: `Reward type: ${e(u).length == 0 ? "All" : e(u)[0].name}`
1362
+ }, {
1363
+ default: I(() => [
1364
+ i(_e, {
1365
+ onClick: s[12] || (s[12] = (_) => u.value = []),
1366
+ label: "All"
1367
+ }),
1368
+ i(_e, {
1369
+ onClick: s[13] || (s[13] = (_) => u.value = [
1370
+ {
1371
+ id: "type",
1372
+ value: "VOUCHER",
1373
+ name: e(Te).VOUCHER.name
1374
+ }
1375
+ ]),
1376
+ label: e(Te).VOUCHER.name
1377
+ }, null, 8, ["label"]),
1378
+ i(_e, {
1379
+ onClick: s[14] || (s[14] = (_) => u.value = [
1380
+ {
1381
+ id: "type",
1382
+ value: "TITLE",
1383
+ name: e(Te).TITLE.name
1384
+ }
1385
+ ]),
1386
+ label: e(Te).TITLE.name
1387
+ }, null, 8, ["label"])
1388
+ ]),
1389
+ _: 1
1390
+ }, 8, ["label"])
1391
+ ]),
1392
+ i(ke, {
1393
+ modelValue: e(z),
1394
+ "onUpdate:modelValue": s[15] || (s[15] = (_) => ve(z) ? z.value = _ : null),
1395
+ selection: "multiple",
1396
+ "column-filter": e(u),
1397
+ "column-defs": w,
1398
+ "row-data": e(S),
1399
+ "hide-footer": e(S).length <= 10
1400
+ }, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"]),
1401
+ i(D, {
1402
+ text: e(se)(e(y), "titles"),
1403
+ state: e(ae)(e(y), "titles")
1404
+ }, null, 8, ["text", "state"])
1405
+ ]),
1406
+ n("div", Co, F(e(d)("connect.store.bundle.edit.advanceSetting")), 1),
1407
+ n("div", So, [
1408
+ e(t).isFeedvibe ? M("", !0) : (m(), T(W, { key: 0 }, [
1409
+ i(k, {
1410
+ "model-value": e(t).internal ?? !1,
1411
+ "onUpdate:modelValue": s[16] || (s[16] = (_) => e(t).internal = _),
1412
+ "label-placement": "right",
1413
+ label: e(d)("connect.store.bundle.edit.internalBundle"),
1414
+ sublabel: e(d)("connect.store.bundle.edit.internalBundleDescription")
1415
+ }, null, 8, ["model-value", "label", "sublabel"]),
1416
+ i(k, {
1417
+ "model-value": e(t).hideInPos ?? !1,
1418
+ "onUpdate:modelValue": s[17] || (s[17] = (_) => e(t).hideInPos = _),
1419
+ "label-placement": "right",
1420
+ label: e(d)("connect.store.bundle.edit.hideInPos"),
1421
+ sublabel: e(d)("connect.store.bundle.edit.hideInPosDescription")
1422
+ }, null, 8, ["model-value", "label", "sublabel"])
1423
+ ], 64)),
1424
+ i(A, {
1425
+ "model-value": ((H = (B = e(t).config) == null ? void 0 : B.options) == null ? void 0 : H.maxPerUser) || null,
1426
+ "onUpdate:modelValue": s[18] || (s[18] = (_) => e(pe).set(e(t), "config.options.maxPerUser", _)),
1427
+ label: e(d)("connect.store.bundle.edit.maxPerUser"),
1428
+ "show-steppers": !1,
1429
+ placeholder: e(d)("connect.store.bundle.edit.unlimited")
1430
+ }, null, 8, ["model-value", "label", "placeholder"]),
1431
+ i(A, {
1432
+ "model-value": ((L = (q = e(t).config) == null ? void 0 : q.options) == null ? void 0 : L.maxReceive) || null,
1433
+ "onUpdate:modelValue": s[19] || (s[19] = (_) => e(pe).set(e(t), "config.options.maxReceive", _)),
1434
+ label: e(d)("connect.store.bundle.edit.maxReceive"),
1435
+ "show-steppers": !1,
1436
+ placeholder: e(d)("connect.store.bundle.edit.unlimited")
1437
+ }, null, 8, ["model-value", "label", "placeholder"])
1438
+ ])
1439
+ ])) : M("", !0)
1440
+ ];
1441
+ }),
1442
+ _: 1
1443
+ }, 8, ["modelValue", "header"]);
1444
+ };
1445
+ }
1446
+ }), $o = { class: "flex gap-8 items-center flex-wrap" }, ko = { class: "flex items-center gap-8" }, Po = /* @__PURE__ */ X({
1447
+ __name: "SendBundleSheet",
1448
+ emits: ["success"],
1449
+ setup(b, { expose: a, emit: c }) {
1450
+ const { minor: g } = et, d = O(), h = O(""), o = O(""), l = O([]), f = O(!1), t = O();
1451
+ O(!0);
1452
+ function r(S) {
1453
+ f.value = !0, h.value = null, o.value = "", d.value = S.bundle;
1454
+ }
1455
+ function p() {
1456
+ f.value = !1;
1457
+ }
1458
+ async function y(S) {
1459
+ const $ = await $t.read({
1460
+ limit: 25,
1461
+ skip: 0,
1462
+ sortBy: "_id",
1463
+ search: S,
1464
+ descending: !1
1465
+ });
1466
+ l.value = $.resources.map((N) => ({
1467
+ label: `${N.name} (${N.phoneNumber})`,
1468
+ value: N._id
1469
+ })), await new Promise((N) => setTimeout(N, 100));
1470
+ }
1471
+ async function w() {
1472
+ if (!d.value || !h.value) return;
1473
+ const S = l.value.find(
1474
+ (N) => N.value === h.value
1475
+ );
1476
+ await Ie.confirm(
1477
+ `Are you sure you want to send bundle ${d.value.name} to ${S == null ? void 0 : S.label}?`,
1478
+ "Confirm",
1479
+ "Confirm",
1480
+ "Cancel"
1481
+ ) && await g(
1482
+ async () => {
1483
+ const N = {
1484
+ bundle: d.value._id,
1485
+ member: h.value,
1486
+ source: mt.enum.ADMIN,
1487
+ ref: `ADMIN:${(/* @__PURE__ */ new Date()).toISOString()}:${o.value}`,
1488
+ withCoin: !1
1489
+ };
1490
+ await Ue.sendBundle(N), p();
1491
+ },
1492
+ {
1493
+ message: "Sending bundle",
1494
+ successMessage: "Bundle sent"
1495
+ }
1496
+ );
1497
+ }
1498
+ const u = E(() => {
1499
+ var $, N, ue;
1500
+ const S = [];
1501
+ return (($ = d.value) == null ? void 0 : $.price.amount) > 0 && S.push(
1502
+ `${K.Config.getCountry().currency.symbol}${tt((N = d.value) == null ? void 0 : N.price)}`
1503
+ ), (ue = d.value) != null && ue.coinPrice && S.push(`${d.value.coinPrice} point(s)`), S.join(" or ");
1504
+ });
1505
+ return a({
1506
+ showSheet: r,
1507
+ hideSheet: p
1508
+ }), De(async () => {
1509
+ await y("");
1510
+ }), (S, $) => {
1511
+ const N = v("FmCardMedia"), ue = v("FmCardHeader"), oe = v("FmChip"), z = v("FmCardSection"), te = v("FmCard"), me = v("FmSelect"), V = v("FmTextField"), xe = v("FmForm"), fe = v("FmButton"), Ve = v("FmSideSheet");
1512
+ return m(), R(Ve, {
1513
+ "max-width": 560,
1514
+ "dismiss-away": !0,
1515
+ header: "Send bundle to member",
1516
+ modelValue: e(f),
1517
+ "onUpdate:modelValue": [
1518
+ $[4] || ($[4] = (j) => ve(f) ? f.value = j : null),
1519
+ $[5] || ($[5] = (j) => f.value = j)
1520
+ ]
1521
+ }, {
1522
+ "side-sheet-footer": I(() => [
1523
+ n("div", ko, [
1524
+ i(fe, {
1525
+ label: "Send",
1526
+ loading: e(Le)().isLoading,
1527
+ onClick: $[2] || ($[2] = async () => {
1528
+ var j;
1529
+ return (j = e(t)) == null ? void 0 : j.validateInputs();
1530
+ })
1531
+ }, null, 8, ["loading"]),
1532
+ i(fe, {
1533
+ label: "Cancel",
1534
+ type: "button",
1535
+ variant: "tertiary",
1536
+ onClick: $[3] || ($[3] = (j) => f.value = !1)
1537
+ })
1538
+ ])
1539
+ ]),
1540
+ default: I(() => [
1541
+ i(xe, {
1542
+ class: "space-y-16",
1543
+ ref_key: "form",
1544
+ ref: t,
1545
+ onValidationSuccess: w,
1546
+ blameFormChildOnValidationFailed: ""
1547
+ }, {
1548
+ default: I(() => [
1549
+ i(te, {
1550
+ class: "max-w-[700px]",
1551
+ horizontal: "",
1552
+ variant: "outlined"
1553
+ }, {
1554
+ default: I(() => {
1555
+ var j, Se;
1556
+ return [
1557
+ (j = e(d)) != null && j.image ? (m(), R(N, {
1558
+ key: 0,
1559
+ width: "100",
1560
+ src: (Se = e(d)) == null ? void 0 : Se.image
1561
+ }, null, 8, ["src"])) : M("", !0),
1562
+ i(z, { class: "flex flex-col gap-16 justify-between" }, {
1563
+ default: I(() => {
1564
+ var C;
1565
+ return [
1566
+ i(ue, {
1567
+ class: "p-0",
1568
+ title: (C = e(d)) == null ? void 0 : C.name,
1569
+ subtitle: e(u)
1570
+ }, null, 8, ["title", "subtitle"]),
1571
+ i(z, { class: "p-0" }, {
1572
+ default: I(() => {
1573
+ var s, k, D, J, Z, A, _e, ke, Fe, ye, ie;
1574
+ return [
1575
+ n("div", $o, [
1576
+ (s = e(d)) != null && s.isFeedvibe ? (m(), R(oe, {
1577
+ key: 0,
1578
+ label: "Feedvibe"
1579
+ })) : M("", !0),
1580
+ (D = (k = e(d)) == null ? void 0 : k.titles) != null && D.length ? (m(), R(oe, {
1581
+ key: 1,
1582
+ label: `${e(d).titles.length} title(s)`
1583
+ }, null, 8, ["label"])) : M("", !0),
1584
+ (Z = (J = e(d)) == null ? void 0 : J.vouchers) != null && Z.length ? (m(), R(oe, {
1585
+ key: 2,
1586
+ label: `${e(d).vouchers.length} voucher(s)`
1587
+ }, null, 8, ["label"])) : M("", !0),
1588
+ (_e = (A = e(d)) == null ? void 0 : A.credit) != null && _e.normal || (ye = (Fe = (ke = e(d)) == null ? void 0 : ke.credit) == null ? void 0 : Fe.free) != null && ye.amount ? (m(), R(oe, {
1589
+ key: 3,
1590
+ label: `${(e(d).credit.normal || 0) + (((ie = e(d).credit.free) == null ? void 0 : ie.amount) || 0)} credit(s)`
1591
+ }, null, 8, ["label"])) : M("", !0)
1592
+ ])
1593
+ ];
1594
+ }),
1595
+ _: 1
1596
+ })
1597
+ ];
1598
+ }),
1599
+ _: 1
1600
+ })
1601
+ ];
1602
+ }),
1603
+ _: 1
1604
+ }),
1605
+ i(me, {
1606
+ modelValue: e(h),
1607
+ "onUpdate:modelValue": $[0] || ($[0] = (j) => ve(h) ? h.value = j : null),
1608
+ label: "Select member",
1609
+ searchable: "",
1610
+ items: e(l),
1611
+ onSearch: y,
1612
+ rules: [(j) => !!j > 0 || "Member is required"],
1613
+ "helper-text": "Type to search member"
1614
+ }, null, 8, ["modelValue", "items", "rules"]),
1615
+ i(V, {
1616
+ modelValue: e(o),
1617
+ "onUpdate:modelValue": $[1] || ($[1] = (j) => ve(o) ? o.value = j : null),
1618
+ label: "Reference (optional)",
1619
+ rules: [
1620
+ (j) => j.length < 50 || "Reference must be less than 50 characters"
1621
+ ]
1622
+ }, null, 8, ["modelValue", "rules"])
1623
+ ]),
1624
+ _: 1
1625
+ }, 512)
1626
+ ]),
1627
+ _: 1
1628
+ }, 8, ["modelValue"]);
1629
+ };
1630
+ }
1631
+ }), Vo = { class: "flex items-center gap-8" }, To = { class: "flex-shrink-0 -mr-8 -mt-8" }, Ro = ["title"], Io = ["src"], Uo = { class: "relative flex items-center gap-6 min-w-0" }, Eo = { class: "fm-typo-en-body-sm-600 tracking-[0.08em] truncate" }, Do = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Bo = {
1632
+ key: 0,
1633
+ class: "flex items-center gap-6"
1634
+ }, No = "linear-gradient(135deg,#FF9455,#B25300)", Mo = /* @__PURE__ */ X({
1635
+ __name: "GiftCardProgramCard",
1636
+ props: {
1637
+ program: {},
1638
+ disabled: { type: Boolean }
1639
+ },
1640
+ emits: ["edit", "setLive", "deactivate"],
1641
+ setup(b, { emit: a }) {
1642
+ const c = b, g = a, d = E(() => pt(c.program)), h = E(() => {
1643
+ const { denominations: f, anyAmount: t } = d.value, r = [], p = [
1644
+ ...f,
1645
+ ...t ? [t.min, t.max] : []
1646
+ ];
1647
+ if (p.length) {
1648
+ const y = Math.min(...p), w = Math.max(...p);
1649
+ r.push(y === w ? `RM${y}` : `RM${y}–RM${w}`);
1650
+ }
1651
+ return t && r.push("Any amount"), r.join(" · ");
1652
+ }), o = E(() => {
1653
+ var f;
1654
+ return ((f = c.program.designs) == null ? void 0 : f[0]) ?? null;
1655
+ }), l = E(() => {
1656
+ const f = c.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));
1657
+ return `${t}${"•".repeat(r)}`;
1658
+ });
1659
+ return (f, t) => {
1660
+ const r = v("FmChip"), p = v("FmButton"), y = v("FmMenuItem"), w = v("FmMenu"), u = v("FmIcon"), S = v("FmCard");
1661
+ return m(), R(S, {
1662
+ variant: "outlined",
1663
+ class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px]"
1664
+ }, {
1665
+ default: I(() => [
1666
+ n("div", Vo, [
1667
+ i(r, {
1668
+ label: "Gift card",
1669
+ variant: "neutral",
1670
+ compact: ""
1671
+ }),
1672
+ i(r, {
1673
+ label: b.program.active ? "Live" : "Inactive",
1674
+ variant: b.program.active ? "success" : "neutral",
1675
+ compact: ""
1676
+ }, null, 8, ["label", "variant"]),
1677
+ t[4] || (t[4] = n("div", { class: "flex-1" }, null, -1)),
1678
+ n("div", To, [
1679
+ i(w, { placement: "bottom-end" }, {
1680
+ "menu-button": I(() => [
1681
+ i(p, {
1682
+ icon: "more_vert",
1683
+ variant: "tertiary"
1684
+ })
1685
+ ]),
1686
+ default: I(() => [
1687
+ i(y, {
1688
+ onClick: t[0] || (t[0] = ($) => g("edit")),
1689
+ icon: "edit",
1690
+ label: "Edit"
1691
+ }),
1692
+ b.program.active ? (m(), R(y, {
1693
+ key: 1,
1694
+ onClick: t[2] || (t[2] = ($) => g("deactivate")),
1695
+ icon: "pause_circle",
1696
+ label: "Set inactive"
1697
+ })) : (m(), R(y, {
1698
+ key: 0,
1699
+ onClick: t[1] || (t[1] = ($) => g("setLive")),
1700
+ icon: "check_circle",
1701
+ label: "Set live"
1702
+ }))
1703
+ ]),
1704
+ _: 1
1705
+ })
1706
+ ])
1707
+ ]),
1708
+ n("div", {
1709
+ class: "fm-typo-en-body-lg-600 truncate",
1710
+ title: b.program.name
1711
+ }, F(b.program.name), 9, Ro),
1712
+ n("div", {
1713
+ class: "relative h-[120px] aspect-[1.586/1] mx-auto rounded-md overflow-hidden flex flex-col p-8 text-fm-color-typo-white",
1714
+ style: Qe({ background: No })
1715
+ }, [
1716
+ e(o) ? (m(), T("img", {
1717
+ key: 0,
1718
+ src: e(o),
1719
+ alt: "",
1720
+ class: "absolute inset-0 w-full h-full object-cover"
1721
+ }, null, 8, Io)) : M("", !0),
1722
+ t[6] || (t[6] = n("div", { class: "relative flex items-start justify-between gap-4" }, [
1723
+ n("span", { class: "fm-typo-en-body-sm-600" }, "FeedMe"),
1724
+ n("span", { class: "fm-typo-en-body-sm-600 uppercase tracking-[0.1em] opacity-90 whitespace-nowrap" }, " Gift Card ")
1725
+ ], -1)),
1726
+ t[7] || (t[7] = n("div", { class: "flex-1" }, null, -1)),
1727
+ n("div", Uo, [
1728
+ 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)),
1729
+ n("span", Eo, F(e(l)), 1)
1730
+ ])
1731
+ ], 4),
1732
+ n("div", Do, F(e(h)), 1),
1733
+ t[9] || (t[9] = n("div", { class: "flex-1" }, null, -1)),
1734
+ b.program.active ? (m(), T("div", Bo, [
1735
+ i(u, {
1736
+ name: "check",
1737
+ size: "sm",
1738
+ class: "text-fm-color-system-success-400"
1739
+ }),
1740
+ t[8] || (t[8] = n("span", { class: "fm-typo-en-body-sm-600 text-fm-color-system-success-400" }, " Live to customers ", -1))
1741
+ ])) : (m(), R(p, {
1742
+ key: 1,
1743
+ label: "Set live",
1744
+ variant: "secondary",
1745
+ size: "md",
1746
+ disabled: b.disabled,
1747
+ onClick: t[3] || (t[3] = ($) => g("setLive"))
1748
+ }, null, 8, ["disabled"]))
1749
+ ]),
1750
+ _: 1
1751
+ });
1752
+ };
1753
+ }
1754
+ }), Oo = { class: "rounded-lg border-1 border-fm-color-primary p-24 flex flex-col gap-16" }, Lo = { class: "flex items-start gap-16" }, Ao = { class: "w-40 h-40 rounded-md flex-none grid place-items-center bg-fm-color-primary" }, jo = { class: "flex flex-col gap-4" }, qo = { class: "fm-typo-en-body-lg-600" }, Go = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ko = { class: "rounded-md border-1 border-fm-color-neutral-gray-200" }, Ho = { class: "flex-1 min-w-0" }, zo = { class: "fm-typo-en-body-md-600" }, Wo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yo = /* @__PURE__ */ X({
1755
+ __name: "StoreOnboarding",
1756
+ props: {
1757
+ settingStatus: {},
1758
+ payoutStatus: {},
1759
+ requiresPayout: { type: Boolean, default: !0 }
1760
+ },
1761
+ emits: ["setupStoreSetting", "setupPayout"],
1762
+ setup(b, { emit: a }) {
1763
+ const { t: c } = he(), g = b, d = a, h = E(() => [
1764
+ {
1765
+ key: "payout",
1766
+ title: c("connect.store.onboarding.payoutTitle"),
1767
+ description: c("connect.store.onboarding.payoutDescription"),
1768
+ status: g.payoutStatus,
1769
+ action: "setupPayout"
1770
+ },
1771
+ {
1772
+ key: "setting",
1773
+ title: c("connect.store.onboarding.settingTitle"),
1774
+ description: c("connect.store.onboarding.settingDescription"),
1775
+ status: g.settingStatus,
1776
+ action: "setupStoreSetting"
1777
+ }
1778
+ ].filter((l) => l.key !== "payout" || g.requiresPayout));
1779
+ return (o, l) => {
1780
+ const f = v("FmIcon"), t = v("FmChip"), r = v("FmButton");
1781
+ return m(), T("div", Oo, [
1782
+ n("div", Lo, [
1783
+ n("span", Ao, [
1784
+ i(f, {
1785
+ name: "warning",
1786
+ class: "text-fm-color-typo-white"
1787
+ })
1788
+ ]),
1789
+ n("div", jo, [
1790
+ n("div", qo, F(e(c)("connect.store.onboarding.title")), 1),
1791
+ n("div", Go, F(e(c)("connect.store.onboarding.description")), 1)
1792
+ ])
1793
+ ]),
1794
+ n("div", Ko, [
1795
+ (m(!0), T(W, null, de(e(h), (p, y) => (m(), T("div", {
1796
+ key: p.key,
1797
+ class: $e(["flex items-center gap-16 p-16", y > 0 ? "border-t-1 border-fm-color-neutral-gray-200" : ""])
1798
+ }, [
1799
+ n("span", {
1800
+ class: $e([
1801
+ "w-24 h-24 rounded-sm flex-none grid place-items-center fm-typo-en-body-sm-600",
1802
+ p.status === "COMPLETE" ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-primary-oats text-fm-color-primary"
1803
+ ])
1804
+ }, [
1805
+ p.status === "COMPLETE" ? (m(), R(f, {
1806
+ key: 0,
1807
+ name: "check",
1808
+ size: "sm"
1809
+ })) : (m(), T(W, { key: 1 }, [
1810
+ le(F(y + 1), 1)
1811
+ ], 64))
1812
+ ], 2),
1813
+ n("div", Ho, [
1814
+ n("div", zo, F(p.title), 1),
1815
+ n("div", Wo, F(p.description), 1)
1816
+ ]),
1817
+ i(t, {
1818
+ label: e(c)(
1819
+ p.status === "COMPLETE" ? "connect.store.onboarding.complete" : p.status === "PENDING" ? "connect.store.onboarding.pendingApproval" : "connect.store.onboarding.incomplete"
1820
+ ),
1821
+ variant: "plain",
1822
+ class: $e(
1823
+ 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"
1824
+ ),
1825
+ compact: ""
1826
+ }, null, 8, ["label", "class"]),
1827
+ p.status !== "COMPLETE" ? (m(), R(r, {
1828
+ key: 0,
1829
+ class: "flex-none",
1830
+ label: e(c)(
1831
+ p.status === "PENDING" ? "connect.store.onboarding.editDetails" : "connect.store.onboarding.setupNow"
1832
+ ),
1833
+ variant: "primary",
1834
+ onClick: (w) => p.action === "setupPayout" ? d("setupPayout") : d("setupStoreSetting")
1835
+ }, null, 8, ["label", "onClick"])) : M("", !0)
1836
+ ], 2))), 128))
1837
+ ])
1838
+ ]);
1839
+ };
1840
+ }
1841
+ }), Jo = { class: "rounded-lg bg-fm-color-system-success-100 p-16 flex items-start gap-16" }, Xo = { class: "w-40 h-40 rounded-md flex-none grid place-items-center bg-fm-color-system-success-400" }, Zo = { class: "flex-1 flex flex-col gap-4" }, Qo = { class: "fm-typo-en-body-lg-600" }, en = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, tn = /* @__PURE__ */ X({
1842
+ __name: "StoreAllSet",
1843
+ emits: ["dismiss"],
1844
+ setup(b, { emit: a }) {
1845
+ const { t: c } = he(), g = a;
1846
+ return (d, h) => {
1847
+ const o = v("FmIcon"), l = v("FmButton");
1848
+ return m(), T("div", Jo, [
1849
+ n("span", Xo, [
1850
+ i(o, {
1851
+ name: "check_circle",
1852
+ class: "text-fm-color-typo-white"
1853
+ })
1854
+ ]),
1855
+ n("div", Zo, [
1856
+ n("div", Qo, F(e(c)("connect.store.allSet.title")), 1),
1857
+ n("div", en, F(e(c)("connect.store.allSet.description")), 1)
1858
+ ]),
1859
+ i(l, {
1860
+ class: "flex-none",
1861
+ icon: "close",
1862
+ size: "md",
1863
+ variant: "tertiary",
1864
+ onClick: h[0] || (h[0] = (f) => g("dismiss"))
1865
+ })
1866
+ ]);
1867
+ };
1868
+ }
1869
+ }), on = { class: "space-y-16" }, nn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, an = { class: "space-y-8" }, sn = { class: "h-8 rounded-full bg-fm-color-neutral-gray-200 overflow-hidden" }, ln = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, rn = { class: "space-y-8" }, cn = { class: "flex-1 min-w-0" }, dn = { class: "fm-typo-en-body-md-600" }, un = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, mn = { class: "flex items-center justify-end gap-8 pb-16" }, pn = /* @__PURE__ */ X({
1870
+ __name: "StoreSetupDialog",
1871
+ props: {
1872
+ settingStatus: {},
1873
+ payoutStatus: {},
1874
+ requiresPayout: { type: Boolean, default: !0 }
1875
+ },
1876
+ setup(b) {
1877
+ const { t: a } = he(), c = b, g = ze(), { emitData: d, emitAction: h } = We(), o = E(() => [
1878
+ {
1879
+ key: "payout",
1880
+ title: a("connect.store.onboarding.payoutTitle"),
1881
+ description: a("connect.store.onboarding.payoutDescription"),
1882
+ status: c.payoutStatus,
1883
+ action: "setupPayout",
1884
+ actionLabel: a(
1885
+ c.payoutStatus === "PENDING" ? "connect.store.onboarding.editDetails" : "connect.store.onboarding.payoutAction"
1886
+ )
1887
+ },
1888
+ {
1889
+ key: "setting",
1890
+ title: a("connect.store.onboarding.settingTitle"),
1891
+ description: a("connect.store.onboarding.settingDescription"),
1892
+ status: c.settingStatus,
1893
+ action: "setupStoreSetting",
1894
+ actionLabel: a("connect.store.onboarding.settingTitle")
1895
+ }
1896
+ ].filter((p) => p.key !== "payout" || c.requiresPayout)), l = E(
1897
+ () => o.value.filter((r) => r.status === "COMPLETE").length
1898
+ ), f = E(
1899
+ () => o.value.find((r) => r.status !== "COMPLETE")
1900
+ );
1901
+ function t() {
1902
+ f.value && (d(f.value.action), h("primary"), g.close());
1903
+ }
1904
+ return (r, p) => {
1905
+ const y = v("FmIcon"), w = v("FmChip"), u = v("FmButton");
1906
+ return m(), T("div", on, [
1907
+ n("div", nn, F(e(a)("connect.store.setupDialog.description")), 1),
1908
+ n("div", an, [
1909
+ n("div", sn, [
1910
+ n("div", {
1911
+ class: "h-full rounded-full bg-fm-color-primary transition-all",
1912
+ style: Qe({ width: `${e(l) / e(o).length * 100}%` })
1913
+ }, null, 4)
1914
+ ]),
1915
+ n("div", ln, F(e(a)("connect.store.setupDialog.progress", {
1916
+ done: e(l),
1917
+ total: e(o).length
1918
+ })), 1)
1919
+ ]),
1920
+ n("div", rn, [
1921
+ (m(!0), T(W, null, de(e(o), (S, $) => {
1922
+ var N;
1923
+ return m(), T("div", {
1924
+ key: S.key,
1925
+ class: $e([
1926
+ "rounded-md border-1 p-16 flex items-center gap-16",
1927
+ S.key === ((N = e(f)) == null ? void 0 : N.key) ? "border-fm-color-primary" : "border-fm-color-neutral-gray-200"
1928
+ ])
1929
+ }, [
1930
+ n("span", {
1931
+ class: $e([
1932
+ "w-24 h-24 rounded-sm flex-none grid place-items-center fm-typo-en-body-sm-600",
1933
+ S.status === "COMPLETE" ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-primary-oats text-fm-color-primary"
1934
+ ])
1935
+ }, [
1936
+ S.status === "COMPLETE" ? (m(), R(y, {
1937
+ key: 0,
1938
+ name: "check",
1939
+ size: "sm"
1940
+ })) : (m(), T(W, { key: 1 }, [
1941
+ le(F($ + 1), 1)
1942
+ ], 64))
1943
+ ], 2),
1944
+ n("div", cn, [
1945
+ n("div", dn, F(S.title), 1),
1946
+ n("div", un, F(S.description), 1)
1947
+ ]),
1948
+ i(w, {
1949
+ label: e(a)(
1950
+ S.status === "COMPLETE" ? "connect.store.onboarding.complete" : S.status === "PENDING" ? "connect.store.onboarding.pendingApproval" : "connect.store.onboarding.incomplete"
1951
+ ),
1952
+ variant: "plain",
1953
+ class: $e(
1954
+ S.status === "COMPLETE" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100"
1955
+ ),
1956
+ compact: ""
1957
+ }, null, 8, ["label", "class"])
1958
+ ], 2);
1959
+ }), 128))
1960
+ ]),
1961
+ n("div", mn, [
1962
+ i(u, {
1963
+ label: e(a)("connect.common.cancel"),
1964
+ variant: "tertiary",
1965
+ onClick: p[0] || (p[0] = (S) => e(g).close())
1966
+ }, null, 8, ["label"]),
1967
+ e(f) ? (m(), R(u, {
1968
+ key: 0,
1969
+ label: e(f).actionLabel,
1970
+ variant: "primary",
1971
+ onClick: t
1972
+ }, null, 8, ["label"])) : M("", !0)
1973
+ ])
1974
+ ]);
1975
+ };
1976
+ }
1977
+ });
1978
+ function fn(b, a, c = !0) {
1979
+ const g = (a == null ? void 0 : a.status) === "APPROVED" && a.enable ? "COMPLETE" : (a == null ? void 0 : a.status) === "PENDING" ? "PENDING" : "INCOMPLETE", d = c;
1980
+ return {
1981
+ settingStatus: b ? "COMPLETE" : "INCOMPLETE",
1982
+ payoutStatus: g,
1983
+ requiresPayout: d,
1984
+ complete: b && (!d || g === "COMPLETE")
1985
+ };
1986
+ }
1987
+ const yn = { class: "grid lg:grid-cols-2 gap-32 items-center" }, gn = { class: "flex flex-col gap-16" }, bn = { class: "flex flex-col gap-8" }, vn = { class: "fm-typo-en-title-md-800" }, hn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary max-w-[460px]" }, xn = { class: "flex flex-col gap-16" }, _n = { class: "w-40 h-40 rounded-md flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary" }, Cn = { class: "flex flex-col gap-2" }, Sn = { class: "fm-typo-en-body-md-600" }, Fn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wn = { class: "flex items-center gap-16 pt-8" }, $n = { class: "relative rounded-lg overflow-hidden aspect-[4/3] flex items-end justify-center bg-gradient-to-br from-[#FFF3E6] to-[#FDE6D0]" }, kn = { class: "absolute inset-0 grid place-items-center" }, Pn = { class: "relative w-[68%] max-w-[320px]" }, Vn = { 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]" }, Tn = { class: "flex flex-col" }, Rn = { class: "fm-typo-en-body-sm-400 uppercase tracking-[0.12em] opacity-90" }, In = /* @__PURE__ */ X({
1988
+ __name: "GiftCardUpsell",
1989
+ props: {
1990
+ premium: { type: Boolean }
1991
+ },
1992
+ emits: ["upgrade", "comparePlans", "create"],
1993
+ setup(b, { emit: a }) {
1994
+ const { t: c } = he(), g = a, d = [
1995
+ {
1996
+ icon: "send",
1997
+ title: "connect.store.giftCard.benefitGiftTitle",
1998
+ description: "connect.store.giftCard.benefitGiftDescription"
1999
+ },
2000
+ {
2001
+ icon: "bar_chart",
2002
+ title: "connect.store.giftCard.benefitSalesTitle",
2003
+ description: "connect.store.giftCard.benefitSalesDescription"
2004
+ },
2005
+ {
2006
+ icon: "favorite",
2007
+ title: "connect.store.giftCard.benefitLoyaltyTitle",
2008
+ description: "connect.store.giftCard.benefitLoyaltyDescription"
2009
+ }
2010
+ ];
2011
+ return (h, o) => {
2012
+ const l = v("FmIcon"), f = v("FmButton"), t = v("FmCard");
2013
+ return m(), R(t, {
2014
+ variant: "outlined",
2015
+ class: "p-24"
2016
+ }, {
2017
+ default: I(() => [
2018
+ n("div", yn, [
2019
+ n("div", gn, [
2020
+ n("span", {
2021
+ class: $e([
2022
+ "self-start inline-flex items-center gap-4 px-8 py-4 rounded-sm fm-typo-en-body-sm-600 tracking-[0.05em]",
2023
+ b.premium ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-secondary-blueberry text-fm-color-typo-white uppercase"
2024
+ ])
2025
+ }, [
2026
+ i(l, {
2027
+ name: b.premium ? "check" : "stars",
2028
+ size: "sm"
2029
+ }, null, 8, ["name"]),
2030
+ le(" " + F(b.premium ? e(c)("connect.store.giftCard.includedInPlan") : e(c)("connect.store.giftCard.premium")), 1)
2031
+ ], 2),
2032
+ n("div", bn, [
2033
+ n("div", vn, F(e(c)("connect.store.giftCard.upsellTitle")), 1),
2034
+ n("div", hn, F(e(c)("connect.store.giftCard.upsellDescription")), 1)
2035
+ ]),
2036
+ n("div", xn, [
2037
+ (m(), T(W, null, de(d, (r) => n("div", {
2038
+ key: r.icon,
2039
+ class: "flex items-start gap-12"
2040
+ }, [
2041
+ n("span", _n, [
2042
+ i(l, {
2043
+ name: r.icon
2044
+ }, null, 8, ["name"])
2045
+ ]),
2046
+ n("div", Cn, [
2047
+ n("div", Sn, F(e(c)(r.title)), 1),
2048
+ n("div", Fn, F(e(c)(r.description)), 1)
2049
+ ])
2050
+ ])), 64))
2051
+ ]),
2052
+ n("div", wn, [
2053
+ b.premium ? (m(), R(f, {
2054
+ key: 0,
2055
+ label: e(c)("connect.store.giftCard.createGiftCard"),
2056
+ variant: "primary",
2057
+ icon: "add",
2058
+ onClick: o[0] || (o[0] = (r) => g("create"))
2059
+ }, null, 8, ["label"])) : (m(), T(W, { key: 1 }, [
2060
+ i(f, {
2061
+ label: e(c)("connect.store.giftCard.upgrade"),
2062
+ variant: "primary",
2063
+ onClick: o[1] || (o[1] = (r) => g("upgrade"))
2064
+ }, null, 8, ["label"]),
2065
+ n("button", {
2066
+ type: "button",
2067
+ class: "inline-flex items-center gap-4 fm-typo-en-body-md-600 text-fm-color-typo-primary",
2068
+ onClick: o[2] || (o[2] = (r) => g("comparePlans"))
2069
+ }, [
2070
+ le(F(e(c)("connect.store.giftCard.comparePlans")) + " ", 1),
2071
+ i(l, {
2072
+ name: "chevron_right",
2073
+ size: "sm"
2074
+ })
2075
+ ])
2076
+ ], 64))
2077
+ ])
2078
+ ]),
2079
+ n("div", $n, [
2080
+ n("div", kn, [
2081
+ n("div", Pn, [
2082
+ 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)),
2083
+ n("div", Vn, [
2084
+ o[5] || (o[5] = n("span", { class: "fm-typo-en-body-md-600" }, "FeedMe", -1)),
2085
+ n("div", Tn, [
2086
+ n("span", Rn, F(e(c)("connect.store.giftCard.giftCardLabel")), 1),
2087
+ o[4] || (o[4] = n("span", { class: "fm-typo-en-title-md-800" }, "RM100", -1))
2088
+ ])
2089
+ ])
2090
+ ])
2091
+ ]),
2092
+ b.premium ? M("", !0) : (m(), T("button", {
2093
+ key: 0,
2094
+ type: "button",
2095
+ 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",
2096
+ onClick: o[3] || (o[3] = (r) => g("upgrade"))
2097
+ }, [
2098
+ i(l, {
2099
+ name: "lock",
2100
+ size: "sm"
2101
+ }),
2102
+ le(" " + F(e(c)("connect.store.giftCard.unlockNow")), 1)
2103
+ ]))
2104
+ ])
2105
+ ])
2106
+ ]),
2107
+ _: 1
2108
+ });
2109
+ };
2110
+ }
2111
+ });
2112
+ var Ze = { 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/" };
2113
+ const Un = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary max-w-[640px]" }, En = { class: "px-24 flex flex-col gap-y-16" }, Dn = { class: "space-y-8 py-12" }, Bn = { class: "flex gap-8 items-center" }, Nn = { class: "fm-typo-en-body-lg-600" }, Mn = {
2114
+ key: 1,
2115
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
2116
+ }, On = {
2117
+ key: 1,
2118
+ class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24"
2119
+ }, Ln = { class: "flex gap-8 items-center" }, An = { class: "fm-typo-en-body-lg-600" }, jn = { class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24" }, qn = { class: "flex flex-col gap-16 text-center" }, Gn = { class: "fm-typo-en-title-sm-800" }, Kn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ka = /* @__PURE__ */ X({
2120
+ __name: "Store",
2121
+ setup(b) {
2122
+ const { t: a } = he(), c = {
2123
+ label: a("connect.store.actions.setting"),
2124
+ value: "setting",
2125
+ isPrimary: !1
2126
+ }, g = {
2127
+ label: a("connect.store.actions.manageReward"),
2128
+ value: "create_reward"
2129
+ }, d = {
2130
+ label: a("connect.store.actions.addCategory"),
2131
+ value: "create_category",
2132
+ isPrimary: !0,
2133
+ prependIcon: "add"
2134
+ }, h = O(), o = Pt(), l = Ye(), { global: f, minor: t } = et, r = ze(), p = E(() => l.sortedStoreCategories), y = E(() => l.sortedStoreCategories.map((x) => x.name)), w = O(), u = O(), S = kt(), $ = O([]), N = E(() => S.isPremium), ue = E(() => {
2135
+ var x;
2136
+ return !!((x = l.storeOption) != null && x.company);
2137
+ }), oe = O(!1), z = E(
2138
+ () => fn(
2139
+ ue.value,
2140
+ l.payoutAccount,
2141
+ !oe.value || N.value
2142
+ )
2143
+ ), te = E(() => !z.value.complete), me = O(!1);
2144
+ function V() {
2145
+ return `connect.store.allSetDismissed.${Ge.getBusinessId()}`;
2146
+ }
2147
+ function xe() {
2148
+ try {
2149
+ return localStorage.getItem(V()) === "1";
2150
+ } catch {
2151
+ return !1;
2152
+ }
2153
+ }
2154
+ function fe() {
2155
+ me.value = !0;
2156
+ try {
2157
+ localStorage.setItem(V(), "1");
2158
+ } catch {
2159
+ }
2160
+ }
2161
+ const Ve = {
2162
+ name: Oe["$connect-TRANSACTION"],
2163
+ query: { tab: "store" }
2164
+ };
2165
+ function j() {
2166
+ window.open(
2167
+ `${Ze.licensePortalUrl}business/${Ge.businessId}/settings`,
2168
+ "_blank"
2169
+ );
2170
+ }
2171
+ function Se() {
2172
+ window.open("https://feedme.ai/pricing", "_blank", "noopener");
2173
+ }
2174
+ async function C() {
2175
+ if (N.value)
2176
+ try {
2177
+ $.value = await qe.readPrograms();
2178
+ } catch {
2179
+ $.value = [];
2180
+ }
2181
+ }
2182
+ function s() {
2183
+ o.push({ name: Oe["$connect-STORE_GIFT_CARD_SETUP"] });
2184
+ }
2185
+ function k(x) {
2186
+ o.push({
2187
+ name: Oe["$connect-STORE_GIFT_CARD_SETUP"],
2188
+ params: { id: String(x._id) }
2189
+ });
2190
+ }
2191
+ async function D(x) {
2192
+ await Ie.confirm(
2193
+ `Set "${x.name}" live? Only one gift card can be live at a time, so any other will be set inactive.`,
2194
+ "Set live",
2195
+ "Set live",
2196
+ "Cancel"
2197
+ ) && await t(
2198
+ async () => {
2199
+ await qe.activateProgram(String(x._id)), await C();
2200
+ },
2201
+ { message: "Setting live", successMessage: "Gift card is live" }
2202
+ );
2203
+ }
2204
+ async function J(x) {
2205
+ await t(
2206
+ async () => {
2207
+ await qe.deactivateProgram(String(x._id)), await C();
2208
+ },
2209
+ { message: "Updating gift card", successMessage: "Gift card set inactive" }
2210
+ );
2211
+ }
2212
+ function Z() {
2213
+ r.open({
2214
+ title: a("connect.store.setupDialog.title"),
2215
+ contentComponent: pn,
2216
+ contentComponentProps: {
2217
+ settingStatus: z.value.settingStatus,
2218
+ payoutStatus: z.value.payoutStatus,
2219
+ requiresPayout: z.value.requiresPayout
2220
+ }
2221
+ }).onPrimary((x) => {
2222
+ A(x === "setupPayout" ? "payout" : "setting");
2223
+ });
2224
+ }
2225
+ async function A(x) {
2226
+ var P;
2227
+ x === "setting" ? (P = w.value) == null || P.showSheet(!0, l.storeOption) : x === "create_category" ? ye(-1) : x === "create_reward" ? await o.push({ name: Oe["$connect-STORE_REWARDS"] }) : x == "payout" && window.open(Ze.paymentPortalUrl, "_blank");
2228
+ }
2229
+ function _e(x, P) {
2230
+ var _;
2231
+ const B = !!((_ = P.company) != null && _.sstRegNo), H = P.inclusiveTaxes ?? [], q = Q.taxSystem.map((U) => U.code), L = B ? H.flatMap((U) => {
2232
+ console.log(U, "inclusive tax");
2233
+ const G = Q.systemDefaultCode(U.systemCode);
2234
+ return G ? [{ systemCode: U.systemCode, taxCode: G.taxCode }] : [];
2235
+ }) : [];
2236
+ return console.log([
2237
+ ["hasSstRegNo", B],
2238
+ ["defaultTaxCodes", L],
2239
+ ["inclusiveTaxes", H],
2240
+ ["taxSystemCodes", q]
2241
+ ]), x.map((U) => ({
2242
+ ...U,
2243
+ bundles: U.bundles.map((G) => {
2244
+ const { pf_vouchers: ee, ...Y } = G;
2245
+ if (!B)
2246
+ return {
2247
+ ...Y,
2248
+ taxes: [],
2249
+ taxTotals: [],
2250
+ priceWithTaxes: { ...Y.price }
2251
+ };
2252
+ const ne = L, we = ot(
2253
+ Q.fullTax,
2254
+ ne,
2255
+ Y.price,
2256
+ Number(Y.credit.normal),
2257
+ H,
2258
+ q
2259
+ );
2260
+ return {
2261
+ ...Y,
2262
+ taxes: ne,
2263
+ taxTotals: we,
2264
+ priceWithTaxes: nt(
2265
+ we,
2266
+ Y.price,
2267
+ H
2268
+ )
2269
+ };
2270
+ })
2271
+ }));
2272
+ }
2273
+ async function ke(x, P, B) {
2274
+ const H = !B && !!P, q = !!B && !P;
2275
+ let L;
2276
+ if (H) {
2277
+ const U = Q.taxSystem[0] ? Q.systemDefaultCode(Q.taxSystem[0].code) : void 0, G = U ? `${U.name} (${U.taxCode})` : a("connect.store.taxPropagation.defaultTax");
2278
+ L = a("connect.store.taxPropagation.addConfirm", {
2279
+ taxCode: G
2280
+ });
2281
+ } else q ? L = a("connect.store.taxPropagation.removeConfirm") : L = a("connect.store.taxPropagation.updateConfirm");
2282
+ await Ie.confirm(
2283
+ L,
2284
+ a("connect.store.taxPropagation.title"),
2285
+ a("connect.store.taxPropagation.confirm"),
2286
+ a("connect.common.cancel")
2287
+ ) && await t(
2288
+ async () => {
2289
+ const U = Ae(l.sortedStoreCategories), G = _e(U, x);
2290
+ await Ue.updateStoreBundle({ categories: G }), await l.readMemberStore(), await l.readMembership(), await l.readRewards();
2291
+ },
2292
+ {
2293
+ message: a("connect.store.taxPropagation.updating"),
2294
+ successMessage: a("connect.store.taxPropagation.success")
2295
+ }
2296
+ );
2297
+ }
2298
+ async function Fe(x) {
2299
+ var G, ee, Y, ne;
2300
+ const P = ((ee = (G = l.storeOption) == null ? void 0 : G.company) == null ? void 0 : ee.sstRegNo) ?? "", B = pe.cloneDeep(
2301
+ ((Y = l.storeOption) == null ? void 0 : Y.inclusiveTaxes) ?? []
2302
+ ), H = ((ne = x.company) == null ? void 0 : ne.sstRegNo) ?? "";
2303
+ await t(
2304
+ async () => {
2305
+ var we;
2306
+ await Ue.updateStore(x), await l.readMemberStore(), (we = w.value) == null || we.showSheet(!1);
2307
+ },
2308
+ {
2309
+ message: a("connect.store.setting.update.message"),
2310
+ successMessage: a("connect.store.setting.update.success")
2311
+ }
2312
+ );
2313
+ const q = P !== H, L = !pe.isEqual(
2314
+ B,
2315
+ x.inclusiveTaxes ?? []
2316
+ );
2317
+ !(q || L) || l.sortedStoreCategories.flatMap(
2318
+ (we) => we.bundles
2319
+ ).length === 0 || await ke(x, H, P);
2320
+ }
2321
+ async function ye(x = -1) {
2322
+ var P;
2323
+ if (te.value) {
2324
+ Z();
2325
+ return;
2326
+ }
2327
+ r.open({
2328
+ title: x == -1 ? a("connect.store.category.add") : a("connect.store.category.edit"),
2329
+ contentComponent: qt,
2330
+ contentComponentProps: {
2331
+ initialValue: ((P = p.value[x]) == null ? void 0 : P.name) ?? "",
2332
+ action: x == -1 ? "add" : "edit"
2333
+ }
2334
+ }).onPrimary(async (B) => {
2335
+ B === null && !await Ie.remove(
2336
+ a("connect.store.category.remove.confirm"),
2337
+ a("connect.store.category.remove.title")
2338
+ ) || await t(
2339
+ async () => {
2340
+ const H = x == -1 ? [...p.value, { name: B, bundles: [] }] : [...p.value].map((q, L) => L == x ? { ...q, name: B } : q).filter((q) => q.name !== null);
2341
+ await Ue.updateStoreBundle({
2342
+ categories: H
2343
+ }), await l.readMemberStore();
2344
+ },
2345
+ {
2346
+ message: B === null ? a("connect.store.category.update.deleting") : x == -1 ? a("connect.store.category.update.creating") : a("connect.store.category.update.updating"),
2347
+ successMessage: B === null ? a("connect.store.category.update.success.deleted") : x == -1 ? a("connect.store.category.update.success.created") : a("connect.store.category.update.success.updated")
2348
+ }
2349
+ );
2350
+ });
2351
+ }
2352
+ async function ie(x, P, B, H) {
2353
+ var _, U, G;
2354
+ P ?? (P = (_ = u.value) == null ? void 0 : _.target.category), B ?? (B = (U = u.value) == null ? void 0 : U.target.index), H ?? (H = (G = u.value) == null ? void 0 : G.target.originalCategoryIndex);
2355
+ const q = Ae(p.value);
2356
+ for (const ee of q)
2357
+ for (const Y of ee.bundles)
2358
+ console.log(Y, "bundle in payload"), "pf_vouchers" in Y && delete Y.pf_vouchers;
2359
+ P != H && H != null && (q[H].bundles.splice(B, 1), B = q[P].bundles.length);
2360
+ const L = q[P];
2361
+ if (!L) {
2362
+ gt.error("Unexpected error", 2e3);
2363
+ return;
2364
+ }
2365
+ if (x == null) {
2366
+ if (await Ie.remove(
2367
+ a("connect.store.bundle.delete.confirm"),
2368
+ a("connect.store.bundle.delete.title")
2369
+ ) == !1)
2370
+ return;
2371
+ L.bundles.splice(B, 1);
2372
+ } else
2373
+ B == -1 ? L.bundles.push(x) : L.bundles[B] = x;
2374
+ await t(
2375
+ async () => {
2376
+ var ee, Y;
2377
+ if (x != null) {
2378
+ const ne = (ee = u.value) == null ? void 0 : ee.bundleImage;
2379
+ ne === null && x.image ? (await je.delete(x.image), x.image = null) : ne && (x.image = await je.update(
2380
+ je.bundleImagePath(void 0, ne),
2381
+ ne
2382
+ ));
2383
+ }
2384
+ await Ue.updateStoreBundle({
2385
+ categories: q
2386
+ }), await l.readMemberStore(), await l.readMembership(), await l.readRewards(), (Y = u.value) == null || Y.showSheet(!1);
2387
+ },
2388
+ {
2389
+ message: `${x == null ? "Deleting" : B == -1 ? "Creating" : "Updating"} bundle`,
2390
+ successMessage: `Bundle ${x == null ? "deleted" : B == -1 ? "created" : "updated"} successfully`
2391
+ }
2392
+ );
2393
+ }
2394
+ function Pe(x) {
2395
+ var P;
2396
+ if (te.value) {
2397
+ Z();
2398
+ return;
2399
+ }
2400
+ (P = u.value) == null || P.showSheet(!0, {
2401
+ ...x,
2402
+ bundle: x.bundle ? Ae(x.bundle) : void 0
2403
+ });
2404
+ }
2405
+ const Be = E(() => [
2406
+ c,
2407
+ g,
2408
+ d
2409
+ ]);
2410
+ function Ne(x) {
2411
+ var P;
2412
+ (P = h.value) == null || P.showSheet({
2413
+ bundle: x
2414
+ });
2415
+ }
2416
+ return De(async () => {
2417
+ await f(async () => {
2418
+ var x, P;
2419
+ if (await l.readMemberStore(), await l.readMembership(), await l.readRewards(), await l.readPayoutAccount(), await S.readPremium(), oe.value = !0, me.value = xe(), await C(), (x = o.currentRoute.value.query) != null && x.action) {
2420
+ switch ((P = o.currentRoute.value.query) == null ? void 0 : P.action) {
2421
+ case "update_setting":
2422
+ A("setting");
2423
+ break;
2424
+ case "create_category":
2425
+ ye(-1);
2426
+ break;
2427
+ case "create_feedvibe_bundle":
2428
+ r.open({
2429
+ title: "Select category",
2430
+ contentComponent: Ht
2431
+ }).onPrimary((B) => {
2432
+ r.close(), Pe({
2433
+ categories: y.value,
2434
+ category: B,
2435
+ index: -1,
2436
+ bundle: {
2437
+ ...pe.cloneDeep(Ke),
2438
+ isFeedvibe: !0,
2439
+ price: K.Dinero.fromNumber({
2440
+ number: 10,
2441
+ precision: 2
2442
+ }).toObject()
2443
+ }
2444
+ });
2445
+ }).onTertiary(() => r.close());
2446
+ break;
2447
+ }
2448
+ o.replace({ query: {} });
2449
+ }
2450
+ });
2451
+ }), (x, P) => {
2452
+ const B = v("RouterLink"), H = v("FmPageHead"), q = v("FmPill"), L = v("FmButton"), _ = v("FmCard");
2453
+ return m(), T(W, null, [
2454
+ i(H, {
2455
+ title: e(a)("connect.store.title"),
2456
+ actions: e(Be),
2457
+ "onClick:action": A
2458
+ }, {
2459
+ description: I(() => [
2460
+ n("span", Un, F(e(a)("connect.store.description")), 1),
2461
+ i(B, {
2462
+ to: Ve,
2463
+ class: "ml-8 fm-typo-en-link-md-600 text-fm-color-primary"
2464
+ }, {
2465
+ default: I(() => [
2466
+ le(F(e(a)("connect.store.viewTransactions")), 1)
2467
+ ]),
2468
+ _: 1
2469
+ })
2470
+ ]),
2471
+ _: 1
2472
+ }, 8, ["title", "actions"]),
2473
+ n("div", En, [
2474
+ e(te) ? (m(), R(Yo, {
2475
+ key: 0,
2476
+ class: "mt-12",
2477
+ "setting-status": e(z).settingStatus,
2478
+ "payout-status": e(z).payoutStatus,
2479
+ "requires-payout": e(z).requiresPayout,
2480
+ onSetupStoreSetting: P[0] || (P[0] = (U) => A("setting")),
2481
+ onSetupPayout: P[1] || (P[1] = (U) => A("payout"))
2482
+ }, null, 8, ["setting-status", "payout-status", "requires-payout"])) : e(me) ? M("", !0) : (m(), R(tn, {
2483
+ key: 1,
2484
+ class: "mt-12",
2485
+ onDismiss: fe
2486
+ })),
2487
+ n("div", Dn, [
2488
+ n("div", Bn, [
2489
+ n("div", Nn, F(e(a)("connect.store.giftCard.title")), 1),
2490
+ i(q, {
2491
+ variant: "premium",
2492
+ label: e(a)("connect.store.giftCard.new")
2493
+ }, null, 8, ["label"]),
2494
+ e(N) && e($).length ? (m(), R(L, {
2495
+ key: 0,
2496
+ icon: "edit",
2497
+ size: "md",
2498
+ variant: "tertiary",
2499
+ onClick: P[2] || (P[2] = (U) => k(e($)[0]))
2500
+ })) : M("", !0),
2501
+ P[4] || (P[4] = n("div", { class: "flex-1" }, null, -1)),
2502
+ e(N) && e($).length ? (m(), T("div", Mn, F(e(a)("connect.store.giftCard.oneLiveHint")), 1)) : M("", !0)
2503
+ ]),
2504
+ !e(N) || !e($).length ? (m(), R(In, {
2505
+ key: 0,
2506
+ premium: e(N),
2507
+ onUpgrade: j,
2508
+ onComparePlans: Se,
2509
+ onCreate: s
2510
+ }, null, 8, ["premium"])) : (m(), T("div", On, [
2511
+ (m(!0), T(W, null, de(e($), (U) => (m(), R(Mo, {
2512
+ key: String(U._id),
2513
+ program: U,
2514
+ onEdit: (G) => k(U),
2515
+ onSetLive: (G) => D(U),
2516
+ onDeactivate: (G) => J(U)
2517
+ }, null, 8, ["program", "onEdit", "onSetLive", "onDeactivate"]))), 128)),
2518
+ i(_, {
2519
+ variant: "outlined",
2520
+ class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
2521
+ }, {
2522
+ default: I(() => [
2523
+ i(L, {
2524
+ label: e(a)("connect.store.giftCard.addGiftCard"),
2525
+ icon: "add",
2526
+ variant: "secondary",
2527
+ onClick: s
2528
+ }, null, 8, ["label"])
2529
+ ]),
2530
+ _: 1
2531
+ })
2532
+ ]))
2533
+ ]),
2534
+ e(p) && e(p).length > 0 ? (m(), T(W, { key: 2 }, [
2535
+ (m(!0), T(W, null, de(e(p), (U, G) => (m(), T("div", {
2536
+ key: U.name,
2537
+ class: "space-y-8 py-12"
2538
+ }, [
2539
+ n("div", Ln, [
2540
+ n("div", An, F(U.name), 1),
2541
+ i(Je, { json: U }, null, 8, ["json"]),
2542
+ i(L, {
2543
+ icon: "edit",
2544
+ size: "md",
2545
+ variant: "tertiary",
2546
+ onClick: (ee) => ye(G)
2547
+ }, null, 8, ["onClick"])
2548
+ ]),
2549
+ n("div", jn, [
2550
+ (m(!0), T(W, null, de(U.bundles, (ee, Y) => (m(), R(Mt, {
2551
+ bundle: ee,
2552
+ key: ee._id,
2553
+ onEdit: (ne) => Pe({
2554
+ bundle: ee,
2555
+ category: G,
2556
+ index: Y,
2557
+ categories: e(y)
2558
+ }),
2559
+ onDelete: (ne) => ie(null, G, Y),
2560
+ onSend: Ne
2561
+ }, null, 8, ["bundle", "onEdit", "onDelete"]))), 128)),
2562
+ i(Ot, {
2563
+ onCreate: (ee) => Pe({
2564
+ category: G,
2565
+ index: -1,
2566
+ categories: e(y)
2567
+ })
2568
+ }, null, 8, ["onCreate"])
2569
+ ])
2570
+ ]))), 128)),
2571
+ i(wo, {
2572
+ ref_key: "bundleSheetRef",
2573
+ ref: u,
2574
+ onUpdate: ie
2575
+ }, null, 512)
2576
+ ], 64)) : (m(), R(_, {
2577
+ key: 3,
2578
+ variant: "outlined",
2579
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
2580
+ }, {
2581
+ default: I(() => [
2582
+ P[5] || (P[5] = n("img", {
2583
+ src: it,
2584
+ class: "aspect-square w-[150px]"
2585
+ }, null, -1)),
2586
+ n("div", qn, [
2587
+ n("div", Gn, F(e(a)("connect.store.bundle.title")), 1),
2588
+ n("div", Kn, F(e(a)("connect.store.bundle.description")), 1)
2589
+ ]),
2590
+ i(L, {
2591
+ variant: "primary",
2592
+ label: e(a)("connect.store.actions.addCategory"),
2593
+ icon: "add",
2594
+ onClick: P[3] || (P[3] = (U) => ye(-1))
2595
+ }, null, 8, ["label"])
2596
+ ]),
2597
+ _: 1
2598
+ })),
2599
+ i(uo, {
2600
+ ref_key: "settingSheetRef",
2601
+ ref: w,
2602
+ onUpdate: Fe
2603
+ }, null, 512),
2604
+ i(Po, {
2605
+ ref_key: "sendBundleSheetRef",
2606
+ ref: h
2607
+ }, null, 512)
2608
+ ])
2609
+ ], 64);
2610
+ };
2611
+ }
2612
+ });
2613
+ export {
2614
+ ka as default
2615
+ };