@feedmepos/mf-connect 0.1.113-prod → 0.1.114-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 (156) hide show
  1. package/README.md +66 -1
  2. package/dist/{App-2J4yDonr.js → App-CIWTDYuZ.js} +700 -654
  3. package/dist/AuditLogs-BluLDXu9.js +2016 -0
  4. package/dist/{Bin-BU_hVuxJ.js → Bin-jS6pM4L3.js} +8 -8
  5. package/dist/Broadcast-DBqsSZ0S.js +306 -0
  6. package/dist/{CampaignAnalytic-DUUmFMvy.js → CampaignAnalytic-DJrjXD4H.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BZirReIy.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CzwigRLi.js} +9 -9
  8. package/dist/{Card-DS2K_LFv.js → Card-B10nLilL.js} +25 -24
  9. package/dist/{Collections-BFdRdPHR.js → Collections-BN42A73p.js} +197 -185
  10. package/dist/{Credit-CODfiox3.js → Credit-0SS26HGE.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B2T5G1hZ.js → DateRangeChip.vue_vue_type_script_setup_true_lang-B3wozBFs.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BRd5RVYe.js +4442 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-KvZebiOu.js → EffectSheet.vue_vue_type_style_index_0_lang-zV9dLCWp.js} +32 -32
  14. package/dist/{Experience-BGBWc8Ep.js → Experience-D7qPzsrc.js} +32 -31
  15. package/dist/{FileSaver.min-DJAN3Eu0.js → FileSaver.min-BKWoklMK.js} +1 -1
  16. package/dist/{Game-6yyn0uAd.js → Game-BoYMwfog.js} +19 -18
  17. package/dist/{GiftCardSetup-B096bTm0.js → GiftCardSetup-B87O0xzo.js} +75 -75
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-ChvUXdF-.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-B3uGbEFY.js} +7 -7
  19. package/dist/{Goals-Db2mwbRo.js → Goals-CVxf3xCA.js} +4 -4
  20. package/dist/Grab-mGL1Mue_.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-xdEzwMcS.js → ImageInput.vue_vue_type_script_setup_true_lang-HipBZ1_T.js} +1 -1
  22. package/dist/{Index-580WNkG2.js → Index-Dptuy-6c.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BkAQXKNJ.js → LocationPicker.vue_vue_type_script_setup_true_lang-Cjc4UeKz.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CR6sSnx4.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Bh0ari3f.js} +1 -1
  25. package/dist/{LoyaltyDashboard-Clr2aiUP.js → LoyaltyDashboard-BxhI6RAE.js} +15 -15
  26. package/dist/MainLayout-YfDxvZXl.js +4 -0
  27. package/dist/{MainLayout-_iCyT5mw.js → MainLayout.vue_vue_type_script_setup_true_lang-BgXpznbi.js} +5 -4
  28. package/dist/{Marketing-fq1wxANq.js → Marketing-C2cVJacf.js} +4 -4
  29. package/dist/MarketingMaterialEdit-DkOEy_L-.js +1037 -0
  30. package/dist/{Member-BfRy196y.js → Member-DufbKDOh.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BAR44Qcp.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CU8EmBxy.js} +43 -50
  32. package/dist/{MemberImportHistory-C4622Ivs.js → MemberImportHistory-DlFN-uQl.js} +7 -7
  33. package/dist/{MemberList-DqtsMN_N.js → MemberList-B344n8I4.js} +103 -105
  34. package/dist/{MemberTransactions-DsUoFg3z.js → MemberTransactions-BS7H640M.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CzFMUgXM.js → MessageInput.vue_vue_type_script_setup_true_lang-CxDtXvwd.js} +4228 -4176
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CVQYcuQ6.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-lY0jlyOG.js} +1 -1
  37. package/dist/{Mission-B0GO4LiM.js → Mission-D2ed_oKn.js} +22 -21
  38. package/dist/{Overview-XpJJmHqs.js → Overview-CLh_T6YY.js} +145 -144
  39. package/dist/{Overview-CVITimwN.js → Overview-DJa-hXDC.js} +23 -22
  40. package/dist/{Point-B7aCrMkI.js → Point-DAPeg1VD.js} +22 -21
  41. package/dist/{Promotion-DfVcuXHy.js → Promotion-CPPCMMFl.js} +137 -131
  42. package/dist/{Queue-BT7O2cvj.js → Queue-BcPwCRcM.js} +47 -46
  43. package/dist/{Record-CAc030dz.js → Record-C5XKn--g.js} +9 -9
  44. package/dist/{Review-CyXo4GTY.js → Review-Cc51luIv.js} +2 -2
  45. package/dist/ReviewFacebookCallback-BSGInFB8.js +225 -0
  46. package/dist/{ReviewGoogleCallback-BxiFOl0B.js → ReviewGoogleCallback-C1gY4vcP.js} +5 -5
  47. package/dist/{Reward-ChfNtdwX.js → Reward-k1R3hLiF.js} +29 -29
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CpQu_QBQ.js → RewardGroup.vue_vue_type_script_setup_true_lang-BGbbGVK4.js} +16 -15
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Coh3L11L.js +1923 -0
  50. package/dist/{Segment-H2zBDZeh.js → Segment-DsBnIvje.js} +290 -291
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B0jCJ-Xq.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CMKpvXN-.js} +31 -30
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DW_ViNZM.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-LyAtRMs8.js} +4 -4
  53. package/dist/Setting-BRueNgc4.js +574 -0
  54. package/dist/{SettingAdvertisements-DPQHP3-B.js → SettingAdvertisements-BrVcQyhF.js} +12 -12
  55. package/dist/Settings-fOvXd29Z.js +286 -0
  56. package/dist/{Store-B2f5HVQc.js → Store-rrh2pIHH.js} +661 -654
  57. package/dist/{StoreRewards-QxfaEt9f.js → StoreRewards-D-jivVKr.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CvQXsZbH.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DbnY9VE9.js +7007 -0
  60. package/dist/{Tier-BSk4rBm8.js → Tier-DJiLtw3M.js} +2576 -687
  61. package/dist/{Title-CIzpB8TT.js → Title-s0bzA7yZ.js} +94 -92
  62. package/dist/{Transaction-BjxxNEHa.js → Transaction-CQ-CJ_eh.js} +2 -2
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BMutYxOU.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bfy8SZH1.js} +26 -26
  64. package/dist/{Voucher-B2lFq21Y.js → Voucher-9vydRET7.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BWV631It.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Dq7veRL5.js} +16 -16
  66. package/dist/WhatsappAccount-D12Hvzfl.js +159 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BrZEDi6O.js +39 -0
  68. package/dist/WhatsappBot-o5b_0CnB.js +629 -0
  69. package/dist/WhatsappBotLogs-CK_V_iT5.js +372 -0
  70. package/dist/WhatsappBotSettings-BooibLUg.js +694 -0
  71. package/dist/WhatsappLayout-bOyNHGUI.js +21 -0
  72. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-Cytrffdh.js +253 -0
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BCoB0Fsa.js → ZodTextField.vue_vue_type_script_setup_true_lang-96t_eUzk.js} +2 -2
  74. package/dist/{app-DgFVWdhA.js → app-DV3e2LkD.js} +10610 -8223
  75. package/dist/app.js +4 -3
  76. package/dist/{base.export-B6Rojjek.js → base.export-DQUUtGmy.js} +2 -2
  77. package/dist/browser-BSAOEeIM.js +1478 -0
  78. package/dist/{business-C6ID0exl.js → business-BZ0boE-5.js} +1 -1
  79. package/dist/campaign-CsfFq2S-.js +400 -0
  80. package/dist/{campaign-BgSJXWdU.js → campaign-DMrtYWcs.js} +31 -25
  81. package/dist/{campaign.enum-CVvm0LMm.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  82. package/dist/campaign.fn-C-CdNNdR.js +776 -0
  83. package/dist/{collectible.enum-DGQVW464.js → collectible.enum-Liy2wH3s.js} +1 -1
  84. package/dist/{collection.fn-dV4F8R-j.js → collection.fn-C-rryKSc.js} +2 -2
  85. package/dist/{currency-DlHi_3WN.js → currency-BOd9iVZV.js} +1 -1
  86. package/dist/duplicateCampaign-ey_rW0Bz.js +51 -0
  87. package/dist/{effect-BJgmiWY4.js → effect-BP6Hkxmj.js} +1 -1
  88. package/dist/{email-addresses-3GTx_xTh.js → email-addresses-CO61QAq0.js} +2 -2
  89. package/dist/feature-flag-Bq1SgbYC.js +868 -0
  90. package/dist/feature-flag-lvPP0ED-.js +50 -0
  91. package/dist/google-BQK68wbe.js +5 -0
  92. package/dist/{helper-BX0JQP06.js → helper-BRpts-M-.js} +1 -1
  93. package/dist/{index-BIpAzktM.js → index-03WIXl-H.js} +8 -7
  94. package/dist/{index-BeCKw7Y3.js → index-B0RavybO.js} +19 -6
  95. package/dist/{index-DeNbsrQx.js → index-BDNkoALK.js} +1 -1
  96. package/dist/{index-Bl5aHABH.js → index-BV5aPSYo.js} +11 -10
  97. package/dist/{index-Cnw0B8Lc.js → index-Bk20uvPY.js} +1 -1
  98. package/dist/index-Bn19rfby.js +14571 -0
  99. package/dist/index-C_H8jFYf.js +2743 -0
  100. package/dist/{index-nmw7_9ZE.js → index-Cj-eugzc.js} +1 -1
  101. package/dist/{index-uXgPJlic.js → index-CoROn5OA.js} +2700 -2613
  102. package/dist/{index-DdMVrWZy.js → index-CrBhcMaL.js} +8028 -10767
  103. package/dist/{index-2xed2K8D.js → index-CsBjAM3E.js} +4 -3
  104. package/dist/{index-CiFReW-F.js → index-D1t4_KaG.js} +1 -1
  105. package/dist/{index-DRNdJ_KC.js → index-D3wGTCWf.js} +8 -7
  106. package/dist/{index-CtBLnWVG.js → index-D41kjcrZ.js} +683 -581
  107. package/dist/{index-CNULhBPM.js → index-DIZLkVe0.js} +691 -230
  108. package/dist/{index-QaWLGgEC.js → index-DucKyzrD.js} +2 -2
  109. package/dist/{index-o2OQljHs.js → index-R5WS21OL.js} +4 -4
  110. package/dist/index-RwNlbTO8.js +115 -0
  111. package/dist/{index-R0qlOO6J.js → index-VYI0zWNC.js} +29 -15
  112. package/dist/index-ZRE89TKq.js +80 -0
  113. package/dist/{index-BHT6cvWA.js → index-_Cj-bsd_.js} +396 -232
  114. package/dist/{index-Y2Pu1YkB.js → index-mToWKHVs.js} +2 -2
  115. package/dist/{index.esm2017-Dum0onrS.js → index.esm2017-B_Sag8Pg.js} +209 -209
  116. package/dist/{loading-B2mSdkfy.js → loading-C5fVI0ry.js} +1 -1
  117. package/dist/{lodash-DtOypaKt.js → lodash-COo8_xCU.js} +1 -1
  118. package/dist/{member-import-C2pLnh44.js → member-import-I_pKwUfF.js} +6 -5
  119. package/dist/{membership-BWyBGF4n.js → membership-BgfH9Kva.js} +3 -3
  120. package/dist/{money-3lCCVCeP.js → money-Cr07YDlV.js} +1 -1
  121. package/dist/{number-zlqy2MLG.js → number-DFsj0dkh.js} +1 -1
  122. package/dist/objectid-Cu89BzwI.js +145 -0
  123. package/dist/{onboarding-BqD3B4M1.js → onboarding-DlkJCm-5.js} +25 -25
  124. package/dist/{onboardingSetup-CCQ90jg7.js → onboardingSetup-BEhVj613.js} +2 -2
  125. package/dist/{plugins-Bj3npYnL.js → plugins-CPTtiKqf.js} +3 -3
  126. package/dist/{MarketingMaterialEdit-0h7E0n5e.js → remy-icon-BhUGu2NI.js} +2 -1031
  127. package/dist/{reward-5dDuZEb7.js → reward-DqY0mQ_5.js} +1 -1
  128. package/dist/{rule-NqLeSyoO.js → rule-mJJ48eKw.js} +572 -492
  129. package/dist/style.css +1 -1
  130. package/dist/template-C1QftpDG.js +188 -0
  131. package/dist/{timezone-B0lkgvh-.js → timezone-BBgBHels.js} +1 -1
  132. package/dist/{transaction.fn-CACuVUBe.js → transaction.fn-Sr0hj3kY.js} +2 -2
  133. package/dist/{trigger-BKJwKTJx.js → trigger-PUP0mwKM.js} +8 -8
  134. package/dist/{useMarketingMaterialActions-DERvOmen.js → useMarketingMaterialActions-faslwaHd.js} +3 -3
  135. package/dist/{usePagination-FkjroUq2.js → usePagination-Be6nIQ9y.js} +1 -1
  136. package/dist/{user-H9MnsLbu.js → user-DBSYzG_9.js} +1 -1
  137. package/dist/vue-i18n-C6c2jsH3.js +2365 -0
  138. package/dist/{xlsx-BVmtIl_i.js → xlsx-Bfo19lFv.js} +786 -786
  139. package/dist/{zod-DI7OBdxu.js → zod-CihbDg3N.js} +1 -1
  140. package/package.json +12 -3
  141. package/dist/Broadcast-CoirZUyr.js +0 -271
  142. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DyIOw_HH.js +0 -2431
  143. package/dist/ReviewFacebookCallback--IcyheQA.js +0 -238
  144. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang--5K-qagY.js +0 -1883
  145. package/dist/Setting-D4XOHSHT.js +0 -2036
  146. package/dist/Settings-Dt_oLoGl.js +0 -179
  147. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Db2cd6ny.js +0 -1264
  148. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D9L-AayN.js +0 -142
  149. package/dist/campaign-DDfFBFye.js +0 -228
  150. package/dist/campaign.fn-DRabv93K.js +0 -776
  151. package/dist/google-C3S8u0mT.js +0 -4
  152. package/dist/index-CmhDYsk6.js +0 -51
  153. package/dist/objectid-b2KGvMA7.js +0 -145
  154. package/dist/rule-builder-BzYwbbj4.js +0 -102
  155. package/dist/template-fjUz6xrU.js +0 -236
  156. package/dist/vue-i18n-DbJO6sZW.js +0 -2365
@@ -0,0 +1,372 @@
1
+ import { defineComponent as T, resolveComponent as k, openBlock as r, createElementBlock as d, createElementVNode as s, toDisplayString as i, unref as p, 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-C6c2jsH3.js";
3
+ import { useCoreStore as oe } from "@feedmepos/mf-common";
4
+ import { S as ne } from "./index-03WIXl-H.js";
5
+ import { w as ae } from "./index-ZRE89TKq.js";
6
+ import { _ as se } from "./remy-icon-BhUGu2NI.js";
7
+ import { _ as le } from "./WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-Cytrffdh.js";
8
+ import { C as U } from "./timezone-BBgBHels.js";
9
+ import { m as re } from "./index-D1t4_KaG.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 r(), 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(p(v)("connect.whatsappBot.logs.thought")), 1),
28
+ s("span", ue, i(p(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
+ ), u = 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 r(), d("article", xe, [
82
+ s("header", fe, [
83
+ s("div", he, i(u.value), 1),
84
+ s("div", ve, [
85
+ s("h2", ge, i(o.value), 1),
86
+ s("p", ye, i(m.conversation.phoneNumber || p(c)("connect.whatsappBot.phoneUnavailable")) + " · " + i(p(c)("connect.whatsappBot.tickets.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
+ (r(!0), d(M, null, V(m.conversation.logs, (l) => (r(), d("li", {
95
+ key: l.id,
96
+ class: "flex flex-col gap-[4px] min-w-0"
97
+ }, [
98
+ l.type === "message" ? (r(), d(M, { key: 0 }, [
99
+ l.isFromMe && !l.isFromBot ? (r(), d("span", be, i(p(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
+ l.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(l)) + " ", 1),
107
+ l.isEdit ? (r(), d("span", ke, " (" + i(p(c)("connect.whatsappBot.logs.edited")) + ") ", 1)) : $("", !0),
108
+ s("time", {
109
+ datetime: l.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(l.timestamp))), 9, Be)
112
+ ], 2)
113
+ ], 64)) : l.type === "thought" ? (r(), I(de, {
114
+ key: 1,
115
+ text: l.text
116
+ }, null, 8, ["text"])) : l.type === "escalate" ? (r(), d("button", {
117
+ key: 2,
118
+ type: "button",
119
+ title: p(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", l.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(p(c)("connect.whatsappBot.logs.escalated")), 1),
131
+ s("span", $e, i(p(c)("connect.whatsappBot.logs.reason", {
132
+ reason: l.source === "staff" ? p(c)("connect.whatsappBot.tickets.staffReason") : l.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
+ ]), u = g.get(o) ?? { name: "", phone: "" };
151
+ t.customerName && (u.name = t.customerName), t.phoneNumber && (u.phone = t.phoneNumber), g.set(o, u);
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], u = g.get(
166
+ JSON.stringify([o.accountLid || o.clientId, o.chatJid])
167
+ );
168
+ t.customerName = (u == null ? void 0 : u.name) ?? "", t.phoneNumber = (u == null ? void 0 : u.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
+ role: "status",
184
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
185
+ }, Te = {
186
+ key: 2,
187
+ class: "flex items-center gap-[12px] flex-wrap"
188
+ }, Ee = {
189
+ role: "alert",
190
+ class: "text-[14px] text-fm-color-typo-error"
191
+ }, Je = {
192
+ key: 3,
193
+ class: "border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[8px]"
194
+ }, Ye = { class: "text-[20px] font-semibold" }, je = { class: "max-w-[420px] text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Ge = {
195
+ key: 4,
196
+ class: "mx-auto w-full min-w-0 flex flex-col gap-[12px]"
197
+ }, qe = /* @__PURE__ */ T({
198
+ __name: "WhatsappBotLogs",
199
+ props: {
200
+ accounts: {}
201
+ },
202
+ setup(m) {
203
+ const v = m, { t: n } = E(), g = oe(), c = w(() => ne.getBusinessId() ?? ""), t = w(
204
+ () => U[g.currentCountry.value || "MY"] ?? U.MY
205
+ ), o = b([]), u = b(""), A = b([]), y = b([]), h = b(!0), f = b(""), B = b(), N = b(!1), l = b("");
206
+ let C;
207
+ function S(a) {
208
+ var F;
209
+ const e = (F = v.accounts.find(
210
+ (L) => L.clientId === a
211
+ )) == null ? void 0 : F.account;
212
+ 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) });
213
+ }
214
+ const R = w(
215
+ () => [
216
+ .../* @__PURE__ */ new Set([
217
+ ...v.accounts.map((a) => a.clientId),
218
+ ...y.value,
219
+ ...o.value
220
+ ])
221
+ ].map((a) => ({ clientId: a, label: S(a) }))
222
+ ), J = w(() => {
223
+ const a = u.value.trim().toLocaleLowerCase();
224
+ return R.value.filter(
225
+ (e) => e.label.toLocaleLowerCase().includes(a)
226
+ );
227
+ }), Z = w(() => {
228
+ const a = o.value, e = a.length ? a.length === 1 ? S(a[0]) : n("connect.whatsappBot.logs.selectedAccounts", {
229
+ count: a.length
230
+ }) : n("connect.whatsappBot.logs.allAccounts");
231
+ return 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
+ l.value = "";
240
+ const e = v.accounts.find(
241
+ (F) => F.clientId === a
242
+ );
243
+ if (!e) {
244
+ l.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 = [], u.value = "", y.value = [], N.value = !1, B.value = void 0, l.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 r(), 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: Z.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: u.value,
299
+ "onUpdate:modelValue": e[0] || (e[0] = (x) => u.value = x),
300
+ placeholder: p(n)("connect.whatsappBot.logs.searchAccounts")
301
+ }, null, 8, ["modelValue", "placeholder"]),
302
+ _(Q),
303
+ _(z, {
304
+ label: p(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
+ (r(!0), d(M, null, V(J.value, (x) => (r(), 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) : (r(), I(z, {
318
+ key: 0,
319
+ label: p(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: p(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
+ l.value ? (r(), d("p", ze, i(l.value), 1)) : $("", !0),
336
+ h.value ? (r(), d("div", Ve, [
337
+ _(q),
338
+ P(" " + i(p(n)("connect.whatsappBot.logs.loading")), 1)
339
+ ])) : f.value ? (r(), d("div", Te, [
340
+ s("p", Ee, i(f.value), 1),
341
+ _(j, {
342
+ variant: "secondary",
343
+ "prepend-icon": "refresh",
344
+ label: p(n)("connect.whatsappBot.tryAgain"),
345
+ onClick: e[3] || (e[3] = (x) => D())
346
+ }, null, 8, ["label"])
347
+ ])) : Y.value.length ? (r(), d("div", Ge, [
348
+ (r(!0), d(M, null, V(Y.value, (x) => (r(), 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
+ ])) : (r(), d("div", Je, [
356
+ s("h2", Ye, i(p(n)("connect.whatsappBot.logs.emptyTitle")), 1),
357
+ s("p", je, i(p(n)("connect.whatsappBot.logs.emptyDescription")), 1)
358
+ ]))
359
+ ]),
360
+ B.value ? (r(), 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
+ };