chordia-ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,90 @@
1
+ # @chordia/ui
2
+
3
+ Chordia Design System — UI components, design tokens, and Tailwind CSS preset for the Chordia conversation intelligence platform.
4
+
5
+ ## Philosophy
6
+
7
+ - Evidence-based, explainable interfaces
8
+ - "No Judgment" principle: colors categorize, never indicate good/bad
9
+ - Clarity over cleverness
10
+ - Calm interfaces that build trust through transparency
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ # Link locally (monorepo / workspace)
16
+ npm link @chordia/ui
17
+ ```
18
+
19
+ ### Peer Dependencies
20
+
21
+ ```bash
22
+ npm install react react-dom lucide-react
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ### 1. Import the Tailwind Preset
28
+
29
+ In your `tailwind.config.js`:
30
+
31
+ ```js
32
+ module.exports = {
33
+ presets: [require('@chordia/ui/tailwind-preset')],
34
+ content: [
35
+ './src/**/*.{js,jsx,ts,tsx}',
36
+ './node_modules/@chordia/ui/src/**/*.{js,jsx}',
37
+ ],
38
+ // your overrides...
39
+ };
40
+ ```
41
+
42
+ ### 2. Import Design Tokens
43
+
44
+ In your global CSS (e.g. `globals.css`):
45
+
46
+ ```css
47
+ @import '@chordia/ui/tokens';
48
+ ```
49
+
50
+ Or import individual token files:
51
+
52
+ ```css
53
+ @import '@chordia/ui/tokens/colors.css';
54
+ @import '@chordia/ui/tokens/typography.css';
55
+ @import '@chordia/ui/tokens/spacing.css';
56
+ ```
57
+
58
+ ### 3. Use Components
59
+
60
+ ```jsx
61
+ import { SignalCard, ScoreDriverCard, DeviationIndicator } from '@chordia/ui';
62
+ ```
63
+
64
+ ## Component Categories
65
+
66
+ | Category | Components |
67
+ |---|---|
68
+ | **Primitives** | DeviationIndicator, Tooltip, ColorPalette |
69
+ | **Data** | DataTable, DataTableFilters, SummaryStatsPanel, InteractionCard |
70
+ | **Compass** | SignalCard, ObservationCard, SmallObservationCard, ScoreDriverCard, ScoreDriverCardVariant, ConditionCard, ModelScoreCard, SummarySection, ExpandPatternComparison |
71
+ | **Media** | TranscriptCard, Timeline |
72
+ | **Chat** | ChatInterface, ChatMessage, ChatHistoryPanel, MessageThread |
73
+ | **Navigation** | Sidebar, NavigationBar |
74
+ | **Layout** | FirstCallScreen, OnboardingChecklist, DemoProjectBanner, IntegrationCard |
75
+ | **Notifications** | NotificationPanel, NotificationItem |
76
+
77
+ ## Utilities
78
+
79
+ ```js
80
+ import { cn } from '@chordia/ui/utils';
81
+ // Tailwind class merging utility (clsx + tailwind-merge)
82
+ ```
83
+
84
+ ## Development
85
+
86
+ This package is currently shared at source level (no build step). Consuming apps import JSX directly and must have appropriate bundler configuration (e.g., Next.js `transpilePackages`).
87
+
88
+ ## Docs
89
+
90
+ See `docs/UIComponentsPage.jsx` for a comprehensive component showcase with sample data.
@@ -0,0 +1,7 @@
1
+ "use strict";const n=require("react/jsx-runtime"),D=require("react"),z=require("lucide-react"),jt=require("react-dom");function Ct(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const x=Ct(D),St=Ct(jt);function K(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function st(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Tt(...e){return t=>{let r=!1;const o=e.map(i=>{const s=st(i,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<o.length;i++){const s=o[i];typeof s=="function"?s():st(e[i],null)}}}}function se(...e){return x.useCallback(Tt(...e),e)}function Rt(e,t=[]){let r=[];function o(s,a){const c=x.createContext(a),u=r.length;r=[...r,a];const l=p=>{var v;const{scope:g,children:f,...m}=p,b=((v=g==null?void 0:g[e])==null?void 0:v[u])||c,y=x.useMemo(()=>m,Object.values(m));return n.jsx(b.Provider,{value:y,children:f})};l.displayName=s+"Provider";function d(p,g){var b;const f=((b=g==null?void 0:g[e])==null?void 0:b[u])||c,m=x.useContext(f);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[l,d]}const i=()=>{const s=r.map(a=>x.createContext(a));return function(c){const u=(c==null?void 0:c[e])||s;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return i.scopeName=e,[o,Tn(i,...t)]}function Tn(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=o.reduce((c,{useScope:u,scopeName:l})=>{const p=u(s)[`__scope${l}`];return{...c,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Rn(e){const t=kn(e),r=x.forwardRef((o,i)=>{const{children:s,...a}=o,c=x.Children.toArray(s),u=c.find(Pn);if(u){const l=u.props.children,d=c.map(p=>p===u?x.Children.count(l)>1?x.Children.only(null):x.isValidElement(l)?l.props.children:null:p);return n.jsx(t,{...a,ref:i,children:x.isValidElement(l)?x.cloneElement(l,void 0,d):null})}return n.jsx(t,{...a,ref:i,children:s})});return r.displayName=`${e}.Slot`,r}function kn(e){const t=x.forwardRef((r,o)=>{const{children:i,...s}=r;if(x.isValidElement(i)){const a=On(i),c=An(s,i.props);return i.type!==x.Fragment&&(c.ref=o?Tt(o,a):a),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kt=Symbol("radix.slottable");function En(e){const t=({children:r})=>n.jsx(n.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=kt,t}function Pn(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kt}function An(e,t){const r={...t};for(const o in t){const i=e[o],s=t[o];/^on[A-Z]/.test(o)?i&&s?r[o]=(...c)=>{const u=s(...c);return i(...c),u}:i&&(r[o]=i):o==="style"?r[o]={...i,...s}:o==="className"&&(r[o]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}function On(e){var o,i;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Nn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oe=Nn.reduce((e,t)=>{const r=Rn(`Primitive.${t}`),o=x.forwardRef((i,s)=>{const{asChild:a,...c}=i,u=a?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(u,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Dn(e,t){e&&St.flushSync(()=>e.dispatchEvent(t))}function ke(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>{var o;return(o=t.current)==null?void 0:o.call(t,...r)},[])}function Ln(e,t=globalThis==null?void 0:globalThis.document){const r=ke(e);x.useEffect(()=>{const o=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var Mn="DismissableLayer",Ie="dismissableLayer.update",In="dismissableLayer.pointerDownOutside",Wn="dismissableLayer.focusOutside",at,Et=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pt=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...u}=e,l=x.useContext(Et),[d,p]=x.useState(null),g=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=x.useState({}),m=se(t,C=>p(C)),b=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=b.indexOf(y),h=d?b.indexOf(d):-1,j=l.layersWithOutsidePointerEventsDisabled.size>0,w=h>=v,T=Bn(C=>{const A=C.target,L=[...l.branches].some(S=>S.contains(A));!w||L||(i==null||i(C),a==null||a(C),C.defaultPrevented||c==null||c())},g),R=_n(C=>{const A=C.target;[...l.branches].some(S=>S.contains(A))||(s==null||s(C),a==null||a(C),C.defaultPrevented||c==null||c())},g);return Ln(C=>{h===l.layers.size-1&&(o==null||o(C),!C.defaultPrevented&&c&&(C.preventDefault(),c()))},g),x.useEffect(()=>{if(d)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(at=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),lt(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=at)}},[d,g,r,l]),x.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),lt())},[d,l]),x.useEffect(()=>{const C=()=>f({});return document.addEventListener(Ie,C),()=>document.removeEventListener(Ie,C)},[]),n.jsx(oe.div,{...u,ref:m,style:{pointerEvents:j?w?"auto":"none":void 0,...e.style},onFocusCapture:K(e.onFocusCapture,R.onFocusCapture),onBlurCapture:K(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,T.onPointerDownCapture)})});Pt.displayName=Mn;var $n="DismissableLayerBranch",zn=x.forwardRef((e,t)=>{const r=x.useContext(Et),o=x.useRef(null),i=se(t,o);return x.useEffect(()=>{const s=o.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),n.jsx(oe.div,{...e,ref:i})});zn.displayName=$n;function Bn(e,t=globalThis==null?void 0:globalThis.document){const r=ke(e),o=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=c=>{if(c.target&&!o.current){let u=function(){At(In,r,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function _n(e,t=globalThis==null?void 0:globalThis.document){const r=ke(e),o=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!o.current&&At(Wn,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function lt(){const e=new CustomEvent(Ie);document.dispatchEvent(e)}function At(e,t,r,{discrete:o}){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),o?Dn(i,s):i.dispatchEvent(s)}var te=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},Fn=x[" useId ".trim().toString()]||(()=>{}),Hn=0;function Vn(e){const[t,r]=x.useState(Fn());return te(()=>{r(o=>o??String(Hn++))},[e]),t?`radix-${t}`:""}const Un=["top","right","bottom","left"],ne=Math.min,B=Math.max,Ce=Math.round,ve=Math.floor,Y=e=>({x:e,y:e}),Yn={left:"right",right:"left",bottom:"top",top:"bottom"},Xn={start:"end",end:"start"};function We(e,t,r){return B(e,ne(t,r))}function G(e,t){return typeof e=="function"?e(t):e}function Z(e){return e.split("-")[0]}function ue(e){return e.split("-")[1]}function Fe(e){return e==="x"?"y":"x"}function He(e){return e==="y"?"height":"width"}const qn=new Set(["top","bottom"]);function U(e){return qn.has(Z(e))?"y":"x"}function Ve(e){return Fe(U(e))}function Kn(e,t,r){r===void 0&&(r=!1);const o=ue(e),i=Ve(e),s=He(i);let a=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Se(a)),[a,Se(a)]}function Gn(e){const t=Se(e);return[$e(e),t,$e(t)]}function $e(e){return e.replace(/start|end/g,t=>Xn[t])}const ct=["left","right"],dt=["right","left"],Zn=["top","bottom"],Jn=["bottom","top"];function Qn(e,t,r){switch(e){case"top":case"bottom":return r?t?dt:ct:t?ct:dt;case"left":case"right":return t?Zn:Jn;default:return[]}}function er(e,t,r,o){const i=ue(e);let s=Qn(Z(e),r==="start",o);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map($e)))),s}function Se(e){return e.replace(/left|right|bottom|top/g,t=>Yn[t])}function tr(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ot(e){return typeof e!="number"?tr(e):{top:e,right:e,bottom:e,left:e}}function Te(e){const{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function ut(e,t,r){let{reference:o,floating:i}=e;const s=U(t),a=Ve(t),c=He(a),u=Z(t),l=s==="y",d=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,g=o[c]/2-i[c]/2;let f;switch(u){case"top":f={x:d,y:o.y-i.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:p};break;case"left":f={x:o.x-i.width,y:p};break;default:f={x:o.x,y:o.y}}switch(ue(t)){case"start":f[a]-=g*(r&&l?-1:1);break;case"end":f[a]+=g*(r&&l?-1:1);break}return f}async function nr(e,t){var r;t===void 0&&(t={});const{x:o,y:i,platform:s,rects:a,elements:c,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:g=!1,padding:f=0}=G(t,e),m=Ot(f),y=c[g?p==="floating"?"reference":"floating":p],v=Te(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(y)))==null||r?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:d,strategy:u})),h=p==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),w=await(s.isElement==null?void 0:s.isElement(j))?await(s.getScale==null?void 0:s.getScale(j))||{x:1,y:1}:{x:1,y:1},T=Te(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:h,offsetParent:j,strategy:u}):h);return{top:(v.top-T.top+m.top)/w.y,bottom:(T.bottom-v.bottom+m.bottom)/w.y,left:(v.left-T.left+m.left)/w.x,right:(T.right-v.right+m.right)/w.x}}const rr=async(e,t,r)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:a}=r,c=s.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:p}=ut(l,o,u),g=o,f={},m=0;for(let y=0;y<c.length;y++){var b;const{name:v,fn:h}=c[y],{x:j,y:w,data:T,reset:R}=await h({x:d,y:p,initialPlacement:o,placement:g,strategy:i,middlewareData:f,rects:l,platform:{...a,detectOverflow:(b=a.detectOverflow)!=null?b:nr},elements:{reference:e,floating:t}});d=j??d,p=w??p,f={...f,[v]:{...f[v],...T}},R&&m<=50&&(m++,typeof R=="object"&&(R.placement&&(g=R.placement),R.rects&&(l=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):R.rects),{x:d,y:p}=ut(l,g,u)),y=-1)}return{x:d,y:p,placement:g,strategy:i,middlewareData:f}},or=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:o,placement:i,rects:s,platform:a,elements:c,middlewareData:u}=t,{element:l,padding:d=0}=G(e,t)||{};if(l==null)return{};const p=Ot(d),g={x:r,y:o},f=Ve(i),m=He(f),b=await a.getDimensions(l),y=f==="y",v=y?"top":"left",h=y?"bottom":"right",j=y?"clientHeight":"clientWidth",w=s.reference[m]+s.reference[f]-g[f]-s.floating[m],T=g[f]-s.reference[f],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let C=R?R[j]:0;(!C||!await(a.isElement==null?void 0:a.isElement(R)))&&(C=c.floating[j]||s.floating[m]);const A=w/2-T/2,L=C/2-b[m]/2-1,S=ne(p[v],L),P=ne(p[h],L),k=S,N=C-b[m]-P,O=C/2-b[m]/2+A,W=We(k,O,N),I=!u.arrow&&ue(i)!=null&&O!==W&&s.reference[m]/2-(O<k?S:P)-b[m]/2<0,M=I?O<k?O-k:O-N:0;return{[f]:g[f]+M,data:{[f]:W,centerOffset:O-W-M,...I&&{alignmentOffset:M}},reset:I}}}),ir=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;const{placement:i,middlewareData:s,rects:a,initialPlacement:c,platform:u,elements:l}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:b=!0,...y}=G(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const v=Z(i),h=U(c),j=Z(c)===c,w=await(u.isRTL==null?void 0:u.isRTL(l.floating)),T=g||(j||!b?[Se(c)]:Gn(c)),R=m!=="none";!g&&R&&T.push(...er(c,b,m,w));const C=[c,...T],A=await u.detectOverflow(t,y),L=[];let S=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&L.push(A[v]),p){const O=Kn(i,a,w);L.push(A[O[0]],A[O[1]])}if(S=[...S,{placement:i,overflows:L}],!L.every(O=>O<=0)){var P,k;const O=(((P=s.flip)==null?void 0:P.index)||0)+1,W=C[O];if(W&&(!(p==="alignment"?h!==U(W):!1)||S.every(E=>U(E.placement)===h?E.overflows[0]>0:!0)))return{data:{index:O,overflows:S},reset:{placement:W}};let I=(k=S.filter(M=>M.overflows[0]<=0).sort((M,E)=>M.overflows[1]-E.overflows[1])[0])==null?void 0:k.placement;if(!I)switch(f){case"bestFit":{var N;const M=(N=S.filter(E=>{if(R){const $=U(E.placement);return $===h||$==="y"}return!0}).map(E=>[E.placement,E.overflows.filter($=>$>0).reduce(($,V)=>$+V,0)]).sort((E,$)=>E[1]-$[1])[0])==null?void 0:N[0];M&&(I=M);break}case"initialPlacement":I=c;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function pt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ft(e){return Un.some(t=>e[t]>=0)}const sr=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:o}=t,{strategy:i="referenceHidden",...s}=G(e,t);switch(i){case"referenceHidden":{const a=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=pt(a,r.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:ft(c)}}}case"escaped":{const a=await o.detectOverflow(t,{...s,altBoundary:!0}),c=pt(a,r.floating);return{data:{escapedOffsets:c,escaped:ft(c)}}}default:return{}}}}},Nt=new Set(["left","top"]);async function ar(e,t){const{placement:r,platform:o,elements:i}=e,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),a=Z(r),c=ue(r),u=U(r)==="y",l=Nt.has(a)?-1:1,d=s&&u?-1:1,p=G(t,e);let{mainAxis:g,crossAxis:f,alignmentAxis:m}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof m=="number"&&(f=c==="end"?m*-1:m),u?{x:f*d,y:g*l}:{x:g*l,y:f*d}}const lr=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;const{x:i,y:s,placement:a,middlewareData:c}=t,u=await ar(t,e);return a===((r=c.offset)==null?void 0:r.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:s+u.y,data:{...u,placement:a}}}}},cr=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:o,placement:i,platform:s}=t,{mainAxis:a=!0,crossAxis:c=!1,limiter:u={fn:v=>{let{x:h,y:j}=v;return{x:h,y:j}}},...l}=G(e,t),d={x:r,y:o},p=await s.detectOverflow(t,l),g=U(Z(i)),f=Fe(g);let m=d[f],b=d[g];if(a){const v=f==="y"?"top":"left",h=f==="y"?"bottom":"right",j=m+p[v],w=m-p[h];m=We(j,m,w)}if(c){const v=g==="y"?"top":"left",h=g==="y"?"bottom":"right",j=b+p[v],w=b-p[h];b=We(j,b,w)}const y=u.fn({...t,[f]:m,[g]:b});return{...y,data:{x:y.x-r,y:y.y-o,enabled:{[f]:a,[g]:c}}}}}},dr=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:o,placement:i,rects:s,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:l=!0}=G(e,t),d={x:r,y:o},p=U(i),g=Fe(p);let f=d[g],m=d[p];const b=G(c,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(u){const j=g==="y"?"height":"width",w=s.reference[g]-s.floating[j]+y.mainAxis,T=s.reference[g]+s.reference[j]-y.mainAxis;f<w?f=w:f>T&&(f=T)}if(l){var v,h;const j=g==="y"?"width":"height",w=Nt.has(Z(i)),T=s.reference[p]-s.floating[j]+(w&&((v=a.offset)==null?void 0:v[p])||0)+(w?0:y.crossAxis),R=s.reference[p]+s.reference[j]+(w?0:((h=a.offset)==null?void 0:h[p])||0)-(w?y.crossAxis:0);m<T?m=T:m>R&&(m=R)}return{[g]:f,[p]:m}}}},ur=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;const{placement:i,rects:s,platform:a,elements:c}=t,{apply:u=()=>{},...l}=G(e,t),d=await a.detectOverflow(t,l),p=Z(i),g=ue(i),f=U(i)==="y",{width:m,height:b}=s.floating;let y,v;p==="top"||p==="bottom"?(y=p,v=g===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(v=p,y=g==="end"?"top":"bottom");const h=b-d.top-d.bottom,j=m-d.left-d.right,w=ne(b-d[y],h),T=ne(m-d[v],j),R=!t.middlewareData.shift;let C=w,A=T;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(A=j),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(C=h),R&&!g){const S=B(d.left,0),P=B(d.right,0),k=B(d.top,0),N=B(d.bottom,0);f?A=m-2*(S!==0||P!==0?S+P:B(d.left,d.right)):C=b-2*(k!==0||N!==0?k+N:B(d.top,d.bottom))}await u({...t,availableWidth:A,availableHeight:C});const L=await a.getDimensions(c.floating);return m!==L.width||b!==L.height?{reset:{rects:!0}}:{}}}};function Ee(){return typeof window<"u"}function pe(e){return Dt(e)?(e.nodeName||"").toLowerCase():"#document"}function _(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){var t;return(t=(Dt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Dt(e){return Ee()?e instanceof Node||e instanceof _(e).Node:!1}function F(e){return Ee()?e instanceof Element||e instanceof _(e).Element:!1}function X(e){return Ee()?e instanceof HTMLElement||e instanceof _(e).HTMLElement:!1}function gt(e){return!Ee()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _(e).ShadowRoot}const pr=new Set(["inline","contents"]);function he(e){const{overflow:t,overflowX:r,overflowY:o,display:i}=H(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!pr.has(i)}const fr=new Set(["table","td","th"]);function gr(e){return fr.has(pe(e))}const xr=[":popover-open",":modal"];function Pe(e){return xr.some(t=>{try{return e.matches(t)}catch{return!1}})}const hr=["transform","translate","scale","rotate","perspective"],mr=["transform","translate","scale","rotate","perspective","filter"],br=["paint","layout","strict","content"];function Ue(e){const t=Ye(),r=F(e)?H(e):e;return hr.some(o=>r[o]?r[o]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||mr.some(o=>(r.willChange||"").includes(o))||br.some(o=>(r.contain||"").includes(o))}function yr(e){let t=re(e);for(;X(t)&&!ce(t);){if(Ue(t))return t;if(Pe(t))return null;t=re(t)}return null}function Ye(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vr=new Set(["html","body","#document"]);function ce(e){return vr.has(pe(e))}function H(e){return _(e).getComputedStyle(e)}function Ae(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function re(e){if(pe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gt(e)&&e.host||q(e);return gt(t)?t.host:t}function Lt(e){const t=re(e);return ce(t)?e.ownerDocument?e.ownerDocument.body:e.body:X(t)&&he(t)?t:Lt(t)}function ge(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=Lt(e),s=i===((o=e.ownerDocument)==null?void 0:o.body),a=_(i);if(s){const c=ze(a);return t.concat(a,a.visualViewport||[],he(i)?i:[],c&&r?ge(c):[])}return t.concat(i,ge(i,[],r))}function ze(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mt(e){const t=H(e);let r=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=X(e),s=i?e.offsetWidth:r,a=i?e.offsetHeight:o,c=Ce(r)!==s||Ce(o)!==a;return c&&(r=s,o=a),{width:r,height:o,$:c}}function Xe(e){return F(e)?e:e.contextElement}function le(e){const t=Xe(e);if(!X(t))return Y(1);const r=t.getBoundingClientRect(),{width:o,height:i,$:s}=Mt(t);let a=(s?Ce(r.width):r.width)/o,c=(s?Ce(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const wr=Y(0);function It(e){const t=_(e);return!Ye()||!t.visualViewport?wr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jr(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==_(e)?!1:t}function ie(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),s=Xe(e);let a=Y(1);t&&(o?F(o)&&(a=le(o)):a=le(e));const c=jr(s,r,o)?It(s):Y(0);let u=(i.left+c.x)/a.x,l=(i.top+c.y)/a.y,d=i.width/a.x,p=i.height/a.y;if(s){const g=_(s),f=o&&F(o)?_(o):o;let m=g,b=ze(m);for(;b&&o&&f!==m;){const y=le(b),v=b.getBoundingClientRect(),h=H(b),j=v.left+(b.clientLeft+parseFloat(h.paddingLeft))*y.x,w=v.top+(b.clientTop+parseFloat(h.paddingTop))*y.y;u*=y.x,l*=y.y,d*=y.x,p*=y.y,u+=j,l+=w,m=_(b),b=ze(m)}}return Te({width:d,height:p,x:u,y:l})}function Oe(e,t){const r=Ae(e).scrollLeft;return t?t.left+r:ie(q(e)).left+r}function Wt(e,t){const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-Oe(e,r),i=r.top+t.scrollTop;return{x:o,y:i}}function Cr(e){let{elements:t,rect:r,offsetParent:o,strategy:i}=e;const s=i==="fixed",a=q(o),c=t?Pe(t.floating):!1;if(o===a||c&&s)return r;let u={scrollLeft:0,scrollTop:0},l=Y(1);const d=Y(0),p=X(o);if((p||!p&&!s)&&((pe(o)!=="body"||he(a))&&(u=Ae(o)),X(o))){const f=ie(o);l=le(o),d.x=f.x+o.clientLeft,d.y=f.y+o.clientTop}const g=a&&!p&&!s?Wt(a,u):Y(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-u.scrollLeft*l.x+d.x+g.x,y:r.y*l.y-u.scrollTop*l.y+d.y+g.y}}function Sr(e){return Array.from(e.getClientRects())}function Tr(e){const t=q(e),r=Ae(e),o=e.ownerDocument.body,i=B(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=B(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-r.scrollLeft+Oe(e);const c=-r.scrollTop;return H(o).direction==="rtl"&&(a+=B(t.clientWidth,o.clientWidth)-i),{width:i,height:s,x:a,y:c}}const xt=25;function Rr(e,t){const r=_(e),o=q(e),i=r.visualViewport;let s=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){s=i.width,a=i.height;const d=Ye();(!d||d&&t==="fixed")&&(c=i.offsetLeft,u=i.offsetTop)}const l=Oe(o);if(l<=0){const d=o.ownerDocument,p=d.body,g=getComputedStyle(p),f=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,m=Math.abs(o.clientWidth-p.clientWidth-f);m<=xt&&(s-=m)}else l<=xt&&(s+=l);return{width:s,height:a,x:c,y:u}}const kr=new Set(["absolute","fixed"]);function Er(e,t){const r=ie(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,s=X(e)?le(e):Y(1),a=e.clientWidth*s.x,c=e.clientHeight*s.y,u=i*s.x,l=o*s.y;return{width:a,height:c,x:u,y:l}}function ht(e,t,r){let o;if(t==="viewport")o=Rr(e,r);else if(t==="document")o=Tr(q(e));else if(F(t))o=Er(t,r);else{const i=It(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Te(o)}function $t(e,t){const r=re(e);return r===t||!F(r)||ce(r)?!1:H(r).position==="fixed"||$t(r,t)}function Pr(e,t){const r=t.get(e);if(r)return r;let o=ge(e,[],!1).filter(c=>F(c)&&pe(c)!=="body"),i=null;const s=H(e).position==="fixed";let a=s?re(e):e;for(;F(a)&&!ce(a);){const c=H(a),u=Ue(a);!u&&c.position==="fixed"&&(i=null),(s?!u&&!i:!u&&c.position==="static"&&!!i&&kr.has(i.position)||he(a)&&!u&&$t(e,a))?o=o.filter(d=>d!==a):i=c,a=re(a)}return t.set(e,o),o}function Ar(e){let{element:t,boundary:r,rootBoundary:o,strategy:i}=e;const a=[...r==="clippingAncestors"?Pe(t)?[]:Pr(t,this._c):[].concat(r),o],c=a[0],u=a.reduce((l,d)=>{const p=ht(t,d,i);return l.top=B(p.top,l.top),l.right=ne(p.right,l.right),l.bottom=ne(p.bottom,l.bottom),l.left=B(p.left,l.left),l},ht(t,c,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Or(e){const{width:t,height:r}=Mt(e);return{width:t,height:r}}function Nr(e,t,r){const o=X(t),i=q(t),s=r==="fixed",a=ie(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const u=Y(0);function l(){u.x=Oe(i)}if(o||!o&&!s)if((pe(t)!=="body"||he(i))&&(c=Ae(t)),o){const f=ie(t,!0,s,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}else i&&l();s&&!o&&i&&l();const d=i&&!o&&!s?Wt(i,c):Y(0),p=a.left+c.scrollLeft-u.x-d.x,g=a.top+c.scrollTop-u.y-d.y;return{x:p,y:g,width:a.width,height:a.height}}function Le(e){return H(e).position==="static"}function mt(e,t){if(!X(e)||H(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return q(e)===r&&(r=r.ownerDocument.body),r}function zt(e,t){const r=_(e);if(Pe(e))return r;if(!X(e)){let i=re(e);for(;i&&!ce(i);){if(F(i)&&!Le(i))return i;i=re(i)}return r}let o=mt(e,t);for(;o&&gr(o)&&Le(o);)o=mt(o,t);return o&&ce(o)&&Le(o)&&!Ue(o)?r:o||yr(e)||r}const Dr=async function(e){const t=this.getOffsetParent||zt,r=this.getDimensions,o=await r(e.floating);return{reference:Nr(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Lr(e){return H(e).direction==="rtl"}const Mr={convertOffsetParentRelativeRectToViewportRelativeRect:Cr,getDocumentElement:q,getClippingRect:Ar,getOffsetParent:zt,getElementRects:Dr,getClientRects:Sr,getDimensions:Or,getScale:le,isElement:F,isRTL:Lr};function Bt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ir(e,t){let r=null,o;const i=q(e);function s(){var c;clearTimeout(o),(c=r)==null||c.disconnect(),r=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),s();const l=e.getBoundingClientRect(),{left:d,top:p,width:g,height:f}=l;if(c||t(),!g||!f)return;const m=ve(p),b=ve(i.clientWidth-(d+g)),y=ve(i.clientHeight-(p+f)),v=ve(d),j={rootMargin:-m+"px "+-b+"px "+-y+"px "+-v+"px",threshold:B(0,ne(1,u))||1};let w=!0;function T(R){const C=R[0].intersectionRatio;if(C!==u){if(!w)return a();C?a(!1,C):o=setTimeout(()=>{a(!1,1e-7)},1e3)}C===1&&!Bt(l,e.getBoundingClientRect())&&a(),w=!1}try{r=new IntersectionObserver(T,{...j,root:i.ownerDocument})}catch{r=new IntersectionObserver(T,j)}r.observe(e)}return a(!0),s}function Wr(e,t,r,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,l=Xe(e),d=i||s?[...l?ge(l):[],...ge(t)]:[];d.forEach(v=>{i&&v.addEventListener("scroll",r,{passive:!0}),s&&v.addEventListener("resize",r)});const p=l&&c?Ir(l,r):null;let g=-1,f=null;a&&(f=new ResizeObserver(v=>{let[h]=v;h&&h.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var j;(j=f)==null||j.observe(t)})),r()}),l&&!u&&f.observe(l),f.observe(t));let m,b=u?ie(e):null;u&&y();function y(){const v=ie(e);b&&!Bt(b,v)&&r(),b=v,m=requestAnimationFrame(y)}return r(),()=>{var v;d.forEach(h=>{i&&h.removeEventListener("scroll",r),s&&h.removeEventListener("resize",r)}),p==null||p(),(v=f)==null||v.disconnect(),f=null,u&&cancelAnimationFrame(m)}}const $r=lr,zr=cr,Br=ir,_r=ur,Fr=sr,bt=or,Hr=dr,Vr=(e,t,r)=>{const o=new Map,i={platform:Mr,...r},s={...i.platform,_c:o};return rr(e,t,{...i,platform:s})};var Ur=typeof document<"u",Yr=function(){},je=Ur?D.useLayoutEffect:Yr;function Re(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,o,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!Re(e[o],t[o]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,i[o]))return!1;for(o=r;o--!==0;){const s=i[o];if(!(s==="_owner"&&e.$$typeof)&&!Re(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function _t(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yt(e,t){const r=_t(e);return Math.round(t*r)/r}function Me(e){const t=x.useRef(e);return je(()=>{t.current=e}),t}function Xr(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:u,open:l}=e,[d,p]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[g,f]=x.useState(o);Re(g,o)||f(o);const[m,b]=x.useState(null),[y,v]=x.useState(null),h=x.useCallback(E=>{E!==R.current&&(R.current=E,b(E))},[]),j=x.useCallback(E=>{E!==C.current&&(C.current=E,v(E))},[]),w=s||m,T=a||y,R=x.useRef(null),C=x.useRef(null),A=x.useRef(d),L=u!=null,S=Me(u),P=Me(i),k=Me(l),N=x.useCallback(()=>{if(!R.current||!C.current)return;const E={placement:t,strategy:r,middleware:g};P.current&&(E.platform=P.current),Vr(R.current,C.current,E).then($=>{const V={...$,isPositioned:k.current!==!1};O.current&&!Re(A.current,V)&&(A.current=V,St.flushSync(()=>{p(V)}))})},[g,t,r,P,k]);je(()=>{l===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,p(E=>({...E,isPositioned:!1})))},[l]);const O=x.useRef(!1);je(()=>(O.current=!0,()=>{O.current=!1}),[]),je(()=>{if(w&&(R.current=w),T&&(C.current=T),w&&T){if(S.current)return S.current(w,T,N);N()}},[w,T,N,S,L]);const W=x.useMemo(()=>({reference:R,floating:C,setReference:h,setFloating:j}),[h,j]),I=x.useMemo(()=>({reference:w,floating:T}),[w,T]),M=x.useMemo(()=>{const E={position:r,left:0,top:0};if(!I.floating)return E;const $=yt(I.floating,d.x),V=yt(I.floating,d.y);return c?{...E,transform:"translate("+$+"px, "+V+"px)",..._t(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:$,top:V}},[r,c,I.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:N,refs:W,elements:I,floatingStyles:M}),[d,N,W,I,M])}const qr=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:o,padding:i}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?bt({element:o.current,padding:i}).fn(r):{}:o?bt({element:o,padding:i}).fn(r):{}}}},Kr=(e,t)=>({...$r(e),options:[e,t]}),Gr=(e,t)=>({...zr(e),options:[e,t]}),Zr=(e,t)=>({...Hr(e),options:[e,t]}),Jr=(e,t)=>({...Br(e),options:[e,t]}),Qr=(e,t)=>({..._r(e),options:[e,t]}),eo=(e,t)=>({...Fr(e),options:[e,t]}),to=(e,t)=>({...qr(e),options:[e,t]});var no="Arrow",Ft=x.forwardRef((e,t)=>{const{children:r,width:o=10,height:i=5,...s}=e;return n.jsx(oe.svg,{...s,ref:t,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ft.displayName=no;var ro=Ft;function oo(e){const[t,r]=x.useState(void 0);return te(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,c;if("borderBoxSize"in s){const u=s.borderBoxSize,l=Array.isArray(u)?u[0]:u;a=l.inlineSize,c=l.blockSize}else a=e.offsetWidth,c=e.offsetHeight;r({width:a,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var qe="Popper",[Ht,Vt]=Rt(qe),[io,Ut]=Ht(qe),Yt=e=>{const{__scopePopper:t,children:r}=e,[o,i]=x.useState(null);return n.jsx(io,{scope:t,anchor:o,onAnchorChange:i,children:r})};Yt.displayName=qe;var Xt="PopperAnchor",qt=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:o,...i}=e,s=Ut(Xt,r),a=x.useRef(null),c=se(t,a),u=x.useRef(null);return x.useEffect(()=>{const l=u.current;u.current=(o==null?void 0:o.current)||a.current,l!==u.current&&s.onAnchorChange(u.current)}),o?null:n.jsx(oe.div,{...i,ref:c})});qt.displayName=Xt;var Ke="PopperContent",[so,ao]=Ht(Ke),Kt=x.forwardRef((e,t)=>{var Qe,et,tt,nt,rt,ot;const{__scopePopper:r,side:o="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:f="optimized",onPlaced:m,...b}=e,y=Ut(Ke,r),[v,h]=x.useState(null),j=se(t,fe=>h(fe)),[w,T]=x.useState(null),R=oo(w),C=(R==null?void 0:R.width)??0,A=(R==null?void 0:R.height)??0,L=o+(s!=="center"?"-"+s:""),S=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(l)?l:[l],k=P.length>0,N={padding:S,boundary:P.filter(co),altBoundary:k},{refs:O,floatingStyles:W,placement:I,isPositioned:M,middlewareData:E}=Xr({strategy:"fixed",placement:L,whileElementsMounted:(...fe)=>Wr(...fe,{animationFrame:f==="always"}),elements:{reference:y.anchor},middleware:[Kr({mainAxis:i+A,alignmentAxis:a}),u&&Gr({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Zr():void 0,...N}),u&&Jr({...N}),Qr({...N,apply:({elements:fe,rects:it,availableWidth:wn,availableHeight:jn})=>{const{width:Cn,height:Sn}=it.reference,ye=fe.floating.style;ye.setProperty("--radix-popper-available-width",`${wn}px`),ye.setProperty("--radix-popper-available-height",`${jn}px`),ye.setProperty("--radix-popper-anchor-width",`${Cn}px`),ye.setProperty("--radix-popper-anchor-height",`${Sn}px`)}}),w&&to({element:w,padding:c}),uo({arrowWidth:C,arrowHeight:A}),g&&eo({strategy:"referenceHidden",...N})]}),[$,V]=Jt(I),be=ke(m);te(()=>{M&&(be==null||be())},[M,be]);const hn=(Qe=E.arrow)==null?void 0:Qe.x,mn=(et=E.arrow)==null?void 0:et.y,bn=((tt=E.arrow)==null?void 0:tt.centerOffset)!==0,[yn,vn]=x.useState();return te(()=>{v&&vn(window.getComputedStyle(v).zIndex)},[v]),n.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:M?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:yn,"--radix-popper-transform-origin":[(nt=E.transformOrigin)==null?void 0:nt.x,(rt=E.transformOrigin)==null?void 0:rt.y].join(" "),...((ot=E.hide)==null?void 0:ot.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(so,{scope:r,placedSide:$,onArrowChange:T,arrowX:hn,arrowY:mn,shouldHideArrow:bn,children:n.jsx(oe.div,{"data-side":$,"data-align":V,...b,ref:j,style:{...b.style,animation:M?void 0:"none"}})})})});Kt.displayName=Ke;var Gt="PopperArrow",lo={top:"bottom",right:"left",bottom:"top",left:"right"},Zt=x.forwardRef(function(t,r){const{__scopePopper:o,...i}=t,s=ao(Gt,o),a=lo[s.placedSide];return n.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:n.jsx(ro,{...i,ref:r,style:{...i.style,display:"block"}})})});Zt.displayName=Gt;function co(e){return e!==null}var uo=e=>({name:"transformOrigin",options:e,fn(t){var y,v,h;const{placement:r,rects:o,middlewareData:i}=t,a=((y=i.arrow)==null?void 0:y.centerOffset)!==0,c=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[l,d]=Jt(r),p={start:"0%",center:"50%",end:"100%"}[d],g=(((v=i.arrow)==null?void 0:v.x)??0)+c/2,f=(((h=i.arrow)==null?void 0:h.y)??0)+u/2;let m="",b="";return l==="bottom"?(m=a?p:`${g}px`,b=`${-u}px`):l==="top"?(m=a?p:`${g}px`,b=`${o.floating.height+u}px`):l==="right"?(m=`${-u}px`,b=a?p:`${f}px`):l==="left"&&(m=`${o.floating.width+u}px`,b=a?p:`${f}px`),{data:{x:m,y:b}}}});function Jt(e){const[t,r="center"]=e.split("-");return[t,r]}var po=Yt,fo=qt,go=Kt,xo=Zt,ho="Portal",Qt=x.forwardRef((e,t)=>{var c;const{container:r,...o}=e,[i,s]=x.useState(!1);te(()=>s(!0),[]);const a=r||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?jt.createPortal(n.jsx(oe.div,{...o,ref:t}),a):null});Qt.displayName=ho;function mo(e,t){return x.useReducer((r,o)=>t[r][o]??r,e)}var Ge=e=>{const{present:t,children:r}=e,o=bo(t),i=typeof r=="function"?r({present:o.isPresent}):x.Children.only(r),s=se(o.ref,yo(i));return typeof r=="function"||o.isPresent?x.cloneElement(i,{ref:s}):null};Ge.displayName="Presence";function bo(e){const[t,r]=x.useState(),o=x.useRef(null),i=x.useRef(e),s=x.useRef("none"),a=e?"mounted":"unmounted",[c,u]=mo(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const l=we(o.current);s.current=c==="mounted"?l:"none"},[c]),te(()=>{const l=o.current,d=i.current;if(d!==e){const g=s.current,f=we(l);e?u("MOUNT"):f==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(d&&g!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),te(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,p=f=>{const b=we(o.current).includes(CSS.escape(f.animationName));if(f.target===t&&b&&(u("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},g=f=>{f.target===t&&(s.current=we(o.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(l=>{o.current=l?getComputedStyle(l):null,r(l)},[])}}function we(e){return(e==null?void 0:e.animationName)||"none"}function yo(e){var o,i;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var vo=x[" useInsertionEffect ".trim().toString()]||te;function wo({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[i,s,a]=jo({defaultProp:t,onChange:r}),c=e!==void 0,u=c?e:i;{const d=x.useRef(e!==void 0);x.useEffect(()=>{const p=d.current;p!==c&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=c},[c,o])}const l=x.useCallback(d=>{var p;if(c){const g=Co(d)?d(e):d;g!==e&&((p=a.current)==null||p.call(a,g))}else s(d)},[c,e,s,a]);return[u,l]}function jo({defaultProp:e,onChange:t}){const[r,o]=x.useState(e),i=x.useRef(r),s=x.useRef(t);return vo(()=>{s.current=t},[t]),x.useEffect(()=>{var a;i.current!==r&&((a=s.current)==null||a.call(s,r),i.current=r)},[r,i]),[r,o,s]}function Co(e){return typeof e=="function"}var So=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"}),To="VisuallyHidden",en=x.forwardRef((e,t)=>n.jsx(oe.span,{...e,ref:t,style:{...So,...e.style}}));en.displayName=To;var Ro=en,[Ne]=Rt("Tooltip",[Vt]),De=Vt(),tn="TooltipProvider",ko=700,Be="tooltip.open",[Eo,Ze]=Ne(tn),nn=e=>{const{__scopeTooltip:t,delayDuration:r=ko,skipDelayDuration:o=300,disableHoverableContent:i=!1,children:s}=e,a=x.useRef(!0),c=x.useRef(!1),u=x.useRef(0);return x.useEffect(()=>{const l=u.current;return()=>window.clearTimeout(l)},[]),n.jsx(Eo,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:x.useCallback(()=>{window.clearTimeout(u.current),a.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:x.useCallback(l=>{c.current=l},[]),disableHoverableContent:i,children:s})};nn.displayName=tn;var xe="Tooltip",[Po,me]=Ne(xe),rn=e=>{const{__scopeTooltip:t,children:r,open:o,defaultOpen:i,onOpenChange:s,disableHoverableContent:a,delayDuration:c}=e,u=Ze(xe,e.__scopeTooltip),l=De(t),[d,p]=x.useState(null),g=Vn(),f=x.useRef(0),m=a??u.disableHoverableContent,b=c??u.delayDuration,y=x.useRef(!1),[v,h]=wo({prop:o,defaultProp:i??!1,onChange:C=>{C?(u.onOpen(),document.dispatchEvent(new CustomEvent(Be))):u.onClose(),s==null||s(C)},caller:xe}),j=x.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),w=x.useCallback(()=>{window.clearTimeout(f.current),f.current=0,y.current=!1,h(!0)},[h]),T=x.useCallback(()=>{window.clearTimeout(f.current),f.current=0,h(!1)},[h]),R=x.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{y.current=!0,h(!0),f.current=0},b)},[b,h]);return x.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),n.jsx(po,{...l,children:n.jsx(Po,{scope:t,contentId:g,open:v,stateAttribute:j,trigger:d,onTriggerChange:p,onTriggerEnter:x.useCallback(()=>{u.isOpenDelayedRef.current?R():w()},[u.isOpenDelayedRef,R,w]),onTriggerLeave:x.useCallback(()=>{m?T():(window.clearTimeout(f.current),f.current=0)},[T,m]),onOpen:w,onClose:T,disableHoverableContent:m,children:r})})};rn.displayName=xe;var _e="TooltipTrigger",on=x.forwardRef((e,t)=>{const{__scopeTooltip:r,...o}=e,i=me(_e,r),s=Ze(_e,r),a=De(r),c=x.useRef(null),u=se(t,c,i.onTriggerChange),l=x.useRef(!1),d=x.useRef(!1),p=x.useCallback(()=>l.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),n.jsx(fo,{asChild:!0,...a,children:n.jsx(oe.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...o,ref:u,onPointerMove:K(e.onPointerMove,g=>{g.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:K(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:K(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:K(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:K(e.onBlur,i.onClose),onClick:K(e.onClick,i.onClose)})})});on.displayName=_e;var Je="TooltipPortal",[Ao,Oo]=Ne(Je,{forceMount:void 0}),sn=e=>{const{__scopeTooltip:t,forceMount:r,children:o,container:i}=e,s=me(Je,t);return n.jsx(Ao,{scope:t,forceMount:r,children:n.jsx(Ge,{present:r||s.open,children:n.jsx(Qt,{asChild:!0,container:i,children:o})})})};sn.displayName=Je;var de="TooltipContent",an=x.forwardRef((e,t)=>{const r=Oo(de,e.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...s}=e,a=me(de,e.__scopeTooltip);return n.jsx(Ge,{present:o||a.open,children:a.disableHoverableContent?n.jsx(ln,{side:i,...s,ref:t}):n.jsx(No,{side:i,...s,ref:t})})}),No=x.forwardRef((e,t)=>{const r=me(de,e.__scopeTooltip),o=Ze(de,e.__scopeTooltip),i=x.useRef(null),s=se(t,i),[a,c]=x.useState(null),{trigger:u,onClose:l}=r,d=i.current,{onPointerInTransitChange:p}=o,g=x.useCallback(()=>{c(null),p(!1)},[p]),f=x.useCallback((m,b)=>{const y=m.currentTarget,v={x:m.clientX,y:m.clientY},h=Io(v,y.getBoundingClientRect()),j=Wo(v,h),w=$o(b.getBoundingClientRect()),T=Bo([...j,...w]);c(T),p(!0)},[p]);return x.useEffect(()=>()=>g(),[g]),x.useEffect(()=>{if(u&&d){const m=y=>f(y,d),b=y=>f(y,u);return u.addEventListener("pointerleave",m),d.addEventListener("pointerleave",b),()=>{u.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",b)}}},[u,d,f,g]),x.useEffect(()=>{if(a){const m=b=>{const y=b.target,v={x:b.clientX,y:b.clientY},h=(u==null?void 0:u.contains(y))||(d==null?void 0:d.contains(y)),j=!zo(v,a);h?g():j&&(g(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[u,d,a,l,g]),n.jsx(ln,{...e,ref:s})}),[Do,Lo]=Ne(xe,{isInside:!1}),Mo=En("TooltipContent"),ln=x.forwardRef((e,t)=>{const{__scopeTooltip:r,children:o,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...c}=e,u=me(de,r),l=De(r),{onClose:d}=u;return x.useEffect(()=>(document.addEventListener(Be,d),()=>document.removeEventListener(Be,d)),[d]),x.useEffect(()=>{if(u.trigger){const p=g=>{const f=g.target;f!=null&&f.contains(u.trigger)&&d()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,d]),n.jsx(Pt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:d,children:n.jsxs(go,{"data-state":u.stateAttribute,...l,...c,ref:t,style:{...c.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:[n.jsx(Mo,{children:o}),n.jsx(Do,{scope:r,isInside:!0,children:n.jsx(Ro,{id:u.contentId,role:"tooltip",children:i||o})})]})})});an.displayName=de;var cn="TooltipArrow",dn=x.forwardRef((e,t)=>{const{__scopeTooltip:r,...o}=e,i=De(r);return Lo(cn,r).isInside?null:n.jsx(xo,{...i,...o,ref:t})});dn.displayName=cn;function Io(e,t){const r=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,o,i,s)){case s:return"left";case i:return"right";case r:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Wo(e,t,r=5){const o=[];switch(t){case"top":o.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":o.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":o.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":o.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return o}function $o(e){const{top:t,right:r,bottom:o,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:o},{x:i,y:o}]}function zo(e,t){const{x:r,y:o}=e;let i=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const c=t[s],u=t[a],l=c.x,d=c.y,p=u.x,g=u.y;d>o!=g>o&&r<(p-l)*(o-d)/(g-d)+l&&(i=!i)}return i}function Bo(e){const t=e.slice();return t.sort((r,o)=>r.x<o.x?-1:r.x>o.x?1:r.y<o.y?-1:r.y>o.y?1:0),_o(t)}function _o(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const i=e[o];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const r=[];for(let o=e.length-1;o>=0;o--){const i=e[o];for(;r.length>=2;){const s=r[r.length-1],a=r[r.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))r.pop();else break}r.push(i)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Fo=nn,Ho=rn,Vo=on,Uo=sn,Yo=an,Xo=dn;function un({delayDuration:e=0,...t}){return n.jsx(Fo,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function J({...e}){return n.jsx(un,{children:n.jsx(Ho,{"data-slot":"tooltip",...e})})}function Q({...e}){return n.jsx(Vo,{"data-slot":"tooltip-trigger",...e})}function ee({sideOffset:e=8,children:t,style:r,...o}){return n.jsx(Uo,{children:n.jsxs(Yo,{"data-slot":"tooltip-content",sideOffset:e,style:{background:"rgba(30, 33, 37, 0.96)",color:"white",fontSize:"var(--text-xs, 10px)",lineHeight:1.4,padding:"6px 12px",borderRadius:"var(--radius-lg, 8px)",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.2)",zIndex:50,width:"fit-content",textWrap:"balance",animationDuration:"0.15s",...r},...o,children:[t,n.jsx(Xo,{style:{fill:"rgba(30, 33, 37, 0.96)",width:10,height:5}})]})})}function ae({level:e=1,label:t="dev",color:r="rgba(30, 33, 37, 0.65)",showLabel:o=!1,direction:i}){const a=[{dots:"●○○○○",text:"Expected — very typical",level:1},{dots:"●●○○○",text:"Typical",level:2},{dots:"●●●○○",text:"Notable",level:3},{dots:"●●●●○",text:"Atypical",level:4},{dots:"●●●●●",text:"Highly atypical — very uncommon",level:5}],c=a.find(l=>l.level===e),u=n.jsxs("div",{style:{minWidth:"260px"},children:[n.jsx("div",{style:{fontWeight:650,marginBottom:"6px",fontSize:"12px"},children:"Deviation from the norm"}),n.jsx("div",{style:{fontSize:"11.5px",lineHeight:1.5,marginBottom:"8px",opacity:.9},children:"Highlights how common or uncommon this behavior is relative to similar calls."}),c&&n.jsxs("div",{style:{fontSize:"11px",lineHeight:1.7,fontFamily:"ui-monospace, monospace",marginBottom:"10px",padding:"6px 8px",background:"rgba(255, 255, 255, 0.12)",borderRadius:"6px",fontWeight:600},children:[n.jsx("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:n.jsxs("span",{children:[c.dots," ",c.text]})}),i&&n.jsx("div",{style:{fontSize:"10px",marginTop:"4px",opacity:.8},children:i==="up"?"Positive deviation":"Negative deviation"})]}),n.jsxs("div",{style:{fontSize:"10.5px",lineHeight:1.7,fontFamily:"ui-monospace, monospace",opacity:.75},children:[n.jsx("div",{style:{fontSize:"10px",marginBottom:"4px",opacity:.7,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Full scale:"}),a.slice().reverse().map(l=>n.jsxs("div",{style:{opacity:l.level===e?.5:.7,fontSize:l.level===e?"10px":"10.5px"},children:[l.dots," ",l.text]},l.level))]})]});return n.jsxs(J,{children:[n.jsx(Q,{asChild:!0,children:n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"help"},children:[o&&n.jsx("div",{style:{fontSize:"10px",color:r,fontWeight:650,letterSpacing:"0.02em",textTransform:"uppercase",opacity:.75},children:t}),n.jsx("div",{style:{display:"flex",gap:"3px",alignItems:"center"},children:Array.from({length:5}).map((l,d)=>{const p=d<e;return n.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:p?r:`${r}15`,border:p?"none":`1px solid ${r}40`,transition:"all 0.2s ease",opacity:p?.75:.5}},d)})})]})}),n.jsx(ee,{style:{maxWidth:300,padding:16},side:"bottom",sideOffset:8,children:u})]})}function pn({variant:e="default",padding:t="md",railColor:r,interactive:o=!1,isActive:i=!1,onClick:s,style:a,className:c,children:u,...l}){const d=o||!!s,p={default:{background:"var(--paper)",border:"1px solid var(--border)",boxShadow:"0 1px 3px var(--shadow)"},elevated:{background:"var(--paper-elevated)",border:"1px solid var(--border)",boxShadow:"0 2px 6px var(--shadow)"},secondary:{background:"var(--paper-secondary)",border:"1px solid var(--border-subtle)",boxShadow:"none"},ghost:{background:"transparent",border:"none",boxShadow:"none"}},g={none:0,sm:8,md:14,lg:20},f=p[e]||p.default,m=g[t]??g.md,b={position:"relative",borderRadius:"var(--radius-md, 6px)",overflow:"hidden",padding:r?`${m}px ${m}px ${m}px ${m+10}px`:m,transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s",...f,...d&&{cursor:"pointer"},...i&&{background:"var(--hover-warm-subtle, rgba(200,170,120,0.06))",borderColor:"var(--border-hover)"},...a},y=h=>{!d||i||(h.currentTarget.style.background="var(--hover-warm-subtle, rgba(200,170,120,0.06))",h.currentTarget.style.borderColor="var(--border-hover)")},v=h=>{d&&(i?(h.currentTarget.style.background="var(--hover-warm-subtle, rgba(200,170,120,0.06))",h.currentTarget.style.borderColor="var(--border-hover)"):(h.currentTarget.style.background=f.background,h.currentTarget.style.borderColor=f.border.replace("1px solid ","")))};return n.jsxs("div",{style:b,className:c,onClick:s,onMouseEnter:y,onMouseLeave:v,...l,children:[r&&n.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:4,background:r}}),u]})}function qo({title:e,children:t}){return n.jsxs(pn,{variant:"elevated",padding:"sm",children:[n.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-strong)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:8},children:e}),t]})}function Ko({children:e,variant:t="default",size:r="md",...o}){const i={default:{color:"var(--text-muted)",backgroundColor:"var(--hover-warm)",borderColor:"var(--border)"},policy:{color:"var(--rail-compliance)",backgroundColor:"rgba(201,138,90,0.1)",borderColor:"rgba(201,138,90,0.25)"},tool:{color:"var(--rail-discovery)",backgroundColor:"rgba(94,136,176,0.1)",borderColor:"rgba(94,136,176,0.25)"},global:{color:"var(--rail-tone)",backgroundColor:"rgba(155,122,168,0.1)",borderColor:"rgba(155,122,168,0.25)"},phase:{color:"var(--rail-outcome)",backgroundColor:"rgba(107,124,147,0.1)",borderColor:"rgba(107,124,147,0.25)"}},s={sm:{fontSize:"var(--text-xs)",padding:"1px 6px"},md:{fontSize:"var(--text-sm)",padding:"2px 8px"}},a=i[t]||i.default,c=s[r]||s.md;return n.jsx("span",{style:{display:"inline-flex",alignItems:"center",borderRadius:"var(--radius-sm)",border:`1px solid ${a.borderColor}`,...a,...c,...o.style},...o,children:e})}function Go({children:e,onClick:t,variant:r="secondary",disabled:o=!1,size:i="md",...s}){const a={primary:{backgroundColor:"var(--rail-tone)",color:"white",border:"none"},secondary:{backgroundColor:"transparent",border:"1px solid var(--border)",color:"var(--text-base)"},ghost:{backgroundColor:"transparent",border:"none",color:"var(--text-muted)"},danger:{backgroundColor:"var(--rail-signal-churn)",color:"white",border:"none"}},c={sm:{fontSize:"var(--text-xs)",padding:"4px 10px"},md:{fontSize:"var(--text-sm)",padding:"6px 14px"}},u={borderRadius:"var(--radius)",transition:"var(--transition-fast)",cursor:o?"not-allowed":"pointer",opacity:o?.5:1,display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-sans)",fontWeight:"var(--font-medium)",textDecoration:"none",userSelect:"none"},l=b=>{o||(r==="secondary"||r==="ghost"?b.currentTarget.style.backgroundColor="var(--hover-warm)":r==="danger"&&(b.currentTarget.style.opacity="0.85"))},d=b=>{o||(r==="secondary"||r==="ghost"?b.currentTarget.style.backgroundColor="transparent":r==="danger"&&(b.currentTarget.style.opacity="1"))},p=a[r]||a.secondary,g=c[i]||c.md,{style:f,...m}=s;return n.jsx("button",{onClick:o?void 0:t,onMouseEnter:l,onMouseLeave:d,style:{...u,...p,...g,...f},disabled:o,...m,children:e})}function Zo({children:e,...t}){return n.jsx("div",{style:{fontSize:"var(--text-xs)",fontWeight:"var(--font-semibold)",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"var(--tracking-wider)",marginBottom:"var(--spacing-1)",fontFamily:"var(--font-sans)",...t.style},...t,children:e})}function Jo({data:e}){const[t,r]=D.useState(!1);return n.jsxs("div",{className:"flex rounded-2xl overflow-hidden bg-white/85 shadow-lg border border-slate-200/50",style:{maxWidth:"900px"},children:[n.jsx("div",{className:"w-1.5 flex-shrink-0",style:{backgroundColor:e.railColor}}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("button",{onClick:()=>r(!t),className:"w-full text-left px-6 py-4 hover:bg-white/40 transition-colors",children:[n.jsx("div",{className:"text-[11px] tracking-[0.16em] uppercase mb-2.5",style:{color:"rgba(30, 33, 37, 0.36)",fontWeight:650},children:e.category}),n.jsxs("div",{className:"flex items-start justify-between gap-4 mb-3",children:[n.jsx("h2",{className:"flex-1",style:{fontSize:"18px",fontWeight:720,letterSpacing:"-0.01em",lineHeight:1.25,color:"rgba(30, 33, 37, 0.92)"},children:e.title}),n.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"8px"},children:[e.deviation&&n.jsx(ae,{level:e.deviation,color:e.railColor,direction:e.deviationDirection}),n.jsx(z.ChevronDown,{size:18,style:{color:"rgba(30, 33, 37, 0.42)",flexShrink:0,transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})]})]}),n.jsx("div",{className:"text-[11.5px] font-mono",style:{color:"rgba(30, 33, 37, 0.52)"},children:e.key}),n.jsxs("div",{className:"mt-1 text-[11.5px]",style:{color:"rgba(30, 33, 37, 0.52)"},children:["value_type ",n.jsx("strong",{children:e.metadata.valueType})," · "," allowed"," ",e.metadata.allowed.map((o,i)=>n.jsxs("span",{children:[n.jsx("strong",{children:o}),i<e.metadata.allowed.length-1&&", "]},o))," · "," version ",n.jsx("strong",{children:e.metadata.version})]}),n.jsx("p",{className:"mt-3 text-[13px] leading-relaxed",style:{color:"rgba(30, 33, 37, 0.68)"},children:e.description}),n.jsx("p",{className:"mt-3 text-xs",style:{color:"rgba(30, 33, 37, 0.56)"},children:t?"Collapse to hide details":"Expand to view required conditions and implementation details."})]}),t&&n.jsxs("div",{className:"border-t border-slate-200/40 bg-white/60 px-6 py-4",children:[n.jsx("div",{className:"text-[11px] tracking-[0.16em] uppercase mb-3",style:{color:"rgba(30, 33, 37, 0.36)",fontWeight:650},children:"Required conditions"}),n.jsx("div",{className:"flex flex-col gap-3 mb-5",children:e.requiredConditions.map(o=>n.jsxs("div",{className:"flex rounded-xl overflow-hidden bg-white/82 border border-slate-200/50",children:[n.jsx("div",{className:"w-1.5 flex-shrink-0",style:{backgroundColor:o.railColor}}),n.jsxs("div",{className:"flex-1 px-4 py-3",children:[n.jsx("div",{className:"text-[13px]",style:{fontWeight:680,lineHeight:1.2,color:"rgba(30, 33, 37, 0.92)"},children:o.title}),n.jsx("div",{className:"mt-1 text-[11.5px] font-mono",style:{color:"rgba(30, 33, 37, 0.52)"},children:o.technicalName}),n.jsxs("div",{className:"mt-1 text-[11.5px]",style:{color:"rgba(30, 33, 37, 0.52)"},children:["role ",n.jsx("strong",{children:o.role})]})]})]},o.technicalName))}),n.jsx("div",{className:"text-[11px] tracking-[0.16em] uppercase mb-2.5",style:{color:"rgba(30, 33, 37, 0.36)",fontWeight:650},children:"Tags"}),n.jsx("div",{className:"flex flex-wrap gap-2 mb-5",children:e.tags.map(o=>n.jsx("span",{className:"text-[11px] px-2 py-0.5 rounded-full border font-mono",style:{borderColor:"rgba(30, 33, 37, 0.50)",background:"rgba(255, 255, 255, 0.70)",color:"rgba(30, 33, 37, 0.60)"},children:o},o))}),n.jsx("div",{className:"text-[11px] tracking-[0.16em] uppercase mb-2.5",style:{color:"rgba(30, 33, 37, 0.36)",fontWeight:650},children:"Implementation"}),n.jsx("div",{className:"text-[12.5px] leading-relaxed font-mono",style:{color:"rgba(30, 33, 37, 0.62)"},children:e.implementation})]})]})]})}function fn({category:e,statement:t,technicalKey:r,value:o,confidence:i,relevance:s,timestamps:a=[],railColor:c,expanded:u=!1,nestedObservations:l=[],onPlayTimestamp:d,onToggle:p,selected:g=!1,onClick:f,deviation:m,deviationDirection:b}){const[y,v]=D.useState(!1);return n.jsxs("div",{style:{position:"relative",display:"flex",border:`1px solid ${g?"rgba(94, 136, 176, 0.35)":y?"rgba(52, 58, 64, 0.18)":"rgba(52, 58, 64, 0.12)"}`,borderRadius:"16px",overflow:"hidden",background:g?"rgba(231, 212, 162, 0.18)":y?"rgba(231, 212, 162, 0.12)":"rgba(255, 255, 255, 0.85)",boxShadow:g?"0 12px 32px rgba(30, 33, 37, 0.20), 0 4px 12px rgba(94, 136, 176, 0.15)":y?"0 8px 18px rgba(30, 33, 37, 0.12)":"0 6px 14px rgba(30, 33, 37, 0.08)",transform:g?"translateY(-3px)":"none",transition:"all 0.2s ease-out",cursor:f||p?"pointer":"default"},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onClick:f||p,children:[n.jsx("div",{style:{width:"5px",background:c}}),n.jsxs("div",{style:{flex:1},children:[n.jsxs("div",{style:{padding:"14px 16px 12px"},children:[n.jsxs("div",{style:{display:"flex",gap:"12px"},children:[n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsx("div",{className:"text-[11px] tracking-[0.16em] uppercase mb-2",style:{color:"rgba(30, 33, 37, 0.36)",fontWeight:650},children:e}),n.jsx("div",{style:{fontSize:"16px",fontWeight:720,letterSpacing:"-0.01em",color:"rgba(30, 33, 37, 0.92)",lineHeight:1.3},children:t}),n.jsx("div",{style:{marginTop:"6px",fontSize:"11.5px",color:"rgba(30, 33, 37, 0.52)",fontFamily:"ui-monospace, monospace"},children:r}),n.jsxs("div",{style:{marginTop:"3px",fontSize:"11.5px",color:"rgba(30, 33, 37, 0.52)",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px"},children:[n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[n.jsx("span",{style:{color:"rgba(94, 136, 176, 0.65)"},children:"value"})," ",n.jsx("strong",{style:{color:"rgba(94, 136, 176, 0.85)"},children:o})]}),n.jsx("span",{children:"·"}),n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[n.jsxs(J,{children:[n.jsx(Q,{asChild:!0,children:n.jsx("span",{style:{color:"rgba(184, 156, 106, 0.65)",cursor:"help",borderBottom:"1px dotted rgba(184, 156, 106, 0.35)"},children:"conf"})}),n.jsx(ee,{children:n.jsxs("div",{children:[n.jsx("div",{style:{fontWeight:600,marginBottom:"4px"},children:"Confidence measures evidence."}),n.jsx("div",{style:{color:"rgba(255, 255, 255, 0.85)"},children:"How strongly the evidence supports this observation in this session."})]})})]})," ",n.jsx("strong",{style:{color:`rgba(184, 156, 106, ${i})`},children:i.toFixed(2)}),n.jsx("span",{style:{display:"inline-block",width:"45px",height:"3px",background:"rgba(30, 33, 37, 0.12)",borderRadius:"2px",position:"relative",overflow:"hidden"},children:n.jsx("span",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${i*100}%`,background:`rgba(184, 156, 106, ${i})`,borderRadius:"2px",transition:"width 0.3s ease"}})})]}),s&&n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"·"}),n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[n.jsx("span",{style:{color:"rgba(139, 123, 168, 0.65)"},children:"rel"})," ",n.jsx("strong",{style:{color:"rgba(139, 123, 168, 0.85)"},children:s})]})]})]}),a.length>0&&n.jsxs("div",{style:{marginTop:"4px",display:"flex",flexWrap:"wrap",gap:"6px",alignItems:"center"},children:[n.jsx("span",{style:{fontSize:"11px",color:"rgba(30, 33, 37, 0.52)"},children:"@"}),a.map((h,j)=>n.jsxs("button",{onClick:w=>{w.stopPropagation(),d&&d(h.start,h.end)},style:{fontSize:"11px",padding:"2px 6px",borderRadius:"999px",border:"1px solid rgba(52, 58, 64, 0.16)",background:"rgba(255, 255, 255, 0.70)",color:"rgba(30, 33, 37, 0.60)",fontFamily:"ui-monospace, monospace",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"4px",transition:"all 0.15s ease"},onMouseEnter:w=>{w.currentTarget.style.background="rgba(255, 255, 255, 0.95)",w.currentTarget.style.borderColor="rgba(52, 58, 64, 0.24)"},onMouseLeave:w=>{w.currentTarget.style.background="rgba(255, 255, 255, 0.70)",w.currentTarget.style.borderColor="rgba(52, 58, 64, 0.16)"},children:[n.jsx("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M3 2.5L9 6L3 9.5V2.5Z",fill:"currentColor"})}),h.start,"–",h.end]},j))]})]}),m&&n.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",flexShrink:0},children:n.jsx(ae,{level:m,color:c,direction:b})})]}),l.length>0&&(p||f)&&n.jsx("div",{style:{marginTop:"8px",display:"flex",justifyContent:"flex-end",paddingTop:"8px",borderTop:"1px solid rgba(52, 58, 64, 0.08)"},children:n.jsxs("div",{style:{color:"rgba(30, 33, 37, 0.42)",display:"flex",alignItems:"center",gap:"6px"},children:[n.jsxs("span",{style:{fontSize:"11px",fontWeight:600,color:"rgba(30, 33, 37, 0.52)"},children:[u?"Hide":"Show"," nested observations"]}),n.jsx(z.ChevronDown,{size:18,style:{transform:u?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})]})})]}),u&&l.length>0&&n.jsxs("div",{style:{borderTop:"1px solid rgba(52, 58, 64, 0.10)",background:"rgba(255, 255, 255, 0.60)",padding:"14px 16px 16px"},children:[n.jsx("div",{className:"text-[11px] tracking-[0.16em] uppercase mb-3",style:{color:"rgba(30, 33, 37, 0.36)",fontWeight:650},children:"Supporting conditions"}),n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:l.map((h,j)=>!h||!h.category||!h.statement||!h.technicalKey?null:n.jsx(fn,{category:h.category||"Condition",statement:h.statement||"",technicalKey:h.technicalKey||"",value:h.value||"present",confidence:h.confidence||.8,relevance:h.relevance,timestamps:h.timestamps||[],railColor:h.railColor||"#6B7C93",deviation:h.deviation,deviationDirection:h.deviationDirection,onPlayTimestamp:d},j))})]})]})]})}function gn({driver:e,onPlayTimestamp:t,selected:r=!1,onClick:o,showWeight:i=!1,hideMetrics:s=!1}){const[a,c]=D.useState(!1),u=e.state==="absent",l=e.timestamps&&e.timestamps.length>0,d=()=>u?a?"linear-gradient(135deg, rgba(30, 33, 37, 0.06) 0%, rgba(30, 33, 37, 0.06) 35%, rgba(255, 255, 255, 0.82) 35%, rgba(255, 255, 255, 0.82) 100%)":"linear-gradient(135deg, rgba(30, 33, 37, 0.04) 0%, rgba(30, 33, 37, 0.04) 35%, rgba(255, 255, 255, 0.82) 35%, rgba(255, 255, 255, 0.82) 100%)":r?"rgba(231, 212, 162, 0.18)":a?"rgba(231, 212, 162, 0.12)":"rgba(255, 255, 255, 0.82)";return n.jsxs("div",{style:{position:"relative",display:"flex",border:`1px solid ${r?"rgba(94, 136, 176, 0.35)":a?"rgba(52, 58, 64, 0.18)":"rgba(52, 58, 64, 0.12)"}`,borderRadius:"12px",overflow:"hidden",background:d(),boxShadow:r?"0 8px 24px rgba(30, 33, 37, 0.18), 0 2px 8px rgba(94, 136, 176, 0.12)":"0 2px 4px rgba(30, 33, 37, 0.06)",transform:r?"translateY(-2px)":"none",cursor:o?"pointer":"default",transition:"all 0.2s ease-out"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onClick:o,children:[n.jsx("div",{style:{width:"5px",background:e.railColor}}),n.jsxs("div",{style:{flex:1,padding:"10px 12px"},children:[n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"8px",marginBottom:e.deviation?"4px":"0"},children:[n.jsx("div",{style:{flex:1,fontSize:"13px",fontWeight:680,color:u?"rgba(30, 33, 37, 0.70)":"rgba(30, 33, 37, 0.92)",lineHeight:1.2,textDecoration:u?"line-through":"none",textDecorationThickness:u?"2px":void 0},children:e.title}),e.deviation&&n.jsx(ae,{level:e.deviation,color:e.railColor,direction:e.deviationDirection})]}),n.jsx("div",{style:{marginTop:"3px",fontSize:"11.5px",color:"rgba(30, 33, 37, 0.52)",fontFamily:"ui-monospace, monospace"},children:e.technicalName}),!s&&n.jsxs("div",{style:{marginTop:"3px",fontSize:"11.5px",color:"rgba(30, 33, 37, 0.52)",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px"},children:[n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[n.jsxs(J,{children:[n.jsx(Q,{asChild:!0,children:n.jsx("span",{style:{color:"rgba(94, 136, 176, 0.65)",cursor:"help",borderBottom:"1px dotted rgba(94, 136, 176, 0.35)"},children:"state"})}),n.jsx(ee,{side:"top",className:"max-w-[320px]",children:n.jsxs("div",{style:{fontSize:"11px",lineHeight:1.5},children:[n.jsx("div",{style:{fontWeight:600,marginBottom:"6px"},children:"Condition states describe what the evidence supports."}),n.jsxs("div",{style:{marginBottom:"8px",color:"rgba(255, 255, 255, 0.85)"},children:[n.jsx("strong",{children:"Present"})," — Clear evidence shows this condition occurred in the session."]}),n.jsxs("div",{style:{marginBottom:"8px",color:"rgba(255, 255, 255, 0.85)"},children:[n.jsx("strong",{children:"Absent"})," — Evidence indicates this condition did not occur."]}),n.jsxs("div",{style:{color:"rgba(255, 255, 255, 0.85)"},children:[n.jsx("strong",{children:"Unknown"})," — There ","isn't"," enough evidence to decide either way."]})]})})]})," ",n.jsx("strong",{style:{color:`rgba(94, 136, 176, ${e.state==="present"?.85:e.state==="absent"?.45:.65})`},children:e.state})]}),n.jsx("span",{children:"·"}),n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[n.jsxs(J,{children:[n.jsx(Q,{asChild:!0,children:n.jsx("span",{style:{color:"rgba(184, 156, 106, 0.65)",cursor:"help",borderBottom:"1px dotted rgba(184, 156, 106, 0.35)"},children:"conf"})}),n.jsx(ee,{side:"top",children:n.jsxs("div",{style:{fontSize:"11px",lineHeight:1.5},children:[n.jsx("div",{style:{fontWeight:600,marginBottom:"4px"},children:"Confidence measures evidence."}),n.jsx("div",{style:{color:"rgba(255, 255, 255, 0.85)"},children:"How strongly the evidence supports this observation in this session."})]})})]})," ",n.jsx("strong",{style:{color:`rgba(184, 156, 106, ${e.confidence})`},children:e.confidence.toFixed(2)}),n.jsx("span",{style:{display:"inline-block",width:"45px",height:"3px",background:"rgba(30, 33, 37, 0.12)",borderRadius:"2px",position:"relative",overflow:"hidden"},children:n.jsx("span",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${e.confidence*100}%`,background:`rgba(184, 156, 106, ${e.confidence})`,borderRadius:"2px",transition:"width 0.3s ease"}})})]}),n.jsx("span",{children:"·"}),n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[n.jsxs(J,{children:[n.jsx(Q,{asChild:!0,children:n.jsx("span",{style:{color:"rgba(75, 135, 125, 0.75)",cursor:"help",borderBottom:"1px dotted rgba(75, 135, 125, 0.45)"},children:"prob"})}),n.jsx(ee,{side:"top",children:n.jsxs("div",{style:{fontSize:"11px",lineHeight:1.5},children:[n.jsx("div",{style:{fontWeight:600,marginBottom:"4px"},children:"Probability measures expectation."}),n.jsx("div",{style:{color:"rgba(255, 255, 255, 0.85)"},children:"How likely this observation is given past sessions and current evidence."})]})})]})," ",n.jsx("strong",{style:{color:`rgba(75, 135, 125, ${Math.max(e.probability,.75)})`},children:e.probability.toFixed(2)}),n.jsx("span",{style:{display:"inline-block",width:"45px",height:"3px",background:"rgba(30, 33, 37, 0.12)",borderRadius:"2px",position:"relative",overflow:"hidden"},children:n.jsx("span",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${e.probability*100}%`,background:`rgba(75, 135, 125, ${Math.max(e.probability,.75)})`,borderRadius:"2px",transition:"width 0.3s ease"}})})]}),i&&n.jsx("span",{children:"·"}),i&&n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[n.jsx("span",{style:{color:"rgba(107, 123, 147, 0.65)"},children:"weight"})," ",n.jsxs("strong",{style:{color:"rgba(107, 123, 147, 0.85)"},children:[e.weight>0?"+":"",e.weight]})]})]}),l?n.jsxs("div",{style:{marginTop:"4px",display:"flex",flexWrap:"wrap",gap:"6px",alignItems:"center"},children:[n.jsx("span",{style:{fontSize:"11px",color:"rgba(30, 33, 37, 0.52)"},children:"@"}),e.timestamps.map((p,g)=>n.jsxs("button",{type:"button","aria-label":`Play ${p.start}–${p.end}`,onClick:f=>{f.stopPropagation(),t&&t(p.start,p.end)},style:{fontSize:"11px",padding:"2px 6px",borderRadius:"999px",border:"1px solid rgba(52, 58, 64, 0.16)",background:"rgba(255, 255, 255, 0.70)",color:"rgba(30, 33, 37, 0.60)",fontFamily:"ui-monospace, monospace",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"4px",transition:"all 0.15s ease"},onMouseEnter:f=>{f.currentTarget.style.background="rgba(255, 255, 255, 0.95)",f.currentTarget.style.borderColor="rgba(52, 58, 64, 0.24)"},onMouseLeave:f=>{f.currentTarget.style.background="rgba(255, 255, 255, 0.70)",f.currentTarget.style.borderColor="rgba(52, 58, 64, 0.16)"},children:[n.jsx("svg",{width:"9",height:"9",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M3 2.5L9 6L3 9.5V2.5Z",fill:"currentColor"})}),p.start,"–",p.end]},g))]}):n.jsxs("div",{style:{marginTop:"4px",fontSize:"11.5px",color:"rgba(30, 33, 37, 0.52)"},children:["@ ",n.jsx("strong",{children:"timestamps checked"})]})]})]})}function Qo({driver:e,variant:t,onPlayTimestamp:r}){const[o,i]=D.useState(!1),s=e.state==="absent",a=e.timestamps&&e.timestamps.length>0,c=g=>{const f=parseInt(g.slice(1,3),16),m=parseInt(g.slice(3,5),16),b=parseInt(g.slice(5,7),16),y=Math.round(f*.299+m*.587+b*.114),v=Math.round(y*.7+f*.3),h=Math.round(y*.7+m*.3),j=Math.round(y*.7+b*.3);return`#${v.toString(16).padStart(2,"0")}${h.toString(16).padStart(2,"0")}${j.toString(16).padStart(2,"0")}`},u=()=>{if(!s)return{};switch(t){case"strikethrough":return{textDecoration:"line-through",textDecorationThickness:"2px",color:"rgba(30, 33, 37, 0.70)"};case"opacity":return{opacity:.45};case"badge":case"background":case"desaturated-rail":return{};default:return{}}},l=()=>s&&t==="background"?{background:o?"rgba(30, 33, 37, 0.06)":"rgba(30, 33, 37, 0.03)"}:s&&t==="angled-background-tl"?{background:o?"linear-gradient(135deg, rgba(30, 33, 37, 0.06) 0%, rgba(30, 33, 37, 0.06) 35%, rgba(255, 255, 255, 0.82) 35%, rgba(255, 255, 255, 0.82) 100%)":"linear-gradient(135deg, rgba(30, 33, 37, 0.04) 0%, rgba(30, 33, 37, 0.04) 35%, rgba(255, 255, 255, 0.82) 35%, rgba(255, 255, 255, 0.82) 100%)"}:s&&t==="angled-background-tr"?{background:o?"linear-gradient(225deg, rgba(30, 33, 37, 0.06) 0%, rgba(30, 33, 37, 0.06) 35%, rgba(255, 255, 255, 0.82) 35%, rgba(255, 255, 255, 0.82) 100%)":"linear-gradient(225deg, rgba(30, 33, 37, 0.04) 0%, rgba(30, 33, 37, 0.04) 35%, rgba(255, 255, 255, 0.82) 35%, rgba(255, 255, 255, 0.82) 100%)"}:{background:o?"rgba(231, 212, 162, 0.12)":"rgba(255, 255, 255, 0.82)"},d=()=>s&&t==="desaturated-rail"?c(e.railColor):e.railColor,p=()=>s&&t==="desaturated-rail"?.4:1;return n.jsxs("div",{style:{position:"relative",display:"flex",border:`1px solid ${o?"rgba(52, 58, 64, 0.18)":"rgba(52, 58, 64, 0.12)"}`,borderRadius:"12px",overflow:"hidden",...l(),boxShadow:"0 2px 4px rgba(30, 33, 37, 0.06)",transition:"all 0.2s ease-out"},onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[n.jsx("div",{style:{width:"5px",background:d(),opacity:p()}}),n.jsxs("div",{style:{flex:1,padding:"10px 12px"},children:[n.jsxs("div",{style:{fontSize:"13px",fontWeight:680,color:"rgba(30, 33, 37, 0.92)",lineHeight:1.2,display:"flex",alignItems:"center",gap:"6px",...u()},children:[e.title,s&&t==="badge"&&n.jsx("span",{style:{fontSize:"9px",padding:"2px 6px",borderRadius:"4px",background:"rgba(30, 33, 37, 0.08)",color:"rgba(30, 33, 37, 0.60)",fontWeight:600,textDecoration:"none"},children:"not detected"})]}),n.jsx("div",{style:{marginTop:"3px",fontSize:"11.5px",color:"rgba(30, 33, 37, 0.52)",fontFamily:"ui-monospace, monospace",...s&&t==="opacity"&&{opacity:1}},children:e.technicalName}),n.jsxs("div",{style:{marginTop:"3px",fontSize:"11.5px",color:"rgba(30, 33, 37, 0.52)",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",...s&&t==="opacity"&&{opacity:1}},children:[n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:["state ",n.jsx("strong",{children:e.state})]}),n.jsx("span",{children:"·"}),n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:["conf ",n.jsx("strong",{children:e.confidence.toFixed(2)}),n.jsx("span",{style:{display:"inline-block",width:"45px",height:"3px",background:"rgba(30, 33, 37, 0.12)",borderRadius:"2px",position:"relative",overflow:"hidden"},children:n.jsx("span",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${e.confidence*100}%`,background:"rgba(30, 33, 37, 0.45)",borderRadius:"2px",transition:"width 0.3s ease"}})})]}),n.jsx("span",{children:"·"}),n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:["prob ",n.jsx("strong",{children:e.probability.toFixed(2)}),n.jsx("span",{style:{display:"inline-block",width:"45px",height:"3px",background:"rgba(30, 33, 37, 0.12)",borderRadius:"2px",position:"relative",overflow:"hidden"},children:n.jsx("span",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${e.probability*100}%`,background:"rgba(30, 33, 37, 0.45)",borderRadius:"2px",transition:"width 0.3s ease"}})})]})]}),a?n.jsxs("div",{style:{marginTop:"4px",display:"flex",flexWrap:"wrap",gap:"6px",alignItems:"center"},children:[n.jsx("span",{style:{fontSize:"11px",color:"rgba(30, 33, 37, 0.52)"},children:"@"}),e.timestamps.map((g,f)=>n.jsxs("span",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[n.jsxs("span",{style:{fontSize:"11px",padding:"2px 6px",borderRadius:"999px",border:"1px solid rgba(52, 58, 64, 0.16)",background:"rgba(255, 255, 255, 0.70)",color:"rgba(30, 33, 37, 0.60)",fontFamily:"ui-monospace, monospace"},children:[g.start,"–",g.end]}),n.jsx("button",{type:"button","aria-label":`Play ${g.start}–${g.end}`,onClick:()=>r==null?void 0:r(g.start,g.end),style:{width:"18px",height:"18px",borderRadius:"999px",border:"1px solid rgba(52, 58, 64, 0.22)",background:"rgba(255, 255, 255, 0.80)",display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,cursor:"pointer"},onMouseEnter:m=>{m.currentTarget.style.background="rgba(255, 255, 255, 1)"},onMouseLeave:m=>{m.currentTarget.style.background="rgba(255, 255, 255, 0.80)"},children:n.jsx(z.Play,{size:8,style:{marginLeft:"1px",color:"rgba(30, 33, 37, 0.70)"},fill:"rgba(30, 33, 37, 0.70)"})})]},f))]}):n.jsxs("div",{style:{marginTop:"4px",fontSize:"11.5px",color:"rgba(30, 33, 37, 0.52)",...s&&t==="opacity"&&{opacity:1}},children:["@ ",n.jsx("strong",{children:"timestamps checked"})]}),e.deviation&&n.jsx("div",{style:{marginTop:"6px",display:"flex",...s&&t==="opacity"&&{opacity:1}},children:n.jsx(ae,{level:e.deviation,color:e.railColor,direction:e.deviationDirection})})]})]})}function ei({signal:e,onExpandObservation:t,activeObservationId:r=null,isObservationPlaying:o=!1,showObservationPlaybackControls:i=!0,useFallbackObservationDuration:s=!0}){const[a,c]=D.useState(!1),u=(l,d)=>{const p=Number(l),g=Number(d);if(!Number.isFinite(p)||!Number.isFinite(g)||g<=p)return null;const f=m=>{const b=Math.floor(m/1e3),y=Math.floor(b/60).toString().padStart(2,"0"),v=(b%60).toString().padStart(2,"0");return`${y}:${v}`};return`${f(p)}–${f(g)}`};return n.jsxs("div",{style:{position:"relative",background:"rgba(255, 255, 255, 0.82)",border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"12px",overflow:"hidden",boxShadow:"0 2px 4px rgba(30, 33, 37, 0.06)"},children:[e.railColor&&n.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:"5px",background:e.railColor,opacity:.6}}),n.jsx("button",{type:"button",onClick:()=>c(!a),style:{width:"100%",padding:"14px 16px 14px 21px",background:"transparent",border:"none",cursor:"pointer",textAlign:"left",transition:"background 0.15s ease"},onMouseEnter:l=>{l.currentTarget.style.background="rgba(231, 212, 162, 0.08)"},onMouseLeave:l=>{l.currentTarget.style.background="transparent"},children:n.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"6px",flexWrap:"wrap"},children:[n.jsx("span",{style:{fontSize:"16px",fontWeight:700,color:"rgba(30, 33, 37, 0.92)",lineHeight:1.15},children:e.name}),e.state&&n.jsx("span",{style:{fontSize:"11px",fontWeight:600,color:"#1F8F5A",background:"rgba(31, 143, 90, 0.10)",padding:"6px 8px",borderRadius:"999px",border:"1px solid rgba(31,143,90,0.12)"},children:String(e.state).toLowerCase()==="present"?"present":e.state}),e.isPreview&&n.jsx("span",{style:{fontSize:"9px",fontWeight:650,letterSpacing:"0.06em",textTransform:"uppercase",color:"rgba(184, 156, 106, 0.75)",background:"rgba(184, 156, 106, 0.12)",padding:"2px 6px",borderRadius:"4px",border:"1px solid rgba(184, 156, 106, 0.2)"},children:"Preview"})]}),n.jsx("div",{style:{fontSize:"13px",color:"rgba(30, 33, 37, 0.66)",lineHeight:1.4,marginBottom:"8px"},children:e.description}),n.jsx("div",{style:{fontSize:"11px",color:"rgba(30, 33, 37, 0.48)",fontFamily:"ui-monospace, monospace",marginBottom:"10px"},children:e.technicalKey}),n.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"12px",fontSize:"11.5px"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[n.jsxs(J,{children:[n.jsx(Q,{asChild:!0,children:n.jsx("span",{style:{color:"rgba(139, 157, 127, 0.65)",cursor:"help",borderBottom:"1px dotted rgba(139, 157, 127, 0.35)"},children:"prob"})}),n.jsx(ee,{className:"w-fit max-w-[34ch] h-auto min-h-0 px-4 py-3 whitespace-normal break-words text-left text-[13px] leading-[1.45]",children:n.jsxs("div",{children:[n.jsx("div",{style:{fontWeight:600,marginBottom:"4px",maxWidth:"34ch"},children:"Probability measures expectation."}),n.jsx("div",{style:{color:"rgba(255, 255, 255, 0.85)",maxWidth:"34ch"},children:"How likely this pattern is, given past sessions and current observations."})]})})]}),n.jsx("strong",{style:{color:`rgba(139, 157, 127, ${e.probability})`},children:e.probability.toFixed(2)}),e.probabilityRange&&n.jsxs("span",{style:{color:"rgba(30, 33, 37, 0.42)",fontSize:"10.5px"},children:["(",e.probabilityRange.min.toFixed(2),"–",e.probabilityRange.max.toFixed(2),")"]}),n.jsx("span",{style:{display:"inline-block",width:"50px",height:"3px",background:"rgba(30, 33, 37, 0.12)",borderRadius:"2px",position:"relative",overflow:"hidden"},children:n.jsx("span",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${e.probability*100}%`,background:`rgba(139, 157, 127, ${e.probability})`,borderRadius:"2px",transition:"width 0.3s ease"}})})]}),n.jsx("span",{style:{color:"rgba(30, 33, 37, 0.24)"},children:"·"}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[n.jsxs(J,{children:[n.jsx(Q,{asChild:!0,children:n.jsx("span",{style:{color:"rgba(184, 156, 106, 0.65)",cursor:"help",borderBottom:"1px dotted rgba(184, 156, 106, 0.35)"},children:"conf"})}),n.jsx(ee,{className:"w-fit max-w-[34ch] h-auto min-h-0 px-4 py-3 whitespace-normal break-words text-left text-[12px] leading-[1.45]",children:n.jsxs("div",{children:[n.jsx("div",{style:{fontWeight:600,marginBottom:"4px",maxWidth:"34ch"},children:"Confidence measures evidence."}),n.jsx("div",{style:{color:"rgba(255, 255, 255, 0.85)",maxWidth:"34ch"},children:"How strongly the observations in this session support this signal."})]})})]}),n.jsx("strong",{style:{color:`rgba(184, 156, 106, ${e.confidence})`},children:e.confidence.toFixed(2)}),n.jsx("span",{style:{display:"inline-block",width:"50px",height:"3px",background:"rgba(30, 33, 37, 0.12)",borderRadius:"2px",position:"relative",overflow:"hidden"},children:n.jsx("span",{style:{position:"absolute",left:0,top:0,height:"100%",width:`${e.confidence*100}%`,background:`rgba(184, 156, 106, ${e.confidence})`,borderRadius:"2px",transition:"width 0.3s ease"}})})]}),n.jsx("span",{style:{color:"rgba(30, 33, 37, 0.24)"},children:"·"}),n.jsxs("div",{style:{color:"rgba(30, 33, 37, 0.52)",fontSize:"11px"},children:[(e.contributingObservations||[]).length," observation",(e.contributingObservations||[]).length!==1?"s":""]})]})]}),n.jsxs("div",{style:{paddingTop:"2px",color:"rgba(30, 33, 37, 0.42)",flexShrink:0,transition:"transform 0.2s ease",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"8px"},children:[e.deviation&&n.jsx(ae,{level:e.deviation,color:e.railColor||"rgba(30, 33, 37, 0.65)",direction:e.deviationDirection}),n.jsx(z.ChevronDown,{size:18,style:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})]})]})}),a&&n.jsxs("div",{style:{borderTop:"1px solid rgba(52, 58, 64, 0.08)",background:"rgba(244, 241, 230, 0.25)",padding:"16px 16px 16px 21px"},children:[n.jsx("div",{style:{fontSize:"10px",fontWeight:650,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgba(30, 33, 37, 0.52)",marginBottom:"12px"},children:"Contributing Observations"}),n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:(e.contributingObservations||[]).map((l,d)=>{const g=u(l==null?void 0:l.startMs,l==null?void 0:l.endMs)||(s?"00:00–00:04":null),f=!!g,m=()=>t==null?void 0:t(l.key),b=!!o&&!!r&&String(r)===String((l==null?void 0:l.playbackId)||"");return n.jsxs("div",{role:"button",tabIndex:0,onClick:m,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),m())},style:{background:b?"rgba(94, 136, 176, 0.08)":"rgba(255, 255, 255, 0.85)",border:b?"1px solid rgba(94, 136, 176, 0.35)":"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"8px",padding:"10px 12px",textAlign:"left",cursor:"pointer",transition:"all 0.15s ease",position:"relative",overflow:"hidden"},onMouseEnter:y=>{y.currentTarget.style.background="rgba(255, 255, 255, 1)",y.currentTarget.style.borderColor="rgba(52, 58, 64, 0.20)",y.currentTarget.style.transform="translateX(2px)"},onMouseLeave:y=>{y.currentTarget.style.background="rgba(255, 255, 255, 0.85)",y.currentTarget.style.borderColor="rgba(52, 58, 64, 0.12)",y.currentTarget.style.transform="translateX(0)"},children:[n.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:"3px",background:l.influence==="increases"?"rgba(107, 123, 147, 0.35)":l.influence==="decreases"?"rgba(30, 33, 37, 0.15)":"rgba(30, 33, 37, 0.08)",borderRadius:"8px 0 0 8px"}}),n.jsx("div",{style:{paddingLeft:"6px",marginBottom:"6px"},children:n.jsx("div",{style:{fontSize:"12px",color:"rgba(30, 33, 37, 0.82)",lineHeight:1.4},children:l.statement})}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"10.5px",paddingLeft:"6px"},children:[n.jsx("span",{style:{fontFamily:"ui-monospace, monospace",color:"rgba(30, 33, 37, 0.42)"},children:l.key}),n.jsx("span",{style:{color:"rgba(30, 33, 37, 0.24)"},children:"·"}),n.jsx("span",{style:{color:"rgba(184, 156, 106, 0.65)"},children:"conf"}),n.jsx("strong",{style:{color:`rgba(184, 156, 106, ${l.confidence})`},children:l.confidence.toFixed(2)}),n.jsx("span",{style:{color:"rgba(30, 33, 37, 0.24)"},children:"·"}),n.jsx("span",{style:{fontSize:"10px",color:l.influence==="increases"?"rgba(107, 123, 147, 0.75)":l.influence==="decreases"?"rgba(30, 33, 37, 0.52)":"rgba(30, 33, 37, 0.42)"},children:l.influence==="increases"?"↑ increases signal":l.influence==="decreases"?"↓ decreases signal":"− neutral"})]}),i&&f?n.jsxs("div",{style:{marginTop:"8px",paddingLeft:"6px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"},children:[n.jsx("span",{style:{display:"inline-flex",alignItems:"center",border:b?"1px solid rgba(94, 136, 176, 0.35)":"1px solid rgba(148, 163, 184, 0.35)",borderRadius:"999px",padding:"2px 9px",fontFamily:"ui-monospace, monospace",fontSize:"10px",color:"rgba(71, 85, 105, 0.9)",background:"rgba(255,255,255,0.9)"},children:g}),n.jsx("button",{type:"button",onClick:y=>{y.stopPropagation(),m()},"aria-label":b?"Pause observation segment":"Play observation segment",title:b?"Pause observation segment":"Play observation segment",disabled:!f,style:{width:"26px",height:"26px",borderRadius:"999px",border:b?"1px solid rgba(94, 136, 176, 0.45)":"1px solid rgba(148, 163, 184, 0.35)",background:b?"rgba(94,136,176,0.12)":"rgba(255,255,255,0.95)",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:b?"rgba(94,136,176,0.95)":"rgba(30, 33, 37, 0.72)",opacity:f?1:.45},children:b?n.jsx(z.Pause,{size:12}):n.jsx(z.Play,{size:12})})]}):null]},d)})}),n.jsxs("div",{style:{marginTop:"12px",padding:"10px 12px",background:"rgba(255, 255, 255, 0.6)",borderRadius:"6px",fontSize:"11px",color:"rgba(30, 33, 37, 0.65)",lineHeight:1.5,fontStyle:"italic"},children:[n.jsx("strong",{style:{fontStyle:"normal",color:"rgba(30, 33, 37, 0.75)"},children:"Note:"})," ","This signal summarizes patterns observed in this session. It does not replace human judgment or constitute a conclusion."]})]})]})}function ti({data:e}){const[t,r]=D.useState(!1),[o,i]=D.useState(e.policy.text),s=()=>{r(!0)},a=()=>{r(!1),console.log("Saving policy:",o)},c=()=>{r(!1),i(e.policy.text)};return n.jsxs("div",{className:"flex rounded-2xl bg-white/85 shadow-lg border border-slate-200/50",style:{maxWidth:"900px",overflow:"visible"},children:[n.jsx("div",{className:"w-1.5 flex-shrink-0 rounded-l-2xl",style:{backgroundColor:e.railColor}}),n.jsxs("div",{className:"flex-1 p-6 overflow-visible",children:[n.jsx("div",{className:"text-[11px] tracking-[0.16em] uppercase mb-2.5",style:{color:"rgba(30, 33, 37, 0.36)",fontWeight:650},children:e.category}),n.jsxs("div",{className:"flex items-start justify-between gap-4 mb-1.5 relative",children:[n.jsx("h2",{className:"flex-1",style:{fontSize:"18px",fontWeight:720,letterSpacing:"-0.01em",lineHeight:1.25,color:"rgba(30, 33, 37, 0.92)"},children:e.title}),e.deviation&&n.jsx("div",{className:"flex-shrink-0",children:n.jsx(ae,{level:e.deviation,color:e.railColor,direction:e.deviationDirection})})]}),n.jsxs("div",{className:"text-[13px] leading-snug mt-1.5",style:{color:"rgba(30, 33, 37, 0.68)"},children:["Short name: ",n.jsx("strong",{children:e.shortName})]}),n.jsx("div",{className:"mt-2 text-[11.5px] font-mono",style:{color:"rgba(30, 33, 37, 0.52)"},children:e.technicalName}),n.jsxs("div",{className:"mt-0.5 text-[11.5px]",style:{color:"rgba(30, 33, 37, 0.52)"},children:["type ",n.jsx("strong",{children:e.metadata.type})," · tier"," ",n.jsx("strong",{children:e.metadata.tier})," · priority"," ",n.jsx("strong",{children:e.metadata.priority})," · vertical"," ",n.jsx("strong",{children:e.metadata.vertical})]}),n.jsxs("div",{className:"mt-5",children:[n.jsx("div",{className:"text-[11px] tracking-[0.16em] uppercase mb-2.5",style:{color:"rgba(30, 33, 37, 0.36)",fontWeight:650},children:"Definition"}),n.jsx("p",{className:"text-[13px] leading-relaxed",style:{color:"rgba(30, 33, 37, 0.72)"},children:e.definition})]}),n.jsxs("div",{className:"mt-6 border border-slate-200/50 rounded-xl bg-white/70 p-4",children:[n.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"text-[11px] tracking-[0.16em] uppercase",style:{color:"rgba(30, 33, 37, 0.36)",fontWeight:650},children:"Policy"}),e.policy.requiresPolicy&&n.jsx("div",{className:"text-[10px] tracking-[0.12em] uppercase border px-2 py-1 rounded-full",style:{color:"rgba(30, 33, 37, 0.55)",borderColor:"rgba(30, 33, 37, 0.40)",background:"rgba(255, 255, 255, 0.70)"},children:"requires_policy"})]}),!t&&n.jsxs("button",{onClick:s,className:"inline-flex items-center gap-2 text-xs px-3 py-1.5 rounded-lg border shadow-sm transition-all hover:shadow-md",style:{borderColor:"rgba(30, 33, 37, 0.40)",background:"rgba(255, 255, 255, 0.92)",color:"rgba(30, 33, 37, 0.78)"},"aria-label":"Edit policy",children:[n.jsx(z.Pencil,{className:"w-3.5 h-3.5",style:{color:"rgba(30, 33, 37, 0.70)"}}),"Edit policy"]})]}),t?n.jsxs("div",{className:"space-y-3",children:[n.jsx("textarea",{value:o,onChange:u=>i(u.target.value),className:"w-full text-[12.5px] leading-relaxed border rounded-lg p-3 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500/50 resize-none",style:{color:"rgba(30, 33, 37, 0.62)",borderColor:"rgba(30, 33, 37, 0.30)"},rows:6}),n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsx("button",{onClick:c,className:"px-3 py-1.5 text-xs rounded-lg border transition-colors",style:{borderColor:"rgba(30, 33, 37, 0.30)",background:"white",color:"rgba(30, 33, 37, 0.70)"},children:"Cancel"}),n.jsx("button",{onClick:a,className:"px-3 py-1.5 text-xs rounded-lg text-white transition-colors shadow-sm",style:{background:"#2563eb"},children:"Save policy"})]})]}):n.jsx("p",{className:"text-[12.5px] leading-relaxed",style:{color:"rgba(30, 33, 37, 0.62)"},children:o})]})]})]})}function ni({score:e,confidence:t,range:r,modelKey:o="legacy_overall",modelVersion:i="v2026_01_11_01",title:s="Agent Score",expanded:a=!1,drivers:c=[],onViewDrivers:u,onPlayTimestamp:l}){const[d,p]=D.useState(a),g=()=>{p(!d),u&&u()};return n.jsxs("div",{children:[n.jsxs("div",{style:{marginBottom:"12px"},children:[n.jsx("div",{className:"text-[11px] tracking-[0.14em] uppercase mb-2",style:{color:"rgba(30, 33, 37, 0.42)",fontWeight:650},children:"MODEL OUTPUT"}),n.jsxs("div",{style:{fontSize:"16px",fontWeight:720,letterSpacing:"-0.01em",color:"rgba(30, 33, 37, 0.92)",lineHeight:1.2},children:[s,n.jsxs("span",{style:{fontSize:"11.5px",color:"rgba(30, 33, 37, 0.52)",fontFamily:"ui-monospace, monospace",marginLeft:"10px"},children:["model_key: ",o," · ",i]})]})]}),n.jsxs("div",{style:{border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"14px",background:"rgba(255, 255, 255, 0.82)",overflow:"hidden"},children:[n.jsx("button",{type:"button",onClick:g,disabled:c.length===0,style:{width:"100%",padding:"16px 18px",background:"transparent",border:"none",cursor:c.length>0?"pointer":"default",textAlign:"left",transition:"background 0.15s ease"},onMouseEnter:f=>{c.length>0&&(f.currentTarget.style.background="rgba(231, 212, 162, 0.08)")},onMouseLeave:f=>{f.currentTarget.style.background="transparent"},children:n.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"16px"},children:[n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px",alignItems:"baseline",marginBottom:"12px"},children:[n.jsx("div",{style:{fontSize:"32px",fontWeight:760,letterSpacing:"-0.02em",color:"rgba(30, 33, 37, 0.92)",lineHeight:1},children:e}),n.jsxs("div",{style:{fontSize:"12px",color:"rgba(30, 33, 37, 0.62)",lineHeight:1.4},children:["score (0–100) · confidence ",n.jsx("strong",{children:t.toFixed(2)})," ·"," ",n.jsx("span",{style:{borderBottom:"1px dashed rgba(231, 212, 162, 0.65)"},children:"model-based estimate"})]})]}),n.jsxs("div",{style:{fontSize:"11.5px",color:"rgba(30, 33, 37, 0.52)",lineHeight:1.5},children:["range ",n.jsxs("strong",{children:[r.min,"–",r.max]})," (illustrative) · normalized for comparability across calls ·"," ",d?"based on evidence-weighted condition signals":"evidence-weighted condition signals"]})]}),c.length>0&&n.jsx("div",{style:{paddingTop:"6px",color:"rgba(30, 33, 37, 0.42)",flexShrink:0,transition:"transform 0.2s ease"},children:n.jsx(z.ChevronDown,{size:18,style:{transform:d?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})})]})}),d&&c.length>0&&n.jsxs("div",{style:{borderTop:"1px solid rgba(52, 58, 64, 0.10)",padding:"16px 18px 18px 18px"},children:[n.jsx("div",{className:"text-[10px] tracking-[0.12em] uppercase mb-4",style:{color:"rgba(30, 33, 37, 0.36)",fontWeight:650},children:"SCORE CONDITIONS FOR THIS INTERACTION"}),n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:c.map((f,m)=>n.jsx(gn,{driver:f,onPlayTimestamp:l,showWeight:!0},m))}),n.jsx("div",{style:{marginTop:"16px",fontSize:"11.5px",color:"rgba(30, 33, 37, 0.52)",lineHeight:1.5},children:"Conditions shown are the largest contributors for this model on this interaction. Inspect timestamps to verify supporting evidence."})]})]})]})}function ri({title:e="Interaction overview",summary:t,boundaryNote:r="This summary reflects observed conversation content and is bounded by transcript quality and available evidence."}){return n.jsxs("div",{className:"pb-2",children:[n.jsxs("div",{className:"mb-3",children:[n.jsx("div",{className:"text-[11px] tracking-[0.14em] uppercase mb-1.5",style:{color:"rgba(30, 33, 37, 0.42)",fontWeight:650},children:"Summary"}),n.jsx("h2",{className:"text-[15px] leading-tight",style:{fontWeight:700,letterSpacing:"-0.01em",color:"rgba(30, 33, 37, 0.90)",lineHeight:1.2},children:e})]}),n.jsx("div",{className:"text-[13.5px] max-w-[860px]",style:{lineHeight:1.6,color:"rgba(30, 33, 37, 0.70)"},children:t}),r&&n.jsx("div",{className:"mt-2 text-[11.5px]",style:{color:"rgba(30, 33, 37, 0.52)",lineHeight:1.5},children:r})]})}const vt={customer:{label:"Customer",railColor:"var(--rail-discovery)",cardBg:"var(--card-customer)",cardBgHighlight:"rgba(94, 136, 176, 0.12)",borderColor:"var(--border-subtle)"},agent:{label:"Agent",railColor:"var(--rail-outcome)",cardBg:"var(--card-agent)",cardBgHighlight:"rgba(107, 124, 147, 0.10)",borderColor:"var(--border-subtle)"},assistant:{label:"AI Assistant",railColor:"var(--rail-purple)",cardBg:"var(--card-assistant)",cardBgHighlight:"rgba(155, 122, 168, 0.10)",borderColor:"var(--border-subtle)"},system:{label:"System",railColor:"var(--text-faint)",cardBg:"transparent",cardBgHighlight:"transparent",borderColor:"transparent"}},wt="conversation-turn-keyframes";function oi(){if(typeof document>"u"||document.getElementById(wt))return;const e=document.createElement("style");e.id=wt,e.textContent=`
2
+ @keyframes turn-playing-pulse {
3
+ 0%, 100% { opacity: 0.4; }
4
+ 50% { opacity: 0.9; }
5
+ }
6
+ `,document.head.appendChild(e)}function xn({role:e="agent",text:t,actorLabel:r,actorRailColor:o,actionKicker:i,toolBadges:s,streaming:a=!1,meta:c,timeRange:u,isHighlighted:l=!1,highlightRailColor:d,observations:p,onObservationClick:g,children:f}){D.useEffect(()=>{oi()},[]);const m=vt[e]||vt.agent,b=r||m.label,y=o||m.railColor,v=l||a;return e==="system"?n.jsx("div",{style:{textAlign:"center",padding:"6px 0",flexShrink:0,fontSize:"var(--text-sm, 11px)",color:"var(--text-faint, rgba(30,33,37,0.36))",fontWeight:500,letterSpacing:"0.02em"},children:t}):n.jsxs("div",{style:{position:"relative",padding:"10px 14px 10px 18px",borderRadius:10,overflow:"hidden",flexShrink:0,background:v?m.cardBgHighlight:m.cardBg,border:`1px solid ${a?y:m.borderColor}`,boxShadow:a?`0 0 8px ${m.cardBgHighlight}`:"none",transition:"background 0.2s, border-color 0.2s, box-shadow 0.2s"},children:[n.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:"var(--rail-width-thin, 4px)",backgroundColor:y,borderRadius:"10px 0 0 10px"}}),n.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,marginBottom:4},children:[n.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[i?n.jsx("div",{style:{fontSize:"var(--text-xs-plus, 10.5px)",fontWeight:650,textTransform:"uppercase",letterSpacing:"var(--tracking-label, 0.16em)",color:y},children:i}):null,n.jsx("div",{style:{fontSize:"var(--text-xs-plus, 10.5px)",fontWeight:650,textTransform:"uppercase",letterSpacing:"var(--tracking-label, 0.16em)",color:"var(--text-faint, rgba(30,33,37,0.36))"},children:b})]}),s&&s.length>0?n.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,flexShrink:0,justifyContent:"flex-end"},children:s.map((h,j)=>{const w=h.pending,T=!w&&h.success===!1,R=w?"var(--rail-discovery, #5E88B0)":T?"var(--rail-compliance, #C98A5A)":"var(--text-xfaint, rgba(30,33,37,0.28))";return n.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:"var(--text-xs, 10px)",padding:"2px 8px 2px 6px",borderRadius:999,background:"var(--paper, rgba(255,255,255,0.78))",border:"1px solid var(--border-subtle, rgba(52,58,64,0.08))",color:"var(--text-faint, rgba(30,33,37,0.36))",fontWeight:500,fontFamily:"var(--font-fira-code, var(--font-mono, monospace))",letterSpacing:"0.01em",lineHeight:1.4,whiteSpace:"nowrap"},children:[n.jsx("span",{style:{width:5,height:5,borderRadius:"50%",backgroundColor:R,flexShrink:0}}),h.name]},j)})}):null]}),n.jsxs("div",{style:{fontSize:"var(--text-md, 13px)",lineHeight:"var(--leading-normal, 1.5)",color:a?"var(--text-strong, rgba(30,33,37,0.92))":"var(--text-base, rgba(30,33,37,0.78))",fontWeight:a?550:400},children:[t,a?n.jsx("span",{style:{display:"inline-block",width:6,height:14,background:y,marginLeft:2,borderRadius:1,animation:"cursorBlink 0.8s ease-in-out infinite",verticalAlign:"text-bottom"}}):null]}),u||f||p&&p.length>0?n.jsxs("div",{style:{marginTop:6,display:"flex",alignItems:"center",gap:6},children:[f,u?n.jsx("span",{style:{fontSize:"var(--text-sm, 11px)",padding:"2px 8px",borderRadius:999,border:"1px solid var(--border, rgba(52,58,64,0.12))",background:"var(--timestamp-bg, rgba(255,255,255,0.70))",color:"var(--text-muted, rgba(30,33,37,0.56))",fontFamily:"var(--font-mono, monospace)"},children:u}):null,p&&p.length>0?n.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginLeft:"auto"},children:p.map((h,j)=>n.jsxs("span",{onClick:h.onClick||(g?()=>g(h):void 0),style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:"var(--text-xs, 10px)",padding:"2px 8px",borderRadius:999,background:`color-mix(in srgb, ${h.color||"var(--state-present)"} 12%, transparent)`,border:`1px solid color-mix(in srgb, ${h.color||"var(--state-present)"} 25%, transparent)`,color:h.color||"var(--state-present)",fontWeight:550,lineHeight:1.4,whiteSpace:"nowrap",cursor:h.onClick||g?"pointer":"default",transition:"background 0.15s"},title:h.reason||h.label,children:[n.jsx("span",{style:{width:4,height:4,borderRadius:"50%",backgroundColor:h.color||"var(--state-present)",flexShrink:0,opacity:.7}}),h.label]},j))}):null]}):null,c?n.jsx("div",{style:{marginTop:6,fontSize:"var(--text-xs-plus, 10.5px)",color:"var(--text-faint, rgba(30,33,37,0.36))",fontFamily:"var(--font-mono, monospace)"},children:c}):null,v&&d?n.jsx("div",{style:{position:"absolute",right:8,top:8,bottom:8,width:6,borderRadius:4,backgroundColor:d,opacity:.7,animation:"turn-playing-pulse 1.5s ease-in-out infinite"}}):null]})}const ii=e=>{const[t,r]=e.split("–").map(o=>{const[i,s]=o.split(":").map(Number);return i*60+s});return{start:t,end:r}},si=e=>({customer:"customer",agent:"agent",third_party:"agent",system:"system",assistant:"assistant"})[e]||"agent";function ai({turns:e,audioUrl:t,activeTurnIndex:r=-1,autoScrollActiveTurn:o=!1,isExternalPlaying:i=!1,onTurnPlayPause:s}){const[a,c]=D.useState(null),[u,l]=D.useState(!1),d=D.useRef(null),p=D.useRef(null),g=D.useRef([]),f=D.useRef(null),m=D.useRef(-1),b=typeof s=="function",y=i!==void 0;D.useEffect(()=>{if(t)return d.current=new Audio(t),d.current.preload="auto",()=>{d.current&&(d.current.pause(),d.current=null)}},[t]),D.useEffect(()=>()=>{d.current&&(d.current.pause(),p.current&&d.current.removeEventListener("timeupdate",p.current))},[]),D.useEffect(()=>{if(!o||r<0)return;const h=f.current,j=g.current[r];if(!j||!h)return;const w=h.getBoundingClientRect(),T=j.getBoundingClientRect(),R=12,C=T.top>=w.top+R&&T.bottom<=w.bottom-8;if(!(m.current===r)||!C){const L=T.top-w.top+h.scrollTop;h.scrollTop=Math.max(L-R,0)}m.current=r},[r,o]);const v=(h,j)=>{if(b){s(e[j],j);return}if(a===j&&u)d.current&&(d.current.pause(),p.current&&(d.current.removeEventListener("timeupdate",p.current),p.current=null)),l(!1);else{const w=a;if(c(j),t&&d.current){const{start:T,end:R}=ii(h);w!==null&&w!==j&&(d.current.pause(),p.current&&(d.current.removeEventListener("timeupdate",p.current),p.current=null));const C=()=>{if(d.current){if(d.current.currentTime=T,R){const A=()=>{d.current&&d.current.currentTime>=R&&(d.current.pause(),l(!1),c(null),p.current&&(d.current.removeEventListener("timeupdate",p.current),p.current=null))};p.current=A,d.current.addEventListener("timeupdate",A)}d.current.play().then(()=>l(!0)).catch(A=>{A&&A.name==="AbortError"||(l(!1),c(null))})}};d.current.readyState>=2?C():(d.current.addEventListener("loadedmetadata",C,{once:!0}),d.current.load())}else l(!0)}};return n.jsxs("div",{ref:f,style:{maxHeight:560,overflowY:"auto",scrollBehavior:"smooth",border:"1px solid var(--border, rgba(52,58,64,0.12))",borderRadius:"var(--radius-lg, 12px)",background:"var(--paper-elevated, rgba(255,255,255,0.82))",padding:16},children:[n.jsx("div",{style:{fontSize:"var(--text-xs-plus, 10.5px)",fontWeight:650,textTransform:"uppercase",letterSpacing:"var(--tracking-label, 0.16em)",color:"var(--text-faint, rgba(30,33,37,0.36))",marginBottom:12},children:"Transcript"}),n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:e.map((h,j)=>{const w=b||y?!!i&&r===j:a===j&&u,T=!!h.isHighlighted||w,R=si(h.actorType);return n.jsx("div",{ref:C=>{g.current[j]=C},children:n.jsx(xn,{role:R,text:h.text,actorLabel:h.actor,actorRailColor:h.actorColor,timeRange:h.timeRange,isHighlighted:T,highlightRailColor:w?h.highlightColor||(R==="agent"?"var(--rail-outcome)":"var(--rail-discovery)"):h.highlightColor,toolBadges:h.toolBadges,observations:h.observations,onObservationClick:h.onObservationClick,children:h.timeRange?n.jsx("button",{onClick:()=>v(h.timeRange,j),style:{width:24,height:24,borderRadius:"50%",border:"1px solid var(--border, rgba(52,58,64,0.12))",background:w?"var(--rail-discovery, #5E88B0)":"var(--paper, rgba(255,255,255,0.78))",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0,transition:"all 0.15s"},"aria-label":w?`Pause segment ${h.timeRange}`:`Play segment ${h.timeRange}`,children:w?n.jsx(z.Pause,{style:{width:12,height:12,color:"var(--paper, #fff)",fill:"var(--paper, #fff)"},strokeWidth:0}):n.jsx(z.Play,{style:{width:12,height:12,color:"var(--text-muted, rgba(30,33,37,0.56))",fill:"var(--text-muted, rgba(30,33,37,0.56))",marginLeft:1},strokeWidth:0})}):null})},j)})})]})}function li({segments:e=[],durationSeconds:t=0,actorRows:r=[],currentTimeSeconds:o=0,onSeek:i,showControls:s=!1,hasRecording:a=!1,timelinePlaying:c=!1,playbackRate:u=1,speedOptions:l=[1,1.25,1.5,2],onTogglePlay:d,onSeekBack:p,onSeekForward:g,onSetPlaybackRate:f,totalDurationLabel:m}){const[b,y]=D.useState(null);D.useEffect(()=>{if(!b)return;const S=setTimeout(()=>y(null),220);return()=>clearTimeout(S)},[b]);const v=Math.max(Number(t)||0,...e.map(S=>Number(S.endTime)||0),1),h=Math.max(0,Math.min(Number(o)||0,v)),j=v>0?h/v*100:0,w=`calc(${j}% + ${(5*(1-j/100)).toFixed(4)}rem)`,T=S=>{const P=Math.floor(S/60),k=Math.floor(S%60);return`${P.toString().padStart(2,"0")}:${k.toString().padStart(2,"0")}`},R=D.useMemo(()=>{if(r.length)return r.map(k=>({...k,segments:e.filter(N=>N.actor===k.key)}));const S=Array.from(new Set(e.map(k=>k.actor))),P=new Map(e.map(k=>[k.actor,k.actorColor]));return S.map(k=>({key:k,label:k,color:P.get(k)||"#6B7C93",segments:e.filter(N=>N.actor===k)}))},[r,e]),C=[],A=120;for(let S=0;S<=v;S+=A)C.push(S);(!C.length||C[C.length-1]<v)&&C.push(v);const L=S=>{if(!i)return;const P=S.currentTarget.getBoundingClientRect();if(!P.width)return;const k=Math.max(0,Math.min((S.clientX-P.left)/P.width,1));i(k*v)};return n.jsxs("div",{style:{padding:"10px 0"},children:[s&&n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8},children:[n.jsxs("div",{style:{fontSize:"var(--text-sm, 11px)",fontFamily:"var(--font-mono, monospace)",color:"var(--text-muted, rgba(30,33,37,0.56))",fontWeight:500,minWidth:70},children:[T(h)," ",n.jsxs("span",{style:{color:"var(--text-faint, rgba(30,33,37,0.36))"},children:["/ ",T(v)]})]}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[n.jsx("button",{type:"button",onClick:()=>{y("rewind"),p==null||p()},disabled:!a,title:"Rewind 15s",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"50%",border:`1px solid ${b==="rewind"?"var(--rail-discovery, #5E88B0)":"var(--border, rgba(52,58,64,0.12))"}`,background:"var(--paper, rgba(255,255,255,0.78))",cursor:"pointer",padding:0},children:n.jsx(z.RotateCcw,{size:13,stroke:"var(--rail-discovery, #5E88B0)"})}),n.jsx("button",{type:"button",onClick:d,disabled:!a,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"50%",background:"var(--rail-discovery, #5E88B0)",color:"#fff",border:"none",cursor:"pointer",padding:0},"aria-label":c?"Pause recording":"Play recording",children:c?n.jsx(z.Pause,{size:14}):n.jsx(z.Play,{size:14,style:{marginLeft:1}})}),n.jsx("button",{type:"button",onClick:()=>{y("forward"),g==null||g()},disabled:!a,title:"Forward 15s",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"50%",border:`1px solid ${b==="forward"?"var(--rail-discovery, #5E88B0)":"var(--border, rgba(52,58,64,0.12))"}`,background:"var(--paper, rgba(255,255,255,0.78))",cursor:"pointer",padding:0},children:n.jsx(z.RotateCw,{size:13,stroke:"var(--rail-discovery, #5E88B0)"})}),n.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:4,borderRadius:999,border:"1px solid var(--border, rgba(52,58,64,0.12))",padding:"2px 3px",background:"var(--paper, rgba(255,255,255,0.78))",marginLeft:4},children:l.map(S=>{const P=u===S;return n.jsx("button",{type:"button",onClick:()=>f==null?void 0:f(S),disabled:!a,title:`Speed: ${S}x`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:24,minWidth:38,padding:"0 6px",borderRadius:999,border:`1px solid ${P?"var(--rail-discovery, #5E88B0)":"transparent"}`,background:P?"var(--rail-discovery, #5E88B0)":"transparent",color:P?"#fff":"var(--text-muted, rgba(30,33,37,0.56))",fontSize:"var(--text-xs, 10px)",fontWeight:600,cursor:"pointer"},children:S===1.5?"1.50x":`${S}x`},S)})})]})]}),n.jsx("div",{style:{background:"var(--paper, rgba(255,255,255,0.78))",border:"1px solid var(--border, rgba(52,58,64,0.12))",borderRadius:10,padding:"12px 16px 10px"},children:n.jsxs("div",{style:{position:"relative"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:6,height:16},children:[n.jsx("div",{style:{width:"5rem",flexShrink:0}}),n.jsx("div",{style:{position:"relative",flex:1},children:C.map(S=>{const P=v>0?S/v*100:0;return n.jsx("div",{style:{position:"absolute",fontSize:"var(--text-xs, 10px)",color:"var(--text-faint, rgba(30,33,37,0.36))",left:`${P}%`,transform:"translateX(-50%)",fontFamily:"var(--font-mono, monospace)",whiteSpace:"nowrap"},children:T(S)},S)})})]}),n.jsx("div",{style:{position:"absolute",pointerEvents:"none",top:0,bottom:0,left:"5rem",width:"calc(100% - 5rem)",zIndex:20},children:C.map(S=>{const P=v>0?S/v*100:0;return n.jsx("div",{style:{position:"absolute",top:0,bottom:0,left:`${P}%`,borderLeft:"1px dashed var(--border, rgba(52,58,64,0.12))",transform:"translateX(-1px)"}},S)})}),n.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10,marginTop:8},children:R.map(S=>{const P=S.key==="system"||S.label==="System";return n.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[n.jsx("div",{style:{width:"5rem",flexShrink:0,fontSize:"var(--text-sm, 11px)",fontWeight:600,color:"var(--text-muted, rgba(30,33,37,0.56))",fontFamily:"var(--font-sans, system-ui, sans-serif)",paddingRight:8},children:S.label}),n.jsx("div",{style:{position:"relative",borderRadius:4,flex:1,height:18,backgroundColor:"var(--paper-secondary, rgba(244,241,230,0.6))",border:"1px solid var(--border-subtle, rgba(52,58,64,0.08))"},children:S.segments.map((k,N)=>{let O=v>0?k.startTime/v*100:0,W=v>0?(k.endTime-k.startTime)/v*100:0;O=Math.max(0,Math.min(100,O)),O+W>100&&(W=100-O),W=Math.max(0,W);const M=k.endTime-k.startTime;return P&&M<=5?n.jsx("div",{style:{position:"absolute",cursor:"pointer",left:`${O}%`,top:"50%",transform:"translateY(-50%)",width:10,height:10,borderRadius:"50%",backgroundColor:S.color,opacity:.85},title:`${S.label}: ${T(k.startTime)}-${T(k.endTime)}`},N):n.jsx("div",{style:{position:"absolute",top:0,bottom:0,left:`${O}%`,width:`${Math.max(W,.7)}%`,maxWidth:`${100-O}%`,backgroundColor:S.color,opacity:.85,borderRadius:2,cursor:"pointer",transition:"opacity 0.15s"},title:`${S.label}: ${T(k.startTime)}-${T(k.endTime)}`},N)})})]},S.key)})}),n.jsx("div",{style:{pointerEvents:"none",position:"absolute",top:0,bottom:0,width:2,borderRadius:1,backgroundColor:"var(--rail-discovery, #5E88B0)",opacity:.55,boxShadow:"0 0 0 1px rgba(94,136,176,0.10)",left:w,transform:"translateX(-50%)"}}),i?n.jsx("button",{type:"button",onClick:L,style:{position:"absolute",cursor:"pointer",background:"transparent",border:"none",padding:0,margin:0,appearance:"none",top:0,bottom:0,left:"5rem",width:"calc(100% - 5rem)",zIndex:25},title:"Click timeline to play from that point","aria-label":"Click timeline to play from that point"}):null]})})]})}exports.Card=pn;exports.ConditionCard=ti;exports.ConversationTurn=xn;exports.DetailCard=qo;exports.DeviationIndicator=ae;exports.ModelScoreCard=ni;exports.ObservationCard=Jo;exports.ScoreDriverCard=gn;exports.ScoreDriverCardVariant=Qo;exports.SectionLabel=Zo;exports.SignalCard=ei;exports.SmallButton=Go;exports.SmallObservationCard=fn;exports.SummarySection=ri;exports.Tag=Ko;exports.Timeline=li;exports.Tooltip=J;exports.TooltipContent=ee;exports.TooltipProvider=un;exports.TooltipTrigger=Q;exports.TranscriptCard=ai;
7
+ //# sourceMappingURL=Timeline.cjs.js.map