From 6b59fdbd486ea3b987e97af1e5c4b3403a5c5ad9 Mon Sep 17 00:00:00 2001 From: Hasan Demirkiran
ce<=0)){var ue,q;const ce=(((ue=d.flip)==null?void 0:ue.index)||0)+1,ee=B[ce];if(ee&&(!(S==="alignment"?D!==Ft(ee):!1)||ne.every(L=>Ft(L.placement)===D?L.overflows[0]>0:!0)))return{data:{index:ce,overflows:ne},reset:{placement:ee}};let ie=(q=ne.filter(se=>se.overflows[0]<=0).sort((se,L)=>se.overflows[1]-L.overflows[1])[0])==null?void 0:q.placement;if(!ie)switch(k){case"bestFit":{var he;const se=(he=ne.filter(L=>{if(G){const Y=Ft(L.placement);return Y===D||Y==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(Y=>Y>0).reduce((Y,V)=>Y+V,0)]).sort((L,Y)=>L[1]-Y[1])[0])==null?void 0:he[0];se&&(ie=se);break}case"initialPlacement":ie=m;break}if(c!==ie)return{reset:{placement:ie}}}return{}}}};function Bf(n,i){return{top:n.top-i.height,right:n.right-i.width,bottom:n.bottom-i.height,left:n.left-i.width}}function Vf(n){return m0.some(i=>n[i]>=0)}const b0=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(i){const{rects:l,platform:a}=i,{strategy:c="referenceHidden",...d}=tn(n,i);switch(c){case"referenceHidden":{const f=await a.detectOverflow(i,{...d,elementContext:"reference"}),m=Bf(f,l.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Vf(m)}}}case"escaped":{const f=await a.detectOverflow(i,{...d,altBoundary:!0}),m=Bf(f,l.floating);return{data:{escapedOffsets:m,escaped:Vf(m)}}}default:return{}}}}},xm=new Set(["left","top"]);async function R0(n,i){const{placement:l,platform:a,elements:c}=n,d=await(a.isRTL==null?void 0:a.isRTL(c.floating)),f=nn(l),m=Tr(l),v=Ft(l)==="y",x=xm.has(f)?-1:1,y=d&&v?-1:1,S=tn(i,n);let{mainAxis:_,crossAxis:k,alignmentAxis:b}=typeof S=="number"?{mainAxis:S,crossAxis:0,alignmentAxis:null}:{mainAxis:S.mainAxis||0,crossAxis:S.crossAxis||0,alignmentAxis:S.alignmentAxis};return m&&typeof b=="number"&&(k=m==="end"?b*-1:b),v?{x:k*y,y:_*x}:{x:_*x,y:k*y}}const j0=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(i){var l,a;const{x:c,y:d,placement:f,middlewareData:m}=i,v=await R0(i,n);return f===((l=m.offset)==null?void 0:l.placement)&&(a=m.arrow)!=null&&a.alignmentOffset?{}:{x:c+v.x,y:d+v.y,data:{...v,placement:f}}}}},T0=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(i){const{x:l,y:a,placement:c,platform:d}=i,{mainAxis:f=!0,crossAxis:m=!1,limiter:v={fn:A=>{let{x:D,y:$}=A;return{x:D,y:$}}},...x}=tn(n,i),y={x:l,y:a},S=await d.detectOverflow(i,x),_=Ft(nn(c)),k=nu(_);let b=y[k],E=y[_];if(f){const A=k==="y"?"top":"left",D=k==="y"?"bottom":"right",$=b+S[A],M=b-S[D];b=$a($,b,M)}if(m){const A=_==="y"?"top":"left",D=_==="y"?"bottom":"right",$=E+S[A],M=E-S[D];E=$a($,E,M)}const j=v.fn({...i,[k]:b,[_]:E});return{...j,data:{x:j.x-l,y:j.y-a,enabled:{[k]:f,[_]:m}}}}}},O0=function(n){return n===void 0&&(n={}),{options:n,fn(i){const{x:l,y:a,placement:c,rects:d,middlewareData:f}=i,{offset:m=0,mainAxis:v=!0,crossAxis:x=!0}=tn(n,i),y={x:l,y:a},S=Ft(c),_=nu(S);let k=y[_],b=y[S];const E=tn(m,i),j=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(v){const $=_==="y"?"height":"width",M=d.reference[_]-d.floating[$]+j.mainAxis,U=d.reference[_]+d.reference[$]-j.mainAxis;kU&&(k=U)}if(x){var A,D;const $=_==="y"?"width":"height",M=xm.has(nn(c)),U=d.reference[S]-d.floating[$]+(M&&((A=f.offset)==null?void 0:A[S])||0)+(M?0:j.crossAxis),G=d.reference[S]+d.reference[$]+(M?0:((D=f.offset)==null?void 0:D[S])||0)-(M?j.crossAxis:0);bG&&(b=G)}return{[_]:k,[S]:b}}}},A0=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(i){var l,a;const{placement:c,rects:d,platform:f,elements:m}=i,{apply:v=()=>{},...x}=tn(n,i),y=await f.detectOverflow(i,x),S=nn(c),_=Tr(c),k=Ft(c)==="y",{width:b,height:E}=d.floating;let j,A;S==="top"||S==="bottom"?(j=S,A=_===(await(f.isRTL==null?void 0:f.isRTL(m.floating))?"start":"end")?"left":"right"):(A=S,j=_==="end"?"top":"bottom");const D=E-y.top-y.bottom,$=b-y.left-y.right,M=Pn(E-y[j],D),U=Pn(b-y[A],$),G=!i.middlewareData.shift;let B=M,le=U;if((l=i.middlewareData.shift)!=null&&l.enabled.x&&(le=$),(a=i.middlewareData.shift)!=null&&a.enabled.y&&(B=D),G&&!_){const ne=ft(y.left,0),ue=ft(y.right,0),q=ft(y.top,0),he=ft(y.bottom,0);k?le=b-2*(ne!==0||ue!==0?ne+ue:ft(y.left,y.right)):B=E-2*(q!==0||he!==0?q+he:ft(y.top,y.bottom))}await v({...i,availableWidth:le,availableHeight:B});const te=await f.getDimensions(m.floating);return b!==te.width||E!==te.height?{reset:{rects:!0}}:{}}}};function dl(){return typeof window<"u"}function Or(n){return wm(n)?(n.nodeName||"").toLowerCase():"#document"}function mt(n){var i;return(n==null||(i=n.ownerDocument)==null?void 0:i.defaultView)||window}function Ut(n){var i;return(i=(wm(n)?n.ownerDocument:n.document)||window.document)==null?void 0:i.documentElement}function wm(n){return dl()?n instanceof Node||n instanceof mt(n).Node:!1}function Rt(n){return dl()?n instanceof Element||n instanceof mt(n).Element:!1}function rn(n){return dl()?n instanceof HTMLElement||n instanceof mt(n).HTMLElement:!1}function Gf(n){return!dl()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof mt(n).ShadowRoot}function Po(n){const{overflow:i,overflowX:l,overflowY:a,display:c}=jt(n);return/auto|scroll|overlay|hidden|clip/.test(i+a+l)&&c!=="inline"&&c!=="contents"}function D0(n){return/^(table|td|th)$/.test(Or(n))}function fl(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const L0=/transform|translate|scale|rotate|perspective|filter/,M0=/paint|layout|strict|content/,Hn=n=>!!n&&n!=="none";let Ta;function iu(n){const i=Rt(n)?jt(n):n;return Hn(i.transform)||Hn(i.translate)||Hn(i.scale)||Hn(i.rotate)||Hn(i.perspective)||!lu()&&(Hn(i.backdropFilter)||Hn(i.filter))||L0.test(i.willChange||"")||M0.test(i.contain||"")}function I0(n){let i=bn(n);for(;rn(i)&&!Nr(i);){if(iu(i))return i;if(fl(i))return null;i=bn(i)}return null}function lu(){return Ta==null&&(Ta=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ta}function Nr(n){return/^(html|body|#document)$/.test(Or(n))}function jt(n){return mt(n).getComputedStyle(n)}function pl(n){return Rt(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function bn(n){if(Or(n)==="html")return n;const i=n.assignedSlot||n.parentNode||Gf(n)&&n.host||Ut(n);return Gf(i)?i.host:i}function Sm(n){const i=bn(n);return Nr(i)?n.ownerDocument?n.ownerDocument.body:n.body:rn(i)&&Po(i)?i:Sm(i)}function ko(n,i,l){var a;i===void 0&&(i=[]),l===void 0&&(l=!0);const c=Sm(n),d=c===((a=n.ownerDocument)==null?void 0:a.body),f=mt(c);if(d){const m=Ha(f);return i.concat(f,f.visualViewport||[],Po(c)?c:[],m&&l?ko(m):[])}else return i.concat(c,ko(c,[],l))}function Ha(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function _m(n){const i=jt(n);let l=parseFloat(i.width)||0,a=parseFloat(i.height)||0;const c=rn(n),d=c?n.offsetWidth:l,f=c?n.offsetHeight:a,m=Ji(l)!==d||Ji(a)!==f;return m&&(l=d,a=f),{width:l,height:a,$:m}}function su(n){return Rt(n)?n:n.contextElement}function Er(n){const i=su(n);if(!rn(i))return $t(1);const l=i.getBoundingClientRect(),{width:a,height:c,$:d}=_m(i);let f=(d?Ji(l.width):l.width)/a,m=(d?Ji(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!m||!Number.isFinite(m))&&(m=1),{x:f,y:m}}const z0=$t(0);function Cm(n){const i=mt(n);return!lu()||!i.visualViewport?z0:{x:i.visualViewport.offsetLeft,y:i.visualViewport.offsetTop}}function F0(n,i,l){return i===void 0&&(i=!1),!l||i&&l!==mt(n)?!1:i}function Gn(n,i,l,a){i===void 0&&(i=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),d=su(n);let f=$t(1);i&&(a?Rt(a)&&(f=Er(a)):f=Er(n));const m=F0(d,l,a)?Cm(d):$t(0);let v=(c.left+m.x)/f.x,x=(c.top+m.y)/f.y,y=c.width/f.x,S=c.height/f.y;if(d){const _=mt(d),k=a&&Rt(a)?mt(a):a;let b=_,E=Ha(b);for(;E&&a&&k!==b;){const j=Er(E),A=E.getBoundingClientRect(),D=jt(E),$=A.left+(E.clientLeft+parseFloat(D.paddingLeft))*j.x,M=A.top+(E.clientTop+parseFloat(D.paddingTop))*j.y;v*=j.x,x*=j.y,y*=j.x,S*=j.y,v+=$,x+=M,b=mt(E),E=Ha(b)}}return el({width:y,height:S,x:v,y:x})}function ml(n,i){const l=pl(n).scrollLeft;return i?i.left+l:Gn(Ut(n)).left+l}function Em(n,i){const l=n.getBoundingClientRect(),a=l.left+i.scrollLeft-ml(n,l),c=l.top+i.scrollTop;return{x:a,y:c}}function $0(n){let{elements:i,rect:l,offsetParent:a,strategy:c}=n;const d=c==="fixed",f=Ut(a),m=i?fl(i.floating):!1;if(a===f||m&&d)return l;let v={scrollLeft:0,scrollTop:0},x=$t(1);const y=$t(0),S=rn(a);if((S||!S&&!d)&&((Or(a)!=="body"||Po(f))&&(v=pl(a)),S)){const k=Gn(a);x=Er(a),y.x=k.x+a.clientLeft,y.y=k.y+a.clientTop}const _=f&&!S&&!d?Em(f,v):$t(0);return{width:l.width*x.x,height:l.height*x.y,x:l.x*x.x-v.scrollLeft*x.x+y.x+_.x,y:l.y*x.y-v.scrollTop*x.y+y.y+_.y}}function W0(n){return Array.from(n.getClientRects())}function H0(n){const i=Ut(n),l=pl(n),a=n.ownerDocument.body,c=ft(i.scrollWidth,i.clientWidth,a.scrollWidth,a.clientWidth),d=ft(i.scrollHeight,i.clientHeight,a.scrollHeight,a.clientHeight);let f=-l.scrollLeft+ml(n);const m=-l.scrollTop;return jt(a).direction==="rtl"&&(f+=ft(i.clientWidth,a.clientWidth)-c),{width:c,height:d,x:f,y:m}}const Yf=25;function U0(n,i){const l=mt(n),a=Ut(n),c=l.visualViewport;let d=a.clientWidth,f=a.clientHeight,m=0,v=0;if(c){d=c.width,f=c.height;const y=lu();(!y||y&&i==="fixed")&&(m=c.offsetLeft,v=c.offsetTop)}const x=ml(a);if(x<=0){const y=a.ownerDocument,S=y.body,_=getComputedStyle(S),k=y.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,b=Math.abs(a.clientWidth-S.clientWidth-k);b<=Yf&&(d-=b)}else x<=Yf&&(d+=x);return{width:d,height:f,x:m,y:v}}function B0(n,i){const l=Gn(n,!0,i==="fixed"),a=l.top+n.clientTop,c=l.left+n.clientLeft,d=rn(n)?Er(n):$t(1),f=n.clientWidth*d.x,m=n.clientHeight*d.y,v=c*d.x,x=a*d.y;return{width:f,height:m,x:v,y:x}}function Qf(n,i,l){let a;if(i==="viewport")a=U0(n,l);else if(i==="document")a=H0(Ut(n));else if(Rt(i))a=B0(i,l);else{const c=Cm(n);a={x:i.x-c.x,y:i.y-c.y,width:i.width,height:i.height}}return el(a)}function km(n,i){const l=bn(n);return l===i||!Rt(l)||Nr(l)?!1:jt(l).position==="fixed"||km(l,i)}function V0(n,i){const l=i.get(n);if(l)return l;let a=ko(n,[],!1).filter(m=>Rt(m)&&Or(m)!=="body"),c=null;const d=jt(n).position==="fixed";let f=d?bn(n):n;for(;Rt(f)&&!Nr(f);){const m=jt(f),v=iu(f);!v&&m.position==="fixed"&&(c=null),(d?!v&&!c:!v&&m.position==="static"&&!!c&&(c.position==="absolute"||c.position==="fixed")||Po(f)&&!v&&km(n,f))?a=a.filter(y=>y!==f):c=m,f=bn(f)}return i.set(n,a),a}function G0(n){let{element:i,boundary:l,rootBoundary:a,strategy:c}=n;const f=[...l==="clippingAncestors"?fl(i)?[]:V0(i,this._c):[].concat(l),a],m=Qf(i,f[0],c);let v=m.top,x=m.right,y=m.bottom,S=m.left;for(let _=1;_ {f(!1,1e-7)},1e3)}B===1&&!Pm(x,n.getBoundingClientRect())&&f(),M=!1}try{l=new IntersectionObserver(U,{...$,root:c.ownerDocument})}catch{l=new IntersectionObserver(U,$)}l.observe(n)}return f(!0),d}function q0(n,i,l,a){a===void 0&&(a={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:v=!1}=a,x=su(n),y=c||d?[...x?ko(x):[],...i?ko(i):[]]:[];y.forEach(A=>{c&&A.addEventListener("scroll",l,{passive:!0}),d&&A.addEventListener("resize",l)});const S=x&&m?J0(x,l):null;let _=-1,k=null;f&&(k=new ResizeObserver(A=>{let[D]=A;D&&D.target===x&&k&&i&&(k.unobserve(i),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var $;($=k)==null||$.observe(i)})),l()}),x&&!v&&k.observe(x),i&&k.observe(i));let b,E=v?Gn(n):null;v&&j();function j(){const A=Gn(n);E&&!Pm(E,A)&&l(),E=A,b=requestAnimationFrame(j)}return l(),()=>{var A;y.forEach(D=>{c&&D.removeEventListener("scroll",l),d&&D.removeEventListener("resize",l)}),S?.(),(A=k)==null||A.disconnect(),k=null,v&&cancelAnimationFrame(b)}}const ew=j0,tw=T0,nw=P0,rw=A0,ow=b0,Kf=N0,iw=O0,lw=(n,i,l)=>{const a=new Map,c={platform:Z0,...l},d={...c.platform,_c:a};return k0(n,i,{...c,platform:d})};var sw=typeof document<"u",aw=function(){},Qi=sw?g.useLayoutEffect:aw;function tl(n,i){if(n===i)return!0;if(typeof n!=typeof i)return!1;if(typeof n=="function"&&n.toString()===i.toString())return!0;let l,a,c;if(n&&i&&typeof n=="object"){if(Array.isArray(n)){if(l=n.length,l!==i.length)return!1;for(a=l;a--!==0;)if(!tl(n[a],i[a]))return!1;return!0}if(c=Object.keys(n),l=c.length,l!==Object.keys(i).length)return!1;for(a=l;a--!==0;)if(!{}.hasOwnProperty.call(i,c[a]))return!1;for(a=l;a--!==0;){const d=c[a];if(!(d==="_owner"&&n.$$typeof)&&!tl(n[d],i[d]))return!1}return!0}return n!==n&&i!==i}function bm(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Zf(n,i){const l=bm(n);return Math.round(i*l)/l}function Aa(n){const i=g.useRef(n);return Qi(()=>{i.current=n}),i}function uw(n){n===void 0&&(n={});const{placement:i="bottom",strategy:l="absolute",middleware:a=[],platform:c,elements:{reference:d,floating:f}={},transform:m=!0,whileElementsMounted:v,open:x}=n,[y,S]=g.useState({x:0,y:0,strategy:l,placement:i,middlewareData:{},isPositioned:!1}),[_,k]=g.useState(a);tl(_,a)||k(a);const[b,E]=g.useState(null),[j,A]=g.useState(null),D=g.useCallback(L=>{L!==G.current&&(G.current=L,E(L))},[]),$=g.useCallback(L=>{L!==B.current&&(B.current=L,A(L))},[]),M=d||b,U=f||j,G=g.useRef(null),B=g.useRef(null),le=g.useRef(y),te=v!=null,ne=Aa(v),ue=Aa(c),q=Aa(x),he=g.useCallback(()=>{if(!G.current||!B.current)return;const L={placement:i,strategy:l,middleware:_};ue.current&&(L.platform=ue.current),lw(G.current,B.current,L).then(Y=>{const V={...Y,isPositioned:q.current!==!1};ce.current&&!tl(le.current,V)&&(le.current=V,Ya.flushSync(()=>{S(V)}))})},[_,i,l,ue,q]);Qi(()=>{x===!1&&le.current.isPositioned&&(le.current.isPositioned=!1,S(L=>({...L,isPositioned:!1})))},[x]);const ce=g.useRef(!1);Qi(()=>(ce.current=!0,()=>{ce.current=!1}),[]),Qi(()=>{if(M&&(G.current=M),U&&(B.current=U),M&&U){if(ne.current)return ne.current(M,U,he);he()}},[M,U,he,ne,te]);const ee=g.useMemo(()=>({reference:G,floating:B,setReference:D,setFloating:$}),[D,$]),ie=g.useMemo(()=>({reference:M,floating:U}),[M,U]),se=g.useMemo(()=>{const L={position:l,left:0,top:0};if(!ie.floating)return L;const Y=Zf(ie.floating,y.x),V=Zf(ie.floating,y.y);return m?{...L,transform:"translate("+Y+"px, "+V+"px)",...bm(ie.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:Y,top:V}},[l,m,ie.floating,y.x,y.y]);return g.useMemo(()=>({...y,update:he,refs:ee,elements:ie,floatingStyles:se}),[y,he,ee,ie,se])}const cw=n=>{function i(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:n,fn(l){const{element:a,padding:c}=typeof n=="function"?n(l):n;return a&&i(a)?a.current!=null?Kf({element:a.current,padding:c}).fn(l):{}:a?Kf({element:a,padding:c}).fn(l):{}}}},dw=(n,i)=>{const l=ew(n);return{name:l.name,fn:l.fn,options:[n,i]}},fw=(n,i)=>{const l=tw(n);return{name:l.name,fn:l.fn,options:[n,i]}},pw=(n,i)=>({fn:iw(n).fn,options:[n,i]}),mw=(n,i)=>{const l=nw(n);return{name:l.name,fn:l.fn,options:[n,i]}},hw=(n,i)=>{const l=rw(n);return{name:l.name,fn:l.fn,options:[n,i]}},gw=(n,i)=>{const l=ow(n);return{name:l.name,fn:l.fn,options:[n,i]}},vw=(n,i)=>{const l=cw(n);return{name:l.name,fn:l.fn,options:[n,i]}};var yw="Arrow",Rm=g.forwardRef((n,i)=>{const{children:l,width:a=10,height:c=5,...d}=n;return h.jsx(De.svg,{...d,ref:i,width:a,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?l:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});Rm.displayName=yw;var xw=Rm;function ww(n){const[i,l]=g.useState(void 0);return Wt(()=>{if(n){l({width:n.offsetWidth,height:n.offsetHeight});const a=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let f,m;if("borderBoxSize"in d){const v=d.borderBoxSize,x=Array.isArray(v)?v[0]:v;f=x.inlineSize,m=x.blockSize}else f=n.offsetWidth,m=n.offsetHeight;l({width:f,height:m})});return a.observe(n,{box:"border-box"}),()=>a.unobserve(n)}else l(void 0)},[n]),i}var au="Popper",[jm,hl]=Rr(au),[Sw,Tm]=jm(au),Om=n=>{const{__scopePopper:i,children:l}=n,[a,c]=g.useState(null);return h.jsx(Sw,{scope:i,anchor:a,onAnchorChange:c,children:l})};Om.displayName=au;var Am="PopperAnchor",Dm=g.forwardRef((n,i)=>{const{__scopePopper:l,virtualRef:a,...c}=n,d=Tm(Am,l),f=g.useRef(null),m=We(i,f),v=g.useRef(null);return g.useEffect(()=>{const x=v.current;v.current=a?.current||f.current,x!==v.current&&d.onAnchorChange(v.current)}),a?null:h.jsx(De.div,{...c,ref:m})});Dm.displayName=Am;var uu="PopperContent",[_w,Cw]=jm(uu),Lm=g.forwardRef((n,i)=>{const{__scopePopper:l,side:a="bottom",sideOffset:c=0,align:d="center",alignOffset:f=0,arrowPadding:m=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:S="partial",hideWhenDetached:_=!1,updatePositionStrategy:k="optimized",onPlaced:b,...E}=n,j=Tm(uu,l),[A,D]=g.useState(null),$=We(i,Se=>D(Se)),[M,U]=g.useState(null),G=ww(M),B=G?.width??0,le=G?.height??0,te=a+(d!=="center"?"-"+d:""),ne=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},ue=Array.isArray(x)?x:[x],q=ue.length>0,he={padding:ne,boundary:ue.filter(kw),altBoundary:q},{refs:ce,floatingStyles:ee,placement:ie,isPositioned:se,middlewareData:L}=uw({strategy:"fixed",placement:te,whileElementsMounted:(...Se)=>q0(...Se,{animationFrame:k==="always"}),elements:{reference:j.anchor},middleware:[dw({mainAxis:c+le,alignmentAxis:f}),v&&fw({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?pw():void 0,...he}),v&&mw({...he}),hw({...he,apply:({elements:Se,rects:_e,availableWidth:Ne,availableHeight:Ze})=>{const{width:Yn,height:jo}=_e.reference,Bt=Se.floating.style;Bt.setProperty("--radix-popper-available-width",`${Ne}px`),Bt.setProperty("--radix-popper-available-height",`${Ze}px`),Bt.setProperty("--radix-popper-anchor-width",`${Yn}px`),Bt.setProperty("--radix-popper-anchor-height",`${jo}px`)}}),M&&vw({element:M,padding:m}),Nw({arrowWidth:B,arrowHeight:le}),_&&gw({strategy:"referenceHidden",...he})]}),[Y,V]=zm(ie),P=pt(b);Wt(()=>{se&&P?.()},[se,P]);const I=L.arrow?.x,de=L.arrow?.y,pe=L.arrow?.centerOffset!==0,[ye,xe]=g.useState();return Wt(()=>{A&&xe(window.getComputedStyle(A).zIndex)},[A]),h.jsx("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...ee,transform:se?ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:h.jsx(_w,{scope:l,placedSide:Y,onArrowChange:U,arrowX:I,arrowY:de,shouldHideArrow:pe,children:h.jsx(De.div,{"data-side":Y,"data-align":V,...E,ref:$,style:{...E.style,animation:se?void 0:"none"}})})})});Lm.displayName=uu;var Mm="PopperArrow",Ew={top:"bottom",right:"left",bottom:"top",left:"right"},Im=g.forwardRef(function(i,l){const{__scopePopper:a,...c}=i,d=Cw(Mm,a),f=Ew[d.placedSide];return h.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:h.jsx(xw,{...c,ref:l,style:{...c.style,display:"block"}})})});Im.displayName=Mm;function kw(n){return n!==null}var Nw=n=>({name:"transformOrigin",options:n,fn(i){const{placement:l,rects:a,middlewareData:c}=i,f=c.arrow?.centerOffset!==0,m=f?0:n.arrowWidth,v=f?0:n.arrowHeight,[x,y]=zm(l),S={start:"0%",center:"50%",end:"100%"}[y],_=(c.arrow?.x??0)+m/2,k=(c.arrow?.y??0)+v/2;let b="",E="";return x==="bottom"?(b=f?S:`${_}px`,E=`${-v}px`):x==="top"?(b=f?S:`${_}px`,E=`${a.floating.height+v}px`):x==="right"?(b=`${-v}px`,E=f?S:`${k}px`):x==="left"&&(b=`${a.floating.width+v}px`,E=f?S:`${k}px`),{data:{x:b,y:E}}}});function zm(n){const[i,l="center"]=n.split("-");return[i,l]}var Fm=Om,$m=Dm,Wm=Lm,Hm=Im,Pw=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),bw="VisuallyHidden",Um=g.forwardRef((n,i)=>h.jsx(De.span,{...n,ref:i,style:{...Pw,...n.style}}));Um.displayName=bw;var Rw=Um,[gl]=Rr("Tooltip",[hl]),vl=hl(),Bm="TooltipProvider",jw=700,Ua="tooltip.open",[Tw,cu]=gl(Bm),Vm=n=>{const{__scopeTooltip:i,delayDuration:l=jw,skipDelayDuration:a=300,disableHoverableContent:c=!1,children:d}=n,f=g.useRef(!0),m=g.useRef(!1),v=g.useRef(0);return g.useEffect(()=>{const x=v.current;return()=>window.clearTimeout(x)},[]),h.jsx(Tw,{scope:i,isOpenDelayedRef:f,delayDuration:l,onOpen:g.useCallback(()=>{window.clearTimeout(v.current),f.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>f.current=!0,a)},[a]),isPointerInTransitRef:m,onPointerInTransitChange:g.useCallback(x=>{m.current=x},[]),disableHoverableContent:c,children:d})};Vm.displayName=Bm;var No="Tooltip",[Ow,yl]=gl(No),Gm=n=>{const{__scopeTooltip:i,children:l,open:a,defaultOpen:c,onOpenChange:d,disableHoverableContent:f,delayDuration:m}=n,v=cu(No,n.__scopeTooltip),x=vl(i),[y,S]=g.useState(null),_=Eo(),k=g.useRef(0),b=f??v.disableHoverableContent,E=m??v.delayDuration,j=g.useRef(!1),[A,D]=sl({prop:a,defaultProp:c??!1,onChange:B=>{B?(v.onOpen(),document.dispatchEvent(new CustomEvent(Ua))):v.onClose(),d?.(B)},caller:No}),$=g.useMemo(()=>A?j.current?"delayed-open":"instant-open":"closed",[A]),M=g.useCallback(()=>{window.clearTimeout(k.current),k.current=0,j.current=!1,D(!0)},[D]),U=g.useCallback(()=>{window.clearTimeout(k.current),k.current=0,D(!1)},[D]),G=g.useCallback(()=>{window.clearTimeout(k.current),k.current=window.setTimeout(()=>{j.current=!0,D(!0),k.current=0},E)},[E,D]);return g.useEffect(()=>()=>{k.current&&(window.clearTimeout(k.current),k.current=0)},[]),h.jsx(Fm,{...x,children:h.jsx(Ow,{scope:i,contentId:_,open:A,stateAttribute:$,trigger:y,onTriggerChange:S,onTriggerEnter:g.useCallback(()=>{v.isOpenDelayedRef.current?G():M()},[v.isOpenDelayedRef,G,M]),onTriggerLeave:g.useCallback(()=>{b?U():(window.clearTimeout(k.current),k.current=0)},[U,b]),onOpen:M,onClose:U,disableHoverableContent:b,children:l})})};Gm.displayName=No;var Ba="TooltipTrigger",Ym=g.forwardRef((n,i)=>{const{__scopeTooltip:l,...a}=n,c=yl(Ba,l),d=cu(Ba,l),f=vl(l),m=g.useRef(null),v=We(i,m,c.onTriggerChange),x=g.useRef(!1),y=g.useRef(!1),S=g.useCallback(()=>x.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",S),[S]),h.jsx($m,{asChild:!0,...f,children:h.jsx(De.button,{"aria-describedby":c.open?c.contentId:void 0,"data-state":c.stateAttribute,...a,ref:v,onPointerMove:Ee(n.onPointerMove,_=>{_.pointerType!=="touch"&&!y.current&&!d.isPointerInTransitRef.current&&(c.onTriggerEnter(),y.current=!0)}),onPointerLeave:Ee(n.onPointerLeave,()=>{c.onTriggerLeave(),y.current=!1}),onPointerDown:Ee(n.onPointerDown,()=>{c.open&&c.onClose(),x.current=!0,document.addEventListener("pointerup",S,{once:!0})}),onFocus:Ee(n.onFocus,()=>{x.current||c.onOpen()}),onBlur:Ee(n.onBlur,c.onClose),onClick:Ee(n.onClick,c.onClose)})})});Ym.displayName=Ba;var Aw="TooltipPortal",[sS,Dw]=gl(Aw,{forceMount:void 0}),Pr="TooltipContent",Qm=g.forwardRef((n,i)=>{const l=Dw(Pr,n.__scopeTooltip),{forceMount:a=l.forceMount,side:c="top",...d}=n,f=yl(Pr,n.__scopeTooltip);return h.jsx(Tt,{present:a||f.open,children:f.disableHoverableContent?h.jsx(Xm,{side:c,...d,ref:i}):h.jsx(Lw,{side:c,...d,ref:i})})}),Lw=g.forwardRef((n,i)=>{const l=yl(Pr,n.__scopeTooltip),a=cu(Pr,n.__scopeTooltip),c=g.useRef(null),d=We(i,c),[f,m]=g.useState(null),{trigger:v,onClose:x}=l,y=c.current,{onPointerInTransitChange:S}=a,_=g.useCallback(()=>{m(null),S(!1)},[S]),k=g.useCallback((b,E)=>{const j=b.currentTarget,A={x:b.clientX,y:b.clientY},D=$w(A,j.getBoundingClientRect()),$=Ww(A,D),M=Hw(E.getBoundingClientRect()),U=Bw([...$,...M]);m(U),S(!0)},[S]);return g.useEffect(()=>()=>_(),[_]),g.useEffect(()=>{if(v&&y){const b=j=>k(j,y),E=j=>k(j,v);return v.addEventListener("pointerleave",b),y.addEventListener("pointerleave",E),()=>{v.removeEventListener("pointerleave",b),y.removeEventListener("pointerleave",E)}}},[v,y,k,_]),g.useEffect(()=>{if(f){const b=E=>{const j=E.target,A={x:E.clientX,y:E.clientY},D=v?.contains(j)||y?.contains(j),$=!Uw(A,f);D?_():$&&(_(),x())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[v,y,f,x,_]),h.jsx(Xm,{...n,ref:d})}),[Mw,Iw]=gl(No,{isInside:!1}),zw=Iv("TooltipContent"),Xm=g.forwardRef((n,i)=>{const{__scopeTooltip:l,children:a,"aria-label":c,onEscapeKeyDown:d,onPointerDownOutside:f,...m}=n,v=yl(Pr,l),x=vl(l),{onClose:y}=v;return g.useEffect(()=>(document.addEventListener(Ua,y),()=>document.removeEventListener(Ua,y)),[y]),g.useEffect(()=>{if(v.trigger){const S=_=>{_.target?.contains(v.trigger)&&y()};return window.addEventListener("scroll",S,{capture:!0}),()=>window.removeEventListener("scroll",S,{capture:!0})}},[v.trigger,y]),h.jsx(al,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:S=>S.preventDefault(),onDismiss:y,children:h.jsxs(Wm,{"data-state":v.stateAttribute,...x,...m,ref:i,style:{...m.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(zw,{children:a}),h.jsx(Mw,{scope:l,isInside:!0,children:h.jsx(Rw,{id:v.contentId,role:"tooltip",children:c||a})})]})})});Qm.displayName=Pr;var Km="TooltipArrow",Fw=g.forwardRef((n,i)=>{const{__scopeTooltip:l,...a}=n,c=vl(l);return Iw(Km,l).isInside?null:h.jsx(Hm,{...c,...a,ref:i})});Fw.displayName=Km;function $w(n,i){const l=Math.abs(i.top-n.y),a=Math.abs(i.bottom-n.y),c=Math.abs(i.right-n.x),d=Math.abs(i.left-n.x);switch(Math.min(l,a,c,d)){case d:return"left";case c:return"right";case l:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function Ww(n,i,l=5){const a=[];switch(i){case"top":a.push({x:n.x-l,y:n.y+l},{x:n.x+l,y:n.y+l});break;case"bottom":a.push({x:n.x-l,y:n.y-l},{x:n.x+l,y:n.y-l});break;case"left":a.push({x:n.x+l,y:n.y-l},{x:n.x+l,y:n.y+l});break;case"right":a.push({x:n.x-l,y:n.y-l},{x:n.x-l,y:n.y+l});break}return a}function Hw(n){const{top:i,right:l,bottom:a,left:c}=n;return[{x:c,y:i},{x:l,y:i},{x:l,y:a},{x:c,y:a}]}function Uw(n,i){const{x:l,y:a}=n;let c=!1;for(let d=0,f=i.length-1;d a!=_>a&&l<(S-x)*(a-y)/(_-y)+x&&(c=!c)}return c}function Bw(n){const i=n.slice();return i.sort((l,a)=>l.x a.x?1:l.y a.y?1:0),Vw(i)}function Vw(n){if(n.length<=1)return n.slice();const i=[];for(let a=0;a =2;){const d=i[i.length-1],f=i[i.length-2];if((d.x-f.x)*(c.y-f.y)>=(d.y-f.y)*(c.x-f.x))i.pop();else break}i.push(c)}i.pop();const l=[];for(let a=n.length-1;a>=0;a--){const c=n[a];for(;l.length>=2;){const d=l[l.length-1],f=l[l.length-2];if((d.x-f.x)*(c.y-f.y)>=(d.y-f.y)*(c.x-f.x))l.pop();else break}l.push(c)}return l.pop(),i.length===1&&l.length===1&&i[0].x===l[0].x&&i[0].y===l[0].y?i:i.concat(l)}var Gw=Vm,Yw=Gm,Qw=Ym,Zm=Qm;const Xw=Gw,du=Yw,fu=Qw,xl=g.forwardRef(({className:n,sideOffset:i=4,...l},a)=>h.jsx(Zm,{ref:a,sideOffset:i,className:me("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",n),...l}));xl.displayName=Zm.displayName;var wl="Collapsible",[Kw]=Rr(wl),[Zw,pu]=Kw(wl),Jm=g.forwardRef((n,i)=>{const{__scopeCollapsible:l,open:a,defaultOpen:c,disabled:d,onOpenChange:f,...m}=n,[v,x]=sl({prop:a,defaultProp:c??!1,onChange:f,caller:wl});return h.jsx(Zw,{scope:l,disabled:d,contentId:Eo(),open:v,onOpenToggle:g.useCallback(()=>x(y=>!y),[x]),children:h.jsx(De.div,{"data-state":hu(v),"data-disabled":d?"":void 0,...m,ref:i})})});Jm.displayName=wl;var qm="CollapsibleTrigger",eh=g.forwardRef((n,i)=>{const{__scopeCollapsible:l,...a}=n,c=pu(qm,l);return h.jsx(De.button,{type:"button","aria-controls":c.contentId,"aria-expanded":c.open||!1,"data-state":hu(c.open),"data-disabled":c.disabled?"":void 0,disabled:c.disabled,...a,ref:i,onClick:Ee(n.onClick,c.onOpenToggle)})});eh.displayName=qm;var mu="CollapsibleContent",th=g.forwardRef((n,i)=>{const{forceMount:l,...a}=n,c=pu(mu,n.__scopeCollapsible);return h.jsx(Tt,{present:l||c.open,children:({present:d})=>h.jsx(Jw,{...a,ref:i,present:d})})});th.displayName=mu;var Jw=g.forwardRef((n,i)=>{const{__scopeCollapsible:l,present:a,children:c,...d}=n,f=pu(mu,l),[m,v]=g.useState(a),x=g.useRef(null),y=We(i,x),S=g.useRef(0),_=S.current,k=g.useRef(0),b=k.current,E=f.open||m,j=g.useRef(E),A=g.useRef(void 0);return g.useEffect(()=>{const D=requestAnimationFrame(()=>j.current=!1);return()=>cancelAnimationFrame(D)},[]),Wt(()=>{const D=x.current;if(D){A.current=A.current||{transitionDuration:D.style.transitionDuration,animationName:D.style.animationName},D.style.transitionDuration="0s",D.style.animationName="none";const $=D.getBoundingClientRect();S.current=$.height,k.current=$.width,j.current||(D.style.transitionDuration=A.current.transitionDuration,D.style.animationName=A.current.animationName),v(a)}},[f.open,a]),h.jsx(De.div,{"data-state":hu(f.open),"data-disabled":f.disabled?"":void 0,id:f.contentId,hidden:!E,...d,ref:y,style:{"--radix-collapsible-content-height":_?`${_}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...n.style},children:E&&c})});function hu(n){return n?"open":"closed"}var qw=Jm;const e1=qw,t1=eh,n1=th,r1=new Set(["production_mutation","credential_access_without_intent","destructive_operation_without_intent","direct_infra_api_with_credential","unknown_high_risk_command","no_policy_rule_matched"]),o1=new Set(["judge_allow","judge_deny","judge_fail_open"]),i1=new Set(["deterministic_deny","deterministic_allow"]);function l1(n){const i={deny:[],ask:[],allow:[]};for(const l of n)i[l.decision]?.push(l);return{counts:{all:n.length,deny:i.deny.length,ask:i.ask.length,allow:i.allow.length},groups:i}}function gu(n,i="—"){const l=n.risk_event??{};return l.command_summary||l.request_summary||l.path_class||l.type||i}function en(n){return n.replace(/_/g," ")}function s1(n,i){if(n===i)return!0;if(n.length!==i.length)return!1;for(let l=0;l i.toUpperCase()):"tool"}function rh(n){const i=n.risk_event?.decision_stage;return!!(i&&i1.has(i))||r1.has(n.reason_code??"")}function a1(n){return n.reason_code==="async_telemetry"?"Recorded after execution.":n.risk_event?.decision_stage==="judge_fail_open"?"Local judge was unavailable, so Guard allowed by fail-open policy.":n.reason||(n.reason_code?en(n.reason_code):"No explanation captured.")}function u1(n){const i=n.risk_event??{};return n.reason_code==="async_telemetry"?"Not a live gate. Recorded after execution for local session history.":i.decision_stage==="judge_allow"?"Deterministic policy allowed this action, then the local judge allowed it.":i.decision_stage==="judge_deny"?"Deterministic policy allowed this action, then the local judge denied it.":i.decision_stage==="judge_fail_open"?`Deterministic policy allowed this action, but the local judge failed${i.judge_failure_kind?` with ${en(i.judge_failure_kind)}`:""}.`:rh(n)?i.policy_rule_id?`Deterministic policy matched ${i.policy_rule_id} before calling the local judge.`:"Deterministic policy allowed this action.":i.type==="normal_tool_call"?"Routine coding-agent behavior. No deterministic policy rule matched.":`Normalized as ${i.type||"unknown"}.`}function oh(n){const i=n.risk_event?.decision_stage;return i&&o1.has(i)?"Local LLM judge":n.reason_code==="async_telemetry"?"Trace history":rh(n)?"Deterministic policy":"Guard policy"}function c1(n){return gu(n,"No command summary stored.")}function d1(n){if(!n)return"";const i=Date.parse(n);return Number.isNaN(i)?"":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(i)}function f1(n){return n==="deny"?"Would deny":n==="ask"?"Would ask":"Allow"}const bo={deny:{text:"text-destructive",bg:"bg-destructive",ring:"ring-destructive/10",border:"border-destructive/20"},ask:{text:"text-amber-700",bg:"bg-amber-500",ring:"ring-amber-500/10",border:"border-amber-300/40"},allow:{text:"text-brand",bg:"bg-brand",ring:"ring-brand/10",border:"border-border"}};function vu({kind:n,className:i}){const l=bo[n];return h.jsx("span",{className:me("h-2 w-2 shrink-0 rounded-full ring-4",l.bg,l.ring,i)})}function Jf({label:n,description:i,children:l}){return h.jsxs("section",{className:"mt-8 first:mt-0",children:[(n||i)&&h.jsxs("div",{className:"mb-3.5 flex items-baseline gap-3",children:[n&&h.jsx("h2",{className:"text-[15px] font-semibold tracking-tight",children:n}),i&&h.jsx("p",{className:"text-[12.5px] text-muted-foreground",children:i})]}),l]})}function qf({k:n,v:i}){return h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"text-muted-foreground",children:n}),h.jsx("span",{className:"font-mono",children:i})]})}function ct({children:n}){return h.jsx("dt",{className:"self-center text-[10.5px] font-medium uppercase tracking-wider text-muted-foreground",children:n})}function dt({children:n,className:i}){return h.jsx("dd",{className:me("text-foreground/90",i),children:n})}const p1={all:"All actions",deny:"Denied · this session",ask:"Needs ask · this session",allow:"Allowed · this session"},m1={deny:"Would deny",ask:"Needs ask",allow:"Allow"},h1={all:["deny","ask","allow"],deny:["deny"],ask:["ask"],allow:["allow"]};function g1({tab:n,groups:i,openId:l,onOpen:a,hasAny:c}){return h.jsxs("section",{className:"overflow-hidden rounded-xl border bg-card shadow-[inset_0_1px_0_rgba(255,255,255,0.8),0_1px_2px_rgba(0,0,0,0.04)]",children:[h.jsx("div",{className:"flex items-center justify-between gap-3 border-b px-5 py-3",children:h.jsxs("div",{className:"flex items-baseline gap-2.5",children:[h.jsx("h3",{className:"font-mono text-[10.5px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:p1[n]}),n!=="all"&&h.jsxs("span",{className:"text-[11px] text-muted-foreground/80",children:["Click ",h.jsx("span",{className:"text-foreground",children:"Total"})," to clear"]})]})}),c?h.jsx("div",{children:h1[n].map(d=>({kind:d,items:i[d]})).filter(({items:d})=>d.length>0).map(({kind:d,items:f},m)=>h.jsx(y1,{label:m1[d],kind:d,count:f.length,separated:m>0,children:f.map(v=>h.jsx(x1,{event:v,active:l===v.id,onClick:()=>a(v.id)},v.id))},d))}):h.jsx(v1,{})]})}function v1(){return h.jsxs("div",{className:"flex flex-col items-center gap-2 px-8 py-16 text-center text-muted-foreground",children:[h.jsx(Ov,{className:"h-5 w-5 text-muted-foreground/50"}),h.jsx("p",{className:"text-[13px]",children:"No actions captured yet."}),h.jsx("p",{className:"text-[12px] text-muted-foreground/70",children:"Start Claude Code to populate this view."})]})}function y1({label:n,kind:i,count:l,separated:a,children:c}){const[d,f]=g.useState(!0);return h.jsxs(e1,{open:d,onOpenChange:f,children:[h.jsxs(t1,{className:me("flex w-full items-center gap-2 border-b bg-muted/40 px-5 py-2 text-left text-[12px] font-medium text-muted-foreground transition-colors hover:bg-muted/40",a&&"border-t"),children:[h.jsx(up,{className:me("h-3 w-3 transition-transform",!d&&"-rotate-90")}),h.jsx(vu,{kind:i}),h.jsx("span",{className:"text-foreground",children:n}),h.jsx("span",{className:"tabular-nums text-[11px] text-muted-foreground",children:l})]}),h.jsx(n1,{className:"overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",children:h.jsx("div",{children:c})})]})}function x1({event:n,active:i,onClick:l}){const a=gu(n),c=n.risk_event?.signals?.[0]?.replace(/_/g," "),d=bo[n.decision];return h.jsxs("button",{onClick:l,className:me("group relative grid w-full grid-cols-[10px_minmax(0,1fr)_auto] items-center gap-4 border-b px-8 py-3 text-left transition-colors last:border-b-0","hover:bg-muted/40",i&&"bg-accent"),children:[i&&h.jsx("span",{className:"absolute inset-y-0 left-0 w-[2px] bg-brand"}),h.jsx(vu,{kind:n.decision}),h.jsxs("span",{className:"flex min-w-0 items-baseline gap-2.5",children:[h.jsx("span",{className:"text-[13px] font-medium text-foreground",children:nh(n.tool_name)}),h.jsx("span",{className:"truncate font-mono text-[12px] text-muted-foreground",children:a})]}),h.jsxs("span",{className:"flex items-center gap-3",children:[c&&h.jsxs(du,{children:[h.jsx(fu,{asChild:!0,children:h.jsx("span",{className:"hidden max-w-[180px] truncate text-[11px] text-muted-foreground md:inline",children:c})}),h.jsxs(xl,{side:"top",children:["Primary signal: ",c]})]}),h.jsx("span",{className:me("rounded-md border bg-background/60 px-1.5 py-0.5 font-mono text-[10.5px] font-medium",d.border,n.decision==="allow"?"text-muted-foreground":d.text),children:oh(n)}),h.jsx(up,{className:me("h-3 w-3 -rotate-90 text-muted-foreground/0 transition-all group-hover:text-muted-foreground/70",i&&"text-muted-foreground/70")})]})]})}const w1={},S1=w1,Sl=S1.VITE_KONTEXT_API??"";function Co(n){return n instanceof Error?n.message:String(n)}async function ep(n){return n.json()}async function _l(n){if(n.ok)return ep(n);const i=`${n.status} ${n.statusText}`.trim();if(!(n.headers.get("content-type")??"").includes("application/json"))throw new Error(i);let a;try{a=await ep(n)}catch(d){throw new Error(`API error response was not valid JSON: ${i}; ${Co(d)}`)}const c=Ro(a)&&typeof a.error=="string"?a.error:i;throw new Error(c)}function Ro(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function ve(n){return typeof n=="string"?n:void 0}function Da(n){return typeof n=="boolean"?n:void 0}function tp(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function La(n){if(!Array.isArray(n))return;const i=n.filter(l=>typeof l=="string");return i.length>0?i:void 0}function ih(n){switch(n){case"allow":case"ask":case"deny":return n;default:return}}function np(n){switch(n){case"relaxed":case"balanced":case"strict":return n;default:return}}function _1(n){if(Ro(n))return{type:ve(n.type),provider:ve(n.provider),provider_category:ve(n.provider_category),operation:ve(n.operation),operation_class:ve(n.operation_class),resource_class:ve(n.resource_class),environment:ve(n.environment),credential_observed:Da(n.credential_observed),credential_source:ve(n.credential_source),direct_api_call:Da(n.direct_api_call),explicit_user_intent:Da(n.explicit_user_intent),command_summary:ve(n.command_summary),request_summary:ve(n.request_summary),path_class:ve(n.path_class),decision:ih(n.decision),reason_code:ve(n.reason_code),decision_stage:ve(n.decision_stage),signals:La(n.signals),guard_id:ve(n.guard_id),confidence:tp(n.confidence),policy_version:ve(n.policy_version),policy_profile:ve(n.policy_profile),policy_rule_pack:ve(n.policy_rule_pack),policy_rule_id:ve(n.policy_rule_id),policy_rule_category:ve(n.policy_rule_category),policy_signals:La(n.policy_signals),judge_runtime:ve(n.judge_runtime),judge_model:ve(n.judge_model),judge_duration_ms:tp(n.judge_duration_ms),judge_failure_kind:ve(n.judge_failure_kind),judge_risk_level:ve(n.judge_risk_level),judge_categories:La(n.judge_categories)}}function C1(n){if(!(!Ro(n)||typeof n.session_id!="string"||typeof n.actions!="number"))return{session_id:n.session_id,actions:n.actions}}function E1(n){if(!Ro(n)||typeof n.id!="string")return;const i=ih(n.decision);if(i)return{id:n.id,session_id:ve(n.session_id),tool_name:ve(n.tool_name),decision:i,reason:ve(n.reason),reason_code:ve(n.reason_code),created_at:ve(n.created_at),risk_event:_1(n.risk_event)}}function lh(n){if(!Ro(n))throw new Error("invalid policy profile response");const i=np(n.profile);if(!i)throw new Error("invalid policy profile response");return{profile:i,recommended_profile:np(n.recommended_profile),version:ve(n.version),rule_pack:ve(n.rule_pack),rule_pack_version:ve(n.rule_pack_version),config_digest:ve(n.config_digest),activation_id:ve(n.activation_id),source:ve(n.source),status:ve(n.status),loaded_at:ve(n.loaded_at)}}function sh(n,i){if(n==null)return[];if(!Array.isArray(n))throw new Error("invalid API response");const l=[];for(const a of n){const c=i(a);if(!c)throw new Error("invalid API response");l.push(c)}return l}async function k1(){return sh(await fetch(`${Sl}/api/sessions`).then(_l),C1)}async function N1(n){return sh(await fetch(`${Sl}/api/sessions/${encodeURIComponent(n)}/events`).then(_l),E1)}async function P1(){return lh(await fetch(`${Sl}/api/policy/profile`).then(_l))}async function b1(n){const i=await fetch(`${Sl}/api/policy/profile`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profile:n})}).then(_l);return lh(i)}function R1({event:n}){const i=n.risk_event??{},l=bo[n.decision],a=d1(n.created_at),c=i.decision_stage==="judge_allow"?"allow":i.decision_stage==="judge_deny"?"deny":i.decision_stage==="judge_fail_open"?"fail open":"",d=T1(i.judge_duration_ms);return h.jsxs("div",{className:"flex h-full flex-col bg-background",children:[h.jsxs(gm,{className:"flex flex-row items-center gap-2 border-b bg-background px-6 py-3.5 pr-14 space-y-0",children:[h.jsx(vu,{kind:n.decision}),h.jsx(vm,{className:me("text-[13px] font-medium",l.text),children:f1(n.decision)}),h.jsx("span",{className:"ml-2 font-mono text-[10.5px] uppercase tracking-[0.2em] text-muted-foreground",children:nh(n.tool_name)})]}),h.jsx(ll,{className:"flex-1",children:h.jsxs("div",{className:"space-y-7 px-7 py-7",children:[h.jsx("div",{className:"space-y-3",children:h.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-[15px] font-medium leading-snug tracking-tight text-foreground",children:gu(n)})}),h.jsxs("dl",{className:"grid grid-cols-[120px_1fr] gap-y-3 text-[13px]",children:[h.jsx(ct,{children:"Operation"}),h.jsx(dt,{children:i.operation||i.operation_class||"unknown"}),h.jsx(ct,{children:"Source"}),h.jsx(dt,{children:oh(n)}),h.jsx(ct,{children:"Stage"}),h.jsx(dt,{children:i.decision_stage?en(i.decision_stage):"unknown"}),h.jsx(ct,{children:"Environment"}),h.jsx(dt,{children:h.jsx("span",{className:"font-mono text-[12.5px]",children:i.environment||"unknown"})}),a&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Timestamp"}),h.jsx(dt,{children:a})]}),i.policy_version&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Policy version"}),h.jsx(dt,{children:i.policy_version})]}),i.policy_profile&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Policy profile"}),h.jsx(dt,{children:en(i.policy_profile)})]}),i.policy_rule_pack&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Rule pack"}),h.jsx(dt,{children:i.policy_rule_pack})]}),i.policy_rule_id&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Policy rule"}),h.jsx(dt,{children:i.policy_rule_id})]}),i.policy_rule_category&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Rule category"}),h.jsx(dt,{children:en(i.policy_rule_category)})]}),c&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Judge result"}),h.jsx(dt,{children:c})]}),i.judge_risk_level&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Judge risk"}),h.jsx(dt,{children:en(i.judge_risk_level)})]}),d&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Judge latency"}),h.jsx(dt,{children:d})]})]}),h.jsx(_o,{title:"Reason",children:h.jsx("p",{className:"text-[13px] leading-relaxed text-foreground/80",children:a1(n)})}),h.jsx(_o,{title:"Analysis",children:h.jsx("p",{className:"text-[13px] leading-relaxed text-foreground/80",children:u1(n)})}),h.jsx(_o,{title:"Command",children:h.jsx("pre",{className:"overflow-x-auto rounded-md border bg-muted/40 px-3 py-2.5 font-mono text-[12px] leading-relaxed text-foreground/90",children:c1(n)})}),(i.signals??[]).length>0&&h.jsx(_o,{title:"Signals",children:h.jsx("div",{className:"flex flex-wrap gap-1.5",children:(i.signals??[]).map(f=>h.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md border bg-card px-2 py-1 font-mono text-[11px] text-foreground/80 shadow-[inset_0_1px_0_rgba(255,255,255,0.7)]",children:[h.jsx("span",{className:me("h-1 w-1 rounded-full",l.bg)}),en(f)]},f))})}),(i.policy_signals??[]).length>0&&h.jsx(_o,{title:"Policy Signals",children:h.jsx("div",{className:"flex flex-wrap gap-1.5",children:(i.policy_signals??[]).map(f=>h.jsx(j1,{signal:f,toneClass:l.bg},f))})}),n.reason_code&&h.jsxs("div",{className:"border-t pt-4 font-mono text-[10.5px] uppercase tracking-[0.2em] text-muted-foreground",children:["decision code · ",h.jsx("span",{className:"text-foreground/70",children:n.reason_code})]})]})})]})}function j1({signal:n,toneClass:i}){return h.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md border bg-card px-2 py-1 font-mono text-[11px] text-foreground/80 shadow-[inset_0_1px_0_rgba(255,255,255,0.7)]",children:[h.jsx("span",{className:me("h-1 w-1 rounded-full",i)}),en(n)]})}function T1(n){return typeof n!="number"||!Number.isFinite(n)||n<0?"":n<1e3?`${Math.round(n)} ms`:`${(n/1e3).toFixed(1)} s`}function _o({title:n,children:i}){return h.jsxs("div",{className:"space-y-2.5",children:[h.jsx("h3",{className:"font-mono text-[10px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:n}),i]})}var Ma,Cl="HoverCard",[ah]=Rr(Cl,[hl]),El=hl(),[O1,yu]=ah(Cl),uh=n=>{const{__scopeHoverCard:i,children:l,open:a,defaultOpen:c,onOpenChange:d,openDelay:f=700,closeDelay:m=300}=n,v=El(i),x=g.useRef(0),y=g.useRef(0),S=g.useRef(!1),_=g.useRef(!1),[k,b]=sl({prop:a,defaultProp:c??!1,onChange:d,caller:Cl}),E=g.useCallback(()=>{clearTimeout(y.current),x.current=window.setTimeout(()=>b(!0),f)},[f,b]),j=g.useCallback(()=>{clearTimeout(x.current),!S.current&&!_.current&&(y.current=window.setTimeout(()=>b(!1),m))},[m,b]),A=g.useCallback(()=>b(!1),[b]);return g.useEffect(()=>()=>{clearTimeout(x.current),clearTimeout(y.current)},[]),h.jsx(O1,{scope:i,open:k,onOpenChange:b,onOpen:E,onClose:j,onDismiss:A,hasSelectionRef:S,isPointerDownOnContentRef:_,children:h.jsx(Fm,{...v,children:l})})};uh.displayName=Cl;var ch="HoverCardTrigger",dh=g.forwardRef((n,i)=>{const{__scopeHoverCard:l,...a}=n,c=yu(ch,l),d=El(l);return h.jsx($m,{asChild:!0,...d,children:h.jsx(De.a,{"data-state":c.open?"open":"closed",...a,ref:i,onPointerEnter:Ee(n.onPointerEnter,rl(c.onOpen)),onPointerLeave:Ee(n.onPointerLeave,rl(c.onClose)),onFocus:Ee(n.onFocus,c.onOpen),onBlur:Ee(n.onBlur,c.onClose),onTouchStart:Ee(n.onTouchStart,f=>f.preventDefault())})})});dh.displayName=ch;var A1="HoverCardPortal",[aS,D1]=ah(A1,{forceMount:void 0}),nl="HoverCardContent",fh=g.forwardRef((n,i)=>{const l=D1(nl,n.__scopeHoverCard),{forceMount:a=l.forceMount,...c}=n,d=yu(nl,n.__scopeHoverCard);return h.jsx(Tt,{present:a||d.open,children:h.jsx(L1,{"data-state":d.open?"open":"closed",...c,onPointerEnter:Ee(n.onPointerEnter,rl(d.onOpen)),onPointerLeave:Ee(n.onPointerLeave,rl(d.onClose)),ref:i})})});fh.displayName=nl;var L1=g.forwardRef((n,i)=>{const{__scopeHoverCard:l,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,...m}=n,v=yu(nl,l),x=El(l),y=g.useRef(null),S=We(i,y),[_,k]=g.useState(!1);return g.useEffect(()=>{if(_){const b=document.body;return Ma=b.style.userSelect||b.style.webkitUserSelect,b.style.userSelect="none",b.style.webkitUserSelect="none",()=>{b.style.userSelect=Ma,b.style.webkitUserSelect=Ma}}},[_]),g.useEffect(()=>{if(y.current){const b=()=>{k(!1),v.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(v.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",b),()=>{document.removeEventListener("pointerup",b),v.hasSelectionRef.current=!1,v.isPointerDownOnContentRef.current=!1}}},[v.isPointerDownOnContentRef,v.hasSelectionRef]),g.useEffect(()=>{y.current&&z1(y.current).forEach(E=>E.setAttribute("tabindex","-1"))}),h.jsx(al,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:Ee(d,b=>{b.preventDefault()}),onDismiss:v.onDismiss,children:h.jsx(Wm,{...x,...m,onPointerDown:Ee(m.onPointerDown,b=>{b.currentTarget.contains(b.target)&&k(!0),v.hasSelectionRef.current=!1,v.isPointerDownOnContentRef.current=!0}),ref:S,style:{...m.style,userSelect:_?"text":void 0,WebkitUserSelect:_?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),M1="HoverCardArrow",I1=g.forwardRef((n,i)=>{const{__scopeHoverCard:l,...a}=n,c=El(l);return h.jsx(Hm,{...c,...a,ref:i})});I1.displayName=M1;function rl(n){return i=>i.pointerType==="touch"?void 0:n()}function z1(n){const i=[],l=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;l.nextNode();)i.push(l.currentNode);return i}var F1=uh,$1=dh,ph=fh;const W1=F1,H1=$1,mh=g.forwardRef(({className:n,align:i="center",sideOffset:l=4,...a},c)=>h.jsx(ph,{ref:c,align:i,sideOffset:l,className:me("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]",n),...a}));mh.displayName=ph.displayName;function Bn({className:n,...i}){return h.jsx("div",{className:me("animate-pulse rounded-md bg-muted",n),...i})}const Va=[{id:"relaxed",label:"Relaxed",lede:"Fewer blocks, more compatibility.",hint:"Use when iterating on agent behavior."},{id:"balanced",label:"Balanced",recommended:!0,lede:"Good protection with fewer false positives.",hint:"Best default for local development."},{id:"strict",label:"Strict",lede:"Maximum protection, more false positives.",hint:"Use when you can accept breakage."}];function U1(n){return Va.find(i=>i.id===n)?.label??"Balanced"}const B1={relaxed:1,balanced:2,strict:3};function V1({profile:n,pending:i,error:l,onActivate:a,onRetry:c}){const d=n?.profile??"balanced",f=!n&&!l;return h.jsxs("section",{className:"space-y-3.5",children:[h.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[h.jsxs("div",{className:"flex items-baseline gap-3",children:[h.jsx("h2",{className:"text-[15px] font-semibold tracking-tight",children:"Policy profile"}),n&&h.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:[U1(n.profile)," profile"]})]}),n&&h.jsx(G1,{profile:n})]}),h.jsx("div",{className:"grid grid-cols-1 gap-2.5 md:grid-cols-3",children:f?Va.map(m=>h.jsx(Y1,{},m.id)):Va.map(m=>h.jsx(Q1,{profile:m,active:m.id===d,pending:m.id===i,disabled:!n||!!i,onActivate:()=>a(m.id)},m.id))}),l&&h.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-[12px] text-destructive",children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[h.jsx(cp,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{children:l})]}),h.jsx("button",{type:"button",onClick:c,className:"shrink-0 font-mono text-[10.5px] uppercase tracking-[0.18em] text-destructive underline-offset-4 hover:underline",children:"Retry"})]})]})}function G1({profile:n}){return h.jsxs(W1,{openDelay:120,children:[h.jsx(H1,{asChild:!0,children:h.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 font-mono text-[10.5px] uppercase tracking-[0.18em] text-muted-foreground transition-colors hover:text-foreground",children:[h.jsx(bv,{className:"h-3 w-3"}),n.version]})}),h.jsx(mh,{side:"left",align:"end",className:"w-[280px] text-[12.5px]",children:h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(qf,{k:"Version",v:n.version??"—"}),h.jsx(qf,{k:"Rule pack",v:n.rule_pack??"—"})]})})]})}function Y1(){return h.jsxs("div",{className:"rounded-xl border bg-card p-4",children:[h.jsx(Bn,{className:"h-3 w-16"}),h.jsx(Bn,{className:"mt-3 h-7 w-24"}),h.jsx(Bn,{className:"mt-3 h-3 w-full"}),h.jsx(Bn,{className:"mt-1.5 h-3 w-3/4"})]})}function Q1({profile:n,active:i,pending:l,disabled:a,onActivate:c}){const d=B1[n.id];return h.jsxs("button",{type:"button",onClick:c,disabled:a,className:me("group relative flex flex-col overflow-hidden rounded-xl border text-left transition-shadow duration-200","disabled:pointer-events-none disabled:opacity-60",i?me("bg-brand-gradient border-brand-dark text-brand-foreground","shadow-[inset_0_1px_0_rgba(255,255,255,0.10),inset_0_0_0_1px_rgba(255,255,255,0.04),0_10px_30px_-8px_rgba(21,40,34,0.45)]","hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.14),inset_0_0_0_1px_rgba(255,255,255,0.06),0_18px_48px_-10px_rgba(21,40,34,0.55)]"):me("bg-card","shadow-[inset_0_1px_0_rgba(255,255,255,0.8),0_1px_2px_rgba(15,17,21,0.04)]","hover:border-foreground/15 hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.8),0_6px_18px_-6px_rgba(15,17,21,0.10)]")),children:[l&&h.jsx("span",{className:"absolute inset-x-0 bottom-0 h-px overflow-hidden",children:h.jsx("span",{className:me("block h-full w-1/3 animate-[shimmer_1.2s_linear_infinite]",i?"bg-white":"bg-foreground")})}),h.jsxs("div",{className:"flex items-center justify-between px-5 pt-4",children:[h.jsx(X1,{filled:d,active:i}),h.jsxs("div",{className:"flex items-center gap-2",children:[n.recommended&&!l&&h.jsx("span",{className:me("font-mono text-[9.5px] font-medium uppercase tracking-[0.18em]",i?"text-white/70":"text-muted-foreground"),children:"Recommended"}),l&&h.jsxs("span",{className:me("inline-flex items-center gap-1 font-mono text-[9.5px] uppercase tracking-[0.18em]",i?"text-white/70":"text-muted-foreground"),children:[h.jsx(jv,{className:"h-3 w-3 animate-spin"}),"Activating"]})]})]}),h.jsxs("div",{className:"px-5 pt-2.5",children:[h.jsx("div",{className:"text-[22px] font-semibold leading-tight tracking-tight",children:n.label}),h.jsx("p",{className:me("mt-1 text-[12.5px] leading-snug",i?"text-white/85":"text-foreground/80"),children:n.lede}),h.jsx("p",{className:me("mt-0.5 text-[11.5px] leading-snug",i?"text-white/55":"text-muted-foreground"),children:n.hint})]}),h.jsx("div",{className:me("mt-3 border-t px-5 py-2.5 font-mono text-[10px] uppercase tracking-[0.22em]",i?"border-white/15 text-white":"border-border text-muted-foreground/70"),children:i?"Active profile":"Tap to activate"})]})}function X1({filled:n,active:i}){return h.jsx("div",{className:"flex items-center gap-1","aria-hidden":"true",children:[1,2,3].map(l=>h.jsx("span",{className:me("h-1 w-2.5 rounded-full transition-colors",l<=n?i?"bg-white":"bg-foreground":i?"bg-white/25":"bg-muted-foreground/25")},l))})}const Un="session-local-guard-preview";new Date(Date.now()-120*1e3).toISOString();new Date(Date.now()-420*1e3).toISOString(),new Date(Date.now()-360*1e3).toISOString(),new Date(Date.now()-300*1e3).toISOString(),new Date(Date.now()-240*1e3).toISOString(),new Date(Date.now()-180*1e3).toISOString(),new Date(Date.now()-120*1e3).toISOString(),new Date(Date.now()-60*1e3).toISOString();function K1({session:n,loading:i}){return h.jsxs("header",{className:"flex items-center justify-between gap-4 border-b bg-background px-10 py-5",children:[h.jsx("div",{className:"flex min-w-0 items-center gap-3",children:i?h.jsx(Bn,{className:"h-6 w-60"}):h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"relative flex h-2 w-2 shrink-0",children:[h.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-brand opacity-50"}),h.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-brand"})]}),h.jsx("span",{className:"truncate font-mono text-[17px] font-medium tracking-tight text-foreground",children:n?.session_id??"-"})]})}),h.jsxs(du,{children:[h.jsx(fu,{asChild:!0,children:h.jsx("span",{className:"cursor-default text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:"Observe mode"})}),h.jsx(xl,{side:"bottom",children:"Recording decisions but not enforcing them."})]})]})}function Z1({sessions:n,counts:i,selectedID:l,onSelect:a}){return h.jsxs("aside",{className:"flex min-h-0 flex-col border-r",children:[h.jsx("div",{className:"px-5 pb-6 pt-7",children:h.jsx("div",{className:"text-[18px] font-semibold tracking-tight",children:"Kontext"})}),h.jsxs(ll,{className:"flex-1 px-2",children:[h.jsx(J1,{label:"This session",count:i.all,active:!0}),n.length>1&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-2.5 pb-1.5 pt-6 text-[10.5px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:"Recent"}),h.jsx("div",{className:"flex flex-col gap-0.5",children:n.slice(0,12).map(c=>h.jsxs("button",{type:"button",onClick:()=>a(c.session_id),className:me("flex items-center justify-between gap-2 rounded-md px-2.5 py-1.5 text-left text-[12.5px] transition-colors hover:bg-accent/60",c.session_id===l&&"bg-accent text-foreground"),children:[h.jsx("span",{className:"truncate font-mono text-muted-foreground",children:c.session_id}),h.jsx("span",{className:"shrink-0 tabular-nums text-[11px] text-muted-foreground",children:c.actions})]},c.session_id))})]})]})]})}function J1({label:n,count:i,active:l}){return h.jsxs("button",{type:"button",className:me("flex w-full items-center justify-between rounded-md px-2.5 py-1.5 text-left text-[13px] font-medium transition-colors",l?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/60 hover:text-foreground"),children:[h.jsx("span",{children:n}),h.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:i})]})}const q1=[{id:"deny",label:"Would deny"},{id:"ask",label:"Needs ask"},{id:"allow",label:"Allowed"}],eS=[{kind:"deny",label:"Would deny"},{kind:"ask",label:"Ask"},{kind:"allow",label:"Allow"}];function tS({counts:n,active:i,onSelect:l,loading:a}){return h.jsxs("section",{className:"overflow-hidden rounded-xl border bg-card shadow-[inset_0_1px_0_rgba(255,255,255,0.8),0_1px_2px_rgba(0,0,0,0.04)]",children:[h.jsx(nS,{count:n.all,active:i==="all",loading:a,onClick:()=>l("all")}),h.jsx("div",{className:"grid divide-y md:grid-cols-3 md:divide-x md:divide-y-0",children:q1.map(c=>h.jsx(rS,{id:c.id,label:c.label,count:n[c.id],total:n.all,active:i===c.id,loading:a,onClick:()=>l(c.id)},c.id))}),h.jsx(oS,{counts:n})]})}function nS({count:n,active:i,loading:l,onClick:a}){return h.jsxs("button",{type:"button",onClick:a,"aria-label":"Show all decisions",className:me("flex w-full items-center gap-3 border-b bg-muted/10 px-6 py-3 text-left transition-colors","hover:bg-muted/30",i&&"bg-muted/40"),children:[l?h.jsx(Bn,{className:"h-7 w-10"}):h.jsx("span",{className:"font-mono text-[26px] font-semibold leading-none tabular-nums text-foreground",children:n}),h.jsx("div",{className:"min-w-0",children:h.jsx("span",{className:me("text-[13px] font-medium",i?"text-foreground":"text-muted-foreground"),children:"decisions captured"})})]})}function rS({id:n,label:i,count:l,total:a,active:c,loading:d,onClick:f}){const m=Math.round(l/Math.max(1,a)*100),v=l===0?"text-muted-foreground/40":bo[n].text;return h.jsxs("button",{type:"button",onClick:f,className:me("group relative flex items-baseline gap-4 px-6 py-5 text-left transition-colors","hover:bg-muted/30",c&&"bg-muted/40"),children:[d?h.jsx(Bn,{className:"h-9 w-12"}):h.jsx("span",{className:me("font-mono text-[36px] font-semibold leading-none tracking-tight tabular-nums",v),children:l}),h.jsxs("div",{className:"flex flex-col leading-tight",children:[h.jsx("span",{className:me("font-mono text-[10px] font-medium uppercase tracking-[0.22em]",c?"text-foreground":"text-muted-foreground"),children:i}),h.jsxs("span",{className:"mt-1 text-[11px] text-muted-foreground/70",children:[m,"% of session"]})]})]})}function oS({counts:n}){const i=eS.map(l=>({count:n[l.kind],color:bo[l.kind].bg,label:l.label})).filter(l=>l.count>0);return h.jsx("div",{className:"border-t bg-muted/20 px-6 py-3",children:h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("div",{className:"flex h-1.5 flex-1 gap-0.5 overflow-hidden rounded-full bg-muted/60",children:i.length===0?h.jsx("div",{className:"w-full bg-muted-foreground/15"}):i.map(l=>h.jsxs(du,{children:[h.jsx(fu,{asChild:!0,children:h.jsx("div",{className:me("transition-opacity hover:opacity-80",l.color),style:{flex:l.count},"aria-label":`${l.count} ${l.label}`})}),h.jsxs(xl,{side:"top",children:[l.count," ",l.label.toLowerCase()]})]},l.label))}),h.jsx("div",{className:"flex items-center gap-3 font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:i.length===0?h.jsx("span",{children:"No activity yet"}):i.map(l=>h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h.jsx("span",{className:me("h-1.5 w-1.5 rounded-full",l.color)}),l.label,h.jsx("span",{className:"tabular-nums text-foreground/70",children:l.count})]},l.label))})]})})}function iS(){const[n,i]=g.useState([]),[l,a]=g.useState(""),[c,d]=g.useState([]),[f,m]=g.useState("all"),[v,x]=g.useState(null),[y,S]=g.useState(""),[_,k]=g.useState(null),[b,E]=g.useState(null),[j,A]=g.useState(""),D=g.useRef("");g.useEffect(()=>{G(),le();const ee=setInterval(G,3e3);return()=>clearInterval(ee)},[]),g.useEffect(()=>{l&&B(l),D.current=l},[l]);function $(ee){D.current=ee,a(ee)}function M(ee){return i(ie=>s1(ie,ee)?ie:ee),S(""),ee}function U(ee){d(ee),S("")}function G(){k1().then(ee=>{const ie=M(ee),se=D.current,L=ie.some(Y=>Y.session_id===se)?se:ie[0]?.session_id;L?L!==se?$(L):B(L):(D.current="",a(""),d([]),x(null))}).catch(ee=>S(Co(ee)))}function B(ee){N1(ee).then(ie=>{D.current===ee&&U(ie)}).catch(ie=>S(Co(ie)))}function le(){P1().then(ee=>{k(ee),A("")}).catch(ee=>{A(`Couldn't load policy profile. ${Co(ee)}`)})}function te(ee){ee===_?.profile||b||(E(ee),A(""),b1(ee).then(k).catch(ie=>A(`Couldn't update policy profile. ${Co(ie)}`)).finally(()=>E(null)))}const{counts:ne,groups:ue}=g.useMemo(()=>l1(c),[c]),q=g.useMemo(()=>v?c.find(ee=>ee.id===v)??null:null,[v,c]),he=g.useMemo(()=>n.find(ee=>ee.session_id===l),[n,l]),ce=n.length===0&&!y;return h.jsx(Xw,{delayDuration:150,children:h.jsxs("div",{className:"grid h-screen grid-cols-[252px_1fr] bg-background text-foreground",children:[h.jsx(Z1,{sessions:n,counts:ne,selectedID:l,onSelect:$}),h.jsxs("main",{className:"flex min-h-0 flex-col overflow-hidden",children:[h.jsx(K1,{session:he,loading:ce}),h.jsx(ll,{className:"flex-1",children:h.jsxs("div",{className:"px-10 pb-10 pt-8",children:[h.jsx(V1,{profile:_,pending:b,error:j,onActivate:te,onRetry:le}),h.jsx(Jf,{label:"Activity",description:"What was decided this session.",children:h.jsx(tS,{counts:ne,active:f,onSelect:m,loading:ce})}),y&&h.jsxs("div",{className:"mt-4 flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-[12px] text-destructive",children:[h.jsx(cp,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{children:y})]}),h.jsx(Jf,{label:"Log",description:"Tool calls in chronological order.",children:h.jsx(g1,{tab:f,groups:ue,openId:v,onOpen:x,hasAny:c.length>0})})]})})]}),h.jsx(c0,{open:!!q,onOpenChange:ee=>!ee&&x(null),children:h.jsx(hm,{side:"right",className:"w-[540px] max-w-[92vw] p-0 sm:max-w-[540px]",children:q&&h.jsx(R1,{event:q})})})]})})}const rp=document.getElementById("root");rp&&xv.createRoot(rp).render(h.jsx(ip.StrictMode,{children:h.jsx(iS,{})})); +For more information, see https://radix-ui.com/primitives/docs/components/${i.docsSlug}`;return g.useEffect(()=>{n&&(document.getElementById(n)||console.error(l))},[l,n]),null},iw="DialogDescriptionWarning",lw=({contentRef:n,descriptionId:i})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${cm(iw).contentName}}.`;return g.useEffect(()=>{const c=n.current?.getAttribute("aria-describedby");i&&c&&(document.getElementById(i)||console.warn(a))},[a,n,i]),null},sw=Zp,aw=em,dm=tm,fm=nm,pm=om,mm=lm,uw=am;const Ff=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,$f=Rp,cw=(n,i)=>l=>{var a;if(i?.variants==null)return $f(n,l?.class,l?.className);const{variants:c,defaultVariants:d}=i,f=Object.keys(c).map(x=>{const y=l?.[x],S=d?.[x];if(y===null)return null;const _=Ff(y)||Ff(S);return c[x][_]}),m=l&&Object.entries(l).reduce((x,y)=>{let[S,_]=y;return _===void 0||(x[S]=_),x},{}),v=i==null||(a=i.compoundVariants)===null||a===void 0?void 0:a.reduce((x,y)=>{let{class:S,className:_,...k}=y;return Object.entries(k).every(b=>{let[E,j]=b;return Array.isArray(j)?j.includes({...d,...m}[E]):{...d,...m}[E]===j})?[...x,S,_]:x},[]);return $f(n,f,v,l?.class,l?.className)},dw=sw,fw=aw,hm=g.forwardRef(({className:n,...i},l)=>h.jsx(dm,{className:ge("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...i,ref:l}));hm.displayName=dm.displayName;const pw=cw("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),gm=g.forwardRef(({side:n="right",className:i,children:l,...a},c)=>h.jsxs(fw,{children:[h.jsx(hm,{}),h.jsxs(fm,{ref:c,className:ge(pw({side:n}),i),...a,children:[l,h.jsxs(uw,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[h.jsx(Lv,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));gm.displayName=fm.displayName;const vm=({className:n,...i})=>h.jsx("div",{className:ge("flex flex-col space-y-2 text-center sm:text-left",n),...i});vm.displayName="SheetHeader";const ym=g.forwardRef(({className:n,...i},l)=>h.jsx(pm,{ref:l,className:ge("text-lg font-semibold text-foreground",n),...i}));ym.displayName=pm.displayName;const mw=g.forwardRef(({className:n,...i},l)=>h.jsx(mm,{ref:l,className:ge("text-sm text-muted-foreground",n),...i}));mw.displayName=mm.displayName;const hw=["top","right","bottom","left"],Pn=Math.min,ft=Math.max,Ji=Math.round,Vi=Math.floor,$t=n=>({x:n,y:n}),gw={left:"right",right:"left",bottom:"top",top:"bottom"};function $a(n,i,l){return ft(n,Pn(i,l))}function en(n,i){return typeof n=="function"?n(i):n}function tn(n){return n.split("-")[0]}function Tr(n){return n.split("-")[1]}function nu(n){return n==="x"?"y":"x"}function ru(n){return n==="y"?"height":"width"}function Ft(n){const i=n[0];return i==="t"||i==="b"?"y":"x"}function ou(n){return nu(Ft(n))}function vw(n,i,l){l===void 0&&(l=!1);const a=Tr(n),c=ou(n),d=ru(c);let f=c==="x"?a===(l?"end":"start")?"right":"left":a==="start"?"bottom":"top";return i.reference[d]>i.floating[d]&&(f=qi(f)),[f,qi(f)]}function yw(n){const i=qi(n);return[Wa(n),i,Wa(i)]}function Wa(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const Wf=["left","right"],Hf=["right","left"],xw=["top","bottom"],ww=["bottom","top"];function Sw(n,i,l){switch(n){case"top":case"bottom":return l?i?Hf:Wf:i?Wf:Hf;case"left":case"right":return i?xw:ww;default:return[]}}function _w(n,i,l,a){const c=Tr(n);let d=Sw(tn(n),l==="start",a);return c&&(d=d.map(f=>f+"-"+c),i&&(d=d.concat(d.map(Wa)))),d}function qi(n){const i=tn(n);return gw[i]+n.slice(i.length)}function Cw(n){return{top:0,right:0,bottom:0,left:0,...n}}function xm(n){return typeof n!="number"?Cw(n):{top:n,right:n,bottom:n,left:n}}function el(n){const{x:i,y:l,width:a,height:c}=n;return{width:a,height:c,top:l,left:i,right:i+a,bottom:l+c,x:i,y:l}}function Uf(n,i,l){let{reference:a,floating:c}=n;const d=Ft(i),f=ou(i),m=ru(f),v=tn(i),x=d==="y",y=a.x+a.width/2-c.width/2,S=a.y+a.height/2-c.height/2,_=a[m]/2-c[m]/2;let k;switch(v){case"top":k={x:y,y:a.y-c.height};break;case"bottom":k={x:y,y:a.y+a.height};break;case"right":k={x:a.x+a.width,y:S};break;case"left":k={x:a.x-c.width,y:S};break;default:k={x:a.x,y:a.y}}switch(Tr(i)){case"start":k[f]-=_*(l&&x?-1:1);break;case"end":k[f]+=_*(l&&x?-1:1);break}return k}async function Ew(n,i){var l;i===void 0&&(i={});const{x:a,y:c,platform:d,rects:f,elements:m,strategy:v}=n,{boundary:x="clippingAncestors",rootBoundary:y="viewport",elementContext:S="floating",altBoundary:_=!1,padding:k=0}=en(i,n),b=xm(k),j=m[_?S==="floating"?"reference":"floating":S],A=el(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(j)))==null||l?j:j.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(m.floating)),boundary:x,rootBoundary:y,strategy:v})),D=S==="floating"?{x:a,y:c,width:f.floating.width,height:f.floating.height}:f.reference,$=await(d.getOffsetParent==null?void 0:d.getOffsetParent(m.floating)),M=await(d.isElement==null?void 0:d.isElement($))?await(d.getScale==null?void 0:d.getScale($))||{x:1,y:1}:{x:1,y:1},U=el(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:D,offsetParent:$,strategy:v}):D);return{top:(A.top-U.top+b.top)/M.y,bottom:(U.bottom-A.bottom+b.bottom)/M.y,left:(A.left-U.left+b.left)/M.x,right:(U.right-A.right+b.right)/M.x}}const kw=50,Nw=async(n,i,l)=>{const{placement:a="bottom",strategy:c="absolute",middleware:d=[],platform:f}=l,m=f.detectOverflow?f:{...f,detectOverflow:Ew},v=await(f.isRTL==null?void 0:f.isRTL(i));let x=await f.getElementRects({reference:n,floating:i,strategy:c}),{x:y,y:S}=Uf(x,a,v),_=a,k=0;const b={};for(let E=0;E ({name:"arrow",options:n,async fn(i){const{x:l,y:a,placement:c,rects:d,platform:f,elements:m,middlewareData:v}=i,{element:x,padding:y=0}=en(n,i)||{};if(x==null)return{};const S=xm(y),_={x:l,y:a},k=ou(c),b=ru(k),E=await f.getDimensions(x),j=k==="y",A=j?"top":"left",D=j?"bottom":"right",$=j?"clientHeight":"clientWidth",M=d.reference[b]+d.reference[k]-_[k]-d.floating[b],U=_[k]-d.reference[k],G=await(f.getOffsetParent==null?void 0:f.getOffsetParent(x));let B=G?G[$]:0;(!B||!await(f.isElement==null?void 0:f.isElement(G)))&&(B=m.floating[$]||d.floating[b]);const le=M/2-U/2,te=B/2-E[b]/2-1,ne=Pn(S[A],te),ue=Pn(S[D],te),q=ne,me=B-E[b]-ue,ce=B/2-E[b]/2+le,ee=$a(q,ce,me),ie=!v.arrow&&Tr(c)!=null&&ce!==ee&&d.reference[b]/2-(ce ce<=0)){var ue,q;const ce=(((ue=d.flip)==null?void 0:ue.index)||0)+1,ee=B[ce];if(ee&&(!(S==="alignment"?D!==Ft(ee):!1)||ne.every(L=>Ft(L.placement)===D?L.overflows[0]>0:!0)))return{data:{index:ce,overflows:ne},reset:{placement:ee}};let ie=(q=ne.filter(se=>se.overflows[0]<=0).sort((se,L)=>se.overflows[1]-L.overflows[1])[0])==null?void 0:q.placement;if(!ie)switch(k){case"bestFit":{var me;const se=(me=ne.filter(L=>{if(G){const Y=Ft(L.placement);return Y===D||Y==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(Y=>Y>0).reduce((Y,V)=>Y+V,0)]).sort((L,Y)=>L[1]-Y[1])[0])==null?void 0:me[0];se&&(ie=se);break}case"initialPlacement":ie=m;break}if(c!==ie)return{reset:{placement:ie}}}return{}}}};function Bf(n,i){return{top:n.top-i.height,right:n.right-i.width,bottom:n.bottom-i.height,left:n.left-i.width}}function Vf(n){return hw.some(i=>n[i]>=0)}const Rw=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(i){const{rects:l,platform:a}=i,{strategy:c="referenceHidden",...d}=en(n,i);switch(c){case"referenceHidden":{const f=await a.detectOverflow(i,{...d,elementContext:"reference"}),m=Bf(f,l.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Vf(m)}}}case"escaped":{const f=await a.detectOverflow(i,{...d,altBoundary:!0}),m=Bf(f,l.floating);return{data:{escapedOffsets:m,escaped:Vf(m)}}}default:return{}}}}},wm=new Set(["left","top"]);async function jw(n,i){const{placement:l,platform:a,elements:c}=n,d=await(a.isRTL==null?void 0:a.isRTL(c.floating)),f=tn(l),m=Tr(l),v=Ft(l)==="y",x=wm.has(f)?-1:1,y=d&&v?-1:1,S=en(i,n);let{mainAxis:_,crossAxis:k,alignmentAxis:b}=typeof S=="number"?{mainAxis:S,crossAxis:0,alignmentAxis:null}:{mainAxis:S.mainAxis||0,crossAxis:S.crossAxis||0,alignmentAxis:S.alignmentAxis};return m&&typeof b=="number"&&(k=m==="end"?b*-1:b),v?{x:k*y,y:_*x}:{x:_*x,y:k*y}}const Tw=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(i){var l,a;const{x:c,y:d,placement:f,middlewareData:m}=i,v=await jw(i,n);return f===((l=m.offset)==null?void 0:l.placement)&&(a=m.arrow)!=null&&a.alignmentOffset?{}:{x:c+v.x,y:d+v.y,data:{...v,placement:f}}}}},Ow=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(i){const{x:l,y:a,placement:c,platform:d}=i,{mainAxis:f=!0,crossAxis:m=!1,limiter:v={fn:A=>{let{x:D,y:$}=A;return{x:D,y:$}}},...x}=en(n,i),y={x:l,y:a},S=await d.detectOverflow(i,x),_=Ft(tn(c)),k=nu(_);let b=y[k],E=y[_];if(f){const A=k==="y"?"top":"left",D=k==="y"?"bottom":"right",$=b+S[A],M=b-S[D];b=$a($,b,M)}if(m){const A=_==="y"?"top":"left",D=_==="y"?"bottom":"right",$=E+S[A],M=E-S[D];E=$a($,E,M)}const j=v.fn({...i,[k]:b,[_]:E});return{...j,data:{x:j.x-l,y:j.y-a,enabled:{[k]:f,[_]:m}}}}}},Aw=function(n){return n===void 0&&(n={}),{options:n,fn(i){const{x:l,y:a,placement:c,rects:d,middlewareData:f}=i,{offset:m=0,mainAxis:v=!0,crossAxis:x=!0}=en(n,i),y={x:l,y:a},S=Ft(c),_=nu(S);let k=y[_],b=y[S];const E=en(m,i),j=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(v){const $=_==="y"?"height":"width",M=d.reference[_]-d.floating[$]+j.mainAxis,U=d.reference[_]+d.reference[$]-j.mainAxis;kU&&(k=U)}if(x){var A,D;const $=_==="y"?"width":"height",M=wm.has(tn(c)),U=d.reference[S]-d.floating[$]+(M&&((A=f.offset)==null?void 0:A[S])||0)+(M?0:j.crossAxis),G=d.reference[S]+d.reference[$]+(M?0:((D=f.offset)==null?void 0:D[S])||0)-(M?j.crossAxis:0);bG&&(b=G)}return{[_]:k,[S]:b}}}},Dw=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(i){var l,a;const{placement:c,rects:d,platform:f,elements:m}=i,{apply:v=()=>{},...x}=en(n,i),y=await f.detectOverflow(i,x),S=tn(c),_=Tr(c),k=Ft(c)==="y",{width:b,height:E}=d.floating;let j,A;S==="top"||S==="bottom"?(j=S,A=_===(await(f.isRTL==null?void 0:f.isRTL(m.floating))?"start":"end")?"left":"right"):(A=S,j=_==="end"?"top":"bottom");const D=E-y.top-y.bottom,$=b-y.left-y.right,M=Pn(E-y[j],D),U=Pn(b-y[A],$),G=!i.middlewareData.shift;let B=M,le=U;if((l=i.middlewareData.shift)!=null&&l.enabled.x&&(le=$),(a=i.middlewareData.shift)!=null&&a.enabled.y&&(B=D),G&&!_){const ne=ft(y.left,0),ue=ft(y.right,0),q=ft(y.top,0),me=ft(y.bottom,0);k?le=b-2*(ne!==0||ue!==0?ne+ue:ft(y.left,y.right)):B=E-2*(q!==0||me!==0?q+me:ft(y.top,y.bottom))}await v({...i,availableWidth:le,availableHeight:B});const te=await f.getDimensions(m.floating);return b!==te.width||E!==te.height?{reset:{rects:!0}}:{}}}};function dl(){return typeof window<"u"}function Or(n){return Sm(n)?(n.nodeName||"").toLowerCase():"#document"}function mt(n){var i;return(n==null||(i=n.ownerDocument)==null?void 0:i.defaultView)||window}function Ut(n){var i;return(i=(Sm(n)?n.ownerDocument:n.document)||window.document)==null?void 0:i.documentElement}function Sm(n){return dl()?n instanceof Node||n instanceof mt(n).Node:!1}function Rt(n){return dl()?n instanceof Element||n instanceof mt(n).Element:!1}function nn(n){return dl()?n instanceof HTMLElement||n instanceof mt(n).HTMLElement:!1}function Gf(n){return!dl()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof mt(n).ShadowRoot}function Po(n){const{overflow:i,overflowX:l,overflowY:a,display:c}=jt(n);return/auto|scroll|overlay|hidden|clip/.test(i+a+l)&&c!=="inline"&&c!=="contents"}function Lw(n){return/^(table|td|th)$/.test(Or(n))}function fl(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const Mw=/transform|translate|scale|rotate|perspective|filter/,Iw=/paint|layout|strict|content/,Hn=n=>!!n&&n!=="none";let Ta;function iu(n){const i=Rt(n)?jt(n):n;return Hn(i.transform)||Hn(i.translate)||Hn(i.scale)||Hn(i.rotate)||Hn(i.perspective)||!lu()&&(Hn(i.backdropFilter)||Hn(i.filter))||Mw.test(i.willChange||"")||Iw.test(i.contain||"")}function zw(n){let i=bn(n);for(;nn(i)&&!Nr(i);){if(iu(i))return i;if(fl(i))return null;i=bn(i)}return null}function lu(){return Ta==null&&(Ta=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ta}function Nr(n){return/^(html|body|#document)$/.test(Or(n))}function jt(n){return mt(n).getComputedStyle(n)}function pl(n){return Rt(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function bn(n){if(Or(n)==="html")return n;const i=n.assignedSlot||n.parentNode||Gf(n)&&n.host||Ut(n);return Gf(i)?i.host:i}function _m(n){const i=bn(n);return Nr(i)?n.ownerDocument?n.ownerDocument.body:n.body:nn(i)&&Po(i)?i:_m(i)}function ko(n,i,l){var a;i===void 0&&(i=[]),l===void 0&&(l=!0);const c=_m(n),d=c===((a=n.ownerDocument)==null?void 0:a.body),f=mt(c);if(d){const m=Ha(f);return i.concat(f,f.visualViewport||[],Po(c)?c:[],m&&l?ko(m):[])}else return i.concat(c,ko(c,[],l))}function Ha(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Cm(n){const i=jt(n);let l=parseFloat(i.width)||0,a=parseFloat(i.height)||0;const c=nn(n),d=c?n.offsetWidth:l,f=c?n.offsetHeight:a,m=Ji(l)!==d||Ji(a)!==f;return m&&(l=d,a=f),{width:l,height:a,$:m}}function su(n){return Rt(n)?n:n.contextElement}function Er(n){const i=su(n);if(!nn(i))return $t(1);const l=i.getBoundingClientRect(),{width:a,height:c,$:d}=Cm(i);let f=(d?Ji(l.width):l.width)/a,m=(d?Ji(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!m||!Number.isFinite(m))&&(m=1),{x:f,y:m}}const Fw=$t(0);function Em(n){const i=mt(n);return!lu()||!i.visualViewport?Fw:{x:i.visualViewport.offsetLeft,y:i.visualViewport.offsetTop}}function $w(n,i,l){return i===void 0&&(i=!1),!l||i&&l!==mt(n)?!1:i}function Gn(n,i,l,a){i===void 0&&(i=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),d=su(n);let f=$t(1);i&&(a?Rt(a)&&(f=Er(a)):f=Er(n));const m=$w(d,l,a)?Em(d):$t(0);let v=(c.left+m.x)/f.x,x=(c.top+m.y)/f.y,y=c.width/f.x,S=c.height/f.y;if(d){const _=mt(d),k=a&&Rt(a)?mt(a):a;let b=_,E=Ha(b);for(;E&&a&&k!==b;){const j=Er(E),A=E.getBoundingClientRect(),D=jt(E),$=A.left+(E.clientLeft+parseFloat(D.paddingLeft))*j.x,M=A.top+(E.clientTop+parseFloat(D.paddingTop))*j.y;v*=j.x,x*=j.y,y*=j.x,S*=j.y,v+=$,x+=M,b=mt(E),E=Ha(b)}}return el({width:y,height:S,x:v,y:x})}function ml(n,i){const l=pl(n).scrollLeft;return i?i.left+l:Gn(Ut(n)).left+l}function km(n,i){const l=n.getBoundingClientRect(),a=l.left+i.scrollLeft-ml(n,l),c=l.top+i.scrollTop;return{x:a,y:c}}function Ww(n){let{elements:i,rect:l,offsetParent:a,strategy:c}=n;const d=c==="fixed",f=Ut(a),m=i?fl(i.floating):!1;if(a===f||m&&d)return l;let v={scrollLeft:0,scrollTop:0},x=$t(1);const y=$t(0),S=nn(a);if((S||!S&&!d)&&((Or(a)!=="body"||Po(f))&&(v=pl(a)),S)){const k=Gn(a);x=Er(a),y.x=k.x+a.clientLeft,y.y=k.y+a.clientTop}const _=f&&!S&&!d?km(f,v):$t(0);return{width:l.width*x.x,height:l.height*x.y,x:l.x*x.x-v.scrollLeft*x.x+y.x+_.x,y:l.y*x.y-v.scrollTop*x.y+y.y+_.y}}function Hw(n){return Array.from(n.getClientRects())}function Uw(n){const i=Ut(n),l=pl(n),a=n.ownerDocument.body,c=ft(i.scrollWidth,i.clientWidth,a.scrollWidth,a.clientWidth),d=ft(i.scrollHeight,i.clientHeight,a.scrollHeight,a.clientHeight);let f=-l.scrollLeft+ml(n);const m=-l.scrollTop;return jt(a).direction==="rtl"&&(f+=ft(i.clientWidth,a.clientWidth)-c),{width:c,height:d,x:f,y:m}}const Yf=25;function Bw(n,i){const l=mt(n),a=Ut(n),c=l.visualViewport;let d=a.clientWidth,f=a.clientHeight,m=0,v=0;if(c){d=c.width,f=c.height;const y=lu();(!y||y&&i==="fixed")&&(m=c.offsetLeft,v=c.offsetTop)}const x=ml(a);if(x<=0){const y=a.ownerDocument,S=y.body,_=getComputedStyle(S),k=y.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,b=Math.abs(a.clientWidth-S.clientWidth-k);b<=Yf&&(d-=b)}else x<=Yf&&(d+=x);return{width:d,height:f,x:m,y:v}}function Vw(n,i){const l=Gn(n,!0,i==="fixed"),a=l.top+n.clientTop,c=l.left+n.clientLeft,d=nn(n)?Er(n):$t(1),f=n.clientWidth*d.x,m=n.clientHeight*d.y,v=c*d.x,x=a*d.y;return{width:f,height:m,x:v,y:x}}function Qf(n,i,l){let a;if(i==="viewport")a=Bw(n,l);else if(i==="document")a=Uw(Ut(n));else if(Rt(i))a=Vw(i,l);else{const c=Em(n);a={x:i.x-c.x,y:i.y-c.y,width:i.width,height:i.height}}return el(a)}function Nm(n,i){const l=bn(n);return l===i||!Rt(l)||Nr(l)?!1:jt(l).position==="fixed"||Nm(l,i)}function Gw(n,i){const l=i.get(n);if(l)return l;let a=ko(n,[],!1).filter(m=>Rt(m)&&Or(m)!=="body"),c=null;const d=jt(n).position==="fixed";let f=d?bn(n):n;for(;Rt(f)&&!Nr(f);){const m=jt(f),v=iu(f);!v&&m.position==="fixed"&&(c=null),(d?!v&&!c:!v&&m.position==="static"&&!!c&&(c.position==="absolute"||c.position==="fixed")||Po(f)&&!v&&Nm(n,f))?a=a.filter(y=>y!==f):c=m,f=bn(f)}return i.set(n,a),a}function Yw(n){let{element:i,boundary:l,rootBoundary:a,strategy:c}=n;const f=[...l==="clippingAncestors"?fl(i)?[]:Gw(i,this._c):[].concat(l),a],m=Qf(i,f[0],c);let v=m.top,x=m.right,y=m.bottom,S=m.left;for(let _=1;_ {f(!1,1e-7)},1e3)}B===1&&!bm(x,n.getBoundingClientRect())&&f(),M=!1}try{l=new IntersectionObserver(U,{...$,root:c.ownerDocument})}catch{l=new IntersectionObserver(U,$)}l.observe(n)}return f(!0),d}function e0(n,i,l,a){a===void 0&&(a={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:v=!1}=a,x=su(n),y=c||d?[...x?ko(x):[],...i?ko(i):[]]:[];y.forEach(A=>{c&&A.addEventListener("scroll",l,{passive:!0}),d&&A.addEventListener("resize",l)});const S=x&&m?qw(x,l):null;let _=-1,k=null;f&&(k=new ResizeObserver(A=>{let[D]=A;D&&D.target===x&&k&&i&&(k.unobserve(i),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var $;($=k)==null||$.observe(i)})),l()}),x&&!v&&k.observe(x),i&&k.observe(i));let b,E=v?Gn(n):null;v&&j();function j(){const A=Gn(n);E&&!bm(E,A)&&l(),E=A,b=requestAnimationFrame(j)}return l(),()=>{var A;y.forEach(D=>{c&&D.removeEventListener("scroll",l),d&&D.removeEventListener("resize",l)}),S?.(),(A=k)==null||A.disconnect(),k=null,v&&cancelAnimationFrame(b)}}const t0=Tw,n0=Ow,r0=bw,o0=Dw,i0=Rw,Kf=Pw,l0=Aw,s0=(n,i,l)=>{const a=new Map,c={platform:Jw,...l},d={...c.platform,_c:a};return Nw(n,i,{...c,platform:d})};var a0=typeof document<"u",u0=function(){},Qi=a0?g.useLayoutEffect:u0;function tl(n,i){if(n===i)return!0;if(typeof n!=typeof i)return!1;if(typeof n=="function"&&n.toString()===i.toString())return!0;let l,a,c;if(n&&i&&typeof n=="object"){if(Array.isArray(n)){if(l=n.length,l!==i.length)return!1;for(a=l;a--!==0;)if(!tl(n[a],i[a]))return!1;return!0}if(c=Object.keys(n),l=c.length,l!==Object.keys(i).length)return!1;for(a=l;a--!==0;)if(!{}.hasOwnProperty.call(i,c[a]))return!1;for(a=l;a--!==0;){const d=c[a];if(!(d==="_owner"&&n.$$typeof)&&!tl(n[d],i[d]))return!1}return!0}return n!==n&&i!==i}function Rm(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Zf(n,i){const l=Rm(n);return Math.round(i*l)/l}function Aa(n){const i=g.useRef(n);return Qi(()=>{i.current=n}),i}function c0(n){n===void 0&&(n={});const{placement:i="bottom",strategy:l="absolute",middleware:a=[],platform:c,elements:{reference:d,floating:f}={},transform:m=!0,whileElementsMounted:v,open:x}=n,[y,S]=g.useState({x:0,y:0,strategy:l,placement:i,middlewareData:{},isPositioned:!1}),[_,k]=g.useState(a);tl(_,a)||k(a);const[b,E]=g.useState(null),[j,A]=g.useState(null),D=g.useCallback(L=>{L!==G.current&&(G.current=L,E(L))},[]),$=g.useCallback(L=>{L!==B.current&&(B.current=L,A(L))},[]),M=d||b,U=f||j,G=g.useRef(null),B=g.useRef(null),le=g.useRef(y),te=v!=null,ne=Aa(v),ue=Aa(c),q=Aa(x),me=g.useCallback(()=>{if(!G.current||!B.current)return;const L={placement:i,strategy:l,middleware:_};ue.current&&(L.platform=ue.current),s0(G.current,B.current,L).then(Y=>{const V={...Y,isPositioned:q.current!==!1};ce.current&&!tl(le.current,V)&&(le.current=V,Ya.flushSync(()=>{S(V)}))})},[_,i,l,ue,q]);Qi(()=>{x===!1&&le.current.isPositioned&&(le.current.isPositioned=!1,S(L=>({...L,isPositioned:!1})))},[x]);const ce=g.useRef(!1);Qi(()=>(ce.current=!0,()=>{ce.current=!1}),[]),Qi(()=>{if(M&&(G.current=M),U&&(B.current=U),M&&U){if(ne.current)return ne.current(M,U,me);me()}},[M,U,me,ne,te]);const ee=g.useMemo(()=>({reference:G,floating:B,setReference:D,setFloating:$}),[D,$]),ie=g.useMemo(()=>({reference:M,floating:U}),[M,U]),se=g.useMemo(()=>{const L={position:l,left:0,top:0};if(!ie.floating)return L;const Y=Zf(ie.floating,y.x),V=Zf(ie.floating,y.y);return m?{...L,transform:"translate("+Y+"px, "+V+"px)",...Rm(ie.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:Y,top:V}},[l,m,ie.floating,y.x,y.y]);return g.useMemo(()=>({...y,update:me,refs:ee,elements:ie,floatingStyles:se}),[y,me,ee,ie,se])}const d0=n=>{function i(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:n,fn(l){const{element:a,padding:c}=typeof n=="function"?n(l):n;return a&&i(a)?a.current!=null?Kf({element:a.current,padding:c}).fn(l):{}:a?Kf({element:a,padding:c}).fn(l):{}}}},f0=(n,i)=>{const l=t0(n);return{name:l.name,fn:l.fn,options:[n,i]}},p0=(n,i)=>{const l=n0(n);return{name:l.name,fn:l.fn,options:[n,i]}},m0=(n,i)=>({fn:l0(n).fn,options:[n,i]}),h0=(n,i)=>{const l=r0(n);return{name:l.name,fn:l.fn,options:[n,i]}},g0=(n,i)=>{const l=o0(n);return{name:l.name,fn:l.fn,options:[n,i]}},v0=(n,i)=>{const l=i0(n);return{name:l.name,fn:l.fn,options:[n,i]}},y0=(n,i)=>{const l=d0(n);return{name:l.name,fn:l.fn,options:[n,i]}};var x0="Arrow",jm=g.forwardRef((n,i)=>{const{children:l,width:a=10,height:c=5,...d}=n;return h.jsx(De.svg,{...d,ref:i,width:a,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?l:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});jm.displayName=x0;var w0=jm;function S0(n){const[i,l]=g.useState(void 0);return Wt(()=>{if(n){l({width:n.offsetWidth,height:n.offsetHeight});const a=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let f,m;if("borderBoxSize"in d){const v=d.borderBoxSize,x=Array.isArray(v)?v[0]:v;f=x.inlineSize,m=x.blockSize}else f=n.offsetWidth,m=n.offsetHeight;l({width:f,height:m})});return a.observe(n,{box:"border-box"}),()=>a.unobserve(n)}else l(void 0)},[n]),i}var au="Popper",[Tm,hl]=Rr(au),[_0,Om]=Tm(au),Am=n=>{const{__scopePopper:i,children:l}=n,[a,c]=g.useState(null);return h.jsx(_0,{scope:i,anchor:a,onAnchorChange:c,children:l})};Am.displayName=au;var Dm="PopperAnchor",Lm=g.forwardRef((n,i)=>{const{__scopePopper:l,virtualRef:a,...c}=n,d=Om(Dm,l),f=g.useRef(null),m=We(i,f),v=g.useRef(null);return g.useEffect(()=>{const x=v.current;v.current=a?.current||f.current,x!==v.current&&d.onAnchorChange(v.current)}),a?null:h.jsx(De.div,{...c,ref:m})});Lm.displayName=Dm;var uu="PopperContent",[C0,E0]=Tm(uu),Mm=g.forwardRef((n,i)=>{const{__scopePopper:l,side:a="bottom",sideOffset:c=0,align:d="center",alignOffset:f=0,arrowPadding:m=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:S="partial",hideWhenDetached:_=!1,updatePositionStrategy:k="optimized",onPlaced:b,...E}=n,j=Om(uu,l),[A,D]=g.useState(null),$=We(i,Se=>D(Se)),[M,U]=g.useState(null),G=S0(M),B=G?.width??0,le=G?.height??0,te=a+(d!=="center"?"-"+d:""),ne=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},ue=Array.isArray(x)?x:[x],q=ue.length>0,me={padding:ne,boundary:ue.filter(N0),altBoundary:q},{refs:ce,floatingStyles:ee,placement:ie,isPositioned:se,middlewareData:L}=c0({strategy:"fixed",placement:te,whileElementsMounted:(...Se)=>e0(...Se,{animationFrame:k==="always"}),elements:{reference:j.anchor},middleware:[f0({mainAxis:c+le,alignmentAxis:f}),v&&p0({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?m0():void 0,...me}),v&&h0({...me}),g0({...me,apply:({elements:Se,rects:_e,availableWidth:Ne,availableHeight:Ze})=>{const{width:Yn,height:jo}=_e.reference,Bt=Se.floating.style;Bt.setProperty("--radix-popper-available-width",`${Ne}px`),Bt.setProperty("--radix-popper-available-height",`${Ze}px`),Bt.setProperty("--radix-popper-anchor-width",`${Yn}px`),Bt.setProperty("--radix-popper-anchor-height",`${jo}px`)}}),M&&y0({element:M,padding:m}),P0({arrowWidth:B,arrowHeight:le}),_&&v0({strategy:"referenceHidden",...me})]}),[Y,V]=Fm(ie),P=pt(b);Wt(()=>{se&&P?.()},[se,P]);const I=L.arrow?.x,de=L.arrow?.y,pe=L.arrow?.centerOffset!==0,[ye,xe]=g.useState();return Wt(()=>{A&&xe(window.getComputedStyle(A).zIndex)},[A]),h.jsx("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...ee,transform:se?ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:h.jsx(C0,{scope:l,placedSide:Y,onArrowChange:U,arrowX:I,arrowY:de,shouldHideArrow:pe,children:h.jsx(De.div,{"data-side":Y,"data-align":V,...E,ref:$,style:{...E.style,animation:se?void 0:"none"}})})})});Mm.displayName=uu;var Im="PopperArrow",k0={top:"bottom",right:"left",bottom:"top",left:"right"},zm=g.forwardRef(function(i,l){const{__scopePopper:a,...c}=i,d=E0(Im,a),f=k0[d.placedSide];return h.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:h.jsx(w0,{...c,ref:l,style:{...c.style,display:"block"}})})});zm.displayName=Im;function N0(n){return n!==null}var P0=n=>({name:"transformOrigin",options:n,fn(i){const{placement:l,rects:a,middlewareData:c}=i,f=c.arrow?.centerOffset!==0,m=f?0:n.arrowWidth,v=f?0:n.arrowHeight,[x,y]=Fm(l),S={start:"0%",center:"50%",end:"100%"}[y],_=(c.arrow?.x??0)+m/2,k=(c.arrow?.y??0)+v/2;let b="",E="";return x==="bottom"?(b=f?S:`${_}px`,E=`${-v}px`):x==="top"?(b=f?S:`${_}px`,E=`${a.floating.height+v}px`):x==="right"?(b=`${-v}px`,E=f?S:`${k}px`):x==="left"&&(b=`${a.floating.width+v}px`,E=f?S:`${k}px`),{data:{x:b,y:E}}}});function Fm(n){const[i,l="center"]=n.split("-");return[i,l]}var $m=Am,Wm=Lm,Hm=Mm,Um=zm,b0=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),R0="VisuallyHidden",Bm=g.forwardRef((n,i)=>h.jsx(De.span,{...n,ref:i,style:{...b0,...n.style}}));Bm.displayName=R0;var j0=Bm,[gl]=Rr("Tooltip",[hl]),vl=hl(),Vm="TooltipProvider",T0=700,Ua="tooltip.open",[O0,cu]=gl(Vm),Gm=n=>{const{__scopeTooltip:i,delayDuration:l=T0,skipDelayDuration:a=300,disableHoverableContent:c=!1,children:d}=n,f=g.useRef(!0),m=g.useRef(!1),v=g.useRef(0);return g.useEffect(()=>{const x=v.current;return()=>window.clearTimeout(x)},[]),h.jsx(O0,{scope:i,isOpenDelayedRef:f,delayDuration:l,onOpen:g.useCallback(()=>{window.clearTimeout(v.current),f.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>f.current=!0,a)},[a]),isPointerInTransitRef:m,onPointerInTransitChange:g.useCallback(x=>{m.current=x},[]),disableHoverableContent:c,children:d})};Gm.displayName=Vm;var No="Tooltip",[A0,yl]=gl(No),Ym=n=>{const{__scopeTooltip:i,children:l,open:a,defaultOpen:c,onOpenChange:d,disableHoverableContent:f,delayDuration:m}=n,v=cu(No,n.__scopeTooltip),x=vl(i),[y,S]=g.useState(null),_=Eo(),k=g.useRef(0),b=f??v.disableHoverableContent,E=m??v.delayDuration,j=g.useRef(!1),[A,D]=sl({prop:a,defaultProp:c??!1,onChange:B=>{B?(v.onOpen(),document.dispatchEvent(new CustomEvent(Ua))):v.onClose(),d?.(B)},caller:No}),$=g.useMemo(()=>A?j.current?"delayed-open":"instant-open":"closed",[A]),M=g.useCallback(()=>{window.clearTimeout(k.current),k.current=0,j.current=!1,D(!0)},[D]),U=g.useCallback(()=>{window.clearTimeout(k.current),k.current=0,D(!1)},[D]),G=g.useCallback(()=>{window.clearTimeout(k.current),k.current=window.setTimeout(()=>{j.current=!0,D(!0),k.current=0},E)},[E,D]);return g.useEffect(()=>()=>{k.current&&(window.clearTimeout(k.current),k.current=0)},[]),h.jsx($m,{...x,children:h.jsx(A0,{scope:i,contentId:_,open:A,stateAttribute:$,trigger:y,onTriggerChange:S,onTriggerEnter:g.useCallback(()=>{v.isOpenDelayedRef.current?G():M()},[v.isOpenDelayedRef,G,M]),onTriggerLeave:g.useCallback(()=>{b?U():(window.clearTimeout(k.current),k.current=0)},[U,b]),onOpen:M,onClose:U,disableHoverableContent:b,children:l})})};Ym.displayName=No;var Ba="TooltipTrigger",Qm=g.forwardRef((n,i)=>{const{__scopeTooltip:l,...a}=n,c=yl(Ba,l),d=cu(Ba,l),f=vl(l),m=g.useRef(null),v=We(i,m,c.onTriggerChange),x=g.useRef(!1),y=g.useRef(!1),S=g.useCallback(()=>x.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",S),[S]),h.jsx(Wm,{asChild:!0,...f,children:h.jsx(De.button,{"aria-describedby":c.open?c.contentId:void 0,"data-state":c.stateAttribute,...a,ref:v,onPointerMove:Ee(n.onPointerMove,_=>{_.pointerType!=="touch"&&!y.current&&!d.isPointerInTransitRef.current&&(c.onTriggerEnter(),y.current=!0)}),onPointerLeave:Ee(n.onPointerLeave,()=>{c.onTriggerLeave(),y.current=!1}),onPointerDown:Ee(n.onPointerDown,()=>{c.open&&c.onClose(),x.current=!0,document.addEventListener("pointerup",S,{once:!0})}),onFocus:Ee(n.onFocus,()=>{x.current||c.onOpen()}),onBlur:Ee(n.onBlur,c.onClose),onClick:Ee(n.onClick,c.onClose)})})});Qm.displayName=Ba;var D0="TooltipPortal",[sS,L0]=gl(D0,{forceMount:void 0}),Pr="TooltipContent",Xm=g.forwardRef((n,i)=>{const l=L0(Pr,n.__scopeTooltip),{forceMount:a=l.forceMount,side:c="top",...d}=n,f=yl(Pr,n.__scopeTooltip);return h.jsx(Tt,{present:a||f.open,children:f.disableHoverableContent?h.jsx(Km,{side:c,...d,ref:i}):h.jsx(M0,{side:c,...d,ref:i})})}),M0=g.forwardRef((n,i)=>{const l=yl(Pr,n.__scopeTooltip),a=cu(Pr,n.__scopeTooltip),c=g.useRef(null),d=We(i,c),[f,m]=g.useState(null),{trigger:v,onClose:x}=l,y=c.current,{onPointerInTransitChange:S}=a,_=g.useCallback(()=>{m(null),S(!1)},[S]),k=g.useCallback((b,E)=>{const j=b.currentTarget,A={x:b.clientX,y:b.clientY},D=W0(A,j.getBoundingClientRect()),$=H0(A,D),M=U0(E.getBoundingClientRect()),U=V0([...$,...M]);m(U),S(!0)},[S]);return g.useEffect(()=>()=>_(),[_]),g.useEffect(()=>{if(v&&y){const b=j=>k(j,y),E=j=>k(j,v);return v.addEventListener("pointerleave",b),y.addEventListener("pointerleave",E),()=>{v.removeEventListener("pointerleave",b),y.removeEventListener("pointerleave",E)}}},[v,y,k,_]),g.useEffect(()=>{if(f){const b=E=>{const j=E.target,A={x:E.clientX,y:E.clientY},D=v?.contains(j)||y?.contains(j),$=!B0(A,f);D?_():$&&(_(),x())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[v,y,f,x,_]),h.jsx(Km,{...n,ref:d})}),[I0,z0]=gl(No,{isInside:!1}),F0=zv("TooltipContent"),Km=g.forwardRef((n,i)=>{const{__scopeTooltip:l,children:a,"aria-label":c,onEscapeKeyDown:d,onPointerDownOutside:f,...m}=n,v=yl(Pr,l),x=vl(l),{onClose:y}=v;return g.useEffect(()=>(document.addEventListener(Ua,y),()=>document.removeEventListener(Ua,y)),[y]),g.useEffect(()=>{if(v.trigger){const S=_=>{_.target?.contains(v.trigger)&&y()};return window.addEventListener("scroll",S,{capture:!0}),()=>window.removeEventListener("scroll",S,{capture:!0})}},[v.trigger,y]),h.jsx(al,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:S=>S.preventDefault(),onDismiss:y,children:h.jsxs(Hm,{"data-state":v.stateAttribute,...x,...m,ref:i,style:{...m.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(F0,{children:a}),h.jsx(I0,{scope:l,isInside:!0,children:h.jsx(j0,{id:v.contentId,role:"tooltip",children:c||a})})]})})});Xm.displayName=Pr;var Zm="TooltipArrow",$0=g.forwardRef((n,i)=>{const{__scopeTooltip:l,...a}=n,c=vl(l);return z0(Zm,l).isInside?null:h.jsx(Um,{...c,...a,ref:i})});$0.displayName=Zm;function W0(n,i){const l=Math.abs(i.top-n.y),a=Math.abs(i.bottom-n.y),c=Math.abs(i.right-n.x),d=Math.abs(i.left-n.x);switch(Math.min(l,a,c,d)){case d:return"left";case c:return"right";case l:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function H0(n,i,l=5){const a=[];switch(i){case"top":a.push({x:n.x-l,y:n.y+l},{x:n.x+l,y:n.y+l});break;case"bottom":a.push({x:n.x-l,y:n.y-l},{x:n.x+l,y:n.y-l});break;case"left":a.push({x:n.x+l,y:n.y-l},{x:n.x+l,y:n.y+l});break;case"right":a.push({x:n.x-l,y:n.y-l},{x:n.x-l,y:n.y+l});break}return a}function U0(n){const{top:i,right:l,bottom:a,left:c}=n;return[{x:c,y:i},{x:l,y:i},{x:l,y:a},{x:c,y:a}]}function B0(n,i){const{x:l,y:a}=n;let c=!1;for(let d=0,f=i.length-1;d a!=_>a&&l<(S-x)*(a-y)/(_-y)+x&&(c=!c)}return c}function V0(n){const i=n.slice();return i.sort((l,a)=>l.x a.x?1:l.y a.y?1:0),G0(i)}function G0(n){if(n.length<=1)return n.slice();const i=[];for(let a=0;a =2;){const d=i[i.length-1],f=i[i.length-2];if((d.x-f.x)*(c.y-f.y)>=(d.y-f.y)*(c.x-f.x))i.pop();else break}i.push(c)}i.pop();const l=[];for(let a=n.length-1;a>=0;a--){const c=n[a];for(;l.length>=2;){const d=l[l.length-1],f=l[l.length-2];if((d.x-f.x)*(c.y-f.y)>=(d.y-f.y)*(c.x-f.x))l.pop();else break}l.push(c)}return l.pop(),i.length===1&&l.length===1&&i[0].x===l[0].x&&i[0].y===l[0].y?i:i.concat(l)}var Y0=Gm,Q0=Ym,X0=Qm,Jm=Xm;const K0=Y0,du=Q0,fu=X0,xl=g.forwardRef(({className:n,sideOffset:i=4,...l},a)=>h.jsx(Jm,{ref:a,sideOffset:i,className:ge("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",n),...l}));xl.displayName=Jm.displayName;var wl="Collapsible",[Z0]=Rr(wl),[J0,pu]=Z0(wl),qm=g.forwardRef((n,i)=>{const{__scopeCollapsible:l,open:a,defaultOpen:c,disabled:d,onOpenChange:f,...m}=n,[v,x]=sl({prop:a,defaultProp:c??!1,onChange:f,caller:wl});return h.jsx(J0,{scope:l,disabled:d,contentId:Eo(),open:v,onOpenToggle:g.useCallback(()=>x(y=>!y),[x]),children:h.jsx(De.div,{"data-state":hu(v),"data-disabled":d?"":void 0,...m,ref:i})})});qm.displayName=wl;var eh="CollapsibleTrigger",th=g.forwardRef((n,i)=>{const{__scopeCollapsible:l,...a}=n,c=pu(eh,l);return h.jsx(De.button,{type:"button","aria-controls":c.contentId,"aria-expanded":c.open||!1,"data-state":hu(c.open),"data-disabled":c.disabled?"":void 0,disabled:c.disabled,...a,ref:i,onClick:Ee(n.onClick,c.onOpenToggle)})});th.displayName=eh;var mu="CollapsibleContent",nh=g.forwardRef((n,i)=>{const{forceMount:l,...a}=n,c=pu(mu,n.__scopeCollapsible);return h.jsx(Tt,{present:l||c.open,children:({present:d})=>h.jsx(q0,{...a,ref:i,present:d})})});nh.displayName=mu;var q0=g.forwardRef((n,i)=>{const{__scopeCollapsible:l,present:a,children:c,...d}=n,f=pu(mu,l),[m,v]=g.useState(a),x=g.useRef(null),y=We(i,x),S=g.useRef(0),_=S.current,k=g.useRef(0),b=k.current,E=f.open||m,j=g.useRef(E),A=g.useRef(void 0);return g.useEffect(()=>{const D=requestAnimationFrame(()=>j.current=!1);return()=>cancelAnimationFrame(D)},[]),Wt(()=>{const D=x.current;if(D){A.current=A.current||{transitionDuration:D.style.transitionDuration,animationName:D.style.animationName},D.style.transitionDuration="0s",D.style.animationName="none";const $=D.getBoundingClientRect();S.current=$.height,k.current=$.width,j.current||(D.style.transitionDuration=A.current.transitionDuration,D.style.animationName=A.current.animationName),v(a)}},[f.open,a]),h.jsx(De.div,{"data-state":hu(f.open),"data-disabled":f.disabled?"":void 0,id:f.contentId,hidden:!E,...d,ref:y,style:{"--radix-collapsible-content-height":_?`${_}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...n.style},children:E&&c})});function hu(n){return n?"open":"closed"}var e1=qm;const t1=e1,n1=th,r1=nh,o1=new Set(["production_mutation","credential_access_without_intent","destructive_operation_without_intent","direct_infra_api_with_credential","unknown_high_risk_command","no_policy_rule_matched"]),i1=new Set(["judge_allow","judge_deny","judge_fail_open"]),l1=new Set(["deterministic_deny","deterministic_allow"]);function s1(n){const i={deny:[],ask:[],allow:[]};for(const l of n)i[l.decision]?.push(l);return{counts:{all:n.length,deny:i.deny.length,ask:i.ask.length,allow:i.allow.length},groups:i}}function gu(n,i="—"){const l=n.risk_event??{};return l.command_summary||l.request_summary||l.path_class||l.type||i}function Nn(n){return n.replace(/_/g," ")}function a1(n,i){if(n===i)return!0;if(n.length!==i.length)return!1;for(let l=0;l i.toUpperCase()):"tool"}function oh(n){const i=n.risk_event?.decision_stage;return!!(i&&l1.has(i))||o1.has(n.reason_code??"")}function u1(n){return n.reason_code==="async_telemetry"?"Recorded after execution.":n.risk_event?.decision_stage==="judge_fail_open"?"Local judge was unavailable, so Guard allowed by fail-open policy.":n.reason||(n.reason_code?Nn(n.reason_code):"No explanation captured.")}function c1(n){const i=n.risk_event??{};return n.reason_code==="async_telemetry"?"Not a live gate. Recorded after execution for local session history.":i.decision_stage==="judge_allow"?"Deterministic policy allowed this action, then the local judge allowed it.":i.decision_stage==="judge_deny"?"Deterministic policy allowed this action, then the local judge denied it.":i.decision_stage==="judge_fail_open"?`Deterministic policy allowed this action, but the local judge failed${i.judge_failure_kind?` with ${Nn(i.judge_failure_kind)}`:""}.`:oh(n)?i.policy_rule_id?`Deterministic policy matched ${i.policy_rule_id} before calling the local judge.`:"Deterministic policy allowed this action.":i.type==="normal_tool_call"?"Routine coding-agent behavior. No deterministic policy rule matched.":`Normalized as ${i.type||"unknown"}.`}function ih(n){const i=n.risk_event?.decision_stage;return i&&i1.has(i)?"Local LLM judge":n.reason_code==="async_telemetry"?"Trace history":oh(n)?"Deterministic policy":"Guard policy"}function d1(n){return gu(n,"No command summary stored.")}function f1(n){if(!n)return"";const i=Date.parse(n);return Number.isNaN(i)?"":new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(i)}function p1(n){return n==="deny"?"Would deny":n==="ask"?"Would ask":"Allow"}const bo={deny:{text:"text-destructive",bg:"bg-destructive",ring:"ring-destructive/10",border:"border-destructive/20"},ask:{text:"text-amber-700",bg:"bg-amber-500",ring:"ring-amber-500/10",border:"border-amber-300/40"},allow:{text:"text-brand",bg:"bg-brand",ring:"ring-brand/10",border:"border-border"}};function vu({kind:n,className:i}){const l=bo[n];return h.jsx("span",{className:ge("h-2 w-2 shrink-0 rounded-full ring-4",l.bg,l.ring,i)})}function Jf({label:n,description:i,children:l}){return h.jsxs("section",{className:"mt-8 first:mt-0",children:[(n||i)&&h.jsxs("div",{className:"mb-3.5 flex items-baseline gap-3",children:[n&&h.jsx("h2",{className:"text-[15px] font-semibold tracking-tight",children:n}),i&&h.jsx("p",{className:"text-[12.5px] text-muted-foreground",children:i})]}),l]})}function qf({k:n,v:i}){return h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"text-muted-foreground",children:n}),h.jsx("span",{className:"font-mono",children:i})]})}function ct({children:n}){return h.jsx("dt",{className:"self-center break-words text-[10.5px] font-medium uppercase tracking-wider text-muted-foreground [overflow-wrap:anywhere]",children:n})}function dt({children:n,className:i}){return h.jsx("dd",{className:ge("min-w-0 break-words text-foreground/90 [overflow-wrap:anywhere]",i),children:n})}const m1={all:"All actions",deny:"Denied · this session",ask:"Needs ask · this session",allow:"Allowed · this session"},h1={deny:"Would deny",ask:"Needs ask",allow:"Allow"},g1={all:["deny","ask","allow"],deny:["deny"],ask:["ask"],allow:["allow"]};function v1({tab:n,groups:i,openId:l,onOpen:a,hasAny:c}){return h.jsxs("section",{className:"overflow-hidden rounded-xl border bg-card shadow-[inset_0_1px_0_rgba(255,255,255,0.8),0_1px_2px_rgba(0,0,0,0.04)]",children:[h.jsx("div",{className:"flex items-center justify-between gap-3 border-b px-5 py-3",children:h.jsxs("div",{className:"flex items-baseline gap-2.5",children:[h.jsx("h3",{className:"font-mono text-[10.5px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:m1[n]}),n!=="all"&&h.jsxs("span",{className:"text-[11px] text-muted-foreground/80",children:["Click ",h.jsx("span",{className:"text-foreground",children:"Total"})," to clear"]})]})}),c?h.jsx("div",{children:g1[n].map(d=>({kind:d,items:i[d]})).filter(({items:d})=>d.length>0).map(({kind:d,items:f},m)=>h.jsx(x1,{label:h1[d],kind:d,count:f.length,separated:m>0,children:f.map(v=>h.jsx(w1,{event:v,active:l===v.id,onClick:()=>a(v.id)},v.id))},d))}):h.jsx(y1,{})]})}function y1(){return h.jsxs("div",{className:"flex flex-col items-center gap-2 px-8 py-16 text-center text-muted-foreground",children:[h.jsx(Av,{className:"h-5 w-5 text-muted-foreground/50"}),h.jsx("p",{className:"text-[13px]",children:"No actions captured yet."}),h.jsx("p",{className:"text-[12px] text-muted-foreground/70",children:"Start Claude Code to populate this view."})]})}function x1({label:n,kind:i,count:l,separated:a,children:c}){const[d,f]=g.useState(!0);return h.jsxs(t1,{open:d,onOpenChange:f,children:[h.jsxs(n1,{className:ge("flex w-full items-center gap-2 border-b bg-muted/40 px-5 py-2 text-left text-[12px] font-medium text-muted-foreground transition-colors hover:bg-muted/40",a&&"border-t"),children:[h.jsx(cp,{className:ge("h-3 w-3 transition-transform",!d&&"-rotate-90")}),h.jsx(vu,{kind:i}),h.jsx("span",{className:"text-foreground",children:n}),h.jsx("span",{className:"tabular-nums text-[11px] text-muted-foreground",children:l})]}),h.jsx(r1,{className:"overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",children:h.jsx("div",{children:c})})]})}function w1({event:n,active:i,onClick:l}){const a=gu(n),c=n.risk_event?.signals?.[0]?.replace(/_/g," "),d=bo[n.decision];return h.jsxs("button",{onClick:l,className:ge("group relative grid w-full grid-cols-[10px_minmax(0,1fr)_auto] items-center gap-4 border-b px-8 py-3 text-left transition-colors last:border-b-0","hover:bg-muted/40",i&&"bg-accent"),children:[i&&h.jsx("span",{className:"absolute inset-y-0 left-0 w-[2px] bg-brand"}),h.jsx(vu,{kind:n.decision}),h.jsxs("span",{className:"flex min-w-0 items-baseline gap-2.5",children:[h.jsx("span",{className:"text-[13px] font-medium text-foreground",children:rh(n.tool_name)}),h.jsx("span",{className:"truncate font-mono text-[12px] text-muted-foreground",children:a})]}),h.jsxs("span",{className:"flex items-center gap-3",children:[c&&h.jsxs(du,{children:[h.jsx(fu,{asChild:!0,children:h.jsx("span",{className:"hidden max-w-[180px] truncate text-[11px] text-muted-foreground md:inline",children:c})}),h.jsxs(xl,{side:"top",children:["Primary signal: ",c]})]}),h.jsx("span",{className:ge("rounded-md border bg-background/60 px-1.5 py-0.5 font-mono text-[10.5px] font-medium",d.border,n.decision==="allow"?"text-muted-foreground":d.text),children:ih(n)}),h.jsx(cp,{className:ge("h-3 w-3 -rotate-90 text-muted-foreground/0 transition-all group-hover:text-muted-foreground/70",i&&"text-muted-foreground/70")})]})]})}const S1={},_1=S1,Sl=_1.VITE_KONTEXT_API??"";function Co(n){return n instanceof Error?n.message:String(n)}async function ep(n){return n.json()}async function _l(n){if(n.ok)return ep(n);const i=`${n.status} ${n.statusText}`.trim();if(!(n.headers.get("content-type")??"").includes("application/json"))throw new Error(i);let a;try{a=await ep(n)}catch(d){throw new Error(`API error response was not valid JSON: ${i}; ${Co(d)}`)}const c=Ro(a)&&typeof a.error=="string"?a.error:i;throw new Error(c)}function Ro(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function ve(n){return typeof n=="string"?n:void 0}function Da(n){return typeof n=="boolean"?n:void 0}function tp(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function La(n){if(!Array.isArray(n))return;const i=n.filter(l=>typeof l=="string");return i.length>0?i:void 0}function lh(n){switch(n){case"allow":case"ask":case"deny":return n;default:return}}function np(n){switch(n){case"relaxed":case"balanced":case"strict":return n;default:return}}function C1(n){if(Ro(n))return{type:ve(n.type),provider:ve(n.provider),provider_category:ve(n.provider_category),operation:ve(n.operation),operation_class:ve(n.operation_class),resource_class:ve(n.resource_class),environment:ve(n.environment),credential_observed:Da(n.credential_observed),credential_source:ve(n.credential_source),direct_api_call:Da(n.direct_api_call),explicit_user_intent:Da(n.explicit_user_intent),command_summary:ve(n.command_summary),request_summary:ve(n.request_summary),path_class:ve(n.path_class),decision:lh(n.decision),reason_code:ve(n.reason_code),decision_stage:ve(n.decision_stage),signals:La(n.signals),guard_id:ve(n.guard_id),confidence:tp(n.confidence),policy_version:ve(n.policy_version),policy_profile:ve(n.policy_profile),policy_rule_pack:ve(n.policy_rule_pack),policy_rule_id:ve(n.policy_rule_id),policy_rule_category:ve(n.policy_rule_category),policy_signals:La(n.policy_signals),judge_runtime:ve(n.judge_runtime),judge_model:ve(n.judge_model),judge_duration_ms:tp(n.judge_duration_ms),judge_failure_kind:ve(n.judge_failure_kind),judge_risk_level:ve(n.judge_risk_level),judge_categories:La(n.judge_categories)}}function E1(n){if(!(!Ro(n)||typeof n.session_id!="string"||typeof n.actions!="number"))return{session_id:n.session_id,actions:n.actions}}function k1(n){if(!Ro(n)||typeof n.id!="string")return;const i=lh(n.decision);if(i)return{id:n.id,session_id:ve(n.session_id),tool_name:ve(n.tool_name),decision:i,reason:ve(n.reason),reason_code:ve(n.reason_code),created_at:ve(n.created_at),risk_event:C1(n.risk_event)}}function sh(n){if(!Ro(n))throw new Error("invalid policy profile response");const i=np(n.profile);if(!i)throw new Error("invalid policy profile response");return{profile:i,recommended_profile:np(n.recommended_profile),version:ve(n.version),rule_pack:ve(n.rule_pack),rule_pack_version:ve(n.rule_pack_version),config_digest:ve(n.config_digest),activation_id:ve(n.activation_id),source:ve(n.source),status:ve(n.status),loaded_at:ve(n.loaded_at)}}function ah(n,i){if(n==null)return[];if(!Array.isArray(n))throw new Error("invalid API response");const l=[];for(const a of n){const c=i(a);if(!c)throw new Error("invalid API response");l.push(c)}return l}async function N1(){return ah(await fetch(`${Sl}/api/sessions`).then(_l),E1)}async function P1(n){return ah(await fetch(`${Sl}/api/sessions/${encodeURIComponent(n)}/events`).then(_l),k1)}async function b1(){return sh(await fetch(`${Sl}/api/policy/profile`).then(_l))}async function R1(n){const i=await fetch(`${Sl}/api/policy/profile`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profile:n})}).then(_l);return sh(i)}function j1({event:n}){const i=n.risk_event??{},l=bo[n.decision],a=f1(n.created_at),c=i.decision_stage==="judge_allow"?"allow":i.decision_stage==="judge_deny"?"deny":i.decision_stage==="judge_fail_open"?"fail open":"",d=T1(i.judge_duration_ms);return h.jsxs("div",{className:"flex h-full min-w-0 flex-col overflow-x-hidden bg-background",children:[h.jsxs(vm,{className:"flex min-w-0 flex-row items-center gap-2 border-b bg-background px-6 py-3.5 pr-14 space-y-0",children:[h.jsx(vu,{kind:n.decision}),h.jsx(ym,{className:ge("shrink-0 text-[13px] font-medium",l.text),children:p1(n.decision)}),h.jsx("span",{className:"ml-2 min-w-0 break-words font-mono text-[10.5px] uppercase tracking-[0.2em] text-muted-foreground [overflow-wrap:anywhere]",children:rh(n.tool_name)})]}),h.jsx(ll,{className:"min-w-0 flex-1 overflow-x-hidden",children:h.jsxs("div",{className:"min-w-0 max-w-full space-y-7 overflow-x-hidden px-7 py-7",children:[h.jsx("div",{className:"min-w-0 space-y-3",children:h.jsx("pre",{className:"max-w-full whitespace-pre-wrap break-words font-mono text-[15px] font-medium leading-snug tracking-tight text-foreground [overflow-wrap:anywhere]",children:gu(n)})}),h.jsxs("dl",{className:"grid min-w-0 grid-cols-[120px_minmax(0,1fr)] gap-y-3 text-[13px]",children:[h.jsx(ct,{children:"Operation"}),h.jsx(dt,{children:i.operation||i.operation_class||"unknown"}),h.jsx(ct,{children:"Source"}),h.jsx(dt,{children:ih(n)}),h.jsx(ct,{children:"Stage"}),h.jsx(dt,{children:i.decision_stage?Nn(i.decision_stage):"unknown"}),h.jsx(ct,{children:"Environment"}),h.jsx(dt,{children:h.jsx("span",{className:"font-mono text-[12.5px]",children:i.environment||"unknown"})}),a&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Timestamp"}),h.jsx(dt,{children:a})]}),i.policy_version&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Policy version"}),h.jsx(dt,{children:i.policy_version})]}),i.policy_profile&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Policy profile"}),h.jsx(dt,{children:Nn(i.policy_profile)})]}),i.policy_rule_pack&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Rule pack"}),h.jsx(dt,{children:i.policy_rule_pack})]}),i.policy_rule_id&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Policy rule"}),h.jsx(dt,{children:i.policy_rule_id})]}),i.policy_rule_category&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Rule category"}),h.jsx(dt,{children:Nn(i.policy_rule_category)})]}),c&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Judge result"}),h.jsx(dt,{children:c})]}),i.judge_risk_level&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Judge risk"}),h.jsx(dt,{children:Nn(i.judge_risk_level)})]}),d&&h.jsxs(h.Fragment,{children:[h.jsx(ct,{children:"Judge latency"}),h.jsx(dt,{children:d})]})]}),h.jsx(_o,{title:"Reason",children:h.jsx("p",{className:"max-w-full break-words text-[13px] leading-relaxed text-foreground/80 [overflow-wrap:anywhere]",children:u1(n)})}),h.jsx(_o,{title:"Analysis",children:h.jsx("p",{className:"max-w-full break-words text-[13px] leading-relaxed text-foreground/80 [overflow-wrap:anywhere]",children:c1(n)})}),h.jsx(_o,{title:"Command",children:h.jsx("pre",{className:"max-w-full whitespace-pre-wrap break-words rounded-md border bg-muted/40 px-3 py-2.5 font-mono text-[12px] leading-relaxed text-foreground/90 [overflow-wrap:anywhere]",children:d1(n)})}),(i.signals??[]).length>0&&h.jsx(_o,{title:"Signals",children:h.jsx("div",{className:"flex flex-wrap gap-1.5",children:(i.signals??[]).map(f=>h.jsx(rp,{signal:f,toneClass:l.bg},f))})}),(i.policy_signals??[]).length>0&&h.jsx(_o,{title:"Policy Signals",children:h.jsx("div",{className:"flex flex-wrap gap-1.5",children:(i.policy_signals??[]).map(f=>h.jsx(rp,{signal:f,toneClass:l.bg},f))})}),n.reason_code&&h.jsxs("div",{className:"border-t pt-4 font-mono text-[10.5px] uppercase tracking-[0.2em] text-muted-foreground",children:["decision code · ",h.jsx("span",{className:"text-foreground/70",children:n.reason_code})]})]})})]})}function rp({signal:n,toneClass:i}){return h.jsxs("span",{className:"inline-flex max-w-full min-w-0 items-start gap-1.5 rounded-md border bg-card px-2 py-1 font-mono text-[11px] text-foreground/80 shadow-[inset_0_1px_0_rgba(255,255,255,0.7)]",children:[h.jsx("span",{className:ge("mt-[0.45em] h-1 w-1 shrink-0 rounded-full",i)}),h.jsx("span",{className:"min-w-0 break-words [overflow-wrap:anywhere]",children:Nn(n)})]})}function T1(n){return typeof n!="number"||!Number.isFinite(n)||n<0?"":n<1e3?`${Math.round(n)} ms`:`${(n/1e3).toFixed(1)} s`}function _o({title:n,children:i}){return h.jsxs("div",{className:"min-w-0 max-w-full space-y-2.5 overflow-x-hidden",children:[h.jsx("h3",{className:"font-mono text-[10px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:n}),i]})}var Ma,Cl="HoverCard",[uh]=Rr(Cl,[hl]),El=hl(),[O1,yu]=uh(Cl),ch=n=>{const{__scopeHoverCard:i,children:l,open:a,defaultOpen:c,onOpenChange:d,openDelay:f=700,closeDelay:m=300}=n,v=El(i),x=g.useRef(0),y=g.useRef(0),S=g.useRef(!1),_=g.useRef(!1),[k,b]=sl({prop:a,defaultProp:c??!1,onChange:d,caller:Cl}),E=g.useCallback(()=>{clearTimeout(y.current),x.current=window.setTimeout(()=>b(!0),f)},[f,b]),j=g.useCallback(()=>{clearTimeout(x.current),!S.current&&!_.current&&(y.current=window.setTimeout(()=>b(!1),m))},[m,b]),A=g.useCallback(()=>b(!1),[b]);return g.useEffect(()=>()=>{clearTimeout(x.current),clearTimeout(y.current)},[]),h.jsx(O1,{scope:i,open:k,onOpenChange:b,onOpen:E,onClose:j,onDismiss:A,hasSelectionRef:S,isPointerDownOnContentRef:_,children:h.jsx($m,{...v,children:l})})};ch.displayName=Cl;var dh="HoverCardTrigger",fh=g.forwardRef((n,i)=>{const{__scopeHoverCard:l,...a}=n,c=yu(dh,l),d=El(l);return h.jsx(Wm,{asChild:!0,...d,children:h.jsx(De.a,{"data-state":c.open?"open":"closed",...a,ref:i,onPointerEnter:Ee(n.onPointerEnter,rl(c.onOpen)),onPointerLeave:Ee(n.onPointerLeave,rl(c.onClose)),onFocus:Ee(n.onFocus,c.onOpen),onBlur:Ee(n.onBlur,c.onClose),onTouchStart:Ee(n.onTouchStart,f=>f.preventDefault())})})});fh.displayName=dh;var A1="HoverCardPortal",[aS,D1]=uh(A1,{forceMount:void 0}),nl="HoverCardContent",ph=g.forwardRef((n,i)=>{const l=D1(nl,n.__scopeHoverCard),{forceMount:a=l.forceMount,...c}=n,d=yu(nl,n.__scopeHoverCard);return h.jsx(Tt,{present:a||d.open,children:h.jsx(L1,{"data-state":d.open?"open":"closed",...c,onPointerEnter:Ee(n.onPointerEnter,rl(d.onOpen)),onPointerLeave:Ee(n.onPointerLeave,rl(d.onClose)),ref:i})})});ph.displayName=nl;var L1=g.forwardRef((n,i)=>{const{__scopeHoverCard:l,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,...m}=n,v=yu(nl,l),x=El(l),y=g.useRef(null),S=We(i,y),[_,k]=g.useState(!1);return g.useEffect(()=>{if(_){const b=document.body;return Ma=b.style.userSelect||b.style.webkitUserSelect,b.style.userSelect="none",b.style.webkitUserSelect="none",()=>{b.style.userSelect=Ma,b.style.webkitUserSelect=Ma}}},[_]),g.useEffect(()=>{if(y.current){const b=()=>{k(!1),v.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(v.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",b),()=>{document.removeEventListener("pointerup",b),v.hasSelectionRef.current=!1,v.isPointerDownOnContentRef.current=!1}}},[v.isPointerDownOnContentRef,v.hasSelectionRef]),g.useEffect(()=>{y.current&&z1(y.current).forEach(E=>E.setAttribute("tabindex","-1"))}),h.jsx(al,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:Ee(d,b=>{b.preventDefault()}),onDismiss:v.onDismiss,children:h.jsx(Hm,{...x,...m,onPointerDown:Ee(m.onPointerDown,b=>{b.currentTarget.contains(b.target)&&k(!0),v.hasSelectionRef.current=!1,v.isPointerDownOnContentRef.current=!0}),ref:S,style:{...m.style,userSelect:_?"text":void 0,WebkitUserSelect:_?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),M1="HoverCardArrow",I1=g.forwardRef((n,i)=>{const{__scopeHoverCard:l,...a}=n,c=El(l);return h.jsx(Um,{...c,...a,ref:i})});I1.displayName=M1;function rl(n){return i=>i.pointerType==="touch"?void 0:n()}function z1(n){const i=[],l=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;l.nextNode();)i.push(l.currentNode);return i}var F1=ch,$1=fh,mh=ph;const W1=F1,H1=$1,hh=g.forwardRef(({className:n,align:i="center",sideOffset:l=4,...a},c)=>h.jsx(mh,{ref:c,align:i,sideOffset:l,className:ge("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]",n),...a}));hh.displayName=mh.displayName;function Bn({className:n,...i}){return h.jsx("div",{className:ge("animate-pulse rounded-md bg-muted",n),...i})}const Va=[{id:"relaxed",label:"Relaxed",lede:"Fewer blocks, more compatibility.",hint:"Use when iterating on agent behavior."},{id:"balanced",label:"Balanced",recommended:!0,lede:"Good protection with fewer false positives.",hint:"Best default for local development."},{id:"strict",label:"Strict",lede:"Maximum protection, more false positives.",hint:"Use when you can accept breakage."}];function U1(n){return Va.find(i=>i.id===n)?.label??"Balanced"}const B1={relaxed:1,balanced:2,strict:3};function V1({profile:n,pending:i,error:l,onActivate:a,onRetry:c}){const d=n?.profile??"balanced",f=!n&&!l;return h.jsxs("section",{className:"space-y-3.5",children:[h.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[h.jsxs("div",{className:"flex items-baseline gap-3",children:[h.jsx("h2",{className:"text-[15px] font-semibold tracking-tight",children:"Policy profile"}),n&&h.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:[U1(n.profile)," profile"]})]}),n&&h.jsx(G1,{profile:n})]}),h.jsx("div",{className:"grid grid-cols-1 gap-2.5 md:grid-cols-3",children:f?Va.map(m=>h.jsx(Y1,{},m.id)):Va.map(m=>h.jsx(Q1,{profile:m,active:m.id===d,pending:m.id===i,disabled:!n||!!i,onActivate:()=>a(m.id)},m.id))}),l&&h.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-[12px] text-destructive",children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[h.jsx(dp,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{children:l})]}),h.jsx("button",{type:"button",onClick:c,className:"shrink-0 font-mono text-[10.5px] uppercase tracking-[0.18em] text-destructive underline-offset-4 hover:underline",children:"Retry"})]})]})}function G1({profile:n}){return h.jsxs(W1,{openDelay:120,children:[h.jsx(H1,{asChild:!0,children:h.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 font-mono text-[10.5px] uppercase tracking-[0.18em] text-muted-foreground transition-colors hover:text-foreground",children:[h.jsx(Rv,{className:"h-3 w-3"}),n.version]})}),h.jsx(hh,{side:"left",align:"end",className:"w-[280px] text-[12.5px]",children:h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(qf,{k:"Version",v:n.version??"—"}),h.jsx(qf,{k:"Rule pack",v:n.rule_pack??"—"})]})})]})}function Y1(){return h.jsxs("div",{className:"rounded-xl border bg-card p-4",children:[h.jsx(Bn,{className:"h-3 w-16"}),h.jsx(Bn,{className:"mt-3 h-7 w-24"}),h.jsx(Bn,{className:"mt-3 h-3 w-full"}),h.jsx(Bn,{className:"mt-1.5 h-3 w-3/4"})]})}function Q1({profile:n,active:i,pending:l,disabled:a,onActivate:c}){const d=B1[n.id];return h.jsxs("button",{type:"button",onClick:c,disabled:a,className:ge("group relative flex flex-col overflow-hidden rounded-xl border text-left transition-shadow duration-200","disabled:pointer-events-none disabled:opacity-60",i?ge("bg-brand-gradient border-brand-dark text-brand-foreground","shadow-[inset_0_1px_0_rgba(255,255,255,0.10),inset_0_0_0_1px_rgba(255,255,255,0.04),0_10px_30px_-8px_rgba(21,40,34,0.45)]","hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.14),inset_0_0_0_1px_rgba(255,255,255,0.06),0_18px_48px_-10px_rgba(21,40,34,0.55)]"):ge("bg-card","shadow-[inset_0_1px_0_rgba(255,255,255,0.8),0_1px_2px_rgba(15,17,21,0.04)]","hover:border-foreground/15 hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.8),0_6px_18px_-6px_rgba(15,17,21,0.10)]")),children:[l&&h.jsx("span",{className:"absolute inset-x-0 bottom-0 h-px overflow-hidden",children:h.jsx("span",{className:ge("block h-full w-1/3 animate-[shimmer_1.2s_linear_infinite]",i?"bg-white":"bg-foreground")})}),h.jsxs("div",{className:"flex items-center justify-between px-5 pt-4",children:[h.jsx(X1,{filled:d,active:i}),h.jsxs("div",{className:"flex items-center gap-2",children:[n.recommended&&!l&&h.jsx("span",{className:ge("font-mono text-[9.5px] font-medium uppercase tracking-[0.18em]",i?"text-white/70":"text-muted-foreground"),children:"Recommended"}),l&&h.jsxs("span",{className:ge("inline-flex items-center gap-1 font-mono text-[9.5px] uppercase tracking-[0.18em]",i?"text-white/70":"text-muted-foreground"),children:[h.jsx(Tv,{className:"h-3 w-3 animate-spin"}),"Activating"]})]})]}),h.jsxs("div",{className:"px-5 pt-2.5",children:[h.jsx("div",{className:"text-[22px] font-semibold leading-tight tracking-tight",children:n.label}),h.jsx("p",{className:ge("mt-1 text-[12.5px] leading-snug",i?"text-white/85":"text-foreground/80"),children:n.lede}),h.jsx("p",{className:ge("mt-0.5 text-[11.5px] leading-snug",i?"text-white/55":"text-muted-foreground"),children:n.hint})]}),h.jsx("div",{className:ge("mt-3 border-t px-5 py-2.5 font-mono text-[10px] uppercase tracking-[0.22em]",i?"border-white/15 text-white":"border-border text-muted-foreground/70"),children:i?"Active profile":"Tap to activate"})]})}function X1({filled:n,active:i}){return h.jsx("div",{className:"flex items-center gap-1","aria-hidden":"true",children:[1,2,3].map(l=>h.jsx("span",{className:ge("h-1 w-2.5 rounded-full transition-colors",l<=n?i?"bg-white":"bg-foreground":i?"bg-white/25":"bg-muted-foreground/25")},l))})}const Un="session-local-guard-preview";new Date(Date.now()-120*1e3).toISOString();new Date(Date.now()-420*1e3).toISOString(),new Date(Date.now()-360*1e3).toISOString(),new Date(Date.now()-300*1e3).toISOString(),new Date(Date.now()-240*1e3).toISOString(),new Date(Date.now()-180*1e3).toISOString(),new Date(Date.now()-120*1e3).toISOString(),new Date(Date.now()-60*1e3).toISOString();function K1({session:n,loading:i}){return h.jsxs("header",{className:"flex items-center justify-between gap-4 border-b bg-background px-10 py-5",children:[h.jsx("div",{className:"flex min-w-0 items-center gap-3",children:i?h.jsx(Bn,{className:"h-6 w-60"}):h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"relative flex h-2 w-2 shrink-0",children:[h.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-brand opacity-50"}),h.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-brand"})]}),h.jsx("span",{className:"truncate font-mono text-[17px] font-medium tracking-tight text-foreground",children:n?.session_id??"-"})]})}),h.jsxs(du,{children:[h.jsx(fu,{asChild:!0,children:h.jsx("span",{className:"cursor-default text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:"Observe mode"})}),h.jsx(xl,{side:"bottom",children:"Recording decisions but not enforcing them."})]})]})}function Z1({sessions:n,counts:i,selectedID:l,onSelect:a}){return h.jsxs("aside",{className:"flex min-h-0 flex-col border-r",children:[h.jsx("div",{className:"px-5 pb-6 pt-7",children:h.jsx("div",{className:"text-[18px] font-semibold tracking-tight",children:"Kontext"})}),h.jsxs(ll,{className:"flex-1 px-2",children:[h.jsx(J1,{label:"This session",count:i.all,active:!0}),n.length>1&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-2.5 pb-1.5 pt-6 text-[10.5px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:"Recent"}),h.jsx("div",{className:"flex flex-col gap-0.5",children:n.slice(0,12).map(c=>h.jsxs("button",{type:"button",onClick:()=>a(c.session_id),className:ge("flex items-center justify-between gap-2 rounded-md px-2.5 py-1.5 text-left text-[12.5px] transition-colors hover:bg-accent/60",c.session_id===l&&"bg-accent text-foreground"),children:[h.jsx("span",{className:"truncate font-mono text-muted-foreground",children:c.session_id}),h.jsx("span",{className:"shrink-0 tabular-nums text-[11px] text-muted-foreground",children:c.actions})]},c.session_id))})]})]})]})}function J1({label:n,count:i,active:l}){return h.jsxs("button",{type:"button",className:ge("flex w-full items-center justify-between rounded-md px-2.5 py-1.5 text-left text-[13px] font-medium transition-colors",l?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/60 hover:text-foreground"),children:[h.jsx("span",{children:n}),h.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:i})]})}const q1=[{id:"deny",label:"Would deny"},{id:"ask",label:"Needs ask"},{id:"allow",label:"Allowed"}],eS=[{kind:"deny",label:"Would deny"},{kind:"ask",label:"Ask"},{kind:"allow",label:"Allow"}];function tS({counts:n,active:i,onSelect:l,loading:a}){return h.jsxs("section",{className:"overflow-hidden rounded-xl border bg-card shadow-[inset_0_1px_0_rgba(255,255,255,0.8),0_1px_2px_rgba(0,0,0,0.04)]",children:[h.jsx(nS,{count:n.all,active:i==="all",loading:a,onClick:()=>l("all")}),h.jsx("div",{className:"grid divide-y md:grid-cols-3 md:divide-x md:divide-y-0",children:q1.map(c=>h.jsx(rS,{id:c.id,label:c.label,count:n[c.id],total:n.all,active:i===c.id,loading:a,onClick:()=>l(c.id)},c.id))}),h.jsx(oS,{counts:n})]})}function nS({count:n,active:i,loading:l,onClick:a}){return h.jsxs("button",{type:"button",onClick:a,"aria-label":"Show all decisions",className:ge("flex w-full items-center gap-3 border-b bg-muted/10 px-6 py-3 text-left transition-colors","hover:bg-muted/30",i&&"bg-muted/40"),children:[l?h.jsx(Bn,{className:"h-7 w-10"}):h.jsx("span",{className:"font-mono text-[26px] font-semibold leading-none tabular-nums text-foreground",children:n}),h.jsx("div",{className:"min-w-0",children:h.jsx("span",{className:ge("text-[13px] font-medium",i?"text-foreground":"text-muted-foreground"),children:"decisions captured"})})]})}function rS({id:n,label:i,count:l,total:a,active:c,loading:d,onClick:f}){const m=Math.round(l/Math.max(1,a)*100),v=l===0?"text-muted-foreground/40":bo[n].text;return h.jsxs("button",{type:"button",onClick:f,className:ge("group relative flex items-baseline gap-4 px-6 py-5 text-left transition-colors","hover:bg-muted/30",c&&"bg-muted/40"),children:[d?h.jsx(Bn,{className:"h-9 w-12"}):h.jsx("span",{className:ge("font-mono text-[36px] font-semibold leading-none tracking-tight tabular-nums",v),children:l}),h.jsxs("div",{className:"flex flex-col leading-tight",children:[h.jsx("span",{className:ge("font-mono text-[10px] font-medium uppercase tracking-[0.22em]",c?"text-foreground":"text-muted-foreground"),children:i}),h.jsxs("span",{className:"mt-1 text-[11px] text-muted-foreground/70",children:[m,"% of session"]})]})]})}function oS({counts:n}){const i=eS.map(l=>({count:n[l.kind],color:bo[l.kind].bg,label:l.label})).filter(l=>l.count>0);return h.jsx("div",{className:"border-t bg-muted/20 px-6 py-3",children:h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("div",{className:"flex h-1.5 flex-1 gap-0.5 overflow-hidden rounded-full bg-muted/60",children:i.length===0?h.jsx("div",{className:"w-full bg-muted-foreground/15"}):i.map(l=>h.jsxs(du,{children:[h.jsx(fu,{asChild:!0,children:h.jsx("div",{className:ge("transition-opacity hover:opacity-80",l.color),style:{flex:l.count},"aria-label":`${l.count} ${l.label}`})}),h.jsxs(xl,{side:"top",children:[l.count," ",l.label.toLowerCase()]})]},l.label))}),h.jsx("div",{className:"flex items-center gap-3 font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:i.length===0?h.jsx("span",{children:"No activity yet"}):i.map(l=>h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h.jsx("span",{className:ge("h-1.5 w-1.5 rounded-full",l.color)}),l.label,h.jsx("span",{className:"tabular-nums text-foreground/70",children:l.count})]},l.label))})]})})}function iS(){const[n,i]=g.useState([]),[l,a]=g.useState(""),[c,d]=g.useState([]),[f,m]=g.useState("all"),[v,x]=g.useState(null),[y,S]=g.useState(""),[_,k]=g.useState(null),[b,E]=g.useState(null),[j,A]=g.useState(""),D=g.useRef("");g.useEffect(()=>{G(),le();const ee=setInterval(G,3e3);return()=>clearInterval(ee)},[]),g.useEffect(()=>{l&&B(l),D.current=l},[l]);function $(ee){D.current=ee,a(ee)}function M(ee){return i(ie=>a1(ie,ee)?ie:ee),S(""),ee}function U(ee){d(ee),S("")}function G(){N1().then(ee=>{const ie=M(ee),se=D.current,L=ie.some(Y=>Y.session_id===se)?se:ie[0]?.session_id;L?L!==se?$(L):B(L):(D.current="",a(""),d([]),x(null))}).catch(ee=>S(Co(ee)))}function B(ee){P1(ee).then(ie=>{D.current===ee&&U(ie)}).catch(ie=>S(Co(ie)))}function le(){b1().then(ee=>{k(ee),A("")}).catch(ee=>{A(`Couldn't load policy profile. ${Co(ee)}`)})}function te(ee){ee===_?.profile||b||(E(ee),A(""),R1(ee).then(k).catch(ie=>A(`Couldn't update policy profile. ${Co(ie)}`)).finally(()=>E(null)))}const{counts:ne,groups:ue}=g.useMemo(()=>s1(c),[c]),q=g.useMemo(()=>v?c.find(ee=>ee.id===v)??null:null,[v,c]),me=g.useMemo(()=>n.find(ee=>ee.session_id===l),[n,l]),ce=n.length===0&&!y;return h.jsx(K0,{delayDuration:150,children:h.jsxs("div",{className:"grid h-screen grid-cols-[252px_1fr] bg-background text-foreground",children:[h.jsx(Z1,{sessions:n,counts:ne,selectedID:l,onSelect:$}),h.jsxs("main",{className:"flex min-h-0 flex-col overflow-hidden",children:[h.jsx(K1,{session:me,loading:ce}),h.jsx(ll,{className:"flex-1",children:h.jsxs("div",{className:"px-10 pb-10 pt-8",children:[h.jsx(V1,{profile:_,pending:b,error:j,onActivate:te,onRetry:le}),h.jsx(Jf,{label:"Activity",description:"What was decided this session.",children:h.jsx(tS,{counts:ne,active:f,onSelect:m,loading:ce})}),y&&h.jsxs("div",{className:"mt-4 flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-[12px] text-destructive",children:[h.jsx(dp,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{children:y})]}),h.jsx(Jf,{label:"Log",description:"Tool calls in chronological order.",children:h.jsx(v1,{tab:f,groups:ue,openId:v,onOpen:x,hasAny:c.length>0})})]})})]}),h.jsx(dw,{open:!!q,onOpenChange:ee=>!ee&&x(null),children:h.jsx(gm,{side:"right",className:"w-[540px] max-w-[92vw] overflow-x-hidden p-0 sm:max-w-[540px]",children:q&&h.jsx(j1,{event:q})})})]})})}const op=document.getElementById("root");op&&wv.createRoot(op).render(h.jsx(lp.StrictMode,{children:h.jsx(iS,{})})); diff --git a/internal/guard/web/assets/dist/assets/index-DUTwVgWJ.css b/internal/guard/web/assets/dist/assets/index-DUTwVgWJ.css deleted file mode 100644 index 0035f7b..0000000 --- a/internal/guard/web/assets/dist/assets/index-DUTwVgWJ.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-family:Geist Sans;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/geist-sans-latin-400-normal-gapTbOY8.woff2) format("woff2"),url(/assets/geist-sans-latin-400-normal-BOaIZNA2.woff) format("woff")}@font-face{font-family:Geist Sans;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/geist-sans-latin-500-normal-uokXdC-Q.woff2) format("woff2"),url(/assets/geist-sans-latin-500-normal-CN2lyvyL.woff) format("woff")}@font-face{font-family:Geist Sans;font-style:normal;font-display:swap;font-weight:600;src:url(/assets/geist-sans-latin-600-normal-DFOURf8L.woff2) format("woff2"),url(/assets/geist-sans-latin-600-normal-CA1yjETN.woff) format("woff")}@font-face{font-family:Geist Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/geist-mono-cyrillic-400-normal-Ce5q_31Z.woff2) format("woff2"),url(/assets/geist-mono-cyrillic-400-normal-BPBWmzPh.woff) format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Geist Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/geist-mono-latin-ext-400-normal-Cgks_Qgx.woff2) format("woff2"),url(/assets/geist-mono-latin-ext-400-normal-CxNRRMGd.woff) format("woff");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/geist-mono-latin-400-normal-LC9RFr9I.woff2) format("woff2"),url(/assets/geist-mono-latin-400-normal-CoULgQGM.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Geist Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/geist-mono-cyrillic-500-normal-CJBLNVQT.woff2) format("woff2"),url(/assets/geist-mono-cyrillic-500-normal-mNhfPmgl.woff) format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Geist Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/geist-mono-latin-ext-500-normal-CQcGuCNt.woff2) format("woff2"),url(/assets/geist-mono-latin-ext-500-normal-diTenJ8L.woff) format("woff");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Geist Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/geist-mono-latin-500-normal-D3o2eNa9.woff2) format("woff2"),url(/assets/geist-mono-latin-500-normal-DOxI7kZ4.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Geist Sans,-apple-system,BlinkMacSystemFont,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Geist Mono,ui-monospace,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius: .625rem;--radius-sm: .375rem;--radius-lg: .875rem;--background: 40 11% 97%;--foreground: 24 10% 10%;--card: 0 0% 100%;--card-foreground: 24 10% 10%;--popover: 0 0% 100%;--popover-foreground: 24 10% 10%;--primary: 24 10% 10%;--primary-foreground: 40 11% 97%;--secondary: 40 8% 93%;--secondary-foreground: 24 10% 10%;--muted: 40 8% 93%;--muted-foreground: 30 6% 44%;--accent: 40 8% 91%;--accent-foreground: 24 10% 10%;--destructive: 0 72% 51%;--destructive-foreground: 0 0% 100%;--border: 36 8% 89%;--input: 36 8% 89%;--ring: 161 48% 12%;--brand: 161 48% 12%;--brand-foreground: 0 0% 100%;--brand-light: 161 33% 94%;--brand-dark: 161 53% 9%}*{border-color:hsl(var(--border))}html,body,#root{height:100%}body{background-color:hsl(var(--background));font-family:Geist Sans,-apple-system,BlinkMacSystemFont,system-ui,sans-serif;color:hsl(var(--foreground));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01","ss03"}.bg-brand-gradient{background:radial-gradient(120% 90% at 0% 0%,rgba(255,255,255,.1),transparent 55%),linear-gradient(135deg,#102d24,#1c4035,#244c3f)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.left-0{left:0}.left-2{left:.5rem}.right-0{right:0}.right-4{right:1rem}.top-0{top:0}.top-4{top:1rem}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-3\.5{margin-bottom:.875rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-9{height:2.25rem}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[var\(--radix-dropdown-menu-content-available-height\)\]{max-height:var(--radix-dropdown-menu-content-available-height)}.min-h-0{min-height:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/3{width:33.333333%}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-5{width:1.25rem}.w-60{width:15rem}.w-64{width:16rem}.w-\[280px\]{width:280px}.w-\[2px\]{width:2px}.w-\[540px\]{width:540px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[8rem\]{min-width:8rem}.max-w-\[180px\]{max-width:180px}.max-w-\[92vw\]{max-width:92vw}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.origin-\[--radix-dropdown-menu-content-transform-origin\]{transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\[--radix-hover-card-content-transform-origin\]{transform-origin:var(--radix-hover-card-content-transform-origin)}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes shimmer{0%{transform:translate(-100%)}to{transform:translate(400%)}}.animate-\[shimmer_1\.2s_linear_infinite\]{animation:shimmer 1.2s linear infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-\[10px_minmax\(0\,1fr\)_auto\]{grid-template-columns:10px minmax(0,1fr) auto}.grid-cols-\[120px_1fr\]{grid-template-columns:120px 1fr}.grid-cols-\[252px_1fr\]{grid-template-columns:252px 1fr}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-y-3{row-gap:.75rem}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.625rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-3\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.875rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.875rem * var(--tw-space-y-reverse))}.space-y-7>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.75rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-md{border-radius:var(--radius)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-amber-300\/40{border-color:#fcd34d66}.border-border{border-color:hsl(var(--border))}.border-brand-dark{--tw-border-opacity: 1;border-color:hsl(var(--brand-dark) / var(--tw-border-opacity, 1))}.border-destructive\/20{border-color:hsl(var(--destructive) / .2)}.border-destructive\/30{border-color:hsl(var(--destructive) / .3)}.border-white\/15{border-color:#ffffff26}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-accent{background-color:hsl(var(--accent))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--background))}.bg-background\/60{background-color:hsl(var(--background) / .6)}.bg-black\/80{background-color:#000c}.bg-border{background-color:hsl(var(--border))}.bg-brand{--tw-bg-opacity: 1;background-color:hsl(var(--brand) / var(--tw-bg-opacity, 1))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/5{background-color:hsl(var(--destructive) / .05)}.bg-foreground{background-color:hsl(var(--foreground))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground\/15{background-color:hsl(var(--muted-foreground) / .15)}.bg-muted-foreground\/25{background-color:hsl(var(--muted-foreground) / .25)}.bg-muted\/10{background-color:hsl(var(--muted) / .1)}.bg-muted\/20{background-color:hsl(var(--muted) / .2)}.bg-muted\/40{background-color:hsl(var(--muted) / .4)}.bg-muted\/60{background-color:hsl(var(--muted) / .6)}.bg-popover{background-color:hsl(var(--popover))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/25{background-color:#ffffff40}.fill-current{fill:currentColor}.p-0{padding:0}.p-1{padding:.25rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-7{padding-top:1.75rem;padding-bottom:1.75rem}.pb-1\.5{padding-bottom:.375rem}.pb-10{padding-bottom:2.5rem}.pb-6{padding-bottom:1.5rem}.pl-8{padding-left:2rem}.pr-14{padding-right:3.5rem}.pr-2{padding-right:.5rem}.pt-2\.5{padding-top:.625rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-7{padding-top:1.75rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:Geist Mono,ui-monospace,monospace}.text-\[10\.5px\]{font-size:10.5px}.text-\[10px\]{font-size:10px}.text-\[11\.5px\]{font-size:11.5px}.text-\[11px\]{font-size:11px}.text-\[12\.5px\]{font-size:12.5px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[15px\]{font-size:15px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[22px\]{font-size:22px}.text-\[26px\]{font-size:26px}.text-\[36px\]{font-size:36px}.text-\[9\.5px\]{font-size:9.5px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-\[0\.22em\]{letter-spacing:.22em}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-brand{--tw-text-opacity: 1;color:hsl(var(--brand) / var(--tw-text-opacity, 1))}.text-brand-foreground{--tw-text-opacity: 1;color:hsl(var(--brand-foreground) / var(--tw-text-opacity, 1))}.text-destructive{color:hsl(var(--destructive))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/70{color:hsl(var(--foreground) / .7)}.text-foreground\/80{color:hsl(var(--foreground) / .8)}.text-foreground\/90{color:hsl(var(--foreground) / .9)}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/0{color:hsl(var(--muted-foreground) / 0)}.text-muted-foreground\/40{color:hsl(var(--muted-foreground) / .4)}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/70{color:hsl(var(--muted-foreground) / .7)}.text-muted-foreground\/80{color:hsl(var(--muted-foreground) / .8)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/55{color:#ffffff8c}.text-white\/70{color:#ffffffb3}.text-white\/85{color:#ffffffd9}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.10\)\,inset_0_0_0_1px_rgba\(255\,255\,255\,0\.04\)\,0_10px_30px_-8px_rgba\(21\,40\,34\,0\.45\)\]{--tw-shadow: inset 0 1px 0 rgba(255,255,255,.1),inset 0 0 0 1px rgba(255,255,255,.04),0 10px 30px -8px rgba(21,40,34,.45);--tw-shadow-colored: inset 0 1px 0 var(--tw-shadow-color), inset 0 0 0 1px var(--tw-shadow-color), 0 10px 30px -8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.7\)\]{--tw-shadow: inset 0 1px 0 rgba(255,255,255,.7);--tw-shadow-colored: inset 0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.8\)\,0_1px_2px_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow: inset 0 1px 0 rgba(255,255,255,.8),0 1px 2px rgba(0,0,0,.04);--tw-shadow-colored: inset 0 1px 0 var(--tw-shadow-color), 0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.8\)\,0_1px_2px_rgba\(15\,17\,21\,0\.04\)\]{--tw-shadow: inset 0 1px 0 rgba(255,255,255,.8),0 1px 2px rgba(15,17,21,.04);--tw-shadow-colored: inset 0 1px 0 var(--tw-shadow-color), 0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-amber-500\/10{--tw-ring-color: rgb(245 158 11 / .1)}.ring-brand\/10{--tw-ring-color: hsl(var(--brand) / .1)}.ring-destructive\/10{--tw-ring-color: hsl(var(--destructive) / .1)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-200{animation-duration:.2s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.first\:mt-0:first-child{margin-top:0}.last\:border-b-0:last-child{border-bottom-width:0px}.hover\:border-foreground\/15:hover{border-color:hsl(var(--foreground) / .15)}.hover\:bg-accent\/60:hover{background-color:hsl(var(--accent) / .6)}.hover\:bg-muted\/30:hover{background-color:hsl(var(--muted) / .3)}.hover\:bg-muted\/40:hover{background-color:hsl(var(--muted) / .4)}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.14\)\,inset_0_0_0_1px_rgba\(255\,255\,255\,0\.06\)\,0_18px_48px_-10px_rgba\(21\,40\,34\,0\.55\)\]:hover{--tw-shadow: inset 0 1px 0 rgba(255,255,255,.14),inset 0 0 0 1px rgba(255,255,255,.06),0 18px 48px -10px rgba(21,40,34,.55);--tw-shadow-colored: inset 0 1px 0 var(--tw-shadow-color), inset 0 0 0 1px var(--tw-shadow-color), 0 18px 48px -10px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.8\)\,0_6px_18px_-6px_rgba\(15\,17\,21\,0\.10\)\]:hover{--tw-shadow: inset 0 1px 0 rgba(255,255,255,.8),0 6px 18px -6px rgba(15,17,21,.1);--tw-shadow-colored: inset 0 1px 0 var(--tw-shadow-color), 0 6px 18px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-60:disabled{opacity:.6}.group:hover .group-hover\:text-muted-foreground\/70{color:hsl(var(--muted-foreground) / .7)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}@keyframes collapsible-up{0%{height:var(--radix-collapsible-content-height)}to{height:0}}.data-\[state\=closed\]\:animate-collapsible-up[data-state=closed]{animation:collapsible-up .2s ease-out}@keyframes collapsible-down{0%{height:0}to{height:var(--radix-collapsible-content-height)}}.data-\[state\=open\]\:animate-collapsible-down[data-state=open]{animation:collapsible-down .2s ease-out}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}@media(min-width:640px){.sm\:max-w-\[540px\]{max-width:540px}.sm\:max-w-sm{max-width:24rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:text-left{text-align:left}}@media(min-width:768px){.md\:inline{display:inline}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.md\:divide-y-0>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(0px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(0px * var(--tw-divide-y-reverse))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0} diff --git a/internal/guard/web/assets/dist/index.html b/internal/guard/web/assets/dist/index.html index ee85c75..73a321e 100644 --- a/internal/guard/web/assets/dist/index.html +++ b/internal/guard/web/assets/dist/index.html @@ -4,8 +4,8 @@ Kontext Guard - - + + diff --git a/web/guard-dashboard/src/App.tsx b/web/guard-dashboard/src/App.tsx index c128135..cbec16e 100644 --- a/web/guard-dashboard/src/App.tsx +++ b/web/guard-dashboard/src/App.tsx @@ -206,7 +206,10 @@ export default function App() {!open && setOpenId(null)}> - diff --git a/web/guard-dashboard/src/dashboard/Inspector.tsx b/web/guard-dashboard/src/dashboard/Inspector.tsx index ad23c2e..e128e3c 100644 --- a/web/guard-dashboard/src/dashboard/Inspector.tsx +++ b/web/guard-dashboard/src/dashboard/Inspector.tsx @@ -31,26 +31,26 @@ export function Inspector({ event }: { event: Event }) { const judgeLatency = formatDurationMs(r.judge_duration_ms); return ( -+ {opened && } -+ +- - + {decisionLabel(event.decision)} - + {prettyTool(event.tool_name)}- --++ ++-{summaryOf(event)}+
- Operation
- {r.operation || r.operation_class || "unknown"}
- Source
@@ -118,17 +118,19 @@ export function Inspector({ event }: { event: Event }) {- {humanReason(event)}
++ {humanReason(event)} +
- +
{technicalExplanation(event)}
- @@ -137,13 +139,7 @@ export function Inspector({ event }: { event: Event }) {+{actionSummary(event)}@@ -172,9 +168,9 @@ export function Inspector({ event }: { event: Event }) { function SignalChip({ signal, toneClass }: { signal: string; toneClass: string }) { return ( - - - {humanize(signal)} + + + {humanize(signal)} ); } @@ -187,7 +183,7 @@ function formatDurationMs(value?: number): string { function Section({ title, children }: { title: string; children: React.ReactNode }) { return ( - {(r.signals ?? []).map((s) => ( - - - {humanize(s)} - +))} +{title}
diff --git a/web/guard-dashboard/src/dashboard/shared.tsx b/web/guard-dashboard/src/dashboard/shared.tsx index 32c107d..19196bf 100644 --- a/web/guard-dashboard/src/dashboard/shared.tsx +++ b/web/guard-dashboard/src/dashboard/shared.tsx @@ -46,12 +46,16 @@ export function Kv({ k, v }: { k: string; v: string }) { export function Dt({ children }: { children: React.ReactNode }) { return ( -- +
- {children}
); } export function Dd({ children, className }: { children: React.ReactNode; className?: string }) { - return- {children}
; + return ( +- + {children} +
+ ); }