@feedmepos/mf-connect 0.1.0-beta.17 → 0.1.0-beta.19

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 (87) hide show
  1. package/dist/{Analytic-BvsvVIaJ.js → Analytic-C_VhRLv6.js} +8 -8
  2. package/dist/{App-B6i-kTvi.js → App-BfRWtnHD.js} +6 -6
  3. package/dist/{Broadcast-BMNY7jfz.js → Broadcast-CkP0D5Q0.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cl-VwkQw.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-NtvMAKVf.js} +8 -9
  5. package/dist/{Card-BUxMxMv3.js → Card-B3LUbgFG.js} +16 -16
  6. package/dist/{Collections-fJ4dAA8O.js → Collections-auS6nQgP.js} +4 -4
  7. package/dist/{Credit-DeLJMW7U.js → Credit-DFCzt7yb.js} +8 -8
  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-KB_zk3f0.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BI0BX8t8.js} +27 -28
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Dy2q_1Kh.js → EffectSheet.vue_vue_type_style_index_0_lang-BrjVcauR.js} +6 -6
  11. package/dist/{Experience-DNlf2fYa.js → Experience-CVb3L3Nz.js} +8 -8
  12. package/dist/{Game-BXj3DErV.js → Game-CVtfz6Hq.js} +8 -8
  13. package/dist/{Index-FMFz2f9Z.js → Index-DFcZ4uTO.js} +7 -7
  14. package/dist/{Marketing-C8OjZOr2.js → Marketing-DLF6iuTD.js} +5 -5
  15. package/dist/{Member-BgwbYQrK.js → Member-CYtrF8IE.js} +4 -4
  16. package/dist/{MemberList-DMQUG_Kt.js → MemberList-CrUHnX69.js} +14 -14
  17. package/dist/{MemberTransactions-CQO2cHn6.js → MemberTransactions-DJGj_aav.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Ds_BwKa6.js → MessageInput.vue_vue_type_script_setup_true_lang-BEXdm4kC.js} +2 -2
  19. package/dist/{Mission-rHomcJXG.js → Mission-_LSdgxEz.js} +8 -8
  20. package/dist/Overview-CuIPJALM.js +879 -0
  21. package/dist/{Point-Du07BO13.js → Point-CVMEXAZ5.js} +23 -23
  22. package/dist/{Promotion-B1gbbfk2.js → Promotion-DSfbCLAe.js} +9 -9
  23. package/dist/{Record-0GtBWXRO.js → Record-BNzcMcpH.js} +4 -4
  24. package/dist/Reward-BCN44pw_.js +399 -0
  25. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-By5HgODg.js +151 -0
  26. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-E7ADhGR7.js → RuleGroup.vue_vue_type_script_setup_true_lang-X24tGtbC.js} +15 -15
  27. package/dist/{Segment-Ci4BDnan.js → Segment-MSDomTz2.js} +13 -13
  28. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-I2KT0px7.js → SelectItems.vue_vue_type_script_setup_true_lang-DyeY1fV7.js} +2 -2
  29. package/dist/{Setting-Dc9rLPuI.js → Setting-BOLu10II.js} +8 -8
  30. package/dist/Store-CtJ9sJol.js +1729 -0
  31. package/dist/{StoreRewards-Cho91MDd.js → StoreRewards-B5HCIRFt.js} +12 -12
  32. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-QNn_cpIj.js +957 -0
  33. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BmEP5mI5.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-arVZw_Lq.js} +1 -1
  34. package/dist/{Tier-DO9pTl_C.js → Tier-C3Y6q17j.js} +15 -15
  35. package/dist/{Title-CgQD-_3y.js → Title-_fk7AbId.js} +15 -15
  36. package/dist/{Transaction-DPmvpR7n.js → Transaction-D9CM1V_f.js} +2 -2
  37. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CJa-Tkws.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BIpPKUWx.js} +7 -7
  38. package/dist/{Voucher-Bq5Ev_fv.js → Voucher-Bo5QWYT0.js} +11 -11
  39. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DeQTAvCe.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CjxmRY5U.js} +10 -10
  40. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DLFDd3Y3.js → ZodTextField.vue_vue_type_script_setup_true_lang-BK28WW3q.js} +1 -1
  41. package/dist/{app-BT6qeigc.js → app-C_djUlXx.js} +28 -28
  42. package/dist/{app-CtaeuBcs.js → app-ChpdgMfQ.js} +1 -1
  43. package/dist/app.js +1 -1
  44. package/dist/{business-Db2WFn9o.js → business-DJIj4b8e.js} +1 -1
  45. package/dist/{campaign-Bo2jmBiD.js → campaign-NrE6WI9q.js} +2 -2
  46. package/dist/{collectible.enum-BR9zmyJv.js → collectible.enum-BzLkFq1w.js} +1 -1
  47. package/dist/{collection.fn-Drj_6HD1.js → collection.fn-DQ71Nfut.js} +2 -2
  48. package/dist/{dto-BH8EtK7z.js → dto-12HT7-EA.js} +51 -51
  49. package/dist/{effect-l8oNjQBm.js → effect-CobPZ4Rb.js} +1 -1
  50. package/dist/{email-addresses-CBqWAs9Z.js → email-addresses-DiWLZMlA.js} +1 -1
  51. package/dist/{export-D6S3dr04.js → export-BrJSwHlS.js} +3 -3
  52. package/dist/{helper-CS2Hx33Q.js → helper-CCRX-fvI.js} +1 -1
  53. package/dist/{index-D2d2rTPz.js → index--wa67pRl.js} +1 -1
  54. package/dist/{index-CATw-eQI.js → index-BBkLSHsJ.js} +2 -2
  55. package/dist/{index-C7kr1TMO.js → index-BCyJY05i.js} +135 -229
  56. package/dist/{index-CXEJbUAO.js → index-BS_AxWZH.js} +1 -1
  57. package/dist/{index-Z61r-lWj.js → index-B__nVNTt.js} +1 -1
  58. package/dist/{index-5mZIFDhm.js → index-Bt2_f4Oi.js} +3 -3
  59. package/dist/index-CC2lo_Wb.js +1067 -0
  60. package/dist/{index-XoOcBFvx.js → index-C_KMGXv9.js} +4 -4
  61. package/dist/index-Ct8B2VHH.js +53 -0
  62. package/dist/{index-BsfC7C2D.js → index-DtnUFcfv.js} +1 -1
  63. package/dist/{index-BfhjAqeE.js → index-DwU8LaVM.js} +3 -3
  64. package/dist/{index-Bj5M_at2.js → index-DzJUULpT.js} +7 -1
  65. package/dist/{index-DVryx2wz.js → index-bsRZyOPx.js} +1 -1
  66. package/dist/{index.esm2017-Dg7M2BO7.js → index.esm2017-B_FgkPTh.js} +1 -1
  67. package/dist/{loading-DxWIhKJX.js → loading-fHk0Jjet.js} +4 -4
  68. package/dist/{membership-Df7gtzWJ.js → membership-BW1NS-Ql.js} +3 -3
  69. package/dist/{money-Ck4ZGH4F.js → money-CmeLOjIj.js} +1 -1
  70. package/dist/{number-D8umDJ-5.js → number-D0Hk2ezY.js} +1 -1
  71. package/dist/{objectid-BGnepAUg.js → objectid-hW6Oa6sR.js} +1 -1
  72. package/dist/{reward-5b5G4KYr.js → reward-BRZhngDm.js} +3 -3
  73. package/dist/{rule-BcLntzKp.js → rule-CECp9iUW.js} +3 -3
  74. package/dist/{rule-builder-B_RDlrnZ.js → rule-builder-BQpTUVhb.js} +1 -1
  75. package/dist/{template-C-myFW3k.js → template-CLAh7Qcz.js} +4 -4
  76. package/dist/{trigger-CAK3-5M9.js → trigger-BTbRRpH9.js} +4 -4
  77. package/dist/{vue-i18n-BC0lAbnG.js → vue-i18n-BQqGhLq-.js} +248 -248
  78. package/dist/{xlsx-DNZb1t3l.js → xlsx-BxwhyUvM.js} +1 -1
  79. package/package.json +3 -3
  80. package/dist/Overview-CmwJjXeT.js +0 -864
  81. package/dist/Reward-aH7S8WL3.js +0 -375
  82. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-XdyqSqlC.js +0 -138
  83. package/dist/Store-B94H-jff.js +0 -1531
  84. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CDiZz1AW.js +0 -890
  85. package/dist/index-CVfN0Gmc.js +0 -298
  86. package/dist/index-CmN2dQk5.js +0 -774
  87. package/dist/index-Ct847l9G.js +0 -50
@@ -1,375 +0,0 @@
1
- import { defineComponent as j, ref as g, computed as H, resolveComponent as c, openBlock as f, createBlock as x, unref as t, isRef as X, withCtx as k, createElementVNode as p, createVNode as r, createCommentVNode as S, createElementBlock as P, Fragment as $, h as F, onMounted as J, toDisplayString as D } from "vue";
2
- import { _ as Z } from "./campaign-CpzFl8Vr.js";
3
- import { components as Y } from "@feedmepos/ui-library";
4
- import { p as q, u as z } from "./loading-DxWIhKJX.js";
5
- import { u as N, C as G } from "./membership-Df7gtzWJ.js";
6
- import { u as Q } from "./vue-i18n-BC0lAbnG.js";
7
- import { c as W } from "./object-qECH92oz.js";
8
- import { Z as _ } from "./zod-Bg2FbC-D.js";
9
- import "./index-CATw-eQI.js";
10
- import { a as ee } from "./index-Ct847l9G.js";
11
- import { useCoreStore as te } from "@feedmepos/mf-common";
12
- import "./app-wDQR6dpb.js";
13
- import "./index.esm2017-Dg7M2BO7.js";
14
- import "./index-BfhjAqeE.js";
15
- import { _ as oe, a as ne } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DeQTAvCe.js";
16
- import { _ as le } from "./EffectSheet.vue_vue_type_style_index_0_lang-Dy2q_1Kh.js";
17
- import { J as M } from "./JsonViewer-v8_C7l5N.js";
18
- import { _ as ae } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DLFDd3Y3.js";
19
- import { i as re } from "./helper-CS2Hx33Q.js";
20
- import { u as se, r as I } from "./reward-5b5G4KYr.js";
21
- import { useRouter as ie } from "vue-router";
22
- const de = { class: "flex gap-8 items-center justify-start" }, me = /* @__PURE__ */ j({
23
- __name: "EditRewardSheet",
24
- props: {},
25
- emits: ["update"],
26
- setup(K, { expose: l, emit: U }) {
27
- const u = N(), i = g(!1), n = g({}), b = g(), y = ee, m = H(() => {
28
- const o = y.safeParse(n.value);
29
- return o.success ? [] : o.error.errors;
30
- });
31
- function w(o, e) {
32
- o && (n.value = e), i.value = o;
33
- }
34
- const h = U;
35
- async function v() {
36
- const o = y.safeParse(n.value);
37
- o.success && (console.log("res", o), h("update", o.data));
38
- }
39
- function L(o) {
40
- o === "VOUCHER" ? n.value.option = {
41
- collectible: null,
42
- type: "VOUCHER",
43
- collectibleConfig: re("VOUCHER", {
44
- business: te().currentBusiness.value._id
45
- }),
46
- earningOption: {
47
- amount: 1,
48
- type: "FIXED"
49
- },
50
- validityOption: {
51
- validForDay: 30
52
- }
53
- } : n.value.option = {
54
- collectible: u.loyaltyRewards.raw[0]._id,
55
- collecitbleType: u.loyaltyRewards.raw[0].type,
56
- type: "LOYALTY",
57
- earningOption: {
58
- amount: 1,
59
- type: "FIXED"
60
- },
61
- validityOption: {
62
- validForDay: 30
63
- }
64
- };
65
- }
66
- function R(o) {
67
- n.value.option.collectible = o;
68
- }
69
- const T = g();
70
- return l({
71
- showSheet: w
72
- }), (o, e) => {
73
- const O = c("FmSelect"), E = c("FmForm"), V = c("FmButton"), A = c("FmSideSheet");
74
- return f(), x(A, {
75
- "max-width": 560,
76
- modelValue: t(i),
77
- "onUpdate:modelValue": [
78
- e[8] || (e[8] = (d) => X(i) ? i.value = d : null),
79
- e[9] || (e[9] = (d) => i.value = d)
80
- ],
81
- header: "Edit reward"
82
- }, {
83
- "side-sheet-footer": k(() => [
84
- p("div", de, [
85
- r(V, {
86
- variant: "primary",
87
- type: "button",
88
- label: "Confirm",
89
- disabled: t(m).length > 0,
90
- onClick: e[6] || (e[6] = (d) => v())
91
- }, null, 8, ["disabled"]),
92
- r(V, {
93
- variant: "secondary",
94
- type: "button",
95
- label: "Cancel",
96
- onClick: e[7] || (e[7] = (d) => i.value = !1)
97
- })
98
- ])
99
- ]),
100
- default: k(() => [
101
- r(M, { json: t(n) }, null, 8, ["json"]),
102
- r(E, {
103
- class: "flex flex-col gap-y-24",
104
- ref_key: "formRef",
105
- ref: T,
106
- onValidationSuccess: e[5] || (e[5] = (d) => v())
107
- }, {
108
- default: k(() => {
109
- var d, s, B;
110
- return [
111
- r(ae, {
112
- modelValue: t(n).name,
113
- "onUpdate:modelValue": e[0] || (e[0] = (a) => t(n).name = a),
114
- label: "Reward Name",
115
- schema: t(_).typeAtPath(t(y), "name", [])
116
- }, null, 8, ["modelValue", "schema"]),
117
- r(O, {
118
- label: "Reward Type",
119
- items: [
120
- { label: "Voucher", value: "VOUCHER" },
121
- { label: "Loyalty", value: "LOYALTY" }
122
- ],
123
- "model-value": t(n).option.type,
124
- "onUpdate:modelValue": L
125
- }, null, 8, ["model-value"]),
126
- t(n).option.type == "LOYALTY" ? (f(), x(O, {
127
- key: 0,
128
- label: "Loyalty type",
129
- items: t(u).loyaltyRewards.items,
130
- "model-value": t(n).option.collectible,
131
- "onUpdate:modelValue": R
132
- }, null, 8, ["items", "model-value"])) : S("", !0),
133
- t(n).option.type === "LOYALTY" ? (f(), P($, { key: 1 }, [
134
- e[10] || (e[10] = p("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
135
- ((d = t(u).loyaltyRewards.items.find(
136
- (a) => {
137
- var C;
138
- return a.value === ((C = t(n)) == null ? void 0 : C.option.collectible);
139
- }
140
- )) == null ? void 0 : d.raw.type) !== "TITLE" ? (f(), x(oe, {
141
- key: 0,
142
- class: "mt-[-8px]",
143
- rules: [
144
- t(_).ruleAtPath(t(y), "option.earningOption", [
145
- t(n).option.type
146
- ])
147
- ],
148
- "helper-state": t(_).helperState(t(m), "option.earningOption"),
149
- "error-text": t(_).helperText(t(m), "option.earningOption"),
150
- "fixed-type": !0,
151
- "model-value": t(n).option.earningOption,
152
- "onUpdate:modelValue": e[1] || (e[1] = (a) => t(n).option.earningOption = a)
153
- }, null, 8, ["rules", "helper-state", "error-text", "model-value"])) : S("", !0),
154
- r(le, {
155
- class: "!gap-24",
156
- "for-credit": t(n).option.type === "LOYALTY" && ((s = t(u).loyaltyRewards.items.find(
157
- (a) => {
158
- var C;
159
- return a.value === ((C = t(n).option) == null ? void 0 : C.collectible);
160
- }
161
- )) == null ? void 0 : s.raw.type) === "CREDIT",
162
- rules: [
163
- t(_).ruleAtPath(t(y), "option.validityOption", [
164
- t(n).option.type
165
- ])
166
- ],
167
- "model-value": t(n).option.validityOption,
168
- "onUpdate:modelValue": e[2] || (e[2] = (a) => t(n).option.validityOption = a)
169
- }, null, 8, ["for-credit", "rules", "model-value"])
170
- ], 64)) : S("", !0),
171
- t(n).option.type === "VOUCHER" ? (f(), x(ne, {
172
- key: 2,
173
- "reward-image": t(b),
174
- "model-value": ((B = t(n)) == null ? void 0 : B.option.collectibleConfig) ?? void 0,
175
- "onUpdate:modelValue": e[3] || (e[3] = (a) => t(n).option.collectibleConfig = a),
176
- "onUpdate:rewardImage": e[4] || (e[4] = (a) => b.value = a)
177
- }, null, 8, ["reward-image", "model-value"])) : S("", !0),
178
- r(M, { json: t(m) }, null, 8, ["json"])
179
- ];
180
- }),
181
- _: 1
182
- }, 512)
183
- ]),
184
- _: 1
185
- }, 8, ["modelValue"]);
186
- };
187
- }
188
- }), pe = { class: "px-24 flex flex-col gap-y-16" }, ce = { class: "flex items-center justify-between w-full" }, ue = { class: "flex flex-col gap-16 text-center" }, fe = { class: "fm-typo-en-title-sm-800" }, ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = /* @__PURE__ */ j({
189
- __name: "Reward",
190
- setup(K) {
191
- const { t: l } = Q(), U = {
192
- label: l("connect.storeRewards.create"),
193
- value: "create",
194
- isPrimary: !0,
195
- prependIcon: "add"
196
- }, u = N(), i = se(), { global: n, minor: b } = z, y = ie(), m = g({
197
- searchKey: "",
198
- columnFilters: []
199
- }), w = H(() => i.rewards), h = [
200
- {
201
- header: l("connect.storeRewards.table.name"),
202
- accessorFn: (o) => o.name
203
- },
204
- {
205
- header: l("connect.storeRewards.table.type"),
206
- cell(o) {
207
- return o.row.original.collectibleConfig ? G[o.row.original.collectibleConfig.type].chip() : "N/A";
208
- }
209
- },
210
- {
211
- header: l("connect.storeRewards.table.actions"),
212
- cell(o) {
213
- return F("div", { class: "flex items-center justify-end gap-4" }, [
214
- F(
215
- Y.FmMenu,
216
- {
217
- placement: "bottom-end",
218
- onClick: (e) => {
219
- e.stopPropagation();
220
- }
221
- },
222
- {
223
- "menu-button": () => F(Y.FmButton, {
224
- icon: "more_vert",
225
- iconColor: "neutral-gray-400",
226
- variant: "tertiary"
227
- }),
228
- default: () => [
229
- // h(components.FmMenuItem, {
230
- // label: 'View collections',
231
- // onClick: async (event: Event) => {
232
- // event.stopPropagation();
233
- // onViewCollection(props.row.original._id as string);
234
- // },
235
- // }),
236
- F(
237
- Y.FmMenuItem,
238
- {
239
- onClick: async (e) => {
240
- e.stopPropagation(), L(o.row.original);
241
- }
242
- },
243
- {
244
- label: F(
245
- "div",
246
- {
247
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
248
- },
249
- "Delete"
250
- )
251
- }
252
- )
253
- ]
254
- }
255
- )
256
- ]);
257
- }
258
- }
259
- ], v = g();
260
- async function L(o) {
261
- await q.remove(
262
- l("connect.storeRewards.delete.confirm"),
263
- l("connect.storeRewards.delete.title")
264
- ) && await b(
265
- async () => {
266
- await I.deleteReward(o._id), await i.readRewards();
267
- },
268
- {
269
- message: l("connect.storeRewards.delete.message"),
270
- successMessage: l("connect.storeRewards.delete.success")
271
- }
272
- );
273
- }
274
- async function R(o) {
275
- var e;
276
- o || (o = {
277
- name: "",
278
- option: {
279
- type: "LOYALTY",
280
- collectible: u.loyaltyRewards.items[0].value,
281
- validityOption: {
282
- validForDay: 7
283
- },
284
- earningOption: {
285
- type: "FIXED",
286
- amount: 1
287
- }
288
- }
289
- }), (e = v.value) == null || e.showSheet(!0, W(o));
290
- }
291
- async function T(o) {
292
- console.log("reward", o), await b(
293
- async () => {
294
- var e;
295
- o.collectibleConfig = void 0, o._id ? await I.updateReward(o._id, o) : await I.createReward(o), await i.readRewards(), (e = v.value) == null || e.showSheet(!1);
296
- },
297
- {
298
- message: "Updating reward",
299
- successMessage: "Reward updated successfully"
300
- }
301
- );
302
- }
303
- return J(async () => {
304
- await n(async () => {
305
- await u.readRewards(), await i.readRewards();
306
- });
307
- }), (o, e) => {
308
- const O = c("FmPageHead"), E = c("FmSearch"), V = c("FmTable"), A = c("FmButton"), d = c("FmCard");
309
- return f(), P($, null, [
310
- r(O, {
311
- title: t(l)("connect.reward.title"),
312
- actions: [U],
313
- "back-button": !0,
314
- "onClick:action": e[0] || (e[0] = () => R()),
315
- "onClick:back": e[1] || (e[1] = () => {
316
- var s;
317
- return (s = t(y)) == null ? void 0 : s.back();
318
- })
319
- }, null, 8, ["title", "actions"]),
320
- p("div", pe, [
321
- t(w) && t(w).length > 0 ? (f(), P($, { key: 0 }, [
322
- p("div", ce, [
323
- e[6] || (e[6] = p("div", { class: "flex gap-8" }, null, -1)),
324
- r(E, {
325
- modelValue: t(m).searchKey,
326
- "onUpdate:modelValue": e[2] || (e[2] = (s) => t(m).searchKey = s),
327
- class: "",
328
- placeholder: "search",
329
- collapsible: ""
330
- }, null, 8, ["modelValue"])
331
- ]),
332
- r(V, {
333
- "row-data": t(w),
334
- "column-defs": h,
335
- "search-value": t(m).searchKey,
336
- "column-filter": t(m).columnFilters,
337
- onRowClick: e[3] || (e[3] = (s) => R(s.original)),
338
- "hide-footer": t(w).length < 10
339
- }, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
340
- ], 64)) : (f(), x(d, {
341
- key: 1,
342
- variant: "outlined",
343
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
344
- }, {
345
- default: k(() => [
346
- e[7] || (e[7] = p("img", {
347
- src: Z,
348
- class: "aspect-square w-[150px]"
349
- }, null, -1)),
350
- p("div", ue, [
351
- p("div", fe, D(t(l)("connect.storeRewards.empty.title")), 1),
352
- p("div", ye, D(t(l)("connect.storeRewards.empty.description")), 1)
353
- ]),
354
- r(A, {
355
- variant: "primary",
356
- label: t(l)("connect.storeRewards.empty.action"),
357
- onClick: e[4] || (e[4] = (s) => R()),
358
- icon: "add"
359
- }, null, 8, ["label"])
360
- ]),
361
- _: 1
362
- })),
363
- r(me, {
364
- ref_key: "rewardSheetRef",
365
- ref: v,
366
- onUpdate: e[5] || (e[5] = (s) => T(s))
367
- }, null, 512)
368
- ])
369
- ], 64);
370
- };
371
- }
372
- });
373
- export {
374
- Pe as default
375
- };
@@ -1,138 +0,0 @@
1
- import { ref as f, defineComponent as P, computed as T, resolveComponent as w, openBlock as x, createBlock as G, unref as e, isRef as j, withCtx as b, createElementVNode as g, createVNode as m, toDisplayString as B } from "vue";
2
- import { u as I } from "./loading-DxWIhKJX.js";
3
- import { J as y } from "./JsonViewer-v8_C7l5N.js";
4
- import { _ as A } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DLFDd3Y3.js";
5
- import { _ as L } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-CJa-Tkws.js";
6
- import { Z as N } from "./zod-Bg2FbC-D.js";
7
- import { u as V } from "./app-wDQR6dpb.js";
8
- import { defineStore as D } from "pinia";
9
- import { r as U } from "./index-D2d2rTPz.js";
10
- import "./index-5mZIFDhm.js";
11
- import "./index-CATw-eQI.js";
12
- import "./index-CmN2dQk5.js";
13
- import "./index-XoOcBFvx.js";
14
- import { c as E } from "./index-C7kr1TMO.js";
15
- import "./index-CVfN0Gmc.js";
16
- import "./index-Z61r-lWj.js";
17
- import "./index-Ct847l9G.js";
18
- import { u as J } from "./vue-i18n-BC0lAbnG.js";
19
- import { c as k } from "./object-qECH92oz.js";
20
- const C = D("mf-connect-referral", () => {
21
- const p = f();
22
- return {
23
- readReferralProgram: async () => {
24
- const u = await U.read();
25
- p.value = u;
26
- },
27
- referralProgram: p
28
- };
29
- }), Z = { class: "flex flex-col space-y-16 pr-12" }, H = { class: "fm-typo-en-title-sm-800" }, M = { class: "flex items-center gap-8" }, O = /* @__PURE__ */ P({
30
- __name: "EditReferralTierSheet",
31
- emits: ["update"],
32
- setup(p, { expose: h, emit: u }) {
33
- const { t: o } = J(), R = u, s = f(!1), a = f({}), i = f(-1), n = C(), l = E.superRefine((r, t) => {
34
- r.name.length >= 50 && t.addIssue({
35
- code: "custom",
36
- message: "Name must be less than 50 characters"
37
- });
38
- }), _ = T(() => {
39
- const r = l.safeParse(a.value);
40
- return r.success ? [] : r.error.errors;
41
- });
42
- function S() {
43
- const r = l.safeParse(a.value);
44
- r.success && R("update", i.value, r.data);
45
- }
46
- function c(r, t) {
47
- var d;
48
- s.value = r, r && typeof t == "number" && t >= 0 ? (i.value = t, a.value = k(
49
- (d = n.referralProgram) == null ? void 0 : d.reward[t]
50
- )) : (i.value = -1, a.value = {
51
- id: (/* @__PURE__ */ new Date()).toISOString(),
52
- name: "",
53
- rewards: [],
54
- rule: void 0
55
- });
56
- }
57
- function F(r) {
58
- a.value.rule = r;
59
- }
60
- return h({
61
- showSheet: c,
62
- data: a
63
- }), (r, t) => {
64
- const d = w("FmButton"), $ = w("FmSideSheet");
65
- return x(), G($, {
66
- "max-width": 1e3,
67
- modelValue: e(s),
68
- "onUpdate:modelValue": t[2] || (t[2] = (v) => j(s) ? s.value = v : null),
69
- header: `${e(i) == -1 ? e(o)("connect.referral.editReferralTierSheet.create") : e(o)("connect.referral.editReferralTierSheet.edit")}`
70
- }, {
71
- "side-sheet-footer": b(() => [
72
- g("div", M, [
73
- m(d, {
74
- label: e(o)("connect.editTierSheet.submit"),
75
- onClick: S,
76
- disabled: e(_).length > 0 || e(V)().isLoading,
77
- loading: e(V)().isLoading
78
- }, null, 8, ["label", "disabled", "loading"]),
79
- m(d, {
80
- label: e(o)("connect.editTierSheet.cancel"),
81
- onClick: t[1] || (t[1] = (v) => c(!1)),
82
- variant: "tertiary"
83
- }, null, 8, ["label"])
84
- ])
85
- ]),
86
- default: b(() => [
87
- m(y, { json: e(a) }, null, 8, ["json"]),
88
- m(y, { json: e(_) }, null, 8, ["json"]),
89
- g("div", Z, [
90
- m(A, {
91
- modelValue: e(a).name,
92
- "onUpdate:modelValue": t[0] || (t[0] = (v) => e(a).name = v),
93
- label: e(o)("connect.referral.editReferralTierSheet.name"),
94
- schema: e(N).typeAtPath(e(l), "name")
95
- }, null, 8, ["modelValue", "label", "schema"]),
96
- g("div", H, B(e(o)("connect.referral.editReferralTierSheet.target_audience")), 1),
97
- m(L, {
98
- "model-value": e(a).rule,
99
- "onUpdate:modelValue": F
100
- }, null, 8, ["model-value"])
101
- ])
102
- ]),
103
- _: 1
104
- }, 8, ["modelValue", "header"]);
105
- };
106
- }
107
- }), de = /* @__PURE__ */ P({
108
- __name: "RewardGroup",
109
- setup(p, { expose: h }) {
110
- const { minor: u } = I, o = C(), R = T(() => {
111
- var n;
112
- return ((n = o.referralProgram) == null ? void 0 : n.reward) ?? [];
113
- }), s = f(null);
114
- function a(n) {
115
- var l;
116
- (l = s.value) == null || l.showSheet(!0, n);
117
- }
118
- h({
119
- onManageRewardGroup: a
120
- });
121
- async function i(n, l) {
122
- var c;
123
- const _ = n == -1 ? R.value.length : n, S = k(o.referralProgram);
124
- S.reward[_] = l, await u(async () => {
125
- await U.update(S), await o.readReferralProgram();
126
- }), (c = s.value) == null || c.showSheet(!1);
127
- }
128
- return (n, l) => (x(), G(O, {
129
- ref_key: "editReferralTierSheetRef",
130
- ref: s,
131
- onUpdate: i
132
- }, null, 512));
133
- }
134
- });
135
- export {
136
- de as _,
137
- C as u
138
- };