@feedmepos/mf-connect 0.1.38-beta.8 → 0.1.38-beta.80

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 (159) hide show
  1. package/dist/{Analytic-CJap-Cat.js → Analytic-LOK5TzX0.js} +31 -32
  2. package/dist/{App-CLTtX1QT.js → App-Bk5Z5u5_.js} +617 -607
  3. package/dist/AuditLogs-Rezf9EeA.js +1991 -0
  4. package/dist/{Bin-C2xMLxoE.js → Bin-B8yzS5bD.js} +10 -10
  5. package/dist/Broadcast-CZ0QCvua.js +266 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BCkD7Xfn.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-iJQS2Ck9.js} +6 -6
  7. package/dist/{Card-BPrCNLQy.js → Card-BQOv5yB9.js} +145 -140
  8. package/dist/Collections-qenPlCd2.js +540 -0
  9. package/dist/Credit-BJLskbVu.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  12. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DKWCWOU_.js +3120 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Dw1qQfnG.js +351 -0
  15. package/dist/Experience-BjfEiGT8.js +259 -0
  16. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-C013Tr1o.js} +1 -1
  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-Gw_tFjen.js +330 -0
  20. package/dist/Grab-Bdv7SaB9.js +300 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-Ba4L39GL.js} +49 -48
  22. package/dist/{Index-DMdNgISh.js → Index-C67U3YDJ.js} +54 -54
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-pQ8sF5KW.js +48 -0
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-o-eN3J4i.js} +1 -1
  25. package/dist/{MainLayout-B1aJoR95.js → MainLayout-DPjqCyJ5.js} +1 -1
  26. package/dist/Marketing-DtEooXof.js +166 -0
  27. package/dist/MarketingMaterialEdit-Balw055Y.js +1065 -0
  28. package/dist/{Member-CnSXGQi_.js → Member-QA7TQnyw.js} +38 -37
  29. package/dist/{MemberList-DcpEKV1D.js → MemberList-CSJQFYlh.js} +486 -491
  30. package/dist/{MemberTransactions-DeuuEcO5.js → MemberTransactions-D-46vda_.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DLAEPNsq.js → MessageInput.vue_vue_type_script_setup_true_lang-6a7_lw74.js} +13443 -10607
  32. package/dist/Mission-DJVxFbX5.js +334 -0
  33. package/dist/{Overview-elpi-jpI.js → Overview-Btkh3oiI.js} +24 -25
  34. package/dist/Point-CVdF9GtN.js +262 -0
  35. package/dist/Promotion-BtmlvUd3.js +396 -0
  36. package/dist/{Queue-GvBhNEFe.js → Queue-BfiCMsLC.js} +23 -24
  37. package/dist/{Record-CbSxgo8i.js → Record-B07QGPli.js} +10 -10
  38. package/dist/Review-BeZ90jW9.js +621 -0
  39. package/dist/ReviewFacebookCallback-CwAcKaib.js +243 -0
  40. package/dist/ReviewGoogleCallback-CVK6Yc5E.js +213 -0
  41. package/dist/{Reward-QCGlrq89.js → Reward-CyXqNpAa.js} +16 -16
  42. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DSRvoo9z.js → RewardGroup.vue_vue_type_script_setup_true_lang-BICsdgSh.js} +13 -14
  43. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BgKGNK7y.js +1912 -0
  44. package/dist/{Segment-5PndnEUa.js → Segment-B9g57O7g.js} +273 -274
  45. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DXR7bpzY.js → SelectItems.vue_vue_type_script_setup_true_lang-BwDOXE87.js} +23 -23
  46. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DmITlNtt.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DXDcJLYF.js} +12 -12
  47. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CROBk6cD.js +226 -0
  48. package/dist/Setting-BHteqZv6.js +2039 -0
  49. package/dist/SettingAdvertisements-CubrbuSL.js +264 -0
  50. package/dist/Store-u6LYUnmp.js +1996 -0
  51. package/dist/StoreRewards-D9h0YnEx.js +535 -0
  52. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-vrYqDGOa.js +1129 -0
  53. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-WgNstmNx.js +7007 -0
  54. package/dist/{Tier-BKKxG29r.js → Tier-CBdi4sPT.js} +561 -480
  55. package/dist/{Title-CReZgw8V.js → Title-BegmN7hs.js} +151 -149
  56. package/dist/{Transaction-HWCmSVaJ.js → Transaction-C6XMd9_r.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D00AchXo.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BBf4BP4m.js} +7 -7
  58. package/dist/Voucher-D6hSas_z.js +421 -0
  59. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-ZOlAZ_q5.js +421 -0
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXF39yC1.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bs8TNiCY.js} +2 -2
  61. package/dist/app-Duwed9mD.js +59309 -0
  62. package/dist/app.js +1 -1
  63. package/dist/{business-Bc-EMd2p.js → business-6oZ8Rgui.js} +11 -8
  64. package/dist/campaign-CzenWLhs.js +219 -0
  65. package/dist/campaign-PYce7g0o.js +253 -0
  66. package/dist/campaign.enum-KHniCp5a.js +26 -0
  67. package/dist/campaign.fn-dOSgHJcU.js +776 -0
  68. package/dist/{collectible.enum-C4dM8khp.js → collectible.enum-BZA1DKIB.js} +1 -1
  69. package/dist/{collection.fn-AjDNdFe1.js → collection.fn-CyfrdKBf.js} +2 -2
  70. package/dist/dto-DYmM2ud_.js +222 -0
  71. package/dist/duplicateCampaign-BXaDK8Q6.js +51 -0
  72. package/dist/effect-DBI_JHbP.js +89 -0
  73. package/dist/{email-addresses-B0SzUCQM.js → email-addresses-BNs-WN79.js} +2 -2
  74. package/dist/{export-Bgz6WcNZ.js → export-DTCCKE2m.js} +4 -4
  75. package/dist/{helper-B1vFwohM.js → helper-CeYr7Anh.js} +22 -7
  76. package/dist/index-38u-cCwD.js +3431 -0
  77. package/dist/{index-Cm2sBagk.js → index-BdjY7GRO.js} +1 -1
  78. package/dist/index-CGMiuxyf.js +85 -0
  79. package/dist/index-CQZbm9P5.js +8912 -0
  80. package/dist/index-Cal60fAm.js +48 -0
  81. package/dist/{index-DT2viYsL.js → index-CnRLkzpg.js} +617 -191
  82. package/dist/index-CuvNtC_M.js +61 -0
  83. package/dist/{index-CSQY21Zb.js → index-D-kPBF9C.js} +3 -3
  84. package/dist/{index-DVQnrex_.js → index-DcFYm1fy.js} +3 -3
  85. package/dist/index-DjONNxbl.js +30289 -0
  86. package/dist/{index-26SopNpv.js → index-ItaoypTr.js} +1 -1
  87. package/dist/index-_jxXI4_v.js +28899 -0
  88. package/dist/{index-DwT9RLst.js → index-nXfjG8UQ.js} +23 -12
  89. package/dist/{index-BIRmS75g.js → index-pHQfP2e7.js} +1 -1
  90. package/dist/{index.esm2017-BAIN70_n.js → index.esm2017-CokFPnqn.js} +185 -185
  91. package/dist/{loading-C6Ouh0mG.js → loading-fZQi5zP8.js} +1 -1
  92. package/dist/{lodash-B5I3zXaY.js → lodash-R-DIRmbj.js} +1 -1
  93. package/dist/{membership-DU0BwIj8.js → membership-CApN5ZJ1.js} +3 -3
  94. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  95. package/dist/{money-Bg7GuE5s.js → money-C6I6vVy2.js} +1 -1
  96. package/dist/{number-Ddmqo5D_.js → number-Dq4d381U.js} +1 -1
  97. package/dist/objectid-Kv5GREBk.js +145 -0
  98. package/dist/{campaign-BeF8kTyg.js → plugins-9_UvAdJ2.js} +784 -777
  99. package/dist/remy-NLAa-9Qg.js +46 -0
  100. package/dist/{reward-CN4gvn4c.js → reward-DXHGeGYY.js} +1 -1
  101. package/dist/{rule-CpiqqR0c.js → rule-B_XgRDr-.js} +505 -487
  102. package/dist/rule-builder-BMXyzu8k.js +102 -0
  103. package/dist/style.css +11 -2
  104. package/dist/template-CnyTUzQU.js +188 -0
  105. package/dist/timezone-Izs3ibB-.js +1156 -0
  106. package/dist/trigger-Dda3NmaE.js +213 -0
  107. package/dist/usePagination-Byxk4XVn.js +220 -0
  108. package/dist/user-BZxO8qdh.js +55 -0
  109. package/dist/{vue-i18n-DVmD9I_o.js → vue-i18n-DDbkmbSf.js} +433 -433
  110. package/dist/{xlsx-qJHsnW7k.js → xlsx-D8yNl8dN.js} +1 -1
  111. package/dist/{zod-Bg2FbC-D.js → zod-Xp7TePRP.js} +32 -31
  112. package/package.json +14 -6
  113. package/dist/AuditLogs-DW4rwNOn.js +0 -1887
  114. package/dist/Broadcast-Dhc0j16O.js +0 -227
  115. package/dist/Collections-CsUJEmqz.js +0 -465
  116. package/dist/Credit-Mqa-0XJd.js +0 -222
  117. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  118. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DWWLxIq-.js +0 -2185
  119. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BiQGZeDc.js +0 -347
  120. package/dist/Experience-BD5C3old.js +0 -223
  121. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  122. package/dist/Game-D4xsi8Ym.js +0 -278
  123. package/dist/Marketing-axcQYl8k.js +0 -20073
  124. package/dist/Mission-BHZiL-GH.js +0 -296
  125. package/dist/Point-gKvdggAl.js +0 -226
  126. package/dist/Promotion-7x2F_sFX.js +0 -289
  127. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-AuN9NgcG.js +0 -1751
  128. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DTlv8ZAn.js +0 -147
  129. package/dist/Setting-Cab47wfH.js +0 -1936
  130. package/dist/Store-BFL3T9B5.js +0 -1842
  131. package/dist/StoreRewards-C43dCJtM.js +0 -423
  132. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-aAj5-nzZ.js +0 -1029
  133. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-K3OPSYrF.js +0 -139
  134. package/dist/Voucher-BhUAcPZg.js +0 -384
  135. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-C0YNez2L.js +0 -419
  136. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  137. package/dist/app-BGaUIdCr.js +0 -7086
  138. package/dist/app-DccKBdW_.js +0 -33357
  139. package/dist/campaign-DbJZEU7P.js +0 -96
  140. package/dist/campaign.enum-PBKYGUQY.js +0 -20
  141. package/dist/campaign.fn-Cq-4LfQj.js +0 -758
  142. package/dist/dto-8NvMMYAb.js +0 -214
  143. package/dist/effect-DZhcEQ5g.js +0 -78
  144. package/dist/index-CQQedv0M.js +0 -32260
  145. package/dist/index-CTgQRqQR.js +0 -30038
  146. package/dist/index-CsaQJMAR.js +0 -66
  147. package/dist/index-DGaywhpY.js +0 -76
  148. package/dist/index-DOfLDlI8.js +0 -8861
  149. package/dist/index-DVpAocyR.js +0 -3120
  150. package/dist/index-DlJGd8RC.js +0 -121
  151. package/dist/index-Dm65CTdy.js +0 -38
  152. package/dist/objectid-MCaJXAgq.js +0 -145
  153. package/dist/plugins-C-CRzeyC.js +0 -208
  154. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  155. package/dist/rule-builder-DmkJng-x.js +0 -89
  156. package/dist/template-DTZgnkl5.js +0 -190
  157. package/dist/trigger-CPjJ73Rc.js +0 -144
  158. package/dist/usePagination-BeF5K3M7.js +0 -223
  159. package/dist/user-8VIt8A1x.js +0 -54
@@ -0,0 +1,396 @@
1
+ import { defineComponent as Q, ref as w, resolveComponent as d, openBlock as f, createBlock as S, unref as a, isRef as te, withCtx as k, createElementVNode as i, createVNode as c, computed as ne, h as I, onMounted as ae, createElementBlock as L, Fragment as B, renderList as se, resolveDynamicComponent as ie, toDisplayString as h } from "vue";
2
+ import { _ as re } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as le, components as N } from "@feedmepos/ui-library";
4
+ import { c as $, p as j } from "./plugins-9_UvAdJ2.js";
5
+ import { u as ce } from "./loading-fZQi5zP8.js";
6
+ import { u as me } from "./business-6oZ8Rgui.js";
7
+ import { c as y, u as ue } from "./campaign-CzenWLhs.js";
8
+ import { u as de } from "./vue-i18n-DDbkmbSf.js";
9
+ import { g as q, a as pe, b as K } from "./campaign-PYce7g0o.js";
10
+ import { c as fe, p as ye } from "./duplicateCampaign-BXaDK8Q6.js";
11
+ import { e as U } from "./effect-DBI_JHbP.js";
12
+ import { _ as ge } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DKWCWOU_.js";
13
+ import { u as he } from "./template-CnyTUzQU.js";
14
+ import { _ as E } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
15
+ const _e = { class: "space-y-8" }, be = /* @__PURE__ */ Q({
16
+ __name: "QueueSheet",
17
+ emits: ["update:model-value"],
18
+ setup(H, { expose: n, emit: R }) {
19
+ const p = w(!1), _ = w([]);
20
+ async function P() {
21
+ p.value = !0;
22
+ const r = await y.getPromotionQueue();
23
+ console.log(r, "jobs"), _.value = r;
24
+ }
25
+ const v = [
26
+ {
27
+ header: "Started At",
28
+ accessorFn: (r) => r.createdAt,
29
+ enableSorting: !0
30
+ },
31
+ {
32
+ header: "Campaigns",
33
+ accessorFn: (r) => r.campaigns
34
+ // cell(props) {
35
+ // const r = props.row.original;
36
+ // return h('div', {
37
+ // innerHTML: r.campaigns.map((c: any) => c.name).join(', '),
38
+ // });
39
+ // },
40
+ }
41
+ ];
42
+ return n({
43
+ showSheet: P
44
+ }), (r, u) => {
45
+ const b = d("FmTable"), T = d("FmSideSheet");
46
+ return f(), S(T, {
47
+ "max-width": 550,
48
+ header: "Promotion Sync Queue",
49
+ modelValue: a(p),
50
+ "onUpdate:modelValue": [
51
+ u[1] || (u[1] = (s) => te(p) ? p.value = s : null),
52
+ u[2] || (u[2] = (s) => p.value = s)
53
+ ]
54
+ }, {
55
+ default: k(() => [
56
+ i("div", _e, [
57
+ 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)),
58
+ c(b, {
59
+ modelValue: r.tableRef,
60
+ "onUpdate:modelValue": u[0] || (u[0] = (s) => r.tableRef = s),
61
+ "column-filter": r.jobFilters,
62
+ "column-defs": v,
63
+ "row-data": a(_),
64
+ "hide-footer": a(_).length <= 10
65
+ }, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"])
66
+ ])
67
+ ]),
68
+ _: 1
69
+ }, 8, ["modelValue"]);
70
+ };
71
+ }
72
+ }), we = { class: "px-24 flex flex-col gap-y-16" }, ve = { class: "flex items-center justify-between w-full" }, Ce = { class: "flex gap-8 overflow-x-auto" }, xe = { class: "space-y-8" }, Fe = { class: "flex w-full gap-4 items-center" }, Se = { class: "space-y-4" }, ke = { class: "fm-typo-en-body-lg-600" }, Pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Te = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ve = { class: "flex items-center gap-8" }, Oe = { class: "flex flex-col gap-16 text-center" }, Ie = { class: "fm-typo-en-title-sm-800" }, Le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ze = /* @__PURE__ */ Q({
73
+ __name: "Promotion",
74
+ setup(H) {
75
+ const { t: n } = de(), R = {
76
+ label: n("connect.promotion.createCampaign"),
77
+ value: "create",
78
+ isPrimary: !0,
79
+ prependIcon: "add"
80
+ }, p = {
81
+ label: "Force sync",
82
+ value: "sync",
83
+ isPrimary: !1,
84
+ prependIcon: "refresh"
85
+ }, _ = {
86
+ label: "Queue",
87
+ value: "queue",
88
+ isPrimary: !1,
89
+ prependIcon: "work_history"
90
+ }, P = he("PROMOTION", le()), v = me(), r = ue(), { global: u, minor: b } = ce, T = [
91
+ {
92
+ label: "Bill promotion",
93
+ value: "BILL"
94
+ },
95
+ {
96
+ label: "Item promotion",
97
+ value: "ITEM"
98
+ }
99
+ ], s = w({
100
+ searchKey: "",
101
+ location: [],
102
+ effectType: []
103
+ });
104
+ function z(e) {
105
+ const o = s.value.location;
106
+ return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((m) => {
107
+ var l;
108
+ return (l = e == null ? void 0 : e.targetLocation) == null ? void 0 : l.includes(m);
109
+ }) : e.targetLocation.includes(o);
110
+ }
111
+ function G(e) {
112
+ var l, x;
113
+ const o = s.value.effectType;
114
+ if (!o || o.length === 0) return !0;
115
+ const m = (x = (l = e.effect) == null ? void 0 : l.options) == null ? void 0 : x.target;
116
+ return o.includes(m);
117
+ }
118
+ const g = ne(
119
+ () => r.campaigns.promotion.filter(
120
+ (e) => z(e) && G(e)
121
+ )
122
+ ), J = [
123
+ {
124
+ header: n("connect.promotion.promotionTitle"),
125
+ accessorFn: (e) => e.name
126
+ },
127
+ {
128
+ header: n("connect.promotion.campaignDate"),
129
+ accessorFn: (e) => q(e)
130
+ },
131
+ {
132
+ header: n("connect.promotion.status"),
133
+ accessorFn: (e) => pe(e),
134
+ cell(e) {
135
+ return K(e.row.original);
136
+ }
137
+ },
138
+ {
139
+ header: n("connect.promotion.type"),
140
+ accessorFn: (e) => `${$.title(e.effect.options.target)} promotion`
141
+ },
142
+ {
143
+ header: n("connect.promotion.summary"),
144
+ accessorFn: (e) => U(e.effect)
145
+ },
146
+ {
147
+ header: n("connect.promotion.actions"),
148
+ cell(e) {
149
+ return I("div", { class: "flex items-center gap-8 justify-end" }, [
150
+ I(N.FmButton, {
151
+ variant: "tertiary",
152
+ icon: "content_copy",
153
+ iconColor: "neutral-gray-400",
154
+ onClick: async (o) => {
155
+ o.stopPropagation(), await M(e.row.original);
156
+ }
157
+ }),
158
+ I(N.FmButton, {
159
+ variant: "tertiary",
160
+ icon: "delete",
161
+ iconColor: "neutral-gray-400",
162
+ onClick: (o) => {
163
+ o.stopPropagation(), D(e.row.original);
164
+ }
165
+ })
166
+ ]);
167
+ }
168
+ }
169
+ ], V = w(), A = w();
170
+ async function D(e) {
171
+ await j.remove(
172
+ n("connect.promotion.confirmRemove", { name: e.name })
173
+ ) && await b(
174
+ async () => {
175
+ await y.delete(e._id), await r.read("PROMOTION");
176
+ },
177
+ {
178
+ message: n("connect.promotion.removing", { name: e.name }),
179
+ successMessage: n("connect.promotion.removedSuccessfully", {
180
+ name: e.name
181
+ })
182
+ }
183
+ );
184
+ }
185
+ async function C(e) {
186
+ e ? await o() : P.open(async (m) => {
187
+ await o(m);
188
+ });
189
+ async function o(m) {
190
+ var l;
191
+ (l = V.value) == null || l.showSheet(
192
+ !0,
193
+ "PROMOTION",
194
+ e ? await y.readById(e._id) : void 0,
195
+ m
196
+ );
197
+ }
198
+ }
199
+ async function M(e) {
200
+ var l;
201
+ if (!await fe(e.name))
202
+ return;
203
+ const o = await y.readById(e._id), m = ye(o);
204
+ (l = V.value) == null || l.showSheet(
205
+ !0,
206
+ "PROMOTION",
207
+ m,
208
+ o.template
209
+ );
210
+ }
211
+ async function W(e) {
212
+ await b(
213
+ async () => {
214
+ e.campaign._id ? await y.update(e.campaign._id, e) : await y.create(e), await r.read("PROMOTION");
215
+ },
216
+ {
217
+ message: n(
218
+ e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
219
+ ),
220
+ successMessage: n(
221
+ e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
222
+ )
223
+ }
224
+ );
225
+ }
226
+ async function X(e) {
227
+ var o;
228
+ switch (e) {
229
+ case "create":
230
+ C();
231
+ break;
232
+ case "sync":
233
+ await j.confirm(
234
+ "Are you sure you want to synchronize all promotions to POS?",
235
+ "Force sync"
236
+ ) && b(
237
+ async () => {
238
+ await y.syncAllPromotion();
239
+ },
240
+ {
241
+ message: "Syncing promotions...",
242
+ successMessage: "All promotions synced"
243
+ }
244
+ );
245
+ break;
246
+ case "queue":
247
+ (o = A.value) == null || o.showSheet();
248
+ break;
249
+ }
250
+ }
251
+ return ae(async () => {
252
+ await u(async () => {
253
+ await v.readLocations(), await r.read("PROMOTION");
254
+ });
255
+ }), (e, o) => {
256
+ const m = d("FmPageHead"), l = d("FmSearch"), x = d("FmTable"), Y = d("FmChip"), O = d("FmButton"), Z = d("FmListItem"), ee = d("FmList"), oe = d("FmCard");
257
+ return f(), L(B, null, [
258
+ c(m, {
259
+ title: a(n)("connect.promotion.title"),
260
+ actions: a(g).length > 0 ? [R, p, _] : [],
261
+ "onClick:action": X
262
+ }, null, 8, ["title", "actions"]),
263
+ i("div", we, [
264
+ c(l, {
265
+ modelValue: s.value.searchKey,
266
+ "onUpdate:modelValue": o[0] || (o[0] = (t) => s.value.searchKey = t),
267
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
268
+ placeholder: a(n)("connect.promotion.search"),
269
+ collapsible: ""
270
+ }, null, 8, ["modelValue", "placeholder"]),
271
+ a(g) && a(g).length > 0 ? (f(), L(B, { key: 0 }, [
272
+ i("div", ve, [
273
+ i("div", Ce, [
274
+ c(E, {
275
+ label: `${a(n)("connect.common.location")}: `,
276
+ "right-icon": "keyboard_arrow_down",
277
+ modelValue: s.value.location,
278
+ "onUpdate:modelValue": o[1] || (o[1] = (t) => s.value.location = t),
279
+ icon: "storefront",
280
+ "show-item-label": !0,
281
+ items: a(v).locationOptions
282
+ }, null, 8, ["label", "modelValue", "items"]),
283
+ c(E, {
284
+ label: "Type:",
285
+ "right-icon": "keyboard_arrow_down",
286
+ modelValue: s.value.effectType,
287
+ "onUpdate:modelValue": o[2] || (o[2] = (t) => s.value.effectType = t),
288
+ icon: "filter_list",
289
+ "show-item-label": !0,
290
+ items: T
291
+ }, null, 8, ["modelValue"])
292
+ ]),
293
+ c(l, {
294
+ modelValue: s.value.searchKey,
295
+ "onUpdate:modelValue": o[3] || (o[3] = (t) => s.value.searchKey = t),
296
+ class: "xs:hidden sm:hidden",
297
+ placeholder: "search",
298
+ collapsible: ""
299
+ }, null, 8, ["modelValue"])
300
+ ]),
301
+ c(x, {
302
+ class: "xs:hidden sm:hidden",
303
+ "row-data": a(g),
304
+ "column-defs": J,
305
+ "search-value": s.value.searchKey,
306
+ "column-filter": [],
307
+ onRowClick: o[4] || (o[4] = (t) => C(t.original)),
308
+ "hide-footer": a(g).length < 10
309
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
310
+ c(ee, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
311
+ default: k(() => [
312
+ (f(!0), L(B, null, se(a(g).filter(
313
+ (t) => t.name.toLowerCase().includes(s.value.searchKey.toLowerCase())
314
+ ), (t) => (f(), S(Z, {
315
+ key: t._id.toString(),
316
+ onClick: (F) => C(t),
317
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
318
+ }, {
319
+ default: k(() => [
320
+ i("div", xe, [
321
+ i("div", Fe, [
322
+ (f(), S(ie(a(K)(t)))),
323
+ c(Y, {
324
+ class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
325
+ compact: !0,
326
+ label: `${a($).title(t.effect.options.target)} promotion`
327
+ }, null, 8, ["label"])
328
+ ]),
329
+ i("div", Se, [
330
+ i("div", ke, h(t.name), 1),
331
+ i("div", Pe, h(a(U)(t.effect)), 1),
332
+ i("div", Te, h(a(n)("connect.promotion.campaignDate")) + ": " + h(a(q)(t)), 1)
333
+ ])
334
+ ]),
335
+ i("div", Ve, [
336
+ c(O, {
337
+ icon: "content_copy",
338
+ "icon-color": "neutral-gray-400",
339
+ variant: "tertiary",
340
+ onClick: async (F) => {
341
+ F.stopPropagation(), await M(t);
342
+ }
343
+ }, null, 8, ["onClick"]),
344
+ c(O, {
345
+ icon: "delete",
346
+ "icon-color": "neutral-gray-400",
347
+ variant: "tertiary",
348
+ onClick: (F) => (F.stopPropagation(), D(t))
349
+ }, null, 8, ["onClick"])
350
+ ])
351
+ ]),
352
+ _: 2
353
+ }, 1032, ["onClick"]))), 128))
354
+ ]),
355
+ _: 1
356
+ })
357
+ ], 64)) : (f(), S(oe, {
358
+ key: 1,
359
+ variant: "outlined",
360
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
361
+ }, {
362
+ default: k(() => [
363
+ o[6] || (o[6] = i("img", {
364
+ src: re,
365
+ class: "aspect-square w-[150px]"
366
+ }, null, -1)),
367
+ i("div", Oe, [
368
+ i("div", Ie, h(a(n)("connect.promotion.createPromotionCampaign")), 1),
369
+ i("div", Le, h(a(n)("connect.promotion.description")), 1)
370
+ ]),
371
+ c(O, {
372
+ variant: "primary",
373
+ label: a(n)("connect.promotion.createPromotionCampaign"),
374
+ icon: "add",
375
+ onClick: o[5] || (o[5] = (t) => C())
376
+ }, null, 8, ["label"])
377
+ ]),
378
+ _: 1
379
+ }))
380
+ ]),
381
+ c(ge, {
382
+ ref_key: "sheetRef",
383
+ ref: V,
384
+ "onSubmit:modelValue": W
385
+ }, null, 512),
386
+ c(be, {
387
+ ref_key: "queueSheetRef",
388
+ ref: A
389
+ }, null, 512)
390
+ ], 64);
391
+ };
392
+ }
393
+ });
394
+ export {
395
+ ze as default
396
+ };
@@ -1,26 +1,25 @@
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-BeF5K3M7.js";
3
- import { _ as S } from "./FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js";
4
- import { c as u, a as Y } from "./plugins-C-CRzeyC.js";
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 L, Fragment as O, createVNode as m, unref as o, createElementVNode as g } from "vue";
2
+ import { u as q, _ as G } from "./usePagination-Byxk4XVn.js";
3
+ import { _ as S } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
4
+ import { c as u, a as Y } from "./plugins-9_UvAdJ2.js";
5
5
  import { useDialog as j, components as y } from "@feedmepos/ui-library";
6
- import "./index-DT2viYsL.js";
7
- import { J as c, c as d } from "./index-DVpAocyR.js";
8
- import "./index-DOfLDlI8.js";
9
- import "./index-Dm65CTdy.js";
10
- import "./index-CSQY21Zb.js";
11
- import "./index-CQQedv0M.js";
12
- import { h as b } from "./moment-BWErdI6_.js";
13
- import { u as W } from "./vue-i18n-DVmD9I_o.js";
14
- import { u as H, v as J, w as K } from "./index.esm2017-BAIN70_n.js";
15
- import { useRoute as Q } from "vue-router";
16
- import { g as $, S as Z, u as X } from "./index-CTgQRqQR.js";
6
+ import "./index-CnRLkzpg.js";
7
+ import { L as c, c as d } from "./index-38u-cCwD.js";
8
+ import "./index-CQZbm9P5.js";
9
+ import "./index-DjONNxbl.js";
10
+ import "./index-D-kPBF9C.js";
11
+ import { h as b } from "./moment-D7p2TMB-.js";
12
+ import { u as W } from "./vue-i18n-DDbkmbSf.js";
13
+ import { u as H, v as K, w as Q } from "./index.esm2017-CokFPnqn.js";
14
+ import { useRoute as $ } from "vue-router";
15
+ import { g as J, S as Z, u as X } from "./index-_jxXI4_v.js";
17
16
  import { o as ee } from "./objectId-dwaoBfJX.js";
18
17
  const te = () => {
19
18
  if (!Z.getBusinessId()) throw new Error("Invalid business ID");
20
19
  return X("queues");
21
20
  }, oe = {
22
21
  async readImportMember(p, w) {
23
- return $(
22
+ return J(
24
23
  await te().get("", {
25
24
  params: { ...p, ...w }
26
25
  })
@@ -28,10 +27,10 @@ const te = () => {
28
27
  }
29
28
  };
30
29
  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" };
31
- 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" }, xe = /* @__PURE__ */ h({
30
+ 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" }, ve = /* @__PURE__ */ h({
32
31
  __name: "Queue",
33
32
  setup(p) {
34
- const v = Q().query.type, { t: x } = W(), E = j(), C = [
33
+ const v = $().query.type, { t: x } = W(), E = j(), C = [
35
34
  {
36
35
  header: "ID",
37
36
  accessorKey: "_id",
@@ -159,15 +158,15 @@ const re = { class: "p-24 flex flex-col gap-y-2" }, ne = { class: "flex items-ce
159
158
  });
160
159
  }
161
160
  const T = async (t) => {
162
- const e = H(void 0, ae.importFilesBucketUrl), r = J(e, t);
163
- return await K(r);
161
+ const e = H(void 0, ae.importFilesBucketUrl), r = K(e, t);
162
+ return await Q(r);
164
163
  }, R = c.options.map((t) => ({ label: u.title(t), value: t })), s = A({
165
164
  type: v ?? [
166
165
  d.enum.MEMBER_IMPORTED,
167
166
  d.enum.SEGMENTATION_IMPORTED
168
167
  ],
169
168
  status: []
170
- }), { tableMeta: i, rowData: P, onSort: k, debouncedFetchData: f } = G(
169
+ }), { tableMeta: i, rowData: P, onSort: k, debouncedFetchData: f } = q(
171
170
  async (t) => {
172
171
  const e = {
173
172
  ...s.value
@@ -199,7 +198,7 @@ const re = { class: "p-24 flex flex-col gap-y-2" }, ne = { class: "flex items-ce
199
198
  await f();
200
199
  }), (t, e) => {
201
200
  const r = V("FmPageHead");
202
- return z(), O(q, null, [
201
+ return z(), L(O, null, [
203
202
  m(r, {
204
203
  title: o(x)("connect.queue.title")
205
204
  }, null, 8, ["title"]),
@@ -235,7 +234,7 @@ const re = { class: "p-24 flex flex-col gap-y-2" }, ne = { class: "flex items-ce
235
234
  }, null, 8, ["modelValue", "items"])
236
235
  ])
237
236
  ]),
238
- m(L, {
237
+ m(G, {
239
238
  loading: o(i).isLoading,
240
239
  "row-data": o(P),
241
240
  "row-count": o(i).totalRows,
@@ -256,5 +255,5 @@ const re = { class: "p-24 flex flex-col gap-y-2" }, ne = { class: "flex items-ce
256
255
  }
257
256
  });
258
257
  export {
259
- xe as default
258
+ ve as default
260
259
  };
@@ -2,20 +2,20 @@ var q = Object.defineProperty;
2
2
  var G = (g, o, m) => o in g ? q(g, o, { enumerable: !0, configurable: !0, writable: !0, value: m }) : g[o] = m;
3
3
  var z = (g, o, m) => G(g, typeof o != "symbol" ? o + "" : o, m);
4
4
  import { defineComponent as T, ref as B, computed as H, resolveComponent as C, openBlock as I, createBlock as J, unref as n, isRef as Q, withCtx as X, createElementBlock as U, createVNode as w, withModifiers as Z, createCommentVNode as ee, createElementVNode as N, h, onMounted as re, Fragment as te } from "vue";
5
- import { u as oe, _ as ae } from "./usePagination-BeF5K3M7.js";
6
- import { g as A } from "./user-8VIt8A1x.js";
5
+ import { u as oe, _ as ae } from "./usePagination-Byxk4XVn.js";
6
+ import { g as A } from "./user-BZxO8qdh.js";
7
7
  import { components as R } from "@feedmepos/ui-library";
8
- import "./index-CQQedv0M.js";
9
- import { u as j } from "./vue-i18n-DVmD9I_o.js";
10
- import { u as L } from "./loading-C6Ouh0mG.js";
8
+ import "./index-DjONNxbl.js";
9
+ import { u as j } from "./vue-i18n-DDbkmbSf.js";
10
+ import { u as L } from "./loading-fZQi5zP8.js";
11
11
  import { useCoreStore as se } from "@feedmepos/mf-common";
12
- import { r as v } from "./index-26SopNpv.js";
12
+ import { r as v } from "./index-ItaoypTr.js";
13
13
  import { c as ie, a as ne } from "./object-qECH92oz.js";
14
- import { u as ce } from "./membership-DU0BwIj8.js";
15
- import { a as le, c as de } from "./plugins-C-CRzeyC.js";
16
- import { u as V, w as me } from "./xlsx-qJHsnW7k.js";
14
+ import { u as ce } from "./membership-CApN5ZJ1.js";
15
+ import { a as le, c as de } from "./plugins-9_UvAdJ2.js";
16
+ import { u as V, w as me } from "./xlsx-D8yNl8dN.js";
17
17
  import { e as f } from "./index-vh86FiIQ.js";
18
- import { h as ue } from "./moment-BWErdI6_.js";
18
+ import { h as ue } from "./moment-D7p2TMB-.js";
19
19
  import { o as pe } from "./objectId-dwaoBfJX.js";
20
20
  const fe = {
21
21
  key: 0,