@feedmepos/mf-connect 0.1.121-dev → 0.1.121-prod

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 (147) hide show
  1. package/dist/{App-DwtaLO6F.js → App-C4T5UWGw.js} +493 -502
  2. package/dist/{Bin-BBaVggZI.js → Bin-ude598pY.js} +8 -8
  3. package/dist/{Broadcast-CqAQ3EmE.js → Broadcast-BtJbmDzX.js} +21 -22
  4. package/dist/{CampaignAnalytic-34bfP8iY.js → CampaignAnalytic-DxC_sgPy.js} +7 -7
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BvAAxE3a.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CBy6cXYx.js} +9 -8
  6. package/dist/{Card-8hlnKnhk.js → Card-B6Qt_KqI.js} +22 -22
  7. package/dist/{Collections-BJ0-UjKf.js → Collections-BCsbhQJM.js} +185 -197
  8. package/dist/{Credit-DJNc__yp.js → Credit-CCl-UjVj.js} +20 -21
  9. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BvilcyyB.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DE_JYKS8.js} +1 -1
  10. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CReXb9gY.js +3493 -0
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DFzVuuEy.js → EffectSheet.vue_vue_type_style_index_0_lang-D_wHxBmj.js} +16 -16
  12. package/dist/{Experience-D-cUhjWc.js → Experience-BZfx679t.js} +31 -32
  13. package/dist/{FileSaver.min-DKYYse6A.js → FileSaver.min-aAU7_riE.js} +1 -1
  14. package/dist/{Game-DdFV90Kp.js → Game-L-RmEmNY.js} +18 -19
  15. package/dist/{GiftCardSetup-Dz0AN159.js → GiftCardSetup-BA_I83wm.js} +31 -31
  16. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-GCp3IFaC.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CtiPxBgn.js} +7 -7
  17. package/dist/{Goals-Dg_kAezl.js → Goals-Dur5LKYk.js} +4 -4
  18. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-B_H1Bgy1.js → ImageInput.vue_vue_type_script_setup_true_lang-ALdW6e1t.js} +1 -1
  19. package/dist/{Index-ZSup3I7J.js → Index-_sUu1gDp.js} +10 -10
  20. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DisF-jcd.js → LocationPicker.vue_vue_type_script_setup_true_lang-BgweoLh2.js} +1 -1
  21. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BHhjZOYi.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BjvB1fab.js} +1 -1
  22. package/dist/{LoyaltyDashboard-D8BhHsaw.js → LoyaltyDashboard-DgLAdZiP.js} +15 -15
  23. package/dist/{MainLayout-BBnhRxyR.js → MainLayout-DOXx217V.js} +1 -1
  24. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-DFrPlj5u.js → MainLayout.vue_vue_type_script_setup_true_lang-BwT0vGID.js} +3 -3
  25. package/dist/{Marketing-5F9LLn91.js → Marketing-CoBYtHdr.js} +4 -4
  26. package/dist/{MarketingMaterialEdit-C7dD4Bzw.js → MarketingMaterialEdit-R2jgDJKr.js} +211 -214
  27. package/dist/{Member-Dk4JeGru.js → Member-CQicHGEK.js} +7 -7
  28. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-ISolD_Qg.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BY57N2OM.js} +47 -39
  29. package/dist/{MemberImportHistory-C0Ep8L2q.js → MemberImportHistory-C_xDFYQh.js} +7 -7
  30. package/dist/{MemberList-BsuPfBgk.js → MemberList-DaOsohKg.js} +105 -103
  31. package/dist/{MemberTransactions-mZ3fHw5O.js → MemberTransactions-DOCrHQ2s.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-1weyRM8c.js → MessageInput.vue_vue_type_script_setup_true_lang-ep7Yqi5n.js} +12 -12
  33. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-caED3JRW.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CTorzIeM.js} +1 -1
  34. package/dist/{Mission-C7DqUOJz.js → Mission-BeNYiQ9K.js} +21 -22
  35. package/dist/{Overview-U201nBVO.js → Overview-8QoQ_gHU.js} +20 -20
  36. package/dist/{Overview-VABLg36G.js → Overview-BMXpAv-n.js} +144 -145
  37. package/dist/{Point-DU6Ndv35.js → Point-Dyq5SXT2.js} +21 -22
  38. package/dist/{Promotion-9UhZXNPb.js → Promotion-BLAsz0mu.js} +131 -137
  39. package/dist/{Queue-CUxMedbd.js → Queue-qmf3ymVp.js} +45 -45
  40. package/dist/{Record-BIftCQzV.js → Record-DMqhKlIc.js} +9 -9
  41. package/dist/{Review-lyVgTfsP.js → Review-DDGtAXxX.js} +2 -2
  42. package/dist/ReviewFacebookCallback-jCP7vNJ3.js +238 -0
  43. package/dist/{ReviewGoogleCallback-B41PXfsj.js → ReviewGoogleCallback-kIu4wO-x.js} +5 -5
  44. package/dist/{Reward-BMun_Rs4.js → Reward-B9eyzyk7.js} +16 -16
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-3TONrUQu.js → RewardGroup.vue_vue_type_script_setup_true_lang-B5oNDez7.js} +13 -13
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cyo98lN8.js +1884 -0
  47. package/dist/{Segment-1VS7ycXi.js → Segment-CSenE8-8.js} +306 -303
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-C5iJSlxi.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-gUmEIxLj.js} +14 -14
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CXY9Wyk9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-5m7qY393.js} +4 -4
  50. package/dist/{Setting-BdtzvKjt.js → Setting-CshEhFJ0.js} +148 -159
  51. package/dist/{SettingAdvertisements-BO2l3HBT.js → SettingAdvertisements-B7NU1mTE.js} +12 -12
  52. package/dist/Settings-CSeRLtGl.js +179 -0
  53. package/dist/{Store-DWQz-MgY.js → Store-BouP_m9K.js} +28 -28
  54. package/dist/{StoreRewards-Bfwuqxf-.js → StoreRewards-NX24LqS_.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B2zDGFAw.js +1265 -0
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-IGh7Kiot.js +142 -0
  57. package/dist/{Tier-CKn-l-wY.js → Tier-Cg5KAErk.js} +687 -2575
  58. package/dist/{Title-BXDk69uL.js → Title-BcziCAh4.js} +94 -95
  59. package/dist/{Transaction-D4HQO4i9.js → Transaction-DK0Splad.js} +2 -2
  60. package/dist/Upselling-1RSD_l_k.js +200 -0
  61. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-um124o4t.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-C-mg8LqR.js} +26 -26
  62. package/dist/{Voucher-BGIyw4jq.js → Voucher-DX6-GX17.js} +19 -19
  63. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BKyZj5SP.js → VoucherEditor.vue_vue_type_script_setup_true_lang-7KZNW6gS.js} +12 -12
  64. package/dist/{WhatsappAccount-Cd82g_xj.js → WhatsappAccount-qbnBp7mv.js} +6 -6
  65. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DWy8kS66.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BAw8wUAu.js} +1 -1
  66. package/dist/{WhatsappBot-auQhO8zk.js → WhatsappBot-Dkx24HI7.js} +6 -6
  67. package/dist/{WhatsappBotLogs-CWuJzK9W.js → WhatsappBotLogs-CR9RPc-1.js} +6 -6
  68. package/dist/{WhatsappBotSettings-B8KXMpIF.js → WhatsappBotSettings-DF97RSSV.js} +4 -4
  69. package/dist/{WhatsappLayout-DxooAkkL.js → WhatsappLayout-JAye9JZI.js} +3 -3
  70. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-CYHmgQ2v.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-toCNd_Ip.js} +3 -3
  71. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DilxQM_z.js → ZodTextField.vue_vue_type_script_setup_true_lang-DvMdQKET.js} +2 -2
  72. package/dist/{app-BG-zK89d.js → app-O2-Xtjxu.js} +15017 -14861
  73. package/dist/app.js +3 -4
  74. package/dist/{base.export-BcMuREGH.js → base.export-0NAAWE2x.js} +2 -2
  75. package/dist/{business-9_NOI2V9.js → business-DO-6gAei.js} +1 -1
  76. package/dist/{campaign-DjBTRZyA.js → campaign-CKpTYx8r.js} +94 -121
  77. package/dist/{campaign-8y_9SvKP.js → campaign-CjtbytTA.js} +28 -34
  78. package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-BqekIiiN.js} +1 -2
  79. package/dist/campaign.fn-DNva0Lzi.js +776 -0
  80. package/dist/{collection.fn-yXurU9iv.js → collection.fn-DgVYvv2u.js} +2 -2
  81. package/dist/{currency-YzyBFtDU.js → currency-RCSoljIc.js} +1 -1
  82. package/dist/{effect-bMGarJZ6.js → effect-Cic-yJ5a.js} +1 -1
  83. package/dist/{email-addresses-Ciu83j_3.js → email-addresses-Cz7nxyM7.js} +25 -25
  84. package/dist/{feature-flag-H5D1Cob5.js → feature-flag-BHFUKA3S.js} +70 -70
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/{helper-BH9HMikb.js → helper-H_gC1vRi.js} +1 -1
  87. package/dist/{index-CH-KHkm5.js → index-B-RKMcrS.js} +1 -1
  88. package/dist/{index-DkMy7WpU.js → index-BEFoWcsk.js} +2 -2
  89. package/dist/{index-DbxiG50D.js → index-BFxCHHSQ.js} +2 -2
  90. package/dist/{index-Cyf05z_2.js → index-BU-CbflW.js} +2 -2
  91. package/dist/{index-CIOidYvo.js → index-C-vDa3pL.js} +1 -1
  92. package/dist/{index-MWNnMT2T.js → index-CSNMZuv4.js} +4 -4
  93. package/dist/{index-RvJ5cq__.js → index-CTDzF7d_.js} +3 -3
  94. package/dist/{index-BaTnDV-T.js → index-D5_gAcWw.js} +2613 -2699
  95. package/dist/{index-BHO82_Ix.js → index-DRuHmNoi.js} +1 -1
  96. package/dist/{index-DYu7ZdQt.js → index-DVIKJ8Fi.js} +1 -1
  97. package/dist/{index-_giqGuYM.js → index-DVt628Qh.js} +1 -1
  98. package/dist/{index-pnM5q4c_.js → index-DZBbFrO4.js} +232 -389
  99. package/dist/{index-BxwJfT08.js → index-DlRDCDW-.js} +197 -197
  100. package/dist/{index-BvKJM3M2.js → index-Dw5ikwFR.js} +15 -29
  101. package/dist/{index-CooParq-.js → index-G8S_j3nj.js} +581 -682
  102. package/dist/{index-taPHgOqE.js → index-GJRqAxuJ.js} +251 -608
  103. package/dist/{index-Ye3qFt34.js → index-bMAgU-Xo.js} +10 -10
  104. package/dist/{index-DpkoCl4z.js → index-ka7lQ9t1.js} +10 -10
  105. package/dist/{index-B7-Uvnfn.js → index-rQ30JRKa.js} +6 -19
  106. package/dist/{index-CJAFz9Nn.js → index-zsTY_sDR.js} +1 -1
  107. package/dist/{index.esm2017-CLxZor1Y.js → index.esm2017-Cf5e9e4I.js} +104 -104
  108. package/dist/{loading-CsOSUWBd.js → loading-Q15eugE9.js} +1 -1
  109. package/dist/{lodash-CshibTzh.js → lodash-B9y2Z6FT.js} +1 -1
  110. package/dist/{member-import-BdaGAjjt.js → member-import-B7-pNlAu.js} +1 -1
  111. package/dist/{membership-C5JWO1FM.js → membership-FjTQN8-W.js} +2 -2
  112. package/dist/{money-Blt5EM43.js → money-DpnjYb20.js} +1 -1
  113. package/dist/{number-COm3MiH8.js → number-DQpgkGJp.js} +1 -1
  114. package/dist/objectid-DDT17fUp.js +145 -0
  115. package/dist/{onboarding-BbQDJOOS.js → onboarding-j-EtZDu5.js} +36 -36
  116. package/dist/{onboardingSetup-BLISY52M.js → onboardingSetup-B4yc4Acp.js} +2 -2
  117. package/dist/{plugins-De_chCYU.js → plugins-TZdigPwR.js} +3 -3
  118. package/dist/{reward-Dl8Zoxe_.js → reward-BpRIHbOy.js} +1 -1
  119. package/dist/{rule-D6_iss3O.js → rule-PjQfvtJP.js} +492 -572
  120. package/dist/rule-builder-Vloq9R4R.js +102 -0
  121. package/dist/style.css +1 -1
  122. package/dist/template-CeZkljlm.js +275 -0
  123. package/dist/{timezone-CA5FwOyy.js → timezone-BmgCN50d.js} +1 -1
  124. package/dist/{transaction.fn-DI_NeGQb.js → transaction.fn-C9wUfIRo.js} +2 -2
  125. package/dist/{trigger-CuymoMM-.js → trigger-D9XVMrkP.js} +9 -9
  126. package/dist/{useMarketingMaterialActions-Bz0Kgvgd.js → useMarketingMaterialActions-2_HeLxeK.js} +4 -4
  127. package/dist/{usePagination-yb1rupwa.js → usePagination-Do3Rw4mx.js} +1 -1
  128. package/dist/{user-QSKyFaMI.js → user-CJpvF5mn.js} +1 -1
  129. package/dist/vue-i18n-CJsKXxJX.js +2365 -0
  130. package/dist/{xlsx--RjkGa9A.js → xlsx-CaTmMdcM.js} +440 -440
  131. package/dist/{zod-CmPMd-h0.js → zod-BcPs1As4.js} +1 -1
  132. package/package.json +3 -7
  133. package/dist/AuditLogs-s572aHLw.js +0 -2016
  134. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSjOHBhA.js +0 -4439
  135. package/dist/Grab-BSQt4deB.js +0 -301
  136. package/dist/ReviewFacebookCallback-Da5G19bE.js +0 -225
  137. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DHzFgr4h.js +0 -1923
  138. package/dist/Settings-CvYawDU5.js +0 -286
  139. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CBwmDKAw.js +0 -1319
  140. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CHzFjo24.js +0 -7007
  141. package/dist/Upselling-CikWzKq7.js +0 -1032
  142. package/dist/campaign.fn-COkPH1QE.js +0 -776
  143. package/dist/duplicateCampaign-dRWioann.js +0 -51
  144. package/dist/google-BQK68wbe.js +0 -5
  145. package/dist/objectid-DQTx3-ee.js +0 -145
  146. package/dist/template-Cw6j1cLX.js +0 -224
  147. package/dist/vue-i18n-B_qtODCw.js +0 -2365
@@ -1,301 +0,0 @@
1
- import { defineComponent as q, ref as L, computed as z, h as J, onMounted as Q, resolveComponent as u, openBlock as f, createElementBlock as k, Fragment as F, createVNode as l, unref as i, withCtx as x, createElementVNode as m, renderList as W, createBlock as O, resolveDynamicComponent as X, toDisplayString as Y } from "vue";
2
- import { _ as Z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as ee, components as te } from "@feedmepos/ui-library";
4
- import { p as P } from "./plugins-De_chCYU.js";
5
- import { u as oe } from "./loading-CsOSUWBd.js";
6
- import { u as ne } from "./business-9_NOI2V9.js";
7
- import { u as ae } from "./campaign-8y_9SvKP.js";
8
- import { u as re } from "./vue-i18n-B_qtODCw.js";
9
- import { h as d } from "./moment-D7p2TMB-.js";
10
- import { a as se, b as V } from "./campaign-DjBTRZyA.js";
11
- import { s as ie, _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSjOHBhA.js";
12
- import { u as le } from "./template-Cw6j1cLX.js";
13
- import { _ as $ } from "./FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js";
14
- import { c as C } from "./index-DkMy7WpU.js";
15
- const me = { class: "px-24 flex flex-col gap-y-16" }, ue = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, pe = { class: "space-y-8" }, fe = { class: "flex w-full gap-4 items-center" }, ge = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = /* @__PURE__ */ q({
16
- __name: "Grab",
17
- setup(_e) {
18
- const { t: o } = re(), I = {
19
- label: o("connect.grab.createCampaign"),
20
- value: "create",
21
- isPrimary: !0,
22
- prependIcon: "add"
23
- }, A = le("GRAB", ee()), S = ne(), g = ae(), { global: R, minor: T } = oe, K = [
24
- {
25
- label: "Bill promotion",
26
- value: "BILL"
27
- },
28
- {
29
- label: "Item promotion",
30
- value: "ITEM"
31
- }
32
- ], c = L({
33
- searchKey: "",
34
- location: [],
35
- effectType: []
36
- });
37
- function E(e) {
38
- const t = c.value.location;
39
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((a) => {
40
- var s;
41
- return (s = e == null ? void 0 : e.targetLocation) == null ? void 0 : s.includes(a);
42
- }) : e.targetLocation.includes(t);
43
- }
44
- function j(e) {
45
- var s, r;
46
- const t = c.value.effectType;
47
- if (!t || t.length === 0) return !0;
48
- const a = (r = (s = e.effect) == null ? void 0 : s.options) == null ? void 0 : r.target;
49
- return t.includes(a);
50
- }
51
- const p = z(
52
- () => g.campaigns.grab.filter(
53
- (e) => E(e) && j(e)
54
- )
55
- ), G = [
56
- {
57
- header: o("connect.grab.promotionTitle"),
58
- accessorFn: (e) => e.name
59
- },
60
- {
61
- header: o("connect.grab.period"),
62
- accessorFn: (e) => {
63
- const t = d(e.timeframeOptions.start).format("DD/MM/YYYY"), a = d(e.timeframeOptions.end).format("DD/MM/YYYY");
64
- return `${t} - ${a}`;
65
- }
66
- },
67
- {
68
- header: o("connect.grab.status"),
69
- accessorFn: (e) => se(e),
70
- cell(e) {
71
- return V(e.row.original);
72
- }
73
- },
74
- {
75
- header: o("connect.grab.summary"),
76
- cell(e) {
77
- const t = ie(e.row.original.discount);
78
- return t ? `${t.type} - ${t.adjustment}` : "-";
79
- }
80
- },
81
- {
82
- header: o("connect.grab.actions"),
83
- cell(e) {
84
- return J(te.FmButton, {
85
- variant: "tertiary",
86
- icon: "delete",
87
- iconColor: "neutral-gray-400",
88
- onClick: (t) => {
89
- t.stopPropagation(), D(e.row.original);
90
- }
91
- });
92
- }
93
- }
94
- ], B = L();
95
- async function D(e) {
96
- await P.remove(o("connect.grab.confirmRemove", { name: e.name })) && await T(
97
- async () => {
98
- await C.delete(e._id), await g.read("PROMOTION");
99
- },
100
- {
101
- message: o("connect.grab.removing", { name: e.name }),
102
- successMessage: o("connect.grab.removedSuccessfully", {
103
- name: e.name
104
- })
105
- }
106
- );
107
- }
108
- async function b(e) {
109
- e ? await t() : A.open(async (a) => {
110
- await t(a);
111
- });
112
- async function t(a) {
113
- var s;
114
- (s = B.value) == null || s.showSheet(
115
- !0,
116
- "GRAB",
117
- e ? await C.readById(e._id) : void 0,
118
- a
119
- );
120
- }
121
- }
122
- async function N(e) {
123
- var a;
124
- const t = await U(e.campaign);
125
- if (t.length > 0) {
126
- const s = t.map(
127
- (r) => `"${r.name}" (${d(r.timeframeOptions.start).format("DD/MM/YYYY")} - ${d(r.timeframeOptions.end).format("DD/MM/YYYY")})`
128
- ).join(`
129
- `);
130
- return await ((a = P.dialog) == null ? void 0 : a.open({
131
- title: o("connect.grab.conflictDetected"),
132
- message: o("connect.grab.conflictMessage", {
133
- conflicts: s
134
- }),
135
- closeButton: !0,
136
- overlay: !0,
137
- primaryActions: {
138
- close: !0,
139
- text: "OK"
140
- }
141
- })), !1;
142
- }
143
- await T(
144
- async () => (e.campaign._id ? await C.update(e.campaign._id, e) : await C.create(e), await g.read("PROMOTION"), !0),
145
- {
146
- message: o(
147
- e.campaign._id ? "connect.grab.updating" : "connect.grab.creating"
148
- ),
149
- successMessage: o(
150
- e.campaign._id ? "connect.grab.updatedSuccessfully" : "connect.grab.createdSuccessfully"
151
- )
152
- }
153
- );
154
- }
155
- async function U(e) {
156
- const t = g.campaigns.grab, a = [], s = !!e._id;
157
- for (const r of t) {
158
- if (s && r._id === e._id) continue;
159
- const _ = d(e.timeframeOptions.start), y = d(e.timeframeOptions.end), h = d(r.timeframeOptions.start), v = d(r.timeframeOptions.end);
160
- if (_.isBefore(v) && y.isAfter(h) || h.isBefore(y) && v.isAfter(_)) {
161
- const n = e.discount, w = r.discount;
162
- n.scope.type === w.scope.type && a.push(r);
163
- }
164
- }
165
- return a;
166
- }
167
- async function H(e) {
168
- switch (e) {
169
- case "create":
170
- b();
171
- break;
172
- }
173
- }
174
- return Q(async () => {
175
- await R(async () => {
176
- await S.readLocations(), await g.read("PROMOTION");
177
- });
178
- }), (e, t) => {
179
- const a = u("FmPill"), s = u("FmPageHead"), r = u("FmSearch"), _ = u("FmTable"), y = u("FmButton"), h = u("FmListItem"), v = u("FmList"), M = u("FmCard");
180
- return f(), k(F, null, [
181
- l(s, {
182
- title: i(o)("connect.grab.title"),
183
- actions: i(p).length > 0 ? [I] : [],
184
- "onClick:action": H
185
- }, {
186
- prepend: x(() => [
187
- l(a, { variant: "beta" }),
188
- l(a, { variant: "premium" })
189
- ]),
190
- _: 1
191
- }, 8, ["title", "actions"]),
192
- m("div", me, [
193
- l(r, {
194
- modelValue: c.value.searchKey,
195
- "onUpdate:modelValue": t[0] || (t[0] = (n) => c.value.searchKey = n),
196
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
197
- placeholder: i(o)("connect.grab.search"),
198
- collapsible: ""
199
- }, null, 8, ["modelValue", "placeholder"]),
200
- i(p) && i(p).length > 0 ? (f(), k(F, { key: 0 }, [
201
- m("div", ue, [
202
- m("div", de, [
203
- l($, {
204
- label: `${i(o)("connect.common.location")}: `,
205
- "right-icon": "keyboard_arrow_down",
206
- modelValue: c.value.location,
207
- "onUpdate:modelValue": t[1] || (t[1] = (n) => c.value.location = n),
208
- icon: "storefront",
209
- "show-item-label": !0,
210
- items: i(S).locationOptions
211
- }, null, 8, ["label", "modelValue", "items"]),
212
- l($, {
213
- label: "Type:",
214
- "right-icon": "keyboard_arrow_down",
215
- modelValue: c.value.effectType,
216
- "onUpdate:modelValue": t[2] || (t[2] = (n) => c.value.effectType = n),
217
- icon: "filter_list",
218
- "show-item-label": !0,
219
- items: K
220
- }, null, 8, ["modelValue"])
221
- ]),
222
- l(r, {
223
- modelValue: c.value.searchKey,
224
- "onUpdate:modelValue": t[3] || (t[3] = (n) => c.value.searchKey = n),
225
- class: "xs:hidden",
226
- placeholder: "search",
227
- collapsible: ""
228
- }, null, 8, ["modelValue"])
229
- ]),
230
- l(_, {
231
- class: "xs:hidden",
232
- "row-data": i(p),
233
- "column-defs": G,
234
- "search-value": c.value.searchKey,
235
- "column-filter": [],
236
- onRowClick: t[4] || (t[4] = (n) => b(n.original)),
237
- "hide-footer": i(p).length < 10
238
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
239
- l(v, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
240
- default: x(() => [
241
- (f(!0), k(F, null, W(i(p).filter(
242
- (n) => n.name.toLowerCase().includes(c.value.searchKey.toLowerCase())
243
- ), (n) => (f(), O(h, {
244
- key: n._id.toString(),
245
- onClick: (w) => b(n),
246
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
247
- }, {
248
- default: x(() => [
249
- m("div", pe, [
250
- m("div", fe, [
251
- (f(), O(X(i(V)(n))))
252
- ])
253
- ]),
254
- l(y, {
255
- icon: "delete",
256
- "icon-color": "neutral-gray-400",
257
- variant: "tertiary",
258
- onClick: (w) => (w.stopPropagation(), D(n))
259
- }, null, 8, ["onClick"])
260
- ]),
261
- _: 2
262
- }, 1032, ["onClick"]))), 128))
263
- ]),
264
- _: 1
265
- })
266
- ], 64)) : (f(), O(M, {
267
- key: 1,
268
- variant: "outlined",
269
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
270
- }, {
271
- default: x(() => [
272
- t[6] || (t[6] = m("img", {
273
- src: Z,
274
- class: "aspect-square w-[150px]"
275
- }, null, -1)),
276
- m("div", ge, [
277
- m("div", ye, Y(i(o)("connect.grab.createPromotionCampaign")), 1),
278
- m("div", be, Y(i(o)("connect.grab.description")), 1)
279
- ]),
280
- l(y, {
281
- variant: "primary",
282
- label: i(o)("connect.grab.createPromotionCampaign"),
283
- icon: "add",
284
- onClick: t[5] || (t[5] = (n) => b())
285
- }, null, 8, ["label"])
286
- ]),
287
- _: 1
288
- }))
289
- ]),
290
- l(ce, {
291
- ref_key: "sheetRef",
292
- ref: B,
293
- "onSubmit:modelValue": N
294
- }, null, 512)
295
- ], 64);
296
- };
297
- }
298
- });
299
- export {
300
- Pe as default
301
- };
@@ -1,225 +0,0 @@
1
- import { defineComponent as L, computed as T, openBlock as i, createElementBlock as m, normalizeClass as B, createElementVNode as u, createBlock as P, unref as e, toDisplayString as y, createCommentVNode as F, createVNode as v, onMounted as $, ref as I, Fragment as E, renderList as R, resolveComponent as M, isRef as N } from "vue";
2
- import { u as C } from "./vue-i18n-B_qtODCw.js";
3
- import { components as x } from "@feedmepos/ui-library";
4
- import { r as S } from "./index-DpkoCl4z.js";
5
- import { u as j } from "./business-9_NOI2V9.js";
6
- import { _ as U } from "./LocationPicker.vue_vue_type_script_setup_true_lang-DisF-jcd.js";
7
- import { R as z } from "./app-BG-zK89d.js";
8
- import { useRouter as V } from "vue-router";
9
- const A = ["src"], H = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, D = {
10
- key: 2,
11
- class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
12
- }, G = /* @__PURE__ */ L({
13
- __name: "FacebookPageConfig",
14
- props: {
15
- page: {},
16
- expanded: { type: Boolean },
17
- availableLocations: {}
18
- },
19
- emits: ["toggleExpand", "toggleLocation"],
20
- setup(s, { emit: t }) {
21
- const k = s, f = t, { t: r } = C(), g = T(() => k.page.locationIds);
22
- return (h, p) => (i(), m("div", {
23
- class: B([
24
- "rounded-lg border overflow-hidden transition-colors",
25
- s.expanded ? "border-fm-color-primary-500" : "border-fm-color-neutral-gray-200"
26
- ])
27
- }, [
28
- u("button", {
29
- class: "w-full flex items-center gap-12 p-16 bg-white text-left hover:bg-fm-color-neutral-gray-50 transition-colors",
30
- onClick: p[0] || (p[0] = (c) => f("toggleExpand"))
31
- }, [
32
- s.page.pageProfileImageUrl ? (i(), m("img", {
33
- key: 0,
34
- src: s.page.pageProfileImageUrl,
35
- class: "w-32 h-32 rounded-full shrink-0 object-cover"
36
- }, null, 8, A)) : (i(), P(e(x).FmIcon, {
37
- key: 1,
38
- name: "thumb_up",
39
- class: "text-fm-color-neutral-gray-400 shrink-0"
40
- })),
41
- u("span", H, y(s.page.pageName), 1),
42
- s.page.locationIds.length > 0 ? (i(), m("span", D, y(e(r)("connect.review.locationsSelected", s.page.locationIds.length)), 1)) : F("", !0),
43
- v(e(x).FmIcon, {
44
- name: s.expanded ? "expand_less" : "expand_more",
45
- class: "text-fm-color-neutral-gray-400 shrink-0"
46
- }, null, 8, ["name"])
47
- ]),
48
- s.expanded ? (i(), P(U, {
49
- key: 0,
50
- locations: s.availableLocations,
51
- "selected-ids": e(g),
52
- onToggle: p[1] || (p[1] = (c) => f("toggleLocation", c))
53
- }, null, 8, ["locations", "selected-ids"])) : F("", !0)
54
- ], 2));
55
- }
56
- }), O = { class: "flex flex-col gap-8" }, W = /* @__PURE__ */ L({
57
- __name: "FacebookPageLocationMapping",
58
- props: {
59
- pages: {}
60
- },
61
- emits: ["update:pages"],
62
- setup(s, { emit: t }) {
63
- const k = s, f = j();
64
- $(() => f.readLocations());
65
- const r = t, g = I(null), h = T(() => {
66
- const l = /* @__PURE__ */ new Set();
67
- for (const b of k.pages)
68
- b.locationIds.forEach((a) => l.add(a));
69
- return l;
70
- });
71
- function p(l) {
72
- const b = new Set(l.locationIds);
73
- return f.locations.filter((a) => {
74
- const n = a._id.toString();
75
- return !h.value.has(n) || b.has(n);
76
- });
77
- }
78
- function c(l, b) {
79
- const a = b._id.toString(), n = k.pages.map((o) => {
80
- if (o.facebookPageId !== l) return o;
81
- const _ = o.locationIds.includes(a);
82
- return {
83
- ...o,
84
- locationIds: _ ? o.locationIds.filter((d) => d !== a) : [...o.locationIds, a]
85
- };
86
- });
87
- r("update:pages", n);
88
- }
89
- function w(l) {
90
- g.value = g.value === l ? null : l;
91
- }
92
- return (l, b) => (i(), m("div", O, [
93
- (i(!0), m(E, null, R(s.pages, (a) => (i(), P(G, {
94
- key: a.facebookPageId,
95
- page: a,
96
- expanded: e(g) === a.facebookPageId,
97
- "available-locations": p(a),
98
- onToggleExpand: (n) => w(a.facebookPageId),
99
- onToggleLocation: (n) => c(a.facebookPageId, n)
100
- }, null, 8, ["page", "expanded", "available-locations", "onToggleExpand", "onToggleLocation"]))), 128))
101
- ]));
102
- }
103
- }), q = { class: "flex flex-col min-h-full gap-16 p-24" }, J = {
104
- key: 0,
105
- class: "flex flex-col items-center justify-center flex-1 gap-16"
106
- }, K = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, Q = {
107
- key: 1,
108
- class: "flex flex-col items-center justify-center flex-1 gap-16"
109
- }, X = { class: "fm-typo-en-body-lg-600" }, Y = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, Z = {
110
- key: 2,
111
- class: "flex flex-col items-center justify-center flex-1 gap-16"
112
- }, ee = { class: "fm-typo-en-body-lg-600" }, oe = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, te = { class: "fm-typo-en-body-lg-600" }, ne = { class: "flex gap-8 justify-end mt-auto pt-8" }, me = /* @__PURE__ */ L({
113
- __name: "ReviewFacebookCallback",
114
- setup(s) {
115
- const { t } = C(), k = V();
116
- function f() {
117
- return k.replace({ name: z["$connect-REVIEW_SETTINGS"] });
118
- }
119
- const r = I([]), g = I(!1), h = I(!1), p = I(!1), c = I(null), w = T(
120
- () => r.value.some((n) => n.locationIds.length > 0)
121
- );
122
- function l(n, o) {
123
- return n instanceof Error ? n.message : o;
124
- }
125
- async function b() {
126
- const n = window.location.hash;
127
- if (!n) {
128
- c.value = t("connect.review.noToken");
129
- return;
130
- }
131
- const _ = new URLSearchParams(n.slice(1)).get("access_token");
132
- if (!_) {
133
- c.value = t("connect.review.noToken");
134
- return;
135
- }
136
- g.value = !0;
137
- try {
138
- const d = await S.connectFacebook(_);
139
- r.value = (d == null ? void 0 : d.pages) ?? [], r.value.length === 0 && (c.value = t("connect.review.facebook.noPages"));
140
- } catch (d) {
141
- c.value = l(d, t("connect.review.facebook.failed"));
142
- } finally {
143
- g.value = !1;
144
- }
145
- }
146
- async function a() {
147
- if (!w.value) {
148
- c.value = t("connect.review.noMappings");
149
- return;
150
- }
151
- const n = r.value.map((o) => ({
152
- facebookPageId: o.facebookPageId,
153
- locationIds: o.locationIds
154
- }));
155
- h.value = !0;
156
- try {
157
- await S.updateFacebookPages(n), p.value = !0, setTimeout(f, 2e3);
158
- } catch (o) {
159
- c.value = l(o, t("connect.review.facebook.failed"));
160
- } finally {
161
- h.value = !1;
162
- }
163
- }
164
- return $(b), (n, o) => {
165
- const _ = M("FmPageHead");
166
- return i(), m(E, null, [
167
- v(_, {
168
- title: e(t)("connect.navigation.review")
169
- }, null, 8, ["title"]),
170
- u("div", q, [
171
- e(g) ? (i(), m("div", J, [
172
- v(e(x).FmIcon, {
173
- name: "sync",
174
- size: "xl",
175
- class: "animate-spin text-fm-color-neutral-gray-400"
176
- }),
177
- u("p", K, y(e(t)("connect.review.facebook.fetching")), 1)
178
- ])) : e(p) ? (i(), m("div", Q, [
179
- v(e(x).FmIcon, {
180
- name: "check_circle",
181
- size: "xl",
182
- class: "text-fm-color-typo-success"
183
- }),
184
- u("p", X, y(e(t)("connect.review.facebook.success")), 1),
185
- u("p", Y, y(e(t)("connect.review.redirecting")), 1)
186
- ])) : e(c) ? (i(), m("div", Z, [
187
- v(e(x).FmIcon, {
188
- name: "error",
189
- size: "xl",
190
- class: "text-fm-color-system-error-500"
191
- }),
192
- u("p", ee, y(e(t)("connect.review.errorTitle")), 1),
193
- u("p", oe, y(e(c)), 1),
194
- v(e(x).FmButton, {
195
- label: e(t)("connect.review.goBack"),
196
- onClick: o[0] || (o[0] = (d) => f())
197
- }, null, 8, ["label"])
198
- ])) : e(r).length > 0 ? (i(), m(E, { key: 3 }, [
199
- u("p", te, y(e(t)("connect.review.facebook.selectPage")), 1),
200
- v(W, {
201
- pages: e(r),
202
- "onUpdate:pages": o[1] || (o[1] = (d) => N(r) ? r.value = d : null)
203
- }, null, 8, ["pages"]),
204
- u("div", ne, [
205
- v(e(x).FmButton, {
206
- variant: "secondary",
207
- label: e(t)("connect.review.cancel"),
208
- onClick: o[2] || (o[2] = (d) => f())
209
- }, null, 8, ["label"]),
210
- v(e(x).FmButton, {
211
- label: e(t)("connect.review.connect"),
212
- disabled: !e(w),
213
- loading: e(h),
214
- onClick: a
215
- }, null, 8, ["label", "disabled", "loading"])
216
- ])
217
- ], 64)) : F("", !0)
218
- ])
219
- ], 64);
220
- };
221
- }
222
- });
223
- export {
224
- me as default
225
- };