@feedmepos/mf-connect 0.1.0-beta.33 → 0.1.0-beta.35

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 (83) hide show
  1. package/dist/{Analytic-COFvmYc_.js → Analytic-BMdB7x5F.js} +24 -23
  2. package/dist/{App-Di7kbEH7.js → App-AakWqQHx.js} +6 -6
  3. package/dist/{Broadcast-CAku3lNW.js → Broadcast-Bf5GOV7p.js} +8 -8
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B1Ozu6-2.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BBTBapxi.js} +7 -7
  5. package/dist/{Card-CcRmp6aK.js → Card-DmxekNts.js} +15 -15
  6. package/dist/{Collections-BRLR37TF.js → Collections-CL7hOycU.js} +4 -4
  7. package/dist/{Credit-BEViCbtH.js → Credit-0eGxacBN.js} +8 -8
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DDSSHrcX.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BLWeJ73S.js} +27 -26
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CGBjH5AK.js → EffectSheet.vue_vue_type_style_index_0_lang-q7qJ9Ec5.js} +6 -6
  10. package/dist/{Experience-BL71InUh.js → Experience-NjmDx3_p.js} +8 -8
  11. package/dist/{Game-vmhBTg3f.js → Game-q19qmf8t.js} +8 -8
  12. package/dist/{Index-DGkT3yms.js → Index-BmzHphDm.js} +9 -9
  13. package/dist/{Marketing-BCqFnOrR.js → Marketing-BgL2CqkH.js} +5 -5
  14. package/dist/{Member-C7uOPBUa.js → Member-DXO7yer0.js} +4 -4
  15. package/dist/{MemberList-CaY2SRSx.js → MemberList-WGMopz-y.js} +14 -14
  16. package/dist/{MemberTransactions-v2sui0Sy.js → MemberTransactions-DmQgrLdy.js} +1 -1
  17. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-za7Jz9uG.js → MessageInput.vue_vue_type_script_setup_true_lang-DFiCQcTe.js} +2 -2
  18. package/dist/{Mission-DZG8d3vM.js → Mission-DOdkoytR.js} +8 -8
  19. package/dist/Overview-Bizp0BGu.js +1064 -0
  20. package/dist/{Point-DW_SHWMs.js → Point-Bvyg1zuh.js} +8 -8
  21. package/dist/{Promotion-C8tygVa7.js → Promotion-B75LcnHm.js} +9 -9
  22. package/dist/{Record-D7XgEVn_.js → Record-BjAbPbiI.js} +5 -5
  23. package/dist/Reward-l1gt8pwu.js +432 -0
  24. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Dyj14jcj.js → RewardGroup.vue_vue_type_script_setup_true_lang-C76emk8A.js} +11 -11
  25. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Cmv-8YZd.js → RuleGroup.vue_vue_type_script_setup_true_lang-B4ak1Gem.js} +13 -13
  26. package/dist/{Segment-DAYnubHq.js → Segment-DJSkWWH8.js} +13 -13
  27. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BviSuL4I.js → SelectItems.vue_vue_type_script_setup_true_lang-ByqgSxPo.js} +2 -2
  28. package/dist/{Setting-Dd-PlldV.js → Setting-DTV24iE5.js} +8 -8
  29. package/dist/{Store-DmBeTkdi.js → Store-C1obQwdr.js} +46 -46
  30. package/dist/{StoreRewards-VrmRII1r.js → StoreRewards-apMVv0Ca.js} +12 -12
  31. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Bx1AwHhj.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DBzA_4gb.js} +17 -17
  32. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DanZYVUH.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-PxZ5Au5X.js} +1 -1
  33. package/dist/{Tier-h5t-OofQ.js → Tier-DSvMUZJG.js} +19 -19
  34. package/dist/{Title-BIGAZzv4.js → Title-CWoqOkd2.js} +19 -19
  35. package/dist/{Transaction-WfW0gCVl.js → Transaction-CaCsXoB5.js} +2 -2
  36. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-KB8LAOv_.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DaT8PyWl.js} +6 -6
  37. package/dist/{Voucher-CzA0AnCo.js → Voucher-BBtDXr9q.js} +11 -11
  38. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BbYPy9pR.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BCSO2-oB.js} +10 -10
  39. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BPHAIlP5.js → ZodTextField.vue_vue_type_script_setup_true_lang-BTm3pDid.js} +1 -1
  40. package/dist/{app-C2GiWW62.js → app-B8JBXu5M.js} +212 -186
  41. package/dist/{app-BhP-DVoF.js → app-D8kcy7_R.js} +1 -1
  42. package/dist/app.js +1 -1
  43. package/dist/{business-BjQMXRkL.js → business-DN4-BTel.js} +1 -1
  44. package/dist/{campaign-tqh1zOQn.js → campaign-Cf6jJz3e.js} +2 -2
  45. package/dist/campaign.enum-DVOwgVTa.js +20 -0
  46. package/dist/campaign.fn-D8apF_YE.js +758 -0
  47. package/dist/{collectible.enum-904x3SQw.js → collectible.enum-DPsEC03C.js} +1 -1
  48. package/dist/{collection.fn-B1wW3tQk.js → collection.fn-CzeGWVx2.js} +2 -2
  49. package/dist/dto-D94IgAXy.js +2018 -0
  50. package/dist/{effect-DlIXzIWd.js → effect-CDg44P_g.js} +1 -1
  51. package/dist/{email-addresses-bquAp7UR.js → email-addresses-CDozpvzz.js} +1 -1
  52. package/dist/{export-9ZU9HjO9.js → export-DQLXrn4F.js} +3 -3
  53. package/dist/{helper-D0S39he1.js → helper-DJMf--V-.js} +1 -1
  54. package/dist/{index-DN5WVCu6.js → index-B0n_PU3b.js} +1 -1
  55. package/dist/{index-BoJwjzpx.js → index-BUZR5Bkw.js} +1 -1
  56. package/dist/{index-kkystjJw.js → index-BbPavTej.js} +3 -3
  57. package/dist/{index-D4QKa9x3.js → index-BgXfVzZF.js} +7 -7
  58. package/dist/{index-l_74COL_.js → index-BmblCnlD.js} +1 -1
  59. package/dist/{index-DF3fzy-k.js → index-BnbkejyF.js} +1 -1
  60. package/dist/{index-Dszb1Xy-.js → index-CVV5I3bh.js} +1 -1
  61. package/dist/{index-B6SrZyMF.js → index-DFbITElv.js} +214 -228
  62. package/dist/{index-DTsmbmOR.js → index-Df84_Ww3.js} +3 -3
  63. package/dist/{index-DNa1m2cM.js → index-DrvefOT4.js} +3 -3
  64. package/dist/{index-DnGzf-f8.js → index-DvE5xL4s.js} +2 -2
  65. package/dist/{index-BwDwKkyV.js → index-V6yWwXYr.js} +1 -1
  66. package/dist/{index.esm2017-CNuwLU2a.js → index.esm2017-C90-ettH.js} +1 -1
  67. package/dist/{loading-CiI8Y9Fj.js → loading-B56wz_ef.js} +4 -4
  68. package/dist/{membership-CPNrhOk0.js → membership-CF1jgR11.js} +4 -4
  69. package/dist/{money-DnAxVjb7.js → money-BEEp2WdU.js} +1 -1
  70. package/dist/{number-B5VKL1Yu.js → number-u7HbwLPt.js} +1 -1
  71. package/dist/{objectid-C-IOC4JL.js → objectid-S3_nH1F7.js} +10 -10
  72. package/dist/{reward-D4RyiYb6.js → reward-BUY77BiP.js} +1 -1
  73. package/dist/{rule-DVMHVRWb.js → rule-BdAPBN8_.js} +3 -3
  74. package/dist/{rule-builder-CFUNraRE.js → rule-builder-z51VUtHk.js} +1 -1
  75. package/dist/{template-OBoSoTcO.js → template-B_J4Q9D6.js} +4 -4
  76. package/dist/{trigger-R6mF8LNa.js → trigger-CGrv0M0q.js} +4 -4
  77. package/dist/{user-BGP1BTAw.js → user-D02jOhtd.js} +1 -1
  78. package/dist/{vue-i18n-_ooGZZRG.js → vue-i18n-rCSjqg2P.js} +333 -333
  79. package/dist/{xlsx-ByJGlrKD.js → xlsx-CL102mzm.js} +1 -1
  80. package/package.json +1 -1
  81. package/dist/Overview-egVspSvq.js +0 -1023
  82. package/dist/Reward-DqP89Pqb.js +0 -413
  83. package/dist/dto-C9SOa-xs.js +0 -2770
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as j, ref as P, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as w, Fragment as b, createVNode as r, unref as t, withCtx as g, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as x, resolveDynamicComponent as q } from "vue";
2
2
  import { _ as z } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { p as Q, u as W } from "./loading-CiI8Y9Fj.js";
5
- import { u as X } from "./business-BjQMXRkL.js";
6
- import { u as Y } from "./campaign-tqh1zOQn.js";
7
- import { g as V, a as I } from "./dto-C9SOa-xs.js";
4
+ import { p as Q, u as W } from "./loading-B56wz_ef.js";
5
+ import { u as X } from "./business-DN4-BTel.js";
6
+ import { u as Y } from "./campaign-Cf6jJz3e.js";
7
+ import { g as V, a as I } from "./dto-D94IgAXy.js";
8
8
  import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DDSSHrcX.js";
10
- import { u as te } from "./template-OBoSoTcO.js";
11
- import { u as oe } from "./vue-i18n-_ooGZZRG.js";
12
- import { c as _ } from "./index-BoJwjzpx.js";
9
+ import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BLWeJ73S.js";
10
+ import { u as te } from "./template-B_J4Q9D6.js";
11
+ import { u as oe } from "./vue-i18n-rCSjqg2P.js";
12
+ import { c as _ } from "./index-BUZR5Bkw.js";
13
13
  const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, se = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ j({
14
14
  __name: "Point",
15
15
  setup(he) {
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as H, ref as S, computed as q, h as z, onMounted as G, resolveComponent as r, openBlock as m, createElementBlock as h, Fragment as w, createVNode as i, unref as a, createElementVNode as s, withCtx as v, renderList as J, createBlock as b, resolveDynamicComponent as Q, toDisplayString as g } from "vue";
2
2
  import { _ as W } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as X, components as Y } from "@feedmepos/ui-library";
4
- import { c as O, p as I, u as Z } from "./loading-CiI8Y9Fj.js";
5
- import { u as ee } from "./business-BjQMXRkL.js";
6
- import { u as oe } from "./campaign-tqh1zOQn.js";
7
- import { u as te } from "./vue-i18n-_ooGZZRG.js";
8
- import { g as V } from "./dto-C9SOa-xs.js";
9
- import { e as L } from "./effect-DlIXzIWd.js";
4
+ import { c as O, p as I, u as Z } from "./loading-B56wz_ef.js";
5
+ import { u as ee } from "./business-DN4-BTel.js";
6
+ import { u as oe } from "./campaign-Cf6jJz3e.js";
7
+ import { u as te } from "./vue-i18n-rCSjqg2P.js";
8
+ import { g as V } from "./dto-D94IgAXy.js";
9
+ import { e as L } from "./effect-CDg44P_g.js";
10
10
  import { _ as ne } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
- import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DDSSHrcX.js";
12
- import { u as se } from "./template-OBoSoTcO.js";
13
- import { c as u } from "./index-BoJwjzpx.js";
11
+ import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BLWeJ73S.js";
12
+ import { u as se } from "./template-B_J4Q9D6.js";
13
+ import { c as u } from "./index-BUZR5Bkw.js";
14
14
  const ce = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, pe = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Le = /* @__PURE__ */ H({
15
15
  __name: "Promotion",
16
16
  setup(_e) {
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as b, ref as w, resolveComponent as y, openBlock as R, createBlock as z, unref as o, isRef as A, withCtx as I, createElementVNode as F, createVNode as C, h as c, onMounted as M, createElementBlock as N, Fragment as V } from "vue";
2
2
  import { u as $, _ as U } from "./usePagination-BeF5K3M7.js";
3
- import { g as v } from "./user-BGP1BTAw.js";
3
+ import { g as v } from "./user-D02jOhtd.js";
4
4
  import { components as g } from "@feedmepos/ui-library";
5
- import { u as B, a as E, c as L } from "./loading-CiI8Y9Fj.js";
6
- import { u as T } from "./vue-i18n-_ooGZZRG.js";
5
+ import { u as B, a as E, c as L } from "./loading-B56wz_ef.js";
6
+ import { u as T } from "./vue-i18n-rCSjqg2P.js";
7
7
  import { useCoreStore as O } from "@feedmepos/mf-common";
8
- import { r as P } from "./index-l_74COL_.js";
8
+ import { r as P } from "./index-BmblCnlD.js";
9
9
  import { c as K, a as W } from "./object-qECH92oz.js";
10
- import { u as j } from "./membership-CPNrhOk0.js";
10
+ import { u as j } from "./membership-CF1jgR11.js";
11
11
  const q = { class: "flex flex-col space-y-16 pr-12" }, G = /* @__PURE__ */ b({
12
12
  __name: "UpdateCriteriaProgressSheet",
13
13
  emits: ["refresh"],
@@ -0,0 +1,432 @@
1
+ import { defineComponent as X, ref as x, computed as $, resolveComponent as f, openBlock as v, createBlock as U, unref as t, isRef as q, withCtx as A, createElementVNode as u, createVNode as d, createCommentVNode as k, createElementBlock as H, Fragment as Y, h as F, onMounted as G, toDisplayString as B } from "vue";
2
+ import { _ as z } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as Q, components as L } from "@feedmepos/ui-library";
4
+ import { f as j, u as J, p as ee } from "./loading-B56wz_ef.js";
5
+ import { u as W, C as te } from "./membership-CF1jgR11.js";
6
+ import { u as oe } from "./vue-i18n-rCSjqg2P.js";
7
+ import { c as ae } from "./object-qECH92oz.js";
8
+ import { Z as O } from "./zod-Bg2FbC-D.js";
9
+ import "./index-DvE5xL4s.js";
10
+ import { a as N } from "./index-BbPavTej.js";
11
+ import { useCoreStore as le } from "@feedmepos/mf-common";
12
+ import { _ as ne, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-BCSO2-oB.js";
13
+ import { _ as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-q7qJ9Ec5.js";
14
+ import { J as K } from "./JsonViewer-v8_C7l5N.js";
15
+ import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BTm3pDid.js";
16
+ import { i as de } from "./helper-DJMf--V-.js";
17
+ import { u as ce, r as M } from "./reward-BUY77BiP.js";
18
+ import "./index-CVV5I3bh.js";
19
+ import { C as pe } from "./campaign.fn-D8apF_YE.js";
20
+ import { e as me } from "./effect-CDg44P_g.js";
21
+ import { useRouter as ue } from "vue-router";
22
+ import { R as fe } from "./app-B8JBXu5M.js";
23
+ const ye = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__ */ X({
24
+ __name: "EditRewardSheet",
25
+ emits: ["update"],
26
+ setup(Z, { expose: n, emit: I }) {
27
+ const p = W(), { minor: R } = J, y = x(!1), a = x({}), w = x(), g = $(() => {
28
+ var l;
29
+ return ((l = a.value.option) == null ? void 0 : l.collectibleType) === "CREDIT" ? N.superRefine((e, o) => {
30
+ var i, b, _, r;
31
+ !((b = (i = e.option) == null ? void 0 : i.validityOption) != null && b.validForDay) && !((r = (_ = e.option) == null ? void 0 : _.validityOption) != null && r.validBefore) && o.addIssue({
32
+ code: "custom",
33
+ path: [],
34
+ message: "Credit validity must be set"
35
+ });
36
+ }) : N;
37
+ }), m = $(() => {
38
+ const l = g.value.safeParse(a.value);
39
+ return l.success ? [] : l.error.errors;
40
+ });
41
+ function C(l, e) {
42
+ l && (a.value = e), y.value = l;
43
+ }
44
+ const D = I;
45
+ async function S() {
46
+ const l = g.value.safeParse(a.value);
47
+ !l.success || !l.data || (await R(
48
+ async () => {
49
+ var e;
50
+ l.data.option.type === "VOUCHER" && w.value && (l.data.option.collectibleConfig.image = await j.update(
51
+ ((e = l.data.option.collectibleConfig) == null ? void 0 : e.image) || j.collectibleImagePath(void 0, w.value),
52
+ w.value
53
+ ));
54
+ },
55
+ {
56
+ message: "Uploading reward image",
57
+ successMessage: "Reward image updated"
58
+ }
59
+ ), D("update", l.data));
60
+ }
61
+ function V(l) {
62
+ l === "VOUCHER" ? a.value.option = {
63
+ collectible: null,
64
+ type: "VOUCHER",
65
+ collectibleConfig: de("VOUCHER", {
66
+ business: le().currentBusiness.value._id
67
+ }),
68
+ earningOption: {
69
+ amount: 1,
70
+ type: "FIXED"
71
+ },
72
+ validityOption: {
73
+ validForDay: 7
74
+ }
75
+ } : a.value.option = {
76
+ collectible: p.loyaltyRewards.raw[0]._id,
77
+ collectibleType: p.loyaltyRewards.raw[0].type,
78
+ type: "LOYALTY",
79
+ earningOption: {
80
+ amount: 1,
81
+ type: "FIXED"
82
+ },
83
+ validityOption: {
84
+ validForDay: 7
85
+ }
86
+ };
87
+ }
88
+ function P(l) {
89
+ a.value.option.collectible = l, a.value.option.collectibleType = p.loyaltyRewards.raw.find(
90
+ (e) => e._id === l
91
+ ).type;
92
+ }
93
+ const h = x();
94
+ return n({
95
+ showSheet: C
96
+ }), (l, e) => {
97
+ const o = f("FmSelect"), i = f("FmForm"), b = f("FmButton"), _ = f("FmSideSheet");
98
+ return v(), U(_, {
99
+ "max-width": 560,
100
+ modelValue: t(y),
101
+ "onUpdate:modelValue": [
102
+ e[8] || (e[8] = (r) => q(y) ? y.value = r : null),
103
+ e[9] || (e[9] = (r) => y.value = r)
104
+ ],
105
+ header: "Edit reward"
106
+ }, {
107
+ "side-sheet-footer": A(() => [
108
+ u("div", ye, [
109
+ d(b, {
110
+ variant: "primary",
111
+ type: "button",
112
+ label: "Confirm",
113
+ disabled: t(m).length > 0,
114
+ onClick: e[6] || (e[6] = (r) => S())
115
+ }, null, 8, ["disabled"]),
116
+ d(b, {
117
+ variant: "secondary",
118
+ type: "button",
119
+ label: "Cancel",
120
+ onClick: e[7] || (e[7] = (r) => y.value = !1)
121
+ })
122
+ ])
123
+ ]),
124
+ default: A(() => [
125
+ d(K, { json: t(a) }, null, 8, ["json"]),
126
+ d(i, {
127
+ class: "flex flex-col gap-y-24",
128
+ ref_key: "formRef",
129
+ ref: h,
130
+ onValidationSuccess: e[5] || (e[5] = (r) => S())
131
+ }, {
132
+ default: A(() => {
133
+ var r, E, c;
134
+ return [
135
+ d(se, {
136
+ modelValue: t(a).name,
137
+ "onUpdate:modelValue": e[0] || (e[0] = (s) => t(a).name = s),
138
+ label: "Reward Name",
139
+ schema: t(O).typeAtPath(t(g), "name", []),
140
+ "error-text": t(O).helperText(t(m), "name")
141
+ }, null, 8, ["modelValue", "schema", "error-text"]),
142
+ d(o, {
143
+ label: "Reward Type",
144
+ disabled: !!t(a)._id,
145
+ items: [
146
+ { label: "Voucher", value: "VOUCHER" },
147
+ { label: "Loyalty", value: "LOYALTY" }
148
+ ],
149
+ "model-value": t(a).option.type,
150
+ "onUpdate:modelValue": V
151
+ }, null, 8, ["disabled", "model-value"]),
152
+ t(a).option.type == "LOYALTY" ? (v(), U(o, {
153
+ key: 0,
154
+ label: "Loyalty type",
155
+ items: t(p).loyaltyRewards.items,
156
+ "model-value": t(a).option.collectible,
157
+ "onUpdate:modelValue": P
158
+ }, null, 8, ["items", "model-value"])) : k("", !0),
159
+ t(a).option.type === "LOYALTY" ? (v(), H(Y, { key: 1 }, [
160
+ e[10] || (e[10] = u("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
161
+ ((r = t(p).loyaltyRewards.items.find(
162
+ (s) => {
163
+ var T;
164
+ return s.value === ((T = t(a)) == null ? void 0 : T.option.collectible);
165
+ }
166
+ )) == null ? void 0 : r.raw.type) !== "TITLE" ? (v(), U(ne, {
167
+ key: 0,
168
+ class: "mt-[-8px]",
169
+ rules: [
170
+ t(O).ruleAtPath(t(g), "option.earningOption", [
171
+ t(a).option.type
172
+ ])
173
+ ],
174
+ "helper-state": t(O).helperState(t(m), "option.earningOption"),
175
+ "error-text": t(O).helperText(t(m), "option.earningOption"),
176
+ "fixed-type": !0,
177
+ "model-value": t(a).option.earningOption,
178
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => t(a).option.earningOption = s)
179
+ }, null, 8, ["rules", "helper-state", "error-text", "model-value"])) : k("", !0),
180
+ d(re, {
181
+ class: "!gap-24",
182
+ "for-credit": t(a).option.type === "LOYALTY" && ((E = t(p).loyaltyRewards.items.find(
183
+ (s) => {
184
+ var T;
185
+ return s.value === ((T = t(a).option) == null ? void 0 : T.collectible);
186
+ }
187
+ )) == null ? void 0 : E.raw.type) === "CREDIT",
188
+ rules: [
189
+ t(O).ruleAtPath(t(g), "option.validityOption", [
190
+ t(a).option.type
191
+ ])
192
+ ],
193
+ "model-value": t(a).option.validityOption,
194
+ "onUpdate:modelValue": e[2] || (e[2] = (s) => t(a).option.validityOption = s)
195
+ }, null, 8, ["for-credit", "rules", "model-value"])
196
+ ], 64)) : k("", !0),
197
+ t(a).option.type === "VOUCHER" ? (v(), U(ie, {
198
+ key: 2,
199
+ "reward-image": t(w),
200
+ "model-value": ((c = t(a)) == null ? void 0 : c.option.collectibleConfig) ?? void 0,
201
+ "onUpdate:modelValue": e[3] || (e[3] = (s) => t(a).option.collectibleConfig = s),
202
+ "onUpdate:rewardImage": e[4] || (e[4] = (s) => w.value = s)
203
+ }, null, 8, ["reward-image", "model-value"])) : k("", !0),
204
+ d(K, { json: t(m) }, null, 8, ["json"])
205
+ ];
206
+ }),
207
+ _: 1
208
+ }, 512)
209
+ ]),
210
+ _: 1
211
+ }, 8, ["modelValue"]);
212
+ };
213
+ }
214
+ }), ve = { class: "px-24 flex flex-col gap-y-16" }, ge = { class: "flex items-center justify-between w-full" }, be = { class: "flex flex-col gap-16 text-center" }, Re = { class: "fm-typo-en-title-sm-800" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ne = /* @__PURE__ */ X({
215
+ __name: "Reward",
216
+ setup(Z) {
217
+ const { t: n } = oe(), I = {
218
+ label: n("connect.storeRewards.create"),
219
+ value: "create",
220
+ isPrimary: !0,
221
+ prependIcon: "add"
222
+ }, p = W(), R = ce(), { global: y, minor: a } = J, w = ue(), g = Q(), m = x({
223
+ searchKey: "",
224
+ columnFilters: []
225
+ }), C = $(() => R.rewards);
226
+ function D(e) {
227
+ w.push({
228
+ name: fe["$connect-STORE_REWARD_COLLECTIONS"],
229
+ params: { id: e }
230
+ });
231
+ }
232
+ const S = [
233
+ {
234
+ header: n("connect.storeRewards.table.name"),
235
+ accessorFn: (e) => e.name
236
+ },
237
+ {
238
+ header: n("connect.storeRewards.table.type"),
239
+ cell(e) {
240
+ return e.row.original.collectibleConfig ? te[e.row.original.collectibleConfig.type].chip() : "N/A";
241
+ }
242
+ },
243
+ {
244
+ header: n("connect.storeRewards.table.summary"),
245
+ accessorFn: (e) => {
246
+ var o, i;
247
+ return e.option.type === "VOUCHER" ? me((i = (o = e.option.collectibleConfig) == null ? void 0 : o.extras) == null ? void 0 : i.effect) : `Get ${e.option.earningOption.amount} ${pe.formattedType(e.option.collectibleType)}`;
248
+ }
249
+ },
250
+ {
251
+ header: n("connect.storeRewards.table.actions"),
252
+ cell(e) {
253
+ return F("div", { class: "flex items-center justify-end gap-4" }, [
254
+ F(
255
+ L.FmMenu,
256
+ {
257
+ placement: "bottom-end",
258
+ onClick: (o) => {
259
+ o.stopPropagation();
260
+ }
261
+ },
262
+ {
263
+ "menu-button": () => F(L.FmButton, {
264
+ icon: "more_vert",
265
+ iconColor: "neutral-gray-400",
266
+ variant: "tertiary"
267
+ }),
268
+ default: () => [
269
+ e.row.original.option.type === "VOUCHER" && F(L.FmMenuItem, {
270
+ label: "View collections",
271
+ onClick: async (o) => {
272
+ o.stopPropagation(), D(
273
+ e.row.original.option.collectible
274
+ );
275
+ }
276
+ }),
277
+ F(
278
+ L.FmMenuItem,
279
+ {
280
+ onClick: async (o) => {
281
+ o.stopPropagation(), P(e.row.original);
282
+ }
283
+ },
284
+ {
285
+ label: F(
286
+ "div",
287
+ {
288
+ class: "text-fm-color-typo-error fm-typo-en-body-md-400"
289
+ },
290
+ "Delete"
291
+ )
292
+ }
293
+ )
294
+ ]
295
+ }
296
+ )
297
+ ]);
298
+ }
299
+ }
300
+ ], V = x();
301
+ async function P(e) {
302
+ await ee.remove(
303
+ n("connect.storeRewards.delete.confirm"),
304
+ n("connect.storeRewards.delete.title")
305
+ ) && await a(
306
+ async () => {
307
+ await M.deleteReward(e._id), await R.readRewards();
308
+ },
309
+ {
310
+ message: n("connect.storeRewards.delete.message"),
311
+ successMessage: n("connect.storeRewards.delete.success")
312
+ }
313
+ );
314
+ }
315
+ async function h(e) {
316
+ var o;
317
+ e || (e = {
318
+ name: "",
319
+ option: {
320
+ type: "LOYALTY",
321
+ collectible: p.loyaltyRewards.items[0].value,
322
+ collectibleType: p.loyaltyRewards.items[0].raw.type,
323
+ validityOption: {
324
+ validForDay: 7
325
+ },
326
+ earningOption: {
327
+ type: "FIXED",
328
+ amount: 1
329
+ }
330
+ }
331
+ }), (o = V.value) == null || o.showSheet(!0, ae(e));
332
+ }
333
+ async function l(e) {
334
+ let o = !1;
335
+ e._id && e.option.type === "VOUCHER" && await new Promise((i) => {
336
+ g.open({
337
+ title: "Confirmation",
338
+ message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
339
+ primaryActions: { text: "Update all", close: !0 },
340
+ secondaryActions: { text: "Update future only", close: !0 }
341
+ }).onPrimary(async () => {
342
+ o = !0, i();
343
+ }).onSecondary(async () => {
344
+ i();
345
+ });
346
+ }), await a(
347
+ async () => {
348
+ var i;
349
+ e.collectibleConfig = void 0, e._id ? await M.updateReward(e._id, {
350
+ ...e,
351
+ updateCollection: o
352
+ }) : await M.createReward(e), await R.readRewards(), (i = V.value) == null || i.showSheet(!1);
353
+ },
354
+ {
355
+ message: "Updating reward",
356
+ successMessage: "Reward updated successfully"
357
+ }
358
+ );
359
+ }
360
+ return G(async () => {
361
+ await y(async () => {
362
+ await p.readMembership(), await p.readRewards(), await R.readRewards();
363
+ });
364
+ }), (e, o) => {
365
+ const i = f("FmPageHead"), b = f("FmSearch"), _ = f("FmTable"), r = f("FmButton"), E = f("FmCard");
366
+ return v(), H(Y, null, [
367
+ d(i, {
368
+ title: t(n)("connect.reward.title"),
369
+ actions: [I],
370
+ "back-button": !0,
371
+ "onClick:action": o[0] || (o[0] = () => h()),
372
+ "onClick:back": o[1] || (o[1] = () => {
373
+ var c;
374
+ return (c = t(w)) == null ? void 0 : c.back();
375
+ })
376
+ }, null, 8, ["title", "actions"]),
377
+ u("div", ve, [
378
+ t(C) && t(C).length > 0 ? (v(), H(Y, { key: 0 }, [
379
+ u("div", ge, [
380
+ o[6] || (o[6] = u("div", { class: "flex gap-8" }, null, -1)),
381
+ d(b, {
382
+ modelValue: t(m).searchKey,
383
+ "onUpdate:modelValue": o[2] || (o[2] = (c) => t(m).searchKey = c),
384
+ class: "",
385
+ placeholder: "search",
386
+ collapsible: ""
387
+ }, null, 8, ["modelValue"])
388
+ ]),
389
+ d(_, {
390
+ "row-data": t(C),
391
+ "column-defs": S,
392
+ "search-value": t(m).searchKey,
393
+ "column-filter": t(m).columnFilters,
394
+ onRowClick: o[3] || (o[3] = (c) => h(c.original)),
395
+ "hide-footer": t(C).length < 10
396
+ }, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
397
+ ], 64)) : (v(), U(E, {
398
+ key: 1,
399
+ variant: "outlined",
400
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
401
+ }, {
402
+ default: A(() => [
403
+ o[7] || (o[7] = u("img", {
404
+ src: z,
405
+ class: "aspect-square w-[150px]"
406
+ }, null, -1)),
407
+ u("div", be, [
408
+ u("div", Re, B(t(n)("connect.storeRewards.empty.title")), 1),
409
+ u("div", Ce, B(t(n)("connect.storeRewards.empty.description")), 1)
410
+ ]),
411
+ d(r, {
412
+ variant: "primary",
413
+ label: t(n)("connect.storeRewards.empty.action"),
414
+ onClick: o[4] || (o[4] = (c) => h()),
415
+ icon: "add"
416
+ }, null, 8, ["label"])
417
+ ]),
418
+ _: 1
419
+ })),
420
+ d(we, {
421
+ ref_key: "rewardSheetRef",
422
+ ref: V,
423
+ onUpdate: o[5] || (o[5] = (c) => l(c))
424
+ }, null, 512)
425
+ ])
426
+ ], 64);
427
+ };
428
+ }
429
+ });
430
+ export {
431
+ Ne as default
432
+ };
@@ -1,19 +1,19 @@
1
1
  import { ref as p, defineComponent as T, computed as x, resolveComponent as y, openBlock as U, createBlock as G, unref as e, isRef as $, withCtx as b, createElementVNode as v, createVNode as u, toDisplayString as j } from "vue";
2
- import { u as B } from "./loading-CiI8Y9Fj.js";
2
+ import { u as B } from "./loading-B56wz_ef.js";
3
3
  import { J as P } from "./JsonViewer-v8_C7l5N.js";
4
- import { _ as D } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BPHAIlP5.js";
5
- import { _ as I } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-KB8LAOv_.js";
4
+ import { _ as D } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BTm3pDid.js";
5
+ import { _ as I } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-DaT8PyWl.js";
6
6
  import { Z as L } from "./zod-Bg2FbC-D.js";
7
7
  import { u as V } from "./app-wDQR6dpb.js";
8
8
  import { defineStore as N } from "pinia";
9
- import { r as k } from "./index-l_74COL_.js";
10
- import "./index-DTsmbmOR.js";
11
- import "./index-DnGzf-f8.js";
12
- import "./index-B6SrZyMF.js";
13
- import { c as E } from "./index-D4QKa9x3.js";
14
- import "./index-DN5WVCu6.js";
15
- import "./index-kkystjJw.js";
16
- import { u as J } from "./vue-i18n-_ooGZZRG.js";
9
+ import { r as k } from "./index-BmblCnlD.js";
10
+ import "./index-Df84_Ww3.js";
11
+ import "./index-DvE5xL4s.js";
12
+ import "./index-DFbITElv.js";
13
+ import { c as E } from "./index-BgXfVzZF.js";
14
+ import "./index-B0n_PU3b.js";
15
+ import "./index-BbPavTej.js";
16
+ import { u as J } from "./vue-i18n-rCSjqg2P.js";
17
17
  import { c as C } from "./object-qECH92oz.js";
18
18
  import { useDialog as Z } from "@feedmepos/ui-library";
19
19
  const A = N("mf-connect-referral", () => {
@@ -1,22 +1,22 @@
1
1
  import { defineComponent as I, computed as q, resolveComponent as k, openBlock as n, createElementBlock as V, createElementVNode as R, createVNode as v, unref as e, createTextVNode as te, toDisplayString as W, withCtx as h, onMounted as z, createBlock as f, createCommentVNode as B, ref as $, Fragment as M, renderList as A, normalizeClass as L, watch as me, resolveDynamicComponent as ae, onBeforeMount as re, isRef as ie, createSlots as de } from "vue";
2
- import { a as pe, C as ye, b as ce, c as ve, d as be } from "./index-DnGzf-f8.js";
3
- import { R as D, a as fe } from "./rule-builder-CFUNraRE.js";
4
- import { a as ge, R as S, S as ke, C as P, W as Ee, T as ne, O as Ve } from "./rule-DVMHVRWb.js";
5
- import { p as Te } from "./loading-CiI8Y9Fj.js";
2
+ import { a as pe, C as ye, b as ce, c as ve, d as be } from "./index-DvE5xL4s.js";
3
+ import { R as D, a as fe } from "./rule-builder-z51VUtHk.js";
4
+ import { a as ge, R as S, S as ke, C as P, W as Ee, T as ne, O as Ve } from "./rule-BdAPBN8_.js";
5
+ import { p as Te } from "./loading-B56wz_ef.js";
6
6
  import { useDialog as le, useDialogChild as ue } from "@feedmepos/ui-library";
7
7
  import { h as J } from "./moment-BWErdI6_.js";
8
- import { z as Fe } from "./app-C2GiWW62.js";
9
- import { u as Q } from "./membership-CPNrhOk0.js";
10
- import { u as X } from "./business-BjQMXRkL.js";
8
+ import { z as Fe } from "./app-B8JBXu5M.js";
9
+ import { u as Q } from "./membership-CF1jgR11.js";
10
+ import { u as X } from "./business-DN4-BTel.js";
11
11
  import { _ as Y } from "./CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js";
12
12
  import { c as se } from "./object-qECH92oz.js";
13
13
  import { Z } from "./zod-Bg2FbC-D.js";
14
- import { _ as Se } from "./SelectItems.vue_vue_type_script_setup_true_lang-BviSuL4I.js";
15
- import "./index-DTsmbmOR.js";
16
- import "./index-B6SrZyMF.js";
17
- import "./index-D4QKa9x3.js";
18
- import "./index-DN5WVCu6.js";
19
- import "./index-kkystjJw.js";
14
+ import { _ as Se } from "./SelectItems.vue_vue_type_script_setup_true_lang-ByqgSxPo.js";
15
+ import "./index-Df84_Ww3.js";
16
+ import "./index-DFbITElv.js";
17
+ import "./index-BgXfVzZF.js";
18
+ import "./index-B0n_PU3b.js";
19
+ import "./index-BbPavTej.js";
20
20
  const Ue = { class: "flex items-center justify-between" }, Ce = { class: "flex items-center gap-8 xs:flex-wrap" }, xe = { class: "text-fm-color-primary line-clamp-1 text-ellipsis" }, Re = /* @__PURE__ */ I({
21
21
  __name: "RuleEntry",
22
22
  props: {
@@ -1,24 +1,24 @@
1
1
  import { defineComponent as Q, onMounted as ue, openBlock as h, createElementBlock as Y, createElementVNode as i, toDisplayString as D, unref as a, createVNode as l, ref as H, computed as X, resolveComponent as x, createBlock as W, isRef as ye, createSlots as ve, withCtx as C, Fragment as q, h as B, onBeforeMount as _e, renderList as Se } from "vue";
2
2
  import { _ as xe } from "./campaign-CpzFl8Vr.js";
3
- import { F as re, p as he, u as we } from "./loading-CiI8Y9Fj.js";
3
+ import { F as re, p as he, u as we } from "./loading-B56wz_ef.js";
4
4
  import { components as Z } from "@feedmepos/ui-library";
5
5
  import { u as pe, _ as me } from "./usePagination-BeF5K3M7.js";
6
- import { u as Fe } from "./vue-i18n-_ooGZZRG.js";
7
- import { w as Ce } from "./xlsx-ByJGlrKD.js";
8
- import { e as Me, M as ke } from "./email-addresses-bquAp7UR.js";
6
+ import { u as Fe } from "./vue-i18n-rCSjqg2P.js";
7
+ import { w as Ce } from "./xlsx-CL102mzm.js";
8
+ import { e as Me, M as ke } from "./email-addresses-CDozpvzz.js";
9
9
  import { Z as Ie } from "./zod-Bg2FbC-D.js";
10
- import { e as Pe } from "./index-DTsmbmOR.js";
10
+ import { e as Pe } from "./index-Df84_Ww3.js";
11
11
  import { u as Re } from "./app-wDQR6dpb.js";
12
- import { R as Be } from "./rule-builder-CFUNraRE.js";
13
- import { _ as Ee } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BPHAIlP5.js";
14
- import { _ as De } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Cmv-8YZd.js";
12
+ import { R as Be } from "./rule-builder-z51VUtHk.js";
13
+ import { _ as Ee } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BTm3pDid.js";
14
+ import { _ as De } from "./RuleGroup.vue_vue_type_script_setup_true_lang-B4ak1Gem.js";
15
15
  import { h as z } from "./moment-BWErdI6_.js";
16
- import { s as E, u as Ye } from "./membership-CPNrhOk0.js";
16
+ import { s as E, u as Ye } from "./membership-CF1jgR11.js";
17
17
  import { o as $e } from "./objectId-dwaoBfJX.js";
18
- import { u as ge } from "./business-BjQMXRkL.js";
19
- import { f as be } from "./number-B5VKL1Yu.js";
20
- import { t as Le } from "./money-DnAxVjb7.js";
21
- import { m as ce } from "./index-DF3fzy-k.js";
18
+ import { u as ge } from "./business-DN4-BTel.js";
19
+ import { f as be } from "./number-u7HbwLPt.js";
20
+ import { t as Le } from "./money-BEEp2WdU.js";
21
+ import { m as ce } from "./index-BnbkejyF.js";
22
22
  const Te = Pe.extend({
23
23
  _id: re.optional(),
24
24
  business: re.optional()
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as N, computed as f, ref as V, onMounted as H, resolveComponent as _, openBlock as c, createElementBlock as u, createVNode as i, withCtx as S, createElementVNode as p, toDisplayString as q, normalizeClass as A, Fragment as b, renderList as j, createCommentVNode as B } from "vue";
2
- import { e as D } from "./app-BhP-DVoF.js";
3
- import "./loading-CiI8Y9Fj.js";
2
+ import { e as D } from "./app-D8kcy7_R.js";
3
+ import "./loading-B56wz_ef.js";
4
4
  import { c as E } from "./object-qECH92oz.js";
5
5
  const M = { class: "flex flex-col flex-nowrap" }, T = { class: "flex gap-16 items-center w-full" }, $ = { class: "flex grow items-center" }, z = { class: "grow text-fm-color-typo-secondary" }, K = { key: 0 }, J = { class: "px-16" }, X = /* @__PURE__ */ N({
6
6
  __name: "SelectItems",
@@ -2,16 +2,16 @@ import { defineComponent as He, ref as H, computed as se, onMounted as Ke, resol
2
2
  import { h as dt } from "./moment-BWErdI6_.js";
3
3
  import { Z as ke } from "./zod-Bg2FbC-D.js";
4
4
  import { useDialog as Ye } from "@feedmepos/ui-library";
5
- import { a as je, u as ft, p as mt, f as K } from "./loading-CiI8Y9Fj.js";
5
+ import { a as je, u as ft, p as mt, f as K } from "./loading-B56wz_ef.js";
6
6
  import { u as gt } from "./app-wDQR6dpb.js";
7
- import { u as ve, l as Je } from "./business-BjQMXRkL.js";
8
- import { u as qe } from "./membership-CPNrhOk0.js";
9
- import { t as ht, k as pt } from "./index-B6SrZyMF.js";
7
+ import { u as ve, l as Je } from "./business-DN4-BTel.js";
8
+ import { u as qe } from "./membership-CF1jgR11.js";
9
+ import { r as ht, i as pt } from "./index-DFbITElv.js";
10
10
  import { _ as Ve } from "./ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js";
11
- import { _ as yt } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DanZYVUH.js";
12
- import { _ as wt } from "./MessageInput.vue_vue_type_script_setup_true_lang-za7Jz9uG.js";
13
- import { u as bt } from "./vue-i18n-_ooGZZRG.js";
14
- import { m as vt } from "./index-BwDwKkyV.js";
11
+ import { _ as yt } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-PxZ5Au5X.js";
12
+ import { _ as wt } from "./MessageInput.vue_vue_type_script_setup_true_lang-DFiCQcTe.js";
13
+ import { u as bt } from "./vue-i18n-rCSjqg2P.js";
14
+ import { m as vt } from "./index-V6yWwXYr.js";
15
15
  import { o as Ct } from "./objectId-dwaoBfJX.js";
16
16
  import { a as Et } from "./object-qECH92oz.js";
17
17
  var ee = {}, Bt = function() {