@feedmepos/mf-connect 0.1.117-dev → 0.1.118-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 (146) hide show
  1. package/dist/{App-BpcsgH7K.js → App-BHcTqLff.js} +89 -97
  2. package/dist/{Bin-Cm0wjQeR.js → Bin-DWhXJmHo.js} +8 -8
  3. package/dist/{Broadcast-BoJaHqnO.js → Broadcast-Ct1DL8Pd.js} +21 -22
  4. package/dist/{CampaignAnalytic-Eg4xZW0B.js → CampaignAnalytic-BSEKCM-4.js} +7 -7
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BXylK6Ze.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BxRg2Wu8.js} +10 -9
  6. package/dist/{Card-BfkMcFaG.js → Card-B7DwrAPH.js} +23 -23
  7. package/dist/{Collections-RXmxQbII.js → Collections-BJw4JJq_.js} +185 -197
  8. package/dist/{Credit-CsRPM1jv.js → Credit-BteIGXkp.js} +20 -21
  9. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-D2tvK7pw.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CSFwIzOS.js} +1 -1
  10. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BJotVIKM.js +3496 -0
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CUx8UIIq.js → EffectSheet.vue_vue_type_style_index_0_lang-BDZ21UHA.js} +30 -30
  12. package/dist/{Experience-BC8Pj-v9.js → Experience-C_VQVfJX.js} +31 -32
  13. package/dist/{FileSaver.min-DzmoQFA0.js → FileSaver.min-CMiQUZQE.js} +1 -1
  14. package/dist/{Game-DJXNHFBs.js → Game-BiHMrMBF.js} +18 -19
  15. package/dist/{GiftCardSetup-_0n8lU-t.js → GiftCardSetup-DtJIm6oI.js} +31 -31
  16. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-C-AiJdui.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-BKGnPAEj.js} +7 -7
  17. package/dist/{Goals-DSZwKpds.js → Goals-B7VjLMDT.js} +4 -4
  18. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BZb-H4fM.js → ImageInput.vue_vue_type_script_setup_true_lang-C9ecPgpJ.js} +1 -1
  19. package/dist/{Index-Cbi0bquE.js → Index-D_DIHKZG.js} +10 -10
  20. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-GLhMtvzi.js → LocationPicker.vue_vue_type_script_setup_true_lang-DSwB0Ubn.js} +1 -1
  21. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Bt9CO_QR.js → LottieAnimation.vue_vue_type_script_setup_true_lang-dk8_eVwd.js} +1 -1
  22. package/dist/{LoyaltyDashboard-fK90c27A.js → LoyaltyDashboard-DOgHeJdK.js} +15 -15
  23. package/dist/{MainLayout-Bf-l9yL4.js → MainLayout-CfYgoXLS.js} +1 -1
  24. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-COR6YYYI.js → MainLayout.vue_vue_type_script_setup_true_lang-Bz2LGHUd.js} +3 -3
  25. package/dist/{Marketing-B7cZGsO-.js → Marketing-B6TCrwaR.js} +4 -4
  26. package/dist/{MarketingMaterialEdit-5IcV2ct6.js → MarketingMaterialEdit-Bu3a9NGj.js} +211 -214
  27. package/dist/{Member-BGTrRVdq.js → Member-X51KrYXV.js} +7 -7
  28. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DJr2hV2W.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CYU21JaO.js} +48 -40
  29. package/dist/{MemberImportHistory--FxkTJmu.js → MemberImportHistory-CHd9fx7E.js} +7 -7
  30. package/dist/{MemberList-EjY5dgwt.js → MemberList-D4L3bSlw.js} +105 -103
  31. package/dist/{MemberTransactions-Oia7LIFK.js → MemberTransactions-CEgjfhnX.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CLOQZCYy.js → MessageInput.vue_vue_type_script_setup_true_lang-zsaig_yK.js} +12 -12
  33. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Ev3bB8cg.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-YZQkKG66.js} +1 -1
  34. package/dist/{Mission-BFHYb4aT.js → Mission-BEVtvY0-.js} +21 -22
  35. package/dist/{Overview-d5U37aot.js → Overview-4QRkldza.js} +144 -145
  36. package/dist/{Overview-BVNyQxFL.js → Overview-DVoXXZ16.js} +21 -21
  37. package/dist/{Point-CXkqH02Z.js → Point-BJmebaL9.js} +21 -22
  38. package/dist/{Promotion-DdxNvlOO.js → Promotion-DWZZBofu.js} +131 -137
  39. package/dist/{Queue-C96oNKyP.js → Queue-DLdsyhCT.js} +46 -46
  40. package/dist/{Record-Bj2e2Y4i.js → Record-QOD3XELf.js} +9 -9
  41. package/dist/{Review-CJK5S1oI.js → Review-CKmhyuqj.js} +2 -2
  42. package/dist/ReviewFacebookCallback-C6DlaJ_j.js +238 -0
  43. package/dist/{ReviewGoogleCallback-Dmk4VyGA.js → ReviewGoogleCallback-CDriVQPZ.js} +5 -5
  44. package/dist/{Reward-Dh2YI0Xb.js → Reward-DftoZfPN.js} +16 -16
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-U47m3AAn.js → RewardGroup.vue_vue_type_script_setup_true_lang-ZgYX2QwC.js} +14 -14
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DHmBwLNP.js +1884 -0
  47. package/dist/{Segment-FYvtCkqH.js → Segment-URdB0lnl.js} +307 -304
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DPZZz2e0.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DmI2LAsz.js} +15 -15
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D8wBgLlS.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BCEgZzA4.js} +4 -4
  50. package/dist/{Setting-CUAWjCqa.js → Setting-BDIHH2Wk.js} +148 -159
  51. package/dist/{SettingAdvertisements-COIQwUD6.js → SettingAdvertisements-CkJYZnIN.js} +12 -12
  52. package/dist/Settings-9gaegvYJ.js +179 -0
  53. package/dist/{Store-BAXwiyvx.js → Store-CV0kYncl.js} +29 -29
  54. package/dist/{StoreRewards-2mUavtUg.js → StoreRewards-30kSkAZ_.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Dgwyk3NA.js +1265 -0
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CDUhH6wp.js +142 -0
  57. package/dist/{Tier-BmAOzRHL.js → Tier-DiQSC3iv.js} +688 -2576
  58. package/dist/{Title-DMxiUg30.js → Title-DixxpjAg.js} +95 -96
  59. package/dist/{Transaction-CF6hXEpN.js → Transaction-DQK4LUGD.js} +2 -2
  60. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BON_t0dL.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CL-GKkuD.js} +26 -26
  61. package/dist/{Voucher-DrtITxq-.js → Voucher-CSVlk_Hr.js} +19 -19
  62. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-1DZOzJKx.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CiSoy0Ky.js} +12 -12
  63. package/dist/{WhatsappAccount-Bb0Y7ikk.js → WhatsappAccount-CQYbv2Ew.js} +66 -64
  64. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-CPlyzkp4.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DjgRo9iA.js} +1 -1
  65. package/dist/{WhatsappBot-DNvvaPey.js → WhatsappBot-DdO9Bfvh.js} +324 -322
  66. package/dist/{WhatsappBotLogs-C8M-1pvv.js → WhatsappBotLogs-CjjWJGND.js} +11 -11
  67. package/dist/{WhatsappBotSettings-D6egqUyU.js → WhatsappBotSettings-DYGx-kRr.js} +287 -288
  68. package/dist/{WhatsappLayout-DeQTPuF6.js → WhatsappLayout-B6k_79Kl.js} +3 -3
  69. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DTUytfe5.js +261 -0
  70. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CKZscSjU.js → ZodTextField.vue_vue_type_script_setup_true_lang-DdCUr_Zm.js} +2 -2
  71. package/dist/{app-BjdLqYQq.js → app-CqQeNnGq.js} +3382 -4110
  72. package/dist/app.js +3 -4
  73. package/dist/{base.export-B68z5BF6.js → base.export-Dls5LQeu.js} +2 -2
  74. package/dist/{business-D9fgkHxb.js → business-gvLSQklz.js} +1 -1
  75. package/dist/{campaign-Dw_ujovr.js → campaign-BqazvOUj.js} +94 -121
  76. package/dist/{campaign-eMaPX8r6.js → campaign-Cd6GmA4U.js} +25 -31
  77. package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-BqekIiiN.js} +1 -2
  78. package/dist/{campaign.fn-DFjGNvmN.js → campaign.fn-C0oMb1fs.js} +99 -99
  79. package/dist/{collection.fn-CCOWtB-c.js → collection.fn-CERMsFPh.js} +2 -2
  80. package/dist/{currency-CTLKReFC.js → currency-IkiKiNg1.js} +1 -1
  81. package/dist/{effect-CTI1ZH57.js → effect-j_T62HBN.js} +1 -1
  82. package/dist/{email-addresses-B74e3bnB.js → email-addresses-CN1kPlEj.js} +2 -2
  83. package/dist/{feature-flag-DVdEaChJ.js → feature-flag-DDfyOLsv.js} +88 -88
  84. package/dist/google-C3S8u0mT.js +4 -0
  85. package/dist/{helper-as9K-piK.js → helper-DVUe13eh.js} +1 -1
  86. package/dist/{index-BW7FoVEA.js → index-9RBtEPPj.js} +1 -1
  87. package/dist/{index-Czg-2Ni0.js → index-BmIfGArh.js} +3 -3
  88. package/dist/{index-DKI8401o.js → index-BvkqHehI.js} +7 -7
  89. package/dist/{index-B0h0iYWP.js → index-BvoOJdfc.js} +2 -2
  90. package/dist/{index-CWLOcQ6j.js → index-C-IajuP1.js} +9 -9
  91. package/dist/{index-3LjKJhQa.js → index-COuLtOaw.js} +1 -1
  92. package/dist/{index-QHqcSN2q.js → index-CPyK4a5J.js} +4 -4
  93. package/dist/{index-BbVbqe4Y.js → index-CWGbeg5X.js} +6 -19
  94. package/dist/{index-CHU3UePP.js → index-C_SaKemI.js} +1 -1
  95. package/dist/{index-BEKMTiFb.js → index-Cjy0SXCn.js} +197 -197
  96. package/dist/{index-C5V6u2Qd.js → index-DALsfLV7.js} +2613 -2699
  97. package/dist/{index-CQxkDpX0.js → index-DMiaWY0s.js} +581 -682
  98. package/dist/{index-B_wRpO02.js → index-D_1pnadB.js} +15 -29
  99. package/dist/{index-TAoQpeLQ.js → index-DzbVgUEP.js} +1 -1
  100. package/dist/{index-C-iwb2Ln.js → index-I9lmcd2w.js} +2 -2
  101. package/dist/{index-wsCCqwdr.js → index-UJHdDEG1.js} +2 -2
  102. package/dist/{index-DcZiikOH.js → index-ep_Kxxid.js} +2 -2
  103. package/dist/{index-BhTrG89b.js → index-fNYUguDQ.js} +232 -389
  104. package/dist/{index-Ba719MYq.js → index-jS16KX9p.js} +1 -1
  105. package/dist/{index-Ckz6u3ac.js → index-k7FFxt_M.js} +2 -2
  106. package/dist/{index-8mBfDn3M.js → index-lzQ6ehOk.js} +251 -608
  107. package/dist/{index.esm2017-DL6rTGDW.js → index.esm2017-vJKhLfdu.js} +177 -177
  108. package/dist/{loading-x6IScY4K.js → loading-jZV2Dm--.js} +1 -1
  109. package/dist/{lodash-nwnDizYo.js → lodash-C2pLek0l.js} +1 -1
  110. package/dist/{member-import-C-b01Tyd.js → member-import-BKI7soRD.js} +1 -1
  111. package/dist/{membership-DfarOMtO.js → membership-smdlFpPr.js} +2 -2
  112. package/dist/{money-CFn-jR4W.js → money-5XyTnYwW.js} +1 -1
  113. package/dist/{number-CSlyDL2x.js → number-DHU9qJJQ.js} +1 -1
  114. package/dist/objectid-jT5g6pGt.js +145 -0
  115. package/dist/{onboarding-DyaFaaF2.js → onboarding-C_5pyGx-.js} +25 -25
  116. package/dist/{onboardingSetup-DQt91O9f.js → onboardingSetup-Bd1V-Ipy.js} +2 -2
  117. package/dist/{plugins-DEHr0UOe.js → plugins-D1Ru-da5.js} +3 -3
  118. package/dist/{reward-Du_Pv-4p.js → reward-BqPl68Xk.js} +1 -1
  119. package/dist/{rule-DfqmQTVK.js → rule-WBrRXwL-.js} +492 -572
  120. package/dist/rule-builder-DAlSbaWh.js +102 -0
  121. package/dist/style.css +1 -1
  122. package/dist/template-DDquG4Xc.js +236 -0
  123. package/dist/{timezone-_4tabIaK.js → timezone-O4qrCDcK.js} +1 -1
  124. package/dist/{transaction.fn-C46PHwCV.js → transaction.fn-CY_F8Nb8.js} +2 -2
  125. package/dist/{trigger-Dipr6btC.js → trigger-D-vySeIB.js} +8 -8
  126. package/dist/{useMarketingMaterialActions-BAw2ZjeF.js → useMarketingMaterialActions-kA6SLHy_.js} +4 -4
  127. package/dist/{usePagination-D6RZ18zS.js → usePagination-AYE_RJH2.js} +1 -1
  128. package/dist/{user-BCexQj3Q.js → user-DJcMkYXP.js} +1 -1
  129. package/dist/vue-i18n-kXHiDb_1.js +2365 -0
  130. package/dist/{xlsx-BTxt_Jg6.js → xlsx--s3hBdDk.js} +224 -224
  131. package/dist/{zod-T4wMYjWT.js → zod-IpHRbxaJ.js} +1 -1
  132. package/package.json +2 -6
  133. package/dist/AuditLogs-BNnUiVnD.js +0 -2016
  134. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BgPeHurN.js +0 -4442
  135. package/dist/Grab-DDc7e-AC.js +0 -301
  136. package/dist/ReviewFacebookCallback-ChG7TRy5.js +0 -225
  137. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-2L6ZGMW7.js +0 -1923
  138. package/dist/Settings-D2gFPvmW.js +0 -286
  139. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-5g3yIL1a.js +0 -1319
  140. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DHi4rdT1.js +0 -7007
  141. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DI0pcHcE.js +0 -253
  142. package/dist/duplicateCampaign-BcpBfUGL.js +0 -51
  143. package/dist/google-BQK68wbe.js +0 -5
  144. package/dist/objectid-zcT6ESET.js +0 -145
  145. package/dist/template-CcbNF4PF.js +0 -188
  146. package/dist/vue-i18n-DXvyTCZf.js +0 -2365
@@ -1,286 +0,0 @@
1
- import { defineComponent as M, useSlots as G, ref as F, watch as z, computed as b, openBlock as t, createElementBlock as s, createElementVNode as a, normalizeClass as N, unref as e, toDisplayString as d, Fragment as w, createBlock as U, createCommentVNode as C, createVNode as E, renderSlot as W, onMounted as q, withCtx as L, renderList as R, createStaticVNode as J } from "vue";
2
- import { u as K } from "./loading-x6IScY4K.js";
3
- import { u as Q } from "./business-D9fgkHxb.js";
4
- import { components as x, useSnackbar as X } from "@feedmepos/ui-library";
5
- import { u as O } from "./vue-i18n-DXvyTCZf.js";
6
- import { h as A } from "./moment-D7p2TMB-.js";
7
- import { g as Z, f as ee } from "./google-BQK68wbe.js";
8
- import { R as ne } from "./app-BjdLqYQq.js";
9
- import { useRouter as oe } from "vue-router";
10
- import { r as $ } from "./index-CWLOcQ6j.js";
11
- const te = { class: "rounded-lg border border-fm-color-neutral-gray-200 bg-white overflow-hidden" }, ce = ["src"], ae = { class: "flex flex-col flex-1 gap-4 min-w-0" }, se = { class: "fm-typo-en-body-md-600 capitalize" }, re = { class: "truncate" }, le = { class: "truncate" }, ie = {
12
- key: 1,
13
- class: "truncate"
14
- }, ue = {
15
- key: 2,
16
- class: "truncate"
17
- }, de = {
18
- key: 1,
19
- class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400 truncate"
20
- }, me = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400" }, H = /* @__PURE__ */ M({
21
- __name: "ReviewSource",
22
- props: {
23
- icon: {},
24
- name: {},
25
- connected: { type: Boolean },
26
- subtitle: {},
27
- syncing: { type: Boolean },
28
- tokenExpired: { type: Boolean },
29
- lastSyncTime: {}
30
- },
31
- emits: ["connect", "sync"],
32
- setup(r, { emit: h }) {
33
- const f = r, S = h, { t: l } = O(), c = G(), k = F(null);
34
- z(
35
- () => f.syncing,
36
- (i) => {
37
- i && (k.value = /* @__PURE__ */ new Date());
38
- },
39
- { immediate: !0 }
40
- );
41
- const p = b(
42
- () => f.lastSyncTime ? A(f.lastSyncTime) : null
43
- ), T = b(() => {
44
- var i;
45
- return ((i = p.value) == null ? void 0 : i.fromNow()) ?? "";
46
- }), B = b(
47
- () => {
48
- var i;
49
- return ((i = p.value) == null ? void 0 : i.format("D MMM YYYY, HH:mm")) ?? "";
50
- }
51
- ), I = b(
52
- () => A(k.value ?? void 0).format("HH:mm")
53
- ), u = b(() => f.syncing ? "syncing" : p.value ? "synced" : "never");
54
- return (i, m) => (t(), s("div", te, [
55
- a("div", {
56
- class: N(["flex items-center gap-12 p-16", e(c).default ? "border-b border-fm-color-neutral-gray-100" : ""])
57
- }, [
58
- a("img", {
59
- src: r.icon,
60
- class: "w-10 h-10 shrink-0"
61
- }, null, 8, ce),
62
- a("div", ae, [
63
- a("span", se, d(r.name), 1),
64
- r.connected ? (t(), s("div", {
65
- key: 0,
66
- class: N(["flex items-center gap-8 fm-typo-en-body-sm-400 truncate", {
67
- "text-fm-color-typo-secondary": u.value !== "syncing",
68
- "text-fm-color-typo-warning": u.value === "syncing"
69
- }])
70
- }, [
71
- a("span", {
72
- class: N(["w-8 h-8 rounded-full shrink-0", {
73
- "bg-fm-color-system-success-400": u.value === "synced",
74
- "bg-fm-color-primary": u.value === "syncing",
75
- "bg-fm-color-neutral-gray-300": u.value === "never"
76
- }])
77
- }, null, 2),
78
- u.value === "synced" ? (t(), s(w, { key: 0 }, [
79
- a("span", re, d(e(l)("connect.review.lastSynced", { relative: T.value })), 1),
80
- m[3] || (m[3] = a("span", { class: "text-fm-color-neutral-gray-300" }, "·", -1)),
81
- a("span", le, d(B.value), 1)
82
- ], 64)) : u.value === "syncing" ? (t(), s("span", ie, d(e(l)("connect.review.syncingNow", { time: I.value })), 1)) : (t(), s("span", ue, d(e(l)("connect.review.neverSynced")), 1))
83
- ], 2)) : (t(), s("span", de, d(r.subtitle || e(l)("connect.review.notConnected")), 1))
84
- ]),
85
- r.connected ? (t(), s(w, { key: 0 }, [
86
- r.tokenExpired ? (t(), U(e(x).FmChip, {
87
- key: 0,
88
- label: e(l)("connect.review.expired"),
89
- variant: "critical"
90
- }, null, 8, ["label"])) : C("", !0),
91
- E(e(x).FmButton, {
92
- variant: "secondary",
93
- "prepend-icon": "refresh",
94
- label: e(l)("connect.review.reconnect"),
95
- onClick: m[0] || (m[0] = (_) => S("connect"))
96
- }, null, 8, ["label"]),
97
- r.tokenExpired ? C("", !0) : (t(), U(e(x).FmButton, {
98
- key: 1,
99
- variant: "primary",
100
- "prepend-icon": "sync",
101
- label: e(l)("connect.review.sync"),
102
- loading: r.syncing,
103
- onClick: m[1] || (m[1] = (_) => S("sync"))
104
- }, null, 8, ["label", "loading"]))
105
- ], 64)) : C("", !0)
106
- ], 2),
107
- r.connected ? C("", !0) : (t(), s("div", {
108
- key: 0,
109
- class: N(["flex items-center justify-between gap-12 p-16", e(c).default ? "border-b border-fm-color-neutral-gray-100" : ""])
110
- }, [
111
- a("span", me, d(e(l)("connect.review.connectHint", { name: r.name })), 1),
112
- E(e(x).FmButton, {
113
- "prepend-icon": "add",
114
- label: e(l)("connect.review.connect"),
115
- onClick: m[2] || (m[2] = (_) => S("connect"))
116
- }, null, 8, ["label"])
117
- ], 2)),
118
- W(i.$slots, "default")
119
- ]));
120
- }
121
- }), ye = { class: "p-24 flex flex-col gap-8" }, fe = { class: "flex flex-col flex-1 min-w-0" }, ge = { class: "fm-typo-en-body-lg-600 truncate" }, pe = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400 truncate" }, ve = ["src"], be = { class: "flex flex-col flex-1 min-w-0" }, ke = { class: "fm-typo-en-body-lg-600 truncate" }, we = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400 truncate" }, Te = /* @__PURE__ */ M({
122
- __name: "Settings",
123
- setup(r) {
124
- const { t: h } = O(), f = X(), S = oe(), l = Q(), c = F(null), k = F(!1), p = F(!1), T = b(
125
- () => {
126
- var n;
127
- return c.value ? ((n = c.value.google) == null ? void 0 : n.accessToken) === null : !1;
128
- }
129
- ), B = b(
130
- () => {
131
- var n;
132
- return c.value ? ((n = c.value.facebook) == null ? void 0 : n.token) === null : !1;
133
- }
134
- );
135
- function I(n) {
136
- const o = window.location.pathname.replace(/\/review(?:\/.*)?$/, "");
137
- return `${window.location.origin}${o}${n}`;
138
- }
139
- async function u() {
140
- await K.minor(async () => {
141
- c.value = await $.getSource();
142
- });
143
- }
144
- function i(n) {
145
- var o;
146
- return (o = l.locations.find(
147
- (g) => g._id.toString() === n
148
- )) == null ? void 0 : o.name;
149
- }
150
- function m(n) {
151
- return n.map((o) => i(o)).filter((o) => o !== void 0).join(", ");
152
- }
153
- function _() {
154
- f.open({
155
- message: h("connect.review.syncSuccess"),
156
- type: "success"
157
- }), S.push({ name: ne["$connect-REVIEW_OVERVIEW"] });
158
- }
159
- async function P() {
160
- var n, o;
161
- k.value = !0;
162
- try {
163
- await $.syncGoogleReviews(), _();
164
- } catch (g) {
165
- if (await u(), ((o = (n = c.value) == null ? void 0 : n.google) == null ? void 0 : o.accessToken) === null) {
166
- f.open({
167
- message: h("connect.review.tokenExpired"),
168
- type: "error"
169
- });
170
- return;
171
- }
172
- throw g;
173
- } finally {
174
- k.value = !1;
175
- }
176
- }
177
- async function Y() {
178
- var n, o;
179
- p.value = !0;
180
- try {
181
- await $.syncFacebookReviews(), _();
182
- } catch (g) {
183
- if (await u(), ((o = (n = c.value) == null ? void 0 : n.facebook) == null ? void 0 : o.token) === null) {
184
- f.open({
185
- message: h("connect.review.tokenExpired"),
186
- type: "error"
187
- });
188
- return;
189
- }
190
- throw g;
191
- } finally {
192
- p.value = !1;
193
- }
194
- }
195
- async function j() {
196
- const n = I("/review/google/callback"), { callbackUrl: o } = await $.getOauthUrl("google", n);
197
- window.location.href = o;
198
- }
199
- async function D() {
200
- const n = I("/review/facebook/callback"), { callbackUrl: o } = await $.getOauthUrl("facebook", n);
201
- window.location.href = o;
202
- }
203
- return q(() => {
204
- u(), l.readLocations();
205
- }), (n, o) => {
206
- var g, V;
207
- return t(), s("div", ye, [
208
- e(c) ? (t(), s(w, { key: 0 }, [
209
- E(H, {
210
- icon: e(Z),
211
- name: "google",
212
- connected: !!e(c).google,
213
- syncing: e(k),
214
- "token-expired": e(T),
215
- "last-sync-time": (g = e(c).google) == null ? void 0 : g.lastSyncTime,
216
- onConnect: j,
217
- onSync: P
218
- }, {
219
- default: L(() => {
220
- var v;
221
- return [
222
- (t(!0), s(w, null, R((v = e(c).google) == null ? void 0 : v.locations, (y) => (t(), s("div", {
223
- key: y.googleLocationName,
224
- class: "flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-100 last:border-b-0"
225
- }, [
226
- E(e(x).FmIcon, {
227
- name: "location_on",
228
- class: "text-fm-color-neutral-gray-300 shrink-0"
229
- }),
230
- a("div", fe, [
231
- a("span", ge, d(y.displayName), 1),
232
- a("span", pe, d(i(y.locationId)), 1)
233
- ])
234
- ]))), 128))
235
- ];
236
- }),
237
- _: 1
238
- }, 8, ["icon", "connected", "syncing", "token-expired", "last-sync-time"]),
239
- E(H, {
240
- icon: e(ee),
241
- name: "facebook",
242
- connected: !!e(c).facebook,
243
- syncing: e(p),
244
- "token-expired": e(B),
245
- "last-sync-time": (V = e(c).facebook) == null ? void 0 : V.lastSyncTime,
246
- onConnect: D,
247
- onSync: Y
248
- }, {
249
- default: L(() => {
250
- var v;
251
- return [
252
- (t(!0), s(w, null, R((v = e(c).facebook) == null ? void 0 : v.pages, (y) => (t(), s("div", {
253
- key: y.facebookPageId,
254
- class: "flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-100 last:border-b-0"
255
- }, [
256
- y.pageProfileImageUrl ? (t(), s("img", {
257
- key: 0,
258
- src: y.pageProfileImageUrl,
259
- class: "w-10 h-10 rounded-full shrink-0 object-cover"
260
- }, null, 8, ve)) : (t(), U(e(x).FmIcon, {
261
- key: 1,
262
- name: "person",
263
- class: "text-fm-color-neutral-gray-300 shrink-0"
264
- })),
265
- a("div", be, [
266
- a("span", ke, d(y.pageName), 1),
267
- a("span", we, d(m(y.locationIds)), 1)
268
- ])
269
- ]))), 128))
270
- ];
271
- }),
272
- _: 1
273
- }, 8, ["icon", "connected", "syncing", "token-expired", "last-sync-time"])
274
- ], 64)) : (t(), s(w, { key: 1 }, R(["google", "facebook"], (v) => a("div", {
275
- key: v,
276
- class: "rounded-lg border border-fm-color-neutral-gray-200 bg-white p-16"
277
- }, [...o[0] || (o[0] = [
278
- J('<div class="animate-pulse flex items-center gap-12"><div class="w-10 h-10 rounded-full bg-fm-color-neutral-gray-100 shrink-0"></div><div class="flex-1 min-w-0 space-y-8"><div class="h-16 w-20 rounded bg-fm-color-neutral-gray-100"></div><div class="h-12 w-full max-w-[160px] rounded bg-fm-color-neutral-gray-100"></div></div><div class="h-32 w-24 rounded bg-fm-color-neutral-gray-100 shrink-0"></div></div>', 1)
279
- ])])), 64))
280
- ]);
281
- };
282
- }
283
- });
284
- export {
285
- Te as default
286
- };