!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"768c393028531b48d077404b24343b320adb8107"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="618b7c45-2b36-454e-8b62-08d8b207b687",e._sentryDebugIdIdentifier="sentry-dbid-618b7c45-2b36-454e-8b62-08d8b207b687")}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 l=r(96540),n=r(32977),s=r(19075),d=r(81685),o=r(42849),a=r(50100),i=r(71870),c=r(91721),u=r(12339),x=r(31787),h=r(24155),b=r(79748),p=r(6304),g=r(41514),j=r(3319),A=r(74848);const f=e=>{let{children:t,...r}=e;return(0,A.jsx)(n.Flex,{column:!0,gap:3,padding:[4,0],...r,children:t})},m=()=>(0,A.jsxs)(f,{children:[(0,A.jsx)(h.A,{height:"80px"}),(0,A.jsx)(h.A,{height:"80px"}),(0,A.jsx)(h.A,{height:"80px"}),(0,A.jsx)(h.A,{height:"80px"}),(0,A.jsx)(h.A,{height:"80px"})]}),k=e=>{let{id:t,createdAt:r}=e;const s=(0,o.A)({reportDate:new Date(r),dateOptions:{long:!0}}),{goToReport:d}=(0,a.A)(),{sendLog:i}=(0,j.A)(),c=(0,l.useCallback)(()=>{d(t),i({feature:"AlertDetailsModal",description:"View full report button click",reportId:t})},[t,d,i]);return(0,A.jsxs)(n.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,A.jsx)(n.TextBig,{strong:!0,color:"menuItem",children:s}),(0,A.jsx)(x.A,{id:t,limitCharacters:180}),(0,A.jsx)(n.Flex,{justifyContent:"end",children:(0,A.jsx)(b.A,{onClick:c,children:"View more"})})]})},I="alert-modal",w=()=>(0,A.jsxs)(n.Flex,{alignItems:"center",gap:2,children:[(0,A.jsx)(n.Icon,{name:"checkmark_s",color:"success"}),(0,A.jsx)(n.TextBig,{children:"Requested a report"})]}),y=e=>{let{alertId:t}=e;const[r,s,,d]=(0,p.A)(),[o,,a]=(0,p.A)(),c=(0,i.A)({onSuccess:a}),{sendLog:x}=(0,j.A)(),h=(0,l.useCallback)(()=>{c({alertId:t}),(0,g.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,A.jsx)(w,{}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(b.A,{Component:n.TextBig,onClick:s,children:"Request a new report"}),r?(0,A.jsx)(u.A,{data:{id:t},handleAction:h,onClose:d}):null]})},T=e=>{let{alertId:t,...r}=e;const{fullyLoaded:l}=(0,s.JL)(t),{loaded:n,reports:o}=(0,d.nX)({alertId:t});return l?n?(0,A.jsxs)(f,{...r,children:[(0,A.jsx)(y,{alertId:t}),o.map(e=>(0,A.jsx)(k,{...e},e.id))]}):(0,A.jsx)(m,{}):(0,A.jsx)(c.A,{})}},31787(e,t,r){r.d(t,{A:()=>c});r(98992),r(72577);var l=r(96540),n=r(32977),s=r(81685),d=r(24155),o=r(83341),a=r(74848);const i=()=>(0,a.jsxs)(n.Flex,{column:!0,gap:2,children:[(0,a.jsx)(d.A,{}),(0,a.jsx)(d.A,{width:"75%"})]}),c=e=>{let{id:t,limitCharacters:r=70}=e;const{loaded:d,report:c,error:u}=(0,s.ef)({id:t}),x=(0,l.useMemo)(()=>d&&!u&&c.data?.blocks?.length?c.data.blocks.find(e=>{let{type:t}=e;return"TEXT"===t})?.data?.substring(0,r):"",[d,c,u]);return d?u?null:(0,a.jsx)(n.Flex,{"data-testid":"insights-report-preview-container",children:(0,a.jsx)(o.A,{children:`${x}...`})}):(0,a.jsx)(i,{})}}}]);