@feedmepos/mf-connect 0.1.98-beta.40 → 0.1.98-beta.41

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 (151) hide show
  1. package/dist/App-C6JJ9uQ8.js +4785 -0
  2. package/dist/AuditLogs-CAlgtDgx.js +2014 -0
  3. package/dist/Bin-D8jwhwER.js +166 -0
  4. package/dist/Broadcast-CP8DRfkT.js +269 -0
  5. package/dist/CampaignAnalytic-MVjYBFvu.js +1826 -0
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DeLURz87.js +122 -0
  7. package/dist/Card-QribXJwZ.js +911 -0
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  9. package/dist/Collections-X9xbt43V.js +541 -0
  10. package/dist/Credit-QmbsW1eb.js +286 -0
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-ClNieHSo.js +3382 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CrGHTNhg.js +351 -0
  15. package/dist/Experience-CPGMg847.js +285 -0
  16. package/dist/FileSaver.min-CK67LsPG.js +74 -0
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-BrkiEFCS.js +356 -0
  20. package/dist/GiftCardSetup-DXNBHF1A.js +542 -0
  21. package/dist/Grab-BgtDzK1B.js +301 -0
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-Dzv2AkKN.js +145 -0
  23. package/dist/Index-KJgzalOd.js +259 -0
  24. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  25. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-C6SBLJGQ.js +48 -0
  26. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Dj74lJ7b.js +18737 -0
  27. package/dist/LoyaltyDashboard-B2JpbC01.js +1345 -0
  28. package/dist/MainLayout-DlfTKHQ-.js +143 -0
  29. package/dist/Marketing-Crx_JQpi.js +236 -0
  30. package/dist/MarketingMaterialEdit-BfsdcMXJ.js +1036 -0
  31. package/dist/Member-C50Nrsko.js +281 -0
  32. package/dist/MemberList-C9uUKw1o.js +1603 -0
  33. package/dist/MemberOverview-wL_ailso.js +58 -0
  34. package/dist/MemberTransactions-DZ7zPOHX.js +45 -0
  35. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Du_ZGsbX.js +60957 -0
  36. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +38 -0
  37. package/dist/Mission-D_km8zi6.js +360 -0
  38. package/dist/Overview-BBieK6qQ.js +1080 -0
  39. package/dist/Overview-B_kmLOcc.js +1316 -0
  40. package/dist/Point-D0q9N7f9.js +288 -0
  41. package/dist/Promotion-DoFTy-NK.js +423 -0
  42. package/dist/Queue-Dh5sDRHW.js +261 -0
  43. package/dist/Record-0owEBKqN.js +342 -0
  44. package/dist/Review-DV2fnpOH.js +45 -0
  45. package/dist/ReviewFacebookCallback-D8mnAPzR.js +238 -0
  46. package/dist/ReviewGoogleCallback-CLzt_ox2.js +213 -0
  47. package/dist/Reward-Co20Xrss.js +442 -0
  48. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-0qU49c47.js +150 -0
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-qdvaXPhJ.js +1913 -0
  50. package/dist/Segment-7dQKeHWK.js +1017 -0
  51. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BUVrUifO.js +181 -0
  52. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDsV9TD9.js +189 -0
  53. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DqPZpddc.js +226 -0
  54. package/dist/Setting-Bvahxs-y.js +2047 -0
  55. package/dist/SettingAdvertisements-fbXLRwfb.js +264 -0
  56. package/dist/Settings-C_HWDFN8.js +179 -0
  57. package/dist/Store-8yBKDR1b.js +2413 -0
  58. package/dist/StoreRewards-DKaJvoJs.js +540 -0
  59. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D23XzJD7.js +1075 -0
  60. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-JaFhCK_L.js +7007 -0
  61. package/dist/Tier-CD-CjXC3.js +972 -0
  62. package/dist/Title-C_lcgye8.js +569 -0
  63. package/dist/Transaction-BvUYm-rT.js +39 -0
  64. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-C3Yacz7K.js +130 -0
  65. package/dist/Voucher-CYaG0GLU.js +444 -0
  66. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DF2JqzRe.js +421 -0
  67. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B4UPqSNc.js +56 -0
  68. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  69. package/dist/app-CE5hQ4Uq.js +60740 -0
  70. package/dist/app-wDQR6dpb.js +39 -0
  71. package/dist/app.js +7 -0
  72. package/dist/business-CE_4siXc.js +82 -0
  73. package/dist/campaign-BP6rvSpg.js +255 -0
  74. package/dist/campaign-CXQtKpeb.js +100 -0
  75. package/dist/campaign-CpzFl8Vr.js +4 -0
  76. package/dist/campaign.enum-Dx-Zo68Q.js +26 -0
  77. package/dist/campaign.fn-DKnBpE1N.js +776 -0
  78. package/dist/collectible.enum-Liy2wH3s.js +19 -0
  79. package/dist/collection.fn-Cg16QZSp.js +26 -0
  80. package/dist/duplicateCampaign-DbtVAGsT.js +51 -0
  81. package/dist/effect-CLI8NI4O.js +89 -0
  82. package/dist/email-addresses-DlLiZ1io.js +705 -0
  83. package/dist/export-6Hr34dBU.js +97 -0
  84. package/dist/feedme.ico +0 -0
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/helper-vkjFqj70.js +86 -0
  87. package/dist/index-BIyKgw4m.js +72 -0
  88. package/dist/index-BLQJ-rv3.js +31 -0
  89. package/dist/index-BbTIqReL.js +67 -0
  90. package/dist/index-BuMfQxMf.js +897 -0
  91. package/dist/index-C8cXXcLk.js +45 -0
  92. package/dist/index-CSVhIZSY.js +8919 -0
  93. package/dist/index-CVHacTbc.js +151 -0
  94. package/dist/index-C_H8jFYf.js +2743 -0
  95. package/dist/index-CmNsGhDf.js +2706 -0
  96. package/dist/index-CnTeeRyJ.js +53 -0
  97. package/dist/index-CuvNtC_M.js +61 -0
  98. package/dist/index-CzbNobLv.js +1139 -0
  99. package/dist/index-D06n1h1b.js +146 -0
  100. package/dist/index-D4SDAfbP.js +27550 -0
  101. package/dist/index-DVnYQ3Hs.js +85 -0
  102. package/dist/index-DcjnS5Sv.js +28900 -0
  103. package/dist/index-Dx9h0FNH.js +3 -0
  104. package/dist/index-YgP4ihQL.js +32 -0
  105. package/dist/index-kedErkLZ.js +2963 -0
  106. package/dist/index-lnQT4P3d.js +55 -0
  107. package/dist/index-vh86FiIQ.js +10 -0
  108. package/dist/index.esm2017-Jhv2lkrq.js +3069 -0
  109. package/dist/loading-NY-FPxVY.js +72 -0
  110. package/dist/lodash-BC_P6kLg.js +3678 -0
  111. package/dist/membership-BWaK-9FY.js +255 -0
  112. package/dist/moment-D7p2TMB-.js +2583 -0
  113. package/dist/money-COoh4GXK.js +15 -0
  114. package/dist/number-BX5OEXgq.js +12 -0
  115. package/dist/object-BYyQ0PZp.js +18 -0
  116. package/dist/objectId-dwaoBfJX.js +7 -0
  117. package/dist/objectid-1SUSRtmY.js +145 -0
  118. package/dist/plugins-ur-FAoye.js +1788 -0
  119. package/dist/remy-Qz_pNsUS.js +13 -0
  120. package/dist/reward-DSsylZ22.js +36 -0
  121. package/dist/rule-BM9GUd1C.js +1969 -0
  122. package/dist/rule-builder-gC9LH2AC.js +126 -0
  123. package/dist/string-Gcy5IM_H.js +32 -0
  124. package/dist/style.css +4 -0
  125. package/dist/template-CUV3AMFI.js +188 -0
  126. package/dist/tier-BJDhpH6X.js +4 -0
  127. package/dist/tiers/tier=1.png +0 -0
  128. package/dist/tiers/tier=2.png +0 -0
  129. package/dist/tiers/tier=3.png +0 -0
  130. package/dist/tiers/tier=4.png +0 -0
  131. package/dist/timezone-BFZhekOU.js +20 -0
  132. package/dist/titles/type=diamond.png +0 -0
  133. package/dist/titles/type=drinks.png +0 -0
  134. package/dist/titles/type=food.png +0 -0
  135. package/dist/titles/type=heart.png +0 -0
  136. package/dist/titles/type=medal.png +0 -0
  137. package/dist/titles/type=spend.png +0 -0
  138. package/dist/titles/type=thank-you.png +0 -0
  139. package/dist/titles/type=thumbs-up.png +0 -0
  140. package/dist/titles/type=years.png +0 -0
  141. package/dist/transaction.fn-C5MlkEIC.js +64 -0
  142. package/dist/trigger-CbjiuoSo.js +213 -0
  143. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  144. package/dist/type_drinks-D6jnpvwV.js +4 -0
  145. package/dist/useMarketingMaterialActions-BLisTieA.js +96 -0
  146. package/dist/usePagination-Caah4sJr.js +220 -0
  147. package/dist/user-BZC4P_jL.js +55 -0
  148. package/dist/vue-i18n-BYz7XAr_.js +2365 -0
  149. package/dist/xlsx-Bn7BqUFA.js +15491 -0
  150. package/dist/zod-DHH42rXG.js +91 -0
  151. package/package.json +1 -1
@@ -0,0 +1,423 @@
1
+ import { defineComponent as z, ref as C, resolveComponent as p, openBlock as y, createBlock as T, unref as a, isRef as ae, withCtx as O, createElementVNode as i, createVNode as r, computed as ie, h as P, onMounted as se, createElementBlock as L, Fragment as A, renderList as re, resolveDynamicComponent as le, toDisplayString as w } from "vue";
2
+ import { _ as ce } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as me, components as B } from "@feedmepos/ui-library";
4
+ import { p as U } from "./plugins-ur-FAoye.js";
5
+ import { u as ue } from "./loading-NY-FPxVY.js";
6
+ import { u as pe } from "./business-CE_4siXc.js";
7
+ import { u as de } from "./campaign-CXQtKpeb.js";
8
+ import { u as fe } from "./vue-i18n-BYz7XAr_.js";
9
+ import { g as q, a as ye, b as K } from "./campaign-BP6rvSpg.js";
10
+ import { c as ge, p as _e } from "./duplicateCampaign-DbtVAGsT.js";
11
+ import { e as E } from "./effect-CLI8NI4O.js";
12
+ import { c as Q } from "./string-Gcy5IM_H.js";
13
+ import "./index-Dx9h0FNH.js";
14
+ import { _ as he } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-ClNieHSo.js";
15
+ import { c as g } from "./index-D06n1h1b.js";
16
+ import { u as we } from "./template-CUV3AMFI.js";
17
+ import { _ as H } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
18
+ import { useRouter as be } from "vue-router";
19
+ import { R as ve } from "./app-CE5hQ4Uq.js";
20
+ const Ce = { class: "space-y-8" }, xe = /* @__PURE__ */ z({
21
+ __name: "QueueSheet",
22
+ emits: ["update:model-value"],
23
+ setup(G, { expose: n, emit: M }) {
24
+ const d = C(!1), b = C([]);
25
+ async function V() {
26
+ d.value = !0;
27
+ const s = await g.getPromotionQueue();
28
+ console.log(s, "jobs"), b.value = s;
29
+ }
30
+ const x = [
31
+ {
32
+ header: "Started At",
33
+ accessorFn: (s) => s.createdAt,
34
+ enableSorting: !0
35
+ },
36
+ {
37
+ header: "Campaigns",
38
+ accessorFn: (s) => s.campaigns
39
+ // cell(props) {
40
+ // const r = props.row.original;
41
+ // return h('div', {
42
+ // innerHTML: r.campaigns.map((c: any) => c.name).join(', '),
43
+ // });
44
+ // },
45
+ }
46
+ ];
47
+ return n({
48
+ showSheet: V
49
+ }), (s, u) => {
50
+ const v = p("FmTable"), I = p("FmSideSheet");
51
+ return y(), T(I, {
52
+ "max-width": 550,
53
+ header: "Promotion Sync Queue",
54
+ modelValue: a(d),
55
+ "onUpdate:modelValue": [
56
+ u[1] || (u[1] = (f) => ae(d) ? d.value = f : null),
57
+ u[2] || (u[2] = (f) => d.value = f)
58
+ ]
59
+ }, {
60
+ default: O(() => [
61
+ i("div", Ce, [
62
+ u[3] || (u[3] = i("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Promotion synchronizing to your restaurant(s) is queued here. Depending on the number of campaigns and restaurants, this process may take several minutes. No task displayed here means there are no pending promotions to sync. ", -1)),
63
+ r(v, {
64
+ modelValue: s.tableRef,
65
+ "onUpdate:modelValue": u[0] || (u[0] = (f) => s.tableRef = f),
66
+ "column-filter": s.jobFilters,
67
+ "column-defs": x,
68
+ "row-data": a(b),
69
+ "hide-footer": a(b).length <= 10
70
+ }, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"])
71
+ ])
72
+ ]),
73
+ _: 1
74
+ }, 8, ["modelValue"]);
75
+ };
76
+ }
77
+ }), Fe = { class: "px-24 flex flex-col gap-y-16" }, ke = { class: "flex items-center justify-between w-full" }, Se = { class: "flex gap-8 overflow-x-auto" }, Pe = { class: "space-y-8" }, Te = { class: "flex w-full gap-4 items-center" }, Oe = { class: "space-y-4" }, Ve = { class: "fm-typo-en-body-lg-600" }, Ie = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Le = { class: "flex items-center gap-8" }, Ae = { class: "flex flex-col gap-16 text-center" }, Be = { class: "fm-typo-en-title-sm-800" }, Me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, to = /* @__PURE__ */ z({
78
+ __name: "Promotion",
79
+ setup(G) {
80
+ const { t: n } = fe(), M = {
81
+ label: n("connect.promotion.createCampaign"),
82
+ value: "create",
83
+ isPrimary: !0,
84
+ prependIcon: "add"
85
+ }, d = {
86
+ label: "Force sync",
87
+ value: "sync",
88
+ isPrimary: !1,
89
+ prependIcon: "refresh"
90
+ }, b = {
91
+ label: "Queue",
92
+ value: "queue",
93
+ isPrimary: !1,
94
+ prependIcon: "work_history"
95
+ }, V = we("PROMOTION", me()), x = pe(), s = de(), { global: u, minor: v } = ue, I = be(), f = [
96
+ {
97
+ label: "Bill promotion",
98
+ value: "BILL"
99
+ },
100
+ {
101
+ label: "Item promotion",
102
+ value: "ITEM"
103
+ }
104
+ ], c = C({
105
+ searchKey: "",
106
+ location: [],
107
+ effectType: []
108
+ });
109
+ function Y(e) {
110
+ const o = c.value.location;
111
+ return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((m) => {
112
+ var l;
113
+ return (l = e == null ? void 0 : e.targetLocation) == null ? void 0 : l.includes(m);
114
+ }) : e.targetLocation.includes(o);
115
+ }
116
+ function J(e) {
117
+ var l, k;
118
+ const o = c.value.effectType;
119
+ if (!o || o.length === 0) return !0;
120
+ const m = (k = (l = e.effect) == null ? void 0 : l.options) == null ? void 0 : k.target;
121
+ return o.includes(m);
122
+ }
123
+ const _ = ie(
124
+ () => s.campaigns.promotion.filter(
125
+ (e) => Y(e) && J(e)
126
+ )
127
+ ), W = [
128
+ {
129
+ header: n("connect.promotion.promotionTitle"),
130
+ accessorFn: (e) => e.name
131
+ },
132
+ {
133
+ header: n("connect.promotion.campaignDate"),
134
+ accessorFn: (e) => q(e)
135
+ },
136
+ {
137
+ header: n("connect.promotion.status"),
138
+ accessorFn: (e) => ye(e),
139
+ cell(e) {
140
+ return K(e.row.original);
141
+ }
142
+ },
143
+ {
144
+ header: n("connect.promotion.type"),
145
+ accessorFn: (e) => `${Q.title(e.effect.options.target)} promotion`
146
+ },
147
+ {
148
+ header: n("connect.promotion.summary"),
149
+ accessorFn: (e) => E(e.effect)
150
+ },
151
+ {
152
+ header: n("connect.promotion.actions"),
153
+ cell(e) {
154
+ return P("div", { class: "flex items-center gap-8 justify-end" }, [
155
+ P(B.FmButton, {
156
+ variant: "tertiary",
157
+ icon: "insights",
158
+ iconColor: "neutral-gray-400",
159
+ onClick: async (o) => {
160
+ o.stopPropagation(), await $(e.row.original);
161
+ }
162
+ }),
163
+ P(B.FmButton, {
164
+ variant: "tertiary",
165
+ icon: "content_copy",
166
+ iconColor: "neutral-gray-400",
167
+ onClick: async (o) => {
168
+ o.stopPropagation(), await j(e.row.original);
169
+ }
170
+ }),
171
+ P(B.FmButton, {
172
+ variant: "tertiary",
173
+ icon: "delete",
174
+ iconColor: "neutral-gray-400",
175
+ onClick: (o) => {
176
+ o.stopPropagation(), D(e.row.original);
177
+ }
178
+ })
179
+ ]);
180
+ }
181
+ }
182
+ ], R = C(), N = C();
183
+ async function D(e) {
184
+ await U.remove(
185
+ n("connect.promotion.confirmRemove", { name: e.name })
186
+ ) && await v(
187
+ async () => {
188
+ await g.delete(e._id), await s.read("PROMOTION");
189
+ },
190
+ {
191
+ message: n("connect.promotion.removing", { name: e.name }),
192
+ successMessage: n("connect.promotion.removedSuccessfully", {
193
+ name: e.name
194
+ })
195
+ }
196
+ );
197
+ }
198
+ async function F(e) {
199
+ e ? await o() : V.open(async (m) => {
200
+ await o(m);
201
+ });
202
+ async function o(m) {
203
+ var l;
204
+ (l = R.value) == null || l.showSheet(
205
+ !0,
206
+ "PROMOTION",
207
+ e ? await g.readById(e._id) : void 0,
208
+ m
209
+ );
210
+ }
211
+ }
212
+ async function $(e) {
213
+ await I.push({
214
+ name: ve["$connect-CAMPAIGN_PROMOTION_ANALYTIC"],
215
+ params: { id: e._id }
216
+ });
217
+ }
218
+ async function j(e) {
219
+ var l;
220
+ if (!await ge(e.name))
221
+ return;
222
+ const o = await g.readById(e._id), m = _e(o);
223
+ (l = R.value) == null || l.showSheet(
224
+ !0,
225
+ "PROMOTION",
226
+ m,
227
+ o.template
228
+ );
229
+ }
230
+ async function X(e) {
231
+ await v(
232
+ async () => {
233
+ e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await s.read("PROMOTION");
234
+ },
235
+ {
236
+ message: n(
237
+ e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
238
+ ),
239
+ successMessage: n(
240
+ e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
241
+ )
242
+ }
243
+ );
244
+ }
245
+ async function Z(e) {
246
+ var o;
247
+ switch (e) {
248
+ case "create":
249
+ F();
250
+ break;
251
+ case "sync":
252
+ await U.confirm(
253
+ "Are you sure you want to synchronize all promotions to POS?",
254
+ "Force sync"
255
+ ) && v(
256
+ async () => {
257
+ await g.syncAllPromotion();
258
+ },
259
+ {
260
+ message: "Syncing promotions...",
261
+ successMessage: "All promotions synced"
262
+ }
263
+ );
264
+ break;
265
+ case "queue":
266
+ (o = N.value) == null || o.showSheet();
267
+ break;
268
+ }
269
+ }
270
+ return se(async () => {
271
+ await u(async () => {
272
+ await x.readLocations(), await s.read("PROMOTION");
273
+ });
274
+ }), (e, o) => {
275
+ const m = p("FmPageHead"), l = p("FmSearch"), k = p("FmTable"), ee = p("FmChip"), S = p("FmButton"), oe = p("FmListItem"), te = p("FmList"), ne = p("FmCard");
276
+ return y(), L(A, null, [
277
+ r(m, {
278
+ title: a(n)("connect.promotion.title"),
279
+ actions: a(_).length > 0 ? [M, d, b] : [],
280
+ "onClick:action": Z
281
+ }, null, 8, ["title", "actions"]),
282
+ i("div", Fe, [
283
+ r(l, {
284
+ modelValue: c.value.searchKey,
285
+ "onUpdate:modelValue": o[0] || (o[0] = (t) => c.value.searchKey = t),
286
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
287
+ placeholder: a(n)("connect.promotion.search"),
288
+ collapsible: ""
289
+ }, null, 8, ["modelValue", "placeholder"]),
290
+ a(_) && a(_).length > 0 ? (y(), L(A, { key: 0 }, [
291
+ i("div", ke, [
292
+ i("div", Se, [
293
+ r(H, {
294
+ label: `${a(n)("connect.common.location")}: `,
295
+ "right-icon": "keyboard_arrow_down",
296
+ modelValue: c.value.location,
297
+ "onUpdate:modelValue": o[1] || (o[1] = (t) => c.value.location = t),
298
+ icon: "storefront",
299
+ "show-item-label": !0,
300
+ items: a(x).locationOptions
301
+ }, null, 8, ["label", "modelValue", "items"]),
302
+ r(H, {
303
+ label: "Type:",
304
+ "right-icon": "keyboard_arrow_down",
305
+ modelValue: c.value.effectType,
306
+ "onUpdate:modelValue": o[2] || (o[2] = (t) => c.value.effectType = t),
307
+ icon: "filter_list",
308
+ "show-item-label": !0,
309
+ items: f
310
+ }, null, 8, ["modelValue"])
311
+ ]),
312
+ r(l, {
313
+ modelValue: c.value.searchKey,
314
+ "onUpdate:modelValue": o[3] || (o[3] = (t) => c.value.searchKey = t),
315
+ class: "xs:hidden sm:hidden",
316
+ placeholder: "search",
317
+ collapsible: ""
318
+ }, null, 8, ["modelValue"])
319
+ ]),
320
+ r(k, {
321
+ class: "xs:hidden sm:hidden",
322
+ "row-data": a(_),
323
+ "column-defs": W,
324
+ "search-value": c.value.searchKey,
325
+ "column-filter": [],
326
+ onRowClick: o[4] || (o[4] = (t) => F(t.original)),
327
+ "hide-footer": a(_).length < 10
328
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
329
+ r(te, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
330
+ default: O(() => [
331
+ (y(!0), L(A, null, re(a(_).filter(
332
+ (t) => t.name.toLowerCase().includes(c.value.searchKey.toLowerCase())
333
+ ), (t) => (y(), T(oe, {
334
+ key: t._id.toString(),
335
+ onClick: (h) => F(t),
336
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
337
+ }, {
338
+ default: O(() => [
339
+ i("div", Pe, [
340
+ i("div", Te, [
341
+ (y(), T(le(a(K)(t)))),
342
+ r(ee, {
343
+ class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
344
+ compact: !0,
345
+ label: `${a(Q).title(t.effect.options.target)} promotion`
346
+ }, null, 8, ["label"])
347
+ ]),
348
+ i("div", Oe, [
349
+ i("div", Ve, w(t.name), 1),
350
+ i("div", Ie, w(a(E)(t.effect)), 1),
351
+ i("div", Re, w(a(n)("connect.promotion.campaignDate")) + ": " + w(a(q)(t)), 1)
352
+ ])
353
+ ]),
354
+ i("div", Le, [
355
+ r(S, {
356
+ icon: "insights",
357
+ "icon-color": "neutral-gray-400",
358
+ variant: "tertiary",
359
+ onClick: async (h) => {
360
+ h.stopPropagation(), await $(t);
361
+ }
362
+ }, null, 8, ["onClick"]),
363
+ r(S, {
364
+ icon: "content_copy",
365
+ "icon-color": "neutral-gray-400",
366
+ variant: "tertiary",
367
+ onClick: async (h) => {
368
+ h.stopPropagation(), await j(t);
369
+ }
370
+ }, null, 8, ["onClick"]),
371
+ r(S, {
372
+ icon: "delete",
373
+ "icon-color": "neutral-gray-400",
374
+ variant: "tertiary",
375
+ onClick: (h) => (h.stopPropagation(), D(t))
376
+ }, null, 8, ["onClick"])
377
+ ])
378
+ ]),
379
+ _: 2
380
+ }, 1032, ["onClick"]))), 128))
381
+ ]),
382
+ _: 1
383
+ })
384
+ ], 64)) : (y(), T(ne, {
385
+ key: 1,
386
+ variant: "outlined",
387
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
388
+ }, {
389
+ default: O(() => [
390
+ o[6] || (o[6] = i("img", {
391
+ src: ce,
392
+ class: "aspect-square w-[150px]"
393
+ }, null, -1)),
394
+ i("div", Ae, [
395
+ i("div", Be, w(a(n)("connect.promotion.createPromotionCampaign")), 1),
396
+ i("div", Me, w(a(n)("connect.promotion.description")), 1)
397
+ ]),
398
+ r(S, {
399
+ variant: "primary",
400
+ label: a(n)("connect.promotion.createPromotionCampaign"),
401
+ icon: "add",
402
+ onClick: o[5] || (o[5] = (t) => F())
403
+ }, null, 8, ["label"])
404
+ ]),
405
+ _: 1
406
+ }))
407
+ ]),
408
+ r(he, {
409
+ ref_key: "sheetRef",
410
+ ref: R,
411
+ "onSubmit:modelValue": X
412
+ }, null, 512),
413
+ r(xe, {
414
+ ref_key: "queueSheetRef",
415
+ ref: N
416
+ }, null, 512)
417
+ ], 64);
418
+ };
419
+ }
420
+ });
421
+ export {
422
+ to as default
423
+ };
@@ -0,0 +1,261 @@
1
+ import { defineComponent as h, h as n, ref as A, watch as B, onBeforeMount as U, resolveComponent as V, openBlock as z, createElementBlock as O, Fragment as q, createVNode as m, unref as o, createElementVNode as g } from "vue";
2
+ import { u as G, _ as L } from "./usePagination-Caah4sJr.js";
3
+ import { _ as S } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
4
+ import { c as u } from "./string-Gcy5IM_H.js";
5
+ import { c as Y } from "./plugins-ur-FAoye.js";
6
+ import { useDialog as j, components as y } from "@feedmepos/ui-library";
7
+ import "./index-CmNsGhDf.js";
8
+ import "./index-kedErkLZ.js";
9
+ import "./index-CSVhIZSY.js";
10
+ import "./index-D4SDAfbP.js";
11
+ import { n as c, a as d } from "./index-BuMfQxMf.js";
12
+ import "./index-lnQT4P3d.js";
13
+ import { h as b } from "./moment-D7p2TMB-.js";
14
+ import { u as W } from "./vue-i18n-BYz7XAr_.js";
15
+ import { u as H, v as K, w as Q } from "./index.esm2017-Jhv2lkrq.js";
16
+ import { useRoute as $ } from "vue-router";
17
+ import { g as J, S as Z, u as X } from "./index-DcjnS5Sv.js";
18
+ import { o as ee } from "./objectId-dwaoBfJX.js";
19
+ const te = () => {
20
+ if (!Z.getBusinessId()) throw new Error("Invalid business ID");
21
+ return X("queues");
22
+ }, oe = {
23
+ async readImportMember(p, w) {
24
+ return J(
25
+ await te().get("", {
26
+ params: { ...p, ...w }
27
+ })
28
+ );
29
+ }
30
+ };
31
+ var ae = { firebase: { apiKey: "AIzaSyAj8JdCHtP0Vc5vZobCfgoLzWxPIn0WUG4", authDomain: "feedme-dev-4c3ef.firebaseapp.com", databaseURL: "https://feedme-dev-4c3ef.firebaseio.com", projectId: "feedme-dev-4c3ef", storageBucket: "feedme-dev-4c3ef.appspot.com", messagingSenderId: "458797803788", appId: "1:458797803788:web:37f2af2926a84288f0c129", measurementId: "G-J2QG09D2Q7" }, assetBucketUrl: "feedme-dev-4c3ef.appspot.com", importFilesBucketUrl: "feedme-dev-4c3ef.appspot.com", clientId: "1a362d621873497b277ea55258cc82594ba148d235257f7bd44ea2acc132d8a4" };
32
+ const re = { class: "p-24 flex flex-col gap-y-2" }, ne = { class: "flex items-center justify-between" }, se = { class: "flex gap-8 items-center w-full overflow-x-scroll" }, Ee = /* @__PURE__ */ h({
33
+ __name: "Queue",
34
+ setup(p) {
35
+ const v = $().query.type, { t: x } = W(), E = j(), C = [
36
+ {
37
+ header: "ID",
38
+ accessorKey: "_id",
39
+ meta: {
40
+ maxWidth: "100px"
41
+ },
42
+ cell(t) {
43
+ return n("div", { class: "flex items-center" }, [
44
+ n(y.FmIcon, {
45
+ name: "content_copy",
46
+ outline: !0,
47
+ size: "sm",
48
+ class: "cursor-pointer mr-4",
49
+ onClick: (e) => {
50
+ e.preventDefault(), e.stopPropagation(), Y(t.row.original._id.toString());
51
+ }
52
+ }),
53
+ n(
54
+ "div",
55
+ { class: "pr-2 text-ellipsis overflow-hidden" },
56
+ t.row.original._id.toString()
57
+ )
58
+ ]);
59
+ },
60
+ enableSorting: !1
61
+ },
62
+ {
63
+ header: "Type",
64
+ accessorFn: (t) => u.title(t.type.replace("_", " ")),
65
+ enableSorting: !1
66
+ },
67
+ {
68
+ header: "Status",
69
+ accessorFn: (t) => {
70
+ var e;
71
+ return t.status ? u.title((e = t.status) == null ? void 0 : e.toString()) : "-";
72
+ },
73
+ cell(t) {
74
+ const e = t.row.original.status;
75
+ return n(y.FmChip, {
76
+ label: e ? u.title(e) : "-",
77
+ compact: !0,
78
+ class: D(e)
79
+ });
80
+ },
81
+ enableSorting: !1
82
+ },
83
+ {
84
+ header: "Ref",
85
+ accessorKey: "ref",
86
+ enableSorting: !1
87
+ },
88
+ {
89
+ header: "Created at",
90
+ accessorFn: (t) => b(ee(t._id.toString())).format("D MMM YYYY, hh:mmA"),
91
+ enableSorting: !0
92
+ },
93
+ {
94
+ header: "Context",
95
+ cell(t) {
96
+ var r, a;
97
+ const e = ((a = (r = t.row.original.context) == null ? void 0 : r.context) == null ? void 0 : a.file) || null;
98
+ return e != null && e.downloadUrl && (e != null && e.originalName) ? n(
99
+ "a",
100
+ {
101
+ class: "fm-typo-en-link-md-600",
102
+ href: e.downloadUrl,
103
+ download: e.originalName,
104
+ target: "_blank",
105
+ rel: "noopener"
106
+ },
107
+ e.originalName
108
+ ) : e != null && e.originalName ? n("div", null, e.originalName) : n("div", null, "-");
109
+ },
110
+ enableSorting: !1
111
+ },
112
+ {
113
+ header: "Failed reason",
114
+ cell(t) {
115
+ return n(y.FmButton, {
116
+ icon: "visibility",
117
+ variant: "tertiary",
118
+ disabled: !t.row.original.failedReason,
119
+ onClick: (e) => {
120
+ e.preventDefault(), e.stopPropagation(), M(t.row.original.failedReason);
121
+ }
122
+ });
123
+ },
124
+ enableSorting: !1
125
+ }
126
+ ], D = (t) => {
127
+ switch (t) {
128
+ case c.enum.ACTIVE:
129
+ return "text-fm-color-typo-info bg-fm-color-system-info-100";
130
+ case c.enum.WAITING:
131
+ return "text-fm-color-typo-warning bg-fm-color-system-warning-100";
132
+ case c.enum.COMPLETED:
133
+ return "text-fm-color-typo-success bg-fm-color-system-success-100";
134
+ case c.enum.FAILED:
135
+ return "text-fm-color-typo-error bg-fm-color-system-error-100";
136
+ default:
137
+ return "text-fm-color-typo-primary bg-fm-color-system-primary-100";
138
+ }
139
+ }, F = h({
140
+ name: "FailedReasonDialog",
141
+ props: {
142
+ data: {
143
+ type: String,
144
+ required: !0
145
+ }
146
+ },
147
+ setup(t) {
148
+ return () => n("div", { class: "whitespace-pre-line" }, t.data);
149
+ }
150
+ });
151
+ async function M(t) {
152
+ E.open({
153
+ title: "Failed Reason",
154
+ closeButton: !0,
155
+ dismissAway: !0,
156
+ contentComponent: F,
157
+ contentComponentProps: {
158
+ data: t
159
+ }
160
+ });
161
+ }
162
+ const T = async (t) => {
163
+ const e = H(void 0, ae.importFilesBucketUrl), r = K(e, t);
164
+ return await Q(r);
165
+ }, R = c.options.map((t) => ({ label: u.title(t), value: t })), s = A({
166
+ type: v ?? [
167
+ d.enum.MEMBER_IMPORTED,
168
+ d.enum.SEGMENTATION_IMPORTED
169
+ ],
170
+ status: []
171
+ }), { tableMeta: i, rowData: P, onSort: k, debouncedFetchData: f } = G(
172
+ async (t) => {
173
+ const e = {
174
+ ...s.value
175
+ }, r = await oe.readImportMember(t, e);
176
+ return await Promise.all(
177
+ r.resources.map(async (a) => {
178
+ var _, I;
179
+ const l = (I = (_ = a.context) == null ? void 0 : _.context) == null ? void 0 : I.file;
180
+ if (b(a.context.emittedAt).diff(b(), "days") < 7 && l)
181
+ try {
182
+ l.downloadUrl = await T(l == null ? void 0 : l.fbFilePath);
183
+ } catch (N) {
184
+ console.log(N);
185
+ }
186
+ })
187
+ ), {
188
+ resources: r.resources,
189
+ meta: r.meta
190
+ };
191
+ }
192
+ );
193
+ return B(
194
+ s,
195
+ () => {
196
+ f();
197
+ },
198
+ { deep: !0 }
199
+ ), U(async () => {
200
+ await f();
201
+ }), (t, e) => {
202
+ const r = V("FmPageHead");
203
+ return z(), O(q, null, [
204
+ m(r, {
205
+ title: o(x)("connect.queue.title")
206
+ }, null, 8, ["title"]),
207
+ g("div", re, [
208
+ g("div", ne, [
209
+ g("div", se, [
210
+ m(S, {
211
+ class: "cursor-pointer text-fm-color-neutral-gray-400",
212
+ "right-icon": "keyboard_arrow_down",
213
+ modelValue: o(s).type,
214
+ "onUpdate:modelValue": e[0] || (e[0] = (a) => o(s).type = a),
215
+ label: "Type: ",
216
+ "show-item-label": !0,
217
+ items: [
218
+ {
219
+ label: "Member Imported",
220
+ value: o(d).enum.MEMBER_IMPORTED
221
+ },
222
+ {
223
+ label: "Segmentation Imported",
224
+ value: o(d).enum.SEGMENTATION_IMPORTED
225
+ }
226
+ ]
227
+ }, null, 8, ["modelValue", "items"]),
228
+ m(S, {
229
+ class: "cursor-pointer text-fm-color-neutral-gray-400",
230
+ "right-icon": "keyboard_arrow_down",
231
+ modelValue: o(s).status,
232
+ "onUpdate:modelValue": e[1] || (e[1] = (a) => o(s).status = a),
233
+ label: "Status: ",
234
+ "show-item-label": !0,
235
+ items: o(R)
236
+ }, null, 8, ["modelValue", "items"])
237
+ ])
238
+ ]),
239
+ m(L, {
240
+ loading: o(i).isLoading,
241
+ "row-data": o(P),
242
+ "row-count": o(i).totalRows,
243
+ "column-defs": C,
244
+ "page-count": o(i).pageCount,
245
+ "page-index": o(i).pageIndex,
246
+ "page-size": o(i).pageSize,
247
+ "shrink-at": !1,
248
+ onSortChange: o(k),
249
+ onPageChange: e[2] || (e[2] = (a) => o(f)({
250
+ pageSize: a.pageSize,
251
+ pageIndex: a.pageIndex
252
+ }))
253
+ }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"])
254
+ ])
255
+ ], 64);
256
+ };
257
+ }
258
+ });
259
+ export {
260
+ Ee as default
261
+ };