1import{l as D,r as $,j as e,a as j,L as g,a0 as C}from"./react-DwuEVfNv.js";import{_ as f,$ as I,c4 as w,fK as z,ed as L,bh as F,fL as R,dq as T,b_ as W,bi as M,bj as O,aK as P,e8 as B,fM as N,y as _,aM as H,aN as J,bk as K,k as o,cV as q,q as d,bm as Q,c5 as p,a3 as V,cr as m,er as y,am as S,m as Y}from"./index-DQzPtNsy.js";import{C as v}from"./CodeBlock-BfKgAAeG.js";import{A as x}from"./ActivityItemTable-DdQuQUnt.js";import{a as G,i as U}from"./activity-DPifZ1mn.js";import"./d3-q0zOtUjj.js";const X=j.div(["max-height:720px;overflow-y:scroll;"]),Z=j(y)(["align-self:flex-start;"]);function ee(a){const n=f()||"",i=I()||"",l=D(),r=w(),{error:b,isLoading:A,data:t}=G(a.eventId),E=z(L(t),["stream_key","srt_passphrase"]);F(R({section:"Events",leaf:t?T(t.type.replace("video.","")):null,error:b}));const c=$.useMemo(()=>(t?.attempts.filter(s=>s.responseStatusCode<200||s.responseStatusCode>=300)??[]).length,[t?.attempts]),k=s=>{try{return JSON.parse(s)}catch{return s}};return A||!t?e.jsx(W,{gutterY:8}):e.jsxs(M,{children:[e.jsxs(O,{children:[e.jsxs(P,{children:[e.jsx(B,{to:N(l,_(n,i,"/activity/events")),children:"Events"}),e.jsx(H,{}),e.jsx(J,{children:t.type})]}),e.jsx(K,{children:e.jsxs(o,{gap:2,children:[e.jsxs(q,{$bold:!0,$wordWrap:!0,children:[t.type," "]}),e.jsx(d,{children:t.id}),e.jsx(te,{event:t,organizationId:a.organizationId})]})})]}),e.jsxs(Q,{gap:8,children:[e.jsx(x,{items:[{title:"Date",value:r(new Date(t.createdAt),p.fullWithSeconds)},{title:"Type",value:t.type},{title:"Object ID",value:t.object?.id},{title:"Source",value:t.accessorSource},{title:"Environment",value:se(t)}].filter(s=>s.value!==null&&s.value!==void 0)}),e.jsxs(o,{gap:3,children:[e.jsxs(V,{yAlign:"center",gap:3,children:[e.jsx(m,{$bold:!0,children:"Webhook Attempts"}),c>0&&e.jsx(y,{content:`${c} Failed Attempt(s)`})]}),e.jsxs(X,{children:[t.attempts.length===0&&e.jsxs(d,{children:["We haven't made any attempts yet. Do you have a"," ",e.jsx(S,{as:g,to:`/organizations/${a.organizationId}/settings/webhooks`,children:"webhook set up"}),"?"]}),e.jsx(o,{gap:4,children:t.attempts.map((s,u)=>e.jsxs(o,{gap:4,children:[e.jsx(Z,{variant:s.responseStatusCode>=200&&s.responseStatusCode<300?"feature":"error",content:s.responseStatusCode>=200&&s.responseStatusCode<300?"Successful Attempt":"Failed Attempt"}),e.jsx(x,{items:[{title:"Date",value:r(new Date(s.createdAt),p.fullWithSeconds)},{title:"Status Code",value:s.responseStatusCode},{title:"Address Attempted",value:s.address},{title:"Response Body",value:e.jsx(v,{wordWrap:!0,children:JSON.stringify(k(s.responseBody),null,2)})}].filter(h=>h.value!==null&&h.value!==void 0)}),u!==t.attempts.length-1&&e.jsx(Y,{orientation:"horizontal"})]},s.id))})]})]}),e.jsxs(o,{gap:3,children:[e.jsx(m,{$bold:!0,children:"Event Data"}),e.jsx(v,{code:JSON.stringify(E,null,2)})]})]})]})}function te({event:a,organizationId:n}){const i=a.environment?e.jsxs(e.Fragment,{children:["An"," ",e.jsx(S,{as:g,to:`/organizations/${n}/environments/${a.environment.id}/video/assets/${a.data.id}`,children:"asset"})]}):"An asset",r={"video.asset.ready":e.jsxs(e.Fragment,{children:["has transitioned to ",e.jsx("code",{children:"ready"})]}),"video.asset.created":e.jsxs(e.Fragment,{children:["has been ",e.jsx("code",{children:"created"})]}),"video.asset.errored":e.jsxs(e.Fragment,{children:["has ",e.jsx("code",{children:"errored"})]})}[a.type];return r?e.jsxs(d,{children:[i," ",r]}):null}function se(a){return a.environment?a.environment.name:U(a.type)?null:"[deleted]"}function le(){const a=f()||"",n=C().eventId||"";return e.jsx(ee,{organizationId:a,eventId:n})}export{le as default}; 2//# sourceMappingURL=EventRoute-CzdtBkTi.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.