@feedmepos/mf-connect 0.1.38-beta.73 → 0.1.38-beta.74

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 (133) hide show
  1. package/package.json +1 -1
  2. package/dist/Analytic-gGjm5ome.js +0 -761
  3. package/dist/App-BDz9mw-6.js +0 -4638
  4. package/dist/AuditLogs-4x90ZjjY.js +0 -1991
  5. package/dist/Bin-Bby2f42O.js +0 -166
  6. package/dist/Broadcast-eYN2AqFC.js +0 -267
  7. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B-fO9-Hb.js +0 -121
  8. package/dist/Card-Cz-pLt7X.js +0 -909
  9. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  10. package/dist/Collections-CgfXuVA1.js +0 -540
  11. package/dist/Credit-Lc6B2oQ9.js +0 -261
  12. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bm7XTR7o.js +0 -3167
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Cp5nSLEX.js +0 -351
  16. package/dist/Experience-Ca94IJBt.js +0 -260
  17. package/dist/FileSaver.min-BThLVsSf.js +0 -74
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  19. package/dist/Game-BYLYDTU9.js +0 -331
  20. package/dist/GenerateMaterial-CUoG6uyI.js +0 -589
  21. package/dist/Grab-DZ_LkTly.js +0 -301
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-CI4kP9ul.js +0 -145
  23. package/dist/Index-BZ2r8x0t.js +0 -259
  24. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  25. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-BLKlXW1b.js +0 -18737
  26. package/dist/MainLayout-BfGSSVMW.js +0 -41
  27. package/dist/Marketing-DYg0J1xG.js +0 -145
  28. package/dist/MarketingMaterialEdit-B--Kck7j.js +0 -746
  29. package/dist/Member-By5QEJxn.js +0 -280
  30. package/dist/MemberList-D49bMmGJ.js +0 -1600
  31. package/dist/MemberOverview-wL_ailso.js +0 -58
  32. package/dist/MemberTransactions-Cz9XENK1.js +0 -45
  33. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-IlFjM-Y5.js +0 -60798
  34. package/dist/Mission-Cvl-V7c8.js +0 -335
  35. package/dist/Overview-lu82lUJp.js +0 -1078
  36. package/dist/Point-C65YFhOB.js +0 -263
  37. package/dist/Promotion-DQCrKO6a.js +0 -397
  38. package/dist/Queue-DR5lfSMi.js +0 -259
  39. package/dist/Record-BCt42_VZ.js +0 -341
  40. package/dist/Reward-7aOnjmMm.js +0 -442
  41. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BPgjr91S.js +0 -149
  42. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Bp5jnlFr.js +0 -1912
  43. package/dist/Segment-DiYwfb8M.js +0 -881
  44. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-ydM5ypC0.js +0 -181
  45. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BRs7pw0l.js +0 -188
  46. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DU8AAPFD.js +0 -147
  47. package/dist/Setting-k6xShcs8.js +0 -1999
  48. package/dist/SettingAdvertisements-DQa_jXYM.js +0 -263
  49. package/dist/Store-B6lYBpsm.js +0 -1995
  50. package/dist/StoreRewards-Cqd399q8.js +0 -534
  51. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Wv_SHwmo.js +0 -1128
  52. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Bi1o4YAz.js +0 -7005
  53. package/dist/Tier-CXXImaDx.js +0 -969
  54. package/dist/Title-CTxNCmBW.js +0 -567
  55. package/dist/Transaction-DonaHVzF.js +0 -39
  56. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DbRVYccO.js +0 -130
  57. package/dist/Voucher-Bso_Mjlg.js +0 -422
  58. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DNvmaJk9.js +0 -421
  59. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-KHZ3-THo.js +0 -56
  60. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  61. package/dist/app-DKrmktFJ.js +0 -59071
  62. package/dist/app-wDQR6dpb.js +0 -39
  63. package/dist/app.js +0 -7
  64. package/dist/business-Dd73TVX5.js +0 -82
  65. package/dist/campaign-BUQHH4KL.js +0 -100
  66. package/dist/campaign-CpzFl8Vr.js +0 -4
  67. package/dist/campaign-DkJOyF24.js +0 -253
  68. package/dist/campaign.enum-C8vJuDAq.js +0 -26
  69. package/dist/campaign.fn-DJSpfhZH.js +0 -776
  70. package/dist/collectible.enum-D3W0TwoJ.js +0 -19
  71. package/dist/collection.fn-YzgpOmG0.js +0 -26
  72. package/dist/dto-sceHHLGr.js +0 -222
  73. package/dist/duplicateCampaign-CDulKxgJ.js +0 -51
  74. package/dist/effect-BSgfR9iB.js +0 -89
  75. package/dist/email-addresses-D_fyxOof.js +0 -705
  76. package/dist/export-OxiqL1B7.js +0 -96
  77. package/dist/feedme.ico +0 -0
  78. package/dist/helper-CzurWUe4.js +0 -86
  79. package/dist/index-BF0hGAkO.js +0 -32
  80. package/dist/index-BGMhsZnB.js +0 -124
  81. package/dist/index-B_QGGlMD.js +0 -54
  82. package/dist/index-BbTHqh58.js +0 -31
  83. package/dist/index-BqQas5Sx.js +0 -2428
  84. package/dist/index-BtMmY44D.js +0 -36
  85. package/dist/index-CAUVTn1I.js +0 -67
  86. package/dist/index-Cg-sBBf_.js +0 -3419
  87. package/dist/index-CuvNtC_M.js +0 -61
  88. package/dist/index-Cyt6eKEF.js +0 -8912
  89. package/dist/index-Dw3ew6qN.js +0 -85
  90. package/dist/index-IBvUTxqC.js +0 -30289
  91. package/dist/index-pkwrUX33.js +0 -28897
  92. package/dist/index-tYmg4eyJ.js +0 -3
  93. package/dist/index-vh86FiIQ.js +0 -10
  94. package/dist/index.esm2017-5xGykkgL.js +0 -3069
  95. package/dist/loading-CvHPT80F.js +0 -215
  96. package/dist/lodash-Q-_FPkpI.js +0 -3678
  97. package/dist/membership-CU-wFWan.js +0 -235
  98. package/dist/moment-D7p2TMB-.js +0 -2583
  99. package/dist/money-CzlfhEoe.js +0 -15
  100. package/dist/number-Bee2M41N.js +0 -12
  101. package/dist/object-qECH92oz.js +0 -26
  102. package/dist/objectId-dwaoBfJX.js +0 -7
  103. package/dist/objectid-DRJQv7AY.js +0 -145
  104. package/dist/plugins-CAdlnev8.js +0 -1817
  105. package/dist/remy-D_Deb3ue.js +0 -13
  106. package/dist/reward-BhlYd0FB.js +0 -36
  107. package/dist/rule-Ccvu41A_.js +0 -1969
  108. package/dist/rule-builder-B968rIyS.js +0 -102
  109. package/dist/style.css +0 -13
  110. package/dist/template-OZfyPJVE.js +0 -188
  111. package/dist/tier-BJDhpH6X.js +0 -4
  112. package/dist/tiers/tier=1.png +0 -0
  113. package/dist/tiers/tier=2.png +0 -0
  114. package/dist/tiers/tier=3.png +0 -0
  115. package/dist/tiers/tier=4.png +0 -0
  116. package/dist/timezone-CopuRbDK.js +0 -1154
  117. package/dist/titles/type=diamond.png +0 -0
  118. package/dist/titles/type=drinks.png +0 -0
  119. package/dist/titles/type=food.png +0 -0
  120. package/dist/titles/type=heart.png +0 -0
  121. package/dist/titles/type=medal.png +0 -0
  122. package/dist/titles/type=spend.png +0 -0
  123. package/dist/titles/type=thank-you.png +0 -0
  124. package/dist/titles/type=thumbs-up.png +0 -0
  125. package/dist/titles/type=years.png +0 -0
  126. package/dist/trigger-BtQI81FL.js +0 -213
  127. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  128. package/dist/type_drinks-D6jnpvwV.js +0 -4
  129. package/dist/usePagination-Ciom38dd.js +0 -266
  130. package/dist/user-BOW0ixDK.js +0 -55
  131. package/dist/vue-i18n-jTYKTJq1.js +0 -2365
  132. package/dist/xlsx-YD3LYwip.js +0 -15491
  133. package/dist/zod-B_G9o5PC.js +0 -91
@@ -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-CvHPT80F.js";
4
- import { u as R } from "./business-Dd73TVX5.js";
5
- import { C as A } from "./campaign-DkJOyF24.js";
6
- import { _ as P } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bm7XTR7o.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-DU8AAPFD.js";
9
- import { u as D } from "./vue-i18n-jTYKTJq1.js";
10
- import { h as E } from "./moment-D7p2TMB-.js";
11
- import { p as I } from "./plugins-CAdlnev8.js";
12
- import { c as g } from "./index-BGMhsZnB.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,267 +0,0 @@
1
- import { defineComponent as H, ref as C, computed as q, onMounted as z, resolveComponent as m, openBlock as d, createElementBlock as h, Fragment as v, createVNode as i, unref as a, createElementVNode as n, withCtx as x, renderList as G, createBlock as S, resolveDynamicComponent as J, toDisplayString as u, createCommentVNode as Q, h as k } from "vue";
2
- import { _ as W } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as X, components as L } from "@feedmepos/ui-library";
4
- import { p as Y } from "./plugins-CAdlnev8.js";
5
- import { u as Z } from "./loading-CvHPT80F.js";
6
- import { u as ee } from "./business-Dd73TVX5.js";
7
- import { u as te } from "./campaign-BUQHH4KL.js";
8
- import { b as V, c as R, a as ae } from "./campaign-DkJOyF24.js";
9
- import { c as oe, p as ne } from "./duplicateCampaign-CDulKxgJ.js";
10
- import { u as se } from "./vue-i18n-jTYKTJq1.js";
11
- import { _ as ce } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
12
- import { _ as ie } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bm7XTR7o.js";
13
- import { u as re } from "./template-OZfyPJVE.js";
14
- import { c as f } from "./index-BGMhsZnB.js";
15
- const le = { class: "px-24 flex flex-col gap-y-16" }, me = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, pe = { class: "space-y-8" }, ue = { class: "flex w-full gap-4 items-center" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "space-y-4" }, ye = { class: "fm-typo-en-body-lg-600" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, he = { class: "flex items-center gap-8" }, we = { key: 0 }, be = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, Ce = { class: "flex flex-col gap-16 text-center" }, ve = { class: "fm-typo-en-title-sm-800" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, je = /* @__PURE__ */ H({
16
- __name: "Broadcast",
17
- setup(Se) {
18
- const { t: s } = se(), O = {
19
- label: s("connect.campaign.common.createCampaign"),
20
- value: "create",
21
- isPrimary: !0,
22
- prependIcon: "add"
23
- }, T = re("BROADCAST", X()), I = ee(), p = te(), { global: K, minor: F } = Z, B = C((/* @__PURE__ */ new Date()).toISOString()), r = C({
24
- searchKey: "",
25
- location: []
26
- });
27
- function P(e) {
28
- const t = r.value.location;
29
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
30
- var c;
31
- return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
32
- }) : e.targetLocation.includes(t);
33
- }
34
- const g = q(
35
- () => p.campaigns.broadcast.filter((e) => P(e))
36
- ), $ = [
37
- {
38
- header: "Broadcast title",
39
- accessorFn: (e) => e.name
40
- },
41
- {
42
- header: "Status",
43
- accessorFn: (e) => ae(e),
44
- cell(e) {
45
- return V(e.row.original);
46
- }
47
- },
48
- {
49
- header: "Summary",
50
- accessorFn: (e) => R(e)
51
- },
52
- {
53
- header: "Message sent",
54
- accessorFn: (e) => e.currentReceive ?? "N/A"
55
- },
56
- {
57
- header: "Actions",
58
- cell(e) {
59
- return k("div", { class: "flex items-center gap-8 justify-end" }, [
60
- k(L.FmButton, {
61
- variant: "tertiary",
62
- icon: "content_copy",
63
- iconColor: "neutral-gray-400",
64
- onClick: async (t) => {
65
- t.stopPropagation(), await D(e.row.original);
66
- }
67
- }),
68
- k(L.FmButton, {
69
- variant: "tertiary",
70
- icon: "delete",
71
- iconColor: "neutral-gray-400",
72
- onClick: (t) => {
73
- t.stopPropagation(), A(e.row.original);
74
- }
75
- })
76
- ]);
77
- }
78
- }
79
- ], w = C();
80
- async function A(e) {
81
- await Y.remove(
82
- s("connect.campaign.common.remove.confirm", { name: e.name })
83
- ) && await F(
84
- async () => {
85
- await f.delete(e._id), await p.read("BROADCAST");
86
- },
87
- {
88
- message: s("connect.campaign.common.remove.removing", { name: e.name }),
89
- successMessage: s("connect.campaign.common.remove.removed", {
90
- name: e.name
91
- })
92
- }
93
- );
94
- }
95
- async function y(e) {
96
- B.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await t() : T.open(async (l) => {
97
- await t(l);
98
- });
99
- async function t(l) {
100
- var c;
101
- (c = w.value) == null || c.showSheet(
102
- !0,
103
- "BROADCAST",
104
- e ? await f.readById(e._id) : void 0,
105
- l
106
- );
107
- }
108
- }
109
- async function D(e) {
110
- var c;
111
- if (!await oe(e.name))
112
- return;
113
- B.value = (/* @__PURE__ */ new Date()).toISOString();
114
- const t = await f.readById(e._id), l = ne(t);
115
- (c = w.value) == null || c.showSheet(
116
- !0,
117
- "BROADCAST",
118
- l,
119
- t.template
120
- );
121
- }
122
- async function j(e) {
123
- await F(
124
- async () => {
125
- e.campaign._id ? await f.update(e.campaign._id, e) : await f.create(e), await p.read("BROADCAST");
126
- },
127
- {
128
- message: s(
129
- `connect.campaign.broadcast.update.${e.campaign._id ? "updating" : "creating"}`
130
- ),
131
- successMessage: s("connect.campaign.broadcast.update.success", {
132
- action: e.campaign._id ? "updated" : "created"
133
- })
134
- }
135
- );
136
- }
137
- return z(async () => {
138
- await K(async () => {
139
- await p.read("BROADCAST");
140
- });
141
- }), (e, t) => {
142
- const l = m("FmPageHead"), c = m("FmSearch"), M = m("FmTable"), b = m("FmButton"), N = m("FmListItem"), U = m("FmList"), E = m("FmCard");
143
- return d(), h(v, null, [
144
- i(l, {
145
- title: a(s)("connect.campaign.broadcast.title"),
146
- actions: a(g).length > 0 ? [O] : [],
147
- "onClick:action": t[0] || (t[0] = () => y())
148
- }, null, 8, ["title", "actions"]),
149
- n("div", le, [
150
- i(c, {
151
- modelValue: a(r).searchKey,
152
- "onUpdate:modelValue": t[1] || (t[1] = (o) => a(r).searchKey = o),
153
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
154
- placeholder: a(s)("connect.campaign.common.search"),
155
- collapsible: ""
156
- }, null, 8, ["modelValue", "placeholder"]),
157
- a(p).campaigns.broadcast && a(p).campaigns.broadcast.length > 0 ? (d(), h(v, { key: 0 }, [
158
- n("div", me, [
159
- n("div", de, [
160
- i(ce, {
161
- label: `${a(s)("connect.campaign.common.location")}: `,
162
- "right-icon": "keyboard_arrow_down",
163
- modelValue: a(r).location,
164
- "onUpdate:modelValue": t[2] || (t[2] = (o) => a(r).location = o),
165
- icon: "storefront",
166
- "show-item-label": !0,
167
- items: a(I).locationOptions
168
- }, null, 8, ["label", "modelValue", "items"])
169
- ]),
170
- i(c, {
171
- modelValue: a(r).searchKey,
172
- "onUpdate:modelValue": t[3] || (t[3] = (o) => a(r).searchKey = o),
173
- class: "xs:hidden sm:hidden",
174
- placeholder: "search",
175
- collapsible: ""
176
- }, null, 8, ["modelValue"])
177
- ]),
178
- i(M, {
179
- class: "xs:hidden sm:hidden",
180
- "row-data": a(g),
181
- "column-defs": $,
182
- "search-value": a(r).searchKey,
183
- "column-filter": [],
184
- onRowClick: t[4] || (t[4] = (o) => y(o.original)),
185
- "hide-footer": !0
186
- }, null, 8, ["row-data", "search-value"]),
187
- i(U, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
188
- default: x(() => [
189
- (d(!0), h(v, null, G(a(g).filter(
190
- (o) => o.name.toLowerCase().includes(a(r).searchKey.toLowerCase())
191
- ), (o) => (d(), S(N, {
192
- key: o._id.toString(),
193
- onClick: (_) => y(o),
194
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
195
- }, {
196
- default: x(() => [
197
- n("div", pe, [
198
- n("div", ue, [
199
- (d(), S(J(a(V)(o)))),
200
- n("div", fe, u(o.currentReceive ?? 0) + " sent ", 1)
201
- ]),
202
- n("div", ge, [
203
- n("div", ye, u(o.name), 1),
204
- n("div", _e, u(a(R)(o)), 1)
205
- ])
206
- ]),
207
- n("div", he, [
208
- i(b, {
209
- icon: "content_copy",
210
- "icon-color": "neutral-gray-400",
211
- variant: "tertiary",
212
- onClick: async (_) => {
213
- _.stopPropagation(), await D(o);
214
- }
215
- }, null, 8, ["onClick"]),
216
- i(b, {
217
- icon: "delete",
218
- "icon-color": "neutral-gray-400",
219
- variant: "tertiary",
220
- onClick: (_) => (_.stopPropagation(), A(o))
221
- }, null, 8, ["onClick"])
222
- ])
223
- ]),
224
- _: 2
225
- }, 1032, ["onClick"]))), 128))
226
- ]),
227
- _: 1
228
- }),
229
- a(g).length == 0 ? (d(), h("div", we, [
230
- n("div", be, u(a(s)("connect.campaign.common.noResults")), 1)
231
- ])) : Q("", !0)
232
- ], 64)) : (d(), S(E, {
233
- key: 1,
234
- variant: "outlined",
235
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
236
- }, {
237
- default: x(() => [
238
- t[6] || (t[6] = n("img", {
239
- src: W,
240
- class: "aspect-square w-[150px]"
241
- }, null, -1)),
242
- n("div", Ce, [
243
- n("div", ve, u(a(s)("connect.campaign.broadcast.create.title")), 1),
244
- n("div", xe, u(a(s)("connect.campaign.broadcast.create.description")), 1)
245
- ]),
246
- i(b, {
247
- variant: "primary",
248
- label: a(s)("connect.campaign.broadcast.create.button"),
249
- icon: "add",
250
- onClick: t[5] || (t[5] = (o) => y())
251
- }, null, 8, ["label"])
252
- ]),
253
- _: 1
254
- })),
255
- i(ie, {
256
- ref_key: "sheetRef",
257
- ref: w,
258
- "onSubmit:modelValue": j
259
- }, null, 512)
260
- ])
261
- ], 64);
262
- };
263
- }
264
- });
265
- export {
266
- je as default
267
- };
@@ -1,121 +0,0 @@
1
- import { R as RuleOperator, _ } from "./index-Cyt6eKEF.js";
2
- import { i as isRuleGroup } from "./rule-builder-B968rIyS.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 "./index-BqQas5Sx.js";
6
- import { a as F_RUNNABLE_CAMPAIGN_TYPE } from "./index-Cg-sBBf_.js";
7
- import "./index-IBvUTxqC.js";
8
- import "./index-B_QGGlMD.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
- };