import{s as e}from"./rolldown-runtime.zcDlVW45.js";import{b as t,y as n}from"./vendor-react.C6bNwj4M.js";import{cs as r,tr as i,yr as a}from"./vendor-neo4j-ndl.llONqzcp.js";import{Pr as o}from"./src.Ce7xDTbc.js";var s=e(r()),c=e(n()),l=t();function u(){let e=window.sessionStorage.getItem(o);return e===null?``:e}var d=[`error`,`log`,`warn`],f=/^.+\s\[(.+)\]\s'(\w+)'\s(.+)$/;function p(e){let t=e.match(f);if(t===null)return[];let[,n,r,i]=t;return n===void 0||r===void 0||i===void 0?[]:[{time:new Date(n),level:d.find(e=>e===r)??`log`,message:i}]}function m(e){let[t,n]=c.useState(u()),r=c.useMemo(()=>t.split(`
`).flatMap(p),[t]);c.useEffect(()=>{window.addEventListener(`storage`,e=>{e.key===o&&n(u())})},[n]);function d(){let e=new Blob([t],{type:`application/octet-stream`});window.location.assign(URL.createObjectURL(e))}return(0,l.jsxs)(i,{isOpen:!0,onClose:e.onClose,children:[(0,l.jsx)(i.Header,{children:`Auth Log`}),(0,l.jsx)(i.Actions,{children:(0,l.jsx)(a,{onClick:d,children:`Download`})}),(0,l.jsx)(i.Description,{children:(0,l.jsx)(`ol`,{className:`grid gap-2`,children:r.map((e,t)=>(0,l.jsxs)(`li`,{className:(0,s.default)(`border-l-4 py-1 pl-2`,{"border-l-danger-border-weak":e.level===`error`,"bg-danger-bg-weak":e.level===`error`,"border-l-neutral-border-weak":e.level===`log`,"border-l-warning-border-weak":e.level===`warn`,"bg-warning-bg-weak":e.level===`warn`}),children:[(0,l.jsx)(`time`,{className:`text-xs`,children:e.time.toLocaleString()}),(0,l.jsx)(`div`,{children:e.message})]},t))})})]})}export{m as default};