!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"6f8fd777495ec30113c7d19e3c90e6767827ed67"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3cf12ad0-ac5a-4b47-b758-d4dc191db914",e._sentryDebugIdIdentifier="sentry-dbid-3cf12ad0-ac5a-4b47-b758-d4dc191db914")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[5178],{5178(e,t,r){r.r(t),r.d(t,{default:()=>T});r(98992),r(81454);var d=r(96540),l=r(56327),n=r(19075),s=r(81685),o=r(42849),a=r(50100),i=r(71870),c=r(91721),u=r(12339),x=r(31787),h=r(24155),p=r(79748),g=r(6304),b=r(41514),j=r(3319),f=r(74848);const A=e=>{let{children:t,...r}=e;return(0,f.jsx)(l.Flex,{column:!0,gap:3,padding:[4,0],...r,children:t})},m=()=>(0,f.jsxs)(A,{children:[(0,f.jsx)(h.A,{height:"80px"}),(0,f.jsx)(h.A,{height:"80px"}),(0,f.jsx)(h.A,{height:"80px"}),(0,f.jsx)(h.A,{height:"80px"}),(0,f.jsx)(h.A,{height:"80px"})]}),k=e=>{let{id:t,createdAt:r}=e;const n=(0,o.A)({reportDate:new Date(r),dateOptions:{long:!0}}),{goToReport:s}=(0,a.A)(),{sendLog:i}=(0,j.A)(),c=(0,d.useCallback)(()=>{s(t),i({feature:"AlertDetailsModal",description:"View full report button click",reportId:t})},[t,s,i]);return(0,f.jsxs)(l.Flex,{"data-testid":"alert-details-modal-tab-reports",column:!0,gap:2,background:"panelBg",round:!0,border:{side:"all",color:"border"},padding:[3,4],children:[(0,f.jsx)(l.TextBig,{strong:!0,color:"menuItem",children:n}),(0,f.jsx)(x.A,{id:t,limitCharacters:180}),(0,f.jsx)(l.Flex,{justifyContent:"end",children:(0,f.jsx)(p.A,{onClick:c,children:"View more"})})]})},I="alert-modal",w=()=>(0,f.jsxs)(l.Flex,{alignItems:"center",gap:2,children:[(0,f.jsx)(l.Icon,{name:"checkmark_s",color:"success"}),(0,f.jsx)(l.TextBig,{children:"Requested a report"})]}),y=e=>{let{alertId:t}=e;const[r,n,,s]=(0,g.A)(),[o,,a]=(0,g.A)(),c=(0,i.A)({onSuccess:a}),{sendLog:x}=(0,j.A)(),h=(0,d.useCallback)(()=>{c({alertId:t}),(0,b.H)("alert-troubleshooter","click-alert-troubleshooter-action-confirmation",I,{action:"request-report-alert",alertId:t},"user-clicked-cta"),x({feature:"AlertTroubleshooter",alertId:t,ui:I,description:"request-report-alert"})},[t,c,x]);return o?(0,f.jsx)(w,{}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.A,{Component:l.TextBig,onClick:n,children:"Request a new report"}),r?(0,f.jsx)(u.A,{data:{id:t},handleAction:h,onClose:s}):null]})},T=e=>{let{alertId:t,...r}=e;const{fullyLoaded:d}=(0,n.JL)(t),{loaded:l,reports:o}=(0,s.nX)({alertId:t});return d?l?(0,f.jsxs)(A,{...r,children:[(0,f.jsx)(y,{alertId:t}),o.map(e=>(0,f.jsx)(k,{...e},e.id))]}):(0,f.jsx)(m,{}):(0,f.jsx)(c.A,{})}},31787(e,t,r){r.d(t,{A:()=>c});r(98992),r(72577);var d=r(96540),l=r(56327),n=r(81685),s=r(24155),o=r(83341),a=r(74848);const i=()=>(0,a.jsxs)(l.Flex,{column:!0,gap:2,children:[(0,a.jsx)(s.A,{}),(0,a.jsx)(s.A,{width:"75%"})]}),c=e=>{let{id:t,limitCharacters:r=70}=e;const{loaded:s,report:c,error:u}=(0,n.ef)({id:t}),x=(0,d.useMemo)(()=>s&&!u&&c.data?.blocks?.length?c.data.blocks.find(e=>{let{type:t}=e;return"TEXT"===t})?.data?.substring(0,r):"",[s,c,u]);return s?u?null:(0,a.jsx)(l.Flex,{"data-testid":"insights-report-preview-container",children:(0,a.jsx)(o.A,{children:`${x}...`})}):(0,a.jsx)(i,{})}}}]);