@feedmepos/mf-connect 0.1.98-beta.60 → 0.1.98-beta.62

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 (122) hide show
  1. package/dist/{App-BUwQLdzG.js → App-BrL2gHiV.js} +8 -8
  2. package/dist/{AuditLogs-laNQB1ef.js → AuditLogs-BlRoAtoO.js} +11 -11
  3. package/dist/{Bin-Bfboeea_.js → Bin-DWR53mGv.js} +8 -8
  4. package/dist/Broadcast-BZ2y0x8d.js +302 -0
  5. package/dist/{CampaignAnalytic-BiA-5XG3.js → CampaignAnalytic-DB2OaPV_.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VrTN-c_a.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Bs1_gtk6.js} +6 -6
  7. package/dist/{Card-CKHaW8N7.js → Card-B6faC6Qm.js} +21 -21
  8. package/dist/{Collections-DRocQb1D.js → Collections-DekhPkTs.js} +8 -8
  9. package/dist/{Credit-DWaoVhSP.js → Credit-BwOLA7a6.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B7ZdULCu.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DCNKIlok.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-3ERieT1j.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D07yq8hu.js} +1830 -996
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-yDUjXV2O.js → EffectSheet.vue_vue_type_style_index_0_lang-CaEBp-Qj.js} +6 -6
  13. package/dist/{Experience-C1_LpneJ.js → Experience-DiW76Zyj.js} +12 -12
  14. package/dist/{FileSaver.min-CWJ-6CFP.js → FileSaver.min-CzzDHyEW.js} +1 -1
  15. package/dist/{Game-DtTYcSZk.js → Game-CHZZ26td.js} +13 -13
  16. package/dist/{GiftCardSetup-B770Rl1Q.js → GiftCardSetup-D573F-re.js} +9 -9
  17. package/dist/{Grab-CN0gmIxT.js → Grab-DyjMfGLW.js} +9 -9
  18. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BaAhKWhX.js → ImageInput.vue_vue_type_script_setup_true_lang-B_Fl95PN.js} +1 -1
  19. package/dist/{Index-0F6aq3f9.js → Index-DVctjU8T.js} +10 -10
  20. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BrKj8W2H.js → LocationPicker.vue_vue_type_script_setup_true_lang-CJcDgM1A.js} +1 -1
  21. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DOuHSVdR.js → LottieAnimation.vue_vue_type_script_setup_true_lang-B8q8mLiv.js} +1 -1
  22. package/dist/{LoyaltyDashboard-CtXyDFqa.js → LoyaltyDashboard-C695q1A0.js} +13 -13
  23. package/dist/{MainLayout-BSWLr3gE.js → MainLayout-DLr0qfQy.js} +3 -3
  24. package/dist/{Marketing-Ci2haxRd.js → Marketing-DtJwIJT1.js} +4 -4
  25. package/dist/{MarketingMaterialEdit-Cw6R0bNM.js → MarketingMaterialEdit-Dxq4Thqp.js} +6 -6
  26. package/dist/{Member-DEzSTAQy.js → Member-DLY-tqMO.js} +7 -7
  27. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BrhSxbrI.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DaXSO2Sw.js} +23 -23
  28. package/dist/{MemberImportHistory-BGfNLzma.js → MemberImportHistory-BllKLK-J.js} +7 -7
  29. package/dist/{MemberList-Cq5Gsv3G.js → MemberList-Cw9OUWN0.js} +14 -14
  30. package/dist/{MemberTransactions-BrUVZRtt.js → MemberTransactions-OBVrKAdH.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DCQ6Fse-.js → MessageInput.vue_vue_type_script_setup_true_lang-BBg9ZmEZ.js} +4338 -4287
  32. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CETwYfZD.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DWP4DTE8.js} +1 -1
  33. package/dist/{Mission-Do4IonLo.js → Mission-2yRMXtq_.js} +13 -13
  34. package/dist/{Overview-DA90l9Kb.js → Overview-B4OGaAQs.js} +19 -19
  35. package/dist/{Overview-DN-nJxw9.js → Overview-C6GQR5Be.js} +4 -4
  36. package/dist/{Point-DQ4w857n.js → Point-BHByUBQy.js} +12 -12
  37. package/dist/{Promotion-Rgt9LcYi.js → Promotion-DHOf5B8h.js} +13 -13
  38. package/dist/{Queue-SzypUxgD.js → Queue-DMQs5RXl.js} +11 -11
  39. package/dist/{Record-DYvPPhIW.js → Record-DgT-afmi.js} +9 -9
  40. package/dist/{Review-B0TERyHM.js → Review-BgOyos-p.js} +2 -2
  41. package/dist/{ReviewFacebookCallback-BJ5jQ3Dv.js → ReviewFacebookCallback-BYCLYoU9.js} +5 -5
  42. package/dist/{ReviewGoogleCallback-BKQD39dv.js → ReviewGoogleCallback-B5IBSCOt.js} +5 -5
  43. package/dist/{Reward-BexlVT_C.js → Reward-DhcO5T8x.js} +16 -16
  44. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-C-ygqNur.js → RewardGroup.vue_vue_type_script_setup_true_lang-BXk_SS1d.js} +12 -12
  45. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DjxIJcdv.js → RuleGroup.vue_vue_type_script_setup_true_lang-DPFXFu8i.js} +13 -13
  46. package/dist/{Segment-CYa4GjtQ.js → Segment-BM7-ufMg.js} +24 -24
  47. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-b-K-VDJC.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BbiZ4qOP.js} +13 -13
  48. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-t2mlDDtn.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BArVHth8.js} +4 -4
  49. package/dist/{Setting-Dmm5BKdF.js → Setting-BOPSL9ZZ.js} +14 -14
  50. package/dist/{SettingAdvertisements-cy4cRBop.js → SettingAdvertisements-cPCVcdFa.js} +12 -12
  51. package/dist/{Settings-DMQuLDM4.js → Settings-CqoifGTo.js} +5 -5
  52. package/dist/{Store-B7KflfSk.js → Store-CK30TAU9.js} +25 -25
  53. package/dist/{StoreRewards-BKae8uZn.js → StoreRewards-ChZtmuzE.js} +15 -15
  54. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-sbIR-k1R.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DYNiShwp.js} +24 -24
  55. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DRT3N9SD.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BHlC1EE4.js} +2 -2
  56. package/dist/{Tier-BeTz6LHH.js → Tier-CF2KJhuH.js} +24 -24
  57. package/dist/{Title-OEVVw5I-.js → Title-BqUR8e6x.js} +21 -21
  58. package/dist/{Transaction-D-MZjntW.js → Transaction-Cf5o_1V3.js} +2 -2
  59. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-xIEOUOdo.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CfArdf8F.js} +6 -6
  60. package/dist/{Voucher-BJCf3pSa.js → Voucher-BPOp4ic5.js} +14 -14
  61. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BFQ_CYub.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BZmGNLq1.js} +12 -12
  62. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DGDw3Too.js → ZodTextField.vue_vue_type_script_setup_true_lang-DrZ11Ra6.js} +2 -2
  63. package/dist/{app-J8VIC7-H.js → app-DJZhbUaQ.js} +4755 -4225
  64. package/dist/app.js +1 -1
  65. package/dist/{base.export-HYFFI4OS.js → base.export-CoTF6Joo.js} +2 -2
  66. package/dist/{business-BonuheMK.js → business-COH4ZPme.js} +1 -1
  67. package/dist/campaign-8u-VUYGh.js +368 -0
  68. package/dist/{campaign-Ct7jhugP.js → campaign-VQNSG0W_.js} +2 -2
  69. package/dist/{campaign.enum-OzJ9IbAW.js → campaign.enum-DPrWb8U2.js} +1 -1
  70. package/dist/{campaign.fn-CDjxE9B2.js → campaign.fn-D888JeGT.js} +72 -72
  71. package/dist/{collectible.enum-Dw_tlI9E.js → collectible.enum-DvSb1Y88.js} +1 -1
  72. package/dist/{collection.fn-CER0_NEn.js → collection.fn-BwIWKhBK.js} +2 -2
  73. package/dist/{currency-CTUS4vS8.js → currency-Hgkd5sh7.js} +1 -1
  74. package/dist/{duplicateCampaign-CMQ-RMH-.js → duplicateCampaign-Dn25VCVj.js} +2 -2
  75. package/dist/{effect-DBeGoMNE.js → effect-BwgQpATD.js} +1 -1
  76. package/dist/{email-addresses-BH3mQzan.js → email-addresses-C1vr0Uy5.js} +2 -2
  77. package/dist/{helper-DJe_JbKJ.js → helper-zfXDm3Jk.js} +1 -1
  78. package/dist/{index-D9f3AIaO.js → index-7vDEWDqs.js} +3 -3
  79. package/dist/index-Buh_J_zJ.js +14550 -0
  80. package/dist/{index-B14H1rLW.js → index-C2tPMx3P.js} +2 -2
  81. package/dist/{index-BzVTqlVH.js → index-C5hBS5HZ.js} +2 -2
  82. package/dist/{index-CEDhjZzd.js → index-C9Q3V8R9.js} +1 -1
  83. package/dist/{index-CrMBqkKk.js → index-CABF2-Io.js} +101 -98
  84. package/dist/{index-BZKKS7jO.js → index-CacUcTSI.js} +5 -5
  85. package/dist/{index-BOVnM3gL.js → index-CkIQalwo.js} +3 -3
  86. package/dist/{index-CN8VyVEB.js → index-CwCYEijW.js} +1 -1
  87. package/dist/{index-COuceEFz.js → index-D4XMwqKT.js} +1 -1
  88. package/dist/{index-CM9GTQIo.js → index-DlPAztwX.js} +3 -3
  89. package/dist/{index-bJX4zgh0.js → index-DqEB7W_r.js} +1 -1
  90. package/dist/{index-BlwAgY_z.js → index-Vv1-II8J.js} +1 -1
  91. package/dist/{index-BmN_Qcw7.js → index-eEMXtCiV.js} +2 -2
  92. package/dist/{index-BRCB6yJ6.js → index-grYhqqn8.js} +299 -196
  93. package/dist/{index-Bnk3vdb-.js → index-lrP5VxZd.js} +7 -7
  94. package/dist/{index-bGByr1XM.js → index-xzDzb0T3.js} +1 -1
  95. package/dist/{index-CWR2s6Nt.js → index-zZTsUIci.js} +1 -1
  96. package/dist/{index.esm2017-BpCPgTjc.js → index.esm2017-BlBA0-BF.js} +37 -37
  97. package/dist/{loading-D_rPJ-Yc.js → loading-CI7gmifv.js} +1 -1
  98. package/dist/{lodash-BM976Z2I.js → lodash-kft-Uy7N.js} +1 -1
  99. package/dist/{member-import-C5rhD3f8.js → member-import-BTr0LEYS.js} +1 -1
  100. package/dist/{membership-CIQCEKiL.js → membership-Cqia6d3x.js} +3 -3
  101. package/dist/{money-BrMT193t.js → money-bl2w3oEQ.js} +1 -1
  102. package/dist/{number-DOcD1tqL.js → number-Ckzx623S.js} +1 -1
  103. package/dist/objectid-CwK8XcuH.js +145 -0
  104. package/dist/{plugins-696Z9K6A.js → plugins-DzWEv3_R.js} +13 -12
  105. package/dist/{reward-lSVIBiE9.js → reward-S5B2MbnJ.js} +1 -1
  106. package/dist/{rule-BUGAimk8.js → rule-2k1mrjlc.js} +8 -8
  107. package/dist/style.css +1 -1
  108. package/dist/{template-01_h2Gac.js → template-DS_X-0yV.js} +6 -6
  109. package/dist/{timezone-okTdM2YU.js → timezone-ByZC3NaX.js} +1 -1
  110. package/dist/{transaction.fn-Nz0T33ex.js → transaction.fn-CmS0f0MN.js} +1 -1
  111. package/dist/{trigger-CKj1X6zs.js → trigger-uYmkCUpm.js} +5 -5
  112. package/dist/{useMarketingMaterialActions-yKqKaPpe.js → useMarketingMaterialActions-D9hFiGQL.js} +3 -3
  113. package/dist/{usePagination-D6cYlfni.js → usePagination-NBKbsZ4_.js} +1 -1
  114. package/dist/{user-DX5qCQfz.js → user-cCAfW4S5.js} +1 -1
  115. package/dist/{vue-i18n-DowpocqN.js → vue-i18n-BzjgwVzt.js} +511 -511
  116. package/dist/{xlsx-Dv4SuJbw.js → xlsx-DiFT4U5o.js} +440 -440
  117. package/dist/{zod-DVw24Ejy.js → zod-6HGtPTQu.js} +1 -1
  118. package/package.json +4 -1
  119. package/dist/Broadcast-CDz-_eDz.js +0 -269
  120. package/dist/campaign-7CI7gfS5.js +0 -255
  121. package/dist/index-Do36kJeb.js +0 -51
  122. package/dist/objectid-CAdRRoFu.js +0 -145
@@ -1,74 +1,77 @@
1
- import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, createCommentVNode, computed, onMounted, toDisplayString, createBlock, withCtx, Fragment, renderList, withModifiers, isRef, createTextVNode, normalizeClass, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
2
- import { _ } from "./lodash-BM976Z2I.js";
3
- import { J as J6, T as Th, z as z$1 } from "./app-J8VIC7-H.js";
4
- import { Z as ZodHelper } from "./zod-DVw24Ejy.js";
5
- import { F as FdoObjectId, z } from "./index-D9f3AIaO.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-CrMBqkKk.js";
7
- import { F as FdtoCollectibleConfig } from "./index-BOVnM3gL.js";
8
- import { a as isRuleGroup, R as RuleBuilder, s as stripRruleDtstartExceptSchedule, i as isRuleEntry, T as TEMPLATES } from "./index-BRCB6yJ6.js";
9
- import { u as useMembershipStore } from "./membership-CIQCEKiL.js";
10
- import { u as useBusinessStore } from "./business-BonuheMK.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, createSlots } from "vue";
2
+ import { _ } from "./lodash-kft-Uy7N.js";
3
+ import { J as J6, T as Th, z as z$1 } from "./app-DJZhbUaQ.js";
4
+ import { Z as ZodHelper } from "./zod-6HGtPTQu.js";
5
+ import { F as FdoObjectId, z } from "./index-7vDEWDqs.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-CABF2-Io.js";
7
+ import { F as FdtoCollectibleConfig } from "./index-CkIQalwo.js";
8
+ import { a as isRuleGroup, R as RuleBuilder, s as stripRruleDtstartExceptSchedule, i as isRuleEntry, T as TEMPLATES } from "./index-grYhqqn8.js";
9
+ import { g as F_APP_INBOX_DESTINATION, A as APP_INBOX_BODY_LIMIT, t as toDelivery, h as toLegacyMessage } from "./index-Buh_J_zJ.js";
10
+ import { u as useMembershipStore } from "./membership-Cqia6d3x.js";
11
+ import { u as useBusinessStore } from "./business-COH4ZPme.js";
11
12
  import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
12
13
  import { h as hooks } from "./moment-D7p2TMB-.js";
13
- import { f as featureVersionMapping } from "./campaign.enum-OzJ9IbAW.js";
14
- import { _ as _sfc_main$t } from "./ImageInput.vue_vue_type_script_setup_true_lang-BaAhKWhX.js";
15
- import { b as _sfc_main$r, a as _sfc_main$u, _ as _sfc_main$w } from "./EffectSheet.vue_vue_type_style_index_0_lang-yDUjXV2O.js";
16
- import { _ as _sfc_main$v } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DRT3N9SD.js";
17
- import { c as core, S as SvcConfig } from "./index-B14H1rLW.js";
18
- import { p as prompt, f as firebaseStorage } from "./plugins-696Z9K6A.js";
14
+ import { f as featureVersionMapping } from "./campaign.enum-DPrWb8U2.js";
15
+ import { _ as _sfc_main$C } from "./ImageInput.vue_vue_type_script_setup_true_lang-B_Fl95PN.js";
16
+ import { b as _sfc_main$A, a as _sfc_main$D, _ as _sfc_main$F } from "./EffectSheet.vue_vue_type_style_index_0_lang-CaEBp-Qj.js";
17
+ import { _ as _sfc_main$E } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BHlC1EE4.js";
18
+ import { c as core, S as SvcConfig } from "./index-C2tPMx3P.js";
19
+ import { p as prompt, f as firebaseStorage } from "./plugins-DzWEv3_R.js";
19
20
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-CHgC5LLL.js";
20
- import { _ as _sfc_main$y } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-xIEOUOdo.js";
21
- import { a as _sfc_main$o, _ as _sfc_main$p } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DjxIJcdv.js";
22
- import { u as useI18n } from "./vue-i18n-DowpocqN.js";
23
- import { T as TypeToTriggerOptions, _ as _sfc_main$z, b as _sfc_main$A } from "./trigger-CKj1X6zs.js";
24
- import { a as _sfc_main$x } from "./MessageInput.vue_vue_type_script_setup_true_lang-DCQ6Fse-.js";
25
- import { m as moment } from "./index-BlwAgY_z.js";
26
- import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-BUGAimk8.js";
21
+ import { _ as _sfc_main$G } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-CfArdf8F.js";
22
+ import { a as _sfc_main$u, _ as _sfc_main$y } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DPFXFu8i.js";
23
+ import { u as useI18n } from "./vue-i18n-BzjgwVzt.js";
24
+ import { T as TypeToTriggerOptions, _ as _sfc_main$H, b as _sfc_main$I } from "./trigger-uYmkCUpm.js";
25
+ import { D as DEFAULT_MESSAGE_VARIABLES, a as _sfc_main$v, g as getSmsMessageMetrics, _ as _sfc_main$w, b as _sfc_main$x } from "./MessageInput.vue_vue_type_script_setup_true_lang-BBg9ZmEZ.js";
27
26
  import { useCoreStore } from "@feedmepos/mf-common";
28
- import { C as CountryTimezone } from "./timezone-okTdM2YU.js";
29
- import { _ as _sfc_main$q, a as _sfc_main$s } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-BFQ_CYub.js";
30
- import "./index-BZKKS7jO.js";
31
- import "./index-CM9GTQIo.js";
32
- import { a as F_GAME_TYPE } from "./collectible.enum-Dw_tlI9E.js";
33
- import { u as useLoading } from "./loading-D_rPJ-Yc.js";
34
- import { i as initCollectibleConfig } from "./helper-DJe_JbKJ.js";
35
- import { C as CollectionUtils } from "./collection.fn-CER0_NEn.js";
27
+ import { c as campaignApi } from "./index-eEMXtCiV.js";
28
+ import { e as CHANNEL_DISPLAY_ORDER, i as isPaidChannel, f as isChannelComplete, h as addChannel, j as setMode, r as removeChannel, m as moveChannel, k as setChannelContent, l as getCampaignSummaryObject } from "./campaign-8u-VUYGh.js";
29
+ import { m as membershipApi } from "./index-xzDzb0T3.js";
30
+ import { m as moment } from "./index-Vv1-II8J.js";
31
+ import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-2k1mrjlc.js";
32
+ import { C as CountryTimezone } from "./timezone-ByZC3NaX.js";
33
+ import { _ as _sfc_main$z, a as _sfc_main$B } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-BZmGNLq1.js";
34
+ import "./index-CacUcTSI.js";
35
+ import "./index-DlPAztwX.js";
36
+ import { a as F_GAME_TYPE } from "./collectible.enum-DvSb1Y88.js";
37
+ import { u as useLoading } from "./loading-CI7gmifv.js";
38
+ import { i as initCollectibleConfig } from "./helper-zfXDm3Jk.js";
39
+ import { C as CollectionUtils } from "./collection.fn-BwIWKhBK.js";
36
40
  import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
37
- import { d as getCampaignSummaryObject } from "./campaign-7CI7gfS5.js";
38
41
  import { useDialog } from "@feedmepos/ui-library";
39
- import { u as useCampaignStore } from "./campaign-Ct7jhugP.js";
42
+ import { u as useCampaignStore } from "./campaign-VQNSG0W_.js";
40
43
  import { a as cleanPF } from "./object-BYyQ0PZp.js";
41
44
  function campaignRefinement(e, s) {
42
- var d, i;
45
+ var c, i;
43
46
  if (console.log(e, s), !e) return;
44
- const n = e.campaign;
45
- if (!n) return;
46
- const u = n.event.rule;
47
- if (!u || !isRuleGroup(u)) {
47
+ const o = e.campaign;
48
+ if (!o) return;
49
+ const d = o.event.rule;
50
+ if (!d || !isRuleGroup(d)) {
48
51
  s.addIssue({
49
52
  code: "custom",
50
53
  path: ["campaign", "event", "rule"],
51
54
  params: {
52
55
  i18n: "connectZodCustom:campaign.rule_required",
53
- type: n.event.type
56
+ type: o.event.type
54
57
  }
55
58
  });
56
59
  return;
57
60
  }
58
- switch (n.type) {
61
+ switch (o.type) {
59
62
  case "MISSION": {
60
- n.earningOption.amount > n.mission.end && s.addIssue({
63
+ o.earningOption.amount > o.mission.end && s.addIssue({
61
64
  code: "custom",
62
65
  path: ["campaign", "earningOption"],
63
66
  params: {
64
67
  i18n: "connectZodCustom:campaign.earning_amount_exceed",
65
- max: n.mission.end
68
+ max: o.mission.end
66
69
  }
67
70
  });
68
71
  break;
69
72
  }
70
73
  case "CREDIT": {
71
- const l = (d = n.config) == null ? void 0 : d.validityOption;
74
+ const l = (c = o.config) == null ? void 0 : c.validityOption;
72
75
  (!l || ["validForDay", "validBefore"].every((a) => l[a] == null)) && s.addIssue({
73
76
  code: "custom",
74
77
  path: ["campaign", "config", "validityOption"],
@@ -78,17 +81,17 @@ function campaignRefinement(e, s) {
78
81
  });
79
82
  }
80
83
  }
81
- switch (n.event.type) {
84
+ switch (o.event.type) {
82
85
  case "BILL_COMPLETED":
83
- n.type === "MISSION" && n.rewards.length && (n.rewards.forEach((l, o) => {
84
- (l.threshold < 0 || l.threshold > n.mission.end) && s.addIssue({
86
+ o.type === "MISSION" && o.rewards.length && (o.rewards.forEach((l, n) => {
87
+ (l.threshold < 0 || l.threshold > o.mission.end) && s.addIssue({
85
88
  code: "custom",
86
- path: ["campaign", "rewards", o, "threshold"],
89
+ path: ["campaign", "rewards", n, "threshold"],
87
90
  params: {
88
91
  i18n: "connectZodCustom:campaign.reward_threshold_range"
89
92
  }
90
93
  });
91
- }), (i = n.config) != null && i.validityOption.followFirstReceive || s.addIssue({
94
+ }), (i = o.config) != null && i.validityOption.followFirstReceive || s.addIssue({
92
95
  code: "custom",
93
96
  path: ["campaign", "config", "validityOption"],
94
97
  params: {
@@ -97,7 +100,7 @@ function campaignRefinement(e, s) {
97
100
  }));
98
101
  break;
99
102
  case "SCHEDULE": {
100
- if (!u.rules.g_schedule) {
103
+ if (!d.rules.g_schedule) {
101
104
  s.addIssue({
102
105
  code: "custom",
103
106
  path: ["campaign", "event", "rule"],
@@ -109,8 +112,8 @@ function campaignRefinement(e, s) {
109
112
  return;
110
113
  }
111
114
  const l = RuleBuilder.getRules(
112
- u.rules.g_schedule
113
- ), o = [
115
+ d.rules.g_schedule
116
+ ), n = [
114
117
  {
115
118
  property: "trigger.date",
116
119
  operator: ["_isOnDate", "_rrule"]
@@ -120,9 +123,9 @@ function campaignRefinement(e, s) {
120
123
  operator: ["_isOnTime"]
121
124
  }
122
125
  ];
123
- o.length == l.length && o.every((r) => l.some((p) => {
124
- const h = RuleBuilder.simplify(p);
125
- return h.property === r.property && r.operator.includes(h.operator);
126
+ n.length == l.length && n.every((r) => l.some((p) => {
127
+ const v = RuleBuilder.simplify(p);
128
+ return v.property === r.property && r.operator.includes(v.operator);
126
129
  })) || s.addIssue({
127
130
  code: "custom",
128
131
  path: ["campaign", "event", "rule"],
@@ -133,7 +136,7 @@ function campaignRefinement(e, s) {
133
136
  break;
134
137
  }
135
138
  default: {
136
- "earningOption" in n && n.earningOption.type != "FIXED" && s.addIssue({
139
+ "earningOption" in o && o.earningOption.type != "FIXED" && s.addIssue({
137
140
  code: "custom",
138
141
  path: ["campaign", "earningOption"],
139
142
  params: {
@@ -145,22 +148,22 @@ function campaignRefinement(e, s) {
145
148
  }
146
149
  }
147
150
  function campaignTransform(e) {
148
- var n;
151
+ var o;
149
152
  if (e.campaign.type === "VOUCHER" && "configs" in e) {
150
- const u = e.configs;
151
- u.extras.targetLocation = e.campaign.targetLocation;
152
- const d = Math.max(
153
+ const d = e.configs;
154
+ d.extras.targetLocation = e.campaign.targetLocation;
155
+ const c = Math.max(
153
156
  e.campaign.earningOption.amount,
154
- u.options.maxUse ?? 1
157
+ d.options.maxUse ?? 1
155
158
  );
156
- e.campaign.earningOption.amount = d, u.options.maxUse = d, e.campaign.earningOption = {
159
+ e.campaign.earningOption.amount = c, d.options.maxUse = c, e.campaign.earningOption = {
157
160
  type: "FIXED",
158
161
  amount: 1
159
162
  };
160
163
  }
161
164
  if (e.campaign.type == "MISSION" && "configs" in e) {
162
- const u = e.configs;
163
- u.options.validityOption = (n = e.campaign.config) == null ? void 0 : n.validityOption;
165
+ const d = e.configs;
166
+ d.options.validityOption = (o = e.campaign.config) == null ? void 0 : o.validityOption;
164
167
  }
165
168
  const s = e.campaign.event;
166
169
  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;
@@ -196,7 +199,10 @@ function GenerateCampaignReq(e) {
196
199
  });
197
200
  case "BROADCAST":
198
201
  return z.object({
199
- campaign: s,
202
+ campaign: s.refine((o) => !!o.delivery || !!o.message, {
203
+ path: ["delivery"],
204
+ message: "A broadcast requires a message or delivery configuration."
205
+ }),
200
206
  templateId: FdoObjectId
201
207
  });
202
208
  case "COIN":
@@ -255,19 +261,19 @@ function summarizeGrabDiscount(e) {
255
261
  if (!e)
256
262
  return null;
257
263
  const s = core.Config.getCountry().currency.symbol;
258
- function n(l) {
264
+ function o(l) {
259
265
  switch (l.scope.type) {
260
266
  case "order":
261
267
  return "Bill discount";
262
268
  case "items":
263
- return l.type.startsWith("bundle") ? u(l.type) : "Item discount";
269
+ return l.type.startsWith("bundle") ? d(l.type) : "Item discount";
264
270
  case "categories":
265
271
  return "Category discount";
266
272
  default:
267
273
  return "Discount";
268
274
  }
269
275
  }
270
- function u(l) {
276
+ function d(l) {
271
277
  switch (l) {
272
278
  case "bundleSameFixPrice":
273
279
  return "Bundle (same item) - Fixed price";
@@ -285,7 +291,7 @@ function summarizeGrabDiscount(e) {
285
291
  return "Bundle discount";
286
292
  }
287
293
  }
288
- function d(l) {
294
+ function c(l) {
289
295
  switch (l.type) {
290
296
  case "percentage":
291
297
  case "bundleSamePercentage":
@@ -310,15 +316,15 @@ function summarizeGrabDiscount(e) {
310
316
  return l.cap && l.cap > 0 ? `capped at ${s}${l.cap}` : null;
311
317
  }
312
318
  return {
313
- type: n(e),
314
- adjustment: d(e),
319
+ type: o(e),
320
+ adjustment: c(e),
315
321
  cap: i(e)
316
322
  };
317
323
  }
318
- const _hoisted_1$l = {
324
+ const _hoisted_1$r = {
319
325
  key: 0,
320
326
  class: "bg-fm-color-neutral-gray-50 border border-fm-color-neutral-gray-200 rounded-8 p-16 space-y-16"
321
- }, _hoisted_2$h = { class: "flex items-center justify-between" }, _hoisted_3$e = { class: "flex items-center gap-8" }, _hoisted_4$d = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 p-16" }, _hoisted_5$a = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$n = /* @__PURE__ */ defineComponent({
327
+ }, _hoisted_2$n = { class: "flex items-center justify-between" }, _hoisted_3$k = { class: "flex items-center gap-8" }, _hoisted_4$j = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 p-16" }, _hoisted_5$g = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$t = /* @__PURE__ */ defineComponent({
322
328
  __name: "GrabItemSelectionInline",
323
329
  props: {
324
330
  visible: { type: Boolean },
@@ -327,59 +333,59 @@ const _hoisted_1$l = {
327
333
  },
328
334
  emits: ["confirm", "cancel"],
329
335
  setup(e, { emit: s }) {
330
- const n = e, u = s, d = ref();
336
+ const o = e, d = s, c = ref();
331
337
  watch(
332
- () => n.visible,
338
+ () => o.visible,
333
339
  (a) => {
334
340
  var r, p;
335
- !a && d.value && ((p = (r = d.value).setSelectedItems) == null || p.call(r, n.initialValue || []));
341
+ !a && c.value && ((p = (r = c.value).setSelectedItems) == null || p.call(r, o.initialValue || []));
336
342
  }
337
343
  );
338
344
  function i() {
339
345
  var a;
340
- (a = d.value) == null || a.onConfirm();
346
+ (a = c.value) == null || a.onConfirm();
341
347
  }
342
348
  function l() {
343
- u("cancel");
349
+ d("cancel");
344
350
  }
345
- function o(a) {
346
- u("confirm", a);
351
+ function n(a) {
352
+ d("confirm", a);
347
353
  }
348
354
  return (a, r) => {
349
- const p = resolveComponent("FmIcon"), h = resolveComponent("FmButton");
350
- return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$l, [
351
- createElementVNode("div", _hoisted_2$h, [
352
- createElementVNode("div", _hoisted_3$e, [
355
+ const p = resolveComponent("FmIcon"), v = resolveComponent("FmButton");
356
+ return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$r, [
357
+ createElementVNode("div", _hoisted_2$n, [
358
+ createElementVNode("div", _hoisted_3$k, [
353
359
  createVNode(p, {
354
360
  name: "restaurant",
355
361
  size: "md"
356
362
  }),
357
363
  r[0] || (r[0] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Items", -1))
358
364
  ]),
359
- createVNode(h, {
365
+ createVNode(v, {
360
366
  icon: "close",
361
367
  variant: "tertiary",
362
368
  onClick: l
363
369
  })
364
370
  ]),
365
371
  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)),
366
- createElementVNode("div", _hoisted_4$d, [
372
+ createElementVNode("div", _hoisted_4$j, [
367
373
  createVNode(unref(J6), {
368
374
  ref_key: "selectItemRef",
369
- ref: d,
375
+ ref: c,
370
376
  "initial-value": e.initialValue,
371
377
  "filter-items": e.filterItems,
372
- "on-complete": o,
378
+ "on-complete": n,
373
379
  "max-height": 300
374
380
  }, null, 8, ["initial-value", "filter-items"])
375
381
  ]),
376
- createElementVNode("div", _hoisted_5$a, [
377
- createVNode(h, {
382
+ createElementVNode("div", _hoisted_5$g, [
383
+ createVNode(v, {
378
384
  variant: "secondary",
379
385
  label: "Cancel",
380
386
  onClick: l
381
387
  }),
382
- createVNode(h, {
388
+ createVNode(v, {
383
389
  variant: "primary",
384
390
  label: "Confirm Selection",
385
391
  onClick: i
@@ -388,13 +394,13 @@ const _hoisted_1$l = {
388
394
  ])) : createCommentVNode("", !0);
389
395
  };
390
396
  }
391
- }), _hoisted_1$k = {
397
+ }), _hoisted_1$q = {
392
398
  key: 0,
393
399
  class: "bg-fm-color-neutral-gray-50 border border-fm-color-neutral-gray-200 rounded-8 p-16 space-y-16"
394
- }, _hoisted_2$g = { class: "flex items-center justify-between" }, _hoisted_3$d = { class: "flex items-center gap-8" }, _hoisted_4$c = { class: "flex gap-16 items-center flex-wrap" }, _hoisted_5$9 = { class: "flex gap-8 items-center" }, _hoisted_6$5 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_7$5 = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 max-h-[300px] overflow-y-auto" }, _hoisted_8$4 = { class: "flex items-center gap-12" }, _hoisted_9$4 = { class: "fm-typo-en-body-md-600" }, _hoisted_10$4 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_11$2 = {
400
+ }, _hoisted_2$m = { class: "flex items-center justify-between" }, _hoisted_3$j = { class: "flex items-center gap-8" }, _hoisted_4$i = { class: "flex gap-16 items-center flex-wrap" }, _hoisted_5$f = { class: "flex gap-8 items-center" }, _hoisted_6$b = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_7$a = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 max-h-[300px] overflow-y-auto" }, _hoisted_8$8 = { class: "flex items-center gap-12" }, _hoisted_9$8 = { class: "fm-typo-en-body-md-600" }, _hoisted_10$8 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_11$6 = {
395
401
  key: 1,
396
402
  class: "p-24 text-center"
397
- }, _hoisted_12$1 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_13$1 = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$m = /* @__PURE__ */ defineComponent({
403
+ }, _hoisted_12$5 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_13$5 = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$s = /* @__PURE__ */ defineComponent({
398
404
  __name: "GrabCategorySelectionInline",
399
405
  props: {
400
406
  visible: { type: Boolean },
@@ -402,125 +408,125 @@ const _hoisted_1$l = {
402
408
  },
403
409
  emits: ["confirm", "cancel"],
404
410
  setup(e, { emit: s }) {
405
- const n = e, u = s, d = Th(), i = ref({}), l = ref(""), o = computed(() => {
406
- const c = d.menu.value;
407
- return c ? c.modules.category.map((m) => ({
411
+ const o = e, d = s, c = Th(), i = ref({}), l = ref(""), n = computed(() => {
412
+ const u = c.menu.value;
413
+ return u ? u.modules.category.map((m) => ({
408
414
  id: m._id,
409
415
  name: m.name
410
416
  })) : [];
411
417
  }), a = computed(() => {
412
- if (!l.value) return o.value;
413
- const c = l.value.toLowerCase();
414
- return o.value.filter(
415
- (m) => m.name.toLowerCase().includes(c)
418
+ if (!l.value) return n.value;
419
+ const u = l.value.toLowerCase();
420
+ return n.value.filter(
421
+ (m) => m.name.toLowerCase().includes(u)
416
422
  );
417
423
  }), r = computed(() => Object.values(i.value).filter(Boolean).length);
418
424
  function p() {
419
- i.value = o.value.reduce(
420
- (c, m) => (c[m.id] = n.initialValue.includes(m.id), c),
425
+ i.value = n.value.reduce(
426
+ (u, m) => (u[m.id] = o.initialValue.includes(m.id), u),
421
427
  {}
422
428
  );
423
429
  }
424
- watch([() => n.visible, () => n.initialValue], () => {
425
- n.visible && p();
430
+ watch([() => o.visible, () => o.initialValue], () => {
431
+ o.visible && p();
426
432
  }), onMounted(async () => {
427
- await d.store.getMenu(), p();
433
+ await c.store.getMenu(), p();
428
434
  });
429
- function h(c) {
430
- i.value[c] = !i.value[c];
435
+ function v(u) {
436
+ i.value[u] = !i.value[u];
431
437
  }
432
438
  function y() {
433
- const c = r.value === a.value.length;
439
+ const u = r.value === a.value.length;
434
440
  a.value.forEach((m) => {
435
- i.value[m.id] = !c;
441
+ i.value[m.id] = !u;
436
442
  });
437
443
  }
438
- function C() {
439
- Object.keys(i.value).forEach((c) => {
440
- i.value[c] = !1;
444
+ function V() {
445
+ Object.keys(i.value).forEach((u) => {
446
+ i.value[u] = !1;
441
447
  });
442
448
  }
443
- function B() {
444
- const c = Object.entries(i.value).filter(([, m]) => m).map(([m]) => m);
445
- u("confirm", c);
449
+ function x() {
450
+ const u = Object.entries(i.value).filter(([, m]) => m).map(([m]) => m);
451
+ d("confirm", u);
446
452
  }
447
- function v() {
448
- u("cancel");
453
+ function f() {
454
+ d("cancel");
449
455
  }
450
- const f = computed(() => a.value.length > 0 && a.value.every(
451
- (c) => i.value[c.id]
456
+ const g = computed(() => a.value.length > 0 && a.value.every(
457
+ (u) => i.value[u.id]
452
458
  ));
453
- return (c, m) => {
454
- const k = resolveComponent("FmIcon"), b = resolveComponent("FmButton"), E = resolveComponent("FmTextField"), S = resolveComponent("FmCheckbox"), x = resolveComponent("FmListItem"), R = resolveComponent("FmList");
455
- return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$k, [
456
- createElementVNode("div", _hoisted_2$g, [
457
- createElementVNode("div", _hoisted_3$d, [
458
- createVNode(k, {
459
+ return (u, m) => {
460
+ const C = resolveComponent("FmIcon"), k = resolveComponent("FmButton"), $ = resolveComponent("FmTextField"), R = resolveComponent("FmCheckbox"), B = resolveComponent("FmListItem"), D = resolveComponent("FmList");
461
+ return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$q, [
462
+ createElementVNode("div", _hoisted_2$m, [
463
+ createElementVNode("div", _hoisted_3$j, [
464
+ createVNode(C, {
459
465
  name: "category",
460
466
  size: "md"
461
467
  }),
462
468
  m[2] || (m[2] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Categories", -1))
463
469
  ]),
464
- createVNode(b, {
470
+ createVNode(k, {
465
471
  icon: "close",
466
472
  variant: "tertiary",
467
- onClick: v
473
+ onClick: f
468
474
  })
469
475
  ]),
470
476
  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)),
471
- createElementVNode("div", _hoisted_4$c, [
472
- createElementVNode("div", _hoisted_5$9, [
473
- createVNode(b, {
477
+ createElementVNode("div", _hoisted_4$i, [
478
+ createElementVNode("div", _hoisted_5$f, [
479
+ createVNode(k, {
474
480
  icon: "select_all",
475
481
  variant: "tertiary",
476
482
  size: "small",
477
- label: `${f.value ? "Deselect" : "Select"} All`,
483
+ label: `${g.value ? "Deselect" : "Select"} All`,
478
484
  onClick: y
479
485
  }, null, 8, ["label"]),
480
- createVNode(b, {
486
+ createVNode(k, {
481
487
  icon: "sync",
482
488
  variant: "tertiary",
483
489
  size: "small",
484
490
  label: "Clear",
485
- onClick: C
491
+ onClick: V
486
492
  }),
487
- createElementVNode("span", _hoisted_6$5, toDisplayString(r.value) + " selected ", 1)
493
+ createElementVNode("span", _hoisted_6$b, toDisplayString(r.value) + " selected ", 1)
488
494
  ]),
489
- createVNode(E, {
495
+ createVNode($, {
490
496
  modelValue: l.value,
491
- "onUpdate:modelValue": m[0] || (m[0] = (N) => l.value = N),
497
+ "onUpdate:modelValue": m[0] || (m[0] = (w) => l.value = w),
492
498
  placeholder: "Search categories",
493
499
  "leading-icon": { name: "search", color: "" },
494
500
  class: "flex-1 min-w-[200px]"
495
501
  }, null, 8, ["modelValue"])
496
502
  ]),
497
- createElementVNode("div", _hoisted_7$5, [
498
- a.value.length > 0 ? (openBlock(), createBlock(R, { key: 0 }, {
503
+ createElementVNode("div", _hoisted_7$a, [
504
+ a.value.length > 0 ? (openBlock(), createBlock(D, { key: 0 }, {
499
505
  default: withCtx(() => [
500
- (openBlock(!0), createElementBlock(Fragment, null, renderList(a.value, (N) => (openBlock(), createBlock(x, {
501
- key: N.id,
506
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(a.value, (w) => (openBlock(), createBlock(B, {
507
+ key: w.id,
502
508
  clickable: !0,
503
- onClick: (w) => h(N.id)
509
+ onClick: (O) => v(w.id)
504
510
  }, {
505
511
  leading: withCtx(() => [
506
- createVNode(S, {
507
- "model-value": i.value[N.id] || !1,
508
- value: N.id,
509
- "onUpdate:modelValue": (w) => h(N.id),
512
+ createVNode(R, {
513
+ "model-value": i.value[w.id] || !1,
514
+ value: w.id,
515
+ "onUpdate:modelValue": (O) => v(w.id),
510
516
  onClick: m[1] || (m[1] = withModifiers(() => {
511
517
  }, ["stop"]))
512
518
  }, null, 8, ["model-value", "value", "onUpdate:modelValue"])
513
519
  ]),
514
520
  default: withCtx(() => [
515
- createElementVNode("div", _hoisted_8$4, [
516
- createVNode(k, {
521
+ createElementVNode("div", _hoisted_8$8, [
522
+ createVNode(C, {
517
523
  name: "category",
518
524
  size: "sm",
519
525
  class: "text-fm-color-typo-secondary"
520
526
  }),
521
527
  createElementVNode("div", null, [
522
- createElementVNode("div", _hoisted_9$4, toDisplayString(N.name), 1),
523
- createElementVNode("div", _hoisted_10$4, " ID: " + toDisplayString(N.id), 1)
528
+ createElementVNode("div", _hoisted_9$8, toDisplayString(w.name), 1),
529
+ createElementVNode("div", _hoisted_10$8, " ID: " + toDisplayString(w.id), 1)
524
530
  ])
525
531
  ])
526
532
  ]),
@@ -528,40 +534,40 @@ const _hoisted_1$l = {
528
534
  }, 1032, ["onClick"]))), 128))
529
535
  ]),
530
536
  _: 1
531
- })) : (openBlock(), createElementBlock("div", _hoisted_11$2, [
532
- createElementVNode("div", _hoisted_12$1, toDisplayString(l.value ? "No categories found matching your search." : "No categories available."), 1)
537
+ })) : (openBlock(), createElementBlock("div", _hoisted_11$6, [
538
+ createElementVNode("div", _hoisted_12$5, toDisplayString(l.value ? "No categories found matching your search." : "No categories available."), 1)
533
539
  ]))
534
540
  ]),
535
- createElementVNode("div", _hoisted_13$1, [
536
- createVNode(b, {
541
+ createElementVNode("div", _hoisted_13$5, [
542
+ createVNode(k, {
537
543
  variant: "secondary",
538
544
  label: "Cancel",
539
- onClick: v
545
+ onClick: f
540
546
  }),
541
- createVNode(b, {
547
+ createVNode(k, {
542
548
  variant: "primary",
543
549
  label: `Confirm Selection (${r.value})`,
544
550
  disabled: r.value === 0,
545
- onClick: B
551
+ onClick: x
546
552
  }, null, 8, ["label", "disabled"])
547
553
  ])
548
554
  ])) : createCommentVNode("", !0);
549
555
  };
550
556
  }
551
- }), _hoisted_1$j = { class: "space-y-8" }, _hoisted_2$f = {
557
+ }), _hoisted_1$p = { class: "space-y-8" }, _hoisted_2$l = {
552
558
  key: 1,
553
559
  class: "border-1 rounded-md flex gap-16 items-center justify-between px-16 py-12"
554
- }, _hoisted_3$c = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$b = { class: "text-fm-color-typo-secondary" }, _hoisted_5$8 = { key: 0 }, _hoisted_6$4 = { class: "space-y-24" }, _hoisted_7$4 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-4" }, _hoisted_8$3 = { key: 0 }, _hoisted_9$3 = { class: "fm-typo-en-body-md-600 mb-8 block" }, _hoisted_10$3 = { key: 1 }, _hoisted_11$1 = { key: 2 }, _hoisted_12 = { key: 0 }, _hoisted_13 = { class: "space-y-8" }, _hoisted_14 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_15 = { class: "flex items-center gap-8" }, _hoisted_16 = { class: "fm-typo-en-body-md-400" }, _hoisted_17 = { key: 3 }, _hoisted_18 = { key: 0 }, _hoisted_19 = { class: "space-y-8" }, _hoisted_20 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_21 = { class: "flex items-center gap-8" }, _hoisted_22 = { class: "fm-typo-en-body-md-400" }, _hoisted_23 = {
560
+ }, _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$7 = { key: 0 }, _hoisted_9$7 = { 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 = { class: "fm-typo-en-body-md-400" }, _hoisted_23 = {
555
561
  key: 0,
556
562
  class: "mt-16 p-12 bg-fm-color-feedback-error-light rounded-8 border border-fm-color-feedback-error-main"
557
- }, _hoisted_24 = { 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$l = /* @__PURE__ */ defineComponent({
563
+ }, _hoisted_24 = { 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({
558
564
  __name: "GrabEffectSheet",
559
565
  props: {
560
566
  modelValue: { type: Object }
561
567
  },
562
568
  emits: ["update:model-value"],
563
569
  setup(e, { emit: s }) {
564
- const n = e, u = s, d = Th(), i = ref(!1), l = ref(!1), o = ref(!1), a = ref({
570
+ const o = e, d = s, c = Th(), i = ref(!1), l = ref(!1), n = ref(!1), a = ref({
565
571
  type: "net",
566
572
  value: 0,
567
573
  scope: {
@@ -569,72 +575,72 @@ const _hoisted_1$l = {
569
575
  }
570
576
  });
571
577
  watch(
572
- () => n.modelValue,
573
- (g) => {
574
- g && (a.value = { ...g });
578
+ () => o.modelValue,
579
+ (b) => {
580
+ b && (a.value = { ...b });
575
581
  },
576
582
  { immediate: !0 }
577
583
  ), onMounted(async () => {
578
- await d.store.getMenu();
584
+ await c.store.getMenu();
579
585
  });
580
586
  const r = computed(() => {
581
- var g;
582
- return !(!a.value.type || !((g = a.value.scope) != null && g.type) || y(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));
587
+ var b;
588
+ return !(!a.value.type || !((b = a.value.scope) != null && b.type) || y(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));
583
589
  });
584
- async function p(g) {
585
- g.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && u("update:model-value", null);
590
+ async function p(b) {
591
+ b.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && d("update:model-value", null);
586
592
  }
587
- function h() {
588
- var g;
589
- return k(((g = a.value.scope) == null ? void 0 : g.type) || "order");
593
+ function v() {
594
+ var b;
595
+ return C(((b = a.value.scope) == null ? void 0 : b.type) || "order");
590
596
  }
591
- function y(g) {
592
- return g && !["freeItem", "delivery"].includes(g);
597
+ function y(b) {
598
+ return b && !["freeItem", "delivery"].includes(b);
593
599
  }
594
- function C(g) {
595
- return g && ["percentage", "bundleSamePercentage", "bundleDiffPercentage"].includes(
596
- g
600
+ function V(b) {
601
+ return b && ["percentage", "bundleSamePercentage", "bundleDiffPercentage"].includes(
602
+ b
597
603
  );
598
604
  }
599
- function B(g) {
600
- return g != null && g.includes("Percentage") ? "Discount percentage" : g != null && g.includes("FixPrice") ? "Bundle fixed price" : g === "percentage" ? "Discount percentage" : "Discount amount";
605
+ function x(b) {
606
+ return b != null && b.includes("Percentage") ? "Discount percentage" : b != null && b.includes("FixPrice") ? "Bundle fixed price" : b === "percentage" ? "Discount percentage" : "Discount amount";
601
607
  }
602
- function v(g) {
603
- return g != null && g.includes("Percentage") || g === "percentage" ? "10" : "5.00";
608
+ function f(b) {
609
+ return b != null && b.includes("Percentage") || b === "percentage" ? "10" : "5.00";
604
610
  }
605
- function f(g) {
606
- return g != null && g.includes("Percentage") || g === "percentage" ? "%" : "$";
611
+ function g(b) {
612
+ return b != null && b.includes("Percentage") || b === "percentage" ? "%" : "$";
607
613
  }
608
- function c(g, V) {
614
+ function u(b, E) {
609
615
  a.value = {
610
616
  ...a.value,
611
- [g]: V
617
+ [b]: E
612
618
  };
613
619
  }
614
- function m(g, V) {
615
- var D;
616
- const $ = {
620
+ function m(b, E) {
621
+ var A;
622
+ const T = {
617
623
  ...a.value.scope,
618
- [g]: V
624
+ [b]: E
619
625
  };
620
626
  if (a.value = {
621
627
  ...a.value,
622
- scope: $
623
- }, g === "type") {
624
- const T = k(V);
625
- T.some(
626
- (U) => U.value === a.value.type
628
+ scope: T
629
+ }, b === "type") {
630
+ const P = C(E);
631
+ P.some(
632
+ (N) => N.value === a.value.type
627
633
  ) || (a.value = {
628
634
  ...a.value,
629
- type: ((D = T[0]) == null ? void 0 : D.value) || "net",
635
+ type: ((A = P[0]) == null ? void 0 : A.value) || "net",
630
636
  // Reset value and cap when changing to incompatible type
631
637
  value: 0,
632
638
  cap: void 0
633
639
  });
634
640
  }
635
641
  }
636
- function k(g) {
637
- switch (g) {
642
+ function C(b) {
643
+ switch (b) {
638
644
  case "order":
639
645
  return [
640
646
  { label: "Amount off", value: "net" },
@@ -680,8 +686,8 @@ const _hoisted_1$l = {
680
686
  ];
681
687
  }
682
688
  }
683
- function b(g) {
684
- switch (g) {
689
+ function k(b) {
690
+ switch (b) {
685
691
  case "order":
686
692
  return "Applies to entire order. Available: Amount off, Percentage off, Delivery fee discount.";
687
693
  case "category":
@@ -692,98 +698,98 @@ const _hoisted_1$l = {
692
698
  return "Select how you want to apply the discount.";
693
699
  }
694
700
  }
695
- function E() {
696
- var g;
697
- return ((g = a.value.scope) == null ? void 0 : g.type) === "items";
701
+ function $() {
702
+ var b;
703
+ return ((b = a.value.scope) == null ? void 0 : b.type) === "items";
698
704
  }
699
- function S() {
700
- var g;
701
- return ((g = a.value.scope) == null ? void 0 : g.type) === "category";
705
+ function R() {
706
+ var b;
707
+ return ((b = a.value.scope) == null ? void 0 : b.type) === "category";
702
708
  }
703
- function x() {
704
- var $;
705
- const g = ($ = a.value.scope) == null ? void 0 : $.objectIDs;
706
- if (!g || g.length === 0)
709
+ function B() {
710
+ var T;
711
+ const b = (T = a.value.scope) == null ? void 0 : T.objectIDs;
712
+ if (!b || b.length === 0)
707
713
  return "No items selected";
708
- const V = d.menu.value;
709
- return V && g.length <= 3 ? g.map((T) => {
710
- const O = V.modules.item.find((U) => U._id === T);
711
- return O ? (O.name2 || O.name).trim() : `Item ${T}`;
712
- }).join(", ") : g.length === 1 ? "1 item selected" : `${g.length} items selected`;
714
+ const E = c.menu.value;
715
+ return E && b.length <= 3 ? b.map((P) => {
716
+ const h = E.modules.item.find((N) => N._id === P);
717
+ return h ? (h.name2 || h.name).trim() : `Item ${P}`;
718
+ }).join(", ") : b.length === 1 ? "1 item selected" : `${b.length} items selected`;
713
719
  }
714
- function R() {
715
- var $;
716
- const g = ($ = a.value.scope) == null ? void 0 : $.objectIDs;
717
- if (!g || g.length === 0)
720
+ function D() {
721
+ var T;
722
+ const b = (T = a.value.scope) == null ? void 0 : T.objectIDs;
723
+ if (!b || b.length === 0)
718
724
  return "No categories selected";
719
- const V = d.menu.value;
720
- return V && g.length <= 3 ? g.map((T) => {
721
- const O = V.modules.category.find((U) => U._id === T);
722
- return O ? O.name : `Category ${T}`;
723
- }).join(", ") : g.length === 1 ? "1 category selected" : `${g.length} categories selected`;
725
+ const E = c.menu.value;
726
+ return E && b.length <= 3 ? b.map((P) => {
727
+ const h = E.modules.category.find((N) => N._id === P);
728
+ return h ? h.name : `Category ${P}`;
729
+ }).join(", ") : b.length === 1 ? "1 category selected" : `${b.length} categories selected`;
724
730
  }
725
- function N() {
731
+ function w() {
726
732
  l.value = !0;
727
733
  }
728
- function w() {
729
- o.value = !0;
734
+ function O() {
735
+ n.value = !0;
730
736
  }
731
- function A(g) {
732
- m("objectIDs", g), l.value = !1;
737
+ function L(b) {
738
+ m("objectIDs", b), l.value = !1;
733
739
  }
734
- function F(g) {
735
- m("objectIDs", g), o.value = !1;
740
+ function I(b) {
741
+ m("objectIDs", b), n.value = !1;
736
742
  }
737
- function G() {
743
+ function Y() {
738
744
  l.value = !1;
739
745
  }
740
- function Y() {
741
- o.value = !1;
746
+ function G() {
747
+ n.value = !1;
742
748
  }
743
749
  const H = computed(() => {
744
- var V, $, D;
745
- const g = [];
746
- return a.value.type || g.push("Discount type is required"), (V = a.value.scope) != null && V.type || g.push("Scope type is required"), y(a.value.type) && (!a.value.value || a.value.value <= 0) && g.push("Discount amount must be greater than 0"), (($ = a.value.scope) == null ? void 0 : $.type) === "items" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && g.push("Please select at least one item"), ((D = a.value.scope) == null ? void 0 : D.type) === "category" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && g.push("Please select at least one category"), g;
750
+ var E, T, A;
751
+ const b = [];
752
+ return a.value.type || b.push("Discount type is required"), (E = a.value.scope) != null && E.type || b.push("Scope type is required"), y(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"), ((A = a.value.scope) == null ? void 0 : A.type) === "category" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && b.push("Please select at least one category"), b;
747
753
  });
748
754
  function q() {
749
- u("update:model-value", a.value), i.value = !1;
755
+ d("update:model-value", a.value), i.value = !1;
750
756
  }
751
757
  const Z = [
752
758
  { label: "Bill discount", value: "order" },
753
759
  { label: "Item discount", value: "items" },
754
760
  { label: "Category discount", value: "category" }
755
761
  ];
756
- return (g, V) => {
757
- const $ = resolveComponent("FmButton"), D = resolveComponent("FmSelect"), T = resolveComponent("FmStepperField"), O = resolveComponent("FmIcon"), U = resolveComponent("FmSideSheet");
758
- return openBlock(), createBlock(U, {
762
+ return (b, E) => {
763
+ const T = resolveComponent("FmButton"), A = resolveComponent("FmSelect"), P = resolveComponent("FmStepperField"), h = resolveComponent("FmIcon"), N = resolveComponent("FmSideSheet");
764
+ return openBlock(), createBlock(N, {
759
765
  "max-width": 550,
760
766
  header: "Apply discount",
761
767
  modelValue: unref(i),
762
768
  "onUpdate:modelValue": [
763
- V[5] || (V[5] = (I) => isRef(i) ? i.value = I : null),
764
- V[6] || (V[6] = (I) => i.value = I)
769
+ E[5] || (E[5] = (F) => isRef(i) ? i.value = F : null),
770
+ E[6] || (E[6] = (F) => i.value = F)
765
771
  ]
766
772
  }, {
767
773
  "side-sheet-button": withCtx(() => {
768
- var I, L, M, j;
774
+ var F, U, S, j;
769
775
  return [
770
- createElementVNode("div", _hoisted_1$j, [
771
- V[7] || (V[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)),
772
- e.modelValue ? (openBlock(), createElementBlock("div", _hoisted_2$f, [
773
- createElementVNode("div", _hoisted_3$c, [
774
- createElementVNode("div", null, toDisplayString((I = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : I.type), 1),
775
- createElementVNode("div", _hoisted_4$b, [
776
- createTextVNode(toDisplayString((L = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : L.adjustment) + " ", 1),
777
- (M = unref(summarizeGrabDiscount)(e.modelValue)) != null && M.cap ? (openBlock(), createElementBlock("span", _hoisted_5$8, toDisplayString((j = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : j.cap), 1)) : createCommentVNode("", !0)
776
+ createElementVNode("div", _hoisted_1$p, [
777
+ 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)),
778
+ e.modelValue ? (openBlock(), createElementBlock("div", _hoisted_2$l, [
779
+ createElementVNode("div", _hoisted_3$i, [
780
+ createElementVNode("div", null, toDisplayString((F = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : F.type), 1),
781
+ createElementVNode("div", _hoisted_4$h, [
782
+ createTextVNode(toDisplayString((U = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : U.adjustment) + " ", 1),
783
+ (S = unref(summarizeGrabDiscount)(e.modelValue)) != null && S.cap ? (openBlock(), createElementBlock("span", _hoisted_5$e, toDisplayString((j = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : j.cap), 1)) : createCommentVNode("", !0)
778
784
  ])
779
785
  ]),
780
- createVNode($, {
786
+ createVNode(T, {
781
787
  icon: "delete",
782
788
  "icon-color": "neutral-gray-400",
783
789
  variant: "tertiary",
784
790
  onClick: p
785
791
  })
786
- ])) : (openBlock(), createBlock($, {
792
+ ])) : (openBlock(), createBlock(T, {
787
793
  key: 0,
788
794
  label: "Apply Grab discount",
789
795
  icon: "add",
@@ -796,13 +802,13 @@ const _hoisted_1$l = {
796
802
  }),
797
803
  "side-sheet-footer": withCtx(() => [
798
804
  createElementVNode("div", _hoisted_26, [
799
- createVNode($, {
805
+ createVNode(T, {
800
806
  variant: "secondary",
801
807
  label: "Cancel",
802
808
  class: "flex-1",
803
- onClick: V[4] || (V[4] = (I) => i.value = !1)
809
+ onClick: E[4] || (E[4] = (F) => i.value = !1)
804
810
  }),
805
- createVNode($, {
811
+ createVNode(T, {
806
812
  variant: "primary",
807
813
  label: unref(r) ? "Confirm" : "Complete Required Fields",
808
814
  class: "flex-1",
@@ -812,118 +818,118 @@ const _hoisted_1$l = {
812
818
  ])
813
819
  ]),
814
820
  default: withCtx(() => {
815
- var I, L, M, j;
821
+ var F, U, S, j;
816
822
  return [
817
- createElementVNode("div", _hoisted_6$4, [
823
+ createElementVNode("div", _hoisted_6$a, [
818
824
  createElementVNode("div", null, [
819
- V[8] || (V[8] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Campaign type", -1)),
820
- createVNode(D, {
821
- "model-value": ((I = unref(a).scope) == null ? void 0 : I.type) || "order",
822
- "onUpdate:modelValue": V[0] || (V[0] = (P) => m("type", P)),
825
+ E[8] || (E[8] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Campaign type", -1)),
826
+ createVNode(A, {
827
+ "model-value": ((F = unref(a).scope) == null ? void 0 : F.type) || "order",
828
+ "onUpdate:modelValue": E[0] || (E[0] = (M) => m("type", M)),
823
829
  placeholder: "Select campaign type",
824
830
  items: Z
825
831
  }, null, 8, ["model-value"]),
826
- createElementVNode("div", _hoisted_7$4, toDisplayString(b((L = unref(a).scope) == null ? void 0 : L.type)), 1)
832
+ createElementVNode("div", _hoisted_7$9, toDisplayString(k((U = unref(a).scope) == null ? void 0 : U.type)), 1)
827
833
  ]),
828
834
  createElementVNode("div", null, [
829
- V[9] || (V[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
830
- createVNode(D, {
835
+ E[9] || (E[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
836
+ createVNode(A, {
831
837
  "model-value": unref(a).type,
832
- "onUpdate:modelValue": V[1] || (V[1] = (P) => c("type", P)),
838
+ "onUpdate:modelValue": E[1] || (E[1] = (M) => u("type", M)),
833
839
  placeholder: "Select discount type",
834
- items: h()
840
+ items: v()
835
841
  }, null, 8, ["model-value", "items"])
836
842
  ]),
837
- y(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_8$3, [
838
- createElementVNode("label", _hoisted_9$3, toDisplayString(B(unref(a).type)), 1),
839
- createVNode(T, {
843
+ y(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_8$7, [
844
+ createElementVNode("label", _hoisted_9$7, toDisplayString(x(unref(a).type)), 1),
845
+ createVNode(P, {
840
846
  modelValue: unref(a).value,
841
- "onUpdate:modelValue": V[2] || (V[2] = (P) => unref(a).value = P),
842
- placeholder: v(unref(a).type),
843
- suffix: f(unref(a).type),
847
+ "onUpdate:modelValue": E[2] || (E[2] = (M) => unref(a).value = M),
848
+ placeholder: f(unref(a).type),
849
+ suffix: g(unref(a).type),
844
850
  type: "number"
845
851
  }, null, 8, ["modelValue", "placeholder", "suffix"])
846
852
  ])) : createCommentVNode("", !0),
847
- C(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_10$3, [
848
- V[10] || (V[10] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount cap (optional)", -1)),
849
- createVNode(T, {
853
+ V(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_10$7, [
854
+ E[10] || (E[10] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount cap (optional)", -1)),
855
+ createVNode(P, {
850
856
  modelValue: unref(a).cap,
851
- "onUpdate:modelValue": V[3] || (V[3] = (P) => unref(a).cap = P),
857
+ "onUpdate:modelValue": E[3] || (E[3] = (M) => unref(a).cap = M),
852
858
  placeholder: "Maximum discount amount",
853
859
  type: "number"
854
860
  }, null, 8, ["modelValue"])
855
861
  ])) : createCommentVNode("", !0),
856
- E() ? (openBlock(), createElementBlock("div", _hoisted_11$1, [
857
- unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_12, [
858
- V[12] || (V[12] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Items", -1)),
859
- createElementVNode("div", _hoisted_13, [
860
- createElementVNode("div", _hoisted_14, [
861
- createElementVNode("div", _hoisted_15, [
862
- createVNode(O, {
862
+ $() ? (openBlock(), createElementBlock("div", _hoisted_11$5, [
863
+ unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_12$4, [
864
+ E[12] || (E[12] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Items", -1)),
865
+ createElementVNode("div", _hoisted_13$4, [
866
+ createElementVNode("div", _hoisted_14$4, [
867
+ createElementVNode("div", _hoisted_15$3, [
868
+ createVNode(h, {
863
869
  name: "restaurant",
864
870
  size: "md"
865
871
  }),
866
- createElementVNode("span", _hoisted_16, toDisplayString(x()), 1)
872
+ createElementVNode("span", _hoisted_16$2, toDisplayString(B()), 1)
867
873
  ]),
868
- createVNode($, {
874
+ createVNode(T, {
869
875
  variant: "secondary",
870
876
  label: "Select Items",
871
877
  icon: "chevron_right",
872
- onClick: N
878
+ onClick: w
873
879
  })
874
880
  ]),
875
- V[11] || (V[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))
881
+ 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))
876
882
  ])
877
883
  ])),
878
- createVNode(_sfc_main$n, {
884
+ createVNode(_sfc_main$t, {
879
885
  visible: unref(l),
880
- "initial-value": ((M = unref(a).scope) == null ? void 0 : M.objectIDs) || [],
881
- onConfirm: A,
882
- onCancel: G
886
+ "initial-value": ((S = unref(a).scope) == null ? void 0 : S.objectIDs) || [],
887
+ onConfirm: L,
888
+ onCancel: Y
883
889
  }, null, 8, ["visible", "initial-value"])
884
890
  ])) : createCommentVNode("", !0),
885
- S() ? (openBlock(), createElementBlock("div", _hoisted_17, [
886
- unref(o) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_18, [
887
- V[14] || (V[14] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Categories", -1)),
888
- createElementVNode("div", _hoisted_19, [
889
- createElementVNode("div", _hoisted_20, [
890
- createElementVNode("div", _hoisted_21, [
891
- createVNode(O, {
891
+ R() ? (openBlock(), createElementBlock("div", _hoisted_17$2, [
892
+ unref(n) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_18$2, [
893
+ E[14] || (E[14] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Categories", -1)),
894
+ createElementVNode("div", _hoisted_19$2, [
895
+ createElementVNode("div", _hoisted_20$2, [
896
+ createElementVNode("div", _hoisted_21$1, [
897
+ createVNode(h, {
892
898
  name: "category",
893
899
  size: "md"
894
900
  }),
895
- createElementVNode("span", _hoisted_22, toDisplayString(R()), 1)
901
+ createElementVNode("span", _hoisted_22, toDisplayString(D()), 1)
896
902
  ]),
897
- createVNode($, {
903
+ createVNode(T, {
898
904
  variant: "secondary",
899
905
  label: "Select Categories",
900
906
  icon: "chevron_right",
901
- onClick: w
907
+ onClick: O
902
908
  })
903
909
  ]),
904
- V[13] || (V[13] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. ", -1))
910
+ 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))
905
911
  ])
906
912
  ])),
907
- createVNode(_sfc_main$m, {
908
- visible: unref(o),
913
+ createVNode(_sfc_main$s, {
914
+ visible: unref(n),
909
915
  "initial-value": ((j = unref(a).scope) == null ? void 0 : j.objectIDs) || [],
910
- onConfirm: F,
911
- onCancel: Y
916
+ onConfirm: I,
917
+ onCancel: G
912
918
  }, null, 8, ["visible", "initial-value"])
913
919
  ])) : createCommentVNode("", !0)
914
920
  ]),
915
921
  unref(H).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23, [
916
922
  createElementVNode("div", _hoisted_24, [
917
- createVNode(O, { name: "warning" }),
918
- V[15] || (V[15] = createElementVNode("span", { class: "fm-typo-en-body-sm-600" }, "Please fix the following issues:", -1))
923
+ createVNode(h, { name: "warning" }),
924
+ E[15] || (E[15] = createElementVNode("span", { class: "fm-typo-en-body-sm-600" }, "Please fix the following issues:", -1))
919
925
  ]),
920
926
  createElementVNode("ul", _hoisted_25, [
921
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(H), (P) => (openBlock(), createElementBlock("li", {
922
- key: P,
927
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(H), (M) => (openBlock(), createElementBlock("li", {
928
+ key: M,
923
929
  class: "fm-typo-en-body-sm-400 text-fm-color-feedback-error-main flex items-start gap-8"
924
930
  }, [
925
- V[16] || (V[16] = createElementVNode("span", { class: "w-4 h-4 bg-fm-color-feedback-error-main rounded-full mt-6 flex-shrink-0" }, null, -1)),
926
- createTextVNode(" " + toDisplayString(P), 1)
931
+ 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)),
932
+ createTextVNode(" " + toDisplayString(M), 1)
927
933
  ]))), 128))
928
934
  ])
929
935
  ])) : createCommentVNode("", !0)
@@ -933,7 +939,7 @@ const _hoisted_1$l = {
933
939
  }, 8, ["modelValue"]);
934
940
  };
935
941
  }
936
- }), GrabEffectSheet = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-cf604dd7"]]), _hoisted_1$i = { class: "space-y-24" }, _sfc_main$k = /* @__PURE__ */ defineComponent({
942
+ }), GrabEffectSheet = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-cf604dd7"]]), _hoisted_1$o = { class: "space-y-24" }, _sfc_main$q = /* @__PURE__ */ defineComponent({
937
943
  __name: "TimeRuleGroup",
938
944
  props: {
939
945
  modelValue: {
@@ -944,52 +950,52 @@ const _hoisted_1$l = {
944
950
  },
945
951
  emits: ["update:model-value"],
946
952
  setup(e, { emit: s }) {
947
- const { t: n } = useI18n(), u = e, d = s, i = ref(
948
- !u.modelValue || !u.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(u.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
953
+ const { t: o } = useI18n(), d = e, c = s, i = ref(
954
+ !d.modelValue || !d.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(d.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
949
955
  );
950
- watch(i, async (o, a) => {
956
+ watch(i, async (n, a) => {
951
957
  var r;
952
- if (a == "custom" && o == "all_time" && RuleBuilder.getRules((r = u.modelValue) == null ? void 0 : r.rules.g_time).length > 0) {
958
+ if (a == "custom" && n == "all_time" && RuleBuilder.getRules((r = d.modelValue) == null ? void 0 : r.rules.g_time).length > 0) {
953
959
  const p = await prompt.confirm(
954
- n("connect.template.rule.time.confirm_remove"),
955
- n("connect.common.confirm"),
956
- n("connect.common.confirm"),
957
- n("connect.common.cancel")
960
+ o("connect.template.rule.time.confirm_remove"),
961
+ o("connect.common.confirm"),
962
+ o("connect.common.confirm"),
963
+ o("connect.common.cancel")
958
964
  );
959
- p && d(
965
+ p && c(
960
966
  "update:model-value",
961
967
  RuleBuilder.setRuleToGroup(
962
- u.modelValue ?? RuleBuilder.scaffoldGroup(),
968
+ d.modelValue ?? RuleBuilder.scaffoldGroup(),
963
969
  RuleBuilder.scaffoldGroup("g_time")
964
970
  )
965
- ), i.value = p ? o : a;
971
+ ), i.value = p ? n : a;
966
972
  }
967
973
  });
968
- async function l(o) {
974
+ async function l(n) {
969
975
  var a;
970
- if (o == "custom" && RuleBuilder.getRules((a = u.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
976
+ if (n == "custom" && RuleBuilder.getRules((a = d.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
971
977
  if (!await prompt.confirm(
972
- n("connect.template.rule.time.confirm_remove"),
973
- n("connect.common.confirm"),
974
- n("connect.common.confirm"),
975
- n("connect.common.cancel")
978
+ o("connect.template.rule.time.confirm_remove"),
979
+ o("connect.common.confirm"),
980
+ o("connect.common.confirm"),
981
+ o("connect.common.cancel")
976
982
  )) {
977
983
  i.value = "all_time";
978
984
  return;
979
985
  }
980
- d(
986
+ c(
981
987
  "update:model-value",
982
988
  RuleBuilder.setRuleToGroup(
983
- u.modelValue ?? RuleBuilder.scaffoldGroup(),
989
+ d.modelValue ?? RuleBuilder.scaffoldGroup(),
984
990
  RuleBuilder.scaffoldGroup("g_time")
985
991
  )
986
992
  );
987
993
  }
988
994
  }
989
- return (o, a) => {
990
- var h;
995
+ return (n, a) => {
996
+ var v;
991
997
  const r = resolveComponent("FmRadio"), p = resolveComponent("FmRadioGroup");
992
- return openBlock(), createElementBlock("div", _hoisted_1$i, [
998
+ return openBlock(), createElementBlock("div", _hoisted_1$o, [
993
999
  createVNode(p, {
994
1000
  modelValue: unref(i),
995
1001
  "onUpdate:modelValue": [
@@ -999,23 +1005,23 @@ const _hoisted_1$l = {
999
1005
  }, {
1000
1006
  default: withCtx(() => [
1001
1007
  createVNode(r, {
1002
- label: unref(n)("connect.template.rule.time.all_time"),
1008
+ label: unref(o)("connect.template.rule.time.all_time"),
1003
1009
  value: "all_time"
1004
1010
  }, null, 8, ["label"]),
1005
1011
  createVNode(r, {
1006
- label: unref(n)("connect.template.rule.time.custom"),
1012
+ label: unref(o)("connect.template.rule.time.custom"),
1007
1013
  value: "custom"
1008
1014
  }, null, 8, ["label"])
1009
1015
  ]),
1010
1016
  _: 1
1011
1017
  }, 8, ["modelValue"]),
1012
- unref(i) == "custom" ? (openBlock(), createBlock(_sfc_main$o, {
1018
+ unref(i) == "custom" ? (openBlock(), createBlock(_sfc_main$u, {
1013
1019
  key: 0,
1014
1020
  class: "!mt-[0px]",
1015
1021
  "include-only": "trigger",
1016
1022
  "trigger-type": "SCHEDULE",
1017
- "model-value": ((h = e.modelValue) == null ? void 0 : h.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
1018
- "onUpdate:modelValue": a[2] || (a[2] = (y) => d(
1023
+ "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
1024
+ "onUpdate:modelValue": a[2] || (a[2] = (y) => c(
1019
1025
  "update:model-value",
1020
1026
  unref(RuleBuilder).setRuleToGroup(
1021
1027
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
@@ -1027,7 +1033,7 @@ const _hoisted_1$l = {
1027
1033
  ]);
1028
1034
  };
1029
1035
  }
1030
- }), _sfc_main$j = /* @__PURE__ */ defineComponent({
1036
+ }), _sfc_main$p = /* @__PURE__ */ defineComponent({
1031
1037
  __name: "BirthdayInput",
1032
1038
  props: {
1033
1039
  modelValue: {
@@ -1036,28 +1042,28 @@ const _hoisted_1$l = {
1036
1042
  },
1037
1043
  emits: ["update:model-value"],
1038
1044
  setup(e, { emit: s }) {
1039
- const { t: n } = useI18n(), u = e, d = s, i = computed(() => {
1040
- const { property: l, operator: o, equator: a } = RuleBuilder.simplify(
1041
- u.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
1045
+ const { t: o } = useI18n(), d = e, c = s, i = computed(() => {
1046
+ const { property: l, operator: n, equator: a } = RuleBuilder.simplify(
1047
+ d.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
1042
1048
  op: "before",
1043
1049
  x: 1
1044
1050
  })
1045
1051
  );
1046
1052
  return {
1047
1053
  property: l,
1048
- operator: o,
1054
+ operator: n,
1049
1055
  equator: a
1050
1056
  };
1051
1057
  });
1052
- return (l, o) => {
1058
+ return (l, n) => {
1053
1059
  const a = resolveComponent("FmRadio"), r = resolveComponent("FmStepperField");
1054
1060
  return openBlock(), createElementBlock("div", null, [
1055
1061
  createVNode(a, {
1056
- label: unref(n)("connect.template.rule.birthday.on_birthday"),
1062
+ label: unref(o)("connect.template.rule.birthday.on_birthday"),
1057
1063
  value: "_isRange-day",
1058
1064
  "model-value": `${unref(i).operator}-${unref(i).equator.unit}`,
1059
- "onUpdate:modelValue": o[0] || (o[0] = () => {
1060
- d(
1065
+ "onUpdate:modelValue": n[0] || (n[0] = () => {
1066
+ c(
1061
1067
  "update:model-value",
1062
1068
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
1063
1069
  op: "this",
@@ -1068,11 +1074,11 @@ const _hoisted_1$l = {
1068
1074
  })
1069
1075
  }, null, 8, ["label", "model-value"]),
1070
1076
  createVNode(a, {
1071
- label: unref(n)("connect.template.rule.birthday.days_before"),
1077
+ label: unref(o)("connect.template.rule.birthday.days_before"),
1072
1078
  value: "_isDay",
1073
1079
  "model-value": unref(i).operator,
1074
- "onUpdate:modelValue": o[1] || (o[1] = () => {
1075
- d(
1080
+ "onUpdate:modelValue": n[1] || (n[1] = () => {
1081
+ c(
1076
1082
  "update:model-value",
1077
1083
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
1078
1084
  op: "after",
@@ -1084,10 +1090,10 @@ const _hoisted_1$l = {
1084
1090
  }, null, 8, ["label", "model-value"]),
1085
1091
  unref(i).operator == "_isDay" ? (openBlock(), createBlock(r, {
1086
1092
  key: 0,
1087
- label: unref(n)("connect.template.rule.birthday.days_before_label"),
1093
+ label: unref(o)("connect.template.rule.birthday.days_before_label"),
1088
1094
  "show-steppers": !1,
1089
1095
  "model-value": unref(i).equator.x,
1090
- "onUpdate:modelValue": o[2] || (o[2] = (p) => d(
1096
+ "onUpdate:modelValue": n[2] || (n[2] = (p) => c(
1091
1097
  "update:model-value",
1092
1098
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
1093
1099
  op: "after",
@@ -1097,11 +1103,11 @@ const _hoisted_1$l = {
1097
1103
  ))
1098
1104
  }, null, 8, ["label", "model-value"])) : createCommentVNode("", !0),
1099
1105
  createVNode(a, {
1100
- label: unref(n)("connect.template.rule.birthday.in_birthday_week"),
1106
+ label: unref(o)("connect.template.rule.birthday.in_birthday_week"),
1101
1107
  value: "_isRange-week",
1102
1108
  "model-value": `${unref(i).operator}-${unref(i).equator.unit}`,
1103
- "onUpdate:modelValue": o[3] || (o[3] = () => {
1104
- d(
1109
+ "onUpdate:modelValue": n[3] || (n[3] = () => {
1110
+ c(
1105
1111
  "update:model-value",
1106
1112
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
1107
1113
  op: "this",
@@ -1112,11 +1118,11 @@ const _hoisted_1$l = {
1112
1118
  })
1113
1119
  }, null, 8, ["label", "model-value"]),
1114
1120
  createVNode(a, {
1115
- label: unref(n)("connect.template.rule.birthday.in_birthday_month"),
1121
+ label: unref(o)("connect.template.rule.birthday.in_birthday_month"),
1116
1122
  value: "_isRange-month",
1117
1123
  "model-value": `${unref(i).operator}-${unref(i).equator.unit}`,
1118
- "onUpdate:modelValue": o[4] || (o[4] = () => {
1119
- d(
1124
+ "onUpdate:modelValue": n[4] || (n[4] = () => {
1125
+ c(
1120
1126
  "update:model-value",
1121
1127
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
1122
1128
  op: "this",
@@ -1129,7 +1135,7 @@ const _hoisted_1$l = {
1129
1135
  ]);
1130
1136
  };
1131
1137
  }
1132
- }), _hoisted_1$h = { class: "space-y-16" }, _hoisted_2$e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$b = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$a = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$7 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
1138
+ }), _hoisted_1$n = { class: "space-y-16" }, _hoisted_2$k = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$h = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$g = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$d = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$o = /* @__PURE__ */ defineComponent({
1133
1139
  __name: "CampaignTriggerInput",
1134
1140
  props: {
1135
1141
  campaignType: {
@@ -1146,30 +1152,30 @@ const _hoisted_1$l = {
1146
1152
  },
1147
1153
  emits: ["update:model-value"],
1148
1154
  setup(e, { emit: s }) {
1149
- const { t: n } = useI18n(), u = e, d = s, i = computed(() => u.disabled ? TypeToTriggerOptions[u.campaignType].filter(
1150
- (l) => l.value == u.modelValue
1151
- ) : TypeToTriggerOptions[u.campaignType]);
1152
- return (l, o) => {
1155
+ const { t: o } = useI18n(), d = e, c = s, i = computed(() => d.disabled ? TypeToTriggerOptions[d.campaignType].filter(
1156
+ (l) => l.value == d.modelValue
1157
+ ) : TypeToTriggerOptions[d.campaignType]);
1158
+ return (l, n) => {
1153
1159
  const a = resolveComponent("FmCard");
1154
- return openBlock(), createElementBlock("div", _hoisted_1$h, [
1155
- createElementVNode("div", _hoisted_2$e, toDisplayString(unref(n)("connect.campaign.trigger.description")), 1),
1156
- createElementVNode("div", _hoisted_3$b, [
1160
+ return openBlock(), createElementBlock("div", _hoisted_1$n, [
1161
+ createElementVNode("div", _hoisted_2$k, toDisplayString(unref(o)("connect.campaign.trigger.description")), 1),
1162
+ createElementVNode("div", _hoisted_3$h, [
1157
1163
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (r) => (openBlock(), createBlock(a, {
1158
1164
  variant: "outlined",
1159
- disabled: u.disabled,
1165
+ disabled: d.disabled,
1160
1166
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1161
1167
  "col-span-3": unref(i).length == 1,
1162
1168
  "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
1163
1169
  "hover:bg-fm-color-opacity-sm": e.modelValue != r.value
1164
1170
  }]),
1165
1171
  onClick: () => {
1166
- u.modelValue != r.value && !u.disabled && d("update:model-value", r.value);
1172
+ d.modelValue != r.value && !d.disabled && c("update:model-value", r.value);
1167
1173
  },
1168
1174
  key: r.name
1169
1175
  }, {
1170
1176
  default: withCtx(() => [
1171
- createElementVNode("div", _hoisted_4$a, toDisplayString(r.name), 1),
1172
- createElementVNode("div", _hoisted_5$7, toDisplayString(r.description), 1)
1177
+ createElementVNode("div", _hoisted_4$g, toDisplayString(r.name), 1),
1178
+ createElementVNode("div", _hoisted_5$d, toDisplayString(r.description), 1)
1173
1179
  ]),
1174
1180
  _: 2
1175
1181
  }, 1032, ["disabled", "class", "onClick"]))), 128))
@@ -1177,7 +1183,7 @@ const _hoisted_1$l = {
1177
1183
  ]);
1178
1184
  };
1179
1185
  }
1180
- }), _sfc_main$h = /* @__PURE__ */ defineComponent({
1186
+ }), _sfc_main$n = /* @__PURE__ */ defineComponent({
1181
1187
  __name: "DateInput",
1182
1188
  props: {
1183
1189
  label: {
@@ -1191,13 +1197,13 @@ const _hoisted_1$l = {
1191
1197
  },
1192
1198
  emits: ["update:model-value"],
1193
1199
  setup(e, { emit: s }) {
1194
- const n = s;
1195
- return (u, d) => {
1196
- const i = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
1197
- return openBlock(), createBlock(o, {
1200
+ const o = s;
1201
+ return (d, c) => {
1202
+ const i = resolveComponent("FmButton"), l = resolveComponent("FmField"), n = resolveComponent("FmDatePicker");
1203
+ return openBlock(), createBlock(n, {
1198
1204
  label: e.label,
1199
1205
  "model-value": e.modelValue || "",
1200
- "onUpdate:modelValue": d[1] || (d[1] = (a) => n("update:model-value", a))
1206
+ "onUpdate:modelValue": c[1] || (c[1] = (a) => o("update:model-value", a))
1201
1207
  }, {
1202
1208
  "trigger-button": withCtx(({ opened: a }) => [
1203
1209
  createVNode(l, {
@@ -1210,7 +1216,7 @@ const _hoisted_1$l = {
1210
1216
  key: 0,
1211
1217
  variant: "tertiary",
1212
1218
  icon: "clear",
1213
- onClick: d[0] || (d[0] = (r) => (r.stopPropagation(), n("update:model-value", null)))
1219
+ onClick: c[0] || (c[0] = (r) => (r.stopPropagation(), o("update:model-value", null)))
1214
1220
  })) : createCommentVNode("", !0)
1215
1221
  ]),
1216
1222
  default: withCtx(() => [
@@ -1225,7 +1231,7 @@ const _hoisted_1$l = {
1225
1231
  }, 8, ["label", "model-value"]);
1226
1232
  };
1227
1233
  }
1228
- }), _hoisted_1$g = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$d = { class: "flex-1 xs:w-full" }, _hoisted_3$a = { class: "mt-5 xs:hidden" }, _hoisted_4$9 = { class: "flex-1 xs:w-full" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
1234
+ }), _hoisted_1$m = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$j = { class: "flex-1 xs:w-full" }, _hoisted_3$g = { class: "mt-5 xs:hidden" }, _hoisted_4$f = { class: "flex-1 xs:w-full" }, _sfc_main$m = /* @__PURE__ */ defineComponent({
1229
1235
  __name: "DateRangeInput",
1230
1236
  props: {
1231
1237
  modelValue: {
@@ -1235,31 +1241,31 @@ const _hoisted_1$l = {
1235
1241
  },
1236
1242
  emits: ["update:model-value"],
1237
1243
  setup(e, { emit: s }) {
1238
- const { t: n } = useI18n(), u = s;
1239
- return (d, i) => {
1240
- var l, o;
1241
- return openBlock(), createElementBlock("div", _hoisted_1$g, [
1242
- createElementVNode("div", _hoisted_2$d, [
1243
- createVNode(_sfc_main$h, {
1244
+ const { t: o } = useI18n(), d = s;
1245
+ return (c, i) => {
1246
+ var l, n;
1247
+ return openBlock(), createElementBlock("div", _hoisted_1$m, [
1248
+ createElementVNode("div", _hoisted_2$j, [
1249
+ createVNode(_sfc_main$n, {
1244
1250
  "model-value": ((l = e.modelValue) == null ? void 0 : l.startDate) ?? null,
1245
- label: unref(n)("connect.common.startDate"),
1251
+ label: unref(o)("connect.common.startDate"),
1246
1252
  "onUpdate:modelValue": i[0] || (i[0] = (a) => {
1247
1253
  var r;
1248
- return u("update:model-value", {
1254
+ return d("update:model-value", {
1249
1255
  startDate: a,
1250
1256
  endDate: ((r = e.modelValue) == null ? void 0 : r.endDate) ?? null
1251
1257
  });
1252
1258
  })
1253
1259
  }, null, 8, ["model-value", "label"])
1254
1260
  ]),
1255
- createElementVNode("div", _hoisted_3$a, toDisplayString(unref(n)("connect.common.to")), 1),
1256
- createElementVNode("div", _hoisted_4$9, [
1257
- createVNode(_sfc_main$h, {
1258
- "model-value": ((o = e.modelValue) == null ? void 0 : o.endDate) ?? null,
1259
- label: unref(n)("connect.common.endDate"),
1261
+ createElementVNode("div", _hoisted_3$g, toDisplayString(unref(o)("connect.common.to")), 1),
1262
+ createElementVNode("div", _hoisted_4$f, [
1263
+ createVNode(_sfc_main$n, {
1264
+ "model-value": ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null,
1265
+ label: unref(o)("connect.common.endDate"),
1260
1266
  "onUpdate:modelValue": i[1] || (i[1] = (a) => {
1261
1267
  var r;
1262
- return u("update:model-value", {
1268
+ return d("update:model-value", {
1263
1269
  startDate: ((r = e.modelValue) == null ? void 0 : r.startDate) ?? null,
1264
1270
  endDate: a
1265
1271
  });
@@ -1269,6 +1275,801 @@ const _hoisted_1$l = {
1269
1275
  ]);
1270
1276
  };
1271
1277
  }
1278
+ }), _hoisted_1$l = { class: "flex flex-col gap-16" }, _hoisted_2$i = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_3$f = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_4$e = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_5$c = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_6$9 = { class: "flex items-center justify-between gap-8" }, _hoisted_7$8 = { class: "fm-typo-en-body-lg-400" }, _hoisted_8$6 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_9$6 = { class: "flex flex-col gap-8" }, _hoisted_10$6 = { class: "flex items-baseline justify-between" }, _hoisted_11$4 = { class: "fm-typo-en-body-lg-400" }, _hoisted_12$3 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_13$3 = { class: "min-w-[160px] flex-1" }, _hoisted_14$3 = { class: "min-w-[180px] flex-1" }, TITLE_LIMIT$1 = 40, PREVIEW_LIMIT = 120, MAX_BUTTONS = 2, TITLE_WARN_AT$1 = 34, PREVIEW_WARN_AT = 110, _sfc_main$l = /* @__PURE__ */ defineComponent({
1279
+ __name: "AppInboxInput",
1280
+ props: {
1281
+ modelValue: {
1282
+ type: Object,
1283
+ required: !0
1284
+ },
1285
+ variables: {
1286
+ type: Array,
1287
+ default: () => [...DEFAULT_MESSAGE_VARIABLES]
1288
+ }
1289
+ },
1290
+ emits: ["update:model-value"],
1291
+ setup(e, { emit: s }) {
1292
+ const { t: o } = useI18n(), d = e, c = s, i = F_APP_INBOX_DESTINATION.options;
1293
+ function l(V) {
1294
+ c("update:model-value", { ...d.modelValue, ...V });
1295
+ }
1296
+ function n(V, x) {
1297
+ return V >= x ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
1298
+ }
1299
+ const a = computed(() => d.modelValue.buttons ?? []), r = computed(() => {
1300
+ var V;
1301
+ return ((V = d.modelValue.content) == null ? void 0 : V.length) ?? 0;
1302
+ });
1303
+ function p(V, x) {
1304
+ l({
1305
+ buttons: a.value.map(
1306
+ (f, g) => g === V ? { ...f, ...x } : f
1307
+ )
1308
+ });
1309
+ }
1310
+ function v() {
1311
+ a.value.length >= MAX_BUTTONS || l({ buttons: [...a.value, { label: "", destination: "NONE" }] });
1312
+ }
1313
+ function y(V) {
1314
+ l({ buttons: a.value.filter((x, f) => f !== V) });
1315
+ }
1316
+ return (V, x) => {
1317
+ const f = resolveComponent("FmTextField"), g = resolveComponent("FmSelect"), u = resolveComponent("FmButton");
1318
+ return openBlock(), createElementBlock("div", _hoisted_1$l, [
1319
+ createElementVNode("div", null, [
1320
+ createElementVNode("div", _hoisted_2$i, [
1321
+ createElementVNode("span", _hoisted_3$f, toDisplayString(unref(o)("connect.campaign.appInbox.title")), 1),
1322
+ createElementVNode("span", {
1323
+ class: normalizeClass(["fm-typo-en-body-sm-400", n(e.modelValue.title.length, TITLE_WARN_AT$1)])
1324
+ }, toDisplayString(e.modelValue.title.length) + " / " + toDisplayString(TITLE_LIMIT$1), 3)
1325
+ ]),
1326
+ createVNode(f, {
1327
+ "model-value": e.modelValue.title,
1328
+ "max-length": TITLE_LIMIT$1,
1329
+ placeholder: unref(o)("connect.campaign.appInbox.titlePlaceholder"),
1330
+ "onUpdate:modelValue": x[0] || (x[0] = (m) => l({ title: m }))
1331
+ }, null, 8, ["model-value", "placeholder"])
1332
+ ]),
1333
+ createElementVNode("div", null, [
1334
+ createElementVNode("div", _hoisted_4$e, [
1335
+ createElementVNode("span", _hoisted_5$c, toDisplayString(unref(o)("connect.campaign.appInbox.previewText")), 1),
1336
+ createElementVNode("span", {
1337
+ class: normalizeClass(["fm-typo-en-body-sm-400", n(e.modelValue.previewText.length, PREVIEW_WARN_AT)])
1338
+ }, toDisplayString(e.modelValue.previewText.length) + " / " + toDisplayString(PREVIEW_LIMIT), 3)
1339
+ ]),
1340
+ createVNode(f, {
1341
+ "model-value": e.modelValue.previewText,
1342
+ "max-length": PREVIEW_LIMIT,
1343
+ placeholder: unref(o)("connect.campaign.appInbox.previewTextPlaceholder"),
1344
+ "onUpdate:modelValue": x[1] || (x[1] = (m) => l({ previewText: m }))
1345
+ }, null, 8, ["model-value", "placeholder"])
1346
+ ]),
1347
+ createElementVNode("div", _hoisted_6$9, [
1348
+ createElementVNode("div", null, [
1349
+ createElementVNode("div", _hoisted_7$8, toDisplayString(unref(o)("connect.campaign.appInbox.bodyMessage")), 1),
1350
+ createElementVNode("div", _hoisted_8$6, toDisplayString(unref(o)("connect.campaign.appInbox.bodyMessageDescription")), 1),
1351
+ createElementVNode("div", {
1352
+ class: normalizeClass([
1353
+ "mt-[2px] fm-typo-en-body-sm-400",
1354
+ unref(r) > unref(APP_INBOX_BODY_LIMIT) ? "text-fm-color-system-error-400" : "text-fm-color-typo-secondary"
1355
+ ])
1356
+ }, toDisplayString(unref(r)) + " / " + toDisplayString(unref(APP_INBOX_BODY_LIMIT)), 3)
1357
+ ]),
1358
+ createVNode(_sfc_main$v, {
1359
+ html: e.modelValue.content,
1360
+ variables: e.variables,
1361
+ "media-limit": 1,
1362
+ "button-label": unref(o)("connect.campaign.appInbox.editBodyMessage"),
1363
+ "onUpdate:html": x[2] || (x[2] = (m) => l({ content: m.html }))
1364
+ }, null, 8, ["html", "variables", "button-label"])
1365
+ ]),
1366
+ createElementVNode("div", _hoisted_9$6, [
1367
+ createElementVNode("div", _hoisted_10$6, [
1368
+ createElementVNode("span", _hoisted_11$4, toDisplayString(unref(o)("connect.campaign.appInbox.buttons")), 1),
1369
+ createElementVNode("span", _hoisted_12$3, toDisplayString(unref(a).length) + " / " + toDisplayString(MAX_BUTTONS), 1)
1370
+ ]),
1371
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (m, C) => (openBlock(), createElementBlock("div", {
1372
+ key: C,
1373
+ class: "flex flex-wrap items-start gap-8"
1374
+ }, [
1375
+ createElementVNode("div", _hoisted_13$3, [
1376
+ createVNode(f, {
1377
+ "model-value": m.label,
1378
+ placeholder: unref(o)("connect.campaign.appInbox.buttonLabel"),
1379
+ "onUpdate:modelValue": (k) => p(C, { label: k })
1380
+ }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])
1381
+ ]),
1382
+ createElementVNode("div", _hoisted_14$3, [
1383
+ createVNode(g, {
1384
+ "model-value": m.destination,
1385
+ items: unref(i).map((k) => ({
1386
+ label: unref(o)(`connect.campaign.appInbox.destination.${k}`),
1387
+ value: k
1388
+ })),
1389
+ "onUpdate:modelValue": (k) => p(C, { destination: k })
1390
+ }, null, 8, ["model-value", "items", "onUpdate:modelValue"])
1391
+ ]),
1392
+ createVNode(u, {
1393
+ icon: "delete",
1394
+ "icon-color": "neutral-gray-400",
1395
+ variant: "tertiary",
1396
+ onClick: (k) => y(C)
1397
+ }, null, 8, ["onClick"])
1398
+ ]))), 128)),
1399
+ unref(a).length < MAX_BUTTONS ? (openBlock(), createBlock(u, {
1400
+ key: 0,
1401
+ variant: "tertiary",
1402
+ icon: "add",
1403
+ label: unref(o)("connect.campaign.appInbox.addButton"),
1404
+ onClick: v
1405
+ }, null, 8, ["label"])) : createCommentVNode("", !0)
1406
+ ])
1407
+ ]);
1408
+ };
1409
+ }
1410
+ }), _hoisted_1$k = { class: "flex flex-col gap-16" }, _hoisted_2$h = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_3$e = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_4$d = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_5$b = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_6$8 = { class: "mb-[6px] fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_7$7 = { class: "mt-4 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, TITLE_LIMIT = 40, BODY_LIMIT = 120, TITLE_WARN_AT = 34, BODY_WARN_AT = 110, _sfc_main$k = /* @__PURE__ */ defineComponent({
1411
+ __name: "PushInput",
1412
+ props: {
1413
+ modelValue: {
1414
+ type: Object,
1415
+ required: !0
1416
+ }
1417
+ },
1418
+ emits: ["update:model-value"],
1419
+ setup(e, { emit: s }) {
1420
+ const { t: o } = useI18n(), d = e, c = s, i = F_APP_INBOX_DESTINATION.options;
1421
+ function l(a) {
1422
+ c("update:model-value", { ...d.modelValue, ...a });
1423
+ }
1424
+ function n(a, r) {
1425
+ return a >= r ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
1426
+ }
1427
+ return (a, r) => {
1428
+ const p = resolveComponent("FmTextField"), v = resolveComponent("FmTextarea"), y = resolveComponent("FmSelect");
1429
+ return openBlock(), createElementBlock("div", _hoisted_1$k, [
1430
+ createElementVNode("div", null, [
1431
+ createElementVNode("div", _hoisted_2$h, [
1432
+ createElementVNode("span", _hoisted_3$e, toDisplayString(unref(o)("connect.campaign.push.title")), 1),
1433
+ createElementVNode("span", {
1434
+ class: normalizeClass(["fm-typo-en-body-sm-400", n(e.modelValue.title.length, TITLE_WARN_AT)])
1435
+ }, toDisplayString(e.modelValue.title.length) + " / " + toDisplayString(TITLE_LIMIT), 3)
1436
+ ]),
1437
+ createVNode(p, {
1438
+ "model-value": e.modelValue.title,
1439
+ "max-length": TITLE_LIMIT,
1440
+ placeholder: unref(o)("connect.campaign.push.titlePlaceholder"),
1441
+ "onUpdate:modelValue": r[0] || (r[0] = (V) => l({ title: V }))
1442
+ }, null, 8, ["model-value", "placeholder"])
1443
+ ]),
1444
+ createElementVNode("div", null, [
1445
+ createElementVNode("div", _hoisted_4$d, [
1446
+ createElementVNode("span", _hoisted_5$b, toDisplayString(unref(o)("connect.campaign.push.body")), 1),
1447
+ createElementVNode("span", {
1448
+ class: normalizeClass(["fm-typo-en-body-sm-400", n(e.modelValue.body.length, BODY_WARN_AT)])
1449
+ }, toDisplayString(e.modelValue.body.length) + " / " + toDisplayString(BODY_LIMIT), 3)
1450
+ ]),
1451
+ createVNode(v, {
1452
+ "model-value": e.modelValue.body,
1453
+ "max-length": BODY_LIMIT,
1454
+ placeholder: unref(o)("connect.campaign.push.bodyPlaceholder"),
1455
+ "onUpdate:modelValue": r[1] || (r[1] = (V) => l({ body: V }))
1456
+ }, null, 8, ["model-value", "placeholder"])
1457
+ ]),
1458
+ createElementVNode("div", null, [
1459
+ createElementVNode("div", _hoisted_6$8, toDisplayString(unref(o)("connect.campaign.push.link")), 1),
1460
+ createVNode(y, {
1461
+ "model-value": e.modelValue.destination ?? "NONE",
1462
+ items: unref(i).map((V) => ({
1463
+ label: unref(o)(`connect.campaign.appInbox.destination.${V}`),
1464
+ value: V
1465
+ })),
1466
+ "onUpdate:modelValue": r[2] || (r[2] = (V) => l({ destination: V }))
1467
+ }, null, 8, ["model-value", "items"]),
1468
+ createElementVNode("div", _hoisted_7$7, toDisplayString(unref(o)("connect.campaign.push.linkHelper")), 1)
1469
+ ])
1470
+ ]);
1471
+ };
1472
+ }
1473
+ }), _hoisted_1$j = { class: "flex items-stretch overflow-x-auto pb-4" }, _hoisted_2$g = {
1474
+ key: 0,
1475
+ class: "flex flex-none items-center px-8 fm-typo-en-body-lg-600 text-fm-color-neutral-gray-300",
1476
+ "aria-hidden": "true"
1477
+ }, _hoisted_3$d = ["aria-current", "onClick"], _hoisted_4$c = { class: "flex items-center gap-[6px]" }, _hoisted_5$a = ["title"], _hoisted_6$7 = { class: "mt-[3px] block text-[11px] leading-[1.3] text-fm-color-typo-secondary" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
1478
+ __name: "ChannelContentTabs",
1479
+ props: {
1480
+ tabs: {},
1481
+ modelValue: {}
1482
+ },
1483
+ emits: ["update:model-value"],
1484
+ setup(e) {
1485
+ const { t: s } = useI18n();
1486
+ return (o, d) => (openBlock(), createElementBlock("div", _hoisted_1$j, [
1487
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(e.tabs, (c) => (openBlock(), createElementBlock("div", {
1488
+ key: c.key,
1489
+ class: "flex flex-none items-center"
1490
+ }, [
1491
+ c.connector ? (openBlock(), createElementBlock("span", _hoisted_2$g, toDisplayString(c.connector), 1)) : createCommentVNode("", !0),
1492
+ createElementVNode("button", {
1493
+ type: "button",
1494
+ class: normalizeClass([
1495
+ "min-w-[132px] flex-none rounded-[10px] border px-[14px] py-[10px] text-left transition-colors",
1496
+ e.modelValue === c.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"
1497
+ ]),
1498
+ "aria-current": e.modelValue === c.key ? "true" : void 0,
1499
+ onClick: (i) => o.$emit("update:model-value", c.key)
1500
+ }, [
1501
+ createElementVNode("span", _hoisted_4$c, [
1502
+ c.step ? (openBlock(), createElementBlock("span", {
1503
+ key: 0,
1504
+ class: normalizeClass([
1505
+ "flex h-[18px] w-[18px] flex-none items-center justify-center rounded-full text-[10.5px] font-semibold leading-[18px]",
1506
+ e.modelValue === c.key ? "bg-fm-color-primary text-fm-color-typo-white" : "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary"
1507
+ ])
1508
+ }, toDisplayString(c.step), 3)) : createCommentVNode("", !0),
1509
+ createElementVNode("span", {
1510
+ class: normalizeClass([
1511
+ "truncate text-[12.5px] font-semibold leading-[1.3]",
1512
+ e.modelValue === c.key ? "text-fm-color-primary" : "text-fm-color-typo-primary"
1513
+ ])
1514
+ }, toDisplayString(c.label), 3),
1515
+ c.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", {
1516
+ key: 1,
1517
+ class: "h-[7px] w-[7px] flex-none rounded-full bg-fm-color-system-error-400",
1518
+ title: unref(s)("connect.campaign.broadcast.messageMissing")
1519
+ }, null, 8, _hoisted_5$a))
1520
+ ]),
1521
+ createElementVNode("span", _hoisted_6$7, toDisplayString(c.sub), 1)
1522
+ ], 10, _hoisted_3$d)
1523
+ ]))), 128))
1524
+ ]));
1525
+ }
1526
+ }), _hoisted_1$i = {
1527
+ key: 0,
1528
+ class: "flex w-[264px] shrink-0 flex-col gap-8"
1529
+ }, _hoisted_2$f = { class: "fm-typo-en-body-md-600" }, _hoisted_3$c = { class: "flex justify-center py-8" }, _hoisted_4$b = {
1530
+ key: 0,
1531
+ class: "px-12 pb-16 pt-16"
1532
+ }, _hoisted_5$9 = { class: "mb-12 text-center text-[11px] text-[rgba(255,255,255,0.6)]" }, _hoisted_6$6 = { class: "rounded-[14px] border border-[rgba(255,255,255,0.12)] bg-[rgba(255,255,255,0.14)] p-12 backdrop-blur" }, _hoisted_7$6 = { class: "fm-typo-en-body-md-600 text-fm-color-typo-white line-clamp-2" }, _hoisted_8$5 = { class: "mt-[2px] fm-typo-en-body-sm-400 text-[rgba(255,255,255,0.72)] line-clamp-3" }, _hoisted_9$5 = {
1533
+ key: 1,
1534
+ class: "px-12 pb-16"
1535
+ }, _hoisted_10$5 = { class: "fm-typo-en-body-md-600 mb-8" }, _hoisted_11$3 = { class: "rounded-[12px] border border-fm-color-neutral-gray-100 p-12" }, _hoisted_12$2 = { class: "fm-typo-en-body-md-600 line-clamp-2" }, _hoisted_13$2 = { class: "mt-[2px] fm-typo-en-body-sm-400 text-fm-color-typo-secondary line-clamp-3" }, _hoisted_14$2 = ["src"], _hoisted_15$2 = ["srcdoc", "title"], _hoisted_16$1 = {
1536
+ key: 2,
1537
+ class: "mt-12 flex flex-col gap-[6px]"
1538
+ }, _hoisted_17$1 = {
1539
+ key: 2,
1540
+ class: "px-12 pb-16"
1541
+ }, _hoisted_18$1 = { class: "fm-typo-en-body-md-600 mb-8" }, _hoisted_19$1 = { class: "whitespace-pre-wrap break-words rounded-[12px] bg-fm-color-neutral-gray-100 p-12 fm-typo-en-body-sm-400" }, _hoisted_20$1 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
1542
+ __name: "ChannelPreview",
1543
+ props: {
1544
+ target: {},
1545
+ content: {},
1546
+ senderPrefix: {}
1547
+ },
1548
+ setup(e) {
1549
+ const { t: s } = useI18n(), o = e, d = computed(
1550
+ () => o.target === "PUSH" ? o.content : void 0
1551
+ ), c = computed(
1552
+ () => o.target === "APP_INBOX" ? o.content : void 0
1553
+ ), i = computed(
1554
+ () => o.target === "SMS" || o.target === "WHATSAPP" ? o.content : void 0
1555
+ ), l = computed(() => {
1556
+ var v, y;
1557
+ const p = (y = (v = i.value) == null ? void 0 : v.content) == null ? void 0 : y.trim();
1558
+ return p ? o.senderPrefix ? `${o.senderPrefix}${p}` : p : s("connect.campaign.broadcast.preview.emptyText");
1559
+ }), n = computed(() => {
1560
+ var v;
1561
+ const p = ((v = c.value) == null ? void 0 : v.content) ?? "";
1562
+ return p.trim() ? `<!doctype html><meta charset="utf-8"><base target="_blank"><style>
1563
+ html,body{margin:0;font:400 12px/1.5 Inter,system-ui,sans-serif;color:#1C1C1E;word-break:break-word}
1564
+ img{max-width:100%;height:auto}
1565
+ </style>${p}` : "";
1566
+ }), a = computed(() => {
1567
+ const p = /* @__PURE__ */ new Date(), v = p.toLocaleDateString(void 0, {
1568
+ weekday: "short",
1569
+ day: "2-digit",
1570
+ month: "short"
1571
+ }), y = p.toLocaleTimeString(void 0, {
1572
+ hour: "2-digit",
1573
+ minute: "2-digit"
1574
+ });
1575
+ return `${v} · ${y}`;
1576
+ }), 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"));
1577
+ return (p, v) => {
1578
+ var y, V, x, f, g, u, m, C, k, $, R;
1579
+ return e.target !== "EMAIL" ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
1580
+ createElementVNode("div", _hoisted_2$f, toDisplayString(unref(s)("connect.campaign.broadcast.preview.title")), 1),
1581
+ createElementVNode("div", {
1582
+ class: normalizeClass([
1583
+ "overflow-hidden rounded-[22px] border border-fm-color-neutral-gray-100",
1584
+ e.target === "PUSH" ? "bg-fm-color-neutral-black" : "bg-fm-color-neutral-white"
1585
+ ])
1586
+ }, [
1587
+ createElementVNode("div", _hoisted_3$c, [
1588
+ createElementVNode("div", {
1589
+ class: normalizeClass([
1590
+ "h-4 w-40 rounded-full",
1591
+ e.target === "PUSH" ? "bg-fm-color-neutral-gray-400" : "bg-fm-color-neutral-gray-100"
1592
+ ])
1593
+ }, null, 2)
1594
+ ]),
1595
+ e.target === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_4$b, [
1596
+ createElementVNode("div", _hoisted_5$9, toDisplayString(unref(a)), 1),
1597
+ createElementVNode("div", _hoisted_6$6, [
1598
+ createElementVNode("div", _hoisted_7$6, toDisplayString(((V = (y = unref(d)) == null ? void 0 : y.title) == null ? void 0 : V.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyTitle")), 1),
1599
+ createElementVNode("div", _hoisted_8$5, toDisplayString(((f = (x = unref(d)) == null ? void 0 : x.body) == null ? void 0 : f.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyBody")), 1)
1600
+ ])
1601
+ ])) : e.target === "APP_INBOX" ? (openBlock(), createElementBlock("div", _hoisted_9$5, [
1602
+ createElementVNode("div", _hoisted_10$5, toDisplayString(unref(s)("connect.campaign.broadcast.preview.inboxHeading")), 1),
1603
+ createElementVNode("div", _hoisted_11$3, [
1604
+ createElementVNode("div", _hoisted_12$2, toDisplayString(((u = (g = unref(c)) == null ? void 0 : g.title) == null ? void 0 : u.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyTitle")), 1),
1605
+ createElementVNode("div", _hoisted_13$2, toDisplayString(((C = (m = unref(c)) == null ? void 0 : m.previewText) == null ? void 0 : C.trim()) || unref(s)("connect.campaign.broadcast.preview.emptyBody")), 1),
1606
+ (k = unref(c)) != null && k.imageUrl ? (openBlock(), createElementBlock("img", {
1607
+ key: 0,
1608
+ src: unref(c).imageUrl,
1609
+ alt: "",
1610
+ class: "mt-8 w-full rounded-[8px]"
1611
+ }, null, 8, _hoisted_14$2)) : createCommentVNode("", !0),
1612
+ unref(n) ? (openBlock(), createElementBlock("iframe", {
1613
+ key: 1,
1614
+ srcdoc: unref(n),
1615
+ sandbox: "",
1616
+ referrerpolicy: "no-referrer",
1617
+ class: "mt-8 h-[120px] w-full border-0",
1618
+ title: unref(s)("connect.campaign.broadcast.preview.bodyFrameTitle")
1619
+ }, null, 8, _hoisted_15$2)) : createCommentVNode("", !0),
1620
+ (R = ($ = unref(c)) == null ? void 0 : $.buttons) != null && R.length ? (openBlock(), createElementBlock("div", _hoisted_16$1, [
1621
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c).buttons, (B, D) => (openBlock(), createElementBlock("div", {
1622
+ key: D,
1623
+ class: "rounded-[8px] bg-fm-color-primary px-12 py-8 text-center fm-typo-en-body-sm-400 text-fm-color-typo-white"
1624
+ }, toDisplayString(B.label || unref(s)("connect.campaign.appInbox.buttonLabel")), 1))), 128))
1625
+ ])) : createCommentVNode("", !0)
1626
+ ])
1627
+ ])) : (openBlock(), createElementBlock("div", _hoisted_17$1, [
1628
+ createElementVNode("div", _hoisted_18$1, toDisplayString(unref(s)(`connect.campaign.broadcast.channel.${e.target}`)), 1),
1629
+ createElementVNode("div", _hoisted_19$1, toDisplayString(unref(l)), 1)
1630
+ ]))
1631
+ ], 2),
1632
+ createElementVNode("div", _hoisted_20$1, toDisplayString(unref(r)), 1)
1633
+ ])) : createCommentVNode("", !0);
1634
+ };
1635
+ }
1636
+ }), _hoisted_1$h = { class: "flex flex-col gap-12 pt-8" }, _hoisted_2$e = { class: "flex flex-wrap items-baseline justify-between gap-16" }, _hoisted_3$b = { class: "fm-typo-en-body-lg-600" }, _hoisted_4$a = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_5$8 = { class: "h-24 w-24 flex-none rounded-full bg-fm-color-neutral-gray-100 text-center fm-typo-en-body-sm-400 leading-[24px]" }, _hoisted_6$5 = { class: "min-w-0 flex-1" }, _hoisted_7$5 = { class: "flex flex-wrap items-center gap-[10px]" }, _hoisted_8$4 = { class: "fm-typo-en-body-md-600" }, _hoisted_9$4 = {
1637
+ key: 0,
1638
+ class: "inline-flex items-center gap-[5px] fm-typo-en-body-sm-400 text-fm-color-system-error-400"
1639
+ }, _hoisted_10$4 = { class: "ml-auto flex flex-none items-center gap-[2px] border-l border-fm-color-neutral-gray-100 pl-4" }, _hoisted_11$2 = ["title"], _hoisted_12$1 = ["title"], _hoisted_13$1 = ["title"], _hoisted_14$1 = {
1640
+ type: "button",
1641
+ class: "w-full rounded-[8px] border-2 border-dashed border-fm-color-neutral-gray-200 p-[20px] fm-typo-en-body-lg-600 text-fm-color-typo-secondary transition-colors hover:border-fm-color-primary hover:text-fm-color-primary"
1642
+ }, _hoisted_15$1 = {
1643
+ key: 1,
1644
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1645
+ }, _sfc_main$h = /* @__PURE__ */ defineComponent({
1646
+ __name: "FallbackChannelList",
1647
+ props: {
1648
+ rows: {},
1649
+ addable: {}
1650
+ },
1651
+ emits: ["move", "remove", "add"],
1652
+ setup(e) {
1653
+ const { t: s } = useI18n(), o = e, d = computed(() => o.addable.length > 0);
1654
+ return (c, i) => {
1655
+ const l = resolveComponent("FmButton"), n = resolveComponent("FmMenuItem"), a = resolveComponent("FmMenu");
1656
+ return openBlock(), createElementBlock("div", _hoisted_1$h, [
1657
+ createElementVNode("div", _hoisted_2$e, [
1658
+ createElementVNode("span", _hoisted_3$b, toDisplayString(unref(s)("connect.campaign.broadcast.fallbackChannels")), 1),
1659
+ createElementVNode("span", _hoisted_4$a, toDisplayString(unref(s)("connect.campaign.broadcast.fallbackChannelsHint")), 1)
1660
+ ]),
1661
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(e.rows, (r, p) => (openBlock(), createElementBlock("div", {
1662
+ key: r.channel,
1663
+ class: "flex flex-wrap items-center gap-12 rounded-[8px] border border-fm-color-neutral-gray-100 px-16 py-[14px]"
1664
+ }, [
1665
+ createElementVNode("span", _hoisted_5$8, toDisplayString(r.position), 1),
1666
+ createElementVNode("span", _hoisted_6$5, [
1667
+ createElementVNode("span", _hoisted_7$5, [
1668
+ createElementVNode("span", _hoisted_8$4, toDisplayString(r.label), 1),
1669
+ r.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", _hoisted_9$4, [
1670
+ i[0] || (i[0] = createElementVNode("span", { class: "h-[6px] w-[6px] rounded-full bg-fm-color-system-error-400" }, null, -1)),
1671
+ createTextVNode(" " + toDisplayString(unref(s)("connect.campaign.broadcast.messageMissing")), 1)
1672
+ ]))
1673
+ ])
1674
+ ]),
1675
+ createElementVNode("span", _hoisted_10$4, [
1676
+ createElementVNode("span", {
1677
+ title: unref(s)("connect.campaign.broadcast.moveUp"),
1678
+ class: "flex"
1679
+ }, [
1680
+ createVNode(l, {
1681
+ icon: "arrow_upward",
1682
+ "icon-color": "neutral-gray-400",
1683
+ variant: "tertiary",
1684
+ onClick: (v) => c.$emit("move", r.channel, -1)
1685
+ }, null, 8, ["onClick"])
1686
+ ], 8, _hoisted_11$2),
1687
+ createElementVNode("span", {
1688
+ title: unref(s)("connect.campaign.broadcast.moveDown"),
1689
+ class: "flex"
1690
+ }, [
1691
+ createVNode(l, {
1692
+ icon: "arrow_downward",
1693
+ "icon-color": "neutral-gray-400",
1694
+ variant: "tertiary",
1695
+ disabled: p === e.rows.length - 1,
1696
+ onClick: (v) => c.$emit("move", r.channel, 1)
1697
+ }, null, 8, ["disabled", "onClick"])
1698
+ ], 8, _hoisted_12$1),
1699
+ createElementVNode("span", {
1700
+ title: unref(s)("connect.campaign.broadcast.removeChannel"),
1701
+ class: "flex"
1702
+ }, [
1703
+ createVNode(l, {
1704
+ icon: "delete",
1705
+ "icon-color": "neutral-gray-400",
1706
+ variant: "tertiary",
1707
+ onClick: (v) => c.$emit("remove", r.channel)
1708
+ }, null, 8, ["onClick"])
1709
+ ], 8, _hoisted_13$1)
1710
+ ])
1711
+ ]))), 128)),
1712
+ unref(d) ? (openBlock(), createBlock(a, {
1713
+ key: 0,
1714
+ placement: "bottom-start"
1715
+ }, {
1716
+ "menu-button": withCtx(() => [
1717
+ createElementVNode("button", _hoisted_14$1, " + " + toDisplayString(unref(s)("connect.campaign.broadcast.addFallbackChannel")), 1)
1718
+ ]),
1719
+ default: withCtx(() => [
1720
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(e.addable, (r) => (openBlock(), createBlock(n, {
1721
+ key: r.channel,
1722
+ label: r.label,
1723
+ onClick: (p) => c.$emit("add", r.channel)
1724
+ }, null, 8, ["label", "onClick"]))), 128))
1725
+ ]),
1726
+ _: 1
1727
+ })) : (openBlock(), createElementBlock("div", _hoisted_15$1, toDisplayString(unref(s)("connect.campaign.broadcast.allChannelsAdded")), 1))
1728
+ ]);
1729
+ };
1730
+ }
1731
+ });
1732
+ var define_appEndpoint_default = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
1733
+ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { class: "flex flex-col gap-[14px]" }, _hoisted_3$a = { class: "fm-typo-en-body-lg-600" }, _hoisted_4$9 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$7 = { class: "grid gap-12 md:grid-cols-2 lg:grid-cols-2" }, _hoisted_6$4 = { class: "flex items-start justify-between gap-12" }, _hoisted_7$4 = { class: "fm-typo-en-title-sm-800" }, _hoisted_8$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_9$3 = {
1734
+ key: 0,
1735
+ class: "flex items-start gap-8 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1736
+ }, _hoisted_10$3 = { class: "flex flex-col gap-12" }, _hoisted_11$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_12 = { class: "grid items-stretch gap-12 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-4" }, _hoisted_13 = { class: "flex items-start justify-between gap-12" }, _hoisted_14 = {
1737
+ key: 0,
1738
+ class: "mt-[3px] fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1739
+ }, _hoisted_15 = {
1740
+ key: 1,
1741
+ class: "mt-[6px] inline-flex rounded-[6px] bg-fm-color-system-warning-100 px-8 py-[3px] fm-typo-en-body-sm-400 text-fm-color-system-warning-400"
1742
+ }, _hoisted_16 = {
1743
+ key: 0,
1744
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
1745
+ }, _hoisted_17 = { class: "flex flex-col gap-[14px]" }, _hoisted_18 = { class: "fm-typo-en-body-lg-600" }, _hoisted_19 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_20 = { class: "flex flex-wrap items-start gap-24" }, _hoisted_21 = { class: "min-w-0 flex-1 basis-[340px]" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
1746
+ __name: "BroadcastDeliveryInput",
1747
+ props: {
1748
+ /** Either the new delivery shape or a legacy single-channel message. */
1749
+ modelValue: {
1750
+ type: Object,
1751
+ default: void 0
1752
+ },
1753
+ triggerType: {
1754
+ type: String,
1755
+ default: () => "SCHEDULE"
1756
+ },
1757
+ variables: {
1758
+ type: Object,
1759
+ default: () => [...DEFAULT_MESSAGE_VARIABLES]
1760
+ },
1761
+ helperText: { type: String },
1762
+ helperState: { type: String },
1763
+ placeholder: { type: String }
1764
+ },
1765
+ emits: ["update:model-value"],
1766
+ setup(e, { emit: s }) {
1767
+ const { t: o } = useI18n(), d = useCoreStore(), c = useMembershipStore(), i = e, l = s, n = ref(!1), a = ref("SMS"), r = computed(() => {
1768
+ const h = i.modelValue;
1769
+ return h && "channels" in h ? h : toDelivery({ message: h });
1770
+ });
1771
+ function p(h) {
1772
+ l("update:model-value", h);
1773
+ }
1774
+ function v(h) {
1775
+ return o(`connect.campaign.broadcast.channel.${h}`);
1776
+ }
1777
+ const y = {
1778
+ SMS: "chat",
1779
+ WHATSAPP: "chat",
1780
+ EMAIL: "mail",
1781
+ APP_INBOX: "inbox",
1782
+ PUSH: "notifications"
1783
+ };
1784
+ function V(h) {
1785
+ return y[h];
1786
+ }
1787
+ const x = computed(() => r.value.mode === "fallback"), f = computed(
1788
+ () => i.variables.filter(
1789
+ (h) => i.triggerType == "SCHEDULE" ? !h.startsWith("transaction.") : !0
1790
+ )
1791
+ );
1792
+ function g(h) {
1793
+ return h === "WHATSAPP" ? n.value : !0;
1794
+ }
1795
+ const u = ["fallback", "all"];
1796
+ function m(h) {
1797
+ h !== r.value.mode && p(setMode(r.value, h));
1798
+ }
1799
+ const C = ref(null);
1800
+ function k(h) {
1801
+ var F;
1802
+ const N = (F = C.value) == null ? void 0 : F[h];
1803
+ return N ? new Intl.NumberFormat(void 0, {
1804
+ style: "currency",
1805
+ currency: N.currency,
1806
+ minimumFractionDigits: N.precision,
1807
+ maximumFractionDigits: N.precision
1808
+ }).format(N.amount / 10 ** N.precision) : null;
1809
+ }
1810
+ const $ = computed(
1811
+ () => CHANNEL_DISPLAY_ORDER.map((h) => {
1812
+ const N = r.value.channels.includes(h), F = k(h);
1813
+ return {
1814
+ channel: h,
1815
+ label: v(h),
1816
+ selected: N,
1817
+ available: g(h),
1818
+ rateNote: isPaidChannel(h) ? F ? o("connect.campaign.broadcast.perMessage", { price: F }) : null : o("connect.campaign.broadcast.freeChannel"),
1819
+ // A broadcast must keep at least one channel, so the last remaining one
1820
+ // cannot be deselected. Surfaced on the card rather than failing silently.
1821
+ locked: N && r.value.channels.length <= 1
1822
+ };
1823
+ })
1824
+ );
1825
+ async function R(h) {
1826
+ if (g(h)) {
1827
+ if (r.value.channels.includes(h)) {
1828
+ await B(h);
1829
+ return;
1830
+ }
1831
+ p(addChannel(r.value, h, f.value));
1832
+ }
1833
+ }
1834
+ async function B(h) {
1835
+ if (r.value.channels.length <= 1 || !await prompt.remove(
1836
+ o("connect.campaign.broadcast.removeChannelConfirm", {
1837
+ channel: v(h)
1838
+ })
1839
+ )) return;
1840
+ const F = removeChannel(r.value, h);
1841
+ p(F), a.value === h && (a.value = F.channels[0] ?? "SMS");
1842
+ }
1843
+ function D(h, N) {
1844
+ p(moveChannel(r.value, h, N));
1845
+ }
1846
+ const w = computed(
1847
+ () => r.value.channels.slice(1).map((h, N) => ({
1848
+ channel: h,
1849
+ label: v(h),
1850
+ position: N + 2,
1851
+ complete: isChannelComplete(r.value, h)
1852
+ }))
1853
+ ), O = computed(
1854
+ () => CHANNEL_DISPLAY_ORDER.filter(
1855
+ (h) => !r.value.channels.includes(h) && g(h)
1856
+ ).map((h) => ({
1857
+ channel: h,
1858
+ label: v(h)
1859
+ }))
1860
+ ), L = computed(
1861
+ () => r.value.channels.map((h, N) => ({
1862
+ key: h,
1863
+ label: v(h),
1864
+ sub: x.value ? o(N === 0 ? "connect.campaign.broadcast.tab.firstAttempt" : "connect.campaign.broadcast.tab.ifNotReached") : o("connect.campaign.broadcast.tab.sendsToEligible"),
1865
+ complete: isChannelComplete(r.value, h),
1866
+ step: x.value ? N + 1 : void 0,
1867
+ connector: N === 0 ? void 0 : x.value ? "→" : "+"
1868
+ }))
1869
+ );
1870
+ watchEffect(() => {
1871
+ const h = L.value.map((N) => N.key);
1872
+ h.length && !h.includes(a.value) && (a.value = h[0]);
1873
+ });
1874
+ const I = computed(() => a.value), Y = computed(() => {
1875
+ const h = I.value;
1876
+ if (!(h === "APP_INBOX" || h === "PUSH"))
1877
+ return r.value.content[h];
1878
+ }), G = computed(
1879
+ () => r.value.content.APP_INBOX
1880
+ ), H = computed(
1881
+ () => r.value.content.PUSH
1882
+ );
1883
+ function q(h) {
1884
+ p(setChannelContent(r.value, "APP_INBOX", h));
1885
+ }
1886
+ function Z(h) {
1887
+ p(setChannelContent(r.value, "PUSH", h));
1888
+ }
1889
+ function b(h, N) {
1890
+ p(setChannelContent(r.value, h, { ...N, channel: h }));
1891
+ }
1892
+ const E = computed(
1893
+ () => r.value.channels.filter(isPaidChannel)
1894
+ ), T = computed(() => {
1895
+ var N, F, U;
1896
+ const h = ((N = c.membership) == null ? void 0 : N.brand) || ((U = (F = d.currentBusiness) == null ? void 0 : F.value) == null ? void 0 : U.name) || "";
1897
+ return getSmsMessageMetrics({ brandName: h, content: "" }).prefix;
1898
+ }), A = `${define_appEndpoint_default.licensePortalUrl}settings?businessId=${SvcConfig.businessId}`;
1899
+ async function P() {
1900
+ try {
1901
+ const h = await membershipApi.getWhatsappNumbers();
1902
+ n.value = h.some(
1903
+ (N) => {
1904
+ var F;
1905
+ return (F = N == null ? void 0 : N.default) == null ? void 0 : F.includes("Marketing");
1906
+ }
1907
+ );
1908
+ } catch (h) {
1909
+ console.error("Failed to fetch WhatsApp numbers:", h);
1910
+ }
1911
+ }
1912
+ return onMounted(async () => {
1913
+ const h = r.value;
1914
+ h.channels.length ? a.value = h.channels[0] : p(addChannel(h, "SMS", f.value)), campaignApi.readBroadcastCreditSummary().then((N) => C.value = N.prices).catch(() => C.value = null), await P();
1915
+ }), (h, N) => {
1916
+ const F = resolveComponent("FmIcon"), U = resolveComponent("FmCard");
1917
+ return openBlock(), createElementBlock("div", _hoisted_1$g, [
1918
+ createElementVNode("div", _hoisted_2$d, [
1919
+ createElementVNode("div", null, [
1920
+ createElementVNode("div", _hoisted_3$a, toDisplayString(unref(o)("connect.campaign.broadcast.delivery")), 1),
1921
+ createElementVNode("div", _hoisted_4$9, toDisplayString(unref(o)("connect.campaign.broadcast.deliveryDescription")), 1)
1922
+ ]),
1923
+ createElementVNode("div", _hoisted_5$7, [
1924
+ (openBlock(), createElementBlock(Fragment, null, renderList(u, (S) => createVNode(U, {
1925
+ key: S,
1926
+ variant: "outlined",
1927
+ class: normalizeClass(["h-full cursor-pointer select-none p-16 space-y-8", {
1928
+ "border-fm-color-primary bg-fm-color-system-warning-100": unref(r).mode === S,
1929
+ "hover:bg-fm-color-opacity-sm": unref(r).mode !== S
1930
+ }]),
1931
+ onClick: (j) => m(S)
1932
+ }, {
1933
+ default: withCtx(() => [
1934
+ createElementVNode("div", _hoisted_6$4, [
1935
+ createElementVNode("div", _hoisted_7$4, toDisplayString(unref(o)(`connect.campaign.broadcast.mode.${S}.label`)), 1),
1936
+ unref(r).mode === S ? (openBlock(), createBlock(F, {
1937
+ key: 0,
1938
+ name: "check_circle",
1939
+ size: "md",
1940
+ class: "shrink-0 text-fm-color-primary"
1941
+ })) : createCommentVNode("", !0)
1942
+ ]),
1943
+ createElementVNode("div", _hoisted_8$3, toDisplayString(unref(o)(`connect.campaign.broadcast.mode.${S}.description`)), 1)
1944
+ ]),
1945
+ _: 2
1946
+ }, 1032, ["class", "onClick"])), 64))
1947
+ ]),
1948
+ unref(r).channels.length < 2 ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
1949
+ createVNode(F, {
1950
+ name: "info",
1951
+ size: "sm",
1952
+ class: "mt-[2px]"
1953
+ }),
1954
+ createElementVNode("span", null, toDisplayString(unref(o)("connect.campaign.broadcast.singleChannelNote")), 1)
1955
+ ])) : createCommentVNode("", !0)
1956
+ ]),
1957
+ createElementVNode("div", _hoisted_10$3, [
1958
+ createElementVNode("div", _hoisted_11$1, toDisplayString(unref(o)("connect.campaign.broadcast.channels")), 1),
1959
+ createElementVNode("div", _hoisted_12, [
1960
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref($), (S) => (openBlock(), createBlock(U, {
1961
+ key: S.channel,
1962
+ variant: "outlined",
1963
+ class: normalizeClass(["flex h-full flex-col gap-12 p-16", [
1964
+ S.selected ? "!border-fm-color-primary bg-fm-color-system-warning-100" : "",
1965
+ S.available ? S.locked ? "cursor-not-allowed" : "cursor-pointer" : "cursor-not-allowed bg-fm-color-neutral-gray-100"
1966
+ ]]),
1967
+ "aria-disabled": !S.available,
1968
+ onClick: (j) => R(S.channel)
1969
+ }, {
1970
+ default: withCtx(() => [
1971
+ createElementVNode("div", _hoisted_13, [
1972
+ createElementVNode("span", {
1973
+ class: normalizeClass([
1974
+ "flex h-[34px] w-[34px] flex-none items-center justify-center rounded-[8px]",
1975
+ S.available ? "bg-fm-color-primary-oats text-fm-color-primary" : "bg-fm-color-neutral-gray-200 text-fm-color-neutral-gray-400"
1976
+ ])
1977
+ }, [
1978
+ createVNode(F, {
1979
+ name: V(S.channel),
1980
+ size: "md"
1981
+ }, null, 8, ["name"])
1982
+ ], 2),
1983
+ S.available ? (openBlock(), createElementBlock("span", {
1984
+ key: 0,
1985
+ class: normalizeClass([
1986
+ "flex h-[22px] w-[22px] flex-none items-center justify-center rounded-[4px] border-2 transition-colors",
1987
+ S.selected ? "border-fm-color-primary bg-fm-color-primary text-fm-color-typo-white" : "border-fm-color-neutral-gray-300 bg-fm-color-neutral-white"
1988
+ ])
1989
+ }, [
1990
+ S.selected ? (openBlock(), createBlock(F, {
1991
+ key: 0,
1992
+ name: "check",
1993
+ size: "sm"
1994
+ })) : createCommentVNode("", !0)
1995
+ ], 2)) : createCommentVNode("", !0)
1996
+ ]),
1997
+ createElementVNode("div", null, [
1998
+ createElementVNode("div", {
1999
+ class: normalizeClass(["fm-typo-en-body-md-600", S.available ? "" : "text-fm-color-typo-disabled"])
2000
+ }, toDisplayString(S.label), 3),
2001
+ S.available && S.rateNote ? (openBlock(), createElementBlock("div", _hoisted_14, toDisplayString(S.rateNote), 1)) : createCommentVNode("", !0),
2002
+ S.available ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_15, toDisplayString(unref(o)("connect.campaign.broadcast.notSetUp")), 1))
2003
+ ]),
2004
+ S.available ? createCommentVNode("", !0) : (openBlock(), createElementBlock("a", {
2005
+ key: 0,
2006
+ href: A,
2007
+ target: "_blank",
2008
+ class: "mt-auto fm-typo-en-body-sm-400 text-fm-color-secondary-blueberry underline",
2009
+ onClick: N[0] || (N[0] = withModifiers(() => {
2010
+ }, ["stop"]))
2011
+ }, toDisplayString(unref(o)("connect.campaign.messageInput.manageWhatsappChannel")), 1))
2012
+ ]),
2013
+ _: 2
2014
+ }, 1032, ["class", "aria-disabled", "onClick"]))), 128))
2015
+ ]),
2016
+ unref(r).channels.length <= 1 ? (openBlock(), createElementBlock("div", _hoisted_16, toDisplayString(unref(o)("connect.campaign.broadcast.keepOneChannel")), 1)) : createCommentVNode("", !0),
2017
+ unref(x) ? (openBlock(), createBlock(_sfc_main$h, {
2018
+ key: 1,
2019
+ rows: unref(w),
2020
+ addable: unref(O),
2021
+ onMove: D,
2022
+ onRemove: B,
2023
+ onAdd: N[1] || (N[1] = (S) => p(unref(addChannel)(unref(r), S, unref(f))))
2024
+ }, null, 8, ["rows", "addable"])) : createCommentVNode("", !0)
2025
+ ]),
2026
+ createElementVNode("div", _hoisted_17, [
2027
+ createElementVNode("div", null, [
2028
+ createElementVNode("div", _hoisted_18, toDisplayString(unref(o)("connect.campaign.broadcast.content")), 1),
2029
+ createElementVNode("div", _hoisted_19, toDisplayString(unref(o)("connect.campaign.broadcast.contentDescription")), 1)
2030
+ ]),
2031
+ unref(E).length ? (openBlock(), createBlock(_sfc_main$w, {
2032
+ key: 0,
2033
+ channels: unref(E)
2034
+ }, null, 8, ["channels"])) : createCommentVNode("", !0),
2035
+ createVNode(_sfc_main$j, {
2036
+ modelValue: unref(a),
2037
+ "onUpdate:modelValue": N[2] || (N[2] = (S) => isRef(a) ? a.value = S : null),
2038
+ tabs: unref(L)
2039
+ }, null, 8, ["modelValue", "tabs"]),
2040
+ createElementVNode("div", _hoisted_20, [
2041
+ createElementVNode("div", _hoisted_21, [
2042
+ unref(a) === "PUSH" && unref(H) ? (openBlock(), createBlock(_sfc_main$k, {
2043
+ key: 0,
2044
+ "model-value": unref(H),
2045
+ "onUpdate:modelValue": Z
2046
+ }, null, 8, ["model-value"])) : unref(a) === "APP_INBOX" && unref(G) ? (openBlock(), createBlock(_sfc_main$l, {
2047
+ key: 1,
2048
+ "model-value": unref(G),
2049
+ variables: unref(f),
2050
+ "onUpdate:modelValue": q
2051
+ }, null, 8, ["model-value", "variables"])) : unref(a) !== "APP_INBOX" && unref(a) !== "PUSH" ? (openBlock(), createBlock(_sfc_main$x, {
2052
+ key: unref(a),
2053
+ "model-value": unref(Y),
2054
+ "allow-email": !1,
2055
+ "allow-whatsapp": !1,
2056
+ "hide-credit-card": !0,
2057
+ "trigger-type": e.triggerType,
2058
+ variables: unref(f),
2059
+ placeholder: e.placeholder,
2060
+ "onUpdate:modelValue": N[3] || (N[3] = (S) => b(unref(I), S))
2061
+ }, null, 8, ["model-value", "trigger-type", "variables", "placeholder"])) : createCommentVNode("", !0)
2062
+ ]),
2063
+ createVNode(_sfc_main$i, {
2064
+ target: unref(a),
2065
+ content: unref(r).content[unref(I)],
2066
+ "sender-prefix": unref(T)
2067
+ }, null, 8, ["target", "content", "sender-prefix"])
2068
+ ])
2069
+ ])
2070
+ ]);
2071
+ };
2072
+ }
1272
2073
  }), _hoisted_1$f = { class: "space-y-8" }, _hoisted_2$c = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$9 = {
1273
2074
  key: 0,
1274
2075
  class: "space-y-4"
@@ -1288,60 +2089,60 @@ const _hoisted_1$l = {
1288
2089
  },
1289
2090
  emits: ["update:model-value"],
1290
2091
  setup(e, { emit: s }) {
1291
- const { t: n } = useI18n(), u = e, d = s, i = useCoreStore(), l = computed(
2092
+ const { t: o } = useI18n(), d = e, c = s, i = useCoreStore(), l = computed(
1292
2093
  () => CountryTimezone[i.currentCountry.value || "MY"]
1293
2094
  );
1294
- function o() {
1295
- const c = RuleBuilder.getRules(u.modelValue);
1296
- return c.length == 0 ? "fixed" : c.some(
2095
+ function n() {
2096
+ const u = RuleBuilder.getRules(d.modelValue);
2097
+ return u.length == 0 ? "fixed" : u.some(
1297
2098
  (m) => isRuleEntry(m) && RuleBuilder.simplify(m).operator == "_rrule"
1298
2099
  ) ? "repeating" : "fixed";
1299
2100
  }
1300
- const a = ref(o()), r = ref(!1), p = ref(!1), h = computed(() => [
1301
- { label: n("connect.template.rule.schedule.fixed"), value: "fixed" },
1302
- { label: n("connect.template.rule.schedule.repeating"), value: "repeating" }
2101
+ const a = ref(n()), r = ref(!1), p = ref(!1), v = computed(() => [
2102
+ { label: o("connect.template.rule.schedule.fixed"), value: "fixed" },
2103
+ { label: o("connect.template.rule.schedule.repeating"), value: "repeating" }
1303
2104
  ]), y = computed(() => {
1304
- const c = RuleBuilder.getRules(u.modelValue), m = c.find(
1305
- (b) => isRuleEntry(b) && RuleBuilder.simplify(b).property == "trigger.date"
1306
- ), k = c.find(
1307
- (b) => isRuleEntry(b) && RuleBuilder.simplify(b).property == "trigger.time"
2105
+ const u = RuleBuilder.getRules(d.modelValue), m = u.find(
2106
+ (k) => isRuleEntry(k) && RuleBuilder.simplify(k).property == "trigger.date"
2107
+ ), C = u.find(
2108
+ (k) => isRuleEntry(k) && RuleBuilder.simplify(k).property == "trigger.time"
1308
2109
  );
1309
2110
  return {
1310
2111
  date: m ? RuleBuilder.simplify(m).equator : null,
1311
- time: k ? RuleBuilder.simplify(k).equator : null
2112
+ time: C ? RuleBuilder.simplify(C).equator : null
1312
2113
  };
1313
- }), C = computed(
2114
+ }), V = computed(
1314
2115
  () => calculateNextScheduleAt(
1315
- u.modelValue,
2116
+ d.modelValue,
1316
2117
  /* @__PURE__ */ new Date(),
1317
- u.startDate ? new Date(u.startDate) : /* @__PURE__ */ new Date(),
1318
- u.endDate ? new Date(u.endDate) : void 0
2118
+ d.startDate ? new Date(d.startDate) : /* @__PURE__ */ new Date(),
2119
+ d.endDate ? new Date(d.endDate) : void 0
1319
2120
  )
1320
2121
  );
1321
- function B(c, m) {
1322
- d(
2122
+ function x(u, m) {
2123
+ c(
1323
2124
  "update:model-value",
1324
2125
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
1325
- RuleBuilder.constructEntry("trigger.date", "_rrule", c),
2126
+ RuleBuilder.constructEntry("trigger.date", "_rrule", u),
1326
2127
  RuleBuilder.constructEntry("trigger.time", "_isOnTime", m ?? "00:00")
1327
2128
  ])
1328
2129
  );
1329
2130
  }
1330
2131
  watch(
1331
- () => u.startDate,
1332
- (c, m) => {
1333
- if (!c || c === m || a.value !== "repeating" || !y.value.date) return;
1334
- const k = RRule.fromString(y.value.date), b = new RRule({
1335
- ...k.origOptions,
1336
- dtstart: new Date(c)
2132
+ () => d.startDate,
2133
+ (u, m) => {
2134
+ if (!u || u === m || a.value !== "repeating" || !y.value.date) return;
2135
+ const C = RRule.fromString(y.value.date), k = new RRule({
2136
+ ...C.origOptions,
2137
+ dtstart: new Date(u)
1337
2138
  }).toString();
1338
- b !== y.value.date && (B(b, y.value.time), p.value = !0);
2139
+ k !== y.value.date && (x(k, y.value.time), p.value = !0);
1339
2140
  }
1340
2141
  );
1341
- function v(c) {
1342
- const m = c.value, k = getRruleAnchorDate({
1343
- startDate: u.startDate ? new Date(u.startDate) : void 0
1344
- }), b = m == "fixed" ? [
2142
+ function f(u) {
2143
+ const m = u.value, C = getRruleAnchorDate({
2144
+ startDate: d.startDate ? new Date(d.startDate) : void 0
2145
+ }), k = m == "fixed" ? [
1345
2146
  RuleBuilder.constructEntry(
1346
2147
  "trigger.date",
1347
2148
  "_isOnDate",
@@ -1353,7 +2154,7 @@ const _hoisted_1$l = {
1353
2154
  "trigger.date",
1354
2155
  "_rrule",
1355
2156
  new RRule({
1356
- dtstart: k,
2157
+ dtstart: C,
1357
2158
  freq: RRule.DAILY,
1358
2159
  interval: 1,
1359
2160
  byhour: 0,
@@ -1364,59 +2165,59 @@ const _hoisted_1$l = {
1364
2165
  ),
1365
2166
  RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
1366
2167
  ];
1367
- d(
2168
+ c(
1368
2169
  "update:model-value",
1369
2170
  RuleBuilder.setRuleToGroup(
1370
2171
  RuleBuilder.scaffoldGroup("g_schedule"),
1371
- b
2172
+ k
1372
2173
  )
1373
2174
  ), a.value = m, p.value = !1;
1374
2175
  }
1375
- function f(c) {
1376
- a.value == "fixed" ? d(
2176
+ function g(u) {
2177
+ a.value == "fixed" ? c(
1377
2178
  "update:model-value",
1378
2179
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
1379
2180
  RuleBuilder.constructEntry(
1380
2181
  "trigger.date",
1381
2182
  "_isOnDate",
1382
- c.date
2183
+ u.date
1383
2184
  ),
1384
2185
  RuleBuilder.constructEntry(
1385
2186
  "trigger.time",
1386
2187
  "_isOnTime",
1387
- c.time
2188
+ u.time
1388
2189
  )
1389
2190
  ])
1390
- ) : B(c.date, c.time), p.value = !1;
2191
+ ) : x(u.date, u.time), p.value = !1;
1391
2192
  }
1392
- return (c, m) => {
1393
- const k = resolveComponent("FmButtonGroup"), b = resolveComponent("FmTimePicker"), E = resolveComponent("FmIcon"), S = resolveComponent("FmTooltip"), x = resolveComponent("FmField"), R = resolveComponent("FmCard"), N = resolveComponent("FmPopover"), w = resolveComponent("FmDatePicker"), A = resolveComponent("FmHelperText");
2193
+ return (u, m) => {
2194
+ const C = resolveComponent("FmButtonGroup"), k = resolveComponent("FmTimePicker"), $ = resolveComponent("FmIcon"), R = resolveComponent("FmTooltip"), B = resolveComponent("FmField"), D = resolveComponent("FmCard"), w = resolveComponent("FmPopover"), O = resolveComponent("FmDatePicker"), L = resolveComponent("FmHelperText");
1394
2195
  return openBlock(), createElementBlock(Fragment, null, [
1395
- createVNode(k, {
1396
- items: unref(h),
1397
- "model-value": unref(h).find((F) => F.value === unref(a)) ?? null,
1398
- "onUpdate:modelValue": v,
2196
+ createVNode(C, {
2197
+ items: unref(v),
2198
+ "model-value": unref(v).find((I) => I.value === unref(a)) ?? null,
2199
+ "onUpdate:modelValue": f,
1399
2200
  class: "mb-8"
1400
2201
  }, null, 8, ["items", "model-value"]),
1401
2202
  createElementVNode("div", _hoisted_1$f, [
1402
2203
  createElementVNode("div", _hoisted_2$c, [
1403
- createVNode(b, {
1404
- label: unref(n)("connect.template.rule.schedule.notify_time"),
2204
+ createVNode(k, {
2205
+ label: unref(o)("connect.template.rule.schedule.notify_time"),
1405
2206
  "model-value": unref(y).time,
1406
- "onUpdate:modelValue": m[0] || (m[0] = (F) => f({ date: unref(y).date, time: F })),
1407
- "helper-text": unref(y).time ? void 0 : unref(n)("connect.template.rule.schedule.time_required"),
2207
+ "onUpdate:modelValue": m[0] || (m[0] = (I) => g({ date: unref(y).date, time: I })),
2208
+ "helper-text": unref(y).time ? void 0 : unref(o)("connect.template.rule.schedule.time_required"),
1408
2209
  "helper-state": unref(y).time ? void 0 : "error"
1409
2210
  }, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
1410
2211
  unref(a) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
1411
2212
  createElementVNode("div", _hoisted_4$8, [
1412
- createElementVNode("div", null, toDisplayString(unref(n)("connect.template.rule.schedule.notify_date")), 1),
1413
- unref(y).date ? (openBlock(), createBlock(S, {
2213
+ createElementVNode("div", null, toDisplayString(unref(o)("connect.template.rule.schedule.notify_date")), 1),
2214
+ unref(y).date ? (openBlock(), createBlock(R, {
1414
2215
  key: 0,
1415
2216
  "z-index": 9999,
1416
2217
  content: unref(SummarizeRrule)(unref(RRule).fromString(unref(y).date).options)
1417
2218
  }, {
1418
2219
  default: withCtx(() => [
1419
- createVNode(E, {
2220
+ createVNode($, {
1420
2221
  name: "info",
1421
2222
  size: "sm",
1422
2223
  outline: !0
@@ -1425,31 +2226,31 @@ const _hoisted_1$l = {
1425
2226
  _: 1
1426
2227
  }, 8, ["content"])) : createCommentVNode("", !0)
1427
2228
  ]),
1428
- createVNode(N, {
2229
+ createVNode(w, {
1429
2230
  "show-popover": unref(r),
1430
- onPopoverChanged: m[3] || (m[3] = (F) => r.value = F)
2231
+ onPopoverChanged: m[3] || (m[3] = (I) => r.value = I)
1431
2232
  }, {
1432
2233
  "popover-button": withCtx(() => [
1433
- createVNode(x, {
2234
+ createVNode(B, {
1434
2235
  class: "cursor-pointer",
1435
- "helper-text": unref(y).date ? void 0 : unref(n)("connect.template.rule.schedule.date_required"),
2236
+ "helper-text": unref(y).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
1436
2237
  "helper-state": unref(y).date ? void 0 : "error"
1437
2238
  }, {
1438
2239
  default: withCtx(() => [
1439
- createElementVNode("div", _hoisted_5$6, toDisplayString(unref(y).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(y).date).options) : unref(n)("connect.template.rule.schedule.set_repeating_date")), 1)
2240
+ createElementVNode("div", _hoisted_5$6, toDisplayString(unref(y).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(y).date).options) : unref(o)("connect.template.rule.schedule.set_repeating_date")), 1)
1440
2241
  ]),
1441
2242
  _: 1
1442
2243
  }, 8, ["helper-text", "helper-state"])
1443
2244
  ]),
1444
2245
  default: withCtx(() => [
1445
- createVNode(R, { class: "elevated p-8 w-[450px]" }, {
2246
+ createVNode(D, { class: "elevated p-8 w-[450px]" }, {
1446
2247
  default: withCtx(() => [
1447
- createVNode(_sfc_main$p, {
2248
+ createVNode(_sfc_main$y, {
1448
2249
  "apply-button": !0,
1449
2250
  "model-value": unref(y).date || "",
1450
2251
  "start-date": e.startDate ? new Date(e.startDate) : /* @__PURE__ */ new Date(),
1451
- onCancel: m[1] || (m[1] = (F) => r.value = !1),
1452
- "onUpdate:modelValue": m[2] || (m[2] = (F) => (f({ date: F, time: unref(y).time }), r.value = !1))
2252
+ onCancel: m[1] || (m[1] = (I) => r.value = !1),
2253
+ "onUpdate:modelValue": m[2] || (m[2] = (I) => (g({ date: I, time: unref(y).time }), r.value = !1))
1453
2254
  }, null, 8, ["model-value", "start-date"])
1454
2255
  ]),
1455
2256
  _: 1
@@ -1457,21 +2258,21 @@ const _hoisted_1$l = {
1457
2258
  ]),
1458
2259
  _: 1
1459
2260
  }, 8, ["show-popover"])
1460
- ])) : (openBlock(), createBlock(w, {
2261
+ ])) : (openBlock(), createBlock(O, {
1461
2262
  key: 1,
1462
- label: unref(n)("connect.template.rule.schedule.notify_date"),
2263
+ label: unref(o)("connect.template.rule.schedule.notify_date"),
1463
2264
  "model-value": unref(y).date || "",
1464
- "onUpdate:modelValue": m[4] || (m[4] = (F) => f({ date: F, time: unref(y).time })),
1465
- "helper-text": unref(y).date ? void 0 : unref(n)("connect.template.rule.schedule.date_required"),
2265
+ "onUpdate:modelValue": m[4] || (m[4] = (I) => g({ date: I, time: unref(y).time })),
2266
+ "helper-text": unref(y).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
1466
2267
  "helper-state": unref(y).date ? void 0 : "error"
1467
2268
  }, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
1468
2269
  ]),
1469
- unref(y).date && unref(y).time && unref(C) ? (openBlock(), createBlock(A, {
2270
+ unref(y).date && unref(y).time && unref(V) ? (openBlock(), createBlock(L, {
1470
2271
  key: 0,
1471
- text: `${unref(moment)(unref(C)).isAfter(unref(moment)()) ? unref(n)("connect.template.rule.schedule.next_notification") : unref(n)("connect.template.rule.schedule.last_trigger_on")} ${unref(moment)(unref(C)).format("dddd, DD MMM YYYY")} at
1472
- ${unref(moment)(unref(C)).format("hh:mmA")}(UTC${unref(moment).tz(unref(l)).format("Z")}) (${unref(moment)(unref(C)).fromNow()})`
2272
+ 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
2273
+ ${unref(moment)(unref(V)).format("hh:mmA")}(UTC${unref(moment).tz(unref(l)).format("Z")}) (${unref(moment)(unref(V)).fromNow()})`
1473
2274
  }, null, 8, ["text"])) : createCommentVNode("", !0),
1474
- unref(p) ? (openBlock(), createBlock(A, {
2275
+ unref(p) ? (openBlock(), createBlock(L, {
1475
2276
  key: 1,
1476
2277
  text: "Repeating schedule was updated to stay anchored to the campaign start date.",
1477
2278
  state: "warning"
@@ -1489,26 +2290,26 @@ const _hoisted_1$l = {
1489
2290
  },
1490
2291
  emits: ["update:model-value"],
1491
2292
  setup(e, { emit: s }) {
1492
- const { t: n } = useI18n(), u = e, d = s, i = computed(
2293
+ const { t: o } = useI18n(), d = e, c = s, i = computed(
1493
2294
  () => [
1494
2295
  {
1495
- label: n("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
1496
- description: n("connect.campaign.gameType.option.FORTUNE_WHEEL.description"),
2296
+ label: o("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
2297
+ description: o("connect.campaign.gameType.option.FORTUNE_WHEEL.description"),
1497
2298
  value: F_GAME_TYPE.enum.FORTUNE_WHEEL,
1498
2299
  hidden: !1
1499
2300
  },
1500
2301
  {
1501
- label: n("connect.campaign.gameType.option.ROCK_PAPER_SCISSORS.label"),
1502
- description: n("connect.campaign.gameType.option.ROCK_PAPER_SCISSORS.description"),
2302
+ label: o("connect.campaign.gameType.option.ROCK_PAPER_SCISSORS.label"),
2303
+ description: o("connect.campaign.gameType.option.ROCK_PAPER_SCISSORS.description"),
1503
2304
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
1504
2305
  hidden: !0
1505
2306
  }
1506
2307
  ].filter((l) => !l.hidden)
1507
2308
  );
1508
- return (l, o) => {
2309
+ return (l, n) => {
1509
2310
  const a = resolveComponent("FmCard");
1510
2311
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
1511
- createElementVNode("div", _hoisted_2$b, toDisplayString(unref(n)("connect.template.select_game")), 1),
2312
+ createElementVNode("div", _hoisted_2$b, toDisplayString(unref(o)("connect.template.select_game")), 1),
1512
2313
  createElementVNode("div", _hoisted_3$8, [
1513
2314
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (r) => (openBlock(), createBlock(a, {
1514
2315
  variant: "outlined",
@@ -1518,7 +2319,7 @@ const _hoisted_1$l = {
1518
2319
  "hover:bg-fm-color-opacity-sm": e.modelValue != r.value
1519
2320
  }]),
1520
2321
  onClick: () => {
1521
- u.modelValue != r.value && d("update:model-value", r.value);
2322
+ d.modelValue != r.value && c("update:model-value", r.value);
1522
2323
  },
1523
2324
  key: r.value
1524
2325
  }, {
@@ -1538,48 +2339,48 @@ const _hoisted_1$l = {
1538
2339
  }, _hoisted_2$a = { class: "flex gap-8 items-center justify-start" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
1539
2340
  __name: "EditRewardPoolSheet",
1540
2341
  emits: ["update:model-value"],
1541
- setup(e, { expose: s, emit: n }) {
1542
- const u = useMembershipStore(), { minor: d } = useLoading, i = ref(!1), l = ref(), o = ref(), a = ref(0), r = computed(() => {
1543
- var v;
1544
- return ((v = u.loyaltyRewards.items.find(
1545
- (f) => {
1546
- var c;
1547
- return f.value === ((c = l.value) == null ? void 0 : c.collectible);
2342
+ setup(e, { expose: s, emit: o }) {
2343
+ const d = useMembershipStore(), { minor: c } = useLoading, i = ref(!1), l = ref(), n = ref(), a = ref(0), r = computed(() => {
2344
+ var f;
2345
+ return ((f = d.loyaltyRewards.items.find(
2346
+ (g) => {
2347
+ var u;
2348
+ return g.value === ((u = l.value) == null ? void 0 : u.collectible);
1548
2349
  }
1549
- )) == null ? void 0 : v.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
2350
+ )) == null ? void 0 : f.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1550
2351
  }), p = computed(() => {
1551
- const B = r.value.safeParse(l.value);
1552
- return B.success ? [] : B.error.errors;
2352
+ const x = r.value.safeParse(l.value);
2353
+ return x.success ? [] : x.error.errors;
1553
2354
  });
1554
- function h(B, v, f) {
1555
- B && (l.value = v, a.value = f), i.value = B;
2355
+ function v(x, f, g) {
2356
+ x && (l.value = f, a.value = g), i.value = x;
1556
2357
  }
1557
- const y = n;
1558
- async function C() {
1559
- const B = r.value.safeParse(l.value);
1560
- B.success && (await d(
2358
+ const y = o;
2359
+ async function V() {
2360
+ const x = r.value.safeParse(l.value);
2361
+ x.success && (await c(
1561
2362
  async () => {
1562
- B.data.type === "VOUCHER" && o.value && (B.data.collectibleConfig.image = await firebaseStorage.update(
1563
- B.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
1564
- o.value
2363
+ x.data.type === "VOUCHER" && n.value && (x.data.collectibleConfig.image = await firebaseStorage.update(
2364
+ x.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
2365
+ n.value
1565
2366
  ));
1566
2367
  },
1567
2368
  {
1568
2369
  message: "Uploading reward image",
1569
2370
  successMessage: "Reward image updated"
1570
2371
  }
1571
- ), y("update:model-value", B.data, a.value));
2372
+ ), y("update:model-value", x.data, a.value));
1572
2373
  }
1573
2374
  return s({
1574
- showSheet: h
1575
- }), (B, v) => {
1576
- const f = resolveComponent("FmSelect"), c = resolveComponent("FmStepperField"), m = resolveComponent("FmButton"), k = resolveComponent("FmSideSheet");
1577
- return openBlock(), createBlock(k, {
2375
+ showSheet: v
2376
+ }), (x, f) => {
2377
+ const g = resolveComponent("FmSelect"), u = resolveComponent("FmStepperField"), m = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
2378
+ return openBlock(), createBlock(C, {
1578
2379
  "max-width": 560,
1579
2380
  modelValue: unref(i),
1580
2381
  "onUpdate:modelValue": [
1581
- v[9] || (v[9] = (b) => isRef(i) ? i.value = b : null),
1582
- v[10] || (v[10] = (b) => i.value = b)
2382
+ f[9] || (f[9] = (k) => isRef(i) ? i.value = k : null),
2383
+ f[10] || (f[10] = (k) => i.value = k)
1583
2384
  ],
1584
2385
  header: "Edit reward",
1585
2386
  "dismiss-away": ""
@@ -1591,21 +2392,21 @@ const _hoisted_1$l = {
1591
2392
  type: "button",
1592
2393
  disabled: unref(p).length > 0,
1593
2394
  label: "Confirm",
1594
- onClick: v[7] || (v[7] = (b) => C())
2395
+ onClick: f[7] || (f[7] = (k) => V())
1595
2396
  }, null, 8, ["disabled"]),
1596
2397
  createVNode(m, {
1597
2398
  variant: "secondary",
1598
2399
  type: "button",
1599
2400
  label: "Cancel",
1600
- onClick: v[8] || (v[8] = (b) => i.value = !1)
2401
+ onClick: f[8] || (f[8] = (k) => i.value = !1)
1601
2402
  })
1602
2403
  ])
1603
2404
  ]),
1604
2405
  default: withCtx(() => {
1605
- var b, E, S;
2406
+ var k, $, R;
1606
2407
  return [
1607
2408
  unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
1608
- createVNode(f, {
2409
+ createVNode(g, {
1609
2410
  label: "Reward Type",
1610
2411
  items: [
1611
2412
  { label: "No Reward", value: "NO_REWARD" },
@@ -1613,12 +2414,12 @@ const _hoisted_1$l = {
1613
2414
  { label: "Loyalty", value: "LOYALTY" }
1614
2415
  ],
1615
2416
  "model-value": unref(l).type,
1616
- "onUpdate:modelValue": v[0] || (v[0] = (x) => {
1617
- x == "NO_REWARD" ? l.value = {
2417
+ "onUpdate:modelValue": f[0] || (f[0] = (B) => {
2418
+ B == "NO_REWARD" ? l.value = {
1618
2419
  type: "NO_REWARD",
1619
2420
  collectible: null,
1620
2421
  weight: 1
1621
- } : x === "VOUCHER" ? l.value = {
2422
+ } : B === "VOUCHER" ? l.value = {
1622
2423
  collectible: null,
1623
2424
  type: "VOUCHER",
1624
2425
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1633,7 +2434,7 @@ const _hoisted_1$l = {
1633
2434
  },
1634
2435
  weight: 1
1635
2436
  } : l.value = {
1636
- collectible: unref(u).loyaltyRewards.raw[0]._id,
2437
+ collectible: unref(d).loyaltyRewards.raw[0]._id,
1637
2438
  type: "LOYALTY",
1638
2439
  earningOption: {
1639
2440
  amount: 1,
@@ -1646,32 +2447,32 @@ const _hoisted_1$l = {
1646
2447
  };
1647
2448
  })
1648
2449
  }, null, 8, ["model-value"]),
1649
- unref(l).type == "LOYALTY" ? (openBlock(), createBlock(f, {
2450
+ unref(l).type == "LOYALTY" ? (openBlock(), createBlock(g, {
1650
2451
  key: 0,
1651
2452
  label: "Loyalty type",
1652
2453
  rules: [unref(ZodHelper).ruleAtPath(unref(r), "collectible", [unref(l).type])],
1653
- items: unref(u).loyaltyRewards.items,
2454
+ items: unref(d).loyaltyRewards.items,
1654
2455
  "model-value": unref(l).collectible,
1655
- "onUpdate:modelValue": v[1] || (v[1] = (x) => unref(l).collectible = x)
2456
+ "onUpdate:modelValue": f[1] || (f[1] = (B) => unref(l).collectible = B)
1656
2457
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1657
- createVNode(c, {
2458
+ createVNode(u, {
1658
2459
  label: "Weight",
1659
2460
  rules: [unref(ZodHelper).ruleAtPath(unref(r), "weight", [unref(l).type])],
1660
2461
  "model-value": unref(l).weight,
1661
- "onUpdate:modelValue": v[2] || (v[2] = (x) => l.value = {
2462
+ "onUpdate:modelValue": f[2] || (f[2] = (B) => l.value = {
1662
2463
  ...unref(l),
1663
- weight: x
2464
+ weight: B
1664
2465
  })
1665
2466
  }, null, 8, ["rules", "model-value"]),
1666
2467
  unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1667
- ((b = unref(u).loyaltyRewards.items.find(
1668
- (x) => {
1669
- var R;
1670
- return x.value === ((R = unref(l)) == null ? void 0 : R.collectible);
2468
+ ((k = unref(d).loyaltyRewards.items.find(
2469
+ (B) => {
2470
+ var D;
2471
+ return B.value === ((D = unref(l)) == null ? void 0 : D.collectible);
1671
2472
  }
1672
- )) == null ? void 0 : b.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1673
- v[11] || (v[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1674
- createVNode(_sfc_main$q, {
2473
+ )) == null ? void 0 : k.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2474
+ f[11] || (f[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
2475
+ createVNode(_sfc_main$z, {
1675
2476
  class: "mt-[-8px]",
1676
2477
  rules: [
1677
2478
  unref(ZodHelper).ruleAtPath(unref(r), "earningOption", [unref(l).type])
@@ -1680,39 +2481,39 @@ const _hoisted_1$l = {
1680
2481
  "error-text": unref(ZodHelper).helperText(unref(p), "earningOption"),
1681
2482
  "fixed-type": !0,
1682
2483
  "model-value": unref(l).earningOption,
1683
- "onUpdate:modelValue": v[3] || (v[3] = (x) => l.value = {
2484
+ "onUpdate:modelValue": f[3] || (f[3] = (B) => l.value = {
1684
2485
  ...unref(l),
1685
- earningOption: x
2486
+ earningOption: B
1686
2487
  })
1687
2488
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"])
1688
2489
  ], 64)) : createCommentVNode("", !0),
1689
- v[12] || (v[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
1690
- createVNode(_sfc_main$r, {
2490
+ f[12] || (f[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
2491
+ createVNode(_sfc_main$A, {
1691
2492
  type: unref(l).type === "LOYALTY" ? "custom" : "range",
1692
- "for-credit": unref(l).type === "LOYALTY" && ((E = unref(u).loyaltyRewards.items.find(
1693
- (x) => {
1694
- var R;
1695
- return x.value === ((R = unref(l)) == null ? void 0 : R.collectible);
2493
+ "for-credit": unref(l).type === "LOYALTY" && (($ = unref(d).loyaltyRewards.items.find(
2494
+ (B) => {
2495
+ var D;
2496
+ return B.value === ((D = unref(l)) == null ? void 0 : D.collectible);
1696
2497
  }
1697
- )) == null ? void 0 : E.raw.type) === "CREDIT",
2498
+ )) == null ? void 0 : $.raw.type) === "CREDIT",
1698
2499
  class: "!gap-24",
1699
2500
  rules: [unref(ZodHelper).ruleAtPath(unref(r), "validityOption", [unref(l).type])],
1700
2501
  "model-value": unref(l).validityOption,
1701
- "onUpdate:modelValue": v[4] || (v[4] = (x) => l.value = {
2502
+ "onUpdate:modelValue": f[4] || (f[4] = (B) => l.value = {
1702
2503
  ...unref(l),
1703
- validityOption: x
2504
+ validityOption: B
1704
2505
  })
1705
2506
  }, null, 8, ["type", "for-credit", "rules", "model-value"])
1706
2507
  ], 64)) : createCommentVNode("", !0),
1707
- unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$s, {
2508
+ unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$B, {
1708
2509
  key: 2,
1709
- "reward-image": unref(o),
1710
- "model-value": ((S = unref(l)) == null ? void 0 : S.collectibleConfig) ?? void 0,
1711
- "onUpdate:modelValue": v[5] || (v[5] = (x) => l.value = {
2510
+ "reward-image": unref(n),
2511
+ "model-value": ((R = unref(l)) == null ? void 0 : R.collectibleConfig) ?? void 0,
2512
+ "onUpdate:modelValue": f[5] || (f[5] = (B) => l.value = {
1712
2513
  ...unref(l),
1713
- collectibleConfig: x
2514
+ collectibleConfig: B
1714
2515
  }),
1715
- "onUpdate:rewardImage": v[6] || (v[6] = (x) => o.value = x)
2516
+ "onUpdate:rewardImage": f[6] || (f[6] = (B) => n.value = B)
1716
2517
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1717
2518
  createVNode(JsonViewer, { json: unref(p) }, null, 8, ["json"])
1718
2519
  ])) : createCommentVNode("", !0)
@@ -1742,80 +2543,80 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1742
2543
  },
1743
2544
  emits: ["update:model-value"],
1744
2545
  setup(e, { emit: s }) {
1745
- const n = e, u = s, d = useMembershipStore(), { t: i } = useI18n(), l = z$1.array(z$1.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => n.modelValue ?? []), a = computed(() => {
1746
- const v = l.safeParse(o.value);
1747
- return v.success ? [] : v.error.errors;
2546
+ const o = e, d = s, c = useMembershipStore(), { t: i } = useI18n(), l = z$1.array(z$1.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), n = computed(() => o.modelValue ?? []), a = computed(() => {
2547
+ const f = l.safeParse(n.value);
2548
+ return f.success ? [] : f.error.errors;
1748
2549
  }), r = ref();
1749
- function p(v, f) {
2550
+ function p(f, g) {
1750
2551
  var m;
1751
- const c = [...o.value];
1752
- c[f] = v, (m = r.value) == null || m.showSheet(!1), u("update:model-value", c);
2552
+ const u = [...n.value];
2553
+ u[g] = f, (m = r.value) == null || m.showSheet(!1), d("update:model-value", u);
1753
2554
  }
1754
- function h(v) {
1755
- const f = v.type == "VOUCHER" ? v.collectibleConfig : d.collectibles.find(
1756
- (k) => k._id.toString() == v.collectible
1757
- ), c = CollectionUtils.formattedType((f == null ? void 0 : f.name) || ""), m = v.weight;
2555
+ function v(f) {
2556
+ const g = f.type == "VOUCHER" ? f.collectibleConfig : c.collectibles.find(
2557
+ (C) => C._id.toString() == f.collectible
2558
+ ), u = CollectionUtils.formattedType((g == null ? void 0 : g.name) || ""), m = f.weight;
1758
2559
  return {
1759
- label: isNullOrEmpty(c) ? "NO REWARD" : c,
1760
- sublabel: `${m} (${(m / o.value.reduce((k, b) => k + b.weight, 0) * 100).toFixed(2)}%)`
2560
+ label: isNullOrEmpty(u) ? "NO REWARD" : u,
2561
+ sublabel: `${m} (${(m / n.value.reduce((C, k) => C + k.weight, 0) * 100).toFixed(2)}%)`
1761
2562
  };
1762
2563
  }
1763
- function y(v) {
1764
- var c;
1765
- const f = [...o.value];
1766
- (c = r.value) == null || c.showSheet(!0, f[v], v);
2564
+ function y(f) {
2565
+ var u;
2566
+ const g = [...n.value];
2567
+ (u = r.value) == null || u.showSheet(!0, g[f], f);
1767
2568
  }
1768
- function C(v) {
1769
- const f = [...o.value];
1770
- f.splice(v, 1), u("update:model-value", f);
2569
+ function V(f) {
2570
+ const g = [...n.value];
2571
+ g.splice(f, 1), d("update:model-value", g);
1771
2572
  }
1772
- function B() {
1773
- var v;
1774
- (v = r.value) == null || v.showSheet(
2573
+ function x() {
2574
+ var f;
2575
+ (f = r.value) == null || f.showSheet(
1775
2576
  !0,
1776
2577
  {
1777
2578
  type: "NO_REWARD",
1778
2579
  collectible: null,
1779
2580
  weight: 1
1780
2581
  },
1781
- o.value.length
2582
+ n.value.length
1782
2583
  );
1783
2584
  }
1784
- return (v, f) => {
1785
- const c = resolveComponent("FmButton"), m = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
2585
+ return (f, g) => {
2586
+ const u = resolveComponent("FmButton"), m = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
1786
2587
  return openBlock(), createElementBlock("div", _hoisted_1$c, [
1787
2588
  createElementVNode("div", _hoisted_2$9, toDisplayString(unref(i)("connect.template.configure_reward_type")), 1),
1788
- createVNode(c, {
2589
+ createVNode(u, {
1789
2590
  label: unref(i)("connect.campaign.rewardPool.addReward"),
1790
- onClick: f[0] || (f[0] = (b) => B()),
2591
+ onClick: g[0] || (g[0] = (k) => x()),
1791
2592
  variant: "plain",
1792
2593
  icon: "add"
1793
2594
  }, null, 8, ["label"]),
1794
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (b, E) => (openBlock(), createBlock(m, {
1795
- key: E,
2595
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (k, $) => (openBlock(), createBlock(m, {
2596
+ key: $,
1796
2597
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
1797
2598
  variant: "outlined",
1798
- onClick: (S) => y(E)
2599
+ onClick: (R) => y($)
1799
2600
  }, {
1800
2601
  default: withCtx(() => {
1801
- var S;
2602
+ var R;
1802
2603
  return [
1803
2604
  createElementVNode("div", null, [
1804
- createElementVNode("div", _hoisted_3$7, toDisplayString(b.type == "LOYALTY" ? (S = b == null ? void 0 : b.earningOption) == null ? void 0 : S.amount : "") + " " + toDisplayString(h(b).label), 1),
1805
- createElementVNode("div", _hoisted_4$6, toDisplayString(h(b).sublabel), 1)
2605
+ createElementVNode("div", _hoisted_3$7, toDisplayString(k.type == "LOYALTY" ? (R = k == null ? void 0 : k.earningOption) == null ? void 0 : R.amount : "") + " " + toDisplayString(v(k).label), 1),
2606
+ createElementVNode("div", _hoisted_4$6, toDisplayString(v(k).sublabel), 1)
1806
2607
  ]),
1807
- createVNode(c, {
2608
+ createVNode(u, {
1808
2609
  icon: "delete",
1809
2610
  variant: "tertiary",
1810
- onClick: (x) => (x.stopPropagation(), C(E))
2611
+ onClick: (B) => (B.stopPropagation(), V($))
1811
2612
  }, null, 8, ["onClick"])
1812
2613
  ];
1813
2614
  }),
1814
2615
  _: 2
1815
2616
  }, 1032, ["onClick"]))), 128)),
1816
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter((b) => b.path.join(".") == ""), (b) => (openBlock(), createBlock(k, {
1817
- key: b.message,
1818
- text: b.message,
2617
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter((k) => k.path.join(".") == ""), (k) => (openBlock(), createBlock(C, {
2618
+ key: k.message,
2619
+ text: k.message,
1819
2620
  state: "error"
1820
2621
  }, null, 8, ["text"]))), 128)),
1821
2622
  createVNode(_sfc_main$d, {
@@ -1838,49 +2639,49 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1838
2639
  },
1839
2640
  emits: ["update:model-value"],
1840
2641
  setup(e, { emit: s }) {
1841
- const { t: n } = useI18n(), u = e, d = s, i = computed(() => [
2642
+ const { t: o } = useI18n(), d = e, c = s, i = computed(() => [
1842
2643
  {
1843
- label: n("connect.template.promotion_game.rock_paper_scissors.label"),
1844
- description: n("connect.template.promotion_game.rock_paper_scissors.description"),
2644
+ label: o("connect.template.promotion_game.rock_paper_scissors.label"),
2645
+ description: o("connect.template.promotion_game.rock_paper_scissors.description"),
1845
2646
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
1846
2647
  }
1847
2648
  ]);
1848
- return (l, o) => {
1849
- var h, y, C;
2649
+ return (l, n) => {
2650
+ var v, y, V;
1850
2651
  const a = resolveComponent("FmSwitch"), r = resolveComponent("FmCard"), p = resolveComponent("FmHelperText");
1851
2652
  return openBlock(), createElementBlock("div", _hoisted_1$b, [
1852
2653
  createVNode(a, {
1853
- label: unref(n)("connect.template.promotion_game.enable"),
1854
- "model-value": !!((h = e.modelValue) != null && h.gameType),
1855
- "onUpdate:modelValue": o[0] || (o[0] = (B) => B ? d("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : d("update:model-value", null))
2654
+ label: unref(o)("connect.template.promotion_game.enable"),
2655
+ "model-value": !!((v = e.modelValue) != null && v.gameType),
2656
+ "onUpdate:modelValue": n[0] || (n[0] = (x) => x ? c("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : c("update:model-value", null))
1856
2657
  }, null, 8, ["label", "model-value"]),
1857
2658
  ((y = e.modelValue) == null ? void 0 : y.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
1858
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (B) => {
1859
- var v, f;
2659
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (x) => {
2660
+ var f, g;
1860
2661
  return openBlock(), createBlock(r, {
1861
2662
  variant: "outlined",
1862
2663
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1863
2664
  "col-span-2": unref(i).length == 1,
1864
- "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.gameType) == B.value,
1865
- "hover:bg-fm-color-opacity-sm": ((f = e.modelValue) == null ? void 0 : f.gameType) != B.value
2665
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((f = e.modelValue) == null ? void 0 : f.gameType) == x.value,
2666
+ "hover:bg-fm-color-opacity-sm": ((g = e.modelValue) == null ? void 0 : g.gameType) != x.value
1866
2667
  }]),
1867
2668
  onClick: () => {
1868
- var c;
1869
- ((c = u.modelValue) == null ? void 0 : c.gameType) != B.value && d("update:model-value", { gameType: B.value });
2669
+ var u;
2670
+ ((u = d.modelValue) == null ? void 0 : u.gameType) != x.value && c("update:model-value", { gameType: x.value });
1870
2671
  },
1871
- key: B.value
2672
+ key: x.value
1872
2673
  }, {
1873
2674
  default: withCtx(() => [
1874
- createElementVNode("div", _hoisted_3$6, toDisplayString(B.label), 1),
1875
- createElementVNode("div", _hoisted_4$5, toDisplayString(B.description), 1)
2675
+ createElementVNode("div", _hoisted_3$6, toDisplayString(x.label), 1),
2676
+ createElementVNode("div", _hoisted_4$5, toDisplayString(x.description), 1)
1876
2677
  ]),
1877
2678
  _: 2
1878
2679
  }, 1032, ["class", "onClick"]);
1879
2680
  }), 128))
1880
2681
  ])) : createCommentVNode("", !0),
1881
- ((C = e.modelValue) == null ? void 0 : C.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(p, {
2682
+ ((V = e.modelValue) == null ? void 0 : V.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(p, {
1882
2683
  key: 1,
1883
- text: unref(n)("connect.template.promotion_game.rock_paper_scissors.warning"),
2684
+ text: unref(o)("connect.template.promotion_game.rock_paper_scissors.warning"),
1884
2685
  state: "warning"
1885
2686
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1886
2687
  ]);
@@ -1902,15 +2703,15 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1902
2703
  },
1903
2704
  emits: ["update:model-value"],
1904
2705
  setup(e, { emit: s }) {
1905
- const { t: n } = useI18n(), u = e, d = s, i = ref(u.modelValue ?? {}), l = ref(
2706
+ const { t: o } = useI18n(), d = e, c = s, i = ref(d.modelValue ?? {}), l = ref(
1906
2707
  (() => {
1907
- const h = {};
2708
+ const v = {};
1908
2709
  return i.value.workingHour && Object.keys(i.value.workingHour).forEach((y) => {
1909
- const C = i.value.workingHour[y];
1910
- C && "periods" in C && Array.isArray(C.periods) ? h[y] = C.periods : Array.isArray(C) && (h[y] = C);
1911
- }), h;
2710
+ const V = i.value.workingHour[y];
2711
+ V && "periods" in V && Array.isArray(V.periods) ? v[y] = V.periods : Array.isArray(V) && (v[y] = V);
2712
+ }), v;
1912
2713
  })()
1913
- ), o = [
2714
+ ), n = [
1914
2715
  { key: "mon", label: "Monday" },
1915
2716
  { key: "tue", label: "Tuesday" },
1916
2717
  { key: "wed", label: "Wednesday" },
@@ -1918,41 +2719,41 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1918
2719
  { key: "fri", label: "Friday" },
1919
2720
  { key: "sat", label: "Saturday" },
1920
2721
  { key: "sun", label: "Sunday" }
1921
- ], a = (h) => {
1922
- l.value[h] || (l.value[h] = []), l.value[h].push({
2722
+ ], a = (v) => {
2723
+ l.value[v] || (l.value[v] = []), l.value[v].push({
1923
2724
  startTime: "00:00",
1924
2725
  endTime: "23:59"
1925
2726
  }), p();
1926
- }, r = (h, y) => {
1927
- l.value[h] && l.value[h].length > y && (l.value[h].splice(y, 1), l.value[h].length === 0 && delete l.value[h], p());
2727
+ }, r = (v, y) => {
2728
+ l.value[v] && l.value[v].length > y && (l.value[v].splice(y, 1), l.value[v].length === 0 && delete l.value[v], p());
1928
2729
  }, p = () => {
1929
- const h = Object.keys(l.value).reduce(
1930
- (y, C) => (l.value[C] && l.value[C].length > 0 && (y[C] = {
1931
- periods: l.value[C]
2730
+ const v = Object.keys(l.value).reduce(
2731
+ (y, V) => (l.value[V] && l.value[V].length > 0 && (y[V] = {
2732
+ periods: l.value[V]
1932
2733
  }), y),
1933
2734
  {}
1934
2735
  );
1935
- i.value.workingHour = Object.keys(h).length > 0 ? h : void 0;
2736
+ i.value.workingHour = Object.keys(v).length > 0 ? v : void 0;
1936
2737
  };
1937
- return watch(i, () => d("update:model-value", i.value), { deep: !0 }), watch(l, p, { deep: !0 }), (h, y) => {
1938
- const C = resolveComponent("FmSelect"), B = resolveComponent("FmStepperField"), v = resolveComponent("FmCheckbox"), f = resolveComponent("FmTimePicker"), c = resolveComponent("FmButton");
2738
+ return watch(i, () => c("update:model-value", i.value), { deep: !0 }), watch(l, p, { deep: !0 }), (v, y) => {
2739
+ const V = resolveComponent("FmSelect"), x = resolveComponent("FmStepperField"), f = resolveComponent("FmCheckbox"), g = resolveComponent("FmTimePicker"), u = resolveComponent("FmButton");
1939
2740
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
1940
2741
  createElementVNode("div", _hoisted_2$7, [
1941
- createVNode(C, {
1942
- label: unref(n)("connect.template.eaterType"),
2742
+ createVNode(V, {
2743
+ label: unref(o)("connect.template.eaterType"),
1943
2744
  modelValue: unref(i).eaterType,
1944
2745
  "onUpdate:modelValue": y[0] || (y[0] = (m) => unref(i).eaterType = m),
1945
2746
  items: [
1946
- { label: unref(n)("connect.template.allEaters"), value: "all" },
1947
- { label: unref(n)("connect.template.newEatersOnly"), value: "new" },
2747
+ { label: unref(o)("connect.template.allEaters"), value: "all" },
2748
+ { label: unref(o)("connect.template.newEatersOnly"), value: "new" },
1948
2749
  {
1949
- label: unref(n)("connect.template.existingEatersOnly"),
2750
+ label: unref(o)("connect.template.existingEatersOnly"),
1950
2751
  value: "existing"
1951
2752
  }
1952
2753
  ],
1953
2754
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "eaterType")]
1954
2755
  }, null, 8, ["label", "modelValue", "items", "rules"]),
1955
- createVNode(B, {
2756
+ createVNode(x, {
1956
2757
  modelValue: unref(i).minBasketAmount,
1957
2758
  "onUpdate:modelValue": y[1] || (y[1] = (m) => unref(i).minBasketAmount = m),
1958
2759
  "show-steppers": !1,
@@ -1962,13 +2763,13 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1962
2763
  (openBlock(), createBlock(resolveDynamicComponent(
1963
2764
  unref(ZodHelper).toInputLabel(
1964
2765
  unref(ZodHelper).typeAtPath(e.schema, "minBasketAmount"),
1965
- unref(n)("connect.template.minBasketAmount")
2766
+ unref(o)("connect.template.minBasketAmount")
1966
2767
  )
1967
2768
  )))
1968
2769
  ]),
1969
2770
  _: 1
1970
2771
  }, 8, ["modelValue", "rules"]),
1971
- createVNode(B, {
2772
+ createVNode(x, {
1972
2773
  modelValue: unref(i).bundleQuantity,
1973
2774
  "onUpdate:modelValue": y[2] || (y[2] = (m) => unref(i).bundleQuantity = m),
1974
2775
  "show-steppers": !1,
@@ -1978,7 +2779,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1978
2779
  (openBlock(), createBlock(resolveDynamicComponent(
1979
2780
  unref(ZodHelper).toInputLabel(
1980
2781
  unref(ZodHelper).typeAtPath(e.schema, "bundleQuantity"),
1981
- unref(n)("connect.template.bundleQuantity")
2782
+ unref(o)("connect.template.bundleQuantity")
1982
2783
  )
1983
2784
  )))
1984
2785
  ]),
@@ -1987,47 +2788,47 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1987
2788
  ]),
1988
2789
  createElementVNode("div", _hoisted_3$5, [
1989
2790
  createElementVNode("div", _hoisted_4$4, [
1990
- createElementVNode("div", _hoisted_5$4, toDisplayString(unref(n)("connect.template.operationHours")), 1),
1991
- (openBlock(), createElementBlock(Fragment, null, renderList(o, (m) => createElementVNode("div", {
2791
+ createElementVNode("div", _hoisted_5$4, toDisplayString(unref(o)("connect.template.operationHours")), 1),
2792
+ (openBlock(), createElementBlock(Fragment, null, renderList(n, (m) => createElementVNode("div", {
1992
2793
  key: m.key,
1993
2794
  class: "space-y-2"
1994
2795
  }, [
1995
2796
  createElementVNode("div", _hoisted_6$3, [
1996
- createVNode(v, {
2797
+ createVNode(f, {
1997
2798
  label: m.label,
1998
2799
  "model-value": !!(unref(l)[m.key] && unref(l)[m.key].length > 0),
1999
- "onUpdate:modelValue": (k) => {
2000
- k ? a(m.key) : (unref(l)[m.key] = [], delete unref(l)[m.key], p());
2800
+ "onUpdate:modelValue": (C) => {
2801
+ C ? a(m.key) : (unref(l)[m.key] = [], delete unref(l)[m.key], p());
2001
2802
  }
2002
2803
  }, null, 8, ["label", "model-value", "onUpdate:modelValue"])
2003
2804
  ]),
2004
2805
  unref(l)[m.key] && unref(l)[m.key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
2005
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[m.key] || [], (k, b) => (openBlock(), createElementBlock("div", {
2006
- key: b,
2806
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[m.key] || [], (C, k) => (openBlock(), createElementBlock("div", {
2807
+ key: k,
2007
2808
  class: "flex items-center space-x-2 w-100"
2008
2809
  }, [
2009
- createVNode(f, {
2010
- "model-value": k.startTime || "",
2011
- "onUpdate:modelValue": (E) => {
2012
- unref(l)[m.key] && unref(l)[m.key][b] && (unref(l)[m.key][b].startTime = E || "", p());
2810
+ createVNode(g, {
2811
+ "model-value": C.startTime || "",
2812
+ "onUpdate:modelValue": ($) => {
2813
+ unref(l)[m.key] && unref(l)[m.key][k] && (unref(l)[m.key][k].startTime = $ || "", p());
2013
2814
  }
2014
2815
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
2015
2816
  y[3] || (y[3] = createElementVNode("span", null, "to", -1)),
2016
- createVNode(f, {
2017
- "model-value": k.endTime || "",
2018
- "onUpdate:modelValue": (E) => {
2019
- unref(l)[m.key] && unref(l)[m.key][b] && (unref(l)[m.key][b].endTime = E || "", p());
2817
+ createVNode(g, {
2818
+ "model-value": C.endTime || "",
2819
+ "onUpdate:modelValue": ($) => {
2820
+ unref(l)[m.key] && unref(l)[m.key][k] && (unref(l)[m.key][k].endTime = $ || "", p());
2020
2821
  }
2021
2822
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
2022
- createVNode(c, {
2823
+ createVNode(u, {
2023
2824
  variant: "tertiary",
2024
2825
  size: "sm",
2025
- onClick: (E) => r(m.key, b),
2826
+ onClick: ($) => r(m.key, k),
2026
2827
  icon: "close"
2027
2828
  }, null, 8, ["onClick"]),
2028
- b === 0 ? (openBlock(), createBlock(c, {
2829
+ k === 0 ? (openBlock(), createBlock(u, {
2029
2830
  key: 0,
2030
- onClick: (E) => a(m.key),
2831
+ onClick: ($) => a(m.key),
2031
2832
  icon: "add",
2032
2833
  variant: "plain"
2033
2834
  }, null, 8, ["onClick"])) : createCommentVNode("", !0)
@@ -2052,14 +2853,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2052
2853
  },
2053
2854
  emits: ["update:model-value"],
2054
2855
  setup(e, { emit: s }) {
2055
- const { t: n } = useI18n(), u = e, d = s, i = ref(u.modelValue ?? {});
2056
- return watch(i, () => d("update:model-value", i.value)), (l, o) => {
2856
+ const { t: o } = useI18n(), d = e, c = s, i = ref(d.modelValue ?? {});
2857
+ return watch(i, () => c("update:model-value", i.value)), (l, n) => {
2057
2858
  const a = resolveComponent("FmStepperField");
2058
2859
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
2059
2860
  createElementVNode("div", _hoisted_2$6, [
2060
2861
  createVNode(a, {
2061
2862
  modelValue: unref(i).totalCount,
2062
- "onUpdate:modelValue": o[0] || (o[0] = (r) => unref(i).totalCount = r),
2863
+ "onUpdate:modelValue": n[0] || (n[0] = (r) => unref(i).totalCount = r),
2063
2864
  "show-steppers": !1,
2064
2865
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCount")]
2065
2866
  }, {
@@ -2067,7 +2868,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2067
2868
  (openBlock(), createBlock(resolveDynamicComponent(
2068
2869
  unref(ZodHelper).toInputLabel(
2069
2870
  unref(ZodHelper).typeAtPath(e.schema, "totalCount"),
2070
- unref(n)("connect.template.totalCount")
2871
+ unref(o)("connect.template.totalCount")
2071
2872
  )
2072
2873
  )))
2073
2874
  ]),
@@ -2075,7 +2876,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2075
2876
  }, 8, ["modelValue", "rules"]),
2076
2877
  createVNode(a, {
2077
2878
  modelValue: unref(i).totalCountPerUser,
2078
- "onUpdate:modelValue": o[1] || (o[1] = (r) => unref(i).totalCountPerUser = r),
2879
+ "onUpdate:modelValue": n[1] || (n[1] = (r) => unref(i).totalCountPerUser = r),
2079
2880
  "show-steppers": !1,
2080
2881
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCountPerUser")]
2081
2882
  }, {
@@ -2083,7 +2884,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2083
2884
  (openBlock(), createBlock(resolveDynamicComponent(
2084
2885
  unref(ZodHelper).toInputLabel(
2085
2886
  unref(ZodHelper).typeAtPath(e.schema, "totalCountPerUser"),
2086
- unref(n)("connect.template.totalCountPerUser")
2887
+ unref(o)("connect.template.totalCountPerUser")
2087
2888
  )
2088
2889
  )))
2089
2890
  ]),
@@ -2102,22 +2903,22 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2102
2903
  },
2103
2904
  emits: ["update:model-value"],
2104
2905
  setup(e, { emit: s }) {
2105
- const { t: n } = useI18n(), u = e, d = s, i = computed(() => [
2906
+ const { t: o } = useI18n(), d = e, c = s, i = computed(() => [
2106
2907
  {
2107
- label: n("connect.campaign.mission.typeOption.STAMP.label"),
2108
- description: n("connect.campaign.mission.typeOption.STAMP.description"),
2908
+ label: o("connect.campaign.mission.typeOption.STAMP.label"),
2909
+ description: o("connect.campaign.mission.typeOption.STAMP.description"),
2109
2910
  value: F_MISSION_TYPE.enum.STAMP
2110
2911
  },
2111
2912
  {
2112
- label: n("connect.campaign.mission.typeOption.PROGRESSIVE.label"),
2113
- description: n("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
2913
+ label: o("connect.campaign.mission.typeOption.PROGRESSIVE.label"),
2914
+ description: o("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
2114
2915
  value: F_MISSION_TYPE.enum.PROGRESSIVE
2115
2916
  }
2116
2917
  ]);
2117
- return (l, o) => {
2918
+ return (l, n) => {
2118
2919
  const a = resolveComponent("FmCard");
2119
2920
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
2120
- createElementVNode("div", _hoisted_2$5, toDisplayString(unref(n)("connect.template.select_game")), 1),
2921
+ createElementVNode("div", _hoisted_2$5, toDisplayString(unref(o)("connect.template.select_game")), 1),
2121
2922
  createElementVNode("div", _hoisted_3$4, [
2122
2923
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (r) => (openBlock(), createBlock(a, {
2123
2924
  variant: "outlined",
@@ -2127,7 +2928,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2127
2928
  "hover:bg-fm-color-opacity-sm": e.modelValue != r.value
2128
2929
  }]),
2129
2930
  onClick: () => {
2130
- u.modelValue != r.value && d("update:model-value", r.value);
2931
+ d.modelValue != r.value && c("update:model-value", r.value);
2131
2932
  },
2132
2933
  key: r.value
2133
2934
  }, {
@@ -2156,15 +2957,15 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2156
2957
  },
2157
2958
  emits: ["update:model-value"],
2158
2959
  setup(e, { emit: s }) {
2159
- const n = s;
2160
- return (u, d) => {
2960
+ const o = s;
2961
+ return (d, c) => {
2161
2962
  const i = resolveComponent("FmStepperField");
2162
2963
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
2163
- d[1] || (d[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)),
2964
+ c[1] || (c[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)),
2164
2965
  createVNode(i, {
2165
2966
  label: "Maximum to collect",
2166
2967
  "model-value": e.modelValue || null,
2167
- "onUpdate:modelValue": d[0] || (d[0] = (l) => n("update:model-value", l)),
2968
+ "onUpdate:modelValue": c[0] || (c[0] = (l) => o("update:model-value", l)),
2168
2969
  "helper-text": e.helperText || "Set the threshold required for reward eligibility",
2169
2970
  "helper-state": e.helperState || "none"
2170
2971
  }, null, 8, ["model-value", "helper-text", "helper-state"])
@@ -2180,29 +2981,29 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2180
2981
  }
2181
2982
  },
2182
2983
  emits: ["update:model-value"],
2183
- setup(e, { expose: s, emit: n }) {
2184
- const u = e, d = useMembershipStore(), { minor: i } = useLoading, l = ref(!1), o = ref(), a = ref(), r = ref(0), p = computed(() => {
2185
- var c;
2186
- return ((c = d.loyaltyRewards.items.find(
2984
+ setup(e, { expose: s, emit: o }) {
2985
+ const d = e, c = useMembershipStore(), { minor: i } = useLoading, l = ref(!1), n = ref(), a = ref(), r = ref(0), p = computed(() => {
2986
+ var u;
2987
+ return ((u = c.loyaltyRewards.items.find(
2187
2988
  (m) => {
2188
- var k;
2189
- return m.value === ((k = o.value) == null ? void 0 : k.collectible);
2989
+ var C;
2990
+ return m.value === ((C = n.value) == null ? void 0 : C.collectible);
2190
2991
  }
2191
- )) == null ? void 0 : c.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
2192
- }), h = computed(() => {
2193
- const f = p.value.safeParse(o.value);
2194
- return f.success ? [] : f.error.errors;
2992
+ )) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
2993
+ }), v = computed(() => {
2994
+ const g = p.value.safeParse(n.value);
2995
+ return g.success ? [] : g.error.errors;
2195
2996
  });
2196
- function y(f, c, m) {
2197
- f && (o.value = c, r.value = m), l.value = f;
2997
+ function y(g, u, m) {
2998
+ g && (n.value = u, r.value = m), l.value = g;
2198
2999
  }
2199
- const C = n;
2200
- async function B() {
2201
- const f = p.value.safeParse(o.value);
2202
- f.success && (await i(
3000
+ const V = o;
3001
+ async function x() {
3002
+ const g = p.value.safeParse(n.value);
3003
+ g.success && (await i(
2203
3004
  async () => {
2204
- f.data.type === "VOUCHER" && a.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
2205
- f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
3005
+ g.data.type === "VOUCHER" && a.value && (g.data.collectibleConfig.image = await firebaseStorage.update(
3006
+ g.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
2206
3007
  a.value
2207
3008
  ));
2208
3009
  },
@@ -2210,82 +3011,82 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2210
3011
  message: "Uploading reward image",
2211
3012
  successMessage: "Reward image updated"
2212
3013
  }
2213
- ), C("update:model-value", f.data, r.value));
3014
+ ), V("update:model-value", g.data, r.value));
2214
3015
  }
2215
- const v = ref();
3016
+ const f = ref();
2216
3017
  return s({
2217
3018
  showSheet: y
2218
- }), (f, c) => {
2219
- const m = resolveComponent("FmStepperField"), k = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), E = resolveComponent("FmButton"), S = resolveComponent("FmSideSheet");
2220
- return openBlock(), createBlock(S, {
3019
+ }), (g, u) => {
3020
+ const m = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), k = resolveComponent("FmForm"), $ = resolveComponent("FmButton"), R = resolveComponent("FmSideSheet");
3021
+ return openBlock(), createBlock(R, {
2221
3022
  "max-width": 560,
2222
3023
  modelValue: unref(l),
2223
3024
  "onUpdate:modelValue": [
2224
- c[10] || (c[10] = (x) => isRef(l) ? l.value = x : null),
2225
- c[11] || (c[11] = (x) => l.value = x)
3025
+ u[10] || (u[10] = (B) => isRef(l) ? l.value = B : null),
3026
+ u[11] || (u[11] = (B) => l.value = B)
2226
3027
  ],
2227
3028
  header: "Edit reward",
2228
3029
  "dismiss-away": ""
2229
3030
  }, {
2230
3031
  "side-sheet-footer": withCtx(() => [
2231
3032
  createElementVNode("div", _hoisted_1$6, [
2232
- createVNode(E, {
3033
+ createVNode($, {
2233
3034
  variant: "primary",
2234
3035
  type: "button",
2235
3036
  label: "Confirm",
2236
- disabled: unref(h).length > 0,
2237
- onClick: c[8] || (c[8] = async () => {
2238
- var x;
2239
- return (x = unref(v)) == null ? void 0 : x.validateInputs();
3037
+ disabled: unref(v).length > 0,
3038
+ onClick: u[8] || (u[8] = async () => {
3039
+ var B;
3040
+ return (B = unref(f)) == null ? void 0 : B.validateInputs();
2240
3041
  })
2241
3042
  }, null, 8, ["disabled"]),
2242
- createVNode(E, {
3043
+ createVNode($, {
2243
3044
  variant: "secondary",
2244
3045
  type: "button",
2245
3046
  label: "Cancel",
2246
- onClick: c[9] || (c[9] = (x) => l.value = !1)
3047
+ onClick: u[9] || (u[9] = (B) => l.value = !1)
2247
3048
  })
2248
3049
  ])
2249
3050
  ]),
2250
3051
  default: withCtx(() => [
2251
- createVNode(JsonViewer, { json: unref(o) }, null, 8, ["json"]),
2252
- unref(o) ? (openBlock(), createBlock(b, {
3052
+ createVNode(JsonViewer, { json: unref(n) }, null, 8, ["json"]),
3053
+ unref(n) ? (openBlock(), createBlock(k, {
2253
3054
  key: 0,
2254
3055
  class: "flex flex-col gap-y-24",
2255
3056
  ref_key: "formRef",
2256
- ref: v,
2257
- onValidationSuccess: c[7] || (c[7] = (x) => B())
3057
+ ref: f,
3058
+ onValidationSuccess: u[7] || (u[7] = (B) => x())
2258
3059
  }, {
2259
3060
  default: withCtx(() => {
2260
- var x, R;
3061
+ var B, D;
2261
3062
  return [
2262
- unref(o).type ? (openBlock(), createBlock(m, {
3063
+ unref(n).type ? (openBlock(), createBlock(m, {
2263
3064
  key: 0,
2264
3065
  label: "Threshold",
2265
3066
  rules: [
2266
3067
  unref(ZodHelper).toRule(
2267
3068
  unref(z$1).number().min(1).max(
2268
- u.maxThreshold,
2269
- `Number cannot be more than ${u.maxThreshold}`
3069
+ d.maxThreshold,
3070
+ `Number cannot be more than ${d.maxThreshold}`
2270
3071
  )
2271
3072
  )
2272
3073
  ],
2273
- "model-value": unref(o).threshold,
2274
- "onUpdate:modelValue": c[0] || (c[0] = (N) => o.value = {
2275
- ...unref(o),
2276
- threshold: N
3074
+ "model-value": unref(n).threshold,
3075
+ "onUpdate:modelValue": u[0] || (u[0] = (w) => n.value = {
3076
+ ...unref(n),
3077
+ threshold: w
2277
3078
  })
2278
3079
  }, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
2279
- createVNode(k, {
3080
+ createVNode(C, {
2280
3081
  label: "Reward Type",
2281
3082
  items: [
2282
3083
  { label: "Voucher", value: "VOUCHER" },
2283
3084
  { label: "Loyalty", value: "LOYALTY" }
2284
3085
  ],
2285
- "model-value": unref(o).type,
2286
- "onUpdate:modelValue": c[1] || (c[1] = (N) => {
2287
- var w, A;
2288
- N === "VOUCHER" ? o.value = {
3086
+ "model-value": unref(n).type,
3087
+ "onUpdate:modelValue": u[1] || (u[1] = (w) => {
3088
+ var O, L;
3089
+ w === "VOUCHER" ? n.value = {
2289
3090
  collectible: null,
2290
3091
  type: "VOUCHER",
2291
3092
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -2298,9 +3099,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2298
3099
  validityOption: {
2299
3100
  validForDay: 7
2300
3101
  },
2301
- threshold: (w = unref(o)) == null ? void 0 : w.threshold
2302
- } : o.value = {
2303
- collectible: unref(d).loyaltyRewards.raw[0]._id,
3102
+ threshold: (O = unref(n)) == null ? void 0 : O.threshold
3103
+ } : n.value = {
3104
+ collectible: unref(c).loyaltyRewards.raw[0]._id,
2304
3105
  type: "LOYALTY",
2305
3106
  earningOption: {
2306
3107
  amount: 1,
@@ -2309,60 +3110,60 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2309
3110
  validityOption: {
2310
3111
  validForDay: 7
2311
3112
  },
2312
- threshold: (A = unref(o)) == null ? void 0 : A.threshold
3113
+ threshold: (L = unref(n)) == null ? void 0 : L.threshold
2313
3114
  };
2314
3115
  })
2315
3116
  }, null, 8, ["model-value"]),
2316
- unref(o).type == "LOYALTY" ? (openBlock(), createBlock(k, {
3117
+ unref(n).type == "LOYALTY" ? (openBlock(), createBlock(C, {
2317
3118
  key: 1,
2318
3119
  label: "Loyalty type",
2319
- rules: [unref(ZodHelper).ruleAtPath(unref(p), "collectible", [unref(o).type])],
2320
- items: unref(d).loyaltyRewards.items,
2321
- "model-value": unref(o).collectible,
2322
- "onUpdate:modelValue": c[2] || (c[2] = (N) => unref(o).collectible = N)
3120
+ rules: [unref(ZodHelper).ruleAtPath(unref(p), "collectible", [unref(n).type])],
3121
+ items: unref(c).loyaltyRewards.items,
3122
+ "model-value": unref(n).collectible,
3123
+ "onUpdate:modelValue": u[2] || (u[2] = (w) => unref(n).collectible = w)
2323
3124
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
2324
- unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
2325
- c[12] || (c[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
2326
- createVNode(_sfc_main$q, {
3125
+ unref(n).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
3126
+ u[12] || (u[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
3127
+ createVNode(_sfc_main$z, {
2327
3128
  class: "mt-[-8px]",
2328
- rules: [unref(ZodHelper).ruleAtPath(unref(p), "earningOption", [unref(o).type])],
2329
- "helper-state": unref(ZodHelper).helperState(unref(h), "earningOption"),
2330
- "error-text": unref(ZodHelper).helperText(unref(h), "earningOption"),
3129
+ rules: [unref(ZodHelper).ruleAtPath(unref(p), "earningOption", [unref(n).type])],
3130
+ "helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
3131
+ "error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
2331
3132
  "fixed-type": !0,
2332
- "model-value": unref(o).earningOption,
2333
- "onUpdate:modelValue": c[3] || (c[3] = (N) => o.value = {
2334
- ...unref(o),
2335
- earningOption: N
3133
+ "model-value": unref(n).earningOption,
3134
+ "onUpdate:modelValue": u[3] || (u[3] = (w) => n.value = {
3135
+ ...unref(n),
3136
+ earningOption: w
2336
3137
  })
2337
3138
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
2338
- createVNode(_sfc_main$r, {
3139
+ createVNode(_sfc_main$A, {
2339
3140
  class: "!gap-24",
2340
- type: unref(o).type === "LOYALTY" ? "custom" : "range",
2341
- "for-credit": unref(o).type === "LOYALTY" && ((x = unref(d).loyaltyRewards.items.find(
2342
- (N) => {
2343
- var w;
2344
- return N.value === ((w = unref(o)) == null ? void 0 : w.collectible);
3141
+ type: unref(n).type === "LOYALTY" ? "custom" : "range",
3142
+ "for-credit": unref(n).type === "LOYALTY" && ((B = unref(c).loyaltyRewards.items.find(
3143
+ (w) => {
3144
+ var O;
3145
+ return w.value === ((O = unref(n)) == null ? void 0 : O.collectible);
2345
3146
  }
2346
- )) == null ? void 0 : x.raw.type) === "CREDIT",
2347
- rules: [unref(ZodHelper).ruleAtPath(unref(p), "validityOption", [unref(o).type])],
2348
- "model-value": unref(o).validityOption,
2349
- "onUpdate:modelValue": c[4] || (c[4] = (N) => o.value = {
2350
- ...unref(o),
2351
- validityOption: N
3147
+ )) == null ? void 0 : B.raw.type) === "CREDIT",
3148
+ rules: [unref(ZodHelper).ruleAtPath(unref(p), "validityOption", [unref(n).type])],
3149
+ "model-value": unref(n).validityOption,
3150
+ "onUpdate:modelValue": u[4] || (u[4] = (w) => n.value = {
3151
+ ...unref(n),
3152
+ validityOption: w
2352
3153
  })
2353
3154
  }, null, 8, ["type", "for-credit", "rules", "model-value"])
2354
3155
  ], 64)) : createCommentVNode("", !0),
2355
- unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$s, {
3156
+ unref(n).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$B, {
2356
3157
  key: 3,
2357
3158
  "reward-image": unref(a),
2358
- "model-value": ((R = unref(o)) == null ? void 0 : R.collectibleConfig) ?? void 0,
2359
- "onUpdate:modelValue": c[5] || (c[5] = (N) => o.value = {
2360
- ...unref(o),
2361
- collectibleConfig: N
3159
+ "model-value": ((D = unref(n)) == null ? void 0 : D.collectibleConfig) ?? void 0,
3160
+ "onUpdate:modelValue": u[5] || (u[5] = (w) => n.value = {
3161
+ ...unref(n),
3162
+ collectibleConfig: w
2362
3163
  }),
2363
- "onUpdate:rewardImage": c[6] || (c[6] = (N) => a.value = N)
3164
+ "onUpdate:rewardImage": u[6] || (u[6] = (w) => a.value = w)
2364
3165
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
2365
- createVNode(JsonViewer, { json: unref(h) }, null, 8, ["json"])
3166
+ createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
2366
3167
  ];
2367
3168
  }),
2368
3169
  _: 1
@@ -2396,19 +3197,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2396
3197
  }
2397
3198
  },
2398
3199
  setup(e) {
2399
- const s = e, { maxRange: n, currentRange: u, markers: d } = toRefs(s), i = computed(
2400
- () => Math.min(u.value / n.value * 100, 100)
2401
- ), l = (o) => o / n.value * 100;
2402
- return (o, a) => {
3200
+ const s = e, { maxRange: o, currentRange: d, markers: c } = toRefs(s), i = computed(
3201
+ () => Math.min(d.value / o.value * 100, 100)
3202
+ ), l = (n) => n / o.value * 100;
3203
+ return (n, a) => {
2403
3204
  const r = resolveComponent("FmIcon");
2404
3205
  return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
2405
- (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (p) => (openBlock(), createBlock(r, {
3206
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(o), 40), (p) => (openBlock(), createBlock(r, {
2406
3207
  class: normalizeClass(
2407
- unref(u) >= p ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
3208
+ unref(d) >= p ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
2408
3209
  ),
2409
- outline: unref(u) < p,
3210
+ outline: unref(d) < p,
2410
3211
  key: p,
2411
- name: unref(d).some((h) => h === p) ? "featured_seasonal_and_gifts" : "check_circle"
3212
+ name: unref(c).some((v) => v === p) ? "featured_seasonal_and_gifts" : "check_circle"
2412
3213
  }, null, 8, ["class", "outline", "name"]))), 128))
2413
3214
  ])) : (openBlock(), createElementBlock("div", {
2414
3215
  key: 1,
@@ -2418,8 +3219,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2418
3219
  class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
2419
3220
  style: normalizeStyle({ width: unref(i) + "%" })
2420
3221
  }, null, 4),
2421
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(d), (p, h) => (openBlock(), createElementBlock("div", {
2422
- key: h,
3222
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(c), (p, v) => (openBlock(), createElementBlock("div", {
3223
+ key: v,
2423
3224
  class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
2424
3225
  style: normalizeStyle({ left: l(p) + "%" })
2425
3226
  }, [
@@ -2435,14 +3236,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2435
3236
  }
2436
3237
  }), isObject = (e) => e !== null && typeof e == "object";
2437
3238
  function changeKeysFactory(e) {
2438
- return function s(n, u = 1, d) {
2439
- if (u === 0 || !isObject(n))
2440
- return n;
2441
- if (Array.isArray(n))
2442
- return n.map((l) => s(l, u - 1, d));
2443
- const i = Object.create(Object.getPrototypeOf(n));
2444
- return Object.keys(n).forEach((l) => {
2445
- const o = n[l], a = e(l, d), r = s(o, u - 1, d);
3239
+ return function s(o, d = 1, c) {
3240
+ if (d === 0 || !isObject(o))
3241
+ return o;
3242
+ if (Array.isArray(o))
3243
+ return o.map((l) => s(l, d - 1, c));
3244
+ const i = Object.create(Object.getPrototypeOf(o));
3245
+ return Object.keys(o).forEach((l) => {
3246
+ const n = o[l], a = e(l, c), r = s(n, d - 1, c);
2446
3247
  i[a] = r;
2447
3248
  }), i;
2448
3249
  };
@@ -2461,45 +3262,45 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2461
3262
  },
2462
3263
  emits: ["update:model-value"],
2463
3264
  setup(e, { emit: s }) {
2464
- const { t: n } = useI18n(), u = e, d = s, i = useMembershipStore(), l = z$1.array(z$1.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
2465
- () => u.modelValue.sort((f, c) => f.threshold - c.threshold) ?? []
3265
+ const { t: o } = useI18n(), d = e, c = s, i = useMembershipStore(), l = z$1.array(z$1.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), n = computed(
3266
+ () => d.modelValue.sort((g, u) => g.threshold - u.threshold) ?? []
2466
3267
  ), a = computed(() => {
2467
- const f = l.safeParse(o.value);
2468
- return f.success ? [] : f.error.errors;
3268
+ const g = l.safeParse(n.value);
3269
+ return g.success ? [] : g.error.errors;
2469
3270
  }), r = ref();
2470
- function p(f, c) {
2471
- var k;
2472
- const m = [...o.value];
2473
- m[c] = f, (k = r.value) == null || k.showSheet(!1), d("update:model-value", m);
2474
- }
2475
- function h(f) {
2476
- const c = f.type == "VOUCHER" ? f.collectibleConfig : i.collectibles.find(
2477
- (b) => b._id.toString() == f.collectible
2478
- ), m = CollectionUtils.formattedType((c == null ? void 0 : c.name) || ""), k = f.earningOption.type == "FIXED" ? n("connect.template.mission_pool.reward_sublabel_fixed", {
2479
- threshold: f.threshold,
2480
- amount: f.earningOption.amount
2481
- }) : n("connect.template.mission_pool.reward_sublabel_per_spend", {
2482
- threshold: f.threshold,
2483
- amount: f.earningOption.amount,
2484
- every: f.earningOption.every
3271
+ function p(g, u) {
3272
+ var C;
3273
+ const m = [...n.value];
3274
+ m[u] = g, (C = r.value) == null || C.showSheet(!1), c("update:model-value", m);
3275
+ }
3276
+ function v(g) {
3277
+ const u = g.type == "VOUCHER" ? g.collectibleConfig : i.collectibles.find(
3278
+ (k) => k._id.toString() == g.collectible
3279
+ ), m = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), C = g.earningOption.type == "FIXED" ? o("connect.template.mission_pool.reward_sublabel_fixed", {
3280
+ threshold: g.threshold,
3281
+ amount: g.earningOption.amount
3282
+ }) : o("connect.template.mission_pool.reward_sublabel_per_spend", {
3283
+ threshold: g.threshold,
3284
+ amount: g.earningOption.amount,
3285
+ every: g.earningOption.every
2485
3286
  });
2486
3287
  return {
2487
- label: isNullOrEmpty(m) ? n("connect.template.mission_pool.no_reward") : m,
2488
- sublabel: k
3288
+ label: isNullOrEmpty(m) ? o("connect.template.mission_pool.no_reward") : m,
3289
+ sublabel: C
2489
3290
  };
2490
3291
  }
2491
- function y(f) {
3292
+ function y(g) {
2492
3293
  var m;
2493
- const c = [...o.value];
2494
- (m = r.value) == null || m.showSheet(!0, c[f], f);
3294
+ const u = [...n.value];
3295
+ (m = r.value) == null || m.showSheet(!0, u[g], g);
2495
3296
  }
2496
- function C(f) {
2497
- const c = [...o.value];
2498
- c.splice(f, 1), d("update:model-value", c);
3297
+ function V(g) {
3298
+ const u = [...n.value];
3299
+ u.splice(g, 1), c("update:model-value", u);
2499
3300
  }
2500
- function B() {
2501
- var f;
2502
- (f = r.value) == null || f.showSheet(
3301
+ function x() {
3302
+ var g;
3303
+ (g = r.value) == null || g.showSheet(
2503
3304
  !0,
2504
3305
  {
2505
3306
  type: "LOYALTY",
@@ -2513,64 +3314,64 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2513
3314
  amount: 1
2514
3315
  }
2515
3316
  },
2516
- o.value.length
3317
+ n.value.length
2517
3318
  );
2518
3319
  }
2519
- function v(f) {
2520
- var c, m;
2521
- return f.type == "VOUCHER" ? (c = f.collectibleConfig) == null ? void 0 : c.name : sentenceCase(
3320
+ function f(g) {
3321
+ var u, m;
3322
+ return g.type == "VOUCHER" ? (u = g.collectibleConfig) == null ? void 0 : u.name : sentenceCase(
2522
3323
  ((m = i.loyaltyRewards.items.find(
2523
- (k) => k.value == f.collectible
3324
+ (C) => C.value == g.collectible
2524
3325
  )) == null ? void 0 : m.label) || ""
2525
3326
  );
2526
3327
  }
2527
- return (f, c) => {
2528
- const m = resolveComponent("FmButton"), k = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
3328
+ return (g, u) => {
3329
+ const m = resolveComponent("FmButton"), C = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
2529
3330
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
2530
- createElementVNode("div", _hoisted_2$3, toDisplayString(unref(n)("connect.template.configure_reward_customer")), 1),
3331
+ createElementVNode("div", _hoisted_2$3, toDisplayString(unref(o)("connect.template.configure_reward_customer")), 1),
2531
3332
  createVNode(m, {
2532
- label: unref(n)("connect.template.mission_pool.add_reward"),
2533
- onClick: c[0] || (c[0] = (E) => B()),
3333
+ label: unref(o)("connect.template.mission_pool.add_reward"),
3334
+ onClick: u[0] || (u[0] = ($) => x()),
2534
3335
  variant: "plain",
2535
3336
  icon: "add"
2536
3337
  }, null, 8, ["label"]),
2537
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (E, S) => (openBlock(), createBlock(k, {
2538
- key: S,
3338
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), ($, R) => (openBlock(), createBlock(C, {
3339
+ key: R,
2539
3340
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
2540
3341
  variant: "outlined",
2541
- onClick: (x) => y(S)
3342
+ onClick: (B) => y(R)
2542
3343
  }, {
2543
3344
  default: withCtx(() => [
2544
3345
  createElementVNode("div", null, [
2545
- createElementVNode("div", _hoisted_3$3, toDisplayString(h(E).label), 1),
2546
- createElementVNode("div", _hoisted_4$2, toDisplayString(h(E).sublabel), 1)
3346
+ createElementVNode("div", _hoisted_3$3, toDisplayString(v($).label), 1),
3347
+ createElementVNode("div", _hoisted_4$2, toDisplayString(v($).sublabel), 1)
2547
3348
  ]),
2548
3349
  createVNode(m, {
2549
3350
  icon: "delete",
2550
3351
  variant: "tertiary",
2551
- onClick: (x) => (x.stopPropagation(), C(S))
3352
+ onClick: (B) => (B.stopPropagation(), V(R))
2552
3353
  }, null, 8, ["onClick"])
2553
3354
  ]),
2554
3355
  _: 2
2555
3356
  }, 1032, ["onClick"]))), 128)),
2556
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter((E) => E.path.join(".") == ""), (E) => (openBlock(), createBlock(b, {
2557
- key: E.message,
2558
- text: E.message,
3357
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter(($) => $.path.join(".") == ""), ($) => (openBlock(), createBlock(k, {
3358
+ key: $.message,
3359
+ text: $.message,
2559
3360
  state: "error"
2560
3361
  }, null, 8, ["text"]))), 128)),
2561
- createElementVNode("div", _hoisted_5$2, toDisplayString(unref(n)("connect.template.mission_pool.preview")), 1),
2562
- (openBlock(), createBlock(k, {
3362
+ createElementVNode("div", _hoisted_5$2, toDisplayString(unref(o)("connect.template.mission_pool.preview")), 1),
3363
+ (openBlock(), createBlock(C, {
2563
3364
  key: 0,
2564
3365
  variant: "outlined",
2565
3366
  class: "p-24 space-y-16 w-fit"
2566
3367
  }, {
2567
3368
  default: withCtx(() => {
2568
- var E, S;
3369
+ var $, R;
2569
3370
  return [
2570
3371
  createElementVNode("div", _hoisted_6$2, [
2571
3372
  createElementVNode("div", null, [
2572
- createElementVNode("div", _hoisted_7$2, toDisplayString(unref(n)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString(((E = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : E.earningOption.amount) > 1 ? (S = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : S.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? v(e.modelValue[e.modelValue.length - 1]) : ""), 1),
2573
- createElementVNode("div", _hoisted_8$2, toDisplayString(unref(n)("connect.template.mission_pool.earn_stamp")), 1)
3373
+ 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 ? (R = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : R.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? f(e.modelValue[e.modelValue.length - 1]) : ""), 1),
3374
+ createElementVNode("div", _hoisted_8$2, toDisplayString(unref(o)("connect.template.mission_pool.earn_stamp")), 1)
2574
3375
  ])
2575
3376
  ]),
2576
3377
  createElementVNode("div", _hoisted_9$2, [
@@ -2578,7 +3379,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2578
3379
  type: e.mission.type,
2579
3380
  "max-range": e.mission.end,
2580
3381
  currentRange: e.mission.end / 4,
2581
- markers: e.modelValue.map((x) => x.threshold)
3382
+ markers: e.modelValue.map((B) => B.threshold)
2582
3383
  }, null, 8, ["type", "max-range", "currentRange", "markers"]),
2583
3384
  e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
2584
3385
  ])
@@ -2602,44 +3403,44 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2602
3403
  },
2603
3404
  emits: ["update:model-value"],
2604
3405
  setup(e, { emit: s }) {
2605
- const { t: n } = useI18n(), u = e, d = computed(() => {
2606
- const o = FdoMission.safeParse(u.modelValue);
2607
- return o.success ? [] : o.error.errors;
3406
+ const { t: o } = useI18n(), d = e, c = computed(() => {
3407
+ const n = FdoMission.safeParse(d.modelValue);
3408
+ return n.success ? [] : n.error.errors;
2608
3409
  }), i = computed(() => [
2609
3410
  {
2610
- label: n("connect.campaign.mission.typeOption.STAMP.label"),
2611
- description: n("connect.campaign.mission.typeOption.STAMP.description"),
3411
+ label: o("connect.campaign.mission.typeOption.STAMP.label"),
3412
+ description: o("connect.campaign.mission.typeOption.STAMP.description"),
2612
3413
  value: F_MISSION_TYPE.enum.STAMP
2613
3414
  },
2614
3415
  {
2615
- label: n("connect.campaign.mission.typeOption.PROGRESSIVE.label"),
2616
- description: n("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
3416
+ label: o("connect.campaign.mission.typeOption.PROGRESSIVE.label"),
3417
+ description: o("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
2617
3418
  value: F_MISSION_TYPE.enum.PROGRESSIVE
2618
3419
  }
2619
3420
  ]), l = s;
2620
- return (o, a) => {
2621
- var h;
3421
+ return (n, a) => {
3422
+ var v;
2622
3423
  const r = resolveComponent("FmCard"), p = resolveComponent("FmStepperField");
2623
3424
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
2624
3425
  createElementVNode("div", _hoisted_2$2, [
2625
- createElementVNode("div", _hoisted_3$2, toDisplayString(unref(n)("connect.campaign.mission.missionType")), 1),
2626
- createElementVNode("div", _hoisted_4$1, toDisplayString(unref(n)("connect.template.select_game")), 1),
3426
+ createElementVNode("div", _hoisted_3$2, toDisplayString(unref(o)("connect.campaign.mission.missionType")), 1),
3427
+ createElementVNode("div", _hoisted_4$1, toDisplayString(unref(o)("connect.template.select_game")), 1),
2627
3428
  createElementVNode("div", _hoisted_5$1, [
2628
3429
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (y) => {
2629
- var C, B;
3430
+ var V, x;
2630
3431
  return openBlock(), createBlock(r, {
2631
3432
  variant: "outlined",
2632
3433
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
2633
3434
  "col-span-2": unref(i).length == 1,
2634
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((C = e.modelValue) == null ? void 0 : C.type) == y.value,
2635
- "hover:bg-fm-color-opacity-sm": ((B = e.modelValue) == null ? void 0 : B.type) != y.value
3435
+ "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) == y.value,
3436
+ "hover:bg-fm-color-opacity-sm": ((x = e.modelValue) == null ? void 0 : x.type) != y.value
2636
3437
  }]),
2637
3438
  onClick: () => {
2638
- var v, f;
2639
- ((v = e.modelValue) == null ? void 0 : v.type) != y.value && l("update:model-value", {
3439
+ var f, g;
3440
+ ((f = e.modelValue) == null ? void 0 : f.type) != y.value && l("update:model-value", {
2640
3441
  ...e.modelValue,
2641
3442
  type: y.value,
2642
- end: ((f = e.modelValue) == null ? void 0 : f.end) || 1
3443
+ end: ((g = e.modelValue) == null ? void 0 : g.end) || 1
2643
3444
  });
2644
3445
  },
2645
3446
  key: y.value
@@ -2654,21 +3455,21 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2654
3455
  ])
2655
3456
  ]),
2656
3457
  createElementVNode("div", _hoisted_8$1, [
2657
- createElementVNode("div", _hoisted_9$1, toDisplayString(unref(n)("connect.campaign.mission.collectionsRequired")), 1),
2658
- createElementVNode("div", _hoisted_10$1, toDisplayString(unref(n)("connect.campaign.mission.collectionsRequiredDescription")), 1),
3458
+ createElementVNode("div", _hoisted_9$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequired")), 1),
3459
+ createElementVNode("div", _hoisted_10$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequiredDescription")), 1),
2659
3460
  createVNode(p, {
2660
- label: unref(n)("connect.campaign.mission.maximumToCollect"),
2661
- "model-value": ((h = e.modelValue) == null ? void 0 : h.end) || null,
3461
+ label: unref(o)("connect.campaign.mission.maximumToCollect"),
3462
+ "model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
2662
3463
  "onUpdate:modelValue": a[0] || (a[0] = (y) => {
2663
- var C;
3464
+ var V;
2664
3465
  return l("update:model-value", {
2665
3466
  ...e.modelValue,
2666
- type: ((C = e.modelValue) == null ? void 0 : C.type) || "STAMP",
3467
+ type: ((V = e.modelValue) == null ? void 0 : V.type) || "STAMP",
2667
3468
  end: y
2668
3469
  });
2669
3470
  }),
2670
- "helper-text": unref(ZodHelper).helperText(unref(d), "end") || unref(n)("connect.campaign.mission.thresholdHelperText"),
2671
- "helper-state": unref(ZodHelper).helperState(unref(d), "end") || "none"
3471
+ "helper-text": unref(ZodHelper).helperText(unref(c), "end") || unref(o)("connect.campaign.mission.thresholdHelperText"),
3472
+ "helper-state": unref(ZodHelper).helperState(unref(c), "end") || "none"
2672
3473
  }, null, 8, ["label", "model-value", "helper-text", "helper-state"])
2673
3474
  ])
2674
3475
  ]);
@@ -2677,10 +3478,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2677
3478
  });
2678
3479
  function useLocaleText() {
2679
3480
  const { locale: e, t: s } = useI18n();
2680
- function n(u, d) {
2681
- return u ? u[e.value] ?? u["en-US"] ?? s(d) : s(d);
3481
+ function o(d, c) {
3482
+ return d ? d[e.value] ?? d["en-US"] ?? s(c) : s(c);
2682
3483
  }
2683
- return { getLocaleText: n };
3484
+ return { getLocaleText: o };
2684
3485
  }
2685
3486
  const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
2686
3487
  __name: "TemplateInput",
@@ -2709,15 +3510,15 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
2709
3510
  },
2710
3511
  emits: ["update:model-value", "update:file"],
2711
3512
  setup(e, { emit: s }) {
2712
- const { t: n } = useI18n(), { getLocaleText: u } = useLocaleText(), d = e, i = s;
3513
+ const { t: o } = useI18n(), { getLocaleText: d } = useLocaleText(), c = e, i = s;
2713
3514
  function l(p) {
2714
- switch (d.field.type) {
3515
+ switch (c.field.type) {
2715
3516
  case "timeframe":
2716
- const h = p.startDate ? hooks(p.startDate).startOf("day").toISOString() : void 0, y = p.endDate ? hooks(p.endDate).endOf("day").toISOString() : void 0;
3517
+ const v = p.startDate ? hooks(p.startDate).startOf("day").toISOString() : void 0, y = p.endDate ? hooks(p.endDate).endOf("day").toISOString() : void 0;
2717
3518
  i("update:model-value", {
2718
3519
  type: "timeframe",
2719
3520
  property: "__now",
2720
- start: h,
3521
+ start: v,
2721
3522
  end: y
2722
3523
  });
2723
3524
  break;
@@ -2725,7 +3526,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
2725
3526
  i(
2726
3527
  "update:file",
2727
3528
  p,
2728
- o.value || firebaseStorage.collectibleImagePath(void 0, p)
3529
+ n.value || firebaseStorage.collectibleImagePath(void 0, p)
2729
3530
  );
2730
3531
  break;
2731
3532
  }
@@ -2734,87 +3535,87 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
2734
3535
  break;
2735
3536
  }
2736
3537
  }
2737
- const o = computed(() => {
2738
- switch (d.field.type) {
3538
+ const n = computed(() => {
3539
+ switch (c.field.type) {
2739
3540
  case "timeframe": {
2740
- const p = d.modelValue;
3541
+ const p = c.modelValue;
2741
3542
  return {
2742
3543
  startDate: p != null && p.start ? hooks(p == null ? void 0 : p.start).format("YYYY-MM-DD") : null,
2743
3544
  endDate: p != null && p.end ? hooks(p == null ? void 0 : p.end).format("YYYY-MM-DD") : null
2744
3545
  };
2745
3546
  }
2746
3547
  default:
2747
- return d.modelValue;
3548
+ return c.modelValue;
2748
3549
  }
2749
3550
  });
2750
3551
  function a() {
2751
3552
  if (!r.value.schema) return [];
2752
- const p = r.value.schema.safeParse(d.modelValue);
3553
+ const p = r.value.schema.safeParse(c.modelValue);
2753
3554
  return p.success ? [] : p.error.errors;
2754
3555
  }
2755
3556
  const r = computed(() => ({
2756
- schema: d.schema,
2757
- unwrapped: d.schema ? ZodHelper.unwrap(d.schema) : void 0,
2758
- rules: d.schema ? [ZodHelper.ruleAtPath(d.schema, "")] : void 0,
2759
- labelMark: d.schema && ZodHelper.isRequired(d.schema) == !1 ? "optional" : void 0,
2760
- zodLabel: d.schema ? ZodHelper.toInputLabel(
2761
- d.schema,
2762
- u(d.field.label_locale, d.field.label ?? "")
3557
+ schema: c.schema,
3558
+ unwrapped: c.schema ? ZodHelper.unwrap(c.schema) : void 0,
3559
+ rules: c.schema ? [ZodHelper.ruleAtPath(c.schema, "")] : void 0,
3560
+ labelMark: c.schema && ZodHelper.isRequired(c.schema) == !1 ? "optional" : void 0,
3561
+ zodLabel: c.schema ? ZodHelper.toInputLabel(
3562
+ c.schema,
3563
+ d(c.field.label_locale, c.field.label ?? "")
2763
3564
  ) : void 0
2764
3565
  }));
2765
- return (p, h) => {
2766
- var c, m, k, b, E;
2767
- const y = resolveComponent("FmTextField"), C = resolveComponent("FmStepperField"), B = resolveComponent("FmTextarea"), v = resolveComponent("FmHelperText"), f = resolveComponent("FmSwitch");
3566
+ return (p, v) => {
3567
+ var u, m, C, k, $;
3568
+ const y = resolveComponent("FmTextField"), V = resolveComponent("FmStepperField"), x = resolveComponent("FmTextarea"), f = resolveComponent("FmHelperText"), g = resolveComponent("FmSwitch");
2768
3569
  return e.field.type === "text" ? (openBlock(), createBlock(y, {
2769
3570
  key: 0,
2770
- label: unref(u)(e.field.label_locale, e.field.label ?? ""),
3571
+ label: unref(d)(e.field.label_locale, e.field.label ?? ""),
2771
3572
  "label-mark": unref(r).labelMark,
2772
3573
  rules: unref(r).rules,
2773
- "model-value": unref(o),
3574
+ "model-value": unref(n),
2774
3575
  "onUpdate:modelValue": l,
2775
3576
  "helper-state": e.helperText ? "error" : void 0,
2776
3577
  "helper-text": e.helperText
2777
3578
  }, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2778
3579
  createVNode(JsonViewer, {
2779
- json: { schema: unref(r).unwrapped, props: d }
3580
+ json: { schema: unref(r).unwrapped, props: c }
2780
3581
  }, null, 8, ["json"]),
2781
- createVNode(C, {
2782
- label: unref(u)(e.field.label_locale, e.field.label ?? ""),
3582
+ createVNode(V, {
3583
+ label: unref(d)(e.field.label_locale, e.field.label ?? ""),
2783
3584
  "label-mark": e.field.isRuleChildren ? void 0 : unref(r).labelMark,
2784
- "model-value": unref(o),
3585
+ "model-value": unref(n),
2785
3586
  rules: e.field.isRuleChildren ? [] : unref(r).rules,
2786
3587
  "onUpdate:modelValue": l,
2787
3588
  "helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
2788
3589
  "helper-text": e.field.isRuleChildren ? e.helperText : void 0
2789
3590
  }, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
2790
- ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(B, {
3591
+ ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(x, {
2791
3592
  key: 2,
2792
- label: unref(u)(e.field.label_locale, e.field.label ?? ""),
3593
+ label: unref(d)(e.field.label_locale, e.field.label ?? ""),
2793
3594
  "label-mark": unref(r).labelMark,
2794
3595
  rules: unref(r).rules,
2795
- "model-value": unref(o),
3596
+ "model-value": unref(n),
2796
3597
  "onUpdate:modelValue": l,
2797
3598
  "show-word-count": "",
2798
- "max-length": (E = (b = (k = (m = (c = unref(r)) == null ? void 0 : c.unwrapped) == null ? void 0 : m._def) == null ? void 0 : k.checks) == null ? void 0 : b.find((S) => S.kind == "max")) == null ? void 0 : E.value
2799
- }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$i, {
3599
+ "max-length": ($ = (k = (C = (m = (u = unref(r)) == null ? void 0 : u.unwrapped) == null ? void 0 : m._def) == null ? void 0 : C.checks) == null ? void 0 : k.find((R) => R.kind == "max")) == null ? void 0 : $.value
3600
+ }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$o, {
2800
3601
  key: 3,
2801
3602
  "campaign-type": e.extras,
2802
- "model-value": unref(o),
3603
+ "model-value": unref(n),
2803
3604
  disabled: e.disabled,
2804
3605
  "onUpdate:modelValue": l
2805
3606
  }, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
2806
- createVNode(_sfc_main$g, {
2807
- "model-value": unref(o),
3607
+ createVNode(_sfc_main$m, {
3608
+ "model-value": unref(n),
2808
3609
  "onUpdate:modelValue": l
2809
3610
  }, null, 8, ["model-value"]),
2810
- createVNode(v, {
3611
+ createVNode(f, {
2811
3612
  class: "!mt-[8px]",
2812
3613
  text: unref(ZodHelper).helperText(a(), ""),
2813
3614
  state: unref(ZodHelper).helperState(a(), "")
2814
3615
  }, null, 8, ["text", "state"])
2815
- ], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$t, {
3616
+ ], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$C, {
2816
3617
  key: 5,
2817
- thumbnail: unref(o),
3618
+ thumbnail: unref(n),
2818
3619
  "aspect-ratio": "16 / 9",
2819
3620
  class: "w-1/2 xs:w-2/3",
2820
3621
  "onUpdate:file": l
@@ -2823,176 +3624,185 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
2823
3624
  (openBlock(), createBlock(resolveDynamicComponent(unref(r).zodLabel)))
2824
3625
  ]),
2825
3626
  _: 1
2826
- }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(f, {
3627
+ }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(g, {
2827
3628
  key: 6,
2828
- label: unref(u)(e.field.label_locale, e.field.label ?? ""),
3629
+ label: unref(d)(e.field.label_locale, e.field.label ?? ""),
2829
3630
  "label-placement": "right",
2830
3631
  sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
2831
3632
  "label-mark": unref(r).labelMark,
2832
3633
  rules: unref(r).rules,
2833
- "model-value": unref(o),
3634
+ "model-value": unref(n),
2834
3635
  "onUpdate:modelValue": l
2835
- }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$u, {
3636
+ }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$D, {
2836
3637
  key: 7,
2837
- "model-value": unref(o),
3638
+ "model-value": unref(n),
2838
3639
  "onUpdate:modelValue": l,
2839
3640
  "no-campaign": !1,
2840
3641
  schema: unref(r).schema,
2841
3642
  "is-mission": e.extras === "MISSION"
2842
3643
  }, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "grab_conditions" ? (openBlock(), createBlock(GrabConditionsInput, {
2843
3644
  key: 8,
2844
- "model-value": unref(o),
3645
+ "model-value": unref(n),
2845
3646
  "onUpdate:modelValue": l,
2846
3647
  schema: unref(r).schema
2847
3648
  }, null, 8, ["model-value", "schema"])) : e.field.type === "grab_quota" ? (openBlock(), createBlock(_sfc_main$9, {
2848
3649
  key: 9,
2849
- "model-value": unref(o),
3650
+ "model-value": unref(n),
2850
3651
  "onUpdate:modelValue": l,
2851
3652
  schema: unref(r).schema
2852
- }, null, 8, ["model-value", "schema"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$v, {
3653
+ }, null, 8, ["model-value", "schema"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$E, {
2853
3654
  key: 10,
2854
- "model-value": unref(o),
3655
+ "model-value": unref(n),
2855
3656
  "onUpdate:modelValue": l
2856
3657
  }, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 11 }, [
2857
- createVNode(_sfc_main$w, {
2858
- "model-value": unref(o),
3658
+ createVNode(_sfc_main$F, {
3659
+ "model-value": unref(n),
2859
3660
  "onUpdate:modelValue": l,
2860
3661
  "can-set-auto-apply": e.field.property == "campaign.effect"
2861
3662
  }, null, 8, ["model-value", "can-set-auto-apply"]),
2862
- unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(v, {
3663
+ unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(f, {
2863
3664
  key: 0,
2864
3665
  class: "!mt-[8px]",
2865
- text: unref(n)("connect.campaign.common.effect_required"),
3666
+ text: unref(o)("connect.campaign.common.effect_required"),
2866
3667
  state: "error"
2867
3668
  }, null, 8, ["text"]))
2868
3669
  ], 64)) : e.field.type == "grab_effect" ? (openBlock(), createElementBlock(Fragment, { key: 12 }, [
2869
3670
  createVNode(GrabEffectSheet, {
2870
- "model-value": unref(o),
3671
+ "model-value": unref(n),
2871
3672
  "onUpdate:modelValue": l
2872
3673
  }, null, 8, ["model-value"]),
2873
- unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(v, {
3674
+ unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(f, {
2874
3675
  key: 0,
2875
3676
  class: "!mt-[8px]",
2876
- text: unref(n)("connect.campaign.common.effect_required"),
3677
+ text: unref(o)("connect.campaign.common.effect_required"),
2877
3678
  state: "error"
2878
3679
  }, null, 8, ["text"]))
2879
- ], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$x, {
2880
- key: 13,
2881
- "allow-email": !0,
2882
- "allow-whatsapp": !0,
2883
- "model-value": unref(o),
2884
- "onUpdate:modelValue": l,
2885
- "helper-text": unref(ZodHelper).helperText(a(), ""),
2886
- "trigger-type": e.field.extras,
2887
- "helper-state": unref(ZodHelper).helperState(a(), "")
2888
- }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$q, {
3680
+ ], 64)) : e.field.type === "message" ? (openBlock(), createElementBlock(Fragment, { key: 13 }, [
3681
+ e.field.property === "campaign.message" ? (openBlock(), createBlock(_sfc_main$g, {
3682
+ key: 0,
3683
+ "model-value": unref(n),
3684
+ "onUpdate:modelValue": l,
3685
+ "helper-text": unref(ZodHelper).helperText(a(), ""),
3686
+ "trigger-type": e.field.extras,
3687
+ "helper-state": unref(ZodHelper).helperState(a(), "")
3688
+ }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$x, {
3689
+ key: 1,
3690
+ "allow-email": !0,
3691
+ "allow-whatsapp": !0,
3692
+ "model-value": unref(n),
3693
+ "onUpdate:modelValue": l,
3694
+ "helper-text": unref(ZodHelper).helperText(a(), ""),
3695
+ "trigger-type": e.field.extras,
3696
+ "helper-state": unref(ZodHelper).helperState(a(), "")
3697
+ }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"]))
3698
+ ], 64)) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$z, {
2889
3699
  key: 14,
2890
- "model-value": unref(o),
3700
+ "model-value": unref(n),
2891
3701
  "onUpdate:modelValue": l,
2892
3702
  extras: e.extras,
2893
3703
  "error-text": e.helperText
2894
- }, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$r, {
3704
+ }, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$A, {
2895
3705
  key: 15,
2896
3706
  type: "custom",
2897
- "model-value": unref(o),
3707
+ "model-value": unref(n),
2898
3708
  "onUpdate:modelValue": l,
2899
3709
  "helper-text": e.helperText || unref(ZodHelper).helperText(a(), ""),
2900
- "for-credit": d.campaignType === "CREDIT"
3710
+ "for-credit": c.campaignType === "CREDIT"
2901
3711
  }, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$e, {
2902
3712
  key: 16,
2903
- "model-value": unref(o),
3713
+ "model-value": unref(n),
2904
3714
  "onUpdate:modelValue": l
2905
3715
  }, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$c, {
2906
3716
  key: 17,
2907
- "model-value": unref(o),
3717
+ "model-value": unref(n),
2908
3718
  "onUpdate:modelValue": l
2909
3719
  }, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
2910
3720
  key: 18,
2911
- "model-value": unref(o),
3721
+ "model-value": unref(n),
2912
3722
  "onUpdate:modelValue": l
2913
3723
  }, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
2914
3724
  key: 19,
2915
- "model-value": unref(o),
3725
+ "model-value": unref(n),
2916
3726
  "onUpdate:modelValue": l
2917
3727
  }, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
2918
3728
  key: 20,
2919
- "model-value": unref(o),
3729
+ "model-value": unref(n),
2920
3730
  "onUpdate:modelValue": l,
2921
3731
  "helper-text": unref(ZodHelper).helperText(a(), ""),
2922
3732
  "helper-state": unref(ZodHelper).helperState(a(), "")
2923
3733
  }, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
2924
3734
  key: 21,
2925
- "model-value": unref(o),
3735
+ "model-value": unref(n),
2926
3736
  "onUpdate:modelValue": l,
2927
3737
  mission: e.extras.mission
2928
3738
  }, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
2929
3739
  createVNode(_sfc_main$f, {
2930
- "model-value": unref(o),
3740
+ "model-value": unref(n),
2931
3741
  "onUpdate:modelValue": l,
2932
3742
  "start-date": e.extras.start,
2933
3743
  "end-date": e.extras.end
2934
3744
  }, null, 8, ["model-value", "start-date", "end-date"]),
2935
- e.helperText ? (openBlock(), createBlock(v, {
3745
+ e.helperText ? (openBlock(), createBlock(f, {
2936
3746
  key: 0,
2937
3747
  class: "!mt-[8px]",
2938
3748
  text: e.helperText,
2939
3749
  state: "error"
2940
3750
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2941
3751
  ], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
2942
- createVNode(_sfc_main$y, {
2943
- "model-value": unref(o),
3752
+ createVNode(_sfc_main$G, {
3753
+ "model-value": unref(n),
2944
3754
  "onUpdate:modelValue": l
2945
3755
  }, null, 8, ["model-value"]),
2946
- e.helperText ? (openBlock(), createBlock(v, {
3756
+ e.helperText ? (openBlock(), createBlock(f, {
2947
3757
  key: 0,
2948
3758
  class: "!mt-[8px]",
2949
3759
  text: e.helperText,
2950
3760
  state: "error"
2951
3761
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2952
3762
  ], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
2953
- e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(v, {
3763
+ e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(n).rules.g_time).length > 0 ? (openBlock(), createBlock(f, {
2954
3764
  key: 0,
2955
3765
  state: "warning",
2956
3766
  text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
2957
3767
  }, null, 8, ["text"])) : createCommentVNode("", !0),
2958
- createVNode(_sfc_main$k, {
2959
- "model-value": unref(o),
3768
+ createVNode(_sfc_main$q, {
3769
+ "model-value": unref(n),
2960
3770
  "onUpdate:modelValue": l
2961
3771
  }, null, 8, ["model-value"]),
2962
- e.helperText ? (openBlock(), createBlock(v, {
3772
+ e.helperText ? (openBlock(), createBlock(f, {
2963
3773
  key: 1,
2964
3774
  class: "!mt-[8px]",
2965
3775
  text: e.helperText,
2966
3776
  state: "error"
2967
3777
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2968
3778
  ], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
2969
- createVNode(_sfc_main$z, {
2970
- "model-value": unref(o),
3779
+ createVNode(_sfc_main$H, {
3780
+ "model-value": unref(n),
2971
3781
  "onUpdate:modelValue": l
2972
3782
  }, null, 8, ["model-value"]),
2973
- e.helperText ? (openBlock(), createBlock(v, {
3783
+ e.helperText ? (openBlock(), createBlock(f, {
2974
3784
  key: 0,
2975
3785
  class: "!mt-[8px]",
2976
3786
  text: e.helperText,
2977
3787
  state: "error"
2978
3788
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2979
3789
  ], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 26 }, [
2980
- createVNode(_sfc_main$A, {
2981
- "model-value": unref(o),
3790
+ createVNode(_sfc_main$I, {
3791
+ "model-value": unref(n),
2982
3792
  "onUpdate:modelValue": l
2983
3793
  }, null, 8, ["model-value"]),
2984
- e.helperText ? (openBlock(), createBlock(v, {
3794
+ e.helperText ? (openBlock(), createBlock(f, {
2985
3795
  key: 0,
2986
3796
  class: "!mt-[8px]",
2987
3797
  text: e.helperText,
2988
3798
  state: "error"
2989
3799
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2990
3800
  ], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 27 }, [
2991
- createVNode(_sfc_main$j, {
2992
- "model-value": unref(o),
3801
+ createVNode(_sfc_main$p, {
3802
+ "model-value": unref(n),
2993
3803
  "onUpdate:modelValue": l
2994
3804
  }, null, 8, ["model-value"]),
2995
- e.helperText ? (openBlock(), createBlock(v, {
3805
+ e.helperText ? (openBlock(), createBlock(f, {
2996
3806
  key: 0,
2997
3807
  class: "!mt-[8px]",
2998
3808
  text: e.helperText,
@@ -3000,16 +3810,16 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3000
3810
  }, null, 8, ["text"])) : createCommentVNode("", !0)
3001
3811
  ], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 28 }, [
3002
3812
  createVNode(_sfc_main$b, {
3003
- "model-value": unref(o),
3813
+ "model-value": unref(n),
3004
3814
  "onUpdate:modelValue": l
3005
3815
  }, null, 8, ["model-value"]),
3006
- e.helperText ? (openBlock(), createBlock(v, {
3816
+ e.helperText ? (openBlock(), createBlock(f, {
3007
3817
  key: 0,
3008
3818
  class: "!mt-[8px]",
3009
3819
  text: e.helperText,
3010
3820
  state: "error"
3011
3821
  }, null, 8, ["text"])) : createCommentVNode("", !0)
3012
- ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(d.field), 1));
3822
+ ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(c.field), 1));
3013
3823
  };
3014
3824
  }
3015
3825
  }), _hoisted_1$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_2$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
@@ -3021,8 +3831,8 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3021
3831
  }
3022
3832
  },
3023
3833
  setup(e) {
3024
- const { t: s, te: n } = useI18n();
3025
- return (u, d) => {
3834
+ const { t: s, te: o } = useI18n();
3835
+ return (d, c) => {
3026
3836
  const i = resolveComponent("FmCard");
3027
3837
  return openBlock(), createBlock(i, {
3028
3838
  variant: "outlined",
@@ -3030,14 +3840,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3030
3840
  }, {
3031
3841
  default: withCtx(() => [
3032
3842
  createElementVNode("div", _hoisted_1$1, toDisplayString(unref(s)("connect.campaign.common.summary")), 1),
3033
- d[0] || (d[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
3034
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, o) => (openBlock(), createElementBlock("div", {
3843
+ c[0] || (c[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
3844
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, n) => (openBlock(), createElementBlock("div", {
3035
3845
  class: "space-y-4",
3036
- key: o
3846
+ key: n
3037
3847
  }, [
3038
3848
  l ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3039
- createElementVNode("div", _hoisted_2$1, toDisplayString(unref(s)(`${o}`)), 1),
3040
- createElementVNode("div", _hoisted_3$1, toDisplayString(unref(n)(`${l}`) ? unref(s)(`${l}`) : l), 1)
3849
+ createElementVNode("div", _hoisted_2$1, toDisplayString(unref(s)(`${n}`)), 1),
3850
+ createElementVNode("div", _hoisted_3$1, toDisplayString(unref(o)(`${l}`) ? unref(s)(`${l}`) : l), 1)
3041
3851
  ], 64)) : createCommentVNode("", !0)
3042
3852
  ]))), 128))
3043
3853
  ]),
@@ -3056,24 +3866,24 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3056
3866
  TEMPLATES.VOUCHER
3057
3867
  ), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign"), campaignType = ref("VOUCHER");
3058
3868
  async function showSheet(visible, type, campaign, selectedTemplate) {
3059
- var e, s, n;
3869
+ var e, s, o;
3060
3870
  if (sheetVisible.value = visible, campaignType.value = type, visible == !0) {
3061
3871
  try {
3062
3872
  isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
3063
3873
  } catch {
3064
3874
  } finally {
3065
- await new Promise((u) => setTimeout(u, 120)), isLoading.value = !1;
3875
+ await new Promise((d) => setTimeout(d, 120)), isLoading.value = !1;
3066
3876
  }
3067
3877
  console.log(
3068
3878
  TEMPLATES[type],
3069
3879
  "base template"
3070
- ), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((u, d) => {
3880
+ ), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((d, c) => {
3071
3881
  var i;
3072
- if (u.campaign.type === "VOUCHER" && u.campaign.code) {
3073
- const l = (i = u.campaign._id) == null ? void 0 : i.toString();
3882
+ if (d.campaign.type === "VOUCHER" && d.campaign.code) {
3883
+ const l = (i = d.campaign._id) == null ? void 0 : i.toString();
3074
3884
  useCampaignStore().campaigns.voucher.some(
3075
- (o) => o.code === u.campaign.code && o._id.toString() !== l
3076
- ) && d.addIssue({
3885
+ (n) => n.code === d.campaign.code && n._id.toString() !== l
3886
+ ) && c.addIssue({
3077
3887
  code: "custom",
3078
3888
  message: "Code already exists, please use another code",
3079
3889
  path: ["campaign", "code"]
@@ -3081,7 +3891,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3081
3891
  }
3082
3892
  })), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
3083
3893
  ...(s = template.value) == null ? void 0 : s.defaultValue
3084
- }), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), 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, sheetTitle.value = (n = campaign == null ? void 0 : campaign.campaign) != null && n._id ? t("connect.campaign.common.edit_campaign_title", {
3894
+ }), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), 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, sheetTitle.value = (o = campaign == null ? void 0 : campaign.campaign) != null && o._id ? t("connect.campaign.common.edit_campaign_title", {
3085
3895
  typeName: t(`connect.campaign.common.typeName.${type}`)
3086
3896
  }) : t("connect.campaign.common.create_campaign_title", {
3087
3897
  typeName: t(`connect.campaign.common.typeName.${type}`)
@@ -3112,10 +3922,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3112
3922
  });
3113
3923
  function stepErrors(e = currentStep.value - 1) {
3114
3924
  const s = template.value.steps[e].groups.flatMap(
3115
- (n) => n.fields.map((u) => u.property)
3925
+ (o) => o.fields.map((d) => schemaPathForField(d.property))
3116
3926
  );
3117
3927
  return errors.value.filter(
3118
- (n) => s.some((u) => n.path.join(".").includes(u))
3928
+ (o) => s.some((d) => o.path.join(".").includes(d))
3119
3929
  );
3120
3930
  }
3121
3931
  __expose({ showSheet });
@@ -3128,11 +3938,29 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3128
3938
  }
3129
3939
  });
3130
3940
  }
3941
+ const broadcastDelivery = computed(
3942
+ () => {
3943
+ var e;
3944
+ return (e = data.value) != null && e.campaign ? toDelivery(data.value.campaign) : void 0;
3945
+ }
3946
+ );
3947
+ function valueForField(e) {
3948
+ return e === "campaign.message" ? broadcastDelivery.value : _.get(data.value, e);
3949
+ }
3950
+ function schemaPathForField(e) {
3951
+ return e === "campaign.message" ? "campaign.delivery" : e;
3952
+ }
3131
3953
  function onUpdateProperty(e, s) {
3132
- var n, u, d, i, l, o, a, r;
3954
+ var o, d, c, i, l, n, a, r;
3955
+ if (e === "campaign.message" && s && "channels" in s) {
3956
+ _.set(data.value, "campaign.delivery", s);
3957
+ const p = toLegacyMessage(s);
3958
+ p && _.set(data.value, "campaign.message", p);
3959
+ return;
3960
+ }
3133
3961
  if (_.set(data.value, e, s), e == "campaign.event.type") {
3134
- const h = ((i = (d = (u = (n = template.value) == null ? void 0 : n.defaultValue) == null ? void 0 : u.campaign) == null ? void 0 : d.event) == null ? void 0 : i.rule) ? _.cloneDeep({
3135
- ...(r = (a = (o = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : o.campaign) == null ? void 0 : a.event) == null ? void 0 : r.rule
3962
+ const v = ((i = (c = (d = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : d.campaign) == null ? void 0 : c.event) == null ? void 0 : i.rule) ? _.cloneDeep({
3963
+ ...(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
3136
3964
  }) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
3137
3965
  RuleBuilder.scaffoldGroup("g_schedule"),
3138
3966
  RuleBuilder.scaffoldGroup("g_time"),
@@ -3151,13 +3979,13 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3151
3979
  "&&"
3152
3980
  );
3153
3981
  if (s != "SCHEDULE") {
3154
- _.set(data.value, "campaign.event.rule", h);
3982
+ _.set(data.value, "campaign.event.rule", v);
3155
3983
  return;
3156
3984
  }
3157
3985
  _.set(
3158
3986
  data.value,
3159
3987
  "campaign.event.rule",
3160
- RuleBuilder.setRuleToGroup(h, y)
3988
+ RuleBuilder.setRuleToGroup(v, y)
3161
3989
  );
3162
3990
  }
3163
3991
  e == "campaign.notify" && s == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
@@ -3169,10 +3997,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3169
3997
  }) : "";
3170
3998
  }
3171
3999
  function isDisable(e) {
3172
- var s, n;
4000
+ var s, o;
3173
4001
  switch (e == null ? void 0 : e.property) {
3174
4002
  case "campaign.event.type":
3175
- return ((n = (s = data.value) == null ? void 0 : s.campaign) == null ? void 0 : n._id) || !1;
4003
+ return ((o = (s = data.value) == null ? void 0 : s.campaign) == null ? void 0 : o._id) || !1;
3176
4004
  default:
3177
4005
  return !1;
3178
4006
  }
@@ -3188,25 +4016,25 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3188
4016
  (s || s === void 0) && (sheetVisible.value = !1);
3189
4017
  }
3190
4018
  return (e, s) => {
3191
- const n = resolveComponent("FmButton"), u = resolveComponent("FmStep"), d = resolveComponent("FmStepper"), i = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
4019
+ const o = resolveComponent("FmButton"), d = resolveComponent("FmStep"), c = resolveComponent("FmStepper"), i = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
3192
4020
  return openBlock(), createBlock(l, {
3193
4021
  "fullscreen-size": "lg",
3194
4022
  modelValue: unref(sheetVisible),
3195
4023
  "onUpdate:modelValue": [
3196
- s[7] || (s[7] = (o) => isRef(sheetVisible) ? sheetVisible.value = o : null),
3197
- s[8] || (s[8] = (o) => sheetVisible.value = o)
4024
+ s[7] || (s[7] = (n) => isRef(sheetVisible) ? sheetVisible.value = n : null),
4025
+ s[8] || (s[8] = (n) => sheetVisible.value = n)
3198
4026
  ]
3199
4027
  }, createSlots({
3200
4028
  "top-sheet-header": withCtx(() => [
3201
4029
  createElementVNode("div", _hoisted_1, [
3202
4030
  createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
3203
4031
  createElementVNode("div", _hoisted_2, [
3204
- createVNode(n, {
3205
- onClick: s[0] || (s[0] = (o) => hideSheet()),
4032
+ createVNode(o, {
4033
+ onClick: s[0] || (s[0] = (n) => hideSheet()),
3206
4034
  label: unref(t)("connect.campaign.common.cancel"),
3207
4035
  variant: "tertiary"
3208
4036
  }, null, 8, ["label"]),
3209
- createVNode(n, {
4037
+ createVNode(o, {
3210
4038
  onClick: onSubmit,
3211
4039
  label: unref(t)("connect.campaign.common.save"),
3212
4040
  disabled: unref(errors).length > 0
@@ -3254,16 +4082,16 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3254
4082
  name: "default",
3255
4083
  fn: withCtx(() => [
3256
4084
  unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
3257
- createVNode(d, {
4085
+ createVNode(c, {
3258
4086
  modelValue: unref(currentStep),
3259
- "onUpdate:modelValue": s[1] || (s[1] = (o) => isRef(currentStep) ? currentStep.value = o : null),
4087
+ "onUpdate:modelValue": s[1] || (s[1] = (n) => isRef(currentStep) ? currentStep.value = n : null),
3260
4088
  orientation: "horizontal",
3261
4089
  class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
3262
4090
  }, {
3263
4091
  default: withCtx(() => [
3264
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, a) => (openBlock(), createBlock(u, {
3265
- key: o.name,
3266
- title: unref(getLocaleText)(o.name_locale, o.name),
4092
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(d, {
4093
+ key: n.name,
4094
+ title: unref(getLocaleText)(n.name_locale, n.name),
3267
4095
  value: a + 1,
3268
4096
  error: () => stepErrors(a).length > 0,
3269
4097
  complete: () => a + 1 <= unref(currentStep)
@@ -3272,22 +4100,22 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3272
4100
  _: 1
3273
4101
  }, 8, ["modelValue"]),
3274
4102
  createElementVNode("div", _hoisted_4, [
3275
- createVNode(n, {
4103
+ createVNode(o, {
3276
4104
  icon: "close",
3277
4105
  variant: "tertiary",
3278
- onClick: s[2] || (s[2] = (o) => sheetVisible.value = !1)
4106
+ onClick: s[2] || (s[2] = (n) => sheetVisible.value = !1)
3279
4107
  }),
3280
- createVNode(d, {
4108
+ createVNode(c, {
3281
4109
  modelValue: unref(currentStep),
3282
- "onUpdate:modelValue": s[3] || (s[3] = (o) => isRef(currentStep) ? currentStep.value = o : null),
4110
+ "onUpdate:modelValue": s[3] || (s[3] = (n) => isRef(currentStep) ? currentStep.value = n : null),
3283
4111
  orientation: "horizontal",
3284
4112
  class: "flex-1"
3285
4113
  }, {
3286
4114
  default: withCtx(() => [
3287
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, a) => (openBlock(), createBlock(u, {
3288
- key: o.name,
4115
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(d, {
4116
+ key: n.name,
3289
4117
  title: unref(sheetTitle),
3290
- description: unref(getLocaleText)(o.name_locale, o.name),
4118
+ description: unref(getLocaleText)(n.name_locale, n.name),
3291
4119
  value: a + 1,
3292
4120
  error: () => stepErrors(a).length > 0,
3293
4121
  complete: () => a + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
@@ -3295,7 +4123,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3295
4123
  ]),
3296
4124
  _: 1
3297
4125
  }, 8, ["modelValue"]),
3298
- createVNode(n, {
4126
+ createVNode(o, {
3299
4127
  icon: "info",
3300
4128
  variant: "tertiary",
3301
4129
  onClick: s[4] || (s[4] = () => showSummaryDialog())
@@ -3307,55 +4135,61 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
3307
4135
  json: {
3308
4136
  data: unref(data),
3309
4137
  errors: unref(errors).map(
3310
- (o) => `${o.path.join(".")} - ${o.message}`
4138
+ (n) => `${n.path.join(".")} - ${n.message}`
3311
4139
  ),
3312
4140
  stepErrors: stepErrors().map(
3313
- (o) => `${o.path.join(".")} - ${o.message}`
4141
+ (n) => `${n.path.join(".")} - ${n.message}`
3314
4142
  ),
3315
4143
  schema: unref(schema)
3316
4144
  }
3317
4145
  }, null, 8, ["json"]),
3318
4146
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
3319
- (o) => o.fields.length && (!o.condition || (Array.isArray(o.condition) ? o.condition.every((a) => unref(_).get(unref(data), a.property) == a.value == (a.not != !0)) : unref(_).get(unref(data), o.condition.property) == o.condition.value == (o.condition.not != !0)))
3320
- ), (o, a) => (openBlock(), createElementBlock("div", {
4147
+ (n) => n.fields.length && (!n.condition || (Array.isArray(n.condition) ? n.condition.every((a) => unref(_).get(unref(data), a.property) == a.value == (a.not != !0)) : unref(_).get(unref(data), n.condition.property) == n.condition.value == (n.condition.not != !0)))
4148
+ ), (n, a) => (openBlock(), createElementBlock("div", {
3321
4149
  key: a,
3322
4150
  class: "space-y-24"
3323
4151
  }, [
3324
- createElementVNode("div", _hoisted_7, toDisplayString(unref(getLocaleText)(o.name_locale, o.name ?? "")), 1),
3325
- (openBlock(!0), createElementBlock(Fragment, null, renderList(o.fields, (r, p) => (openBlock(), createElementBlock("div", { key: p }, [
4152
+ createElementVNode("div", _hoisted_7, toDisplayString(unref(getLocaleText)(n.name_locale, n.name ?? "")), 1),
4153
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(n.fields, (r, p) => (openBlock(), createElementBlock("div", { key: p }, [
3326
4154
  (openBlock(), createBlock(_sfc_main$2, {
3327
4155
  key: p,
3328
4156
  field: r,
3329
- modelValue: unref(_).get(unref(data), r.property),
4157
+ modelValue: valueForField(r.property),
3330
4158
  disabled: isDisable(r),
3331
4159
  "campaign-type": unref(campaignType),
3332
- "onUpdate:modelValue": (h) => onUpdateProperty(r.property, h),
3333
- "onUpdate:file": async (h, y) => {
3334
- const C = await onUpdateFile(h, y);
3335
- onUpdateProperty(r.property, C || "");
4160
+ "onUpdate:modelValue": (v) => onUpdateProperty(r.property, v),
4161
+ "onUpdate:file": async (v, y) => {
4162
+ const V = await onUpdateFile(v, y);
4163
+ onUpdateProperty(r.property, V || "");
3336
4164
  },
3337
4165
  schema: unref(ZodHelper).typeAtPath(
3338
4166
  unref(schema),
3339
- r.property,
4167
+ schemaPathForField(r.property),
3340
4168
  unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
3341
4169
  ),
3342
- "helper-state": unref(ZodHelper).helperState(unref(errors), r.property),
3343
- "helper-text": unref(ZodHelper).helperText(unref(errors), r.property),
4170
+ "helper-state": unref(ZodHelper).helperState(
4171
+ unref(errors),
4172
+ schemaPathForField(r.property)
4173
+ ),
4174
+ "helper-text": unref(ZodHelper).helperText(
4175
+ unref(errors),
4176
+ schemaPathForField(r.property)
4177
+ ),
3344
4178
  extras: r.extras != null ? r.extras == "" ? unref(data) : unref(_).get(unref(data), r.extras) : void 0
3345
4179
  }, null, 8, ["field", "modelValue", "disabled", "campaign-type", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
3346
4180
  ]))), 128))
3347
4181
  ]))), 128)),
3348
4182
  createElementVNode("div", _hoisted_8, [
3349
- createVNode(n, {
4183
+ createVNode(o, {
3350
4184
  label: unref(t)("connect.common.back"),
3351
4185
  variant: "tertiary",
3352
4186
  disabled: unref(currentStep) == 1,
3353
- onClick: s[5] || (s[5] = (o) => currentStep.value--)
4187
+ onClick: s[5] || (s[5] = (n) => currentStep.value--)
3354
4188
  }, null, 8, ["label", "disabled"]),
3355
- createVNode(n, {
4189
+ createVNode(o, {
3356
4190
  disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
3357
4191
  label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? unref(t)("connect.common.next") : unref(t)("connect.common.submit"),
3358
- onClick: s[6] || (s[6] = (o) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
4192
+ onClick: s[6] || (s[6] = (n) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
3359
4193
  }, null, 8, ["disabled", "label"])
3360
4194
  ])
3361
4195
  ]),