@feedmepos/mf-connect 0.1.124-prod → 0.1.126-dev

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 (149) hide show
  1. package/dist/{App-DMh2xABv.js → App-B_Yp6cvN.js} +224 -216
  2. package/dist/AuditLogs-C1U17evK.js +2016 -0
  3. package/dist/{Bin-C_pkPgIo.js → Bin-CmIpEIwe.js} +8 -8
  4. package/dist/{Broadcast-6ZJzdY0b.js → Broadcast-DkV4BdU_.js} +22 -21
  5. package/dist/{CampaignAnalytic-CLd5ecQe.js → CampaignAnalytic-Dkwo_lpB.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C4OWhhAx.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Ch8Gblw6.js} +9 -10
  7. package/dist/{Card-CkS8F43U.js → Card-DXCkG34M.js} +23 -23
  8. package/dist/{Collections-BA9I-dDz.js → Collections-CybPfSO4.js} +197 -185
  9. package/dist/{Credit-CXm0A-qe.js → Credit-B-KUzWsX.js} +21 -20
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-DzsHTlrN.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CWHYeYVD.js} +1 -1
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C86llTFR.js +4439 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-zSPUBUSz.js → EffectSheet.vue_vue_type_style_index_0_lang-nMcH6y5e.js} +33 -33
  13. package/dist/{Experience-Bq4ykqTJ.js → Experience-Q2NHpa-V.js} +32 -31
  14. package/dist/{FileSaver.min-BtBxrIBi.js → FileSaver.min-CKw2rn-J.js} +1 -1
  15. package/dist/{Game-DpLFmP-G.js → Game-lZvkg04z.js} +19 -18
  16. package/dist/{GiftCardSetup-BqOqEUim.js → GiftCardSetup-CPRju80_.js} +31 -31
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-B06xj5q7.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-Ci686UoB.js} +7 -7
  18. package/dist/{Goals-DMlNeiUc.js → Goals-asGsUeVv.js} +4 -4
  19. package/dist/Grab-BjFLSMpE.js +301 -0
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DPWRgxG_.js → ImageInput.vue_vue_type_script_setup_true_lang-nk87zPWH.js} +1 -1
  21. package/dist/{Index-Cw07jj0k.js → Index-DIasPS4Y.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CLjjquVP.js → LocationPicker.vue_vue_type_script_setup_true_lang-DkOn8p1v.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DHOShJQp.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BdSkxiP-.js} +1 -1
  24. package/dist/{LoyaltyDashboard-DzSiK6M7.js → LoyaltyDashboard-DlCsZ3YX.js} +15 -15
  25. package/dist/{MainLayout-1EF680_j.js → MainLayout-DLObnTAA.js} +1 -1
  26. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-Df9pBgH9.js → MainLayout.vue_vue_type_script_setup_true_lang-DigSZKt1.js} +3 -3
  27. package/dist/{Marketing-T-epFsvG.js → Marketing-JflPW-w9.js} +4 -4
  28. package/dist/{MarketingMaterialEdit-CVhPfyEp.js → MarketingMaterialEdit-fSAB3YVb.js} +214 -211
  29. package/dist/{Member-BUZOPyQR.js → Member-CzNahXTj.js} +7 -7
  30. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-zURjtl1z.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-bqWUIbMG.js} +40 -48
  31. package/dist/{MemberImportHistory-DGz9i6L7.js → MemberImportHistory--r_A_2Es.js} +7 -7
  32. package/dist/{MemberList-CNdSrzBa.js → MemberList-CQZQ4sN8.js} +103 -105
  33. package/dist/{MemberTransactions-CdQMuQsd.js → MemberTransactions-BPg9JaUA.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CWKVXeCa.js → MessageInput.vue_vue_type_script_setup_true_lang-BhIFChx-.js} +12 -12
  35. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-xZitIoXE.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CdGSNqEp.js} +1 -1
  36. package/dist/{Mission-CYxgMBPt.js → Mission-CYCB3YQc.js} +22 -21
  37. package/dist/{Overview-qZ1KKw9D.js → Overview-B5ylMBHT.js} +145 -144
  38. package/dist/{Overview-DSm8AfDB.js → Overview-DuNuUYYq.js} +21 -21
  39. package/dist/{Point-BGlbT9OK.js → Point-DG-Uwj25.js} +22 -21
  40. package/dist/{Promotion-CtlrUFa8.js → Promotion-DqxBQ1yO.js} +137 -131
  41. package/dist/{Queue-Dc_z9MKc.js → Queue-Cy8LGt_Y.js} +46 -46
  42. package/dist/{Record-DVKrhFwJ.js → Record-CzXbu41w.js} +9 -9
  43. package/dist/{Review-Bh8Tw_QU.js → Review-7VL6gIqp.js} +2 -2
  44. package/dist/ReviewFacebookCallback-BwzuPmrz.js +225 -0
  45. package/dist/{ReviewGoogleCallback-CsSCz_C5.js → ReviewGoogleCallback-1JXR_f5O.js} +5 -5
  46. package/dist/{Reward-DY1Q3m1w.js → Reward-BKhUDEu3.js} +16 -16
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-4A91EkSW.js → RewardGroup.vue_vue_type_script_setup_true_lang-DjjCytWF.js} +14 -14
  48. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Vg7pRGIz.js +1923 -0
  49. package/dist/{Segment-D6LchJFl.js → Segment-DdHDJhaS.js} +304 -307
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CSAtkMnJ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-9kGUkHMi.js} +15 -15
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Co1MQoVq.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DeFw0px7.js} +4 -4
  52. package/dist/{Setting-UkdSKiUb.js → Setting-DZKGXw-i.js} +17 -17
  53. package/dist/{SettingAdvertisements-DK97gcus.js → SettingAdvertisements-BBNs8tCw.js} +12 -12
  54. package/dist/Settings-9v0hnBJZ.js +286 -0
  55. package/dist/{Store-2VVStL5_.js → Store-C8IlE4IH.js} +29 -29
  56. package/dist/{StoreRewards-f3Pyb9hu.js → StoreRewards-DWygRLR1.js} +15 -15
  57. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BmnyPSVT.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CeYYws6P.js} +25 -25
  58. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BiN3uRJ_.js +7007 -0
  59. package/dist/{Tier-D4Of9P17.js → Tier-7RoxGHsP.js} +2583 -688
  60. package/dist/{Title-Cg6X9UkB.js → Title-0q2Z4HIe.js} +96 -95
  61. package/dist/{Transaction-LJbjQnj_.js → Transaction-CFasERdg.js} +2 -2
  62. package/dist/{Upselling-B-VwbtjT.js → Upselling-DM9R6pYw.js} +3 -3
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DqH6Upx-.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BDjwcgnc.js} +26 -26
  64. package/dist/{Voucher-BJG6VKXt.js → Voucher-BkzW2hVV.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-7kYeJthi.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DaE4xa3x.js} +12 -12
  66. package/dist/{WhatsappAccount-Dc1fJWWj.js → WhatsappAccount-C3WpDF9O.js} +6 -6
  67. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BV0Bsl7a.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BxC_3h52.js} +1 -1
  68. package/dist/{WhatsappBot-Coq1WP96.js → WhatsappBot-DZb-Dn3s.js} +6 -6
  69. package/dist/WhatsappBotLogs--KskC32Z.js +509 -0
  70. package/dist/WhatsappBotSettings-Dns_PqVE.js +945 -0
  71. package/dist/{WhatsappLayout-x9Ovpu6e.js → WhatsappLayout-NIrFGbId.js} +3 -3
  72. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DZlT0uLW.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-BfD5hHc7.js} +3 -3
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DSJncfI_.js → ZodTextField.vue_vue_type_script_setup_true_lang-CJGxy7gf.js} +2 -2
  74. package/dist/{app-BMFxxLUm.js → app-B9nLnoBt.js} +4497 -3667
  75. package/dist/app.js +4 -3
  76. package/dist/{base.export-LmQ51u5f.js → base.export-CBzNea0v.js} +2 -2
  77. package/dist/{business-DZWViiMC.js → business-aT2zslwu.js} +1 -1
  78. package/dist/{campaign-DZDGbR4W.js → campaign-B6nTwt17.js} +121 -94
  79. package/dist/{campaign-C9xvGyrL.js → campaign-BDCLKFwN.js} +31 -25
  80. package/dist/{campaign.enum-BqekIiiN.js → campaign.enum-Dx-Zo68Q.js} +2 -1
  81. package/dist/campaign.fn-Ck1t5C1T.js +776 -0
  82. package/dist/{collection.fn-DrNrla0B.js → collection.fn-CDna_VLD.js} +2 -2
  83. package/dist/{currency-BZv2gSlF.js → currency-Baum67Wz.js} +1 -1
  84. package/dist/duplicateCampaign-BwrMZgaV.js +51 -0
  85. package/dist/{effect-CvumfBMY.js → effect-CeJbflOK.js} +1 -1
  86. package/dist/{email-addresses-79tPeI4j.js → email-addresses-Y3vF73J0.js} +2 -2
  87. package/dist/{feature-flag-CYXnrECh.js → feature-flag-zn6Ql9tv.js} +84 -84
  88. package/dist/google-BQK68wbe.js +5 -0
  89. package/dist/{helper-DFjsyjri.js → helper-DZvnn-yx.js} +1 -1
  90. package/dist/{index-CcCiEG6N.js → index-B20FfbEE.js} +1 -1
  91. package/dist/{index-DWZzsJHU.js → index-B22ojkMy.js} +2 -2
  92. package/dist/{index-I9lmcd2w.js → index-B3LCTMwV.js} +68 -54
  93. package/dist/{index-C43KoLej.js → index-B5H4znfe.js} +4 -4
  94. package/dist/{index-C5bC2n8X.js → index-BL2zQnXK.js} +3 -3
  95. package/dist/{index-MhAbTpBy.js → index-BYUEPfbP.js} +23 -23
  96. package/dist/{index-CA7oIW_T.js → index-BqniSMV6.js} +197 -197
  97. package/dist/{index-CAWnce4u.js → index-CDRTiAEu.js} +1 -1
  98. package/dist/{index-_-nCOZ1D.js → index-CMs3aIA6.js} +19 -6
  99. package/dist/{index-BiPRZRyE.js → index-CPi3Qwmj.js} +2699 -2613
  100. package/dist/{index-Ba1t5vQv.js → index-DCR1GFCA.js} +380 -234
  101. package/dist/{index-C6ZTa-eq.js → index-DHNhIloU.js} +1 -1
  102. package/dist/{index-CBd91xYU.js → index-DJIt5tXC.js} +7 -7
  103. package/dist/index-DXKJsqgW.js +104 -0
  104. package/dist/{index-CNzQ3FLi.js → index-DXyOBtgF.js} +1 -1
  105. package/dist/{index-Bnane9cm.js → index-Da0-7h2j.js} +1 -1
  106. package/dist/{index-C6Rx7pjc.js → index-DkBOM8za.js} +608 -251
  107. package/dist/{index-CW4rNV1_.js → index-FgM7b2Sw.js} +2 -2
  108. package/dist/{index-DZrX13oF.js → index-juXxYQ_a.js} +1314 -1242
  109. package/dist/{index-Bt-n8QuD.js → index-njg4JLa-.js} +9 -9
  110. package/dist/{index-B_8PAyia.js → index-r_T5o_hF.js} +2 -2
  111. package/dist/{index.esm2017-DtTjnHHc.js → index.esm2017-Dtk7BscN.js} +57 -57
  112. package/dist/{loading-DkqEFbrR.js → loading-PoODMkQD.js} +1 -1
  113. package/dist/{lodash-BxU_5gPB.js → lodash-TthNgH98.js} +1 -1
  114. package/dist/{member-import-B3NBqSF6.js → member-import-D7zs0Jvh.js} +22 -13
  115. package/dist/{membership-Dr5BxoL-.js → membership-Cab-iWQ1.js} +2 -2
  116. package/dist/{money-D58xuACG.js → money-9Q306M3g.js} +1 -1
  117. package/dist/{number-C9CiD5ci.js → number-D9M3D435.js} +1 -1
  118. package/dist/objectid-DKvQl6FD.js +145 -0
  119. package/dist/{onboarding-BssUSfGQ.js → onboarding-D5LKUHVI.js} +25 -25
  120. package/dist/{onboardingSetup-Dc_lD-K8.js → onboardingSetup-D0jsS6w5.js} +2 -2
  121. package/dist/{plugins-D7Xjefvk.js → plugins-CDTKQ1Pg.js} +3 -3
  122. package/dist/{reward-CACqYkQp.js → reward-De3e9vYS.js} +1 -1
  123. package/dist/{rule-BRaTrwKz.js → rule-trVJgEOe.js} +572 -492
  124. package/dist/style.css +1 -1
  125. package/dist/template-Bj3Tb6bP.js +227 -0
  126. package/dist/{timezone-CgVEOC5i.js → timezone-DkuByUmb.js} +1 -1
  127. package/dist/{transaction.fn-C64l_ja_.js → transaction.fn-CPE-oQhA.js} +2 -2
  128. package/dist/{trigger-d2RIqXLt.js → trigger-C6oM-8pe.js} +9 -9
  129. package/dist/{useMarketingMaterialActions-Drf2MY9h.js → useMarketingMaterialActions-C5scdJQp.js} +4 -4
  130. package/dist/{usePagination-IUw34YLE.js → usePagination-CIuTHSSG.js} +1 -1
  131. package/dist/{user-ClGyYHyS.js → user-Bdlgn2yo.js} +1 -1
  132. package/dist/vue-i18n-DEpDI-dt.js +2365 -0
  133. package/dist/{xlsx-HvtVSofi.js → xlsx-CvecxUOG.js} +1 -1
  134. package/dist/{zod-IPdjFU_b.js → zod-bniyeWdY.js} +1 -1
  135. package/package.json +6 -2
  136. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C5INV6R7.js +0 -3493
  137. package/dist/ReviewFacebookCallback-ZZ0pxplM.js +0 -238
  138. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-JA0XIgqb.js +0 -1884
  139. package/dist/Settings-BFcVswDS.js +0 -179
  140. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CCWNzg4p.js +0 -142
  141. package/dist/WhatsappBotLogs-EH9PQVn9.js +0 -372
  142. package/dist/WhatsappBotSettings-fNRFecJX.js +0 -704
  143. package/dist/campaign.fn-OVkj0QLu.js +0 -776
  144. package/dist/google-C3S8u0mT.js +0 -4
  145. package/dist/index-C-pVo6PI.js +0 -74
  146. package/dist/objectid-CgTtbB6Q.js +0 -145
  147. package/dist/rule-builder-DZOASGFD.js +0 -102
  148. package/dist/template-DdeVPIBt.js +0 -275
  149. package/dist/vue-i18n-Cby9s0nj.js +0 -2365
@@ -1,372 +0,0 @@
1
- import { defineComponent as T, resolveComponent as k, openBlock as l, createElementBlock as d, createElementVNode as s, toDisplayString as i, unref as u, createVNode as _, computed as w, Fragment as M, renderList as V, createCommentVNode as $, normalizeClass as ee, createTextVNode as P, createBlock as I, ref as b, watch as G, onBeforeUnmount as te, withCtx as O } from "vue";
2
- import { u as E } from "./vue-i18n-Cby9s0nj.js";
3
- import { useCoreStore as oe } from "@feedmepos/mf-common";
4
- import { S as ne } from "./index-CBd91xYU.js";
5
- import { w as ae } from "./index-C-pVo6PI.js";
6
- import { _ as se } from "./remy-icon-BhUGu2NI.js";
7
- import { _ as le } from "./WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DZlT0uLW.js";
8
- import { C as U } from "./timezone-CgVEOC5i.js";
9
- import { m as re } from "./index-CNzQ3FLi.js";
10
- const ce = { class: "group self-end min-w-[min(280px,100%)] max-w-[80%] rounded-[12px] rounded-br-[4px] bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary" }, ie = { class: "flex items-center gap-[4px] min-h-[28px] px-[10px] py-[4px] text-[11px] font-medium cursor-pointer list-none rounded-[12px] focus-visible:outline-fm-color-primary" }, pe = { class: "flex-1 group-open:hidden" }, ue = { class: "flex-1 hidden group-open:inline" }, me = { class: "px-[10px] pt-[2px] pb-[8px] text-[13px] leading-[18px] whitespace-pre-wrap break-words" }, de = /* @__PURE__ */ T({
11
- __name: "ThoughtBubble",
12
- props: {
13
- text: {}
14
- },
15
- setup(m) {
16
- const { t: v } = E();
17
- return (n, g) => {
18
- const c = k("FmIcon");
19
- return l(), d("details", ce, [
20
- s("summary", ie, [
21
- g[0] || (g[0] = s("img", {
22
- src: se,
23
- alt: "",
24
- "aria-hidden": "true",
25
- class: "w-[16px] h-[16px] shrink-0"
26
- }, null, -1)),
27
- s("span", pe, i(u(v)("connect.whatsappBot.logs.thought")), 1),
28
- s("span", ue, i(u(v)("connect.whatsappBot.logs.hideThought")), 1),
29
- _(c, {
30
- name: "keyboard_arrow_down",
31
- size: "sm",
32
- class: "transition-transform group-open:rotate-180"
33
- })
34
- ]),
35
- s("p", me, i(m.text), 1)
36
- ]);
37
- };
38
- }
39
- }), xe = { class: "border border-fm-color-neutral-gray-100 rounded-[16px] bg-fm-color-neutral-white overflow-hidden" }, fe = { class: "flex items-center gap-[10px] px-[16px] py-[10px] border-b border-fm-color-neutral-gray-100 flex-wrap" }, he = {
40
- "aria-hidden": "true",
41
- class: "w-[28px] h-[28px] rounded-full bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary text-[12px] font-semibold flex items-center justify-center shrink-0"
42
- }, ve = { class: "min-w-0 flex-1" }, ge = { class: "text-[14px] font-semibold leading-[20px] break-words" }, ye = { class: "text-[12px] leading-[16px] text-fm-color-typo-tertiary break-words" }, _e = ["datetime"], we = { class: "flex flex-col gap-[10px] px-[16px] py-[12px]" }, be = {
43
- key: 0,
44
- class: "self-end text-[12px] leading-[16px] text-fm-color-typo-tertiary"
45
- }, ke = {
46
- key: 0,
47
- class: "text-[11px] text-fm-color-typo-tertiary"
48
- }, Be = ["datetime"], Ce = ["title", "onClick"], Fe = { class: "w-[24px] h-[24px] rounded-full bg-fm-color-secondary-plum/10 text-fm-color-secondary-plum flex items-center justify-center shrink-0" }, Ae = { class: "flex flex-col min-w-0" }, Ne = { class: "text-[13px] leading-[18px] font-semibold" }, $e = { class: "text-[12px] leading-[16px] text-fm-color-typo-tertiary whitespace-pre-wrap break-words" }, Ie = /* @__PURE__ */ T({
49
- __name: "WhatsappLogConversation",
50
- props: {
51
- conversation: {},
52
- accountName: {},
53
- timezone: {}
54
- },
55
- emits: ["notificationGroup"],
56
- setup(m, { emit: v }) {
57
- const n = m, g = v, { t: c, locale: t } = E(), o = w(
58
- () => n.conversation.customerName || n.conversation.phoneNumber || c("connect.whatsappBot.logs.unknownCustomer")
59
- ), p = w(
60
- () => n.conversation.customerName ? n.conversation.customerName.trim().split(/\s+/).slice(0, 2).map((f) => Array.from(f)[0]).join("").toLocaleUpperCase(t.value) : "?"
61
- ), A = w(
62
- () => new Intl.DateTimeFormat(t.value, {
63
- dateStyle: "medium",
64
- timeStyle: "short",
65
- timeZone: n.timezone
66
- })
67
- ), y = w(
68
- () => new Intl.DateTimeFormat(t.value, {
69
- hour: "2-digit",
70
- minute: "2-digit",
71
- hour12: !1,
72
- timeZone: n.timezone
73
- })
74
- );
75
- function h(f) {
76
- var B;
77
- return (B = f.reaction) != null && B.removed ? c("connect.whatsappBot.logs.reactionRemoved") : f.text ? f.text : c("connect.whatsappBot.logs.mediaMessage", { type: f.messageType });
78
- }
79
- return (f, B) => {
80
- const N = k("FmIcon");
81
- return l(), d("article", xe, [
82
- s("header", fe, [
83
- s("div", he, i(p.value), 1),
84
- s("div", ve, [
85
- s("h2", ge, i(o.value), 1),
86
- s("p", ye, i(m.conversation.phoneNumber || u(c)("connect.whatsappBot.phoneUnavailable")) + " · " + i(u(c)("connect.whatsappBot.logs.via", { name: m.accountName })), 1)
87
- ]),
88
- s("time", {
89
- datetime: m.conversation.lastCreatedAt,
90
- class: "text-[12px] text-fm-color-typo-tertiary tabular-nums"
91
- }, i(A.value.format(new Date(m.conversation.lastCreatedAt))), 9, _e)
92
- ]),
93
- s("ol", we, [
94
- (l(!0), d(M, null, V(m.conversation.logs, (r) => (l(), d("li", {
95
- key: r.id,
96
- class: "flex flex-col gap-[4px] min-w-0"
97
- }, [
98
- r.type === "message" ? (l(), d(M, { key: 0 }, [
99
- r.isFromMe && !r.isFromBot ? (l(), d("span", be, i(u(c)("connect.whatsappBot.logs.sentByStaff")), 1)) : $("", !0),
100
- s("div", {
101
- class: ee([
102
- "px-[10px] py-[6px] text-[14px] leading-[20px] whitespace-pre-wrap break-words min-w-0",
103
- r.isFromMe ? "self-end max-w-[80%] bg-fm-color-primary-oats rounded-[12px] rounded-br-[4px]" : "self-start max-w-[75%] bg-[#F7F7F7] rounded-[12px] rounded-bl-[4px]"
104
- ])
105
- }, [
106
- P(i(h(r)) + " ", 1),
107
- r.isEdit ? (l(), d("span", ke, " (" + i(u(c)("connect.whatsappBot.logs.edited")) + ") ", 1)) : $("", !0),
108
- s("time", {
109
- datetime: r.timestamp,
110
- class: "float-right mt-[6px] ml-[10px] text-[11px] leading-[14px] text-fm-color-typo-tertiary tabular-nums"
111
- }, i(y.value.format(new Date(r.timestamp))), 9, Be)
112
- ], 2)
113
- ], 64)) : r.type === "thought" ? (l(), I(de, {
114
- key: 1,
115
- text: r.text
116
- }, null, 8, ["text"])) : r.type === "escalate" ? (l(), d("button", {
117
- key: 2,
118
- type: "button",
119
- title: u(c)("connect.whatsappBot.logs.openNotificationGroup"),
120
- class: "self-end flex items-start gap-[8px] max-w-[80%] py-[8px] pr-[12px] pl-[8px] border border-fm-color-neutral-gray-200 rounded-[8px] text-left hover:bg-fm-color-neutral-gray-100/50 focus-visible:outline-fm-color-primary",
121
- onClick: (C) => g("notificationGroup", r.clientId)
122
- }, [
123
- s("span", Fe, [
124
- _(N, {
125
- name: "group",
126
- size: "sm"
127
- })
128
- ]),
129
- s("span", Ae, [
130
- s("span", Ne, i(u(c)("connect.whatsappBot.logs.escalated")), 1),
131
- s("span", $e, i(u(c)("connect.whatsappBot.logs.reason", {
132
- reason: r.reason
133
- })), 1)
134
- ])
135
- ], 8, Ce)) : $("", !0)
136
- ]))), 128))
137
- ])
138
- ]);
139
- };
140
- }
141
- });
142
- function Me(m, v) {
143
- const n = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), c = [...m].sort(
144
- (t, o) => Date.parse(t.createdAt) - Date.parse(o.createdAt) || W(t) - W(o) || t.id.localeCompare(o.id)
145
- );
146
- for (const t of c) {
147
- const o = JSON.stringify([
148
- t.accountLid || t.clientId,
149
- t.chatJid
150
- ]), p = g.get(o) ?? { name: "", phone: "" };
151
- t.customerName && (p.name = t.customerName), t.phoneNumber && (p.phone = t.phoneNumber), g.set(o, p);
152
- const A = re.tz(t.createdAt, v).format("YYYY-MM-DD"), y = `${o}:${A}`, h = n.get(y);
153
- h ? (h.logs.push(t), h.lastCreatedAt = t.createdAt, h.clientId = t.clientId) : n.set(y, {
154
- id: y,
155
- clientId: t.clientId,
156
- chatJid: t.chatJid,
157
- customerName: "",
158
- phoneNumber: "",
159
- createdAt: t.createdAt,
160
- lastCreatedAt: t.createdAt,
161
- logs: [t]
162
- });
163
- }
164
- for (const t of n.values()) {
165
- const o = t.logs[0], p = g.get(
166
- JSON.stringify([o.accountLid || o.clientId, o.chatJid])
167
- );
168
- t.customerName = (p == null ? void 0 : p.name) ?? "", t.phoneNumber = (p == null ? void 0 : p.phone) ?? "";
169
- }
170
- return [...n.values()].sort(
171
- (t, o) => Date.parse(o.lastCreatedAt) - Date.parse(t.lastCreatedAt)
172
- );
173
- }
174
- function W(m) {
175
- return m.type === "thought" ? 1 : m.type === "escalate" ? 2 : m.isFromMe ? 3 : 0;
176
- }
177
- const Se = { class: "mt-[20px] flex flex-col gap-[16px]" }, De = { class: "flex items-center gap-[8px] flex-wrap" }, Le = { class: "max-h-[240px] overflow-y-auto" }, ze = {
178
- key: 0,
179
- role: "alert",
180
- class: "text-[14px] text-fm-color-typo-error"
181
- }, Ve = {
182
- key: 1,
183
- class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
184
- }, Te = {
185
- key: 2,
186
- class: "flex items-center gap-[12px] flex-wrap"
187
- }, Ee = {
188
- role: "alert",
189
- class: "text-[14px] text-fm-color-typo-error"
190
- }, Je = {
191
- key: 3,
192
- class: "border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[8px]"
193
- }, Ye = { class: "text-[20px] font-semibold" }, je = { class: "max-w-[420px] text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Ge = {
194
- key: 4,
195
- class: "mx-auto w-full min-w-0 flex flex-col gap-[12px]"
196
- }, qe = /* @__PURE__ */ T({
197
- __name: "WhatsappBotLogs",
198
- props: {
199
- accounts: {}
200
- },
201
- setup(m) {
202
- const v = m, { t: n } = E(), g = oe(), c = w(() => ne.getBusinessId() ?? ""), t = w(
203
- () => U[g.currentCountry.value || "MY"] ?? U.MY
204
- ), o = b([]), p = b(""), A = b([]), y = b([]), h = b(!0), f = b(""), B = b(), N = b(!1), r = b("");
205
- let C;
206
- function S(a) {
207
- var F;
208
- const e = (F = v.accounts.find(
209
- (L) => L.clientId === a
210
- )) == null ? void 0 : F.account;
211
- return (e == null ? void 0 : e.businessName) || (e == null ? void 0 : e.name) || (e == null ? void 0 : e.phoneNumber) || n("connect.whatsappBot.logs.unknownAccount", { id: a.slice(-6) });
212
- }
213
- const Z = w(
214
- () => [
215
- .../* @__PURE__ */ new Set([
216
- ...v.accounts.map((a) => a.clientId),
217
- ...y.value,
218
- ...o.value
219
- ])
220
- ].map((a) => ({ clientId: a, label: S(a) }))
221
- ), J = w(() => {
222
- const a = p.value.trim().toLocaleLowerCase();
223
- return Z.value.filter(
224
- (e) => e.label.toLocaleLowerCase().includes(a)
225
- );
226
- }), R = w(() => {
227
- const a = o.value;
228
- let e = n("connect.whatsappBot.logs.allAccounts");
229
- return a.length === 1 ? e = S(a[0]) : a.length > 1 && (e = n("connect.whatsappBot.logs.selectedAccounts", {
230
- count: a.length
231
- })), n("connect.whatsappBot.logs.accountFilter", { name: e });
232
- }), Y = w(
233
- () => Me(A.value, t.value)
234
- );
235
- function H(a) {
236
- o.value = o.value.includes(a) ? o.value.filter((e) => e !== a) : [...o.value, a];
237
- }
238
- function K(a) {
239
- r.value = "";
240
- const e = v.accounts.find(
241
- (F) => F.clientId === a
242
- );
243
- if (!e) {
244
- r.value = n("connect.whatsappBot.errors.accountNotFound");
245
- return;
246
- }
247
- B.value = e, N.value = !0;
248
- }
249
- async function D() {
250
- C == null || C.abort();
251
- const a = new AbortController();
252
- C = a, h.value = !0, f.value = "", A.value = [];
253
- try {
254
- if (!c.value)
255
- throw new Error(n("connect.whatsappBot.errors.selectBusiness"));
256
- const e = await ae.listLogs(
257
- c.value,
258
- o.value.length ? { clientIds: o.value.join(",") } : {},
259
- a.signal
260
- );
261
- if (a.signal.aborted) return;
262
- A.value = e.logs, y.value = [
263
- .../* @__PURE__ */ new Set([
264
- ...y.value,
265
- ...e.logs.map((F) => F.clientId)
266
- ])
267
- ];
268
- } catch (e) {
269
- a.signal.aborted || (f.value = e instanceof Error ? e.message : n("connect.whatsappBot.logs.loadError"));
270
- } finally {
271
- a.signal.aborted || (h.value = !1);
272
- }
273
- }
274
- return G(c, () => {
275
- o.value = [], p.value = "", y.value = [], N.value = !1, B.value = void 0, r.value = "";
276
- }), G(
277
- [c, () => o.value.join(",")],
278
- () => void D(),
279
- { immediate: !0 }
280
- ), te(() => C == null ? void 0 : C.abort()), (a, e) => {
281
- const F = k("FmChip"), L = k("FmSearch"), Q = k("FmMenuDivider"), z = k("FmMenuItem"), X = k("FmMenu"), j = k("FmButton"), q = k("FmCircularProgress");
282
- return l(), d(M, null, [
283
- s("section", Se, [
284
- s("div", De, [
285
- _(X, {
286
- "close-on-click": !1,
287
- width: 280
288
- }, {
289
- "menu-button": O(() => [
290
- _(F, {
291
- label: R.value,
292
- "right-icon": "keyboard_arrow_down",
293
- class: "text-fm-color-typo-secondary cursor-pointer"
294
- }, null, 8, ["label"])
295
- ]),
296
- default: O(() => [
297
- _(L, {
298
- modelValue: p.value,
299
- "onUpdate:modelValue": e[0] || (e[0] = (x) => p.value = x),
300
- placeholder: u(n)("connect.whatsappBot.logs.searchAccounts")
301
- }, null, 8, ["modelValue", "placeholder"]),
302
- _(Q),
303
- _(z, {
304
- label: u(n)("connect.whatsappBot.logs.allAccounts"),
305
- "model-value": !o.value.length,
306
- "has-checkbox": "",
307
- onClick: e[1] || (e[1] = (x) => o.value = [])
308
- }, null, 8, ["label", "model-value"]),
309
- s("div", Le, [
310
- (l(!0), d(M, null, V(J.value, (x) => (l(), I(z, {
311
- key: x.clientId,
312
- label: x.label,
313
- "model-value": o.value.includes(x.clientId),
314
- "has-checkbox": "",
315
- onClick: (Oe) => H(x.clientId)
316
- }, null, 8, ["label", "model-value", "onClick"]))), 128)),
317
- J.value.length ? $("", !0) : (l(), I(z, {
318
- key: 0,
319
- label: u(n)("connect.whatsappBot.logs.noMatchingAccounts"),
320
- disabled: ""
321
- }, null, 8, ["label"]))
322
- ])
323
- ]),
324
- _: 1
325
- }),
326
- _(j, {
327
- variant: "plain",
328
- "prepend-icon": "refresh",
329
- label: u(n)("connect.whatsappBot.logs.refresh"),
330
- disabled: h.value,
331
- class: "ml-auto",
332
- onClick: e[2] || (e[2] = (x) => D())
333
- }, null, 8, ["label", "disabled"])
334
- ]),
335
- r.value ? (l(), d("p", ze, i(r.value), 1)) : $("", !0),
336
- h.value ? (l(), d("output", Ve, [
337
- _(q),
338
- P(" " + i(u(n)("connect.whatsappBot.logs.loading")), 1)
339
- ])) : f.value ? (l(), d("div", Te, [
340
- s("p", Ee, i(f.value), 1),
341
- _(j, {
342
- variant: "secondary",
343
- "prepend-icon": "refresh",
344
- label: u(n)("connect.whatsappBot.tryAgain"),
345
- onClick: e[3] || (e[3] = (x) => D())
346
- }, null, 8, ["label"])
347
- ])) : Y.value.length ? (l(), d("div", Ge, [
348
- (l(!0), d(M, null, V(Y.value, (x) => (l(), I(Ie, {
349
- key: x.id,
350
- conversation: x,
351
- "account-name": S(x.clientId),
352
- timezone: t.value,
353
- onNotificationGroup: K
354
- }, null, 8, ["conversation", "account-name", "timezone"]))), 128))
355
- ])) : (l(), d("div", Je, [
356
- s("h2", Ye, i(u(n)("connect.whatsappBot.logs.emptyTitle")), 1),
357
- s("p", je, i(u(n)("connect.whatsappBot.logs.emptyDescription")), 1)
358
- ]))
359
- ]),
360
- B.value ? (l(), I(le, {
361
- key: 0,
362
- modelValue: N.value,
363
- "onUpdate:modelValue": e[4] || (e[4] = (x) => N.value = x),
364
- account: B.value
365
- }, null, 8, ["modelValue", "account"])) : $("", !0)
366
- ], 64);
367
- };
368
- }
369
- });
370
- export {
371
- qe as default
372
- };