@feedmepos/mf-connect 0.1.38-beta.44 → 0.1.38-beta.46

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 (98) hide show
  1. package/dist/{Analytic-DaVlIGf-.js → Analytic-BGKCj1jr.js} +13 -13
  2. package/dist/{App-BuWDQu4h.js → App-Rjzbi736.js} +7 -7
  3. package/dist/{AuditLogs-Dg-AmPCL.js → AuditLogs-Dip8piV3.js} +9 -9
  4. package/dist/{Bin-BLZqBirZ.js → Bin-DOvnUMsH.js} +8 -8
  5. package/dist/{Broadcast-CO9pC5-Y.js → Broadcast-xcZBuHpL.js} +8 -8
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BzeOFGn3.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Dizv5GP_.js} +6 -6
  7. package/dist/{Card-DxC4SzhE.js → Card-CKjNEigS.js} +18 -18
  8. package/dist/{Collections-Dl24kiOy.js → Collections-x5ofCSJN.js} +74 -73
  9. package/dist/{Credit-Dx9iReBU.js → Credit-BWBu_w2L.js} +8 -8
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-B31p-9aH.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CBoP1Jwt.js} +1143 -1117
  11. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-YjvIstf7.js +348 -0
  12. package/dist/{Experience-CeTt_14y.js → Experience-pkdcwDSi.js} +8 -8
  13. package/dist/{Game-BiD0onYI.js → Game-Dna43QZe.js} +9 -9
  14. package/dist/{Grab-IOWWGsOE.js → Grab-C9Z_Zfe8.js} +8 -8
  15. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js → ImageInput.vue_vue_type_script_setup_true_lang-DElYlMlB.js} +44 -43
  16. package/dist/{Index-D3z5IdXJ.js → Index-DRIWf1NE.js} +10 -10
  17. package/dist/{Marketing-b1cfAMZ3.js → Marketing-usRTwLLw.js} +7 -7
  18. package/dist/{Member-BSUAVJcD.js → Member-B70QVgJa.js} +10 -10
  19. package/dist/{MemberList-CnXn01xK.js → MemberList-JI4mBPfA.js} +25 -25
  20. package/dist/{MemberTransactions-C_oE-NJv.js → MemberTransactions-DYHJdzBn.js} +1 -1
  21. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BYlfLbKK.js → MessageInput.vue_vue_type_script_setup_true_lang-Dvr2n1Qk.js} +5090 -5091
  22. package/dist/{Mission-BJpdXP_V.js → Mission-D8FTOnMy.js} +9 -9
  23. package/dist/{Overview-CW5f7sAz.js → Overview-CaxFeeVL.js} +19 -19
  24. package/dist/{Point-BlW29FTE.js → Point-I9wVIa2q.js} +8 -8
  25. package/dist/{Promotion-BLbBVMGg.js → Promotion-CWFtbYmb.js} +9 -9
  26. package/dist/{Queue-IKQPAf2s.js → Queue-BmjIEX84.js} +10 -10
  27. package/dist/{Record-BpAB2Eun.js → Record-DuvGrBry.js} +8 -8
  28. package/dist/{Reward-CRyvWOwo.js → Reward-BQ36_7d0.js} +16 -16
  29. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CbL_JmWH.js → RewardGroup.vue_vue_type_script_setup_true_lang-0AbXVk_6.js} +12 -12
  30. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BF98epZo.js → RuleGroup.vue_vue_type_script_setup_true_lang-pwHQUtHq.js} +596 -592
  31. package/dist/{Segment-C0lbV7EJ.js → Segment-ClGmNf-7.js} +23 -23
  32. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-D1lUfj_I.js → SelectItems.vue_vue_type_script_setup_true_lang-CGsYilHx.js} +2 -2
  33. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CurmIKU-.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Bbisi3wu.js} +12 -12
  34. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BM-fztkT.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CRnHuPPI.js} +3 -3
  35. package/dist/{Setting-BIgHzM4O.js → Setting-DtRP7-KR.js} +14 -14
  36. package/dist/{SettingAdvertisements-pSKo469B.js → SettingAdvertisements-9gG904yk.js} +12 -12
  37. package/dist/{Store-Czn9bmJY.js → Store-j8N8l1e7.js} +21 -21
  38. package/dist/{StoreRewards-BEgyufA-.js → StoreRewards-9o5EngS4.js} +15 -15
  39. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DzlPKkvb.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Bs54sDKB.js} +31 -29
  40. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Dt-fITiT.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CqBeBxgc.js} +1 -1
  41. package/dist/{Tier-uoxXOOmb.js → Tier-N4Fwb4c2.js} +23 -23
  42. package/dist/{Title-QaZ_Qzwk.js → Title-BisuO_Bq.js} +20 -20
  43. package/dist/{Transaction-By9Q6BcR.js → Transaction-BvL-lHUW.js} +2 -2
  44. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-ChoSRMz9.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-D3zT4NEB.js} +6 -6
  45. package/dist/{Voucher-DD9c1bOC.js → Voucher-BNVS0bf_.js} +12 -12
  46. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BdAaQtUx.js +421 -0
  47. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B1E0-61O.js → ZodTextField.vue_vue_type_script_setup_true_lang-Db5UjYDs.js} +2 -2
  48. package/dist/{app-D1EzxIEG.js → app-5gFoCIZ5.js} +2285 -795
  49. package/dist/{app-C-L8YbbE.js → app-HOMrHaJX.js} +1 -1
  50. package/dist/app.js +1 -1
  51. package/dist/{business-B9L1wZ9V.js → business-DrOrg91y.js} +1 -1
  52. package/dist/{campaign-BR7cO_ag.js → campaign-D-0jxXgS.js} +1 -1
  53. package/dist/campaign-DxZjTV1c.js +233 -0
  54. package/dist/{campaign.enum-OFeKrvOv.js → campaign.enum-DfqdgPF7.js} +1 -1
  55. package/dist/{campaign.fn-B9PtQJx6.js → campaign.fn-BA9SsYlS.js} +23 -23
  56. package/dist/{collectible.enum-BE8Vnk8X.js → collectible.enum-CUY4edTO.js} +1 -1
  57. package/dist/{collection.fn-CSzvUULo.js → collection.fn-BUyLrKuP.js} +2 -2
  58. package/dist/{dto-DH8S9-Ib.js → dto-CdsbCKbi.js} +4 -4
  59. package/dist/{effect-DZGMEmET.js → effect-CHvrDcct.js} +1 -1
  60. package/dist/{email-addresses-Clhn0_GY.js → email-addresses-BQGuEvTh.js} +1 -1
  61. package/dist/{export-D2-7Mdk_.js → export-CgyLGAFe.js} +3 -3
  62. package/dist/{helper-A850CYX-.js → helper-CUXD11Bp.js} +1 -1
  63. package/dist/{index-DBkatkYW.js → index-BMpQ1Eq2.js} +1 -1
  64. package/dist/{index-CaRmY5ov.js → index-BTzBc44a.js} +4 -4
  65. package/dist/{index-Di6vuuEG.js → index-BmOfDfwV.js} +222 -217
  66. package/dist/{index-Fx5b3dyw.js → index-Bsz-Af4_.js} +2 -2
  67. package/dist/{index-CLvKSnsU.js → index-D-Qagjww.js} +3 -3
  68. package/dist/{index-DZ2N0Xar.js → index-DQlMaN5j.js} +1023 -1023
  69. package/dist/{index-ti-HnLrW.js → index-DUBEbnDX.js} +1 -1
  70. package/dist/{index-CZtsEfNW.js → index-DUZWoVeF.js} +1 -1
  71. package/dist/{index-DgS92jOx.js → index-DrRjJg2A.js} +1 -1
  72. package/dist/{index-aXnPGrHU.js → index-DtcXk4cG.js} +1 -1
  73. package/dist/{index-Ddj2NyfT.js → index-Dvy1ftAd.js} +1 -1
  74. package/dist/{index-DIFcHxGK.js → index-ePW_CRtd.js} +1 -1
  75. package/dist/{index-BIX6P8Ch.js → index-uliDTEHQ.js} +3 -3
  76. package/dist/{index.esm2017-CeG_Fc0h.js → index.esm2017-CJJcI6HI.js} +1 -1
  77. package/dist/{loading-BTmVuA3F.js → loading-O2OJnB-v.js} +1 -1
  78. package/dist/{membership-855TzqV2.js → membership-kVwD3i5I.js} +3 -3
  79. package/dist/{money-q7C-U4gP.js → money-CvRqEjZN.js} +1 -1
  80. package/dist/{number-D_GEDOMH.js → number-BtM53Gqu.js} +1 -1
  81. package/dist/{objectid-BMt_qSOq.js → objectid-BbEyb60f.js} +12 -12
  82. package/dist/{campaign-DBsKNNfL.js → plugins-nuoNiWZV.js} +783 -788
  83. package/dist/{reward-BzhG23G8.js → reward-C904TC9N.js} +1 -1
  84. package/dist/{rule-hkruDWXK.js → rule-B2r0vrQs.js} +3 -3
  85. package/dist/{rule-builder-CDKwRPm6.js → rule-builder-DxCXxYrs.js} +1 -1
  86. package/dist/template-C8z7oS1X.js +188 -0
  87. package/dist/{timezone-CczMDZJW.js → timezone-C-mgrIzx.js} +1 -1
  88. package/dist/trigger-DrmYFT7r.js +213 -0
  89. package/dist/{user-vV0mHSKf.js → user-C_PXVgnR.js} +1 -1
  90. package/dist/{vue-i18n-C3xXE7er.js → vue-i18n-CBY1MepG.js} +111 -111
  91. package/dist/{xlsx-DwllaYd7.js → xlsx-DmlvPg-W.js} +1 -1
  92. package/dist/{zod-Bg2FbC-D.js → zod-DlxxgJ-R.js} +32 -31
  93. package/package.json +1 -1
  94. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-C7EGat91.js +0 -348
  95. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DgCjZuxC.js +0 -419
  96. package/dist/plugins-DYwCm0Ql.js +0 -208
  97. package/dist/template-Bzs20Hr7.js +0 -190
  98. package/dist/trigger-C67D78R1.js +0 -144
@@ -1,64 +1,64 @@
1
1
  import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, createCommentVNode, computed, onMounted, toDisplayString, createBlock, withCtx, Fragment, renderList, withModifiers, unref, isRef, createTextVNode, normalizeClass, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
2
2
  import { _ } from "./lodash-B5I3zXaY.js";
3
- import { z } from "./app-D1EzxIEG.js";
4
- import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
5
- import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-DBsKNNfL.js";
6
- import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-DH8S9-Ib.js";
7
- import { u as useMembershipStore } from "./membership-855TzqV2.js";
8
- import { u as useBusinessStore } from "./business-B9L1wZ9V.js";
9
- import "./index-Fx5b3dyw.js";
10
- import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-CDKwRPm6.js";
3
+ import { z } from "./app-5gFoCIZ5.js";
4
+ import { Z as ZodHelper } from "./zod-DlxxgJ-R.js";
5
+ import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-CdsbCKbi.js";
6
+ import { u as useMembershipStore } from "./membership-kVwD3i5I.js";
7
+ import { u as useBusinessStore } from "./business-DrOrg91y.js";
8
+ import "./index-Bsz-Af4_.js";
9
+ import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-DxCXxYrs.js";
11
10
  import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
12
11
  import { h as hooks } from "./moment-D7p2TMB-.js";
13
- import { f as featureVersionMapping } from "./campaign.enum-OFeKrvOv.js";
14
- import { _ as _sfc_main$u } from "./ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js";
15
- import { b as _sfc_main$s, a as _sfc_main$v, _ as _sfc_main$x } from "./EffectSheet.vue_vue_type_style_index_0_lang-C7EGat91.js";
16
- import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-Dt-fITiT.js";
17
- import { c as core, S as SvcConfig } from "./index-CLvKSnsU.js";
18
- import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-DYwCm0Ql.js";
19
- import { C as Cb } from "./app-C-L8YbbE.js";
20
- import { _ as _sfc_main$o } from "./SelectItems.vue_vue_type_script_setup_true_lang-D1lUfj_I.js";
12
+ import { f as featureVersionMapping } from "./campaign.enum-DfqdgPF7.js";
13
+ import { _ as _sfc_main$u } from "./ImageInput.vue_vue_type_script_setup_true_lang-DElYlMlB.js";
14
+ import { b as _sfc_main$s, a as _sfc_main$v, _ as _sfc_main$x } from "./EffectSheet.vue_vue_type_style_index_0_lang-YjvIstf7.js";
15
+ import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CqBeBxgc.js";
16
+ import { c as core, S as SvcConfig } from "./index-D-Qagjww.js";
17
+ import { p as prompt, f as firebaseStorage } from "./plugins-nuoNiWZV.js";
18
+ import { C as Cb } from "./app-HOMrHaJX.js";
19
+ import { _ as _sfc_main$o } from "./SelectItems.vue_vue_type_script_setup_true_lang-CGsYilHx.js";
21
20
  import { _ as _export_sfc } from "./_plugin-vue_export-helper-CHgC5LLL.js";
22
- import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-ChoSRMz9.js";
23
- import { _ as _sfc_main$p, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BF98epZo.js";
24
- import { u as useI18n } from "./vue-i18n-C3xXE7er.js";
25
- import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-C67D78R1.js";
26
- import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-BYlfLbKK.js";
27
- import { C as CountryTimezone, m as moment } from "./timezone-CczMDZJW.js";
28
- import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-hkruDWXK.js";
21
+ import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-D3zT4NEB.js";
22
+ import { _ as _sfc_main$p, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-pwHQUtHq.js";
23
+ import { u as useI18n } from "./vue-i18n-CBY1MepG.js";
24
+ import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-DrmYFT7r.js";
25
+ import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-Dvr2n1Qk.js";
26
+ import { C as CountryTimezone, m as moment } from "./timezone-C-mgrIzx.js";
27
+ import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-B2r0vrQs.js";
29
28
  import { useCoreStore } from "@feedmepos/mf-common";
30
- import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DgCjZuxC.js";
31
- import { T as TEMPLATES } from "./index-Di6vuuEG.js";
32
- import { v as FdoCreditLoyaltyReward, w as FdtoRandomReward, x as F_MISSION_TYPE, y as FdoThresholdCreditReward, z as FdtoThresholdReward, A as FdoMission } from "./index-CaRmY5ov.js";
33
- import "./index-DBkatkYW.js";
34
- import "./index-BIX6P8Ch.js";
35
- import { a as F_GAME_TYPE } from "./collectible.enum-BE8Vnk8X.js";
36
- import { u as useLoading } from "./loading-BTmVuA3F.js";
37
- import { i as initCollectibleConfig } from "./helper-A850CYX-.js";
38
- import { C as CollectionUtils } from "./collection.fn-CSzvUULo.js";
29
+ import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-BdAaQtUx.js";
30
+ import { T as TEMPLATES } from "./index-BmOfDfwV.js";
31
+ import { v as FdoCreditLoyaltyReward, w as FdtoRandomReward, x as F_MISSION_TYPE, y as FdoThresholdCreditReward, z as FdtoThresholdReward, A as FdoMission } from "./index-BTzBc44a.js";
32
+ import "./index-BMpQ1Eq2.js";
33
+ import "./index-uliDTEHQ.js";
34
+ import { a as F_GAME_TYPE } from "./collectible.enum-CUY4edTO.js";
35
+ import { u as useLoading } from "./loading-O2OJnB-v.js";
36
+ import { i as initCollectibleConfig } from "./helper-CUXD11Bp.js";
37
+ import { C as CollectionUtils } from "./collection.fn-BUyLrKuP.js";
39
38
  import { s as sentenceCase$1 } from "./index-CsaQJMAR.js";
40
- import "./index-DZ2N0Xar.js";
39
+ import { c as getCampaignSummaryObject } from "./campaign-DxZjTV1c.js";
40
+ import "./index-DQlMaN5j.js";
41
41
  import { useDialog } from "@feedmepos/ui-library";
42
- import { u as useCampaignStore } from "./campaign-BR7cO_ag.js";
42
+ import { u as useCampaignStore } from "./campaign-D-0jxXgS.js";
43
43
  import { a as cleanPF } from "./object-qECH92oz.js";
44
44
  function summarizeGrabDiscount(e) {
45
45
  if (!e)
46
46
  return null;
47
- const d = core.Config.getCountry().currency.symbol;
48
- function r(o) {
49
- switch (o.scope.type) {
47
+ const m = core.Config.getCountry().currency.symbol;
48
+ function a(l) {
49
+ switch (l.scope.type) {
50
50
  case "order":
51
51
  return "Bill discount";
52
52
  case "items":
53
- return o.type.startsWith("bundle") ? i(o.type) : "Item discount";
53
+ return l.type.startsWith("bundle") ? d(l.type) : "Item discount";
54
54
  case "categories":
55
55
  return "Category discount";
56
56
  default:
57
57
  return "Discount";
58
58
  }
59
59
  }
60
- function i(o) {
61
- switch (o) {
60
+ function d(l) {
61
+ switch (l) {
62
62
  case "bundleSameFixPrice":
63
63
  return "Bundle (same item) - Fixed price";
64
64
  case "bundleDiffFixPrice":
@@ -75,40 +75,40 @@ function summarizeGrabDiscount(e) {
75
75
  return "Bundle discount";
76
76
  }
77
77
  }
78
- function u(o) {
79
- switch (o.type) {
78
+ function i(l) {
79
+ switch (l.type) {
80
80
  case "percentage":
81
81
  case "bundleSamePercentage":
82
82
  case "bundleDiffPercentage":
83
- return `${o.value}% discount`;
83
+ return `${l.value}% discount`;
84
84
  case "net":
85
85
  case "bundleSameNet":
86
86
  case "bundleDiffNet":
87
- return `${d}${o.value} discount`;
87
+ return `${m}${l.value} discount`;
88
88
  case "bundleSameFixPrice":
89
89
  case "bundleDiffFixPrice":
90
- return `${d}${o.value} fixed price`;
90
+ return `${m}${l.value} fixed price`;
91
91
  case "delivery":
92
92
  return "Delivery fee discount";
93
93
  case "freeItem":
94
94
  return "Free item";
95
95
  default:
96
- return `${d}${o.value} discount`;
96
+ return `${m}${l.value} discount`;
97
97
  }
98
98
  }
99
- function a(o) {
100
- return o.cap && o.cap > 0 ? `capped at ${d}${o.cap}` : null;
99
+ function s(l) {
100
+ return l.cap && l.cap > 0 ? `capped at ${m}${l.cap}` : null;
101
101
  }
102
102
  return {
103
- type: r(e),
104
- adjustment: u(e),
105
- cap: a(e)
103
+ type: a(e),
104
+ adjustment: i(e),
105
+ cap: s(e)
106
106
  };
107
107
  }
108
108
  const _hoisted_1$l = {
109
109
  key: 0,
110
110
  class: "bg-fm-color-neutral-gray-50 border border-fm-color-neutral-gray-200 rounded-8 p-16 space-y-16"
111
- }, _hoisted_2$h = { class: "flex items-center justify-between" }, _hoisted_3$e = { class: "flex items-center gap-8" }, _hoisted_4$b = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 p-16" }, _hoisted_5$7 = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$n = /* @__PURE__ */ defineComponent({
111
+ }, _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({
112
112
  __name: "GrabItemSelectionInline",
113
113
  props: {
114
114
  visible: { type: Boolean },
@@ -116,63 +116,63 @@ const _hoisted_1$l = {
116
116
  filterItems: { type: Function }
117
117
  },
118
118
  emits: ["confirm", "cancel"],
119
- setup(e, { emit: d }) {
120
- const r = e, i = d, u = ref();
119
+ setup(e, { emit: m }) {
120
+ const a = e, d = m, i = ref();
121
121
  watch(
122
- () => r.visible,
123
- (l) => {
124
- var s, h;
125
- !l && u.value && ((h = (s = u.value).setSelectedItems) == null || h.call(s, r.initialValue || []));
122
+ () => a.visible,
123
+ (n) => {
124
+ var r, y;
125
+ !n && i.value && ((y = (r = i.value).setSelectedItems) == null || y.call(r, a.initialValue || []));
126
126
  }
127
127
  );
128
- function a() {
129
- var l;
130
- (l = u.value) == null || l.onConfirm();
128
+ function s() {
129
+ var n;
130
+ (n = i.value) == null || n.onConfirm();
131
131
  }
132
- function o() {
133
- i("cancel");
132
+ function l() {
133
+ d("cancel");
134
134
  }
135
- function n(l) {
136
- i("confirm", l);
135
+ function o(n) {
136
+ d("confirm", n);
137
137
  }
138
- return (l, s) => {
139
- const h = resolveComponent("FmIcon"), g = resolveComponent("FmButton");
138
+ return (n, r) => {
139
+ const y = resolveComponent("FmIcon"), v = resolveComponent("FmButton");
140
140
  return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$l, [
141
141
  createElementVNode("div", _hoisted_2$h, [
142
142
  createElementVNode("div", _hoisted_3$e, [
143
- createVNode(h, {
143
+ createVNode(y, {
144
144
  name: "restaurant",
145
145
  size: "md"
146
146
  }),
147
- s[0] || (s[0] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Items", -1))
147
+ r[0] || (r[0] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Items", -1))
148
148
  ]),
149
- createVNode(g, {
149
+ createVNode(v, {
150
150
  icon: "close",
151
151
  variant: "tertiary",
152
- onClick: o
152
+ onClick: l
153
153
  })
154
154
  ]),
155
- s[1] || (s[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which items this discount applies to. For bundle discounts, select multiple items that can be bundled together. ", -1)),
156
- createElementVNode("div", _hoisted_4$b, [
155
+ 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)),
156
+ createElementVNode("div", _hoisted_4$d, [
157
157
  createVNode(_sfc_main$o, {
158
158
  ref_key: "selectItemRef",
159
- ref: u,
159
+ ref: i,
160
160
  "initial-value": e.initialValue,
161
161
  "filter-items": e.filterItems,
162
- "on-complete": n,
162
+ "on-complete": o,
163
163
  "max-height": 300
164
164
  }, null, 8, ["initial-value", "filter-items"])
165
165
  ]),
166
- createElementVNode("div", _hoisted_5$7, [
167
- createVNode(g, {
166
+ createElementVNode("div", _hoisted_5$a, [
167
+ createVNode(v, {
168
168
  variant: "secondary",
169
169
  label: "Cancel",
170
- onClick: o
170
+ onClick: l
171
171
  }),
172
- createVNode(g, {
172
+ createVNode(v, {
173
173
  variant: "primary",
174
174
  label: "Confirm Selection",
175
- onClick: a
175
+ onClick: s
176
176
  })
177
177
  ])
178
178
  ])) : createCommentVNode("", !0);
@@ -181,7 +181,7 @@ const _hoisted_1$l = {
181
181
  }), _hoisted_1$k = {
182
182
  key: 0,
183
183
  class: "bg-fm-color-neutral-gray-50 border border-fm-color-neutral-gray-200 rounded-8 p-16 space-y-16"
184
- }, _hoisted_2$g = { class: "flex items-center justify-between" }, _hoisted_3$d = { class: "flex items-center gap-8" }, _hoisted_4$a = { class: "flex gap-16 items-center flex-wrap" }, _hoisted_5$6 = { class: "flex gap-8 items-center" }, _hoisted_6$5 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_7$4 = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 max-h-[300px] overflow-y-auto" }, _hoisted_8$2 = { class: "flex items-center gap-12" }, _hoisted_9$2 = { class: "fm-typo-en-body-md-600" }, _hoisted_10$2 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_11$2 = {
184
+ }, _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 = {
185
185
  key: 1,
186
186
  class: "p-24 text-center"
187
187
  }, _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({
@@ -191,57 +191,57 @@ const _hoisted_1$l = {
191
191
  initialValue: {}
192
192
  },
193
193
  emits: ["confirm", "cancel"],
194
- setup(e, { emit: d }) {
195
- const r = e, i = d, u = Cb(), a = ref({}), o = ref(""), n = computed(() => {
196
- const m = u.menu.value;
197
- return m ? m.modules.category.map((f) => ({
194
+ setup(e, { emit: m }) {
195
+ const a = e, d = m, i = Cb(), s = ref({}), l = ref(""), o = computed(() => {
196
+ const c = i.menu.value;
197
+ return c ? c.modules.category.map((f) => ({
198
198
  id: f._id,
199
199
  name: f.name
200
200
  })) : [];
201
- }), l = computed(() => {
202
- if (!o.value) return n.value;
203
- const m = o.value.toLowerCase();
204
- return n.value.filter(
205
- (f) => f.name.toLowerCase().includes(m)
201
+ }), n = computed(() => {
202
+ if (!l.value) return o.value;
203
+ const c = l.value.toLowerCase();
204
+ return o.value.filter(
205
+ (f) => f.name.toLowerCase().includes(c)
206
206
  );
207
- }), s = computed(() => Object.values(a.value).filter(Boolean).length);
208
- function h() {
209
- a.value = n.value.reduce(
210
- (m, f) => (m[f.id] = r.initialValue.includes(f.id), m),
207
+ }), r = computed(() => Object.values(s.value).filter(Boolean).length);
208
+ function y() {
209
+ s.value = o.value.reduce(
210
+ (c, f) => (c[f.id] = a.initialValue.includes(f.id), c),
211
211
  {}
212
212
  );
213
213
  }
214
- watch([() => r.visible, () => r.initialValue], () => {
215
- r.visible && h();
214
+ watch([() => a.visible, () => a.initialValue], () => {
215
+ a.visible && y();
216
216
  }), onMounted(async () => {
217
- await u.store.getMenu(), h();
217
+ await i.store.getMenu(), y();
218
218
  });
219
- function g(m) {
220
- a.value[m] = !a.value[m];
219
+ function v(c) {
220
+ s.value[c] = !s.value[c];
221
221
  }
222
- function b() {
223
- const m = s.value === l.value.length;
224
- l.value.forEach((f) => {
225
- a.value[f.id] = !m;
222
+ function h() {
223
+ const c = r.value === n.value.length;
224
+ n.value.forEach((f) => {
225
+ s.value[f.id] = !c;
226
226
  });
227
227
  }
228
- function V() {
229
- Object.keys(a.value).forEach((m) => {
230
- a.value[m] = !1;
228
+ function x() {
229
+ Object.keys(s.value).forEach((c) => {
230
+ s.value[c] = !1;
231
231
  });
232
232
  }
233
- function p() {
234
- const m = Object.entries(a.value).filter(([, f]) => f).map(([f]) => f);
235
- i("confirm", m);
233
+ function k() {
234
+ const c = Object.entries(s.value).filter(([, f]) => f).map(([f]) => f);
235
+ d("confirm", c);
236
236
  }
237
- function c() {
238
- i("cancel");
237
+ function p() {
238
+ d("cancel");
239
239
  }
240
- const y = computed(() => l.value.length > 0 && l.value.every(
241
- (m) => a.value[m.id]
240
+ const u = computed(() => n.value.length > 0 && n.value.every(
241
+ (c) => s.value[c.id]
242
242
  ));
243
- return (m, f) => {
244
- const B = resolveComponent("FmIcon"), C = resolveComponent("FmButton"), E = resolveComponent("FmTextField"), $ = resolveComponent("FmCheckbox"), x = resolveComponent("FmListItem"), S = resolveComponent("FmList");
243
+ return (c, f) => {
244
+ const B = resolveComponent("FmIcon"), b = resolveComponent("FmButton"), E = resolveComponent("FmTextField"), N = resolveComponent("FmCheckbox"), C = resolveComponent("FmListItem"), R = resolveComponent("FmList");
245
245
  return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$k, [
246
246
  createElementVNode("div", _hoisted_2$g, [
247
247
  createElementVNode("div", _hoisted_3$d, [
@@ -251,66 +251,66 @@ const _hoisted_1$l = {
251
251
  }),
252
252
  f[2] || (f[2] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Categories", -1))
253
253
  ]),
254
- createVNode(C, {
254
+ createVNode(b, {
255
255
  icon: "close",
256
256
  variant: "tertiary",
257
- onClick: c
257
+ onClick: p
258
258
  })
259
259
  ]),
260
260
  f[3] || (f[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)),
261
- createElementVNode("div", _hoisted_4$a, [
262
- createElementVNode("div", _hoisted_5$6, [
263
- createVNode(C, {
261
+ createElementVNode("div", _hoisted_4$c, [
262
+ createElementVNode("div", _hoisted_5$9, [
263
+ createVNode(b, {
264
264
  icon: "select_all",
265
265
  variant: "tertiary",
266
266
  size: "small",
267
- label: `${y.value ? "Deselect" : "Select"} All`,
268
- onClick: b
267
+ label: `${u.value ? "Deselect" : "Select"} All`,
268
+ onClick: h
269
269
  }, null, 8, ["label"]),
270
- createVNode(C, {
270
+ createVNode(b, {
271
271
  icon: "sync",
272
272
  variant: "tertiary",
273
273
  size: "small",
274
274
  label: "Clear",
275
- onClick: V
275
+ onClick: x
276
276
  }),
277
- createElementVNode("span", _hoisted_6$5, toDisplayString(s.value) + " selected ", 1)
277
+ createElementVNode("span", _hoisted_6$5, toDisplayString(r.value) + " selected ", 1)
278
278
  ]),
279
279
  createVNode(E, {
280
- modelValue: o.value,
281
- "onUpdate:modelValue": f[0] || (f[0] = (N) => o.value = N),
280
+ modelValue: l.value,
281
+ "onUpdate:modelValue": f[0] || (f[0] = (S) => l.value = S),
282
282
  placeholder: "Search categories",
283
283
  "leading-icon": { name: "search", color: "" },
284
284
  class: "flex-1 min-w-[200px]"
285
285
  }, null, 8, ["modelValue"])
286
286
  ]),
287
- createElementVNode("div", _hoisted_7$4, [
288
- l.value.length > 0 ? (openBlock(), createBlock(S, { key: 0 }, {
287
+ createElementVNode("div", _hoisted_7$5, [
288
+ n.value.length > 0 ? (openBlock(), createBlock(R, { key: 0 }, {
289
289
  default: withCtx(() => [
290
- (openBlock(!0), createElementBlock(Fragment, null, renderList(l.value, (N) => (openBlock(), createBlock(x, {
291
- key: N.id,
290
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (S) => (openBlock(), createBlock(C, {
291
+ key: S.id,
292
292
  clickable: !0,
293
- onClick: (I) => g(N.id)
293
+ onClick: ($) => v(S.id)
294
294
  }, {
295
295
  leading: withCtx(() => [
296
- createVNode($, {
297
- "model-value": a.value[N.id] || !1,
298
- value: N.id,
299
- "onUpdate:modelValue": (I) => g(N.id),
296
+ createVNode(N, {
297
+ "model-value": s.value[S.id] || !1,
298
+ value: S.id,
299
+ "onUpdate:modelValue": ($) => v(S.id),
300
300
  onClick: f[1] || (f[1] = withModifiers(() => {
301
301
  }, ["stop"]))
302
302
  }, null, 8, ["model-value", "value", "onUpdate:modelValue"])
303
303
  ]),
304
304
  default: withCtx(() => [
305
- createElementVNode("div", _hoisted_8$2, [
305
+ createElementVNode("div", _hoisted_8$4, [
306
306
  createVNode(B, {
307
307
  name: "category",
308
308
  size: "sm",
309
309
  class: "text-fm-color-typo-secondary"
310
310
  }),
311
311
  createElementVNode("div", null, [
312
- createElementVNode("div", _hoisted_9$2, toDisplayString(N.name), 1),
313
- createElementVNode("div", _hoisted_10$2, " ID: " + toDisplayString(N.id), 1)
312
+ createElementVNode("div", _hoisted_9$4, toDisplayString(S.name), 1),
313
+ createElementVNode("div", _hoisted_10$4, " ID: " + toDisplayString(S.id), 1)
314
314
  ])
315
315
  ])
316
316
  ]),
@@ -319,20 +319,20 @@ const _hoisted_1$l = {
319
319
  ]),
320
320
  _: 1
321
321
  })) : (openBlock(), createElementBlock("div", _hoisted_11$2, [
322
- createElementVNode("div", _hoisted_12$1, toDisplayString(o.value ? "No categories found matching your search." : "No categories available."), 1)
322
+ createElementVNode("div", _hoisted_12$1, toDisplayString(l.value ? "No categories found matching your search." : "No categories available."), 1)
323
323
  ]))
324
324
  ]),
325
325
  createElementVNode("div", _hoisted_13$1, [
326
- createVNode(C, {
326
+ createVNode(b, {
327
327
  variant: "secondary",
328
328
  label: "Cancel",
329
- onClick: c
329
+ onClick: p
330
330
  }),
331
- createVNode(C, {
331
+ createVNode(b, {
332
332
  variant: "primary",
333
- label: `Confirm Selection (${s.value})`,
334
- disabled: s.value === 0,
335
- onClick: p
333
+ label: `Confirm Selection (${r.value})`,
334
+ disabled: r.value === 0,
335
+ onClick: k
336
336
  }, null, 8, ["label", "disabled"])
337
337
  ])
338
338
  ])) : createCommentVNode("", !0);
@@ -341,7 +341,7 @@ const _hoisted_1$l = {
341
341
  }), _hoisted_1$j = { class: "space-y-8" }, _hoisted_2$f = {
342
342
  key: 1,
343
343
  class: "border-1 rounded-md flex gap-16 items-center justify-between px-16 py-12"
344
- }, _hoisted_3$c = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$9 = { class: "text-fm-color-typo-secondary" }, _hoisted_5$5 = { key: 0 }, _hoisted_6$4 = { class: "space-y-24" }, _hoisted_7$3 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-4" }, _hoisted_8$1 = { key: 0 }, _hoisted_9$1 = { class: "fm-typo-en-body-md-600 mb-8 block" }, _hoisted_10$1 = { 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 = {
344
+ }, _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 = {
345
345
  key: 0,
346
346
  class: "mt-16 p-12 bg-fm-color-feedback-error-light rounded-8 border border-fm-color-feedback-error-main"
347
347
  }, _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({
@@ -350,8 +350,8 @@ const _hoisted_1$l = {
350
350
  modelValue: { type: Object }
351
351
  },
352
352
  emits: ["update:model-value"],
353
- setup(e, { emit: d }) {
354
- const r = e, i = d, u = Cb(), a = ref(!1), o = ref(!1), n = ref(!1), l = ref({
353
+ setup(e, { emit: m }) {
354
+ const a = e, d = m, i = Cb(), s = ref(!1), l = ref(!1), o = ref(!1), n = ref({
355
355
  type: "net",
356
356
  value: 0,
357
357
  scope: {
@@ -359,72 +359,72 @@ const _hoisted_1$l = {
359
359
  }
360
360
  });
361
361
  watch(
362
- () => r.modelValue,
363
- (v) => {
364
- v && (l.value = { ...v });
362
+ () => a.modelValue,
363
+ (g) => {
364
+ g && (n.value = { ...g });
365
365
  },
366
366
  { immediate: !0 }
367
367
  ), onMounted(async () => {
368
- await u.store.getMenu();
368
+ await i.store.getMenu();
369
369
  });
370
- const s = computed(() => {
371
- var v;
372
- return !(!l.value.type || !((v = l.value.scope) != null && v.type) || b(l.value.type) && (!l.value.value || l.value.value <= 0) || (l.value.scope.type === "items" || l.value.scope.type === "category") && (!l.value.scope.objectIDs || l.value.scope.objectIDs.length === 0));
370
+ const r = computed(() => {
371
+ var g;
372
+ return !(!n.value.type || !((g = n.value.scope) != null && g.type) || h(n.value.type) && (!n.value.value || n.value.value <= 0) || (n.value.scope.type === "items" || n.value.scope.type === "category") && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0));
373
373
  });
374
- async function h(v) {
375
- v.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && i("update:model-value", null);
374
+ async function y(g) {
375
+ g.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && d("update:model-value", null);
376
376
  }
377
- function g() {
378
- var v;
379
- return B(((v = l.value.scope) == null ? void 0 : v.type) || "order");
377
+ function v() {
378
+ var g;
379
+ return B(((g = n.value.scope) == null ? void 0 : g.type) || "order");
380
380
  }
381
- function b(v) {
382
- return v && !["freeItem", "delivery"].includes(v);
381
+ function h(g) {
382
+ return g && !["freeItem", "delivery"].includes(g);
383
383
  }
384
- function V(v) {
385
- return v && ["percentage", "bundleSamePercentage", "bundleDiffPercentage"].includes(
386
- v
384
+ function x(g) {
385
+ return g && ["percentage", "bundleSamePercentage", "bundleDiffPercentage"].includes(
386
+ g
387
387
  );
388
388
  }
389
- function p(v) {
390
- return v != null && v.includes("Percentage") ? "Discount percentage" : v != null && v.includes("FixPrice") ? "Bundle fixed price" : v === "percentage" ? "Discount percentage" : "Discount amount";
389
+ function k(g) {
390
+ return g != null && g.includes("Percentage") ? "Discount percentage" : g != null && g.includes("FixPrice") ? "Bundle fixed price" : g === "percentage" ? "Discount percentage" : "Discount amount";
391
391
  }
392
- function c(v) {
393
- return v != null && v.includes("Percentage") || v === "percentage" ? "10" : "5.00";
392
+ function p(g) {
393
+ return g != null && g.includes("Percentage") || g === "percentage" ? "10" : "5.00";
394
394
  }
395
- function y(v) {
396
- return v != null && v.includes("Percentage") || v === "percentage" ? "%" : "$";
395
+ function u(g) {
396
+ return g != null && g.includes("Percentage") || g === "percentage" ? "%" : "$";
397
397
  }
398
- function m(v, k) {
399
- l.value = {
400
- ...l.value,
401
- [v]: k
398
+ function c(g, V) {
399
+ n.value = {
400
+ ...n.value,
401
+ [g]: V
402
402
  };
403
403
  }
404
- function f(v, k) {
405
- var T;
404
+ function f(g, V) {
405
+ var D;
406
406
  const w = {
407
- ...l.value.scope,
408
- [v]: k
407
+ ...n.value.scope,
408
+ [g]: V
409
409
  };
410
- if (l.value = {
411
- ...l.value,
410
+ if (n.value = {
411
+ ...n.value,
412
412
  scope: w
413
- }, v === "type") {
414
- const F = B(k);
413
+ }, g === "type") {
414
+ const F = B(V);
415
415
  F.some(
416
- (U) => U.value === l.value.type
417
- ) || (l.value = {
418
- ...l.value,
419
- type: ((T = F[0]) == null ? void 0 : T.value) || "net",
416
+ (P) => P.value === n.value.type
417
+ ) || (n.value = {
418
+ ...n.value,
419
+ type: ((D = F[0]) == null ? void 0 : D.value) || "net",
420
420
  // Reset value and cap when changing to incompatible type
421
421
  value: 0,
422
422
  cap: void 0
423
423
  });
424
424
  }
425
425
  }
426
- function B(v) {
427
- switch (v) {
426
+ function B(g) {
427
+ switch (g) {
428
428
  case "order":
429
429
  return [
430
430
  { label: "Amount off", value: "net" },
@@ -470,8 +470,8 @@ const _hoisted_1$l = {
470
470
  ];
471
471
  }
472
472
  }
473
- function C(v) {
474
- switch (v) {
473
+ function b(g) {
474
+ switch (g) {
475
475
  case "order":
476
476
  return "Applies to entire order. Available: Amount off, Percentage off, Delivery fee discount.";
477
477
  case "category":
@@ -483,95 +483,95 @@ const _hoisted_1$l = {
483
483
  }
484
484
  }
485
485
  function E() {
486
- var v;
487
- return ((v = l.value.scope) == null ? void 0 : v.type) === "items";
486
+ var g;
487
+ return ((g = n.value.scope) == null ? void 0 : g.type) === "items";
488
488
  }
489
- function $() {
490
- var v;
491
- return ((v = l.value.scope) == null ? void 0 : v.type) === "category";
489
+ function N() {
490
+ var g;
491
+ return ((g = n.value.scope) == null ? void 0 : g.type) === "category";
492
492
  }
493
- function x() {
493
+ function C() {
494
494
  var w;
495
- const v = (w = l.value.scope) == null ? void 0 : w.objectIDs;
496
- if (!v || v.length === 0)
495
+ const g = (w = n.value.scope) == null ? void 0 : w.objectIDs;
496
+ if (!g || g.length === 0)
497
497
  return "No items selected";
498
- const k = u.menu.value;
499
- return k && v.length <= 3 ? v.map((F) => {
500
- const R = k.modules.item.find((U) => U._id === F);
501
- return R ? (R.name2 || R.name).trim() : `Item ${F}`;
502
- }).join(", ") : v.length === 1 ? "1 item selected" : `${v.length} items selected`;
498
+ const V = i.menu.value;
499
+ return V && g.length <= 3 ? g.map((F) => {
500
+ const T = V.modules.item.find((P) => P._id === F);
501
+ return T ? (T.name2 || T.name).trim() : `Item ${F}`;
502
+ }).join(", ") : g.length === 1 ? "1 item selected" : `${g.length} items selected`;
503
503
  }
504
- function S() {
504
+ function R() {
505
505
  var w;
506
- const v = (w = l.value.scope) == null ? void 0 : w.objectIDs;
507
- if (!v || v.length === 0)
506
+ const g = (w = n.value.scope) == null ? void 0 : w.objectIDs;
507
+ if (!g || g.length === 0)
508
508
  return "No categories selected";
509
- const k = u.menu.value;
510
- return k && v.length <= 3 ? v.map((F) => {
511
- const R = k.modules.category.find((U) => U._id === F);
512
- return R ? R.name : `Category ${F}`;
513
- }).join(", ") : v.length === 1 ? "1 category selected" : `${v.length} categories selected`;
509
+ const V = i.menu.value;
510
+ return V && g.length <= 3 ? g.map((F) => {
511
+ const T = V.modules.category.find((P) => P._id === F);
512
+ return T ? T.name : `Category ${F}`;
513
+ }).join(", ") : g.length === 1 ? "1 category selected" : `${g.length} categories selected`;
514
514
  }
515
- function N() {
516
- o.value = !0;
515
+ function S() {
516
+ l.value = !0;
517
517
  }
518
- function I() {
519
- n.value = !0;
518
+ function $() {
519
+ o.value = !0;
520
520
  }
521
- function M(v) {
522
- f("objectIDs", v), o.value = !1;
521
+ function H(g) {
522
+ f("objectIDs", g), l.value = !1;
523
523
  }
524
- function j(v) {
525
- f("objectIDs", v), n.value = !1;
524
+ function j(g) {
525
+ f("objectIDs", g), o.value = !1;
526
526
  }
527
527
  function Y() {
528
- o.value = !1;
528
+ l.value = !1;
529
529
  }
530
530
  function G() {
531
- n.value = !1;
531
+ o.value = !1;
532
532
  }
533
- const H = computed(() => {
534
- var k, w, T;
535
- const v = [];
536
- return l.value.type || v.push("Discount type is required"), (k = l.value.scope) != null && k.type || v.push("Scope type is required"), b(l.value.type) && (!l.value.value || l.value.value <= 0) && v.push("Discount amount must be greater than 0"), ((w = l.value.scope) == null ? void 0 : w.type) === "items" && (!l.value.scope.objectIDs || l.value.scope.objectIDs.length === 0) && v.push("Please select at least one item"), ((T = l.value.scope) == null ? void 0 : T.type) === "category" && (!l.value.scope.objectIDs || l.value.scope.objectIDs.length === 0) && v.push("Please select at least one category"), v;
533
+ const M = computed(() => {
534
+ var V, w, D;
535
+ const g = [];
536
+ return n.value.type || g.push("Discount type is required"), (V = n.value.scope) != null && V.type || g.push("Scope type is required"), h(n.value.type) && (!n.value.value || n.value.value <= 0) && g.push("Discount amount must be greater than 0"), ((w = n.value.scope) == null ? void 0 : w.type) === "items" && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0) && g.push("Please select at least one item"), ((D = n.value.scope) == null ? void 0 : D.type) === "category" && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0) && g.push("Please select at least one category"), g;
537
537
  });
538
538
  function Z() {
539
- i("update:model-value", l.value), a.value = !1;
539
+ d("update:model-value", n.value), s.value = !1;
540
540
  }
541
541
  const q = [
542
542
  { label: "Bill discount", value: "order" },
543
543
  { label: "Item discount", value: "items" },
544
544
  { label: "Category discount", value: "category" }
545
545
  ];
546
- return (v, k) => {
547
- const w = resolveComponent("FmButton"), T = resolveComponent("FmSelect"), F = resolveComponent("FmStepperField"), R = resolveComponent("FmIcon"), U = resolveComponent("FmSideSheet");
548
- return openBlock(), createBlock(U, {
546
+ return (g, V) => {
547
+ const w = resolveComponent("FmButton"), D = resolveComponent("FmSelect"), F = resolveComponent("FmStepperField"), T = resolveComponent("FmIcon"), P = resolveComponent("FmSideSheet");
548
+ return openBlock(), createBlock(P, {
549
549
  "max-width": 550,
550
550
  header: "Apply discount",
551
- modelValue: unref(a),
551
+ modelValue: unref(s),
552
552
  "onUpdate:modelValue": [
553
- k[5] || (k[5] = (D) => isRef(a) ? a.value = D : null),
554
- k[6] || (k[6] = (D) => a.value = D)
553
+ V[5] || (V[5] = (O) => isRef(s) ? s.value = O : null),
554
+ V[6] || (V[6] = (O) => s.value = O)
555
555
  ]
556
556
  }, {
557
557
  "side-sheet-button": withCtx(() => {
558
- var D, P, A, L;
558
+ var O, U, A, L;
559
559
  return [
560
560
  createElementVNode("div", _hoisted_1$j, [
561
- k[7] || (k[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)),
561
+ 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)),
562
562
  e.modelValue ? (openBlock(), createElementBlock("div", _hoisted_2$f, [
563
563
  createElementVNode("div", _hoisted_3$c, [
564
- createElementVNode("div", null, toDisplayString((D = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : D.type), 1),
565
- createElementVNode("div", _hoisted_4$9, [
566
- createTextVNode(toDisplayString((P = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : P.adjustment) + " ", 1),
567
- (A = unref(summarizeGrabDiscount)(e.modelValue)) != null && A.cap ? (openBlock(), createElementBlock("span", _hoisted_5$5, toDisplayString((L = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : L.cap), 1)) : createCommentVNode("", !0)
564
+ createElementVNode("div", null, toDisplayString((O = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : O.type), 1),
565
+ createElementVNode("div", _hoisted_4$b, [
566
+ createTextVNode(toDisplayString((U = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : U.adjustment) + " ", 1),
567
+ (A = unref(summarizeGrabDiscount)(e.modelValue)) != null && A.cap ? (openBlock(), createElementBlock("span", _hoisted_5$8, toDisplayString((L = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : L.cap), 1)) : createCommentVNode("", !0)
568
568
  ])
569
569
  ]),
570
570
  createVNode(w, {
571
571
  icon: "delete",
572
572
  "icon-color": "neutral-gray-400",
573
573
  variant: "tertiary",
574
- onClick: h
574
+ onClick: y
575
575
  })
576
576
  ])) : (openBlock(), createBlock(w, {
577
577
  key: 0,
@@ -590,130 +590,130 @@ const _hoisted_1$l = {
590
590
  variant: "secondary",
591
591
  label: "Cancel",
592
592
  class: "flex-1",
593
- onClick: k[4] || (k[4] = (D) => a.value = !1)
593
+ onClick: V[4] || (V[4] = (O) => s.value = !1)
594
594
  }),
595
595
  createVNode(w, {
596
596
  variant: "primary",
597
- label: unref(s) ? "Confirm" : "Complete Required Fields",
597
+ label: unref(r) ? "Confirm" : "Complete Required Fields",
598
598
  class: "flex-1",
599
- disabled: !unref(s),
599
+ disabled: !unref(r),
600
600
  onClick: Z
601
601
  }, null, 8, ["label", "disabled"])
602
602
  ])
603
603
  ]),
604
604
  default: withCtx(() => {
605
- var D, P, A, L;
605
+ var O, U, A, L;
606
606
  return [
607
607
  createElementVNode("div", _hoisted_6$4, [
608
608
  createElementVNode("div", null, [
609
- k[8] || (k[8] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Campaign type", -1)),
610
- createVNode(T, {
611
- "model-value": ((D = unref(l).scope) == null ? void 0 : D.type) || "order",
612
- "onUpdate:modelValue": k[0] || (k[0] = (O) => f("type", O)),
609
+ V[8] || (V[8] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Campaign type", -1)),
610
+ createVNode(D, {
611
+ "model-value": ((O = unref(n).scope) == null ? void 0 : O.type) || "order",
612
+ "onUpdate:modelValue": V[0] || (V[0] = (I) => f("type", I)),
613
613
  placeholder: "Select campaign type",
614
614
  items: q
615
615
  }, null, 8, ["model-value"]),
616
- createElementVNode("div", _hoisted_7$3, toDisplayString(C((P = unref(l).scope) == null ? void 0 : P.type)), 1)
616
+ createElementVNode("div", _hoisted_7$4, toDisplayString(b((U = unref(n).scope) == null ? void 0 : U.type)), 1)
617
617
  ]),
618
618
  createElementVNode("div", null, [
619
- k[9] || (k[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
620
- createVNode(T, {
621
- "model-value": unref(l).type,
622
- "onUpdate:modelValue": k[1] || (k[1] = (O) => m("type", O)),
619
+ V[9] || (V[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
620
+ createVNode(D, {
621
+ "model-value": unref(n).type,
622
+ "onUpdate:modelValue": V[1] || (V[1] = (I) => c("type", I)),
623
623
  placeholder: "Select discount type",
624
- items: g()
624
+ items: v()
625
625
  }, null, 8, ["model-value", "items"])
626
626
  ]),
627
- b(unref(l).type) ? (openBlock(), createElementBlock("div", _hoisted_8$1, [
628
- createElementVNode("label", _hoisted_9$1, toDisplayString(p(unref(l).type)), 1),
627
+ h(unref(n).type) ? (openBlock(), createElementBlock("div", _hoisted_8$3, [
628
+ createElementVNode("label", _hoisted_9$3, toDisplayString(k(unref(n).type)), 1),
629
629
  createVNode(F, {
630
- modelValue: unref(l).value,
631
- "onUpdate:modelValue": k[2] || (k[2] = (O) => unref(l).value = O),
632
- placeholder: c(unref(l).type),
633
- suffix: y(unref(l).type),
630
+ modelValue: unref(n).value,
631
+ "onUpdate:modelValue": V[2] || (V[2] = (I) => unref(n).value = I),
632
+ placeholder: p(unref(n).type),
633
+ suffix: u(unref(n).type),
634
634
  type: "number"
635
635
  }, null, 8, ["modelValue", "placeholder", "suffix"])
636
636
  ])) : createCommentVNode("", !0),
637
- V(unref(l).type) ? (openBlock(), createElementBlock("div", _hoisted_10$1, [
638
- k[10] || (k[10] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount cap (optional)", -1)),
637
+ x(unref(n).type) ? (openBlock(), createElementBlock("div", _hoisted_10$3, [
638
+ V[10] || (V[10] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount cap (optional)", -1)),
639
639
  createVNode(F, {
640
- modelValue: unref(l).cap,
641
- "onUpdate:modelValue": k[3] || (k[3] = (O) => unref(l).cap = O),
640
+ modelValue: unref(n).cap,
641
+ "onUpdate:modelValue": V[3] || (V[3] = (I) => unref(n).cap = I),
642
642
  placeholder: "Maximum discount amount",
643
643
  type: "number"
644
644
  }, null, 8, ["modelValue"])
645
645
  ])) : createCommentVNode("", !0),
646
646
  E() ? (openBlock(), createElementBlock("div", _hoisted_11$1, [
647
- unref(o) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_12, [
648
- k[12] || (k[12] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Items", -1)),
647
+ unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_12, [
648
+ V[12] || (V[12] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Items", -1)),
649
649
  createElementVNode("div", _hoisted_13, [
650
650
  createElementVNode("div", _hoisted_14, [
651
651
  createElementVNode("div", _hoisted_15, [
652
- createVNode(R, {
652
+ createVNode(T, {
653
653
  name: "restaurant",
654
654
  size: "md"
655
655
  }),
656
- createElementVNode("span", _hoisted_16, toDisplayString(x()), 1)
656
+ createElementVNode("span", _hoisted_16, toDisplayString(C()), 1)
657
657
  ]),
658
658
  createVNode(w, {
659
659
  variant: "secondary",
660
660
  label: "Select Items",
661
661
  icon: "chevron_right",
662
- onClick: N
662
+ onClick: S
663
663
  })
664
664
  ]),
665
- k[11] || (k[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))
665
+ 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))
666
666
  ])
667
667
  ])),
668
668
  createVNode(_sfc_main$n, {
669
- visible: unref(o),
670
- "initial-value": ((A = unref(l).scope) == null ? void 0 : A.objectIDs) || [],
671
- onConfirm: M,
669
+ visible: unref(l),
670
+ "initial-value": ((A = unref(n).scope) == null ? void 0 : A.objectIDs) || [],
671
+ onConfirm: H,
672
672
  onCancel: Y
673
673
  }, null, 8, ["visible", "initial-value"])
674
674
  ])) : createCommentVNode("", !0),
675
- $() ? (openBlock(), createElementBlock("div", _hoisted_17, [
676
- unref(n) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_18, [
677
- k[14] || (k[14] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Categories", -1)),
675
+ N() ? (openBlock(), createElementBlock("div", _hoisted_17, [
676
+ unref(o) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_18, [
677
+ V[14] || (V[14] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Categories", -1)),
678
678
  createElementVNode("div", _hoisted_19, [
679
679
  createElementVNode("div", _hoisted_20, [
680
680
  createElementVNode("div", _hoisted_21, [
681
- createVNode(R, {
681
+ createVNode(T, {
682
682
  name: "category",
683
683
  size: "md"
684
684
  }),
685
- createElementVNode("span", _hoisted_22, toDisplayString(S()), 1)
685
+ createElementVNode("span", _hoisted_22, toDisplayString(R()), 1)
686
686
  ]),
687
687
  createVNode(w, {
688
688
  variant: "secondary",
689
689
  label: "Select Categories",
690
690
  icon: "chevron_right",
691
- onClick: I
691
+ onClick: $
692
692
  })
693
693
  ]),
694
- k[13] || (k[13] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. ", -1))
694
+ 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))
695
695
  ])
696
696
  ])),
697
697
  createVNode(_sfc_main$m, {
698
- visible: unref(n),
699
- "initial-value": ((L = unref(l).scope) == null ? void 0 : L.objectIDs) || [],
698
+ visible: unref(o),
699
+ "initial-value": ((L = unref(n).scope) == null ? void 0 : L.objectIDs) || [],
700
700
  onConfirm: j,
701
701
  onCancel: G
702
702
  }, null, 8, ["visible", "initial-value"])
703
703
  ])) : createCommentVNode("", !0)
704
704
  ]),
705
- unref(H).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23, [
705
+ unref(M).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23, [
706
706
  createElementVNode("div", _hoisted_24, [
707
- createVNode(R, { name: "warning" }),
708
- k[15] || (k[15] = createElementVNode("span", { class: "fm-typo-en-body-sm-600" }, "Please fix the following issues:", -1))
707
+ createVNode(T, { name: "warning" }),
708
+ V[15] || (V[15] = createElementVNode("span", { class: "fm-typo-en-body-sm-600" }, "Please fix the following issues:", -1))
709
709
  ]),
710
710
  createElementVNode("ul", _hoisted_25, [
711
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(H), (O) => (openBlock(), createElementBlock("li", {
712
- key: O,
711
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(M), (I) => (openBlock(), createElementBlock("li", {
712
+ key: I,
713
713
  class: "fm-typo-en-body-sm-400 text-fm-color-feedback-error-main flex items-start gap-8"
714
714
  }, [
715
- k[16] || (k[16] = createElementVNode("span", { class: "w-4 h-4 bg-fm-color-feedback-error-main rounded-full mt-6 flex-shrink-0" }, null, -1)),
716
- createTextVNode(" " + toDisplayString(O), 1)
715
+ 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)),
716
+ createTextVNode(" " + toDisplayString(I), 1)
717
717
  ]))), 128))
718
718
  ])
719
719
  ])) : createCommentVNode("", !0)
@@ -733,83 +733,83 @@ const _hoisted_1$l = {
733
733
  }
734
734
  },
735
735
  emits: ["update:model-value"],
736
- setup(e, { emit: d }) {
737
- const { t: r } = useI18n(), i = e, u = d, a = ref(
738
- !i.modelValue || !i.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(i.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
736
+ setup(e, { emit: m }) {
737
+ const { t: a } = useI18n(), d = e, i = m, s = ref(
738
+ !d.modelValue || !d.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(d.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
739
739
  );
740
- watch(a, async (n, l) => {
741
- var s;
742
- if (l == "custom" && n == "all_time" && RuleBuilder.getRules((s = i.modelValue) == null ? void 0 : s.rules.g_time).length > 0) {
743
- const h = await prompt.confirm(
744
- r("connect.template.rule.time.confirm_remove"),
745
- r("connect.common.confirm"),
746
- r("connect.common.confirm"),
747
- r("connect.common.cancel")
740
+ watch(s, async (o, n) => {
741
+ var r;
742
+ if (n == "custom" && o == "all_time" && RuleBuilder.getRules((r = d.modelValue) == null ? void 0 : r.rules.g_time).length > 0) {
743
+ const y = await prompt.confirm(
744
+ a("connect.template.rule.time.confirm_remove"),
745
+ a("connect.common.confirm"),
746
+ a("connect.common.confirm"),
747
+ a("connect.common.cancel")
748
748
  );
749
- h && u(
749
+ y && i(
750
750
  "update:model-value",
751
751
  RuleBuilder.setRuleToGroup(
752
- i.modelValue ?? RuleBuilder.scaffoldGroup(),
752
+ d.modelValue ?? RuleBuilder.scaffoldGroup(),
753
753
  RuleBuilder.scaffoldGroup("g_time")
754
754
  )
755
- ), a.value = h ? n : l;
755
+ ), s.value = y ? o : n;
756
756
  }
757
757
  });
758
- async function o(n) {
759
- var l;
760
- if (n == "custom" && RuleBuilder.getRules((l = i.modelValue) == null ? void 0 : l.rules.g_time).length > 0) {
758
+ async function l(o) {
759
+ var n;
760
+ if (o == "custom" && RuleBuilder.getRules((n = d.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
761
761
  if (!await prompt.confirm(
762
- r("connect.template.rule.time.confirm_remove"),
763
- r("connect.common.confirm"),
764
- r("connect.common.confirm"),
765
- r("connect.common.cancel")
762
+ a("connect.template.rule.time.confirm_remove"),
763
+ a("connect.common.confirm"),
764
+ a("connect.common.confirm"),
765
+ a("connect.common.cancel")
766
766
  )) {
767
- a.value = "all_time";
767
+ s.value = "all_time";
768
768
  return;
769
769
  }
770
- u(
770
+ i(
771
771
  "update:model-value",
772
772
  RuleBuilder.setRuleToGroup(
773
- i.modelValue ?? RuleBuilder.scaffoldGroup(),
773
+ d.modelValue ?? RuleBuilder.scaffoldGroup(),
774
774
  RuleBuilder.scaffoldGroup("g_time")
775
775
  )
776
776
  );
777
777
  }
778
778
  }
779
- return (n, l) => {
780
- var g;
781
- const s = resolveComponent("FmRadio"), h = resolveComponent("FmRadioGroup");
779
+ return (o, n) => {
780
+ var v;
781
+ const r = resolveComponent("FmRadio"), y = resolveComponent("FmRadioGroup");
782
782
  return openBlock(), createElementBlock("div", _hoisted_1$i, [
783
- createVNode(h, {
784
- modelValue: unref(a),
783
+ createVNode(y, {
784
+ modelValue: unref(s),
785
785
  "onUpdate:modelValue": [
786
- l[0] || (l[0] = (b) => isRef(a) ? a.value = b : null),
787
- l[1] || (l[1] = (b) => o(b))
786
+ n[0] || (n[0] = (h) => isRef(s) ? s.value = h : null),
787
+ n[1] || (n[1] = (h) => l(h))
788
788
  ]
789
789
  }, {
790
790
  default: withCtx(() => [
791
- createVNode(s, {
792
- label: unref(r)("connect.template.rule.time.all_time"),
791
+ createVNode(r, {
792
+ label: unref(a)("connect.template.rule.time.all_time"),
793
793
  value: "all_time"
794
794
  }, null, 8, ["label"]),
795
- createVNode(s, {
796
- label: unref(r)("connect.template.rule.time.custom"),
795
+ createVNode(r, {
796
+ label: unref(a)("connect.template.rule.time.custom"),
797
797
  value: "custom"
798
798
  }, null, 8, ["label"])
799
799
  ]),
800
800
  _: 1
801
801
  }, 8, ["modelValue"]),
802
- unref(a) == "custom" ? (openBlock(), createBlock(_sfc_main$p, {
802
+ unref(s) == "custom" ? (openBlock(), createBlock(_sfc_main$p, {
803
803
  key: 0,
804
804
  class: "!mt-[0px]",
805
805
  "include-only": "trigger",
806
806
  "trigger-type": "SCHEDULE",
807
- "model-value": ((g = e.modelValue) == null ? void 0 : g.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
808
- "onUpdate:modelValue": l[2] || (l[2] = (b) => u(
807
+ "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
808
+ "onUpdate:modelValue": n[2] || (n[2] = (h) => i(
809
809
  "update:model-value",
810
810
  unref(RuleBuilder).setRuleToGroup(
811
811
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
812
- b,
812
+ h,
813
813
  "&&"
814
814
  )
815
815
  ))
@@ -825,27 +825,27 @@ const _hoisted_1$l = {
825
825
  }
826
826
  },
827
827
  emits: ["update:model-value"],
828
- setup(e, { emit: d }) {
829
- const r = e, i = d, u = computed(() => {
830
- const { property: a, operator: o, equator: n } = RuleBuilder.simplify(
831
- r.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
828
+ setup(e, { emit: m }) {
829
+ const { t: a } = useI18n(), d = e, i = m, s = computed(() => {
830
+ const { property: l, operator: o, equator: n } = RuleBuilder.simplify(
831
+ d.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
832
832
  op: "before",
833
833
  x: 1
834
834
  })
835
835
  );
836
836
  return {
837
- property: a,
837
+ property: l,
838
838
  operator: o,
839
839
  equator: n
840
840
  };
841
841
  });
842
- return (a, o) => {
843
- const n = resolveComponent("FmRadio"), l = resolveComponent("FmStepperField");
842
+ return (l, o) => {
843
+ const n = resolveComponent("FmRadio"), r = resolveComponent("FmStepperField");
844
844
  return openBlock(), createElementBlock("div", null, [
845
845
  createVNode(n, {
846
- label: "On birthday",
846
+ label: unref(a)("connect.template.rule.birthday.on_birthday"),
847
847
  value: "_isRange-day",
848
- "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
848
+ "model-value": `${unref(s).operator}-${unref(s).equator.unit}`,
849
849
  "onUpdate:modelValue": o[0] || (o[0] = () => {
850
850
  i(
851
851
  "update:model-value",
@@ -856,11 +856,11 @@ const _hoisted_1$l = {
856
856
  })
857
857
  );
858
858
  })
859
- }, null, 8, ["model-value"]),
859
+ }, null, 8, ["label", "model-value"]),
860
860
  createVNode(n, {
861
- label: "N days before birthday",
861
+ label: unref(a)("connect.template.rule.birthday.days_before"),
862
862
  value: "_isDay",
863
- "model-value": unref(u).operator,
863
+ "model-value": unref(s).operator,
864
864
  "onUpdate:modelValue": o[1] || (o[1] = () => {
865
865
  i(
866
866
  "update:model-value",
@@ -871,25 +871,25 @@ const _hoisted_1$l = {
871
871
  })
872
872
  );
873
873
  })
874
- }, null, 8, ["model-value"]),
875
- unref(u).operator == "_isDay" ? (openBlock(), createBlock(l, {
874
+ }, null, 8, ["label", "model-value"]),
875
+ unref(s).operator == "_isDay" ? (openBlock(), createBlock(r, {
876
876
  key: 0,
877
- label: "Days before birthday",
877
+ label: unref(a)("connect.template.rule.birthday.days_before_label"),
878
878
  "show-steppers": !1,
879
- "model-value": unref(u).equator.x,
880
- "onUpdate:modelValue": o[2] || (o[2] = (s) => i(
879
+ "model-value": unref(s).equator.x,
880
+ "onUpdate:modelValue": o[2] || (o[2] = (y) => i(
881
881
  "update:model-value",
882
882
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
883
883
  op: "after",
884
- x: s,
884
+ x: y,
885
885
  ignoreYear: !0
886
886
  })
887
887
  ))
888
- }, null, 8, ["model-value"])) : createCommentVNode("", !0),
888
+ }, null, 8, ["label", "model-value"])) : createCommentVNode("", !0),
889
889
  createVNode(n, {
890
- label: "In birthday week",
890
+ label: unref(a)("connect.template.rule.birthday.in_birthday_week"),
891
891
  value: "_isRange-week",
892
- "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
892
+ "model-value": `${unref(s).operator}-${unref(s).equator.unit}`,
893
893
  "onUpdate:modelValue": o[3] || (o[3] = () => {
894
894
  i(
895
895
  "update:model-value",
@@ -900,11 +900,11 @@ const _hoisted_1$l = {
900
900
  })
901
901
  );
902
902
  })
903
- }, null, 8, ["model-value"]),
903
+ }, null, 8, ["label", "model-value"]),
904
904
  createVNode(n, {
905
- label: "In birthday month",
905
+ label: unref(a)("connect.template.rule.birthday.in_birthday_month"),
906
906
  value: "_isRange-month",
907
- "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
907
+ "model-value": `${unref(s).operator}-${unref(s).equator.unit}`,
908
908
  "onUpdate:modelValue": o[4] || (o[4] = () => {
909
909
  i(
910
910
  "update:model-value",
@@ -915,11 +915,11 @@ const _hoisted_1$l = {
915
915
  })
916
916
  );
917
917
  })
918
- }, null, 8, ["model-value"])
918
+ }, null, 8, ["label", "model-value"])
919
919
  ]);
920
920
  };
921
921
  }
922
- }), _hoisted_1$h = { class: "space-y-16" }, _hoisted_2$e = { class: "grid grid-cols-3 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$8 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
922
+ }), _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({
923
923
  __name: "CampaignTriggerInput",
924
924
  props: {
925
925
  campaignType: {
@@ -935,31 +935,31 @@ const _hoisted_1$l = {
935
935
  }
936
936
  },
937
937
  emits: ["update:model-value"],
938
- setup(e, { emit: d }) {
939
- const r = e, i = d, u = computed(() => r.disabled ? TypeToTriggerOptions[r.campaignType].filter(
940
- (a) => a.value == r.modelValue
941
- ) : TypeToTriggerOptions[r.campaignType]);
942
- return (a, o) => {
938
+ setup(e, { emit: m }) {
939
+ const { t: a } = useI18n(), d = e, i = m, s = computed(() => d.disabled ? TypeToTriggerOptions[d.campaignType].filter(
940
+ (l) => l.value == d.modelValue
941
+ ) : TypeToTriggerOptions[d.campaignType]);
942
+ return (l, o) => {
943
943
  const n = resolveComponent("FmCard");
944
944
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
945
- o[0] || (o[0] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1)),
946
- createElementVNode("div", _hoisted_2$e, [
947
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (l) => (openBlock(), createBlock(n, {
945
+ createElementVNode("div", _hoisted_2$e, toDisplayString(unref(a)("connect.campaign.trigger.description")), 1),
946
+ createElementVNode("div", _hoisted_3$b, [
947
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (r) => (openBlock(), createBlock(n, {
948
948
  variant: "outlined",
949
- disabled: r.disabled,
949
+ disabled: d.disabled,
950
950
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
951
- "col-span-3": unref(u).length == 1,
952
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == l.value,
953
- "hover:bg-fm-color-opacity-sm": e.modelValue != l.value
951
+ "col-span-3": unref(s).length == 1,
952
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
953
+ "hover:bg-fm-color-opacity-sm": e.modelValue != r.value
954
954
  }]),
955
955
  onClick: () => {
956
- r.modelValue != l.value && !r.disabled && i("update:model-value", l.value);
956
+ d.modelValue != r.value && !d.disabled && i("update:model-value", r.value);
957
957
  },
958
- key: l.name
958
+ key: r.name
959
959
  }, {
960
960
  default: withCtx(() => [
961
- createElementVNode("div", _hoisted_3$b, toDisplayString(l.name), 1),
962
- createElementVNode("div", _hoisted_4$8, toDisplayString(l.description), 1)
961
+ createElementVNode("div", _hoisted_4$a, toDisplayString(r.name), 1),
962
+ createElementVNode("div", _hoisted_5$7, toDisplayString(r.description), 1)
963
963
  ]),
964
964
  _: 2
965
965
  }, 1032, ["disabled", "class", "onClick"]))), 128))
@@ -980,27 +980,27 @@ const _hoisted_1$l = {
980
980
  }
981
981
  },
982
982
  emits: ["update:model-value"],
983
- setup(e, { emit: d }) {
984
- const r = d;
985
- return (i, u) => {
986
- const a = resolveComponent("FmButton"), o = resolveComponent("FmField"), n = resolveComponent("FmDatePicker");
987
- return openBlock(), createBlock(n, {
983
+ setup(e, { emit: m }) {
984
+ const a = m;
985
+ return (d, i) => {
986
+ const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
987
+ return openBlock(), createBlock(o, {
988
988
  label: e.label,
989
989
  "model-value": e.modelValue || "",
990
- "onUpdate:modelValue": u[1] || (u[1] = (l) => r("update:model-value", l))
990
+ "onUpdate:modelValue": i[1] || (i[1] = (n) => a("update:model-value", n))
991
991
  }, {
992
- "trigger-button": withCtx(({ opened: l }) => [
993
- createVNode(o, {
992
+ "trigger-button": withCtx(({ opened: n }) => [
993
+ createVNode(l, {
994
994
  class: "flex items-center",
995
995
  "prepend-icon": "calendar_month",
996
- "icon-outlined": !l
996
+ "icon-outlined": !n
997
997
  }, {
998
998
  append: withCtx(() => [
999
- e.modelValue ? (openBlock(), createBlock(a, {
999
+ e.modelValue ? (openBlock(), createBlock(s, {
1000
1000
  key: 0,
1001
1001
  variant: "tertiary",
1002
1002
  icon: "clear",
1003
- onClick: u[0] || (u[0] = (s) => (s.stopPropagation(), r("update:model-value", null)))
1003
+ onClick: i[0] || (i[0] = (r) => (r.stopPropagation(), a("update:model-value", null)))
1004
1004
  })) : createCommentVNode("", !0)
1005
1005
  ]),
1006
1006
  default: withCtx(() => [
@@ -1015,7 +1015,7 @@ const _hoisted_1$l = {
1015
1015
  }, 8, ["label", "model-value"]);
1016
1016
  };
1017
1017
  }
1018
- }), _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: "flex-1 xs:w-full" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
1018
+ }), _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({
1019
1019
  __name: "DateRangeInput",
1020
1020
  props: {
1021
1021
  modelValue: {
@@ -1024,37 +1024,37 @@ const _hoisted_1$l = {
1024
1024
  }
1025
1025
  },
1026
1026
  emits: ["update:model-value"],
1027
- setup(e, { emit: d }) {
1028
- const r = d;
1029
- return (i, u) => {
1030
- var a, o;
1027
+ setup(e, { emit: m }) {
1028
+ const { t: a } = useI18n(), d = m;
1029
+ return (i, s) => {
1030
+ var l, o;
1031
1031
  return openBlock(), createElementBlock("div", _hoisted_1$g, [
1032
1032
  createElementVNode("div", _hoisted_2$d, [
1033
1033
  createVNode(_sfc_main$h, {
1034
- "model-value": ((a = e.modelValue) == null ? void 0 : a.startDate) ?? null,
1035
- label: "Start date",
1036
- "onUpdate:modelValue": u[0] || (u[0] = (n) => {
1037
- var l;
1038
- return r("update:model-value", {
1034
+ "model-value": ((l = e.modelValue) == null ? void 0 : l.startDate) ?? null,
1035
+ label: unref(a)("connect.common.startDate"),
1036
+ "onUpdate:modelValue": s[0] || (s[0] = (n) => {
1037
+ var r;
1038
+ return d("update:model-value", {
1039
1039
  startDate: n,
1040
- endDate: ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null
1040
+ endDate: ((r = e.modelValue) == null ? void 0 : r.endDate) ?? null
1041
1041
  });
1042
1042
  })
1043
- }, null, 8, ["model-value"])
1043
+ }, null, 8, ["model-value", "label"])
1044
1044
  ]),
1045
- u[2] || (u[2] = createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1)),
1046
- createElementVNode("div", _hoisted_3$a, [
1045
+ createElementVNode("div", _hoisted_3$a, toDisplayString(unref(a)("connect.common.to")), 1),
1046
+ createElementVNode("div", _hoisted_4$9, [
1047
1047
  createVNode(_sfc_main$h, {
1048
1048
  "model-value": ((o = e.modelValue) == null ? void 0 : o.endDate) ?? null,
1049
- label: "End date",
1050
- "onUpdate:modelValue": u[1] || (u[1] = (n) => {
1051
- var l;
1052
- return r("update:model-value", {
1053
- startDate: ((l = e.modelValue) == null ? void 0 : l.startDate) ?? null,
1049
+ label: unref(a)("connect.common.endDate"),
1050
+ "onUpdate:modelValue": s[1] || (s[1] = (n) => {
1051
+ var r;
1052
+ return d("update:model-value", {
1053
+ startDate: ((r = e.modelValue) == null ? void 0 : r.startDate) ?? null,
1054
1054
  endDate: n
1055
1055
  });
1056
1056
  })
1057
- }, null, 8, ["model-value"])
1057
+ }, null, 8, ["model-value", "label"])
1058
1058
  ])
1059
1059
  ]);
1060
1060
  };
@@ -1062,7 +1062,7 @@ const _hoisted_1$l = {
1062
1062
  }), _hoisted_1$f = { class: "space-y-8" }, _hoisted_2$c = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$9 = {
1063
1063
  key: 0,
1064
1064
  class: "space-y-4"
1065
- }, _hoisted_4$7 = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$4 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$f = /* @__PURE__ */ defineComponent({
1065
+ }, _hoisted_4$8 = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$6 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$f = /* @__PURE__ */ defineComponent({
1066
1066
  __name: "ScheduleRuleInput",
1067
1067
  props: {
1068
1068
  modelValue: {
@@ -1077,36 +1077,39 @@ const _hoisted_1$l = {
1077
1077
  }
1078
1078
  },
1079
1079
  emits: ["update:model-value"],
1080
- setup(e, { emit: d }) {
1081
- const r = e, i = d, u = useCoreStore(), a = computed(
1082
- () => CountryTimezone[u.currentCountry.value || "MY"]
1080
+ setup(e, { emit: m }) {
1081
+ const { t: a } = useI18n(), d = e, i = m, s = useCoreStore(), l = computed(
1082
+ () => CountryTimezone[s.currentCountry.value || "MY"]
1083
1083
  );
1084
1084
  function o() {
1085
- const V = RuleBuilder.getRules(r.modelValue);
1086
- return V.length == 0 ? "fixed" : V.some(
1087
- (p) => isRuleEntry(p) && RuleBuilder.simplify(p).operator == "_rrule"
1085
+ const p = RuleBuilder.getRules(d.modelValue);
1086
+ return p.length == 0 ? "fixed" : p.some(
1087
+ (u) => isRuleEntry(u) && RuleBuilder.simplify(u).operator == "_rrule"
1088
1088
  ) ? "repeating" : "fixed";
1089
1089
  }
1090
- const n = ref(o()), l = ref(!1), s = computed(() => {
1091
- const V = RuleBuilder.getRules(r.modelValue), p = V.find(
1092
- (y) => isRuleEntry(y) && RuleBuilder.simplify(y).property == "trigger.date"
1093
- ), c = V.find(
1094
- (y) => isRuleEntry(y) && RuleBuilder.simplify(y).property == "trigger.time"
1090
+ const n = ref(o()), r = ref(!1), y = computed(() => [
1091
+ { label: a("connect.template.rule.schedule.fixed"), value: "fixed" },
1092
+ { label: a("connect.template.rule.schedule.repeating"), value: "repeating" }
1093
+ ]), v = computed(() => {
1094
+ const p = RuleBuilder.getRules(d.modelValue), u = p.find(
1095
+ (f) => isRuleEntry(f) && RuleBuilder.simplify(f).property == "trigger.date"
1096
+ ), c = p.find(
1097
+ (f) => isRuleEntry(f) && RuleBuilder.simplify(f).property == "trigger.time"
1095
1098
  );
1096
1099
  return {
1097
- date: p ? RuleBuilder.simplify(p).equator : null,
1100
+ date: u ? RuleBuilder.simplify(u).equator : null,
1098
1101
  time: c ? RuleBuilder.simplify(c).equator : null
1099
1102
  };
1100
1103
  }), h = computed(
1101
1104
  () => calculateNextScheduleAt(
1102
- r.modelValue,
1105
+ d.modelValue,
1103
1106
  /* @__PURE__ */ new Date(),
1104
- r.startDate ? new Date(r.startDate) : void 0,
1105
- r.endDate ? new Date(r.endDate) : void 0
1107
+ d.startDate ? new Date(d.startDate) : void 0,
1108
+ d.endDate ? new Date(d.endDate) : void 0
1106
1109
  )
1107
1110
  );
1108
- function g(V) {
1109
- const p = V.label.toLowerCase(), c = p == "fixed" ? [
1111
+ function x(p) {
1112
+ const u = p.value, c = u == "fixed" ? [
1110
1113
  RuleBuilder.constructEntry(
1111
1114
  "trigger.date",
1112
1115
  "_isOnDate",
@@ -1127,21 +1130,21 @@ const _hoisted_1$l = {
1127
1130
  RuleBuilder.scaffoldGroup("g_schedule"),
1128
1131
  c
1129
1132
  )
1130
- ), n.value = p;
1133
+ ), n.value = u;
1131
1134
  }
1132
- function b(V) {
1135
+ function k(p) {
1133
1136
  n.value == "fixed" ? i(
1134
1137
  "update:model-value",
1135
1138
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
1136
1139
  RuleBuilder.constructEntry(
1137
1140
  "trigger.date",
1138
1141
  "_isOnDate",
1139
- V.date
1142
+ p.date
1140
1143
  ),
1141
1144
  RuleBuilder.constructEntry(
1142
1145
  "trigger.time",
1143
1146
  "_isOnTime",
1144
- V.time
1147
+ p.time
1145
1148
  )
1146
1149
  ])
1147
1150
  ) : i(
@@ -1150,44 +1153,44 @@ const _hoisted_1$l = {
1150
1153
  RuleBuilder.constructEntry(
1151
1154
  "trigger.date",
1152
1155
  "_rrule",
1153
- V.date
1156
+ p.date
1154
1157
  ),
1155
1158
  RuleBuilder.constructEntry(
1156
1159
  "trigger.time",
1157
1160
  "_isOnTime",
1158
- V.time
1161
+ p.time
1159
1162
  )
1160
1163
  ])
1161
1164
  );
1162
1165
  }
1163
- return (V, p) => {
1164
- const c = resolveComponent("FmButtonGroup"), y = resolveComponent("FmTimePicker"), m = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), B = resolveComponent("FmField"), C = resolveComponent("FmCard"), E = resolveComponent("FmPopover"), $ = resolveComponent("FmDatePicker"), x = resolveComponent("FmHelperText");
1166
+ return (p, u) => {
1167
+ const c = resolveComponent("FmButtonGroup"), f = resolveComponent("FmTimePicker"), B = resolveComponent("FmIcon"), b = resolveComponent("FmTooltip"), E = resolveComponent("FmField"), N = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), R = resolveComponent("FmDatePicker"), S = resolveComponent("FmHelperText");
1165
1168
  return openBlock(), createElementBlock(Fragment, null, [
1166
1169
  createVNode(c, {
1167
- items: [{ label: "Fixed" }, { label: "Repeating" }],
1168
- "model-value": { label: unref(cases).title(unref(n)) },
1169
- "onUpdate:modelValue": g,
1170
+ items: unref(y),
1171
+ "model-value": unref(y).find(($) => $.value === unref(n)) ?? null,
1172
+ "onUpdate:modelValue": x,
1170
1173
  class: "mb-8"
1171
- }, null, 8, ["model-value"]),
1174
+ }, null, 8, ["items", "model-value"]),
1172
1175
  createElementVNode("div", _hoisted_1$f, [
1173
1176
  createElementVNode("div", _hoisted_2$c, [
1174
- createVNode(y, {
1175
- label: "Notify time",
1176
- "model-value": unref(s).time,
1177
- "onUpdate:modelValue": p[0] || (p[0] = (S) => b({ date: unref(s).date, time: S })),
1178
- "helper-text": unref(s).time ? void 0 : "Time is required",
1179
- "helper-state": unref(s).time ? void 0 : "error"
1180
- }, null, 8, ["model-value", "helper-text", "helper-state"]),
1177
+ createVNode(f, {
1178
+ label: unref(a)("connect.template.rule.schedule.notify_time"),
1179
+ "model-value": unref(v).time,
1180
+ "onUpdate:modelValue": u[0] || (u[0] = ($) => k({ date: unref(v).date, time: $ })),
1181
+ "helper-text": unref(v).time ? void 0 : unref(a)("connect.template.rule.schedule.time_required"),
1182
+ "helper-state": unref(v).time ? void 0 : "error"
1183
+ }, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
1181
1184
  unref(n) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
1182
- createElementVNode("div", _hoisted_4$7, [
1183
- p[5] || (p[5] = createElementVNode("div", null, "Notify date", -1)),
1184
- unref(s).date ? (openBlock(), createBlock(f, {
1185
+ createElementVNode("div", _hoisted_4$8, [
1186
+ createElementVNode("div", null, toDisplayString(unref(a)("connect.template.rule.schedule.notify_date")), 1),
1187
+ unref(v).date ? (openBlock(), createBlock(b, {
1185
1188
  key: 0,
1186
1189
  "z-index": 9999,
1187
- content: unref(SummarizeRrule)(unref(RRule).fromString(unref(s).date).options)
1190
+ content: unref(SummarizeRrule)(unref(RRule).fromString(unref(v).date).options)
1188
1191
  }, {
1189
1192
  default: withCtx(() => [
1190
- createVNode(m, {
1193
+ createVNode(B, {
1191
1194
  name: "info",
1192
1195
  size: "sm",
1193
1196
  outline: !0
@@ -1196,30 +1199,30 @@ const _hoisted_1$l = {
1196
1199
  _: 1
1197
1200
  }, 8, ["content"])) : createCommentVNode("", !0)
1198
1201
  ]),
1199
- createVNode(E, {
1200
- "show-popover": unref(l),
1201
- onPopoverChanged: p[3] || (p[3] = (S) => l.value = S)
1202
+ createVNode(C, {
1203
+ "show-popover": unref(r),
1204
+ onPopoverChanged: u[3] || (u[3] = ($) => r.value = $)
1202
1205
  }, {
1203
1206
  "popover-button": withCtx(() => [
1204
- createVNode(B, {
1207
+ createVNode(E, {
1205
1208
  class: "cursor-pointer",
1206
- "helper-text": unref(s).date ? void 0 : "Date is required",
1207
- "helper-state": unref(s).date ? void 0 : "error"
1209
+ "helper-text": unref(v).date ? void 0 : unref(a)("connect.template.rule.schedule.date_required"),
1210
+ "helper-state": unref(v).date ? void 0 : "error"
1208
1211
  }, {
1209
1212
  default: withCtx(() => [
1210
- createElementVNode("div", _hoisted_5$4, toDisplayString(unref(s).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(s).date).options) : "Set a repeating date"), 1)
1213
+ createElementVNode("div", _hoisted_5$6, toDisplayString(unref(v).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(v).date).options) : unref(a)("connect.template.rule.schedule.set_repeating_date")), 1)
1211
1214
  ]),
1212
1215
  _: 1
1213
1216
  }, 8, ["helper-text", "helper-state"])
1214
1217
  ]),
1215
1218
  default: withCtx(() => [
1216
- createVNode(C, { class: "elevated p-8 w-[450px]" }, {
1219
+ createVNode(N, { class: "elevated p-8 w-[450px]" }, {
1217
1220
  default: withCtx(() => [
1218
1221
  createVNode(_sfc_main$q, {
1219
1222
  "apply-button": !0,
1220
- "model-value": unref(s).date || "",
1221
- onCancel: p[1] || (p[1] = (S) => l.value = !1),
1222
- "onUpdate:modelValue": p[2] || (p[2] = (S) => (b({ date: S, time: unref(s).time }), l.value = !1))
1223
+ "model-value": unref(v).date || "",
1224
+ onCancel: u[1] || (u[1] = ($) => r.value = !1),
1225
+ "onUpdate:modelValue": u[2] || (u[2] = ($) => (k({ date: $, time: unref(v).time }), r.value = !1))
1223
1226
  }, null, 8, ["model-value"])
1224
1227
  ]),
1225
1228
  _: 1
@@ -1227,25 +1230,25 @@ const _hoisted_1$l = {
1227
1230
  ]),
1228
1231
  _: 1
1229
1232
  }, 8, ["show-popover"])
1230
- ])) : (openBlock(), createBlock($, {
1233
+ ])) : (openBlock(), createBlock(R, {
1231
1234
  key: 1,
1232
- label: "Notify date",
1233
- "model-value": unref(s).date || "",
1234
- "onUpdate:modelValue": p[4] || (p[4] = (S) => b({ date: S, time: unref(s).time })),
1235
- "helper-text": unref(s).date ? void 0 : "Date is required",
1236
- "helper-state": unref(s).date ? void 0 : "error"
1237
- }, null, 8, ["model-value", "helper-text", "helper-state"]))
1235
+ label: unref(a)("connect.template.rule.schedule.notify_date"),
1236
+ "model-value": unref(v).date || "",
1237
+ "onUpdate:modelValue": u[4] || (u[4] = ($) => k({ date: $, time: unref(v).time })),
1238
+ "helper-text": unref(v).date ? void 0 : unref(a)("connect.template.rule.schedule.date_required"),
1239
+ "helper-state": unref(v).date ? void 0 : "error"
1240
+ }, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
1238
1241
  ]),
1239
- unref(s).date && unref(s).time && unref(h) ? (openBlock(), createBlock(x, {
1242
+ unref(v).date && unref(v).time && unref(h) ? (openBlock(), createBlock(S, {
1240
1243
  key: 0,
1241
- text: `${unref(moment)(unref(h)).isAfter(unref(moment)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(moment)(unref(h)).format("dddd, DD MMM YYYY")} at
1242
- ${unref(moment)(unref(h)).format("hh:mmA")}(UTC${unref(moment).tz(unref(a)).format("Z")}) (${unref(moment)(unref(h)).fromNow()})`
1244
+ text: `${unref(moment)(unref(h)).isAfter(unref(moment)()) ? unref(a)("connect.template.rule.schedule.next_notification") : unref(a)("connect.template.rule.schedule.last_trigger_on")} ${unref(moment)(unref(h)).format("dddd, DD MMM YYYY")} at
1245
+ ${unref(moment)(unref(h)).format("hh:mmA")}(UTC${unref(moment).tz(unref(l)).format("Z")}) (${unref(moment)(unref(h)).fromNow()})`
1243
1246
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1244
1247
  ])
1245
1248
  ], 64);
1246
1249
  };
1247
1250
  }
1248
- }), _hoisted_1$e = { class: "space-y-16" }, _hoisted_2$b = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$8 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$6 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
1251
+ }), _hoisted_1$e = { class: "space-y-16" }, _hoisted_2$b = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$8 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$7 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
1249
1252
  __name: "GameTypeInput",
1250
1253
  props: {
1251
1254
  modelValue: {
@@ -1253,43 +1256,43 @@ const _hoisted_1$l = {
1253
1256
  }
1254
1257
  },
1255
1258
  emits: ["update:model-value"],
1256
- setup(e, { emit: d }) {
1257
- const r = e, i = d, u = computed(
1259
+ setup(e, { emit: m }) {
1260
+ const { t: a } = useI18n(), d = e, i = m, s = computed(
1258
1261
  () => [
1259
1262
  {
1260
- label: "Fortune Wheel",
1261
- description: "Allow customers to spin the Fortune Wheel to win various rewards.",
1263
+ label: a("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
1264
+ description: a("connect.campaign.gameType.option.FORTUNE_WHEEL.description"),
1262
1265
  value: F_GAME_TYPE.enum.FORTUNE_WHEEL,
1263
1266
  hidden: !1
1264
1267
  },
1265
1268
  {
1266
- label: "Rock paper scissor",
1267
- description: "Customers play a game of Rock Paper Scissors against the cashier.",
1269
+ label: a("connect.campaign.gameType.option.ROCK_PAPER_SCISSORS.label"),
1270
+ description: a("connect.campaign.gameType.option.ROCK_PAPER_SCISSORS.description"),
1268
1271
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
1269
1272
  hidden: !0
1270
1273
  }
1271
- ].filter((a) => !a.hidden)
1274
+ ].filter((l) => !l.hidden)
1272
1275
  );
1273
- return (a, o) => {
1276
+ return (l, o) => {
1274
1277
  const n = resolveComponent("FmCard");
1275
1278
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
1276
- o[0] || (o[0] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1)),
1277
- createElementVNode("div", _hoisted_2$b, [
1278
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (l) => (openBlock(), createBlock(n, {
1279
+ createElementVNode("div", _hoisted_2$b, toDisplayString(unref(a)("connect.template.select_game")), 1),
1280
+ createElementVNode("div", _hoisted_3$8, [
1281
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (r) => (openBlock(), createBlock(n, {
1279
1282
  variant: "outlined",
1280
1283
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1281
- "col-span-2": unref(u).length == 1,
1282
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == l.value,
1283
- "hover:bg-fm-color-opacity-sm": e.modelValue != l.value
1284
+ "col-span-2": unref(s).length == 1,
1285
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
1286
+ "hover:bg-fm-color-opacity-sm": e.modelValue != r.value
1284
1287
  }]),
1285
1288
  onClick: () => {
1286
- r.modelValue != l.value && i("update:model-value", l.value);
1289
+ d.modelValue != r.value && i("update:model-value", r.value);
1287
1290
  },
1288
- key: l.value
1291
+ key: r.value
1289
1292
  }, {
1290
1293
  default: withCtx(() => [
1291
- createElementVNode("div", _hoisted_3$8, toDisplayString(l.label), 1),
1292
- createElementVNode("div", _hoisted_4$6, toDisplayString(l.description), 1)
1294
+ createElementVNode("div", _hoisted_4$7, toDisplayString(r.label), 1),
1295
+ createElementVNode("div", _hoisted_5$5, toDisplayString(r.description), 1)
1293
1296
  ]),
1294
1297
  _: 2
1295
1298
  }, 1032, ["class", "onClick"]))), 128))
@@ -1303,48 +1306,48 @@ const _hoisted_1$l = {
1303
1306
  }, _hoisted_2$a = { class: "flex gap-8 items-center justify-start" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
1304
1307
  __name: "EditRewardPoolSheet",
1305
1308
  emits: ["update:model-value"],
1306
- setup(e, { expose: d, emit: r }) {
1307
- const i = useMembershipStore(), { minor: u } = useLoading, a = ref(!1), o = ref(), n = ref(), l = ref(0), s = computed(() => {
1308
- var c;
1309
- return ((c = i.loyaltyRewards.items.find(
1310
- (y) => {
1311
- var m;
1312
- return y.value === ((m = o.value) == null ? void 0 : m.collectible);
1309
+ setup(e, { expose: m, emit: a }) {
1310
+ const d = useMembershipStore(), { minor: i } = useLoading, s = ref(!1), l = ref(), o = ref(), n = ref(0), r = computed(() => {
1311
+ var p;
1312
+ return ((p = d.loyaltyRewards.items.find(
1313
+ (u) => {
1314
+ var c;
1315
+ return u.value === ((c = l.value) == null ? void 0 : c.collectible);
1313
1316
  }
1314
- )) == null ? void 0 : c.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1315
- }), h = computed(() => {
1316
- const p = s.value.safeParse(o.value);
1317
- return p.success ? [] : p.error.errors;
1317
+ )) == null ? void 0 : p.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1318
+ }), y = computed(() => {
1319
+ const k = r.value.safeParse(l.value);
1320
+ return k.success ? [] : k.error.errors;
1318
1321
  });
1319
- function g(p, c, y) {
1320
- p && (o.value = c, l.value = y), a.value = p;
1322
+ function v(k, p, u) {
1323
+ k && (l.value = p, n.value = u), s.value = k;
1321
1324
  }
1322
- const b = r;
1323
- async function V() {
1324
- const p = s.value.safeParse(o.value);
1325
- p.success && (await u(
1325
+ const h = a;
1326
+ async function x() {
1327
+ const k = r.value.safeParse(l.value);
1328
+ k.success && (await i(
1326
1329
  async () => {
1327
- p.data.type === "VOUCHER" && n.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
1328
- p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
1329
- n.value
1330
+ k.data.type === "VOUCHER" && o.value && (k.data.collectibleConfig.image = await firebaseStorage.update(
1331
+ k.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
1332
+ o.value
1330
1333
  ));
1331
1334
  },
1332
1335
  {
1333
1336
  message: "Uploading reward image",
1334
1337
  successMessage: "Reward image updated"
1335
1338
  }
1336
- ), b("update:model-value", p.data, l.value));
1339
+ ), h("update:model-value", k.data, n.value));
1337
1340
  }
1338
- return d({
1339
- showSheet: g
1340
- }), (p, c) => {
1341
- const y = resolveComponent("FmSelect"), m = resolveComponent("FmStepperField"), f = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
1341
+ return m({
1342
+ showSheet: v
1343
+ }), (k, p) => {
1344
+ const u = resolveComponent("FmSelect"), c = resolveComponent("FmStepperField"), f = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
1342
1345
  return openBlock(), createBlock(B, {
1343
1346
  "max-width": 560,
1344
- modelValue: unref(a),
1347
+ modelValue: unref(s),
1345
1348
  "onUpdate:modelValue": [
1346
- c[9] || (c[9] = (C) => isRef(a) ? a.value = C : null),
1347
- c[10] || (c[10] = (C) => a.value = C)
1349
+ p[9] || (p[9] = (b) => isRef(s) ? s.value = b : null),
1350
+ p[10] || (p[10] = (b) => s.value = b)
1348
1351
  ],
1349
1352
  header: "Edit reward",
1350
1353
  "dismiss-away": ""
@@ -1354,36 +1357,36 @@ const _hoisted_1$l = {
1354
1357
  createVNode(f, {
1355
1358
  variant: "primary",
1356
1359
  type: "button",
1357
- disabled: unref(h).length > 0,
1360
+ disabled: unref(y).length > 0,
1358
1361
  label: "Confirm",
1359
- onClick: c[7] || (c[7] = (C) => V())
1362
+ onClick: p[7] || (p[7] = (b) => x())
1360
1363
  }, null, 8, ["disabled"]),
1361
1364
  createVNode(f, {
1362
1365
  variant: "secondary",
1363
1366
  type: "button",
1364
1367
  label: "Cancel",
1365
- onClick: c[8] || (c[8] = (C) => a.value = !1)
1368
+ onClick: p[8] || (p[8] = (b) => s.value = !1)
1366
1369
  })
1367
1370
  ])
1368
1371
  ]),
1369
1372
  default: withCtx(() => {
1370
- var C, E, $;
1373
+ var b, E, N;
1371
1374
  return [
1372
- unref(o) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
1373
- createVNode(y, {
1375
+ unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
1376
+ createVNode(u, {
1374
1377
  label: "Reward Type",
1375
1378
  items: [
1376
1379
  { label: "No Reward", value: "NO_REWARD" },
1377
1380
  { label: "Voucher", value: "VOUCHER" },
1378
1381
  { label: "Loyalty", value: "LOYALTY" }
1379
1382
  ],
1380
- "model-value": unref(o).type,
1381
- "onUpdate:modelValue": c[0] || (c[0] = (x) => {
1382
- x == "NO_REWARD" ? o.value = {
1383
+ "model-value": unref(l).type,
1384
+ "onUpdate:modelValue": p[0] || (p[0] = (C) => {
1385
+ C == "NO_REWARD" ? l.value = {
1383
1386
  type: "NO_REWARD",
1384
1387
  collectible: null,
1385
1388
  weight: 1
1386
- } : x === "VOUCHER" ? o.value = {
1389
+ } : C === "VOUCHER" ? l.value = {
1387
1390
  collectible: null,
1388
1391
  type: "VOUCHER",
1389
1392
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1397,8 +1400,8 @@ const _hoisted_1$l = {
1397
1400
  validForDay: 7
1398
1401
  },
1399
1402
  weight: 1
1400
- } : o.value = {
1401
- collectible: unref(i).loyaltyRewards.raw[0]._id,
1403
+ } : l.value = {
1404
+ collectible: unref(d).loyaltyRewards.raw[0]._id,
1402
1405
  type: "LOYALTY",
1403
1406
  earningOption: {
1404
1407
  amount: 1,
@@ -1411,75 +1414,75 @@ const _hoisted_1$l = {
1411
1414
  };
1412
1415
  })
1413
1416
  }, null, 8, ["model-value"]),
1414
- unref(o).type == "LOYALTY" ? (openBlock(), createBlock(y, {
1417
+ unref(l).type == "LOYALTY" ? (openBlock(), createBlock(u, {
1415
1418
  key: 0,
1416
1419
  label: "Loyalty type",
1417
- rules: [unref(ZodHelper).ruleAtPath(unref(s), "collectible", [unref(o).type])],
1418
- items: unref(i).loyaltyRewards.items,
1419
- "model-value": unref(o).collectible,
1420
- "onUpdate:modelValue": c[1] || (c[1] = (x) => unref(o).collectible = x)
1420
+ rules: [unref(ZodHelper).ruleAtPath(unref(r), "collectible", [unref(l).type])],
1421
+ items: unref(d).loyaltyRewards.items,
1422
+ "model-value": unref(l).collectible,
1423
+ "onUpdate:modelValue": p[1] || (p[1] = (C) => unref(l).collectible = C)
1421
1424
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1422
- createVNode(m, {
1425
+ createVNode(c, {
1423
1426
  label: "Weight",
1424
- rules: [unref(ZodHelper).ruleAtPath(unref(s), "weight", [unref(o).type])],
1425
- "model-value": unref(o).weight,
1426
- "onUpdate:modelValue": c[2] || (c[2] = (x) => o.value = {
1427
- ...unref(o),
1428
- weight: x
1427
+ rules: [unref(ZodHelper).ruleAtPath(unref(r), "weight", [unref(l).type])],
1428
+ "model-value": unref(l).weight,
1429
+ "onUpdate:modelValue": p[2] || (p[2] = (C) => l.value = {
1430
+ ...unref(l),
1431
+ weight: C
1429
1432
  })
1430
1433
  }, null, 8, ["rules", "model-value"]),
1431
- unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1432
- ((C = unref(i).loyaltyRewards.items.find(
1433
- (x) => {
1434
- var S;
1435
- return x.value === ((S = unref(o)) == null ? void 0 : S.collectible);
1434
+ unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1435
+ ((b = unref(d).loyaltyRewards.items.find(
1436
+ (C) => {
1437
+ var R;
1438
+ return C.value === ((R = unref(l)) == null ? void 0 : R.collectible);
1436
1439
  }
1437
- )) == null ? void 0 : C.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1438
- c[11] || (c[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1440
+ )) == null ? void 0 : b.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1441
+ p[11] || (p[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1439
1442
  createVNode(_sfc_main$r, {
1440
1443
  class: "mt-[-8px]",
1441
1444
  rules: [
1442
- unref(ZodHelper).ruleAtPath(unref(s), "earningOption", [unref(o).type])
1445
+ unref(ZodHelper).ruleAtPath(unref(r), "earningOption", [unref(l).type])
1443
1446
  ],
1444
- "helper-state": unref(ZodHelper).helperState(unref(h), "earningOption"),
1445
- "error-text": unref(ZodHelper).helperText(unref(h), "earningOption"),
1447
+ "helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
1448
+ "error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
1446
1449
  "fixed-type": !0,
1447
- "model-value": unref(o).earningOption,
1448
- "onUpdate:modelValue": c[3] || (c[3] = (x) => o.value = {
1449
- ...unref(o),
1450
- earningOption: x
1450
+ "model-value": unref(l).earningOption,
1451
+ "onUpdate:modelValue": p[3] || (p[3] = (C) => l.value = {
1452
+ ...unref(l),
1453
+ earningOption: C
1451
1454
  })
1452
1455
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"])
1453
1456
  ], 64)) : createCommentVNode("", !0),
1454
- c[12] || (c[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
1457
+ p[12] || (p[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
1455
1458
  createVNode(_sfc_main$s, {
1456
- type: unref(o).type === "LOYALTY" ? "custom" : "range",
1457
- "for-credit": unref(o).type === "LOYALTY" && ((E = unref(i).loyaltyRewards.items.find(
1458
- (x) => {
1459
- var S;
1460
- return x.value === ((S = unref(o)) == null ? void 0 : S.collectible);
1459
+ type: unref(l).type === "LOYALTY" ? "custom" : "range",
1460
+ "for-credit": unref(l).type === "LOYALTY" && ((E = unref(d).loyaltyRewards.items.find(
1461
+ (C) => {
1462
+ var R;
1463
+ return C.value === ((R = unref(l)) == null ? void 0 : R.collectible);
1461
1464
  }
1462
1465
  )) == null ? void 0 : E.raw.type) === "CREDIT",
1463
1466
  class: "!gap-24",
1464
- rules: [unref(ZodHelper).ruleAtPath(unref(s), "validityOption", [unref(o).type])],
1465
- "model-value": unref(o).validityOption,
1466
- "onUpdate:modelValue": c[4] || (c[4] = (x) => o.value = {
1467
- ...unref(o),
1468
- validityOption: x
1467
+ rules: [unref(ZodHelper).ruleAtPath(unref(r), "validityOption", [unref(l).type])],
1468
+ "model-value": unref(l).validityOption,
1469
+ "onUpdate:modelValue": p[4] || (p[4] = (C) => l.value = {
1470
+ ...unref(l),
1471
+ validityOption: C
1469
1472
  })
1470
1473
  }, null, 8, ["type", "for-credit", "rules", "model-value"])
1471
1474
  ], 64)) : createCommentVNode("", !0),
1472
- unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$t, {
1475
+ unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$t, {
1473
1476
  key: 2,
1474
- "reward-image": unref(n),
1475
- "model-value": (($ = unref(o)) == null ? void 0 : $.collectibleConfig) ?? void 0,
1476
- "onUpdate:modelValue": c[5] || (c[5] = (x) => o.value = {
1477
- ...unref(o),
1478
- collectibleConfig: x
1477
+ "reward-image": unref(o),
1478
+ "model-value": ((N = unref(l)) == null ? void 0 : N.collectibleConfig) ?? void 0,
1479
+ "onUpdate:modelValue": p[5] || (p[5] = (C) => l.value = {
1480
+ ...unref(l),
1481
+ collectibleConfig: C
1479
1482
  }),
1480
- "onUpdate:rewardImage": c[6] || (c[6] = (x) => n.value = x)
1483
+ "onUpdate:rewardImage": p[6] || (p[6] = (C) => o.value = C)
1481
1484
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1482
- createVNode(JsonViewer, { json: unref(h) }, null, 8, ["json"])
1485
+ createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
1483
1486
  ])) : createCommentVNode("", !0)
1484
1487
  ];
1485
1488
  }),
@@ -1491,7 +1494,7 @@ const _hoisted_1$l = {
1491
1494
  function isNullOrEmpty(e) {
1492
1495
  return e == null || e === "";
1493
1496
  }
1494
- const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-en-body-lg-400" }, _hoisted_3$7 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
1497
+ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$7 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$6 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
1495
1498
  __name: "RewardPoolInput",
1496
1499
  props: {
1497
1500
  modelValue: {
@@ -1506,37 +1509,37 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1506
1509
  }
1507
1510
  },
1508
1511
  emits: ["update:model-value"],
1509
- setup(e, { emit: d }) {
1510
- const r = e, i = d, u = useMembershipStore(), a = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => r.modelValue ?? []), n = computed(() => {
1511
- const p = a.safeParse(o.value);
1512
+ setup(e, { emit: m }) {
1513
+ const a = e, d = m, i = useMembershipStore(), { t: s } = useI18n(), l = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => a.modelValue ?? []), n = computed(() => {
1514
+ const p = l.safeParse(o.value);
1512
1515
  return p.success ? [] : p.error.errors;
1513
- }), l = ref();
1514
- function s(p, c) {
1515
- var m;
1516
- const y = [...o.value];
1517
- y[c] = p, (m = l.value) == null || m.showSheet(!1), i("update:model-value", y);
1516
+ }), r = ref();
1517
+ function y(p, u) {
1518
+ var f;
1519
+ const c = [...o.value];
1520
+ c[u] = p, (f = r.value) == null || f.showSheet(!1), d("update:model-value", c);
1518
1521
  }
1519
- function h(p) {
1520
- const c = p.type == "VOUCHER" ? p.collectibleConfig : u.collectibles.find(
1521
- (f) => f._id.toString() == p.collectible
1522
- ), y = CollectionUtils.formattedType((c == null ? void 0 : c.name) || ""), m = p.weight;
1522
+ function v(p) {
1523
+ const u = p.type == "VOUCHER" ? p.collectibleConfig : i.collectibles.find(
1524
+ (B) => B._id.toString() == p.collectible
1525
+ ), c = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), f = p.weight;
1523
1526
  return {
1524
- label: isNullOrEmpty(y) ? "NO REWARD" : y,
1525
- sublabel: `${m} (${(m / o.value.reduce((f, B) => f + B.weight, 0) * 100).toFixed(2)}%)`
1527
+ label: isNullOrEmpty(c) ? "NO REWARD" : c,
1528
+ sublabel: `${f} (${(f / o.value.reduce((B, b) => B + b.weight, 0) * 100).toFixed(2)}%)`
1526
1529
  };
1527
1530
  }
1528
- function g(p) {
1529
- var y;
1530
- const c = [...o.value];
1531
- (y = l.value) == null || y.showSheet(!0, c[p], p);
1531
+ function h(p) {
1532
+ var c;
1533
+ const u = [...o.value];
1534
+ (c = r.value) == null || c.showSheet(!0, u[p], p);
1532
1535
  }
1533
- function b(p) {
1534
- const c = [...o.value];
1535
- c.splice(p, 1), i("update:model-value", c);
1536
+ function x(p) {
1537
+ const u = [...o.value];
1538
+ u.splice(p, 1), d("update:model-value", u);
1536
1539
  }
1537
- function V() {
1540
+ function k() {
1538
1541
  var p;
1539
- (p = l.value) == null || p.showSheet(
1542
+ (p = r.value) == null || p.showSheet(
1540
1543
  !0,
1541
1544
  {
1542
1545
  type: "NO_REWARD",
@@ -1546,47 +1549,47 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1546
1549
  o.value.length
1547
1550
  );
1548
1551
  }
1549
- return (p, c) => {
1550
- const y = resolveComponent("FmButton"), m = resolveComponent("FmCard"), f = resolveComponent("FmHelperText");
1552
+ return (p, u) => {
1553
+ const c = resolveComponent("FmButton"), f = resolveComponent("FmCard"), B = resolveComponent("FmHelperText");
1551
1554
  return openBlock(), createElementBlock("div", _hoisted_1$c, [
1552
- c[1] || (c[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type and weightage given to your customer. ", -1)),
1553
- createVNode(y, {
1554
- label: "Add Reward",
1555
- onClick: c[0] || (c[0] = (B) => V()),
1555
+ createElementVNode("div", _hoisted_2$9, toDisplayString(unref(s)("connect.template.configure_reward_type")), 1),
1556
+ createVNode(c, {
1557
+ label: unref(s)("connect.campaign.rewardPool.addReward"),
1558
+ onClick: u[0] || (u[0] = (b) => k()),
1556
1559
  variant: "plain",
1557
1560
  icon: "add"
1558
- }),
1559
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (B, C) => (openBlock(), createBlock(m, {
1560
- key: C,
1561
+ }, null, 8, ["label"]),
1562
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (b, E) => (openBlock(), createBlock(f, {
1563
+ key: E,
1561
1564
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
1562
1565
  variant: "outlined",
1563
- onClick: (E) => g(C)
1566
+ onClick: (N) => h(E)
1564
1567
  }, {
1565
1568
  default: withCtx(() => {
1566
- var E;
1569
+ var N;
1567
1570
  return [
1568
1571
  createElementVNode("div", null, [
1569
- createElementVNode("div", _hoisted_2$9, toDisplayString(B.type == "LOYALTY" ? (E = B == null ? void 0 : B.earningOption) == null ? void 0 : E.amount : "") + " " + toDisplayString(h(B).label), 1),
1570
- createElementVNode("div", _hoisted_3$7, toDisplayString(h(B).sublabel), 1)
1572
+ createElementVNode("div", _hoisted_3$7, toDisplayString(b.type == "LOYALTY" ? (N = b == null ? void 0 : b.earningOption) == null ? void 0 : N.amount : "") + " " + toDisplayString(v(b).label), 1),
1573
+ createElementVNode("div", _hoisted_4$6, toDisplayString(v(b).sublabel), 1)
1571
1574
  ]),
1572
- createVNode(y, {
1575
+ createVNode(c, {
1573
1576
  icon: "delete",
1574
1577
  variant: "tertiary",
1575
- onClick: ($) => ($.stopPropagation(), b(C))
1578
+ onClick: (C) => (C.stopPropagation(), x(E))
1576
1579
  }, null, 8, ["onClick"])
1577
1580
  ];
1578
1581
  }),
1579
1582
  _: 2
1580
1583
  }, 1032, ["onClick"]))), 128)),
1581
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((B) => B.path.join(".") == ""), (B) => (openBlock(), createBlock(f, {
1582
- key: B.message,
1583
- text: B.message,
1584
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((b) => b.path.join(".") == ""), (b) => (openBlock(), createBlock(B, {
1585
+ key: b.message,
1586
+ text: b.message,
1584
1587
  state: "error"
1585
1588
  }, null, 8, ["text"]))), 128)),
1586
1589
  createVNode(_sfc_main$d, {
1587
1590
  ref_key: "sheetRef",
1588
- ref: l,
1589
- "onUpdate:modelValue": s
1591
+ ref: r,
1592
+ "onUpdate:modelValue": y
1590
1593
  }, null, 512)
1591
1594
  ]);
1592
1595
  };
@@ -1602,56 +1605,56 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1602
1605
  }
1603
1606
  },
1604
1607
  emits: ["update:model-value"],
1605
- setup(e, { emit: d }) {
1606
- const r = e, i = d, u = computed(() => [
1608
+ setup(e, { emit: m }) {
1609
+ const { t: a } = useI18n(), d = e, i = m, s = computed(() => [
1607
1610
  {
1608
- label: "Rock paper scissor",
1609
- description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
1611
+ label: a("connect.template.promotion_game.rock_paper_scissors.label"),
1612
+ description: a("connect.template.promotion_game.rock_paper_scissors.description"),
1610
1613
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
1611
1614
  }
1612
1615
  ]);
1613
- return (a, o) => {
1614
- var h, g, b;
1615
- const n = resolveComponent("FmSwitch"), l = resolveComponent("FmCard"), s = resolveComponent("FmHelperText");
1616
+ return (l, o) => {
1617
+ var v, h, x;
1618
+ const n = resolveComponent("FmSwitch"), r = resolveComponent("FmCard"), y = resolveComponent("FmHelperText");
1616
1619
  return openBlock(), createElementBlock("div", _hoisted_1$b, [
1617
1620
  createVNode(n, {
1618
- label: "Enable game",
1619
- "model-value": !!((h = e.modelValue) != null && h.gameType),
1620
- "onUpdate:modelValue": o[0] || (o[0] = (V) => V ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
1621
- }, null, 8, ["model-value"]),
1622
- ((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
1623
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (V) => {
1624
- var p, c;
1625
- return openBlock(), createBlock(l, {
1621
+ label: unref(a)("connect.template.promotion_game.enable"),
1622
+ "model-value": !!((v = e.modelValue) != null && v.gameType),
1623
+ "onUpdate:modelValue": o[0] || (o[0] = (k) => k ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
1624
+ }, null, 8, ["label", "model-value"]),
1625
+ ((h = e.modelValue) == null ? void 0 : h.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
1626
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (k) => {
1627
+ var p, u;
1628
+ return openBlock(), createBlock(r, {
1626
1629
  variant: "outlined",
1627
1630
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1628
- "col-span-2": unref(u).length == 1,
1629
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((p = e.modelValue) == null ? void 0 : p.gameType) == V.value,
1630
- "hover:bg-fm-color-opacity-sm": ((c = e.modelValue) == null ? void 0 : c.gameType) != V.value
1631
+ "col-span-2": unref(s).length == 1,
1632
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((p = e.modelValue) == null ? void 0 : p.gameType) == k.value,
1633
+ "hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) != k.value
1631
1634
  }]),
1632
1635
  onClick: () => {
1633
- var y;
1634
- ((y = r.modelValue) == null ? void 0 : y.gameType) != V.value && i("update:model-value", { gameType: V.value });
1636
+ var c;
1637
+ ((c = d.modelValue) == null ? void 0 : c.gameType) != k.value && i("update:model-value", { gameType: k.value });
1635
1638
  },
1636
- key: V.value
1639
+ key: k.value
1637
1640
  }, {
1638
1641
  default: withCtx(() => [
1639
- createElementVNode("div", _hoisted_3$6, toDisplayString(V.label), 1),
1640
- createElementVNode("div", _hoisted_4$5, toDisplayString(V.description), 1)
1642
+ createElementVNode("div", _hoisted_3$6, toDisplayString(k.label), 1),
1643
+ createElementVNode("div", _hoisted_4$5, toDisplayString(k.description), 1)
1641
1644
  ]),
1642
1645
  _: 2
1643
1646
  }, 1032, ["class", "onClick"]);
1644
1647
  }), 128))
1645
1648
  ])) : createCommentVNode("", !0),
1646
- ((b = e.modelValue) == null ? void 0 : b.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(s, {
1649
+ ((x = e.modelValue) == null ? void 0 : x.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(y, {
1647
1650
  key: 1,
1648
- text: "Rock paper scissors is only available for POS >= 7.7.4 with dual screen on android devices (Sunmi D3 Pro and Sunmi T3 Pro)",
1651
+ text: unref(a)("connect.template.promotion_game.rock_paper_scissors.warning"),
1649
1652
  state: "warning"
1650
- })) : createCommentVNode("", !0)
1653
+ }, null, 8, ["text"])) : createCommentVNode("", !0)
1651
1654
  ]);
1652
1655
  };
1653
1656
  }
1654
- }), _hoisted_1$a = { class: "space-y-8" }, _hoisted_2$7 = { class: "grid gap-16 grid-cols-2" }, _hoisted_3$5 = { class: "space-y-6" }, _hoisted_4$4 = { class: "space-y-8" }, _hoisted_5$3 = { class: "fm-typo-en-body-lg-600" }, _hoisted_6$3 = { class: "flex items-center space-x-3" }, _hoisted_7$2 = {
1657
+ }), _hoisted_1$a = { class: "space-y-8" }, _hoisted_2$7 = { class: "grid gap-16 grid-cols-2" }, _hoisted_3$5 = { class: "space-y-6" }, _hoisted_4$4 = { class: "space-y-8" }, _hoisted_5$4 = { class: "fm-typo-en-body-lg-600" }, _hoisted_6$3 = { class: "flex items-center space-x-3" }, _hoisted_7$3 = {
1655
1658
  key: 0,
1656
1659
  class: "ml-6 space-y-2"
1657
1660
  }, _sfc_main$a = /* @__PURE__ */ defineComponent({
@@ -1666,16 +1669,16 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1666
1669
  }
1667
1670
  },
1668
1671
  emits: ["update:model-value"],
1669
- setup(e, { emit: d }) {
1670
- const { t: r } = useI18n(), i = e, u = d, a = ref(i.modelValue ?? {}), o = ref(
1672
+ setup(e, { emit: m }) {
1673
+ const { t: a } = useI18n(), d = e, i = m, s = ref(d.modelValue ?? {}), l = ref(
1671
1674
  (() => {
1672
- const g = {};
1673
- return a.value.workingHour && Object.keys(a.value.workingHour).forEach((b) => {
1674
- const V = a.value.workingHour[b];
1675
- V && "periods" in V && Array.isArray(V.periods) ? g[b] = V.periods : Array.isArray(V) && (g[b] = V);
1676
- }), g;
1675
+ const v = {};
1676
+ return s.value.workingHour && Object.keys(s.value.workingHour).forEach((h) => {
1677
+ const x = s.value.workingHour[h];
1678
+ x && "periods" in x && Array.isArray(x.periods) ? v[h] = x.periods : Array.isArray(x) && (v[h] = x);
1679
+ }), v;
1677
1680
  })()
1678
- ), n = [
1681
+ ), o = [
1679
1682
  { key: "mon", label: "Monday" },
1680
1683
  { key: "tue", label: "Tuesday" },
1681
1684
  { key: "wed", label: "Wednesday" },
@@ -1683,43 +1686,43 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1683
1686
  { key: "fri", label: "Friday" },
1684
1687
  { key: "sat", label: "Saturday" },
1685
1688
  { key: "sun", label: "Sunday" }
1686
- ], l = (g) => {
1687
- o.value[g] || (o.value[g] = []), o.value[g].push({
1689
+ ], n = (v) => {
1690
+ l.value[v] || (l.value[v] = []), l.value[v].push({
1688
1691
  startTime: "00:00",
1689
1692
  endTime: "23:59"
1690
- }), h();
1691
- }, s = (g, b) => {
1692
- o.value[g] && o.value[g].length > b && (o.value[g].splice(b, 1), o.value[g].length === 0 && delete o.value[g], h());
1693
- }, h = () => {
1694
- const g = Object.keys(o.value).reduce(
1695
- (b, V) => (o.value[V] && o.value[V].length > 0 && (b[V] = {
1696
- periods: o.value[V]
1697
- }), b),
1693
+ }), y();
1694
+ }, r = (v, h) => {
1695
+ l.value[v] && l.value[v].length > h && (l.value[v].splice(h, 1), l.value[v].length === 0 && delete l.value[v], y());
1696
+ }, y = () => {
1697
+ const v = Object.keys(l.value).reduce(
1698
+ (h, x) => (l.value[x] && l.value[x].length > 0 && (h[x] = {
1699
+ periods: l.value[x]
1700
+ }), h),
1698
1701
  {}
1699
1702
  );
1700
- a.value.workingHour = Object.keys(g).length > 0 ? g : void 0;
1703
+ s.value.workingHour = Object.keys(v).length > 0 ? v : void 0;
1701
1704
  };
1702
- return watch(a, () => u("update:model-value", a.value), { deep: !0 }), watch(o, h, { deep: !0 }), (g, b) => {
1703
- const V = resolveComponent("FmSelect"), p = resolveComponent("FmStepperField"), c = resolveComponent("FmCheckbox"), y = resolveComponent("FmTimePicker"), m = resolveComponent("FmButton");
1705
+ return watch(s, () => i("update:model-value", s.value), { deep: !0 }), watch(l, y, { deep: !0 }), (v, h) => {
1706
+ const x = resolveComponent("FmSelect"), k = resolveComponent("FmStepperField"), p = resolveComponent("FmCheckbox"), u = resolveComponent("FmTimePicker"), c = resolveComponent("FmButton");
1704
1707
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
1705
1708
  createElementVNode("div", _hoisted_2$7, [
1706
- createVNode(V, {
1707
- label: unref(r)("connect.template.eaterType"),
1708
- modelValue: unref(a).eaterType,
1709
- "onUpdate:modelValue": b[0] || (b[0] = (f) => unref(a).eaterType = f),
1709
+ createVNode(x, {
1710
+ label: unref(a)("connect.template.eaterType"),
1711
+ modelValue: unref(s).eaterType,
1712
+ "onUpdate:modelValue": h[0] || (h[0] = (f) => unref(s).eaterType = f),
1710
1713
  items: [
1711
- { label: unref(r)("connect.template.allEaters"), value: "all" },
1712
- { label: unref(r)("connect.template.newEatersOnly"), value: "new" },
1714
+ { label: unref(a)("connect.template.allEaters"), value: "all" },
1715
+ { label: unref(a)("connect.template.newEatersOnly"), value: "new" },
1713
1716
  {
1714
- label: unref(r)("connect.template.existingEatersOnly"),
1717
+ label: unref(a)("connect.template.existingEatersOnly"),
1715
1718
  value: "existing"
1716
1719
  }
1717
1720
  ],
1718
1721
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "eaterType")]
1719
1722
  }, null, 8, ["label", "modelValue", "items", "rules"]),
1720
- createVNode(p, {
1721
- modelValue: unref(a).minBasketAmount,
1722
- "onUpdate:modelValue": b[1] || (b[1] = (f) => unref(a).minBasketAmount = f),
1723
+ createVNode(k, {
1724
+ modelValue: unref(s).minBasketAmount,
1725
+ "onUpdate:modelValue": h[1] || (h[1] = (f) => unref(s).minBasketAmount = f),
1723
1726
  "show-steppers": !1,
1724
1727
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "minBasketAmount")]
1725
1728
  }, {
@@ -1727,15 +1730,15 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1727
1730
  (openBlock(), createBlock(resolveDynamicComponent(
1728
1731
  unref(ZodHelper).toInputLabel(
1729
1732
  unref(ZodHelper).typeAtPath(e.schema, "minBasketAmount"),
1730
- unref(r)("connect.template.minBasketAmount")
1733
+ unref(a)("connect.template.minBasketAmount")
1731
1734
  )
1732
1735
  )))
1733
1736
  ]),
1734
1737
  _: 1
1735
1738
  }, 8, ["modelValue", "rules"]),
1736
- createVNode(p, {
1737
- modelValue: unref(a).bundleQuantity,
1738
- "onUpdate:modelValue": b[2] || (b[2] = (f) => unref(a).bundleQuantity = f),
1739
+ createVNode(k, {
1740
+ modelValue: unref(s).bundleQuantity,
1741
+ "onUpdate:modelValue": h[2] || (h[2] = (f) => unref(s).bundleQuantity = f),
1739
1742
  "show-steppers": !1,
1740
1743
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "bundleQuantity")]
1741
1744
  }, {
@@ -1743,7 +1746,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1743
1746
  (openBlock(), createBlock(resolveDynamicComponent(
1744
1747
  unref(ZodHelper).toInputLabel(
1745
1748
  unref(ZodHelper).typeAtPath(e.schema, "bundleQuantity"),
1746
- unref(r)("connect.template.bundleQuantity")
1749
+ unref(a)("connect.template.bundleQuantity")
1747
1750
  )
1748
1751
  )))
1749
1752
  ]),
@@ -1752,47 +1755,47 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1752
1755
  ]),
1753
1756
  createElementVNode("div", _hoisted_3$5, [
1754
1757
  createElementVNode("div", _hoisted_4$4, [
1755
- createElementVNode("div", _hoisted_5$3, toDisplayString(unref(r)("connect.template.operationHours")), 1),
1756
- (openBlock(), createElementBlock(Fragment, null, renderList(n, (f) => createElementVNode("div", {
1758
+ createElementVNode("div", _hoisted_5$4, toDisplayString(unref(a)("connect.template.operationHours")), 1),
1759
+ (openBlock(), createElementBlock(Fragment, null, renderList(o, (f) => createElementVNode("div", {
1757
1760
  key: f.key,
1758
1761
  class: "space-y-2"
1759
1762
  }, [
1760
1763
  createElementVNode("div", _hoisted_6$3, [
1761
- createVNode(c, {
1764
+ createVNode(p, {
1762
1765
  label: f.label,
1763
- "model-value": !!(unref(o)[f.key] && unref(o)[f.key].length > 0),
1766
+ "model-value": !!(unref(l)[f.key] && unref(l)[f.key].length > 0),
1764
1767
  "onUpdate:modelValue": (B) => {
1765
- B ? l(f.key) : (unref(o)[f.key] = [], delete unref(o)[f.key], h());
1768
+ B ? n(f.key) : (unref(l)[f.key] = [], delete unref(l)[f.key], y());
1766
1769
  }
1767
1770
  }, null, 8, ["label", "model-value", "onUpdate:modelValue"])
1768
1771
  ]),
1769
- unref(o)[f.key] && unref(o)[f.key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$2, [
1770
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o)[f.key] || [], (B, C) => (openBlock(), createElementBlock("div", {
1771
- key: C,
1772
+ unref(l)[f.key] && unref(l)[f.key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
1773
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[f.key] || [], (B, b) => (openBlock(), createElementBlock("div", {
1774
+ key: b,
1772
1775
  class: "flex items-center space-x-2 w-100"
1773
1776
  }, [
1774
- createVNode(y, {
1777
+ createVNode(u, {
1775
1778
  "model-value": B.startTime || "",
1776
1779
  "onUpdate:modelValue": (E) => {
1777
- unref(o)[f.key] && unref(o)[f.key][C] && (unref(o)[f.key][C].startTime = E || "", h());
1780
+ unref(l)[f.key] && unref(l)[f.key][b] && (unref(l)[f.key][b].startTime = E || "", y());
1778
1781
  }
1779
1782
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
1780
- b[3] || (b[3] = createElementVNode("span", null, "to", -1)),
1781
- createVNode(y, {
1783
+ h[3] || (h[3] = createElementVNode("span", null, "to", -1)),
1784
+ createVNode(u, {
1782
1785
  "model-value": B.endTime || "",
1783
1786
  "onUpdate:modelValue": (E) => {
1784
- unref(o)[f.key] && unref(o)[f.key][C] && (unref(o)[f.key][C].endTime = E || "", h());
1787
+ unref(l)[f.key] && unref(l)[f.key][b] && (unref(l)[f.key][b].endTime = E || "", y());
1785
1788
  }
1786
1789
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
1787
- createVNode(m, {
1790
+ createVNode(c, {
1788
1791
  variant: "tertiary",
1789
1792
  size: "sm",
1790
- onClick: (E) => s(f.key, C),
1793
+ onClick: (E) => r(f.key, b),
1791
1794
  icon: "close"
1792
1795
  }, null, 8, ["onClick"]),
1793
- C === 0 ? (openBlock(), createBlock(m, {
1796
+ b === 0 ? (openBlock(), createBlock(c, {
1794
1797
  key: 0,
1795
- onClick: (E) => l(f.key),
1798
+ onClick: (E) => n(f.key),
1796
1799
  icon: "add",
1797
1800
  variant: "plain"
1798
1801
  }, null, 8, ["onClick"])) : createCommentVNode("", !0)
@@ -1816,15 +1819,15 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1816
1819
  }
1817
1820
  },
1818
1821
  emits: ["update:model-value"],
1819
- setup(e, { emit: d }) {
1820
- const { t: r } = useI18n(), i = e, u = d, a = ref(i.modelValue ?? {});
1821
- return watch(a, () => u("update:model-value", a.value)), (o, n) => {
1822
- const l = resolveComponent("FmStepperField");
1822
+ setup(e, { emit: m }) {
1823
+ const { t: a } = useI18n(), d = e, i = m, s = ref(d.modelValue ?? {});
1824
+ return watch(s, () => i("update:model-value", s.value)), (l, o) => {
1825
+ const n = resolveComponent("FmStepperField");
1823
1826
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
1824
1827
  createElementVNode("div", _hoisted_2$6, [
1825
- createVNode(l, {
1826
- modelValue: unref(a).totalCount,
1827
- "onUpdate:modelValue": n[0] || (n[0] = (s) => unref(a).totalCount = s),
1828
+ createVNode(n, {
1829
+ modelValue: unref(s).totalCount,
1830
+ "onUpdate:modelValue": o[0] || (o[0] = (r) => unref(s).totalCount = r),
1828
1831
  "show-steppers": !1,
1829
1832
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCount")]
1830
1833
  }, {
@@ -1832,15 +1835,15 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1832
1835
  (openBlock(), createBlock(resolveDynamicComponent(
1833
1836
  unref(ZodHelper).toInputLabel(
1834
1837
  unref(ZodHelper).typeAtPath(e.schema, "totalCount"),
1835
- unref(r)("connect.template.totalCount")
1838
+ unref(a)("connect.template.totalCount")
1836
1839
  )
1837
1840
  )))
1838
1841
  ]),
1839
1842
  _: 1
1840
1843
  }, 8, ["modelValue", "rules"]),
1841
- createVNode(l, {
1842
- modelValue: unref(a).totalCountPerUser,
1843
- "onUpdate:modelValue": n[1] || (n[1] = (s) => unref(a).totalCountPerUser = s),
1844
+ createVNode(n, {
1845
+ modelValue: unref(s).totalCountPerUser,
1846
+ "onUpdate:modelValue": o[1] || (o[1] = (r) => unref(s).totalCountPerUser = r),
1844
1847
  "show-steppers": !1,
1845
1848
  rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCountPerUser")]
1846
1849
  }, {
@@ -1848,7 +1851,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1848
1851
  (openBlock(), createBlock(resolveDynamicComponent(
1849
1852
  unref(ZodHelper).toInputLabel(
1850
1853
  unref(ZodHelper).typeAtPath(e.schema, "totalCountPerUser"),
1851
- unref(r)("connect.template.totalCountPerUser")
1854
+ unref(a)("connect.template.totalCountPerUser")
1852
1855
  )
1853
1856
  )))
1854
1857
  ]),
@@ -1858,7 +1861,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1858
1861
  ]);
1859
1862
  };
1860
1863
  }
1861
- }), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$5 = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$4 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
1864
+ }), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$4 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$3 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
1862
1865
  __name: "MissionTypeInput",
1863
1866
  props: {
1864
1867
  modelValue: {
@@ -1866,39 +1869,39 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1866
1869
  }
1867
1870
  },
1868
1871
  emits: ["update:model-value"],
1869
- setup(e, { emit: d }) {
1870
- const r = e, i = d, u = computed(() => [
1872
+ setup(e, { emit: m }) {
1873
+ const { t: a } = useI18n(), d = e, i = m, s = computed(() => [
1871
1874
  {
1872
- label: "Stamp",
1873
- description: "Award stamps for purchases, redeemable after reaching set milestones.",
1875
+ label: a("connect.campaign.mission.typeOption.STAMP.label"),
1876
+ description: a("connect.campaign.mission.typeOption.STAMP.description"),
1874
1877
  value: F_MISSION_TYPE.enum.STAMP
1875
1878
  },
1876
1879
  {
1877
- label: "Progress",
1878
- description: "Reward customers when they reach a cumulative spending goal.",
1880
+ label: a("connect.campaign.mission.typeOption.PROGRESSIVE.label"),
1881
+ description: a("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
1879
1882
  value: F_MISSION_TYPE.enum.PROGRESSIVE
1880
1883
  }
1881
1884
  ]);
1882
- return (a, o) => {
1885
+ return (l, o) => {
1883
1886
  const n = resolveComponent("FmCard");
1884
1887
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
1885
- o[0] || (o[0] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1)),
1886
- createElementVNode("div", _hoisted_2$5, [
1887
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (l) => (openBlock(), createBlock(n, {
1888
+ createElementVNode("div", _hoisted_2$5, toDisplayString(unref(a)("connect.template.select_game")), 1),
1889
+ createElementVNode("div", _hoisted_3$4, [
1890
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (r) => (openBlock(), createBlock(n, {
1888
1891
  variant: "outlined",
1889
1892
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1890
- "col-span-2": unref(u).length == 1,
1891
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == l.value,
1892
- "hover:bg-fm-color-opacity-sm": e.modelValue != l.value
1893
+ "col-span-2": unref(s).length == 1,
1894
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
1895
+ "hover:bg-fm-color-opacity-sm": e.modelValue != r.value
1893
1896
  }]),
1894
1897
  onClick: () => {
1895
- r.modelValue != l.value && i("update:model-value", l.value);
1898
+ d.modelValue != r.value && i("update:model-value", r.value);
1896
1899
  },
1897
- key: l.value
1900
+ key: r.value
1898
1901
  }, {
1899
1902
  default: withCtx(() => [
1900
- createElementVNode("div", _hoisted_3$4, toDisplayString(l.label), 1),
1901
- createElementVNode("div", _hoisted_4$3, toDisplayString(l.description), 1)
1903
+ createElementVNode("div", _hoisted_4$3, toDisplayString(r.label), 1),
1904
+ createElementVNode("div", _hoisted_5$3, toDisplayString(r.description), 1)
1902
1905
  ]),
1903
1906
  _: 2
1904
1907
  }, 1032, ["class", "onClick"]))), 128))
@@ -1920,16 +1923,16 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1920
1923
  }
1921
1924
  },
1922
1925
  emits: ["update:model-value"],
1923
- setup(e, { emit: d }) {
1924
- const r = d;
1925
- return (i, u) => {
1926
- const a = resolveComponent("FmStepperField");
1926
+ setup(e, { emit: m }) {
1927
+ const a = m;
1928
+ return (d, i) => {
1929
+ const s = resolveComponent("FmStepperField");
1927
1930
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
1928
- u[1] || (u[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)),
1929
- createVNode(a, {
1931
+ i[1] || (i[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1)),
1932
+ createVNode(s, {
1930
1933
  label: "Maximum to collect",
1931
1934
  "model-value": e.modelValue || null,
1932
- "onUpdate:modelValue": u[0] || (u[0] = (o) => r("update:model-value", o)),
1935
+ "onUpdate:modelValue": i[0] || (i[0] = (l) => a("update:model-value", l)),
1933
1936
  "helper-text": e.helperText || "Set the threshold required for reward eligibility",
1934
1937
  "helper-state": e.helperState || "none"
1935
1938
  }, null, 8, ["model-value", "helper-text", "helper-state"])
@@ -1945,49 +1948,49 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1945
1948
  }
1946
1949
  },
1947
1950
  emits: ["update:model-value"],
1948
- setup(e, { expose: d, emit: r }) {
1949
- const i = e, u = useMembershipStore(), { minor: a } = useLoading, o = ref(!1), n = ref(), l = ref(), s = ref(0), h = computed(() => {
1950
- var m;
1951
- return ((m = u.loyaltyRewards.items.find(
1951
+ setup(e, { expose: m, emit: a }) {
1952
+ const d = e, i = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), o = ref(), n = ref(), r = ref(0), y = computed(() => {
1953
+ var c;
1954
+ return ((c = i.loyaltyRewards.items.find(
1952
1955
  (f) => {
1953
1956
  var B;
1954
- return f.value === ((B = n.value) == null ? void 0 : B.collectible);
1957
+ return f.value === ((B = o.value) == null ? void 0 : B.collectible);
1955
1958
  }
1956
- )) == null ? void 0 : m.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
1957
- }), g = computed(() => {
1958
- const y = h.value.safeParse(n.value);
1959
- return y.success ? [] : y.error.errors;
1959
+ )) == null ? void 0 : c.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
1960
+ }), v = computed(() => {
1961
+ const u = y.value.safeParse(o.value);
1962
+ return u.success ? [] : u.error.errors;
1960
1963
  });
1961
- function b(y, m, f) {
1962
- y && (n.value = m, s.value = f), o.value = y;
1964
+ function h(u, c, f) {
1965
+ u && (o.value = c, r.value = f), l.value = u;
1963
1966
  }
1964
- const V = r;
1965
- async function p() {
1966
- const y = h.value.safeParse(n.value);
1967
- y.success && (await a(
1967
+ const x = a;
1968
+ async function k() {
1969
+ const u = y.value.safeParse(o.value);
1970
+ u.success && (await s(
1968
1971
  async () => {
1969
- y.data.type === "VOUCHER" && l.value && (y.data.collectibleConfig.image = await firebaseStorage.update(
1970
- y.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, l.value),
1971
- l.value
1972
+ u.data.type === "VOUCHER" && n.value && (u.data.collectibleConfig.image = await firebaseStorage.update(
1973
+ u.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
1974
+ n.value
1972
1975
  ));
1973
1976
  },
1974
1977
  {
1975
1978
  message: "Uploading reward image",
1976
1979
  successMessage: "Reward image updated"
1977
1980
  }
1978
- ), V("update:model-value", y.data, s.value));
1979
- }
1980
- const c = ref();
1981
- return d({
1982
- showSheet: b
1983
- }), (y, m) => {
1984
- const f = resolveComponent("FmStepperField"), B = resolveComponent("FmSelect"), C = resolveComponent("FmForm"), E = resolveComponent("FmButton"), $ = resolveComponent("FmSideSheet");
1985
- return openBlock(), createBlock($, {
1981
+ ), x("update:model-value", u.data, r.value));
1982
+ }
1983
+ const p = ref();
1984
+ return m({
1985
+ showSheet: h
1986
+ }), (u, c) => {
1987
+ const f = resolveComponent("FmStepperField"), B = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), E = resolveComponent("FmButton"), N = resolveComponent("FmSideSheet");
1988
+ return openBlock(), createBlock(N, {
1986
1989
  "max-width": 560,
1987
- modelValue: unref(o),
1990
+ modelValue: unref(l),
1988
1991
  "onUpdate:modelValue": [
1989
- m[10] || (m[10] = (x) => isRef(o) ? o.value = x : null),
1990
- m[11] || (m[11] = (x) => o.value = x)
1992
+ c[10] || (c[10] = (C) => isRef(l) ? l.value = C : null),
1993
+ c[11] || (c[11] = (C) => l.value = C)
1991
1994
  ],
1992
1995
  header: "Edit reward",
1993
1996
  "dismiss-away": ""
@@ -1998,47 +2001,47 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
1998
2001
  variant: "primary",
1999
2002
  type: "button",
2000
2003
  label: "Confirm",
2001
- disabled: unref(g).length > 0,
2002
- onClick: m[8] || (m[8] = async () => {
2003
- var x;
2004
- return (x = unref(c)) == null ? void 0 : x.validateInputs();
2004
+ disabled: unref(v).length > 0,
2005
+ onClick: c[8] || (c[8] = async () => {
2006
+ var C;
2007
+ return (C = unref(p)) == null ? void 0 : C.validateInputs();
2005
2008
  })
2006
2009
  }, null, 8, ["disabled"]),
2007
2010
  createVNode(E, {
2008
2011
  variant: "secondary",
2009
2012
  type: "button",
2010
2013
  label: "Cancel",
2011
- onClick: m[9] || (m[9] = (x) => o.value = !1)
2014
+ onClick: c[9] || (c[9] = (C) => l.value = !1)
2012
2015
  })
2013
2016
  ])
2014
2017
  ]),
2015
2018
  default: withCtx(() => [
2016
- createVNode(JsonViewer, { json: unref(n) }, null, 8, ["json"]),
2017
- unref(n) ? (openBlock(), createBlock(C, {
2019
+ createVNode(JsonViewer, { json: unref(o) }, null, 8, ["json"]),
2020
+ unref(o) ? (openBlock(), createBlock(b, {
2018
2021
  key: 0,
2019
2022
  class: "flex flex-col gap-y-24",
2020
2023
  ref_key: "formRef",
2021
- ref: c,
2022
- onValidationSuccess: m[7] || (m[7] = (x) => p())
2024
+ ref: p,
2025
+ onValidationSuccess: c[7] || (c[7] = (C) => k())
2023
2026
  }, {
2024
2027
  default: withCtx(() => {
2025
- var x, S;
2028
+ var C, R;
2026
2029
  return [
2027
- unref(n).type ? (openBlock(), createBlock(f, {
2030
+ unref(o).type ? (openBlock(), createBlock(f, {
2028
2031
  key: 0,
2029
2032
  label: "Threshold",
2030
2033
  rules: [
2031
2034
  unref(ZodHelper).toRule(
2032
2035
  unref(z).number().min(1).max(
2033
- i.maxThreshold,
2034
- `Number cannot be more than ${i.maxThreshold}`
2036
+ d.maxThreshold,
2037
+ `Number cannot be more than ${d.maxThreshold}`
2035
2038
  )
2036
2039
  )
2037
2040
  ],
2038
- "model-value": unref(n).threshold,
2039
- "onUpdate:modelValue": m[0] || (m[0] = (N) => n.value = {
2040
- ...unref(n),
2041
- threshold: N
2041
+ "model-value": unref(o).threshold,
2042
+ "onUpdate:modelValue": c[0] || (c[0] = (S) => o.value = {
2043
+ ...unref(o),
2044
+ threshold: S
2042
2045
  })
2043
2046
  }, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
2044
2047
  createVNode(B, {
@@ -2047,10 +2050,10 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2047
2050
  { label: "Voucher", value: "VOUCHER" },
2048
2051
  { label: "Loyalty", value: "LOYALTY" }
2049
2052
  ],
2050
- "model-value": unref(n).type,
2051
- "onUpdate:modelValue": m[1] || (m[1] = (N) => {
2052
- var I, M;
2053
- N === "VOUCHER" ? n.value = {
2053
+ "model-value": unref(o).type,
2054
+ "onUpdate:modelValue": c[1] || (c[1] = (S) => {
2055
+ var $, H;
2056
+ S === "VOUCHER" ? o.value = {
2054
2057
  collectible: null,
2055
2058
  type: "VOUCHER",
2056
2059
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -2063,9 +2066,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2063
2066
  validityOption: {
2064
2067
  validForDay: 7
2065
2068
  },
2066
- threshold: (I = unref(n)) == null ? void 0 : I.threshold
2067
- } : n.value = {
2068
- collectible: unref(u).loyaltyRewards.raw[0]._id,
2069
+ threshold: ($ = unref(o)) == null ? void 0 : $.threshold
2070
+ } : o.value = {
2071
+ collectible: unref(i).loyaltyRewards.raw[0]._id,
2069
2072
  type: "LOYALTY",
2070
2073
  earningOption: {
2071
2074
  amount: 1,
@@ -2074,60 +2077,60 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2074
2077
  validityOption: {
2075
2078
  validForDay: 7
2076
2079
  },
2077
- threshold: (M = unref(n)) == null ? void 0 : M.threshold
2080
+ threshold: (H = unref(o)) == null ? void 0 : H.threshold
2078
2081
  };
2079
2082
  })
2080
2083
  }, null, 8, ["model-value"]),
2081
- unref(n).type == "LOYALTY" ? (openBlock(), createBlock(B, {
2084
+ unref(o).type == "LOYALTY" ? (openBlock(), createBlock(B, {
2082
2085
  key: 1,
2083
2086
  label: "Loyalty type",
2084
- rules: [unref(ZodHelper).ruleAtPath(unref(h), "collectible", [unref(n).type])],
2085
- items: unref(u).loyaltyRewards.items,
2086
- "model-value": unref(n).collectible,
2087
- "onUpdate:modelValue": m[2] || (m[2] = (N) => unref(n).collectible = N)
2087
+ rules: [unref(ZodHelper).ruleAtPath(unref(y), "collectible", [unref(o).type])],
2088
+ items: unref(i).loyaltyRewards.items,
2089
+ "model-value": unref(o).collectible,
2090
+ "onUpdate:modelValue": c[2] || (c[2] = (S) => unref(o).collectible = S)
2088
2091
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
2089
- unref(n).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
2090
- m[12] || (m[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
2092
+ unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
2093
+ c[12] || (c[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
2091
2094
  createVNode(_sfc_main$r, {
2092
2095
  class: "mt-[-8px]",
2093
- rules: [unref(ZodHelper).ruleAtPath(unref(h), "earningOption", [unref(n).type])],
2094
- "helper-state": unref(ZodHelper).helperState(unref(g), "earningOption"),
2095
- "error-text": unref(ZodHelper).helperText(unref(g), "earningOption"),
2096
+ rules: [unref(ZodHelper).ruleAtPath(unref(y), "earningOption", [unref(o).type])],
2097
+ "helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
2098
+ "error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
2096
2099
  "fixed-type": !0,
2097
- "model-value": unref(n).earningOption,
2098
- "onUpdate:modelValue": m[3] || (m[3] = (N) => n.value = {
2099
- ...unref(n),
2100
- earningOption: N
2100
+ "model-value": unref(o).earningOption,
2101
+ "onUpdate:modelValue": c[3] || (c[3] = (S) => o.value = {
2102
+ ...unref(o),
2103
+ earningOption: S
2101
2104
  })
2102
2105
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
2103
2106
  createVNode(_sfc_main$s, {
2104
2107
  class: "!gap-24",
2105
- type: unref(n).type === "LOYALTY" ? "custom" : "range",
2106
- "for-credit": unref(n).type === "LOYALTY" && ((x = unref(u).loyaltyRewards.items.find(
2107
- (N) => {
2108
- var I;
2109
- return N.value === ((I = unref(n)) == null ? void 0 : I.collectible);
2108
+ type: unref(o).type === "LOYALTY" ? "custom" : "range",
2109
+ "for-credit": unref(o).type === "LOYALTY" && ((C = unref(i).loyaltyRewards.items.find(
2110
+ (S) => {
2111
+ var $;
2112
+ return S.value === (($ = unref(o)) == null ? void 0 : $.collectible);
2110
2113
  }
2111
- )) == null ? void 0 : x.raw.type) === "CREDIT",
2112
- rules: [unref(ZodHelper).ruleAtPath(unref(h), "validityOption", [unref(n).type])],
2113
- "model-value": unref(n).validityOption,
2114
- "onUpdate:modelValue": m[4] || (m[4] = (N) => n.value = {
2115
- ...unref(n),
2116
- validityOption: N
2114
+ )) == null ? void 0 : C.raw.type) === "CREDIT",
2115
+ rules: [unref(ZodHelper).ruleAtPath(unref(y), "validityOption", [unref(o).type])],
2116
+ "model-value": unref(o).validityOption,
2117
+ "onUpdate:modelValue": c[4] || (c[4] = (S) => o.value = {
2118
+ ...unref(o),
2119
+ validityOption: S
2117
2120
  })
2118
2121
  }, null, 8, ["type", "for-credit", "rules", "model-value"])
2119
2122
  ], 64)) : createCommentVNode("", !0),
2120
- unref(n).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$t, {
2123
+ unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$t, {
2121
2124
  key: 3,
2122
- "reward-image": unref(l),
2123
- "model-value": ((S = unref(n)) == null ? void 0 : S.collectibleConfig) ?? void 0,
2124
- "onUpdate:modelValue": m[5] || (m[5] = (N) => n.value = {
2125
- ...unref(n),
2126
- collectibleConfig: N
2125
+ "reward-image": unref(n),
2126
+ "model-value": ((R = unref(o)) == null ? void 0 : R.collectibleConfig) ?? void 0,
2127
+ "onUpdate:modelValue": c[5] || (c[5] = (S) => o.value = {
2128
+ ...unref(o),
2129
+ collectibleConfig: S
2127
2130
  }),
2128
- "onUpdate:rewardImage": m[6] || (m[6] = (N) => l.value = N)
2131
+ "onUpdate:rewardImage": c[6] || (c[6] = (S) => n.value = S)
2129
2132
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
2130
- createVNode(JsonViewer, { json: unref(g) }, null, 8, ["json"])
2133
+ createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
2131
2134
  ];
2132
2135
  }),
2133
2136
  _: 1
@@ -2161,19 +2164,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2161
2164
  }
2162
2165
  },
2163
2166
  setup(e) {
2164
- const d = e, { maxRange: r, currentRange: i, markers: u } = toRefs(d), a = computed(
2165
- () => Math.min(i.value / r.value * 100, 100)
2166
- ), o = (n) => n / r.value * 100;
2167
- return (n, l) => {
2168
- const s = resolveComponent("FmIcon");
2167
+ const m = e, { maxRange: a, currentRange: d, markers: i } = toRefs(m), s = computed(
2168
+ () => Math.min(d.value / a.value * 100, 100)
2169
+ ), l = (o) => o / a.value * 100;
2170
+ return (o, n) => {
2171
+ const r = resolveComponent("FmIcon");
2169
2172
  return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
2170
- (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(r), 40), (h) => (openBlock(), createBlock(s, {
2173
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (y) => (openBlock(), createBlock(r, {
2171
2174
  class: normalizeClass(
2172
- unref(i) >= h ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
2175
+ unref(d) >= y ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
2173
2176
  ),
2174
- outline: unref(i) < h,
2175
- key: h,
2176
- name: unref(u).some((g) => g === h) ? "featured_seasonal_and_gifts" : "check_circle"
2177
+ outline: unref(d) < y,
2178
+ key: y,
2179
+ name: unref(i).some((v) => v === y) ? "featured_seasonal_and_gifts" : "check_circle"
2177
2180
  }, null, 8, ["class", "outline", "name"]))), 128))
2178
2181
  ])) : (openBlock(), createElementBlock("div", {
2179
2182
  key: 1,
@@ -2181,18 +2184,18 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2181
2184
  }, [
2182
2185
  createElementVNode("div", {
2183
2186
  class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
2184
- style: normalizeStyle({ width: unref(a) + "%" })
2187
+ style: normalizeStyle({ width: unref(s) + "%" })
2185
2188
  }, null, 4),
2186
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (h, g) => (openBlock(), createElementBlock("div", {
2187
- key: g,
2189
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (y, v) => (openBlock(), createElementBlock("div", {
2190
+ key: v,
2188
2191
  class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
2189
- style: normalizeStyle({ left: o(h) + "%" })
2192
+ style: normalizeStyle({ left: l(y) + "%" })
2190
2193
  }, [
2191
2194
  createElementVNode("div", _hoisted_2$4, [
2192
2195
  createElementVNode("div", {
2193
2196
  class: normalizeClass(["h-16 w-[2px]", "bg-fm-color-system-warning-300"])
2194
2197
  }),
2195
- l[0] || (l[0] = createElementVNode("div", null, "🎁", -1))
2198
+ n[0] || (n[0] = createElementVNode("div", null, "🎁", -1))
2196
2199
  ])
2197
2200
  ], 4))), 128))
2198
2201
  ]));
@@ -2200,19 +2203,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
2200
2203
  }
2201
2204
  }), isObject = (e) => e !== null && typeof e == "object";
2202
2205
  function changeKeysFactory(e) {
2203
- return function d(r, i = 1, u) {
2204
- if (i === 0 || !isObject(r))
2205
- return r;
2206
- if (Array.isArray(r))
2207
- return r.map((o) => d(o, i - 1, u));
2208
- const a = Object.create(Object.getPrototypeOf(r));
2209
- return Object.keys(r).forEach((o) => {
2210
- const n = r[o], l = e(o, u), s = d(n, i - 1, u);
2211
- a[l] = s;
2212
- }), a;
2206
+ return function m(a, d = 1, i) {
2207
+ if (d === 0 || !isObject(a))
2208
+ return a;
2209
+ if (Array.isArray(a))
2210
+ return a.map((l) => m(l, d - 1, i));
2211
+ const s = Object.create(Object.getPrototypeOf(a));
2212
+ return Object.keys(a).forEach((l) => {
2213
+ const o = a[l], n = e(l, i), r = m(o, d - 1, i);
2214
+ s[n] = r;
2215
+ }), s;
2213
2216
  };
2214
2217
  }
2215
- const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_3$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_4$2 = { class: "flex items-center gap-4" }, _hoisted_5$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_6$2 = { class: "flex items-center gap-16" }, _hoisted_7$1 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
2218
+ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$2 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = { class: "fm-typo-en-title-sm-800" }, _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
2216
2219
  __name: "MissionPoolInput",
2217
2220
  props: {
2218
2221
  modelValue: {
@@ -2225,43 +2228,50 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2225
2228
  }
2226
2229
  },
2227
2230
  emits: ["update:model-value"],
2228
- setup(e, { emit: d }) {
2229
- const r = e, i = d, u = useMembershipStore(), a = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
2230
- () => r.modelValue.sort((c, y) => c.threshold - y.threshold) ?? []
2231
+ setup(e, { emit: m }) {
2232
+ const { t: a } = useI18n(), d = e, i = m, s = useMembershipStore(), l = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
2233
+ () => d.modelValue.sort((u, c) => u.threshold - c.threshold) ?? []
2231
2234
  ), n = computed(() => {
2232
- const c = a.safeParse(o.value);
2233
- return c.success ? [] : c.error.errors;
2234
- }), l = ref();
2235
- function s(c, y) {
2236
- var f;
2237
- const m = [...o.value];
2238
- m[y] = c, (f = l.value) == null || f.showSheet(!1), i("update:model-value", m);
2239
- }
2240
- function h(c) {
2241
- const y = c.type == "VOUCHER" ? c.collectibleConfig : u.collectibles.find(
2242
- (f) => f._id.toString() == c.collectible
2243
- ), m = CollectionUtils.formattedType((y == null ? void 0 : y.name) || "");
2235
+ const u = l.safeParse(o.value);
2236
+ return u.success ? [] : u.error.errors;
2237
+ }), r = ref();
2238
+ function y(u, c) {
2239
+ var B;
2240
+ const f = [...o.value];
2241
+ f[c] = u, (B = r.value) == null || B.showSheet(!1), i("update:model-value", f);
2242
+ }
2243
+ function v(u) {
2244
+ const c = u.type == "VOUCHER" ? u.collectibleConfig : s.collectibles.find(
2245
+ (b) => b._id.toString() == u.collectible
2246
+ ), f = CollectionUtils.formattedType((c == null ? void 0 : c.name) || ""), B = u.earningOption.type == "FIXED" ? a("connect.template.mission_pool.reward_sublabel_fixed", {
2247
+ threshold: u.threshold,
2248
+ amount: u.earningOption.amount
2249
+ }) : a("connect.template.mission_pool.reward_sublabel_per_spend", {
2250
+ threshold: u.threshold,
2251
+ amount: u.earningOption.amount,
2252
+ every: u.earningOption.every
2253
+ });
2244
2254
  return {
2245
- label: isNullOrEmpty(m) ? "NO REWARD" : m,
2246
- sublabel: `Reward at ${c.threshold} | Amount: ${c.earningOption.type == "FIXED" ? c.earningOption.amount : `${c.earningOption.amount} for every RM${c.earningOption.every} spent`} `
2255
+ label: isNullOrEmpty(f) ? a("connect.template.mission_pool.no_reward") : f,
2256
+ sublabel: B
2247
2257
  };
2248
2258
  }
2249
- function g(c) {
2250
- var m;
2251
- const y = [...o.value];
2252
- (m = l.value) == null || m.showSheet(!0, y[c], c);
2259
+ function h(u) {
2260
+ var f;
2261
+ const c = [...o.value];
2262
+ (f = r.value) == null || f.showSheet(!0, c[u], u);
2253
2263
  }
2254
- function b(c) {
2255
- const y = [...o.value];
2256
- y.splice(c, 1), i("update:model-value", y);
2264
+ function x(u) {
2265
+ const c = [...o.value];
2266
+ c.splice(u, 1), i("update:model-value", c);
2257
2267
  }
2258
- function V() {
2259
- var c;
2260
- (c = l.value) == null || c.showSheet(
2268
+ function k() {
2269
+ var u;
2270
+ (u = r.value) == null || u.showSheet(
2261
2271
  !0,
2262
2272
  {
2263
2273
  type: "LOYALTY",
2264
- collectible: u.loyaltyRewards.items[0].value,
2274
+ collectible: s.loyaltyRewards.items[0].value,
2265
2275
  threshold: null,
2266
2276
  validityOption: {
2267
2277
  validForDay: 7
@@ -2274,71 +2284,71 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2274
2284
  o.value.length
2275
2285
  );
2276
2286
  }
2277
- function p(c) {
2278
- var y, m;
2279
- return c.type == "VOUCHER" ? (y = c.collectibleConfig) == null ? void 0 : y.name : sentenceCase(
2280
- ((m = u.loyaltyRewards.items.find(
2281
- (f) => f.value == c.collectible
2282
- )) == null ? void 0 : m.label) || ""
2287
+ function p(u) {
2288
+ var c, f;
2289
+ return u.type == "VOUCHER" ? (c = u.collectibleConfig) == null ? void 0 : c.name : sentenceCase(
2290
+ ((f = s.loyaltyRewards.items.find(
2291
+ (B) => B.value == u.collectible
2292
+ )) == null ? void 0 : f.label) || ""
2283
2293
  );
2284
2294
  }
2285
- return (c, y) => {
2286
- const m = resolveComponent("FmButton"), f = resolveComponent("FmCard"), B = resolveComponent("FmHelperText");
2295
+ return (u, c) => {
2296
+ const f = resolveComponent("FmButton"), B = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
2287
2297
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
2288
- y[2] || (y[2] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1)),
2289
- createVNode(m, {
2290
- label: "Add Reward",
2291
- onClick: y[0] || (y[0] = (C) => V()),
2298
+ createElementVNode("div", _hoisted_2$3, toDisplayString(unref(a)("connect.template.configure_reward_customer")), 1),
2299
+ createVNode(f, {
2300
+ label: unref(a)("connect.template.mission_pool.add_reward"),
2301
+ onClick: c[0] || (c[0] = (E) => k()),
2292
2302
  variant: "plain",
2293
2303
  icon: "add"
2294
- }),
2295
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (C, E) => (openBlock(), createBlock(f, {
2296
- key: E,
2304
+ }, null, 8, ["label"]),
2305
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (E, N) => (openBlock(), createBlock(B, {
2306
+ key: N,
2297
2307
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
2298
2308
  variant: "outlined",
2299
- onClick: ($) => g(E)
2309
+ onClick: (C) => h(N)
2300
2310
  }, {
2301
2311
  default: withCtx(() => [
2302
2312
  createElementVNode("div", null, [
2303
- createElementVNode("div", _hoisted_2$3, toDisplayString(h(C).label), 1),
2304
- createElementVNode("div", _hoisted_3$3, toDisplayString(h(C).sublabel), 1)
2313
+ createElementVNode("div", _hoisted_3$3, toDisplayString(v(E).label), 1),
2314
+ createElementVNode("div", _hoisted_4$2, toDisplayString(v(E).sublabel), 1)
2305
2315
  ]),
2306
- createVNode(m, {
2316
+ createVNode(f, {
2307
2317
  icon: "delete",
2308
2318
  variant: "tertiary",
2309
- onClick: ($) => ($.stopPropagation(), b(E))
2319
+ onClick: (C) => (C.stopPropagation(), x(N))
2310
2320
  }, null, 8, ["onClick"])
2311
2321
  ]),
2312
2322
  _: 2
2313
2323
  }, 1032, ["onClick"]))), 128)),
2314
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((C) => C.path.join(".") == ""), (C) => (openBlock(), createBlock(B, {
2315
- key: C.message,
2316
- text: C.message,
2324
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((E) => E.path.join(".") == ""), (E) => (openBlock(), createBlock(b, {
2325
+ key: E.message,
2326
+ text: E.message,
2317
2327
  state: "error"
2318
2328
  }, null, 8, ["text"]))), 128)),
2319
- y[3] || (y[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1)),
2320
- (openBlock(), createBlock(f, {
2329
+ createElementVNode("div", _hoisted_5$2, toDisplayString(unref(a)("connect.template.mission_pool.preview")), 1),
2330
+ (openBlock(), createBlock(B, {
2321
2331
  key: 0,
2322
2332
  variant: "outlined",
2323
2333
  class: "p-24 space-y-16 w-fit"
2324
2334
  }, {
2325
2335
  default: withCtx(() => {
2326
- var C, E;
2336
+ var E, N;
2327
2337
  return [
2328
- createElementVNode("div", _hoisted_4$2, [
2338
+ createElementVNode("div", _hoisted_6$2, [
2329
2339
  createElementVNode("div", null, [
2330
- createElementVNode("div", _hoisted_5$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((C = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : C.earningOption.amount) > 1 ? (E = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : E.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? p(e.modelValue[e.modelValue.length - 1]) : ""), 1),
2331
- y[1] || (y[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1))
2340
+ createElementVNode("div", _hoisted_7$2, toDisplayString(unref(a)("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 ? (N = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : N.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? p(e.modelValue[e.modelValue.length - 1]) : ""), 1),
2341
+ createElementVNode("div", _hoisted_8$2, toDisplayString(unref(a)("connect.template.mission_pool.earn_stamp")), 1)
2332
2342
  ])
2333
2343
  ]),
2334
- createElementVNode("div", _hoisted_6$2, [
2344
+ createElementVNode("div", _hoisted_9$2, [
2335
2345
  createVNode(_sfc_main$5, {
2336
2346
  type: e.mission.type,
2337
2347
  "max-range": e.mission.end,
2338
2348
  currentRange: e.mission.end / 4,
2339
- markers: e.modelValue.map(($) => $.threshold)
2349
+ markers: e.modelValue.map((C) => C.threshold)
2340
2350
  }, null, 8, ["type", "max-range", "currentRange", "markers"]),
2341
- e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_7$1, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
2351
+ e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
2342
2352
  ])
2343
2353
  ];
2344
2354
  }),
@@ -2346,93 +2356,101 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2346
2356
  })),
2347
2357
  createVNode(_sfc_main$6, {
2348
2358
  ref_key: "sheetRef",
2349
- ref: l,
2350
- "onUpdate:modelValue": s,
2359
+ ref: r,
2360
+ "onUpdate:modelValue": y,
2351
2361
  "max-threshold": e.mission.end
2352
2362
  }, null, 8, ["max-threshold"])
2353
2363
  ]);
2354
2364
  };
2355
2365
  }
2356
- }), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_6$1 = { class: "space-y-8" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
2366
+ }), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$1 = { class: "grid grid-cols-2 gap-16" }, _hoisted_6$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_7$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_8$1 = { class: "space-y-8" }, _hoisted_9$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_10$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
2357
2367
  __name: "MissionInput",
2358
2368
  props: {
2359
2369
  modelValue: Object
2360
2370
  },
2361
2371
  emits: ["update:model-value"],
2362
- setup(e, { emit: d }) {
2363
- const r = e, i = computed(() => {
2364
- const o = FdoMission.safeParse(r.modelValue);
2372
+ setup(e, { emit: m }) {
2373
+ const { t: a } = useI18n(), d = e, i = computed(() => {
2374
+ const o = FdoMission.safeParse(d.modelValue);
2365
2375
  return o.success ? [] : o.error.errors;
2366
- }), u = computed(() => [
2376
+ }), s = computed(() => [
2367
2377
  {
2368
- label: "Stamp",
2369
- description: "Award stamps for purchases, redeemable after reaching set milestones.",
2378
+ label: a("connect.campaign.mission.typeOption.STAMP.label"),
2379
+ description: a("connect.campaign.mission.typeOption.STAMP.description"),
2370
2380
  value: F_MISSION_TYPE.enum.STAMP
2371
2381
  },
2372
2382
  {
2373
- label: "Progress",
2374
- description: "Reward customers when they reach a cumulative spending goal.",
2383
+ label: a("connect.campaign.mission.typeOption.PROGRESSIVE.label"),
2384
+ description: a("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
2375
2385
  value: F_MISSION_TYPE.enum.PROGRESSIVE
2376
2386
  }
2377
- ]), a = d;
2387
+ ]), l = m;
2378
2388
  return (o, n) => {
2379
- var h;
2380
- const l = resolveComponent("FmCard"), s = resolveComponent("FmStepperField");
2389
+ var v;
2390
+ const r = resolveComponent("FmCard"), y = resolveComponent("FmStepperField");
2381
2391
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
2382
2392
  createElementVNode("div", _hoisted_2$2, [
2383
- n[1] || (n[1] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1)),
2384
- n[2] || (n[2] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1)),
2385
- createElementVNode("div", _hoisted_3$2, [
2386
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (g) => {
2387
- var b, V;
2388
- return openBlock(), createBlock(l, {
2393
+ createElementVNode("div", _hoisted_3$2, toDisplayString(unref(a)("connect.campaign.mission.missionType")), 1),
2394
+ createElementVNode("div", _hoisted_4$1, toDisplayString(unref(a)("connect.template.select_game")), 1),
2395
+ createElementVNode("div", _hoisted_5$1, [
2396
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (h) => {
2397
+ var x, k;
2398
+ return openBlock(), createBlock(r, {
2389
2399
  variant: "outlined",
2390
2400
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
2391
- "col-span-2": unref(u).length == 1,
2392
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((b = e.modelValue) == null ? void 0 : b.type) == g.value,
2393
- "hover:bg-fm-color-opacity-sm": ((V = e.modelValue) == null ? void 0 : V.type) != g.value
2401
+ "col-span-2": unref(s).length == 1,
2402
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((x = e.modelValue) == null ? void 0 : x.type) == h.value,
2403
+ "hover:bg-fm-color-opacity-sm": ((k = e.modelValue) == null ? void 0 : k.type) != h.value
2394
2404
  }]),
2395
2405
  onClick: () => {
2396
- var p, c;
2397
- ((p = e.modelValue) == null ? void 0 : p.type) != g.value && a("update:model-value", {
2406
+ var p, u;
2407
+ ((p = e.modelValue) == null ? void 0 : p.type) != h.value && l("update:model-value", {
2398
2408
  ...e.modelValue,
2399
- type: g.value,
2400
- end: ((c = e.modelValue) == null ? void 0 : c.end) || 1
2409
+ type: h.value,
2410
+ end: ((u = e.modelValue) == null ? void 0 : u.end) || 1
2401
2411
  });
2402
2412
  },
2403
- key: g.value
2413
+ key: h.value
2404
2414
  }, {
2405
2415
  default: withCtx(() => [
2406
- createElementVNode("div", _hoisted_4$1, toDisplayString(g.label), 1),
2407
- createElementVNode("div", _hoisted_5$1, toDisplayString(g.description), 1)
2416
+ createElementVNode("div", _hoisted_6$1, toDisplayString(h.label), 1),
2417
+ createElementVNode("div", _hoisted_7$1, toDisplayString(h.description), 1)
2408
2418
  ]),
2409
2419
  _: 2
2410
2420
  }, 1032, ["class", "onClick"]);
2411
2421
  }), 128))
2412
2422
  ])
2413
2423
  ]),
2414
- createElementVNode("div", _hoisted_6$1, [
2415
- n[3] || (n[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1)),
2416
- n[4] || (n[4] = 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)),
2417
- createVNode(s, {
2418
- label: "Maximum to collect",
2419
- "model-value": ((h = e.modelValue) == null ? void 0 : h.end) || null,
2420
- "onUpdate:modelValue": n[0] || (n[0] = (g) => {
2421
- var b;
2422
- return a("update:model-value", {
2424
+ createElementVNode("div", _hoisted_8$1, [
2425
+ createElementVNode("div", _hoisted_9$1, toDisplayString(unref(a)("connect.campaign.mission.collectionsRequired")), 1),
2426
+ createElementVNode("div", _hoisted_10$1, toDisplayString(unref(a)("connect.campaign.mission.collectionsRequiredDescription")), 1),
2427
+ createVNode(y, {
2428
+ label: unref(a)("connect.campaign.mission.maximumToCollect"),
2429
+ "model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
2430
+ "onUpdate:modelValue": n[0] || (n[0] = (h) => {
2431
+ var x;
2432
+ return l("update:model-value", {
2423
2433
  ...e.modelValue,
2424
- type: ((b = e.modelValue) == null ? void 0 : b.type) || "STAMP",
2425
- end: g
2434
+ type: ((x = e.modelValue) == null ? void 0 : x.type) || "STAMP",
2435
+ end: h
2426
2436
  });
2427
2437
  }),
2428
- "helper-text": unref(ZodHelper).helperText(unref(i), "end") || "Set the threshold required for reward eligibility",
2438
+ "helper-text": unref(ZodHelper).helperText(unref(i), "end") || unref(a)("connect.campaign.mission.thresholdHelperText"),
2429
2439
  "helper-state": unref(ZodHelper).helperState(unref(i), "end") || "none"
2430
- }, null, 8, ["model-value", "helper-text", "helper-state"])
2440
+ }, null, 8, ["label", "model-value", "helper-text", "helper-state"])
2431
2441
  ])
2432
2442
  ]);
2433
2443
  };
2434
2444
  }
2435
- }), _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
2445
+ });
2446
+ function useLocaleText() {
2447
+ const { locale: e, t: m } = useI18n();
2448
+ function a(d, i) {
2449
+ return d ? d[e.value] ?? d["en-US"] ?? m(i) : m(i);
2450
+ }
2451
+ return { getLocaleText: a };
2452
+ }
2453
+ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
2436
2454
  __name: "TemplateInput",
2437
2455
  props: {
2438
2456
  field: { type: Object, required: !0 },
@@ -2458,39 +2476,39 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2458
2476
  }
2459
2477
  },
2460
2478
  emits: ["update:model-value", "update:file"],
2461
- setup(e, { emit: d }) {
2462
- const { t: r } = useI18n(), i = e, u = d;
2463
- function a(s) {
2479
+ setup(e, { emit: m }) {
2480
+ const { t: a } = useI18n(), { getLocaleText: d } = useLocaleText(), i = e, s = m;
2481
+ function l(y) {
2464
2482
  switch (i.field.type) {
2465
2483
  case "timeframe":
2466
- const h = s.startDate ? hooks(s.startDate).startOf("day").toISOString() : void 0, g = s.endDate ? hooks(s.endDate).endOf("day").toISOString() : void 0;
2467
- u("update:model-value", {
2484
+ const v = y.startDate ? hooks(y.startDate).startOf("day").toISOString() : void 0, h = y.endDate ? hooks(y.endDate).endOf("day").toISOString() : void 0;
2485
+ s("update:model-value", {
2468
2486
  type: "timeframe",
2469
2487
  property: "__now",
2470
- start: h,
2471
- end: g
2488
+ start: v,
2489
+ end: h
2472
2490
  });
2473
2491
  break;
2474
2492
  case "image": {
2475
- u(
2493
+ s(
2476
2494
  "update:file",
2477
- s,
2478
- o.value || firebaseStorage.collectibleImagePath(void 0, s)
2495
+ y,
2496
+ o.value || firebaseStorage.collectibleImagePath(void 0, y)
2479
2497
  );
2480
2498
  break;
2481
2499
  }
2482
2500
  default:
2483
- u("update:model-value", s);
2501
+ s("update:model-value", y);
2484
2502
  break;
2485
2503
  }
2486
2504
  }
2487
2505
  const o = computed(() => {
2488
2506
  switch (i.field.type) {
2489
2507
  case "timeframe": {
2490
- const s = i.modelValue;
2508
+ const y = i.modelValue;
2491
2509
  return {
2492
- startDate: s != null && s.start ? hooks(s == null ? void 0 : s.start).format("YYYY-MM-DD") : null,
2493
- endDate: s != null && s.end ? hooks(s == null ? void 0 : s.end).format("YYYY-MM-DD") : null
2510
+ startDate: y != null && y.start ? hooks(y == null ? void 0 : y.start).format("YYYY-MM-DD") : null,
2511
+ endDate: y != null && y.end ? hooks(y == null ? void 0 : y.end).format("YYYY-MM-DD") : null
2494
2512
  };
2495
2513
  }
2496
2514
  default:
@@ -2498,61 +2516,64 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2498
2516
  }
2499
2517
  });
2500
2518
  function n() {
2501
- if (!l.value.schema) return [];
2502
- const s = l.value.schema.safeParse(i.modelValue);
2503
- return s.success ? [] : s.error.errors;
2519
+ if (!r.value.schema) return [];
2520
+ const y = r.value.schema.safeParse(i.modelValue);
2521
+ return y.success ? [] : y.error.errors;
2504
2522
  }
2505
- const l = computed(() => ({
2523
+ const r = computed(() => ({
2506
2524
  schema: i.schema,
2507
2525
  unwrapped: i.schema ? ZodHelper.unwrap(i.schema) : void 0,
2508
2526
  rules: i.schema ? [ZodHelper.ruleAtPath(i.schema, "")] : void 0,
2509
2527
  labelMark: i.schema && ZodHelper.isRequired(i.schema) == !1 ? "optional" : void 0,
2510
- zodLabel: i.schema ? ZodHelper.toInputLabel(i.schema, i.field.label) : void 0
2528
+ zodLabel: i.schema ? ZodHelper.toInputLabel(
2529
+ i.schema,
2530
+ d(i.field.label_locale, i.field.label ?? "")
2531
+ ) : void 0
2511
2532
  }));
2512
- return (s, h) => {
2513
- var y, m, f, B, C;
2514
- const g = resolveComponent("FmTextField"), b = resolveComponent("FmStepperField"), V = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), c = resolveComponent("FmSwitch");
2515
- return e.field.type === "text" ? (openBlock(), createBlock(g, {
2533
+ return (y, v) => {
2534
+ var c, f, B, b, E;
2535
+ const h = resolveComponent("FmTextField"), x = resolveComponent("FmStepperField"), k = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), u = resolveComponent("FmSwitch");
2536
+ return e.field.type === "text" ? (openBlock(), createBlock(h, {
2516
2537
  key: 0,
2517
- label: unref(r)(e.field.label),
2518
- "label-mark": unref(l).labelMark,
2519
- rules: unref(l).rules,
2538
+ label: unref(d)(e.field.label_locale, e.field.label ?? ""),
2539
+ "label-mark": unref(r).labelMark,
2540
+ rules: unref(r).rules,
2520
2541
  "model-value": unref(o),
2521
- "onUpdate:modelValue": a,
2542
+ "onUpdate:modelValue": l,
2522
2543
  "helper-state": e.helperText ? "error" : void 0,
2523
2544
  "helper-text": e.helperText
2524
2545
  }, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2525
2546
  createVNode(JsonViewer, {
2526
- json: { schema: unref(l).unwrapped, props: i }
2547
+ json: { schema: unref(r).unwrapped, props: i }
2527
2548
  }, null, 8, ["json"]),
2528
- createVNode(b, {
2529
- label: unref(r)(e.field.label),
2530
- "label-mark": e.field.isRuleChildren ? void 0 : unref(l).labelMark,
2549
+ createVNode(x, {
2550
+ label: unref(d)(e.field.label_locale, e.field.label ?? ""),
2551
+ "label-mark": e.field.isRuleChildren ? void 0 : unref(r).labelMark,
2531
2552
  "model-value": unref(o),
2532
- rules: e.field.isRuleChildren ? [] : unref(l).rules,
2533
- "onUpdate:modelValue": a,
2553
+ rules: e.field.isRuleChildren ? [] : unref(r).rules,
2554
+ "onUpdate:modelValue": l,
2534
2555
  "helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
2535
2556
  "helper-text": e.field.isRuleChildren ? e.helperText : void 0
2536
2557
  }, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
2537
- ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(V, {
2558
+ ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(k, {
2538
2559
  key: 2,
2539
- label: unref(r)(e.field.label),
2540
- "label-mark": unref(l).labelMark,
2541
- rules: unref(l).rules,
2560
+ label: unref(d)(e.field.label_locale, e.field.label ?? ""),
2561
+ "label-mark": unref(r).labelMark,
2562
+ rules: unref(r).rules,
2542
2563
  "model-value": unref(o),
2543
- "onUpdate:modelValue": a,
2564
+ "onUpdate:modelValue": l,
2544
2565
  "show-word-count": "",
2545
- "max-length": (C = (B = (f = (m = (y = unref(l)) == null ? void 0 : y.unwrapped) == null ? void 0 : m._def) == null ? void 0 : f.checks) == null ? void 0 : B.find((E) => E.kind == "max")) == null ? void 0 : C.value
2566
+ "max-length": (E = (b = (B = (f = (c = unref(r)) == null ? void 0 : c.unwrapped) == null ? void 0 : f._def) == null ? void 0 : B.checks) == null ? void 0 : b.find((N) => N.kind == "max")) == null ? void 0 : E.value
2546
2567
  }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$i, {
2547
2568
  key: 3,
2548
2569
  "campaign-type": e.extras,
2549
2570
  "model-value": unref(o),
2550
2571
  disabled: e.disabled,
2551
- "onUpdate:modelValue": a
2572
+ "onUpdate:modelValue": l
2552
2573
  }, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
2553
2574
  createVNode(_sfc_main$g, {
2554
2575
  "model-value": unref(o),
2555
- "onUpdate:modelValue": a
2576
+ "onUpdate:modelValue": l
2556
2577
  }, null, 8, ["model-value"]),
2557
2578
  createVNode(p, {
2558
2579
  class: "!mt-[8px]",
@@ -2564,63 +2585,63 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2564
2585
  thumbnail: unref(o),
2565
2586
  "aspect-ratio": "16 / 9",
2566
2587
  class: "w-1/2 xs:w-2/3",
2567
- "onUpdate:file": a
2588
+ "onUpdate:file": l
2568
2589
  }, {
2569
2590
  label: withCtx(() => [
2570
- (openBlock(), createBlock(resolveDynamicComponent(unref(l).zodLabel)))
2591
+ (openBlock(), createBlock(resolveDynamicComponent(unref(r).zodLabel)))
2571
2592
  ]),
2572
2593
  _: 1
2573
- }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(c, {
2594
+ }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(u, {
2574
2595
  key: 6,
2575
- label: unref(r)(e.field.label),
2596
+ label: unref(d)(e.field.label_locale, e.field.label ?? ""),
2576
2597
  "label-placement": "right",
2577
2598
  sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
2578
- "label-mark": unref(l).labelMark,
2579
- rules: unref(l).rules,
2599
+ "label-mark": unref(r).labelMark,
2600
+ rules: unref(r).rules,
2580
2601
  "model-value": unref(o),
2581
- "onUpdate:modelValue": a
2602
+ "onUpdate:modelValue": l
2582
2603
  }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$v, {
2583
2604
  key: 7,
2584
2605
  "model-value": unref(o),
2585
- "onUpdate:modelValue": a,
2606
+ "onUpdate:modelValue": l,
2586
2607
  "no-campaign": !1,
2587
- schema: unref(l).schema,
2608
+ schema: unref(r).schema,
2588
2609
  "is-mission": e.extras === "MISSION"
2589
2610
  }, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "grab_conditions" ? (openBlock(), createBlock(GrabConditionsInput, {
2590
2611
  key: 8,
2591
2612
  "model-value": unref(o),
2592
- "onUpdate:modelValue": a,
2593
- schema: unref(l).schema
2613
+ "onUpdate:modelValue": l,
2614
+ schema: unref(r).schema
2594
2615
  }, null, 8, ["model-value", "schema"])) : e.field.type === "grab_quota" ? (openBlock(), createBlock(_sfc_main$9, {
2595
2616
  key: 9,
2596
2617
  "model-value": unref(o),
2597
- "onUpdate:modelValue": a,
2598
- schema: unref(l).schema
2618
+ "onUpdate:modelValue": l,
2619
+ schema: unref(r).schema
2599
2620
  }, null, 8, ["model-value", "schema"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$w, {
2600
2621
  key: 10,
2601
2622
  "model-value": unref(o),
2602
- "onUpdate:modelValue": a
2623
+ "onUpdate:modelValue": l
2603
2624
  }, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 11 }, [
2604
2625
  createVNode(_sfc_main$x, {
2605
2626
  "model-value": unref(o),
2606
- "onUpdate:modelValue": a,
2627
+ "onUpdate:modelValue": l,
2607
2628
  "can-set-auto-apply": e.field.property == "campaign.effect"
2608
2629
  }, null, 8, ["model-value", "can-set-auto-apply"]),
2609
2630
  unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
2610
2631
  key: 0,
2611
2632
  class: "!mt-[8px]",
2612
- text: unref(r)("connect.campaign.common.effect_required"),
2633
+ text: unref(a)("connect.campaign.common.effect_required"),
2613
2634
  state: "error"
2614
2635
  }, null, 8, ["text"]))
2615
2636
  ], 64)) : e.field.type == "grab_effect" ? (openBlock(), createElementBlock(Fragment, { key: 12 }, [
2616
2637
  createVNode(GrabEffectSheet, {
2617
2638
  "model-value": unref(o),
2618
- "onUpdate:modelValue": a
2639
+ "onUpdate:modelValue": l
2619
2640
  }, null, 8, ["model-value"]),
2620
2641
  unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
2621
2642
  key: 0,
2622
2643
  class: "!mt-[8px]",
2623
- text: unref(r)("connect.campaign.common.effect_required"),
2644
+ text: unref(a)("connect.campaign.common.effect_required"),
2624
2645
  state: "error"
2625
2646
  }, null, 8, ["text"]))
2626
2647
  ], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$y, {
@@ -2628,54 +2649,54 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2628
2649
  "allow-email": !0,
2629
2650
  "allow-whatsapp": !0,
2630
2651
  "model-value": unref(o),
2631
- "onUpdate:modelValue": a,
2652
+ "onUpdate:modelValue": l,
2632
2653
  "helper-text": unref(ZodHelper).helperText(n(), ""),
2633
2654
  "trigger-type": e.field.extras,
2634
2655
  "helper-state": unref(ZodHelper).helperState(n(), "")
2635
2656
  }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$r, {
2636
2657
  key: 14,
2637
2658
  "model-value": unref(o),
2638
- "onUpdate:modelValue": a,
2659
+ "onUpdate:modelValue": l,
2639
2660
  extras: e.extras,
2640
2661
  "error-text": e.helperText
2641
2662
  }, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$s, {
2642
2663
  key: 15,
2643
2664
  type: "custom",
2644
2665
  "model-value": unref(o),
2645
- "onUpdate:modelValue": a,
2666
+ "onUpdate:modelValue": l,
2646
2667
  "helper-text": e.helperText || unref(ZodHelper).helperText(n(), ""),
2647
2668
  "for-credit": i.campaignType === "CREDIT"
2648
2669
  }, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$e, {
2649
2670
  key: 16,
2650
2671
  "model-value": unref(o),
2651
- "onUpdate:modelValue": a
2672
+ "onUpdate:modelValue": l
2652
2673
  }, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$c, {
2653
2674
  key: 17,
2654
2675
  "model-value": unref(o),
2655
- "onUpdate:modelValue": a
2676
+ "onUpdate:modelValue": l
2656
2677
  }, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
2657
2678
  key: 18,
2658
2679
  "model-value": unref(o),
2659
- "onUpdate:modelValue": a
2680
+ "onUpdate:modelValue": l
2660
2681
  }, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
2661
2682
  key: 19,
2662
2683
  "model-value": unref(o),
2663
- "onUpdate:modelValue": a
2684
+ "onUpdate:modelValue": l
2664
2685
  }, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
2665
2686
  key: 20,
2666
2687
  "model-value": unref(o),
2667
- "onUpdate:modelValue": a,
2688
+ "onUpdate:modelValue": l,
2668
2689
  "helper-text": unref(ZodHelper).helperText(n(), ""),
2669
2690
  "helper-state": unref(ZodHelper).helperState(n(), "")
2670
2691
  }, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
2671
2692
  key: 21,
2672
2693
  "model-value": unref(o),
2673
- "onUpdate:modelValue": a,
2694
+ "onUpdate:modelValue": l,
2674
2695
  mission: e.extras.mission
2675
2696
  }, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
2676
2697
  createVNode(_sfc_main$f, {
2677
2698
  "model-value": unref(o),
2678
- "onUpdate:modelValue": a,
2699
+ "onUpdate:modelValue": l,
2679
2700
  "start-date": e.extras.start,
2680
2701
  "end-date": e.extras.end
2681
2702
  }, null, 8, ["model-value", "start-date", "end-date"]),
@@ -2688,7 +2709,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2688
2709
  ], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
2689
2710
  createVNode(_sfc_main$z, {
2690
2711
  "model-value": unref(o),
2691
- "onUpdate:modelValue": a
2712
+ "onUpdate:modelValue": l
2692
2713
  }, null, 8, ["model-value"]),
2693
2714
  e.helperText ? (openBlock(), createBlock(p, {
2694
2715
  key: 0,
@@ -2704,7 +2725,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2704
2725
  }, null, 8, ["text"])) : createCommentVNode("", !0),
2705
2726
  createVNode(_sfc_main$k, {
2706
2727
  "model-value": unref(o),
2707
- "onUpdate:modelValue": a
2728
+ "onUpdate:modelValue": l
2708
2729
  }, null, 8, ["model-value"]),
2709
2730
  e.helperText ? (openBlock(), createBlock(p, {
2710
2731
  key: 1,
@@ -2715,7 +2736,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2715
2736
  ], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
2716
2737
  createVNode(_sfc_main$A, {
2717
2738
  "model-value": unref(o),
2718
- "onUpdate:modelValue": a
2739
+ "onUpdate:modelValue": l
2719
2740
  }, null, 8, ["model-value"]),
2720
2741
  e.helperText ? (openBlock(), createBlock(p, {
2721
2742
  key: 0,
@@ -2726,7 +2747,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2726
2747
  ], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 26 }, [
2727
2748
  createVNode(_sfc_main$B, {
2728
2749
  "model-value": unref(o),
2729
- "onUpdate:modelValue": a
2750
+ "onUpdate:modelValue": l
2730
2751
  }, null, 8, ["model-value"]),
2731
2752
  e.helperText ? (openBlock(), createBlock(p, {
2732
2753
  key: 0,
@@ -2737,7 +2758,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2737
2758
  ], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 27 }, [
2738
2759
  createVNode(_sfc_main$j, {
2739
2760
  "model-value": unref(o),
2740
- "onUpdate:modelValue": a
2761
+ "onUpdate:modelValue": l
2741
2762
  }, null, 8, ["model-value"]),
2742
2763
  e.helperText ? (openBlock(), createBlock(p, {
2743
2764
  key: 0,
@@ -2748,7 +2769,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2748
2769
  ], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 28 }, [
2749
2770
  createVNode(_sfc_main$b, {
2750
2771
  "model-value": unref(o),
2751
- "onUpdate:modelValue": a
2772
+ "onUpdate:modelValue": l
2752
2773
  }, null, 8, ["model-value"]),
2753
2774
  e.helperText ? (openBlock(), createBlock(p, {
2754
2775
  key: 0,
@@ -2768,23 +2789,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2768
2789
  }
2769
2790
  },
2770
2791
  setup(e) {
2771
- const { t: d, te: r } = useI18n();
2772
- return (i, u) => {
2773
- const a = resolveComponent("FmCard");
2774
- return openBlock(), createBlock(a, {
2792
+ const { t: m, te: a } = useI18n();
2793
+ return (d, i) => {
2794
+ const s = resolveComponent("FmCard");
2795
+ return openBlock(), createBlock(s, {
2775
2796
  variant: "outlined",
2776
2797
  class: "p-16 space-y-8"
2777
2798
  }, {
2778
2799
  default: withCtx(() => [
2779
- createElementVNode("div", _hoisted_1$1, toDisplayString(unref(d)("connect.campaign.common.summary")), 1),
2780
- u[0] || (u[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
2781
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, n) => (openBlock(), createElementBlock("div", {
2800
+ createElementVNode("div", _hoisted_1$1, toDisplayString(unref(m)("connect.campaign.common.summary")), 1),
2801
+ i[0] || (i[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
2802
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, o) => (openBlock(), createElementBlock("div", {
2782
2803
  class: "space-y-4",
2783
- key: n
2804
+ key: o
2784
2805
  }, [
2785
- o ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2786
- createElementVNode("div", _hoisted_2$1, toDisplayString(unref(d)(`${n}`)), 1),
2787
- createElementVNode("div", _hoisted_3$1, toDisplayString(unref(r)(`${o}`) ? unref(d)(`${o}`) : o), 1)
2806
+ l ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2807
+ createElementVNode("div", _hoisted_2$1, toDisplayString(unref(m)(`${o}`)), 1),
2808
+ createElementVNode("div", _hoisted_3$1, toDisplayString(unref(a)(`${l}`) ? unref(m)(`${l}`) : l), 1)
2788
2809
  ], 64)) : createCommentVNode("", !0)
2789
2810
  ]))), 128))
2790
2811
  ]),
@@ -2799,32 +2820,36 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2799
2820
  __name: "EditCampaignSheet",
2800
2821
  emits: ["submit:model-value"],
2801
2822
  setup(__props, { expose: __expose, emit: __emit }) {
2802
- const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
2823
+ const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), { getLocaleText } = useLocaleText(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
2803
2824
  TEMPLATES.VOUCHER
2804
2825
  ), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign"), campaignType = ref("VOUCHER");
2805
2826
  async function showSheet(visible, type, campaign, selectedTemplate) {
2806
- var e, d;
2827
+ var e, m;
2807
2828
  if (sheetVisible.value = visible, campaignType.value = type, visible == !0) {
2808
2829
  try {
2809
2830
  isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
2810
2831
  } catch {
2811
2832
  } finally {
2812
- await new Promise((r) => setTimeout(r, 120)), isLoading.value = !1;
2833
+ await new Promise((a) => setTimeout(a, 120)), isLoading.value = !1;
2813
2834
  }
2814
2835
  console.log(
2815
2836
  TEMPLATES[type],
2816
2837
  "base template"
2817
- ), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((r, i) => {
2818
- r.campaign.type === "VOUCHER" && r.campaign.code && useCampaignStore().campaigns.voucher.some(
2819
- (u) => u.code === r.campaign.code && u._id.toString() !== r.campaign._id.toString()
2820
- ) && i.addIssue({
2838
+ ), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a, d) => {
2839
+ a.campaign.type === "VOUCHER" && a.campaign.code && useCampaignStore().campaigns.voucher.some(
2840
+ (i) => i.code === a.campaign.code && i._id.toString() !== a.campaign._id.toString()
2841
+ ) && d.addIssue({
2821
2842
  code: "custom",
2822
2843
  message: "Code already exists, please use another code",
2823
2844
  path: ["campaign", "code"]
2824
2845
  });
2825
2846
  })), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
2826
- ...(d = template.value) == null ? void 0 : d.defaultValue
2827
- }), "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 = campaign ? `Edit ${CampaignOptions[type].name} Campaign` : `Create ${CampaignOptions[type].name} Campaign`;
2847
+ ...(m = template.value) == null ? void 0 : m.defaultValue
2848
+ }), "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 = campaign ? t("connect.campaign.common.edit_campaign_title", {
2849
+ typeName: t(`connect.campaign.common.typeName.${type}`)
2850
+ }) : t("connect.campaign.common.create_campaign_title", {
2851
+ typeName: t(`connect.campaign.common.typeName.${type}`)
2852
+ });
2828
2853
  }
2829
2854
  }
2830
2855
  async function hideSheet() {
@@ -2850,11 +2875,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2850
2875
  return e.success ? [] : e.error.errors;
2851
2876
  });
2852
2877
  function stepErrors(e = currentStep.value - 1) {
2853
- const d = template.value.steps[e].groups.flatMap(
2854
- (r) => r.fields.map((i) => i.property)
2878
+ const m = template.value.steps[e].groups.flatMap(
2879
+ (a) => a.fields.map((d) => d.property)
2855
2880
  );
2856
2881
  return errors.value.filter(
2857
- (r) => d.some((i) => r.path.join(".").includes(i))
2882
+ (a) => m.some((d) => a.path.join(".").includes(d))
2858
2883
  );
2859
2884
  }
2860
2885
  __expose({ showSheet });
@@ -2867,17 +2892,17 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2867
2892
  }
2868
2893
  });
2869
2894
  }
2870
- function onUpdateProperty(e, d) {
2871
- var r, i, u, a, o, n, l, s;
2872
- if (_.set(data.value, e, d), e == "campaign.event.type") {
2873
- const g = ((a = (u = (i = (r = template.value) == null ? void 0 : r.defaultValue) == null ? void 0 : i.campaign) == null ? void 0 : u.event) == null ? void 0 : a.rule) ? _.cloneDeep({
2874
- ...(s = (l = (n = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : n.campaign) == null ? void 0 : l.event) == null ? void 0 : s.rule
2895
+ function onUpdateProperty(e, m) {
2896
+ var a, d, i, s, l, o, n, r;
2897
+ if (_.set(data.value, e, m), e == "campaign.event.type") {
2898
+ const v = ((s = (i = (d = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : d.campaign) == null ? void 0 : i.event) == null ? void 0 : s.rule) ? _.cloneDeep({
2899
+ ...(r = (n = (o = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : o.campaign) == null ? void 0 : n.event) == null ? void 0 : r.rule
2875
2900
  }) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
2876
2901
  RuleBuilder.scaffoldGroup("g_schedule"),
2877
2902
  RuleBuilder.scaffoldGroup("g_time"),
2878
2903
  RuleBuilder.scaffoldGroup("g_user"),
2879
2904
  RuleBuilder.scaffoldGroup("g_bill")
2880
- ]), b = RuleBuilder.setRuleToGroup(
2905
+ ]), h = RuleBuilder.setRuleToGroup(
2881
2906
  RuleBuilder.scaffoldGroup("g_schedule"),
2882
2907
  [
2883
2908
  RuleBuilder.constructEntry(
@@ -2889,29 +2914,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2889
2914
  ],
2890
2915
  "&&"
2891
2916
  );
2892
- if (d != "SCHEDULE") {
2893
- _.set(data.value, "campaign.event.rule", g);
2917
+ if (m != "SCHEDULE") {
2918
+ _.set(data.value, "campaign.event.rule", v);
2894
2919
  return;
2895
2920
  }
2896
2921
  _.set(
2897
2922
  data.value,
2898
2923
  "campaign.event.rule",
2899
- RuleBuilder.setRuleToGroup(g, b)
2924
+ RuleBuilder.setRuleToGroup(v, h)
2900
2925
  );
2901
2926
  }
2902
- e == "campaign.notify" && d == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
2927
+ e == "campaign.notify" && m == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
2903
2928
  }
2904
- async function onUpdateFile(e, d) {
2905
- return e ? await minor(async () => firebaseStorage.update(d, e), {
2929
+ async function onUpdateFile(e, m) {
2930
+ return e ? await minor(async () => firebaseStorage.update(m, e), {
2906
2931
  message: `${e ? "Uploading" : "Removing"} file`,
2907
2932
  successMessage: `File ${e ? "uploaded" : "removed"} successfully`
2908
2933
  }) : "";
2909
2934
  }
2910
2935
  function isDisable(e) {
2911
- var d, r;
2936
+ var m, a;
2912
2937
  switch (e == null ? void 0 : e.property) {
2913
2938
  case "campaign.event.type":
2914
- return ((r = (d = data.value) == null ? void 0 : d.campaign) == null ? void 0 : r._id) || !1;
2939
+ return ((a = (m = data.value) == null ? void 0 : m.campaign) == null ? void 0 : a._id) || !1;
2915
2940
  default:
2916
2941
  return !1;
2917
2942
  }
@@ -2920,32 +2945,32 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2920
2945
  const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
2921
2946
  if (!e.success)
2922
2947
  return;
2923
- const d = await emits(
2948
+ const m = await emits(
2924
2949
  "submit:model-value",
2925
2950
  cleanPF(JSON.parse(JSON.stringify(e.data)))
2926
2951
  );
2927
- (d || d === void 0) && (sheetVisible.value = !1);
2952
+ (m || m === void 0) && (sheetVisible.value = !1);
2928
2953
  }
2929
- return (e, d) => {
2930
- const r = resolveComponent("FmButton"), i = resolveComponent("FmStep"), u = resolveComponent("FmStepper"), a = resolveComponent("FmCard"), o = resolveComponent("FmTopSheet");
2931
- return openBlock(), createBlock(o, {
2954
+ return (e, m) => {
2955
+ const a = resolveComponent("FmButton"), d = resolveComponent("FmStep"), i = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
2956
+ return openBlock(), createBlock(l, {
2932
2957
  "fullscreen-size": "lg",
2933
2958
  modelValue: unref(sheetVisible),
2934
2959
  "onUpdate:modelValue": [
2935
- d[7] || (d[7] = (n) => isRef(sheetVisible) ? sheetVisible.value = n : null),
2936
- d[8] || (d[8] = (n) => sheetVisible.value = n)
2960
+ m[7] || (m[7] = (o) => isRef(sheetVisible) ? sheetVisible.value = o : null),
2961
+ m[8] || (m[8] = (o) => sheetVisible.value = o)
2937
2962
  ]
2938
2963
  }, createSlots({
2939
2964
  "top-sheet-header": withCtx(() => [
2940
2965
  createElementVNode("div", _hoisted_1, [
2941
2966
  createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
2942
2967
  createElementVNode("div", _hoisted_2, [
2943
- createVNode(r, {
2944
- onClick: d[0] || (d[0] = (n) => hideSheet()),
2968
+ createVNode(a, {
2969
+ onClick: m[0] || (m[0] = (o) => hideSheet()),
2945
2970
  label: unref(t)("connect.campaign.common.cancel"),
2946
2971
  variant: "tertiary"
2947
2972
  }, null, 8, ["label"]),
2948
- createVNode(r, {
2973
+ createVNode(a, {
2949
2974
  onClick: onSubmit,
2950
2975
  label: unref(t)("connect.campaign.common.save"),
2951
2976
  disabled: unref(errors).length > 0
@@ -2961,7 +2986,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2961
2986
  createElementVNode("div", _hoisted_9, [
2962
2987
  createElementVNode("div", _hoisted_10, [
2963
2988
  createElementVNode("div", _hoisted_11, [
2964
- d[9] || (d[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
2989
+ m[9] || (m[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
2965
2990
  createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
2966
2991
  createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
2967
2992
  createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
@@ -2983,7 +3008,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2983
3008
  ])
2984
3009
  ])
2985
3010
  ], -1)),
2986
- createVNode(a, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
3011
+ createVNode(s, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2987
3012
  ])
2988
3013
  ])
2989
3014
  ])
@@ -2993,51 +3018,51 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2993
3018
  name: "default",
2994
3019
  fn: withCtx(() => [
2995
3020
  unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
2996
- createVNode(u, {
3021
+ createVNode(i, {
2997
3022
  modelValue: unref(currentStep),
2998
- "onUpdate:modelValue": d[1] || (d[1] = (n) => isRef(currentStep) ? currentStep.value = n : null),
3023
+ "onUpdate:modelValue": m[1] || (m[1] = (o) => isRef(currentStep) ? currentStep.value = o : null),
2999
3024
  orientation: "horizontal",
3000
3025
  class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
3001
3026
  }, {
3002
3027
  default: withCtx(() => [
3003
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, l) => (openBlock(), createBlock(i, {
3004
- key: n.name,
3005
- title: unref(t)(n.name),
3006
- value: l + 1,
3007
- error: () => stepErrors(l).length > 0,
3008
- complete: () => l + 1 <= unref(currentStep)
3028
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(d, {
3029
+ key: o.name,
3030
+ title: unref(getLocaleText)(o.name_locale, o.name),
3031
+ value: n + 1,
3032
+ error: () => stepErrors(n).length > 0,
3033
+ complete: () => n + 1 <= unref(currentStep)
3009
3034
  }, null, 8, ["title", "value", "error", "complete"]))), 128))
3010
3035
  ]),
3011
3036
  _: 1
3012
3037
  }, 8, ["modelValue"]),
3013
3038
  createElementVNode("div", _hoisted_4, [
3014
- createVNode(r, {
3039
+ createVNode(a, {
3015
3040
  icon: "close",
3016
3041
  variant: "tertiary",
3017
- onClick: d[2] || (d[2] = (n) => sheetVisible.value = !1)
3042
+ onClick: m[2] || (m[2] = (o) => sheetVisible.value = !1)
3018
3043
  }),
3019
- createVNode(u, {
3044
+ createVNode(i, {
3020
3045
  modelValue: unref(currentStep),
3021
- "onUpdate:modelValue": d[3] || (d[3] = (n) => isRef(currentStep) ? currentStep.value = n : null),
3046
+ "onUpdate:modelValue": m[3] || (m[3] = (o) => isRef(currentStep) ? currentStep.value = o : null),
3022
3047
  orientation: "horizontal",
3023
3048
  class: "flex-1"
3024
3049
  }, {
3025
3050
  default: withCtx(() => [
3026
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, l) => (openBlock(), createBlock(i, {
3027
- key: n.name,
3051
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(d, {
3052
+ key: o.name,
3028
3053
  title: unref(sheetTitle),
3029
- description: unref(t)(n.name),
3030
- value: l + 1,
3031
- error: () => stepErrors(l).length > 0,
3032
- complete: () => l + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
3054
+ description: unref(getLocaleText)(o.name_locale, o.name),
3055
+ value: n + 1,
3056
+ error: () => stepErrors(n).length > 0,
3057
+ complete: () => n + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
3033
3058
  }, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
3034
3059
  ]),
3035
3060
  _: 1
3036
3061
  }, 8, ["modelValue"]),
3037
- createVNode(r, {
3062
+ createVNode(a, {
3038
3063
  icon: "info",
3039
3064
  variant: "tertiary",
3040
- onClick: d[4] || (d[4] = () => showSummaryDialog())
3065
+ onClick: m[4] || (m[4] = () => showSummaryDialog())
3041
3066
  })
3042
3067
  ]),
3043
3068
  createElementVNode("div", _hoisted_5, [
@@ -3046,55 +3071,55 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
3046
3071
  json: {
3047
3072
  data: unref(data),
3048
3073
  errors: unref(errors).map(
3049
- (n) => `${n.path.join(".")} - ${n.message}`
3074
+ (o) => `${o.path.join(".")} - ${o.message}`
3050
3075
  ),
3051
3076
  stepErrors: stepErrors().map(
3052
- (n) => `${n.path.join(".")} - ${n.message}`
3077
+ (o) => `${o.path.join(".")} - ${o.message}`
3053
3078
  ),
3054
3079
  schema: unref(schema)
3055
3080
  }
3056
3081
  }, null, 8, ["json"]),
3057
3082
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
3058
- (n) => n.fields.length && (!n.condition || (Array.isArray(n.condition) ? n.condition.every((l) => unref(_).get(unref(data), l.property) == l.value == (l.not != !0)) : unref(_).get(unref(data), n.condition.property) == n.condition.value == (n.condition.not != !0)))
3059
- ), (n, l) => (openBlock(), createElementBlock("div", {
3060
- key: l,
3083
+ (o) => o.fields.length && (!o.condition || (Array.isArray(o.condition) ? o.condition.every((n) => unref(_).get(unref(data), n.property) == n.value == (n.not != !0)) : unref(_).get(unref(data), o.condition.property) == o.condition.value == (o.condition.not != !0)))
3084
+ ), (o, n) => (openBlock(), createElementBlock("div", {
3085
+ key: n,
3061
3086
  class: "space-y-24"
3062
3087
  }, [
3063
- createElementVNode("div", _hoisted_7, toDisplayString(n.name ? unref(t)(n.name) : ""), 1),
3064
- (openBlock(!0), createElementBlock(Fragment, null, renderList(n.fields, (s, h) => (openBlock(), createElementBlock("div", { key: h }, [
3088
+ createElementVNode("div", _hoisted_7, toDisplayString(unref(getLocaleText)(o.name_locale, o.name ?? "")), 1),
3089
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(o.fields, (r, y) => (openBlock(), createElementBlock("div", { key: y }, [
3065
3090
  (openBlock(), createBlock(_sfc_main$2, {
3066
- key: h,
3067
- field: s,
3068
- modelValue: unref(_).get(unref(data), s.property),
3069
- disabled: isDisable(s),
3091
+ key: y,
3092
+ field: r,
3093
+ modelValue: unref(_).get(unref(data), r.property),
3094
+ disabled: isDisable(r),
3070
3095
  "campaign-type": unref(campaignType),
3071
- "onUpdate:modelValue": (g) => onUpdateProperty(s.property, g),
3072
- "onUpdate:file": async (g, b) => {
3073
- const V = await onUpdateFile(g, b);
3074
- onUpdateProperty(s.property, V || "");
3096
+ "onUpdate:modelValue": (v) => onUpdateProperty(r.property, v),
3097
+ "onUpdate:file": async (v, h) => {
3098
+ const x = await onUpdateFile(v, h);
3099
+ onUpdateProperty(r.property, x || "");
3075
3100
  },
3076
3101
  schema: unref(ZodHelper).typeAtPath(
3077
3102
  unref(schema),
3078
- s.property,
3103
+ r.property,
3079
3104
  unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
3080
3105
  ),
3081
- "helper-state": unref(ZodHelper).helperState(unref(errors), s.property),
3082
- "helper-text": unref(ZodHelper).helperText(unref(errors), s.property),
3083
- extras: s.extras != null ? s.extras == "" ? unref(data) : unref(_).get(unref(data), s.extras) : void 0
3106
+ "helper-state": unref(ZodHelper).helperState(unref(errors), r.property),
3107
+ "helper-text": unref(ZodHelper).helperText(unref(errors), r.property),
3108
+ extras: r.extras != null ? r.extras == "" ? unref(data) : unref(_).get(unref(data), r.extras) : void 0
3084
3109
  }, null, 8, ["field", "modelValue", "disabled", "campaign-type", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
3085
3110
  ]))), 128))
3086
3111
  ]))), 128)),
3087
3112
  createElementVNode("div", _hoisted_8, [
3088
- createVNode(r, {
3089
- label: "Back",
3113
+ createVNode(a, {
3114
+ label: unref(t)("connect.common.back"),
3090
3115
  variant: "tertiary",
3091
3116
  disabled: unref(currentStep) == 1,
3092
- onClick: d[5] || (d[5] = (n) => currentStep.value--)
3093
- }, null, 8, ["disabled"]),
3094
- createVNode(r, {
3117
+ onClick: m[5] || (m[5] = (o) => currentStep.value--)
3118
+ }, null, 8, ["label", "disabled"]),
3119
+ createVNode(a, {
3095
3120
  disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
3096
- label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
3097
- onClick: d[6] || (d[6] = (n) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
3121
+ label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? unref(t)("connect.common.next") : unref(t)("connect.common.submit"),
3122
+ onClick: m[6] || (m[6] = (o) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
3098
3123
  }, null, 8, ["disabled", "label"])
3099
3124
  ])
3100
3125
  ]),
@@ -3113,5 +3138,6 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
3113
3138
  });
3114
3139
  export {
3115
3140
  _sfc_main as _,
3116
- summarizeGrabDiscount as s
3141
+ summarizeGrabDiscount as s,
3142
+ useLocaleText as u
3117
3143
  };