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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/{App-BUwQLdzG.js → App-BrL2gHiV.js} +8 -8
  2. package/dist/{AuditLogs-laNQB1ef.js → AuditLogs-BlRoAtoO.js} +11 -11
  3. package/dist/{Bin-Bfboeea_.js → Bin-DWR53mGv.js} +8 -8
  4. package/dist/Broadcast-BZ2y0x8d.js +302 -0
  5. package/dist/{CampaignAnalytic-BiA-5XG3.js → CampaignAnalytic-DB2OaPV_.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VrTN-c_a.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Bs1_gtk6.js} +6 -6
  7. package/dist/{Card-CKHaW8N7.js → Card-B6faC6Qm.js} +21 -21
  8. package/dist/{Collections-DRocQb1D.js → Collections-DekhPkTs.js} +8 -8
  9. package/dist/{Credit-DWaoVhSP.js → Credit-BwOLA7a6.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B7ZdULCu.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DCNKIlok.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-3ERieT1j.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D07yq8hu.js} +1830 -996
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-yDUjXV2O.js → EffectSheet.vue_vue_type_style_index_0_lang-CaEBp-Qj.js} +6 -6
  13. package/dist/{Experience-C1_LpneJ.js → Experience-DiW76Zyj.js} +12 -12
  14. package/dist/{FileSaver.min-CWJ-6CFP.js → FileSaver.min-CzzDHyEW.js} +1 -1
  15. package/dist/{Game-DtTYcSZk.js → Game-CHZZ26td.js} +13 -13
  16. package/dist/{GiftCardSetup-B770Rl1Q.js → GiftCardSetup-D573F-re.js} +9 -9
  17. package/dist/{Grab-CN0gmIxT.js → Grab-DyjMfGLW.js} +9 -9
  18. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BaAhKWhX.js → ImageInput.vue_vue_type_script_setup_true_lang-B_Fl95PN.js} +1 -1
  19. package/dist/{Index-0F6aq3f9.js → Index-DVctjU8T.js} +10 -10
  20. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BrKj8W2H.js → LocationPicker.vue_vue_type_script_setup_true_lang-CJcDgM1A.js} +1 -1
  21. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DOuHSVdR.js → LottieAnimation.vue_vue_type_script_setup_true_lang-B8q8mLiv.js} +1 -1
  22. package/dist/{LoyaltyDashboard-CtXyDFqa.js → LoyaltyDashboard-C695q1A0.js} +13 -13
  23. package/dist/{MainLayout-BSWLr3gE.js → MainLayout-DLr0qfQy.js} +3 -3
  24. package/dist/{Marketing-Ci2haxRd.js → Marketing-DtJwIJT1.js} +4 -4
  25. package/dist/{MarketingMaterialEdit-Cw6R0bNM.js → MarketingMaterialEdit-Dxq4Thqp.js} +6 -6
  26. package/dist/{Member-DEzSTAQy.js → Member-DLY-tqMO.js} +7 -7
  27. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BrhSxbrI.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DaXSO2Sw.js} +23 -23
  28. package/dist/{MemberImportHistory-BGfNLzma.js → MemberImportHistory-BllKLK-J.js} +7 -7
  29. package/dist/{MemberList-Cq5Gsv3G.js → MemberList-Cw9OUWN0.js} +14 -14
  30. package/dist/{MemberTransactions-BrUVZRtt.js → MemberTransactions-OBVrKAdH.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DCQ6Fse-.js → MessageInput.vue_vue_type_script_setup_true_lang-BBg9ZmEZ.js} +4338 -4287
  32. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CETwYfZD.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DWP4DTE8.js} +1 -1
  33. package/dist/{Mission-Do4IonLo.js → Mission-2yRMXtq_.js} +13 -13
  34. package/dist/{Overview-DA90l9Kb.js → Overview-B4OGaAQs.js} +19 -19
  35. package/dist/{Overview-DN-nJxw9.js → Overview-C6GQR5Be.js} +4 -4
  36. package/dist/{Point-DQ4w857n.js → Point-BHByUBQy.js} +12 -12
  37. package/dist/{Promotion-Rgt9LcYi.js → Promotion-DHOf5B8h.js} +13 -13
  38. package/dist/{Queue-SzypUxgD.js → Queue-DMQs5RXl.js} +11 -11
  39. package/dist/{Record-DYvPPhIW.js → Record-DgT-afmi.js} +9 -9
  40. package/dist/{Review-B0TERyHM.js → Review-BgOyos-p.js} +2 -2
  41. package/dist/{ReviewFacebookCallback-BJ5jQ3Dv.js → ReviewFacebookCallback-BYCLYoU9.js} +5 -5
  42. package/dist/{ReviewGoogleCallback-BKQD39dv.js → ReviewGoogleCallback-B5IBSCOt.js} +5 -5
  43. package/dist/{Reward-BexlVT_C.js → Reward-DhcO5T8x.js} +16 -16
  44. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-C-ygqNur.js → RewardGroup.vue_vue_type_script_setup_true_lang-BXk_SS1d.js} +12 -12
  45. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DjxIJcdv.js → RuleGroup.vue_vue_type_script_setup_true_lang-DPFXFu8i.js} +13 -13
  46. package/dist/{Segment-CYa4GjtQ.js → Segment-BM7-ufMg.js} +24 -24
  47. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-b-K-VDJC.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BbiZ4qOP.js} +13 -13
  48. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-t2mlDDtn.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BArVHth8.js} +4 -4
  49. package/dist/{Setting-Dmm5BKdF.js → Setting-BOPSL9ZZ.js} +14 -14
  50. package/dist/{SettingAdvertisements-cy4cRBop.js → SettingAdvertisements-cPCVcdFa.js} +12 -12
  51. package/dist/{Settings-DMQuLDM4.js → Settings-CqoifGTo.js} +5 -5
  52. package/dist/{Store-B7KflfSk.js → Store-CK30TAU9.js} +25 -25
  53. package/dist/{StoreRewards-BKae8uZn.js → StoreRewards-ChZtmuzE.js} +15 -15
  54. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-sbIR-k1R.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DYNiShwp.js} +24 -24
  55. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DRT3N9SD.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BHlC1EE4.js} +2 -2
  56. package/dist/{Tier-BeTz6LHH.js → Tier-CF2KJhuH.js} +24 -24
  57. package/dist/{Title-OEVVw5I-.js → Title-BqUR8e6x.js} +21 -21
  58. package/dist/{Transaction-D-MZjntW.js → Transaction-Cf5o_1V3.js} +2 -2
  59. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-xIEOUOdo.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CfArdf8F.js} +6 -6
  60. package/dist/{Voucher-BJCf3pSa.js → Voucher-BPOp4ic5.js} +14 -14
  61. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BFQ_CYub.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BZmGNLq1.js} +12 -12
  62. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DGDw3Too.js → ZodTextField.vue_vue_type_script_setup_true_lang-DrZ11Ra6.js} +2 -2
  63. package/dist/{app-J8VIC7-H.js → app-DJZhbUaQ.js} +4755 -4225
  64. package/dist/app.js +1 -1
  65. package/dist/{base.export-HYFFI4OS.js → base.export-CoTF6Joo.js} +2 -2
  66. package/dist/{business-BonuheMK.js → business-COH4ZPme.js} +1 -1
  67. package/dist/campaign-8u-VUYGh.js +368 -0
  68. package/dist/{campaign-Ct7jhugP.js → campaign-VQNSG0W_.js} +2 -2
  69. package/dist/{campaign.enum-OzJ9IbAW.js → campaign.enum-DPrWb8U2.js} +1 -1
  70. package/dist/{campaign.fn-CDjxE9B2.js → campaign.fn-D888JeGT.js} +72 -72
  71. package/dist/{collectible.enum-Dw_tlI9E.js → collectible.enum-DvSb1Y88.js} +1 -1
  72. package/dist/{collection.fn-CER0_NEn.js → collection.fn-BwIWKhBK.js} +2 -2
  73. package/dist/{currency-CTUS4vS8.js → currency-Hgkd5sh7.js} +1 -1
  74. package/dist/{duplicateCampaign-CMQ-RMH-.js → duplicateCampaign-Dn25VCVj.js} +2 -2
  75. package/dist/{effect-DBeGoMNE.js → effect-BwgQpATD.js} +1 -1
  76. package/dist/{email-addresses-BH3mQzan.js → email-addresses-C1vr0Uy5.js} +2 -2
  77. package/dist/{helper-DJe_JbKJ.js → helper-zfXDm3Jk.js} +1 -1
  78. package/dist/{index-D9f3AIaO.js → index-7vDEWDqs.js} +3 -3
  79. package/dist/index-Buh_J_zJ.js +14550 -0
  80. package/dist/{index-B14H1rLW.js → index-C2tPMx3P.js} +2 -2
  81. package/dist/{index-BzVTqlVH.js → index-C5hBS5HZ.js} +2 -2
  82. package/dist/{index-CEDhjZzd.js → index-C9Q3V8R9.js} +1 -1
  83. package/dist/{index-CrMBqkKk.js → index-CABF2-Io.js} +101 -98
  84. package/dist/{index-BZKKS7jO.js → index-CacUcTSI.js} +5 -5
  85. package/dist/{index-BOVnM3gL.js → index-CkIQalwo.js} +3 -3
  86. package/dist/{index-CN8VyVEB.js → index-CwCYEijW.js} +1 -1
  87. package/dist/{index-COuceEFz.js → index-D4XMwqKT.js} +1 -1
  88. package/dist/{index-CM9GTQIo.js → index-DlPAztwX.js} +3 -3
  89. package/dist/{index-bJX4zgh0.js → index-DqEB7W_r.js} +1 -1
  90. package/dist/{index-BlwAgY_z.js → index-Vv1-II8J.js} +1 -1
  91. package/dist/{index-BmN_Qcw7.js → index-eEMXtCiV.js} +2 -2
  92. package/dist/{index-BRCB6yJ6.js → index-grYhqqn8.js} +299 -196
  93. package/dist/{index-Bnk3vdb-.js → index-lrP5VxZd.js} +7 -7
  94. package/dist/{index-bGByr1XM.js → index-xzDzb0T3.js} +1 -1
  95. package/dist/{index-CWR2s6Nt.js → index-zZTsUIci.js} +1 -1
  96. package/dist/{index.esm2017-BpCPgTjc.js → index.esm2017-BlBA0-BF.js} +37 -37
  97. package/dist/{loading-D_rPJ-Yc.js → loading-CI7gmifv.js} +1 -1
  98. package/dist/{lodash-BM976Z2I.js → lodash-kft-Uy7N.js} +1 -1
  99. package/dist/{member-import-C5rhD3f8.js → member-import-BTr0LEYS.js} +1 -1
  100. package/dist/{membership-CIQCEKiL.js → membership-Cqia6d3x.js} +3 -3
  101. package/dist/{money-BrMT193t.js → money-bl2w3oEQ.js} +1 -1
  102. package/dist/{number-DOcD1tqL.js → number-Ckzx623S.js} +1 -1
  103. package/dist/objectid-CwK8XcuH.js +145 -0
  104. package/dist/{plugins-696Z9K6A.js → plugins-DzWEv3_R.js} +13 -12
  105. package/dist/{reward-lSVIBiE9.js → reward-S5B2MbnJ.js} +1 -1
  106. package/dist/{rule-BUGAimk8.js → rule-2k1mrjlc.js} +8 -8
  107. package/dist/style.css +1 -1
  108. package/dist/{template-01_h2Gac.js → template-DS_X-0yV.js} +6 -6
  109. package/dist/{timezone-okTdM2YU.js → timezone-ByZC3NaX.js} +1 -1
  110. package/dist/{transaction.fn-Nz0T33ex.js → transaction.fn-CmS0f0MN.js} +1 -1
  111. package/dist/{trigger-CKj1X6zs.js → trigger-uYmkCUpm.js} +5 -5
  112. package/dist/{useMarketingMaterialActions-yKqKaPpe.js → useMarketingMaterialActions-D9hFiGQL.js} +3 -3
  113. package/dist/{usePagination-D6cYlfni.js → usePagination-NBKbsZ4_.js} +1 -1
  114. package/dist/{user-DX5qCQfz.js → user-cCAfW4S5.js} +1 -1
  115. package/dist/{vue-i18n-DowpocqN.js → vue-i18n-BzjgwVzt.js} +511 -511
  116. package/dist/{xlsx-Dv4SuJbw.js → xlsx-DiFT4U5o.js} +440 -440
  117. package/dist/{zod-DVw24Ejy.js → zod-6HGtPTQu.js} +1 -1
  118. package/package.json +4 -1
  119. package/dist/Broadcast-CDz-_eDz.js +0 -269
  120. package/dist/campaign-7CI7gfS5.js +0 -255
  121. package/dist/index-Do36kJeb.js +0 -51
  122. package/dist/objectid-CAdRRoFu.js +0 -145
package/dist/app.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "vue";
2
- import { F as e, i as o, r as p } from "./app-J8VIC7-H.js";
2
+ import { F as e, i as o, r as p } from "./app-DJZhbUaQ.js";
3
3
  export {
4
4
  e as FmApp,
5
5
  o as i18nMessages,
@@ -1,8 +1,8 @@
1
1
  var w = Object.defineProperty;
2
2
  var y = (e, s, o) => s in e ? w(e, s, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[s] = o;
3
3
  var n = (e, s, o) => y(e, typeof s != "symbol" ? s + "" : s, o);
4
- import { u as x } from "./loading-D_rPJ-Yc.js";
5
- import { w as h, u as a } from "./xlsx-Dv4SuJbw.js";
4
+ import { u as x } from "./loading-CI7gmifv.js";
5
+ import { w as h, u as a } from "./xlsx-DiFT4U5o.js";
6
6
  const t = {
7
7
  sortBy: "_id",
8
8
  descending: !1,
@@ -1,7 +1,7 @@
1
1
  import { ref as i, computed as u } from "vue";
2
2
  import { defineStore as w } from "pinia";
3
3
  import { useCoreStore as y } from "@feedmepos/mf-common";
4
- import { d as I, g as r, A as b, S, b as D } from "./index-B14H1rLW.js";
4
+ import { d as I, g as r, A as b, S, b as D } from "./index-C2tPMx3P.js";
5
5
  const $ = {
6
6
  async readSettings(e) {
7
7
  try {
@@ -0,0 +1,368 @@
1
+ import { h as s } from "./moment-D7p2TMB-.js";
2
+ import "./index-CABF2-Io.js";
3
+ import { e as l } from "./effect-BwgQpATD.js";
4
+ import { components as h } from "@feedmepos/ui-library";
5
+ import { a as C } from "./index-grYhqqn8.js";
6
+ import { c as O } from "./rule-2k1mrjlc.js";
7
+ import { u as b } from "./business-COH4ZPme.js";
8
+ import { C as i } from "./campaign.fn-D888JeGT.js";
9
+ import { t as y } from "./index-Buh_J_zJ.js";
10
+ import { c as d } from "./string-Gcy5IM_H.js";
11
+ import { i as f } from "./plugins-DzWEv3_R.js";
12
+ import { h as p } from "vue";
13
+ import { F as c } from "./campaign.enum-DPrWb8U2.js";
14
+ const E = [
15
+ "APP_INBOX",
16
+ "PUSH",
17
+ "SMS",
18
+ "EMAIL",
19
+ "WHATSAPP"
20
+ ], N = [...E];
21
+ function G(t) {
22
+ return N.includes(t);
23
+ }
24
+ function I(t, e) {
25
+ return t === "APP_INBOX" ? {
26
+ title: "",
27
+ previewText: "",
28
+ content: "",
29
+ buttons: [],
30
+ variables: e
31
+ } : t === "PUSH" ? {
32
+ title: "",
33
+ body: "",
34
+ destination: "NONE",
35
+ variables: e
36
+ } : {
37
+ channel: t,
38
+ content: "",
39
+ language: "en",
40
+ variables: e
41
+ };
42
+ }
43
+ function j(t, e, n = []) {
44
+ return t.channels.includes(e) ? t : {
45
+ ...t,
46
+ channels: [...t.channels, e],
47
+ content: {
48
+ ...t.content,
49
+ [e]: t.content[e] ?? I(e, n)
50
+ }
51
+ };
52
+ }
53
+ function V(t, e) {
54
+ const n = { ...t.content };
55
+ return delete n[e], {
56
+ ...t,
57
+ channels: t.channels.filter((o) => o !== e),
58
+ content: n
59
+ };
60
+ }
61
+ function k(t, e, n) {
62
+ return {
63
+ ...t,
64
+ content: { ...t.content, [e]: n }
65
+ };
66
+ }
67
+ function z(t, e, n) {
68
+ const o = t.channels.indexOf(e), m = o + n;
69
+ if (o < 0 || m < 0 || m >= t.channels.length) return t;
70
+ const u = [...t.channels];
71
+ return [u[o], u[m]] = [u[m], u[o]], { ...t, channels: u };
72
+ }
73
+ function X(t, e) {
74
+ return { ...t, mode: e };
75
+ }
76
+ function W(t, e) {
77
+ const n = t.content[e];
78
+ if (!n) return !1;
79
+ if (e === "APP_INBOX") {
80
+ const o = n;
81
+ return o.title.trim().length > 0 && o.previewText.trim().length > 0;
82
+ }
83
+ if (e === "PUSH") {
84
+ const o = n;
85
+ return o.title.trim().length > 0 && o.body.trim().length > 0;
86
+ }
87
+ return n.content.trim().length > 0;
88
+ }
89
+ function R(t, e) {
90
+ return t.channels.map(e).join(t.mode === "fallback" ? " → " : " + ");
91
+ }
92
+ const a = f.global.t;
93
+ function S() {
94
+ const t = f.global.locale;
95
+ return typeof t == "string" ? t : t.value;
96
+ }
97
+ function g(t) {
98
+ return new Intl.DateTimeFormat(S(), {
99
+ day: "2-digit",
100
+ month: "short",
101
+ year: "numeric"
102
+ }).format(new Date(t));
103
+ }
104
+ function r(t) {
105
+ return p(
106
+ "div",
107
+ {
108
+ class: `${t.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
109
+ },
110
+ [
111
+ p(h.FmIcon, { size: "sm", name: t.icon, outline: !0 }),
112
+ p("span", { class: "fm-typo-en-body-md-600" }, t.name)
113
+ ]
114
+ );
115
+ }
116
+ const J = {
117
+ [c.enum.CREDIT]: {
118
+ chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
119
+ icon: "local_activity",
120
+ get name() {
121
+ return a("connect.campaign.common.typeName.CREDIT");
122
+ },
123
+ chip() {
124
+ return r(this);
125
+ }
126
+ },
127
+ [c.enum.PROMOTION]: {
128
+ chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
129
+ icon: "loyalty",
130
+ get name() {
131
+ return a("connect.campaign.common.typeName.PROMOTION");
132
+ },
133
+ chip() {
134
+ return r(this);
135
+ }
136
+ },
137
+ [c.enum.VOUCHER]: {
138
+ chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
139
+ icon: "sell",
140
+ get name() {
141
+ return a("connect.campaign.common.typeName.VOUCHER");
142
+ },
143
+ chip() {
144
+ return r(this);
145
+ }
146
+ },
147
+ [c.enum.POINT]: {
148
+ chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
149
+ icon: "award_star",
150
+ get name() {
151
+ return a("connect.campaign.common.typeName.POINT");
152
+ },
153
+ chip() {
154
+ return r(this);
155
+ }
156
+ },
157
+ [c.enum.BROADCAST]: {
158
+ chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
159
+ icon: "campaign",
160
+ get name() {
161
+ return a("connect.campaign.common.typeName.BROADCAST");
162
+ },
163
+ chip() {
164
+ return r(this);
165
+ }
166
+ },
167
+ [c.enum.GAME]: {
168
+ chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
169
+ icon: "database",
170
+ get name() {
171
+ return a("connect.campaign.common.typeName.GAME");
172
+ },
173
+ chip() {
174
+ return r(this);
175
+ }
176
+ },
177
+ [c.enum.REWARD_POOL]: {
178
+ chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
179
+ icon: "editor_choice",
180
+ get name() {
181
+ return a("connect.campaign.common.typeName.REWARD_POOL");
182
+ },
183
+ chip() {
184
+ return r(this);
185
+ }
186
+ },
187
+ [c.enum.COIN]: {
188
+ chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
189
+ icon: "monetization_on",
190
+ get name() {
191
+ return a("connect.campaign.common.typeName.COIN");
192
+ },
193
+ chip() {
194
+ return r(this);
195
+ }
196
+ },
197
+ [c.enum.MEMBERSHIP]: {
198
+ chipClass: "",
199
+ icon: "",
200
+ get name() {
201
+ return a("connect.campaign.common.typeName.MEMBERSHIP");
202
+ },
203
+ chip() {
204
+ return r(this);
205
+ }
206
+ },
207
+ [c.enum.MISSION]: {
208
+ chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
209
+ icon: "editor_choice",
210
+ get name() {
211
+ return a("connect.campaign.common.typeName.MISSION");
212
+ },
213
+ chip() {
214
+ return r(this);
215
+ }
216
+ },
217
+ [c.enum.GRAB]: {
218
+ chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
219
+ icon: "editor_choice",
220
+ name: "Grab",
221
+ chip() {
222
+ return r(this);
223
+ }
224
+ }
225
+ };
226
+ function K(t) {
227
+ const e = _(t), n = {
228
+ active: "text-fm-color-typo-success bg-fm-color-system-success-100",
229
+ upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
230
+ expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
231
+ };
232
+ return t.type == "VOUCHER" ? p(h.FmChip, {
233
+ class: n[e],
234
+ label: d.title(a(`connect.campaign.common.status.${e}`)),
235
+ compact: !0
236
+ }) : p(h.FmChip, {
237
+ class: n[e],
238
+ label: d.title(a(`connect.campaign.common.status.${e}`)),
239
+ compact: !0
240
+ });
241
+ }
242
+ function q(t) {
243
+ const e = t.timeframeOptions;
244
+ if (!e || !e.start && !e.end)
245
+ return a("connect.campaign.common.always_active");
246
+ if (!e.start && e.end)
247
+ return a("connect.campaign.common.valid_until", {
248
+ date: g(e.end)
249
+ });
250
+ const n = g(e.start), o = e.end ? g(e.end) : a("connect.campaign.common.unlimited");
251
+ return `${n} -> ${o}`;
252
+ }
253
+ function A(t) {
254
+ if (!t || !t.start && !t.end)
255
+ return "connect.campaign.common.always";
256
+ const e = t.start ? s(t.start).format("DD MMM YYYY") : "From campaign creation", n = t.end ? s(t.end).format("DD MMM YYYY") : "Never ends";
257
+ return `${e} - ${n}`;
258
+ }
259
+ function Q(t) {
260
+ const { campaign: e } = t;
261
+ return {
262
+ "connect.campaign.common.campaign_name": e.name,
263
+ "connect.campaign.common.campaign_period": A(
264
+ e.timeframeOptions
265
+ ),
266
+ get "connect.campaign.common.next_schedule_at"() {
267
+ if ((e == null ? void 0 : e.event.type) != "SCHEDULE" || !e.event.rule || !C(e.event.rule))
268
+ return;
269
+ const n = O(
270
+ e.event.rule.rules.g_schedule
271
+ );
272
+ return n ? s(n).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
273
+ },
274
+ get "connect.campaign.common.discount_type"() {
275
+ if (e.type == "PROMOTION") return l(e.effect);
276
+ if ("configs" in t && t.configs.type == "VOUCHER")
277
+ return l(t.configs.extras.effect);
278
+ },
279
+ get "connect.campaign.broadcast.summary.delivery"() {
280
+ if (e.type != "BROADCAST") return;
281
+ const n = y(e);
282
+ if (!(n.channels.length < 2))
283
+ return `connect.campaign.broadcast.mode.${n.mode}.label`;
284
+ },
285
+ get "connect.campaign.broadcast.summary.channels"() {
286
+ var n;
287
+ if (e.type == "BROADCAST")
288
+ return ((n = D(e)) == null ? void 0 : n.route) ?? "connect.campaign.broadcast.noChannelsSelected";
289
+ },
290
+ get "connect.campaign.common.available_at"() {
291
+ return e.targetLocation ? e.targetLocation.length > 0 ? e.targetLocation.map(
292
+ (n) => b().locationItems.find((o) => o.value == n).label
293
+ ).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
294
+ }
295
+ };
296
+ }
297
+ function _(t) {
298
+ return t.timeframeOptions && t.timeframeOptions.type == "timeframe" ? s().isBetween(
299
+ t.timeframeOptions.start ?? s().subtract(1, "d"),
300
+ t.timeframeOptions.end ?? s().add(1, "d")
301
+ ) ? "active" : s().isAfter(t.timeframeOptions.end) ? "expired" : "upcoming" : "active";
302
+ }
303
+ function D(t) {
304
+ const e = y(t);
305
+ if (!e.channels.length) return null;
306
+ const n = R(
307
+ e,
308
+ (o) => f.global.t(`connect.campaign.broadcast.channel.${o}`)
309
+ );
310
+ return {
311
+ strategy: e.channels.length > 1 ? f.global.t(
312
+ `connect.campaign.broadcast.strategy.${e.mode}`
313
+ ) : null,
314
+ route: n
315
+ };
316
+ }
317
+ function Z(t) {
318
+ var e, n;
319
+ switch (t.event.type) {
320
+ case "BILL_COMPLETED":
321
+ const o = `Spend to get ${i.formattedType(t.type)}`;
322
+ switch (t.type) {
323
+ case "POINT":
324
+ case "CREDIT":
325
+ case "COIN":
326
+ return t.earningOption.type == "FIXED" ? `Spend to get ${t.earningOption.amount} ${i.formattedType(t.type)}` : `Every ${t.earningOption.every} amount spent get ${t.earningOption.amount} ${i.formattedType(t.type)}`;
327
+ case "VOUCHER":
328
+ const m = (n = (e = t == null ? void 0 : t.pf_collectible) == null ? void 0 : e.extras) == null ? void 0 : n.effect;
329
+ return m ? `${o} - ${l(m)}` : o;
330
+ default:
331
+ return o;
332
+ }
333
+ case "FEEDBACK":
334
+ return `Give feedback to receive ${i.formattedType(t.type)}`;
335
+ case "SCHEDULE":
336
+ return `Receive ${i.formattedType(t.type)} on scheduled time`;
337
+ case "SIMPLE_CLAIM":
338
+ return "Simple claim voucher";
339
+ case "TIER_UPGRADED":
340
+ return `Receive ${i.formattedType(t.type)} when member tier upgraded`;
341
+ case "MEMBERSHIP_JOINED":
342
+ return `Receive ${i.formattedType(t.type)} when member joined`;
343
+ case "MAKING_ORDER":
344
+ return t.type !== "PROMOTION" ? void 0 : l(t.effect);
345
+ default:
346
+ throw new Error(
347
+ `Not implemented ${JSON.stringify({ cause: t.event.type })}`
348
+ );
349
+ }
350
+ }
351
+ export {
352
+ J as C,
353
+ _ as a,
354
+ K as b,
355
+ Z as c,
356
+ D as d,
357
+ E as e,
358
+ W as f,
359
+ q as g,
360
+ j as h,
361
+ G as i,
362
+ X as j,
363
+ k,
364
+ Q as l,
365
+ z as m,
366
+ V as r,
367
+ A as s
368
+ };
@@ -1,7 +1,7 @@
1
1
  import { defineStore as d } from "pinia";
2
2
  import { reactive as b, onMounted as f, ref as s } from "vue";
3
- import { c } from "./index-BmN_Qcw7.js";
4
- import { g as i, S as g, b as h } from "./index-B14H1rLW.js";
3
+ import { c } from "./index-eEMXtCiV.js";
4
+ import { g as i, S as g, b as h } from "./index-C2tPMx3P.js";
5
5
  const p = () => {
6
6
  const e = g.getBusinessId();
7
7
  if (!e) throw new Error("Invalid business ID");
@@ -1,4 +1,4 @@
1
- import { z as E } from "./index-D9f3AIaO.js";
1
+ import { z as E } from "./index-7vDEWDqs.js";
2
2
  const M = E.enum([
3
3
  "VOUCHER",
4
4
  "PROMOTION",