@feedmepos/mf-connect 0.1.0-beta.3 → 0.1.0-beta.31

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 (99) hide show
  1. package/dist/Analytic-C-QC9ivZ.js +424 -0
  2. package/dist/{App-gzbM97vW.js → App-NASVRSh2.js} +397 -384
  3. package/dist/{Broadcast-BwYZkTs0.js → Broadcast-Cffg7nbY.js} +32 -32
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DIh9rz6T.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CA4kVwMl.js} +8 -8
  5. package/dist/Card-CmYFb1_Y.js +897 -0
  6. package/dist/{Collections-Df6tlo8S.js → Collections-CibvGIpU.js} +4 -4
  7. package/dist/{Credit-BPel8vA9.js → Credit-Ck6i9ySs.js} +14 -14
  8. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B35zbHHI.js +2198 -0
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BT8ucS5G.js → EffectSheet.vue_vue_type_style_index_0_lang-CQV77_cx.js} +8 -8
  11. package/dist/{Experience-CPpz1Zwx.js → Experience-CWUX2QvS.js} +8 -8
  12. package/dist/{Game-ByLblISC.js → Game-D3cdZrlc.js} +15 -15
  13. package/dist/Index-CWLZiYXT.js +255 -0
  14. package/dist/Marketing-Bol8eY5d.js +20070 -0
  15. package/dist/{Member-CCc_FEZY.js → Member-Cso-T2Xk.js} +4 -4
  16. package/dist/MemberList-Bqns9wko.js +1045 -0
  17. package/dist/{MemberTransactions-DD5ahSbY.js → MemberTransactions-zNw-30Xu.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DSPvWk4C.js → MessageInput.vue_vue_type_script_setup_true_lang-BLS5fNr6.js} +2 -2
  19. package/dist/{Mission-VH4057I-.js → Mission-C0-K0A_5.js} +98 -86
  20. package/dist/Overview-fZ9NvFKz.js +1024 -0
  21. package/dist/{Point-Bu3IlpH4.js → Point-D3gGhQlP.js} +23 -23
  22. package/dist/{Promotion-B45AOHis.js → Promotion-COCJIfu-.js} +53 -47
  23. package/dist/Record-C0a4Cn1U.js +209 -0
  24. package/dist/Reward-D0G4CBYd.js +411 -0
  25. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-zSOwxAcS.js +151 -0
  26. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-AmIdaAeX.js +1639 -0
  27. package/dist/Segment-eBM3aveX.js +567 -0
  28. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BgMuKAjE.js +181 -0
  29. package/dist/{Setting-CF09eRQJ.js → Setting-Dfye6fs5.js} +8 -8
  30. package/dist/Store-rQfwc8d6.js +1745 -0
  31. package/dist/{StoreRewards-0iGExjqQ.js → StoreRewards-DVTNMWdG.js} +12 -12
  32. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-3dvBoXz2.js +957 -0
  33. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BEfxin47.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DxGIUrmO.js} +1 -1
  34. package/dist/{Tier-IaeWe7rM.js → Tier-DekrYu5l.js} +327 -317
  35. package/dist/{Title-DD67Zxh5.js → Title-oAWsBqoM.js} +199 -183
  36. package/dist/{Transaction-BsPDnLzB.js → Transaction-Ss2XCksi.js} +2 -2
  37. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-BMIqnBts.js +130 -0
  38. package/dist/{Voucher-M7JfcKo0.js → Voucher-CjPJxdw8.js} +31 -31
  39. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DlWCpoOp.js +419 -0
  40. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-k0lprU2i.js → ZodTextField.vue_vue_type_script_setup_true_lang-FXQNhMrv.js} +1 -1
  41. package/dist/{app-HFICF0vL.js → app-C_zlbFNe.js} +1285 -1283
  42. package/dist/{app-DwujUNP-.js → app-WUJQRyEM.js} +1 -1
  43. package/dist/app.js +1 -1
  44. package/dist/{business-BaF1QJXa.js → business-C0e_E2xp.js} +1 -1
  45. package/dist/{campaign-CTDtmAE9.js → campaign-iWzbtNA5.js} +2 -2
  46. package/dist/collectible.enum-QITAo8Jg.js +19 -0
  47. package/dist/{collection.fn-DMW03W4R.js → collection.fn-R3hvasuZ.js} +2 -2
  48. package/dist/{dto-gpaNZHzQ.js → dto-D_tjJ72q.js} +78 -86
  49. package/dist/{effect-CBUmtwet.js → effect-_bpW5fmr.js} +9 -9
  50. package/dist/email-addresses-DUKn8uD0.js +705 -0
  51. package/dist/{export-Bdh_PbsW.js → export-CEBWZ8ko.js} +3 -3
  52. package/dist/{helper-Cu9elRvl.js → helper-CuF45pbY.js} +1 -1
  53. package/dist/{index-NXiDu42U.js → index-BO8RnVxy.js} +1 -1
  54. package/dist/{index-CArqG03W.js → index-BPc3wxOE.js} +39 -35
  55. package/dist/index-BXTQ6onZ.js +1067 -0
  56. package/dist/index-C4aPU80a.js +38 -0
  57. package/dist/{index-At6yms5t.js → index-CBzSPD25.js} +30 -26
  58. package/dist/{index-Ch6XwPzF.js → index-CR0ZVZQG.js} +1 -1
  59. package/dist/{index-DrGrOgZB.js → index-CXFwMV0s.js} +13 -1
  60. package/dist/index-CsaQJMAR.js +66 -0
  61. package/dist/{index-Dfdg2Q3E.js → index-Dh6xIUXJ.js} +1 -1
  62. package/dist/{index-ogzk-Mj4.js → index-LMvyNoHf.js} +1 -1
  63. package/dist/{index-Crw-Vgo5.js → index-S6sFiBxK.js} +1500 -1479
  64. package/dist/index-SpDFfOz_.js +54 -0
  65. package/dist/{index-CtH2S49l.js → index-Urbp7cdO.js} +203 -195
  66. package/dist/index-pHbs1GrF.js +29000 -0
  67. package/dist/{index.esm2017-CeJpvUbA.js → index.esm2017-BunOalUj.js} +33 -33
  68. package/dist/{loading-Cn8ml_vy.js → loading-CYFsZ9UB.js} +591 -597
  69. package/dist/{membership-CX4AKMlH.js → membership-C9089j0H.js} +51 -43
  70. package/dist/money-D-zGFohv.js +15 -0
  71. package/dist/number-UFl4zW6h.js +12 -0
  72. package/dist/objectid-BKIyQ5iE.js +145 -0
  73. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  74. package/dist/reward-LYKGLzXz.js +36 -0
  75. package/dist/{rule-Cv83Y59R.js → rule-BUUKmR4_.js} +180 -177
  76. package/dist/{rule-builder-Dew4yB5Q.js → rule-builder-9JUuOcMH.js} +1 -1
  77. package/dist/style.css +1 -1
  78. package/dist/{template-CSnbgM1o.js → template-CkXuF0cN.js} +5 -5
  79. package/dist/trigger-DjAx9efN.js +114 -0
  80. package/dist/user-DbsZta3D.js +54 -0
  81. package/dist/{vue-i18n-CNH_IhVd.js → vue-i18n-yYO72Mbp.js} +2 -2
  82. package/dist/{xlsx-D4DUZHix.js → xlsx-Dagi6ArS.js} +1 -1
  83. package/package.json +8 -7
  84. package/dist/Analytic-BC5BA6pN.js +0 -622
  85. package/dist/Card-CBYQGKwY.js +0 -825
  86. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-PsrS7I0r.js +0 -2809
  87. package/dist/Marketing-D0vm80e_.js +0 -316
  88. package/dist/MemberList-CrnipE9y.js +0 -1733
  89. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Ijc2OYh9.js +0 -1753
  90. package/dist/Segment-ZWsp48aC.js +0 -437
  91. package/dist/Store-B_G6Dhmq.js +0 -1511
  92. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CaxUr9zl.js +0 -890
  93. package/dist/index-8MaN7rez.js +0 -762
  94. package/dist/index-BjdHxGDn.js +0 -298
  95. package/dist/index-CuvNtC_M.js +0 -61
  96. package/dist/index-RP0XOPRL.js +0 -29193
  97. package/dist/money-BTejgvKu.js +0 -15
  98. package/dist/number-Cen5TucC.js +0 -12
  99. package/dist/user-Bm4KttFq.js +0 -37
@@ -0,0 +1,419 @@
1
+ import { defineComponent as A, ref as w, resolveComponent as c, openBlock as d, createBlock as F, withCtx as f, renderSlot as q, createVNode as m, createTextVNode as S, toDisplayString as I, createElementVNode as n, computed as N, createElementBlock as h, Fragment as U, renderList as z, unref as e, normalizeClass as J, createCommentVNode as P, resolveDynamicComponent as H } from "vue";
2
+ import { c as X } from "./index-pHbs1GrF.js";
3
+ import { e as K, F as Q } from "./index-S6sFiBxK.js";
4
+ import { C as W } from "./membership-C9089j0H.js";
5
+ import { Z as g } from "./zod-Bg2FbC-D.js";
6
+ import { _ as Y } from "./SelectItems.vue_vue_type_script_setup_true_lang-BgMuKAjE.js";
7
+ import { u as ee } from "./business-C0e_E2xp.js";
8
+ import { useCoreStore as te } from "@feedmepos/mf-common";
9
+ import { _ as le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-FXQNhMrv.js";
10
+ import { _ as oe } from "./ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js";
11
+ import { b as ae, a as ne } from "./EffectSheet.vue_vue_type_style_index_0_lang-CQV77_cx.js";
12
+ import { _ as se } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DxGIUrmO.js";
13
+ import { u as me } from "./vue-i18n-yYO72Mbp.js";
14
+ import { i as re } from "./helper-CuF45pbY.js";
15
+ const ue = { class: "flex justify-end gap-8 w-full" }, ie = /* @__PURE__ */ A({
16
+ __name: "MenuSheet",
17
+ props: {
18
+ modelValue: {},
19
+ filterItems: { type: Function }
20
+ },
21
+ emits: ["confirm"],
22
+ setup(a, { emit: T }) {
23
+ const O = w(), s = w(!1);
24
+ function l() {
25
+ var u;
26
+ (u = O.value) == null || u.onConfirm();
27
+ }
28
+ const y = T;
29
+ return (u, x) => {
30
+ const o = c("FmField"), v = c("FmButton"), R = c("FmSideSheet");
31
+ return d(), F(R, {
32
+ modelValue: s.value,
33
+ "onUpdate:modelValue": x[1] || (x[1] = (b) => s.value = b),
34
+ title: "Select Items",
35
+ "close-button": !1,
36
+ "dismiss-away": !0,
37
+ "max-width": 560
38
+ }, {
39
+ "side-sheet-button": f(() => [
40
+ q(u.$slots, "side-sheet-button", {}, () => [
41
+ m(o, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
42
+ default: f(() => [
43
+ S(I(u.modelValue.length) + " item(s) selected ", 1)
44
+ ]),
45
+ _: 1
46
+ })
47
+ ])
48
+ ]),
49
+ "side-sheet-footer": f(() => [
50
+ n("div", ue, [
51
+ m(v, {
52
+ variant: "tertiary",
53
+ onClick: x[0] || (x[0] = (b) => s.value = !1),
54
+ label: "Cancel"
55
+ }),
56
+ m(v, {
57
+ variant: "primary",
58
+ onClick: l,
59
+ label: "Confirm"
60
+ })
61
+ ])
62
+ ]),
63
+ default: f(() => [
64
+ m(Y, {
65
+ class: "h-full",
66
+ "max-height": 0,
67
+ ref_key: "selectItemRef",
68
+ ref: O,
69
+ "initial-value": u.modelValue,
70
+ "filter-items": u.filterItems,
71
+ "on-complete": (b) => {
72
+ y("confirm", b), s.value = !1;
73
+ }
74
+ }, null, 8, ["initial-value", "filter-items", "on-complete"])
75
+ ]),
76
+ _: 3
77
+ }, 8, ["modelValue"]);
78
+ };
79
+ }
80
+ }), de = { class: "space-y-24" }, pe = { class: "grid grid-cols-2 gap-16" }, ce = { class: "fm-typo-en-title-sm-800" }, fe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ye = { class: "space-y-16" }, ve = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, be = {
81
+ key: 0,
82
+ class: "xs:!block flex gap-16 items-center pt-8"
83
+ }, ge = { class: "fm-typo-en-body-lg-400" }, xe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ve = {
84
+ key: 0,
85
+ class: "pt-8 space-y-8"
86
+ }, Fe = { class: "flex items-center gap-16 xs:block xs:space-y-8 w-fit" }, Ce = { class: "xs:!block flex gap-16 items-center" }, _e = /* @__PURE__ */ A({
87
+ __name: "EarningOptionInput",
88
+ props: {
89
+ modelValue: {
90
+ type: Object
91
+ },
92
+ extras: {
93
+ type: Object
94
+ },
95
+ fixedType: {
96
+ type: Boolean
97
+ },
98
+ errorText: {
99
+ type: String
100
+ }
101
+ },
102
+ emits: ["update:model-value"],
103
+ setup(a, { emit: T }) {
104
+ var R, b, k;
105
+ const O = ee(), s = a, l = T, y = [
106
+ {
107
+ label: "Based on spending",
108
+ sublabel: "Customers earn rewards based on how much they spend.",
109
+ value: "PROPORTIONAL"
110
+ },
111
+ {
112
+ label: "Fixed amount",
113
+ sublabel: "Customers earn a set amount of rewards for specific actions.",
114
+ value: "FIXED"
115
+ }
116
+ ].filter((p) => {
117
+ var t, C;
118
+ return s.fixedType || ((C = (t = s.extras) == null ? void 0 : t.campaign) == null ? void 0 : C.event.type) != "BILL_COMPLETED" ? p.value == "FIXED" : !0;
119
+ }), u = N(() => {
120
+ var t, C;
121
+ const p = s.extras && "configs" in s.extras ? s.extras.configs.type : (t = s.extras) == null ? void 0 : t.campaign.type;
122
+ return (((C = W[p]) == null ? void 0 : C.name) || "reward").toLowerCase();
123
+ }), x = N(() => {
124
+ const p = K.safeParse(s.modelValue);
125
+ return p.success ? [] : p.error.errors;
126
+ });
127
+ function o(p) {
128
+ var t;
129
+ p != ((t = s.modelValue) == null ? void 0 : t.type) && l(
130
+ "update:model-value",
131
+ p === "FIXED" ? {
132
+ type: "FIXED",
133
+ amount: 1
134
+ } : {
135
+ type: "PROPORTIONAL",
136
+ amount: 1,
137
+ every: 1
138
+ }
139
+ );
140
+ }
141
+ const v = w(
142
+ ((R = s.modelValue) == null ? void 0 : R.type) === "PROPORTIONAL" && !!((k = (b = s.modelValue) == null ? void 0 : b.property) != null && k.length) || !1
143
+ );
144
+ return (p, t) => {
145
+ var B, _, D;
146
+ const C = c("FmCard"), $ = c("FmStepperField"), L = c("FmRadio"), j = c("FmPill"), G = c("FmButton"), M = c("FmRadioGroup"), Z = c("FmHelperText");
147
+ return d(), h("div", de, [
148
+ n("div", pe, [
149
+ (d(!0), h(U, null, z(e(y), (r) => {
150
+ var V, i;
151
+ return d(), F(C, {
152
+ variant: "outlined",
153
+ class: J(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
154
+ "col-span-2": e(y).length == 1,
155
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((V = a.modelValue) == null ? void 0 : V.type) === r.value,
156
+ "hover:bg-fm-color-opacity-sm": ((i = a.modelValue) == null ? void 0 : i.type) != r.value
157
+ }]),
158
+ onClick: (E) => o(r.value),
159
+ key: r.value
160
+ }, {
161
+ default: f(() => [
162
+ n("div", ce, I(r.label), 1),
163
+ n("div", fe, I(r.sublabel), 1)
164
+ ]),
165
+ _: 2
166
+ }, 1032, ["class", "onClick"]);
167
+ }), 128))
168
+ ]),
169
+ n("div", ye, [
170
+ ((B = a.modelValue) == null ? void 0 : B.type) === "FIXED" ? (d(), F($, {
171
+ key: 0,
172
+ label: `Receive ${e(u)}(s)`,
173
+ class: "flex-1",
174
+ "model-value": ((_ = a.modelValue) == null ? void 0 : _.amount) ?? null,
175
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => l("update:model-value", {
176
+ ...a.modelValue ?? { type: "FIXED" },
177
+ amount: r
178
+ }))
179
+ }, null, 8, ["label", "model-value"])) : ((D = a.modelValue) == null ? void 0 : D.type) === "PROPORTIONAL" ? (d(), h(U, { key: 1 }, [
180
+ t[11] || (t[11] = n("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1)),
181
+ m(M, {
182
+ "model-value": e(v),
183
+ "onUpdate:modelValue": t[6] || (t[6] = (r) => {
184
+ e(v) != r && (l("update:model-value", {
185
+ ...a.modelValue ?? {
186
+ type: "PROPORTIONAL",
187
+ amount: 1,
188
+ every: 1
189
+ },
190
+ property: r ? [] : void 0,
191
+ every: 1
192
+ }), v.value = r);
193
+ })
194
+ }, {
195
+ default: f(() => [
196
+ m(L, {
197
+ label: "Amount spent",
198
+ sublabel: `Receive ${e(u)} by amount spent`,
199
+ value: !1
200
+ }, {
201
+ label: f(() => {
202
+ var r, V;
203
+ return [
204
+ t[8] || (t[8] = n("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1)),
205
+ n("div", ve, " Receive " + I(e(u)) + " by amount spent ", 1),
206
+ e(v) ? P("", !0) : (d(), h("div", be, [
207
+ m($, {
208
+ label: `Receive ${e(u)}(s)`,
209
+ inputmode: "decimal",
210
+ class: "flex-1",
211
+ "model-value": ((r = a.modelValue) == null ? void 0 : r.amount) ?? null,
212
+ "onUpdate:modelValue": t[1] || (t[1] = (i) => l("update:model-value", {
213
+ ...a.modelValue ?? { type: "FIXED" },
214
+ amount: i
215
+ }))
216
+ }, null, 8, ["label", "model-value"]),
217
+ t[7] || (t[7] = n("div", { class: "xs:py-4 text-center" }, "for every", -1)),
218
+ m($, {
219
+ label: `Amount spend (${e(X.Config).getCountry().currency.symbol})`,
220
+ class: "flex-1",
221
+ inputmode: "decimal",
222
+ "model-value": ((V = a.modelValue) == null ? void 0 : V.every) ?? null,
223
+ "onUpdate:modelValue": t[2] || (t[2] = (i) => l("update:model-value", {
224
+ ...a.modelValue,
225
+ every: i
226
+ }))
227
+ }, {
228
+ prepend: f(() => [
229
+ S(I(e(X.Config).getCountry().currency.symbol), 1)
230
+ ]),
231
+ _: 1
232
+ }, 8, ["label", "model-value"])
233
+ ]))
234
+ ];
235
+ }),
236
+ _: 1
237
+ }, 8, ["sublabel"]),
238
+ m(L, {
239
+ label: "Product bought",
240
+ sublabel: `Receive ${e(u)} by product bought`,
241
+ value: !0,
242
+ disabled: !e(O).isPremium
243
+ }, {
244
+ label: f(() => {
245
+ var r, V;
246
+ return [
247
+ n("div", ge, [
248
+ t[9] || (t[9] = S(" Product bought ")),
249
+ m(j, { variant: "premium" })
250
+ ]),
251
+ n("div", xe, " Receive " + I(e(u)) + " by product bought ", 1),
252
+ e(v) ? (d(), h("div", Ve, [
253
+ n("div", Fe, [
254
+ m(ie, {
255
+ "model-value": s.modelValue.property || [],
256
+ onConfirm: t[3] || (t[3] = (i) => l("update:model-value", {
257
+ ...a.modelValue,
258
+ property: i
259
+ }))
260
+ }, {
261
+ "side-sheet-button": f(() => {
262
+ var i, E;
263
+ return [
264
+ m(G, {
265
+ label: (i = s.modelValue.property) != null && i.length ? `${(E = s.modelValue.property) == null ? void 0 : E.length} product(s) selected` : "Select product",
266
+ icon: "link",
267
+ variant: "secondary"
268
+ }, null, 8, ["label"])
269
+ ];
270
+ }),
271
+ _: 1
272
+ }, 8, ["model-value"])
273
+ ]),
274
+ n("div", Ce, [
275
+ m($, {
276
+ inputmode: "decimal",
277
+ label: `Receive ${e(u)}(s)`,
278
+ class: "flex-1",
279
+ "model-value": ((r = a.modelValue) == null ? void 0 : r.amount) ?? null,
280
+ "onUpdate:modelValue": t[4] || (t[4] = (i) => l("update:model-value", {
281
+ ...a.modelValue ?? { type: "FIXED" },
282
+ amount: i
283
+ }))
284
+ }, null, 8, ["label", "model-value"]),
285
+ t[10] || (t[10] = n("div", { class: "xs:py-4 text-center" }, "for every", -1)),
286
+ m($, {
287
+ label: "Item purchased",
288
+ class: "flex-1",
289
+ "model-value": ((V = a.modelValue) == null ? void 0 : V.every) ?? null,
290
+ inputmode: "numeric",
291
+ "max-fraction-digits": 0,
292
+ "onUpdate:modelValue": t[5] || (t[5] = (i) => l("update:model-value", {
293
+ ...a.modelValue,
294
+ every: i
295
+ }))
296
+ }, null, 8, ["model-value"])
297
+ ])
298
+ ])) : P("", !0)
299
+ ];
300
+ }),
301
+ _: 1
302
+ }, 8, ["sublabel", "disabled"])
303
+ ]),
304
+ _: 1
305
+ }, 8, ["model-value"])
306
+ ], 64)) : P("", !0)
307
+ ]),
308
+ a.errorText || e(x).length > 0 ? (d(), F(Z, {
309
+ key: 0,
310
+ class: "!mt-4",
311
+ text: a.errorText || e(g).helperText(e(x), ""),
312
+ state: "error"
313
+ }, null, 8, ["text"])) : P("", !0)
314
+ ]);
315
+ };
316
+ }
317
+ }), Ie = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, De = /* @__PURE__ */ A({
318
+ __name: "VoucherEditor",
319
+ props: {
320
+ modelValue: {
321
+ type: Object
322
+ },
323
+ rewardImage: {
324
+ type: Object
325
+ }
326
+ },
327
+ emits: ["update:model-value", "update:reward-image"],
328
+ setup(a, { emit: T }) {
329
+ const { t: O } = me(), l = w(
330
+ a.modelValue ?? re("VOUCHER", {
331
+ business: te().currentBusiness.value._id,
332
+ name: ""
333
+ })
334
+ ), y = Q, u = T;
335
+ return (x, o) => {
336
+ var b, k, p;
337
+ const v = c("FmTextarea"), R = c("FmHelperText");
338
+ return d(), h(U, null, [
339
+ m(le, {
340
+ modelValue: e(l).name,
341
+ "onUpdate:modelValue": o[0] || (o[0] = (t) => e(l).name = t),
342
+ label: "Voucher name",
343
+ schema: e(g).typeAtPath(e(y), "name", [e(l).type])
344
+ }, null, 8, ["modelValue", "schema"]),
345
+ m(v, {
346
+ class: "!mb-[-16px]",
347
+ modelValue: e(l).description,
348
+ "onUpdate:modelValue": o[1] || (o[1] = (t) => e(l).description = t),
349
+ rules: [e(g).ruleAtPath(e(y), "description", [e(l).type])]
350
+ }, {
351
+ label: f(() => [
352
+ (d(), F(H(
353
+ e(g).toInputLabel(
354
+ e(g).typeAtPath(e(y), "description", [e(l).type]),
355
+ "Voucher description"
356
+ )
357
+ )))
358
+ ]),
359
+ _: 1
360
+ }, 8, ["modelValue", "rules"]),
361
+ n("div", Ie, [
362
+ o[6] || (o[6] = n("div", null, "Voucher description should not exceed 200 characters.", -1)),
363
+ n("div", null, I(((b = e(l).description) == null ? void 0 : b.length) ?? 0) + "/200", 1)
364
+ ]),
365
+ m(oe, {
366
+ class: "w-1/2 xs:w-2/3",
367
+ "aspect-ratio": "16/9",
368
+ file: a.rewardImage ?? void 0,
369
+ thumbnail: e(l).image ?? void 0,
370
+ "onUpdate:file": o[2] || (o[2] = async (t) => {
371
+ u("update:reward-image", t), t || (e(l).image = null);
372
+ })
373
+ }, {
374
+ label: f(() => [
375
+ (d(), F(H(
376
+ e(g).toInputLabel(
377
+ e(g).typeAtPath(e(y), "image", [e(l).type]),
378
+ "Voucher image"
379
+ )
380
+ )))
381
+ ]),
382
+ _: 1
383
+ }, 8, ["file", "thumbnail"]),
384
+ o[7] || (o[7] = n("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1)),
385
+ m(ae, {
386
+ "model-value": e(l).extras.effect,
387
+ "onUpdate:modelValue": o[3] || (o[3] = (t) => e(l).extras.effect = t)
388
+ }, null, 8, ["model-value"]),
389
+ e(l).extras.effect == null ? (d(), F(R, {
390
+ key: 0,
391
+ class: "!mt-8",
392
+ text: e(O)("connect.campaign.common.effect_required"),
393
+ state: "error"
394
+ }, null, 8, ["text"])) : P("", !0),
395
+ o[8] || (o[8] = n("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1)),
396
+ m(ne, {
397
+ "model-value": e(l).options,
398
+ "no-campaign": e(l).noCampaign,
399
+ "onUpdate:modelValue": o[4] || (o[4] = (t) => e(l).options = t),
400
+ schema: e(g).typeAtPath(e(y), "options", ["VOUCHER"])
401
+ }, null, 8, ["model-value", "no-campaign", "schema"]),
402
+ o[9] || (o[9] = n("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1)),
403
+ e(l).type === "VOUCHER" ? (d(), F(se, {
404
+ key: 1,
405
+ "model-value": ((p = (k = e(l).extras) == null ? void 0 : k.targetLocation) == null ? void 0 : p.map(String)) ?? null,
406
+ type: "select",
407
+ "onUpdate:modelValue": o[5] || (o[5] = (t) => {
408
+ e(l).extras.targetLocation = t;
409
+ }),
410
+ rules: [e(g).ruleAtPath(e(y), "extras.targetLocation")]
411
+ }, null, 8, ["model-value", "rules"])) : P("", !0)
412
+ ], 64);
413
+ };
414
+ }
415
+ });
416
+ export {
417
+ _e as _,
418
+ De as a
419
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as f, useAttrs as y, resolveComponent as b, openBlock as l, createBlock as v, mergeProps as x, unref as t, createSlots as g, withCtx as h, createElementVNode as a, toDisplayString as n, renderSlot as k, createElementBlock as F, createCommentVNode as S } from "vue";
2
2
  import { Z as d } from "./zod-Bg2FbC-D.js";
3
- import { u as V } from "./vue-i18n-CNH_IhVd.js";
3
+ import { u as V } from "./vue-i18n-yYO72Mbp.js";
4
4
  const B = { class: "fm-typo-en-body-lg-400 flex gap-4 text-fm-color-typo-primary items-center" }, C = {
5
5
  key: 0,
6
6
  class: "text-fm-color-typo-tertiary"