@feedmepos/mf-connect 0.1.38-beta.2 → 0.1.39-prod

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 (110) hide show
  1. package/dist/Analytic-D8WCDkga.js +427 -0
  2. package/dist/{App-D11A2JY1.js → App-CTnXtg1W.js} +352 -364
  3. package/dist/{Bin-9wV4Ah3M.js → Bin-BY6-bvFj.js} +8 -8
  4. package/dist/{Broadcast-I3BtSk8V.js → Broadcast-5VTEIQAr.js} +40 -40
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-XJqTXbKr.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BuAQxEM4.js} +18 -18
  6. package/dist/{Card-CqALG5RM.js → Card-8ivdV-Qz.js} +159 -159
  7. package/dist/{Collections-rg3SzoUb.js → Collections-CFszRHmE.js} +91 -103
  8. package/dist/{Credit-BNn1sYZv.js → Credit-DFslY__4.js} +74 -74
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-PJ8q72XH.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BvCLYtJ3.js} +488 -489
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Sww7KNle.js → EffectSheet.vue_vue_type_style_index_0_lang-Ci_bp7GH.js} +94 -94
  11. package/dist/{Experience-D_Qm8SUj.js → Experience-BxfiZNlY.js} +41 -41
  12. package/dist/{Game-CKXgXm6Q.js → Game-0FZJcLmj.js} +31 -31
  13. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
  14. package/dist/{Index-D4DGfUHd.js → Index-ByeKKbuM.js} +10 -10
  15. package/dist/Marketing-C7F4abzg.js +319 -0
  16. package/dist/{Member-B55vWHDd.js → Member-DP0fLSIV.js} +64 -64
  17. package/dist/MemberList-DFW2bMbr.js +1606 -0
  18. package/dist/MemberOverview-C2n9oJZh.js +58 -0
  19. package/dist/{MemberTransactions-CP5EI-W0.js → MemberTransactions-CW62fvgx.js} +1 -1
  20. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-iJXNbgsB.js +455 -0
  21. package/dist/{Mission-CFvhROuB.js → Mission-DEgQHJw6.js} +21 -21
  22. package/dist/{Overview-4273yNwL.js → Overview-5jDtZKi8.js} +335 -335
  23. package/dist/{Point-B_-_C919.js → Point-D2lB1-xB.js} +41 -41
  24. package/dist/{Promotion-D2S3COxk.js → Promotion-Diz1gIa0.js} +42 -42
  25. package/dist/{Queue-BmS1Oi-C.js → Queue-DIAuq7HG.js} +51 -51
  26. package/dist/{Record-DRBl0M8g.js → Record-T608yda1.js} +9 -9
  27. package/dist/{Reward-8056NmfK.js → Reward-fZzHrHCW.js} +173 -173
  28. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJ_WC2gV.js → RewardGroup.vue_vue_type_script_setup_true_lang-YOKVfimM.js} +11 -11
  29. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DqNQl_nz.js → RuleGroup.vue_vue_type_script_setup_true_lang-C3_lmBe5.js} +431 -431
  30. package/dist/Segment-DDQIzsrk.js +882 -0
  31. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-4nNkkklE.js → SelectItems.vue_vue_type_script_setup_true_lang-B5oUf91Q.js} +2 -2
  32. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dnf2oxOG.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-C2U6Kzvx.js} +11 -11
  33. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLYP-5U9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BRmqgxES.js} +3 -3
  34. package/dist/{Setting-BrJfYoru.js → Setting-CQNyXmp4.js} +432 -432
  35. package/dist/{Store-Bpl_4yZW.js → Store-CIA1Rtsg.js} +210 -210
  36. package/dist/StoreRewards-D5zlE6cE.js +423 -0
  37. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BkTYngJ_.js +995 -0
  38. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-QucRaI08.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-D8l3fQyz.js} +1 -1
  39. package/dist/{Tier-_LnXg3n6.js → Tier-jFXVOje_.js} +106 -106
  40. package/dist/{Title-B7AGStvx.js → Title-DVpZ1YMK.js} +131 -133
  41. package/dist/{Transaction-Chxv6V7u.js → Transaction-BF_wmok6.js} +2 -2
  42. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CzXNmobp.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cex1Z43W.js} +6 -6
  43. package/dist/{Voucher-C5z2kOq9.js → Voucher-CaBMU5w0.js} +37 -37
  44. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BXt2fLOD.js +419 -0
  45. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BlXzEWA6.js → ZodTextField.vue_vue_type_script_setup_true_lang-CtHjWpUe.js} +1 -1
  46. package/dist/{app-BVojNX0w.js → app-CPhyKlyf.js} +1 -1
  47. package/dist/{app-7cvPyHJ7.js → app-DuIzRGvb.js} +124 -161
  48. package/dist/app.js +3 -4
  49. package/dist/{business-CmxV69wT.js → business-TTvv3aTz.js} +1 -1
  50. package/dist/{campaign-Dq5C_no-.js → campaign-BiMCoAzx.js} +3 -5
  51. package/dist/{campaign-CT_cNJEL.js → campaign-CjEVStN1.js} +9 -9
  52. package/dist/{campaign.enum-dp7yHKzF.js → campaign.enum-DpYmj9jp.js} +1 -1
  53. package/dist/campaign.fn-DJ6J98jS.js +758 -0
  54. package/dist/{collectible.enum-DxbB4DxT.js → collectible.enum-Cgmm_s-C.js} +1 -1
  55. package/dist/{collection.fn-CNZRdUgy.js → collection.fn-BsYCNgfJ.js} +2 -2
  56. package/dist/{dto-CT9zZbv9.js → dto-DgmHIlZ2.js} +4 -4
  57. package/dist/{effect-FIlOEC4H.js → effect-DnAVIDFy.js} +1 -1
  58. package/dist/{email-addresses-Ba7xImfX.js → email-addresses-CMRgb6Uv.js} +1 -1
  59. package/dist/{export-uzjZFNF9.js → export-DtarK6IJ.js} +3 -3
  60. package/dist/{helper-D4sAZde0.js → helper-BKZghMbF.js} +1 -1
  61. package/dist/{index-l2F5MnLF.js → index-2OAcPmuQ.js} +1 -1
  62. package/dist/{index-BI3m1Ehv.js → index-B0YZKHyu.js} +3 -3
  63. package/dist/{index-CH3z92VV.js → index-B5oXFFlO.js} +1 -1
  64. package/dist/{index-CvBcve-r.js → index-BQ3KHJXX.js} +1 -1
  65. package/dist/{index-B9pl4zRZ.js → index-B_893fH7.js} +79 -179
  66. package/dist/{index-CNJLP3D5.js → index-BoR-BOFw.js} +1 -1
  67. package/dist/{index-DNxa8Rqx.js → index-C7rl1eHp.js} +449 -516
  68. package/dist/{index-BXz54M1s.js → index-CBcbwf0k.js} +1 -1
  69. package/dist/{index-CS3Jmojj.js → index-CIztuDE4.js} +2462 -2453
  70. package/dist/{index-D5rvMvzx.js → index-CK67enPK.js} +1 -1
  71. package/dist/index-CuvNtC_M.js +61 -0
  72. package/dist/index-D2uZzjpn.js +44 -0
  73. package/dist/{index-CUfS9Kp1.js → index-DWdAUovq.js} +9 -9
  74. package/dist/{index-CONvJfKv.js → index-DkWcEDHA.js} +1 -1
  75. package/dist/{index-BjU8LVUC.js → index-VHu8hYtE.js} +385 -376
  76. package/dist/{index.esm2017-ATcsD5N4.js → index.esm2017-DkwLmmR_.js} +127 -127
  77. package/dist/{loading-BWGQSrCB.js → loading-BFkEqWR6.js} +1 -1
  78. package/dist/{membership-Cc4OZ8-U.js → membership-D0eN3i_T.js} +3 -3
  79. package/dist/{money-D7p8nfun.js → money-DS9ZQwSP.js} +1 -1
  80. package/dist/{number-CMJjC4qz.js → number-C8Gt93v9.js} +1 -1
  81. package/dist/objectid-Cr99eTPd.js +145 -0
  82. package/dist/{plugins-eQis66QR.js → plugins-DK_ue6Xa.js} +2 -2
  83. package/dist/{reward-DrnzbG20.js → reward-CW2dSLDW.js} +1 -1
  84. package/dist/{rule-CtRxkYXB.js → rule-CebKyXSm.js} +3 -3
  85. package/dist/{rule-builder-Di9RIYHF.js → rule-builder-kQq14RfN.js} +17 -17
  86. package/dist/style.css +1 -1
  87. package/dist/{template-C3UfY0v5.js → template-CxUxlb6-.js} +64 -64
  88. package/dist/{trigger-C9U7Zgad.js → trigger-RqJo06KA.js} +4 -4
  89. package/dist/{usePagination-BeF5K3M7.js → usePagination-JoYaROkV.js} +85 -85
  90. package/dist/{user-D7n9yYmO.js → user-DhV5Iy52.js} +1 -1
  91. package/dist/{vue-i18n-Bz45zC04.js → vue-i18n-BtvUK9hI.js} +419 -419
  92. package/dist/{xlsx-D4S4qbcZ.js → xlsx-WnLDq4qn.js} +381 -381
  93. package/package.json +3 -9
  94. package/dist/Analytic-BjSfI2Ff.js +0 -761
  95. package/dist/AuditLogs-DWCFYoRg.js +0 -1887
  96. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +0 -58
  97. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
  98. package/dist/Marketing-Dn9A1vgH.js +0 -20073
  99. package/dist/MemberList-BWTG9Ohy.js +0 -1606
  100. package/dist/MemberOverview-wL_ailso.js +0 -58
  101. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-D--_An-f.js +0 -60279
  102. package/dist/Segment-Bzq-pyhc.js +0 -882
  103. package/dist/StoreRewards-Cu7n7Pjz.js +0 -423
  104. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-T3Wo2maC.js +0 -1029
  105. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DdGMrk2C.js +0 -419
  106. package/dist/campaign.fn-BYZgKDN7.js +0 -758
  107. package/dist/index-CsaQJMAR.js +0 -66
  108. package/dist/index-CwsMG2cV.js +0 -56
  109. package/dist/objectid-D5T27iny.js +0 -145
  110. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
@@ -0,0 +1,58 @@
1
+ import { defineComponent as d, resolveComponent as o, openBlock as r, createElementBlock as s, Fragment as a, createElementVNode as e, createVNode as c, withCtx as v, renderList as p, normalizeClass as _, toDisplayString as n, createCommentVNode as u } from "vue";
2
+ const y = { class: "bg-gradient-to-r from-orange-200 p-24 to-blue-200 via-pink-100 mx-[-24px]" }, b = /* @__PURE__ */ e("div", { class: "fm-typo-en-body-lg-600" }, "Member overview", -1), g = { class: "grid grid-cols-6 xs:grid-cols-2 gap-4 divide-x xs:divide-x-0" }, x = { class: "fm-typo-body-md-400 fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, f = { class: "fm-typo-en-title-sm-800" }, F = /* @__PURE__ */ d({
3
+ __name: "MemberOverview",
4
+ setup(k) {
5
+ const l = [
6
+ {
7
+ key: "Total member",
8
+ value: 4
9
+ },
10
+ {
11
+ key: "New member",
12
+ value: 2
13
+ },
14
+ {
15
+ key: "Member average spend",
16
+ value: 100
17
+ },
18
+ {
19
+ key: "Average visit time",
20
+ value: 567
21
+ },
22
+ {
23
+ key: "Member growth",
24
+ value: "100%"
25
+ },
26
+ { key: "Inactive member", value: 0 }
27
+ ];
28
+ return (h, C) => {
29
+ const i = o("FmCard");
30
+ return o("FmButton"), r(), s(a, null, [
31
+ e("div", y, [
32
+ c(i, {
33
+ variant: "outlined",
34
+ class: "flex flex-col gap-16 p-16"
35
+ }, {
36
+ default: v(() => [
37
+ b,
38
+ e("div", g, [
39
+ (r(), s(a, null, p(l, (t, m) => e("div", {
40
+ key: t.key,
41
+ class: _(["px-8", { "xs:!border-r": m % 2 == 0 }])
42
+ }, [
43
+ e("div", x, n(t.key), 1),
44
+ e("div", f, n(t.value), 1)
45
+ ], 2)), 64))
46
+ ])
47
+ ]),
48
+ _: 1
49
+ })
50
+ ]),
51
+ u("", !0)
52
+ ], 64);
53
+ };
54
+ }
55
+ });
56
+ export {
57
+ F as default
58
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as d, ref as p, resolveComponent as _, openBlock as a, createElementBlock as f, createVNode as v, unref as o, createBlock as u, createCommentVNode as b } from "vue";
2
- import { _ as k, a as x } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-T3Wo2maC.js";
2
+ import { _ as k, a as x } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-BkTYngJ_.js";
3
3
  import { useRouter as y } from "vue-router";
4
4
  const C = { class: "flex flex-col gap-y-32 pb-24" }, F = /* @__PURE__ */ d({
5
5
  __name: "MemberTransactions",
@@ -0,0 +1,455 @@
1
+ import { defineComponent as I, shallowRef as G, openBlock as h, createElementBlock as F, normalizeStyle as z, ref as w, resolveComponent as b, createBlock as C, unref as i, isRef as P, withCtx as $, createVNode as g, createElementVNode as S, createCommentVNode as H, withDirectives as A, vShow as B, computed as q, onMounted as J, Fragment as T, renderList as Z, normalizeClass as K, toDisplayString as W } from "vue";
2
+ import { p as X } from "./plugins-DK_ue6Xa.js";
3
+ import { B as Y } from "./index-C7rl1eHp.js";
4
+ import "./index-CIztuDE4.js";
5
+ import { _ as Q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
+ import { _ as ee, S as te } from "./LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js";
7
+ import { c as ne } from "./object-qECH92oz.js";
8
+ import { useCoreStore as oe } from "@feedmepos/mf-common";
9
+ import { u as se } from "./membership-D0eN3i_T.js";
10
+ const ae = {
11
+ "user.name": {
12
+ name: "User name"
13
+ },
14
+ "user.birthday": {
15
+ name: "Birthday"
16
+ },
17
+ "user.joinAt": {
18
+ name: "Join at"
19
+ },
20
+ "user.expiringVouchers.days7": {
21
+ name: "Expiring vouchers in 7 days"
22
+ },
23
+ "user.expiringVouchers.days30": {
24
+ name: "Expiring vouchers in 30 days"
25
+ },
26
+ "user.expiringVouchers.days90": {
27
+ name: "Expiring vouchers in 90 days"
28
+ },
29
+ "user.tier": {
30
+ name: "User tier"
31
+ },
32
+ "user.point": {
33
+ name: "User experience"
34
+ },
35
+ "user.gender": {
36
+ name: "Gender"
37
+ },
38
+ "user.phoneNumber": {
39
+ name: "Phone Number"
40
+ },
41
+ "transaction.amount": {
42
+ name: "Reward amount"
43
+ },
44
+ "collectible.name": {
45
+ name: "Reward name"
46
+ },
47
+ "membership.url": {
48
+ name: "Membership URL"
49
+ }
50
+ }, Ie = {
51
+ MY: ["user.phoneNumber", "membership.url"]
52
+ }, ie = "https://editor.unlayer.com/embed.js?2", N = [];
53
+ let O = !1;
54
+ const re = (e) => {
55
+ const n = document.querySelectorAll("script");
56
+ let d = !1;
57
+ return n.forEach((u) => {
58
+ u.src.includes(e) && (d = !0);
59
+ }), d;
60
+ }, le = (e) => {
61
+ N.push(e);
62
+ }, R = () => {
63
+ if (O) {
64
+ let e;
65
+ for (; e = N.shift(); )
66
+ e();
67
+ }
68
+ }, de = (e, n = ie) => {
69
+ if (le(e), re(n))
70
+ R();
71
+ else {
72
+ const d = document.createElement("script");
73
+ d.setAttribute("src", n), d.onload = () => {
74
+ O = !0, R();
75
+ }, document.head.appendChild(d);
76
+ }
77
+ };
78
+ let ce = 0;
79
+ const ue = I({
80
+ name: "EmailEditor",
81
+ props: {
82
+ editorId: String,
83
+ minHeight: {
84
+ type: String,
85
+ default: "500px"
86
+ },
87
+ options: Object,
88
+ scriptUrl: String,
89
+ /**
90
+ * @Deprecated Props: Use `options.appearance` instead
91
+ */
92
+ appearance: Object,
93
+ /**
94
+ * @Deprecated Props: Use `options.locale` instead
95
+ */
96
+ locale: String,
97
+ /**
98
+ * @Deprecated Props: Use `options.projectId` instead
99
+ */
100
+ projectId: Number,
101
+ /**
102
+ * @Deprecated Props: Use `options.tools` instead
103
+ */
104
+ tools: Object
105
+ },
106
+ computed: {
107
+ id() {
108
+ return this.editorId || `editor-${++ce}`;
109
+ }
110
+ },
111
+ setup() {
112
+ return {
113
+ editor: G(null)
114
+ // Makes editor available to the template
115
+ };
116
+ },
117
+ mounted() {
118
+ this.$emit("load"), de(this.loadEditor.bind(this), this.scriptUrl);
119
+ },
120
+ methods: {
121
+ loadEditor() {
122
+ const e = this.options || {};
123
+ this.appearance && (e.appearance = this.appearance), this.locale && (e.locale = this.locale), this.projectId && (e.projectId = this.projectId), this.tools && (e.tools = this.tools), this.editor = unlayer.createEditor({
124
+ ...e,
125
+ id: this.id
126
+ }), this.editor.addEventListener("editor:ready", () => {
127
+ this.$emit("ready");
128
+ });
129
+ },
130
+ /**
131
+ * @deprecated This method will be removed in the next major release. Use `editor.exportHtml` instead.
132
+ */
133
+ exportHtml(e) {
134
+ var n;
135
+ (n = this.editor) == null || n.exportHtml(e);
136
+ },
137
+ /**
138
+ * @deprecated This method will be removed in the next major release. Use `editor.loadDesign` instead.
139
+ */
140
+ loadDesign(e) {
141
+ var n;
142
+ (n = this.editor) == null || n.loadDesign(e);
143
+ },
144
+ /**
145
+ * @deprecated This method will be removed in the next major release. Use `editor.saveDesign` instead.
146
+ */
147
+ saveDesign(e) {
148
+ var n;
149
+ (n = this.editor) == null || n.saveDesign(e);
150
+ }
151
+ }
152
+ }), me = ["id"];
153
+ function pe(e, n, d, u, a, m) {
154
+ return h(), F("div", {
155
+ id: e.id,
156
+ class: "unlayer-editor",
157
+ style: z({ minHeight: e.minHeight })
158
+ }, null, 12, me);
159
+ }
160
+ const he = /* @__PURE__ */ Q(ue, [["render", pe], ["__scopeId", "data-v-a9a2bb94"]]), ge = { class: "h-full flex flex-col" }, fe = { class: "flex items-center gap-8" }, be = /* @__PURE__ */ I({
161
+ __name: "EmailEditorSheet",
162
+ props: {
163
+ design: {
164
+ type: Object,
165
+ required: !1
166
+ },
167
+ title: {
168
+ type: String,
169
+ required: !1
170
+ }
171
+ },
172
+ emits: ["update:design"],
173
+ setup(e, { expose: n, emit: d }) {
174
+ const u = w(!1), a = w(null), m = w(!1), x = e, c = w({
175
+ html: "",
176
+ design: x.design,
177
+ title: x.title || ""
178
+ });
179
+ function E(o) {
180
+ u.value = o;
181
+ }
182
+ const L = d;
183
+ function k() {
184
+ a.value && (a.value.exportHtml((o) => {
185
+ c.value = {
186
+ html: o.html,
187
+ design: o.design,
188
+ title: c.value.title
189
+ }, L("update:design", c.value);
190
+ }), E(!1));
191
+ }
192
+ return n({
193
+ showSheet: E
194
+ }), (o, t) => {
195
+ const r = b("FmButton"), f = b("FmTextField"), y = b("FmSideSheet");
196
+ return h(), C(y, {
197
+ modelValue: i(u),
198
+ "onUpdate:modelValue": t[4] || (t[4] = (l) => P(u) ? u.value = l : null),
199
+ header: "Email editor",
200
+ "max-width": 1280
201
+ }, {
202
+ "side-sheet-button": $(() => [
203
+ g(r, {
204
+ label: "Edit email",
205
+ variant: "tertiary",
206
+ icon: "edit"
207
+ })
208
+ ]),
209
+ default: $(() => [
210
+ S("div", ge, [
211
+ i(m) ? H("", !0) : (h(), C(ee, {
212
+ key: 0,
213
+ class: "flex-1",
214
+ json: i(te),
215
+ width: 100,
216
+ height: 100
217
+ }, null, 8, ["json"])),
218
+ A(g(f, {
219
+ label: "Email title",
220
+ modelValue: i(c).title,
221
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => i(c).title = l)
222
+ }, null, 8, ["modelValue"]), [
223
+ [B, i(m)]
224
+ ]),
225
+ A(g(he, {
226
+ class: "flex-1",
227
+ ref_key: "editorRef",
228
+ ref: a,
229
+ onLoad: t[1] || (t[1] = (l) => m.value = !1),
230
+ onReady: t[2] || (t[2] = () => {
231
+ var l;
232
+ m.value = !0, x.design && ((l = i(a)) == null || l.loadDesign(i(ne)(x.design)));
233
+ })
234
+ }, null, 512), [
235
+ [B, i(m)]
236
+ ])
237
+ ])
238
+ ]),
239
+ "side-sheet-footer": $(() => [
240
+ S("div", fe, [
241
+ g(r, {
242
+ variant: "primary",
243
+ label: "Confirm",
244
+ onClick: k
245
+ }),
246
+ g(r, {
247
+ variant: "tertiary",
248
+ label: "Cancel",
249
+ onClick: t[3] || (t[3] = (l) => E(!1))
250
+ })
251
+ ])
252
+ ]),
253
+ _: 1
254
+ }, 8, ["modelValue"]);
255
+ };
256
+ }
257
+ }), ye = { class: "space-y-4" }, ve = { class: "flex items-center gap-8 justify-between" }, Se = /* @__PURE__ */ S("div", { class: "fm-typo-en-body-lg-400" }, "Add message", -1), xe = { class: "relative" }, Ee = { class: "absolute bottom-[24px] right-[4px]" }, Ue = /* @__PURE__ */ I({
258
+ __name: "MessageInput",
259
+ props: {
260
+ allowEmail: {
261
+ type: Boolean,
262
+ default: !1
263
+ },
264
+ modelValue: {
265
+ type: Object
266
+ },
267
+ triggerType: {
268
+ type: String,
269
+ default: () => "SCHEDULE"
270
+ },
271
+ helperText: {
272
+ type: String
273
+ },
274
+ helperState: {
275
+ type: String
276
+ },
277
+ variables: {
278
+ type: Object,
279
+ default: () => [
280
+ "user.name",
281
+ "user.birthday",
282
+ "user.joinAt",
283
+ "user.expiringVouchers.days7",
284
+ "user.expiringVouchers.days30",
285
+ "user.expiringVouchers.days90",
286
+ "user.tier",
287
+ "user.point",
288
+ "transaction.amount",
289
+ "collectible.name"
290
+ ]
291
+ },
292
+ placeholder: {
293
+ type: String
294
+ }
295
+ },
296
+ emits: ["update:model-value"],
297
+ setup(e, { emit: n }) {
298
+ const d = oe(), u = se(), a = e, m = n;
299
+ function x() {
300
+ var r;
301
+ const o = {
302
+ user: {
303
+ name: "John Doe",
304
+ tier: 1,
305
+ point: 1283,
306
+ birthday: (/* @__PURE__ */ new Date("2000-10-02T16:00:00.000Z")).toLocaleDateString(),
307
+ joinAt: (/* @__PURE__ */ new Date("2024-06-14")).toLocaleDateString(),
308
+ expiringVouchers: { days7: 3, days30: 5, days90: 5 }
309
+ },
310
+ transaction: {
311
+ amount: 3
312
+ },
313
+ collectible: {
314
+ name: "RM10 Voucher"
315
+ }
316
+ }, t = Y(
317
+ ((r = a.modelValue) == null ? void 0 : r.content) ?? "",
318
+ o
319
+ );
320
+ X.confirm(t, "Preview message", "OK");
321
+ }
322
+ function c(o, t = "SMS") {
323
+ m("update:model-value", {
324
+ channel: t,
325
+ content: t == "SMS" ? o : o.html,
326
+ design: t == "EMAIL" ? o.design : void 0,
327
+ language: "en",
328
+ title: t == "EMAIL" ? o.title : void 0,
329
+ variables: a.variables
330
+ });
331
+ }
332
+ const E = w(a.helperState || "none"), L = q(() => {
333
+ var M, _;
334
+ const o = ((M = u.membership) == null ? void 0 : M.brand) || d.currentBusiness.value.name || "", t = 160;
335
+ let r = t;
336
+ const f = ((_ = a.modelValue) == null ? void 0 : _.content.replace(/{{([^}]+)}}/g, (v, s) => {
337
+ switch (s) {
338
+ case "user.name":
339
+ return "1234567890";
340
+ case "user.tier":
341
+ return "1";
342
+ case "user.point":
343
+ return "1000";
344
+ case "user.birthday":
345
+ return "01/01/2024";
346
+ case "user.joinAt":
347
+ return "01/01/2024";
348
+ case "user.expiringVouchers.days7":
349
+ case "user.expiringVouchers.days30":
350
+ case "user.expiringVouchers.days90":
351
+ return "5";
352
+ case "transaction.amount":
353
+ return "100";
354
+ case "collectible.name":
355
+ return "Voucher";
356
+ default:
357
+ return "...";
358
+ }
359
+ })) || "";
360
+ let y = o.length + 5;
361
+ const l = "^{}\\[~]|€", j = /[^@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞ !"#%&'()*+,\-./0123456789:;<=>?A-ZÄÖÑܧ¿a-zäöñüà^{}\\[~\]|€]/.test(
362
+ f
363
+ );
364
+ let p = 0;
365
+ if (j)
366
+ p = f.length + y, r = p > 70 ? 67 : 70;
367
+ else {
368
+ let v = 0;
369
+ for (const s of f)
370
+ l.includes(s) ? v += 2 : v += 1;
371
+ p = v + y, r = p > 160 ? 153 : 160;
372
+ }
373
+ const V = Math.min(r, t);
374
+ return `Reserved: ${y} | Character used: ${p} | Encoding: ${j ? "UCS2" : "GSM 7-bit"}. Estimated ${Math.ceil(p / V)} SMS (Every ${V} characters will be sent as 1 SMS)`;
375
+ }), k = [{ label: "SMS" }, { label: "EMAIL" }];
376
+ return J(() => {
377
+ m("update:model-value", {
378
+ ...a.modelValue,
379
+ variables: a.variables
380
+ }), a.modelValue || c("");
381
+ }), (o, t) => {
382
+ var p, V, M, _, v;
383
+ const r = b("FmButtonGroup"), f = b("FmButton"), y = b("FmTextarea"), l = b("FmMenuItem"), j = b("FmMenu");
384
+ return h(), F("div", ye, [
385
+ e.allowEmail ? (h(), C(r, {
386
+ key: 0,
387
+ items: k,
388
+ "model-value": { label: (p = e.modelValue) == null ? void 0 : p.channel },
389
+ "onUpdate:modelValue": t[0] || (t[0] = (s) => c("", s.label))
390
+ }, null, 8, ["model-value"])) : H("", !0),
391
+ ((V = e.modelValue) == null ? void 0 : V.channel) == "EMAIL" ? (h(), C(be, {
392
+ key: 1,
393
+ design: (M = e.modelValue) == null ? void 0 : M.design,
394
+ title: ((_ = e.modelValue) == null ? void 0 : _.title) || void 0,
395
+ "onUpdate:design": t[1] || (t[1] = (s) => {
396
+ c(s, "EMAIL");
397
+ })
398
+ }, null, 8, ["design", "title"])) : (h(), F(T, { key: 2 }, [
399
+ S("div", ve, [
400
+ Se,
401
+ g(f, {
402
+ icon: "visibility",
403
+ label: "Preview message",
404
+ variant: "plain",
405
+ onClick: x
406
+ })
407
+ ]),
408
+ S("div", xe, [
409
+ g(y, {
410
+ "model-value": (v = e.modelValue) == null ? void 0 : v.content,
411
+ "onUpdate:modelValue": c,
412
+ "show-word-count": !0,
413
+ placeholder: e.placeholder,
414
+ "helper-state": i(E) || "none"
415
+ }, null, 8, ["model-value", "placeholder", "helper-state"]),
416
+ S("div", Ee, [
417
+ g(j, { placement: "left-end" }, {
418
+ "menu-button": $(() => [
419
+ g(f, {
420
+ icon: "add",
421
+ variant: "tertiary",
422
+ size: "md"
423
+ })
424
+ ]),
425
+ default: $(() => [
426
+ (h(!0), F(T, null, Z(e.variables.filter(
427
+ (s) => e.triggerType == "SCHEDULE" ? !s.startsWith("transaction.") : !0
428
+ ), (s) => {
429
+ var U;
430
+ return h(), C(l, {
431
+ key: s,
432
+ label: ((U = i(ae)[s]) == null ? void 0 : U.name) || s,
433
+ onClick: (Ve) => {
434
+ var D;
435
+ return c(((D = e.modelValue) == null ? void 0 : D.content) + `{{${s}}}`);
436
+ }
437
+ }, null, 8, ["label", "onClick"]);
438
+ }), 128))
439
+ ]),
440
+ _: 1
441
+ })
442
+ ])
443
+ ]),
444
+ S("span", {
445
+ class: K(["fm-typo-en-body-md-400 text-fm-color-neutral-gray-400", i(E)])
446
+ }, W(i(L)), 3)
447
+ ], 64))
448
+ ]);
449
+ };
450
+ }
451
+ });
452
+ export {
453
+ Ie as M,
454
+ Ue as _
455
+ };
@@ -1,21 +1,24 @@
1
1
  import { defineComponent as H, ref as w, computed as q, h as l, onMounted as z, resolveComponent as m, openBlock as p, createElementBlock as x, Fragment as v, createVNode as c, unref as t, createElementVNode as s, withCtx as C, renderList as W, createBlock as b, resolveDynamicComponent as G, toDisplayString as u } from "vue";
2
2
  import { _ as J } from "./campaign-CpzFl8Vr.js";
3
- import { u as Q } from "./loading-BWGQSrCB.js";
4
- import { g as X, a as B, b as P } from "./campaign-CT_cNJEL.js";
5
- import { a as Y, p as Z } from "./plugins-eQis66QR.js";
6
- import { u as ee } from "./business-CmxV69wT.js";
7
- import { u as oe } from "./campaign-Dq5C_no-.js";
3
+ import { u as Q } from "./loading-BFkEqWR6.js";
4
+ import { g as X, a as B, b as P } from "./campaign-CjEVStN1.js";
5
+ import { a as Y, p as Z } from "./plugins-DK_ue6Xa.js";
6
+ import { u as ee } from "./business-TTvv3aTz.js";
7
+ import { u as oe } from "./campaign-BiMCoAzx.js";
8
8
  import { useDialog as te, components as _ } from "@feedmepos/ui-library";
9
9
  import { _ as ne } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
10
- import { u as ae } from "./template-C3UfY0v5.js";
11
- import { _ as se } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-PJ8q72XH.js";
12
- import { s as ie } from "./index-CsaQJMAR.js";
13
- import { u as ce } from "./vue-i18n-Bz45zC04.js";
14
- import { _ as re } from "./SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dnf2oxOG.js";
15
- import { c as h } from "./index-D5rvMvzx.js";
16
- const le = { class: "px-24 flex flex-col gap-y-16" }, me = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, pe = { class: "space-y-8" }, ue = { class: "flex w-full gap-4 items-center" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "space-y-4" }, ye = { class: "fm-typo-en-body-lg-600" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, we = { class: "flex flex-col gap-16 text-center" }, xe = { class: "fm-typo-en-title-sm-800" }, ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Oe = /* @__PURE__ */ H({
10
+ import { u as ae } from "./template-CxUxlb6-.js";
11
+ import { _ as se } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BvCLYtJ3.js";
12
+ import { s as ie } from "./index-CuvNtC_M.js";
13
+ import { u as ce } from "./vue-i18n-BtvUK9hI.js";
14
+ import { _ as re } from "./SendCollectionSheet.vue_vue_type_script_setup_true_lang-C2U6Kzvx.js";
15
+ import { c as h } from "./index-CK67enPK.js";
16
+ const le = { class: "px-24 flex flex-col gap-y-16" }, me = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, pe = { class: "space-y-8" }, ue = { class: "flex w-full gap-4 items-center" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "space-y-4" }, ye = { class: "fm-typo-en-body-lg-600" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, we = /* @__PURE__ */ s("img", {
17
+ src: J,
18
+ class: "aspect-square w-[150px]"
19
+ }, null, -1), xe = { class: "flex flex-col gap-16 text-center" }, ve = { class: "fm-typo-en-title-sm-800" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ae = /* @__PURE__ */ H({
17
20
  __name: "Mission",
18
- setup(Ce) {
21
+ setup(be) {
19
22
  const { t: n } = ce(), R = {
20
23
  label: n("connect.program.common.actions.create", {
21
24
  type: n("connect.program.mission.title").toLowerCase()
@@ -260,13 +263,10 @@ const le = { class: "px-24 flex flex-col gap-y-16" }, me = { class: "flex items-
260
263
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
261
264
  }, {
262
265
  default: C(() => [
263
- o[6] || (o[6] = s("img", {
264
- src: J,
265
- class: "aspect-square w-[150px]"
266
- }, null, -1)),
267
- s("div", we, [
268
- s("div", xe, u(t(n)("connect.campaign.mission.createProgram")), 1),
269
- s("div", ve, u(t(n)("connect.campaign.mission.description")), 1)
266
+ we,
267
+ s("div", xe, [
268
+ s("div", ve, u(t(n)("connect.campaign.mission.createProgram")), 1),
269
+ s("div", Ce, u(t(n)("connect.campaign.mission.description")), 1)
270
270
  ]),
271
271
  c(M, {
272
272
  variant: "primary",
@@ -292,5 +292,5 @@ const le = { class: "px-24 flex flex-col gap-y-16" }, me = { class: "flex items-
292
292
  }
293
293
  });
294
294
  export {
295
- Oe as default
295
+ Ae as default
296
296
  };