@feedmepos/mf-connect 0.1.98-beta.15 → 0.1.98-beta.16

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 (138) hide show
  1. package/dist/App-DNXDhULP.js +4782 -0
  2. package/dist/AuditLogs-BNS27IJT.js +2013 -0
  3. package/dist/Bin-Dkjyrbz-.js +166 -0
  4. package/dist/Broadcast-B-fpjVzY.js +266 -0
  5. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-qBcG-vPM.js +120 -0
  6. package/dist/Card-BvVHO8kN.js +910 -0
  7. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  8. package/dist/Collections-BLxPSOJl.js +540 -0
  9. package/dist/Credit-DU-stilH.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bqnb00zk.js +3377 -0
  13. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CTSfEq5N.js +351 -0
  14. package/dist/Experience-C3tB8hTp.js +259 -0
  15. package/dist/FileSaver.min-EIworvUf.js +74 -0
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  17. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  18. package/dist/Game-Dq1ms2fA.js +330 -0
  19. package/dist/Grab-DnSO2oLx.js +300 -0
  20. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-n1r2bgOE.js +145 -0
  21. package/dist/Index-BFIHgW9W.js +259 -0
  22. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-Do7CJZuh.js +48 -0
  24. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-vpJmHgKM.js +18737 -0
  25. package/dist/LoyaltyDashboard-CcBogXzl.js +1082 -0
  26. package/dist/MainLayout-CPNiL_et.js +41 -0
  27. package/dist/Marketing-Bzb1VaVA.js +235 -0
  28. package/dist/MarketingMaterialEdit-8UQNx3mV.js +1035 -0
  29. package/dist/Member-Drb_NVrb.js +280 -0
  30. package/dist/MemberList-wa3JxCVr.js +1601 -0
  31. package/dist/MemberOverview-wL_ailso.js +58 -0
  32. package/dist/MemberTransactions-8qlm-T67.js +45 -0
  33. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BHicaUXs.js +60802 -0
  34. package/dist/Mission-DmWbQmOv.js +334 -0
  35. package/dist/Overview-COEFtf12.js +1079 -0
  36. package/dist/Overview-D7ki-aBA.js +969 -0
  37. package/dist/Point-B0W-BcPA.js +262 -0
  38. package/dist/Promotion-CY16SjmK.js +397 -0
  39. package/dist/Queue-hMur40Xc.js +260 -0
  40. package/dist/Record-Bj7GQP1r.js +342 -0
  41. package/dist/Review-Z1XD6bJK.js +45 -0
  42. package/dist/ReviewFacebookCallback-DirGtKLX.js +248 -0
  43. package/dist/ReviewGoogleCallback-CVC6741e.js +213 -0
  44. package/dist/Reward-DDB5Usau.js +442 -0
  45. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-B-OnKAbx.js +149 -0
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DDHM8NLi.js +1911 -0
  47. package/dist/Segment-Bl0k9fvJ.js +1014 -0
  48. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-C33DPiN6.js +181 -0
  49. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-YMpQ-IiW.js +188 -0
  50. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang--Rtf3gRa.js +226 -0
  51. package/dist/Setting-CpD98E2N.js +2047 -0
  52. package/dist/SettingAdvertisements-BZFQu_HI.js +264 -0
  53. package/dist/Settings-CRqlKNsc.js +228 -0
  54. package/dist/Store-CDG2_iqc.js +1996 -0
  55. package/dist/StoreRewards-DIU5hPXv.js +540 -0
  56. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B82RH_ZC.js +1133 -0
  57. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DKGCmk5y.js +7007 -0
  58. package/dist/Tier-BXgIdYDa.js +969 -0
  59. package/dist/Title-DgHxyV8p.js +566 -0
  60. package/dist/Transaction-iDacnm6Y.js +39 -0
  61. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-RUbR6pdK.js +130 -0
  62. package/dist/Voucher-C-I8JK4F.js +421 -0
  63. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BUpYZxij.js +421 -0
  64. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-LhG5jJq3.js +56 -0
  65. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  66. package/dist/app-CyNzTZOx.js +59950 -0
  67. package/dist/app-wDQR6dpb.js +39 -0
  68. package/dist/app.js +7 -0
  69. package/dist/business-o_sAO_33.js +82 -0
  70. package/dist/campaign--IUcyI8h.js +219 -0
  71. package/dist/campaign-CpzFl8Vr.js +4 -0
  72. package/dist/campaign-zLKyql03.js +277 -0
  73. package/dist/campaign.enum-CEbNgaGZ.js +26 -0
  74. package/dist/campaign.fn-BVT0m6Uy.js +776 -0
  75. package/dist/collectible.enum-2y8KIQLL.js +19 -0
  76. package/dist/duplicateCampaign-DIzdQf0e.js +51 -0
  77. package/dist/effect-B6gKaH4T.js +89 -0
  78. package/dist/email-addresses-CO9GNnUN.js +705 -0
  79. package/dist/export-DdDpRFVg.js +97 -0
  80. package/dist/feedme.ico +0 -0
  81. package/dist/google-BQK68wbe.js +5 -0
  82. package/dist/helper-DqypCsTm.js +86 -0
  83. package/dist/index-BK0OmX3R.js +85 -0
  84. package/dist/index-Bc7JXl59.js +54 -0
  85. package/dist/index-BgiIGrLb.js +32 -0
  86. package/dist/index-C-TiT9bf.js +1157 -0
  87. package/dist/index-COXmoOd1.js +3678 -0
  88. package/dist/index-CT6uJJ9y.js +151 -0
  89. package/dist/index-Ci2gFCfD.js +61 -0
  90. package/dist/index-CtJ0MQQ1.js +3 -0
  91. package/dist/index-CuvNtC_M.js +61 -0
  92. package/dist/index-D41Xq5qY.js +8910 -0
  93. package/dist/index-DBD_e_yR.js +31 -0
  94. package/dist/index-DDpz9LmI.js +67 -0
  95. package/dist/index-Dh2apeby.js +2819 -0
  96. package/dist/index-DiDmMG_M.js +28900 -0
  97. package/dist/index-pjXQwa0j.js +30289 -0
  98. package/dist/index-vh86FiIQ.js +10 -0
  99. package/dist/index.esm2017-Cd4FhecE.js +3069 -0
  100. package/dist/loading-D-RglDMV.js +72 -0
  101. package/dist/lodash-cggYhL9V.js +3678 -0
  102. package/dist/membership-DTfMyKwP.js +255 -0
  103. package/dist/moment-D7p2TMB-.js +2583 -0
  104. package/dist/money-fGZfbdgV.js +15 -0
  105. package/dist/number-BOalh3ZH.js +12 -0
  106. package/dist/object-BYyQ0PZp.js +18 -0
  107. package/dist/objectId-dwaoBfJX.js +7 -0
  108. package/dist/objectid-zPJFVngY.js +145 -0
  109. package/dist/plugins-CbpvMMOJ.js +1788 -0
  110. package/dist/reward-DkVAHEq2.js +36 -0
  111. package/dist/rule-EzWg2u8d.js +1969 -0
  112. package/dist/string-Gcy5IM_H.js +32 -0
  113. package/dist/style.css +4 -0
  114. package/dist/template-BfVFq4on.js +188 -0
  115. package/dist/tier-BJDhpH6X.js +4 -0
  116. package/dist/tiers/tier=1.png +0 -0
  117. package/dist/tiers/tier=2.png +0 -0
  118. package/dist/tiers/tier=3.png +0 -0
  119. package/dist/tiers/tier=4.png +0 -0
  120. package/dist/titles/type=diamond.png +0 -0
  121. package/dist/titles/type=drinks.png +0 -0
  122. package/dist/titles/type=food.png +0 -0
  123. package/dist/titles/type=heart.png +0 -0
  124. package/dist/titles/type=medal.png +0 -0
  125. package/dist/titles/type=spend.png +0 -0
  126. package/dist/titles/type=thank-you.png +0 -0
  127. package/dist/titles/type=thumbs-up.png +0 -0
  128. package/dist/titles/type=years.png +0 -0
  129. package/dist/trigger-es-_uiSg.js +213 -0
  130. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  131. package/dist/type_drinks-D6jnpvwV.js +4 -0
  132. package/dist/useMarketingMaterialActions-CpiIKMmG.js +107 -0
  133. package/dist/usePagination-SYsXgU6x.js +220 -0
  134. package/dist/user-DUe40u3g.js +55 -0
  135. package/dist/vue-i18n-Dn9zxRuv.js +2365 -0
  136. package/dist/xlsx-DugGi7dB.js +15491 -0
  137. package/dist/zod-Dw8_B6RC.js +91 -0
  138. package/package.json +1 -1
@@ -0,0 +1,166 @@
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-D-RglDMV.js";
4
+ import { u as R } from "./business-o_sAO_33.js";
5
+ import { C as A } from "./campaign-zLKyql03.js";
6
+ import { _ as P } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bqnb00zk.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--Rtf3gRa.js";
9
+ import { u as D } from "./vue-i18n-Dn9zxRuv.js";
10
+ import { h as E } from "./moment-D7p2TMB-.js";
11
+ import { p as I } from "./plugins-CbpvMMOJ.js";
12
+ import { c as g } from "./campaign--IUcyI8h.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
+ };
@@ -0,0 +1,266 @@
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-CbpvMMOJ.js";
5
+ import { u as Z } from "./loading-D-RglDMV.js";
6
+ import { u as ee } from "./business-o_sAO_33.js";
7
+ import { u as te, c as g } from "./campaign--IUcyI8h.js";
8
+ import { b as V, c as R, a as ae } from "./campaign-zLKyql03.js";
9
+ import { c as oe, p as ne } from "./duplicateCampaign-DIzdQf0e.js";
10
+ import { u as se } from "./vue-i18n-Dn9zxRuv.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-Bqnb00zk.js";
13
+ import { u as re } from "./template-BfVFq4on.js";
14
+ 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" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { 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" }, $e = /* @__PURE__ */ H({
15
+ __name: "Broadcast",
16
+ setup(Se) {
17
+ const { t: s } = se(), O = {
18
+ label: s("connect.campaign.common.createCampaign"),
19
+ value: "create",
20
+ isPrimary: !0,
21
+ prependIcon: "add"
22
+ }, T = re("BROADCAST", X()), I = ee(), p = te(), { global: K, minor: F } = Z, B = C((/* @__PURE__ */ new Date()).toISOString()), r = C({
23
+ searchKey: "",
24
+ location: []
25
+ });
26
+ function P(e) {
27
+ const t = r.value.location;
28
+ return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((l) => {
29
+ var c;
30
+ return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
31
+ }) : e.targetLocation.includes(t);
32
+ }
33
+ const f = q(
34
+ () => p.campaigns.broadcast.filter((e) => P(e))
35
+ ), $ = [
36
+ {
37
+ header: "Broadcast title",
38
+ accessorFn: (e) => e.name
39
+ },
40
+ {
41
+ header: "Status",
42
+ accessorFn: (e) => ae(e),
43
+ cell(e) {
44
+ return V(e.row.original);
45
+ }
46
+ },
47
+ {
48
+ header: "Summary",
49
+ accessorFn: (e) => R(e)
50
+ },
51
+ {
52
+ header: "Message sent",
53
+ accessorFn: (e) => e.currentReceive ?? "N/A"
54
+ },
55
+ {
56
+ header: "Actions",
57
+ cell(e) {
58
+ return k("div", { class: "flex items-center gap-8 justify-end" }, [
59
+ k(L.FmButton, {
60
+ variant: "tertiary",
61
+ icon: "content_copy",
62
+ iconColor: "neutral-gray-400",
63
+ onClick: async (t) => {
64
+ t.stopPropagation(), await D(e.row.original);
65
+ }
66
+ }),
67
+ k(L.FmButton, {
68
+ variant: "tertiary",
69
+ icon: "delete",
70
+ iconColor: "neutral-gray-400",
71
+ onClick: (t) => {
72
+ t.stopPropagation(), A(e.row.original);
73
+ }
74
+ })
75
+ ]);
76
+ }
77
+ }
78
+ ], w = C();
79
+ async function A(e) {
80
+ await Y.remove(
81
+ s("connect.campaign.common.remove.confirm", { name: e.name })
82
+ ) && await F(
83
+ async () => {
84
+ await g.delete(e._id), await p.read("BROADCAST");
85
+ },
86
+ {
87
+ message: s("connect.campaign.common.remove.removing", { name: e.name }),
88
+ successMessage: s("connect.campaign.common.remove.removed", {
89
+ name: e.name
90
+ })
91
+ }
92
+ );
93
+ }
94
+ async function y(e) {
95
+ B.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await t() : T.open(async (l) => {
96
+ await t(l);
97
+ });
98
+ async function t(l) {
99
+ var c;
100
+ (c = w.value) == null || c.showSheet(
101
+ !0,
102
+ "BROADCAST",
103
+ e ? await g.readById(e._id) : void 0,
104
+ l
105
+ );
106
+ }
107
+ }
108
+ async function D(e) {
109
+ var c;
110
+ if (!await oe(e.name))
111
+ return;
112
+ B.value = (/* @__PURE__ */ new Date()).toISOString();
113
+ const t = await g.readById(e._id), l = ne(t);
114
+ (c = w.value) == null || c.showSheet(
115
+ !0,
116
+ "BROADCAST",
117
+ l,
118
+ t.template
119
+ );
120
+ }
121
+ async function j(e) {
122
+ await F(
123
+ async () => {
124
+ e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await p.read("BROADCAST");
125
+ },
126
+ {
127
+ message: s(
128
+ `connect.campaign.broadcast.update.${e.campaign._id ? "updating" : "creating"}`
129
+ ),
130
+ successMessage: s("connect.campaign.broadcast.update.success", {
131
+ action: e.campaign._id ? "updated" : "created"
132
+ })
133
+ }
134
+ );
135
+ }
136
+ return z(async () => {
137
+ await K(async () => {
138
+ await p.read("BROADCAST");
139
+ });
140
+ }), (e, t) => {
141
+ const l = m("FmPageHead"), c = m("FmSearch"), M = m("FmTable"), b = m("FmButton"), N = m("FmListItem"), U = m("FmList"), E = m("FmCard");
142
+ return d(), h(v, null, [
143
+ i(l, {
144
+ title: a(s)("connect.campaign.broadcast.title"),
145
+ actions: a(f).length > 0 ? [O] : [],
146
+ "onClick:action": t[0] || (t[0] = () => y())
147
+ }, null, 8, ["title", "actions"]),
148
+ n("div", le, [
149
+ i(c, {
150
+ modelValue: a(r).searchKey,
151
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => a(r).searchKey = o),
152
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
153
+ placeholder: a(s)("connect.campaign.common.search"),
154
+ collapsible: ""
155
+ }, null, 8, ["modelValue", "placeholder"]),
156
+ a(p).campaigns.broadcast && a(p).campaigns.broadcast.length > 0 ? (d(), h(v, { key: 0 }, [
157
+ n("div", me, [
158
+ n("div", de, [
159
+ i(ce, {
160
+ label: `${a(s)("connect.campaign.common.location")}: `,
161
+ "right-icon": "keyboard_arrow_down",
162
+ modelValue: a(r).location,
163
+ "onUpdate:modelValue": t[2] || (t[2] = (o) => a(r).location = o),
164
+ icon: "storefront",
165
+ "show-item-label": !0,
166
+ items: a(I).locationOptions
167
+ }, null, 8, ["label", "modelValue", "items"])
168
+ ]),
169
+ i(c, {
170
+ modelValue: a(r).searchKey,
171
+ "onUpdate:modelValue": t[3] || (t[3] = (o) => a(r).searchKey = o),
172
+ class: "xs:hidden sm:hidden",
173
+ placeholder: "search",
174
+ collapsible: ""
175
+ }, null, 8, ["modelValue"])
176
+ ]),
177
+ i(M, {
178
+ class: "xs:hidden sm:hidden",
179
+ "row-data": a(f),
180
+ "column-defs": $,
181
+ "search-value": a(r).searchKey,
182
+ "column-filter": [],
183
+ onRowClick: t[4] || (t[4] = (o) => y(o.original)),
184
+ "hide-footer": !0
185
+ }, null, 8, ["row-data", "search-value"]),
186
+ i(U, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
187
+ default: x(() => [
188
+ (d(!0), h(v, null, G(a(f).filter(
189
+ (o) => o.name.toLowerCase().includes(a(r).searchKey.toLowerCase())
190
+ ), (o) => (d(), S(N, {
191
+ key: o._id.toString(),
192
+ onClick: (_) => y(o),
193
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
194
+ }, {
195
+ default: x(() => [
196
+ n("div", pe, [
197
+ n("div", ue, [
198
+ (d(), S(J(a(V)(o)))),
199
+ n("div", ge, u(o.currentReceive ?? 0) + " sent ", 1)
200
+ ]),
201
+ n("div", fe, [
202
+ n("div", ye, u(o.name), 1),
203
+ n("div", _e, u(a(R)(o)), 1)
204
+ ])
205
+ ]),
206
+ n("div", he, [
207
+ i(b, {
208
+ icon: "content_copy",
209
+ "icon-color": "neutral-gray-400",
210
+ variant: "tertiary",
211
+ onClick: async (_) => {
212
+ _.stopPropagation(), await D(o);
213
+ }
214
+ }, null, 8, ["onClick"]),
215
+ i(b, {
216
+ icon: "delete",
217
+ "icon-color": "neutral-gray-400",
218
+ variant: "tertiary",
219
+ onClick: (_) => (_.stopPropagation(), A(o))
220
+ }, null, 8, ["onClick"])
221
+ ])
222
+ ]),
223
+ _: 2
224
+ }, 1032, ["onClick"]))), 128))
225
+ ]),
226
+ _: 1
227
+ }),
228
+ a(f).length == 0 ? (d(), h("div", we, [
229
+ n("div", be, u(a(s)("connect.campaign.common.noResults")), 1)
230
+ ])) : Q("", !0)
231
+ ], 64)) : (d(), S(E, {
232
+ key: 1,
233
+ variant: "outlined",
234
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
235
+ }, {
236
+ default: x(() => [
237
+ t[6] || (t[6] = n("img", {
238
+ src: W,
239
+ class: "aspect-square w-[150px]"
240
+ }, null, -1)),
241
+ n("div", Ce, [
242
+ n("div", ve, u(a(s)("connect.campaign.broadcast.create.title")), 1),
243
+ n("div", xe, u(a(s)("connect.campaign.broadcast.create.description")), 1)
244
+ ]),
245
+ i(b, {
246
+ variant: "primary",
247
+ label: a(s)("connect.campaign.broadcast.create.button"),
248
+ icon: "add",
249
+ onClick: t[5] || (t[5] = (o) => y())
250
+ }, null, 8, ["label"])
251
+ ]),
252
+ _: 1
253
+ })),
254
+ i(ie, {
255
+ ref_key: "sheetRef",
256
+ ref: w,
257
+ "onSubmit:modelValue": j
258
+ }, null, 512)
259
+ ])
260
+ ], 64);
261
+ };
262
+ }
263
+ });
264
+ export {
265
+ $e as default
266
+ };
@@ -0,0 +1,120 @@
1
+ import { R as RuleOperator, _ } from "./index-D41Xq5qY.js";
2
+ import { i as isRuleGroup } from "./index-Dh2apeby.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-COXmoOd1.js";
6
+ import "./index-pjXQwa0j.js";
7
+ import "./index-Bc7JXl59.js";
8
+ function validateRule(data, r, date) {
9
+ const rules = new RuleOperator(date ?? /* @__PURE__ */ new Date());
10
+ function meetConditions(e) {
11
+ return Object.entries(e.conditions ?? {}).reduce(
12
+ (o, [n, t]) => {
13
+ const l = e.property ? e.property === "__now" ? rules.ruleNow : _.get(data, e.property) : data;
14
+ if (t == null)
15
+ return console.log("Bad data, ignoring rule", {
16
+ // property: r.property,
17
+ // source,
18
+ conditionKey: n,
19
+ equator: t
20
+ // raw: data,
21
+ }), o;
22
+ const i = rules[n](
23
+ l,
24
+ t
25
+ );
26
+ return o && i;
27
+ },
28
+ !0
29
+ );
30
+ }
31
+ function evaluateRuleResult(rr, logic) {
32
+ const target = Object.entries(rr).reduce((e, [o, n]) => e.replace(RegExp(`\\b${o}\\b`, "g"), n ? "true" : "false"), logic);
33
+ return !logic || !!eval(target);
34
+ }
35
+ function getRuleResults(e) {
36
+ return isRuleGroup(e) ? Object.entries(e.rules).reduce((o, [n, t]) => ({
37
+ ...o,
38
+ [n]: isRuleGroup(t) ? evaluateRuleResult(getRuleResults(t), t.logic) : meetConditions(t)
39
+ }), {}) : {
40
+ [e.name]: meetConditions(e)
41
+ };
42
+ }
43
+ return isRuleGroup(r) ? evaluateRuleResult(getRuleResults(r), r.logic) : meetConditions(r);
44
+ }
45
+ 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({
46
+ __name: "CampaignTypeDialog",
47
+ props: {
48
+ onSelect: {
49
+ type: Function,
50
+ required: !0
51
+ }
52
+ },
53
+ setup(e) {
54
+ const o = e, n = useDialog(), t = [
55
+ {
56
+ title: "Promotion",
57
+ description: "Special offers or deals made available for a limited time",
58
+ value: F_RUNNABLE_CAMPAIGN_TYPE.enum.PROMOTION
59
+ },
60
+ {
61
+ title: "Voucher",
62
+ description: "A digital coupon that can be redeemed for a discounts on future purchases.",
63
+ value: F_RUNNABLE_CAMPAIGN_TYPE.enum.VOUCHER
64
+ },
65
+ {
66
+ title: "Experience",
67
+ description: "Experience points help customers gain membership tiers.",
68
+ value: F_RUNNABLE_CAMPAIGN_TYPE.enum.POINT
69
+ },
70
+ {
71
+ title: "Point",
72
+ description: "Points allow customers to purchase bundle items.",
73
+ value: F_RUNNABLE_CAMPAIGN_TYPE.enum.COIN
74
+ },
75
+ {
76
+ title: "Game",
77
+ description: "The game feature adds a fun and encourage customers to engage more.",
78
+ value: F_RUNNABLE_CAMPAIGN_TYPE.enum.GAME
79
+ },
80
+ {
81
+ title: "Credit",
82
+ description: "Credits are virtual money that customers can use to pay for their purchases.",
83
+ value: F_RUNNABLE_CAMPAIGN_TYPE.enum.CREDIT
84
+ }
85
+ ];
86
+ function l(i) {
87
+ n.close(), o.onSelect(i);
88
+ }
89
+ return (i, a) => {
90
+ const c = resolveComponent("FmCard");
91
+ return openBlock(), createBlock(c, { class: "p-24 space-y-16" }, {
92
+ default: withCtx(() => [
93
+ a[0] || (a[0] = createElementVNode("div", { class: "" }, [
94
+ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Add benefit"),
95
+ 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. ")
96
+ ], -1)),
97
+ createElementVNode("div", _hoisted_1, [
98
+ (openBlock(), createElementBlock(Fragment, null, renderList(t, (s) => createVNode(c, {
99
+ variant: "outlined",
100
+ key: s.value,
101
+ onClick: (u) => l(s.value),
102
+ class: "p-16 space-y-8 cursor-pointer"
103
+ }, {
104
+ default: withCtx(() => [
105
+ createElementVNode("div", _hoisted_2, toDisplayString(s.title), 1),
106
+ createElementVNode("div", _hoisted_3, toDisplayString(s.description), 1)
107
+ ]),
108
+ _: 2
109
+ }, 1032, ["onClick"])), 64))
110
+ ])
111
+ ]),
112
+ _: 1
113
+ });
114
+ };
115
+ }
116
+ });
117
+ export {
118
+ _sfc_main as _,
119
+ validateRule as v
120
+ };