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

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/package.json +1 -1
  2. package/dist/App-DwjQisFZ.js +0 -4785
  3. package/dist/AuditLogs-DMGqmriL.js +0 -2014
  4. package/dist/Bin-4wvIqogM.js +0 -166
  5. package/dist/Broadcast-DPpuSZ8_.js +0 -269
  6. package/dist/CampaignAnalytic-CXFDo2X_.js +0 -1826
  7. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-SLoy1-Kd.js +0 -122
  8. package/dist/Card-C8SA6un0.js +0 -911
  9. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  10. package/dist/Collections-BCpSiM_4.js +0 -541
  11. package/dist/Credit-C8RTBpP7.js +0 -286
  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-0OI5QzpR.js +0 -3382
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CJTduNh3.js +0 -351
  16. package/dist/Experience-Bg3kFQQE.js +0 -285
  17. package/dist/FileSaver.min-DMUuMi9w.js +0 -74
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  19. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
  20. package/dist/Game-D3DbkRUj.js +0 -356
  21. package/dist/GiftCardSetup-CxlMM4up.js +0 -542
  22. package/dist/Grab-DvEK8ixP.js +0 -301
  23. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BBK-UrEe.js +0 -145
  24. package/dist/Index-Do_9DXuY.js +0 -259
  25. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  26. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-BKPGBYiU.js +0 -48
  27. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-D6wJN9Gj.js +0 -18737
  28. package/dist/LoyaltyDashboard-B4WqycGN.js +0 -1345
  29. package/dist/MainLayout-DdxLaufS.js +0 -143
  30. package/dist/Marketing-CcFEMwKB.js +0 -236
  31. package/dist/MarketingMaterialEdit-DoYFaMf7.js +0 -1036
  32. package/dist/Member-BussgBln.js +0 -281
  33. package/dist/MemberList-BXJxSsjo.js +0 -1603
  34. package/dist/MemberOverview-wL_ailso.js +0 -58
  35. package/dist/MemberTransactions-O-XY5nz3.js +0 -45
  36. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-DsxrIO0r.js +0 -60957
  37. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +0 -38
  38. package/dist/Mission-CPkM-8Ns.js +0 -360
  39. package/dist/Overview-BJjpYUJN.js +0 -1080
  40. package/dist/Overview-C5KF_Jxj.js +0 -1316
  41. package/dist/Point-FDFwR3Hk.js +0 -288
  42. package/dist/Promotion-qtucKxn0.js +0 -423
  43. package/dist/Queue-d91tocPX.js +0 -261
  44. package/dist/Record-CvkK2iLq.js +0 -342
  45. package/dist/Review-C_zLGtzU.js +0 -45
  46. package/dist/ReviewFacebookCallback-Bidg3P76.js +0 -238
  47. package/dist/ReviewGoogleCallback-DL0lxMBL.js +0 -213
  48. package/dist/Reward-BTsQaI-J.js +0 -442
  49. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BjxA4eMX.js +0 -150
  50. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D4NIDc-C.js +0 -1913
  51. package/dist/Segment-BgFyB3BK.js +0 -1017
  52. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CkhjFNvZ.js +0 -181
  53. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-HYbRyACe.js +0 -189
  54. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-7dv3cAW3.js +0 -226
  55. package/dist/Setting-BxHoCSxw.js +0 -2047
  56. package/dist/SettingAdvertisements-WfvuE4fA.js +0 -264
  57. package/dist/Settings-B42SAvEx.js +0 -179
  58. package/dist/Store-BnvWfCy-.js +0 -2413
  59. package/dist/StoreRewards-BRzAMqR-.js +0 -540
  60. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-C3FJr1L5.js +0 -1075
  61. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-UZYzUcif.js +0 -7007
  62. package/dist/Tier-BrzLNat2.js +0 -972
  63. package/dist/Title-EnlaNXld.js +0 -569
  64. package/dist/Transaction-BiXNxUGX.js +0 -39
  65. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Db5_DKQ0.js +0 -130
  66. package/dist/Voucher-C2dyk-jj.js +0 -444
  67. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DPE24a-J.js +0 -421
  68. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CI1HM9HA.js +0 -56
  69. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  70. package/dist/app-Bt8HrAEr.js +0 -60740
  71. package/dist/app-wDQR6dpb.js +0 -39
  72. package/dist/app.js +0 -7
  73. package/dist/business-BwtQpfUr.js +0 -82
  74. package/dist/campaign-B6U9lwKi.js +0 -255
  75. package/dist/campaign-C6Cb9s3C.js +0 -100
  76. package/dist/campaign-CpzFl8Vr.js +0 -4
  77. package/dist/campaign.enum-Dx-Zo68Q.js +0 -26
  78. package/dist/campaign.fn-B0x2EGhw.js +0 -776
  79. package/dist/collectible.enum-Liy2wH3s.js +0 -19
  80. package/dist/collection.fn-DfoA9sJV.js +0 -26
  81. package/dist/duplicateCampaign-Cnq5N-V8.js +0 -51
  82. package/dist/effect-B2REbrv8.js +0 -89
  83. package/dist/email-addresses-BzmOsxLn.js +0 -705
  84. package/dist/export-jHpRhPQu.js +0 -97
  85. package/dist/feedme.ico +0 -0
  86. package/dist/google-C3S8u0mT.js +0 -4
  87. package/dist/helper-DQAHX1kX.js +0 -86
  88. package/dist/index-4GG-yjdN.js +0 -2963
  89. package/dist/index-BWgMbKOB.js +0 -85
  90. package/dist/index-BccUpf0U.js +0 -3
  91. package/dist/index-BkgkJkVs.js +0 -8919
  92. package/dist/index-C0PKVTf9.js +0 -32
  93. package/dist/index-C8cXXcLk.js +0 -45
  94. package/dist/index-CTTGf4TM.js +0 -151
  95. package/dist/index-C_H8jFYf.js +0 -2743
  96. package/dist/index-CuvNtC_M.js +0 -61
  97. package/dist/index-DJN4auwx.js +0 -146
  98. package/dist/index-DMr9ohGV.js +0 -1139
  99. package/dist/index-DQTo_ytu.js +0 -31
  100. package/dist/index-DW7-0rf_.js +0 -53
  101. package/dist/index-Da7J83jM.js +0 -2706
  102. package/dist/index-Di1Z4vLS.js +0 -27550
  103. package/dist/index-FoKZGh7Z.js +0 -67
  104. package/dist/index-N25Px7RQ.js +0 -72
  105. package/dist/index-PgblELTo.js +0 -897
  106. package/dist/index-STBMTK1u.js +0 -28900
  107. package/dist/index-hP3Mgc0u.js +0 -55
  108. package/dist/index-vh86FiIQ.js +0 -10
  109. package/dist/index.esm2017-DV56jzfJ.js +0 -3069
  110. package/dist/loading-D__sDcq1.js +0 -72
  111. package/dist/lodash-DgkDIHoV.js +0 -3678
  112. package/dist/membership-CBjt1MGx.js +0 -255
  113. package/dist/moment-D7p2TMB-.js +0 -2583
  114. package/dist/money-BFUbPKDM.js +0 -15
  115. package/dist/number-CJb8OUa3.js +0 -12
  116. package/dist/object-BYyQ0PZp.js +0 -18
  117. package/dist/objectId-dwaoBfJX.js +0 -7
  118. package/dist/objectid-BMUFNR9T.js +0 -145
  119. package/dist/plugins-D95ZeD-9.js +0 -1788
  120. package/dist/remy-Qz_pNsUS.js +0 -13
  121. package/dist/reward-CSfV_XFK.js +0 -36
  122. package/dist/rule-DIzVHy2z.js +0 -1969
  123. package/dist/rule-builder-DF7fCvec.js +0 -126
  124. package/dist/string-Gcy5IM_H.js +0 -32
  125. package/dist/style.css +0 -4
  126. package/dist/template-r3lAQP1B.js +0 -188
  127. package/dist/tier-BJDhpH6X.js +0 -4
  128. package/dist/tiers/tier=1.png +0 -0
  129. package/dist/tiers/tier=2.png +0 -0
  130. package/dist/tiers/tier=3.png +0 -0
  131. package/dist/tiers/tier=4.png +0 -0
  132. package/dist/timezone-D40qRUoz.js +0 -20
  133. package/dist/titles/type=diamond.png +0 -0
  134. package/dist/titles/type=drinks.png +0 -0
  135. package/dist/titles/type=food.png +0 -0
  136. package/dist/titles/type=heart.png +0 -0
  137. package/dist/titles/type=medal.png +0 -0
  138. package/dist/titles/type=spend.png +0 -0
  139. package/dist/titles/type=thank-you.png +0 -0
  140. package/dist/titles/type=thumbs-up.png +0 -0
  141. package/dist/titles/type=years.png +0 -0
  142. package/dist/transaction.fn-DV-cpfOj.js +0 -64
  143. package/dist/trigger-BEJaSv5R.js +0 -213
  144. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  145. package/dist/type_drinks-D6jnpvwV.js +0 -4
  146. package/dist/useMarketingMaterialActions-Bd5BDfE1.js +0 -96
  147. package/dist/usePagination-DLIo76-X.js +0 -220
  148. package/dist/user-DtEjuhyM.js +0 -55
  149. package/dist/vue-i18n-dQ1XCaUv.js +0 -2365
  150. package/dist/xlsx-BUMZsTov.js +0 -15491
  151. package/dist/zod-B_pVZhsV.js +0 -91
@@ -1,423 +0,0 @@
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-D95ZeD-9.js";
5
- import { u as ue } from "./loading-D__sDcq1.js";
6
- import { u as pe } from "./business-BwtQpfUr.js";
7
- import { u as de } from "./campaign-C6Cb9s3C.js";
8
- import { u as fe } from "./vue-i18n-dQ1XCaUv.js";
9
- import { g as q, a as ye, b as K } from "./campaign-B6U9lwKi.js";
10
- import { c as ge, p as _e } from "./duplicateCampaign-Cnq5N-V8.js";
11
- import { e as E } from "./effect-B2REbrv8.js";
12
- import { c as Q } from "./string-Gcy5IM_H.js";
13
- import "./index-BccUpf0U.js";
14
- import { _ as he } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-0OI5QzpR.js";
15
- import { c as g } from "./index-DJN4auwx.js";
16
- import { u as we } from "./template-r3lAQP1B.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-Bt8HrAEr.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
- };
@@ -1,261 +0,0 @@
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-DLIo76-X.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-D95ZeD-9.js";
6
- import { useDialog as j, components as y } from "@feedmepos/ui-library";
7
- import "./index-Da7J83jM.js";
8
- import "./index-4GG-yjdN.js";
9
- import "./index-BkgkJkVs.js";
10
- import "./index-Di1Z4vLS.js";
11
- import { n as c, a as d } from "./index-PgblELTo.js";
12
- import "./index-hP3Mgc0u.js";
13
- import { h as b } from "./moment-D7p2TMB-.js";
14
- import { u as W } from "./vue-i18n-dQ1XCaUv.js";
15
- import { u as H, v as K, w as Q } from "./index.esm2017-DV56jzfJ.js";
16
- import { useRoute as $ } from "vue-router";
17
- import { g as J, S as Z, u as X } from "./index-STBMTK1u.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
- };