@feedmepos/mf-connect 0.1.98-beta.77 → 0.1.98-beta.79

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 (124) hide show
  1. package/dist/{App-py_UovMT.js → App-BffPZGzn.js} +9 -9
  2. package/dist/{AuditLogs-CBYgZ7FH.js → AuditLogs-D3MEmFSx.js} +12 -12
  3. package/dist/{Bin-ju8M0hFD.js → Bin-Jw_wcgsC.js} +8 -8
  4. package/dist/{Broadcast-BTb4ylCq.js → Broadcast-DOw7z6bn.js} +12 -12
  5. package/dist/{CampaignAnalytic-2D7t722G.js → CampaignAnalytic-XXjhRtfl.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BcyTpZwP.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DkWeDf14.js} +7 -7
  7. package/dist/{Card-BiWlWZ6x.js → Card-D_rB1X9o.js} +22 -22
  8. package/dist/{Collections-BPOc6UY8.js → Collections-Da1I5--J.js} +8 -8
  9. package/dist/{Credit-Bb4wVQoC.js → Credit-DJuBjxVe.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-DG2U57X1.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CowFIZ3q.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CCT9ozoB.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-pI1jnJn4.js} +1330 -1227
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CsychcNd.js → EffectSheet.vue_vue_type_style_index_0_lang-BrBy93g0.js} +6 -6
  13. package/dist/{Experience-DBoDu8Cm.js → Experience-F4_hPy4x.js} +13 -13
  14. package/dist/{FileSaver.min-daHPgPSL.js → FileSaver.min-C-nhkwVc.js} +1 -1
  15. package/dist/{Game-BiUvjTES.js → Game-Cfe5gux2.js} +13 -13
  16. package/dist/{GiftCardSetup-BPGb-CL2.js → GiftCardSetup-CGJCg8-o.js} +10 -10
  17. package/dist/GoalPickerPanel.vue_vue_type_script_setup_true_lang-DTHFJbl8.js +424 -0
  18. package/dist/Goals-WWe3kZ3W.js +247 -0
  19. package/dist/{Grab-MCcNgCKI.js → Grab-Dr49Cz71.js} +9 -9
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CM7mxUvJ.js → ImageInput.vue_vue_type_script_setup_true_lang-CPB7kKVu.js} +1 -1
  21. package/dist/{Index-SjcZ2j_i.js → Index-TsViXhvK.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CV97Pgg_.js → LocationPicker.vue_vue_type_script_setup_true_lang-DmXKvvvk.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BOh6ZIXp.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BgRr2Bu5.js} +1 -1
  24. package/dist/{LoyaltyDashboard-DEW10zj_.js → LoyaltyDashboard-D-sVA0uB.js} +19 -16
  25. package/dist/{MainLayout-Qqi3QprJ.js → MainLayout-gSvcU53G.js} +3 -3
  26. package/dist/{Marketing-Dib60MJ-.js → Marketing-BUsNL2jQ.js} +4 -4
  27. package/dist/{MarketingMaterialEdit-D_QFXzja.js → MarketingMaterialEdit-DtubIpnt.js} +6 -6
  28. package/dist/{Member-Dcj7oysp.js → Member-9ng7QgMa.js} +7 -7
  29. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DrUVoRN4.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-qOMNiTrI.js} +23 -23
  30. package/dist/{MemberImportHistory-0GNHB9xb.js → MemberImportHistory-BsW3XNAv.js} +7 -7
  31. package/dist/{MemberList-D1EF36nF.js → MemberList-DUky4ceB.js} +14 -14
  32. package/dist/{MemberTransactions-N7fyQ8Tu.js → MemberTransactions-Bu-la_J4.js} +1 -1
  33. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-ChOoxM8X.js → MessageInput.vue_vue_type_script_setup_true_lang-BfLVofJG.js} +10 -10
  34. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DXaA1dNg.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CYqH-qT-.js} +1 -1
  35. package/dist/{Mission-rZt8vCOe.js → Mission-47XKDAIr.js} +14 -14
  36. package/dist/{Overview-B0QFLXFh.js → Overview-SDSNOe1_.js} +20 -20
  37. package/dist/{Overview-A705DkOm.js → Overview-fPy87ZWK.js} +4 -4
  38. package/dist/{Point-DkkRK7il.js → Point-Biql3Qi5.js} +14 -14
  39. package/dist/{Promotion-xd-T2-dQ.js → Promotion-CBbBWtke.js} +14 -14
  40. package/dist/{Queue-CDuCwa_c.js → Queue-DJgqg-cC.js} +12 -12
  41. package/dist/{Record-BHLRFtLP.js → Record-C6Uzc6pD.js} +9 -9
  42. package/dist/{Review-DXz6MS9O.js → Review-C2pjn38Z.js} +2 -2
  43. package/dist/{ReviewFacebookCallback-CM0ivdpZ.js → ReviewFacebookCallback-USPINa9z.js} +5 -5
  44. package/dist/{ReviewGoogleCallback--a0scVu4.js → ReviewGoogleCallback-Br_CV3Pq.js} +5 -5
  45. package/dist/{Reward-CiuyrrgK.js → Reward-Bl6TyJoX.js} +16 -16
  46. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-D89D4DjD.js → RewardGroup.vue_vue_type_script_setup_true_lang-DVu2-HRI.js} +13 -13
  47. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Dlw-NQtl.js → RuleGroup.vue_vue_type_script_setup_true_lang-DqnvglII.js} +14 -14
  48. package/dist/{Segment-DyresHK1.js → Segment-BKBNrfz8.js} +25 -25
  49. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CSXVvOb5.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DLskCbGj.js} +14 -14
  50. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CoPg1oMO.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BT3-tDl-.js} +4 -4
  51. package/dist/{Setting-BPK8w0eT.js → Setting-BqbtEU61.js} +15 -14
  52. package/dist/{SettingAdvertisements-93EXzmkv.js → SettingAdvertisements-DoHnZG47.js} +12 -12
  53. package/dist/{Settings-CVYiGv6m.js → Settings-HlQyk7g8.js} +5 -5
  54. package/dist/{Store-3e4b8AjN.js → Store-uexWJZhp.js} +26 -26
  55. package/dist/{StoreRewards-uWqfpsl6.js → StoreRewards-BbkTRt3c.js} +15 -15
  56. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DuuNYvYB.js → StoreTransactions.vue_vue_type_script_setup_true_lang-K6q2obBY.js} +24 -24
  57. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DhZ7pGPi.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CRfwFvlQ.js} +2 -2
  58. package/dist/{Tier-DONSsmtj.js → Tier-DN6l1PvI.js} +26 -26
  59. package/dist/{Title-Ko5lEmYl.js → Title-4w7I9PNy.js} +22 -22
  60. package/dist/{Transaction-C5tbK2o8.js → Transaction-BypZ5Cbs.js} +2 -2
  61. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DfWj1srU.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CVaOiG6q.js} +6 -6
  62. package/dist/{Voucher-BlWeC-0I.js → Voucher-_kyZ6H17.js} +18 -18
  63. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Aoq8uF1S.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DbrNDu2d.js} +12 -12
  64. package/dist/{WhatsappBot-BKmZ77uJ.js → WhatsappBot-CgLUjd8a.js} +2 -2
  65. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-D6AoU850.js → ZodTextField.vue_vue_type_script_setup_true_lang-B3BOd7wE.js} +2 -2
  66. package/dist/{app-Qg5rsLCS.js → app-BUdfgxte.js} +269 -214
  67. package/dist/app.js +1 -1
  68. package/dist/{base.export-B1bfW8El.js → base.export-gSYuTgGq.js} +2 -2
  69. package/dist/{business-BLk60Wa-.js → business-CjYxENvr.js} +1 -1
  70. package/dist/{campaign-DWP1aWZz.js → campaign-CNYzUQiR.js} +2 -2
  71. package/dist/{campaign-CGE8f5UN.js → campaign-yvttY7Iz.js} +10 -10
  72. package/dist/{campaign.fn-B1Yt9BZe.js → campaign.fn-Bsb9ItkF.js} +36 -36
  73. package/dist/{collection.fn-DwnnquLt.js → collection.fn-0klvp7AD.js} +2 -2
  74. package/dist/{currency-BXNSzxvj.js → currency-UZt1QX64.js} +1 -1
  75. package/dist/{duplicateCampaign-DS6X_uLQ.js → duplicateCampaign-CCr4vLrU.js} +2 -2
  76. package/dist/{effect-B1bo4EpE.js → effect-Dx3ZJxHs.js} +1 -1
  77. package/dist/{email-addresses-BWq7G9Jn.js → email-addresses-C0cqEsI0.js} +2 -2
  78. package/dist/{helper-Cy2y7vuV.js → helper-C_jOIHaL.js} +1 -1
  79. package/dist/{index-CI-HrzbP.js → index--qbL3r5K.js} +3 -3
  80. package/dist/{index-DAH5yRqP.js → index-9LJ75jOS.js} +7 -7
  81. package/dist/{index-CY0hT3HV.js → index-BLn35ij4.js} +29 -24
  82. package/dist/{index-Dgd7zWGJ.js → index-BWnVV310.js} +3 -3
  83. package/dist/{index-BZsEcvBN.js → index-BhP7DpQu.js} +8 -8
  84. package/dist/{index-ClWk2SqX.js → index-Bru3cF21.js} +1 -1
  85. package/dist/{index-B0dYeFs8.js → index-C4cDk-o7.js} +1 -1
  86. package/dist/{index-DyPtIo3J.js → index-Cb9hrU0J.js} +1 -1
  87. package/dist/{index-1hK_eYK1.js → index-ChgrDBj1.js} +2 -2
  88. package/dist/{index-D4nk586_.js → index-D3wRc-GN.js} +4 -4
  89. package/dist/{index-p9YHYXPf.js → index-D8i3eZnu.js} +1 -1
  90. package/dist/{index-Boag5HJA.js → index-DWdVixHn.js} +4 -4
  91. package/dist/{index-CNoVkpQ3.js → index-Dr0sT8uH.js} +2 -2
  92. package/dist/{index-Swe7a4_X.js → index-Dwrv-CFH.js} +2 -2
  93. package/dist/{index-B8qRU50F.js → index-DyaRNZLw.js} +1 -1
  94. package/dist/{index-C33MgGOl.js → index-U9Y--r1N.js} +3 -2
  95. package/dist/{index-BmElc5NY.js → index-kwMMiU8Z.js} +2 -2
  96. package/dist/{index-CnTaGkOT.js → index-tS9a8fVh.js} +1 -1
  97. package/dist/{index-BJvX9rG4.js → index-uNe9XFEK.js} +2 -2
  98. package/dist/{index.esm2017-BIBRdFdm.js → index.esm2017-DqDs52qt.js} +37 -37
  99. package/dist/{loading-TDsYUHLu.js → loading-DbSZrkUs.js} +1 -1
  100. package/dist/{lodash-abgtdmvd.js → lodash-DqWWo2-K.js} +1 -1
  101. package/dist/{member-import-DeU7DbJW.js → member-import-CoVI5_0P.js} +1 -1
  102. package/dist/{membership-EZT0X6ed.js → membership-SQa4SZUq.js} +2 -2
  103. package/dist/{money-B86Qgxua.js → money-Cl_T-LaY.js} +1 -1
  104. package/dist/{number-Dsl9GWdS.js → number-BOrgnhwZ.js} +1 -1
  105. package/dist/{objectid-D6mg3XC5.js → objectid-CsDYQ9eX.js} +9 -9
  106. package/dist/onboarding-BLU2SSrI.js +131 -0
  107. package/dist/{onboardingSetup-BOLuQWax.js → onboardingSetup-jyeouaTv.js} +2 -2
  108. package/dist/{plugins-Bhi51Nbd.js → plugins-t_9JTEIa.js} +3 -3
  109. package/dist/{reward-DUv9YGlz.js → reward-BWunDF4U.js} +1 -1
  110. package/dist/{rule-DhBVl_w3.js → rule-DyUt0gcn.js} +9 -9
  111. package/dist/{template-zkPMQqZM.js → template-DNh14IvS.js} +6 -6
  112. package/dist/{timezone-CyvzaL88.js → timezone-DpCfnolZ.js} +1 -1
  113. package/dist/{transaction.fn-Dq_IkjHc.js → transaction.fn-D8JhcKmt.js} +2 -2
  114. package/dist/{trigger-COXS9V0F.js → trigger-DYyQ4d7Z.js} +5 -5
  115. package/dist/{useMarketingMaterialActions-D6IOmaPj.js → useMarketingMaterialActions-BVzjD61l.js} +3 -3
  116. package/dist/{usePagination-BC3Nh3fc.js → usePagination-jqXEShKi.js} +1 -1
  117. package/dist/{user-DEiz-sFG.js → user-Bb-YcUvV.js} +1 -1
  118. package/dist/{vue-i18n-BkZRNKBM.js → vue-i18n-Bud-ZmQ_.js} +195 -195
  119. package/dist/{xlsx-DQuDEWD0.js → xlsx-NzYW6kUX.js} +224 -224
  120. package/dist/{zod-lj0bd2h4.js → zod-DK9AcJ_Q.js} +1 -1
  121. package/package.json +1 -1
  122. package/dist/GoalPickerPanel.vue_vue_type_script_setup_true_lang-Ba0tRqlV.js +0 -417
  123. package/dist/Goals-Lj7OXqCG.js +0 -244
  124. package/dist/onboarding-X-5Gm3VM.js +0 -129
@@ -1,57 +1,69 @@
1
- import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, createCommentVNode, computed, onMounted, toDisplayString, createBlock, withCtx, Fragment, renderList, withModifiers, isRef, createTextVNode, normalizeClass, watchEffect, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
2
- import { _ } from "./lodash-abgtdmvd.js";
3
- import { S as S6, f as Zh, z as z$1 } from "./app-Qg5rsLCS.js";
4
- import { Z as ZodHelper } from "./zod-lj0bd2h4.js";
5
- import { z } from "./index-C_H8jFYf.js";
6
- import { e as FdoGroup, F as F_RUNNABLE_CAMPAIGN_TYPE, f as FdtoRunnableCampaign, g as FdoCreditLoyaltyReward, h as FdtoRandomReward, i as F_MISSION_TYPE, j as FdoThresholdCreditReward, k as FdtoThresholdReward, l as FdoMission } from "./index-Boag5HJA.js";
7
- import { F as FdoObjectId } from "./index-Dgd7zWGJ.js";
8
- import { F as FdtoCollectibleConfig } from "./index-BmElc5NY.js";
9
- import { a as isRuleGroup, R as RuleBuilder, s as stripRruleDtstartExceptSchedule, i as isRuleEntry, T as TEMPLATES } from "./index-DAH5yRqP.js";
10
- import { A as APP_INBOX_BODY_LIMIT, g as FdoBroadcastUrl, h as F_PUSH_DESTINATION, t as toDelivery, i as toLegacyMessage } from "./index-CI-HrzbP.js";
11
- import { e as CHANNEL_DISPLAY_ORDER, i as isPaidChannel, f as isChannelComplete, h as addChannel, j as setMode, k as hasDraft, l as setPrimaryChannel, r as removeChannel, m as moveChannel, n as setChannelContent, o as getCampaignSummaryObject, p as normaliseBroadcastDelivery } from "./campaign-CGE8f5UN.js";
12
- import { u as useMembershipStore } from "./membership-EZT0X6ed.js";
13
- import { u as useBusinessStore } from "./business-BLk60Wa-.js";
1
+ import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, createCommentVNode, computed, onMounted, toDisplayString, createBlock, withCtx, Fragment, renderList, withModifiers, isRef, createTextVNode, normalizeClass, watchEffect, resolveDynamicComponent, toRefs, normalizeStyle, onBeforeUnmount, createSlots } from "vue";
2
+ import { _ } from "./lodash-DqWWo2-K.js";
3
+ import { h as axios, c as core, S as SvcConfig } from "./index-U9Y--r1N.js";
4
+ import { z, S as S6, f as Zh } from "./app-BUdfgxte.js";
5
+ import { Z as ZodHelper } from "./zod-DK9AcJ_Q.js";
6
+ import { z as z$1 } from "./index-C_H8jFYf.js";
7
+ import { e as FdoGroup, F as F_RUNNABLE_CAMPAIGN_TYPE, f as FdtoRunnableCampaign, g as FdoCreditLoyaltyReward, h as FdtoRandomReward, i as F_MISSION_TYPE, j as FdoThresholdCreditReward, k as FdtoThresholdReward, l as FdoMission } from "./index-DWdVixHn.js";
8
+ import { F as FdoObjectId } from "./index-BWnVV310.js";
9
+ import { F as FdtoCollectibleConfig } from "./index-kwMMiU8Z.js";
10
+ import { a as isRuleGroup, R as RuleBuilder, s as stripRruleDtstartExceptSchedule, i as isRuleEntry, T as TEMPLATES } from "./index-9LJ75jOS.js";
11
+ import { A as APP_INBOX_BODY_LIMIT, g as FdoBroadcastUrl, h as F_PUSH_DESTINATION, t as toDelivery, i as toLegacyMessage } from "./index--qbL3r5K.js";
12
+ import { e as CHANNEL_DISPLAY_ORDER, i as isPaidChannel, f as isChannelComplete, h as setMode, j as addChannel, k as hasDraft, l as setPrimaryChannel, r as removeChannel, m as moveChannel, n as setChannelContent, o as getCampaignSummaryObject, p as normaliseBroadcastDelivery } from "./campaign-yvttY7Iz.js";
13
+ import { u as useMembershipStore } from "./membership-SQa4SZUq.js";
14
+ import { u as useBusinessStore } from "./business-CjYxENvr.js";
14
15
  import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
15
16
  import { h as hooks } from "./moment-D7p2TMB-.js";
16
17
  import { f as featureVersionMapping } from "./campaign.enum-Dx-Zo68Q.js";
17
- import { _ as _sfc_main$C } from "./ImageInput.vue_vue_type_script_setup_true_lang-CM7mxUvJ.js";
18
- import { b as _sfc_main$A, a as _sfc_main$D, _ as _sfc_main$F } from "./EffectSheet.vue_vue_type_style_index_0_lang-CsychcNd.js";
19
- import { _ as _sfc_main$E } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DhZ7pGPi.js";
20
- import { c as core, S as SvcConfig } from "./index-C33MgGOl.js";
21
- import { p as prompt, f as firebaseStorage } from "./plugins-Bhi51Nbd.js";
18
+ import { _ as _sfc_main$C } from "./ImageInput.vue_vue_type_script_setup_true_lang-CPB7kKVu.js";
19
+ import { b as _sfc_main$A, a as _sfc_main$D, _ as _sfc_main$F } from "./EffectSheet.vue_vue_type_style_index_0_lang-BrBy93g0.js";
20
+ import { _ as _sfc_main$E } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CRfwFvlQ.js";
21
+ import { p as prompt, f as firebaseStorage } from "./plugins-t_9JTEIa.js";
22
22
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-CHgC5LLL.js";
23
- import { _ as _sfc_main$G } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-DfWj1srU.js";
24
- import { a as _sfc_main$u, _ as _sfc_main$y } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Dlw-NQtl.js";
25
- import { u as useI18n } from "./vue-i18n-BkZRNKBM.js";
26
- import { T as TypeToTriggerOptions, _ as _sfc_main$H, b as _sfc_main$I } from "./trigger-COXS9V0F.js";
27
- import { D as DEFAULT_MESSAGE_VARIABLES, b as _sfc_main$v, g as getSmsMessageMetrics, _ as _sfc_main$w, a as _sfc_main$x } from "./MessageInput.vue_vue_type_script_setup_true_lang-ChOoxM8X.js";
23
+ import { _ as _sfc_main$G } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-CVaOiG6q.js";
24
+ import { a as _sfc_main$u, _ as _sfc_main$y } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DqnvglII.js";
25
+ import { u as useI18n } from "./vue-i18n-Bud-ZmQ_.js";
26
+ import { T as TypeToTriggerOptions, _ as _sfc_main$H, b as _sfc_main$I } from "./trigger-DYyQ4d7Z.js";
27
+ import { D as DEFAULT_MESSAGE_VARIABLES, b as _sfc_main$v, g as getSmsMessageMetrics, _ as _sfc_main$w, a as _sfc_main$x } from "./MessageInput.vue_vue_type_script_setup_true_lang-BfLVofJG.js";
28
+ import { useDialog } from "@feedmepos/ui-library";
28
29
  import { useCoreStore } from "@feedmepos/mf-common";
29
- import { c as campaignApi } from "./index-Swe7a4_X.js";
30
- import { m as membershipApi } from "./index-BJvX9rG4.js";
31
- import { m as moment } from "./index-B8qRU50F.js";
32
- import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-DhBVl_w3.js";
33
- import { C as CountryTimezone } from "./timezone-CyvzaL88.js";
34
- import { _ as _sfc_main$z, a as _sfc_main$B } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-Aoq8uF1S.js";
35
- import "./index-D4nk586_.js";
36
- import "./index-CNoVkpQ3.js";
37
- import "./index-CY0hT3HV.js";
30
+ import { c as campaignApi } from "./index-Dwrv-CFH.js";
31
+ import { m as membershipApi } from "./index-uNe9XFEK.js";
32
+ import { m as moment } from "./index-DyaRNZLw.js";
33
+ import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-DyUt0gcn.js";
34
+ import { C as CountryTimezone } from "./timezone-DpCfnolZ.js";
35
+ import { _ as _sfc_main$z, a as _sfc_main$B } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DbrNDu2d.js";
36
+ import "./index-D3wRc-GN.js";
37
+ import "./index-Dr0sT8uH.js";
38
+ import "./index-BLn35ij4.js";
38
39
  import "./index-BgECjFM0.js";
39
40
  import { a as F_GAME_TYPE } from "./collectible.enum-Liy2wH3s.js";
40
- import { u as useLoading } from "./loading-TDsYUHLu.js";
41
- import { i as initCollectibleConfig } from "./helper-Cy2y7vuV.js";
42
- import { C as CollectionUtils } from "./collection.fn-DwnnquLt.js";
41
+ import { u as useLoading } from "./loading-DbSZrkUs.js";
42
+ import { i as initCollectibleConfig } from "./helper-C_jOIHaL.js";
43
+ import { C as CollectionUtils } from "./collection.fn-0klvp7AD.js";
43
44
  import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
44
- import { useDialog } from "@feedmepos/ui-library";
45
- import { u as useCampaignStore } from "./campaign-DWP1aWZz.js";
45
+ import { u as useCampaignStore } from "./campaign-CNYzUQiR.js";
46
46
  import { a as cleanPF } from "./object-BYyQ0PZp.js";
47
- function campaignRefinement(e, s) {
48
- var i, c;
49
- if (console.log(e, s), !e) return;
47
+ const publicClient = axios.create({ withCredentials: !1, timeout: 5e3 });
48
+ async function getNativeApp(e) {
49
+ z.string().length(24).parse(e);
50
+ const o = await publicClient.get(
51
+ `https://api.feedmedev.vip/metadata/${encodeURIComponent(e)}/native-app`
52
+ );
53
+ return z.object({
54
+ businessId: z.literal(e),
55
+ native: z.boolean(),
56
+ platforms: z.array(z.string())
57
+ }).parse(o.data).native;
58
+ }
59
+ function campaignRefinement(e, r) {
60
+ var i, u;
61
+ if (console.log(e, r), !e) return;
50
62
  const o = e.campaign;
51
63
  if (!o) return;
52
- const d = o.event.rule;
53
- if (!d || !isRuleGroup(d)) {
54
- s.addIssue({
64
+ const m = o.event.rule;
65
+ if (!m || !isRuleGroup(m)) {
66
+ r.addIssue({
55
67
  code: "custom",
56
68
  path: ["campaign", "event", "rule"],
57
69
  params: {
@@ -63,7 +75,7 @@ function campaignRefinement(e, s) {
63
75
  }
64
76
  switch (o.type) {
65
77
  case "MISSION": {
66
- o.earningOption.amount > o.mission.end && s.addIssue({
78
+ o.earningOption.amount > o.mission.end && r.addIssue({
67
79
  code: "custom",
68
80
  path: ["campaign", "earningOption"],
69
81
  params: {
@@ -75,7 +87,7 @@ function campaignRefinement(e, s) {
75
87
  }
76
88
  case "CREDIT": {
77
89
  const l = (i = o.config) == null ? void 0 : i.validityOption;
78
- (!l || ["validForDay", "validBefore"].every((a) => l[a] == null)) && s.addIssue({
90
+ (!l || ["validForDay", "validBefore"].every((a) => l[a] == null)) && r.addIssue({
79
91
  code: "custom",
80
92
  path: ["campaign", "config", "validityOption"],
81
93
  params: {
@@ -87,14 +99,14 @@ function campaignRefinement(e, s) {
87
99
  switch (o.event.type) {
88
100
  case "BILL_COMPLETED":
89
101
  o.type === "MISSION" && o.rewards.length && (o.rewards.forEach((l, n) => {
90
- (l.threshold < 0 || l.threshold > o.mission.end) && s.addIssue({
102
+ (l.threshold < 0 || l.threshold > o.mission.end) && r.addIssue({
91
103
  code: "custom",
92
104
  path: ["campaign", "rewards", n, "threshold"],
93
105
  params: {
94
106
  i18n: "connectZodCustom:campaign.reward_threshold_range"
95
107
  }
96
108
  });
97
- }), (c = o.config) != null && c.validityOption.followFirstReceive || s.addIssue({
109
+ }), (u = o.config) != null && u.validityOption.followFirstReceive || r.addIssue({
98
110
  code: "custom",
99
111
  path: ["campaign", "config", "validityOption"],
100
112
  params: {
@@ -103,8 +115,8 @@ function campaignRefinement(e, s) {
103
115
  }));
104
116
  break;
105
117
  case "SCHEDULE": {
106
- if (!d.rules.g_schedule) {
107
- s.addIssue({
118
+ if (!m.rules.g_schedule) {
119
+ r.addIssue({
108
120
  code: "custom",
109
121
  path: ["campaign", "event", "rule"],
110
122
  params: {
@@ -115,7 +127,7 @@ function campaignRefinement(e, s) {
115
127
  return;
116
128
  }
117
129
  const l = RuleBuilder.getRules(
118
- d.rules.g_schedule
130
+ m.rules.g_schedule
119
131
  ), n = [
120
132
  {
121
133
  property: "trigger.date",
@@ -126,10 +138,10 @@ function campaignRefinement(e, s) {
126
138
  operator: ["_isOnTime"]
127
139
  }
128
140
  ];
129
- n.length == l.length && n.every((r) => l.some((p) => {
130
- const v = RuleBuilder.simplify(p);
131
- return v.property === r.property && r.operator.includes(v.operator);
132
- })) || s.addIssue({
141
+ n.length == l.length && n.every((s) => l.some((y) => {
142
+ const f = RuleBuilder.simplify(y);
143
+ return f.property === s.property && s.operator.includes(f.operator);
144
+ })) || r.addIssue({
133
145
  code: "custom",
134
146
  path: ["campaign", "event", "rule"],
135
147
  params: {
@@ -139,7 +151,7 @@ function campaignRefinement(e, s) {
139
151
  break;
140
152
  }
141
153
  default: {
142
- "earningOption" in o && o.earningOption.type != "FIXED" && s.addIssue({
154
+ "earningOption" in o && o.earningOption.type != "FIXED" && r.addIssue({
143
155
  code: "custom",
144
156
  path: ["campaign", "earningOption"],
145
157
  params: {
@@ -153,89 +165,89 @@ function campaignRefinement(e, s) {
153
165
  function campaignTransform(e) {
154
166
  var o;
155
167
  if (e.campaign.type === "VOUCHER" && "configs" in e) {
156
- const d = e.configs;
157
- d.extras.targetLocation = e.campaign.targetLocation;
168
+ const m = e.configs;
169
+ m.extras.targetLocation = e.campaign.targetLocation;
158
170
  const i = Math.max(
159
171
  e.campaign.earningOption.amount,
160
- d.options.maxUse ?? 1
172
+ m.options.maxUse ?? 1
161
173
  );
162
- e.campaign.earningOption.amount = i, d.options.maxUse = i, e.campaign.earningOption = {
174
+ e.campaign.earningOption.amount = i, m.options.maxUse = i, e.campaign.earningOption = {
163
175
  type: "FIXED",
164
176
  amount: 1
165
177
  };
166
178
  }
167
179
  if (e.campaign.type == "MISSION" && "configs" in e) {
168
- const d = e.configs;
169
- d.options.validityOption = (o = e.campaign.config) == null ? void 0 : o.validityOption;
180
+ const m = e.configs;
181
+ m.options.validityOption = (o = e.campaign.config) == null ? void 0 : o.validityOption;
170
182
  }
171
- const s = e.campaign.event;
172
- return s.type != "BILL_COMPLETED" && s.rule && isRuleGroup(s.rule) && (s.rule = RuleBuilder.removeEntry(s.rule, "g_bill"), e.campaign.event = s), s.rule && isRuleGroup(s.rule) && (s.rule = stripRruleDtstartExceptSchedule(s.rule), e.campaign.event = s), e;
183
+ const r = e.campaign.event;
184
+ return r.type != "BILL_COMPLETED" && r.rule && isRuleGroup(r.rule) && (r.rule = RuleBuilder.removeEntry(r.rule, "g_bill"), e.campaign.event = r), r.rule && isRuleGroup(r.rule) && (r.rule = stripRruleDtstartExceptSchedule(r.rule), e.campaign.event = r), e;
173
185
  }
174
186
  function GenerateCampaignReq(e) {
175
- const s = FdtoRunnableCampaign.optionsMap.get(e).extend({
187
+ const r = FdtoRunnableCampaign.optionsMap.get(e).extend({
176
188
  _id: FdoObjectId.optional(),
177
- collectible: z.string().nullish()
189
+ collectible: z$1.string().nullish()
178
190
  });
179
191
  switch (e) {
180
192
  case "VOUCHER":
181
- return z.object({
182
- campaign: s,
193
+ return z$1.object({
194
+ campaign: r,
183
195
  templateId: FdoObjectId,
184
196
  configs: FdtoCollectibleConfig,
185
- updateCollections: z.boolean().optional(),
186
- code: z.string().optional()
197
+ updateCollections: z$1.boolean().optional(),
198
+ code: z$1.string().optional()
187
199
  });
188
200
  case "PROMOTION":
189
- return z.object({
190
- campaign: s,
201
+ return z$1.object({
202
+ campaign: r,
191
203
  templateId: FdoObjectId
192
204
  });
193
205
  case "POINT":
194
- return z.object({
195
- campaign: s,
206
+ return z$1.object({
207
+ campaign: r,
196
208
  templateId: FdoObjectId
197
209
  });
198
210
  case "CREDIT":
199
- return z.object({
200
- campaign: s,
211
+ return z$1.object({
212
+ campaign: r,
201
213
  templateId: FdoObjectId
202
214
  });
203
215
  case "BROADCAST":
204
- return z.object({
205
- campaign: s.refine((o) => !!o.delivery || !!o.message, {
216
+ return z$1.object({
217
+ campaign: r.refine((o) => !!o.delivery || !!o.message, {
206
218
  path: ["delivery"],
207
219
  message: "A broadcast requires a message or delivery configuration."
208
220
  }),
209
221
  templateId: FdoObjectId
210
222
  });
211
223
  case "COIN":
212
- return z.object({
213
- campaign: s,
224
+ return z$1.object({
225
+ campaign: r,
214
226
  templateId: FdoObjectId
215
227
  });
216
228
  case "REWARD_POOL":
217
- return z.object({
218
- campaign: s,
229
+ return z$1.object({
230
+ campaign: r,
219
231
  templateId: FdoObjectId,
220
- updateCollections: z.boolean().optional()
232
+ updateCollections: z$1.boolean().optional()
221
233
  });
222
234
  case "GAME":
223
- return z.object({
224
- campaign: s,
235
+ return z$1.object({
236
+ campaign: r,
225
237
  configs: FdtoCollectibleConfig,
226
238
  templateId: FdoObjectId,
227
- updateCollections: z.boolean().optional()
239
+ updateCollections: z$1.boolean().optional()
228
240
  });
229
241
  case "MISSION":
230
- return z.object({
231
- campaign: s,
242
+ return z$1.object({
243
+ campaign: r,
232
244
  configs: FdtoCollectibleConfig,
233
245
  templateId: FdoObjectId,
234
- updateCollections: z.boolean().optional()
246
+ updateCollections: z$1.boolean().optional()
235
247
  });
236
248
  case "GRAB":
237
- return z.object({
238
- campaign: s,
249
+ return z$1.object({
250
+ campaign: r,
239
251
  templateId: FdoObjectId
240
252
  });
241
253
  default:
@@ -244,9 +256,9 @@ function GenerateCampaignReq(e) {
244
256
  }
245
257
  FdoGroup.extend({
246
258
  _id: FdoObjectId.optional(),
247
- name: z.string().min(1).max(300),
259
+ name: z$1.string().min(1).max(300),
248
260
  business: FdoObjectId.optional(),
249
- campaigns: z.array(FdoObjectId).optional()
261
+ campaigns: z$1.array(FdoObjectId).optional()
250
262
  });
251
263
  const CampaignDtos = {
252
264
  [F_RUNNABLE_CAMPAIGN_TYPE.enum.VOUCHER]: GenerateCampaignReq("VOUCHER"),
@@ -263,20 +275,20 @@ const CampaignDtos = {
263
275
  function summarizeGrabDiscount(e) {
264
276
  if (!e)
265
277
  return null;
266
- const s = core.Config.getCountry().currency.symbol;
278
+ const r = core.Config.getCountry().currency.symbol;
267
279
  function o(l) {
268
280
  switch (l.scope.type) {
269
281
  case "order":
270
282
  return "Bill discount";
271
283
  case "items":
272
- return l.type.startsWith("bundle") ? d(l.type) : "Item discount";
284
+ return l.type.startsWith("bundle") ? m(l.type) : "Item discount";
273
285
  case "categories":
274
286
  return "Category discount";
275
287
  default:
276
288
  return "Discount";
277
289
  }
278
290
  }
279
- function d(l) {
291
+ function m(l) {
280
292
  switch (l) {
281
293
  case "bundleSameFixPrice":
282
294
  return "Bundle (same item) - Fixed price";
@@ -303,25 +315,25 @@ function summarizeGrabDiscount(e) {
303
315
  case "net":
304
316
  case "bundleSameNet":
305
317
  case "bundleDiffNet":
306
- return `${s}${l.value} discount`;
318
+ return `${r}${l.value} discount`;
307
319
  case "bundleSameFixPrice":
308
320
  case "bundleDiffFixPrice":
309
- return `${s}${l.value} fixed price`;
321
+ return `${r}${l.value} fixed price`;
310
322
  case "delivery":
311
323
  return "Delivery fee discount";
312
324
  case "freeItem":
313
325
  return "Free item";
314
326
  default:
315
- return `${s}${l.value} discount`;
327
+ return `${r}${l.value} discount`;
316
328
  }
317
329
  }
318
- function c(l) {
319
- return l.cap && l.cap > 0 ? `capped at ${s}${l.cap}` : null;
330
+ function u(l) {
331
+ return l.cap && l.cap > 0 ? `capped at ${r}${l.cap}` : null;
320
332
  }
321
333
  return {
322
334
  type: o(e),
323
335
  adjustment: i(e),
324
- cap: c(e)
336
+ cap: u(e)
325
337
  };
326
338
  }
327
339
  const _hoisted_1$r = {
@@ -335,43 +347,43 @@ const _hoisted_1$r = {
335
347
  filterItems: { type: Function }
336
348
  },
337
349
  emits: ["confirm", "cancel"],
338
- setup(e, { emit: s }) {
339
- const o = e, d = s, i = ref();
350
+ setup(e, { emit: r }) {
351
+ const o = e, m = r, i = ref();
340
352
  watch(
341
353
  () => o.visible,
342
354
  (a) => {
343
- var r, p;
344
- !a && i.value && ((p = (r = i.value).setSelectedItems) == null || p.call(r, o.initialValue || []));
355
+ var s, y;
356
+ !a && i.value && ((y = (s = i.value).setSelectedItems) == null || y.call(s, o.initialValue || []));
345
357
  }
346
358
  );
347
- function c() {
359
+ function u() {
348
360
  var a;
349
361
  (a = i.value) == null || a.onConfirm();
350
362
  }
351
363
  function l() {
352
- d("cancel");
364
+ m("cancel");
353
365
  }
354
366
  function n(a) {
355
- d("confirm", a);
367
+ m("confirm", a);
356
368
  }
357
- return (a, r) => {
358
- const p = resolveComponent("FmIcon"), v = resolveComponent("FmButton");
369
+ return (a, s) => {
370
+ const y = resolveComponent("FmIcon"), f = resolveComponent("FmButton");
359
371
  return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$r, [
360
372
  createElementVNode("div", _hoisted_2$n, [
361
373
  createElementVNode("div", _hoisted_3$k, [
362
- createVNode(p, {
374
+ createVNode(y, {
363
375
  name: "restaurant",
364
376
  size: "md"
365
377
  }),
366
- r[0] || (r[0] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Items", -1))
378
+ s[0] || (s[0] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Items", -1))
367
379
  ]),
368
- createVNode(v, {
380
+ createVNode(f, {
369
381
  icon: "close",
370
382
  variant: "tertiary",
371
383
  onClick: l
372
384
  })
373
385
  ]),
374
- r[1] || (r[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which items this discount applies to. For bundle discounts, select multiple items that can be bundled together. ", -1)),
386
+ s[1] || (s[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which items this discount applies to. For bundle discounts, select multiple items that can be bundled together. ", -1)),
375
387
  createElementVNode("div", _hoisted_4$j, [
376
388
  createVNode(unref(S6), {
377
389
  ref_key: "selectItemRef",
@@ -383,15 +395,15 @@ const _hoisted_1$r = {
383
395
  }, null, 8, ["initial-value", "filter-items"])
384
396
  ]),
385
397
  createElementVNode("div", _hoisted_5$g, [
386
- createVNode(v, {
398
+ createVNode(f, {
387
399
  variant: "secondary",
388
400
  label: "Cancel",
389
401
  onClick: l
390
402
  }),
391
- createVNode(v, {
403
+ createVNode(f, {
392
404
  variant: "primary",
393
405
  label: "Confirm Selection",
394
- onClick: c
406
+ onClick: u
395
407
  })
396
408
  ])
397
409
  ])) : createCommentVNode("", !0);
@@ -410,57 +422,57 @@ const _hoisted_1$r = {
410
422
  initialValue: {}
411
423
  },
412
424
  emits: ["confirm", "cancel"],
413
- setup(e, { emit: s }) {
414
- const o = e, d = s, i = Zh(), c = ref({}), l = ref(""), n = computed(() => {
415
- const u = i.menu.value;
416
- return u ? u.modules.category.map((m) => ({
417
- id: m._id,
418
- name: m.name
425
+ setup(e, { emit: r }) {
426
+ const o = e, m = r, i = Zh(), u = ref({}), l = ref(""), n = computed(() => {
427
+ const d = i.menu.value;
428
+ return d ? d.modules.category.map((p) => ({
429
+ id: p._id,
430
+ name: p.name
419
431
  })) : [];
420
432
  }), a = computed(() => {
421
433
  if (!l.value) return n.value;
422
- const u = l.value.toLowerCase();
434
+ const d = l.value.toLowerCase();
423
435
  return n.value.filter(
424
- (m) => m.name.toLowerCase().includes(u)
436
+ (p) => p.name.toLowerCase().includes(d)
425
437
  );
426
- }), r = computed(() => Object.values(c.value).filter(Boolean).length);
427
- function p() {
428
- c.value = n.value.reduce(
429
- (u, m) => (u[m.id] = o.initialValue.includes(m.id), u),
438
+ }), s = computed(() => Object.values(u.value).filter(Boolean).length);
439
+ function y() {
440
+ u.value = n.value.reduce(
441
+ (d, p) => (d[p.id] = o.initialValue.includes(p.id), d),
430
442
  {}
431
443
  );
432
444
  }
433
445
  watch([() => o.visible, () => o.initialValue], () => {
434
- o.visible && p();
446
+ o.visible && y();
435
447
  }), onMounted(async () => {
436
- await i.store.getMenu(), p();
448
+ await i.store.getMenu(), y();
437
449
  });
438
- function v(u) {
439
- c.value[u] = !c.value[u];
450
+ function f(d) {
451
+ u.value[d] = !u.value[d];
440
452
  }
441
- function f() {
442
- const u = r.value === a.value.length;
443
- a.value.forEach((m) => {
444
- c.value[m.id] = !u;
453
+ function c() {
454
+ const d = s.value === a.value.length;
455
+ a.value.forEach((p) => {
456
+ u.value[p.id] = !d;
445
457
  });
446
458
  }
447
- function V() {
448
- Object.keys(c.value).forEach((u) => {
449
- c.value[u] = !1;
459
+ function k() {
460
+ Object.keys(u.value).forEach((d) => {
461
+ u.value[d] = !1;
450
462
  });
451
463
  }
452
- function k() {
453
- const u = Object.entries(c.value).filter(([, m]) => m).map(([m]) => m);
454
- d("confirm", u);
464
+ function V() {
465
+ const d = Object.entries(u.value).filter(([, p]) => p).map(([p]) => p);
466
+ m("confirm", d);
455
467
  }
456
- function y() {
457
- d("cancel");
468
+ function g() {
469
+ m("cancel");
458
470
  }
459
- const g = computed(() => a.value.length > 0 && a.value.every(
460
- (u) => c.value[u.id]
471
+ const v = computed(() => a.value.length > 0 && a.value.every(
472
+ (d) => u.value[d.id]
461
473
  ));
462
- return (u, m) => {
463
- const C = resolveComponent("FmIcon"), x = resolveComponent("FmButton"), $ = resolveComponent("FmTextField"), F = resolveComponent("FmCheckbox"), N = resolveComponent("FmListItem"), D = resolveComponent("FmList");
474
+ return (d, p) => {
475
+ const C = resolveComponent("FmIcon"), x = resolveComponent("FmButton"), N = resolveComponent("FmTextField"), w = resolveComponent("FmCheckbox"), $ = resolveComponent("FmListItem"), T = resolveComponent("FmList");
464
476
  return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$q, [
465
477
  createElementVNode("div", _hoisted_2$m, [
466
478
  createElementVNode("div", _hoisted_3$j, [
@@ -468,55 +480,55 @@ const _hoisted_1$r = {
468
480
  name: "category",
469
481
  size: "md"
470
482
  }),
471
- m[2] || (m[2] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Categories", -1))
483
+ p[2] || (p[2] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Categories", -1))
472
484
  ]),
473
485
  createVNode(x, {
474
486
  icon: "close",
475
487
  variant: "tertiary",
476
- onClick: y
488
+ onClick: g
477
489
  })
478
490
  ]),
479
- m[3] || (m[3] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. The discount will be available for all items within the selected categories. ", -1)),
491
+ p[3] || (p[3] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. The discount will be available for all items within the selected categories. ", -1)),
480
492
  createElementVNode("div", _hoisted_4$i, [
481
493
  createElementVNode("div", _hoisted_5$f, [
482
494
  createVNode(x, {
483
495
  icon: "select_all",
484
496
  variant: "tertiary",
485
497
  size: "small",
486
- label: `${g.value ? "Deselect" : "Select"} All`,
487
- onClick: f
498
+ label: `${v.value ? "Deselect" : "Select"} All`,
499
+ onClick: c
488
500
  }, null, 8, ["label"]),
489
501
  createVNode(x, {
490
502
  icon: "sync",
491
503
  variant: "tertiary",
492
504
  size: "small",
493
505
  label: "Clear",
494
- onClick: V
506
+ onClick: k
495
507
  }),
496
- createElementVNode("span", _hoisted_6$b, toDisplayString(r.value) + " selected ", 1)
508
+ createElementVNode("span", _hoisted_6$b, toDisplayString(s.value) + " selected ", 1)
497
509
  ]),
498
- createVNode($, {
510
+ createVNode(N, {
499
511
  modelValue: l.value,
500
- "onUpdate:modelValue": m[0] || (m[0] = (w) => l.value = w),
512
+ "onUpdate:modelValue": p[0] || (p[0] = (R) => l.value = R),
501
513
  placeholder: "Search categories",
502
514
  "leading-icon": { name: "search", color: "" },
503
515
  class: "flex-1 min-w-[200px]"
504
516
  }, null, 8, ["modelValue"])
505
517
  ]),
506
518
  createElementVNode("div", _hoisted_7$a, [
507
- a.value.length > 0 ? (openBlock(), createBlock(D, { key: 0 }, {
519
+ a.value.length > 0 ? (openBlock(), createBlock(T, { key: 0 }, {
508
520
  default: withCtx(() => [
509
- (openBlock(!0), createElementBlock(Fragment, null, renderList(a.value, (w) => (openBlock(), createBlock(N, {
510
- key: w.id,
521
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(a.value, (R) => (openBlock(), createBlock($, {
522
+ key: R.id,
511
523
  clickable: !0,
512
- onClick: (O) => v(w.id)
524
+ onClick: (A) => f(R.id)
513
525
  }, {
514
526
  leading: withCtx(() => [
515
- createVNode(F, {
516
- "model-value": c.value[w.id] || !1,
517
- value: w.id,
518
- "onUpdate:modelValue": (O) => v(w.id),
519
- onClick: m[1] || (m[1] = withModifiers(() => {
527
+ createVNode(w, {
528
+ "model-value": u.value[R.id] || !1,
529
+ value: R.id,
530
+ "onUpdate:modelValue": (A) => f(R.id),
531
+ onClick: p[1] || (p[1] = withModifiers(() => {
520
532
  }, ["stop"]))
521
533
  }, null, 8, ["model-value", "value", "onUpdate:modelValue"])
522
534
  ]),
@@ -528,8 +540,8 @@ const _hoisted_1$r = {
528
540
  class: "text-fm-color-typo-secondary"
529
541
  }),
530
542
  createElementVNode("div", null, [
531
- createElementVNode("div", _hoisted_9$9, toDisplayString(w.name), 1),
532
- createElementVNode("div", _hoisted_10$8, " ID: " + toDisplayString(w.id), 1)
543
+ createElementVNode("div", _hoisted_9$9, toDisplayString(R.name), 1),
544
+ createElementVNode("div", _hoisted_10$8, " ID: " + toDisplayString(R.id), 1)
533
545
  ])
534
546
  ])
535
547
  ]),
@@ -545,13 +557,13 @@ const _hoisted_1$r = {
545
557
  createVNode(x, {
546
558
  variant: "secondary",
547
559
  label: "Cancel",
548
- onClick: y
560
+ onClick: g
549
561
  }),
550
562
  createVNode(x, {
551
563
  variant: "primary",
552
- label: `Confirm Selection (${r.value})`,
553
- disabled: r.value === 0,
554
- onClick: k
564
+ label: `Confirm Selection (${s.value})`,
565
+ disabled: s.value === 0,
566
+ onClick: V
555
567
  }, null, 8, ["label", "disabled"])
556
568
  ])
557
569
  ])) : createCommentVNode("", !0);
@@ -563,14 +575,14 @@ const _hoisted_1$r = {
563
575
  }, _hoisted_3$i = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$h = { class: "text-fm-color-typo-secondary" }, _hoisted_5$e = { key: 0 }, _hoisted_6$a = { class: "space-y-24" }, _hoisted_7$9 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-4" }, _hoisted_8$8 = { key: 0 }, _hoisted_9$8 = { class: "fm-typo-en-body-md-600 mb-8 block" }, _hoisted_10$7 = { key: 1 }, _hoisted_11$5 = { key: 2 }, _hoisted_12$4 = { key: 0 }, _hoisted_13$4 = { class: "space-y-8" }, _hoisted_14$4 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_15$3 = { class: "flex items-center gap-8" }, _hoisted_16$2 = { class: "fm-typo-en-body-md-400" }, _hoisted_17$2 = { key: 3 }, _hoisted_18$2 = { key: 0 }, _hoisted_19$2 = { class: "space-y-8" }, _hoisted_20$2 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_21$1 = { class: "flex items-center gap-8" }, _hoisted_22$1 = { class: "fm-typo-en-body-md-400" }, _hoisted_23$1 = {
564
576
  key: 0,
565
577
  class: "mt-16 p-12 bg-fm-color-feedback-error-light rounded-8 border border-fm-color-feedback-error-main"
566
- }, _hoisted_24$1 = { class: "flex items-center gap-8 mb-8 text-fm-color-system-error-300" }, _hoisted_25 = { class: "space-y-4" }, _hoisted_26 = { class: "flex gap-16" }, _sfc_main$r = /* @__PURE__ */ defineComponent({
578
+ }, _hoisted_24$1 = { class: "flex items-center gap-8 mb-8 text-fm-color-system-error-300" }, _hoisted_25$1 = { class: "space-y-4" }, _hoisted_26$1 = { class: "flex gap-16" }, _sfc_main$r = /* @__PURE__ */ defineComponent({
567
579
  __name: "GrabEffectSheet",
568
580
  props: {
569
581
  modelValue: { type: Object }
570
582
  },
571
583
  emits: ["update:model-value"],
572
- setup(e, { emit: s }) {
573
- const o = e, d = s, i = Zh(), c = ref(!1), l = ref(!1), n = ref(!1), a = ref({
584
+ setup(e, { emit: r }) {
585
+ const o = e, m = r, i = Zh(), u = ref(!1), l = ref(!1), n = ref(!1), a = ref({
574
586
  type: "net",
575
587
  value: 0,
576
588
  scope: {
@@ -586,56 +598,56 @@ const _hoisted_1$r = {
586
598
  ), onMounted(async () => {
587
599
  await i.store.getMenu();
588
600
  });
589
- const r = computed(() => {
601
+ const s = computed(() => {
590
602
  var b;
591
- return !(!a.value.type || !((b = a.value.scope) != null && b.type) || f(a.value.type) && (!a.value.value || a.value.value <= 0) || (a.value.scope.type === "items" || a.value.scope.type === "category") && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0));
603
+ return !(!a.value.type || !((b = a.value.scope) != null && b.type) || c(a.value.type) && (!a.value.value || a.value.value <= 0) || (a.value.scope.type === "items" || a.value.scope.type === "category") && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0));
592
604
  });
593
- async function p(b) {
594
- b.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && d("update:model-value", null);
605
+ async function y(b) {
606
+ b.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && m("update:model-value", null);
595
607
  }
596
- function v() {
608
+ function f() {
597
609
  var b;
598
610
  return C(((b = a.value.scope) == null ? void 0 : b.type) || "order");
599
611
  }
600
- function f(b) {
612
+ function c(b) {
601
613
  return b && !["freeItem", "delivery"].includes(b);
602
614
  }
603
- function V(b) {
615
+ function k(b) {
604
616
  return b && ["percentage", "bundleSamePercentage", "bundleDiffPercentage"].includes(
605
617
  b
606
618
  );
607
619
  }
608
- function k(b) {
620
+ function V(b) {
609
621
  return b != null && b.includes("Percentage") ? "Discount percentage" : b != null && b.includes("FixPrice") ? "Bundle fixed price" : b === "percentage" ? "Discount percentage" : "Discount amount";
610
622
  }
611
- function y(b) {
623
+ function g(b) {
612
624
  return b != null && b.includes("Percentage") || b === "percentage" ? "10" : "5.00";
613
625
  }
614
- function g(b) {
626
+ function v(b) {
615
627
  return b != null && b.includes("Percentage") || b === "percentage" ? "%" : "$";
616
628
  }
617
- function u(b, B) {
629
+ function d(b, E) {
618
630
  a.value = {
619
631
  ...a.value,
620
- [b]: B
632
+ [b]: E
621
633
  };
622
634
  }
623
- function m(b, B) {
635
+ function p(b, E) {
624
636
  var U;
625
- const T = {
637
+ const F = {
626
638
  ...a.value.scope,
627
- [b]: B
639
+ [b]: E
628
640
  };
629
641
  if (a.value = {
630
642
  ...a.value,
631
- scope: T
643
+ scope: F
632
644
  }, b === "type") {
633
- const P = C(B);
634
- P.some(
635
- (h) => h.value === a.value.type
645
+ const O = C(E);
646
+ O.some(
647
+ (H) => H.value === a.value.type
636
648
  ) || (a.value = {
637
649
  ...a.value,
638
- type: ((U = P[0]) == null ? void 0 : U.value) || "net",
650
+ type: ((U = O[0]) == null ? void 0 : U.value) || "net",
639
651
  // Reset value and cap when changing to incompatible type
640
652
  value: 0,
641
653
  cap: void 0
@@ -701,98 +713,98 @@ const _hoisted_1$r = {
701
713
  return "Select how you want to apply the discount.";
702
714
  }
703
715
  }
704
- function $() {
716
+ function N() {
705
717
  var b;
706
718
  return ((b = a.value.scope) == null ? void 0 : b.type) === "items";
707
719
  }
708
- function F() {
720
+ function w() {
709
721
  var b;
710
722
  return ((b = a.value.scope) == null ? void 0 : b.type) === "category";
711
723
  }
712
- function N() {
713
- var T;
714
- const b = (T = a.value.scope) == null ? void 0 : T.objectIDs;
724
+ function $() {
725
+ var F;
726
+ const b = (F = a.value.scope) == null ? void 0 : F.objectIDs;
715
727
  if (!b || b.length === 0)
716
728
  return "No items selected";
717
- const B = i.menu.value;
718
- return B && b.length <= 3 ? b.map((P) => {
719
- const A = B.modules.item.find((h) => h._id === P);
720
- return A ? (A.name2 || A.name).trim() : `Item ${P}`;
729
+ const E = i.menu.value;
730
+ return E && b.length <= 3 ? b.map((O) => {
731
+ const P = E.modules.item.find((H) => H._id === O);
732
+ return P ? (P.name2 || P.name).trim() : `Item ${O}`;
721
733
  }).join(", ") : b.length === 1 ? "1 item selected" : `${b.length} items selected`;
722
734
  }
723
- function D() {
724
- var T;
725
- const b = (T = a.value.scope) == null ? void 0 : T.objectIDs;
735
+ function T() {
736
+ var F;
737
+ const b = (F = a.value.scope) == null ? void 0 : F.objectIDs;
726
738
  if (!b || b.length === 0)
727
739
  return "No categories selected";
728
- const B = i.menu.value;
729
- return B && b.length <= 3 ? b.map((P) => {
730
- const A = B.modules.category.find((h) => h._id === P);
731
- return A ? A.name : `Category ${P}`;
740
+ const E = i.menu.value;
741
+ return E && b.length <= 3 ? b.map((O) => {
742
+ const P = E.modules.category.find((H) => H._id === O);
743
+ return P ? P.name : `Category ${O}`;
732
744
  }).join(", ") : b.length === 1 ? "1 category selected" : `${b.length} categories selected`;
733
745
  }
734
- function w() {
746
+ function R() {
735
747
  l.value = !0;
736
748
  }
737
- function O() {
749
+ function A() {
738
750
  n.value = !0;
739
751
  }
740
- function j(b) {
741
- m("objectIDs", b), l.value = !1;
752
+ function M(b) {
753
+ p("objectIDs", b), l.value = !1;
742
754
  }
743
755
  function I(b) {
744
- m("objectIDs", b), n.value = !1;
756
+ p("objectIDs", b), n.value = !1;
745
757
  }
746
- function H() {
758
+ function X() {
747
759
  l.value = !1;
748
760
  }
749
- function q() {
761
+ function K() {
750
762
  n.value = !1;
751
763
  }
752
- const G = computed(() => {
753
- var B, T, U;
764
+ const Z = computed(() => {
765
+ var E, F, U;
754
766
  const b = [];
755
- return a.value.type || b.push("Discount type is required"), (B = a.value.scope) != null && B.type || b.push("Scope type is required"), f(a.value.type) && (!a.value.value || a.value.value <= 0) && b.push("Discount amount must be greater than 0"), ((T = a.value.scope) == null ? void 0 : T.type) === "items" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && b.push("Please select at least one item"), ((U = a.value.scope) == null ? void 0 : U.type) === "category" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && b.push("Please select at least one category"), b;
767
+ return a.value.type || b.push("Discount type is required"), (E = a.value.scope) != null && E.type || b.push("Scope type is required"), c(a.value.type) && (!a.value.value || a.value.value <= 0) && b.push("Discount amount must be greater than 0"), ((F = a.value.scope) == null ? void 0 : F.type) === "items" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && b.push("Please select at least one item"), ((U = a.value.scope) == null ? void 0 : U.type) === "category" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && b.push("Please select at least one category"), b;
756
768
  });
757
- function Y() {
758
- d("update:model-value", a.value), c.value = !1;
769
+ function W() {
770
+ m("update:model-value", a.value), u.value = !1;
759
771
  }
760
- const Z = [
772
+ const Y = [
761
773
  { label: "Bill discount", value: "order" },
762
774
  { label: "Item discount", value: "items" },
763
775
  { label: "Category discount", value: "category" }
764
776
  ];
765
- return (b, B) => {
766
- const T = resolveComponent("FmButton"), U = resolveComponent("FmSelect"), P = resolveComponent("FmStepperField"), A = resolveComponent("FmIcon"), h = resolveComponent("FmSideSheet");
767
- return openBlock(), createBlock(h, {
777
+ return (b, E) => {
778
+ const F = resolveComponent("FmButton"), U = resolveComponent("FmSelect"), O = resolveComponent("FmStepperField"), P = resolveComponent("FmIcon"), H = resolveComponent("FmSideSheet");
779
+ return openBlock(), createBlock(H, {
768
780
  "max-width": 550,
769
781
  header: "Apply discount",
770
- modelValue: unref(c),
782
+ modelValue: unref(u),
771
783
  "onUpdate:modelValue": [
772
- B[5] || (B[5] = (E) => isRef(c) ? c.value = E : null),
773
- B[6] || (B[6] = (E) => c.value = E)
784
+ E[5] || (E[5] = (L) => isRef(u) ? u.value = L : null),
785
+ E[6] || (E[6] = (L) => u.value = L)
774
786
  ]
775
787
  }, {
776
788
  "side-sheet-button": withCtx(() => {
777
- var E, R, M, S;
789
+ var L, j, G, h;
778
790
  return [
779
791
  createElementVNode("div", _hoisted_1$p, [
780
- B[7] || (B[7] = createElementVNode("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Configure the Grab campaign discount you want to offer your customers. ", -1)),
792
+ E[7] || (E[7] = createElementVNode("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Configure the Grab campaign discount you want to offer your customers. ", -1)),
781
793
  e.modelValue ? (openBlock(), createElementBlock("div", _hoisted_2$l, [
782
794
  createElementVNode("div", _hoisted_3$i, [
783
- createElementVNode("div", null, toDisplayString((E = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : E.type), 1),
795
+ createElementVNode("div", null, toDisplayString((L = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : L.type), 1),
784
796
  createElementVNode("div", _hoisted_4$h, [
785
- createTextVNode(toDisplayString((R = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : R.adjustment) + " ", 1),
786
- (M = unref(summarizeGrabDiscount)(e.modelValue)) != null && M.cap ? (openBlock(), createElementBlock("span", _hoisted_5$e, toDisplayString((S = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : S.cap), 1)) : createCommentVNode("", !0)
797
+ createTextVNode(toDisplayString((j = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : j.adjustment) + " ", 1),
798
+ (G = unref(summarizeGrabDiscount)(e.modelValue)) != null && G.cap ? (openBlock(), createElementBlock("span", _hoisted_5$e, toDisplayString((h = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : h.cap), 1)) : createCommentVNode("", !0)
787
799
  ])
788
800
  ]),
789
- createVNode(T, {
801
+ createVNode(F, {
790
802
  icon: "delete",
791
803
  "icon-color": "neutral-gray-400",
792
804
  variant: "tertiary",
793
- onClick: p
805
+ onClick: y
794
806
  })
795
- ])) : (openBlock(), createBlock(T, {
807
+ ])) : (openBlock(), createBlock(F, {
796
808
  key: 0,
797
809
  label: "Apply Grab discount",
798
810
  icon: "add",
@@ -804,135 +816,135 @@ const _hoisted_1$r = {
804
816
  ];
805
817
  }),
806
818
  "side-sheet-footer": withCtx(() => [
807
- createElementVNode("div", _hoisted_26, [
808
- createVNode(T, {
819
+ createElementVNode("div", _hoisted_26$1, [
820
+ createVNode(F, {
809
821
  variant: "secondary",
810
822
  label: "Cancel",
811
823
  class: "flex-1",
812
- onClick: B[4] || (B[4] = (E) => c.value = !1)
824
+ onClick: E[4] || (E[4] = (L) => u.value = !1)
813
825
  }),
814
- createVNode(T, {
826
+ createVNode(F, {
815
827
  variant: "primary",
816
- label: unref(r) ? "Confirm" : "Complete Required Fields",
828
+ label: unref(s) ? "Confirm" : "Complete Required Fields",
817
829
  class: "flex-1",
818
- disabled: !unref(r),
819
- onClick: Y
830
+ disabled: !unref(s),
831
+ onClick: W
820
832
  }, null, 8, ["label", "disabled"])
821
833
  ])
822
834
  ]),
823
835
  default: withCtx(() => {
824
- var E, R, M, S;
836
+ var L, j, G, h;
825
837
  return [
826
838
  createElementVNode("div", _hoisted_6$a, [
827
839
  createElementVNode("div", null, [
828
- B[8] || (B[8] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Campaign type", -1)),
840
+ E[8] || (E[8] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Campaign type", -1)),
829
841
  createVNode(U, {
830
- "model-value": ((E = unref(a).scope) == null ? void 0 : E.type) || "order",
831
- "onUpdate:modelValue": B[0] || (B[0] = (L) => m("type", L)),
842
+ "model-value": ((L = unref(a).scope) == null ? void 0 : L.type) || "order",
843
+ "onUpdate:modelValue": E[0] || (E[0] = (B) => p("type", B)),
832
844
  placeholder: "Select campaign type",
833
- items: Z
845
+ items: Y
834
846
  }, null, 8, ["model-value"]),
835
- createElementVNode("div", _hoisted_7$9, toDisplayString(x((R = unref(a).scope) == null ? void 0 : R.type)), 1)
847
+ createElementVNode("div", _hoisted_7$9, toDisplayString(x((j = unref(a).scope) == null ? void 0 : j.type)), 1)
836
848
  ]),
837
849
  createElementVNode("div", null, [
838
- B[9] || (B[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
850
+ E[9] || (E[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
839
851
  createVNode(U, {
840
852
  "model-value": unref(a).type,
841
- "onUpdate:modelValue": B[1] || (B[1] = (L) => u("type", L)),
853
+ "onUpdate:modelValue": E[1] || (E[1] = (B) => d("type", B)),
842
854
  placeholder: "Select discount type",
843
- items: v()
855
+ items: f()
844
856
  }, null, 8, ["model-value", "items"])
845
857
  ]),
846
- f(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_8$8, [
847
- createElementVNode("label", _hoisted_9$8, toDisplayString(k(unref(a).type)), 1),
848
- createVNode(P, {
858
+ c(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_8$8, [
859
+ createElementVNode("label", _hoisted_9$8, toDisplayString(V(unref(a).type)), 1),
860
+ createVNode(O, {
849
861
  modelValue: unref(a).value,
850
- "onUpdate:modelValue": B[2] || (B[2] = (L) => unref(a).value = L),
851
- placeholder: y(unref(a).type),
852
- suffix: g(unref(a).type),
862
+ "onUpdate:modelValue": E[2] || (E[2] = (B) => unref(a).value = B),
863
+ placeholder: g(unref(a).type),
864
+ suffix: v(unref(a).type),
853
865
  type: "number"
854
866
  }, null, 8, ["modelValue", "placeholder", "suffix"])
855
867
  ])) : createCommentVNode("", !0),
856
- V(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_10$7, [
857
- B[10] || (B[10] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount cap (optional)", -1)),
858
- createVNode(P, {
868
+ k(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_10$7, [
869
+ E[10] || (E[10] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount cap (optional)", -1)),
870
+ createVNode(O, {
859
871
  modelValue: unref(a).cap,
860
- "onUpdate:modelValue": B[3] || (B[3] = (L) => unref(a).cap = L),
872
+ "onUpdate:modelValue": E[3] || (E[3] = (B) => unref(a).cap = B),
861
873
  placeholder: "Maximum discount amount",
862
874
  type: "number"
863
875
  }, null, 8, ["modelValue"])
864
876
  ])) : createCommentVNode("", !0),
865
- $() ? (openBlock(), createElementBlock("div", _hoisted_11$5, [
877
+ N() ? (openBlock(), createElementBlock("div", _hoisted_11$5, [
866
878
  unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_12$4, [
867
- B[12] || (B[12] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Items", -1)),
879
+ E[12] || (E[12] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Items", -1)),
868
880
  createElementVNode("div", _hoisted_13$4, [
869
881
  createElementVNode("div", _hoisted_14$4, [
870
882
  createElementVNode("div", _hoisted_15$3, [
871
- createVNode(A, {
883
+ createVNode(P, {
872
884
  name: "restaurant",
873
885
  size: "md"
874
886
  }),
875
- createElementVNode("span", _hoisted_16$2, toDisplayString(N()), 1)
887
+ createElementVNode("span", _hoisted_16$2, toDisplayString($()), 1)
876
888
  ]),
877
- createVNode(T, {
889
+ createVNode(F, {
878
890
  variant: "secondary",
879
891
  label: "Select Items",
880
892
  icon: "chevron_right",
881
- onClick: w
893
+ onClick: R
882
894
  })
883
895
  ]),
884
- B[11] || (B[11] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which items this discount applies to. Bundle discounts require multiple items. ", -1))
896
+ E[11] || (E[11] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which items this discount applies to. Bundle discounts require multiple items. ", -1))
885
897
  ])
886
898
  ])),
887
899
  createVNode(_sfc_main$t, {
888
900
  visible: unref(l),
889
- "initial-value": ((M = unref(a).scope) == null ? void 0 : M.objectIDs) || [],
890
- onConfirm: j,
891
- onCancel: H
901
+ "initial-value": ((G = unref(a).scope) == null ? void 0 : G.objectIDs) || [],
902
+ onConfirm: M,
903
+ onCancel: X
892
904
  }, null, 8, ["visible", "initial-value"])
893
905
  ])) : createCommentVNode("", !0),
894
- F() ? (openBlock(), createElementBlock("div", _hoisted_17$2, [
906
+ w() ? (openBlock(), createElementBlock("div", _hoisted_17$2, [
895
907
  unref(n) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_18$2, [
896
- B[14] || (B[14] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Categories", -1)),
908
+ E[14] || (E[14] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Categories", -1)),
897
909
  createElementVNode("div", _hoisted_19$2, [
898
910
  createElementVNode("div", _hoisted_20$2, [
899
911
  createElementVNode("div", _hoisted_21$1, [
900
- createVNode(A, {
912
+ createVNode(P, {
901
913
  name: "category",
902
914
  size: "md"
903
915
  }),
904
- createElementVNode("span", _hoisted_22$1, toDisplayString(D()), 1)
916
+ createElementVNode("span", _hoisted_22$1, toDisplayString(T()), 1)
905
917
  ]),
906
- createVNode(T, {
918
+ createVNode(F, {
907
919
  variant: "secondary",
908
920
  label: "Select Categories",
909
921
  icon: "chevron_right",
910
- onClick: O
922
+ onClick: A
911
923
  })
912
924
  ]),
913
- B[13] || (B[13] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. ", -1))
925
+ E[13] || (E[13] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. ", -1))
914
926
  ])
915
927
  ])),
916
928
  createVNode(_sfc_main$s, {
917
929
  visible: unref(n),
918
- "initial-value": ((S = unref(a).scope) == null ? void 0 : S.objectIDs) || [],
930
+ "initial-value": ((h = unref(a).scope) == null ? void 0 : h.objectIDs) || [],
919
931
  onConfirm: I,
920
- onCancel: q
932
+ onCancel: K
921
933
  }, null, 8, ["visible", "initial-value"])
922
934
  ])) : createCommentVNode("", !0)
923
935
  ]),
924
- unref(G).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23$1, [
936
+ unref(Z).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23$1, [
925
937
  createElementVNode("div", _hoisted_24$1, [
926
- createVNode(A, { name: "warning" }),
927
- B[15] || (B[15] = createElementVNode("span", { class: "fm-typo-en-body-sm-600" }, "Please fix the following issues:", -1))
938
+ createVNode(P, { name: "warning" }),
939
+ E[15] || (E[15] = createElementVNode("span", { class: "fm-typo-en-body-sm-600" }, "Please fix the following issues:", -1))
928
940
  ]),
929
- createElementVNode("ul", _hoisted_25, [
930
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(G), (L) => (openBlock(), createElementBlock("li", {
931
- key: L,
941
+ createElementVNode("ul", _hoisted_25$1, [
942
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(Z), (B) => (openBlock(), createElementBlock("li", {
943
+ key: B,
932
944
  class: "fm-typo-en-body-sm-400 text-fm-color-feedback-error-main flex items-start gap-8"
933
945
  }, [
934
- B[16] || (B[16] = createElementVNode("span", { class: "w-4 h-4 bg-fm-color-feedback-error-main rounded-full mt-6 flex-shrink-0" }, null, -1)),
935
- createTextVNode(" " + toDisplayString(L), 1)
946
+ E[16] || (E[16] = createElementVNode("span", { class: "w-4 h-4 bg-fm-color-feedback-error-main rounded-full mt-6 flex-shrink-0" }, null, -1)),
947
+ createTextVNode(" " + toDisplayString(B), 1)
936
948
  ]))), 128))
937
949
  ])
938
950
  ])) : createCommentVNode("", !0)
@@ -952,83 +964,83 @@ const _hoisted_1$r = {
952
964
  }
953
965
  },
954
966
  emits: ["update:model-value"],
955
- setup(e, { emit: s }) {
956
- const { t: o } = useI18n(), d = e, i = s, c = ref(
957
- !d.modelValue || !d.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(d.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
967
+ setup(e, { emit: r }) {
968
+ const { t: o } = useI18n(), m = e, i = r, u = ref(
969
+ !m.modelValue || !m.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(m.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
958
970
  );
959
- watch(c, async (n, a) => {
960
- var r;
961
- if (a == "custom" && n == "all_time" && RuleBuilder.getRules((r = d.modelValue) == null ? void 0 : r.rules.g_time).length > 0) {
962
- const p = await prompt.confirm(
971
+ watch(u, async (n, a) => {
972
+ var s;
973
+ if (a == "custom" && n == "all_time" && RuleBuilder.getRules((s = m.modelValue) == null ? void 0 : s.rules.g_time).length > 0) {
974
+ const y = await prompt.confirm(
963
975
  o("connect.template.rule.time.confirm_remove"),
964
976
  o("connect.common.confirm"),
965
977
  o("connect.common.confirm"),
966
978
  o("connect.common.cancel")
967
979
  );
968
- p && i(
980
+ y && i(
969
981
  "update:model-value",
970
982
  RuleBuilder.setRuleToGroup(
971
- d.modelValue ?? RuleBuilder.scaffoldGroup(),
983
+ m.modelValue ?? RuleBuilder.scaffoldGroup(),
972
984
  RuleBuilder.scaffoldGroup("g_time")
973
985
  )
974
- ), c.value = p ? n : a;
986
+ ), u.value = y ? n : a;
975
987
  }
976
988
  });
977
989
  async function l(n) {
978
990
  var a;
979
- if (n == "custom" && RuleBuilder.getRules((a = d.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
991
+ if (n == "custom" && RuleBuilder.getRules((a = m.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
980
992
  if (!await prompt.confirm(
981
993
  o("connect.template.rule.time.confirm_remove"),
982
994
  o("connect.common.confirm"),
983
995
  o("connect.common.confirm"),
984
996
  o("connect.common.cancel")
985
997
  )) {
986
- c.value = "all_time";
998
+ u.value = "all_time";
987
999
  return;
988
1000
  }
989
1001
  i(
990
1002
  "update:model-value",
991
1003
  RuleBuilder.setRuleToGroup(
992
- d.modelValue ?? RuleBuilder.scaffoldGroup(),
1004
+ m.modelValue ?? RuleBuilder.scaffoldGroup(),
993
1005
  RuleBuilder.scaffoldGroup("g_time")
994
1006
  )
995
1007
  );
996
1008
  }
997
1009
  }
998
1010
  return (n, a) => {
999
- var v;
1000
- const r = resolveComponent("FmRadio"), p = resolveComponent("FmRadioGroup");
1011
+ var f;
1012
+ const s = resolveComponent("FmRadio"), y = resolveComponent("FmRadioGroup");
1001
1013
  return openBlock(), createElementBlock("div", _hoisted_1$o, [
1002
- createVNode(p, {
1003
- modelValue: unref(c),
1014
+ createVNode(y, {
1015
+ modelValue: unref(u),
1004
1016
  "onUpdate:modelValue": [
1005
- a[0] || (a[0] = (f) => isRef(c) ? c.value = f : null),
1006
- a[1] || (a[1] = (f) => l(f))
1017
+ a[0] || (a[0] = (c) => isRef(u) ? u.value = c : null),
1018
+ a[1] || (a[1] = (c) => l(c))
1007
1019
  ]
1008
1020
  }, {
1009
1021
  default: withCtx(() => [
1010
- createVNode(r, {
1022
+ createVNode(s, {
1011
1023
  label: unref(o)("connect.template.rule.time.all_time"),
1012
1024
  value: "all_time"
1013
1025
  }, null, 8, ["label"]),
1014
- createVNode(r, {
1026
+ createVNode(s, {
1015
1027
  label: unref(o)("connect.template.rule.time.custom"),
1016
1028
  value: "custom"
1017
1029
  }, null, 8, ["label"])
1018
1030
  ]),
1019
1031
  _: 1
1020
1032
  }, 8, ["modelValue"]),
1021
- unref(c) == "custom" ? (openBlock(), createBlock(_sfc_main$u, {
1033
+ unref(u) == "custom" ? (openBlock(), createBlock(_sfc_main$u, {
1022
1034
  key: 0,
1023
1035
  class: "!mt-[0px]",
1024
1036
  "include-only": "trigger",
1025
1037
  "trigger-type": "SCHEDULE",
1026
- "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
1027
- "onUpdate:modelValue": a[2] || (a[2] = (f) => i(
1038
+ "model-value": ((f = e.modelValue) == null ? void 0 : f.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
1039
+ "onUpdate:modelValue": a[2] || (a[2] = (c) => i(
1028
1040
  "update:model-value",
1029
1041
  unref(RuleBuilder).setRuleToGroup(
1030
1042
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
1031
- f,
1043
+ c,
1032
1044
  "&&"
1033
1045
  )
1034
1046
  ))
@@ -1044,10 +1056,10 @@ const _hoisted_1$r = {
1044
1056
  }
1045
1057
  },
1046
1058
  emits: ["update:model-value"],
1047
- setup(e, { emit: s }) {
1048
- const { t: o } = useI18n(), d = e, i = s, c = computed(() => {
1059
+ setup(e, { emit: r }) {
1060
+ const { t: o } = useI18n(), m = e, i = r, u = computed(() => {
1049
1061
  const { property: l, operator: n, equator: a } = RuleBuilder.simplify(
1050
- d.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
1062
+ m.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
1051
1063
  op: "before",
1052
1064
  x: 1
1053
1065
  })
@@ -1059,12 +1071,12 @@ const _hoisted_1$r = {
1059
1071
  };
1060
1072
  });
1061
1073
  return (l, n) => {
1062
- const a = resolveComponent("FmRadio"), r = resolveComponent("FmStepperField");
1074
+ const a = resolveComponent("FmRadio"), s = resolveComponent("FmStepperField");
1063
1075
  return openBlock(), createElementBlock("div", null, [
1064
1076
  createVNode(a, {
1065
1077
  label: unref(o)("connect.template.rule.birthday.on_birthday"),
1066
1078
  value: "_isRange-day",
1067
- "model-value": `${unref(c).operator}-${unref(c).equator.unit}`,
1079
+ "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
1068
1080
  "onUpdate:modelValue": n[0] || (n[0] = () => {
1069
1081
  i(
1070
1082
  "update:model-value",
@@ -1079,7 +1091,7 @@ const _hoisted_1$r = {
1079
1091
  createVNode(a, {
1080
1092
  label: unref(o)("connect.template.rule.birthday.days_before"),
1081
1093
  value: "_isDay",
1082
- "model-value": unref(c).operator,
1094
+ "model-value": unref(u).operator,
1083
1095
  "onUpdate:modelValue": n[1] || (n[1] = () => {
1084
1096
  i(
1085
1097
  "update:model-value",
@@ -1091,16 +1103,16 @@ const _hoisted_1$r = {
1091
1103
  );
1092
1104
  })
1093
1105
  }, null, 8, ["label", "model-value"]),
1094
- unref(c).operator == "_isDay" ? (openBlock(), createBlock(r, {
1106
+ unref(u).operator == "_isDay" ? (openBlock(), createBlock(s, {
1095
1107
  key: 0,
1096
1108
  label: unref(o)("connect.template.rule.birthday.days_before_label"),
1097
1109
  "show-steppers": !1,
1098
- "model-value": unref(c).equator.x,
1099
- "onUpdate:modelValue": n[2] || (n[2] = (p) => i(
1110
+ "model-value": unref(u).equator.x,
1111
+ "onUpdate:modelValue": n[2] || (n[2] = (y) => i(
1100
1112
  "update:model-value",
1101
1113
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
1102
1114
  op: "after",
1103
- x: p,
1115
+ x: y,
1104
1116
  ignoreYear: !0
1105
1117
  })
1106
1118
  ))
@@ -1108,7 +1120,7 @@ const _hoisted_1$r = {
1108
1120
  createVNode(a, {
1109
1121
  label: unref(o)("connect.template.rule.birthday.in_birthday_week"),
1110
1122
  value: "_isRange-week",
1111
- "model-value": `${unref(c).operator}-${unref(c).equator.unit}`,
1123
+ "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
1112
1124
  "onUpdate:modelValue": n[3] || (n[3] = () => {
1113
1125
  i(
1114
1126
  "update:model-value",
@@ -1123,7 +1135,7 @@ const _hoisted_1$r = {
1123
1135
  createVNode(a, {
1124
1136
  label: unref(o)("connect.template.rule.birthday.in_birthday_month"),
1125
1137
  value: "_isRange-month",
1126
- "model-value": `${unref(c).operator}-${unref(c).equator.unit}`,
1138
+ "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
1127
1139
  "onUpdate:modelValue": n[4] || (n[4] = () => {
1128
1140
  i(
1129
1141
  "update:model-value",
@@ -1154,31 +1166,31 @@ const _hoisted_1$r = {
1154
1166
  }
1155
1167
  },
1156
1168
  emits: ["update:model-value"],
1157
- setup(e, { emit: s }) {
1158
- const { t: o } = useI18n(), d = e, i = s, c = computed(() => d.disabled ? TypeToTriggerOptions[d.campaignType].filter(
1159
- (l) => l.value == d.modelValue
1160
- ) : TypeToTriggerOptions[d.campaignType]);
1169
+ setup(e, { emit: r }) {
1170
+ const { t: o } = useI18n(), m = e, i = r, u = computed(() => m.disabled ? TypeToTriggerOptions[m.campaignType].filter(
1171
+ (l) => l.value == m.modelValue
1172
+ ) : TypeToTriggerOptions[m.campaignType]);
1161
1173
  return (l, n) => {
1162
1174
  const a = resolveComponent("FmCard");
1163
1175
  return openBlock(), createElementBlock("div", _hoisted_1$n, [
1164
1176
  createElementVNode("div", _hoisted_2$k, toDisplayString(unref(o)("connect.campaign.trigger.description")), 1),
1165
1177
  createElementVNode("div", _hoisted_3$h, [
1166
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (r) => (openBlock(), createBlock(a, {
1178
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (s) => (openBlock(), createBlock(a, {
1167
1179
  variant: "outlined",
1168
- disabled: d.disabled,
1180
+ disabled: m.disabled,
1169
1181
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1170
- "col-span-3": unref(c).length == 1,
1171
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
1172
- "hover:bg-fm-color-opacity-sm": e.modelValue != r.value
1182
+ "col-span-3": unref(u).length == 1,
1183
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == s.value,
1184
+ "hover:bg-fm-color-opacity-sm": e.modelValue != s.value
1173
1185
  }]),
1174
1186
  onClick: () => {
1175
- d.modelValue != r.value && !d.disabled && i("update:model-value", r.value);
1187
+ m.modelValue != s.value && !m.disabled && i("update:model-value", s.value);
1176
1188
  },
1177
- key: r.name
1189
+ key: s.name
1178
1190
  }, {
1179
1191
  default: withCtx(() => [
1180
- createElementVNode("div", _hoisted_4$g, toDisplayString(r.name), 1),
1181
- createElementVNode("div", _hoisted_5$d, toDisplayString(r.description), 1)
1192
+ createElementVNode("div", _hoisted_4$g, toDisplayString(s.name), 1),
1193
+ createElementVNode("div", _hoisted_5$d, toDisplayString(s.description), 1)
1182
1194
  ]),
1183
1195
  _: 2
1184
1196
  }, 1032, ["disabled", "class", "onClick"]))), 128))
@@ -1199,10 +1211,10 @@ const _hoisted_1$r = {
1199
1211
  }
1200
1212
  },
1201
1213
  emits: ["update:model-value"],
1202
- setup(e, { emit: s }) {
1203
- const o = s;
1204
- return (d, i) => {
1205
- const c = resolveComponent("FmButton"), l = resolveComponent("FmField"), n = resolveComponent("FmDatePicker");
1214
+ setup(e, { emit: r }) {
1215
+ const o = r;
1216
+ return (m, i) => {
1217
+ const u = resolveComponent("FmButton"), l = resolveComponent("FmField"), n = resolveComponent("FmDatePicker");
1206
1218
  return openBlock(), createBlock(n, {
1207
1219
  label: e.label,
1208
1220
  "model-value": e.modelValue || "",
@@ -1215,11 +1227,11 @@ const _hoisted_1$r = {
1215
1227
  "icon-outlined": !a
1216
1228
  }, {
1217
1229
  append: withCtx(() => [
1218
- e.modelValue ? (openBlock(), createBlock(c, {
1230
+ e.modelValue ? (openBlock(), createBlock(u, {
1219
1231
  key: 0,
1220
1232
  variant: "tertiary",
1221
1233
  icon: "clear",
1222
- onClick: i[0] || (i[0] = (r) => (r.stopPropagation(), o("update:model-value", null)))
1234
+ onClick: i[0] || (i[0] = (s) => (s.stopPropagation(), o("update:model-value", null)))
1223
1235
  })) : createCommentVNode("", !0)
1224
1236
  ]),
1225
1237
  default: withCtx(() => [
@@ -1243,20 +1255,20 @@ const _hoisted_1$r = {
1243
1255
  }
1244
1256
  },
1245
1257
  emits: ["update:model-value"],
1246
- setup(e, { emit: s }) {
1247
- const { t: o } = useI18n(), d = s;
1248
- return (i, c) => {
1258
+ setup(e, { emit: r }) {
1259
+ const { t: o } = useI18n(), m = r;
1260
+ return (i, u) => {
1249
1261
  var l, n;
1250
1262
  return openBlock(), createElementBlock("div", _hoisted_1$m, [
1251
1263
  createElementVNode("div", _hoisted_2$j, [
1252
1264
  createVNode(_sfc_main$n, {
1253
1265
  "model-value": ((l = e.modelValue) == null ? void 0 : l.startDate) ?? null,
1254
1266
  label: unref(o)("connect.common.startDate"),
1255
- "onUpdate:modelValue": c[0] || (c[0] = (a) => {
1256
- var r;
1257
- return d("update:model-value", {
1267
+ "onUpdate:modelValue": u[0] || (u[0] = (a) => {
1268
+ var s;
1269
+ return m("update:model-value", {
1258
1270
  startDate: a,
1259
- endDate: ((r = e.modelValue) == null ? void 0 : r.endDate) ?? null
1271
+ endDate: ((s = e.modelValue) == null ? void 0 : s.endDate) ?? null
1260
1272
  });
1261
1273
  })
1262
1274
  }, null, 8, ["model-value", "label"])
@@ -1266,10 +1278,10 @@ const _hoisted_1$r = {
1266
1278
  createVNode(_sfc_main$n, {
1267
1279
  "model-value": ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null,
1268
1280
  label: unref(o)("connect.common.endDate"),
1269
- "onUpdate:modelValue": c[1] || (c[1] = (a) => {
1270
- var r;
1271
- return d("update:model-value", {
1272
- startDate: ((r = e.modelValue) == null ? void 0 : r.startDate) ?? null,
1281
+ "onUpdate:modelValue": u[1] || (u[1] = (a) => {
1282
+ var s;
1283
+ return m("update:model-value", {
1284
+ startDate: ((s = e.modelValue) == null ? void 0 : s.startDate) ?? null,
1273
1285
  endDate: a
1274
1286
  });
1275
1287
  })
@@ -1296,42 +1308,42 @@ const _hoisted_1$r = {
1296
1308
  }
1297
1309
  },
1298
1310
  emits: ["update:model-value"],
1299
- setup(e, { emit: s }) {
1300
- const { t: o } = useI18n(), d = e, i = s;
1301
- function c(V) {
1302
- i("update:model-value", { ...d.modelValue, ...V });
1311
+ setup(e, { emit: r }) {
1312
+ const { t: o } = useI18n(), m = e, i = r;
1313
+ function u(k) {
1314
+ i("update:model-value", { ...m.modelValue, ...k });
1303
1315
  }
1304
- function l(V, k) {
1305
- return V >= k ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
1316
+ function l(k, V) {
1317
+ return k >= V ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
1306
1318
  }
1307
- const n = computed(() => d.modelValue.buttons ?? []), a = computed(() => {
1308
- var V;
1309
- return ((V = d.modelValue.content) == null ? void 0 : V.length) ?? 0;
1319
+ const n = computed(() => m.modelValue.buttons ?? []), a = computed(() => {
1320
+ var k;
1321
+ return ((k = m.modelValue.content) == null ? void 0 : k.length) ?? 0;
1310
1322
  });
1311
- function r(V, k) {
1312
- c({
1323
+ function s(k, V) {
1324
+ u({
1313
1325
  buttons: n.value.map(
1314
- (y, g) => g === V ? { ...y, ...k } : y
1326
+ (g, v) => v === k ? { ...g, ...V } : g
1315
1327
  )
1316
1328
  });
1317
1329
  }
1318
- function p() {
1319
- n.value.length >= MAX_BUTTONS || c({ buttons: [...n.value, { label: "", url: "" }] });
1330
+ function y() {
1331
+ n.value.length >= MAX_BUTTONS || u({ buttons: [...n.value, { label: "", url: "" }] });
1320
1332
  }
1321
- function v(V) {
1322
- var y;
1323
- if (!d.showValidation) return { label: void 0, url: void 0 };
1324
- const k = (y = V.url) == null ? void 0 : y.trim();
1333
+ function f(k) {
1334
+ var g;
1335
+ if (!m.showValidation) return { label: void 0, url: void 0 };
1336
+ const V = (g = k.url) == null ? void 0 : g.trim();
1325
1337
  return {
1326
- label: V.label.trim() ? void 0 : o("connect.campaign.appInbox.buttonLabelRequired"),
1327
- url: k ? FdoBroadcastUrl.safeParse(k).success ? void 0 : o("connect.campaign.push.linkUrlInvalid") : o("connect.campaign.appInbox.buttonUrlRequired")
1338
+ label: k.label.trim() ? void 0 : o("connect.campaign.appInbox.buttonLabelRequired"),
1339
+ url: V ? FdoBroadcastUrl.safeParse(V).success ? void 0 : o("connect.campaign.push.linkUrlInvalid") : o("connect.campaign.appInbox.buttonUrlRequired")
1328
1340
  };
1329
1341
  }
1330
- function f(V) {
1331
- c({ buttons: n.value.filter((k, y) => y !== V) });
1342
+ function c(k) {
1343
+ u({ buttons: n.value.filter((V, g) => g !== k) });
1332
1344
  }
1333
- return (V, k) => {
1334
- const y = resolveComponent("FmTextField"), g = resolveComponent("FmButton");
1345
+ return (k, V) => {
1346
+ const g = resolveComponent("FmTextField"), v = resolveComponent("FmButton");
1335
1347
  return openBlock(), createElementBlock("div", _hoisted_1$l, [
1336
1348
  createElementVNode("div", null, [
1337
1349
  createElementVNode("div", _hoisted_2$i, [
@@ -1340,11 +1352,11 @@ const _hoisted_1$r = {
1340
1352
  class: normalizeClass(["fm-typo-en-body-sm-400", l(e.modelValue.title.length, TITLE_WARN_AT$1)])
1341
1353
  }, toDisplayString(e.modelValue.title.length) + " / " + toDisplayString(TITLE_LIMIT$1), 3)
1342
1354
  ]),
1343
- createVNode(y, {
1355
+ createVNode(g, {
1344
1356
  "model-value": e.modelValue.title,
1345
1357
  "max-length": TITLE_LIMIT$1,
1346
1358
  placeholder: unref(o)("connect.campaign.appInbox.titlePlaceholder"),
1347
- "onUpdate:modelValue": k[0] || (k[0] = (u) => c({ title: u }))
1359
+ "onUpdate:modelValue": V[0] || (V[0] = (d) => u({ title: d }))
1348
1360
  }, null, 8, ["model-value", "placeholder"])
1349
1361
  ]),
1350
1362
  createElementVNode("div", null, [
@@ -1354,11 +1366,11 @@ const _hoisted_1$r = {
1354
1366
  class: normalizeClass(["fm-typo-en-body-sm-400", l(e.modelValue.previewText.length, PREVIEW_WARN_AT)])
1355
1367
  }, toDisplayString(e.modelValue.previewText.length) + " / " + toDisplayString(PREVIEW_LIMIT), 3)
1356
1368
  ]),
1357
- createVNode(y, {
1369
+ createVNode(g, {
1358
1370
  "model-value": e.modelValue.previewText,
1359
1371
  "max-length": PREVIEW_LIMIT,
1360
1372
  placeholder: unref(o)("connect.campaign.appInbox.previewTextPlaceholder"),
1361
- "onUpdate:modelValue": k[1] || (k[1] = (u) => c({ previewText: u }))
1373
+ "onUpdate:modelValue": V[1] || (V[1] = (d) => u({ previewText: d }))
1362
1374
  }, null, 8, ["model-value", "placeholder"])
1363
1375
  ]),
1364
1376
  createElementVNode("div", _hoisted_6$9, [
@@ -1377,7 +1389,7 @@ const _hoisted_1$r = {
1377
1389
  variables: e.variables,
1378
1390
  "media-limit": 1,
1379
1391
  "button-label": unref(o)("connect.campaign.appInbox.editBodyMessage"),
1380
- "onUpdate:html": k[2] || (k[2] = (u) => c({ content: u.html }))
1392
+ "onUpdate:html": V[2] || (V[2] = (d) => u({ content: d.html }))
1381
1393
  }, null, 8, ["html", "variables", "button-label"])
1382
1394
  ]),
1383
1395
  createElementVNode("div", _hoisted_9$7, [
@@ -1385,43 +1397,43 @@ const _hoisted_1$r = {
1385
1397
  createElementVNode("span", _hoisted_11$4, toDisplayString(unref(o)("connect.campaign.appInbox.buttons")), 1),
1386
1398
  createElementVNode("span", _hoisted_12$3, toDisplayString(unref(n).length) + " / " + toDisplayString(MAX_BUTTONS), 1)
1387
1399
  ]),
1388
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (u, m) => (openBlock(), createElementBlock("div", {
1389
- key: m,
1400
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (d, p) => (openBlock(), createElementBlock("div", {
1401
+ key: p,
1390
1402
  class: "flex flex-wrap items-start gap-8"
1391
1403
  }, [
1392
1404
  createElementVNode("div", _hoisted_13$3, [
1393
- createVNode(y, {
1394
- "model-value": u.label,
1405
+ createVNode(g, {
1406
+ "model-value": d.label,
1395
1407
  "max-length": 20,
1396
1408
  placeholder: unref(o)("connect.campaign.appInbox.buttonLabel"),
1397
- "helper-state": v(u).label ? "error" : "none",
1398
- "helper-text": v(u).label,
1399
- "onUpdate:modelValue": (C) => r(m, { label: C })
1409
+ "helper-state": f(d).label ? "error" : "none",
1410
+ "helper-text": f(d).label,
1411
+ "onUpdate:modelValue": (C) => s(p, { label: C })
1400
1412
  }, null, 8, ["model-value", "placeholder", "helper-state", "helper-text", "onUpdate:modelValue"])
1401
1413
  ]),
1402
1414
  createElementVNode("div", _hoisted_14$3, [
1403
- createVNode(y, {
1404
- "model-value": u.url ?? "",
1415
+ createVNode(g, {
1416
+ "model-value": d.url ?? "",
1405
1417
  inputmode: "url",
1406
1418
  placeholder: unref(o)("connect.campaign.push.linkUrlPlaceholder"),
1407
- "helper-state": v(u).url ? "error" : "none",
1408
- "helper-text": v(u).url,
1409
- "onUpdate:modelValue": (C) => r(m, { url: C.trim() })
1419
+ "helper-state": f(d).url ? "error" : "none",
1420
+ "helper-text": f(d).url,
1421
+ "onUpdate:modelValue": (C) => s(p, { url: C.trim() })
1410
1422
  }, null, 8, ["model-value", "placeholder", "helper-state", "helper-text", "onUpdate:modelValue"])
1411
1423
  ]),
1412
- createVNode(g, {
1424
+ createVNode(v, {
1413
1425
  icon: "delete",
1414
1426
  "icon-color": "neutral-gray-400",
1415
1427
  variant: "tertiary",
1416
- onClick: (C) => f(m)
1428
+ onClick: (C) => c(p)
1417
1429
  }, null, 8, ["onClick"])
1418
1430
  ]))), 128)),
1419
- unref(n).length < MAX_BUTTONS ? (openBlock(), createBlock(g, {
1431
+ unref(n).length < MAX_BUTTONS ? (openBlock(), createBlock(v, {
1420
1432
  key: 0,
1421
1433
  variant: "tertiary",
1422
1434
  icon: "add",
1423
1435
  label: unref(o)("connect.campaign.appInbox.addButton"),
1424
- onClick: p
1436
+ onClick: y
1425
1437
  }, null, 8, ["label"])) : createCommentVNode("", !0)
1426
1438
  ])
1427
1439
  ]);
@@ -1447,73 +1459,73 @@ const _hoisted_1$r = {
1447
1459
  }
1448
1460
  },
1449
1461
  emits: ["update:model-value"],
1450
- setup(e, { emit: s }) {
1451
- const { t: o } = useI18n(), d = e, i = s, c = F_PUSH_DESTINATION.options, l = computed(() => d.modelValue.destination === "EXTERNAL"), n = computed(() => {
1452
- var f;
1453
- if (!d.showValidation || !l.value) return;
1454
- const v = (f = d.modelValue.url) == null ? void 0 : f.trim();
1455
- return v ? FdoBroadcastUrl.safeParse(v).success ? void 0 : o("connect.campaign.push.linkUrlInvalid") : o("connect.campaign.push.linkUrlRequired");
1462
+ setup(e, { emit: r }) {
1463
+ const { t: o } = useI18n(), m = e, i = r, u = F_PUSH_DESTINATION.options, l = computed(() => m.modelValue.destination === "EXTERNAL"), n = computed(() => {
1464
+ var c;
1465
+ if (!m.showValidation || !l.value) return;
1466
+ const f = (c = m.modelValue.url) == null ? void 0 : c.trim();
1467
+ return f ? FdoBroadcastUrl.safeParse(f).success ? void 0 : o("connect.campaign.push.linkUrlInvalid") : o("connect.campaign.push.linkUrlRequired");
1456
1468
  });
1457
- function a(v) {
1458
- i("update:model-value", { ...d.modelValue, ...v });
1469
+ function a(f) {
1470
+ i("update:model-value", { ...m.modelValue, ...f });
1459
1471
  }
1460
- function r(v) {
1461
- a(v === "EXTERNAL" ? { destination: v } : { destination: v, url: null });
1472
+ function s(f) {
1473
+ a(f === "EXTERNAL" ? { destination: f } : { destination: f, url: null });
1462
1474
  }
1463
- function p(v, f) {
1464
- return v >= f ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
1475
+ function y(f, c) {
1476
+ return f >= c ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
1465
1477
  }
1466
- return (v, f) => {
1467
- const V = resolveComponent("FmTextField"), k = resolveComponent("FmTextarea"), y = resolveComponent("FmSelect");
1478
+ return (f, c) => {
1479
+ const k = resolveComponent("FmTextField"), V = resolveComponent("FmTextarea"), g = resolveComponent("FmSelect");
1468
1480
  return openBlock(), createElementBlock("div", _hoisted_1$k, [
1469
1481
  createElementVNode("div", null, [
1470
1482
  createElementVNode("div", _hoisted_2$h, [
1471
1483
  createElementVNode("span", _hoisted_3$e, toDisplayString(unref(o)("connect.campaign.push.title")), 1),
1472
1484
  createElementVNode("span", {
1473
- class: normalizeClass(["fm-typo-en-body-sm-400", p(e.modelValue.title.length, TITLE_WARN_AT)])
1485
+ class: normalizeClass(["fm-typo-en-body-sm-400", y(e.modelValue.title.length, TITLE_WARN_AT)])
1474
1486
  }, toDisplayString(e.modelValue.title.length) + " / " + toDisplayString(TITLE_LIMIT), 3)
1475
1487
  ]),
1476
- createVNode(V, {
1488
+ createVNode(k, {
1477
1489
  "model-value": e.modelValue.title,
1478
1490
  "max-length": TITLE_LIMIT,
1479
1491
  placeholder: unref(o)("connect.campaign.push.titlePlaceholder"),
1480
- "onUpdate:modelValue": f[0] || (f[0] = (g) => a({ title: g }))
1492
+ "onUpdate:modelValue": c[0] || (c[0] = (v) => a({ title: v }))
1481
1493
  }, null, 8, ["model-value", "placeholder"])
1482
1494
  ]),
1483
1495
  createElementVNode("div", null, [
1484
1496
  createElementVNode("div", _hoisted_4$d, [
1485
1497
  createElementVNode("span", _hoisted_5$b, toDisplayString(unref(o)("connect.campaign.push.body")), 1),
1486
1498
  createElementVNode("span", {
1487
- class: normalizeClass(["fm-typo-en-body-sm-400", p(e.modelValue.body.length, BODY_WARN_AT)])
1499
+ class: normalizeClass(["fm-typo-en-body-sm-400", y(e.modelValue.body.length, BODY_WARN_AT)])
1488
1500
  }, toDisplayString(e.modelValue.body.length) + " / " + toDisplayString(BODY_LIMIT), 3)
1489
1501
  ]),
1490
- createVNode(k, {
1502
+ createVNode(V, {
1491
1503
  "model-value": e.modelValue.body,
1492
1504
  "max-length": BODY_LIMIT,
1493
1505
  placeholder: unref(o)("connect.campaign.push.bodyPlaceholder"),
1494
- "onUpdate:modelValue": f[1] || (f[1] = (g) => a({ body: g }))
1506
+ "onUpdate:modelValue": c[1] || (c[1] = (v) => a({ body: v }))
1495
1507
  }, null, 8, ["model-value", "placeholder"])
1496
1508
  ]),
1497
1509
  createElementVNode("div", null, [
1498
1510
  createElementVNode("div", _hoisted_6$8, toDisplayString(unref(o)("connect.campaign.push.link")), 1),
1499
- createVNode(y, {
1511
+ createVNode(g, {
1500
1512
  "model-value": e.modelValue.destination ?? "NONE",
1501
- items: unref(c).map((g) => ({
1502
- label: unref(o)(`connect.campaign.appInbox.destination.${g}`),
1503
- value: g
1513
+ items: unref(u).map((v) => ({
1514
+ label: unref(o)(`connect.campaign.appInbox.destination.${v}`),
1515
+ value: v
1504
1516
  })),
1505
- "onUpdate:modelValue": f[2] || (f[2] = (g) => r(g))
1517
+ "onUpdate:modelValue": c[2] || (c[2] = (v) => s(v))
1506
1518
  }, null, 8, ["model-value", "items"]),
1507
1519
  unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_7$7, toDisplayString(unref(o)("connect.campaign.push.linkHelper")), 1)),
1508
1520
  unref(l) ? (openBlock(), createElementBlock("div", _hoisted_8$6, [
1509
1521
  createElementVNode("div", _hoisted_9$6, toDisplayString(unref(o)("connect.campaign.push.linkUrl")), 1),
1510
- createVNode(V, {
1522
+ createVNode(k, {
1511
1523
  "model-value": e.modelValue.url ?? "",
1512
1524
  inputmode: "url",
1513
1525
  placeholder: unref(o)("connect.campaign.push.linkUrlPlaceholder"),
1514
1526
  "helper-state": unref(n) ? "error" : "none",
1515
1527
  "helper-text": unref(n),
1516
- "onUpdate:modelValue": f[3] || (f[3] = (g) => a({ url: g.trim() || null }))
1528
+ "onUpdate:modelValue": c[3] || (c[3] = (v) => a({ url: v.trim() || null }))
1517
1529
  }, null, 8, ["model-value", "placeholder", "helper-state", "helper-text"])
1518
1530
  ])) : createCommentVNode("", !0)
1519
1531
  ])
@@ -1532,8 +1544,8 @@ const _hoisted_1$r = {
1532
1544
  },
1533
1545
  emits: ["update:model-value"],
1534
1546
  setup(e) {
1535
- const { t: s } = useI18n();
1536
- return (o, d) => (openBlock(), createElementBlock("div", _hoisted_1$j, [
1547
+ const { t: r } = useI18n();
1548
+ return (o, m) => (openBlock(), createElementBlock("div", _hoisted_1$j, [
1537
1549
  (openBlock(!0), createElementBlock(Fragment, null, renderList(e.tabs, (i) => (openBlock(), createElementBlock("div", {
1538
1550
  key: i.key,
1539
1551
  class: "flex flex-none items-center"
@@ -1546,7 +1558,7 @@ const _hoisted_1$r = {
1546
1558
  e.modelValue === i.key ? "border-fm-color-primary bg-fm-color-system-warning-100" : "border-fm-color-neutral-gray-100 bg-fm-color-neutral-white hover:border-fm-color-neutral-gray-200"
1547
1559
  ]),
1548
1560
  "aria-current": e.modelValue === i.key ? "true" : void 0,
1549
- onClick: (c) => o.$emit("update:model-value", i.key)
1561
+ onClick: (u) => o.$emit("update:model-value", i.key)
1550
1562
  }, [
1551
1563
  createElementVNode("span", _hoisted_4$c, [
1552
1564
  i.step ? (openBlock(), createElementBlock("span", {
@@ -1565,7 +1577,7 @@ const _hoisted_1$r = {
1565
1577
  i.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", {
1566
1578
  key: 1,
1567
1579
  class: "h-[7px] w-[7px] flex-none rounded-full bg-fm-color-system-error-400",
1568
- title: unref(s)("connect.campaign.broadcast.messageMissing")
1580
+ title: unref(r)("connect.campaign.broadcast.messageMissing")
1569
1581
  }, null, 8, _hoisted_5$a))
1570
1582
  ]),
1571
1583
  createElementVNode("span", _hoisted_6$7, toDisplayString(i.sub), 1)
@@ -1596,38 +1608,38 @@ const _hoisted_1$r = {
1596
1608
  senderPrefix: {}
1597
1609
  },
1598
1610
  setup(e) {
1599
- const { t: s } = useI18n(), o = e, d = computed(
1611
+ const { t: r } = useI18n(), o = e, m = computed(
1600
1612
  () => o.target === "PUSH" ? o.content : void 0
1601
1613
  ), i = computed(
1602
1614
  () => o.target === "APP_INBOX" ? o.content : void 0
1603
- ), c = computed(
1615
+ ), u = computed(
1604
1616
  () => o.target === "SMS" || o.target === "WHATSAPP" ? o.content : void 0
1605
1617
  ), l = computed(() => {
1606
- var v, f;
1607
- const p = (f = (v = c.value) == null ? void 0 : v.content) == null ? void 0 : f.trim();
1608
- return p ? o.senderPrefix ? `${o.senderPrefix}${p}` : p : s("connect.campaign.broadcast.preview.emptyText");
1618
+ var f, c;
1619
+ const y = (c = (f = u.value) == null ? void 0 : f.content) == null ? void 0 : c.trim();
1620
+ return y ? o.senderPrefix ? `${o.senderPrefix}${y}` : y : r("connect.campaign.broadcast.preview.emptyText");
1609
1621
  }), n = computed(() => {
1610
- var v;
1611
- const p = ((v = i.value) == null ? void 0 : v.content) ?? "";
1612
- return p.trim() ? `<!doctype html><meta charset="utf-8"><base target="_blank"><style>
1622
+ var f;
1623
+ const y = ((f = i.value) == null ? void 0 : f.content) ?? "";
1624
+ return y.trim() ? `<!doctype html><meta charset="utf-8"><base target="_blank"><style>
1613
1625
  html,body{margin:0;font:400 12px/1.5 Inter,system-ui,sans-serif;color:#1C1C1E;word-break:break-word}
1614
1626
  img{max-width:100%;height:auto}
1615
- </style>${p}` : "";
1627
+ </style>${y}` : "";
1616
1628
  }), a = computed(() => {
1617
- const p = /* @__PURE__ */ new Date(), v = p.toLocaleDateString(void 0, {
1629
+ const y = /* @__PURE__ */ new Date(), f = y.toLocaleDateString(void 0, {
1618
1630
  weekday: "short",
1619
1631
  day: "2-digit",
1620
1632
  month: "short"
1621
- }), f = p.toLocaleTimeString(void 0, {
1633
+ }), c = y.toLocaleTimeString(void 0, {
1622
1634
  hour: "2-digit",
1623
1635
  minute: "2-digit"
1624
1636
  });
1625
- return `${v} · ${f}`;
1626
- }), r = computed(() => o.target === "PUSH" ? s("connect.campaign.broadcast.preview.note.push") : o.target === "APP_INBOX" ? s("connect.campaign.broadcast.preview.note.inbox") : s("connect.campaign.broadcast.preview.note.text"));
1627
- return (p, v) => {
1628
- var f, V, k, y, g, u, m, C, x, $, F;
1637
+ return `${f} · ${c}`;
1638
+ }), s = computed(() => o.target === "PUSH" ? r("connect.campaign.broadcast.preview.note.push") : o.target === "APP_INBOX" ? r("connect.campaign.broadcast.preview.note.inbox") : r("connect.campaign.broadcast.preview.note.text"));
1639
+ return (y, f) => {
1640
+ var c, k, V, g, v, d, p, C, x, N, w;
1629
1641
  return e.target !== "EMAIL" ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
1630
- createElementVNode("div", _hoisted_2$f, toDisplayString(unref(s)("connect.campaign.broadcast.preview.title")), 1),
1642
+ createElementVNode("div", _hoisted_2$f, toDisplayString(unref(r)("connect.campaign.broadcast.preview.title")), 1),
1631
1643
  createElementVNode("div", {
1632
1644
  class: normalizeClass([
1633
1645
  "overflow-hidden rounded-[22px] border border-fm-color-neutral-gray-100",
@@ -1645,14 +1657,14 @@ const _hoisted_1$r = {
1645
1657
  e.target === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_4$b, [
1646
1658
  createElementVNode("div", _hoisted_5$9, toDisplayString(unref(a)), 1),
1647
1659
  createElementVNode("div", _hoisted_6$6, [
1648
- createElementVNode("div", _hoisted_7$6, toDisplayString(((V = (f = unref(d)) == null ? void 0 : f.title) == null ? void 0 : V.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyTitle")), 1),
1649
- createElementVNode("div", _hoisted_8$5, toDisplayString(((y = (k = unref(d)) == null ? void 0 : k.body) == null ? void 0 : y.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyBody")), 1)
1660
+ createElementVNode("div", _hoisted_7$6, toDisplayString(((k = (c = unref(m)) == null ? void 0 : c.title) == null ? void 0 : k.trim()) || unref(r)("connect.campaign.broadcast.preview.emptyTitle")), 1),
1661
+ createElementVNode("div", _hoisted_8$5, toDisplayString(((g = (V = unref(m)) == null ? void 0 : V.body) == null ? void 0 : g.trim()) || unref(r)("connect.campaign.broadcast.preview.emptyBody")), 1)
1650
1662
  ])
1651
1663
  ])) : e.target === "APP_INBOX" ? (openBlock(), createElementBlock("div", _hoisted_9$5, [
1652
- createElementVNode("div", _hoisted_10$5, toDisplayString(unref(s)("connect.campaign.broadcast.preview.inboxHeading")), 1),
1664
+ createElementVNode("div", _hoisted_10$5, toDisplayString(unref(r)("connect.campaign.broadcast.preview.inboxHeading")), 1),
1653
1665
  createElementVNode("div", _hoisted_11$3, [
1654
- createElementVNode("div", _hoisted_12$2, toDisplayString(((u = (g = unref(i)) == null ? void 0 : g.title) == null ? void 0 : u.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyTitle")), 1),
1655
- createElementVNode("div", _hoisted_13$2, toDisplayString(((C = (m = unref(i)) == null ? void 0 : m.previewText) == null ? void 0 : C.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyBody")), 1),
1666
+ createElementVNode("div", _hoisted_12$2, toDisplayString(((d = (v = unref(i)) == null ? void 0 : v.title) == null ? void 0 : d.trim()) || unref(r)("connect.campaign.broadcast.preview.emptyTitle")), 1),
1667
+ createElementVNode("div", _hoisted_13$2, toDisplayString(((C = (p = unref(i)) == null ? void 0 : p.previewText) == null ? void 0 : C.trim()) || unref(r)("connect.campaign.broadcast.preview.emptyBody")), 1),
1656
1668
  (x = unref(i)) != null && x.imageUrl ? (openBlock(), createElementBlock("img", {
1657
1669
  key: 0,
1658
1670
  src: unref(i).imageUrl,
@@ -1665,21 +1677,21 @@ const _hoisted_1$r = {
1665
1677
  sandbox: "",
1666
1678
  referrerpolicy: "no-referrer",
1667
1679
  class: "mt-8 h-[120px] w-full border-0",
1668
- title: unref(s)("connect.campaign.broadcast.preview.bodyFrameTitle")
1680
+ title: unref(r)("connect.campaign.broadcast.preview.bodyFrameTitle")
1669
1681
  }, null, 8, _hoisted_15$2)) : createCommentVNode("", !0),
1670
- (F = ($ = unref(i)) == null ? void 0 : $.buttons) != null && F.length ? (openBlock(), createElementBlock("div", _hoisted_16$1, [
1671
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i).buttons, (N, D) => (openBlock(), createElementBlock("div", {
1672
- key: D,
1682
+ (w = (N = unref(i)) == null ? void 0 : N.buttons) != null && w.length ? (openBlock(), createElementBlock("div", _hoisted_16$1, [
1683
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i).buttons, ($, T) => (openBlock(), createElementBlock("div", {
1684
+ key: T,
1673
1685
  class: "rounded-[8px] bg-fm-color-primary px-12 py-8 text-center fm-typo-en-body-sm-400 text-fm-color-typo-white"
1674
- }, toDisplayString(N.label || unref(s)("connect.campaign.appInbox.buttonLabel")), 1))), 128))
1686
+ }, toDisplayString($.label || unref(r)("connect.campaign.appInbox.buttonLabel")), 1))), 128))
1675
1687
  ])) : createCommentVNode("", !0)
1676
1688
  ])
1677
1689
  ])) : (openBlock(), createElementBlock("div", _hoisted_17$1, [
1678
- createElementVNode("div", _hoisted_18$1, toDisplayString(unref(s)(`connect.campaign.broadcast.channel.${e.target}`)), 1),
1690
+ createElementVNode("div", _hoisted_18$1, toDisplayString(unref(r)(`connect.campaign.broadcast.channel.${e.target}`)), 1),
1679
1691
  createElementVNode("div", _hoisted_19$1, toDisplayString(unref(l)), 1)
1680
1692
  ]))
1681
1693
  ], 2),
1682
- createElementVNode("div", _hoisted_20$1, toDisplayString(unref(r)), 1)
1694
+ createElementVNode("div", _hoisted_20$1, toDisplayString(unref(s)), 1)
1683
1695
  ])) : createCommentVNode("", !0);
1684
1696
  };
1685
1697
  }
@@ -1700,82 +1712,82 @@ const _hoisted_1$r = {
1700
1712
  },
1701
1713
  emits: ["move", "remove", "add"],
1702
1714
  setup(e) {
1703
- const { t: s } = useI18n(), o = e, d = computed(() => o.addable.length > 0);
1704
- return (i, c) => {
1715
+ const { t: r } = useI18n(), o = e, m = computed(() => o.addable.length > 0);
1716
+ return (i, u) => {
1705
1717
  const l = resolveComponent("FmButton"), n = resolveComponent("FmMenuItem"), a = resolveComponent("FmMenu");
1706
1718
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
1707
1719
  createElementVNode("div", _hoisted_2$e, [
1708
- createElementVNode("span", _hoisted_3$b, toDisplayString(unref(s)("connect.campaign.broadcast.fallbackChannels")), 1),
1709
- createElementVNode("span", _hoisted_4$a, toDisplayString(unref(s)("connect.campaign.broadcast.fallbackChannelsHint")), 1)
1720
+ createElementVNode("span", _hoisted_3$b, toDisplayString(unref(r)("connect.campaign.broadcast.fallbackChannels")), 1),
1721
+ createElementVNode("span", _hoisted_4$a, toDisplayString(unref(r)("connect.campaign.broadcast.fallbackChannelsHint")), 1)
1710
1722
  ]),
1711
- (openBlock(!0), createElementBlock(Fragment, null, renderList(e.rows, (r, p) => (openBlock(), createElementBlock("div", {
1712
- key: r.channel,
1723
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(e.rows, (s, y) => (openBlock(), createElementBlock("div", {
1724
+ key: s.channel,
1713
1725
  class: "flex flex-wrap items-center gap-12 rounded-[8px] border border-fm-color-neutral-gray-100 px-16 py-[14px]"
1714
1726
  }, [
1715
- createElementVNode("span", _hoisted_5$8, toDisplayString(r.position), 1),
1727
+ createElementVNode("span", _hoisted_5$8, toDisplayString(s.position), 1),
1716
1728
  createElementVNode("span", _hoisted_6$5, [
1717
1729
  createElementVNode("span", _hoisted_7$5, [
1718
- createElementVNode("span", _hoisted_8$4, toDisplayString(r.label), 1),
1719
- r.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", _hoisted_9$4, [
1720
- c[0] || (c[0] = createElementVNode("span", { class: "h-[6px] w-[6px] rounded-full bg-fm-color-system-error-400" }, null, -1)),
1721
- createTextVNode(" " + toDisplayString(unref(s)("connect.campaign.broadcast.messageMissing")), 1)
1730
+ createElementVNode("span", _hoisted_8$4, toDisplayString(s.label), 1),
1731
+ s.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", _hoisted_9$4, [
1732
+ u[0] || (u[0] = createElementVNode("span", { class: "h-[6px] w-[6px] rounded-full bg-fm-color-system-error-400" }, null, -1)),
1733
+ createTextVNode(" " + toDisplayString(unref(r)("connect.campaign.broadcast.messageMissing")), 1)
1722
1734
  ]))
1723
1735
  ])
1724
1736
  ]),
1725
1737
  createElementVNode("span", _hoisted_10$4, [
1726
1738
  createElementVNode("span", {
1727
- title: unref(s)("connect.campaign.broadcast.moveUp"),
1739
+ title: unref(r)("connect.campaign.broadcast.moveUp"),
1728
1740
  class: "flex"
1729
1741
  }, [
1730
1742
  createVNode(l, {
1731
1743
  icon: "arrow_upward",
1732
1744
  "icon-color": "neutral-gray-400",
1733
1745
  variant: "tertiary",
1734
- disabled: p === 0,
1735
- onClick: (v) => i.$emit("move", r.channel, -1)
1746
+ disabled: y === 0,
1747
+ onClick: (f) => i.$emit("move", s.channel, -1)
1736
1748
  }, null, 8, ["disabled", "onClick"])
1737
1749
  ], 8, _hoisted_11$2),
1738
1750
  createElementVNode("span", {
1739
- title: unref(s)("connect.campaign.broadcast.moveDown"),
1751
+ title: unref(r)("connect.campaign.broadcast.moveDown"),
1740
1752
  class: "flex"
1741
1753
  }, [
1742
1754
  createVNode(l, {
1743
1755
  icon: "arrow_downward",
1744
1756
  "icon-color": "neutral-gray-400",
1745
1757
  variant: "tertiary",
1746
- disabled: p === e.rows.length - 1,
1747
- onClick: (v) => i.$emit("move", r.channel, 1)
1758
+ disabled: y === e.rows.length - 1,
1759
+ onClick: (f) => i.$emit("move", s.channel, 1)
1748
1760
  }, null, 8, ["disabled", "onClick"])
1749
1761
  ], 8, _hoisted_12$1),
1750
1762
  createElementVNode("span", {
1751
- title: unref(s)("connect.campaign.broadcast.removeChannel"),
1763
+ title: unref(r)("connect.campaign.broadcast.removeChannel"),
1752
1764
  class: "flex"
1753
1765
  }, [
1754
1766
  createVNode(l, {
1755
1767
  icon: "delete",
1756
1768
  "icon-color": "neutral-gray-400",
1757
1769
  variant: "tertiary",
1758
- onClick: (v) => i.$emit("remove", r.channel)
1770
+ onClick: (f) => i.$emit("remove", s.channel)
1759
1771
  }, null, 8, ["onClick"])
1760
1772
  ], 8, _hoisted_13$1)
1761
1773
  ])
1762
1774
  ]))), 128)),
1763
- unref(d) ? (openBlock(), createBlock(a, {
1775
+ unref(m) ? (openBlock(), createBlock(a, {
1764
1776
  key: 0,
1765
1777
  placement: "bottom-start"
1766
1778
  }, {
1767
1779
  "menu-button": withCtx(() => [
1768
- createElementVNode("button", _hoisted_14$1, " + " + toDisplayString(unref(s)("connect.campaign.broadcast.addFallbackChannel")), 1)
1780
+ createElementVNode("button", _hoisted_14$1, " + " + toDisplayString(unref(r)("connect.campaign.broadcast.addFallbackChannel")), 1)
1769
1781
  ]),
1770
1782
  default: withCtx(() => [
1771
- (openBlock(!0), createElementBlock(Fragment, null, renderList(e.addable, (r) => (openBlock(), createBlock(n, {
1772
- key: r.channel,
1773
- label: r.label,
1774
- onClick: (p) => i.$emit("add", r.channel)
1783
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(e.addable, (s) => (openBlock(), createBlock(n, {
1784
+ key: s.channel,
1785
+ label: s.label,
1786
+ onClick: (y) => i.$emit("add", s.channel)
1775
1787
  }, null, 8, ["label", "onClick"]))), 128))
1776
1788
  ]),
1777
1789
  _: 1
1778
- })) : (openBlock(), createElementBlock("div", _hoisted_15$1, toDisplayString(unref(s)("connect.campaign.broadcast.allChannelsAdded")), 1))
1790
+ })) : (openBlock(), createElementBlock("div", _hoisted_15$1, toDisplayString(unref(r)("connect.campaign.broadcast.allChannelsAdded")), 1))
1779
1791
  ]);
1780
1792
  };
1781
1793
  }
@@ -1798,16 +1810,26 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
1798
1810
  class: "mt-[6px] inline-flex rounded-[6px] bg-fm-color-neutral-gray-100 px-8 py-[3px] fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1799
1811
  }, _hoisted_18 = {
1800
1812
  key: 0,
1813
+ class: "fm-typo-en-body-sm-400 text-fm-color-system-warning-400"
1814
+ }, _hoisted_19 = {
1815
+ key: 1,
1801
1816
  class: "fm-typo-en-body-sm-400 text-fm-color-system-error-400"
1802
- }, _hoisted_19 = { class: "flex flex-col gap-[14px]" }, _hoisted_20 = { class: "fm-typo-en-body-lg-600" }, _hoisted_21 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_22 = {
1817
+ }, _hoisted_20 = { class: "flex flex-col gap-[14px]" }, _hoisted_21 = { class: "fm-typo-en-body-lg-600" }, _hoisted_22 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_23 = {
1803
1818
  key: 1,
1804
1819
  class: "rounded-[8px] border border-dashed border-fm-color-neutral-gray-200 p-24 text-center fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1805
- }, _hoisted_23 = {
1820
+ }, _hoisted_24 = {
1806
1821
  key: 3,
1807
1822
  class: "flex flex-wrap items-start gap-24"
1808
- }, _hoisted_24 = { class: "min-w-0 flex-1 basis-[340px]" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
1823
+ }, _hoisted_25 = { class: "min-w-0 flex-1 basis-[340px]" }, _hoisted_26 = {
1824
+ key: 1,
1825
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1826
+ }, _sfc_main$g = /* @__PURE__ */ defineComponent({
1809
1827
  __name: "BroadcastDeliveryInput",
1810
1828
  props: {
1829
+ pushAvailability: {
1830
+ type: String,
1831
+ default: "checking"
1832
+ },
1811
1833
  /** Either the new delivery shape or a legacy single-channel message. */
1812
1834
  modelValue: {
1813
1835
  type: Object,
@@ -1830,162 +1852,181 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
1830
1852
  helperState: { type: String },
1831
1853
  placeholder: { type: String }
1832
1854
  },
1833
- emits: ["update:model-value"],
1834
- setup(e, { emit: s }) {
1835
- const { t: o } = useI18n(), d = useCoreStore(), i = useMembershipStore(), c = e, l = s, n = ref(!1), a = ref("SMS"), r = computed(() => {
1836
- const h = c.modelValue;
1855
+ emits: ["retry-push", "update:model-value"],
1856
+ setup(e, { emit: r }) {
1857
+ const { t: o } = useI18n(), m = useDialog(), i = computed(
1858
+ () => o(
1859
+ "connect.campaign.broadcast.pushAvailability." + (a.pushAvailability === "checking" ? "checking" : a.pushAvailability === "non-native" ? "requiresNativeApp" : "unavailable")
1860
+ )
1861
+ );
1862
+ function u() {
1863
+ m.open({
1864
+ title: o("connect.campaign.broadcast.pushAvailability.contactSales"),
1865
+ message: o("connect.campaign.broadcast.pushAvailability.dialogMessage"),
1866
+ primaryActions: {
1867
+ text: o("connect.campaign.broadcast.pushAvailability.close"),
1868
+ close: !0
1869
+ }
1870
+ });
1871
+ }
1872
+ const l = useCoreStore(), n = useMembershipStore(), a = e, s = r, y = ref(!1), f = ref("SMS"), c = computed(() => {
1873
+ const h = a.modelValue;
1837
1874
  return h && "channels" in h ? h : toDelivery({ message: h });
1838
1875
  });
1839
- function p(h) {
1840
- l("update:model-value", h);
1876
+ function k(h) {
1877
+ s("update:model-value", h);
1841
1878
  }
1842
- function v(h) {
1879
+ function V(h) {
1843
1880
  return o(`connect.campaign.broadcast.channel.${h}`);
1844
1881
  }
1845
- const f = {
1882
+ const g = {
1846
1883
  SMS: "chat",
1847
1884
  WHATSAPP: "chat",
1848
1885
  EMAIL: "mail",
1849
1886
  APP_INBOX: "inbox",
1850
1887
  PUSH: "notifications"
1851
1888
  };
1852
- function V(h) {
1853
- return f[h];
1889
+ function v(h) {
1890
+ return g[h];
1854
1891
  }
1855
- const k = computed(() => r.value.mode === "fallback"), y = computed(
1856
- () => c.variables.filter(
1857
- (h) => c.triggerType == "SCHEDULE" ? !h.startsWith("transaction.") : !0
1892
+ const d = computed(() => c.value.mode === "fallback"), p = computed(
1893
+ () => a.variables.filter(
1894
+ (h) => a.triggerType == "SCHEDULE" ? !h.startsWith("transaction.") : !0
1858
1895
  )
1859
1896
  );
1860
- function g(h) {
1861
- return h === "WHATSAPP" ? n.value : !0;
1897
+ function C(h) {
1898
+ return h === "PUSH" ? a.pushAvailability === "native" : h === "WHATSAPP" ? y.value : !0;
1862
1899
  }
1863
- const u = ["fallback", "all"];
1864
- function m(h) {
1865
- h !== r.value.mode && p(setMode(r.value, h));
1900
+ const x = ["fallback", "all"];
1901
+ function N(h) {
1902
+ h !== c.value.mode && k(setMode(c.value, h));
1866
1903
  }
1867
- const C = ref(null);
1868
- function x(h) {
1869
- var R;
1870
- const E = (R = C.value) == null ? void 0 : R[h];
1871
- return E ? new Intl.NumberFormat(void 0, {
1904
+ const w = ref(null);
1905
+ function $(h) {
1906
+ var D;
1907
+ const B = (D = w.value) == null ? void 0 : D[h];
1908
+ return B ? new Intl.NumberFormat(void 0, {
1872
1909
  style: "currency",
1873
- currency: E.currency,
1874
- minimumFractionDigits: E.precision,
1875
- maximumFractionDigits: E.precision
1876
- }).format(E.amount / 10 ** E.precision) : null;
1910
+ currency: B.currency,
1911
+ minimumFractionDigits: B.precision,
1912
+ maximumFractionDigits: B.precision
1913
+ }).format(B.amount / 10 ** B.precision) : null;
1877
1914
  }
1878
- const $ = computed(
1915
+ const T = computed(
1879
1916
  () => CHANNEL_DISPLAY_ORDER.map((h) => {
1880
- const E = r.value.channels.includes(h), R = x(h);
1917
+ const B = c.value.channels.includes(h), D = $(h);
1881
1918
  return {
1882
1919
  channel: h,
1883
- label: v(h),
1884
- selected: E,
1885
- available: g(h),
1886
- rateNote: isPaidChannel(h) ? R ? o("connect.campaign.broadcast.perMessage", { price: R }) : null : o("connect.campaign.broadcast.freeChannel"),
1920
+ label: V(h),
1921
+ selected: B,
1922
+ available: C(h),
1923
+ rateNote: isPaidChannel(h) ? D ? o("connect.campaign.broadcast.perMessage", { price: D }) : null : o("connect.campaign.broadcast.freeChannel"),
1887
1924
  // In fallback mode the grid is a radio for the primary channel, so only
1888
1925
  // the primary reads as checked; a fallback is tagged instead.
1889
- checked: k.value ? r.value.channels[0] === h : E,
1890
- usedAsFallback: k.value && r.value.channels.indexOf(h) > 0
1926
+ checked: d.value ? c.value.channels[0] === h : B,
1927
+ usedAsFallback: d.value && c.value.channels.indexOf(h) > 0
1891
1928
  };
1892
1929
  })
1893
1930
  );
1894
- async function F(h) {
1895
- if (g(h)) {
1896
- if (k.value) {
1897
- await N(h);
1931
+ async function R(h) {
1932
+ if (C(h)) {
1933
+ if (d.value) {
1934
+ await A(h);
1898
1935
  return;
1899
1936
  }
1900
- if (r.value.channels.includes(h)) {
1901
- await D(h);
1937
+ if (c.value.channels.includes(h)) {
1938
+ await M(h);
1902
1939
  return;
1903
1940
  }
1904
- p(addChannel(r.value, h, y.value));
1941
+ k(addChannel(c.value, h, p.value));
1905
1942
  }
1906
1943
  }
1907
- async function N(h) {
1908
- const E = r.value.channels[0];
1909
- E !== h && (E && hasDraft(r.value, E) && !await prompt.remove(
1944
+ async function A(h) {
1945
+ if (!C(h)) return;
1946
+ const B = c.value.channels[0];
1947
+ B !== h && (B && hasDraft(c.value, B) && !await prompt.remove(
1910
1948
  o("connect.campaign.broadcast.replaceChannelConfirm", {
1911
- channel: v(E),
1912
- next: v(h)
1949
+ channel: V(B),
1950
+ next: V(h)
1913
1951
  })
1914
- ) || (p(setPrimaryChannel(r.value, h, y.value)), a.value = h));
1952
+ ) || C(h) && (k(setPrimaryChannel(c.value, h, p.value)), f.value = h));
1915
1953
  }
1916
- async function D(h) {
1917
- if (hasDraft(r.value, h) && !await prompt.remove(
1954
+ async function M(h) {
1955
+ if (hasDraft(c.value, h) && !await prompt.remove(
1918
1956
  o("connect.campaign.broadcast.removeChannelConfirm", {
1919
- channel: v(h)
1957
+ channel: V(h)
1920
1958
  })
1921
1959
  ))
1922
1960
  return;
1923
- const E = removeChannel(r.value, h);
1924
- p(E), a.value === h && (a.value = E.channels[0] ?? "SMS");
1961
+ const B = removeChannel(c.value, h);
1962
+ k(B), f.value === h && (f.value = B.channels[0] ?? "SMS");
1963
+ }
1964
+ function I(h, B) {
1965
+ k(moveChannel(c.value, h, B));
1925
1966
  }
1926
- function w(h, E) {
1927
- p(moveChannel(r.value, h, E));
1967
+ function X(h) {
1968
+ C(h) && k(addChannel(c.value, h, p.value));
1928
1969
  }
1929
- const O = computed(
1930
- () => r.value.channels.slice(1).map((h, E) => ({
1970
+ const K = computed(
1971
+ () => c.value.channels.slice(1).map((h, B) => ({
1931
1972
  channel: h,
1932
- label: v(h),
1933
- position: E + 2,
1934
- complete: !c.showValidation || isChannelComplete(r.value, h)
1973
+ label: V(h),
1974
+ position: B + 2,
1975
+ complete: !a.showValidation || isChannelComplete(c.value, h)
1935
1976
  }))
1936
- ), j = computed(
1977
+ ), Z = computed(
1937
1978
  () => CHANNEL_DISPLAY_ORDER.filter(
1938
- (h) => !r.value.channels.includes(h) && g(h)
1979
+ (h) => !c.value.channels.includes(h) && C(h)
1939
1980
  ).map((h) => ({
1940
1981
  channel: h,
1941
- label: v(h)
1982
+ label: V(h)
1942
1983
  }))
1943
- ), I = computed(
1944
- () => r.value.channels.map((h, E) => ({
1984
+ ), W = computed(
1985
+ () => c.value.channels.map((h, B) => ({
1945
1986
  key: h,
1946
- label: v(h),
1947
- sub: k.value ? o(E === 0 ? "connect.campaign.broadcast.tab.firstAttempt" : "connect.campaign.broadcast.tab.ifNotReached") : o("connect.campaign.broadcast.tab.sendsToEligible"),
1948
- complete: !c.showValidation || isChannelComplete(r.value, h),
1949
- step: k.value ? E + 1 : void 0,
1950
- connector: E === 0 ? void 0 : k.value ? "→" : "+"
1987
+ label: V(h),
1988
+ sub: d.value ? o(B === 0 ? "connect.campaign.broadcast.tab.firstAttempt" : "connect.campaign.broadcast.tab.ifNotReached") : o("connect.campaign.broadcast.tab.sendsToEligible"),
1989
+ complete: !a.showValidation || isChannelComplete(c.value, h),
1990
+ step: d.value ? B + 1 : void 0,
1991
+ connector: B === 0 ? void 0 : d.value ? "→" : "+"
1951
1992
  }))
1952
1993
  );
1953
1994
  watchEffect(() => {
1954
- const h = I.value.map((E) => E.key);
1955
- h.length && !h.includes(a.value) && (a.value = h[0]);
1995
+ const h = W.value.map((B) => B.key);
1996
+ h.length && !h.includes(f.value) && (f.value = h[0]);
1956
1997
  });
1957
- const H = computed(() => a.value), q = computed(() => {
1958
- const h = H.value;
1998
+ const Y = computed(() => f.value), b = computed(() => {
1999
+ const h = Y.value;
1959
2000
  if (!(h === "APP_INBOX" || h === "PUSH"))
1960
- return r.value.content[h];
1961
- }), G = computed(
1962
- () => r.value.content.APP_INBOX
1963
- ), Y = computed(
1964
- () => r.value.content.PUSH
2001
+ return c.value.content[h];
2002
+ }), E = computed(
2003
+ () => c.value.content.APP_INBOX
2004
+ ), F = computed(
2005
+ () => c.value.content.PUSH
1965
2006
  );
1966
- function Z(h) {
1967
- p(setChannelContent(r.value, "APP_INBOX", h));
2007
+ function U(h) {
2008
+ k(setChannelContent(c.value, "APP_INBOX", h));
1968
2009
  }
1969
- function b(h) {
1970
- p(setChannelContent(r.value, "PUSH", h));
2010
+ function O(h) {
2011
+ C("PUSH") && k(setChannelContent(c.value, "PUSH", h));
1971
2012
  }
1972
- function B(h, E) {
1973
- h === "APP_INBOX" || h === "PUSH" || p(setChannelContent(r.value, h, { ...E, channel: h }));
2013
+ function P(h, B) {
2014
+ h === "APP_INBOX" || h === "PUSH" || k(setChannelContent(c.value, h, { ...B, channel: h }));
1974
2015
  }
1975
- const T = computed(
1976
- () => r.value.channels.filter(isPaidChannel)
1977
- ), U = computed(() => {
1978
- var E, R, M;
1979
- const h = ((E = i.membership) == null ? void 0 : E.brand) || ((M = (R = d.currentBusiness) == null ? void 0 : R.value) == null ? void 0 : M.name) || "";
2016
+ const H = computed(
2017
+ () => c.value.channels.filter(isPaidChannel)
2018
+ ), L = computed(() => {
2019
+ var B, D, q;
2020
+ const h = ((B = n.membership) == null ? void 0 : B.brand) || ((q = (D = l.currentBusiness) == null ? void 0 : D.value) == null ? void 0 : q.name) || "";
1980
2021
  return getSmsMessageMetrics({ brandName: h, content: "" }).prefix;
1981
- }), P = `${define_appEndpoint_default.licensePortalUrl}settings?businessId=${SvcConfig.businessId}`;
1982
- async function A() {
2022
+ }), j = `${define_appEndpoint_default.licensePortalUrl}settings?businessId=${SvcConfig.businessId}`;
2023
+ async function G() {
1983
2024
  try {
1984
2025
  const h = await membershipApi.getWhatsappNumbers();
1985
- n.value = h.some(
1986
- (E) => {
1987
- var R;
1988
- return (R = E == null ? void 0 : E.default) == null ? void 0 : R.includes("Marketing");
2026
+ y.value = h.some(
2027
+ (B) => {
2028
+ var D;
2029
+ return (D = B == null ? void 0 : B.default) == null ? void 0 : D.includes("Marketing");
1989
2030
  }
1990
2031
  );
1991
2032
  } catch (h) {
@@ -1993,10 +2034,10 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
1993
2034
  }
1994
2035
  }
1995
2036
  return onMounted(async () => {
1996
- const h = r.value.channels[0];
1997
- h && (a.value = h), campaignApi.readBroadcastCreditSummary().then((E) => C.value = E.prices).catch(() => C.value = null), await A();
1998
- }), (h, E) => {
1999
- const R = resolveComponent("FmIcon"), M = resolveComponent("FmCard");
2037
+ const h = c.value.channels[0];
2038
+ h && (f.value = h), campaignApi.readBroadcastCreditSummary().then((B) => w.value = B.prices).catch(() => w.value = null), await G();
2039
+ }), (h, B) => {
2040
+ const D = resolveComponent("FmIcon"), q = resolveComponent("FmCard"), J = resolveComponent("FmButton");
2000
2041
  return openBlock(), createElementBlock("div", _hoisted_1$g, [
2001
2042
  createElementVNode("div", _hoisted_2$d, [
2002
2043
  createElementVNode("div", null, [
@@ -2004,19 +2045,19 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2004
2045
  createElementVNode("div", _hoisted_4$9, toDisplayString(unref(o)("connect.campaign.broadcast.deliveryDescription")), 1)
2005
2046
  ]),
2006
2047
  createElementVNode("div", _hoisted_5$7, [
2007
- (openBlock(), createElementBlock(Fragment, null, renderList(u, (S) => createVNode(M, {
2048
+ (openBlock(), createElementBlock(Fragment, null, renderList(x, (S) => createVNode(q, {
2008
2049
  key: S,
2009
2050
  variant: "outlined",
2010
2051
  class: normalizeClass(["h-full cursor-pointer select-none p-16 space-y-8", {
2011
- "border-fm-color-primary bg-fm-color-system-warning-100": unref(r).mode === S,
2012
- "hover:bg-fm-color-opacity-sm": unref(r).mode !== S
2052
+ "border-fm-color-primary bg-fm-color-system-warning-100": unref(c).mode === S,
2053
+ "hover:bg-fm-color-opacity-sm": unref(c).mode !== S
2013
2054
  }]),
2014
- onClick: (L) => m(S)
2055
+ onClick: (Q) => N(S)
2015
2056
  }, {
2016
2057
  default: withCtx(() => [
2017
2058
  createElementVNode("div", _hoisted_6$4, [
2018
2059
  createElementVNode("div", _hoisted_7$4, toDisplayString(unref(o)(`connect.campaign.broadcast.mode.${S}.label`)), 1),
2019
- unref(r).mode === S ? (openBlock(), createBlock(R, {
2060
+ unref(c).mode === S ? (openBlock(), createBlock(D, {
2020
2061
  key: 0,
2021
2062
  name: "check_circle",
2022
2063
  size: "md",
@@ -2028,8 +2069,8 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2028
2069
  _: 2
2029
2070
  }, 1032, ["class", "onClick"])), 64))
2030
2071
  ]),
2031
- unref(r).channels.length < 2 ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
2032
- createVNode(R, {
2072
+ unref(c).channels.length < 2 ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
2073
+ createVNode(D, {
2033
2074
  name: "info",
2034
2075
  size: "sm",
2035
2076
  class: "mt-[2px]"
@@ -2038,17 +2079,17 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2038
2079
  ])) : createCommentVNode("", !0)
2039
2080
  ]),
2040
2081
  createElementVNode("div", _hoisted_10$3, [
2041
- createElementVNode("div", _hoisted_11$1, toDisplayString(unref(k) ? unref(o)("connect.campaign.broadcast.primaryChannel") : unref(o)("connect.campaign.broadcast.channels")), 1),
2082
+ createElementVNode("div", _hoisted_11$1, toDisplayString(unref(d) ? unref(o)("connect.campaign.broadcast.primaryChannel") : unref(o)("connect.campaign.broadcast.channels")), 1),
2042
2083
  createElementVNode("div", _hoisted_12, [
2043
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref($), (S) => (openBlock(), createBlock(M, {
2084
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(T), (S) => (openBlock(), createBlock(q, {
2044
2085
  key: S.channel,
2045
2086
  variant: "outlined",
2046
2087
  class: normalizeClass(["flex h-full flex-col gap-12 p-16", [
2047
2088
  S.checked ? "!border-fm-color-primary bg-fm-color-system-warning-100" : "",
2048
2089
  S.available ? "cursor-pointer" : "cursor-not-allowed bg-fm-color-neutral-gray-100"
2049
2090
  ]]),
2050
- "aria-disabled": !S.available,
2051
- onClick: (L) => F(S.channel)
2091
+ "aria-disabled": S.channel === "PUSH" ? void 0 : !S.available,
2092
+ onClick: (Q) => R(S.channel)
2052
2093
  }, {
2053
2094
  default: withCtx(() => [
2054
2095
  createElementVNode("div", _hoisted_13, [
@@ -2058,19 +2099,19 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2058
2099
  S.available ? "bg-fm-color-primary-oats text-fm-color-primary" : "bg-fm-color-neutral-gray-200 text-fm-color-neutral-gray-400"
2059
2100
  ])
2060
2101
  }, [
2061
- createVNode(R, {
2062
- name: V(S.channel),
2102
+ createVNode(D, {
2103
+ name: v(S.channel),
2063
2104
  size: "md"
2064
2105
  }, null, 8, ["name"])
2065
2106
  ], 2),
2066
2107
  S.available ? (openBlock(), createElementBlock("span", {
2067
2108
  key: 0,
2068
2109
  class: normalizeClass(["flex h-[22px] w-[22px] flex-none items-center justify-center border-2 transition-colors", [
2069
- unref(k) ? "rounded-full" : "rounded-[4px]",
2110
+ unref(d) ? "rounded-full" : "rounded-[4px]",
2070
2111
  S.checked ? "border-fm-color-primary bg-fm-color-primary text-fm-color-typo-white" : "border-fm-color-neutral-gray-300 bg-fm-color-neutral-white"
2071
2112
  ]])
2072
2113
  }, [
2073
- S.checked && !unref(k) ? (openBlock(), createBlock(R, {
2114
+ S.checked && !unref(d) ? (openBlock(), createBlock(D, {
2074
2115
  key: 0,
2075
2116
  name: "check",
2076
2117
  size: "sm"
@@ -2082,75 +2123,93 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2082
2123
  class: normalizeClass(["fm-typo-en-body-md-600", S.available ? "" : "text-fm-color-typo-disabled"])
2083
2124
  }, toDisplayString(S.label), 3),
2084
2125
  S.available && S.rateNote ? (openBlock(), createElementBlock("div", _hoisted_15, toDisplayString(S.rateNote), 1)) : createCommentVNode("", !0),
2085
- S.available ? S.usedAsFallback ? (openBlock(), createElementBlock("div", _hoisted_17, toDisplayString(unref(o)("connect.campaign.broadcast.usedAsFallback")), 1)) : createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_16, toDisplayString(unref(o)("connect.campaign.broadcast.notSetUp")), 1))
2126
+ S.available ? S.usedAsFallback ? (openBlock(), createElementBlock("div", _hoisted_17, toDisplayString(unref(o)("connect.campaign.broadcast.usedAsFallback")), 1)) : createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_16, toDisplayString(S.channel === "PUSH" ? unref(i) : unref(o)("connect.campaign.broadcast.notSetUp")), 1))
2086
2127
  ]),
2087
- S.available ? createCommentVNode("", !0) : (openBlock(), createElementBlock("a", {
2128
+ S.channel === "WHATSAPP" && !S.available ? (openBlock(), createElementBlock("a", {
2088
2129
  key: 0,
2089
- href: P,
2130
+ href: j,
2090
2131
  target: "_blank",
2091
2132
  class: "mt-auto fm-typo-en-body-sm-400 text-fm-color-secondary-blueberry underline",
2092
- onClick: E[0] || (E[0] = withModifiers(() => {
2133
+ onClick: B[0] || (B[0] = withModifiers(() => {
2093
2134
  }, ["stop"]))
2094
- }, toDisplayString(unref(o)("connect.campaign.messageInput.manageWhatsappChannel")), 1))
2135
+ }, toDisplayString(unref(o)("connect.campaign.messageInput.manageWhatsappChannel")), 1)) : createCommentVNode("", !0),
2136
+ S.channel === "PUSH" && !S.available ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2137
+ e.pushAvailability === "non-native" ? (openBlock(), createBlock(J, {
2138
+ key: 0,
2139
+ label: unref(o)("connect.campaign.broadcast.pushAvailability.contactSales"),
2140
+ onClick: withModifiers(u, ["stop"])
2141
+ }, null, 8, ["label"])) : createCommentVNode("", !0),
2142
+ e.pushAvailability === "failed" ? (openBlock(), createBlock(J, {
2143
+ key: 1,
2144
+ label: unref(o)("connect.campaign.broadcast.pushAvailability.retry"),
2145
+ onClick: B[1] || (B[1] = withModifiers((Q) => s("retry-push"), ["stop"]))
2146
+ }, null, 8, ["label"])) : createCommentVNode("", !0),
2147
+ S.selected ? (openBlock(), createBlock(J, {
2148
+ key: 2,
2149
+ label: unref(o)("connect.campaign.broadcast.pushAvailability.removePush"),
2150
+ onClick: B[2] || (B[2] = withModifiers((Q) => M("PUSH"), ["stop"]))
2151
+ }, null, 8, ["label"])) : createCommentVNode("", !0)
2152
+ ], 64)) : createCommentVNode("", !0)
2095
2153
  ]),
2096
2154
  _: 2
2097
2155
  }, 1032, ["class", "aria-disabled", "onClick"]))), 128))
2098
2156
  ]),
2099
- e.showValidation && !unref(r).channels.length ? (openBlock(), createElementBlock("div", _hoisted_18, toDisplayString(unref(o)("connect.campaign.broadcast.selectChannelRequired")), 1)) : createCommentVNode("", !0),
2100
- unref(k) && unref(r).channels.length ? (openBlock(), createBlock(_sfc_main$h, {
2101
- key: 1,
2102
- rows: unref(O),
2103
- addable: unref(j),
2104
- onMove: w,
2105
- onRemove: D,
2106
- onAdd: E[1] || (E[1] = (S) => p(unref(addChannel)(unref(r), S, unref(y))))
2157
+ unref(c).channels.includes("PUSH") && !C("PUSH") ? (openBlock(), createElementBlock("div", _hoisted_18, toDisplayString(unref(o)("connect.campaign.broadcast.pushAvailability.removeBeforeSave")), 1)) : createCommentVNode("", !0),
2158
+ e.showValidation && !unref(c).channels.length ? (openBlock(), createElementBlock("div", _hoisted_19, toDisplayString(unref(o)("connect.campaign.broadcast.selectChannelRequired")), 1)) : createCommentVNode("", !0),
2159
+ unref(d) && unref(c).channels.length ? (openBlock(), createBlock(_sfc_main$h, {
2160
+ key: 2,
2161
+ rows: unref(K),
2162
+ addable: unref(Z),
2163
+ onMove: I,
2164
+ onRemove: M,
2165
+ onAdd: X
2107
2166
  }, null, 8, ["rows", "addable"])) : createCommentVNode("", !0)
2108
2167
  ]),
2109
- createElementVNode("div", _hoisted_19, [
2168
+ createElementVNode("div", _hoisted_20, [
2110
2169
  createElementVNode("div", null, [
2111
- createElementVNode("div", _hoisted_20, toDisplayString(unref(o)("connect.campaign.broadcast.content")), 1),
2112
- createElementVNode("div", _hoisted_21, toDisplayString(unref(o)("connect.campaign.broadcast.contentDescription")), 1)
2170
+ createElementVNode("div", _hoisted_21, toDisplayString(unref(o)("connect.campaign.broadcast.content")), 1),
2171
+ createElementVNode("div", _hoisted_22, toDisplayString(unref(o)("connect.campaign.broadcast.contentDescription")), 1)
2113
2172
  ]),
2114
- unref(T).length ? (openBlock(), createBlock(_sfc_main$w, {
2173
+ unref(H).length ? (openBlock(), createBlock(_sfc_main$w, {
2115
2174
  key: 0,
2116
- channels: unref(T)
2175
+ channels: unref(H)
2117
2176
  }, null, 8, ["channels"])) : createCommentVNode("", !0),
2118
- unref(r).channels.length ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_22, toDisplayString(unref(o)("connect.campaign.broadcast.noChannelContent")), 1)),
2119
- unref(r).channels.length ? (openBlock(), createBlock(_sfc_main$j, {
2177
+ unref(c).channels.length ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_23, toDisplayString(unref(o)("connect.campaign.broadcast.noChannelContent")), 1)),
2178
+ unref(c).channels.length ? (openBlock(), createBlock(_sfc_main$j, {
2120
2179
  key: 2,
2121
- modelValue: unref(a),
2122
- "onUpdate:modelValue": E[2] || (E[2] = (S) => isRef(a) ? a.value = S : null),
2123
- tabs: unref(I)
2180
+ modelValue: unref(f),
2181
+ "onUpdate:modelValue": B[3] || (B[3] = (S) => isRef(f) ? f.value = S : null),
2182
+ tabs: unref(W)
2124
2183
  }, null, 8, ["modelValue", "tabs"])) : createCommentVNode("", !0),
2125
- unref(r).channels.includes(unref(a)) ? (openBlock(), createElementBlock("div", _hoisted_23, [
2126
- createElementVNode("div", _hoisted_24, [
2127
- unref(a) === "PUSH" && unref(Y) ? (openBlock(), createBlock(_sfc_main$k, {
2184
+ unref(c).channels.includes(unref(f)) ? (openBlock(), createElementBlock("div", _hoisted_24, [
2185
+ createElementVNode("div", _hoisted_25, [
2186
+ unref(f) === "PUSH" && unref(F) && C("PUSH") ? (openBlock(), createBlock(_sfc_main$k, {
2128
2187
  key: 0,
2129
- "model-value": unref(Y),
2188
+ "model-value": unref(F),
2130
2189
  "show-validation": e.showValidation,
2131
- "onUpdate:modelValue": b
2132
- }, null, 8, ["model-value", "show-validation"])) : unref(a) === "APP_INBOX" && unref(G) ? (openBlock(), createBlock(_sfc_main$l, {
2133
- key: 1,
2134
- "model-value": unref(G),
2135
- variables: unref(y),
2190
+ "onUpdate:modelValue": O
2191
+ }, null, 8, ["model-value", "show-validation"])) : unref(f) === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_26, toDisplayString(unref(i)), 1)) : unref(f) === "APP_INBOX" && unref(E) ? (openBlock(), createBlock(_sfc_main$l, {
2192
+ key: 2,
2193
+ "model-value": unref(E),
2194
+ variables: unref(p),
2136
2195
  "show-validation": e.showValidation,
2137
- "onUpdate:modelValue": Z
2138
- }, null, 8, ["model-value", "variables", "show-validation"])) : unref(a) !== "APP_INBOX" && unref(a) !== "PUSH" ? (openBlock(), createBlock(_sfc_main$x, {
2139
- key: unref(a),
2140
- "model-value": unref(q),
2196
+ "onUpdate:modelValue": U
2197
+ }, null, 8, ["model-value", "variables", "show-validation"])) : unref(f) !== "APP_INBOX" ? (openBlock(), createBlock(_sfc_main$x, {
2198
+ key: unref(f),
2199
+ "model-value": unref(b),
2141
2200
  "allow-email": !1,
2142
2201
  "allow-whatsapp": !1,
2143
2202
  "hide-credit-card": !0,
2144
2203
  "trigger-type": e.triggerType,
2145
- variables: unref(y),
2204
+ variables: unref(p),
2146
2205
  placeholder: e.placeholder,
2147
- "onUpdate:modelValue": E[3] || (E[3] = (S) => B(unref(H), S))
2206
+ "onUpdate:modelValue": B[4] || (B[4] = (S) => P(unref(Y), S))
2148
2207
  }, null, 8, ["model-value", "trigger-type", "variables", "placeholder"])) : createCommentVNode("", !0)
2149
2208
  ]),
2150
2209
  createVNode(_sfc_main$i, {
2151
- target: unref(a),
2152
- content: unref(r).content[unref(H)],
2153
- "sender-prefix": unref(U)
2210
+ target: unref(f),
2211
+ content: unref(c).content[unref(Y)],
2212
+ "sender-prefix": unref(L)
2154
2213
  }, null, 8, ["target", "content", "sender-prefix"])
2155
2214
  ])) : createCommentVNode("", !0)
2156
2215
  ])
@@ -2175,61 +2234,61 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2175
2234
  }
2176
2235
  },
2177
2236
  emits: ["update:model-value"],
2178
- setup(e, { emit: s }) {
2179
- const { t: o } = useI18n(), d = e, i = s, c = useCoreStore(), l = computed(
2180
- () => CountryTimezone[c.currentCountry.value || "MY"]
2237
+ setup(e, { emit: r }) {
2238
+ const { t: o } = useI18n(), m = e, i = r, u = useCoreStore(), l = computed(
2239
+ () => CountryTimezone[u.currentCountry.value || "MY"]
2181
2240
  );
2182
2241
  function n() {
2183
- const u = RuleBuilder.getRules(d.modelValue);
2184
- return u.length == 0 ? "fixed" : u.some(
2185
- (m) => isRuleEntry(m) && RuleBuilder.simplify(m).operator == "_rrule"
2242
+ const d = RuleBuilder.getRules(m.modelValue);
2243
+ return d.length == 0 ? "fixed" : d.some(
2244
+ (p) => isRuleEntry(p) && RuleBuilder.simplify(p).operator == "_rrule"
2186
2245
  ) ? "repeating" : "fixed";
2187
2246
  }
2188
- const a = ref(n()), r = ref(!1), p = ref(!1), v = computed(() => [
2247
+ const a = ref(n()), s = ref(!1), y = ref(!1), f = computed(() => [
2189
2248
  { label: o("connect.template.rule.schedule.fixed"), value: "fixed" },
2190
2249
  { label: o("connect.template.rule.schedule.repeating"), value: "repeating" }
2191
- ]), f = computed(() => {
2192
- const u = RuleBuilder.getRules(d.modelValue), m = u.find(
2250
+ ]), c = computed(() => {
2251
+ const d = RuleBuilder.getRules(m.modelValue), p = d.find(
2193
2252
  (x) => isRuleEntry(x) && RuleBuilder.simplify(x).property == "trigger.date"
2194
- ), C = u.find(
2253
+ ), C = d.find(
2195
2254
  (x) => isRuleEntry(x) && RuleBuilder.simplify(x).property == "trigger.time"
2196
2255
  );
2197
2256
  return {
2198
- date: m ? RuleBuilder.simplify(m).equator : null,
2257
+ date: p ? RuleBuilder.simplify(p).equator : null,
2199
2258
  time: C ? RuleBuilder.simplify(C).equator : null
2200
2259
  };
2201
- }), V = computed(
2260
+ }), k = computed(
2202
2261
  () => calculateNextScheduleAt(
2203
- d.modelValue,
2262
+ m.modelValue,
2204
2263
  /* @__PURE__ */ new Date(),
2205
- d.startDate ? new Date(d.startDate) : /* @__PURE__ */ new Date(),
2206
- d.endDate ? new Date(d.endDate) : void 0
2264
+ m.startDate ? new Date(m.startDate) : /* @__PURE__ */ new Date(),
2265
+ m.endDate ? new Date(m.endDate) : void 0
2207
2266
  )
2208
2267
  );
2209
- function k(u, m) {
2268
+ function V(d, p) {
2210
2269
  i(
2211
2270
  "update:model-value",
2212
2271
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
2213
- RuleBuilder.constructEntry("trigger.date", "_rrule", u),
2214
- RuleBuilder.constructEntry("trigger.time", "_isOnTime", m ?? "00:00")
2272
+ RuleBuilder.constructEntry("trigger.date", "_rrule", d),
2273
+ RuleBuilder.constructEntry("trigger.time", "_isOnTime", p ?? "00:00")
2215
2274
  ])
2216
2275
  );
2217
2276
  }
2218
2277
  watch(
2219
- () => d.startDate,
2220
- (u, m) => {
2221
- if (!u || u === m || a.value !== "repeating" || !f.value.date) return;
2222
- const C = RRule.fromString(f.value.date), x = new RRule({
2278
+ () => m.startDate,
2279
+ (d, p) => {
2280
+ if (!d || d === p || a.value !== "repeating" || !c.value.date) return;
2281
+ const C = RRule.fromString(c.value.date), x = new RRule({
2223
2282
  ...C.origOptions,
2224
- dtstart: new Date(u)
2283
+ dtstart: new Date(d)
2225
2284
  }).toString();
2226
- x !== f.value.date && (k(x, f.value.time), p.value = !0);
2285
+ x !== c.value.date && (V(x, c.value.time), y.value = !0);
2227
2286
  }
2228
2287
  );
2229
- function y(u) {
2230
- const m = u.value, C = getRruleAnchorDate({
2231
- startDate: d.startDate ? new Date(d.startDate) : void 0
2232
- }), x = m == "fixed" ? [
2288
+ function g(d) {
2289
+ const p = d.value, C = getRruleAnchorDate({
2290
+ startDate: m.startDate ? new Date(m.startDate) : void 0
2291
+ }), x = p == "fixed" ? [
2233
2292
  RuleBuilder.constructEntry(
2234
2293
  "trigger.date",
2235
2294
  "_isOnDate",
@@ -2258,53 +2317,53 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2258
2317
  RuleBuilder.scaffoldGroup("g_schedule"),
2259
2318
  x
2260
2319
  )
2261
- ), a.value = m, p.value = !1;
2320
+ ), a.value = p, y.value = !1;
2262
2321
  }
2263
- function g(u) {
2322
+ function v(d) {
2264
2323
  a.value == "fixed" ? i(
2265
2324
  "update:model-value",
2266
2325
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
2267
2326
  RuleBuilder.constructEntry(
2268
2327
  "trigger.date",
2269
2328
  "_isOnDate",
2270
- u.date
2329
+ d.date
2271
2330
  ),
2272
2331
  RuleBuilder.constructEntry(
2273
2332
  "trigger.time",
2274
2333
  "_isOnTime",
2275
- u.time
2334
+ d.time
2276
2335
  )
2277
2336
  ])
2278
- ) : k(u.date, u.time), p.value = !1;
2337
+ ) : V(d.date, d.time), y.value = !1;
2279
2338
  }
2280
- return (u, m) => {
2281
- const C = resolveComponent("FmButtonGroup"), x = resolveComponent("FmTimePicker"), $ = resolveComponent("FmIcon"), F = resolveComponent("FmTooltip"), N = resolveComponent("FmField"), D = resolveComponent("FmCard"), w = resolveComponent("FmPopover"), O = resolveComponent("FmDatePicker"), j = resolveComponent("FmHelperText");
2339
+ return (d, p) => {
2340
+ const C = resolveComponent("FmButtonGroup"), x = resolveComponent("FmTimePicker"), N = resolveComponent("FmIcon"), w = resolveComponent("FmTooltip"), $ = resolveComponent("FmField"), T = resolveComponent("FmCard"), R = resolveComponent("FmPopover"), A = resolveComponent("FmDatePicker"), M = resolveComponent("FmHelperText");
2282
2341
  return openBlock(), createElementBlock(Fragment, null, [
2283
2342
  createVNode(C, {
2284
- items: unref(v),
2285
- "model-value": unref(v).find((I) => I.value === unref(a)) ?? null,
2286
- "onUpdate:modelValue": y,
2343
+ items: unref(f),
2344
+ "model-value": unref(f).find((I) => I.value === unref(a)) ?? null,
2345
+ "onUpdate:modelValue": g,
2287
2346
  class: "mb-8"
2288
2347
  }, null, 8, ["items", "model-value"]),
2289
2348
  createElementVNode("div", _hoisted_1$f, [
2290
2349
  createElementVNode("div", _hoisted_2$c, [
2291
2350
  createVNode(x, {
2292
2351
  label: unref(o)("connect.template.rule.schedule.notify_time"),
2293
- "model-value": unref(f).time,
2294
- "onUpdate:modelValue": m[0] || (m[0] = (I) => g({ date: unref(f).date, time: I })),
2295
- "helper-text": unref(f).time ? void 0 : unref(o)("connect.template.rule.schedule.time_required"),
2296
- "helper-state": unref(f).time ? void 0 : "error"
2352
+ "model-value": unref(c).time,
2353
+ "onUpdate:modelValue": p[0] || (p[0] = (I) => v({ date: unref(c).date, time: I })),
2354
+ "helper-text": unref(c).time ? void 0 : unref(o)("connect.template.rule.schedule.time_required"),
2355
+ "helper-state": unref(c).time ? void 0 : "error"
2297
2356
  }, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
2298
2357
  unref(a) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
2299
2358
  createElementVNode("div", _hoisted_4$8, [
2300
2359
  createElementVNode("div", null, toDisplayString(unref(o)("connect.template.rule.schedule.notify_date")), 1),
2301
- unref(f).date ? (openBlock(), createBlock(F, {
2360
+ unref(c).date ? (openBlock(), createBlock(w, {
2302
2361
  key: 0,
2303
2362
  "z-index": 9999,
2304
- content: unref(SummarizeRrule)(unref(RRule).fromString(unref(f).date).options)
2363
+ content: unref(SummarizeRrule)(unref(RRule).fromString(unref(c).date).options)
2305
2364
  }, {
2306
2365
  default: withCtx(() => [
2307
- createVNode($, {
2366
+ createVNode(N, {
2308
2367
  name: "info",
2309
2368
  size: "sm",
2310
2369
  outline: !0
@@ -2313,31 +2372,31 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2313
2372
  _: 1
2314
2373
  }, 8, ["content"])) : createCommentVNode("", !0)
2315
2374
  ]),
2316
- createVNode(w, {
2317
- "show-popover": unref(r),
2318
- onPopoverChanged: m[3] || (m[3] = (I) => r.value = I)
2375
+ createVNode(R, {
2376
+ "show-popover": unref(s),
2377
+ onPopoverChanged: p[3] || (p[3] = (I) => s.value = I)
2319
2378
  }, {
2320
2379
  "popover-button": withCtx(() => [
2321
- createVNode(N, {
2380
+ createVNode($, {
2322
2381
  class: "cursor-pointer",
2323
- "helper-text": unref(f).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
2324
- "helper-state": unref(f).date ? void 0 : "error"
2382
+ "helper-text": unref(c).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
2383
+ "helper-state": unref(c).date ? void 0 : "error"
2325
2384
  }, {
2326
2385
  default: withCtx(() => [
2327
- createElementVNode("div", _hoisted_5$6, toDisplayString(unref(f).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(f).date).options) : unref(o)("connect.template.rule.schedule.set_repeating_date")), 1)
2386
+ createElementVNode("div", _hoisted_5$6, toDisplayString(unref(c).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(c).date).options) : unref(o)("connect.template.rule.schedule.set_repeating_date")), 1)
2328
2387
  ]),
2329
2388
  _: 1
2330
2389
  }, 8, ["helper-text", "helper-state"])
2331
2390
  ]),
2332
2391
  default: withCtx(() => [
2333
- createVNode(D, { class: "elevated p-8 w-[450px]" }, {
2392
+ createVNode(T, { class: "elevated p-8 w-[450px]" }, {
2334
2393
  default: withCtx(() => [
2335
2394
  createVNode(_sfc_main$y, {
2336
2395
  "apply-button": !0,
2337
- "model-value": unref(f).date || "",
2396
+ "model-value": unref(c).date || "",
2338
2397
  "start-date": e.startDate ? new Date(e.startDate) : /* @__PURE__ */ new Date(),
2339
- onCancel: m[1] || (m[1] = (I) => r.value = !1),
2340
- "onUpdate:modelValue": m[2] || (m[2] = (I) => (g({ date: I, time: unref(f).time }), r.value = !1))
2398
+ onCancel: p[1] || (p[1] = (I) => s.value = !1),
2399
+ "onUpdate:modelValue": p[2] || (p[2] = (I) => (v({ date: I, time: unref(c).time }), s.value = !1))
2341
2400
  }, null, 8, ["model-value", "start-date"])
2342
2401
  ]),
2343
2402
  _: 1
@@ -2345,21 +2404,21 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2345
2404
  ]),
2346
2405
  _: 1
2347
2406
  }, 8, ["show-popover"])
2348
- ])) : (openBlock(), createBlock(O, {
2407
+ ])) : (openBlock(), createBlock(A, {
2349
2408
  key: 1,
2350
2409
  label: unref(o)("connect.template.rule.schedule.notify_date"),
2351
- "model-value": unref(f).date || "",
2352
- "onUpdate:modelValue": m[4] || (m[4] = (I) => g({ date: I, time: unref(f).time })),
2353
- "helper-text": unref(f).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
2354
- "helper-state": unref(f).date ? void 0 : "error"
2410
+ "model-value": unref(c).date || "",
2411
+ "onUpdate:modelValue": p[4] || (p[4] = (I) => v({ date: I, time: unref(c).time })),
2412
+ "helper-text": unref(c).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
2413
+ "helper-state": unref(c).date ? void 0 : "error"
2355
2414
  }, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
2356
2415
  ]),
2357
- unref(f).date && unref(f).time && unref(V) ? (openBlock(), createBlock(j, {
2416
+ unref(c).date && unref(c).time && unref(k) ? (openBlock(), createBlock(M, {
2358
2417
  key: 0,
2359
- text: `${unref(moment)(unref(V)).isAfter(unref(moment)()) ? unref(o)("connect.template.rule.schedule.next_notification") : unref(o)("connect.template.rule.schedule.last_trigger_on")} ${unref(moment)(unref(V)).format("dddd, DD MMM YYYY")} at
2360
- ${unref(moment)(unref(V)).format("hh:mmA")}(UTC${unref(moment).tz(unref(l)).format("Z")}) (${unref(moment)(unref(V)).fromNow()})`
2418
+ text: `${unref(moment)(unref(k)).isAfter(unref(moment)()) ? unref(o)("connect.template.rule.schedule.next_notification") : unref(o)("connect.template.rule.schedule.last_trigger_on")} ${unref(moment)(unref(k)).format("dddd, DD MMM YYYY")} at
2419
+ ${unref(moment)(unref(k)).format("hh:mmA")}(UTC${unref(moment).tz(unref(l)).format("Z")}) (${unref(moment)(unref(k)).fromNow()})`
2361
2420
  }, null, 8, ["text"])) : createCommentVNode("", !0),
2362
- unref(p) ? (openBlock(), createBlock(j, {
2421
+ unref(y) ? (openBlock(), createBlock(M, {
2363
2422
  key: 1,
2364
2423
  text: "Repeating schedule was updated to stay anchored to the campaign start date.",
2365
2424
  state: "warning"
@@ -2376,8 +2435,8 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2376
2435
  }
2377
2436
  },
2378
2437
  emits: ["update:model-value"],
2379
- setup(e, { emit: s }) {
2380
- const { t: o } = useI18n(), d = e, i = s, c = computed(
2438
+ setup(e, { emit: r }) {
2439
+ const { t: o } = useI18n(), m = e, i = r, u = computed(
2381
2440
  () => [
2382
2441
  {
2383
2442
  label: o("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
@@ -2398,21 +2457,21 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2398
2457
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
2399
2458
  createElementVNode("div", _hoisted_2$b, toDisplayString(unref(o)("connect.template.select_game")), 1),
2400
2459
  createElementVNode("div", _hoisted_3$8, [
2401
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (r) => (openBlock(), createBlock(a, {
2460
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (s) => (openBlock(), createBlock(a, {
2402
2461
  variant: "outlined",
2403
2462
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
2404
- "col-span-2": unref(c).length == 1,
2405
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
2406
- "hover:bg-fm-color-opacity-sm": e.modelValue != r.value
2463
+ "col-span-2": unref(u).length == 1,
2464
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == s.value,
2465
+ "hover:bg-fm-color-opacity-sm": e.modelValue != s.value
2407
2466
  }]),
2408
2467
  onClick: () => {
2409
- d.modelValue != r.value && i("update:model-value", r.value);
2468
+ m.modelValue != s.value && i("update:model-value", s.value);
2410
2469
  },
2411
- key: r.value
2470
+ key: s.value
2412
2471
  }, {
2413
2472
  default: withCtx(() => [
2414
- createElementVNode("div", _hoisted_4$7, toDisplayString(r.label), 1),
2415
- createElementVNode("div", _hoisted_5$5, toDisplayString(r.description), 1)
2473
+ createElementVNode("div", _hoisted_4$7, toDisplayString(s.label), 1),
2474
+ createElementVNode("div", _hoisted_5$5, toDisplayString(s.description), 1)
2416
2475
  ]),
2417
2476
  _: 2
2418
2477
  }, 1032, ["class", "onClick"]))), 128))
@@ -2426,29 +2485,29 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2426
2485
  }, _hoisted_2$a = { class: "flex gap-8 items-center justify-start" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
2427
2486
  __name: "EditRewardPoolSheet",
2428
2487
  emits: ["update:model-value"],
2429
- setup(e, { expose: s, emit: o }) {
2430
- const d = useMembershipStore(), { minor: i } = useLoading, c = ref(!1), l = ref(), n = ref(), a = ref(0), r = computed(() => {
2431
- var y;
2432
- return ((y = d.loyaltyRewards.items.find(
2433
- (g) => {
2434
- var u;
2435
- return g.value === ((u = l.value) == null ? void 0 : u.collectible);
2488
+ setup(e, { expose: r, emit: o }) {
2489
+ const m = useMembershipStore(), { minor: i } = useLoading, u = ref(!1), l = ref(), n = ref(), a = ref(0), s = computed(() => {
2490
+ var g;
2491
+ return ((g = m.loyaltyRewards.items.find(
2492
+ (v) => {
2493
+ var d;
2494
+ return v.value === ((d = l.value) == null ? void 0 : d.collectible);
2436
2495
  }
2437
- )) == null ? void 0 : y.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
2438
- }), p = computed(() => {
2439
- const k = r.value.safeParse(l.value);
2440
- return k.success ? [] : k.error.errors;
2496
+ )) == null ? void 0 : g.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
2497
+ }), y = computed(() => {
2498
+ const V = s.value.safeParse(l.value);
2499
+ return V.success ? [] : V.error.errors;
2441
2500
  });
2442
- function v(k, y, g) {
2443
- k && (l.value = y, a.value = g), c.value = k;
2501
+ function f(V, g, v) {
2502
+ V && (l.value = g, a.value = v), u.value = V;
2444
2503
  }
2445
- const f = o;
2446
- async function V() {
2447
- const k = r.value.safeParse(l.value);
2448
- k.success && (await i(
2504
+ const c = o;
2505
+ async function k() {
2506
+ const V = s.value.safeParse(l.value);
2507
+ V.success && (await i(
2449
2508
  async () => {
2450
- k.data.type === "VOUCHER" && n.value && (k.data.collectibleConfig.image = await firebaseStorage.update(
2451
- k.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
2509
+ V.data.type === "VOUCHER" && n.value && (V.data.collectibleConfig.image = await firebaseStorage.update(
2510
+ V.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
2452
2511
  n.value
2453
2512
  ));
2454
2513
  },
@@ -2456,44 +2515,44 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2456
2515
  message: "Uploading reward image",
2457
2516
  successMessage: "Reward image updated"
2458
2517
  }
2459
- ), f("update:model-value", k.data, a.value));
2518
+ ), c("update:model-value", V.data, a.value));
2460
2519
  }
2461
- return s({
2462
- showSheet: v
2463
- }), (k, y) => {
2464
- const g = resolveComponent("FmSelect"), u = resolveComponent("FmStepperField"), m = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
2520
+ return r({
2521
+ showSheet: f
2522
+ }), (V, g) => {
2523
+ const v = resolveComponent("FmSelect"), d = resolveComponent("FmStepperField"), p = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
2465
2524
  return openBlock(), createBlock(C, {
2466
2525
  "max-width": 560,
2467
- modelValue: unref(c),
2526
+ modelValue: unref(u),
2468
2527
  "onUpdate:modelValue": [
2469
- y[9] || (y[9] = (x) => isRef(c) ? c.value = x : null),
2470
- y[10] || (y[10] = (x) => c.value = x)
2528
+ g[9] || (g[9] = (x) => isRef(u) ? u.value = x : null),
2529
+ g[10] || (g[10] = (x) => u.value = x)
2471
2530
  ],
2472
2531
  header: "Edit reward",
2473
2532
  "dismiss-away": ""
2474
2533
  }, {
2475
2534
  "side-sheet-footer": withCtx(() => [
2476
2535
  createElementVNode("div", _hoisted_2$a, [
2477
- createVNode(m, {
2536
+ createVNode(p, {
2478
2537
  variant: "primary",
2479
2538
  type: "button",
2480
- disabled: unref(p).length > 0,
2539
+ disabled: unref(y).length > 0,
2481
2540
  label: "Confirm",
2482
- onClick: y[7] || (y[7] = (x) => V())
2541
+ onClick: g[7] || (g[7] = (x) => k())
2483
2542
  }, null, 8, ["disabled"]),
2484
- createVNode(m, {
2543
+ createVNode(p, {
2485
2544
  variant: "secondary",
2486
2545
  type: "button",
2487
2546
  label: "Cancel",
2488
- onClick: y[8] || (y[8] = (x) => c.value = !1)
2547
+ onClick: g[8] || (g[8] = (x) => u.value = !1)
2489
2548
  })
2490
2549
  ])
2491
2550
  ]),
2492
2551
  default: withCtx(() => {
2493
- var x, $, F;
2552
+ var x, N, w;
2494
2553
  return [
2495
2554
  unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
2496
- createVNode(g, {
2555
+ createVNode(v, {
2497
2556
  label: "Reward Type",
2498
2557
  items: [
2499
2558
  { label: "No Reward", value: "NO_REWARD" },
@@ -2501,12 +2560,12 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2501
2560
  { label: "Loyalty", value: "LOYALTY" }
2502
2561
  ],
2503
2562
  "model-value": unref(l).type,
2504
- "onUpdate:modelValue": y[0] || (y[0] = (N) => {
2505
- N == "NO_REWARD" ? l.value = {
2563
+ "onUpdate:modelValue": g[0] || (g[0] = ($) => {
2564
+ $ == "NO_REWARD" ? l.value = {
2506
2565
  type: "NO_REWARD",
2507
2566
  collectible: null,
2508
2567
  weight: 1
2509
- } : N === "VOUCHER" ? l.value = {
2568
+ } : $ === "VOUCHER" ? l.value = {
2510
2569
  collectible: null,
2511
2570
  type: "VOUCHER",
2512
2571
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -2521,7 +2580,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2521
2580
  },
2522
2581
  weight: 1
2523
2582
  } : l.value = {
2524
- collectible: unref(d).loyaltyRewards.raw[0]._id,
2583
+ collectible: unref(m).loyaltyRewards.raw[0]._id,
2525
2584
  type: "LOYALTY",
2526
2585
  earningOption: {
2527
2586
  amount: 1,
@@ -2534,75 +2593,75 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
2534
2593
  };
2535
2594
  })
2536
2595
  }, null, 8, ["model-value"]),
2537
- unref(l).type == "LOYALTY" ? (openBlock(), createBlock(g, {
2596
+ unref(l).type == "LOYALTY" ? (openBlock(), createBlock(v, {
2538
2597
  key: 0,
2539
2598
  label: "Loyalty type",
2540
- rules: [unref(ZodHelper).ruleAtPath(unref(r), "collectible", [unref(l).type])],
2541
- items: unref(d).loyaltyRewards.items,
2599
+ rules: [unref(ZodHelper).ruleAtPath(unref(s), "collectible", [unref(l).type])],
2600
+ items: unref(m).loyaltyRewards.items,
2542
2601
  "model-value": unref(l).collectible,
2543
- "onUpdate:modelValue": y[1] || (y[1] = (N) => unref(l).collectible = N)
2602
+ "onUpdate:modelValue": g[1] || (g[1] = ($) => unref(l).collectible = $)
2544
2603
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
2545
- createVNode(u, {
2604
+ createVNode(d, {
2546
2605
  label: "Weight",
2547
- rules: [unref(ZodHelper).ruleAtPath(unref(r), "weight", [unref(l).type])],
2606
+ rules: [unref(ZodHelper).ruleAtPath(unref(s), "weight", [unref(l).type])],
2548
2607
  "model-value": unref(l).weight,
2549
- "onUpdate:modelValue": y[2] || (y[2] = (N) => l.value = {
2608
+ "onUpdate:modelValue": g[2] || (g[2] = ($) => l.value = {
2550
2609
  ...unref(l),
2551
- weight: N
2610
+ weight: $
2552
2611
  })
2553
2612
  }, null, 8, ["rules", "model-value"]),
2554
2613
  unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2555
- ((x = unref(d).loyaltyRewards.items.find(
2556
- (N) => {
2557
- var D;
2558
- return N.value === ((D = unref(l)) == null ? void 0 : D.collectible);
2614
+ ((x = unref(m).loyaltyRewards.items.find(
2615
+ ($) => {
2616
+ var T;
2617
+ return $.value === ((T = unref(l)) == null ? void 0 : T.collectible);
2559
2618
  }
2560
2619
  )) == null ? void 0 : x.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2561
- y[11] || (y[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
2620
+ g[11] || (g[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
2562
2621
  createVNode(_sfc_main$z, {
2563
2622
  class: "mt-[-8px]",
2564
2623
  rules: [
2565
- unref(ZodHelper).ruleAtPath(unref(r), "earningOption", [unref(l).type])
2624
+ unref(ZodHelper).ruleAtPath(unref(s), "earningOption", [unref(l).type])
2566
2625
  ],
2567
- "helper-state": unref(ZodHelper).helperState(unref(p), "earningOption"),
2568
- "error-text": unref(ZodHelper).helperText(unref(p), "earningOption"),
2626
+ "helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
2627
+ "error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
2569
2628
  "fixed-type": !0,
2570
2629
  "model-value": unref(l).earningOption,
2571
- "onUpdate:modelValue": y[3] || (y[3] = (N) => l.value = {
2630
+ "onUpdate:modelValue": g[3] || (g[3] = ($) => l.value = {
2572
2631
  ...unref(l),
2573
- earningOption: N
2632
+ earningOption: $
2574
2633
  })
2575
2634
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"])
2576
2635
  ], 64)) : createCommentVNode("", !0),
2577
- y[12] || (y[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
2636
+ g[12] || (g[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
2578
2637
  createVNode(_sfc_main$A, {
2579
2638
  type: unref(l).type === "LOYALTY" ? "custom" : "range",
2580
- "for-credit": unref(l).type === "LOYALTY" && (($ = unref(d).loyaltyRewards.items.find(
2581
- (N) => {
2582
- var D;
2583
- return N.value === ((D = unref(l)) == null ? void 0 : D.collectible);
2639
+ "for-credit": unref(l).type === "LOYALTY" && ((N = unref(m).loyaltyRewards.items.find(
2640
+ ($) => {
2641
+ var T;
2642
+ return $.value === ((T = unref(l)) == null ? void 0 : T.collectible);
2584
2643
  }
2585
- )) == null ? void 0 : $.raw.type) === "CREDIT",
2644
+ )) == null ? void 0 : N.raw.type) === "CREDIT",
2586
2645
  class: "!gap-24",
2587
- rules: [unref(ZodHelper).ruleAtPath(unref(r), "validityOption", [unref(l).type])],
2646
+ rules: [unref(ZodHelper).ruleAtPath(unref(s), "validityOption", [unref(l).type])],
2588
2647
  "model-value": unref(l).validityOption,
2589
- "onUpdate:modelValue": y[4] || (y[4] = (N) => l.value = {
2648
+ "onUpdate:modelValue": g[4] || (g[4] = ($) => l.value = {
2590
2649
  ...unref(l),
2591
- validityOption: N
2650
+ validityOption: $
2592
2651
  })
2593
2652
  }, null, 8, ["type", "for-credit", "rules", "model-value"])
2594
2653
  ], 64)) : createCommentVNode("", !0),
2595
2654
  unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$B, {
2596
2655
  key: 2,
2597
2656
  "reward-image": unref(n),
2598
- "model-value": ((F = unref(l)) == null ? void 0 : F.collectibleConfig) ?? void 0,
2599
- "onUpdate:modelValue": y[5] || (y[5] = (N) => l.value = {
2657
+ "model-value": ((w = unref(l)) == null ? void 0 : w.collectibleConfig) ?? void 0,
2658
+ "onUpdate:modelValue": g[5] || (g[5] = ($) => l.value = {
2600
2659
  ...unref(l),
2601
- collectibleConfig: N
2660
+ collectibleConfig: $
2602
2661
  }),
2603
- "onUpdate:rewardImage": y[6] || (y[6] = (N) => n.value = N)
2662
+ "onUpdate:rewardImage": g[6] || (g[6] = ($) => n.value = $)
2604
2663
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
2605
- createVNode(JsonViewer, { json: unref(p) }, null, 8, ["json"])
2664
+ createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
2606
2665
  ])) : createCommentVNode("", !0)
2607
2666
  ];
2608
2667
  }),
@@ -2629,37 +2688,37 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2629
2688
  }
2630
2689
  },
2631
2690
  emits: ["update:model-value"],
2632
- setup(e, { emit: s }) {
2633
- const o = e, d = s, i = useMembershipStore(), { t: c } = useI18n(), l = z$1.array(z$1.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), n = computed(() => o.modelValue ?? []), a = computed(() => {
2634
- const y = l.safeParse(n.value);
2635
- return y.success ? [] : y.error.errors;
2636
- }), r = ref();
2637
- function p(y, g) {
2638
- var m;
2639
- const u = [...n.value];
2640
- u[g] = y, (m = r.value) == null || m.showSheet(!1), d("update:model-value", u);
2691
+ setup(e, { emit: r }) {
2692
+ const o = e, m = r, i = useMembershipStore(), { t: u } = useI18n(), l = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), n = computed(() => o.modelValue ?? []), a = computed(() => {
2693
+ const g = l.safeParse(n.value);
2694
+ return g.success ? [] : g.error.errors;
2695
+ }), s = ref();
2696
+ function y(g, v) {
2697
+ var p;
2698
+ const d = [...n.value];
2699
+ d[v] = g, (p = s.value) == null || p.showSheet(!1), m("update:model-value", d);
2641
2700
  }
2642
- function v(y) {
2643
- const g = y.type == "VOUCHER" ? y.collectibleConfig : i.collectibles.find(
2644
- (C) => C._id.toString() == y.collectible
2645
- ), u = CollectionUtils.formattedType((g == null ? void 0 : g.name) || ""), m = y.weight;
2701
+ function f(g) {
2702
+ const v = g.type == "VOUCHER" ? g.collectibleConfig : i.collectibles.find(
2703
+ (C) => C._id.toString() == g.collectible
2704
+ ), d = CollectionUtils.formattedType((v == null ? void 0 : v.name) || ""), p = g.weight;
2646
2705
  return {
2647
- label: isNullOrEmpty(u) ? "NO REWARD" : u,
2648
- sublabel: `${m} (${(m / n.value.reduce((C, x) => C + x.weight, 0) * 100).toFixed(2)}%)`
2706
+ label: isNullOrEmpty(d) ? "NO REWARD" : d,
2707
+ sublabel: `${p} (${(p / n.value.reduce((C, x) => C + x.weight, 0) * 100).toFixed(2)}%)`
2649
2708
  };
2650
2709
  }
2651
- function f(y) {
2652
- var u;
2653
- const g = [...n.value];
2654
- (u = r.value) == null || u.showSheet(!0, g[y], y);
2710
+ function c(g) {
2711
+ var d;
2712
+ const v = [...n.value];
2713
+ (d = s.value) == null || d.showSheet(!0, v[g], g);
2655
2714
  }
2656
- function V(y) {
2657
- const g = [...n.value];
2658
- g.splice(y, 1), d("update:model-value", g);
2715
+ function k(g) {
2716
+ const v = [...n.value];
2717
+ v.splice(g, 1), m("update:model-value", v);
2659
2718
  }
2660
- function k() {
2661
- var y;
2662
- (y = r.value) == null || y.showSheet(
2719
+ function V() {
2720
+ var g;
2721
+ (g = s.value) == null || g.showSheet(
2663
2722
  !0,
2664
2723
  {
2665
2724
  type: "NO_REWARD",
@@ -2669,33 +2728,33 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2669
2728
  n.value.length
2670
2729
  );
2671
2730
  }
2672
- return (y, g) => {
2673
- const u = resolveComponent("FmButton"), m = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
2731
+ return (g, v) => {
2732
+ const d = resolveComponent("FmButton"), p = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
2674
2733
  return openBlock(), createElementBlock("div", _hoisted_1$c, [
2675
- createElementVNode("div", _hoisted_2$9, toDisplayString(unref(c)("connect.template.configure_reward_type")), 1),
2676
- createVNode(u, {
2677
- label: unref(c)("connect.campaign.rewardPool.addReward"),
2678
- onClick: g[0] || (g[0] = (x) => k()),
2734
+ createElementVNode("div", _hoisted_2$9, toDisplayString(unref(u)("connect.template.configure_reward_type")), 1),
2735
+ createVNode(d, {
2736
+ label: unref(u)("connect.campaign.rewardPool.addReward"),
2737
+ onClick: v[0] || (v[0] = (x) => V()),
2679
2738
  variant: "plain",
2680
2739
  icon: "add"
2681
2740
  }, null, 8, ["label"]),
2682
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (x, $) => (openBlock(), createBlock(m, {
2683
- key: $,
2741
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (x, N) => (openBlock(), createBlock(p, {
2742
+ key: N,
2684
2743
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
2685
2744
  variant: "outlined",
2686
- onClick: (F) => f($)
2745
+ onClick: (w) => c(N)
2687
2746
  }, {
2688
2747
  default: withCtx(() => {
2689
- var F;
2748
+ var w;
2690
2749
  return [
2691
2750
  createElementVNode("div", null, [
2692
- createElementVNode("div", _hoisted_3$7, toDisplayString(x.type == "LOYALTY" ? (F = x == null ? void 0 : x.earningOption) == null ? void 0 : F.amount : "") + " " + toDisplayString(v(x).label), 1),
2693
- createElementVNode("div", _hoisted_4$6, toDisplayString(v(x).sublabel), 1)
2751
+ createElementVNode("div", _hoisted_3$7, toDisplayString(x.type == "LOYALTY" ? (w = x == null ? void 0 : x.earningOption) == null ? void 0 : w.amount : "") + " " + toDisplayString(f(x).label), 1),
2752
+ createElementVNode("div", _hoisted_4$6, toDisplayString(f(x).sublabel), 1)
2694
2753
  ]),
2695
- createVNode(u, {
2754
+ createVNode(d, {
2696
2755
  icon: "delete",
2697
2756
  variant: "tertiary",
2698
- onClick: (N) => (N.stopPropagation(), V($))
2757
+ onClick: ($) => ($.stopPropagation(), k(N))
2699
2758
  }, null, 8, ["onClick"])
2700
2759
  ];
2701
2760
  }),
@@ -2708,8 +2767,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2708
2767
  }, null, 8, ["text"]))), 128)),
2709
2768
  createVNode(_sfc_main$d, {
2710
2769
  ref_key: "sheetRef",
2711
- ref: r,
2712
- "onUpdate:modelValue": p
2770
+ ref: s,
2771
+ "onUpdate:modelValue": y
2713
2772
  }, null, 512)
2714
2773
  ]);
2715
2774
  };
@@ -2725,8 +2784,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2725
2784
  }
2726
2785
  },
2727
2786
  emits: ["update:model-value"],
2728
- setup(e, { emit: s }) {
2729
- const { t: o } = useI18n(), d = e, i = s, c = computed(() => [
2787
+ setup(e, { emit: r }) {
2788
+ const { t: o } = useI18n(), m = e, i = r, u = computed(() => [
2730
2789
  {
2731
2790
  label: o("connect.template.promotion_game.rock_paper_scissors.label"),
2732
2791
  description: o("connect.template.promotion_game.rock_paper_scissors.description"),
@@ -2734,39 +2793,39 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2734
2793
  }
2735
2794
  ]);
2736
2795
  return (l, n) => {
2737
- var v, f, V;
2738
- const a = resolveComponent("FmSwitch"), r = resolveComponent("FmCard"), p = resolveComponent("FmHelperText");
2796
+ var f, c, k;
2797
+ const a = resolveComponent("FmSwitch"), s = resolveComponent("FmCard"), y = resolveComponent("FmHelperText");
2739
2798
  return openBlock(), createElementBlock("div", _hoisted_1$b, [
2740
2799
  createVNode(a, {
2741
2800
  label: unref(o)("connect.template.promotion_game.enable"),
2742
- "model-value": !!((v = e.modelValue) != null && v.gameType),
2743
- "onUpdate:modelValue": n[0] || (n[0] = (k) => k ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
2801
+ "model-value": !!((f = e.modelValue) != null && f.gameType),
2802
+ "onUpdate:modelValue": n[0] || (n[0] = (V) => V ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
2744
2803
  }, null, 8, ["label", "model-value"]),
2745
- ((f = e.modelValue) == null ? void 0 : f.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
2746
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (k) => {
2747
- var y, g;
2748
- return openBlock(), createBlock(r, {
2804
+ ((c = e.modelValue) == null ? void 0 : c.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
2805
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (V) => {
2806
+ var g, v;
2807
+ return openBlock(), createBlock(s, {
2749
2808
  variant: "outlined",
2750
2809
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
2751
- "col-span-2": unref(c).length == 1,
2752
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((y = e.modelValue) == null ? void 0 : y.gameType) == k.value,
2753
- "hover:bg-fm-color-opacity-sm": ((g = e.modelValue) == null ? void 0 : g.gameType) != k.value
2810
+ "col-span-2": unref(u).length == 1,
2811
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((g = e.modelValue) == null ? void 0 : g.gameType) == V.value,
2812
+ "hover:bg-fm-color-opacity-sm": ((v = e.modelValue) == null ? void 0 : v.gameType) != V.value
2754
2813
  }]),
2755
2814
  onClick: () => {
2756
- var u;
2757
- ((u = d.modelValue) == null ? void 0 : u.gameType) != k.value && i("update:model-value", { gameType: k.value });
2815
+ var d;
2816
+ ((d = m.modelValue) == null ? void 0 : d.gameType) != V.value && i("update:model-value", { gameType: V.value });
2758
2817
  },
2759
- key: k.value
2818
+ key: V.value
2760
2819
  }, {
2761
2820
  default: withCtx(() => [
2762
- createElementVNode("div", _hoisted_3$6, toDisplayString(k.label), 1),
2763
- createElementVNode("div", _hoisted_4$5, toDisplayString(k.description), 1)
2821
+ createElementVNode("div", _hoisted_3$6, toDisplayString(V.label), 1),
2822
+ createElementVNode("div", _hoisted_4$5, toDisplayString(V.description), 1)
2764
2823
  ]),
2765
2824
  _: 2
2766
2825
  }, 1032, ["class", "onClick"]);
2767
2826
  }), 128))
2768
2827
  ])) : createCommentVNode("", !0),
2769
- ((V = e.modelValue) == null ? void 0 : V.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(p, {
2828
+ ((k = e.modelValue) == null ? void 0 : k.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(y, {
2770
2829
  key: 1,
2771
2830
  text: unref(o)("connect.template.promotion_game.rock_paper_scissors.warning"),
2772
2831
  state: "warning"
@@ -2785,18 +2844,18 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2785
2844
  },
2786
2845
  schema: {
2787
2846
  type: Object,
2788
- default: () => z$1.any()
2847
+ default: () => z.any()
2789
2848
  }
2790
2849
  },
2791
2850
  emits: ["update:model-value"],
2792
- setup(e, { emit: s }) {
2793
- const { t: o } = useI18n(), d = e, i = s, c = ref(d.modelValue ?? {}), l = ref(
2851
+ setup(e, { emit: r }) {
2852
+ const { t: o } = useI18n(), m = e, i = r, u = ref(m.modelValue ?? {}), l = ref(
2794
2853
  (() => {
2795
- const v = {};
2796
- return c.value.workingHour && Object.keys(c.value.workingHour).forEach((f) => {
2797
- const V = c.value.workingHour[f];
2798
- V && "periods" in V && Array.isArray(V.periods) ? v[f] = V.periods : Array.isArray(V) && (v[f] = V);
2799
- }), v;
2854
+ const f = {};
2855
+ return u.value.workingHour && Object.keys(u.value.workingHour).forEach((c) => {
2856
+ const k = u.value.workingHour[c];
2857
+ k && "periods" in k && Array.isArray(k.periods) ? f[c] = k.periods : Array.isArray(k) && (f[c] = k);
2858
+ }), f;
2800
2859
  })()
2801
2860
  ), n = [
2802
2861
  { key: "mon", label: "Monday" },
@@ -2806,30 +2865,30 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2806
2865
  { key: "fri", label: "Friday" },
2807
2866
  { key: "sat", label: "Saturday" },
2808
2867
  { key: "sun", label: "Sunday" }
2809
- ], a = (v) => {
2810
- l.value[v] || (l.value[v] = []), l.value[v].push({
2868
+ ], a = (f) => {
2869
+ l.value[f] || (l.value[f] = []), l.value[f].push({
2811
2870
  startTime: "00:00",
2812
2871
  endTime: "23:59"
2813
- }), p();
2814
- }, r = (v, f) => {
2815
- l.value[v] && l.value[v].length > f && (l.value[v].splice(f, 1), l.value[v].length === 0 && delete l.value[v], p());
2816
- }, p = () => {
2817
- const v = Object.keys(l.value).reduce(
2818
- (f, V) => (l.value[V] && l.value[V].length > 0 && (f[V] = {
2819
- periods: l.value[V]
2820
- }), f),
2872
+ }), y();
2873
+ }, s = (f, c) => {
2874
+ l.value[f] && l.value[f].length > c && (l.value[f].splice(c, 1), l.value[f].length === 0 && delete l.value[f], y());
2875
+ }, y = () => {
2876
+ const f = Object.keys(l.value).reduce(
2877
+ (c, k) => (l.value[k] && l.value[k].length > 0 && (c[k] = {
2878
+ periods: l.value[k]
2879
+ }), c),
2821
2880
  {}
2822
2881
  );
2823
- c.value.workingHour = Object.keys(v).length > 0 ? v : void 0;
2882
+ u.value.workingHour = Object.keys(f).length > 0 ? f : void 0;
2824
2883
  };
2825
- return watch(c, () => i("update:model-value", c.value), { deep: !0 }), watch(l, p, { deep: !0 }), (v, f) => {
2826
- const V = resolveComponent("FmSelect"), k = resolveComponent("FmStepperField"), y = resolveComponent("FmCheckbox"), g = resolveComponent("FmTimePicker"), u = resolveComponent("FmButton");
2884
+ return watch(u, () => i("update:model-value", u.value), { deep: !0 }), watch(l, y, { deep: !0 }), (f, c) => {
2885
+ const k = resolveComponent("FmSelect"), V = resolveComponent("FmStepperField"), g = resolveComponent("FmCheckbox"), v = resolveComponent("FmTimePicker"), d = resolveComponent("FmButton");
2827
2886
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
2828
2887
  createElementVNode("div", _hoisted_2$7, [
2829
- createVNode(V, {
2888
+ createVNode(k, {
2830
2889
  label: unref(o)("connect.template.eaterType"),
2831
- modelValue: unref(c).eaterType,
2832
- "onUpdate:modelValue": f[0] || (f[0] = (m) => unref(c).eaterType = m),
2890
+ modelValue: unref(u).eaterType,
2891
+ "onUpdate:modelValue": c[0] || (c[0] = (p) => unref(u).eaterType = p),
2833
2892
  items: [
2834
2893
  { label: unref(o)("connect.template.allEaters"), value: "all" },
2835
2894
  { label: unref(o)("connect.template.newEatersOnly"), value: "new" },
@@ -2840,9 +2899,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2840
2899
  ],
2841
2900
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "eaterType")]
2842
2901
  }, null, 8, ["label", "modelValue", "items", "rules"]),
2843
- createVNode(k, {
2844
- modelValue: unref(c).minBasketAmount,
2845
- "onUpdate:modelValue": f[1] || (f[1] = (m) => unref(c).minBasketAmount = m),
2902
+ createVNode(V, {
2903
+ modelValue: unref(u).minBasketAmount,
2904
+ "onUpdate:modelValue": c[1] || (c[1] = (p) => unref(u).minBasketAmount = p),
2846
2905
  "show-steppers": !1,
2847
2906
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "minBasketAmount")]
2848
2907
  }, {
@@ -2856,9 +2915,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2856
2915
  ]),
2857
2916
  _: 1
2858
2917
  }, 8, ["modelValue", "rules"]),
2859
- createVNode(k, {
2860
- modelValue: unref(c).bundleQuantity,
2861
- "onUpdate:modelValue": f[2] || (f[2] = (m) => unref(c).bundleQuantity = m),
2918
+ createVNode(V, {
2919
+ modelValue: unref(u).bundleQuantity,
2920
+ "onUpdate:modelValue": c[2] || (c[2] = (p) => unref(u).bundleQuantity = p),
2862
2921
  "show-steppers": !1,
2863
2922
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "bundleQuantity")]
2864
2923
  }, {
@@ -2876,46 +2935,46 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2876
2935
  createElementVNode("div", _hoisted_3$5, [
2877
2936
  createElementVNode("div", _hoisted_4$4, [
2878
2937
  createElementVNode("div", _hoisted_5$4, toDisplayString(unref(o)("connect.template.operationHours")), 1),
2879
- (openBlock(), createElementBlock(Fragment, null, renderList(n, (m) => createElementVNode("div", {
2880
- key: m.key,
2938
+ (openBlock(), createElementBlock(Fragment, null, renderList(n, (p) => createElementVNode("div", {
2939
+ key: p.key,
2881
2940
  class: "space-y-2"
2882
2941
  }, [
2883
2942
  createElementVNode("div", _hoisted_6$3, [
2884
- createVNode(y, {
2885
- label: m.label,
2886
- "model-value": !!(unref(l)[m.key] && unref(l)[m.key].length > 0),
2943
+ createVNode(g, {
2944
+ label: p.label,
2945
+ "model-value": !!(unref(l)[p.key] && unref(l)[p.key].length > 0),
2887
2946
  "onUpdate:modelValue": (C) => {
2888
- C ? a(m.key) : (unref(l)[m.key] = [], delete unref(l)[m.key], p());
2947
+ C ? a(p.key) : (unref(l)[p.key] = [], delete unref(l)[p.key], y());
2889
2948
  }
2890
2949
  }, null, 8, ["label", "model-value", "onUpdate:modelValue"])
2891
2950
  ]),
2892
- unref(l)[m.key] && unref(l)[m.key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
2893
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[m.key] || [], (C, x) => (openBlock(), createElementBlock("div", {
2951
+ unref(l)[p.key] && unref(l)[p.key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
2952
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[p.key] || [], (C, x) => (openBlock(), createElementBlock("div", {
2894
2953
  key: x,
2895
2954
  class: "flex items-center space-x-2 w-100"
2896
2955
  }, [
2897
- createVNode(g, {
2956
+ createVNode(v, {
2898
2957
  "model-value": C.startTime || "",
2899
- "onUpdate:modelValue": ($) => {
2900
- unref(l)[m.key] && unref(l)[m.key][x] && (unref(l)[m.key][x].startTime = $ || "", p());
2958
+ "onUpdate:modelValue": (N) => {
2959
+ unref(l)[p.key] && unref(l)[p.key][x] && (unref(l)[p.key][x].startTime = N || "", y());
2901
2960
  }
2902
2961
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
2903
- f[3] || (f[3] = createElementVNode("span", null, "to", -1)),
2904
- createVNode(g, {
2962
+ c[3] || (c[3] = createElementVNode("span", null, "to", -1)),
2963
+ createVNode(v, {
2905
2964
  "model-value": C.endTime || "",
2906
- "onUpdate:modelValue": ($) => {
2907
- unref(l)[m.key] && unref(l)[m.key][x] && (unref(l)[m.key][x].endTime = $ || "", p());
2965
+ "onUpdate:modelValue": (N) => {
2966
+ unref(l)[p.key] && unref(l)[p.key][x] && (unref(l)[p.key][x].endTime = N || "", y());
2908
2967
  }
2909
2968
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
2910
- createVNode(u, {
2969
+ createVNode(d, {
2911
2970
  variant: "tertiary",
2912
2971
  size: "sm",
2913
- onClick: ($) => r(m.key, x),
2972
+ onClick: (N) => s(p.key, x),
2914
2973
  icon: "close"
2915
2974
  }, null, 8, ["onClick"]),
2916
- x === 0 ? (openBlock(), createBlock(u, {
2975
+ x === 0 ? (openBlock(), createBlock(d, {
2917
2976
  key: 0,
2918
- onClick: ($) => a(m.key),
2977
+ onClick: (N) => a(p.key),
2919
2978
  icon: "add",
2920
2979
  variant: "plain"
2921
2980
  }, null, 8, ["onClick"])) : createCommentVNode("", !0)
@@ -2935,19 +2994,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2935
2994
  },
2936
2995
  schema: {
2937
2996
  type: Object,
2938
- default: () => z$1.any()
2997
+ default: () => z.any()
2939
2998
  }
2940
2999
  },
2941
3000
  emits: ["update:model-value"],
2942
- setup(e, { emit: s }) {
2943
- const { t: o } = useI18n(), d = e, i = s, c = ref(d.modelValue ?? {});
2944
- return watch(c, () => i("update:model-value", c.value)), (l, n) => {
3001
+ setup(e, { emit: r }) {
3002
+ const { t: o } = useI18n(), m = e, i = r, u = ref(m.modelValue ?? {});
3003
+ return watch(u, () => i("update:model-value", u.value)), (l, n) => {
2945
3004
  const a = resolveComponent("FmStepperField");
2946
3005
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
2947
3006
  createElementVNode("div", _hoisted_2$6, [
2948
3007
  createVNode(a, {
2949
- modelValue: unref(c).totalCount,
2950
- "onUpdate:modelValue": n[0] || (n[0] = (r) => unref(c).totalCount = r),
3008
+ modelValue: unref(u).totalCount,
3009
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => unref(u).totalCount = s),
2951
3010
  "show-steppers": !1,
2952
3011
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCount")]
2953
3012
  }, {
@@ -2962,8 +3021,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2962
3021
  _: 1
2963
3022
  }, 8, ["modelValue", "rules"]),
2964
3023
  createVNode(a, {
2965
- modelValue: unref(c).totalCountPerUser,
2966
- "onUpdate:modelValue": n[1] || (n[1] = (r) => unref(c).totalCountPerUser = r),
3024
+ modelValue: unref(u).totalCountPerUser,
3025
+ "onUpdate:modelValue": n[1] || (n[1] = (s) => unref(u).totalCountPerUser = s),
2967
3026
  "show-steppers": !1,
2968
3027
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCountPerUser")]
2969
3028
  }, {
@@ -2989,8 +3048,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2989
3048
  }
2990
3049
  },
2991
3050
  emits: ["update:model-value"],
2992
- setup(e, { emit: s }) {
2993
- const { t: o } = useI18n(), d = e, i = s, c = computed(() => [
3051
+ setup(e, { emit: r }) {
3052
+ const { t: o } = useI18n(), m = e, i = r, u = computed(() => [
2994
3053
  {
2995
3054
  label: o("connect.campaign.mission.typeOption.STAMP.label"),
2996
3055
  description: o("connect.campaign.mission.typeOption.STAMP.description"),
@@ -3007,21 +3066,21 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
3007
3066
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
3008
3067
  createElementVNode("div", _hoisted_2$5, toDisplayString(unref(o)("connect.template.select_game")), 1),
3009
3068
  createElementVNode("div", _hoisted_3$4, [
3010
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (r) => (openBlock(), createBlock(a, {
3069
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (s) => (openBlock(), createBlock(a, {
3011
3070
  variant: "outlined",
3012
3071
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
3013
- "col-span-2": unref(c).length == 1,
3014
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
3015
- "hover:bg-fm-color-opacity-sm": e.modelValue != r.value
3072
+ "col-span-2": unref(u).length == 1,
3073
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == s.value,
3074
+ "hover:bg-fm-color-opacity-sm": e.modelValue != s.value
3016
3075
  }]),
3017
3076
  onClick: () => {
3018
- d.modelValue != r.value && i("update:model-value", r.value);
3077
+ m.modelValue != s.value && i("update:model-value", s.value);
3019
3078
  },
3020
- key: r.value
3079
+ key: s.value
3021
3080
  }, {
3022
3081
  default: withCtx(() => [
3023
- createElementVNode("div", _hoisted_4$3, toDisplayString(r.label), 1),
3024
- createElementVNode("div", _hoisted_5$3, toDisplayString(r.description), 1)
3082
+ createElementVNode("div", _hoisted_4$3, toDisplayString(s.label), 1),
3083
+ createElementVNode("div", _hoisted_5$3, toDisplayString(s.description), 1)
3025
3084
  ]),
3026
3085
  _: 2
3027
3086
  }, 1032, ["class", "onClick"]))), 128))
@@ -3043,13 +3102,13 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
3043
3102
  }
3044
3103
  },
3045
3104
  emits: ["update:model-value"],
3046
- setup(e, { emit: s }) {
3047
- const o = s;
3048
- return (d, i) => {
3049
- const c = resolveComponent("FmStepperField");
3105
+ setup(e, { emit: r }) {
3106
+ const o = r;
3107
+ return (m, i) => {
3108
+ const u = resolveComponent("FmStepperField");
3050
3109
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
3051
3110
  i[1] || (i[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1)),
3052
- createVNode(c, {
3111
+ createVNode(u, {
3053
3112
  label: "Maximum to collect",
3054
3113
  "model-value": e.modelValue || null,
3055
3114
  "onUpdate:modelValue": i[0] || (i[0] = (l) => o("update:model-value", l)),
@@ -3068,29 +3127,29 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
3068
3127
  }
3069
3128
  },
3070
3129
  emits: ["update:model-value"],
3071
- setup(e, { expose: s, emit: o }) {
3072
- const d = e, i = useMembershipStore(), { minor: c } = useLoading, l = ref(!1), n = ref(), a = ref(), r = ref(0), p = computed(() => {
3073
- var u;
3074
- return ((u = i.loyaltyRewards.items.find(
3075
- (m) => {
3130
+ setup(e, { expose: r, emit: o }) {
3131
+ const m = e, i = useMembershipStore(), { minor: u } = useLoading, l = ref(!1), n = ref(), a = ref(), s = ref(0), y = computed(() => {
3132
+ var d;
3133
+ return ((d = i.loyaltyRewards.items.find(
3134
+ (p) => {
3076
3135
  var C;
3077
- return m.value === ((C = n.value) == null ? void 0 : C.collectible);
3136
+ return p.value === ((C = n.value) == null ? void 0 : C.collectible);
3078
3137
  }
3079
- )) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
3080
- }), v = computed(() => {
3081
- const g = p.value.safeParse(n.value);
3082
- return g.success ? [] : g.error.errors;
3138
+ )) == null ? void 0 : d.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
3139
+ }), f = computed(() => {
3140
+ const v = y.value.safeParse(n.value);
3141
+ return v.success ? [] : v.error.errors;
3083
3142
  });
3084
- function f(g, u, m) {
3085
- g && (n.value = u, r.value = m), l.value = g;
3143
+ function c(v, d, p) {
3144
+ v && (n.value = d, s.value = p), l.value = v;
3086
3145
  }
3087
- const V = o;
3088
- async function k() {
3089
- const g = p.value.safeParse(n.value);
3090
- g.success && (await c(
3146
+ const k = o;
3147
+ async function V() {
3148
+ const v = y.value.safeParse(n.value);
3149
+ v.success && (await u(
3091
3150
  async () => {
3092
- g.data.type === "VOUCHER" && a.value && (g.data.collectibleConfig.image = await firebaseStorage.update(
3093
- g.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
3151
+ v.data.type === "VOUCHER" && a.value && (v.data.collectibleConfig.image = await firebaseStorage.update(
3152
+ v.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
3094
3153
  a.value
3095
3154
  ));
3096
3155
  },
@@ -3098,40 +3157,40 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
3098
3157
  message: "Uploading reward image",
3099
3158
  successMessage: "Reward image updated"
3100
3159
  }
3101
- ), V("update:model-value", g.data, r.value));
3160
+ ), k("update:model-value", v.data, s.value));
3102
3161
  }
3103
- const y = ref();
3104
- return s({
3105
- showSheet: f
3106
- }), (g, u) => {
3107
- const m = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), x = resolveComponent("FmForm"), $ = resolveComponent("FmButton"), F = resolveComponent("FmSideSheet");
3108
- return openBlock(), createBlock(F, {
3162
+ const g = ref();
3163
+ return r({
3164
+ showSheet: c
3165
+ }), (v, d) => {
3166
+ const p = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), x = resolveComponent("FmForm"), N = resolveComponent("FmButton"), w = resolveComponent("FmSideSheet");
3167
+ return openBlock(), createBlock(w, {
3109
3168
  "max-width": 560,
3110
3169
  modelValue: unref(l),
3111
3170
  "onUpdate:modelValue": [
3112
- u[10] || (u[10] = (N) => isRef(l) ? l.value = N : null),
3113
- u[11] || (u[11] = (N) => l.value = N)
3171
+ d[10] || (d[10] = ($) => isRef(l) ? l.value = $ : null),
3172
+ d[11] || (d[11] = ($) => l.value = $)
3114
3173
  ],
3115
3174
  header: "Edit reward",
3116
3175
  "dismiss-away": ""
3117
3176
  }, {
3118
3177
  "side-sheet-footer": withCtx(() => [
3119
3178
  createElementVNode("div", _hoisted_1$6, [
3120
- createVNode($, {
3179
+ createVNode(N, {
3121
3180
  variant: "primary",
3122
3181
  type: "button",
3123
3182
  label: "Confirm",
3124
- disabled: unref(v).length > 0,
3125
- onClick: u[8] || (u[8] = async () => {
3126
- var N;
3127
- return (N = unref(y)) == null ? void 0 : N.validateInputs();
3183
+ disabled: unref(f).length > 0,
3184
+ onClick: d[8] || (d[8] = async () => {
3185
+ var $;
3186
+ return ($ = unref(g)) == null ? void 0 : $.validateInputs();
3128
3187
  })
3129
3188
  }, null, 8, ["disabled"]),
3130
- createVNode($, {
3189
+ createVNode(N, {
3131
3190
  variant: "secondary",
3132
3191
  type: "button",
3133
3192
  label: "Cancel",
3134
- onClick: u[9] || (u[9] = (N) => l.value = !1)
3193
+ onClick: d[9] || (d[9] = ($) => l.value = !1)
3135
3194
  })
3136
3195
  ])
3137
3196
  ]),
@@ -3141,27 +3200,27 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
3141
3200
  key: 0,
3142
3201
  class: "flex flex-col gap-y-24",
3143
3202
  ref_key: "formRef",
3144
- ref: y,
3145
- onValidationSuccess: u[7] || (u[7] = (N) => k())
3203
+ ref: g,
3204
+ onValidationSuccess: d[7] || (d[7] = ($) => V())
3146
3205
  }, {
3147
3206
  default: withCtx(() => {
3148
- var N, D;
3207
+ var $, T;
3149
3208
  return [
3150
- unref(n).type ? (openBlock(), createBlock(m, {
3209
+ unref(n).type ? (openBlock(), createBlock(p, {
3151
3210
  key: 0,
3152
3211
  label: "Threshold",
3153
3212
  rules: [
3154
3213
  unref(ZodHelper).toRule(
3155
- unref(z$1).number().min(1).max(
3156
- d.maxThreshold,
3157
- `Number cannot be more than ${d.maxThreshold}`
3214
+ unref(z).number().min(1).max(
3215
+ m.maxThreshold,
3216
+ `Number cannot be more than ${m.maxThreshold}`
3158
3217
  )
3159
3218
  )
3160
3219
  ],
3161
3220
  "model-value": unref(n).threshold,
3162
- "onUpdate:modelValue": u[0] || (u[0] = (w) => n.value = {
3221
+ "onUpdate:modelValue": d[0] || (d[0] = (R) => n.value = {
3163
3222
  ...unref(n),
3164
- threshold: w
3223
+ threshold: R
3165
3224
  })
3166
3225
  }, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
3167
3226
  createVNode(C, {
@@ -3171,9 +3230,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
3171
3230
  { label: "Loyalty", value: "LOYALTY" }
3172
3231
  ],
3173
3232
  "model-value": unref(n).type,
3174
- "onUpdate:modelValue": u[1] || (u[1] = (w) => {
3175
- var O, j;
3176
- w === "VOUCHER" ? n.value = {
3233
+ "onUpdate:modelValue": d[1] || (d[1] = (R) => {
3234
+ var A, M;
3235
+ R === "VOUCHER" ? n.value = {
3177
3236
  collectible: null,
3178
3237
  type: "VOUCHER",
3179
3238
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -3186,7 +3245,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
3186
3245
  validityOption: {
3187
3246
  validForDay: 7
3188
3247
  },
3189
- threshold: (O = unref(n)) == null ? void 0 : O.threshold
3248
+ threshold: (A = unref(n)) == null ? void 0 : A.threshold
3190
3249
  } : n.value = {
3191
3250
  collectible: unref(i).loyaltyRewards.raw[0]._id,
3192
3251
  type: "LOYALTY",
@@ -3197,60 +3256,60 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
3197
3256
  validityOption: {
3198
3257
  validForDay: 7
3199
3258
  },
3200
- threshold: (j = unref(n)) == null ? void 0 : j.threshold
3259
+ threshold: (M = unref(n)) == null ? void 0 : M.threshold
3201
3260
  };
3202
3261
  })
3203
3262
  }, null, 8, ["model-value"]),
3204
3263
  unref(n).type == "LOYALTY" ? (openBlock(), createBlock(C, {
3205
3264
  key: 1,
3206
3265
  label: "Loyalty type",
3207
- rules: [unref(ZodHelper).ruleAtPath(unref(p), "collectible", [unref(n).type])],
3266
+ rules: [unref(ZodHelper).ruleAtPath(unref(y), "collectible", [unref(n).type])],
3208
3267
  items: unref(i).loyaltyRewards.items,
3209
3268
  "model-value": unref(n).collectible,
3210
- "onUpdate:modelValue": u[2] || (u[2] = (w) => unref(n).collectible = w)
3269
+ "onUpdate:modelValue": d[2] || (d[2] = (R) => unref(n).collectible = R)
3211
3270
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
3212
3271
  unref(n).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
3213
- u[12] || (u[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
3272
+ d[12] || (d[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
3214
3273
  createVNode(_sfc_main$z, {
3215
3274
  class: "mt-[-8px]",
3216
- rules: [unref(ZodHelper).ruleAtPath(unref(p), "earningOption", [unref(n).type])],
3217
- "helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
3218
- "error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
3275
+ rules: [unref(ZodHelper).ruleAtPath(unref(y), "earningOption", [unref(n).type])],
3276
+ "helper-state": unref(ZodHelper).helperState(unref(f), "earningOption"),
3277
+ "error-text": unref(ZodHelper).helperText(unref(f), "earningOption"),
3219
3278
  "fixed-type": !0,
3220
3279
  "model-value": unref(n).earningOption,
3221
- "onUpdate:modelValue": u[3] || (u[3] = (w) => n.value = {
3280
+ "onUpdate:modelValue": d[3] || (d[3] = (R) => n.value = {
3222
3281
  ...unref(n),
3223
- earningOption: w
3282
+ earningOption: R
3224
3283
  })
3225
3284
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
3226
3285
  createVNode(_sfc_main$A, {
3227
3286
  class: "!gap-24",
3228
3287
  type: unref(n).type === "LOYALTY" ? "custom" : "range",
3229
- "for-credit": unref(n).type === "LOYALTY" && ((N = unref(i).loyaltyRewards.items.find(
3230
- (w) => {
3231
- var O;
3232
- return w.value === ((O = unref(n)) == null ? void 0 : O.collectible);
3288
+ "for-credit": unref(n).type === "LOYALTY" && (($ = unref(i).loyaltyRewards.items.find(
3289
+ (R) => {
3290
+ var A;
3291
+ return R.value === ((A = unref(n)) == null ? void 0 : A.collectible);
3233
3292
  }
3234
- )) == null ? void 0 : N.raw.type) === "CREDIT",
3235
- rules: [unref(ZodHelper).ruleAtPath(unref(p), "validityOption", [unref(n).type])],
3293
+ )) == null ? void 0 : $.raw.type) === "CREDIT",
3294
+ rules: [unref(ZodHelper).ruleAtPath(unref(y), "validityOption", [unref(n).type])],
3236
3295
  "model-value": unref(n).validityOption,
3237
- "onUpdate:modelValue": u[4] || (u[4] = (w) => n.value = {
3296
+ "onUpdate:modelValue": d[4] || (d[4] = (R) => n.value = {
3238
3297
  ...unref(n),
3239
- validityOption: w
3298
+ validityOption: R
3240
3299
  })
3241
3300
  }, null, 8, ["type", "for-credit", "rules", "model-value"])
3242
3301
  ], 64)) : createCommentVNode("", !0),
3243
3302
  unref(n).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$B, {
3244
3303
  key: 3,
3245
3304
  "reward-image": unref(a),
3246
- "model-value": ((D = unref(n)) == null ? void 0 : D.collectibleConfig) ?? void 0,
3247
- "onUpdate:modelValue": u[5] || (u[5] = (w) => n.value = {
3305
+ "model-value": ((T = unref(n)) == null ? void 0 : T.collectibleConfig) ?? void 0,
3306
+ "onUpdate:modelValue": d[5] || (d[5] = (R) => n.value = {
3248
3307
  ...unref(n),
3249
- collectibleConfig: w
3308
+ collectibleConfig: R
3250
3309
  }),
3251
- "onUpdate:rewardImage": u[6] || (u[6] = (w) => a.value = w)
3310
+ "onUpdate:rewardImage": d[6] || (d[6] = (R) => a.value = R)
3252
3311
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
3253
- createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
3312
+ createVNode(JsonViewer, { json: unref(f) }, null, 8, ["json"])
3254
3313
  ];
3255
3314
  }),
3256
3315
  _: 1
@@ -3284,19 +3343,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
3284
3343
  }
3285
3344
  },
3286
3345
  setup(e) {
3287
- const s = e, { maxRange: o, currentRange: d, markers: i } = toRefs(s), c = computed(
3288
- () => Math.min(d.value / o.value * 100, 100)
3346
+ const r = e, { maxRange: o, currentRange: m, markers: i } = toRefs(r), u = computed(
3347
+ () => Math.min(m.value / o.value * 100, 100)
3289
3348
  ), l = (n) => n / o.value * 100;
3290
3349
  return (n, a) => {
3291
- const r = resolveComponent("FmIcon");
3350
+ const s = resolveComponent("FmIcon");
3292
3351
  return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
3293
- (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(o), 40), (p) => (openBlock(), createBlock(r, {
3352
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(o), 40), (y) => (openBlock(), createBlock(s, {
3294
3353
  class: normalizeClass(
3295
- unref(d) >= p ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
3354
+ unref(m) >= y ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
3296
3355
  ),
3297
- outline: unref(d) < p,
3298
- key: p,
3299
- name: unref(i).some((v) => v === p) ? "featured_seasonal_and_gifts" : "check_circle"
3356
+ outline: unref(m) < y,
3357
+ key: y,
3358
+ name: unref(i).some((f) => f === y) ? "featured_seasonal_and_gifts" : "check_circle"
3300
3359
  }, null, 8, ["class", "outline", "name"]))), 128))
3301
3360
  ])) : (openBlock(), createElementBlock("div", {
3302
3361
  key: 1,
@@ -3304,12 +3363,12 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
3304
3363
  }, [
3305
3364
  createElementVNode("div", {
3306
3365
  class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
3307
- style: normalizeStyle({ width: unref(c) + "%" })
3366
+ style: normalizeStyle({ width: unref(u) + "%" })
3308
3367
  }, null, 4),
3309
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (p, v) => (openBlock(), createElementBlock("div", {
3310
- key: v,
3368
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (y, f) => (openBlock(), createElementBlock("div", {
3369
+ key: f,
3311
3370
  class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
3312
- style: normalizeStyle({ left: l(p) + "%" })
3371
+ style: normalizeStyle({ left: l(y) + "%" })
3313
3372
  }, [
3314
3373
  createElementVNode("div", _hoisted_2$4, [
3315
3374
  createElementVNode("div", {
@@ -3323,16 +3382,16 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
3323
3382
  }
3324
3383
  }), isObject = (e) => e !== null && typeof e == "object";
3325
3384
  function changeKeysFactory(e) {
3326
- return function s(o, d = 1, i) {
3327
- if (d === 0 || !isObject(o))
3385
+ return function r(o, m = 1, i) {
3386
+ if (m === 0 || !isObject(o))
3328
3387
  return o;
3329
3388
  if (Array.isArray(o))
3330
- return o.map((l) => s(l, d - 1, i));
3331
- const c = Object.create(Object.getPrototypeOf(o));
3389
+ return o.map((l) => r(l, m - 1, i));
3390
+ const u = Object.create(Object.getPrototypeOf(o));
3332
3391
  return Object.keys(o).forEach((l) => {
3333
- const n = o[l], a = e(l, i), r = s(n, d - 1, i);
3334
- c[a] = r;
3335
- }), c;
3392
+ const n = o[l], a = e(l, i), s = r(n, m - 1, i);
3393
+ u[a] = s;
3394
+ }), u;
3336
3395
  };
3337
3396
  }
3338
3397
  const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$2 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = { class: "fm-typo-en-title-sm-800" }, _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
@@ -3348,50 +3407,50 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
3348
3407
  }
3349
3408
  },
3350
3409
  emits: ["update:model-value"],
3351
- setup(e, { emit: s }) {
3352
- const { t: o } = useI18n(), d = e, i = s, c = useMembershipStore(), l = z$1.array(z$1.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), n = computed(
3353
- () => d.modelValue.sort((g, u) => g.threshold - u.threshold) ?? []
3410
+ setup(e, { emit: r }) {
3411
+ const { t: o } = useI18n(), m = e, i = r, u = useMembershipStore(), l = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), n = computed(
3412
+ () => m.modelValue.sort((v, d) => v.threshold - d.threshold) ?? []
3354
3413
  ), a = computed(() => {
3355
- const g = l.safeParse(n.value);
3356
- return g.success ? [] : g.error.errors;
3357
- }), r = ref();
3358
- function p(g, u) {
3414
+ const v = l.safeParse(n.value);
3415
+ return v.success ? [] : v.error.errors;
3416
+ }), s = ref();
3417
+ function y(v, d) {
3359
3418
  var C;
3360
- const m = [...n.value];
3361
- m[u] = g, (C = r.value) == null || C.showSheet(!1), i("update:model-value", m);
3419
+ const p = [...n.value];
3420
+ p[d] = v, (C = s.value) == null || C.showSheet(!1), i("update:model-value", p);
3362
3421
  }
3363
- function v(g) {
3364
- const u = g.type == "VOUCHER" ? g.collectibleConfig : c.collectibles.find(
3365
- (x) => x._id.toString() == g.collectible
3366
- ), m = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), C = g.earningOption.type == "FIXED" ? o("connect.template.mission_pool.reward_sublabel_fixed", {
3367
- threshold: g.threshold,
3368
- amount: g.earningOption.amount
3422
+ function f(v) {
3423
+ const d = v.type == "VOUCHER" ? v.collectibleConfig : u.collectibles.find(
3424
+ (x) => x._id.toString() == v.collectible
3425
+ ), p = CollectionUtils.formattedType((d == null ? void 0 : d.name) || ""), C = v.earningOption.type == "FIXED" ? o("connect.template.mission_pool.reward_sublabel_fixed", {
3426
+ threshold: v.threshold,
3427
+ amount: v.earningOption.amount
3369
3428
  }) : o("connect.template.mission_pool.reward_sublabel_per_spend", {
3370
- threshold: g.threshold,
3371
- amount: g.earningOption.amount,
3372
- every: g.earningOption.every
3429
+ threshold: v.threshold,
3430
+ amount: v.earningOption.amount,
3431
+ every: v.earningOption.every
3373
3432
  });
3374
3433
  return {
3375
- label: isNullOrEmpty(m) ? o("connect.template.mission_pool.no_reward") : m,
3434
+ label: isNullOrEmpty(p) ? o("connect.template.mission_pool.no_reward") : p,
3376
3435
  sublabel: C
3377
3436
  };
3378
3437
  }
3379
- function f(g) {
3380
- var m;
3381
- const u = [...n.value];
3382
- (m = r.value) == null || m.showSheet(!0, u[g], g);
3438
+ function c(v) {
3439
+ var p;
3440
+ const d = [...n.value];
3441
+ (p = s.value) == null || p.showSheet(!0, d[v], v);
3383
3442
  }
3384
- function V(g) {
3385
- const u = [...n.value];
3386
- u.splice(g, 1), i("update:model-value", u);
3443
+ function k(v) {
3444
+ const d = [...n.value];
3445
+ d.splice(v, 1), i("update:model-value", d);
3387
3446
  }
3388
- function k() {
3389
- var g;
3390
- (g = r.value) == null || g.showSheet(
3447
+ function V() {
3448
+ var v;
3449
+ (v = s.value) == null || v.showSheet(
3391
3450
  !0,
3392
3451
  {
3393
3452
  type: "LOYALTY",
3394
- collectible: c.loyaltyRewards.items[0].value,
3453
+ collectible: u.loyaltyRewards.items[0].value,
3395
3454
  threshold: null,
3396
3455
  validityOption: {
3397
3456
  validForDay: 7
@@ -3404,46 +3463,46 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
3404
3463
  n.value.length
3405
3464
  );
3406
3465
  }
3407
- function y(g) {
3408
- var u, m;
3409
- return g.type == "VOUCHER" ? (u = g.collectibleConfig) == null ? void 0 : u.name : sentenceCase(
3410
- ((m = c.loyaltyRewards.items.find(
3411
- (C) => C.value == g.collectible
3412
- )) == null ? void 0 : m.label) || ""
3466
+ function g(v) {
3467
+ var d, p;
3468
+ return v.type == "VOUCHER" ? (d = v.collectibleConfig) == null ? void 0 : d.name : sentenceCase(
3469
+ ((p = u.loyaltyRewards.items.find(
3470
+ (C) => C.value == v.collectible
3471
+ )) == null ? void 0 : p.label) || ""
3413
3472
  );
3414
3473
  }
3415
- return (g, u) => {
3416
- const m = resolveComponent("FmButton"), C = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
3474
+ return (v, d) => {
3475
+ const p = resolveComponent("FmButton"), C = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
3417
3476
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
3418
3477
  createElementVNode("div", _hoisted_2$3, toDisplayString(unref(o)("connect.template.configure_reward_customer")), 1),
3419
- createVNode(m, {
3478
+ createVNode(p, {
3420
3479
  label: unref(o)("connect.template.mission_pool.add_reward"),
3421
- onClick: u[0] || (u[0] = ($) => k()),
3480
+ onClick: d[0] || (d[0] = (N) => V()),
3422
3481
  variant: "plain",
3423
3482
  icon: "add"
3424
3483
  }, null, 8, ["label"]),
3425
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), ($, F) => (openBlock(), createBlock(C, {
3426
- key: F,
3484
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (N, w) => (openBlock(), createBlock(C, {
3485
+ key: w,
3427
3486
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
3428
3487
  variant: "outlined",
3429
- onClick: (N) => f(F)
3488
+ onClick: ($) => c(w)
3430
3489
  }, {
3431
3490
  default: withCtx(() => [
3432
3491
  createElementVNode("div", null, [
3433
- createElementVNode("div", _hoisted_3$3, toDisplayString(v($).label), 1),
3434
- createElementVNode("div", _hoisted_4$2, toDisplayString(v($).sublabel), 1)
3492
+ createElementVNode("div", _hoisted_3$3, toDisplayString(f(N).label), 1),
3493
+ createElementVNode("div", _hoisted_4$2, toDisplayString(f(N).sublabel), 1)
3435
3494
  ]),
3436
- createVNode(m, {
3495
+ createVNode(p, {
3437
3496
  icon: "delete",
3438
3497
  variant: "tertiary",
3439
- onClick: (N) => (N.stopPropagation(), V(F))
3498
+ onClick: ($) => ($.stopPropagation(), k(w))
3440
3499
  }, null, 8, ["onClick"])
3441
3500
  ]),
3442
3501
  _: 2
3443
3502
  }, 1032, ["onClick"]))), 128)),
3444
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter(($) => $.path.join(".") == ""), ($) => (openBlock(), createBlock(x, {
3445
- key: $.message,
3446
- text: $.message,
3503
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter((N) => N.path.join(".") == ""), (N) => (openBlock(), createBlock(x, {
3504
+ key: N.message,
3505
+ text: N.message,
3447
3506
  state: "error"
3448
3507
  }, null, 8, ["text"]))), 128)),
3449
3508
  createElementVNode("div", _hoisted_5$2, toDisplayString(unref(o)("connect.template.mission_pool.preview")), 1),
@@ -3453,11 +3512,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
3453
3512
  class: "p-24 space-y-16 w-fit"
3454
3513
  }, {
3455
3514
  default: withCtx(() => {
3456
- var $, F;
3515
+ var N, w;
3457
3516
  return [
3458
3517
  createElementVNode("div", _hoisted_6$2, [
3459
3518
  createElementVNode("div", null, [
3460
- createElementVNode("div", _hoisted_7$2, toDisplayString(unref(o)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString((($ = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : $.earningOption.amount) > 1 ? (F = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : F.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? y(e.modelValue[e.modelValue.length - 1]) : ""), 1),
3519
+ createElementVNode("div", _hoisted_7$2, toDisplayString(unref(o)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString(((N = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : N.earningOption.amount) > 1 ? (w = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : w.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? g(e.modelValue[e.modelValue.length - 1]) : ""), 1),
3461
3520
  createElementVNode("div", _hoisted_8$2, toDisplayString(unref(o)("connect.template.mission_pool.earn_stamp")), 1)
3462
3521
  ])
3463
3522
  ]),
@@ -3466,7 +3525,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
3466
3525
  type: e.mission.type,
3467
3526
  "max-range": e.mission.end,
3468
3527
  currentRange: e.mission.end / 4,
3469
- markers: e.modelValue.map((N) => N.threshold)
3528
+ markers: e.modelValue.map(($) => $.threshold)
3470
3529
  }, null, 8, ["type", "max-range", "currentRange", "markers"]),
3471
3530
  e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
3472
3531
  ])
@@ -3476,8 +3535,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
3476
3535
  })),
3477
3536
  createVNode(_sfc_main$6, {
3478
3537
  ref_key: "sheetRef",
3479
- ref: r,
3480
- "onUpdate:modelValue": p,
3538
+ ref: s,
3539
+ "onUpdate:modelValue": y,
3481
3540
  "max-threshold": e.mission.end
3482
3541
  }, null, 8, ["max-threshold"])
3483
3542
  ]);
@@ -3489,11 +3548,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
3489
3548
  modelValue: Object
3490
3549
  },
3491
3550
  emits: ["update:model-value"],
3492
- setup(e, { emit: s }) {
3493
- const { t: o } = useI18n(), d = e, i = computed(() => {
3494
- const n = FdoMission.safeParse(d.modelValue);
3551
+ setup(e, { emit: r }) {
3552
+ const { t: o } = useI18n(), m = e, i = computed(() => {
3553
+ const n = FdoMission.safeParse(m.modelValue);
3495
3554
  return n.success ? [] : n.error.errors;
3496
- }), c = computed(() => [
3555
+ }), u = computed(() => [
3497
3556
  {
3498
3557
  label: o("connect.campaign.mission.typeOption.STAMP.label"),
3499
3558
  description: o("connect.campaign.mission.typeOption.STAMP.description"),
@@ -3504,37 +3563,37 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
3504
3563
  description: o("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
3505
3564
  value: F_MISSION_TYPE.enum.PROGRESSIVE
3506
3565
  }
3507
- ]), l = s;
3566
+ ]), l = r;
3508
3567
  return (n, a) => {
3509
- var v;
3510
- const r = resolveComponent("FmCard"), p = resolveComponent("FmStepperField");
3568
+ var f;
3569
+ const s = resolveComponent("FmCard"), y = resolveComponent("FmStepperField");
3511
3570
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
3512
3571
  createElementVNode("div", _hoisted_2$2, [
3513
3572
  createElementVNode("div", _hoisted_3$2, toDisplayString(unref(o)("connect.campaign.mission.missionType")), 1),
3514
3573
  createElementVNode("div", _hoisted_4$1, toDisplayString(unref(o)("connect.template.select_game")), 1),
3515
3574
  createElementVNode("div", _hoisted_5$1, [
3516
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (f) => {
3517
- var V, k;
3518
- return openBlock(), createBlock(r, {
3575
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (c) => {
3576
+ var k, V;
3577
+ return openBlock(), createBlock(s, {
3519
3578
  variant: "outlined",
3520
3579
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
3521
- "col-span-2": unref(c).length == 1,
3522
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((V = e.modelValue) == null ? void 0 : V.type) == f.value,
3523
- "hover:bg-fm-color-opacity-sm": ((k = e.modelValue) == null ? void 0 : k.type) != f.value
3580
+ "col-span-2": unref(u).length == 1,
3581
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((k = e.modelValue) == null ? void 0 : k.type) == c.value,
3582
+ "hover:bg-fm-color-opacity-sm": ((V = e.modelValue) == null ? void 0 : V.type) != c.value
3524
3583
  }]),
3525
3584
  onClick: () => {
3526
- var y, g;
3527
- ((y = e.modelValue) == null ? void 0 : y.type) != f.value && l("update:model-value", {
3585
+ var g, v;
3586
+ ((g = e.modelValue) == null ? void 0 : g.type) != c.value && l("update:model-value", {
3528
3587
  ...e.modelValue,
3529
- type: f.value,
3530
- end: ((g = e.modelValue) == null ? void 0 : g.end) || 1
3588
+ type: c.value,
3589
+ end: ((v = e.modelValue) == null ? void 0 : v.end) || 1
3531
3590
  });
3532
3591
  },
3533
- key: f.value
3592
+ key: c.value
3534
3593
  }, {
3535
3594
  default: withCtx(() => [
3536
- createElementVNode("div", _hoisted_6$1, toDisplayString(f.label), 1),
3537
- createElementVNode("div", _hoisted_7$1, toDisplayString(f.description), 1)
3595
+ createElementVNode("div", _hoisted_6$1, toDisplayString(c.label), 1),
3596
+ createElementVNode("div", _hoisted_7$1, toDisplayString(c.description), 1)
3538
3597
  ]),
3539
3598
  _: 2
3540
3599
  }, 1032, ["class", "onClick"]);
@@ -3544,15 +3603,15 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
3544
3603
  createElementVNode("div", _hoisted_8$1, [
3545
3604
  createElementVNode("div", _hoisted_9$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequired")), 1),
3546
3605
  createElementVNode("div", _hoisted_10$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequiredDescription")), 1),
3547
- createVNode(p, {
3606
+ createVNode(y, {
3548
3607
  label: unref(o)("connect.campaign.mission.maximumToCollect"),
3549
- "model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
3550
- "onUpdate:modelValue": a[0] || (a[0] = (f) => {
3551
- var V;
3608
+ "model-value": ((f = e.modelValue) == null ? void 0 : f.end) || null,
3609
+ "onUpdate:modelValue": a[0] || (a[0] = (c) => {
3610
+ var k;
3552
3611
  return l("update:model-value", {
3553
3612
  ...e.modelValue,
3554
- type: ((V = e.modelValue) == null ? void 0 : V.type) || "STAMP",
3555
- end: f
3613
+ type: ((k = e.modelValue) == null ? void 0 : k.type) || "STAMP",
3614
+ end: c
3556
3615
  });
3557
3616
  }),
3558
3617
  "helper-text": unref(ZodHelper).helperText(unref(i), "end") || unref(o)("connect.campaign.mission.thresholdHelperText"),
@@ -3564,15 +3623,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
3564
3623
  }
3565
3624
  });
3566
3625
  function useLocaleText() {
3567
- const { locale: e, t: s } = useI18n();
3568
- function o(d, i) {
3569
- return d ? d[e.value] ?? d["en-US"] ?? s(i) : s(i);
3626
+ const { locale: e, t: r } = useI18n();
3627
+ function o(m, i) {
3628
+ return m ? m[e.value] ?? m["en-US"] ?? r(i) : r(i);
3570
3629
  }
3571
3630
  return { getLocaleText: o };
3572
3631
  }
3573
3632
  const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
3574
3633
  __name: "TemplateInput",
3575
3634
  props: {
3635
+ pushAvailability: {
3636
+ type: String,
3637
+ default: "checking"
3638
+ },
3576
3639
  field: { type: Object, required: !0 },
3577
3640
  modelValue: {
3578
3641
  type: Object
@@ -3600,40 +3663,40 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3600
3663
  default: !0
3601
3664
  }
3602
3665
  },
3603
- emits: ["update:model-value", "update:file"],
3604
- setup(e, { emit: s }) {
3605
- const { t: o } = useI18n(), { getLocaleText: d } = useLocaleText(), i = e, c = s;
3606
- function l(p) {
3666
+ emits: ["retry-push", "update:model-value", "update:file"],
3667
+ setup(e, { emit: r }) {
3668
+ const { t: o } = useI18n(), { getLocaleText: m } = useLocaleText(), i = e, u = r;
3669
+ function l(y) {
3607
3670
  switch (i.field.type) {
3608
3671
  case "timeframe":
3609
- const v = p.startDate ? hooks(p.startDate).startOf("day").toISOString() : void 0, f = p.endDate ? hooks(p.endDate).endOf("day").toISOString() : void 0;
3610
- c("update:model-value", {
3672
+ const f = y.startDate ? hooks(y.startDate).startOf("day").toISOString() : void 0, c = y.endDate ? hooks(y.endDate).endOf("day").toISOString() : void 0;
3673
+ u("update:model-value", {
3611
3674
  type: "timeframe",
3612
3675
  property: "__now",
3613
- start: v,
3614
- end: f
3676
+ start: f,
3677
+ end: c
3615
3678
  });
3616
3679
  break;
3617
3680
  case "image": {
3618
- c(
3681
+ u(
3619
3682
  "update:file",
3620
- p,
3621
- n.value || firebaseStorage.collectibleImagePath(void 0, p)
3683
+ y,
3684
+ n.value || firebaseStorage.collectibleImagePath(void 0, y)
3622
3685
  );
3623
3686
  break;
3624
3687
  }
3625
3688
  default:
3626
- c("update:model-value", p);
3689
+ u("update:model-value", y);
3627
3690
  break;
3628
3691
  }
3629
3692
  }
3630
3693
  const n = computed(() => {
3631
3694
  switch (i.field.type) {
3632
3695
  case "timeframe": {
3633
- const p = i.modelValue;
3696
+ const y = i.modelValue;
3634
3697
  return {
3635
- startDate: p != null && p.start ? hooks(p == null ? void 0 : p.start).format("YYYY-MM-DD") : null,
3636
- endDate: p != null && p.end ? hooks(p == null ? void 0 : p.end).format("YYYY-MM-DD") : null
3698
+ startDate: y != null && y.start ? hooks(y == null ? void 0 : y.start).format("YYYY-MM-DD") : null,
3699
+ endDate: y != null && y.end ? hooks(y == null ? void 0 : y.end).format("YYYY-MM-DD") : null
3637
3700
  };
3638
3701
  }
3639
3702
  default:
@@ -3641,54 +3704,54 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3641
3704
  }
3642
3705
  });
3643
3706
  function a() {
3644
- if (!r.value.schema) return [];
3645
- const p = r.value.schema.safeParse(i.modelValue);
3646
- return p.success ? [] : p.error.errors;
3707
+ if (!s.value.schema) return [];
3708
+ const y = s.value.schema.safeParse(i.modelValue);
3709
+ return y.success ? [] : y.error.errors;
3647
3710
  }
3648
- const r = computed(() => ({
3711
+ const s = computed(() => ({
3649
3712
  schema: i.schema,
3650
3713
  unwrapped: i.schema ? ZodHelper.unwrap(i.schema) : void 0,
3651
3714
  rules: i.schema ? [ZodHelper.ruleAtPath(i.schema, "")] : void 0,
3652
3715
  labelMark: i.schema && ZodHelper.isRequired(i.schema) == !1 ? "optional" : void 0,
3653
3716
  zodLabel: i.schema ? ZodHelper.toInputLabel(
3654
3717
  i.schema,
3655
- d(i.field.label_locale, i.field.label ?? "")
3718
+ m(i.field.label_locale, i.field.label ?? "")
3656
3719
  ) : void 0
3657
3720
  }));
3658
- return (p, v) => {
3659
- var u, m, C, x, $;
3660
- const f = resolveComponent("FmTextField"), V = resolveComponent("FmStepperField"), k = resolveComponent("FmTextarea"), y = resolveComponent("FmHelperText"), g = resolveComponent("FmSwitch");
3661
- return e.field.type === "text" ? (openBlock(), createBlock(f, {
3721
+ return (y, f) => {
3722
+ var d, p, C, x, N;
3723
+ const c = resolveComponent("FmTextField"), k = resolveComponent("FmStepperField"), V = resolveComponent("FmTextarea"), g = resolveComponent("FmHelperText"), v = resolveComponent("FmSwitch");
3724
+ return e.field.type === "text" ? (openBlock(), createBlock(c, {
3662
3725
  key: 0,
3663
- label: unref(d)(e.field.label_locale, e.field.label ?? ""),
3664
- "label-mark": unref(r).labelMark,
3665
- rules: unref(r).rules,
3726
+ label: unref(m)(e.field.label_locale, e.field.label ?? ""),
3727
+ "label-mark": unref(s).labelMark,
3728
+ rules: unref(s).rules,
3666
3729
  "model-value": unref(n),
3667
3730
  "onUpdate:modelValue": l,
3668
3731
  "helper-state": e.helperText ? "error" : void 0,
3669
3732
  "helper-text": e.helperText
3670
3733
  }, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
3671
3734
  createVNode(JsonViewer, {
3672
- json: { schema: unref(r).unwrapped, props: i }
3735
+ json: { schema: unref(s).unwrapped, props: i }
3673
3736
  }, null, 8, ["json"]),
3674
- createVNode(V, {
3675
- label: unref(d)(e.field.label_locale, e.field.label ?? ""),
3676
- "label-mark": e.field.isRuleChildren ? void 0 : unref(r).labelMark,
3737
+ createVNode(k, {
3738
+ label: unref(m)(e.field.label_locale, e.field.label ?? ""),
3739
+ "label-mark": e.field.isRuleChildren ? void 0 : unref(s).labelMark,
3677
3740
  "model-value": unref(n),
3678
- rules: e.field.isRuleChildren ? [] : unref(r).rules,
3741
+ rules: e.field.isRuleChildren ? [] : unref(s).rules,
3679
3742
  "onUpdate:modelValue": l,
3680
3743
  "helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
3681
3744
  "helper-text": e.field.isRuleChildren ? e.helperText : void 0
3682
3745
  }, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
3683
- ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(k, {
3746
+ ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(V, {
3684
3747
  key: 2,
3685
- label: unref(d)(e.field.label_locale, e.field.label ?? ""),
3686
- "label-mark": unref(r).labelMark,
3687
- rules: unref(r).rules,
3748
+ label: unref(m)(e.field.label_locale, e.field.label ?? ""),
3749
+ "label-mark": unref(s).labelMark,
3750
+ rules: unref(s).rules,
3688
3751
  "model-value": unref(n),
3689
3752
  "onUpdate:modelValue": l,
3690
3753
  "show-word-count": "",
3691
- "max-length": ($ = (x = (C = (m = (u = unref(r)) == null ? void 0 : u.unwrapped) == null ? void 0 : m._def) == null ? void 0 : C.checks) == null ? void 0 : x.find((F) => F.kind == "max")) == null ? void 0 : $.value
3754
+ "max-length": (N = (x = (C = (p = (d = unref(s)) == null ? void 0 : d.unwrapped) == null ? void 0 : p._def) == null ? void 0 : C.checks) == null ? void 0 : x.find((w) => w.kind == "max")) == null ? void 0 : N.value
3692
3755
  }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$o, {
3693
3756
  key: 3,
3694
3757
  "campaign-type": e.extras,
@@ -3700,7 +3763,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3700
3763
  "model-value": unref(n),
3701
3764
  "onUpdate:modelValue": l
3702
3765
  }, null, 8, ["model-value"]),
3703
- createVNode(y, {
3766
+ createVNode(g, {
3704
3767
  class: "!mt-[8px]",
3705
3768
  text: unref(ZodHelper).helperText(a(), ""),
3706
3769
  state: unref(ZodHelper).helperState(a(), "")
@@ -3713,16 +3776,16 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3713
3776
  "onUpdate:file": l
3714
3777
  }, {
3715
3778
  label: withCtx(() => [
3716
- (openBlock(), createBlock(resolveDynamicComponent(unref(r).zodLabel)))
3779
+ (openBlock(), createBlock(resolveDynamicComponent(unref(s).zodLabel)))
3717
3780
  ]),
3718
3781
  _: 1
3719
- }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(g, {
3782
+ }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(v, {
3720
3783
  key: 6,
3721
- label: unref(d)(e.field.label_locale, e.field.label ?? ""),
3784
+ label: unref(m)(e.field.label_locale, e.field.label ?? ""),
3722
3785
  "label-placement": "right",
3723
3786
  sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
3724
- "label-mark": unref(r).labelMark,
3725
- rules: unref(r).rules,
3787
+ "label-mark": unref(s).labelMark,
3788
+ rules: unref(s).rules,
3726
3789
  "model-value": unref(n),
3727
3790
  "onUpdate:modelValue": l
3728
3791
  }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$D, {
@@ -3730,18 +3793,18 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3730
3793
  "model-value": unref(n),
3731
3794
  "onUpdate:modelValue": l,
3732
3795
  "no-campaign": !1,
3733
- schema: unref(r).schema,
3796
+ schema: unref(s).schema,
3734
3797
  "is-mission": e.extras === "MISSION"
3735
3798
  }, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "grab_conditions" ? (openBlock(), createBlock(GrabConditionsInput, {
3736
3799
  key: 8,
3737
3800
  "model-value": unref(n),
3738
3801
  "onUpdate:modelValue": l,
3739
- schema: unref(r).schema
3802
+ schema: unref(s).schema
3740
3803
  }, null, 8, ["model-value", "schema"])) : e.field.type === "grab_quota" ? (openBlock(), createBlock(_sfc_main$9, {
3741
3804
  key: 9,
3742
3805
  "model-value": unref(n),
3743
3806
  "onUpdate:modelValue": l,
3744
- schema: unref(r).schema
3807
+ schema: unref(s).schema
3745
3808
  }, null, 8, ["model-value", "schema"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$E, {
3746
3809
  key: 10,
3747
3810
  "model-value": unref(n),
@@ -3752,7 +3815,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3752
3815
  "onUpdate:modelValue": l,
3753
3816
  "can-set-auto-apply": e.field.property == "campaign.effect"
3754
3817
  }, null, 8, ["model-value", "can-set-auto-apply"]),
3755
- unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(y, {
3818
+ unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(g, {
3756
3819
  key: 0,
3757
3820
  class: "!mt-[8px]",
3758
3821
  text: unref(o)("connect.campaign.common.effect_required"),
@@ -3763,7 +3826,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3763
3826
  "model-value": unref(n),
3764
3827
  "onUpdate:modelValue": l
3765
3828
  }, null, 8, ["model-value"]),
3766
- unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(y, {
3829
+ unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(g, {
3767
3830
  key: 0,
3768
3831
  class: "!mt-[8px]",
3769
3832
  text: unref(o)("connect.campaign.common.effect_required"),
@@ -3772,13 +3835,15 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3772
3835
  ], 64)) : e.field.type === "message" ? (openBlock(), createElementBlock(Fragment, { key: 13 }, [
3773
3836
  e.field.property === "campaign.message" ? (openBlock(), createBlock(_sfc_main$g, {
3774
3837
  key: 0,
3838
+ "push-availability": e.pushAvailability,
3839
+ onRetryPush: f[0] || (f[0] = (w) => u("retry-push")),
3775
3840
  "show-validation": e.showValidation,
3776
3841
  "model-value": unref(n),
3777
3842
  "onUpdate:modelValue": l,
3778
3843
  "helper-text": unref(ZodHelper).helperText(a(), ""),
3779
3844
  "trigger-type": e.field.extras,
3780
3845
  "helper-state": unref(ZodHelper).helperState(a(), "")
3781
- }, null, 8, ["show-validation", "model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$x, {
3846
+ }, null, 8, ["push-availability", "show-validation", "model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$x, {
3782
3847
  key: 1,
3783
3848
  "allow-email": !0,
3784
3849
  "allow-whatsapp": !0,
@@ -3835,7 +3900,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3835
3900
  "start-date": e.extras.start,
3836
3901
  "end-date": e.extras.end
3837
3902
  }, null, 8, ["model-value", "start-date", "end-date"]),
3838
- e.helperText ? (openBlock(), createBlock(y, {
3903
+ e.helperText ? (openBlock(), createBlock(g, {
3839
3904
  key: 0,
3840
3905
  class: "!mt-[8px]",
3841
3906
  text: e.helperText,
@@ -3846,14 +3911,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3846
3911
  "model-value": unref(n),
3847
3912
  "onUpdate:modelValue": l
3848
3913
  }, null, 8, ["model-value"]),
3849
- e.helperText ? (openBlock(), createBlock(y, {
3914
+ e.helperText ? (openBlock(), createBlock(g, {
3850
3915
  key: 0,
3851
3916
  class: "!mt-[8px]",
3852
3917
  text: e.helperText,
3853
3918
  state: "error"
3854
3919
  }, null, 8, ["text"])) : createCommentVNode("", !0)
3855
3920
  ], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
3856
- e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(n).rules.g_time).length > 0 ? (openBlock(), createBlock(y, {
3921
+ e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(n).rules.g_time).length > 0 ? (openBlock(), createBlock(g, {
3857
3922
  key: 0,
3858
3923
  state: "warning",
3859
3924
  text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
@@ -3862,7 +3927,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3862
3927
  "model-value": unref(n),
3863
3928
  "onUpdate:modelValue": l
3864
3929
  }, null, 8, ["model-value"]),
3865
- e.helperText ? (openBlock(), createBlock(y, {
3930
+ e.helperText ? (openBlock(), createBlock(g, {
3866
3931
  key: 1,
3867
3932
  class: "!mt-[8px]",
3868
3933
  text: e.helperText,
@@ -3873,7 +3938,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3873
3938
  "model-value": unref(n),
3874
3939
  "onUpdate:modelValue": l
3875
3940
  }, null, 8, ["model-value"]),
3876
- e.helperText ? (openBlock(), createBlock(y, {
3941
+ e.helperText ? (openBlock(), createBlock(g, {
3877
3942
  key: 0,
3878
3943
  class: "!mt-[8px]",
3879
3944
  text: e.helperText,
@@ -3884,7 +3949,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3884
3949
  "model-value": unref(n),
3885
3950
  "onUpdate:modelValue": l
3886
3951
  }, null, 8, ["model-value"]),
3887
- e.helperText ? (openBlock(), createBlock(y, {
3952
+ e.helperText ? (openBlock(), createBlock(g, {
3888
3953
  key: 0,
3889
3954
  class: "!mt-[8px]",
3890
3955
  text: e.helperText,
@@ -3895,7 +3960,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3895
3960
  "model-value": unref(n),
3896
3961
  "onUpdate:modelValue": l
3897
3962
  }, null, 8, ["model-value"]),
3898
- e.helperText ? (openBlock(), createBlock(y, {
3963
+ e.helperText ? (openBlock(), createBlock(g, {
3899
3964
  key: 0,
3900
3965
  class: "!mt-[8px]",
3901
3966
  text: e.helperText,
@@ -3906,7 +3971,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3906
3971
  "model-value": unref(n),
3907
3972
  "onUpdate:modelValue": l
3908
3973
  }, null, 8, ["model-value"]),
3909
- e.helperText ? (openBlock(), createBlock(y, {
3974
+ e.helperText ? (openBlock(), createBlock(g, {
3910
3975
  key: 0,
3911
3976
  class: "!mt-[8px]",
3912
3977
  text: e.helperText,
@@ -3924,26 +3989,26 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3924
3989
  }
3925
3990
  },
3926
3991
  setup(e) {
3927
- const { t: s, te: o } = useI18n();
3928
- function d(i) {
3992
+ const { t: r, te: o } = useI18n();
3993
+ function m(i) {
3929
3994
  return o(i) || o(i, "en-US");
3930
3995
  }
3931
- return (i, c) => {
3996
+ return (i, u) => {
3932
3997
  const l = resolveComponent("FmCard");
3933
3998
  return openBlock(), createBlock(l, {
3934
3999
  variant: "outlined",
3935
4000
  class: "p-16 space-y-8"
3936
4001
  }, {
3937
4002
  default: withCtx(() => [
3938
- createElementVNode("div", _hoisted_1$1, toDisplayString(unref(s)("connect.campaign.common.summary")), 1),
3939
- c[0] || (c[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
4003
+ createElementVNode("div", _hoisted_1$1, toDisplayString(unref(r)("connect.campaign.common.summary")), 1),
4004
+ u[0] || (u[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
3940
4005
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (n, a) => (openBlock(), createElementBlock("div", {
3941
4006
  class: "space-y-4",
3942
4007
  key: a
3943
4008
  }, [
3944
4009
  n ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3945
- createElementVNode("div", _hoisted_2$1, toDisplayString(unref(s)(`${a}`)), 1),
3946
- createElementVNode("div", _hoisted_3$1, toDisplayString(d(`${n}`) ? unref(s)(`${n}`) : n), 1)
4010
+ createElementVNode("div", _hoisted_2$1, toDisplayString(unref(r)(`${a}`)), 1),
4011
+ createElementVNode("div", _hoisted_3$1, toDisplayString(m(`${n}`) ? unref(r)(`${n}`) : n), 1)
3947
4012
  ], 64)) : createCommentVNode("", !0)
3948
4013
  ]))), 128))
3949
4014
  ]),
@@ -3958,27 +4023,57 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3958
4023
  __name: "EditCampaignSheet",
3959
4024
  emits: ["submit:model-value"],
3960
4025
  setup(__props, { expose: __expose, emit: __emit }) {
3961
- const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), { getLocaleText } = useLocaleText(), currentStep = ref(1), data = ref(), schema = ref(z$1.any()), template = ref(
4026
+ const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), { getLocaleText } = useLocaleText(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
3962
4027
  TEMPLATES.VOUCHER
3963
- ), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign"), campaignType = ref("VOUCHER");
4028
+ ), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign"), campaignType = ref("VOUCHER"), pushAvailability = ref("checking");
4029
+ let availabilityRequest = 0;
4030
+ async function checkPushAvailability() {
4031
+ const e = ++availabilityRequest, r = SvcConfig.getBusinessId();
4032
+ pushAvailability.value = "checking";
4033
+ try {
4034
+ if (!r) throw new Error("Business ID is unavailable");
4035
+ const m = await getNativeApp(r);
4036
+ o() && (pushAvailability.value = m ? "native" : "non-native");
4037
+ } catch {
4038
+ o() && (pushAvailability.value = "failed");
4039
+ }
4040
+ function o() {
4041
+ return e === availabilityRequest && sheetVisible.value && campaignType.value === "BROADCAST" && SvcConfig.getBusinessId() === r;
4042
+ }
4043
+ }
4044
+ watch(
4045
+ sheetVisible,
4046
+ (e) => {
4047
+ e || ++availabilityRequest;
4048
+ },
4049
+ { flush: "sync" }
4050
+ ), onBeforeUnmount(() => {
4051
+ ++availabilityRequest;
4052
+ });
4053
+ const pushBlocked = computed(
4054
+ () => {
4055
+ var e;
4056
+ return campaignType.value === "BROADCAST" && toDelivery(((e = data.value) == null ? void 0 : e.campaign) ?? {}).channels.includes("PUSH") && pushAvailability.value !== "native";
4057
+ }
4058
+ );
3964
4059
  async function showSheet(visible, type, campaign, selectedTemplate) {
3965
- var e, s, o;
3966
- if (sheetVisible.value = visible, campaignType.value = type, visible == !0) {
4060
+ var e, r, o;
4061
+ if (sheetVisible.value = visible, campaignType.value = type, ++availabilityRequest, visible && type === "BROADCAST" && checkPushAvailability(), visible == !0) {
3967
4062
  try {
3968
4063
  isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
3969
4064
  } catch {
3970
4065
  } finally {
3971
- await new Promise((d) => setTimeout(d, 120)), isLoading.value = !1;
4066
+ await new Promise((m) => setTimeout(m, 120)), isLoading.value = !1;
3972
4067
  }
3973
4068
  console.log(
3974
4069
  TEMPLATES[type],
3975
4070
  "base template"
3976
- ), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((d, i) => {
3977
- var c;
3978
- if (d.campaign.type === "VOUCHER" && d.campaign.code) {
3979
- const l = (c = d.campaign._id) == null ? void 0 : c.toString();
4071
+ ), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((m, i) => {
4072
+ var u;
4073
+ if (m.campaign.type === "VOUCHER" && m.campaign.code) {
4074
+ const l = (u = m.campaign._id) == null ? void 0 : u.toString();
3980
4075
  useCampaignStore().campaigns.voucher.some(
3981
- (n) => n.code === d.campaign.code && n._id.toString() !== l
4076
+ (n) => n.code === m.campaign.code && n._id.toString() !== l
3982
4077
  ) && i.addIssue({
3983
4078
  code: "custom",
3984
4079
  message: "Code already exists, please use another code",
@@ -3986,7 +4081,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3986
4081
  });
3987
4082
  }
3988
4083
  })), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
3989
- ...(s = template.value) == null ? void 0 : s.defaultValue
4084
+ ...(r = template.value) == null ? void 0 : r.defaultValue
3990
4085
  }), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), type === "BROADCAST" && normaliseBroadcastDelivery(data.value.campaign), data.value.templateId = SvcConfig.getBusinessId(), data.value.campaign.business = SvcConfig.getBusinessId(), data.value.campaign.templateId = SvcConfig.getBusinessId(), "configs" in data.value && (data.value.configs.business = SvcConfig.getBusinessId()), currentStep.value = 1, submitAttempted.value = !1, sheetTitle.value = (o = campaign == null ? void 0 : campaign.campaign) != null && o._id ? t("connect.campaign.common.edit_campaign_title", {
3991
4086
  typeName: t(`connect.campaign.common.typeName.${type}`)
3992
4087
  }) : t("connect.campaign.common.create_campaign_title", {
@@ -4013,15 +4108,21 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
4013
4108
  });
4014
4109
  }
4015
4110
  const emits = __emit, errors = computed(() => {
4016
- const e = schema.value.superRefine(campaignRefinement).safeParse(data.value);
4017
- return e.success ? [] : e.error.errors;
4111
+ const e = schema.value.superRefine(campaignRefinement).safeParse(data.value), r = e.success ? [] : [...e.error.errors];
4112
+ return pushBlocked.value && r.push({
4113
+ code: "custom",
4114
+ path: ["campaign", "delivery", "channels"],
4115
+ message: t(
4116
+ "connect.campaign.broadcast.pushAvailability.removeBeforeSave"
4117
+ )
4118
+ }), r;
4018
4119
  });
4019
4120
  function stepErrors(e = currentStep.value - 1) {
4020
- const s = template.value.steps[e].groups.flatMap(
4021
- (o) => o.fields.map((d) => schemaPathForField(d.property))
4121
+ const r = template.value.steps[e].groups.flatMap(
4122
+ (o) => o.fields.map((m) => schemaPathForField(m.property))
4022
4123
  );
4023
4124
  return errors.value.filter(
4024
- (o) => s.some((d) => o.path.join(".").includes(d))
4125
+ (o) => r.some((m) => o.path.join(".").includes(m))
4025
4126
  );
4026
4127
  }
4027
4128
  const validateOnSubmit = computed(() => campaignType.value === "BROADCAST"), submitAttempted = ref(!1), showValidation = computed(
@@ -4064,23 +4165,23 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
4064
4165
  function schemaPathForField(e) {
4065
4166
  return e === "campaign.message" ? "campaign.delivery" : e;
4066
4167
  }
4067
- function onUpdateProperty(e, s) {
4068
- var o, d, i, c, l, n, a, r;
4069
- if (e === "campaign.message" && s && "channels" in s) {
4070
- _.set(data.value, "campaign.delivery", s);
4071
- const p = toLegacyMessage(s);
4072
- p ? _.set(data.value, "campaign.message", p) : delete data.value.campaign.message;
4168
+ function onUpdateProperty(e, r) {
4169
+ var o, m, i, u, l, n, a, s;
4170
+ if (e === "campaign.message" && r && "channels" in r) {
4171
+ _.set(data.value, "campaign.delivery", r);
4172
+ const y = toLegacyMessage(r);
4173
+ y ? _.set(data.value, "campaign.message", y) : delete data.value.campaign.message;
4073
4174
  return;
4074
4175
  }
4075
- if (_.set(data.value, e, s), e == "campaign.event.type") {
4076
- const v = ((c = (i = (d = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : d.campaign) == null ? void 0 : i.event) == null ? void 0 : c.rule) ? _.cloneDeep({
4077
- ...(r = (a = (n = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : n.campaign) == null ? void 0 : a.event) == null ? void 0 : r.rule
4176
+ if (_.set(data.value, e, r), e == "campaign.event.type") {
4177
+ const f = ((u = (i = (m = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : m.campaign) == null ? void 0 : i.event) == null ? void 0 : u.rule) ? _.cloneDeep({
4178
+ ...(s = (a = (n = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : n.campaign) == null ? void 0 : a.event) == null ? void 0 : s.rule
4078
4179
  }) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
4079
4180
  RuleBuilder.scaffoldGroup("g_schedule"),
4080
4181
  RuleBuilder.scaffoldGroup("g_time"),
4081
4182
  RuleBuilder.scaffoldGroup("g_user"),
4082
4183
  RuleBuilder.scaffoldGroup("g_bill")
4083
- ]), f = RuleBuilder.setRuleToGroup(
4184
+ ]), c = RuleBuilder.setRuleToGroup(
4084
4185
  RuleBuilder.scaffoldGroup("g_schedule"),
4085
4186
  [
4086
4187
  RuleBuilder.constructEntry(
@@ -4092,52 +4193,52 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
4092
4193
  ],
4093
4194
  "&&"
4094
4195
  );
4095
- if (s != "SCHEDULE") {
4096
- _.set(data.value, "campaign.event.rule", v);
4196
+ if (r != "SCHEDULE") {
4197
+ _.set(data.value, "campaign.event.rule", f);
4097
4198
  return;
4098
4199
  }
4099
4200
  _.set(
4100
4201
  data.value,
4101
4202
  "campaign.event.rule",
4102
- RuleBuilder.setRuleToGroup(v, f)
4203
+ RuleBuilder.setRuleToGroup(f, c)
4103
4204
  );
4104
4205
  }
4105
- e == "campaign.notify" && s == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
4206
+ e == "campaign.notify" && r == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
4106
4207
  }
4107
- async function onUpdateFile(e, s) {
4108
- return e ? await minor(async () => firebaseStorage.update(s, e), {
4208
+ async function onUpdateFile(e, r) {
4209
+ return e ? await minor(async () => firebaseStorage.update(r, e), {
4109
4210
  message: `${e ? "Uploading" : "Removing"} file`,
4110
4211
  successMessage: `File ${e ? "uploaded" : "removed"} successfully`
4111
4212
  }) : "";
4112
4213
  }
4113
4214
  function isDisable(e) {
4114
- var s, o;
4215
+ var r, o;
4115
4216
  switch (e == null ? void 0 : e.property) {
4116
4217
  case "campaign.event.type":
4117
- return ((o = (s = data.value) == null ? void 0 : s.campaign) == null ? void 0 : o._id) || !1;
4218
+ return ((o = (r = data.value) == null ? void 0 : r.campaign) == null ? void 0 : o._id) || !1;
4118
4219
  default:
4119
4220
  return !1;
4120
4221
  }
4121
4222
  }
4122
4223
  async function onSubmit() {
4123
- submitAttempted.value = !0;
4224
+ if (submitAttempted.value = !0, pushBlocked.value) return;
4124
4225
  const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
4125
4226
  if (!e.success)
4126
4227
  return;
4127
- const s = await emits(
4228
+ const r = await emits(
4128
4229
  "submit:model-value",
4129
4230
  cleanPF(JSON.parse(JSON.stringify(e.data)))
4130
4231
  );
4131
- (s || s === void 0) && (sheetVisible.value = !1);
4232
+ (r || r === void 0) && (sheetVisible.value = !1);
4132
4233
  }
4133
- return (e, s) => {
4134
- const o = resolveComponent("FmButton"), d = resolveComponent("FmStep"), i = resolveComponent("FmStepper"), c = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
4234
+ return (e, r) => {
4235
+ const o = resolveComponent("FmButton"), m = resolveComponent("FmStep"), i = resolveComponent("FmStepper"), u = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
4135
4236
  return openBlock(), createBlock(l, {
4136
4237
  "fullscreen-size": "lg",
4137
4238
  modelValue: unref(sheetVisible),
4138
4239
  "onUpdate:modelValue": [
4139
- s[7] || (s[7] = (n) => isRef(sheetVisible) ? sheetVisible.value = n : null),
4140
- s[8] || (s[8] = (n) => sheetVisible.value = n)
4240
+ r[7] || (r[7] = (n) => isRef(sheetVisible) ? sheetVisible.value = n : null),
4241
+ r[8] || (r[8] = (n) => sheetVisible.value = n)
4141
4242
  ]
4142
4243
  }, createSlots({
4143
4244
  "top-sheet-header": withCtx(() => [
@@ -4145,7 +4246,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
4145
4246
  createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
4146
4247
  createElementVNode("div", _hoisted_2, [
4147
4248
  createVNode(o, {
4148
- onClick: s[0] || (s[0] = (n) => hideSheet()),
4249
+ onClick: r[0] || (r[0] = (n) => hideSheet()),
4149
4250
  label: unref(t)("connect.campaign.common.cancel"),
4150
4251
  variant: "tertiary"
4151
4252
  }, null, 8, ["label"]),
@@ -4165,7 +4266,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
4165
4266
  createElementVNode("div", _hoisted_9, [
4166
4267
  createElementVNode("div", _hoisted_10, [
4167
4268
  createElementVNode("div", _hoisted_11, [
4168
- s[9] || (s[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
4269
+ r[9] || (r[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
4169
4270
  createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
4170
4271
  createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
4171
4272
  createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
@@ -4187,7 +4288,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
4187
4288
  ])
4188
4289
  ])
4189
4290
  ], -1)),
4190
- createVNode(c, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
4291
+ createVNode(u, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
4191
4292
  ])
4192
4293
  ])
4193
4294
  ])
@@ -4199,12 +4300,12 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
4199
4300
  unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
4200
4301
  createVNode(i, {
4201
4302
  modelValue: unref(currentStep),
4202
- "onUpdate:modelValue": s[1] || (s[1] = (n) => isRef(currentStep) ? currentStep.value = n : null),
4303
+ "onUpdate:modelValue": r[1] || (r[1] = (n) => isRef(currentStep) ? currentStep.value = n : null),
4203
4304
  orientation: "horizontal",
4204
4305
  class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
4205
4306
  }, {
4206
4307
  default: withCtx(() => [
4207
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(d, {
4308
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(m, {
4208
4309
  key: n.name,
4209
4310
  title: unref(getLocaleText)(n.name_locale, n.name),
4210
4311
  value: a + 1,
@@ -4218,16 +4319,16 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
4218
4319
  createVNode(o, {
4219
4320
  icon: "close",
4220
4321
  variant: "tertiary",
4221
- onClick: s[2] || (s[2] = (n) => sheetVisible.value = !1)
4322
+ onClick: r[2] || (r[2] = (n) => sheetVisible.value = !1)
4222
4323
  }),
4223
4324
  createVNode(i, {
4224
4325
  modelValue: unref(currentStep),
4225
- "onUpdate:modelValue": s[3] || (s[3] = (n) => isRef(currentStep) ? currentStep.value = n : null),
4326
+ "onUpdate:modelValue": r[3] || (r[3] = (n) => isRef(currentStep) ? currentStep.value = n : null),
4226
4327
  orientation: "horizontal",
4227
4328
  class: "flex-1"
4228
4329
  }, {
4229
4330
  default: withCtx(() => [
4230
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(d, {
4331
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(m, {
4231
4332
  key: n.name,
4232
4333
  title: unref(sheetTitle),
4233
4334
  description: unref(getLocaleText)(n.name_locale, n.name),
@@ -4241,7 +4342,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
4241
4342
  createVNode(o, {
4242
4343
  icon: "info",
4243
4344
  variant: "tertiary",
4244
- onClick: s[4] || (s[4] = () => showSummaryDialog())
4345
+ onClick: r[4] || (r[4] = () => showSummaryDialog())
4245
4346
  })
4246
4347
  ]),
4247
4348
  createElementVNode("div", _hoisted_5, [
@@ -4265,34 +4366,36 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
4265
4366
  class: "space-y-24"
4266
4367
  }, [
4267
4368
  createElementVNode("div", _hoisted_7, toDisplayString(unref(getLocaleText)(n.name_locale, n.name ?? "")), 1),
4268
- (openBlock(!0), createElementBlock(Fragment, null, renderList(n.fields, (r, p) => (openBlock(), createElementBlock("div", { key: p }, [
4369
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(n.fields, (s, y) => (openBlock(), createElementBlock("div", { key: y }, [
4269
4370
  (openBlock(), createBlock(_sfc_main$2, {
4270
- key: p,
4271
- field: r,
4272
- modelValue: valueForField(r.property),
4273
- disabled: isDisable(r),
4371
+ key: y,
4372
+ field: s,
4373
+ modelValue: valueForField(s.property),
4374
+ disabled: isDisable(s),
4274
4375
  "campaign-type": unref(campaignType),
4275
4376
  "show-validation": unref(showValidation),
4276
- "onUpdate:modelValue": (v) => onUpdateProperty(r.property, v),
4277
- "onUpdate:file": async (v, f) => {
4278
- const V = await onUpdateFile(v, f);
4279
- onUpdateProperty(r.property, V || "");
4377
+ "push-availability": unref(pushAvailability),
4378
+ onRetryPush: checkPushAvailability,
4379
+ "onUpdate:modelValue": (f) => onUpdateProperty(s.property, f),
4380
+ "onUpdate:file": async (f, c) => {
4381
+ const k = await onUpdateFile(f, c);
4382
+ onUpdateProperty(s.property, k || "");
4280
4383
  },
4281
4384
  schema: unref(ZodHelper).typeAtPath(
4282
4385
  unref(schema),
4283
- schemaPathForField(r.property),
4386
+ schemaPathForField(s.property),
4284
4387
  unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
4285
4388
  ),
4286
4389
  "helper-state": unref(ZodHelper).helperState(
4287
4390
  unref(visibleErrors),
4288
- schemaPathForField(r.property)
4391
+ schemaPathForField(s.property)
4289
4392
  ),
4290
4393
  "helper-text": unref(ZodHelper).helperText(
4291
4394
  unref(visibleErrors),
4292
- schemaPathForField(r.property)
4395
+ schemaPathForField(s.property)
4293
4396
  ),
4294
- extras: r.extras != null ? r.extras == "" ? unref(data) : unref(_).get(unref(data), r.extras) : void 0
4295
- }, null, 8, ["field", "modelValue", "disabled", "campaign-type", "show-validation", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
4397
+ extras: s.extras != null ? s.extras == "" ? unref(data) : unref(_).get(unref(data), s.extras) : void 0
4398
+ }, null, 8, ["field", "modelValue", "disabled", "campaign-type", "show-validation", "push-availability", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
4296
4399
  ]))), 128))
4297
4400
  ]))), 128)),
4298
4401
  createElementVNode("div", _hoisted_8, [
@@ -4300,12 +4403,12 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
4300
4403
  label: unref(t)("connect.common.back"),
4301
4404
  variant: "tertiary",
4302
4405
  disabled: unref(currentStep) == 1,
4303
- onClick: s[5] || (s[5] = (n) => currentStep.value--)
4406
+ onClick: r[5] || (r[5] = (n) => currentStep.value--)
4304
4407
  }, null, 8, ["label", "disabled"]),
4305
4408
  createVNode(o, {
4306
4409
  disabled: isNextDisabled(),
4307
4410
  label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? unref(t)("connect.common.next") : unref(t)("connect.common.submit"),
4308
- onClick: s[6] || (s[6] = (n) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? onNext() : onSubmit())
4411
+ onClick: r[6] || (r[6] = (n) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? onNext() : onSubmit())
4309
4412
  }, null, 8, ["disabled", "label"])
4310
4413
  ])
4311
4414
  ]),