@feedmepos/mf-connect 0.1.70-prod → 0.1.72-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 (93) hide show
  1. package/dist/{Analytic-PyqBxIYV.js → Analytic-CxQKbOnR.js} +163 -163
  2. package/dist/{App-Jvndjs57.js → App-C0HCgYW2.js} +7 -7
  3. package/dist/{Bin-COT0Y0Ho.js → Bin-BFx6j8vs.js} +8 -8
  4. package/dist/{Broadcast-BEXF2mv2.js → Broadcast-CUfwWq6_.js} +8 -8
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D_2YsnqM.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-2oosZTlv.js} +6 -6
  6. package/dist/{Card-B_PJslck.js → Card-DsMVa01V.js} +16 -16
  7. package/dist/{Collections-BNXcAI8E.js → Collections-DSbNXU78.js} +72 -71
  8. package/dist/{Credit-CbefgVBA.js → Credit-Dp-tSMfE.js} +8 -8
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BWrvk8cN.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BW7V_Nsq.js} +817 -794
  10. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D7QHcodO.js +348 -0
  11. package/dist/{Experience-D4PlCeQu.js → Experience-DkQbI88m.js} +8 -8
  12. package/dist/{Game-ByPV3v3c.js → Game-BJvtVGC7.js} +9 -9
  13. package/dist/{Index-CTE6GcPE.js → Index-BcHe2Qqe.js} +10 -10
  14. package/dist/{Marketing-CBarYi4e.js → Marketing-BaYjdZpb.js} +6 -6
  15. package/dist/{Member-aiHpHoBw.js → Member-BzrcLN4X.js} +10 -10
  16. package/dist/{MemberList-ZfDDJKU8.js → MemberList-_uD6WR--.js} +25 -25
  17. package/dist/{MemberTransactions-YPSNz6QZ.js → MemberTransactions-DIG5noli.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DyJKk8W7.js → MessageInput.vue_vue_type_script_setup_true_lang-Cm4jVJBM.js} +7 -7
  19. package/dist/{Mission-CX9m_lVc.js → Mission-B0h7ECrd.js} +9 -9
  20. package/dist/{Overview-93wWO0vg.js → Overview-BfjTYcaf.js} +18 -18
  21. package/dist/{Point-CvBoOpox.js → Point-yBqZgf08.js} +8 -8
  22. package/dist/{Promotion-DzABoX1Q.js → Promotion-Bh8yiwPe.js} +9 -9
  23. package/dist/{Queue-CLsAkssT.js → Queue-CMMyxmWP.js} +10 -10
  24. package/dist/{Record-D7H9PUO9.js → Record-DSLpbGVk.js} +8 -8
  25. package/dist/{Reward-RuXRWNEz.js → Reward-BzAIdcgx.js} +15 -15
  26. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BhooU8k4.js → RewardGroup.vue_vue_type_script_setup_true_lang-DoGsPRbi.js} +11 -11
  27. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CX4uEjpm.js → RuleGroup.vue_vue_type_script_setup_true_lang-B7qMLC2M.js} +595 -591
  28. package/dist/{Segment-DttKqwI6.js → Segment-BVH3YC8I.js} +22 -22
  29. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Bc52DzKg.js → SelectItems.vue_vue_type_script_setup_true_lang-BkHWRVba.js} +2 -2
  30. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cs31sJoR.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D-4QjkWh.js} +11 -11
  31. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DVDJSZ2m.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CzCSXHge.js} +3 -3
  32. package/dist/{Setting-B-OauIYc.js → Setting-CFLtqHFJ.js} +12 -12
  33. package/dist/{SettingAdvertisements-DgeX4O4l.js → SettingAdvertisements-CvFG5Fun.js} +11 -11
  34. package/dist/{Store-DXolnTox.js → Store-CHcszdPx.js} +19 -19
  35. package/dist/{StoreRewards-AZL1ZRuo.js → StoreRewards-BXrXO3Cg.js} +13 -13
  36. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-EdoXx3OE.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Clou5scZ.js} +19 -19
  37. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-mHmnkhIP.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BEpXudTV.js} +1 -1
  38. package/dist/{Tier-C95me-Y-.js → Tier-98o6YCz1.js} +19 -19
  39. package/dist/{Title-Cl3aYevK.js → Title-BmvCMh9F.js} +18 -18
  40. package/dist/{Transaction-DQXVmId0.js → Transaction-D07dnpCB.js} +2 -2
  41. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D8Kfo_M8.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DHvItthe.js} +6 -6
  42. package/dist/{Voucher-C-P0YBPO.js → Voucher-BX5Dy6oL.js} +12 -12
  43. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BlXCP_IR.js +421 -0
  44. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXArW7Vz.js → ZodTextField.vue_vue_type_script_setup_true_lang-TkZAyKkk.js} +1 -1
  45. package/dist/{app-B6euOjfV.js → app-7Ivt_7kS.js} +1974 -914
  46. package/dist/{app-7__6-fNI.js → app-C98aAmiY.js} +1 -1
  47. package/dist/app.js +1 -1
  48. package/dist/{business-qci70l-A.js → business-B55rTB5S.js} +1 -1
  49. package/dist/{campaign-FPNFOCIx.js → campaign-RS-eYMBW.js} +1 -1
  50. package/dist/campaign-dSphYCws.js +226 -0
  51. package/dist/{campaign.enum-BshKRCYQ.js → campaign.enum-BZRXf9TI.js} +1 -1
  52. package/dist/{campaign.fn-B5brKxfK.js → campaign.fn-D_b763b6.js} +73 -73
  53. package/dist/{collectible.enum-BYIdgjMd.js → collectible.enum-ANnJMtnj.js} +1 -1
  54. package/dist/{collection.fn-Czegj-3i.js → collection.fn-BObHG1bS.js} +2 -2
  55. package/dist/{dto-CoTw6KOu.js → dto-BA2PX6Mi.js} +4 -4
  56. package/dist/{effect-AUk5fAKr.js → effect-DDAGMMzr.js} +1 -1
  57. package/dist/{email-addresses-CzoIsTNA.js → email-addresses-jx17hvtN.js} +1 -1
  58. package/dist/{export-a4tq7KAV.js → export-DI_2PZhY.js} +3 -3
  59. package/dist/{helper-BPAmOP7l.js → helper-ApDLcgT1.js} +1 -1
  60. package/dist/{index-DFrGNKGq.js → index-B5J1HBw3.js} +1 -1
  61. package/dist/{index-DyNcdfkp.js → index-BCOxYH7r.js} +1 -1
  62. package/dist/{index-CPHYlicy.js → index-BbNMr2Lt.js} +3 -3
  63. package/dist/{index-DROE-IrQ.js → index-C1tcqVNm.js} +3 -3
  64. package/dist/{index-BqKYZ98Q.js → index-CEeIezsZ.js} +1 -1
  65. package/dist/{index-CGryjlaX.js → index-CN0ree8J.js} +1 -1
  66. package/dist/{index-CQ4_BfJL.js → index-Cl85lvDM.js} +1 -1
  67. package/dist/{index-ZC8SINKX.js → index-CtpRdZKH.js} +2 -2
  68. package/dist/{index-BioBPRnA.js → index-DUfWM7U3.js} +1023 -1023
  69. package/dist/{index-DD6t-ukB.js → index-D_9bRGRa.js} +1 -1
  70. package/dist/{index-DdTu5PZ4.js → index-Dg6gbVXO.js} +1 -1
  71. package/dist/{index-BicoBDJX.js → index-Dpe36Jv6.js} +4 -4
  72. package/dist/{index-CKd9UEIG.js → index-DtB1XLw6.js} +183 -178
  73. package/dist/{index.esm2017-DBUyLYkl.js → index.esm2017-CcAT1nnu.js} +1 -1
  74. package/dist/{loading-E0yVUdfI.js → loading-Hh5FSOP9.js} +1 -1
  75. package/dist/{membership-yP4z8gbJ.js → membership-DXQf9Mj3.js} +3 -3
  76. package/dist/{money-DhnXYNa2.js → money-OBHKTSCa.js} +1 -1
  77. package/dist/{number-XYUCGxPv.js → number-DTqujv4j.js} +1 -1
  78. package/dist/{objectid-BfQ_M2eI.js → objectid-BkZDKSpn.js} +1 -1
  79. package/dist/{campaign-D_eIup7X.js → plugins-CQqQawn6.js} +784 -776
  80. package/dist/{reward-B3J0dhNd.js → reward-n9uPwsH1.js} +1 -1
  81. package/dist/{rule-BzqUqJYa.js → rule-BgsibUNE.js} +3 -3
  82. package/dist/{rule-builder-BvtsmkMr.js → rule-builder-BkzqGukH.js} +1 -1
  83. package/dist/template-gXT-yGOY.js +188 -0
  84. package/dist/{timezone-BCyUSe2a.js → timezone-X-iXAUqa.js} +1 -1
  85. package/dist/{trigger-DCSJm_qA.js → trigger-DEZuV7Fw.js} +4 -4
  86. package/dist/{user-BwjCcgQT.js → user-DG_FfcGk.js} +1 -1
  87. package/dist/{vue-i18n-BLkfzQts.js → vue-i18n-BB1YkgAs.js} +201 -201
  88. package/dist/{xlsx-D2Uw1Ytp.js → xlsx-CJQa9ako.js} +1 -1
  89. package/package.json +1 -1
  90. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BVdF1Urm.js +0 -348
  91. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DRn1HmAb.js +0 -419
  92. package/dist/plugins-bpWCIR9y.js +0 -208
  93. package/dist/template-BFr8iIV_.js +0 -190
@@ -1,419 +0,0 @@
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-DROE-IrQ.js";
3
- import { e as K, F as Q } from "./index-ZC8SINKX.js";
4
- import { C as W } from "./membership-yP4z8gbJ.js";
5
- import { Z as g } from "./zod-Bg2FbC-D.js";
6
- import { _ as Y } from "./SelectItems.vue_vue_type_script_setup_true_lang-Bc52DzKg.js";
7
- import { u as ee } from "./business-qci70l-A.js";
8
- import { useCoreStore as te } from "@feedmepos/mf-common";
9
- import { _ as le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DXArW7Vz.js";
10
- import { _ as oe } from "./ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js";
11
- import { _ as ae, a as ne } from "./EffectSheet.vue_vue_type_style_index_0_lang-BVdF1Urm.js";
12
- import { _ as se } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-mHmnkhIP.js";
13
- import { u as me } from "./vue-i18n-BLkfzQts.js";
14
- import { i as re } from "./helper-BPAmOP7l.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(o, { emit: T }) {
23
- const O = w(), s = w(!1);
24
- function l() {
25
- var i;
26
- (i = O.value) == null || i.onConfirm();
27
- }
28
- const y = T;
29
- return (i, x) => {
30
- const a = 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(i.$slots, "side-sheet-button", {}, () => [
41
- m(a, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
42
- default: f(() => [
43
- S(I(o.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": o.modelValue,
70
- "filter-items": o.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" }, De = /* @__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(o, { emit: T }) {
104
- var R, b, k;
105
- const O = ee(), s = o, 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
- }), i = 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 a(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, u;
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 = o.modelValue) == null ? void 0 : V.type) === r.value,
156
- "hover:bg-fm-color-opacity-sm": ((u = o.modelValue) == null ? void 0 : u.type) != r.value
157
- }]),
158
- onClick: (E) => a(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 = o.modelValue) == null ? void 0 : B.type) === "FIXED" ? (d(), F($, {
171
- key: 0,
172
- label: `Receive ${e(i)}(s)`,
173
- class: "flex-1",
174
- "model-value": ((D = o.modelValue) == null ? void 0 : D.amount) ?? null,
175
- "onUpdate:modelValue": t[0] || (t[0] = (r) => l("update:model-value", {
176
- ...o.modelValue ?? { type: "FIXED" },
177
- amount: r
178
- }))
179
- }, null, 8, ["label", "model-value"])) : ((_ = o.modelValue) == null ? void 0 : _.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
- ...o.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(i)} 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(i)) + " by amount spent ", 1),
206
- e(v) ? P("", !0) : (d(), h("div", be, [
207
- m($, {
208
- label: `Receive ${e(i)}(s)`,
209
- inputmode: "decimal",
210
- class: "flex-1",
211
- "model-value": ((r = o.modelValue) == null ? void 0 : r.amount) ?? null,
212
- "onUpdate:modelValue": t[1] || (t[1] = (u) => l("update:model-value", {
213
- ...o.modelValue ?? { type: "FIXED" },
214
- amount: u
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 = o.modelValue) == null ? void 0 : V.every) ?? null,
223
- "onUpdate:modelValue": t[2] || (t[2] = (u) => l("update:model-value", {
224
- ...o.modelValue,
225
- every: u
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(i)} 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 ", -1)),
249
- m(j, { variant: "premium" })
250
- ]),
251
- n("div", xe, " Receive " + I(e(i)) + " 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] = (u) => l("update:model-value", {
257
- ...o.modelValue,
258
- property: u
259
- }))
260
- }, {
261
- "side-sheet-button": f(() => {
262
- var u, E;
263
- return [
264
- m(G, {
265
- label: (u = s.modelValue.property) != null && u.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(i)}(s)`,
278
- class: "flex-1",
279
- "model-value": ((r = o.modelValue) == null ? void 0 : r.amount) ?? null,
280
- "onUpdate:modelValue": t[4] || (t[4] = (u) => l("update:model-value", {
281
- ...o.modelValue ?? { type: "FIXED" },
282
- amount: u
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 = o.modelValue) == null ? void 0 : V.every) ?? null,
290
- inputmode: "numeric",
291
- "max-fraction-digits": 0,
292
- "onUpdate:modelValue": t[5] || (t[5] = (u) => l("update:model-value", {
293
- ...o.modelValue,
294
- every: u
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
- o.errorText || e(x).length > 0 ? (d(), F(Z, {
309
- key: 0,
310
- class: "!mt-4",
311
- text: o.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" }, _e = /* @__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(o, { emit: T }) {
329
- const { t: O } = me(), l = w(
330
- o.modelValue ?? re("VOUCHER", {
331
- business: te().currentBusiness.value._id,
332
- name: ""
333
- })
334
- ), y = Q, i = T;
335
- return (x, a) => {
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": a[0] || (a[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": a[1] || (a[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
- a[6] || (a[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: o.rewardImage ?? void 0,
369
- thumbnail: e(l).image ?? void 0,
370
- "onUpdate:file": a[2] || (a[2] = async (t) => {
371
- i("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
- a[7] || (a[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": a[3] || (a[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
- a[8] || (a[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": a[4] || (a[4] = (t) => e(l).options = t),
400
- schema: e(g).typeAtPath(e(y), "options", ["VOUCHER"])
401
- }, null, 8, ["model-value", "no-campaign", "schema"]),
402
- a[9] || (a[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": a[5] || (a[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
- De as _,
418
- _e as a
419
- };
@@ -1,208 +0,0 @@
1
- import { u as $, v as C, x as P, w as A, y as S } from "./index.esm2017-DBUyLYkl.js";
2
- import { u as w } from "./app-wDQR6dpb.js";
3
- import { S as o } from "./index-DROE-IrQ.js";
4
- function L(e, n) {
5
- let t = "", r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
6
- const s = r.length;
7
- for (let a = 0; a < e; a++)
8
- t += r.charAt(Math.floor(Math.random() * s));
9
- return t;
10
- }
11
- const O = {
12
- alphabetOnly(e) {
13
- return e.replace(/[^a-zA-Z]/g, "");
14
- },
15
- alphaNumeric(e) {
16
- return e.replace(/[^a-zA-Z0-9]/g, "");
17
- },
18
- numericOnly(e) {
19
- return e.replace(/[^0-9]/g, "");
20
- },
21
- singularOrPlural(e, n, t) {
22
- const r = e > 1 ? t || `${n}s` : n;
23
- return `${e} ${r}`;
24
- }
25
- }, V = {
26
- title: (e) => e.replace(
27
- /\b\w+/g,
28
- (n) => n.charAt(0).toUpperCase() + n.substring(1).toLowerCase()
29
- )
30
- };
31
- var i = [];
32
- for (var v = 0; v < 256; ++v)
33
- i.push((v + 256).toString(16).slice(1));
34
- function k(e, n = 0) {
35
- return (i[e[n + 0]] + i[e[n + 1]] + i[e[n + 2]] + i[e[n + 3]] + "-" + i[e[n + 4]] + i[e[n + 5]] + "-" + i[e[n + 6]] + i[e[n + 7]] + "-" + i[e[n + 8]] + i[e[n + 9]] + "-" + i[e[n + 10]] + i[e[n + 11]] + i[e[n + 12]] + i[e[n + 13]] + i[e[n + 14]] + i[e[n + 15]]).toLowerCase();
36
- }
37
- var h, R = new Uint8Array(16);
38
- function _() {
39
- if (!h && (h = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !h))
40
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
41
- return h(R);
42
- }
43
- var b, p, x = 0, y = 0;
44
- function E(e, n, t) {
45
- var r = n && t || 0, s = n || new Array(16);
46
- e = e || {};
47
- var a = e.node, c = e.clockseq;
48
- if (e._v6 || (a || (a = b), c == null && (c = p)), a == null || c == null) {
49
- var u = e.random || (e.rng || _)();
50
- a == null && (a = [u[0], u[1], u[2], u[3], u[4], u[5]], !b && !e._v6 && (a[0] |= 1, b = a)), c == null && (c = (u[6] << 8 | u[7]) & 16383, p === void 0 && !e._v6 && (p = c));
51
- }
52
- var l = e.msecs !== void 0 ? e.msecs : Date.now(), d = e.nsecs !== void 0 ? e.nsecs : y + 1, I = l - x + (d - y) / 1e4;
53
- if (I < 0 && e.clockseq === void 0 && (c = c + 1 & 16383), (I < 0 || l > x) && e.nsecs === void 0 && (d = 0), d >= 1e4)
54
- throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
55
- x = l, y = d, p = c, l += 122192928e5;
56
- var m = ((l & 268435455) * 1e4 + d) % 4294967296;
57
- s[r++] = m >>> 24 & 255, s[r++] = m >>> 16 & 255, s[r++] = m >>> 8 & 255, s[r++] = m & 255;
58
- var f = l / 4294967296 * 1e4 & 268435455;
59
- s[r++] = f >>> 8 & 255, s[r++] = f & 255, s[r++] = f >>> 24 & 15 | 16, s[r++] = f >>> 16 & 255, s[r++] = c >>> 8 | 128, s[r++] = c & 255;
60
- for (var g = 0; g < 6; ++g)
61
- s[r + g] = a[g];
62
- return n || k(s);
63
- }
64
- async function j(e, n) {
65
- await new Promise((t) => {
66
- const r = document.createElement("input");
67
- r.value = e, document.body.appendChild(r), r.select(), document.execCommand("copy"), document.body.removeChild(r), t("");
68
- }).then(() => {
69
- var t;
70
- (t = w().snackbar) == null || t.open({
71
- message: (n == null ? void 0 : n.successMessage) || "Copied to clipboard",
72
- type: "success",
73
- dismissable: !0
74
- });
75
- });
76
- }
77
- const T = {
78
- fileExtension(e) {
79
- return (e == null ? void 0 : e.type.replace(/video\/|image\//, "")) || void 0;
80
- },
81
- generateId(e) {
82
- return [E(), this.fileExtension(e)].filter(Boolean).join(".");
83
- },
84
- campaignPath(e) {
85
- return `business/${o.getBusinessId()}/campaigns/${e || this.generateId()}`;
86
- },
87
- coverImagePath() {
88
- return `business/${o.getBusinessId()}/membership/design/image.png`;
89
- },
90
- advertisementPath(e, n) {
91
- return `business/${o.getBusinessId()}/membership/advertisement/${e}.${this.fileExtension(n)}`;
92
- },
93
- designPath(e, n) {
94
- return `business/${o.getBusinessId()}/membership/design/${e}.${this.fileExtension(n)}`;
95
- },
96
- bundleImagePath(e, n) {
97
- return `business/${o.getBusinessId()}/membership/bundles/${e || this.generateId(n)}`;
98
- },
99
- collectibleImagePath(e, n) {
100
- return `business/${o.getBusinessId()}/membership/collectibles/${e || this.generateId(n)}`;
101
- },
102
- tierImagePath(e, n) {
103
- return `business/${o.getBusinessId()}/membership/tiers/${e || this.generateId(n)}`;
104
- },
105
- referralTermAndConditionPath() {
106
- return `business/${o.getBusinessId()}/membership/referral/term_and_condition.pdf`;
107
- },
108
- async update(e, n, t) {
109
- const r = $(void 0, t), s = C(r, e);
110
- return await P(s, n), A(s);
111
- },
112
- async delete(e, n) {
113
- const t = $(void 0, n), r = C(t, e);
114
- await S(r);
115
- }
116
- }, U = {
117
- get dialog() {
118
- return w().dialog;
119
- },
120
- confirm(e, n = "Confirm", t = "Confirm", r = "Cancel") {
121
- return new Promise((s) => {
122
- var a;
123
- (a = this.dialog) == null || a.open({
124
- title: n,
125
- message: e,
126
- closeButton: !0,
127
- overlay: !0,
128
- primaryActions: {
129
- close: !0,
130
- text: t
131
- },
132
- secondaryActions: {
133
- variant: "tertiary",
134
- close: !0,
135
- text: r
136
- }
137
- }).onPrimary(() => {
138
- s(!0);
139
- }).onSecondary(() => {
140
- s(!1);
141
- }).onClose(() => {
142
- s(!1);
143
- });
144
- });
145
- },
146
- remove(e, n = "Remove", t = "Remove", r = "Cancel") {
147
- return new Promise((s) => {
148
- var a;
149
- (a = this.dialog) == null || a.open({
150
- title: n,
151
- message: e,
152
- closeButton: !0,
153
- overlay: !0,
154
- primaryActions: {
155
- close: !0,
156
- variant: "destructive",
157
- text: t
158
- },
159
- secondaryActions: {
160
- variant: "tertiary",
161
- close: !0,
162
- text: r
163
- }
164
- }).onPrimary(() => {
165
- s(!0);
166
- }).onClose(() => {
167
- s(!1);
168
- });
169
- });
170
- }
171
- }, D = {
172
- get snackbar() {
173
- return w().snackbar;
174
- },
175
- success(e, n = 2e3) {
176
- var t;
177
- return (t = this.snackbar) == null ? void 0 : t.open({ message: e, type: "success" }, n);
178
- },
179
- error(e, n = 2e3) {
180
- var t;
181
- return (t = this.snackbar) == null ? void 0 : t.open({ message: e, type: "error" }, n);
182
- },
183
- info(e, n = 2e3, t = !1) {
184
- var r;
185
- return (r = this.snackbar) == null ? void 0 : r.open(
186
- {
187
- message: e,
188
- type: "info",
189
- dismissable: n !== null,
190
- spinner: t
191
- },
192
- n
193
- );
194
- },
195
- close(e) {
196
- var n;
197
- return (n = this.snackbar) == null ? void 0 : n.close(e);
198
- }
199
- };
200
- export {
201
- j as a,
202
- O as b,
203
- V as c,
204
- T as f,
205
- D as n,
206
- U as p,
207
- L as r
208
- };