@cyber-harbour/ui 2.2.7-beta.0 → 2.2.7

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/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import {a,w,x,u,c,l,z,Pa,pb,Ya,ma as ma$1,Cb,y,kb,G,ib,H,lb}from'./chunk-FRUL75XR.mjs';export{tb as Alert,A as AlertIcon,za as AndroidIcon,B as ApiIcon,C as ArrowCircleTopRightIcon,D as ArrowRightIcon,ia as BallsMenu,pb as Box,q as BreakpointProvider,E as BugReportIcon,Na as BurgerMenuIcon,sa as BusIcon,z as Button,F as CalendarIcon,ta as CarIcon,Kb as ChatField,ja as CheckIcon,vb as Checkbox,ka as ChevronDownIcon,G as ChevronLeftIcon,H as ChevronRightIcon,la as ChevronUpIcon,Oa as ClockIcon,I as CloseCircleIcon,J as ClosedLockIcon,Db as ContentLoader,fb as ContextMenu,gb as ContextMenuDelimiter,qa as CrossIcon,K as DataSetsIcon,L as DeepSearchIcon,M as DisabledVisibleIcon,N as DocsIcon,O as DownloadIcon,yb as Drawer,Ab as DrawerBody,zb as DrawerHeader,P as EditUserIcon,rb as EmptyData,Q as EnableVisibleIcon,R as EnterArrowLeftIcon,Ra as FaceSearchIcon,mb as FileField,xa as FileIcon,S as FiltersIcon,Ia as FlashIcon,nb as FlexContainer,ob as FlexItem,Ba as FolderAlertIcon,Ja as FolderInfoIcon,ab as Header,bb as HeaderDelimeter,cb as HeaderSection,T as HomepageIcon,Qa as ImageIcon,oa as InfoCircleFilledIcon,U as InfoCircleIcon,kb as Input,ya as IosIcon,ub as Label,qb as Line,wb as LinerProgress,Za as ListMenu,_a as ListMenuItem,$a as ListMenuSection,V as MapRadarIcon,ra as MaximizeIcon,Sa as MessageAsteriskIcon,Aa as MicrosoftIcon,Pa as MinusIcon,Fb as Modal,Hb as ModalBody,Ib as ModalFooter,Gb as ModalHeader,W as MoonIcon,X as OpenLockIcon,Y as OrganizationIcon,Eb as Overlay,eb as Pagination,Ea as PassportIcon,Z as PasswordFinderIcon,Ga as PencilIcon,_ as PhonebookIcon,va as PlaneIcon,ma as PlusIcon,Fa as PointIcon,$ as PrintIcon,aa as Profiler2Icon,ba as ProfilerIcon,Lb as ProgressLoader,Ca as RelationIcon,Da as RelationPointsIcon,Ka as RotateLeftIcon,La as RotateRightIcon,jb as RowActionsMenu,ca as SandBoxIcon,da as SearchIcon,ib as Select,wa as ShipIcon,Ua as Sidebar,Ta as SidebarContext,Wa as SidebarDelimeter,Va as SidebarItem,Xa as SidebarSection,ea as StatisticIcon,Cb as StyledTooltipContent,fa as SunIcon,xb as Switch,db as Table,sb as Tag,Jb as TailwindExample,s as ThemeProvider,Bb as Tooltip,Ya as Typography,pa as UnfoldIcon,ga as UpRightArrowCircleIcon,Ma as UploadImageIcon,Ha as UserInCircleIcon,na as UsersIcon,ha as VectorIcon,ua as WayIcon,f as convertPaletteToRem,w as createComponent,x as createStyledComponent,p as darkTheme,o as darkThemePx,t as destructSpaceProps,u as generatePropertySpaceStyle,k as getBreakpoint,h as getButtonSizeStyles,g as getButtonStyles,i as getInputStyles,v as getResponsiveProps,j as getTypographyStyles,l as hexToRgba,n as lightTheme,m as lightThemePx,e as propToRem,c as pxToRem,d as remToPx,b as resolveThemeColor,r as useBreakpoint,hb as useContextMenuControl,y as useTheme}from'./chunk-FRUL75XR.mjs';import vo,{styled,useTheme,keyframes,css as css$1}from'styled-components';export{ServerStyleSheet,StyleSheetManager}from'styled-components';import {jsx,jsxs}from'react/jsx-runtime';import {useState,useRef,useCallback,useEffect,Fragment,forwardRef,useMemo,useImperativeHandle,useLayoutEffect,memo}from'react';import To from'lodash.clonedeep';import {scaleOrdinal,schemeCategory10,forceSimulation,forceLink,forceManyBody,forceX,forceY,forceCenter,forceCollide}from'd3';import yo from'react-content-loader';import Vo from'lodash.throttle';import {renderAsync}from'docx-preview';import Qo from'@uiw/react-codemirror';import {vscodeLight}from'@uiw/codemirror-theme-vscode';import {javascript}from'@codemirror/lang-javascript';import {json}from'@codemirror/lang-json';import {html}from'@codemirror/lang-html';import {css}from'@codemirror/lang-css';import {python}from'@codemirror/lang-python';import {java}from'@codemirror/lang-java';import {cpp}from'@codemirror/lang-cpp';import {php}from'@codemirror/lang-php';import {rust}from'@codemirror/lang-rust';import {xml}from'@codemirror/lang-xml';import {yaml}from'@codemirror/lang-yaml';import {markdown}from'@codemirror/lang-markdown';import {sql}from'@codemirror/lang-sql';import dn from'react-markdown';import un from'remark-gfm';import {TableVirtuoso}from'react-virtuoso';import Lt from'papaparse';import Zn from'copy-to-clipboard';import {Popover}from'react-tiny-popover';import {parse,isValid,getYear,format,getMonth,startOfWeek,startOfMonth,endOfMonth,getDay,previousSunday,nextSaturday,differenceInDays}from'date-fns';import {createPortal}from'react-dom';var qs=a(({children:r,className:o})=>jsx(to,{className:o,children:r}),"PageLayout"),to=styled.div`
1
+ import {a,w,x,u,c,l,z,Pa,Ya,ma as ma$1,ra,pb,Cb,y,kb,G,ib,H,lb}from'./chunk-FRUL75XR.mjs';export{tb as Alert,A as AlertIcon,za as AndroidIcon,B as ApiIcon,C as ArrowCircleTopRightIcon,D as ArrowRightIcon,ia as BallsMenu,pb as Box,q as BreakpointProvider,E as BugReportIcon,Na as BurgerMenuIcon,sa as BusIcon,z as Button,F as CalendarIcon,ta as CarIcon,Kb as ChatField,ja as CheckIcon,vb as Checkbox,ka as ChevronDownIcon,G as ChevronLeftIcon,H as ChevronRightIcon,la as ChevronUpIcon,Oa as ClockIcon,I as CloseCircleIcon,J as ClosedLockIcon,Db as ContentLoader,fb as ContextMenu,gb as ContextMenuDelimiter,qa as CrossIcon,K as DataSetsIcon,L as DeepSearchIcon,M as DisabledVisibleIcon,N as DocsIcon,O as DownloadIcon,yb as Drawer,Ab as DrawerBody,zb as DrawerHeader,P as EditUserIcon,rb as EmptyData,Q as EnableVisibleIcon,R as EnterArrowLeftIcon,Ra as FaceSearchIcon,mb as FileField,xa as FileIcon,S as FiltersIcon,Ia as FlashIcon,nb as FlexContainer,ob as FlexItem,Ba as FolderAlertIcon,Ja as FolderInfoIcon,ab as Header,bb as HeaderDelimeter,cb as HeaderSection,T as HomepageIcon,Qa as ImageIcon,oa as InfoCircleFilledIcon,U as InfoCircleIcon,kb as Input,ya as IosIcon,ub as Label,qb as Line,wb as LinerProgress,Za as ListMenu,_a as ListMenuItem,$a as ListMenuSection,V as MapRadarIcon,ra as MaximizeIcon,Sa as MessageAsteriskIcon,Aa as MicrosoftIcon,Pa as MinusIcon,Fb as Modal,Hb as ModalBody,Ib as ModalFooter,Gb as ModalHeader,W as MoonIcon,X as OpenLockIcon,Y as OrganizationIcon,Eb as Overlay,eb as Pagination,Ea as PassportIcon,Z as PasswordFinderIcon,Ga as PencilIcon,_ as PhonebookIcon,va as PlaneIcon,ma as PlusIcon,Fa as PointIcon,$ as PrintIcon,aa as Profiler2Icon,ba as ProfilerIcon,Lb as ProgressLoader,Ca as RelationIcon,Da as RelationPointsIcon,Ka as RotateLeftIcon,La as RotateRightIcon,jb as RowActionsMenu,ca as SandBoxIcon,da as SearchIcon,ib as Select,wa as ShipIcon,Ua as Sidebar,Ta as SidebarContext,Wa as SidebarDelimeter,Va as SidebarItem,Xa as SidebarSection,ea as StatisticIcon,Cb as StyledTooltipContent,fa as SunIcon,xb as Switch,db as Table,sb as Tag,Jb as TailwindExample,s as ThemeProvider,Bb as Tooltip,Ya as Typography,pa as UnfoldIcon,ga as UpRightArrowCircleIcon,Ma as UploadImageIcon,Ha as UserInCircleIcon,na as UsersIcon,ha as VectorIcon,ua as WayIcon,f as convertPaletteToRem,w as createComponent,x as createStyledComponent,p as darkTheme,o as darkThemePx,t as destructSpaceProps,u as generatePropertySpaceStyle,k as getBreakpoint,h as getButtonSizeStyles,g as getButtonStyles,i as getInputStyles,v as getResponsiveProps,j as getTypographyStyles,l as hexToRgba,n as lightTheme,m as lightThemePx,e as propToRem,c as pxToRem,d as remToPx,b as resolveThemeColor,r as useBreakpoint,hb as useContextMenuControl,y as useTheme}from'./chunk-FRUL75XR.mjs';import xo,{styled,useTheme,keyframes,css as css$1}from'styled-components';export{ServerStyleSheet,StyleSheetManager}from'styled-components';import {jsx,jsxs}from'react/jsx-runtime';import {useState,useRef,useCallback,useEffect,Fragment,forwardRef,useMemo,useImperativeHandle,useLayoutEffect,memo}from'react';import Ro from'lodash.clonedeep';import {scaleOrdinal,schemeCategory10,forceSimulation,forceLink,forceManyBody,forceX,forceY,forceCenter,forceCollide}from'd3';import wo from'react-content-loader';import {renderAsync}from'docx-preview';import tn from'lodash.throttle';import nn from'@uiw/react-codemirror';import {vscodeLight}from'@uiw/codemirror-theme-vscode';import {javascript}from'@codemirror/lang-javascript';import {json}from'@codemirror/lang-json';import {html}from'@codemirror/lang-html';import {css}from'@codemirror/lang-css';import {python}from'@codemirror/lang-python';import {java}from'@codemirror/lang-java';import {cpp}from'@codemirror/lang-cpp';import {php}from'@codemirror/lang-php';import {rust}from'@codemirror/lang-rust';import {xml}from'@codemirror/lang-xml';import {yaml}from'@codemirror/lang-yaml';import {markdown}from'@codemirror/lang-markdown';import {sql}from'@codemirror/lang-sql';import mn from'react-markdown';import gn from'remark-gfm';import {TableVirtuoso}from'react-virtuoso';import Bt from'papaparse';import ta from'copy-to-clipboard';import {Popover}from'react-tiny-popover';import {parse,isValid,getYear,format,getMonth,startOfWeek,startOfMonth,endOfMonth,getDay,previousSunday,nextSaturday,differenceInDays}from'date-fns';import {createPortal}from'react-dom';var Vs=a(({children:r,className:o})=>jsx(oo,{className:o,children:r}),"PageLayout"),oo=styled.div`
2
2
  display: grid;
3
3
  min-height: 100dvh;
4
4
  position: relative;
@@ -9,11 +9,11 @@ import {a,w,x,u,c,l,z,Pa,pb,Ya,ma as ma$1,Cb,y,kb,G,ib,H,lb}from'./chunk-FRUL75X
9
9
  & > header {
10
10
  grid-area: header;
11
11
  }
12
- `;var Zs=a(({children:r,className:o})=>jsx(no,{className:o,children:r}),"PageContent"),no=styled.main`
12
+ `;var ec=a(({children:r,className:o})=>jsx(io,{className:o,children:r}),"PageContent"),io=styled.main`
13
13
  grid-area: content;
14
14
  min-width: 0;
15
15
  background: ${({theme:r})=>r.colors.backgroundBase};
16
- `;var tc=a(({children:r,className:o,top:n=0})=>jsx(so,{className:o,$top:n,onClick:a=>a.stopPropagation(),children:r}),"SubNav"),so=styled.div(({theme:r,$top:o})=>`
16
+ `;var ac=a(({children:r,className:o,top:n=0})=>jsx(lo,{className:o,$top:n,onClick:a=>a.stopPropagation(),children:r}),"SubNav"),lo=styled.div(({theme:r,$top:o})=>`
17
17
  display: flex;
18
18
  flex-direction: column;
19
19
  justify-content: space-between;
@@ -33,37 +33,37 @@ import {a,w,x,u,c,l,z,Pa,pb,Ya,ma as ma$1,Cb,y,kb,G,ib,H,lb}from'./chunk-FRUL75X
33
33
  position: sticky;
34
34
  border-right: 1px solid ${r.colors.stroke.light};
35
35
  }
36
- `);var pc=w(({maxWidth:r,...o})=>jsx(uo,{...o,$maxWidth:r})),uo=x(styled.div(({theme:r,$maxWidth:o,px:n=20})=>`
36
+ `);var gc=w(({maxWidth:r,...o})=>jsx(ho,{...o,$maxWidth:r})),ho=x(styled.div(({theme:r,$maxWidth:o,px:n=20})=>`
37
37
  ${u(r,"padding-inline",n)}
38
38
  width: 100%;
39
39
  min-width: 0;
40
40
  max-width: ${typeof o=="number"?c(o,r.baseSize):o||"100%"};
41
- `),{ignoreStyles:["padding-inline"]});var mo=20,bo="splitter_columns_widths",nr=a((r,o,n)=>{let a=localStorage.getItem(r);if(a)try{let s=JSON.parse(a);if(Array.isArray(s)&&s.length===o)return s}catch{}else if(n.length===o)return n;return Array(o).fill(100/o)},"getSavedWidths"),yc=a(({columns:r,initialWidths:o,layoutClassname:n="",splitterClassname:a="",minWidth:s=mo,storageKey:i=bo})=>{let[h,b]=useState(()=>nr(i,r.length,o)),v=useRef(null),P=useRef(null),D=useRef(s),x=useRef(h),N=useCallback(E=>{if(P.current===null||!v.current)return;let C=v.current.getBoundingClientRect(),M=C.width,F=E-C.left,H=[...x.current],te=P.current,re=te+1,pe=H.slice(0,te).reduce((Se,Me)=>Se+Me,0),he=F/M*100-pe,me=H[te]+H[re]-he;he>=D.current&&me>=D.current&&(H[te]=he,H[re]=me,b(H),x.current=H);},[]),z=useCallback(E=>N(E.clientX),[N]),t=useCallback(E=>{E.preventDefault(),N(E.touches[0].clientX);},[N]),I=useCallback(()=>{P.current=null,localStorage.setItem(i,JSON.stringify(x.current)),document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",I),document.removeEventListener("touchmove",t),document.removeEventListener("touchend",I);},[z,t,i]),w=useCallback(E=>C=>{C.preventDefault(),P.current=E,document.addEventListener("mousemove",z,{passive:false}),document.addEventListener("mouseup",I);},[z,I]),d=useCallback(E=>C=>{C.preventDefault(),P.current=E,document.addEventListener("touchmove",t,{passive:false}),document.addEventListener("touchend",I);},[t,I]);return useEffect(()=>{let E=nr(i,r.length,o);x.current=E,b(E);},[r.length,o,i]),jsx("div",{ref:v,className:`flex select-none ${n}`,children:r.map(({content:E,className:C},M)=>jsxs(Fragment,{children:[jsx("div",{className:C,style:{flex:`${h[M]} 1 0%`},children:E}),M<r.length-1&&jsx("div",{onMouseDown:w(M),onTouchStart:d(M),className:`hidden lg:flex! lg:sticky lg:top-0 border-s border-gray-200 ${a}`,children:jsx("span",{className:"absolute top-1/2 start-1/2 -translate-x-1/2 -translate-y-1/2 block w-5 h-8 flex justify-center items-center bg-white border border-gray-200 text-gray-400 rounded-md cursor-col-resize hover:bg-gray-100",children:jsxs("svg",{className:"shrink-0 size-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("circle",{cx:"9",cy:"12",r:"1"}),jsx("circle",{cx:"9",cy:"5",r:"1"}),jsx("circle",{cx:"9",cy:"19",r:"1"}),jsx("circle",{cx:"15",cy:"12",r:"1"}),jsx("circle",{cx:"15",cy:"5",r:"1"}),jsx("circle",{cx:"15",cy:"19",r:"1"})]})})})]},`${M}`))})},"SplitterLayout");var xo=vo.div`
41
+ `),{ignoreStyles:["padding-inline"]});var vo=20,yo="splitter_columns_widths",dr=a((r,o,n)=>{let a=localStorage.getItem(r);if(a)try{let d=JSON.parse(a);if(Array.isArray(d)&&d.length===o)return d}catch{}else if(n.length===o)return n;return Array(o).fill(100/o)},"getSavedWidths"),kc=a(({columns:r,initialWidths:o,layoutClassname:n="",splitterClassname:a="",minWidth:d=vo,storageKey:i=yo})=>{let[h,x]=useState(()=>dr(i,r.length,o)),k=useRef(null),R=useRef(null),P=useRef(d),m=useRef(h),E=useCallback(B=>{if(R.current===null||!k.current)return;let M=k.current.getBoundingClientRect(),T=M.width,$=B-M.left,Y=[...m.current],ne=R.current,re=ne+1,se=Y.slice(0,ne).reduce((we,ve)=>we+ve,0),ye=$/T*100-se,le=Y[ne]+Y[re]-ye;ye>=P.current&&le>=P.current&&(Y[ne]=ye,Y[re]=le,x(Y),m.current=Y);},[]),A=useCallback(B=>E(B.clientX),[E]),t=useCallback(B=>{B.preventDefault(),E(B.touches[0].clientX);},[E]),F=useCallback(()=>{R.current=null,localStorage.setItem(i,JSON.stringify(m.current)),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",F),document.removeEventListener("touchmove",t),document.removeEventListener("touchend",F);},[A,t,i]),S=useCallback(B=>M=>{M.preventDefault(),R.current=B,document.addEventListener("mousemove",A,{passive:false}),document.addEventListener("mouseup",F);},[A,F]),p=useCallback(B=>M=>{M.preventDefault(),R.current=B,document.addEventListener("touchmove",t,{passive:false}),document.addEventListener("touchend",F);},[t,F]);return useEffect(()=>{let B=dr(i,r.length,o);m.current=B,x(B);},[r.length,o,i]),jsx("div",{ref:k,className:`flex select-none ${n}`,children:r.map(({content:B,className:M},T)=>jsxs(Fragment,{children:[jsx("div",{className:M,style:{flex:`${h[T]} 1 0%`},children:B}),T<r.length-1&&jsx("div",{onMouseDown:S(T),onTouchStart:p(T),className:`hidden lg:flex! lg:sticky lg:top-0 border-s border-gray-200 ${a}`,children:jsx("span",{className:"absolute top-1/2 start-1/2 -translate-x-1/2 -translate-y-1/2 block w-5 h-8 flex justify-center items-center bg-white border border-gray-200 text-gray-400 rounded-md cursor-col-resize hover:bg-gray-100",children:jsxs("svg",{className:"shrink-0 size-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("circle",{cx:"9",cy:"12",r:"1"}),jsx("circle",{cx:"9",cy:"5",r:"1"}),jsx("circle",{cx:"9",cy:"19",r:"1"}),jsx("circle",{cx:"15",cy:"12",r:"1"}),jsx("circle",{cx:"15",cy:"5",r:"1"}),jsx("circle",{cx:"15",cy:"19",r:"1"})]})})})]},`${T}`))})},"SplitterLayout");var So=xo.div`
42
42
  width: 100%;
43
43
  height: 100%;
44
44
  display: flex;
45
45
  align-items: center;
46
46
  justify-content: center;
47
- `,ko=a(({width:r=280,height:o=280})=>{let n=useTheme();return jsx(xo,{children:jsxs(yo,{foregroundColor:n.contentLoader.foreground,backgroundColor:n.contentLoader.background,width:r,height:o,viewBox:"0 0 280 280",children:[jsx("path",{d:"m55 38-0.97266 0.22852 7.0801 30.092-18.355-20.979-0.75195 0.6582 19.596 22.395 0.43164 1.834 0.97266-0.22852 0.75195-0.6582-0.37695-0.42969 9.625-27.912-0.94531-0.32617-9.4375 27.371-0.10547-0.12109zm8 34-0.78516 0.61914 0.0957 0.12305-12.311 13.258 0.73242 0.67969 12.205-13.145 14.277 18.084 0.78516-0.61914-14.373-18.207 0.10547-0.11328zm15 19-0.48438 0.875 46.992 25.996 8e-3 4e-3 20.506 11.592-28.182 4.5449 0.15998 0.98819 29.418-4.7441 0.25 0.14062-12.555 24.143 0.88672 0.46094 13-25 15 25 26 30v18l-11 18 0.85352 0.52148 9.8008-16.039-4.6543 33.518 0.99023 0.13867 4.7793-34.408 7.2305 16.27 0.91406-0.40625-7.9141-17.807v-17.104l18 12.316 0.56445-0.82617-18.896-12.928-25.855-29.836-14.633-24.387 0.01562-0.02344h23.805v-1h-23.152l13.848-21.234 55.201-28.791-0.45898-0.88476 0.77734 0.62305 11.402-14.25 16.668-11.842-0.58008-0.81641-16.785 11.928-11.486 14.355-55.434 28.912-14.277 21.893-7.7617-27.166-0.96094 0.27344 7.7227 27.031-1.1191 0.17969-21.604-12.211zm140.43-12.912-6.957-17.338-0.92773 0.37305 6.957 17.338zm-6.957-17.338 0.72266 0.69336 16.232-16.896-0.7207-0.69336zm-3.4766 137.25 5 15 0.94922-0.31641-5-15zm-91-63-0.48047-0.87695-31 17 0.48047 0.87695zm-31 17 5 18 0.96289-0.26758-5-18zm0 0-0.70703-0.70703-12.898 12.898-17.881 9.9336 0.48633 0.875 18-10zm5 18-0.64062-0.76758-18 15 0.64062 0.76758z"}),jsx("circle",{cx:"229.92",cy:"63.7318",r:"5",transform:"rotate(173.661 229.92 63.7318)"}),jsx("circle",{cx:"227.711",cy:"43.8541",r:"5",transform:"rotate(173.661 227.711 43.8541)"}),jsx("circle",{cx:"211.478",cy:"60.7499",r:"5",transform:"rotate(173.661 211.478 60.7499)"}),jsx("circle",{cx:"218.434",cy:"78.0877",r:"5",transform:"rotate(173.661 218.434 78.0877)"}),jsx("circle",{cx:"246.705",cy:"51.8054",r:"5",transform:"rotate(173.661 246.705 51.8054)"}),jsx("circle",{cx:"42",cy:"48",r:"5"}),jsx("circle",{cx:"55",cy:"38",r:"5"}),jsx("circle",{cx:"73",cy:"43",r:"5"}),jsx("circle",{cx:"63",cy:"72",r:"5"}),jsx("circle",{cx:"50",cy:"86",r:"5"}),jsx("circle",{cx:"78",cy:"91",r:"5"}),jsx("circle",{cx:"73",cy:"165",r:"5"}),jsx("circle",{cx:"73",cy:"185",r:"5"}),jsx("circle",{cx:"91",cy:"170",r:"5"}),jsx("circle",{cx:"86",cy:"152",r:"5"}),jsx("circle",{cx:"148",cy:"130",r:"5"}),jsx("circle",{cx:"189",cy:"185",r:"5"}),jsx("circle",{cx:"163",cy:"107",r:"5"}),jsx("circle",{cx:"140",cy:"102",r:"5"}),jsx("circle",{cx:"117",cy:"135",r:"5"}),jsx("circle",{cx:"125",cy:"117",r:"5"}),jsx("circle",{cx:"208",cy:"198",r:"5"}),jsx("circle",{cx:"189",cy:"203",r:"5"}),jsx("circle",{cx:"198",cy:"221",r:"5"}),jsx("circle",{cx:"178",cy:"221",r:"5"}),jsx("circle",{cx:"184",cy:"239",r:"5"}),jsx("circle",{cx:"213",cy:"213",r:"5"}),jsx("circle",{cx:"173",cy:"130",r:"5"}),jsx("circle",{cx:"163",cy:"155",r:"5"}),jsx("circle",{cx:"135",cy:"155",r:"5"}),jsx("circle",{cx:"55",cy:"175",r:"5"})]})})},"GraphLoader"),ir=ko;var it=typeof window<"u"&&window.devicePixelRatio||1;function Oo(r){return !r||r.length===0?[]:r.map(o=>{let n=new Image;n.src=o.img;let a=new Image;return a.src=o.hoverImg,{...o,normalImg:n,hoverImg:a}})}a(Oo,"prepareButtonImages");var U={fontSize:3,nodeSizeBase:30,nodeAreaFactor:2,textPaddingFactor:.9,gridSpacing:20,dotSize:1,maxZoom:4},Fo=forwardRef(({loading:r,width:o,height:n,graphData:a$1,buttons:s=[],onNodeClick:i,onBackgroundClick:h,onNodeHover:b,onLinkHover:v,onLinkClick:P},D)=>{let x=useTheme(),[N,z]=useState(true),t=useRef({transform:{x:0,y:0,k:1},isPanning:false,hoveredNode:null,hoveredLink:null,draggedNode:null,selectedNode:null,hoveredButtonIndex:null,highlightNodes:new Set,highlightLinks:new Set,lastMousePos:{x:0,y:0},mustBeStoppedPropagation:false,mouseStartPos:null,isDragging:false,width:o*it,height:n*it,animation:{id:null,buttonIndex:null},spinnerAngle:0}),{nodes:I,links:w}=useMemo(()=>To(a$1),[a$1]),[d,E]=useState([]),C=useRef(null),M=useRef(null),F=useRef(null),H=scaleOrdinal(schemeCategory10),te=useCallback(()=>{if(!C.current)return false;try{let e=C.current.getContext("2d");return e?(F.current=e,!0):(console.error("Failed to get 2D context"),!1)}catch(e){return console.error("Error initializing Canvas 2D context:",e),false}},[]),re=useCallback(()=>M.current?M.current.nodes():null,[]),pe=useCallback(()=>{if(!M.current)return null;let e=M.current.force("link");return e?e.links():null},[]),he=useCallback(e=>{e.save(),e.setTransform(1,0,0,1,0,0);let{width:u,height:l}=t.current,p=U.gridSpacing,f=U.dotSize;e.fillStyle=x.graph2D.grid.dotColor;for(let y=p/2;y<=u;y+=p)for(let g=p/2;g<=l;g+=p)e.beginPath(),e.arc(y,g,f,0,2*Math.PI),e.fill();e.restore();},[x.graph2D.grid.dotColor,U.gridSpacing,U.dotSize]),me=useCallback((e,u,l)=>{if(!e)return "";if(l.measureText(e).width<=u)return e;let f=e,y="...";for(;l.measureText(f+y).width>u&&f.length>0;)f=f.slice(0,-1);return f+y},[]),Se=a(e=>{let l=Math.min(e,U.maxZoom)/U.maxZoom;return Math.max(U.fontSize*l,U.fontSize)},"calculateFontSize"),Me=useCallback(e=>{let u=pe(),l=re();!u||u.length===0||!l||l.length===0||(e.lineWidth=.5,e.globalAlpha=1,u.forEach(p=>{let f=typeof p.source=="object"?p.source:l.find(Re=>Re.id===p.source),y=typeof p.target=="object"?p.target:l.find(Re=>Re.id===p.target);if(!f||!y)return;let g={x:f.x||0,y:f.y||0},m={x:y.x||0,y:y.y||0},S=m.x-g.x,T=m.y-g.y,R=Math.sqrt(S*S+T*T),W=S/R,B=T/R,J=U.nodeSizeBase/2,q=U.nodeSizeBase/2,V=4,k={x:g.x+W*J,y:g.y+B*J},A={x:m.x-W*(q+V),y:m.y-B*(q+V)},L={x:m.x-W*(q+1),y:m.y-B*(q+1)},Q=t.current.highlightLinks.has(p),G=Q?x.graph2D.link.highlighted:x.graph2D.link.normal,ee=Q?1.5:.5,de=g.x+(m.x-g.x)/2,ze=g.y+(m.y-g.y)/2,_e=Math.atan2(T,S);if(p.label){let Re=t.current.transform.k,Ae=Se(Re);e.font=`${Ae}px Sans-Serif`;let Wt=e.measureText(p.label).width,Xt=10;e.beginPath(),e.moveTo(k.x,k.y);let qt=R/2-(Wt+Xt)/2,Yt={x:g.x+W*qt,y:g.y+B*qt};e.lineTo(Yt.x,Yt.y),e.strokeStyle=G,e.lineWidth=ee,e.stroke(),e.beginPath();let Ut=R/2+(Wt+Xt)/2,Vt={x:g.x+W*Ut,y:g.y+B*Ut};e.moveTo(Vt.x,Vt.y),e.lineTo(A.x,A.y),e.strokeStyle=G,e.lineWidth=ee,e.stroke();}else e.beginPath(),e.moveTo(k.x,k.y),e.lineTo(A.x,A.y),e.strokeStyle=G,e.lineWidth=ee,e.stroke();let Ge=2;if(e.save(),e.translate(L.x,L.y),e.rotate(_e),e.beginPath(),e.moveTo(0,0),e.lineTo(-V,Ge),e.lineTo(-V,0),e.lineTo(-V,-Ge),e.closePath(),e.fillStyle=G,e.fill(),e.restore(),p.label){let Re=t.current.transform.k,Ae=Se(Re);e.font=`${Ae}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(de,ze),Math.abs(_e)>Math.PI/2?e.rotate(_e+Math.PI):e.rotate(_e),e.fillStyle=Q?x.graph2D.link.highlightedTextColor:x.graph2D.link.textColor,e.fillText(p.label,0,0),e.restore();}}));},[U,x.graph2D.link]),$=a((e,u,l,p,f,y,g)=>{try{if(y!=null){let m=f*.8;e.font=`${m}px sans-serif`,e.textBaseline="middle",e.textAlign="left";let S=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1,minimumFractionDigits:0,compactDisplay:"short"}).format(y),T=e.measureText(S).width,R=f*.3,B=(f+R+T)/2;e.drawImage(u,l-B,p-f/2,f,f),e.fillStyle=g||"#99989C",e.fillText(S,l-B+f+R,p);}else e.drawImage(u,l-f/2,p-f/2,f,f);}catch(m){console.warn("Error rendering icon:",m);}},"drawIconWithOptionalCounter"),_=useCallback((e,u)=>{if(!d||d.length===0||!e||!e.x||!e.y)return;let{x:l$1,y:p}=e,f=U.nodeSizeBase*U.nodeAreaFactor/2;u.save();let y=Math.min(d.length,8),g=Math.min(Math.PI*2/y,Math.PI);for(let m=0;m<y;m++){let S=m*g,T=(m+1)*g,R=t.current.hoveredButtonIndex===m;u.beginPath(),u.arc(l$1,p,f,S,T,false),u.lineTo(l$1,p),u.closePath(),u.lineWidth=1,u.strokeStyle=x.graph2D?.button?.stroke||"#FFFFFF",u.stroke(),u.fillStyle=R?x.graph2D?.button?.hoverFill||"rgba(255, 255, 255, 0.3)":x.graph2D?.button?.normalFill||"rgba(255, 255, 255, 0.1)",u.fill();let W=f*.2,B=(S+T)/2,J=f-U.nodeSizeBase/2+W,q=l$1+Math.cos(B)*J,V=p+Math.sin(B)*J,k=d[m];if(k.loading){let A=W/2,L=W/12;u.save(),u.translate(q,V),u.rotate(t.current.spinnerAngle);for(let Q=0;Q<12;Q++){let G=Math.PI*2*Q/12,ee=Q/12,de=Math.cos(G)*A,ze=Math.sin(G)*A;u.beginPath(),u.fillStyle=l(x.graph2D?.button?.spinnerColor,ee),u.arc(de,ze,L,0,Math.PI*2),u.fill();}u.restore(),t.current.spinnerAngle+=.1,t.current.spinnerAngle>Math.PI*2&&(t.current.spinnerAngle-=Math.PI*2),t.current.animation.id!==null&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null),t.current.animation.id=requestAnimationFrame(j),t.current.animation.buttonIndex=m;}else {t.current.animation.id&&t.current.animation.buttonIndex===m&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null);let A=R?k.hoverImg:k.normalImg,L=k.getCount?k.getCount(e):null;A.complete?$(u,A,q,V,W,L,x.graph2D?.button?.textColor):A.onload=()=>{F.current&&$(u,A,q,V,W,L,x.graph2D?.button?.textColor);};}}u.restore();},[d,x.graph2D?.button]),Y=useCallback(e=>{let u=re();!u||u.length===0||(e.globalAlpha=1,u.forEach(l=>{let{x:p,y:f,color:y,fontColor:g,label:m}=l,S=t.current.highlightNodes.has(l)||l===t.current.hoveredNode||l===t.current.draggedNode,T=l===t.current.selectedNode,R=U.nodeSizeBase,W=U.nodeSizeBase/2;if(S&&!T){let B=U.nodeSizeBase*U.nodeAreaFactor*.75/2;e.beginPath(),e.arc(p,f,B,0,2*Math.PI,false),e.fillStyle=x.graph2D.ring.highlightFill,e.fill();}if(T)if(s&&s.length>0)_(l,e);else {let B=U.nodeSizeBase*U.nodeAreaFactor/2;e.beginPath(),e.arc(p,f,B,0,2*Math.PI,false),e.fillStyle=x.graph2D.ring.selectionFill||x.graph2D.ring.highlightFill,e.fill();}if(e.beginPath(),e.arc(p,f,W,0,2*Math.PI),e.fillStyle=y||H(l.group||"0"),e.fill(),m){e.save(),e.translate(p,f);let B=t.current.transform.k,J=Se(B),q=R*U.textPaddingFactor;e.font=`${J}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=g||"#000";let V=me(m,q,e);e.fillText(V,0,0),e.restore();}}));},[x.graph2D.ring,s,_]),j=useCallback(()=>{let e=F.current;e&&(e.clearRect(0,0,t.current.width,t.current.height),he(e),e.save(),e.setTransform(t.current.transform.k,0,0,t.current.transform.k,t.current.transform.x,t.current.transform.y),Me(e),Y(e),e.restore());},[Me,Y,he]),K=useCallback((e,u=[],l)=>{let p=pe()||[],f=re()||[];if(!M.current||!e.length)return;let{width:y,height:g}=t.current,m=l?.smoothAppearance??false,S=l?.transitionDuration??1e3,T=new Set(f.map(k=>k.id)),R=e.filter(k=>!T.has(k.id)),W=new Set(p.map(k=>`${typeof k.source=="object"?k.source.id:k.source}-${typeof k.target=="object"?k.target.id:k.target}`)),B=u.filter(k=>{let A=`${typeof k.source=="object"?k.source.id:k.source}-${typeof k.target=="object"?k.target.id:k.target}`;return !W.has(A)});if(R.length===0&&B.length===0)return;let J=[...f,...R],q=[...p,...B];m&&(R.forEach(k=>{let A=B.filter(L=>{let Q=typeof L.source=="object"?L.source.id:L.source,G=typeof L.target=="object"?L.target.id:L.target;return Q===k.id&&T.has(G)||G===k.id&&T.has(Q)});if(A.length>0){let L=A[0],Q=typeof L.source=="object"?L.source.id===k.id?L.target:L.source.id:L.source===k.id?L.target:L.source,G=J.find(ee=>ee.id===Q);if(G&&G.x!==void 0&&G.y!==void 0){let ee=30+Math.random()*20,de=Math.random()*Math.PI*2;k.x=G.x+Math.cos(de)*ee,k.y=G.y+Math.sin(de)*ee,k.vx=0,k.vy=0;}}else {let L=y/2,Q=g/2,G=Math.min(y,g)/4,ee=Math.random()*Math.PI*2;k.x=L+Math.cos(ee)*(G*Math.random()),k.y=Q+Math.sin(ee)*(G*Math.random()),k.vx=0,k.vy=0;}}),f.forEach(k=>{k.fx=k.x,k.fy=k.y;})),M.current.nodes(J);let V=M.current.force("link");V&&V.links(q),B.forEach(k=>{let A=typeof k.source=="object"?k.source:J.find(Q=>Q.id===k.source),L=typeof k.target=="object"?k.target:J.find(Q=>Q.id===k.target);!A||!L||(!A.neighbors&&(A.neighbors=[]),!L.neighbors&&(L.neighbors=[]),A.neighbors.push(L),L.neighbors.push(A),!A.links&&(A.links=[]),!L.links&&(L.links=[]),A.links.push(k),L.links.push(k));}),m?(M.current.alphaTarget(.3),M.current.alpha(.3),M.current.velocityDecay(.7),M.current.restart(),setTimeout(()=>{f.forEach(k=>{k.fx=void 0,k.fy=void 0;}),M.current?.alphaTarget(0),M.current?.alpha(.1),M.current?.velocityDecay(.6);},S)):M.current.alpha(.1).restart(),j();},[I,j]),se=useCallback(e=>{let u=re(),l=pe();if(!M.current||!e.length||!u||u.length===0||!l||l.length===0)return;let p=new Set(e);if(t.current.selectedNode&&t.current.selectedNode.id!==void 0&&p.has(t.current.selectedNode.id)&&(t.current.selectedNode=null),t.current.hoveredNode&&t.current.hoveredNode.id!==void 0&&p.has(t.current.hoveredNode.id)&&(t.current.hoveredNode=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set),t.current.hoveredLink){let m=typeof t.current.hoveredLink.source=="object"?t.current.hoveredLink.source.id:t.current.hoveredLink.source,S=typeof t.current.hoveredLink.target=="object"?t.current.hoveredLink.target.id:t.current.hoveredLink.target;(m!==void 0&&p.has(m)||S!==void 0&&p.has(S))&&(t.current.hoveredLink=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set);}t.current.draggedNode&&t.current.draggedNode.id!==void 0&&p.has(t.current.draggedNode.id)&&(t.current.draggedNode=null);let f=u.filter(m=>m.id!==void 0&&!p.has(m.id)),y=l.filter(m=>{let S=typeof m.source=="object"?m.source.id:m.source,T=typeof m.target=="object"?m.target.id:m.target;return S!==void 0&&!p.has(S)&&T!==void 0&&!p.has(T)});f.forEach(m=>{m.neighbors=[],m.links=[];}),y.forEach(m=>{let S=typeof m.source=="object"?m.source:f.find(R=>R.id===m.source),T=typeof m.target=="object"?m.target:f.find(R=>R.id===m.target);!S||!T||(S.neighbors=S.neighbors||[],T.neighbors=T.neighbors||[],S.neighbors.push(T),T.neighbors.push(S),S.links=S.links||[],T.links=T.links||[],S.links.push(m),T.links.push(m));}),M.current.nodes(f);let g=M.current.force("link");g&&g.links(y),j();},[j]),ae=useCallback((e=0,u=20)=>{let l=re();if(!F.current||!C.current||!l||!l.length)return;let f=1/0,y=1/0,g=-1/0,m=-1/0;if(l.forEach(S=>{if(S.x===void 0||S.y===void 0)return;let T=S.x,R=S.y;f=Math.min(f,T),y=Math.min(y,R),g=Math.max(g,T),m=Math.max(m,R);}),isFinite(f)&&isFinite(g)&&isFinite(y)&&isFinite(m)){let{width:S,height:T}=t.current;f-=u,y-=u,g+=u,m+=u;let R=g-f,W=m-y,B=R>0?S/R:1,J=W>0?T/W:1,q=Math.min(B,J,10),V=f+R/2,k=y+W/2,A={k:q,x:S/2-V*q,y:T/2-k*q};if(e>0){let L={...t.current.transform},Q=Date.now(),G=a(()=>{let ee=Math.min(1,(Date.now()-Q)/e),de=ee===1?1:1-Math.pow(1-ee,3),ze={k:L.k+(A.k-L.k)*de,x:L.x+(A.x-L.x)*de,y:L.y+(A.y-L.y)*de};t.current.transform=ze,j(),ee<1&&requestAnimationFrame(G);},"animateZoom");requestAnimationFrame(G);}else t.current.transform=A,j();}},[]),Z=useCallback((e,u)=>{let l=re();if(!l||l.length===0)return null;let p=U.nodeSizeBase/2,f=typeof window<"u"&&window.devicePixelRatio||1,y=(e*f-t.current.transform.x)/t.current.transform.k,g=(u*f-t.current.transform.y)/t.current.transform.k;return l.find(m=>{let S=(m.x||0)-y,T=(m.y||0)-g;return Math.sqrt(S*S+T*T)<=p})||null},[]),oe=useCallback((e,u)=>{let l=pe(),p=re();if(!l||l.length===0||!p||p.length===0)return null;let f=typeof window<"u"&&window.devicePixelRatio||1,y=(e*f-t.current.transform.x)/t.current.transform.k,g=(u*f-t.current.transform.y)/t.current.transform.k,m=5;return l.find(S=>{let T=typeof S.source=="object"?S.source:p.find(Ae=>Ae.id===S.source),R=typeof S.target=="object"?S.target:p.find(Ae=>Ae.id===S.target);if(!T||!R)return false;let W=T.x||0,B=T.y||0,J=R.x||0,q=R.y||0,V=y-W,k=g-B,A=J-W,L=q-B,Q=V*A+k*L,G=A*A+L*L;if(G===0)return false;let ee=Q/G;ee=Math.max(0,Math.min(1,ee));let de=W+ee*A,ze=B+ee*L,_e=y-de,Ge=g-ze;return Math.sqrt(_e*_e+Ge*Ge)<=m})||null},[]),be=useCallback((e,u,l,p,f,y,g)=>{let m=e-l,S=u-p,T=Math.sqrt(m*m+S*S),R=Math.atan2(S,m);R<0&&(R+=2*Math.PI);let J=T>=f*.5&&T<=f*1,q=false;return y===Math.PI&&g===Math.PI*2?q=R>=Math.PI&&R<=Math.PI*2:y===0&&g===Math.PI?q=R>=0&&R<=Math.PI:q=y<=g&&R>=y&&R<=g||y>g&&(R>=y||R<=g),J&&q},[]),De=useCallback(e=>{if(e===t.current.hoveredNode)return;let u=new Set,l=new Set;e&&(u.add(e),e.neighbors&&e.neighbors.forEach(p=>u.add(p)),e.links&&e.links.forEach(p=>l.add(p))),t.current.hoveredNode=e,b&&b(e),t.current.highlightNodes=u,t.current.highlightLinks=l;},[b]),Te=useCallback(e=>{if(e===t.current.hoveredLink)return;let u=new Set,l=new Set;if(e){l.add(e);let p=re();if(p){let f=typeof e.source=="object"?e.source:p.find(g=>g.id===e.source),y=typeof e.target=="object"?e.target:p.find(g=>g.id===e.target);f&&u.add(f),y&&u.add(y);}}t.current.hoveredLink=e,v&&v(e),t.current.highlightNodes=u,t.current.highlightLinks=l;},[v,re]),Ye=useCallback(e=>{P&&P(e);},[P]),Le=useCallback(e=>{t.current.selectedNode=e,i&&i(e);},[i]),Ue=useCallback(()=>{t.current.selectedNode=null,h&&h();},[h]),Ne=useCallback(e=>{if(!C.current||!M.current)return;let u=C.current.getBoundingClientRect(),l=e.clientX-u.left,p=e.clientY-u.top;t.current.mouseStartPos={x:l,y:p},t.current.isDragging=false;let f=Z(l,p);f?(t.current.draggedNode=f,f.fx=f.x,f.fy=f.y):(t.current.isPanning=true,t.current.lastMousePos={x:l,y:p});},[Z]),$e=useCallback((e,u)=>{let l=null;if(C.current&&t.current&&d.length>0){let p=U.nodeSizeBase*U.nodeAreaFactor/2,f=C.current.getBoundingClientRect(),y=C.current.width/f.width,g=C.current.height/f.height,m=e*y,S=u*g,T=(m-t.current.transform.x)/t.current.transform.k,R=(S-t.current.transform.y)/t.current.transform.k,W=t.current.selectedNode?.x||0,B=t.current.selectedNode?.y||0,J=Math.min(d.length,8),q=Math.min(Math.PI*2/J,Math.PI);for(let V=0;V<J;V++){let k=V*q,A=(V+1)*q;if(be(T,R,W,B,p,k,A)){l=V;break}}}return l},[d]),Ce=useCallback(e=>{if(!C.current)return;let u=C.current.getBoundingClientRect(),l=e.clientX-u.left,p=e.clientY-u.top;if(t.current.draggedNode&&t.current.mouseStartPos&&M.current){let g=t.current.mouseStartPos.x,m=t.current.mouseStartPos.y,S=l-g,T=p-m;Math.sqrt(S*S+T*T)>3&&(t.current.isDragging=true,M.current.alphaTarget()===0&&M.current.alphaTarget(0).restart());let B=typeof window<"u"&&window.devicePixelRatio||1,J=(l*B-t.current.transform.x)/t.current.transform.k,q=(p*B-t.current.transform.y)/t.current.transform.k;t.current.draggedNode.fx=J,t.current.draggedNode.fy=q;return}if(t.current.isPanning&&t.current.mouseStartPos){let g=l-t.current.lastMousePos.x,m=p-t.current.lastMousePos.y,S=t.current.mouseStartPos.x,T=t.current.mouseStartPos.y;Math.sqrt(Math.pow(l-S,2)+Math.pow(p-T,2))>3&&(t.current.isDragging=true),t.current.transform={...t.current.transform,x:t.current.transform.x+g,y:t.current.transform.y+m},t.current.lastMousePos={x:l,y:p},j();return}let f,y;if(t.current.selectedNode&&C.current&&d.length>0){let g=$e(l,p);g!==null&&(y=t.current.selectedNode),g!==t.current.hoveredButtonIndex&&(f=true),t.current.hoveredButtonIndex=g;}else t.current.hoveredButtonIndex!==null&&(t.current.hoveredButtonIndex=null);if(!y&&(y=Z(l,p),!y)){let g=oe(l,p),m=g!==t.current.hoveredLink;if(g&&t.current.hoveredNode&&De(null),Te(g),C.current&&(C.current.style.cursor=g?"pointer":"default"),m){j();return}}y&&t.current.hoveredLink&&Te(null),y!==t.current.hoveredNode&&(f=true),De(y),C.current&&(C.current.style.cursor=y?"pointer":"default"),f&&j();},[d,Z,oe,De,Te,j,be,$e]),Ve=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.stopPropagation(),e.preventDefault()),t.current.mustBeStoppedPropagation=false;},[]),We=useCallback(e=>{let u=t.current.isDragging;if(u&&(t.current.mustBeStoppedPropagation=true),!u&&t.current.mouseStartPos){let l=C.current?.getBoundingClientRect();if(l){let p=e.clientX-l.left,f=e.clientY-l.top;d.length>0&&t.current.hoveredButtonIndex===null&&(t.current.hoveredButtonIndex=$e(p,f));let y=false;if(t.current.selectedNode&&t.current.hoveredButtonIndex!==null&&s[t.current.hoveredButtonIndex]){let g=s[t.current.hoveredButtonIndex];g&&g.onClick&&(g.onClick(t.current.selectedNode),y=true,t.current.hoveredButtonIndex=null);}if(!y&&t.current.draggedNode)Le(t.current.draggedNode);else if(!y&&!t.current.draggedNode){let g=oe(p,f);g?Ye(g):Ue();}}}if(t.current.draggedNode&&M.current){if(u){M.current.alphaTarget(0);let l=.05,p=.04,f=.6;M.current.alpha(l).alphaDecay(p),M.current.velocityDecay(f);}else M.current.alphaTarget(0);t.current.draggedNode.fx=void 0,t.current.draggedNode.fy=void 0,t.current.draggedNode=null;}t.current.isDragging=false,t.current.mouseStartPos=null,t.current.isPanning&&(t.current.isPanning=false),j();},[s,j,Le,Ue,oe,Ye,$e,d]),Dt=useCallback(e=>{if(e.stopPropagation(),e.preventDefault(),!C.current)return;let u=C.current.getBoundingClientRect(),l=e.clientX-u.left,p=e.clientY-u.top,y=-e.deltaY>0?1.1:1/1.1,g=t.current.transform,m=g.k*y;if(m<.01||m>10)return;let S=g.k*y,T=l-(l-g.x)*y,R=p-(p-g.y)*y;t.current.transform={k:S,x:T,y:R},j();},[j]),Ct=a((e,u)=>{let l=e.touches[0];if(l){let p={clientX:l.clientX,clientY:l.clientY};u(p);}},"convertTouchToMouseEvent"),Jr=useCallback(e=>{Ct(e,Ne);},[Ne]),Pt=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.preventDefault(),e.stopPropagation()),t.current.mustBeStoppedPropagation=false,Ct(e,We);},[We]),Qr=useCallback(e=>{Ct(e,Ce);},[Ce]);return useImperativeHandle(D,()=>({zoomToFit:ae,addNodes:K,removeNodes:se}),[ae,K,se]),useEffect(()=>{let e=C.current,{width:u,height:l}=t.current;if(!e)return;te(),z(true);let p=u/2,f=l/2,y=U.nodeSizeBase,g=y/2,m=y*2.5;M.current&&M.current.stop();let S=M.current=forceSimulation(I).force("link",forceLink(w).id(T=>T.id).distance(m).strength(.9)).force("charge",forceManyBody().strength(-y/10*200).theta(.5).distanceMin(y*2)).force("x",forceX().strength(.03)).force("y",forceY().strength(.03)).force("center",forceCenter(p,f).strength(.05)).force("collide",forceCollide().radius(g*2).iterations(2).strength(1)).velocityDecay(.6);return ()=>{S.stop();}},[I,w]),useLayoutEffect(()=>{let e=C.current;e&&(t.current.width=o*it,t.current.height=n*it,e.width=t.current.width,e.height=t.current.height);},[o,n]),useEffect(()=>{if(M.current){let e=M.current;e.on("tick",()=>{j();}),e.on("end",()=>{N&&(ae(0,20),setTimeout(()=>{z(false);},200));});}N||j();},[I,w,N,j,ae]),useEffect(()=>{!I||!w||w.forEach(e=>{let u=typeof e.source=="object"?e.source:I.find(p=>p.id===e.source),l=typeof e.target=="object"?e.target:I.find(p=>p.id===e.target);!u||!l||(!u.neighbors&&(u.neighbors=[]),!l.neighbors&&(l.neighbors=[]),u.neighbors.push(l),l.neighbors.push(u),!u.links&&(u.links=[]),!l.links&&(l.links=[]),u.links.push(e),l.links.push(e));});},[I,w]),useEffect(()=>{s&&s.length>0&&E(Oo(s));},[s]),useEffect(()=>{let e=C.current;if(!(!e||typeof window>"u"))return e.addEventListener("wheel",Dt,{passive:false}),e.addEventListener("touchend",Pt,{passive:false}),()=>{e.removeEventListener("wheel",Dt),e.removeEventListener("touchend",Pt);}},[Dt,Pt]),jsxs(Ho,{children:[(r||N)&&jsx(ir,{width:o,height:n}),jsx($o,{ref:C,style:{width:o,height:n,display:r||N?"none":"block"},onMouseDown:Ne,onMouseMove:Ce,onMouseUp:We,onMouseLeave:We,onClick:Ve,onTouchStart:Jr,onTouchMove:Qr})]})}),Ho=styled.div`
47
+ `,Do=a(({width:r=280,height:o=280})=>{let n=useTheme();return jsx(So,{children:jsxs(wo,{foregroundColor:n.contentLoader.foreground,backgroundColor:n.contentLoader.background,width:r,height:o,viewBox:"0 0 280 280",children:[jsx("path",{d:"m55 38-0.97266 0.22852 7.0801 30.092-18.355-20.979-0.75195 0.6582 19.596 22.395 0.43164 1.834 0.97266-0.22852 0.75195-0.6582-0.37695-0.42969 9.625-27.912-0.94531-0.32617-9.4375 27.371-0.10547-0.12109zm8 34-0.78516 0.61914 0.0957 0.12305-12.311 13.258 0.73242 0.67969 12.205-13.145 14.277 18.084 0.78516-0.61914-14.373-18.207 0.10547-0.11328zm15 19-0.48438 0.875 46.992 25.996 8e-3 4e-3 20.506 11.592-28.182 4.5449 0.15998 0.98819 29.418-4.7441 0.25 0.14062-12.555 24.143 0.88672 0.46094 13-25 15 25 26 30v18l-11 18 0.85352 0.52148 9.8008-16.039-4.6543 33.518 0.99023 0.13867 4.7793-34.408 7.2305 16.27 0.91406-0.40625-7.9141-17.807v-17.104l18 12.316 0.56445-0.82617-18.896-12.928-25.855-29.836-14.633-24.387 0.01562-0.02344h23.805v-1h-23.152l13.848-21.234 55.201-28.791-0.45898-0.88476 0.77734 0.62305 11.402-14.25 16.668-11.842-0.58008-0.81641-16.785 11.928-11.486 14.355-55.434 28.912-14.277 21.893-7.7617-27.166-0.96094 0.27344 7.7227 27.031-1.1191 0.17969-21.604-12.211zm140.43-12.912-6.957-17.338-0.92773 0.37305 6.957 17.338zm-6.957-17.338 0.72266 0.69336 16.232-16.896-0.7207-0.69336zm-3.4766 137.25 5 15 0.94922-0.31641-5-15zm-91-63-0.48047-0.87695-31 17 0.48047 0.87695zm-31 17 5 18 0.96289-0.26758-5-18zm0 0-0.70703-0.70703-12.898 12.898-17.881 9.9336 0.48633 0.875 18-10zm5 18-0.64062-0.76758-18 15 0.64062 0.76758z"}),jsx("circle",{cx:"229.92",cy:"63.7318",r:"5",transform:"rotate(173.661 229.92 63.7318)"}),jsx("circle",{cx:"227.711",cy:"43.8541",r:"5",transform:"rotate(173.661 227.711 43.8541)"}),jsx("circle",{cx:"211.478",cy:"60.7499",r:"5",transform:"rotate(173.661 211.478 60.7499)"}),jsx("circle",{cx:"218.434",cy:"78.0877",r:"5",transform:"rotate(173.661 218.434 78.0877)"}),jsx("circle",{cx:"246.705",cy:"51.8054",r:"5",transform:"rotate(173.661 246.705 51.8054)"}),jsx("circle",{cx:"42",cy:"48",r:"5"}),jsx("circle",{cx:"55",cy:"38",r:"5"}),jsx("circle",{cx:"73",cy:"43",r:"5"}),jsx("circle",{cx:"63",cy:"72",r:"5"}),jsx("circle",{cx:"50",cy:"86",r:"5"}),jsx("circle",{cx:"78",cy:"91",r:"5"}),jsx("circle",{cx:"73",cy:"165",r:"5"}),jsx("circle",{cx:"73",cy:"185",r:"5"}),jsx("circle",{cx:"91",cy:"170",r:"5"}),jsx("circle",{cx:"86",cy:"152",r:"5"}),jsx("circle",{cx:"148",cy:"130",r:"5"}),jsx("circle",{cx:"189",cy:"185",r:"5"}),jsx("circle",{cx:"163",cy:"107",r:"5"}),jsx("circle",{cx:"140",cy:"102",r:"5"}),jsx("circle",{cx:"117",cy:"135",r:"5"}),jsx("circle",{cx:"125",cy:"117",r:"5"}),jsx("circle",{cx:"208",cy:"198",r:"5"}),jsx("circle",{cx:"189",cy:"203",r:"5"}),jsx("circle",{cx:"198",cy:"221",r:"5"}),jsx("circle",{cx:"178",cy:"221",r:"5"}),jsx("circle",{cx:"184",cy:"239",r:"5"}),jsx("circle",{cx:"213",cy:"213",r:"5"}),jsx("circle",{cx:"173",cy:"130",r:"5"}),jsx("circle",{cx:"163",cy:"155",r:"5"}),jsx("circle",{cx:"135",cy:"155",r:"5"}),jsx("circle",{cx:"55",cy:"175",r:"5"})]})})},"GraphLoader"),pr=Do;var ft=typeof window<"u"&&window.devicePixelRatio||1;function Ho(r){return !r||r.length===0?[]:r.map(o=>{let n=new Image;n.src=o.img;let a=new Image;return a.src=o.hoverImg,{...o,normalImg:n,hoverImg:a}})}a(Ho,"prepareButtonImages");var te={fontSize:3,nodeSizeBase:30,nodeAreaFactor:2,textPaddingFactor:.9,gridSpacing:20,dotSize:1,maxZoom:4},Wo=forwardRef(({loading:r,width:o,height:n,graphData:a$1,buttons:d=[],onNodeClick:i,onBackgroundClick:h,onNodeHover:x,onLinkHover:k,onLinkClick:R},P)=>{let m=useTheme(),[E,A]=useState(true),t=useRef({transform:{x:0,y:0,k:1},isPanning:false,hoveredNode:null,hoveredLink:null,draggedNode:null,selectedNode:null,hoveredButtonIndex:null,highlightNodes:new Set,highlightLinks:new Set,lastMousePos:{x:0,y:0},mustBeStoppedPropagation:false,mouseStartPos:null,isDragging:false,width:o*ft,height:n*ft,animation:{id:null,buttonIndex:null},spinnerAngle:0}),{nodes:F,links:S}=useMemo(()=>Ro(a$1),[a$1]),[p,B]=useState([]),M=useRef(null),T=useRef(null),$=useRef(null),Y=scaleOrdinal(schemeCategory10),ne=useCallback(()=>{if(!M.current)return false;try{let e=M.current.getContext("2d");return e?($.current=e,!0):(console.error("Failed to get 2D context"),!1)}catch(e){return console.error("Error initializing Canvas 2D context:",e),false}},[]),re=useCallback(()=>T.current?T.current.nodes():null,[]),se=useCallback(()=>{if(!T.current)return null;let e=T.current.force("link");return e?e.links():null},[]),ye=useCallback(e=>{e.save(),e.setTransform(1,0,0,1,0,0);let{width:l,height:c}=t.current,u=te.gridSpacing,f=te.dotSize;e.fillStyle=m.graph2D.grid.dotColor;for(let w=u/2;w<=l;w+=u)for(let g=u/2;g<=c;g+=u)e.beginPath(),e.arc(w,g,f,0,2*Math.PI),e.fill();e.restore();},[m.graph2D.grid.dotColor,te.gridSpacing,te.dotSize]),le=useCallback((e,l,c)=>{if(!e)return "";if(c.measureText(e).width<=l)return e;let f=e,w="...";for(;c.measureText(f+w).width>l&&f.length>0;)f=f.slice(0,-1);return f+w},[]),we=a(e=>{let c=Math.min(e,te.maxZoom)/te.maxZoom;return Math.max(te.fontSize*c,te.fontSize)},"calculateFontSize"),ve=useCallback(e=>{let l=se(),c=re();!l||l.length===0||!c||c.length===0||(e.lineWidth=.5,e.globalAlpha=1,l.forEach(u=>{let f=typeof u.source=="object"?u.source:c.find(We=>We.id===u.source),w=typeof u.target=="object"?u.target:c.find(We=>We.id===u.target);if(!f||!w)return;let g={x:f.x||0,y:f.y||0},b={x:w.x||0,y:w.y||0},D=b.x-g.x,N=b.y-g.y,z=Math.sqrt(D*D+N*N),y=D/z,C=N/z,_=te.nodeSizeBase/2,I=te.nodeSizeBase/2,j=4,v={x:g.x+y*_,y:g.y+C*_},O={x:b.x-y*(I+j),y:b.y-C*(I+j)},L={x:b.x-y*(I+1),y:b.y-C*(I+1)},G=t.current.highlightLinks.has(u),K=G?m.graph2D.link.highlighted:m.graph2D.link.normal,ee=G?1.5:.5,ge=g.x+(b.x-g.x)/2,pe=g.y+(b.y-g.y)/2,he=Math.atan2(N,D);if(u.label){let We=t.current.transform.k,Ze=we(We);e.font=`${Ze}px Sans-Serif`;let Zt=e.measureText(u.label).width,Vt=10;e.beginPath(),e.moveTo(v.x,v.y);let Gt=z/2-(Zt+Vt)/2,Kt={x:g.x+y*Gt,y:g.y+C*Gt};e.lineTo(Kt.x,Kt.y),e.strokeStyle=K,e.lineWidth=ee,e.stroke(),e.beginPath();let Jt=z/2+(Zt+Vt)/2,Qt={x:g.x+y*Jt,y:g.y+C*Jt};e.moveTo(Qt.x,Qt.y),e.lineTo(O.x,O.y),e.strokeStyle=K,e.lineWidth=ee,e.stroke();}else e.beginPath(),e.moveTo(v.x,v.y),e.lineTo(O.x,O.y),e.strokeStyle=K,e.lineWidth=ee,e.stroke();let He=2;if(e.save(),e.translate(L.x,L.y),e.rotate(he),e.beginPath(),e.moveTo(0,0),e.lineTo(-j,He),e.lineTo(-j,0),e.lineTo(-j,-He),e.closePath(),e.fillStyle=K,e.fill(),e.restore(),u.label){let We=t.current.transform.k,Ze=we(We);e.font=`${Ze}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(ge,pe),Math.abs(he)>Math.PI/2?e.rotate(he+Math.PI):e.rotate(he),e.fillStyle=G?m.graph2D.link.highlightedTextColor:m.graph2D.link.textColor,e.fillText(u.label,0,0),e.restore();}}));},[te,m.graph2D.link]),q=a((e,l,c,u,f,w,g)=>{try{if(w!=null){let b=f*.8;e.font=`${b}px sans-serif`,e.textBaseline="middle",e.textAlign="left";let D=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1,minimumFractionDigits:0,compactDisplay:"short"}).format(w),N=e.measureText(D).width,z=f*.3,C=(f+z+N)/2;e.drawImage(l,c-C,u-f/2,f,f),e.fillStyle=g||"#99989C",e.fillText(D,c-C+f+z,u);}else e.drawImage(l,c-f/2,u-f/2,f,f);}catch(b){console.warn("Error rendering icon:",b);}},"drawIconWithOptionalCounter"),H=useCallback((e,l$1)=>{if(!p||p.length===0||!e||!e.x||!e.y)return;let{x:c,y:u}=e,f=te.nodeSizeBase*te.nodeAreaFactor/2;l$1.save();let w=Math.min(p.length,8),g=Math.min(Math.PI*2/w,Math.PI);for(let b=0;b<w;b++){let D=b*g,N=(b+1)*g,z=t.current.hoveredButtonIndex===b;l$1.beginPath(),l$1.arc(c,u,f,D,N,false),l$1.lineTo(c,u),l$1.closePath(),l$1.lineWidth=1,l$1.strokeStyle=m.graph2D?.button?.stroke||"#FFFFFF",l$1.stroke(),l$1.fillStyle=z?m.graph2D?.button?.hoverFill||"rgba(255, 255, 255, 0.3)":m.graph2D?.button?.normalFill||"rgba(255, 255, 255, 0.1)",l$1.fill();let y=f*.2,C=(D+N)/2,_=f-te.nodeSizeBase/2+y,I=c+Math.cos(C)*_,j=u+Math.sin(C)*_,v=p[b];if(v.loading){let O=y/2,L=y/12;l$1.save(),l$1.translate(I,j),l$1.rotate(t.current.spinnerAngle);for(let G=0;G<12;G++){let K=Math.PI*2*G/12,ee=G/12,ge=Math.cos(K)*O,pe=Math.sin(K)*O;l$1.beginPath(),l$1.fillStyle=l(m.graph2D?.button?.spinnerColor,ee),l$1.arc(ge,pe,L,0,Math.PI*2),l$1.fill();}l$1.restore(),t.current.spinnerAngle+=.1,t.current.spinnerAngle>Math.PI*2&&(t.current.spinnerAngle-=Math.PI*2),t.current.animation.id!==null&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null),t.current.animation.id=requestAnimationFrame(W),t.current.animation.buttonIndex=b;}else {t.current.animation.id&&t.current.animation.buttonIndex===b&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null);let O=z?v.hoverImg:v.normalImg,L=v.getCount?v.getCount(e):null;O.complete?q(l$1,O,I,j,y,L,m.graph2D?.button?.textColor):O.onload=()=>{$.current&&q(l$1,O,I,j,y,L,m.graph2D?.button?.textColor);};}}l$1.restore();},[p,m.graph2D?.button]),V=useCallback(e=>{let l=re();!l||l.length===0||(e.globalAlpha=1,l.forEach(c=>{let{x:u,y:f,color:w,fontColor:g,label:b}=c,D=t.current.highlightNodes.has(c)||c===t.current.hoveredNode||c===t.current.draggedNode,N=c===t.current.selectedNode,z=te.nodeSizeBase,y=te.nodeSizeBase/2;if(D&&!N){let C=te.nodeSizeBase*te.nodeAreaFactor*.75/2;e.beginPath(),e.arc(u,f,C,0,2*Math.PI,false),e.fillStyle=m.graph2D.ring.highlightFill,e.fill();}if(N)if(d&&d.length>0)H(c,e);else {let C=te.nodeSizeBase*te.nodeAreaFactor/2;e.beginPath(),e.arc(u,f,C,0,2*Math.PI,false),e.fillStyle=m.graph2D.ring.selectionFill||m.graph2D.ring.highlightFill,e.fill();}if(e.beginPath(),e.arc(u,f,y,0,2*Math.PI),e.fillStyle=w||Y(c.group||"0"),e.fill(),b){e.save(),e.translate(u,f);let C=t.current.transform.k,_=we(C),I=z*te.textPaddingFactor;e.font=`${_}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=g||"#000";let j=le(b,I,e);e.fillText(j,0,0),e.restore();}}));},[m.graph2D.ring,d,H]),W=useCallback(()=>{let e=$.current;e&&(e.clearRect(0,0,t.current.width,t.current.height),ye(e),e.save(),e.setTransform(t.current.transform.k,0,0,t.current.transform.k,t.current.transform.x,t.current.transform.y),ve(e),V(e),e.restore());},[ve,V,ye]),Z=useCallback((e,l=[],c)=>{let u=se()||[],f=re()||[];if(!T.current||!e.length)return;let{width:w,height:g}=t.current,b=c?.smoothAppearance??false,D=c?.transitionDuration??1e3,N=new Set(f.map(v=>v.id)),z=e.filter(v=>!N.has(v.id)),y=new Set(u.map(v=>`${typeof v.source=="object"?v.source.id:v.source}-${typeof v.target=="object"?v.target.id:v.target}`)),C=l.filter(v=>{let O=`${typeof v.source=="object"?v.source.id:v.source}-${typeof v.target=="object"?v.target.id:v.target}`;return !y.has(O)});if(z.length===0&&C.length===0)return;let _=[...f,...z],I=[...u,...C];b&&(z.forEach(v=>{let O=C.filter(L=>{let G=typeof L.source=="object"?L.source.id:L.source,K=typeof L.target=="object"?L.target.id:L.target;return G===v.id&&N.has(K)||K===v.id&&N.has(G)});if(O.length>0){let L=O[0],G=typeof L.source=="object"?L.source.id===v.id?L.target:L.source.id:L.source===v.id?L.target:L.source,K=_.find(ee=>ee.id===G);if(K&&K.x!==void 0&&K.y!==void 0){let ee=30+Math.random()*20,ge=Math.random()*Math.PI*2;v.x=K.x+Math.cos(ge)*ee,v.y=K.y+Math.sin(ge)*ee,v.vx=0,v.vy=0;}}else {let L=w/2,G=g/2,K=Math.min(w,g)/4,ee=Math.random()*Math.PI*2;v.x=L+Math.cos(ee)*(K*Math.random()),v.y=G+Math.sin(ee)*(K*Math.random()),v.vx=0,v.vy=0;}}),f.forEach(v=>{v.fx=v.x,v.fy=v.y;})),T.current.nodes(_);let j=T.current.force("link");j&&j.links(I),C.forEach(v=>{let O=typeof v.source=="object"?v.source:_.find(G=>G.id===v.source),L=typeof v.target=="object"?v.target:_.find(G=>G.id===v.target);!O||!L||(!O.neighbors&&(O.neighbors=[]),!L.neighbors&&(L.neighbors=[]),O.neighbors.push(L),L.neighbors.push(O),!O.links&&(O.links=[]),!L.links&&(L.links=[]),O.links.push(v),L.links.push(v));}),b?(T.current.alphaTarget(.3),T.current.alpha(.3),T.current.velocityDecay(.7),T.current.restart(),setTimeout(()=>{f.forEach(v=>{v.fx=void 0,v.fy=void 0;}),T.current?.alphaTarget(0),T.current?.alpha(.1),T.current?.velocityDecay(.6);},D)):T.current.alpha(.1).restart(),W();},[F,W]),oe=useCallback(e=>{let l=re(),c=se();if(!T.current||!e.length||!l||l.length===0||!c||c.length===0)return;let u=new Set(e);if(t.current.selectedNode&&t.current.selectedNode.id!==void 0&&u.has(t.current.selectedNode.id)&&(t.current.selectedNode=null),t.current.hoveredNode&&t.current.hoveredNode.id!==void 0&&u.has(t.current.hoveredNode.id)&&(t.current.hoveredNode=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set),t.current.hoveredLink){let b=typeof t.current.hoveredLink.source=="object"?t.current.hoveredLink.source.id:t.current.hoveredLink.source,D=typeof t.current.hoveredLink.target=="object"?t.current.hoveredLink.target.id:t.current.hoveredLink.target;(b!==void 0&&u.has(b)||D!==void 0&&u.has(D))&&(t.current.hoveredLink=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set);}t.current.draggedNode&&t.current.draggedNode.id!==void 0&&u.has(t.current.draggedNode.id)&&(t.current.draggedNode=null);let f=l.filter(b=>b.id!==void 0&&!u.has(b.id)),w=c.filter(b=>{let D=typeof b.source=="object"?b.source.id:b.source,N=typeof b.target=="object"?b.target.id:b.target;return D!==void 0&&!u.has(D)&&N!==void 0&&!u.has(N)});f.forEach(b=>{b.neighbors=[],b.links=[];}),w.forEach(b=>{let D=typeof b.source=="object"?b.source:f.find(z=>z.id===b.source),N=typeof b.target=="object"?b.target:f.find(z=>z.id===b.target);!D||!N||(D.neighbors=D.neighbors||[],N.neighbors=N.neighbors||[],D.neighbors.push(N),N.neighbors.push(D),D.links=D.links||[],N.links=N.links||[],D.links.push(b),N.links.push(b));}),T.current.nodes(f);let g=T.current.force("link");g&&g.links(w),W();},[W]),ae=useCallback((e=0,l=20)=>{let c=re();if(!$.current||!M.current||!c||!c.length)return;let f=1/0,w=1/0,g=-1/0,b=-1/0;if(c.forEach(D=>{if(D.x===void 0||D.y===void 0)return;let N=D.x,z=D.y;f=Math.min(f,N),w=Math.min(w,z),g=Math.max(g,N),b=Math.max(b,z);}),isFinite(f)&&isFinite(g)&&isFinite(w)&&isFinite(b)){let{width:D,height:N}=t.current;f-=l,w-=l,g+=l,b+=l;let z=g-f,y=b-w,C=z>0?D/z:1,_=y>0?N/y:1,I=Math.min(C,_,10),j=f+z/2,v=w+y/2,O={k:I,x:D/2-j*I,y:N/2-v*I};if(e>0){let L={...t.current.transform},G=Date.now(),K=a(()=>{let ee=Math.min(1,(Date.now()-G)/e),ge=ee===1?1:1-Math.pow(1-ee,3),pe={k:L.k+(O.k-L.k)*ge,x:L.x+(O.x-L.x)*ge,y:L.y+(O.y-L.y)*ge};t.current.transform=pe,W(),ee<1&&requestAnimationFrame(K);},"animateZoom");requestAnimationFrame(K);}else t.current.transform=O,W();}},[]),X=useCallback((e,l)=>{let c=re();if(!c||c.length===0)return null;let u=te.nodeSizeBase/2,f=typeof window<"u"&&window.devicePixelRatio||1,w=(e*f-t.current.transform.x)/t.current.transform.k,g=(l*f-t.current.transform.y)/t.current.transform.k;return c.find(b=>{let D=(b.x||0)-w,N=(b.y||0)-g;return Math.sqrt(D*D+N*N)<=u})||null},[]),Q=useCallback((e,l)=>{let c=se(),u=re();if(!c||c.length===0||!u||u.length===0)return null;let f=typeof window<"u"&&window.devicePixelRatio||1,w=(e*f-t.current.transform.x)/t.current.transform.k,g=(l*f-t.current.transform.y)/t.current.transform.k,b=5;return c.find(D=>{let N=typeof D.source=="object"?D.source:u.find(Ze=>Ze.id===D.source),z=typeof D.target=="object"?D.target:u.find(Ze=>Ze.id===D.target);if(!N||!z)return false;let y=N.x||0,C=N.y||0,_=z.x||0,I=z.y||0,j=w-y,v=g-C,O=_-y,L=I-C,G=j*O+v*L,K=O*O+L*L;if(K===0)return false;let ee=G/K;ee=Math.max(0,Math.min(1,ee));let ge=y+ee*O,pe=C+ee*L,he=w-ge,He=g-pe;return Math.sqrt(he*he+He*He)<=b})||null},[]),de=useCallback((e,l,c,u,f,w,g)=>{let b=e-c,D=l-u,N=Math.sqrt(b*b+D*D),z=Math.atan2(D,b);z<0&&(z+=2*Math.PI);let _=N>=f*.5&&N<=f*1,I=false;return w===Math.PI&&g===Math.PI*2?I=z>=Math.PI&&z<=Math.PI*2:w===0&&g===Math.PI?I=z>=0&&z<=Math.PI:I=w<=g&&z>=w&&z<=g||w>g&&(z>=w||z<=g),_&&I},[]),ce=useCallback(e=>{if(e===t.current.hoveredNode)return;let l=new Set,c=new Set;e&&(l.add(e),e.neighbors&&e.neighbors.forEach(u=>l.add(u)),e.links&&e.links.forEach(u=>c.add(u))),t.current.hoveredNode=e,x&&x(e),t.current.highlightNodes=l,t.current.highlightLinks=c;},[x]),ue=useCallback(e=>{if(e===t.current.hoveredLink)return;let l=new Set,c=new Set;if(e){c.add(e);let u=re();if(u){let f=typeof e.source=="object"?e.source:u.find(g=>g.id===e.source),w=typeof e.target=="object"?e.target:u.find(g=>g.id===e.target);f&&l.add(f),w&&l.add(w);}}t.current.hoveredLink=e,k&&k(e),t.current.highlightNodes=l,t.current.highlightLinks=c;},[k,re]),Se=useCallback(e=>{R&&R(e);},[R]),_e=useCallback(e=>{t.current.selectedNode=e,i&&i(e);},[i]),qe=useCallback(()=>{t.current.selectedNode=null,h&&h();},[h]),Ne=useCallback(e=>{if(!M.current||!T.current)return;let l=M.current.getBoundingClientRect(),c=e.clientX-l.left,u=e.clientY-l.top;t.current.mouseStartPos={x:c,y:u},t.current.isDragging=false;let f=X(c,u);f?(t.current.draggedNode=f,f.fx=f.x,f.fy=f.y):(t.current.isPanning=true,t.current.lastMousePos={x:c,y:u});},[X]),Be=useCallback((e,l)=>{let c=null;if(M.current&&t.current&&p.length>0){let u=te.nodeSizeBase*te.nodeAreaFactor/2,f=M.current.getBoundingClientRect(),w=M.current.width/f.width,g=M.current.height/f.height,b=e*w,D=l*g,N=(b-t.current.transform.x)/t.current.transform.k,z=(D-t.current.transform.y)/t.current.transform.k,y=t.current.selectedNode?.x||0,C=t.current.selectedNode?.y||0,_=Math.min(p.length,8),I=Math.min(Math.PI*2/_,Math.PI);for(let j=0;j<_;j++){let v=j*I,O=(j+1)*I;if(de(N,z,y,C,u,v,O)){c=j;break}}}return c},[p]),Ce=useCallback(e=>{if(!M.current)return;let l=M.current.getBoundingClientRect(),c=e.clientX-l.left,u=e.clientY-l.top;if(t.current.draggedNode&&t.current.mouseStartPos&&T.current){let g=t.current.mouseStartPos.x,b=t.current.mouseStartPos.y,D=c-g,N=u-b;Math.sqrt(D*D+N*N)>3&&(t.current.isDragging=true,T.current.alphaTarget()===0&&T.current.alphaTarget(0).restart());let C=typeof window<"u"&&window.devicePixelRatio||1,_=(c*C-t.current.transform.x)/t.current.transform.k,I=(u*C-t.current.transform.y)/t.current.transform.k;t.current.draggedNode.fx=_,t.current.draggedNode.fy=I;return}if(t.current.isPanning&&t.current.mouseStartPos){let g=c-t.current.lastMousePos.x,b=u-t.current.lastMousePos.y,D=t.current.mouseStartPos.x,N=t.current.mouseStartPos.y;Math.sqrt(Math.pow(c-D,2)+Math.pow(u-N,2))>3&&(t.current.isDragging=true),t.current.transform={...t.current.transform,x:t.current.transform.x+g,y:t.current.transform.y+b},t.current.lastMousePos={x:c,y:u},W();return}let f,w;if(t.current.selectedNode&&M.current&&p.length>0){let g=Be(c,u);g!==null&&(w=t.current.selectedNode),g!==t.current.hoveredButtonIndex&&(f=true),t.current.hoveredButtonIndex=g;}else t.current.hoveredButtonIndex!==null&&(t.current.hoveredButtonIndex=null);if(!w&&(w=X(c,u),!w)){let g=Q(c,u),b=g!==t.current.hoveredLink;if(g&&t.current.hoveredNode&&ce(null),ue(g),M.current&&(M.current.style.cursor=g?"pointer":"default"),b){W();return}}w&&t.current.hoveredLink&&ue(null),w!==t.current.hoveredNode&&(f=true),ce(w),M.current&&(M.current.style.cursor=w?"pointer":"default"),f&&W();},[p,X,Q,ce,ue,W,de,Be]),Pe=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.stopPropagation(),e.preventDefault()),t.current.mustBeStoppedPropagation=false;},[]),Re=useCallback(e=>{let l=t.current.isDragging;if(l&&(t.current.mustBeStoppedPropagation=true),!l&&t.current.mouseStartPos){let c=M.current?.getBoundingClientRect();if(c){let u=e.clientX-c.left,f=e.clientY-c.top;p.length>0&&t.current.hoveredButtonIndex===null&&(t.current.hoveredButtonIndex=Be(u,f));let w=false;if(t.current.selectedNode&&t.current.hoveredButtonIndex!==null&&d[t.current.hoveredButtonIndex]){let g=d[t.current.hoveredButtonIndex];g&&g.onClick&&(g.onClick(t.current.selectedNode),w=true,t.current.hoveredButtonIndex=null);}if(!w&&t.current.draggedNode)_e(t.current.draggedNode);else if(!w&&!t.current.draggedNode){let g=Q(u,f);g?Se(g):qe();}}}if(t.current.draggedNode&&T.current){if(l){T.current.alphaTarget(0);let c=.05,u=.04,f=.6;T.current.alpha(c).alphaDecay(u),T.current.velocityDecay(f);}else T.current.alphaTarget(0);t.current.draggedNode.fx=void 0,t.current.draggedNode.fy=void 0,t.current.draggedNode=null;}t.current.isDragging=false,t.current.mouseStartPos=null,t.current.isPanning&&(t.current.isPanning=false),W();},[d,W,_e,qe,Q,Se,Be,p]),Ue=useCallback(e=>{if(e.stopPropagation(),e.preventDefault(),!M.current)return;let l=M.current.getBoundingClientRect(),c=e.clientX-l.left,u=e.clientY-l.top,w=-e.deltaY>0?1.1:1/1.1,g=t.current.transform,b=g.k*w;if(b<.01||b>10)return;let D=g.k*w,N=c-(c-g.x)*w,z=u-(u-g.y)*w;t.current.transform={k:D,x:N,y:z},W();},[W]),Fe=a((e,l)=>{let c=e.touches[0];if(c){let u={clientX:c.clientX,clientY:c.clientY};l(u);}},"convertTouchToMouseEvent"),et=useCallback(e=>{Fe(e,Ne);},[Ne]),Oe=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.preventDefault(),e.stopPropagation()),t.current.mustBeStoppedPropagation=false,Fe(e,Re);},[Re]),Lt=useCallback(e=>{Fe(e,Ce);},[Ce]);return useImperativeHandle(P,()=>({zoomToFit:ae,addNodes:Z,removeNodes:oe}),[ae,Z,oe]),useEffect(()=>{let e=M.current,{width:l,height:c}=t.current;if(!e)return;ne(),A(true);let u=l/2,f=c/2,w=te.nodeSizeBase,g=w/2,b=w*2.5;T.current&&T.current.stop();let D=T.current=forceSimulation(F).force("link",forceLink(S).id(N=>N.id).distance(b).strength(.9)).force("charge",forceManyBody().strength(-w/10*200).theta(.5).distanceMin(w*2)).force("x",forceX().strength(.03)).force("y",forceY().strength(.03)).force("center",forceCenter(u,f).strength(.05)).force("collide",forceCollide().radius(g*2).iterations(2).strength(1)).velocityDecay(.6);return ()=>{D.stop();}},[F,S]),useLayoutEffect(()=>{let e=M.current;e&&(t.current.width=o*ft,t.current.height=n*ft,e.width=t.current.width,e.height=t.current.height);},[o,n]),useEffect(()=>{if(T.current){let e=T.current;e.on("tick",()=>{W();}),e.on("end",()=>{E&&(ae(0,20),setTimeout(()=>{A(false);},200));});}E||W();},[F,S,E,W,ae]),useEffect(()=>{!F||!S||S.forEach(e=>{let l=typeof e.source=="object"?e.source:F.find(u=>u.id===e.source),c=typeof e.target=="object"?e.target:F.find(u=>u.id===e.target);!l||!c||(!l.neighbors&&(l.neighbors=[]),!c.neighbors&&(c.neighbors=[]),l.neighbors.push(c),c.neighbors.push(l),!l.links&&(l.links=[]),!c.links&&(c.links=[]),l.links.push(e),c.links.push(e));});},[F,S]),useEffect(()=>{d&&d.length>0&&B(Ho(d));},[d]),useEffect(()=>{let e=M.current;if(!(!e||typeof window>"u"))return e.addEventListener("wheel",Ue,{passive:false}),e.addEventListener("touchend",Oe,{passive:false}),()=>{e.removeEventListener("wheel",Ue),e.removeEventListener("touchend",Oe);}},[Ue,Oe]),jsxs($o,{children:[(r||E)&&jsx(pr,{width:o,height:n}),jsx(Xo,{ref:M,style:{width:o,height:n,display:r||E?"none":"block"},onMouseDown:Ne,onMouseMove:Ce,onMouseUp:Re,onMouseLeave:Re,onClick:Pe,onTouchStart:et,onTouchMove:Lt})]})}),$o=styled.div`
48
48
  display: flex;
49
49
  align-items: center;
50
50
  justify-content: center;
51
51
  width: 100%;
52
52
  min-width: 0;
53
53
  position: relative;
54
- `,$o=styled.canvas``;Fo.displayName="Graph2D";var Gc=w(({isActive:r,position:o,top:n=0,left:a=0,right:s,bottom:i,...h})=>jsx(qo,{$isActive:r,$position:o,$top:n,$left:a,$right:s,$bottom:i,...h})),qo=vo.div(({$isActive:r,$top:o,$left:n,$right:a,$bottom:s,$position:i,theme:h})=>`
54
+ `,Xo=styled.canvas``;Wo.displayName="Graph2D";var Qc=w(({isActive:r,position:o,top:n=0,left:a=0,right:d,bottom:i,...h})=>jsx(Uo,{$isActive:r,$position:o,$top:n,$left:a,$right:d,$bottom:i,...h})),Uo=xo.div(({$isActive:r,$top:o,$left:n,$right:a,$bottom:d,$position:i,theme:h})=>`
55
55
  ${r?`
56
56
  position: ${i};
57
57
  z-index: 1000;
58
58
  ${typeof o=="number"?`top: ${c(o,h.baseSize)};`:""}
59
59
  ${typeof n=="number"?`left: ${c(n,h.baseSize)};`:""}
60
60
  ${typeof a=="number"?`right: ${c(a,h.baseSize)};`:""}
61
- ${typeof s=="number"?`bottom: ${c(s,h.baseSize)};`:""}
61
+ ${typeof d=="number"?`bottom: ${c(d,h.baseSize)};`:""}
62
62
 
63
63
  `:""}
64
64
 
65
65
  min-width: 0;
66
- `);var Tt=20,pr=a(({url:r})=>{let[o,n]=useState(1),[a$1,s]=useState(1),i=useRef(false),h=useRef({width:0,height:0}),b=useRef(null),v=useRef(null),P=useCallback(()=>{if(!v.current||h.current.width===0)return 1;let w=v.current.clientWidth-Tt,d=v.current.clientHeight-Tt,{width:E,height:C}=h.current;return Math.min(w/E,d/C,1)},[]);useEffect(()=>{i.current=false,h.current={width:0,height:0},n(1),s(1);},[r]),useEffect(()=>{if(!v.current)return;let w=Vo(()=>{i.current||h.current.width===0||s(P());},150),d=new ResizeObserver(w);return d.observe(v.current),()=>{d.disconnect(),w.cancel();}},[P]);let D=a(()=>{i.current=true,n(w=>Math.min(w+.25,4));},"handleZoomIn"),x=a(()=>{i.current=true,n(w=>Math.max(w-.25,.25));},"handleZoomOut"),N=a(()=>{i.current=false,n(1),s(P());},"handleResetZoom"),z$1=h.current.width>0,t=h.current.width*a$1*o,I=h.current.height*a$1*o;return jsxs("div",{className:"h-full w-full flex flex-col px-6",children:[jsxs("div",{className:"flex justify-center items-stretch py-3 gap-1 border-b border-gray-200 relative mx-2.5",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:x,disabled:o<=.25,className:"bg-white! hover:bg-blue-50!",p:7}),jsxs(pb,{py:8,px:8,className:"flex items-center justify-between gap-1.5 min-w-21 rounded-[5px]! cursor-pointer select-none",onClick:N,children:[jsx(Ya,{color:"text.lighter",style:{fontSize:10},children:"Scale:"}),jsxs(Ya,{children:[Math.round(o*100),"%"]})]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma$1,{style:{width:14,height:14}}),onClick:D,disabled:o>=4,className:"bg-white! hover:bg-blue-50!",p:10})]}),jsx("div",{ref:v,className:"h-full w-full overflow-auto",children:jsx("img",{src:r,ref:b,alt:"image",className:"block object-contain",style:{transition:"width 0.15s ease-in-out, height 0.15s ease-in-out",marginInline:"auto",marginBlock:Tt/2,...z$1&&{width:t,height:I}},onLoad:()=>{b.current&&(h.current={width:b.current.naturalWidth,height:b.current.naturalHeight},s(P()));}})})]})},"ImageDriver");var fr=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full py-5.5 px-8.5",children:jsx("audio",{controls:true,src:r,className:"w-full"})}),"AudioDriver");var Nt=a(({url:r})=>{let[o,n]=useState(null),[a$1,s]=useState(false),[i,h]=useState(true),[b,v]=useState(null);return useEffect(()=>{s(true);},[]),useEffect(()=>{if(!a$1)return;a(async()=>{try{let D=await import('./PdfDriver-ZHGUHQV2.mjs');n(()=>D.PdfDriver),h(!1);}catch(D){console.error("Failed to load PDF driver:",D),v("Failed to load PDF viewer"),h(false);}},"loadPdfDriver")();},[a$1]),a$1?i?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})}):b||!o?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-red-500 text-center",children:jsx("p",{children:b||"PDF viewer unavailable"})})}):jsx(o,{url:r}):jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})})},"PdfDriverWrapper");var br=50,Ko=1e4,yr=a(({url:r,blob:o})=>{let n=useRef(null),a$1=useRef(null),[s,i]=useState(null),[h,b]=useState(true),[v,P]=useState(1),D=useRef(false),[x,N]=useState({width:0,height:0}),z$1=useRef(0),t=a(()=>{D.current=true,P(w=>Math.min(w+.25,4));},"handleZoomIn"),I=a(()=>{D.current=true,P(w=>Math.max(w-.25,.25));},"handleZoomOut");return useEffect(()=>{a(async()=>{if(a$1.current)try{b(!0),i(null);let d=o;if(!d&&r&&(d=await(await fetch(r)).blob()),!d){i("\u041D\u0435 \u043D\u0430\u0434\u0430\u043D\u043E \u0434\u043B\u044F DOCX \u0444\u0430\u0439\u043B\u0443");return}if(d.size/(1024*1024)>br){i(`\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439 (> ${br} \u041C\u0411)`);return}a$1.current.innerHTML="";let C=renderAsync(d,a$1.current,void 0,{debug:!0,experimental:!0,hideWrapperOnPrint:!0,breakPages:!0,ignoreLastRenderedPageBreak:!1}),M=new Promise((H,te)=>setTimeout(()=>te(new Error("\u0420\u0435\u043D\u0434\u0435\u0440\u0438\u043D\u0433 DOCX \u0437\u0430\u0439\u043D\u044F\u0432 \u043D\u0430\u0434\u0442\u043E \u0431\u0430\u0433\u0430\u0442\u043E \u0447\u0430\u0441\u0443")),Ko));await Promise.race([C,M]),await new Promise(H=>requestAnimationFrame(H));let F=a$1.current.querySelector(".docx-wrapper");if(F&&(z$1.current=F.offsetWidth,N({width:F.offsetWidth,height:F.offsetHeight})),n.current&&z$1.current>0){let H=n.current.clientWidth,te=Math.min(H/z$1.current,1);P(te);}b(!1);}catch(d){i(d?.message||"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 DOCX \u0444\u0430\u0439\u043B"),b(false);}},"renderDocument")();},[r,o]),useEffect(()=>{if(!n.current)return;let w=Vo(E=>{if(!(D.current||z$1.current===0))for(let C of E){let M=C.contentRect.width,F=Math.min(M/z$1.current,1);P(F);}},150),d=new ResizeObserver(w);return d.observe(n.current),()=>{d.disconnect(),w.cancel();}},[]),jsxs("div",{className:"h-full w-full flex flex-col px-0.5",children:[jsxs("div",{className:"flex justify-center items-stretch px-8 py-3 gap-1 border-b border-gray-200",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:I,disabled:v<=.25,className:"bg-white! hover:bg-blue-50!",p:7}),jsxs(pb,{py:8,px:8,className:"flex items-center justify-between gap-1.5 min-w-21 rounded-[5px]!",children:[jsx(Ya,{color:"text.lighter",style:{fontSize:10},children:"Scale:"}),jsxs(Ya,{children:[Math.round(v*100),"%"]})]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma$1,{style:{width:14,height:14}}),onClick:t,disabled:v>=4,className:"bg-white! hover:bg-blue-50!",p:10})]}),!!s&&!h&&jsx("div",{className:"text-red-500 p-8",children:s}),h&&jsx("div",{className:"flex items-center justify-center p-8",children:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F..."}),jsx("div",{ref:n,className:"w-full h-full overflow-auto [&::-webkit-scrollbar-thumb]:bg-gray-100 [&::-webkit-scrollbar-track]:bg-[gray]",style:{backgroundColor:"gray",scrollbarGutter:"stable both-edges",scrollbarColor:"#f1f1f1 gray"},children:jsx("div",{style:{width:x.width>0?x.width*v:void 0,height:x.height>0?x.height*v:void 0,overflow:"hidden",margin:"0 auto"},children:jsx("div",{ref:a$1,className:`[&>div.docx-wrapper_table_*]:wrap-break-word!
66
+ `);var Go=[.1,.25,.5,.75,1,1.5,2,3,4,5],Ko=5,Jo=.1,Qo=140;function mt(r,o,n,a){return {x:r<n?(n-r)/2:0,y:o<a?(a-o)/2:0}}a(mt,"computePadding");var gr=a(({url:r,alt:o="image",naturalWidth:n,naturalHeight:a$1,zoomSteps:d=Go,maxZoom:i=Ko,minZoom:h=Jo,showMinimap:x=true,minimapWidth:k=Qo,className:R,onZoomChange:P})=>{let[m,E]=useState("adaptive"),[A,t]=useState(1),[F,S]=useState(false),p=useRef(false),[B,M]=useState(false),[T,$]=useState(false),[Y,ne]=useState({left:0,top:0}),re=useRef(0),[se,ye]=useState({width:0,height:0}),le=useRef({width:0,height:0}),we=useRef(null),ve=useRef(null),q=useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),H=useRef(m),V=useRef(A),W=useRef(P);H.current=m,V.current=A,W.current=P;let Z=n||le.current.width,oe=a$1||le.current.height,ae=useMemo(()=>[...d].sort((y,C)=>y-C),[d]),X=useCallback(()=>se.width===0||Z===0?1:Math.min(se.width/Z,se.height/oe,1),[se,Z,oe]),Q=useCallback((y,C)=>{if(C==="in"){let I=ae.find(j=>j>y+.001);return I!==void 0?Math.min(I,i):y}let _=ae.findLast(I=>I<y-.001);return _!==void 0?Math.max(_,h):y},[ae,i,h]),de=useCallback(()=>H.current==="adaptive"?X():V.current,[X]),ce=useCallback(y=>{E("manual"),t(y),W.current?.(y,"manual");},[]),ue=useCallback(()=>{E("adaptive"),W.current?.(X(),"adaptive");},[X]),Se=useCallback(y=>{requestAnimationFrame(()=>{let C=ve.current;if(!C)return;let _=C.getBoundingClientRect(),I=Z*y,j=oe*y,v=mt(I,j,_.width,_.height);C.scrollLeft=I/2+v.x-_.width/2,C.scrollTop=j/2+v.y-_.height/2;});},[Z,oe]);useEffect(()=>{E("adaptive"),t(1),M(false),$(false),le.current={width:0,height:0};},[r]),useEffect(()=>{let y=ve.current;if(!y)return;let C=new ResizeObserver(_=>{let I=_[0];if(!I)return;let{width:j,height:v}=I.contentRect;ye(O=>O.width===j&&O.height===v?O:{width:j,height:v});});return C.observe(y),()=>C.disconnect()},[]),useEffect(()=>{let y=ve.current;if(!y)return;let C=a(()=>{cancelAnimationFrame(re.current),re.current=requestAnimationFrame(()=>{let _=y.scrollLeft,I=y.scrollTop;ne(j=>j.left===_&&j.top===I?j:{left:_,top:I});});},"handleScroll");return y.addEventListener("scroll",C,{passive:true}),()=>{y.removeEventListener("scroll",C),cancelAnimationFrame(re.current);}},[]),useEffect(()=>{let y=ve.current;if(!y||!B)return;let C=a(_=>{if(!(_.ctrlKey||_.metaKey))return;_.preventDefault();let I=de(),j=_.deltaY>0?"out":"in",v=Q(I,j),O=X();if(j==="out"&&v<=O){ue();return}let L=y.getBoundingClientRect(),G,K,ee=le.current.width||1,ge=le.current.height||1;if(H.current==="adaptive"){let pe=we.current;if(!pe)return;let he=pe.getBoundingClientRect();G=(_.clientX-he.left)/(he.width/ee),K=(_.clientY-he.top)/(he.height/ge);}else {let pe=ee*I,he=ge*I,He=mt(pe,he,L.width,L.height);G=(y.scrollLeft+_.clientX-L.left-He.x)/I,K=(y.scrollTop+_.clientY-L.top-He.y)/I;}ce(v),requestAnimationFrame(()=>{let pe=y.getBoundingClientRect(),he=mt(ee*v,ge*v,pe.width,pe.height);y.scrollLeft=G*v+he.x-(_.clientX-pe.left),y.scrollTop=K*v+he.y-(_.clientY-pe.top);});},"handleWheel");return y.addEventListener("wheel",C,{passive:false}),()=>y.removeEventListener("wheel",C)},[B,de,Q,X,ce,ue]),useEffect(()=>{if(m!=="manual")return;let y=ve.current;if(!y)return;let C=a(j=>{j.button===0&&(j.preventDefault(),p.current=true,S(true),q.current={x:j.clientX,y:j.clientY,scrollLeft:y.scrollLeft,scrollTop:y.scrollTop});},"handleMouseDown"),_=a(j=>{if(!p.current)return;let{x:v,y:O,scrollLeft:L,scrollTop:G}=q.current;y.scrollLeft=L-(j.clientX-v),y.scrollTop=G-(j.clientY-O);},"handleMouseMove"),I=a(()=>{p.current=false,S(false);},"handleMouseUp");return y.addEventListener("mousedown",C),window.addEventListener("mousemove",_),window.addEventListener("mouseup",I),()=>{y.removeEventListener("mousedown",C),window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",I);}},[m]);let _e=useCallback(()=>{m==="manual"&&ue();},[m,ue]),qe=useCallback(()=>{let y=de(),C=Q(y,"in");C!==y&&(ce(C),Se(C));},[de,Q,ce,Se]),Ne=useCallback(()=>{let y=de(),C=Q(y,"out");if(C<=X()){ue();return}ce(C),Se(C);},[de,Q,X,ue,ce,Se]),Be=useCallback(()=>{ce(1),Se(1);},[ce,Se]),Ce=useCallback(()=>{let y=we.current;y&&(le.current={width:y.naturalWidth,height:y.naturalHeight},M(true),$(false));},[]),Pe=m==="adaptive"?X():A,Re=Z*Pe,Ue=oe*Pe,Fe=se.width,et=se.height,Oe=m==="manual"?mt(Re,Ue,Fe,et):{x:0,y:0},Lt=x&&m==="manual"&&(Re>Fe||Ue>et),e=Z>0?k/Z:0,l=oe*e,c=Fe>0?Fe/A*e:0,u=et>0?et/A*e:0,f=Math.max(0,Y.left-Oe.x)/A*e,w=Math.max(0,Y.top-Oe.y)/A*e,g=m==="adaptive"?"Fit":`${Math.round(A*100)}%`,b=Q(Pe,"in")!==Pe,D=m==="manual"||Pe>h,N=m==="adaptive"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{width:Re,height:Ue,maxWidth:"none",maxHeight:"none",marginLeft:Oe.x,marginTop:Oe.y,flexShrink:0},z$1={cursor:m==="manual"?F?"grabbing":"grab":"default"};return jsxs("div",{className:`h-full w-full flex flex-col min-h-0 min-w-0 overflow-hidden ${R??""}`,children:[jsxs("div",{className:"flex w-full items-center py-2 px-3 gap-1 border-b border-gray-200 shrink-0",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa,{style:{width:12,height:12}}),onClick:Ne,disabled:!D,p:8,className:"bg-white! hover:bg-blue-50! h-8!"}),jsx("button",{type:"button",onClick:m==="manual"?ue:void 0,className:"flex items-center justify-center bg-white h-8! min-w-16 px-3 select-none border border-gray-300 rounded-md","aria-label":g,children:jsx(Ya,{style:{fontSize:12,fontWeight:500},children:g})}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma$1,{style:{width:12,height:12}}),onClick:qe,disabled:!b,className:"bg-white! hover:bg-blue-50! h-8!",p:8}),jsx(z,{variant:"outlined","aria-label":"fit-to-container",size:"small",color:m==="adaptive"?"primary":"default",icon:jsx(ra,{style:{width:12,height:12}}),onClick:ue,className:`${m==="adaptive"?"bg-blue-50!":"bg-white! hover:bg-blue-50!"} h-8! ml-auto`,p:8}),jsx(z,{variant:"outlined","aria-label":"original-size",size:"small",color:m==="manual"&&A===1?"primary":"default",onClick:Be,className:`${m==="manual"&&A===1?"bg-blue-50!":"bg-white! hover:bg-blue-50!"} h-8!`,p:8,children:jsx(Ya,{style:{fontSize:12,fontWeight:500,lineHeight:1},children:"1:1"})})]}),jsxs("div",{className:"flex-1 min-h-0 min-w-0 relative",children:[jsx("div",{ref:ve,className:`h-full w-full ${m==="adaptive"?"flex items-center justify-center overflow-hidden":"overflow-auto"}`,style:z$1,onDoubleClick:_e,children:T?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx(Ya,{color:"text.lighter",children:"Failed to load image"})}):jsx("img",{ref:we,src:r,alt:o,draggable:false,className:"block select-none",style:N,onLoad:Ce,onError:()=>$(true)})}),Lt&&jsxs("div",{className:"absolute bottom-3 right-3 rounded-lg overflow-hidden shadow-lg pointer-events-none",style:{width:k,height:l,backdropFilter:"blur(8px)",background:"rgba(255,255,255,0.75)"},children:[jsx("img",{src:r,alt:"",draggable:false,className:"block w-full h-full object-contain"}),jsx("div",{className:"absolute border-2 border-blue-500 rounded-sm",style:{width:Math.min(c,k),height:Math.min(u,l),left:Math.max(0,Math.min(f,k-c)),top:Math.max(0,Math.min(w,l-u)),background:"rgba(59,130,246,0.1)"}})]})]})]})},"ImageDriver");var vr=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full py-5.5 px-8.5",children:jsx("audio",{controls:true,src:r,className:"w-full"})}),"AudioDriver");var zt=a(({url:r})=>{let[o,n]=useState(null),[a$1,d]=useState(false),[i,h]=useState(true),[x,k]=useState(null);return useEffect(()=>{d(true);},[]),useEffect(()=>{if(!a$1)return;a(async()=>{try{let P=await import('./PdfDriver-ZHGUHQV2.mjs');n(()=>P.PdfDriver),h(!1);}catch(P){console.error("Failed to load PDF driver:",P),k("Failed to load PDF viewer"),h(false);}},"loadPdfDriver")();},[a$1]),a$1?i?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})}):x||!o?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-red-500 text-center",children:jsx("p",{children:x||"PDF viewer unavailable"})})}):jsx(o,{url:r}):jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})})},"PdfDriverWrapper");var xr=50,rn=1e4,kr=a(({url:r,blob:o})=>{let n=useRef(null),a$1=useRef(null),[d,i]=useState(null),[h,x]=useState(true),[k,R]=useState(1),P=useRef(false),[m,E]=useState({width:0,height:0}),A=useRef(0),t=a(()=>{P.current=true,R(S=>Math.min(S+.25,4));},"handleZoomIn"),F=a(()=>{P.current=true,R(S=>Math.max(S-.25,.25));},"handleZoomOut");return useEffect(()=>{a(async()=>{if(a$1.current)try{x(!0),i(null);let p=o;if(!p&&r&&(p=await(await fetch(r)).blob()),!p){i("\u041D\u0435 \u043D\u0430\u0434\u0430\u043D\u043E \u0434\u043B\u044F DOCX \u0444\u0430\u0439\u043B\u0443");return}if(p.size/(1024*1024)>xr){i(`\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439 (> ${xr} \u041C\u0411)`);return}a$1.current.innerHTML="";let M=renderAsync(p,a$1.current,void 0,{debug:!0,experimental:!0,hideWrapperOnPrint:!0,breakPages:!0,ignoreLastRenderedPageBreak:!1}),T=new Promise((Y,ne)=>setTimeout(()=>ne(new Error("\u0420\u0435\u043D\u0434\u0435\u0440\u0438\u043D\u0433 DOCX \u0437\u0430\u0439\u043D\u044F\u0432 \u043D\u0430\u0434\u0442\u043E \u0431\u0430\u0433\u0430\u0442\u043E \u0447\u0430\u0441\u0443")),rn));await Promise.race([M,T]),await new Promise(Y=>requestAnimationFrame(Y));let $=a$1.current.querySelector(".docx-wrapper");if($&&(A.current=$.offsetWidth,E({width:$.offsetWidth,height:$.offsetHeight})),n.current&&A.current>0){let Y=n.current.clientWidth,ne=Math.min(Y/A.current,1);R(ne);}x(!1);}catch(p){i(p?.message||"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 DOCX \u0444\u0430\u0439\u043B"),x(false);}},"renderDocument")();},[r,o]),useEffect(()=>{if(!n.current)return;let S=tn(B=>{if(!(P.current||A.current===0))for(let M of B){let T=M.contentRect.width,$=Math.min(T/A.current,1);R($);}},150),p=new ResizeObserver(S);return p.observe(n.current),()=>{p.disconnect(),S.cancel();}},[]),jsxs("div",{className:"h-full w-full flex flex-col px-0.5",children:[jsxs("div",{className:"flex justify-center items-stretch px-8 py-3 gap-1 border-b border-gray-200",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:F,disabled:k<=.25,className:"bg-white! hover:bg-blue-50!",p:7}),jsxs(pb,{py:8,px:8,className:"flex items-center justify-between gap-1.5 min-w-21 rounded-[5px]!",children:[jsx(Ya,{color:"text.lighter",style:{fontSize:10},children:"Scale:"}),jsxs(Ya,{children:[Math.round(k*100),"%"]})]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma$1,{style:{width:14,height:14}}),onClick:t,disabled:k>=4,className:"bg-white! hover:bg-blue-50!",p:10})]}),!!d&&!h&&jsx("div",{className:"text-red-500 p-8",children:d}),h&&jsx("div",{className:"flex items-center justify-center p-8",children:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F..."}),jsx("div",{ref:n,className:"w-full h-full overflow-auto [&::-webkit-scrollbar-thumb]:bg-gray-100 [&::-webkit-scrollbar-track]:bg-[gray]",style:{backgroundColor:"gray",scrollbarGutter:"stable both-edges",scrollbarColor:"#f1f1f1 gray"},children:jsx("div",{style:{width:m.width>0?m.width*k:void 0,height:m.height>0?m.height*k:void 0,overflow:"hidden",margin:"0 auto"},children:jsx("div",{ref:a$1,className:`[&>div.docx-wrapper_table_*]:wrap-break-word!
67
67
  [&>div.docx-wrapper_table]:table-fixed!
68
68
  [&>div.docx-wrapper_table_td]:w-fit!
69
69
  [&>div.docx-wrapper_table_col]:w-fit!
@@ -79,11 +79,11 @@ ${r?`
79
79
  [&>div.docx-wrapper]:box-border
80
80
  [&>div.docx-wrapper]:min-w-fit!
81
81
  [&>div.docx-wrapper]:w-full!
82
- [&>div.docx-wrapper]:min-h-full`,style:{boxSizing:"border-box",wordBreak:"break-word",overflowWrap:"break-word",transform:`scale(${v})`,transformOrigin:"top left"}})})})]})},"DocxDriver");var pn=a(r=>({js:[javascript({jsx:false})],jsx:[javascript({jsx:true})],ts:[javascript({typescript:true,jsx:false})],tsx:[javascript({typescript:true,jsx:true})],json:[json()],html:[html()],css:[css()],scss:[css()],py:[python()],java:[java()],cpp:[cpp()],c:[cpp()],php:[php()],rs:[rust()],xml:[xml()],yaml:[yaml()],yml:[yaml()],md:[markdown()],sql:[sql()],sh:[markdown()],bash:[markdown()]})[r]||[],"getLanguageExtension"),Sr=a(({url:r,extension:o})=>{let[n,a$1]=useState(""),[s,i]=useState(true),[h,b]=useState(null),[v,P]=useState(0),D=useRef(null);if(useEffect(()=>{a(async()=>{try{i(!0),b(null);let t=await fetch(r);if(!t.ok)throw new Error(`Failed to load file: ${t.statusText}`);let I=await t.text();if(o==="json")try{I=JSON.stringify(JSON.parse(I),null,2);}catch{}a$1(I);}catch(t){b(t instanceof Error?t.message:"Failed to load text content");}finally{i(false);}},"loadTextContent")();},[r]),useEffect(()=>{let z=a(()=>{if(D.current){let t=D.current.clientHeight;P(t);}},"updateHeight");return z(),window.addEventListener("resize",z),()=>{window.removeEventListener("resize",z);}},[s]),s)return jsx("div",{className:"flex items-center justify-center p-8.5",children:jsx("div",{className:"text-gray-500",children:"Loading text content..."})});if(h)return jsx("div",{className:"flex items-center justify-center p-8.5",children:jsxs("div",{className:"text-red-500",children:["Error: ",h]})});if(o==="md")return jsx("div",{ref:D,className:"h-full w-full overflow-auto p-5 prose max-w-[100%] select-text prose-table px-8.5",style:{wordBreak:"break-word"},children:jsx(dn,{remarkPlugins:[un],children:n})});let N=pn(o);return jsx("div",{ref:D,className:"h-full w-full",children:v>0&&jsx(Qo,{value:n,theme:vscodeLight,extensions:N,editable:false,height:`${v}px`,basicSetup:{lineNumbers:true,highlightActiveLineGutter:false,highlightActiveLine:false,foldGutter:true,dropCursor:false,indentOnInput:false,syntaxHighlighting:true,bracketMatching:true,closeBrackets:false,autocompletion:false,rectangularSelection:false,crosshairCursor:false,highlightSelectionMatches:false,closeBracketsKeymap:false,searchKeymap:false,foldKeymap:true,completionKeymap:false,lintKeymap:false}})})},"TextDriver");var Cr=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full px-8.5",children:jsx("video",{controls:true,src:r,className:"w-full max-h-full"})}),"VideoDriver");var gt=class{static{a(this,"LruChunkCache");}cache=new Map;pinned=new Set;maxSize;constructor(o=8){this.maxSize=o;}get(o){let n=this.cache.get(o);return n!==void 0&&(this.cache.delete(o),this.cache.set(o,n)),n}set(o,n){if(this.cache.delete(o),this.cache.size>=this.maxSize){for(let a of this.cache.keys())if(!this.pinned.has(a)){this.cache.delete(a);break}}this.cache.set(o,n);}pin(o){this.pinned.clear();for(let n of o)this.pinned.add(n);this.pinned.size>this.maxSize&&(this.maxSize=this.pinned.size+4);}clear(){this.cache.clear(),this.pinned.clear();}};var Ee="chunks",It=class{static{a(this,"IndexedDBStore");}db;sessionId;dbName;constructor(o,n,a){this.db=o,this.sessionId=n,this.dbName=a;}async set(o,n){return new Promise((a,s)=>{let i=this.db.transaction(Ee,"readwrite");i.objectStore(Ee).put(n,o),i.oncomplete=()=>a(),i.onerror=()=>s(i.error);})}async get(o){return new Promise((n,a)=>{let i=this.db.transaction(Ee,"readonly").objectStore(Ee).get(o);i.onsuccess=()=>n(i.result??void 0),i.onerror=()=>a(i.error);})}async clear(){return new Promise((o,n)=>{let a=this.db.transaction(Ee,"readwrite");a.objectStore(Ee).clear(),a.oncomplete=()=>o(),a.onerror=()=>n(a.error);})}async destroy(){return this.db.close(),new Promise((o,n)=>{let a=indexedDB.deleteDatabase(this.dbName);a.onsuccess=()=>o(),a.onerror=()=>n(a.error),a.onblocked=()=>o();})}},Et=class{static{a(this,"MemoryStore");}sessionId=null;chunks=new Map;async set(o,n){this.chunks.set(o,n);}async get(o){return this.chunks.get(o)}async clear(){this.chunks.clear();}async destroy(){this.chunks.clear();}};async function Pr(){let r=`${Date.now()}_${Math.random().toString(36).slice(2)}`,o=`csv-chunks-${r}`;try{let n=await new Promise((a,s)=>{let i=indexedDB.open(o,1);i.onupgradeneeded=()=>{let h=i.result;h.objectStoreNames.contains(Ee)||h.createObjectStore(Ee);},i.onsuccess=()=>a(i.result),i.onerror=()=>s(i.error);});return new It(n,r,o)}catch{return console.warn("IndexedDB unavailable, falling back to in-memory storage"),new Et}}a(Pr,"createChunkStore");function bn(r){let o=[],n=false,a=0,s=0;for(let i=0;i<r.length;i++){let h=r[i];if(h==='"')n=!n;else if(!n&&(h===`
82
+ [&>div.docx-wrapper]:min-h-full`,style:{boxSizing:"border-box",wordBreak:"break-word",overflowWrap:"break-word",transform:`scale(${k})`,transformOrigin:"top left"}})})})]})},"DocxDriver");var bn=a(r=>({js:[javascript({jsx:false})],jsx:[javascript({jsx:true})],ts:[javascript({typescript:true,jsx:false})],tsx:[javascript({typescript:true,jsx:true})],json:[json()],html:[html()],css:[css()],scss:[css()],py:[python()],java:[java()],cpp:[cpp()],c:[cpp()],php:[php()],rs:[rust()],xml:[xml()],yaml:[yaml()],yml:[yaml()],md:[markdown()],sql:[sql()],sh:[markdown()],bash:[markdown()]})[r]||[],"getLanguageExtension"),Mr=a(({url:r,extension:o})=>{let[n,a$1]=useState(""),[d,i]=useState(true),[h,x]=useState(null),[k,R]=useState(0),P=useRef(null);if(useEffect(()=>{a(async()=>{try{i(!0),x(null);let t=await fetch(r);if(!t.ok)throw new Error(`Failed to load file: ${t.statusText}`);let F=await t.text();if(o==="json")try{F=JSON.stringify(JSON.parse(F),null,2);}catch{}a$1(F);}catch(t){x(t instanceof Error?t.message:"Failed to load text content");}finally{i(false);}},"loadTextContent")();},[r]),useEffect(()=>{let A=a(()=>{if(P.current){let t=P.current.clientHeight;R(t);}},"updateHeight");return A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A);}},[d]),d)return jsx("div",{className:"flex items-center justify-center p-8.5",children:jsx("div",{className:"text-gray-500",children:"Loading text content..."})});if(h)return jsx("div",{className:"flex items-center justify-center p-8.5",children:jsxs("div",{className:"text-red-500",children:["Error: ",h]})});if(o==="md")return jsx("div",{ref:P,className:"h-full w-full overflow-auto p-5 prose max-w-[100%] select-text prose-table px-8.5",style:{wordBreak:"break-word"},children:jsx(mn,{remarkPlugins:[gn],children:n})});let E=bn(o);return jsx("div",{ref:P,className:"h-full w-full",children:k>0&&jsx(nn,{value:n,theme:vscodeLight,extensions:E,editable:false,height:`${k}px`,basicSetup:{lineNumbers:true,highlightActiveLineGutter:false,highlightActiveLine:false,foldGutter:true,dropCursor:false,indentOnInput:false,syntaxHighlighting:true,bracketMatching:true,closeBrackets:false,autocompletion:false,rectangularSelection:false,crosshairCursor:false,highlightSelectionMatches:false,closeBracketsKeymap:false,searchKeymap:false,foldKeymap:true,completionKeymap:false,lintKeymap:false}})})},"TextDriver");var Nr=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full px-8.5",children:jsx("video",{controls:true,src:r,className:"w-full max-h-full"})}),"VideoDriver");var St=class{static{a(this,"LruChunkCache");}cache=new Map;pinned=new Set;maxSize;constructor(o=8){this.maxSize=o;}get(o){let n=this.cache.get(o);return n!==void 0&&(this.cache.delete(o),this.cache.set(o,n)),n}set(o,n){if(this.cache.delete(o),this.cache.size>=this.maxSize){for(let a of this.cache.keys())if(!this.pinned.has(a)){this.cache.delete(a);break}}this.cache.set(o,n);}pin(o){this.pinned.clear();for(let n of o)this.pinned.add(n);this.pinned.size>this.maxSize&&(this.maxSize=this.pinned.size+4);}clear(){this.cache.clear(),this.pinned.clear();}};var Ye="chunks",At=class{static{a(this,"IndexedDBStore");}db;sessionId;dbName;constructor(o,n,a){this.db=o,this.sessionId=n,this.dbName=a;}async set(o,n){return new Promise((a,d)=>{let i=this.db.transaction(Ye,"readwrite");i.objectStore(Ye).put(n,o),i.oncomplete=()=>a(),i.onerror=()=>d(i.error);})}async get(o){return new Promise((n,a)=>{let i=this.db.transaction(Ye,"readonly").objectStore(Ye).get(o);i.onsuccess=()=>n(i.result??void 0),i.onerror=()=>a(i.error);})}async clear(){return new Promise((o,n)=>{let a=this.db.transaction(Ye,"readwrite");a.objectStore(Ye).clear(),a.oncomplete=()=>o(),a.onerror=()=>n(a.error);})}async destroy(){return this.db.close(),new Promise((o,n)=>{let a=indexedDB.deleteDatabase(this.dbName);a.onsuccess=()=>o(),a.onerror=()=>n(a.error),a.onblocked=()=>o();})}},jt=class{static{a(this,"MemoryStore");}sessionId=null;chunks=new Map;async set(o,n){this.chunks.set(o,n);}async get(o){return this.chunks.get(o)}async clear(){this.chunks.clear();}async destroy(){this.chunks.clear();}};async function Rr(){let r=`${Date.now()}_${Math.random().toString(36).slice(2)}`,o=`csv-chunks-${r}`;try{let n=await new Promise((a,d)=>{let i=indexedDB.open(o,1);i.onupgradeneeded=()=>{let h=i.result;h.objectStoreNames.contains(Ye)||h.createObjectStore(Ye);},i.onsuccess=()=>a(i.result),i.onerror=()=>d(i.error);});return new At(n,r,o)}catch{return console.warn("IndexedDB unavailable, falling back to in-memory storage"),new jt}}a(Rr,"createChunkStore");function kn(r){let o=[],n=false,a=0,d=0;for(let i=0;i<r.length;i++){let h=r[i];if(h==='"')n=!n;else if(!n&&(h===`
83
83
  `||h==="\r"&&r[i+1]!==`
84
- `)){let b=i,v=r.slice(a,b).replace(/\r$/,"");v&&o.push(v),a=i+1,s=i+1;}}return [o,r.slice(s)]}a(bn,"splitCsvRows");function yn(r,o){return r.stream?Promise.resolve(r.stream):r.blob?Promise.resolve(r.blob.stream()):r.url?fetch(r.url,{signal:o}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.body}):Promise.reject(new Error("No source provided"))}a(yn,"resolveStream");function Tr(r){let[o,n]=useState("idle"),[a,s]=useState(0),[i,h]=useState([]),[b,v]=useState(null),[P,D]=useState(0),[x,N]=useState(0),z=useRef(r),t=useRef(0),I=useRef(0),w=useRef(""),d=useRef(new gt(10)),E=useRef(null),C=useRef(null),M=useRef(new Set),F=useRef(null),H=useRef(false),te=useCallback((_,Y)=>{let j=_+`
85
- `+Y.join(`
86
- `),{data:K}=Lt.parse(j,{header:true,dynamicTyping:false,skipEmptyLines:true});return K},[]),re=useCallback(async(_,Y)=>{let j=E.current;if(!j)return;let K=Math.max(0,Math.floor(_/1e3)-2),se=Math.min(t.current-1,Math.floor(Y/1e3)+2),ae=false;for(let Z=K;Z<=se;Z++)if(d.current.get(Z)===void 0&&!M.current.has(Z)){M.current.add(Z);try{let oe=await j.get(Z);if(oe&&w.current){let be=te(w.current,oe);d.current.set(Z,be),ae=!0;}}finally{M.current.delete(Z);}}ae&&N(Z=>Z+1);},[te]),pe=useCallback(_=>{let Y=Math.floor(_/1e3),j=_%1e3;return d.current.get(Y)?.[j]},[x]),he=useCallback(async()=>{H.current=true;let _=new AbortController;C.current=_,await E.current?.destroy();let Y=await Pr();E.current=Y,t.current=0,I.current=0,w.current="",d.current.clear(),h([]),s(0),v(null),D(0),n("loading");let j=z.current;try{let K=await yn(j,_.signal);n("streaming");let se=K.getReader(),ae=new TextDecoder("utf-8"),Z="",oe=[],be=!0,De=0,Te=0,Ye=j.blob?.size||0;for(;;){if(_.signal.aborted)return;let{done:Le,value:Ue}=await se.read();if(Le)break;De+=Ue.byteLength,Ye&&D(De/Ye),Z+=ae.decode(Ue,{stream:!0});let[Ne,$e]=bn(Z);if(Ne.length!==0){if(Z=$e,be&&Ne.length>0){w.current=Ne.shift().replace(/^\uFEFF/,"");let{data:Ce}=Lt.parse(w.current,{});Ce[0]&&h(Ce[0]),be=!1;}for(let Ce of Ne)if(Ce.trim()&&(oe.push(Ce),oe.length>=1e3)){let Ve=t.current;if(await Y.set(Ve,oe),Ve<3){let We=te(w.current,oe);d.current.set(Ve,We);}t.current+=1,Te+=oe.length,oe=[],I.current=Te,F.current||(F.current=requestAnimationFrame(()=>{s(I.current),F.current=null;}));}}}if(Z.trim())if(be){w.current=Z;let{data:Le}=Lt.parse(w.current,{});Le[0]&&h(Le[0]);}else oe.push(Z);oe.length>0&&(await Y.set(t.current,oe),t.current+=1,Te+=oe.length),F.current&&(cancelAnimationFrame(F.current),F.current=null),s(Te),D(1),n("done");}catch(K){if(_.signal.aborted)return;let se=K instanceof Error?K.message:"Unknown error";v(se),n("partial_error");}finally{H.current=false;}},[te]),me=useRef(false);useEffect(()=>(me.current=true,H.current||he(),()=>{me.current=false,queueMicrotask(()=>{me.current||(C.current?.abort(),E.current?.destroy(),F.current&&cancelAnimationFrame(F.current));});}),[he]);let Se=E.current?.sessionId??null,Me=t.current,$=useCallback(_=>{d.current.pin(_);},[]);return {state:o,headers:i,totalRows:a,getRow:pe,error:b,progress:P,prefetchRange:re,sessionId:Se,chunkCount:Me,pinChunks:$}}a(Tr,"useCsvStream");var vn=`
84
+ `)){let x=i,k=r.slice(a,x).replace(/\r$/,"");k&&o.push(k),a=i+1,d=i+1;}}return [o,r.slice(d)]}a(kn,"splitCsvRows");function Sn(r,o){return r.stream?Promise.resolve(r.stream):r.blob?Promise.resolve(r.blob.stream()):r.url?fetch(r.url,{signal:o}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.body}):Promise.reject(new Error("No source provided"))}a(Sn,"resolveStream");function Lr(r){let[o,n]=useState("idle"),[a,d]=useState(0),[i,h]=useState([]),[x,k]=useState(null),[R,P]=useState(0),[m,E]=useState(0),A=useRef(r),t=useRef(0),F=useRef(0),S=useRef(""),p=useRef(new St(10)),B=useRef(null),M=useRef(null),T=useRef(new Set),$=useRef(null),Y=useRef(false),ne=useCallback((H,V)=>{let W=H+`
85
+ `+V.join(`
86
+ `),{data:Z}=Bt.parse(W,{header:true,dynamicTyping:false,skipEmptyLines:true});return Z},[]),re=useCallback(async(H,V)=>{let W=B.current;if(!W)return;let Z=Math.max(0,Math.floor(H/1e3)-2),oe=Math.min(t.current-1,Math.floor(V/1e3)+2),ae=false;for(let X=Z;X<=oe;X++)if(p.current.get(X)===void 0&&!T.current.has(X)){T.current.add(X);try{let Q=await W.get(X);if(Q&&S.current){let de=ne(S.current,Q);p.current.set(X,de),ae=!0;}}finally{T.current.delete(X);}}ae&&E(X=>X+1);},[ne]),se=useCallback(H=>{let V=Math.floor(H/1e3),W=H%1e3;return p.current.get(V)?.[W]},[m]),ye=useCallback(async()=>{Y.current=true;let H=new AbortController;M.current=H,await B.current?.destroy();let V=await Rr();B.current=V,t.current=0,F.current=0,S.current="",p.current.clear(),h([]),d(0),k(null),P(0),n("loading");let W=A.current;try{let Z=await Sn(W,H.signal);n("streaming");let oe=Z.getReader(),ae=new TextDecoder("utf-8"),X="",Q=[],de=!0,ce=0,ue=0,Se=W.blob?.size||0;for(;;){if(H.signal.aborted)return;let{done:_e,value:qe}=await oe.read();if(_e)break;ce+=qe.byteLength,Se&&P(ce/Se),X+=ae.decode(qe,{stream:!0});let[Ne,Be]=kn(X);if(Ne.length!==0){if(X=Be,de&&Ne.length>0){S.current=Ne.shift().replace(/^\uFEFF/,"");let{data:Ce}=Bt.parse(S.current,{});Ce[0]&&h(Ce[0]),de=!1;}for(let Ce of Ne)if(Ce.trim()&&(Q.push(Ce),Q.length>=1e3)){let Pe=t.current;if(await V.set(Pe,Q),Pe<3){let Re=ne(S.current,Q);p.current.set(Pe,Re);}t.current+=1,ue+=Q.length,Q=[],F.current=ue,$.current||($.current=requestAnimationFrame(()=>{d(F.current),$.current=null;}));}}}if(X.trim())if(de){S.current=X;let{data:_e}=Bt.parse(S.current,{});_e[0]&&h(_e[0]);}else Q.push(X);Q.length>0&&(await V.set(t.current,Q),t.current+=1,ue+=Q.length),$.current&&(cancelAnimationFrame($.current),$.current=null),d(ue),P(1),n("done");}catch(Z){if(H.signal.aborted)return;let oe=Z instanceof Error?Z.message:"Unknown error";k(oe),n("partial_error");}finally{Y.current=false;}},[ne]),le=useRef(false);useEffect(()=>(le.current=true,Y.current||ye(),()=>{le.current=false,queueMicrotask(()=>{le.current||(M.current?.abort(),B.current?.destroy(),$.current&&cancelAnimationFrame($.current));});}),[ye]);let we=B.current?.sessionId??null,ve=t.current,q=useCallback(H=>{p.current.pin(H);},[]);return {state:o,headers:i,totalRows:a,getRow:se,error:x,progress:R,prefetchRange:re,sessionId:we,chunkCount:ve,pinChunks:q}}a(Lr,"useCsvStream");var Dn=`
87
87
  const DB_VERSION = 1;
88
88
  const STORE_NAME = 'chunks';
89
89
 
@@ -169,16 +169,16 @@ self.onmessage = async (e) => {
169
169
  }
170
170
  }
171
171
  };
172
- `,Je=null,Qe=null;function zt(){if(!Je){let r=new Blob([vn],{type:"application/javascript"});Qe=URL.createObjectURL(r),Je=new Worker(Qe);}return Je}a(zt,"getSearchWorker");function Nr(){Je?.terminate(),Je=null,Qe&&(URL.revokeObjectURL(Qe),Qe=null);}a(Nr,"terminateSearchWorker");function Rr(r,o){let[n,a]=useState(""),[s,i]=useState("idle"),[h,b]=useState(null),[v,P]=useState({searched:0,total:0,found:0}),D=useRef(null),x=useCallback(t=>{if(!r||o===0)return;if(!t.trim()){b(null),i("idle"),P({searched:0,total:0,found:0});return}i("searching"),P({searched:0,total:o,found:0});let I=zt();I.onmessage=w=>{let{type:d}=w.data;d==="progress"&&P({searched:w.data.searched,total:w.data.total,found:w.data.found}),d==="done"&&(b(w.data.matchedIndices),i("done")),d==="cancelled"&&i("idle"),d==="error"&&(i("idle"),console.error("Search worker error:",w.data.message));},I.postMessage({type:"cancel"}),I.postMessage({type:"search",sessionId:r,query:t,chunkCount:o,chunkSize:1e3});},[r,o]),N=useCallback(t=>{a(t),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{x(t);},300);},[x]),z=useCallback(()=>{a(""),b(null),i("idle"),P({searched:0,total:0,found:0}),zt().postMessage({type:"cancel"});},[]);return useEffect(()=>()=>{D.current&&clearTimeout(D.current),Nr();},[]),{query:n,onQueryChange:N,clearSearch:z,searchState:s,matchedIndices:h,searchProgress:v}}a(Rr,"useCsvSearch");var Tn={loading:"Loading...",rows:"rows",retry:"Retry",searchPlaceholder:"Search...",searchFound:"found",searching:"Searching..."};function Nn(r,o,n){let a=1/0,s=-1/0,i=Math.min(n,r.length-1);for(let h=o;h<=i;h++){let b=r[h];b<a&&(a=b),b>s&&(s=b);}return {min:a,max:s}}a(Nn,"getMinMax");function Rn(r,o,n){let a=Math.min(100,n),s=r.map(()=>[]);for(let i=0;i<a;i++){let h=o(i);if(h)for(let b=0;b<r.length;b++){let v=h[r[b]]??"";s[b].push(v.length);}}return r.map((i,h)=>{let b=i.length*9,v=s[h];if(v.length===0)return Math.min(Math.max(150,b+24),800);v.sort((z,t)=>z-t);let P=Math.floor(v.length*.9),x=v[P]*7.5+24,N=Math.max(b+24,x);return Math.min(Math.max(50,N),800)})}a(Rn,"estimateColumnWidths");var jt=a(r=>{let{state:o,headers:n,totalRows:a$1,getRow:s,error:i,progress:h,prefetchRange:b,sessionId:v,chunkCount:P,pinChunks:D}=Tr(r),x={...Tn,...r.labels},{query:N,onQueryChange:z$1,clearSearch:t,searchState:I,matchedIndices:w}=Rr(v,P),d=w!==null,E=d?w.length:a$1,[C,M]=useState([]),F=useRef(null),H=useRef(null),te=useRef(false),re=useRef(false);useEffect(()=>{re.current=false,te.current=false,M([]);},[v]),useEffect(()=>{if(n.length===0||te.current||re.current||a$1===0)return;let $=s(0);!$||!n.some(_=>$[_]!==void 0)||(re.current=true,M(Rn(n,s,a$1)));},[n,a$1,s]),useEffect(()=>()=>H.current?.(),[]);let pe=useCallback(($,_)=>{$.preventDefault(),te.current=true;let Y=$.clientX,j=C[_]??150;F.current={index:_,startX:Y,startWidth:j};let K=a(ae=>{if(!F.current)return;let Z=ae.clientX-Y,oe=Math.max(50,j+Z);M(be=>{let De=[...be];return De[_]=oe,De});},"onMouseMove"),se=a(()=>{F.current=null,H.current=null,document.removeEventListener("mousemove",K),document.removeEventListener("mouseup",se);},"onMouseUp");H.current=se,document.addEventListener("mousemove",K),document.addEventListener("mouseup",se);},[C]),he=C.reduce(($,_)=>$+_,0),me=useCallback(()=>jsx(Ln,{children:n.map(($,_)=>jsxs(zn,{style:{width:C[_]},children:[$,jsx(_n,{onMouseDown:Y=>pe(Y,_)})]},_))}),[n,C,pe]),Se=useCallback($=>{if(d&&w){let _=1/0,Y=-1/0,j=new Set,K=Math.min($.endIndex,w.length-1);for(let se=$.startIndex;se<=K;se++){let ae=w[se];ae<_&&(_=ae),ae>Y&&(Y=ae),j.add(Math.floor(ae/1e3));}D(Array.from(j)),_!==1/0&&b(_,Y);}else D([]),b($.startIndex,$.endIndex);},[b,D,d,w]),Me=useCallback($=>{let _=d&&w?w[$]:$,Y=s(_);return Y?n.map((j,K)=>jsx(Lr,{style:{width:C[K]},children:Y[j]??""},K)):n.map((j,K)=>jsx(Lr,{style:{width:C[K]},children:jsx(Bn,{})},K))},[s,n,C,d,w]);return useEffect(()=>{if(E>0)if(d&&w){let{min:$,max:_}=Nn(w,0,50);$!==1/0&&b($,_);}else b(0,50);},[E,d,w,b]),o==="idle"||o==="loading"||o==="streaming"?jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[jsx("div",{className:"h-10 w-10 rounded-full border-2 border-gray-200 animate-spin border-s-transparent"}),o==="streaming"&&a$1>0&&jsxs(Ya,{variant:"body",color:"text.lighter",style:{fontSize:12},children:[x.loading," ",a$1.toLocaleString()," ",x.rows,h>0?` (${Math.round(h*100)}%)`:""]})]}):jsxs("div",{className:"h-full w-full flex flex-col",children:[jsxs("div",{className:"flex items-center justify-between px-4 py-2 gap-3",children:[jsx(Ya,{variant:"body",color:"text.lighter",style:{fontSize:12,whiteSpace:"nowrap"},children:`${E.toLocaleString()} ${d?x.searchFound:x.rows}${d?` / ${a$1.toLocaleString()}`:""}`}),jsxs(On,{children:[jsx(Fn,{type:"text",value:N,onChange:$=>z$1($.target.value),placeholder:x.searchPlaceholder}),I==="searching"?jsx($n,{children:jsx(Xn,{})}):N?jsx(Hn,{onClick:t,type:"button",children:"\u2715"}):null]})]}),o==="partial_error"&&jsxs(pb,{className:"flex items-center justify-between mx-4 mb-2 px-3 py-2 rounded bg-red-50 border border-red-200",children:[jsx(Ya,{variant:"body",style:{fontSize:12,color:"#dc2626"},children:i}),r.onRetry&&jsx(z,{onClick:()=>r.onRetry(i??""),variant:"outlined",size:"small",children:x.retry})]}),jsx("div",{className:"flex-1 min-h-0",children:n.length>0&&jsx(TableVirtuoso,{totalCount:E,increaseViewportBy:300,fixedHeaderContent:me,itemContent:Me,rangeChanged:Se,style:{height:"100%"},components:{Table:a(({style:$,context:_,...Y})=>jsx(In,{style:{...$,minWidth:"100%",width:he},...Y}),"Table"),TableHead:En,TableRow:a(({context:$,..._})=>jsx(An,{..._}),"TableRow")}},d?"filtered":"all")})]})},"CsvDriver"),In=styled.table(({theme:r})=>`
172
+ `,it=null,st=null;function Ft(){if(!it){let r=new Blob([Dn],{type:"application/javascript"});st=URL.createObjectURL(r),it=new Worker(st);}return it}a(Ft,"getSearchWorker");function Ir(){it?.terminate(),it=null,st&&(URL.revokeObjectURL(st),st=null);}a(Ir,"terminateSearchWorker");function zr(r,o){let[n,a]=useState(""),[d,i]=useState("idle"),[h,x]=useState(null),[k,R]=useState({searched:0,total:0,found:0}),P=useRef(null),m=useCallback(t=>{if(!r||o===0)return;if(!t.trim()){x(null),i("idle"),R({searched:0,total:0,found:0});return}i("searching"),R({searched:0,total:o,found:0});let F=Ft();F.onmessage=S=>{let{type:p}=S.data;p==="progress"&&R({searched:S.data.searched,total:S.data.total,found:S.data.found}),p==="done"&&(x(S.data.matchedIndices),i("done")),p==="cancelled"&&i("idle"),p==="error"&&(i("idle"),console.error("Search worker error:",S.data.message));},F.postMessage({type:"cancel"}),F.postMessage({type:"search",sessionId:r,query:t,chunkCount:o,chunkSize:1e3});},[r,o]),E=useCallback(t=>{a(t),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{m(t);},300);},[m]),A=useCallback(()=>{a(""),x(null),i("idle"),R({searched:0,total:0,found:0}),Ft().postMessage({type:"cancel"});},[]);return useEffect(()=>()=>{P.current&&clearTimeout(P.current),Ir();},[]),{query:n,onQueryChange:E,clearSearch:A,searchState:d,matchedIndices:h,searchProgress:k}}a(zr,"useCsvSearch");var In={loading:"Loading...",rows:"rows",retry:"Retry",searchPlaceholder:"Search...",searchFound:"found",searching:"Searching..."};function zn(r,o,n){let a=1/0,d=-1/0,i=Math.min(n,r.length-1);for(let h=o;h<=i;h++){let x=r[h];x<a&&(a=x),x>d&&(d=x);}return {min:a,max:d}}a(zn,"getMinMax");function _n(r,o,n){let a=Math.min(100,n),d=r.map(()=>[]);for(let i=0;i<a;i++){let h=o(i);if(h)for(let x=0;x<r.length;x++){let k=h[r[x]]??"";d[x].push(k.length);}}return r.map((i,h)=>{let x=i.length*9,k=d[h];if(k.length===0)return Math.min(Math.max(150,x+24),800);k.sort((A,t)=>A-t);let R=Math.floor(k.length*.9),m=k[R]*7.5+24,E=Math.max(x+24,m);return Math.min(Math.max(50,E),800)})}a(_n,"estimateColumnWidths");var Wt=a(r=>{let{state:o,headers:n,totalRows:a$1,getRow:d,error:i,progress:h,prefetchRange:x,sessionId:k,chunkCount:R,pinChunks:P}=Lr(r),m={...In,...r.labels},{query:E,onQueryChange:A,clearSearch:t,searchState:F,matchedIndices:S}=zr(k,R),p=S!==null,B=p?S.length:a$1,[M,T]=useState([]),$=useRef(null),Y=useRef(null),ne=useRef(false),re=useRef(false);useEffect(()=>{re.current=false,ne.current=false,T([]);},[k]),useEffect(()=>{if(n.length===0||ne.current||re.current||a$1===0)return;let q=d(0);!q||!n.some(H=>q[H]!==void 0)||(re.current=true,T(_n(n,d,a$1)));},[n,a$1,d]),useEffect(()=>()=>Y.current?.(),[]);let se=useCallback((q,H)=>{q.preventDefault(),ne.current=true;let V=q.clientX,W=M[H]??150;$.current={index:H,startX:V,startWidth:W};let Z=a(ae=>{if(!$.current)return;let X=ae.clientX-V,Q=Math.max(50,W+X);T(de=>{let ce=[...de];return ce[H]=Q,ce});},"onMouseMove"),oe=a(()=>{$.current=null,Y.current=null,document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",oe);},"onMouseUp");Y.current=oe,document.addEventListener("mousemove",Z),document.addEventListener("mouseup",oe);},[M]),ye=M.reduce((q,H)=>q+H,0),le=useCallback(()=>jsx(Bn,{children:n.map((q,H)=>jsxs(Fn,{style:{width:M[H]},children:[q,jsx(On,{onMouseDown:V=>se(V,H)})]},H))}),[n,M,se]),we=useCallback(q=>{if(p&&S){let H=1/0,V=-1/0,W=new Set,Z=Math.min(q.endIndex,S.length-1);for(let oe=q.startIndex;oe<=Z;oe++){let ae=S[oe];ae<H&&(H=ae),ae>V&&(V=ae),W.add(Math.floor(ae/1e3));}P(Array.from(W)),H!==1/0&&x(H,V);}else P([]),x(q.startIndex,q.endIndex);},[x,P,p,S]),ve=useCallback(q=>{let H=p&&S?S[q]:q,V=d(H);return V?n.map((W,Z)=>jsx(jr,{style:{width:M[Z]},children:V[W]??""},Z)):n.map((W,Z)=>jsx(jr,{style:{width:M[Z]},children:jsx($n,{})},Z))},[d,n,M,p,S]);return useEffect(()=>{if(B>0)if(p&&S){let{min:q,max:H}=zn(S,0,50);q!==1/0&&x(q,H);}else x(0,50);},[B,p,S,x]),o==="idle"||o==="loading"||o==="streaming"?jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[jsx("div",{className:"h-10 w-10 rounded-full border-2 border-gray-200 animate-spin border-s-transparent"}),o==="streaming"&&a$1>0&&jsxs(Ya,{variant:"body",color:"text.lighter",style:{fontSize:12},children:[m.loading," ",a$1.toLocaleString()," ",m.rows,h>0?` (${Math.round(h*100)}%)`:""]})]}):jsxs("div",{className:"h-full w-full flex flex-col",children:[jsxs("div",{className:"flex items-center justify-between px-4 py-2 gap-3",children:[jsx(Ya,{variant:"body",color:"text.lighter",style:{fontSize:12,whiteSpace:"nowrap"},children:`${B.toLocaleString()} ${p?m.searchFound:m.rows}${p?` / ${a$1.toLocaleString()}`:""}`}),jsxs(Xn,{children:[jsx(Yn,{type:"text",value:E,onChange:q=>A(q.target.value),placeholder:m.searchPlaceholder}),F==="searching"?jsx(Un,{children:jsx(Vn,{})}):E?jsx(qn,{onClick:t,type:"button",children:"\u2715"}):null]})]}),o==="partial_error"&&jsxs(pb,{className:"flex items-center justify-between mx-4 mb-2 px-3 py-2 rounded bg-red-50 border border-red-200",children:[jsx(Ya,{variant:"body",style:{fontSize:12,color:"#dc2626"},children:i}),r.onRetry&&jsx(z,{onClick:()=>r.onRetry(i??""),variant:"outlined",size:"small",children:m.retry})]}),jsx("div",{className:"flex-1 min-h-0",children:n.length>0&&jsx(TableVirtuoso,{totalCount:B,increaseViewportBy:300,fixedHeaderContent:le,itemContent:ve,rangeChanged:we,style:{height:"100%"},components:{Table:a(({style:q,context:H,...V})=>jsx(An,{style:{...q,minWidth:"100%",width:ye},...V}),"Table"),TableHead:jn,TableRow:a(({context:q,...H})=>jsx(Hn,{...H}),"TableRow")}},p?"filtered":"all")})]})},"CsvDriver"),An=styled.table(({theme:r})=>`
173
173
  border-collapse: separate;
174
174
  border-spacing: 0;
175
175
  table-layout: fixed;
176
176
  font-size: 13px;
177
177
  background-color: ${r.colors.background};
178
- `),En=styled.thead(({theme:r})=>`
178
+ `),jn=styled.thead(({theme:r})=>`
179
179
  background-color: ${r.colors.background};
180
180
  z-index: 1;
181
- `),Ln=styled.tr``,zn=styled.th(({theme:r})=>`
181
+ `),Bn=styled.tr``,Fn=styled.th(({theme:r})=>`
182
182
  position: relative;
183
183
  text-align: left;
184
184
  padding: 8px 12px;
@@ -193,7 +193,7 @@ self.onmessage = async (e) => {
193
193
  &:last-child {
194
194
  border-right: none;
195
195
  }
196
- `),_n=styled.div(({theme:r})=>`
196
+ `),On=styled.div(({theme:r})=>`
197
197
  position: absolute;
198
198
  right: 0;
199
199
  top: 0;
@@ -205,11 +205,11 @@ self.onmessage = async (e) => {
205
205
  background-color: ${r.colors.primary?.light};
206
206
  opacity: 0.4;
207
207
  }
208
- `),An=styled.tr(({theme:r})=>`
208
+ `),Hn=styled.tr(({theme:r})=>`
209
209
  &:hover {
210
210
  background-color: ${r.colors.backgroundBase};
211
211
  }
212
- `),Lr=styled.td(({theme:r})=>`
212
+ `),jr=styled.td(({theme:r})=>`
213
213
  padding: 6px 12px;
214
214
  word-wrap: break-word;
215
215
  overflow-wrap: break-word;
@@ -219,20 +219,20 @@ self.onmessage = async (e) => {
219
219
  &:last-child {
220
220
  border-right: none;
221
221
  }
222
- `),jn=keyframes`
222
+ `),Wn=keyframes`
223
223
  0%, 100% { opacity: 0.4; }
224
224
  50% { opacity: 1; }
225
- `,Bn=styled.div(({theme:r})=>css$1`
225
+ `,$n=styled.div(({theme:r})=>css$1`
226
226
  height: 12px;
227
227
  width: 60%;
228
228
  background: ${r.colors.stroke.light};
229
229
  border-radius: 4px;
230
- animation: ${jn} 1.5s ease-in-out infinite;
231
- `),On=styled.div`
230
+ animation: ${Wn} 1.5s ease-in-out infinite;
231
+ `),Xn=styled.div`
232
232
  position: relative;
233
233
  width: 200px;
234
234
  flex-shrink: 0;
235
- `,Fn=styled.input(({theme:r})=>`
235
+ `,Yn=styled.input(({theme:r})=>`
236
236
  padding: 4px 24px 4px 8px;
237
237
  font-size: 12px;
238
238
  border: 1px solid ${r.colors.stroke.light};
@@ -242,7 +242,7 @@ self.onmessage = async (e) => {
242
242
  &:focus {
243
243
  border-color: ${r.colors.primary?.main};
244
244
  }
245
- `),Hn=styled.button(({theme:r})=>`
245
+ `),qn=styled.button(({theme:r})=>`
246
246
  position: absolute;
247
247
  right: 6px;
248
248
  top: 50%;
@@ -257,23 +257,23 @@ self.onmessage = async (e) => {
257
257
  &:hover {
258
258
  color: ${r.colors.text?.main};
259
259
  }
260
- `),$n=styled.div`
260
+ `),Un=styled.div`
261
261
  position: absolute;
262
262
  right: 6px;
263
263
  top: 50%;
264
264
  transform: translateY(-50%);
265
265
  display: flex;
266
266
  align-items: center;
267
- `,Wn=keyframes`
267
+ `,Zn=keyframes`
268
268
  to { transform: rotate(360deg); }
269
- `,Xn=styled.div(({theme:r})=>css$1`
269
+ `,Vn=styled.div(({theme:r})=>css$1`
270
270
  width: 14px;
271
271
  height: 14px;
272
272
  border: 2px solid ${r.colors.stroke.light};
273
273
  border-top-color: ${r.colors.text?.light};
274
274
  border-radius: 50%;
275
- animation: ${Wn} 0.6s linear infinite;
276
- `);var Br=memo(a(function({extension:o,blob:n,path:a,buffer:s,stream:i,csvLabels:h,onCsvRetry:b,not_supported_message:v=" Sorry, this file type isn\u2019t supported yet."}){let P=o.toLocaleLowerCase().trim(),D;if(a?D=a:n&&(D=URL.createObjectURL(n)),["csv","tsv"].includes(P))return jsx(jt,{url:D,blob:n,stream:i,labels:h,onRetry:b});if(D){if(["jpeg","jpg","png","gif","bmp","webp"].includes(P))return jsx(pr,{url:D});if(["mp3","wav","ogg","flac"].includes(P))return jsx(fr,{url:D});if(["mp4","webm"].includes(P))return jsx(Cr,{url:D});if(o==="pdf")return jsx(Nt,{url:D});if(["txt","js","jsx","ts","tsx","json","html","css","scss","py","java","cpp","c","cs","php","rb","go","rs","swift","kt","xml","yaml","yml","md","sql","sh","bash"].includes(P))return jsx(Sr,{url:D,extension:P})}return P==="docx"?jsx(yr,{url:D,blob:n}):jsx("div",{className:"h-full flex flex-col justify-center items-center",children:jsx(pb,{className:"mx-5",children:jsx(Ya,{variant:"h2",color:"text.light",weight:500,className:"text-center",children:v})})})},"Driver"));var Bd=a(r=>jsx("div",{className:"h-full w-full",children:jsx(Br,{...r})}),"FileViewer");var Hr=250,Zd=a(({text:r,speed:o=50,onDone:n,markdown:a$1=false,markdownComponents:s={},className:i,...h})=>{let[b,v]=useState(""),P=useRef(null),D=useRef(null);return useEffect(()=>{let x=false;if(o>0){v(""),P.current=performance.now();let N=a(z=>{if(x||!P.current)return;let t=z-P.current,I=t/o>Hr?o/2:o,w=t/o>Hr?1.5:1,d=Math.floor(t/I*w);if(d>=r.length){v(r),x=true,n?.();return}v(r.slice(0,d)),D.current=requestAnimationFrame(N);},"tick");D.current=requestAnimationFrame(N);}else v(r),n?.();return ()=>{D.current&&cancelAnimationFrame(D.current);}},[r,o,n]),a$1?jsx("div",{className:i,children:jsx(dn,{remarkPlugins:[un],components:s,...h,children:b})}):jsx(Ya,{className:i,...h,children:b})},"Typewriter");var ta={timeout:2e3,message:"Copied!"},cu=a(({text:r,children:o,format:n="text/plain",tooltip:a$1,positions:s=["top"],className:i})=>{let[h,b]=useState(false),v=useRef(null),P={...ta,...a$1},D=Array.isArray(s)?s[0]:s,x=a(async()=>{"clipboard"in navigator?await navigator.clipboard.writeText(r):Zn(r,{format:n}),b(true),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>b(false),P.timeout);},"handleCopy");return useEffect(()=>()=>{v.current&&clearTimeout(v.current);},[]),jsx(Popover,{padding:6,positions:s,isOpen:h,align:"center",onClickOutside:()=>b(false),content:!!a$1?.message&&jsx(Cb,{className:i,$position:D,$offset:6,children:a$1.message}),containerStyle:{zIndex:"9999"},children:jsx("div",{className:"inline-block",onMouseLeave:()=>b(false),children:o({copy:x})})})},"CopyToClipboard");var Wr=a(r=>new Date(r?Array.isArray(r)?r[1]||r[0]||new Date:r:new Date),"getInitValue"),St=a((r,o)=>{let n;if(o){let s=parse(r||"",o,new Date);if(isValid(s)&&getYear(s)>=1970)return s}let a=new Date(r||"");return isNaN(a.getTime())?n:a},"parseDate"),da=a((r,o)=>{let n=r?St(r,o):void 0;return n&&o?format(n,o):r},"renderDate"),xu=a(({value:r,range:o,inline:n=false,minDate:a=new Date(getYear(new Date)-5,0,1),maxDate:s=new Date(getYear(new Date)+5,11,31),format:i="dd.MM.yyyy",onChange:h,...b})=>{let[v,P]=useState(getMonth(Wr(r))),[D,x]=useState(getYear(Wr(r))),N=useMemo(()=>{if(r){if(Array.isArray(r)){let t=St(r[0],i),I=St(r[1],i);return [t,I]}return St(r,i)}},[r]),z=useCallback(t=>{if(o){let I=!!(N&&Array.isArray(N)&&N[0]),w=!!(N&&Array.isArray(N)&&N[1]);!I||I&&w?h?.([t.toString(),""]):I&&!w&&(t<N[0]?h?.([t.toString(),N[0].toString()]):h?.([N[0].toString(),t.toString()]));}else h?.(t.toString());},[o,N,h]);return n?jsx(Xr,{month:v,year:D,minDate:a,maxDate:s,selectedDate:N,onSelectDate:z,onChangeMonth:P,onChangeYear:x}):o?jsx(ua,{range:true,value:r,onChange:h,...b}):jsx(pa,{value:r,onChange:h,minDate:a,maxDate:s,month:v,year:D,selectedDate:N,onChangeMonth:P,onChangeYear:x,onSelectDate:z,formatStr:i,...b})},"DatePicker"),ua=a(({minDate:r,maxDate:o,value:n,onChange:a})=>null,"DatePickerGroupInput"),pa=a(({placeholder:r,value:o,onChange:n,inputProps:a,...s})=>{let[i,h]=useState(false),b=y();return jsx(Popover,{positions:["bottom","top","right","left"],align:"start",isOpen:i,onClickOutside:()=>h(false),content:jsx(pb,{children:jsx(Xr,{...s})}),containerStyle:{zIndex:`${b.zIndex.popover}`},children:jsx("div",{onClick:()=>h(true),children:jsx(kb,{...a,placeholder:r,value:da(o,s.formatStr),onChange:v=>n?.(v.target.value)})})})},"DatePickerInput"),Xr=a(({month:r,year:o,selectedDate:n,minDate:a,maxDate:s,onSelectDate:i,onChangeMonth:h,onChangeYear:b})=>{let v=useMemo(()=>new Array(12).fill(null).map((d,E)=>{let C=new Date(0,E);return {value:E+1,inputDisplay:format(C,"MMMM")}}),[]),P=useMemo(()=>{let d=getYear(a),C=getYear(s)-d+1;return new Array(C).fill(null).map((M,F)=>{let H=d+F;return {value:H,inputDisplay:H.toString()}})},[a,s]),D=useMemo(()=>new Array(7).fill(null).map((d,E)=>{let C=startOfWeek(new Date,{weekStartsOn:E});return format(C,"EEE")}),[]),x=useMemo(()=>{let d=startOfMonth(new Date(o,r)),E=endOfMonth(new Date(o,r)),C=getDay(d)===0?d:previousSunday(d),M=getDay(E)===6?E:nextSaturday(E),F=differenceInDays(M,C),H=differenceInDays(d,C);return new Array(F+1).fill(null).map((te,re)=>new Date(o,r,re-H+1))},[r,o]),N=useCallback(()=>{r===0?(b(o-1),h(11)):h(r-1);},[r,o]),z$1=useCallback(()=>{r===11?(b(o+1),h(0)):h(r+1);},[r,o]),t=useMemo(()=>a?!(o<getYear(a)||o===getYear(a)&&r<=getMonth(a)):true,[r,o,a]),I=useMemo(()=>s?!(o>getYear(s)||o===getYear(s)&&r>=getMonth(s)):true,[r,o,s]),w=useCallback(d=>{d.stopPropagation();},[]);return jsxs("div",{className:"flex flex-col date-picker-calendar",onClick:w,children:[jsxs("div",{className:"flex justify-center items-center gap-2 pb-3",children:[t&&jsx(z,{size:"small",variant:"empty",icon:jsx(G,{}),onClick:N}),jsxs("div",{className:"flex-1 flex justify-center gap-1",children:[jsx(ib,{placeholder:"",hasBorder:false,selected:r+1,options:v,onSelect:d=>h(d-1),maxWidth:150,maxHeight:300}),jsx(ib,{placeholder:"",hasBorder:false,selected:o,options:P,onSelect:d=>b(d),maxWidth:100,maxHeight:300})]}),I&&jsx(z,{size:"small",variant:"empty",icon:jsx(H,{}),onClick:z$1})]}),jsx("div",{className:"grid grid-cols-7 gap-2",children:D.map(d=>jsx("div",{className:"text-center",children:d},d))}),jsx("div",{className:"grid grid-cols-7 gap-2 mt-2",children:x.map(d=>{let E=getMonth(d)===r,C=format(d,"yyyy-MM-dd")===format(new Date,"yyyy-MM-dd"),M=n&&(Array.isArray(n)&&(n[0]&&format(d,"yyyy-MM-dd")===format(n[0],"yyyy-MM-dd")||n[1]&&format(d,"yyyy-MM-dd")===format(n[1],"yyyy-MM-dd"))||!Array.isArray(n)&&format(d,"yyyy-MM-dd")===format(n,"yyyy-MM-dd")),F=n&&Array.isArray(n)&&n[0]&&n[1]&&d>n[0]&&d<n[1],H=a&&differenceInDays(d,a)<0||s&&differenceInDays(d,s)>0||!E;return jsx(ha,{date:d,isCurrentMonth:E,isCurrentDay:C,isSelected:!!M,isInRange:!!F,isDisabled:!!H,onSelectDate:i},d.toISOString())})})]})},"DatePickerCalendar"),ha=a(({date:r,isCurrentMonth:o,isCurrentDay:n,isSelected:a$1,isInRange:s,isDisabled:i,onSelectDate:h})=>jsx("div",{className:`text-center p-2 cursor-pointer rounded ${i?"text-gray-400 cursor-not-allowed":a$1?"bg-blue-500 text-white":s?"bg-blue-100":n?"text-blue-500":o?"text-black":"text-gray-400"} ${i?"":a$1?"hover:bg-blue-600":"hover:bg-gray-100"}`,onClick:a(v=>{i||h(r);},"handleClick"),children:format(r,"d")}),"CalendarDay");var ma=a(r=>{switch(r){case "primary":return "bg-blue-100 border-blue-200 dark:bg-blue-800/10 dark:border-blue-900";case "error":return "bg-red-100 border-red-200 dark:bg-red-800/10 dark:border-red-900";case "warning":return "bg-yellow-100 border-yellow-200 dark:bg-yellow-800/10 dark:border-yellow-900";case "success":return "bg-teal-100 border-teal-200 dark:bg-teal-800/10 dark:border-teal-900";case "default":default:return "bg-white border border-gray-200 dark:bg-neutral-800 dark:border-neutral-700"}},"getColorStyle"),ba=a(r=>{switch(r){case "primary":return "text-blue-800 dark:text-blue-500";case "error":return "text-red-800 dark:text-red-500";case "warning":return "text-yellow-800 dark:text-yellow-500";case "success":return "text-teal-800 dark:text-teal-500";case "default":default:return "text-gray-800 dark:text-white"}},"getTextColor"),ya=a(r=>{switch(r){case "bottom":return "translate-y-4";case "top":default:return "-translate-y-4"}},"getTransitionStarting"),Vr=a(({id:r,color:o="default",message:n,duration:a,transitionDirection:s,cancelable:i=true,onClose:h})=>{let[b,v]=useState(false),[P,D]=useState(false),x=useRef(null),N=useCallback(()=>{v(true),x.current=setTimeout(()=>{h(r);},300);},[r,h]);return useEffect(()=>{if(D(true),a&&a<1/0){let z=setTimeout(()=>{N();},a);return ()=>clearTimeout(z)}},[a,N]),useEffect(()=>()=>{x.current&&clearTimeout(x.current);},[]),jsx("div",{className:`max-w-xs
275
+ animation: ${Zn} 0.6s linear infinite;
276
+ `);var Wr=memo(a(function({extension:o,blob:n,path:a,buffer:d,stream:i,csvLabels:h,onCsvRetry:x,not_supported_message:k=" Sorry, this file type isn\u2019t supported yet."}){let R=o.toLocaleLowerCase().trim(),P;if(a?P=a:n&&(P=URL.createObjectURL(n)),["csv","tsv"].includes(R))return jsx(Wt,{url:P,blob:n,stream:i,labels:h,onRetry:x});if(P){if(["jpeg","jpg","png","gif","bmp","webp"].includes(R))return jsx(gr,{url:P});if(["mp3","wav","ogg","flac"].includes(R))return jsx(vr,{url:P});if(["mp4","webm"].includes(R))return jsx(Nr,{url:P});if(o==="pdf")return jsx(zt,{url:P});if(["txt","js","jsx","ts","tsx","json","html","css","scss","py","java","cpp","c","cs","php","rb","go","rs","swift","kt","xml","yaml","yml","md","sql","sh","bash"].includes(R))return jsx(Mr,{url:P,extension:R})}return R==="docx"?jsx(kr,{url:P,blob:n}):jsx("div",{className:"h-full flex flex-col justify-center items-center",children:jsx(pb,{className:"mx-5",children:jsx(Ya,{variant:"h2",color:"text.light",weight:500,className:"text-center",children:k})})})},"Driver"));var Hd=a(r=>jsx("div",{className:"h-full w-full",children:jsx(Wr,{...r})}),"FileViewer");var Yr=250,Qd=a(({text:r,speed:o=50,onDone:n,markdown:a$1=false,markdownComponents:d={},className:i,...h})=>{let[x,k]=useState(""),R=useRef(null),P=useRef(null);return useEffect(()=>{let m=false;if(o>0){k(""),R.current=performance.now();let E=a(A=>{if(m||!R.current)return;let t=A-R.current,F=t/o>Yr?o/2:o,S=t/o>Yr?1.5:1,p=Math.floor(t/F*S);if(p>=r.length){k(r),m=true,n?.();return}k(r.slice(0,p)),P.current=requestAnimationFrame(E);},"tick");P.current=requestAnimationFrame(E);}else k(r),n?.();return ()=>{P.current&&cancelAnimationFrame(P.current);}},[r,o,n]),a$1?jsx("div",{className:i,children:jsx(mn,{remarkPlugins:[gn],components:d,...h,children:x})}):jsx(Ya,{className:i,...h,children:x})},"Typewriter");var ia={timeout:2e3,message:"Copied!"},uu=a(({text:r,children:o,format:n="text/plain",tooltip:a$1,positions:d=["top"],className:i})=>{let[h,x]=useState(false),k=useRef(null),R={...ia,...a$1},P=Array.isArray(d)?d[0]:d,m=a(async()=>{"clipboard"in navigator?await navigator.clipboard.writeText(r):ta(r,{format:n}),x(true),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>x(false),R.timeout);},"handleCopy");return useEffect(()=>()=>{k.current&&clearTimeout(k.current);},[]),jsx(Popover,{padding:6,positions:d,isOpen:h,align:"center",onClickOutside:()=>x(false),content:!!a$1?.message&&jsx(Cb,{className:i,$position:P,$offset:6,children:a$1.message}),containerStyle:{zIndex:"9999"},children:jsx("div",{className:"inline-block",onMouseLeave:()=>x(false),children:o({copy:m})})})},"CopyToClipboard");var Ur=a(r=>new Date(r?Array.isArray(r)?r[1]||r[0]||new Date:r:new Date),"getInitValue"),Et=a((r,o)=>{let n;if(o){let d=parse(r||"",o,new Date);if(isValid(d)&&getYear(d)>=1970)return d}let a=new Date(r||"");return isNaN(a.getTime())?n:a},"parseDate"),ma=a((r,o)=>{let n=r?Et(r,o):void 0;return n&&o?format(n,o):r},"renderDate"),Du=a(({value:r,range:o,inline:n=false,minDate:a=new Date(getYear(new Date)-5,0,1),maxDate:d=new Date(getYear(new Date)+5,11,31),format:i="dd.MM.yyyy",onChange:h,...x})=>{let[k,R]=useState(getMonth(Ur(r))),[P,m]=useState(getYear(Ur(r))),E=useMemo(()=>{if(r){if(Array.isArray(r)){let t=Et(r[0],i),F=Et(r[1],i);return [t,F]}return Et(r,i)}},[r]),A=useCallback(t=>{if(o){let F=!!(E&&Array.isArray(E)&&E[0]),S=!!(E&&Array.isArray(E)&&E[1]);!F||F&&S?h?.([t.toString(),""]):F&&!S&&(t<E[0]?h?.([t.toString(),E[0].toString()]):h?.([E[0].toString(),t.toString()]));}else h?.(t.toString());},[o,E,h]);return n?jsx(Zr,{month:k,year:P,minDate:a,maxDate:d,selectedDate:E,onSelectDate:A,onChangeMonth:R,onChangeYear:m}):o?jsx(ga,{range:true,value:r,onChange:h,...x}):jsx(ba,{value:r,onChange:h,minDate:a,maxDate:d,month:k,year:P,selectedDate:E,onChangeMonth:R,onChangeYear:m,onSelectDate:A,formatStr:i,...x})},"DatePicker"),ga=a(({minDate:r,maxDate:o,value:n,onChange:a})=>null,"DatePickerGroupInput"),ba=a(({placeholder:r,value:o,onChange:n,inputProps:a,...d})=>{let[i,h]=useState(false),x=y();return jsx(Popover,{positions:["bottom","top","right","left"],align:"start",isOpen:i,onClickOutside:()=>h(false),content:jsx(pb,{children:jsx(Zr,{...d})}),containerStyle:{zIndex:`${x.zIndex.popover}`},children:jsx("div",{onClick:()=>h(true),children:jsx(kb,{...a,placeholder:r,value:ma(o,d.formatStr),onChange:k=>n?.(k.target.value)})})})},"DatePickerInput"),Zr=a(({month:r,year:o,selectedDate:n,minDate:a,maxDate:d,onSelectDate:i,onChangeMonth:h,onChangeYear:x})=>{let k=useMemo(()=>new Array(12).fill(null).map((p,B)=>{let M=new Date(0,B);return {value:B+1,inputDisplay:format(M,"MMMM")}}),[]),R=useMemo(()=>{let p=getYear(a),M=getYear(d)-p+1;return new Array(M).fill(null).map((T,$)=>{let Y=p+$;return {value:Y,inputDisplay:Y.toString()}})},[a,d]),P=useMemo(()=>new Array(7).fill(null).map((p,B)=>{let M=startOfWeek(new Date,{weekStartsOn:B});return format(M,"EEE")}),[]),m=useMemo(()=>{let p=startOfMonth(new Date(o,r)),B=endOfMonth(new Date(o,r)),M=getDay(p)===0?p:previousSunday(p),T=getDay(B)===6?B:nextSaturday(B),$=differenceInDays(T,M),Y=differenceInDays(p,M);return new Array($+1).fill(null).map((ne,re)=>new Date(o,r,re-Y+1))},[r,o]),E=useCallback(()=>{r===0?(x(o-1),h(11)):h(r-1);},[r,o]),A=useCallback(()=>{r===11?(x(o+1),h(0)):h(r+1);},[r,o]),t=useMemo(()=>a?!(o<getYear(a)||o===getYear(a)&&r<=getMonth(a)):true,[r,o,a]),F=useMemo(()=>d?!(o>getYear(d)||o===getYear(d)&&r>=getMonth(d)):true,[r,o,d]),S=useCallback(p=>{p.stopPropagation();},[]);return jsxs("div",{className:"flex flex-col date-picker-calendar",onClick:S,children:[jsxs("div",{className:"flex justify-center items-center gap-2 pb-3",children:[t&&jsx(z,{size:"small",variant:"empty",icon:jsx(G,{}),onClick:E}),jsxs("div",{className:"flex-1 flex justify-center gap-1",children:[jsx(ib,{placeholder:"",hasBorder:false,selected:r+1,options:k,onSelect:p=>h(p-1),maxWidth:150,maxHeight:300}),jsx(ib,{placeholder:"",hasBorder:false,selected:o,options:R,onSelect:p=>x(p),maxWidth:100,maxHeight:300})]}),F&&jsx(z,{size:"small",variant:"empty",icon:jsx(H,{}),onClick:A})]}),jsx("div",{className:"grid grid-cols-7 gap-2",children:P.map(p=>jsx("div",{className:"text-center",children:p},p))}),jsx("div",{className:"grid grid-cols-7 gap-2 mt-2",children:m.map(p=>{let B=getMonth(p)===r,M=format(p,"yyyy-MM-dd")===format(new Date,"yyyy-MM-dd"),T=n&&(Array.isArray(n)&&(n[0]&&format(p,"yyyy-MM-dd")===format(n[0],"yyyy-MM-dd")||n[1]&&format(p,"yyyy-MM-dd")===format(n[1],"yyyy-MM-dd"))||!Array.isArray(n)&&format(p,"yyyy-MM-dd")===format(n,"yyyy-MM-dd")),$=n&&Array.isArray(n)&&n[0]&&n[1]&&p>n[0]&&p<n[1],Y=a&&differenceInDays(p,a)<0||d&&differenceInDays(p,d)>0||!B;return jsx(va,{date:p,isCurrentMonth:B,isCurrentDay:M,isSelected:!!T,isInRange:!!$,isDisabled:!!Y,onSelectDate:i},p.toISOString())})})]})},"DatePickerCalendar"),va=a(({date:r,isCurrentMonth:o,isCurrentDay:n,isSelected:a$1,isInRange:d,isDisabled:i,onSelectDate:h})=>jsx("div",{className:`text-center p-2 cursor-pointer rounded ${i?"text-gray-400 cursor-not-allowed":a$1?"bg-blue-500 text-white":d?"bg-blue-100":n?"text-blue-500":o?"text-black":"text-gray-400"} ${i?"":a$1?"hover:bg-blue-600":"hover:bg-gray-100"}`,onClick:a(k=>{i||h(r);},"handleClick"),children:format(r,"d")}),"CalendarDay");var xa=a(r=>{switch(r){case "primary":return "bg-blue-100 border-blue-200 dark:bg-blue-800/10 dark:border-blue-900";case "error":return "bg-red-100 border-red-200 dark:bg-red-800/10 dark:border-red-900";case "warning":return "bg-yellow-100 border-yellow-200 dark:bg-yellow-800/10 dark:border-yellow-900";case "success":return "bg-teal-100 border-teal-200 dark:bg-teal-800/10 dark:border-teal-900";case "default":default:return "bg-white border border-gray-200 dark:bg-neutral-800 dark:border-neutral-700"}},"getColorStyle"),ka=a(r=>{switch(r){case "primary":return "text-blue-800 dark:text-blue-500";case "error":return "text-red-800 dark:text-red-500";case "warning":return "text-yellow-800 dark:text-yellow-500";case "success":return "text-teal-800 dark:text-teal-500";case "default":default:return "text-gray-800 dark:text-white"}},"getTextColor"),Sa=a(r=>{switch(r){case "bottom":return "translate-y-4";case "top":default:return "-translate-y-4"}},"getTransitionStarting"),Jr=a(({id:r,color:o="default",message:n,duration:a,transitionDirection:d,cancelable:i=true,onClose:h})=>{let[x,k]=useState(false),[R,P]=useState(false),m=useRef(null),E=useCallback(()=>{k(true),m.current=setTimeout(()=>{h(r);},300);},[r,h]);return useEffect(()=>{if(P(true),a&&a<1/0){let A=setTimeout(()=>{E();},a);return ()=>clearTimeout(A)}},[a,E]),useEffect(()=>()=>{m.current&&clearTimeout(m.current);},[]),jsx("div",{className:`max-w-xs
277
277
  border
278
278
  w-full
279
279
  text-sm
@@ -281,8 +281,8 @@ self.onmessage = async (e) => {
281
281
  transition-all
282
282
  ease-in-out
283
283
  duration-300
284
- ${b||!P?"opacity-0":"opacity-100"}
285
- ${P?"translate-y-0":ya(s)}
286
- ${ma(o)} ${ba(o)}`,children:jsxs("div",{className:"flex p-4",style:{wordBreak:"break-word"},children:[n,i&&jsx("div",{className:"ms-auto",children:jsx("button",{type:"button",className:"inline-flex shrink-0 justify-center items-center size-5 rounded-lg opacity-50 hover:opacity-100 focus:outline-hidden focus:opacity-100 cursor-pointer","aria-label":"Close",onClick:N,children:jsxs("svg",{className:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M18 6 6 18"}),jsx("path",{d:"m6 6 12 12"})]})})})]})})},"Toast");var wa=a((r,o)=>{switch(r){case "top-right":return `top-${o} right-${o}`;case "top-left":return `top-${o} left-${o}`;case "bottom-right":return `bottom-${o} right-${o}`;case "bottom-left":return `bottom-${o} left-${o}`;default:return `top-${o} right-${o}`}},"getPosition"),zu=a(({items:r,onClose:o,position:n="top-right",offset:a=4})=>{let s=useMemo(()=>n.startsWith("top")?"top":"bottom",[n]);return jsx("div",{className:`fixed flex min-w-0 max-w-xs w-full flex-col z-50 gap-2 ${wa(n,a)}`,children:r.map(i=>jsx(Vr,{transitionDirection:s,...i,onClose:o},i.id))})},"ToastsList");var Xu=a(({onChange:r,disabled:o,multiple:n,dragText:a$1="Drop file to upload",className:s})=>{let[i,h]=useState(false),[b,v]=useState(false),[P,D]=useState(false);return useEffect(()=>{if(o)return;let x=0,N=a(w=>{w.preventDefault(),x++,x===1&&h(true);},"handleDragEnter"),z=a(w=>{w.preventDefault(),x--,x===0&&h(false);},"handleDragLeave"),t=a(w=>{w.preventDefault();},"handleDragOver"),I=a(async w=>{if(w.preventDefault(),x=0,h(false),!b)try{v(!0);let d=await lb(w.dataTransfer.items);r(n?d:d.length>0?[d[0]]:[]);}catch(d){console.error("\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0447\u0438\u0442\u0430\u043D\u043D\u0456 \u0444\u0430\u0439\u043B\u0456\u0432:",d);}finally{v(false);}},"handleDrop");return document.addEventListener("dragenter",N),document.addEventListener("dragleave",z),document.addEventListener("dragover",t),document.addEventListener("drop",I),()=>{document.removeEventListener("dragenter",N),document.removeEventListener("dragleave",z),document.removeEventListener("dragover",t),document.removeEventListener("drop",I);}},[o,b,n,r]),useEffect(()=>{D(true);},[]),P&&i?createPortal(jsx("div",{className:`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-[rgba(251,250,250,0.9)] z-9999 ${s}`,children:jsx(Ya,{variant:"h3",className:"px-3 py-2 bg-white rounded-md border border-gray-200",children:a$1})}),document.body):null},"GlobalDropZone");
287
- export{pc as Container,cu as CopyToClipboard,xu as DatePicker,Xr as DatePickerCalendar,Bd as FileViewer,Gc as FullscreenCard,Xu as GlobalDropZone,Fo as Graph2D,Zs as PageContent,qs as PageLayout,yc as SplitterLayout,so as Styled,to as StyledContainer,no as StyledMain,tc as SubNav,zu as ToastsList,Zd as Typewriter};//# sourceMappingURL=index.mjs.map
284
+ ${x||!R?"opacity-0":"opacity-100"}
285
+ ${R?"translate-y-0":Sa(d)}
286
+ ${xa(o)} ${ka(o)}`,children:jsxs("div",{className:"flex p-4",style:{wordBreak:"break-word"},children:[n,i&&jsx("div",{className:"ms-auto",children:jsx("button",{type:"button",className:"inline-flex shrink-0 justify-center items-center size-5 rounded-lg opacity-50 hover:opacity-100 focus:outline-hidden focus:opacity-100 cursor-pointer","aria-label":"Close",onClick:E,children:jsxs("svg",{className:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M18 6 6 18"}),jsx("path",{d:"m6 6 12 12"})]})})})]})})},"Toast");var Ca=a((r,o)=>{switch(r){case "top-right":return `top-${o} right-${o}`;case "top-left":return `top-${o} left-${o}`;case "bottom-right":return `bottom-${o} right-${o}`;case "bottom-left":return `bottom-${o} left-${o}`;default:return `top-${o} right-${o}`}},"getPosition"),ju=a(({items:r,onClose:o,position:n="top-right",offset:a=4})=>{let d=useMemo(()=>n.startsWith("top")?"top":"bottom",[n]);return jsx("div",{className:`fixed flex min-w-0 max-w-xs w-full flex-col z-50 gap-2 ${Ca(n,a)}`,children:r.map(i=>jsx(Jr,{transitionDirection:d,...i,onClose:o},i.id))})},"ToastsList");var Uu=a(({onChange:r,disabled:o,multiple:n,dragText:a$1="Drop file to upload",className:d})=>{let[i,h]=useState(false),[x,k]=useState(false),[R,P]=useState(false);return useEffect(()=>{if(o)return;let m=0,E=a(S=>{S.preventDefault(),m++,m===1&&h(true);},"handleDragEnter"),A=a(S=>{S.preventDefault(),m--,m===0&&h(false);},"handleDragLeave"),t=a(S=>{S.preventDefault();},"handleDragOver"),F=a(async S=>{if(S.preventDefault(),m=0,h(false),!x)try{k(!0);let p=await lb(S.dataTransfer.items);r(n?p:p.length>0?[p[0]]:[]);}catch(p){console.error("\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0447\u0438\u0442\u0430\u043D\u043D\u0456 \u0444\u0430\u0439\u043B\u0456\u0432:",p);}finally{k(false);}},"handleDrop");return document.addEventListener("dragenter",E),document.addEventListener("dragleave",A),document.addEventListener("dragover",t),document.addEventListener("drop",F),()=>{document.removeEventListener("dragenter",E),document.removeEventListener("dragleave",A),document.removeEventListener("dragover",t),document.removeEventListener("drop",F);}},[o,x,n,r]),useEffect(()=>{P(true);},[]),R&&i?createPortal(jsx("div",{className:`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-[rgba(251,250,250,0.9)] z-9999 ${d}`,children:jsx(Ya,{variant:"h3",className:"px-3 py-2 bg-white rounded-md border border-gray-200",children:a$1})}),document.body):null},"GlobalDropZone");
287
+ export{gc as Container,uu as CopyToClipboard,Du as DatePicker,Zr as DatePickerCalendar,Hd as FileViewer,Qc as FullscreenCard,Uu as GlobalDropZone,Wo as Graph2D,ec as PageContent,Vs as PageLayout,kc as SplitterLayout,lo as Styled,oo as StyledContainer,io as StyledMain,ac as SubNav,ju as ToastsList,Qd as Typewriter};//# sourceMappingURL=index.mjs.map
288
288
  //# sourceMappingURL=index.mjs.map