@feedmepos/mf-connect 0.1.56-prod → 0.1.58-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 (128) hide show
  1. package/package.json +1 -1
  2. package/dist/Analytic-XUI4rZyP.js +0 -427
  3. package/dist/App-vv5J1Ebe.js +0 -4630
  4. package/dist/Bin-D4V36uXK.js +0 -166
  5. package/dist/Broadcast-BvW27G77.js +0 -233
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2MC6Gy1.js +0 -121
  7. package/dist/Card-C7xLv1Fb.js +0 -911
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-BKfS-bGL.js +0 -458
  10. package/dist/Credit-CGmWQq0t.js +0 -228
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C2p6_R01.js +0 -2194
  13. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BGlaqjWp.js +0 -348
  14. package/dist/Experience-CT7Yab3W.js +0 -229
  15. package/dist/FileSaver.min-NlMItPOc.js +0 -74
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  17. package/dist/Game-DtW4rtYQ.js +0 -284
  18. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +0 -144
  19. package/dist/Index-Bs5ob9Km.js +0 -259
  20. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  21. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
  22. package/dist/MainLayout-B1aJoR95.js +0 -41
  23. package/dist/Marketing-tA350rTd.js +0 -319
  24. package/dist/Member-CZoTXgKz.js +0 -279
  25. package/dist/MemberList-ChwyPtmW.js +0 -1607
  26. package/dist/MemberOverview-wL_ailso.js +0 -58
  27. package/dist/MemberTransactions-Cchtvxm9.js +0 -45
  28. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Bo0EnHBx.js +0 -60553
  29. package/dist/Mission-DDpelLqN.js +0 -302
  30. package/dist/Overview-Da3ewBat.js +0 -1079
  31. package/dist/Point-CggE8VUk.js +0 -232
  32. package/dist/Promotion-DxvbZhgQ.js +0 -289
  33. package/dist/Queue-fIxlHrMd.js +0 -260
  34. package/dist/Record-Bv90_VUG.js +0 -341
  35. package/dist/Reward-BWYLk7aC.js +0 -442
  36. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CjYEtENe.js +0 -150
  37. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Ak1R8Y2a.js +0 -1763
  38. package/dist/Segment-_VGdBy3a.js +0 -882
  39. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-Dm4hF1n1.js +0 -181
  40. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DWDMhmNr.js +0 -188
  41. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Czy25PII.js +0 -147
  42. package/dist/Setting-7fTz1dJa.js +0 -1936
  43. package/dist/Store-TQHKR__B.js +0 -1842
  44. package/dist/StoreRewards-DZy1ZwiI.js +0 -423
  45. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cae25Vr6.js +0 -995
  46. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BVVEzpyP.js +0 -139
  47. package/dist/Tier-CK53vdbl.js +0 -895
  48. package/dist/Title-CGWPq_FF.js +0 -566
  49. package/dist/Transaction-DjJ03PfX.js +0 -39
  50. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DNSdyxrF.js +0 -130
  51. package/dist/Voucher-D6RuJjNn.js +0 -384
  52. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-D4iCOq3V.js +0 -419
  53. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BFz8RvY_.js +0 -56
  54. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  55. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  56. package/dist/app-BLlAxdVk.js +0 -57962
  57. package/dist/app-_rmIFJ8M.js +0 -7057
  58. package/dist/app-wDQR6dpb.js +0 -39
  59. package/dist/app.js +0 -6
  60. package/dist/business-gJ9fK_2b.js +0 -82
  61. package/dist/campaign-BfznfcHc.js +0 -94
  62. package/dist/campaign-C_Yq-ffV.js +0 -1810
  63. package/dist/campaign-CpzFl8Vr.js +0 -4
  64. package/dist/campaign.enum-Dsbpz7BO.js +0 -20
  65. package/dist/campaign.fn-C6vKb-lp.js +0 -758
  66. package/dist/collectible.enum-DNpj_oyC.js +0 -19
  67. package/dist/collection.fn-Cgo0sPL2.js +0 -26
  68. package/dist/dto-CaSQ4Pp9.js +0 -216
  69. package/dist/effect-DuH74x-N.js +0 -78
  70. package/dist/email-addresses-DXr-Qqt9.js +0 -705
  71. package/dist/export-tMPFlVV0.js +0 -97
  72. package/dist/feedme.ico +0 -0
  73. package/dist/helper-CJTseW10.js +0 -71
  74. package/dist/index-8RETBwYy.js +0 -8861
  75. package/dist/index-B57kxqv7.js +0 -3
  76. package/dist/index-BNUuy_4R.js +0 -44
  77. package/dist/index-BSJ-4JYy.js +0 -146
  78. package/dist/index-BTpBLMHl.js +0 -3070
  79. package/dist/index-C6Iyn1Q6.js +0 -54
  80. package/dist/index-CWI06v9e.js +0 -31
  81. package/dist/index-CdnKwJuz.js +0 -30076
  82. package/dist/index-Cr_9Bqa1.js +0 -121
  83. package/dist/index-CuvNtC_M.js +0 -61
  84. package/dist/index-DTyfvK3U.js +0 -2130
  85. package/dist/index-Dn0gJspN.js +0 -32269
  86. package/dist/index-IHKkNyxb.js +0 -38
  87. package/dist/index-J3TDCX-5.js +0 -76
  88. package/dist/index-V9kRRAB1.js +0 -32
  89. package/dist/index-vh86FiIQ.js +0 -10
  90. package/dist/index.esm2017-P2nmohVw.js +0 -3069
  91. package/dist/loading-D5ZAAdUU.js +0 -71
  92. package/dist/lodash-B5I3zXaY.js +0 -3678
  93. package/dist/membership-xl9aKOQ_.js +0 -235
  94. package/dist/moment-D7p2TMB-.js +0 -2583
  95. package/dist/money-CIHN3jJZ.js +0 -15
  96. package/dist/number-BN4-Jdog.js +0 -12
  97. package/dist/object-qECH92oz.js +0 -26
  98. package/dist/objectId-dwaoBfJX.js +0 -7
  99. package/dist/objectid-Dh6RD0Tk.js +0 -145
  100. package/dist/plugins-CJlgzIv2.js +0 -208
  101. package/dist/reward-C8mezXzs.js +0 -36
  102. package/dist/rule-9VRIJFHZ.js +0 -1951
  103. package/dist/rule-builder-CZUgrDAw.js +0 -102
  104. package/dist/style.css +0 -4
  105. package/dist/template-aPJnNGLi.js +0 -190
  106. package/dist/tier-BJDhpH6X.js +0 -4
  107. package/dist/tiers/tier=1.png +0 -0
  108. package/dist/tiers/tier=2.png +0 -0
  109. package/dist/tiers/tier=3.png +0 -0
  110. package/dist/tiers/tier=4.png +0 -0
  111. package/dist/timezone-CpvXaiqq.js +0 -1151
  112. package/dist/titles/type=diamond.png +0 -0
  113. package/dist/titles/type=drinks.png +0 -0
  114. package/dist/titles/type=food.png +0 -0
  115. package/dist/titles/type=heart.png +0 -0
  116. package/dist/titles/type=medal.png +0 -0
  117. package/dist/titles/type=spend.png +0 -0
  118. package/dist/titles/type=thank-you.png +0 -0
  119. package/dist/titles/type=thumbs-up.png +0 -0
  120. package/dist/titles/type=years.png +0 -0
  121. package/dist/trigger-BfrtcBd-.js +0 -144
  122. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  123. package/dist/type_drinks-D6jnpvwV.js +0 -4
  124. package/dist/usePagination-Ds-cuHop.js +0 -223
  125. package/dist/user-Bt1C0yV5.js +0 -54
  126. package/dist/vue-i18n-OdHHHpEE.js +0 -2365
  127. package/dist/xlsx-BgB0dYfE.js +0 -15491
  128. package/dist/zod-Bg2FbC-D.js +0 -90
@@ -1,166 +0,0 @@
1
- import { defineComponent as C, ref as c, h as s, onMounted as x, resolveComponent as d, openBlock as S, createElementBlock as B, Fragment as M, createVNode as l, unref as o, createElementVNode as u } from "vue";
2
- import { components as p } from "@feedmepos/ui-library";
3
- import { u as K } from "./loading-D5ZAAdUU.js";
4
- import { u as R } from "./business-gJ9fK_2b.js";
5
- import { C as A } from "./campaign-C_Yq-ffV.js";
6
- import { _ as P } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-C2p6_R01.js";
7
- import { _ as U } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
8
- import { _ as Y } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-Czy25PII.js";
9
- import { u as D } from "./vue-i18n-OdHHHpEE.js";
10
- import { h as E } from "./moment-D7p2TMB-.js";
11
- import { p as I } from "./plugins-CJlgzIv2.js";
12
- import { c as g } from "./index-Cr_9Bqa1.js";
13
- const T = { class: "px-24 flex flex-col gap-y-16" }, $ = { class: "flex items-center justify-between w-full" }, j = { class: "flex gap-8 overflow-x-auto" }, oe = /* @__PURE__ */ C({
14
- __name: "Bin",
15
- setup(H) {
16
- const { t: n } = D(), y = R(), { global: _, minor: b } = K, a = c({
17
- searchKey: "",
18
- location: null
19
- }), m = c([]), w = [
20
- {
21
- header: n("connect.campaign.common.title"),
22
- accessorFn: (e) => e.name
23
- },
24
- {
25
- header: n("connect.campaign.common.campaignType"),
26
- cell(e) {
27
- return A[e.row.original.type].chip();
28
- }
29
- },
30
- {
31
- header: n("connect.campaign.common.deletedAt"),
32
- cell(e) {
33
- return E(e.row.original.deletedAt).format("D MMM YYYY, hh:mmA");
34
- }
35
- },
36
- {
37
- header: n("connect.voucher.actions"),
38
- cell(e) {
39
- return s("div", { class: "flex items-center justify-end" }, [
40
- s(
41
- p.FmMenu,
42
- {
43
- placement: "bottom-end",
44
- onClick: (t) => {
45
- t.stopPropagation();
46
- }
47
- },
48
- {
49
- "menu-button": () => s(p.FmButton, {
50
- icon: "more_vert",
51
- iconColor: "neutral-gray-400",
52
- variant: "tertiary"
53
- }),
54
- default: () => [
55
- s(
56
- p.FmMenuItem,
57
- {
58
- icon: "restore",
59
- onClick: async (i) => {
60
- i.stopPropagation(), F(e.row.original);
61
- }
62
- },
63
- {
64
- label: s(
65
- "div",
66
- {
67
- class: "fm-typo-en-body-md-400"
68
- },
69
- n("connect.campaign.common.actions.restore")
70
- )
71
- }
72
- )
73
- ]
74
- }
75
- )
76
- ]);
77
- }
78
- }
79
- ], v = c(), V = c();
80
- async function F(e) {
81
- await I.confirm(
82
- n("connect.campaign.common.restore.confirm", { name: e.name })
83
- ) && await b(
84
- async () => {
85
- await g.restore(e._id), await f();
86
- },
87
- {
88
- message: n("connect.campaign.common.restore.restoring", { name: e.name }),
89
- successMessage: n("connect.campaign.common.restore.restored", {
90
- name: e.name
91
- })
92
- }
93
- );
94
- }
95
- async function f() {
96
- const e = await g.readAllDeleted({
97
- limit: 1e3,
98
- skip: 0,
99
- sortBy: "_id",
100
- descending: !0
101
- });
102
- m.value = e.resources;
103
- }
104
- return x(async () => {
105
- await _(async () => {
106
- await f();
107
- });
108
- }), (e, t) => {
109
- const i = d("FmPageHead"), h = d("FmSearch"), k = d("FmTable");
110
- return S(), B(M, null, [
111
- l(i, {
112
- title: o(n)("connect.bin.title")
113
- }, null, 8, ["title"]),
114
- u("div", T, [
115
- l(h, {
116
- modelValue: o(a).searchKey,
117
- "onUpdate:modelValue": t[0] || (t[0] = (r) => o(a).searchKey = r),
118
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
119
- placeholder: o(n)("connect.voucher.search"),
120
- collapsible: ""
121
- }, null, 8, ["modelValue", "placeholder"]),
122
- u("div", $, [
123
- u("div", j, [
124
- l(U, {
125
- modelValue: o(a).location,
126
- "onUpdate:modelValue": t[1] || (t[1] = (r) => o(a).location = r),
127
- label: o(n)("connect.voucher.location"),
128
- "show-item-label": !0,
129
- icon: "storefront",
130
- placement: "bottom-start",
131
- items: o(y).locationItems
132
- }, null, 8, ["modelValue", "label", "items"])
133
- ]),
134
- l(h, {
135
- modelValue: o(a).searchKey,
136
- "onUpdate:modelValue": t[2] || (t[2] = (r) => o(a).searchKey = r),
137
- class: "xs:hidden",
138
- placeholder: o(n)("connect.voucher.search"),
139
- collapsible: ""
140
- }, null, 8, ["modelValue", "placeholder"])
141
- ]),
142
- l(k, {
143
- "row-data": o(m),
144
- "column-defs": w,
145
- "search-value": o(a).searchKey,
146
- "column-filter": [],
147
- onRowClick: t[3] || (t[3] = (r) => e.onEdit(r.original)),
148
- "hide-footer": o(m).length < 10
149
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
150
- l(P, {
151
- ref_key: "sheetRef",
152
- ref: v,
153
- "onSubmit:modelValue": e.onUpdate
154
- }, null, 8, ["onSubmit:modelValue"]),
155
- l(Y, {
156
- ref_key: "sendVoucherSheetRef",
157
- ref: V
158
- }, null, 512)
159
- ])
160
- ], 64);
161
- };
162
- }
163
- });
164
- export {
165
- oe as default
166
- };
@@ -1,233 +0,0 @@
1
- import { defineComponent as U, ref as h, computed as j, onMounted as E, resolveComponent as m, openBlock as d, createElementBlock as y, Fragment as b, createVNode as r, unref as o, createElementVNode as n, withCtx as w, renderList as H, createBlock as v, resolveDynamicComponent as q, toDisplayString as p, createCommentVNode as z, h as G } from "vue";
2
- import { _ as J } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as Q, components as W } from "@feedmepos/ui-library";
4
- import { p as X } from "./plugins-CJlgzIv2.js";
5
- import { u as Y } from "./loading-D5ZAAdUU.js";
6
- import { u as Z } from "./business-gJ9fK_2b.js";
7
- import { u as ee } from "./campaign-BfznfcHc.js";
8
- import { a as B, b as A, g as te } from "./campaign-C_Yq-ffV.js";
9
- import { u as oe } from "./vue-i18n-OdHHHpEE.js";
10
- import { _ as ae } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
- import { _ as ne } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-C2p6_R01.js";
12
- import { u as se } from "./template-aPJnNGLi.js";
13
- import { c as _ } from "./index-Cr_9Bqa1.js";
14
- const ce = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { key: 0 }, ye = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, _e = { class: "flex flex-col gap-16 text-center" }, he = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ke = /* @__PURE__ */ U({
15
- __name: "Broadcast",
16
- setup(we) {
17
- const { t: s } = oe(), L = {
18
- label: s("connect.campaign.common.createCampaign"),
19
- value: "create",
20
- isPrimary: !0,
21
- prependIcon: "add"
22
- }, V = se("BROADCAST", Q()), D = Z(), u = ee(), { global: R, minor: C } = Y, T = h((/* @__PURE__ */ new Date()).toISOString()), c = h({
23
- searchKey: "",
24
- location: []
25
- });
26
- function K(e) {
27
- const t = c.value.location;
28
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
29
- var i;
30
- return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(l);
31
- }) : e.targetLocation.includes(t);
32
- }
33
- const f = j(
34
- () => u.campaigns.broadcast.filter((e) => K(e))
35
- ), O = [
36
- {
37
- header: "Broadcast title",
38
- accessorFn: (e) => e.name
39
- },
40
- {
41
- header: "Status",
42
- accessorFn: (e) => te(e),
43
- cell(e) {
44
- return B(e.row.original);
45
- }
46
- },
47
- {
48
- header: "Summary",
49
- accessorFn: (e) => A(e)
50
- },
51
- {
52
- header: "Message sent",
53
- accessorFn: (e) => e.currentReceive ?? "N/A"
54
- },
55
- {
56
- header: "Actions",
57
- cell(e) {
58
- return G(W.FmButton, {
59
- variant: "tertiary",
60
- icon: "delete",
61
- iconColor: "neutral-gray-400",
62
- onClick: (t) => {
63
- t.stopPropagation(), S(e.row.original);
64
- }
65
- });
66
- }
67
- }
68
- ], x = h();
69
- async function S(e) {
70
- await X.remove(
71
- s("connect.campaign.common.remove.confirm", { name: e.name })
72
- ) && await C(
73
- async () => {
74
- await _.delete(e._id), await u.read("BROADCAST");
75
- },
76
- {
77
- message: s("connect.campaign.common.remove.removing", { name: e.name }),
78
- successMessage: s("connect.campaign.common.remove.removed", {
79
- name: e.name
80
- })
81
- }
82
- );
83
- }
84
- async function g(e) {
85
- T.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await t() : V.open(async (l) => {
86
- await t(l);
87
- });
88
- async function t(l) {
89
- var i;
90
- (i = x.value) == null || i.showSheet(
91
- !0,
92
- "BROADCAST",
93
- e ? await _.readById(e._id) : void 0,
94
- l
95
- );
96
- }
97
- }
98
- async function I(e) {
99
- await C(
100
- async () => {
101
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await u.read("BROADCAST");
102
- },
103
- {
104
- message: s(
105
- `connect.campaign.broadcast.update.${e.campaign._id ? "updating" : "creating"}`
106
- ),
107
- successMessage: s("connect.campaign.broadcast.update.success", {
108
- action: e.campaign._id ? "updated" : "created"
109
- })
110
- }
111
- );
112
- }
113
- return E(async () => {
114
- await R(async () => {
115
- await u.read("BROADCAST");
116
- });
117
- }), (e, t) => {
118
- const l = m("FmPageHead"), i = m("FmSearch"), $ = m("FmTable"), F = m("FmButton"), P = m("FmListItem"), M = m("FmList"), N = m("FmCard");
119
- return d(), y(b, null, [
120
- r(l, {
121
- title: o(s)("connect.campaign.broadcast.title"),
122
- actions: o(f).length > 0 ? [L] : [],
123
- "onClick:action": t[0] || (t[0] = () => g())
124
- }, null, 8, ["title", "actions"]),
125
- n("div", ce, [
126
- r(i, {
127
- modelValue: o(c).searchKey,
128
- "onUpdate:modelValue": t[1] || (t[1] = (a) => o(c).searchKey = a),
129
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
130
- placeholder: o(s)("connect.campaign.common.search"),
131
- collapsible: ""
132
- }, null, 8, ["modelValue", "placeholder"]),
133
- o(u).campaigns.broadcast && o(u).campaigns.broadcast.length > 0 ? (d(), y(b, { key: 0 }, [
134
- n("div", re, [
135
- n("div", ie, [
136
- r(ae, {
137
- label: `${o(s)("connect.campaign.common.location")}: `,
138
- "right-icon": "keyboard_arrow_down",
139
- modelValue: o(c).location,
140
- "onUpdate:modelValue": t[2] || (t[2] = (a) => o(c).location = a),
141
- icon: "storefront",
142
- "show-item-label": !0,
143
- items: o(D).locationOptions
144
- }, null, 8, ["label", "modelValue", "items"])
145
- ]),
146
- r(i, {
147
- modelValue: o(c).searchKey,
148
- "onUpdate:modelValue": t[3] || (t[3] = (a) => o(c).searchKey = a),
149
- class: "xs:hidden",
150
- placeholder: "search",
151
- collapsible: ""
152
- }, null, 8, ["modelValue"])
153
- ]),
154
- r($, {
155
- class: "xs:hidden",
156
- "row-data": o(f),
157
- "column-defs": O,
158
- "search-value": o(c).searchKey,
159
- "column-filter": [],
160
- onRowClick: t[4] || (t[4] = (a) => g(a.original)),
161
- "hide-footer": !0
162
- }, null, 8, ["row-data", "search-value"]),
163
- r(M, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
164
- default: w(() => [
165
- (d(!0), y(b, null, H(o(f).filter(
166
- (a) => a.name.toLowerCase().includes(o(c).searchKey.toLowerCase())
167
- ), (a) => (d(), v(P, {
168
- key: a._id.toString(),
169
- onClick: (k) => g(a),
170
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
171
- }, {
172
- default: w(() => [
173
- n("div", le, [
174
- n("div", me, [
175
- (d(), v(q(o(B)(a)))),
176
- n("div", de, p(a.currentReceive ?? 0) + " sent ", 1)
177
- ]),
178
- n("div", ue, [
179
- n("div", pe, p(a.name), 1),
180
- n("div", fe, p(o(A)(a)), 1)
181
- ])
182
- ]),
183
- r(F, {
184
- icon: "delete",
185
- "icon-color": "neutral-gray-400",
186
- variant: "tertiary",
187
- onClick: (k) => (k.stopPropagation(), S(a))
188
- }, null, 8, ["onClick"])
189
- ]),
190
- _: 2
191
- }, 1032, ["onClick"]))), 128))
192
- ]),
193
- _: 1
194
- }),
195
- o(f).length == 0 ? (d(), y("div", ge, [
196
- n("div", ye, p(o(s)("connect.campaign.common.noResults")), 1)
197
- ])) : z("", !0)
198
- ], 64)) : (d(), v(N, {
199
- key: 1,
200
- variant: "outlined",
201
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
202
- }, {
203
- default: w(() => [
204
- t[6] || (t[6] = n("img", {
205
- src: J,
206
- class: "aspect-square w-[150px]"
207
- }, null, -1)),
208
- n("div", _e, [
209
- n("div", he, p(o(s)("connect.campaign.broadcast.create.title")), 1),
210
- n("div", be, p(o(s)("connect.campaign.broadcast.create.description")), 1)
211
- ]),
212
- r(F, {
213
- variant: "primary",
214
- label: o(s)("connect.campaign.broadcast.create.button"),
215
- icon: "add",
216
- onClick: t[5] || (t[5] = (a) => g())
217
- }, null, 8, ["label"])
218
- ]),
219
- _: 1
220
- })),
221
- r(ne, {
222
- ref_key: "sheetRef",
223
- ref: x,
224
- "onSubmit:modelValue": I
225
- }, null, 512)
226
- ])
227
- ], 64);
228
- };
229
- }
230
- });
231
- export {
232
- Ke as default
233
- };
@@ -1,121 +0,0 @@
1
- import { R as RuleOperator, _ } from "./index-8RETBwYy.js";
2
- import { i as isRuleGroup } from "./rule-builder-CZUgrDAw.js";
3
- import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, createVNode, toDisplayString } from "vue";
4
- import { useDialog } from "@feedmepos/ui-library";
5
- import { a as F_RUNNABLE_CAMPAIGN_TYPE } from "./index-BTpBLMHl.js";
6
- import "./index-DTyfvK3U.js";
7
- import "./index-IHKkNyxb.js";
8
- import "./index-C6Iyn1Q6.js";
9
- function validateRule(data, r, date) {
10
- const rules = new RuleOperator(date ?? /* @__PURE__ */ new Date());
11
- function meetConditions(e) {
12
- return Object.entries(e.conditions ?? {}).reduce(
13
- (o, [n, t]) => {
14
- const l = e.property ? e.property === "__now" ? rules.ruleNow : _.get(data, e.property) : data;
15
- if (t == null)
16
- return console.log("Bad data, ignoring rule", {
17
- // property: r.property,
18
- // source,
19
- conditionKey: n,
20
- equator: t
21
- // raw: data,
22
- }), o;
23
- const i = rules[n](
24
- l,
25
- t
26
- );
27
- return o && i;
28
- },
29
- !0
30
- );
31
- }
32
- function evaluateRuleResult(rr, logic) {
33
- const target = Object.entries(rr).reduce((e, [o, n]) => e.replace(RegExp(`\\b${o}\\b`, "g"), n ? "true" : "false"), logic);
34
- return !logic || !!eval(target);
35
- }
36
- function getRuleResults(e) {
37
- return isRuleGroup(e) ? Object.entries(e.rules).reduce((o, [n, t]) => ({
38
- ...o,
39
- [n]: isRuleGroup(t) ? evaluateRuleResult(getRuleResults(t), t.logic) : meetConditions(t)
40
- }), {}) : {
41
- [e.name]: meetConditions(e)
42
- };
43
- }
44
- return isRuleGroup(r) ? evaluateRuleResult(getRuleResults(r), r.logic) : meetConditions(r);
45
- }
46
- const _hoisted_1 = { class: "flex flex-col h-full space-y-24" }, _hoisted_2 = { class: "fm-typo-en-title-sm-600" }, _hoisted_3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main = /* @__PURE__ */ defineComponent({
47
- __name: "CampaignTypeDialog",
48
- props: {
49
- onSelect: {
50
- type: Function,
51
- required: !0
52
- }
53
- },
54
- setup(e) {
55
- const o = e, n = useDialog(), t = [
56
- {
57
- title: "Promotion",
58
- description: "Special offers or deals made available for a limited time",
59
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.PROMOTION
60
- },
61
- {
62
- title: "Voucher",
63
- description: "A digital coupon that can be redeemed for a discounts on future purchases.",
64
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.VOUCHER
65
- },
66
- {
67
- title: "Experience",
68
- description: "Experience points help customers gain membership tiers.",
69
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.POINT
70
- },
71
- {
72
- title: "Point",
73
- description: "Points allow customers to purchase bundle items.",
74
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.COIN
75
- },
76
- {
77
- title: "Game",
78
- description: "The game feature adds a fun and encourage customers to engage more.",
79
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.GAME
80
- },
81
- {
82
- title: "Credit",
83
- description: "Credits are virtual money that customers can use to pay for their purchases.",
84
- value: F_RUNNABLE_CAMPAIGN_TYPE.enum.CREDIT
85
- }
86
- ];
87
- function l(i) {
88
- n.close(), o.onSelect(i);
89
- }
90
- return (i, a) => {
91
- const c = resolveComponent("FmCard");
92
- return openBlock(), createBlock(c, { class: "p-24 space-y-16" }, {
93
- default: withCtx(() => [
94
- a[0] || (a[0] = createElementVNode("div", { class: "" }, [
95
- createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Add benefit"),
96
- createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Select the benefit type that you want to reward the selected tier. ")
97
- ], -1)),
98
- createElementVNode("div", _hoisted_1, [
99
- (openBlock(), createElementBlock(Fragment, null, renderList(t, (s) => createVNode(c, {
100
- variant: "outlined",
101
- key: s.value,
102
- onClick: (u) => l(s.value),
103
- class: "p-16 space-y-8 cursor-pointer"
104
- }, {
105
- default: withCtx(() => [
106
- createElementVNode("div", _hoisted_2, toDisplayString(s.title), 1),
107
- createElementVNode("div", _hoisted_3, toDisplayString(s.description), 1)
108
- ]),
109
- _: 2
110
- }, 1032, ["onClick"])), 64))
111
- ])
112
- ]),
113
- _: 1
114
- });
115
- };
116
- }
117
- });
118
- export {
119
- _sfc_main as _,
120
- validateRule as v
121
- };