better-auth-studio 1.1.2-beta.4 → 1.1.2-beta.5
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.
package/README.md
CHANGED
|
@@ -10,58 +10,7 @@ A web-based studio interface for managing Better Auth applications. Better Auth
|
|
|
10
10
|
## Preview
|
|
11
11
|
A sneak peek of the studio dashboard and management interface.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
<table>
|
|
15
|
-
<tr>
|
|
16
|
-
<td width="50%">
|
|
17
|
-
<img src="https://gk6bju9ndq.ufs.sh/f/M5pOhOFFvHQJI57TKc4BY9GjOlTtSmoRXCZJ2D50IWsLq6vd" alt="Better Auth Studio Preview 0" width="100%" />
|
|
18
|
-
</td>
|
|
19
|
-
<td width="50%">
|
|
20
|
-
<img src="https://gk6bju9ndq.ufs.sh/f/M5pOhOFFvHQJ4L7IilBo7ItO3420CBLpvnPJlA6j5zaFYZbG" alt="Better Auth Studio Preview 4" width="100%" />
|
|
21
|
-
</td>
|
|
22
|
-
</tr>
|
|
23
|
-
<tr>
|
|
24
|
-
<td width="50%">
|
|
25
|
-
<img src="https://gk6bju9ndq.ufs.sh/f/M5pOhOFFvHQJdiXpY6GJ15hUVAwrQyozdc6PpIXfSi7GWkeR" alt="Better Auth Studio Preview 2" width="100%" />
|
|
26
|
-
</td>
|
|
27
|
-
<td width="50%">
|
|
28
|
-
<img src="https://gk6bju9ndq.ufs.sh/f/M5pOhOFFvHQJNAk2JU1Cviwfb1ltHVgPJF9BWxzE2m60rQaK" alt="Better Auth Studio Preview 6" width="100%" />
|
|
29
|
-
</td>
|
|
30
|
-
</tr>
|
|
31
|
-
<tr>
|
|
32
|
-
<td width="50%">
|
|
33
|
-
<img src="https://gk6bju9ndq.ufs.sh/f/M5pOhOFFvHQJgSyVwl0dZe8UGVJLkR74CQXb9m1wzKIqhTME" alt="Better Auth Studio Preview 11" width="100%" />
|
|
34
|
-
</td>
|
|
35
|
-
<td width="50%">
|
|
36
|
-
<img src="https://gk6bju9ndq.ufs.sh/f/M5pOhOFFvHQJODyqbs8p2EKCNef8H9XqPm4cIwjaQVRUAFg7" alt="Better Auth Studio Preview 8" width="100%" />
|
|
37
|
-
</td>
|
|
38
|
-
</tr>
|
|
39
|
-
<tr>
|
|
40
|
-
<td width="50%">
|
|
41
|
-
<img src="https://gk6bju9ndq.ufs.sh/f/M5pOhOFFvHQJ2syhnQSdgJ9w13MfvHiGYPs07AkpWQSXm6Nj" alt="Better Auth Studio Preview 12" width="100%" />
|
|
42
|
-
</td>
|
|
43
|
-
<td width="50%">
|
|
44
|
-
<img src="https://gk6bju9ndq.ufs.sh/f/M5pOhOFFvHQJcW7cwWXSlBtbRHTF15ujAQLPx3VpcKgMOz08" alt="Better Auth Studio Preview 3" width="100%" />
|
|
45
|
-
</td>
|
|
46
|
-
</tr>
|
|
47
|
-
<tr>
|
|
48
|
-
<td width="50%">
|
|
49
|
-
<img src="https://gk6bju9ndq.ufs.sh/f/M5pOhOFFvHQJnAGpd3rzcKd2Hu4wkD0jJbApf78rC1VgZORT" alt="Better Auth Studio Preview 10" width="100%" />
|
|
50
|
-
</td>
|
|
51
|
-
<td width="50%">
|
|
52
|
-
<img src="https://gk6bju9ndq.ufs.sh/f/M5pOhOFFvHQJK6lXYfaxUOknshdjxpSgwV6mq7DtH3aMZXWK" alt="Better Auth Studio Preview 13" width="100%" />
|
|
53
|
-
</td>
|
|
54
|
-
</tr>
|
|
55
|
-
<tr>
|
|
56
|
-
<td width="50%">
|
|
57
|
-
<img src="https://gk6bju9ndq.ufs.sh/f/M5pOhOFFvHQJhZFdrWmjbSvOe01IQl7r68LUfVKuFcNqAydt" alt="Better Auth Studio Preview 14" width="100%" />
|
|
58
|
-
</td>
|
|
59
|
-
<td width="50%">
|
|
60
|
-
<img src="https://gk6bju9ndq.ufs.sh/f/M5pOhOFFvHQJwnJFq9htT259fPAQY0eIdDmn7O4xVlGaCjZR" alt="Better Auth Studio Preview 5" width="100%" />
|
|
61
|
-
</td>
|
|
62
|
-
</tr>
|
|
63
|
-
</table>
|
|
64
|
-
</div>
|
|
13
|
+
Demo app will be up soon.
|
|
65
14
|
|
|
66
15
|
## 🚀 Quick Start
|
|
67
16
|
|
|
@@ -327,10 +276,10 @@ export default config;
|
|
|
327
276
|
|
|
328
277
|
The init command automatically creates `app/api/studio/[[...path]]/route.ts`:
|
|
329
278
|
```typescript
|
|
330
|
-
import {
|
|
279
|
+
import { betterAuthStudio } from "better-auth-studio/nextjs";
|
|
331
280
|
import studioConfig from "@/studio.config";
|
|
332
281
|
|
|
333
|
-
const handler =
|
|
282
|
+
const handler = betterAuthStudio(studioConfig);
|
|
334
283
|
|
|
335
284
|
export {
|
|
336
285
|
handler as GET,
|
|
@@ -959,7 +959,7 @@ export const auth = betterAuth({
|
|
|
959
959
|
},
|
|
960
960
|
}),
|
|
961
961
|
],
|
|
962
|
-
});`,language:"typescript",fileName:"studio.config.ts",className:"w-full"})]})]})})]}):r&&t.length===0?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(ya,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading events..."})]})}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Events",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-sm",children:t.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Real-time authentication events and activity"})]})}),a.jsxs("div",{className:"flex items-center justify-between gap-8 py-4 px-6 bg-gradient-to-b from-white/[4%] to-white/[2.5%] border border-white/10 rounded-none overflow-x-auto relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0 ",children:a.jsx(zi,{className:"w-5 h-5 text-green-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Success"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.success})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(ZN,{className:"w-5 h-5 text-red-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Failed"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.failed})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(LU,{className:"w-5 h-5 text-yellow-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Warning"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.warning})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(Iae,{className:"w-5 h-5 text-blue-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Info"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.info})]})]})]}),t.length>0&&a.jsxs("div",{className:"bg-gradient-to-b from-white/[4%] to-white/[2.5%] border border-white/10 rounded-none p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("h3",{className:"text-sm text-white uppercase font-light mb-6",children:"Event Distribution"}),(()=>{const ee=[...t].sort((Re,Be)=>new Date(Re.timestamp).getTime()-new Date(Be.timestamp).getTime()),ue=ee[0],ve=ee[ee.length-1],Ee=(new Date(ve.timestamp).getTime()-new Date(ue.timestamp).getTime())/(1e3*60*60*24);let ge="hour",Ue=[],He=[];if(Ee<=1)ge="hour",Ue=Array.from({length:24},(Re,Be)=>Be.toString()),He=Array.from({length:24},(Re,Be)=>Be%4===0?`${Be.toString().padStart(2,"0")}:00`:"");else if(Ee<=7){ge="day";const Re=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Ue=Array.from({length:7},(Be,Ye)=>Ye.toString()),He=Re}else if(Ee<=30){ge="week";const Re=new Date(ue.timestamp),Be=new Date(ve.timestamp),Ye=[],ot=[],tt=new Date(Re);tt.setHours(0,0,0,0);const wt=tt.getDay();tt.setDate(tt.getDate()-wt);let Ut=1;for(;tt<=Be;){const Bt=In(tt,"yyyy-MM-dd");Ye.push(Bt),ot.push(`Week ${Ut}`),tt.setDate(tt.getDate()+7),Ut++}Ue=Ye,He=ot}else{ge="month";const Re=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Ue=Array.from({length:12},(Be,Ye)=>Ye.toString()),He=Re}const ie={};Ue.forEach(Re=>{ie[Re]={success:0,failed:0,warning:0,info:0}}),t.forEach(Re=>{var ot;const Be=new Date(Re.timestamp);let Ye="";if(ge==="hour")Ye=Be.getHours().toString();else if(ge==="day")Ye=Be.getDay().toString();else if(ge==="week"){const tt=new Date(Be);tt.setHours(0,0,0,0);const wt=tt.getDay();tt.setDate(tt.getDate()-wt),Ye=In(tt,"yyyy-MM-dd")}else Ye=Be.getMonth().toString();if(ie[Ye]){const tt=Re.status||"success",wt=((ot=Re.display)==null?void 0:ot.severity)||"info";tt==="success"&&wt!=="failed"?ie[Ye].success++:tt==="failed"||wt==="failed"?ie[Ye].failed++:wt==="warning"?ie[Ye].warning++:(wt==="info"||!wt)&&ie[Ye].info++}});const Me=Object.values(ie).map(Re=>Re.success+Re.failed+Re.warning+Re.info),Ie=Math.max(...Me,1),Ae=Math.ceil(Ie/5),ct=Ae*5,Je=Array.from({length:6},(Re,Be)=>ct-Ae*Be);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsx("div",{className:"flex flex-col justify-between h-48 text-xs text-gray-500 font-mono pt-0.5 pb-0.5",children:Je.map((Re,Be)=>a.jsx("span",{className:"leading-none",children:Math.round(Re)},Be))}),a.jsxs("div",{className:"flex-1 h-48 relative",children:[a.jsx("div",{className:"absolute inset-0 flex flex-col justify-between z-0",children:[0,1,2,3,4,5].map(Re=>a.jsx("div",{className:"w-full h-px bg-white/10",style:{opacity:.3}},Re))}),a.jsx("div",{className:"h-48 flex items-end justify-between space-x-1 relative z-10",children:Ue.map((Re,Be)=>{const Ye=ie[Re]||{success:0,failed:0,warning:0,info:0},ot=Ye.success+Ye.failed+Ye.warning+Ye.info,tt=ot>0?ot/ct*100:0,wt=ot>0?Ye.success/ot*100:0,Ut=ot>0?Ye.failed/ot*100:0,Bt=ot>0?Ye.warning/ot*100:0,vn=ot>0?Ye.info/ot*100:0;return a.jsxs("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group flex flex-col-reverse border border-dashed border-white/20",style:{height:`${tt}%`,minHeight:ot>0?"2px":"0"},onMouseEnter:le=>{const Ce=le.currentTarget.getBoundingClientRect(),st=Ce.left+Ce.width/2,et=Ce.top,Fe=240,Xe=120,De=Math.max(Fe/2,Math.min(window.innerWidth-Fe/2,st)),rt=Math.max(Xe+10,Math.min(window.innerHeight-10,et));O(Be),I({x:De,y:rt})},onMouseLeave:()=>{O(null),I(null)},children:[Ye.success>0&&a.jsx("div",{className:"w-full relative",style:{height:`${wt}%`,backgroundColor:"rgba(34, 197, 94, 0.05)",minHeight:Ye.success>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})}),Ye.failed>0&&a.jsx("div",{className:"w-full relative",style:{height:`${Ut}%`,backgroundColor:"rgba(239, 68, 68, 0.05)",minHeight:Ye.failed>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})}),Ye.warning>0&&a.jsx("div",{className:"w-full relative",style:{height:`${Bt}%`,backgroundColor:"rgba(234, 179, 8, 0.05)",minHeight:Ye.warning>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})}),Ye.info>0&&a.jsx("div",{className:"w-full relative",style:{height:`${vn}%`,backgroundColor:"rgba(59, 130, 246, 0.05)",minHeight:Ye.info>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})})]},Re)})}),U!==null&&W&&(()=>{const Re=Ue[U],Be=ie[Re]||{success:0,failed:0,warning:0,info:0},Ye=Be.success+Be.failed+Be.warning+Be.info;let ot=He[U]||"";const tt={Sun:"Sunday",Mon:"Monday",Tue:"Tuesday",Wed:"Wednesday",Thu:"Thursday",Fri:"Friday",Sat:"Saturday"},wt={Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"};return tt[ot]?ot=tt[ot]:wt[ot]&&(ot=wt[ot]),a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${W.x}px`,top:`${W.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border overflow-x-hidden border-white/20 rounded-sm px-4 py-3 shadow-lg min-w-[150px]",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-3 font-mono uppercase",children:ot}),a.jsxs("div",{className:"flex flex-col items-center justify-center my-1 mb-1.5",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-1.5 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-white font-mono font-medium",children:"Total"}),a.jsx("span",{className:"text-sm text-white font-mono",children:Ye})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"}),Be.success>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Success"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#22c55e"},children:Be.success})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"})]}),Be.failed>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Failed"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#ef4444"},children:Be.failed})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"})]}),Be.warning>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Warning"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#eab308"},children:Be.warning})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"})]}),Be.info>0&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Info"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#3b82f6"},children:Be.info})]})]})]})})})()]})]}),a.jsx("div",{className:"flex justify-between text-xs text-gray-500 font-mono mt-2",children:He.map((Re,Be)=>a.jsx("span",{className:"flex-1 text-center truncate",children:Re||""},`${Re}-${Be}`))})]})})()]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(ao,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(we,{placeholder:"Search events...",value:i,onChange:ee=>o(ee.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex w-[130px] items-center space-x-2",children:a.jsxs(Tn,{value:l,className:"w-full",onValueChange:c,children:[a.jsx(Cn,{className:"w-full font-mono uppercase sm:text-[11px] border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsx(Jn,{})}),a.jsxs(kn,{className:"font-mono uppercase text-[11px]",children:[a.jsx(qe,{value:"all",children:"All Events"}),a.jsx(qe,{value:"success",children:"Success"}),a.jsx(qe,{value:"failed",children:"Failed"}),a.jsx(qe,{value:"info",children:"Info"}),a.jsx(qe,{value:"warning",children:"Warning"})]})]})}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(Tn,{value:"",onValueChange:H,children:[a.jsx(Cn,{className:"w-[120px] font-mono uppercase sm:text-[11px] border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(gm,{className:"w-4 h-4 text-gray-400"}),a.jsx(Jn,{placeholder:"Add Filter",className:"pr-2"})]})}),a.jsxs(kn,{className:"font-mono uppercase text-[11px]",children:[!F.some(ee=>ee.type==="timestamp")&&a.jsx(qe,{value:"timestamp",children:"Date Range"}),!F.some(ee=>ee.type==="eventType")&&a.jsx(qe,{value:"eventType",children:"Event Type"})]})]})})]}),F.length>0&&a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:F.map(ee=>{var ue,ve,Ne,Ee;return a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-black/50 border border-dashed border-white/20 rounded-none",children:[ee.type==="timestamp"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono uppercase text-gray-400",children:"Date:"}),a.jsxs(ga,{children:[a.jsx(xa,{asChild:!0,children:a.jsxs(q,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(Oc,{className:"mr-1 h-3 w-3"}),(ue=ee.dateRange)!=null&&ue.from?In(ee.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(la,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Oa,{mode:"single",selected:(ve=ee.dateRange)==null?void 0:ve.from,onSelect:ge=>{var Ue;return A("timestamp",{from:ge,to:(Ue=ee.dateRange)==null?void 0:Ue.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(ga,{children:[a.jsx(xa,{asChild:!0,children:a.jsxs(q,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(Oc,{className:"mr-1 h-3 w-3"}),(Ne=ee.dateRange)!=null&&Ne.to?In(ee.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(la,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Oa,{mode:"single",selected:(Ee=ee.dateRange)==null?void 0:Ee.to,onSelect:ge=>{var Ue;return A("timestamp",{from:(Ue=ee.dateRange)==null?void 0:Ue.from,to:ge})},initialFocus:!0,disabled:ge=>{var Ue;return(Ue=ee.dateRange)!=null&&Ue.from?ge<ee.dateRange.from:!1},className:"rounded-none"})})]})]}),ee.type==="eventType"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono uppercase text-gray-400",children:"Event Types:"}),a.jsxs(ga,{children:[a.jsx(xa,{asChild:!0,children:a.jsx(q,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:ee.eventTypes&&ee.eventTypes.length>0?`${ee.eventTypes.length} selected`:"Select types"})}),a.jsx(la,{className:"w-auto p-0 bg-black border-white/10 max-h-[400px] overflow-y-auto",children:a.jsxs("div",{className:"p-3 space-y-2 min-w-[250px]",children:[a.jsx("div",{className:"text-xs font-mono uppercase text-gray-400 mb-2 px-2",children:"Select Event Types"}),a.jsx("div",{className:"space-y-1",children:qfe.map(ge=>{var He;const Ue=((He=ee.eventTypes)==null?void 0:He.includes(ge))||!1;return a.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-white/5 cursor-pointer rounded-none",children:[a.jsx(ru,{checked:Ue,onCheckedChange:()=>z("eventType",ge),className:"border-white/20 data-[state=checked]:bg-white data-[state=checked]:border-white"}),a.jsx("span",{className:"text-xs font-mono text-white",children:ge})]},ge)})})]})})]})]}),a.jsx("button",{onClick:()=>T(ee.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(ln,{className:"w-3 h-3 text-white"})})]},ee.type)})})]}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Event"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Type"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Timestamp"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-mono uppercase text-xs",children:"Actions"})]})}),a.jsx("tbody",{children:$.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"py-8 text-center text-gray-400",children:"No events found"})}):$.map(ee=>{var Ue,He;const ue=v.has(ee.id),ve=((Ue=ee.display)==null?void 0:Ue.severity)||"info",Ne=ee.status||"success",Ee=Ne==="success"&&ve!=="failed",ge=Ne==="failed"||ve==="failed";return a.jsxs("tr",{onClick:()=>L(ee),className:`border-b border-dashed border-white/5 hover:bg-white/5 transition-all cursor-pointer ${ue?Ee?"new-event-row bg-green-400/10 border-green-400/20":ge?"new-event-row bg-red-400/10 border-red-400/20":"":""}`,children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:`w-10 h-10 rounded-none border border-dashed flex items-center justify-center relative overflow-hidden group ${mO(ve,Ne)}`,children:[Ee&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-5 group-hover:opacity-[8%] transition-opacity",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.3) 1px, transparent 1px, transparent 4px)"}}),ge&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-5 group-hover:opacity-[8%] transition-opacity",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.3) 1px, transparent 1px, transparent 4px)"}}),a.jsx("div",{className:"relative z-10",children:gO(ee.type,ve,Ne)})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:((He=ee.display)==null?void 0:He.message)||ee.type}),a.jsx(_t,{id:ee.id})]})]})}),a.jsx("td",{className:"py-4 px-4",children:a.jsx("span",{className:"text-xs font-mono text-gray-400 uppercase",children:ee.type})}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:`w-px h-5 rounded-none ${Ne==="success"?"bg-green-400":"bg-red-400"}`}),a.jsx("span",{className:"text-xs font-mono uppercase text-gray-400",children:Ne})]})}),a.jsx("td",{className:"py-4 px-4",children:ee.userId?a.jsxs("button",{onClick:ie=>{ie.stopPropagation(),e(`/users/${ee.userId}`)},className:"underline underline-offset-4 decoration-dashed hover:underline font-mono text-xs transition-colors",children:[ee.userId.slice(0,8),"..."]}):a.jsx("span",{className:"text-gray-500",children:"—"})}),a.jsx("td",{className:"py-4 px-4 text-xs text-gray-400",children:a.jsxs("div",{className:"flex font-mono uppercase flex-col",children:[new Date(ee.timestamp).toLocaleString(),a.jsx("p",{className:"text-xs",children:new Date(ee.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx(q,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:ie=>{ie.stopPropagation(),L(ee)},children:a.jsx(ds,{className:"w-4 h-4"})})})]},ee.id)})})]})})}),u&&d&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none w-full max-w-2xl p-6 shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"flex flex-col gap-2",children:a.jsxs("h3",{className:"text-lg text-white font-light font-mono",children:[a.jsx("span",{className:"uppercase",children:"Event Details"}),a.jsx(_t,{id:d.id,variant:"subscript",nonSliced:!0})]})}),a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>h(!1),className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ln,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-6 mt-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:`w-14 h-14 rounded-none border border-dashed flex items-center justify-center relative overflow-hidden ${mO((Q=d.display)==null?void 0:Q.severity,d.status)}`,children:[d.status==="success"&&((J=d.display)==null?void 0:J.severity)!=="failed"&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[8%]",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.3) 1px, transparent 1px, transparent 4px)"}}),(d.status==="failed"||((K=d.display)==null?void 0:K.severity)==="failed")&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[8%]",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.3) 1px, transparent 1px, transparent 4px)"}}),a.jsx("div",{className:"relative z-10",children:gO(d.type,(re=d.display)==null?void 0:re.severity,d.status)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-white font-medium leading-tight",children:((oe=d.display)==null?void 0:oe.message)||d.type}),a.jsx("div",{className:"text-sm text-gray-400 font-mono uppercase",children:d.type})]})]}),a.jsxs("div",{className:"space-y-2 text-sm",children:[[{label:"Status",value:(d.status||"success").toUpperCase()},{label:"Severity",value:(((he=d.display)==null?void 0:he.severity)||"info").toUpperCase()},{label:"Timestamp",value:Gfe(d.timestamp)},{label:"Source",value:(d.source||"app").toUpperCase()},d.userId&&{label:"User ID",value:d.userId},d.sessionId&&{label:"Session ID",value:d.sessionId},d.organizationId&&{label:"Organization ID",value:d.organizationId},d.ipAddress&&{label:"IP Address",value:d.ipAddress},d.userAgent&&{label:"User Agent",value:d.userAgent}].filter(ee=>!!ee).map(ee=>a.jsxs("div",{className:"flex items-center justify-between border border-dashed border-white/15 bg-black/90 px-3 py-2 rounded-none",children:[a.jsx("div",{className:"text-[11px] font-mono font-light uppercase tracking-wide text-gray-400",children:ee.label}),a.jsx("div",{className:"text-[10px] font-mono uppercase text-white text-right break-words max-w-[60%]",children:ee.value})]},ee.label)),d.metadata&&Object.keys(d.metadata).length>0&&a.jsxs("div",{className:"mt-4",children:[a.jsx("div",{className:"text-[11px] font-mono font-light uppercase tracking-wide text-gray-400 mb-2",children:"Metadata"}),a.jsx("div",{className:"border border-dashed border-white/15 bg-black/90 px-3 py-2 rounded-none",children:a.jsx("pre",{className:"text-[10px] font-mono text-white overflow-x-auto",children:JSON.stringify(d.metadata,null,2)})})]})]})]}),a.jsx("div",{className:"flex justify-end mt-8",children:a.jsx(q,{onClick:()=>h(!1),className:"border border-white/20 bg-white text-black hover:bg-white/90 rounded-none font-mono uppercase text-xs tracking-tight",children:"Close"})})]})}),a.jsx("style",{children:`
|
|
962
|
+
});`,language:"typescript",fileName:"studio.config.ts",className:"w-full"})]})]})})]}):r&&t.length===0?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(ya,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading events..."})]})}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Events",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-sm",children:t.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Real-time authentication events and activity"})]})}),a.jsxs("div",{className:"flex items-center justify-between gap-8 py-4 px-6 bg-gradient-to-b from-white/[4%] to-white/[2.5%] border border-white/10 rounded-none overflow-x-auto relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0 ",children:a.jsx(zi,{className:"w-5 h-5 text-green-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Success"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.success})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(ZN,{className:"w-5 h-5 text-red-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Failed"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.failed})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(LU,{className:"w-5 h-5 text-yellow-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Warning"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.warning})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(Iae,{className:"w-5 h-5 text-blue-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Info"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.info})]})]})]}),t.length>0&&a.jsxs("div",{className:"bg-gradient-to-b from-white/[4%] to-white/[2.5%] border border-white/10 rounded-none p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("h3",{className:"text-sm text-white uppercase font-light mb-6",children:"Event Distribution"}),(()=>{const ee=[...t].sort((Re,Be)=>new Date(Re.timestamp).getTime()-new Date(Be.timestamp).getTime()),ue=ee[0],ve=ee[ee.length-1],Ee=(new Date(ve.timestamp).getTime()-new Date(ue.timestamp).getTime())/(1e3*60*60*24);let ge="hour",Ue=[],He=[];if(Ee<=1)ge="hour",Ue=Array.from({length:24},(Re,Be)=>Be.toString()),He=Array.from({length:24},(Re,Be)=>Be%4===0?`${Be.toString().padStart(2,"0")}:00`:"");else if(Ee<=7){ge="day";const Re=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Ue=Array.from({length:7},(Be,Ye)=>Ye.toString()),He=Re}else if(Ee<=30){ge="week";const Re=new Date(ue.timestamp),Be=new Date(ve.timestamp),Ye=[],ot=[],tt=new Date(Re);tt.setHours(0,0,0,0);const wt=tt.getDay();tt.setDate(tt.getDate()-wt);let Ut=1;for(;tt<=Be;){const Bt=In(tt,"yyyy-MM-dd");Ye.push(Bt),ot.push(`Week ${Ut}`),tt.setDate(tt.getDate()+7),Ut++}Ue=Ye,He=ot}else{ge="month";const Re=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Ue=Array.from({length:12},(Be,Ye)=>Ye.toString()),He=Re}const ie={};Ue.forEach(Re=>{ie[Re]={success:0,failed:0,warning:0,info:0}}),t.forEach(Re=>{var ot;const Be=new Date(Re.timestamp);let Ye="";if(ge==="hour")Ye=Be.getHours().toString();else if(ge==="day")Ye=Be.getDay().toString();else if(ge==="week"){const tt=new Date(Be);tt.setHours(0,0,0,0);const wt=tt.getDay();tt.setDate(tt.getDate()-wt),Ye=In(tt,"yyyy-MM-dd")}else Ye=Be.getMonth().toString();if(ie[Ye]){const tt=Re.status||"success",wt=((ot=Re.display)==null?void 0:ot.severity)||"info";tt==="success"&&wt!=="failed"?ie[Ye].success++:tt==="failed"||wt==="failed"?ie[Ye].failed++:wt==="warning"?ie[Ye].warning++:(wt==="info"||!wt)&&ie[Ye].info++}});const Me=Object.values(ie).map(Re=>Re.success+Re.failed+Re.warning+Re.info),Ie=Math.max(...Me,1),Ae=Math.ceil(Ie/5),ct=Ae*5,Je=Array.from({length:6},(Re,Be)=>ct-Ae*Be);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsx("div",{className:"flex flex-col justify-between h-48 text-xs text-gray-500 font-mono pt-0.5 pb-0.5",children:Je.map((Re,Be)=>a.jsx("span",{className:"leading-none",children:Math.round(Re)},Be))}),a.jsxs("div",{className:"flex-1 h-48 relative",children:[a.jsx("div",{className:"absolute inset-0 flex flex-col justify-between z-0",children:[0,1,2,3,4,5].map(Re=>a.jsx("div",{className:"w-full h-px bg-white/10",style:{opacity:.3}},Re))}),a.jsx("div",{className:"h-48 flex items-end justify-between space-x-1 relative z-10",children:Ue.map((Re,Be)=>{const Ye=ie[Re]||{success:0,failed:0,warning:0,info:0},ot=Ye.success+Ye.failed+Ye.warning+Ye.info,tt=ot>0?ot/ct*100:0,wt=ot>0?Ye.success/ot*100:0,Ut=ot>0?Ye.failed/ot*100:0,Bt=ot>0?Ye.warning/ot*100:0,vn=ot>0?Ye.info/ot*100:0;return a.jsxs("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group flex flex-col-reverse border border-dashed border-white/20",style:{height:`${tt}%`,minHeight:ot>0?"2px":"0"},onMouseEnter:le=>{const Ce=le.currentTarget.getBoundingClientRect(),st=Ce.left+Ce.width/2,et=Ce.top,Fe=240,Xe=120,De=Math.max(Fe/2,Math.min(window.innerWidth-Fe/2,st)),rt=Math.max(Xe+10,Math.min(window.innerHeight-10,et));O(Be),I({x:De,y:rt})},onMouseLeave:()=>{O(null),I(null)},children:[Ye.success>0&&a.jsx("div",{className:"w-full relative",style:{height:`${wt}%`,backgroundColor:"rgba(34, 197, 94, 0.05)",minHeight:Ye.success>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})}),Ye.failed>0&&a.jsx("div",{className:"w-full relative",style:{height:`${Ut}%`,backgroundColor:"rgba(239, 68, 68, 0.05)",minHeight:Ye.failed>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})}),Ye.warning>0&&a.jsx("div",{className:"w-full relative",style:{height:`${Bt}%`,backgroundColor:"rgba(234, 179, 8, 0.05)",minHeight:Ye.warning>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})}),Ye.info>0&&a.jsx("div",{className:"w-full relative",style:{height:`${vn}%`,backgroundColor:"rgba(59, 130, 246, 0.05)",minHeight:Ye.info>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})})]},Re)})}),U!==null&&W&&(()=>{const Re=Ue[U],Be=ie[Re]||{success:0,failed:0,warning:0,info:0},Ye=Be.success+Be.failed+Be.warning+Be.info;let ot=He[U]||"";const tt={Sun:"Sunday",Mon:"Monday",Tue:"Tuesday",Wed:"Wednesday",Thu:"Thursday",Fri:"Friday",Sat:"Saturday"},wt={Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"};return tt[ot]?ot=tt[ot]:wt[ot]&&(ot=wt[ot]),a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${W.x}px`,top:`${W.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border overflow-x-hidden border-white/20 rounded-sm px-4 py-3 shadow-lg min-w-[150px]",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-3 font-mono uppercase",children:ot}),a.jsxs("div",{className:"flex flex-col items-center justify-center my-1 mb-1.5",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-1.5 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-white font-mono font-medium",children:"Total"}),a.jsx("span",{className:"text-sm text-white font-mono",children:Ye})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"}),Be.success>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Success"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#22c55e"},children:Be.success})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"})]}),Be.failed>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Failed"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#ef4444"},children:Be.failed})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"})]}),Be.warning>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Warning"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#eab308"},children:Be.warning})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"})]}),Be.info>0&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Info"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#3b82f6"},children:Be.info})]})]})]})})})()]})]}),a.jsx("div",{className:"flex justify-between text-xs text-gray-500 font-mono mt-2",children:He.map((Re,Be)=>a.jsx("span",{className:"flex-1 text-center truncate",children:Re||""},`${Re}-${Be}`))})]})})()]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(ao,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(we,{placeholder:"Search events...",value:i,onChange:ee=>o(ee.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex w-[130px] items-center space-x-2",children:a.jsxs(Tn,{value:l,className:"w-full",onValueChange:c,children:[a.jsx(Cn,{className:"w-full font-mono uppercase sm:text-[11px] border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsx(Jn,{})}),a.jsxs(kn,{className:"font-mono uppercase text-[11px]",children:[a.jsx(qe,{value:"all",children:"All Events"}),a.jsx(qe,{value:"success",children:"Success"}),a.jsx(qe,{value:"failed",children:"Failed"}),a.jsx(qe,{value:"info",children:"Info"}),a.jsx(qe,{value:"warning",children:"Warning"})]})]})}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(Tn,{value:"",onValueChange:H,children:[a.jsx(Cn,{className:"w-[120px] font-mono uppercase sm:text-[11px] border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(gm,{className:"w-4 h-4 text-gray-400"}),a.jsx(Jn,{placeholder:"Add Filter",className:"pr-2"})]})}),a.jsxs(kn,{className:"font-mono uppercase text-[11px]",children:[!F.some(ee=>ee.type==="timestamp")&&a.jsx(qe,{value:"timestamp",children:"Date Range"}),!F.some(ee=>ee.type==="eventType")&&a.jsx(qe,{value:"eventType",children:"Event Type"})]})]})})]}),F.length>0&&a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:F.map(ee=>{var ue,ve,Ne,Ee;return a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-black/50 border border-dashed border-white/20 rounded-none",children:[ee.type==="timestamp"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono uppercase text-gray-400",children:"Date:"}),a.jsxs(ga,{children:[a.jsx(xa,{asChild:!0,children:a.jsxs(q,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(Oc,{className:"mr-1 h-3 w-3"}),(ue=ee.dateRange)!=null&&ue.from?In(ee.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(la,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Oa,{mode:"single",selected:(ve=ee.dateRange)==null?void 0:ve.from,onSelect:ge=>{var Ue;return A("timestamp",{from:ge,to:(Ue=ee.dateRange)==null?void 0:Ue.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(ga,{children:[a.jsx(xa,{asChild:!0,children:a.jsxs(q,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(Oc,{className:"mr-1 h-3 w-3"}),(Ne=ee.dateRange)!=null&&Ne.to?In(ee.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(la,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Oa,{mode:"single",selected:(Ee=ee.dateRange)==null?void 0:Ee.to,onSelect:ge=>{var Ue;return A("timestamp",{from:(Ue=ee.dateRange)==null?void 0:Ue.from,to:ge})},initialFocus:!0,disabled:ge=>{var Ue;return(Ue=ee.dateRange)!=null&&Ue.from?ge<ee.dateRange.from:!1},className:"rounded-none"})})]})]}),ee.type==="eventType"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono uppercase text-gray-400",children:"Event Types:"}),a.jsxs(ga,{children:[a.jsx(xa,{asChild:!0,children:a.jsx(q,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:ee.eventTypes&&ee.eventTypes.length>0?`${ee.eventTypes.length} selected`:"Select types"})}),a.jsx(la,{className:"w-auto p-0 bg-black border-white/10 max-h-[400px] overflow-y-auto",children:a.jsxs("div",{className:"p-3 space-y-2 min-w-[250px]",children:[a.jsx("div",{className:"text-xs font-mono uppercase text-gray-400 mb-2 px-2",children:"Select Event Types"}),a.jsx("div",{className:"space-y-1",children:qfe.map(ge=>{var He;const Ue=((He=ee.eventTypes)==null?void 0:He.includes(ge))||!1;return a.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-white/5 cursor-pointer rounded-none",children:[a.jsx(ru,{checked:Ue,onCheckedChange:()=>z("eventType",ge),className:"border-white/20 data-[state=checked]:bg-white data-[state=checked]:border-white"}),a.jsx("span",{className:"text-xs font-mono text-white",children:ge})]},ge)})})]})})]})]}),a.jsx("button",{onClick:()=>T(ee.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(ln,{className:"w-3 h-3 text-white"})})]},ee.type)})})]}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Event"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Type"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Timestamp"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-mono uppercase text-xs",children:"Actions"})]})}),a.jsx("tbody",{children:$.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"py-8 text-center text-gray-400",children:"No events found"})}):$.map(ee=>{var Ue,He;const ue=v.has(ee.id),ve=((Ue=ee.display)==null?void 0:Ue.severity)||"info",Ne=ee.status||"success",Ee=Ne==="success"&&ve!=="failed",ge=Ne==="failed"||ve==="failed";return a.jsxs("tr",{onClick:()=>L(ee),className:`border-b border-dashed border-white/5 hover:bg-white/5 transition-all cursor-pointer ${ue?Ee?"new-event-row bg-green-400/10 border-green-400/20":ge?"new-event-row bg-red-400/10 border-red-400/20":"":""}`,children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:`w-10 h-10 rounded-none border border-dashed flex items-center justify-center relative overflow-hidden group ${mO(ve,Ne)}`,children:[Ee&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-5 group-hover:opacity-[8%] transition-opacity",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.3) 1px, transparent 1px, transparent 4px)"}}),ge&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-5 group-hover:opacity-[8%] transition-opacity",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.3) 1px, transparent 1px, transparent 4px)"}}),a.jsx("div",{className:"relative z-10",children:gO(ee.type,ve,Ne)})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:((He=ee.display)==null?void 0:He.message)||ee.type}),a.jsx(_t,{id:ee.id})]})]})}),a.jsx("td",{className:"py-4 px-4",children:a.jsx("span",{className:"text-xs font-mono text-gray-400 uppercase",children:ee.type})}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:`w-px h-5 rounded-none ${Ne==="success"?"bg-green-400":"bg-red-400"}`}),a.jsx("span",{className:"text-xs font-mono uppercase text-gray-400",children:Ne})]})}),a.jsx("td",{className:"py-4 px-4",children:ee.userId?a.jsxs("button",{onClick:ie=>{ie.stopPropagation(),e(`/users/${ee.userId}`)},className:"underline underline-offset-4 decoration-dashed hover:underline font-mono text-xs cursor-pointer transition-colors",children:[ee.userId.slice(0,8),"..."]}):a.jsx("span",{className:"text-gray-500",children:"—"})}),a.jsx("td",{className:"py-4 px-4 text-xs text-gray-400",children:a.jsxs("div",{className:"flex font-mono uppercase flex-col",children:[new Date(ee.timestamp).toLocaleString(),a.jsx("p",{className:"text-xs",children:new Date(ee.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx(q,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:ie=>{ie.stopPropagation(),L(ee)},children:a.jsx(ds,{className:"w-4 h-4"})})})]},ee.id)})})]})})}),u&&d&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none w-full max-w-2xl p-6 shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"flex flex-col gap-2",children:a.jsxs("h3",{className:"text-lg text-white font-light font-mono",children:[a.jsx("span",{className:"uppercase",children:"Event Details"}),a.jsx(_t,{id:d.id,variant:"subscript",nonSliced:!0})]})}),a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>h(!1),className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ln,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-6 mt-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:`w-14 h-14 rounded-none border border-dashed flex items-center justify-center relative overflow-hidden ${mO((Q=d.display)==null?void 0:Q.severity,d.status)}`,children:[d.status==="success"&&((J=d.display)==null?void 0:J.severity)!=="failed"&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[8%]",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.3) 1px, transparent 1px, transparent 4px)"}}),(d.status==="failed"||((K=d.display)==null?void 0:K.severity)==="failed")&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[8%]",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.3) 1px, transparent 1px, transparent 4px)"}}),a.jsx("div",{className:"relative z-10",children:gO(d.type,(re=d.display)==null?void 0:re.severity,d.status)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-white font-medium leading-tight",children:((oe=d.display)==null?void 0:oe.message)||d.type}),a.jsx("div",{className:"text-sm text-gray-400 font-mono uppercase",children:d.type})]})]}),a.jsxs("div",{className:"space-y-2 text-sm",children:[[{label:"Status",value:(d.status||"success").toUpperCase()},{label:"Severity",value:(((he=d.display)==null?void 0:he.severity)||"info").toUpperCase()},{label:"Timestamp",value:Gfe(d.timestamp)},{label:"Source",value:(d.source||"app").toUpperCase()},d.userId&&{label:"User ID",value:d.userId},d.sessionId&&{label:"Session ID",value:d.sessionId},d.organizationId&&{label:"Organization ID",value:d.organizationId},d.ipAddress&&{label:"IP Address",value:d.ipAddress},d.userAgent&&{label:"User Agent",value:d.userAgent}].filter(ee=>!!ee).map(ee=>a.jsxs("div",{className:"flex items-center justify-between border border-dashed border-white/15 bg-black/90 px-3 py-2 rounded-none",children:[a.jsx("div",{className:"text-[11px] font-mono font-light uppercase tracking-wide text-gray-400",children:ee.label}),a.jsx("div",{className:"text-[10px] font-mono uppercase text-white text-right break-words max-w-[60%]",children:ee.value})]},ee.label)),d.metadata&&Object.keys(d.metadata).length>0&&a.jsxs("div",{className:"mt-4",children:[a.jsx("div",{className:"text-[11px] font-mono font-light uppercase tracking-wide text-gray-400 mb-2",children:"Metadata"}),a.jsx("div",{className:"border border-dashed border-white/15 bg-black/90 px-3 py-2 rounded-none",children:a.jsx("pre",{className:"text-[10px] font-mono text-white overflow-x-auto",children:JSON.stringify(d.metadata,null,2)})})]})]})]}),a.jsx("div",{className:"flex justify-end mt-8",children:a.jsx(q,{onClick:()=>h(!1),className:"border border-white/20 bg-white text-black hover:bg-white/90 rounded-none font-mono uppercase text-xs tracking-tight",children:"Close"})})]})}),a.jsx("style",{children:`
|
|
963
963
|
@keyframes slideInFromTop {
|
|
964
964
|
from {
|
|
965
965
|
opacity: 0;
|
package/dist/public/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/png" href="/logo.png" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Better Auth Studio</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/main-
|
|
8
|
+
<script type="module" crossorigin src="/assets/main-DuWKYIyf.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/main-CEuuUcyk.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
|
@@ -959,7 +959,7 @@ export const auth = betterAuth({
|
|
|
959
959
|
},
|
|
960
960
|
}),
|
|
961
961
|
],
|
|
962
|
-
});`,language:"typescript",fileName:"studio.config.ts",className:"w-full"})]})]})})]}):r&&t.length===0?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(ya,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading events..."})]})}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Events",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-sm",children:t.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Real-time authentication events and activity"})]})}),a.jsxs("div",{className:"flex items-center justify-between gap-8 py-4 px-6 bg-gradient-to-b from-white/[4%] to-white/[2.5%] border border-white/10 rounded-none overflow-x-auto relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0 ",children:a.jsx(zi,{className:"w-5 h-5 text-green-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Success"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.success})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(ZN,{className:"w-5 h-5 text-red-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Failed"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.failed})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(LU,{className:"w-5 h-5 text-yellow-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Warning"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.warning})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(Iae,{className:"w-5 h-5 text-blue-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Info"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.info})]})]})]}),t.length>0&&a.jsxs("div",{className:"bg-gradient-to-b from-white/[4%] to-white/[2.5%] border border-white/10 rounded-none p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("h3",{className:"text-sm text-white uppercase font-light mb-6",children:"Event Distribution"}),(()=>{const ee=[...t].sort((Re,Be)=>new Date(Re.timestamp).getTime()-new Date(Be.timestamp).getTime()),ue=ee[0],ve=ee[ee.length-1],Ee=(new Date(ve.timestamp).getTime()-new Date(ue.timestamp).getTime())/(1e3*60*60*24);let ge="hour",Ue=[],He=[];if(Ee<=1)ge="hour",Ue=Array.from({length:24},(Re,Be)=>Be.toString()),He=Array.from({length:24},(Re,Be)=>Be%4===0?`${Be.toString().padStart(2,"0")}:00`:"");else if(Ee<=7){ge="day";const Re=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Ue=Array.from({length:7},(Be,Ye)=>Ye.toString()),He=Re}else if(Ee<=30){ge="week";const Re=new Date(ue.timestamp),Be=new Date(ve.timestamp),Ye=[],ot=[],tt=new Date(Re);tt.setHours(0,0,0,0);const wt=tt.getDay();tt.setDate(tt.getDate()-wt);let Ut=1;for(;tt<=Be;){const Bt=In(tt,"yyyy-MM-dd");Ye.push(Bt),ot.push(`Week ${Ut}`),tt.setDate(tt.getDate()+7),Ut++}Ue=Ye,He=ot}else{ge="month";const Re=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Ue=Array.from({length:12},(Be,Ye)=>Ye.toString()),He=Re}const ie={};Ue.forEach(Re=>{ie[Re]={success:0,failed:0,warning:0,info:0}}),t.forEach(Re=>{var ot;const Be=new Date(Re.timestamp);let Ye="";if(ge==="hour")Ye=Be.getHours().toString();else if(ge==="day")Ye=Be.getDay().toString();else if(ge==="week"){const tt=new Date(Be);tt.setHours(0,0,0,0);const wt=tt.getDay();tt.setDate(tt.getDate()-wt),Ye=In(tt,"yyyy-MM-dd")}else Ye=Be.getMonth().toString();if(ie[Ye]){const tt=Re.status||"success",wt=((ot=Re.display)==null?void 0:ot.severity)||"info";tt==="success"&&wt!=="failed"?ie[Ye].success++:tt==="failed"||wt==="failed"?ie[Ye].failed++:wt==="warning"?ie[Ye].warning++:(wt==="info"||!wt)&&ie[Ye].info++}});const Me=Object.values(ie).map(Re=>Re.success+Re.failed+Re.warning+Re.info),Ie=Math.max(...Me,1),Ae=Math.ceil(Ie/5),ct=Ae*5,Je=Array.from({length:6},(Re,Be)=>ct-Ae*Be);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsx("div",{className:"flex flex-col justify-between h-48 text-xs text-gray-500 font-mono pt-0.5 pb-0.5",children:Je.map((Re,Be)=>a.jsx("span",{className:"leading-none",children:Math.round(Re)},Be))}),a.jsxs("div",{className:"flex-1 h-48 relative",children:[a.jsx("div",{className:"absolute inset-0 flex flex-col justify-between z-0",children:[0,1,2,3,4,5].map(Re=>a.jsx("div",{className:"w-full h-px bg-white/10",style:{opacity:.3}},Re))}),a.jsx("div",{className:"h-48 flex items-end justify-between space-x-1 relative z-10",children:Ue.map((Re,Be)=>{const Ye=ie[Re]||{success:0,failed:0,warning:0,info:0},ot=Ye.success+Ye.failed+Ye.warning+Ye.info,tt=ot>0?ot/ct*100:0,wt=ot>0?Ye.success/ot*100:0,Ut=ot>0?Ye.failed/ot*100:0,Bt=ot>0?Ye.warning/ot*100:0,vn=ot>0?Ye.info/ot*100:0;return a.jsxs("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group flex flex-col-reverse border border-dashed border-white/20",style:{height:`${tt}%`,minHeight:ot>0?"2px":"0"},onMouseEnter:le=>{const Ce=le.currentTarget.getBoundingClientRect(),st=Ce.left+Ce.width/2,et=Ce.top,Fe=240,Xe=120,De=Math.max(Fe/2,Math.min(window.innerWidth-Fe/2,st)),rt=Math.max(Xe+10,Math.min(window.innerHeight-10,et));O(Be),I({x:De,y:rt})},onMouseLeave:()=>{O(null),I(null)},children:[Ye.success>0&&a.jsx("div",{className:"w-full relative",style:{height:`${wt}%`,backgroundColor:"rgba(34, 197, 94, 0.05)",minHeight:Ye.success>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})}),Ye.failed>0&&a.jsx("div",{className:"w-full relative",style:{height:`${Ut}%`,backgroundColor:"rgba(239, 68, 68, 0.05)",minHeight:Ye.failed>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})}),Ye.warning>0&&a.jsx("div",{className:"w-full relative",style:{height:`${Bt}%`,backgroundColor:"rgba(234, 179, 8, 0.05)",minHeight:Ye.warning>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})}),Ye.info>0&&a.jsx("div",{className:"w-full relative",style:{height:`${vn}%`,backgroundColor:"rgba(59, 130, 246, 0.05)",minHeight:Ye.info>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})})]},Re)})}),U!==null&&W&&(()=>{const Re=Ue[U],Be=ie[Re]||{success:0,failed:0,warning:0,info:0},Ye=Be.success+Be.failed+Be.warning+Be.info;let ot=He[U]||"";const tt={Sun:"Sunday",Mon:"Monday",Tue:"Tuesday",Wed:"Wednesday",Thu:"Thursday",Fri:"Friday",Sat:"Saturday"},wt={Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"};return tt[ot]?ot=tt[ot]:wt[ot]&&(ot=wt[ot]),a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${W.x}px`,top:`${W.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border overflow-x-hidden border-white/20 rounded-sm px-4 py-3 shadow-lg min-w-[150px]",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-3 font-mono uppercase",children:ot}),a.jsxs("div",{className:"flex flex-col items-center justify-center my-1 mb-1.5",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-1.5 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-white font-mono font-medium",children:"Total"}),a.jsx("span",{className:"text-sm text-white font-mono",children:Ye})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"}),Be.success>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Success"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#22c55e"},children:Be.success})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"})]}),Be.failed>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Failed"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#ef4444"},children:Be.failed})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"})]}),Be.warning>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Warning"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#eab308"},children:Be.warning})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"})]}),Be.info>0&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Info"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#3b82f6"},children:Be.info})]})]})]})})})()]})]}),a.jsx("div",{className:"flex justify-between text-xs text-gray-500 font-mono mt-2",children:He.map((Re,Be)=>a.jsx("span",{className:"flex-1 text-center truncate",children:Re||""},`${Re}-${Be}`))})]})})()]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(ao,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(we,{placeholder:"Search events...",value:i,onChange:ee=>o(ee.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex w-[130px] items-center space-x-2",children:a.jsxs(Tn,{value:l,className:"w-full",onValueChange:c,children:[a.jsx(Cn,{className:"w-full font-mono uppercase sm:text-[11px] border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsx(Jn,{})}),a.jsxs(kn,{className:"font-mono uppercase text-[11px]",children:[a.jsx(qe,{value:"all",children:"All Events"}),a.jsx(qe,{value:"success",children:"Success"}),a.jsx(qe,{value:"failed",children:"Failed"}),a.jsx(qe,{value:"info",children:"Info"}),a.jsx(qe,{value:"warning",children:"Warning"})]})]})}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(Tn,{value:"",onValueChange:H,children:[a.jsx(Cn,{className:"w-[120px] font-mono uppercase sm:text-[11px] border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(gm,{className:"w-4 h-4 text-gray-400"}),a.jsx(Jn,{placeholder:"Add Filter",className:"pr-2"})]})}),a.jsxs(kn,{className:"font-mono uppercase text-[11px]",children:[!F.some(ee=>ee.type==="timestamp")&&a.jsx(qe,{value:"timestamp",children:"Date Range"}),!F.some(ee=>ee.type==="eventType")&&a.jsx(qe,{value:"eventType",children:"Event Type"})]})]})})]}),F.length>0&&a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:F.map(ee=>{var ue,ve,Ne,Ee;return a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-black/50 border border-dashed border-white/20 rounded-none",children:[ee.type==="timestamp"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono uppercase text-gray-400",children:"Date:"}),a.jsxs(ga,{children:[a.jsx(xa,{asChild:!0,children:a.jsxs(q,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(Oc,{className:"mr-1 h-3 w-3"}),(ue=ee.dateRange)!=null&&ue.from?In(ee.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(la,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Oa,{mode:"single",selected:(ve=ee.dateRange)==null?void 0:ve.from,onSelect:ge=>{var Ue;return A("timestamp",{from:ge,to:(Ue=ee.dateRange)==null?void 0:Ue.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(ga,{children:[a.jsx(xa,{asChild:!0,children:a.jsxs(q,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(Oc,{className:"mr-1 h-3 w-3"}),(Ne=ee.dateRange)!=null&&Ne.to?In(ee.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(la,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Oa,{mode:"single",selected:(Ee=ee.dateRange)==null?void 0:Ee.to,onSelect:ge=>{var Ue;return A("timestamp",{from:(Ue=ee.dateRange)==null?void 0:Ue.from,to:ge})},initialFocus:!0,disabled:ge=>{var Ue;return(Ue=ee.dateRange)!=null&&Ue.from?ge<ee.dateRange.from:!1},className:"rounded-none"})})]})]}),ee.type==="eventType"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono uppercase text-gray-400",children:"Event Types:"}),a.jsxs(ga,{children:[a.jsx(xa,{asChild:!0,children:a.jsx(q,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:ee.eventTypes&&ee.eventTypes.length>0?`${ee.eventTypes.length} selected`:"Select types"})}),a.jsx(la,{className:"w-auto p-0 bg-black border-white/10 max-h-[400px] overflow-y-auto",children:a.jsxs("div",{className:"p-3 space-y-2 min-w-[250px]",children:[a.jsx("div",{className:"text-xs font-mono uppercase text-gray-400 mb-2 px-2",children:"Select Event Types"}),a.jsx("div",{className:"space-y-1",children:qfe.map(ge=>{var He;const Ue=((He=ee.eventTypes)==null?void 0:He.includes(ge))||!1;return a.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-white/5 cursor-pointer rounded-none",children:[a.jsx(ru,{checked:Ue,onCheckedChange:()=>z("eventType",ge),className:"border-white/20 data-[state=checked]:bg-white data-[state=checked]:border-white"}),a.jsx("span",{className:"text-xs font-mono text-white",children:ge})]},ge)})})]})})]})]}),a.jsx("button",{onClick:()=>T(ee.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(ln,{className:"w-3 h-3 text-white"})})]},ee.type)})})]}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Event"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Type"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Timestamp"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-mono uppercase text-xs",children:"Actions"})]})}),a.jsx("tbody",{children:$.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"py-8 text-center text-gray-400",children:"No events found"})}):$.map(ee=>{var Ue,He;const ue=v.has(ee.id),ve=((Ue=ee.display)==null?void 0:Ue.severity)||"info",Ne=ee.status||"success",Ee=Ne==="success"&&ve!=="failed",ge=Ne==="failed"||ve==="failed";return a.jsxs("tr",{onClick:()=>L(ee),className:`border-b border-dashed border-white/5 hover:bg-white/5 transition-all cursor-pointer ${ue?Ee?"new-event-row bg-green-400/10 border-green-400/20":ge?"new-event-row bg-red-400/10 border-red-400/20":"":""}`,children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:`w-10 h-10 rounded-none border border-dashed flex items-center justify-center relative overflow-hidden group ${mO(ve,Ne)}`,children:[Ee&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-5 group-hover:opacity-[8%] transition-opacity",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.3) 1px, transparent 1px, transparent 4px)"}}),ge&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-5 group-hover:opacity-[8%] transition-opacity",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.3) 1px, transparent 1px, transparent 4px)"}}),a.jsx("div",{className:"relative z-10",children:gO(ee.type,ve,Ne)})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:((He=ee.display)==null?void 0:He.message)||ee.type}),a.jsx(_t,{id:ee.id})]})]})}),a.jsx("td",{className:"py-4 px-4",children:a.jsx("span",{className:"text-xs font-mono text-gray-400 uppercase",children:ee.type})}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:`w-px h-5 rounded-none ${Ne==="success"?"bg-green-400":"bg-red-400"}`}),a.jsx("span",{className:"text-xs font-mono uppercase text-gray-400",children:Ne})]})}),a.jsx("td",{className:"py-4 px-4",children:ee.userId?a.jsxs("button",{onClick:ie=>{ie.stopPropagation(),e(`/users/${ee.userId}`)},className:"underline underline-offset-4 decoration-dashed hover:underline font-mono text-xs transition-colors",children:[ee.userId.slice(0,8),"..."]}):a.jsx("span",{className:"text-gray-500",children:"—"})}),a.jsx("td",{className:"py-4 px-4 text-xs text-gray-400",children:a.jsxs("div",{className:"flex font-mono uppercase flex-col",children:[new Date(ee.timestamp).toLocaleString(),a.jsx("p",{className:"text-xs",children:new Date(ee.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx(q,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:ie=>{ie.stopPropagation(),L(ee)},children:a.jsx(ds,{className:"w-4 h-4"})})})]},ee.id)})})]})})}),u&&d&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none w-full max-w-2xl p-6 shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"flex flex-col gap-2",children:a.jsxs("h3",{className:"text-lg text-white font-light font-mono",children:[a.jsx("span",{className:"uppercase",children:"Event Details"}),a.jsx(_t,{id:d.id,variant:"subscript",nonSliced:!0})]})}),a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>h(!1),className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ln,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-6 mt-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:`w-14 h-14 rounded-none border border-dashed flex items-center justify-center relative overflow-hidden ${mO((Q=d.display)==null?void 0:Q.severity,d.status)}`,children:[d.status==="success"&&((J=d.display)==null?void 0:J.severity)!=="failed"&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[8%]",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.3) 1px, transparent 1px, transparent 4px)"}}),(d.status==="failed"||((K=d.display)==null?void 0:K.severity)==="failed")&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[8%]",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.3) 1px, transparent 1px, transparent 4px)"}}),a.jsx("div",{className:"relative z-10",children:gO(d.type,(re=d.display)==null?void 0:re.severity,d.status)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-white font-medium leading-tight",children:((oe=d.display)==null?void 0:oe.message)||d.type}),a.jsx("div",{className:"text-sm text-gray-400 font-mono uppercase",children:d.type})]})]}),a.jsxs("div",{className:"space-y-2 text-sm",children:[[{label:"Status",value:(d.status||"success").toUpperCase()},{label:"Severity",value:(((he=d.display)==null?void 0:he.severity)||"info").toUpperCase()},{label:"Timestamp",value:Gfe(d.timestamp)},{label:"Source",value:(d.source||"app").toUpperCase()},d.userId&&{label:"User ID",value:d.userId},d.sessionId&&{label:"Session ID",value:d.sessionId},d.organizationId&&{label:"Organization ID",value:d.organizationId},d.ipAddress&&{label:"IP Address",value:d.ipAddress},d.userAgent&&{label:"User Agent",value:d.userAgent}].filter(ee=>!!ee).map(ee=>a.jsxs("div",{className:"flex items-center justify-between border border-dashed border-white/15 bg-black/90 px-3 py-2 rounded-none",children:[a.jsx("div",{className:"text-[11px] font-mono font-light uppercase tracking-wide text-gray-400",children:ee.label}),a.jsx("div",{className:"text-[10px] font-mono uppercase text-white text-right break-words max-w-[60%]",children:ee.value})]},ee.label)),d.metadata&&Object.keys(d.metadata).length>0&&a.jsxs("div",{className:"mt-4",children:[a.jsx("div",{className:"text-[11px] font-mono font-light uppercase tracking-wide text-gray-400 mb-2",children:"Metadata"}),a.jsx("div",{className:"border border-dashed border-white/15 bg-black/90 px-3 py-2 rounded-none",children:a.jsx("pre",{className:"text-[10px] font-mono text-white overflow-x-auto",children:JSON.stringify(d.metadata,null,2)})})]})]})]}),a.jsx("div",{className:"flex justify-end mt-8",children:a.jsx(q,{onClick:()=>h(!1),className:"border border-white/20 bg-white text-black hover:bg-white/90 rounded-none font-mono uppercase text-xs tracking-tight",children:"Close"})})]})}),a.jsx("style",{children:`
|
|
962
|
+
});`,language:"typescript",fileName:"studio.config.ts",className:"w-full"})]})]})})]}):r&&t.length===0?a.jsx("div",{className:"flex items-center justify-center h-32",children:a.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[a.jsx(ya,{className:"w-6 h-6 text-white animate-spin"}),a.jsx("div",{className:"text-white text-sm",children:"Loading events..."})]})}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl relative text-white font-light inline-flex items-start",children:["Events",a.jsxs("sup",{className:"text-xs text-gray-500 ml-1 mt-0",children:[a.jsx("span",{className:"mr-1",children:"["}),a.jsx("span",{className:"text-white font-mono text-sm",children:t.length}),a.jsx("span",{className:"ml-1",children:"]"})]})]}),a.jsx("p",{className:"text-gray-400 mt-1 uppercase font-mono text-sm font-light",children:"Real-time authentication events and activity"})]})}),a.jsxs("div",{className:"flex items-center justify-between gap-8 py-4 px-6 bg-gradient-to-b from-white/[4%] to-white/[2.5%] border border-white/10 rounded-none overflow-x-auto relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0 ",children:a.jsx(zi,{className:"w-5 h-5 text-green-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Success"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.success})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(ZN,{className:"w-5 h-5 text-red-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Failed"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.failed})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(LU,{className:"w-5 h-5 text-yellow-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Warning"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.warning})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsxs("div",{className:"flex items-center gap-3 min-w-fit",children:[a.jsx("div",{className:"w-10 h-10 rounded-none bg-white/5 border border-dashed border-white/10 flex items-center justify-center flex-shrink-0",children:a.jsx(Iae,{className:"w-5 h-5 text-blue-400"})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400 text-sm uppercase tracking-wide",children:"Info"}),a.jsx("span",{className:"text-white text-lg font-medium",children:C.info})]})]})]}),t.length>0&&a.jsxs("div",{className:"bg-gradient-to-b from-white/[4%] to-white/[2.5%] border border-white/10 rounded-none p-6 relative",children:[a.jsx("div",{className:"absolute top-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute top-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[12px] h-[0.5px] bg-white/20"}),a.jsx("div",{className:"absolute bottom-0 right-0 w-[0.5px] h-[12px] bg-white/20"}),a.jsx("h3",{className:"text-sm text-white uppercase font-light mb-6",children:"Event Distribution"}),(()=>{const ee=[...t].sort((Re,Be)=>new Date(Re.timestamp).getTime()-new Date(Be.timestamp).getTime()),ue=ee[0],ve=ee[ee.length-1],Ee=(new Date(ve.timestamp).getTime()-new Date(ue.timestamp).getTime())/(1e3*60*60*24);let ge="hour",Ue=[],He=[];if(Ee<=1)ge="hour",Ue=Array.from({length:24},(Re,Be)=>Be.toString()),He=Array.from({length:24},(Re,Be)=>Be%4===0?`${Be.toString().padStart(2,"0")}:00`:"");else if(Ee<=7){ge="day";const Re=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Ue=Array.from({length:7},(Be,Ye)=>Ye.toString()),He=Re}else if(Ee<=30){ge="week";const Re=new Date(ue.timestamp),Be=new Date(ve.timestamp),Ye=[],ot=[],tt=new Date(Re);tt.setHours(0,0,0,0);const wt=tt.getDay();tt.setDate(tt.getDate()-wt);let Ut=1;for(;tt<=Be;){const Bt=In(tt,"yyyy-MM-dd");Ye.push(Bt),ot.push(`Week ${Ut}`),tt.setDate(tt.getDate()+7),Ut++}Ue=Ye,He=ot}else{ge="month";const Re=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Ue=Array.from({length:12},(Be,Ye)=>Ye.toString()),He=Re}const ie={};Ue.forEach(Re=>{ie[Re]={success:0,failed:0,warning:0,info:0}}),t.forEach(Re=>{var ot;const Be=new Date(Re.timestamp);let Ye="";if(ge==="hour")Ye=Be.getHours().toString();else if(ge==="day")Ye=Be.getDay().toString();else if(ge==="week"){const tt=new Date(Be);tt.setHours(0,0,0,0);const wt=tt.getDay();tt.setDate(tt.getDate()-wt),Ye=In(tt,"yyyy-MM-dd")}else Ye=Be.getMonth().toString();if(ie[Ye]){const tt=Re.status||"success",wt=((ot=Re.display)==null?void 0:ot.severity)||"info";tt==="success"&&wt!=="failed"?ie[Ye].success++:tt==="failed"||wt==="failed"?ie[Ye].failed++:wt==="warning"?ie[Ye].warning++:(wt==="info"||!wt)&&ie[Ye].info++}});const Me=Object.values(ie).map(Re=>Re.success+Re.failed+Re.warning+Re.info),Ie=Math.max(...Me,1),Ae=Math.ceil(Ie/5),ct=Ae*5,Je=Array.from({length:6},(Re,Be)=>ct-Ae*Be);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsx("div",{className:"flex flex-col justify-between h-48 text-xs text-gray-500 font-mono pt-0.5 pb-0.5",children:Je.map((Re,Be)=>a.jsx("span",{className:"leading-none",children:Math.round(Re)},Be))}),a.jsxs("div",{className:"flex-1 h-48 relative",children:[a.jsx("div",{className:"absolute inset-0 flex flex-col justify-between z-0",children:[0,1,2,3,4,5].map(Re=>a.jsx("div",{className:"w-full h-px bg-white/10",style:{opacity:.3}},Re))}),a.jsx("div",{className:"h-48 flex items-end justify-between space-x-1 relative z-10",children:Ue.map((Re,Be)=>{const Ye=ie[Re]||{success:0,failed:0,warning:0,info:0},ot=Ye.success+Ye.failed+Ye.warning+Ye.info,tt=ot>0?ot/ct*100:0,wt=ot>0?Ye.success/ot*100:0,Ut=ot>0?Ye.failed/ot*100:0,Bt=ot>0?Ye.warning/ot*100:0,vn=ot>0?Ye.info/ot*100:0;return a.jsxs("div",{className:"flex-1 transition-all duration-200 ease-out relative cursor-pointer group flex flex-col-reverse border border-dashed border-white/20",style:{height:`${tt}%`,minHeight:ot>0?"2px":"0"},onMouseEnter:le=>{const Ce=le.currentTarget.getBoundingClientRect(),st=Ce.left+Ce.width/2,et=Ce.top,Fe=240,Xe=120,De=Math.max(Fe/2,Math.min(window.innerWidth-Fe/2,st)),rt=Math.max(Xe+10,Math.min(window.innerHeight-10,et));O(Be),I({x:De,y:rt})},onMouseLeave:()=>{O(null),I(null)},children:[Ye.success>0&&a.jsx("div",{className:"w-full relative",style:{height:`${wt}%`,backgroundColor:"rgba(34, 197, 94, 0.05)",minHeight:Ye.success>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})}),Ye.failed>0&&a.jsx("div",{className:"w-full relative",style:{height:`${Ut}%`,backgroundColor:"rgba(239, 68, 68, 0.05)",minHeight:Ye.failed>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})}),Ye.warning>0&&a.jsx("div",{className:"w-full relative",style:{height:`${Bt}%`,backgroundColor:"rgba(234, 179, 8, 0.05)",minHeight:Ye.warning>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})}),Ye.info>0&&a.jsx("div",{className:"w-full relative",style:{height:`${vn}%`,backgroundColor:"rgba(59, 130, 246, 0.05)",minHeight:Ye.info>0?"1px":"0"},children:a.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"repeating-linear-gradient(-45deg, #ffffff, #ffffff 1px, transparent 1px, transparent 6px)",opacity:"0.07"}})})]},Re)})}),U!==null&&W&&(()=>{const Re=Ue[U],Be=ie[Re]||{success:0,failed:0,warning:0,info:0},Ye=Be.success+Be.failed+Be.warning+Be.info;let ot=He[U]||"";const tt={Sun:"Sunday",Mon:"Monday",Tue:"Tuesday",Wed:"Wednesday",Thu:"Thursday",Fri:"Friday",Sat:"Saturday"},wt={Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"};return tt[ot]?ot=tt[ot]:wt[ot]&&(ot=wt[ot]),a.jsx("div",{className:"fixed z-50 pointer-events-none transition-all duration-200 ease-out animate-in fade-in",style:{left:`${W.x}px`,top:`${W.y}px`,transform:"translate(-50%, -100%)",maxWidth:"calc(100vw - 20px)"},children:a.jsxs("div",{className:"bg-black border overflow-x-hidden border-white/20 rounded-sm px-4 py-3 shadow-lg min-w-[150px]",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-3 font-mono uppercase",children:ot}),a.jsxs("div",{className:"flex flex-col items-center justify-center my-1 mb-1.5",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-1.5 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-white font-mono font-medium",children:"Total"}),a.jsx("span",{className:"text-sm text-white font-mono",children:Ye})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"}),Be.success>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Success"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#22c55e"},children:Be.success})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"})]}),Be.failed>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Failed"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#ef4444"},children:Be.failed})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"})]}),Be.warning>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Warning"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#eab308"},children:Be.warning})]}),a.jsx("hr",{className:"border-t border-dashed border-white/10"})]}),Be.info>0&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-mono uppercase",children:"Info"}),a.jsx("span",{className:"text-xs font-mono",style:{color:"#3b82f6"},children:Be.info})]})]})]})})})()]})]}),a.jsx("div",{className:"flex justify-between text-xs text-gray-500 font-mono mt-2",children:He.map((Re,Be)=>a.jsx("span",{className:"flex-1 text-center truncate",children:Re||""},`${Re}-${Be}`))})]})})()]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"flex-1 relative",children:[a.jsx(ao,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(we,{placeholder:"Search events...",value:i,onChange:ee=>o(ee.target.value),className:"pl-10 border border-dashed border-white/20 bg-black/30 text-white rounded-none"})]}),a.jsx("div",{className:"flex w-[130px] items-center space-x-2",children:a.jsxs(Tn,{value:l,className:"w-full",onValueChange:c,children:[a.jsx(Cn,{className:"w-full font-mono uppercase sm:text-[11px] border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsx(Jn,{})}),a.jsxs(kn,{className:"font-mono uppercase text-[11px]",children:[a.jsx(qe,{value:"all",children:"All Events"}),a.jsx(qe,{value:"success",children:"Success"}),a.jsx(qe,{value:"failed",children:"Failed"}),a.jsx(qe,{value:"info",children:"Info"}),a.jsx(qe,{value:"warning",children:"Warning"})]})]})}),a.jsx("div",{className:"flex items-center space-x-2",children:a.jsxs(Tn,{value:"",onValueChange:H,children:[a.jsx(Cn,{className:"w-[120px] font-mono uppercase sm:text-[11px] border border-dashed border-white/20 bg-black/30 text-white rounded-none",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(gm,{className:"w-4 h-4 text-gray-400"}),a.jsx(Jn,{placeholder:"Add Filter",className:"pr-2"})]})}),a.jsxs(kn,{className:"font-mono uppercase text-[11px]",children:[!F.some(ee=>ee.type==="timestamp")&&a.jsx(qe,{value:"timestamp",children:"Date Range"}),!F.some(ee=>ee.type==="eventType")&&a.jsx(qe,{value:"eventType",children:"Event Type"})]})]})})]}),F.length>0&&a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:F.map(ee=>{var ue,ve,Ne,Ee;return a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-black/50 border border-dashed border-white/20 rounded-none",children:[ee.type==="timestamp"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono uppercase text-gray-400",children:"Date:"}),a.jsxs(ga,{children:[a.jsx(xa,{asChild:!0,children:a.jsxs(q,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(Oc,{className:"mr-1 h-3 w-3"}),(ue=ee.dateRange)!=null&&ue.from?In(ee.dateRange.from,"MMM dd yyyy"):"From"]})}),a.jsx(la,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Oa,{mode:"single",selected:(ve=ee.dateRange)==null?void 0:ve.from,onSelect:ge=>{var Ue;return A("timestamp",{from:ge,to:(Ue=ee.dateRange)==null?void 0:Ue.to})},initialFocus:!0,className:"rounded-none"})})]}),a.jsxs(ga,{children:[a.jsx(xa,{asChild:!0,children:a.jsxs(q,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:[a.jsx(Oc,{className:"mr-1 h-3 w-3"}),(Ne=ee.dateRange)!=null&&Ne.to?In(ee.dateRange.to,"MMM dd yyyy"):"To"]})}),a.jsx(la,{className:"w-auto p-0 bg-black border-white/10",children:a.jsx(Oa,{mode:"single",selected:(Ee=ee.dateRange)==null?void 0:Ee.to,onSelect:ge=>{var Ue;return A("timestamp",{from:(Ue=ee.dateRange)==null?void 0:Ue.from,to:ge})},initialFocus:!0,disabled:ge=>{var Ue;return(Ue=ee.dateRange)!=null&&Ue.from?ge<ee.dateRange.from:!1},className:"rounded-none"})})]})]}),ee.type==="eventType"&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono uppercase text-gray-400",children:"Event Types:"}),a.jsxs(ga,{children:[a.jsx(xa,{asChild:!0,children:a.jsx(q,{variant:"outline",className:"h-8 px-3 text-xs font-mono uppercase text-gray-400 hover:text-white bg-transparent border-white/10 hover:bg-white/5",children:ee.eventTypes&&ee.eventTypes.length>0?`${ee.eventTypes.length} selected`:"Select types"})}),a.jsx(la,{className:"w-auto p-0 bg-black border-white/10 max-h-[400px] overflow-y-auto",children:a.jsxs("div",{className:"p-3 space-y-2 min-w-[250px]",children:[a.jsx("div",{className:"text-xs font-mono uppercase text-gray-400 mb-2 px-2",children:"Select Event Types"}),a.jsx("div",{className:"space-y-1",children:qfe.map(ge=>{var He;const Ue=((He=ee.eventTypes)==null?void 0:He.includes(ge))||!1;return a.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-white/5 cursor-pointer rounded-none",children:[a.jsx(ru,{checked:Ue,onCheckedChange:()=>z("eventType",ge),className:"border-white/20 data-[state=checked]:bg-white data-[state=checked]:border-white"}),a.jsx("span",{className:"text-xs font-mono text-white",children:ge})]},ge)})})]})})]})]}),a.jsx("button",{onClick:()=>T(ee.type),className:"ml-1 hover:bg-white/20 rounded-full p-0.5",children:a.jsx(ln,{className:"w-3 h-3 text-white"})})]},ee.type)})})]}),a.jsx("div",{className:"bg-black/30 border border-dashed border-white/20 rounded-none",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-dashed border-white/10",children:[a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Event"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Type"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Status"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"User"}),a.jsx("th",{className:"text-left py-4 px-4 text-white font-mono uppercase text-xs",children:"Timestamp"}),a.jsx("th",{className:"text-right py-4 px-4 text-white font-mono uppercase text-xs",children:"Actions"})]})}),a.jsx("tbody",{children:$.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"py-8 text-center text-gray-400",children:"No events found"})}):$.map(ee=>{var Ue,He;const ue=v.has(ee.id),ve=((Ue=ee.display)==null?void 0:Ue.severity)||"info",Ne=ee.status||"success",Ee=Ne==="success"&&ve!=="failed",ge=Ne==="failed"||ve==="failed";return a.jsxs("tr",{onClick:()=>L(ee),className:`border-b border-dashed border-white/5 hover:bg-white/5 transition-all cursor-pointer ${ue?Ee?"new-event-row bg-green-400/10 border-green-400/20":ge?"new-event-row bg-red-400/10 border-red-400/20":"":""}`,children:[a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:`w-10 h-10 rounded-none border border-dashed flex items-center justify-center relative overflow-hidden group ${mO(ve,Ne)}`,children:[Ee&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-5 group-hover:opacity-[8%] transition-opacity",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.3) 1px, transparent 1px, transparent 4px)"}}),ge&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-5 group-hover:opacity-[8%] transition-opacity",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.3) 1px, transparent 1px, transparent 4px)"}}),a.jsx("div",{className:"relative z-10",children:gO(ee.type,ve,Ne)})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-light",children:((He=ee.display)==null?void 0:He.message)||ee.type}),a.jsx(_t,{id:ee.id})]})]})}),a.jsx("td",{className:"py-4 px-4",children:a.jsx("span",{className:"text-xs font-mono text-gray-400 uppercase",children:ee.type})}),a.jsx("td",{className:"py-4 px-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:`w-px h-5 rounded-none ${Ne==="success"?"bg-green-400":"bg-red-400"}`}),a.jsx("span",{className:"text-xs font-mono uppercase text-gray-400",children:Ne})]})}),a.jsx("td",{className:"py-4 px-4",children:ee.userId?a.jsxs("button",{onClick:ie=>{ie.stopPropagation(),e(`/users/${ee.userId}`)},className:"underline underline-offset-4 decoration-dashed hover:underline font-mono text-xs cursor-pointer transition-colors",children:[ee.userId.slice(0,8),"..."]}):a.jsx("span",{className:"text-gray-500",children:"—"})}),a.jsx("td",{className:"py-4 px-4 text-xs text-gray-400",children:a.jsxs("div",{className:"flex font-mono uppercase flex-col",children:[new Date(ee.timestamp).toLocaleString(),a.jsx("p",{className:"text-xs",children:new Date(ee.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})})]})}),a.jsx("td",{className:"py-4 px-4 text-right",children:a.jsx(q,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white rounded-none",onClick:ie=>{ie.stopPropagation(),L(ee)},children:a.jsx(ds,{className:"w-4 h-4"})})})]},ee.id)})})]})})}),u&&d&&a.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-black border border-white/15 rounded-none w-full max-w-2xl p-6 shadow-2xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"flex flex-col gap-2",children:a.jsxs("h3",{className:"text-lg text-white font-light font-mono",children:[a.jsx("span",{className:"uppercase",children:"Event Details"}),a.jsx(_t,{id:d.id,variant:"subscript",nonSliced:!0})]})}),a.jsx(q,{variant:"ghost",size:"sm",onClick:()=>h(!1),className:"text-gray-400 -mt-2 hover:text-white rounded-none",children:a.jsx(ln,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center mt-2",children:[a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"}),a.jsx("div",{className:"relative z-20 h-4 w-[calc(100%+3rem)] mx-auto -translate-x-1/2 left-1/2 bg-[repeating-linear-gradient(-45deg,#ffffff,#ffffff_1px,transparent_1px,transparent_6px)] opacity-[7%]"}),a.jsx("hr",{className:"w-[calc(100%+3rem)] border-white/10 h-px"})]}),a.jsxs("div",{className:"space-y-6 mt-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:`w-14 h-14 rounded-none border border-dashed flex items-center justify-center relative overflow-hidden ${mO((Q=d.display)==null?void 0:Q.severity,d.status)}`,children:[d.status==="success"&&((J=d.display)==null?void 0:J.severity)!=="failed"&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[8%]",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.3) 1px, transparent 1px, transparent 4px)"}}),(d.status==="failed"||((K=d.display)==null?void 0:K.severity)==="failed")&&a.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[8%]",style:{backgroundImage:"repeating-linear-gradient(0deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.3) 1px, transparent 1px, transparent 4px)"}}),a.jsx("div",{className:"relative z-10",children:gO(d.type,(re=d.display)==null?void 0:re.severity,d.status)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-white font-medium leading-tight",children:((oe=d.display)==null?void 0:oe.message)||d.type}),a.jsx("div",{className:"text-sm text-gray-400 font-mono uppercase",children:d.type})]})]}),a.jsxs("div",{className:"space-y-2 text-sm",children:[[{label:"Status",value:(d.status||"success").toUpperCase()},{label:"Severity",value:(((he=d.display)==null?void 0:he.severity)||"info").toUpperCase()},{label:"Timestamp",value:Gfe(d.timestamp)},{label:"Source",value:(d.source||"app").toUpperCase()},d.userId&&{label:"User ID",value:d.userId},d.sessionId&&{label:"Session ID",value:d.sessionId},d.organizationId&&{label:"Organization ID",value:d.organizationId},d.ipAddress&&{label:"IP Address",value:d.ipAddress},d.userAgent&&{label:"User Agent",value:d.userAgent}].filter(ee=>!!ee).map(ee=>a.jsxs("div",{className:"flex items-center justify-between border border-dashed border-white/15 bg-black/90 px-3 py-2 rounded-none",children:[a.jsx("div",{className:"text-[11px] font-mono font-light uppercase tracking-wide text-gray-400",children:ee.label}),a.jsx("div",{className:"text-[10px] font-mono uppercase text-white text-right break-words max-w-[60%]",children:ee.value})]},ee.label)),d.metadata&&Object.keys(d.metadata).length>0&&a.jsxs("div",{className:"mt-4",children:[a.jsx("div",{className:"text-[11px] font-mono font-light uppercase tracking-wide text-gray-400 mb-2",children:"Metadata"}),a.jsx("div",{className:"border border-dashed border-white/15 bg-black/90 px-3 py-2 rounded-none",children:a.jsx("pre",{className:"text-[10px] font-mono text-white overflow-x-auto",children:JSON.stringify(d.metadata,null,2)})})]})]})]}),a.jsx("div",{className:"flex justify-end mt-8",children:a.jsx(q,{onClick:()=>h(!1),className:"border border-white/20 bg-white text-black hover:bg-white/90 rounded-none font-mono uppercase text-xs tracking-tight",children:"Close"})})]})}),a.jsx("style",{children:`
|
|
963
963
|
@keyframes slideInFromTop {
|
|
964
964
|
from {
|
|
965
965
|
opacity: 0;
|
package/public/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/png" href="/logo.png" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Better Auth Studio</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/main-
|
|
8
|
+
<script type="module" crossorigin src="/assets/main-DuWKYIyf.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/main-CEuuUcyk.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|