@jacshuo/onyx 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/Chart/BarChart.cjs +1 -1
  2. package/dist/Chart/BarChart.js +1 -1
  3. package/dist/Chart/LineChart.cjs +1 -1
  4. package/dist/Chart/LineChart.js +1 -1
  5. package/dist/Chart/PieChart.cjs +1 -1
  6. package/dist/Chart/PieChart.js +1 -1
  7. package/dist/Chart/ScatterChart.cjs +1 -1
  8. package/dist/Chart/ScatterChart.js +1 -1
  9. package/dist/Chart/index.cjs +1 -1
  10. package/dist/Chart/index.js +1 -1
  11. package/dist/DataDisplay/CodeBlock.cjs +2 -2
  12. package/dist/DataDisplay/CodeBlock.js +2 -2
  13. package/dist/DataDisplay/List.cjs +1 -1
  14. package/dist/DataDisplay/List.js +1 -1
  15. package/dist/DataDisplay/MetricCard.cjs +1 -0
  16. package/dist/DataDisplay/MetricCard.d.cts +3 -0
  17. package/dist/DataDisplay/MetricCard.d.ts +3 -0
  18. package/dist/DataDisplay/MetricCard.js +1 -0
  19. package/dist/DataDisplay/Stat.cjs +1 -0
  20. package/dist/DataDisplay/Stat.d.cts +3 -0
  21. package/dist/DataDisplay/Stat.d.ts +3 -0
  22. package/dist/DataDisplay/Stat.js +1 -0
  23. package/dist/DataDisplay/Table.cjs +1 -1
  24. package/dist/DataDisplay/Table.js +1 -1
  25. package/dist/DataDisplay/Tree.cjs +1 -1
  26. package/dist/DataDisplay/Tree.js +1 -1
  27. package/dist/DataDisplay/index.cjs +2 -2
  28. package/dist/DataDisplay/index.d.cts +6 -0
  29. package/dist/DataDisplay/index.d.ts +6 -0
  30. package/dist/DataDisplay/index.js +2 -2
  31. package/dist/Extras/CommandPalette.cjs +1 -0
  32. package/dist/Extras/CommandPalette.css +1 -0
  33. package/dist/Extras/CommandPalette.d.cts +4 -0
  34. package/dist/Extras/CommandPalette.d.ts +4 -0
  35. package/dist/Extras/CommandPalette.js +1 -0
  36. package/dist/Extras/FileExplorer.cjs +2 -2
  37. package/dist/Extras/FileExplorer.js +2 -2
  38. package/dist/Extras/Timeline.cjs +1 -0
  39. package/dist/Extras/Timeline.css +1 -0
  40. package/dist/Extras/Timeline.d.cts +6 -0
  41. package/dist/Extras/Timeline.d.ts +6 -0
  42. package/dist/Extras/Timeline.js +1 -0
  43. package/dist/Extras/index.cjs +4 -4
  44. package/dist/Extras/index.css +1 -1
  45. package/dist/Extras/index.d.cts +9 -0
  46. package/dist/Extras/index.d.ts +9 -0
  47. package/dist/Extras/index.js +4 -4
  48. package/dist/Feedback/Alert.cjs +1 -1
  49. package/dist/Feedback/Alert.js +1 -1
  50. package/dist/Feedback/ProgressBar.cjs +1 -1
  51. package/dist/Feedback/ProgressBar.js +1 -1
  52. package/dist/Feedback/Skeleton.cjs +1 -0
  53. package/dist/Feedback/Skeleton.d.cts +2 -0
  54. package/dist/Feedback/Skeleton.d.ts +2 -0
  55. package/dist/Feedback/Skeleton.js +1 -0
  56. package/dist/Feedback/Spin.cjs +2 -2
  57. package/dist/Feedback/Spin.js +2 -2
  58. package/dist/Feedback/Toast.cjs +1 -0
  59. package/dist/Feedback/Toast.d.cts +11 -0
  60. package/dist/Feedback/Toast.d.ts +11 -0
  61. package/dist/Feedback/Toast.js +1 -0
  62. package/dist/Feedback/index.cjs +2 -2
  63. package/dist/Feedback/index.d.cts +11 -0
  64. package/dist/Feedback/index.d.ts +11 -0
  65. package/dist/Feedback/index.js +2 -2
  66. package/dist/Forms/Select.cjs +1 -0
  67. package/dist/Forms/Select.css +1 -0
  68. package/dist/Forms/Select.d.cts +3 -0
  69. package/dist/Forms/Select.d.ts +3 -0
  70. package/dist/Forms/Select.js +1 -0
  71. package/dist/Navigation/Breadcrumb.cjs +1 -0
  72. package/dist/Navigation/Breadcrumb.d.cts +3 -0
  73. package/dist/Navigation/Breadcrumb.d.ts +3 -0
  74. package/dist/Navigation/Breadcrumb.js +1 -0
  75. package/dist/Navigation/Header.cjs +1 -1
  76. package/dist/Navigation/Header.js +1 -1
  77. package/dist/Navigation/Pagination.cjs +1 -0
  78. package/dist/Navigation/Pagination.d.cts +2 -0
  79. package/dist/Navigation/Pagination.d.ts +2 -0
  80. package/dist/Navigation/Pagination.js +1 -0
  81. package/dist/Navigation/RibbonBar.cjs +1 -0
  82. package/dist/Navigation/RibbonBar.d.cts +6 -0
  83. package/dist/Navigation/RibbonBar.d.ts +6 -0
  84. package/dist/Navigation/RibbonBar.js +1 -0
  85. package/dist/Navigation/index.cjs +2 -2
  86. package/dist/Navigation/index.d.cts +8 -0
  87. package/dist/Navigation/index.d.ts +8 -0
  88. package/dist/Navigation/index.js +2 -2
  89. package/dist/Overlay/ContextMenu.cjs +1 -0
  90. package/dist/Overlay/ContextMenu.d.cts +3 -0
  91. package/dist/Overlay/ContextMenu.d.ts +3 -0
  92. package/dist/Overlay/ContextMenu.js +1 -0
  93. package/dist/Overlay/Drawer.cjs +1 -0
  94. package/dist/Overlay/Drawer.css +1 -0
  95. package/dist/Overlay/Drawer.d.cts +10 -0
  96. package/dist/Overlay/Drawer.d.ts +10 -0
  97. package/dist/Overlay/Drawer.js +1 -0
  98. package/dist/Overlay/index.cjs +1 -1
  99. package/dist/Overlay/index.css +1 -0
  100. package/dist/Overlay/index.d.cts +8 -0
  101. package/dist/Overlay/index.d.ts +8 -0
  102. package/dist/Overlay/index.js +1 -1
  103. package/dist/Primitives/Avatar.cjs +1 -0
  104. package/dist/Primitives/Avatar.d.cts +4 -0
  105. package/dist/Primitives/Avatar.d.ts +4 -0
  106. package/dist/Primitives/Avatar.js +1 -0
  107. package/dist/Primitives/Badge.cjs +1 -1
  108. package/dist/Primitives/Badge.js +1 -1
  109. package/dist/Primitives/Button.cjs +1 -1
  110. package/dist/Primitives/Button.js +1 -1
  111. package/dist/Primitives/Checkbox.cjs +1 -1
  112. package/dist/Primitives/Checkbox.js +1 -1
  113. package/dist/Primitives/Dropdown.cjs +1 -1
  114. package/dist/Primitives/Dropdown.js +1 -1
  115. package/dist/Primitives/DropdownButton.cjs +1 -1
  116. package/dist/Primitives/DropdownButton.js +1 -1
  117. package/dist/Primitives/Indicator.cjs +1 -1
  118. package/dist/Primitives/Indicator.js +1 -1
  119. package/dist/Primitives/Input.cjs +1 -1
  120. package/dist/Primitives/Input.js +1 -1
  121. package/dist/Primitives/Label.cjs +1 -1
  122. package/dist/Primitives/Label.js +1 -1
  123. package/dist/Primitives/Radio.cjs +1 -1
  124. package/dist/Primitives/Radio.js +1 -1
  125. package/dist/Primitives/Slider.cjs +1 -0
  126. package/dist/Primitives/Slider.css +1 -0
  127. package/dist/Primitives/Slider.d.cts +4 -0
  128. package/dist/Primitives/Slider.d.ts +4 -0
  129. package/dist/Primitives/Slider.js +1 -0
  130. package/dist/Primitives/Switch.cjs +1 -1
  131. package/dist/Primitives/Switch.js +1 -1
  132. package/dist/Primitives/Tag.cjs +1 -0
  133. package/dist/Primitives/Tag.d.cts +2 -0
  134. package/dist/Primitives/Tag.d.ts +2 -0
  135. package/dist/Primitives/Tag.js +1 -0
  136. package/dist/Primitives/index.cjs +1 -1
  137. package/dist/Primitives/index.css +1 -0
  138. package/dist/Primitives/index.d.cts +6 -0
  139. package/dist/Primitives/index.d.ts +6 -0
  140. package/dist/Primitives/index.js +1 -1
  141. package/dist/_tsup-dts-rollup.d.cts +967 -2
  142. package/dist/_tsup-dts-rollup.d.ts +967 -2
  143. package/dist/index.cjs +5 -5
  144. package/dist/index.css +1 -1
  145. package/dist/index.d.cts +69 -0
  146. package/dist/index.d.ts +69 -0
  147. package/dist/index.js +5 -5
  148. package/dist/styles/DataDisplay/MetricCard.css +1 -0
  149. package/dist/styles/DataDisplay/Stat.css +1 -0
  150. package/dist/styles/Extras/CommandPalette.css +65 -0
  151. package/dist/styles/Extras/Timeline.css +52 -0
  152. package/dist/styles/Feedback/Skeleton.css +37 -0
  153. package/dist/styles/Feedback/Toast.css +77 -0
  154. package/dist/styles/Forms/Select.css +36 -0
  155. package/dist/styles/Navigation/RibbonBar.css +1 -0
  156. package/dist/styles/Overlay/ContextMenu.css +1 -0
  157. package/dist/styles/Overlay/Drawer.css +52 -0
  158. package/dist/styles/Primitives/Slider.css +4 -0
  159. package/dist/styles/Primitives/Tag.css +1 -0
  160. package/dist/styles/base.css +1012 -0
  161. package/dist/styles.css +1223 -0
  162. package/dist/theme.cjs +1 -1
  163. package/dist/theme.d.cts +7 -0
  164. package/dist/theme.d.ts +7 -0
  165. package/dist/theme.js +1 -1
  166. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
- import ln,{createContext,useState,useCallback,useRef,useLayoutEffect,useEffect,useMemo,useId,useContext}from'react';import {createPortal}from'react-dom';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Heart,ThumbsDown,Bookmark,Share2,Download,ZoomIn,ZoomOut,X,ChevronLeft,ChevronRight,Camera,Aperture,Calendar,MapPin,Info,ListMusic,Shuffle,Repeat1,SkipBack,Pause,Play,SkipForward,VolumeX,Volume2,Disc3,ListVideo,Theater,Minimize,Maximize,ArrowUpDown,HardDrive,LayoutGrid,LayoutList,Minus,Minimize2,Maximize2,FolderUp,Search,CornerRightDown,Folder,ArrowUp,AlertTriangle,Trash2,FileArchive,Database,FileSpreadsheet,FileText,Terminal,FileCode,Video,Music,Image,File}from'lucide-react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {cva}from'class-variance-authority';function s(...e){return twMerge(clsx(e))}var Wt="#1c1914",Gt="#130f0b",In="#2e261e",kt="#504638",qe="#6b5d4d",ct=`url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")`,Hn=[{key:"like",icon:jsx(Heart,{className:"h-5 w-5"}),activeIcon:jsx(Heart,{className:"h-5 w-5",fill:"currentColor"}),label:"Like",toggle:true},{key:"dislike",icon:jsx(ThumbsDown,{className:"h-5 w-5"}),label:"Dislike"},{key:"bookmark",icon:jsx(Bookmark,{className:"h-5 w-5"}),activeIcon:jsx(Bookmark,{className:"h-5 w-5",fill:"currentColor"}),label:"Bookmark",toggle:true},{key:"share",icon:jsx(Share2,{className:"h-5 w-5"}),label:"Share"},{key:"download",icon:jsx(Download,{className:"h-5 w-5"}),label:"Download"}];function Nt({photos:e,layout:n="strip",actions:i=Hn,onAction:g,className:k,showGrain:m=true,sheetTitle:h,sheetLabel:D}){let[S,x]=useState(null),[j,T]=useState(new Set),N=useCallback(B=>x(B),[]),w=useCallback(()=>x(null),[]),_=useCallback((B,z)=>{if(i.find(A=>A.key===B)?.toggle){let A=`${z}-${B}`;T(X=>{let I=new Set(X);return I.has(A)?I.delete(A):I.add(A),I});}g?.(B,e[z],z);},[i,g,e]);return jsxs(Fragment,{children:[jsx(n==="strip"?On:n==="sheet"?_n:Vn,{photos:e,onPhotoClick:N,showGrain:m,className:k,sheetTitle:h,sheetLabel:D}),S!==null&&createPortal(jsx($n,{photos:e,currentIndex:S,onIndexChange:x,onClose:w,actions:i,activeActions:j,onAction:_,showGrain:m}),document.body)]})}function Yt({count:e=30}){return jsx("div",{className:"flex shrink-0 items-center justify-between px-3",style:{height:22,background:Wt},children:Array.from({length:e}).map((n,i)=>jsx("div",{className:"rounded-xs",style:{width:12,height:8,background:In}},i))})}function On({photos:e,onPhotoClick:n,showGrain:i,className:g}){let k=useRef(null);return jsxs("div",{className:s("select-none rounded-lg overflow-hidden",g),style:{background:Gt},children:[jsx(Yt,{count:Math.max(30,e.length*6)}),jsx("div",{ref:k,className:"flex gap-1 overflow-x-auto scroll-smooth px-1 py-1",style:{background:Wt,scrollSnapType:"x mandatory"},children:e.map((m,h)=>jsxs("div",{className:"group relative shrink-0 cursor-pointer",style:{scrollSnapAlign:"center"},onClick:()=>n(h),children:[jsxs("div",{className:"overflow-hidden rounded-xs border",style:{borderColor:kt,width:280,height:187},children:[jsx("img",{src:m.src,alt:m.alt??m.title??"",className:"h-full w-full object-cover transition-transform duration-700 ease-out group-hover:scale-110",draggable:false}),jsx("div",{className:"pointer-events-none absolute inset-0 mix-blend-multiply opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"rgba(255, 175, 60, 0.06)"}}),i&&jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-[0.06]",style:{backgroundImage:ct,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsx("div",{className:"pointer-events-none absolute inset-0 opacity-30 transition-opacity duration-300 group-hover:opacity-50",style:{background:"radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.5) 100%)"}})]}),jsxs("div",{className:"mt-0.5 text-center font-mono text-[9px] tracking-widest",style:{color:qe},children:[String(h+1).padStart(2,"0"),h%2===0?"":"A"]})]},h))}),jsx(Yt,{count:Math.max(30,e.length*6)})]})}function _n({photos:e,onPhotoClick:n,showGrain:i,className:g,sheetTitle:k,sheetLabel:m}){return jsxs("div",{className:s("rounded-lg p-5",g),style:{background:Gt},children:[jsxs("div",{className:"mb-4 flex items-center justify-between",children:[jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:qe},children:k??`JAC\xB7Film 35mm \xB7 ${e.length} exposures`}),jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:qe},children:m??"Contact Sheet"})]}),jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6",children:e.map((h,D)=>jsxs("div",{className:"group cursor-pointer",style:{animation:`reveal-up 0.4s ease-out ${D*50}ms both`},onClick:()=>n(D),children:[jsx("div",{className:"mb-0.5 font-mono text-[9px] tracking-wider",style:{color:qe},children:String(D+1).padStart(2,"0")}),jsxs("div",{className:"relative overflow-hidden rounded-[1px] border transition-all duration-300 group-hover:border-amber-600/50 group-hover:shadow-[0_0_20px_rgba(217,171,89,0.15)]",style:{borderColor:kt,aspectRatio:"3/2"},children:[jsx("img",{src:h.src,alt:h.alt??"",className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105",draggable:false}),i&&jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:ct}}),jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 translate-y-full bg-linear-to-t from-black/70 to-transparent p-2 pt-6 transition-transform duration-300 group-hover:translate-y-0",children:jsx("span",{className:"text-xs font-medium text-white/90",children:h.title})})]})]},D))})]})}function Vn({photos:e,onPhotoClick:n,showGrain:i,className:g}){let[k,m]=useState(false),[h,D]=useState(null),S=Math.min(e.length,8),x=e.slice(0,S),j=N=>{let w=Math.sin(N*137.508+1)*1e4,_=(w%12-6).toFixed(1),y=(w/7%8-4).toFixed(1),B=(w/13%6-3).toFixed(1);return `rotate(${_}deg) translate(${y}px, ${B}px)`},T=(N,w)=>{let _=(w-1)/2,y=((N-_)*7).toFixed(1),B=((N-_)*110).toFixed(0),z=(-Math.abs(N-_)*10+(h===N?-18:0)).toFixed(0);return `translateX(${B}px) translateY(${z}px) rotate(${y}deg)`};return jsxs("div",{className:s("flex flex-col items-center gap-4",g),children:[jsx("div",{className:"relative flex h-85 w-full items-center justify-center",onMouseEnter:()=>m(true),onMouseLeave:()=>{m(false),D(null);},children:x.map((N,w)=>jsx("div",{className:"absolute cursor-pointer rounded-lg shadow-xl transition-all duration-500",style:{transitionTimingFunction:"cubic-bezier(0.34, 1.56, 0.64, 1)",transitionDelay:k?`${w*35}ms`:`${(S-w)*25}ms`,transform:k?T(w,x.length):j(w),zIndex:k?w+1:x.length-w,width:220,height:147},onClick:()=>n(w),onMouseEnter:()=>k&&D(w),onMouseLeave:()=>D(null),children:jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-lg border transition-shadow duration-300",style:{borderColor:k&&h===w?"rgba(217,171,89,0.5)":kt,boxShadow:k&&h===w?"0 25px 50px rgba(0,0,0,0.5), 0 0 30px rgba(217,171,89,0.1)":"0 10px 30px rgba(0,0,0,0.4)"},children:[jsx("img",{src:N.src,alt:N.alt??"",className:"h-full w-full object-cover",draggable:false}),i&&jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:ct}}),jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.35) 100%)"}}),k&&h===w&&jsx("div",{className:"absolute inset-x-0 bottom-0 bg-linear-to-t from-black/80 to-transparent p-3 pt-8",style:{animation:"reveal-up 0.25s ease-out"},children:jsx("span",{className:"text-sm font-medium text-white/90",children:N.title})})]})},w))}),e.length>S&&jsxs("span",{className:"font-mono text-xs",style:{color:qe},children:["+ ",e.length-S," more"]}),jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] transition-opacity duration-300",style:{color:qe,opacity:k?0:.7},children:"Hover to explore"})]})}function $n({photos:e,currentIndex:n,onIndexChange:i,onClose:g,actions:k,activeActions:m,onAction:h,showGrain:D}){let S=e[n],[x,j]=useState(1),[T,N]=useState({x:0,y:0}),[w,_]=useState(false),[y,B]=useState(false),z=useRef(false),G=useRef({x:0,y:0}),A=useRef(null);useLayoutEffect(()=>{requestAnimationFrame(()=>B(true));},[]),useEffect(()=>{let o=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=o;}},[]),useEffect(()=>{let o=L=>{switch(L.key){case "Escape":g();break;case "ArrowLeft":X$1(-1);break;case "ArrowRight":X$1(1);break;case "i":case "I":_(K=>!K);break}};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)}),useEffect(()=>{let o=A.current;if(!o)return;let L=K=>{K.preventDefault();let ne=K.deltaY<0?1.12:.89;j(U=>{let be=Math.min(8,Math.max(1,U*ne));return be<=1&&N({x:0,y:0}),be});};return o.addEventListener("wheel",L,{passive:false}),()=>o.removeEventListener("wheel",L)},[]);let X$1=useCallback(o=>{let L=n+o;L>=0&&L<e.length&&(i(L),j(1),N({x:0,y:0}));},[n,e.length,i]),I=useCallback(o=>{x<=1||(z.current=true,G.current={x:o.clientX,y:o.clientY},o.target.setPointerCapture(o.pointerId));},[x]),ge=useCallback(o=>{if(!z.current)return;let L=o.clientX-G.current.x,K=o.clientY-G.current.y;G.current={x:o.clientX,y:o.clientY},N(ne=>({x:ne.x+L/x,y:ne.y+K/x}));},[x]),d=useCallback(()=>{z.current=false;},[]),b=useCallback(()=>{x>1?(j(1),N({x:0,y:0})):j(2.5);},[x]),E=o=>m.has(`${n}-${o}`),C=S.metadata;return jsxs("div",{className:"fixed inset-0 z-200 flex flex-col",style:{animation:"lightbox-backdrop-in 0.35s ease-out"},children:[jsx("div",{className:"absolute inset-0 bg-black/95",onClick:g}),D&&jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.025]",style:{backgroundImage:ct,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsxs("div",{className:"relative z-10 flex h-12 shrink-0 items-center justify-between px-4",children:[jsxs("span",{className:"font-mono text-sm text-white/50",children:[n+1," / ",e.length]}),jsxs("div",{className:"flex items-center gap-1",children:[jsxs("span",{className:"mr-2 font-mono text-xs text-white/40",children:[x.toFixed(1),"x"]}),jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>j(o=>Math.min(8,o*1.3)),title:"Zoom in",children:jsx(ZoomIn,{className:"h-4 w-4"})}),jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>{j(o=>{let L=Math.max(1,o*.7);return L<=1&&N({x:0,y:0}),L});},title:"Zoom out",children:jsx(ZoomOut,{className:"h-4 w-4"})}),jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:g,title:"Close",children:jsx(X,{className:"h-5 w-5"})})]})]}),jsxs("div",{ref:A,className:"relative flex flex-1 items-center justify-center overflow-hidden",style:{cursor:x>1?"grab":"default"},onPointerDown:I,onPointerMove:ge,onPointerUp:d,onDoubleClick:b,children:[jsx("img",{src:S.src,alt:S.alt??S.title??"",className:"max-h-full max-w-full select-none object-contain",style:{animation:"lightbox-photo-in 0.35s cubic-bezier(0.16, 1, 0.3, 1)",transform:`scale(${x}) translate(${T.x}px, ${T.y}px)`,transition:z.current?"none":"transform 0.15s ease-out"},draggable:false},n),n>0&&jsx("button",{className:"absolute left-3 top-1/2 -translate-y-1/2 rounded-full bg-black/40 p-2.5 text-white/70 backdrop-blur-sm transition-all hover:bg-black/60 hover:text-white",onClick:o=>{o.stopPropagation(),X$1(-1);},children:jsx(ChevronLeft,{className:"h-6 w-6"})}),n<e.length-1&&jsx("button",{className:"absolute right-3 top-1/2 -translate-y-1/2 rounded-full bg-black/40 p-2.5 text-white/70 backdrop-blur-sm transition-all hover:bg-black/60 hover:text-white",onClick:o=>{o.stopPropagation(),X$1(1);},children:jsx(ChevronRight,{className:"h-6 w-6"})})]}),jsx("div",{className:s("absolute inset-x-0 bottom-0 z-20 transition-all duration-400",w?"translate-y-0 opacity-100":"pointer-events-none translate-y-full opacity-0"),children:jsxs("div",{className:"bg-linear-to-t from-black/90 via-black/75 to-transparent px-6 pb-24 pt-16",children:[S.title&&jsx("h3",{className:"mb-3 text-xl font-semibold text-white",children:S.title}),S.description&&jsx("p",{className:"mb-4 max-w-xl border-l-2 border-amber-500/40 pl-4 text-sm leading-relaxed text-white/60 italic",style:{animation:"reveal-up 0.4s ease-out 0.1s both"},children:S.description}),C&&jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-sm text-white/70",children:[C.camera&&jsxs("span",{className:"flex items-center gap-1.5",children:[jsx(Camera,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",C.camera,C.lens&&jsx("span",{className:"text-white/40",children:"\xB7"}),C.lens&&C.lens]}),(C.aperture||C.shutter||C.iso)&&jsxs("span",{className:"flex items-center gap-1.5",children:[jsx(Aperture,{className:"h-3.5 w-3.5 text-amber-400/80"}),[C.aperture,C.shutter,C.iso&&`ISO ${C.iso}`].filter(Boolean).join(" \xB7 ")]}),C.date&&jsxs("span",{className:"flex items-center gap-1.5",children:[jsx(Calendar,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",C.date]}),C.location&&jsxs("span",{className:"flex items-center gap-1.5",children:[jsx(MapPin,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",C.location]})]})]})}),jsx("div",{className:"relative z-20 flex h-16 shrink-0 items-center justify-center gap-1",children:jsxs("div",{className:"flex items-center gap-0.5 rounded-full bg-white/6 px-2 py-1.5 backdrop-blur-xl",children:[k.map(o=>{let L=o.toggle&&E(o.key);return jsx("button",{className:s("rounded-full p-2.5 transition-all duration-200",L?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>h(o.key,n),title:o.label,children:L&&o.activeIcon?o.activeIcon:o.icon},o.key)}),jsx("div",{className:"mx-1 h-5 w-px bg-white/10"}),jsx("button",{className:s("rounded-full p-2.5 transition-all duration-200",w?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>_(o=>!o),title:"Photo info (I)",children:jsx(Info,{className:"h-5 w-5"})})]})})]})}var Ct="data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">
1
+ import br,{createContext,useState,useCallback,useRef,useLayoutEffect,useEffect,useMemo,useId,useContext}from'react';import {createPortal}from'react-dom';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Heart,ThumbsDown,Bookmark,Share2,Download,ZoomIn,ZoomOut,X,ChevronLeft,ChevronRight,Camera,Aperture,Calendar,MapPin,Info,ListMusic,Shuffle,Repeat1,SkipBack,Pause,Play,SkipForward,VolumeX,Volume2,Disc3,ListVideo,Theater,Minimize,Maximize,ArrowUpDown,HardDrive,LayoutGrid,LayoutList,Minus,Minimize2,Maximize2,FolderUp,Search,CornerRightDown,Folder,ArrowUp,AlertTriangle,Trash2,Command,FileArchive,Database,FileSpreadsheet,FileText,Terminal,FileCode,Video,Music,Image,File,Check,AlertCircle,Dot,Clock}from'lucide-react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {cva}from'class-variance-authority';function o(...e){return twMerge(clsx(e))}var rr="#1c1914",nr="#130f0b",an="#2e261e",St="#504638",et="#6b5d4d",pt=`url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")`,on=[{key:"like",icon:jsx(Heart,{className:"h-5 w-5"}),activeIcon:jsx(Heart,{className:"h-5 w-5",fill:"currentColor"}),label:"Like",toggle:true},{key:"dislike",icon:jsx(ThumbsDown,{className:"h-5 w-5"}),label:"Dislike"},{key:"bookmark",icon:jsx(Bookmark,{className:"h-5 w-5"}),activeIcon:jsx(Bookmark,{className:"h-5 w-5",fill:"currentColor"}),label:"Bookmark",toggle:true},{key:"share",icon:jsx(Share2,{className:"h-5 w-5"}),label:"Share"},{key:"download",icon:jsx(Download,{className:"h-5 w-5"}),label:"Download"}];function Pt({photos:e,layout:t="strip",actions:n=on,onAction:u,className:f,showGrain:c=true,sheetTitle:d,sheetLabel:v}){let[y,h]=useState(null),[L,w]=useState(new Set),l=useCallback(H=>h(H),[]),m=useCallback(()=>h(null),[]),P=useCallback((H,E)=>{if(n.find(V=>V.key===H)?.toggle){let V=`${E}-${H}`;w(O=>{let $=new Set(O);return $.has(V)?$.delete(V):$.add(V),$});}u?.(H,e[E],E);},[n,u,e]);return jsxs(Fragment,{children:[jsx(t==="strip"?sn:t==="sheet"?ln:cn,{photos:e,onPhotoClick:l,showGrain:c,className:f,sheetTitle:d,sheetLabel:v}),y!==null&&createPortal(jsx(dn,{photos:e,currentIndex:y,onIndexChange:h,onClose:m,actions:n,activeActions:L,onAction:P,showGrain:c}),document.body)]})}function tr({count:e=30}){return jsx("div",{className:"flex shrink-0 items-center justify-between px-3",style:{height:22,background:rr},children:Array.from({length:e}).map((t,n)=>jsx("div",{className:"rounded-xs",style:{width:12,height:8,background:an}},n))})}function sn({photos:e,onPhotoClick:t,showGrain:n,className:u}){let f=useRef(null);return jsxs("div",{className:o("select-none rounded-lg overflow-hidden",u),style:{background:nr},children:[jsx(tr,{count:Math.max(30,e.length*6)}),jsx("div",{ref:f,className:"flex gap-1 overflow-x-auto scroll-smooth px-1 py-1",style:{background:rr,scrollSnapType:"x mandatory"},children:e.map((c,d)=>jsxs("div",{className:"group relative shrink-0 cursor-pointer",style:{scrollSnapAlign:"center"},onClick:()=>t(d),children:[jsxs("div",{className:"overflow-hidden rounded-xs border",style:{borderColor:St,width:280,height:187},children:[jsx("img",{src:c.src,alt:c.alt??c.title??"",className:"h-full w-full object-cover transition-transform duration-700 ease-out group-hover:scale-110",draggable:false}),jsx("div",{className:"pointer-events-none absolute inset-0 mix-blend-multiply opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"rgba(255, 175, 60, 0.06)"}}),n&&jsx("div",{className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-[0.06]",style:{backgroundImage:pt,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsx("div",{className:"pointer-events-none absolute inset-0 opacity-30 transition-opacity duration-300 group-hover:opacity-50",style:{background:"radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.5) 100%)"}})]}),jsxs("div",{className:"mt-0.5 text-center font-mono text-[9px] tracking-widest",style:{color:et},children:[String(d+1).padStart(2,"0"),d%2===0?"":"A"]})]},d))}),jsx(tr,{count:Math.max(30,e.length*6)})]})}function ln({photos:e,onPhotoClick:t,showGrain:n,className:u,sheetTitle:f,sheetLabel:c}){return jsxs("div",{className:o("rounded-lg p-5",u),style:{background:nr},children:[jsxs("div",{className:"mb-4 flex items-center justify-between",children:[jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:et},children:f??`JAC\xB7Film 35mm \xB7 ${e.length} exposures`}),jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:et},children:c??"Contact Sheet"})]}),jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6",children:e.map((d,v)=>jsxs("div",{className:"group cursor-pointer",style:{animation:`reveal-up 0.4s ease-out ${v*50}ms both`},onClick:()=>t(v),children:[jsx("div",{className:"mb-0.5 font-mono text-[9px] tracking-wider",style:{color:et},children:String(v+1).padStart(2,"0")}),jsxs("div",{className:"relative overflow-hidden rounded-[1px] border transition-all duration-300 group-hover:border-amber-600/50 group-hover:shadow-[0_0_20px_rgba(217,171,89,0.15)]",style:{borderColor:St,aspectRatio:"3/2"},children:[jsx("img",{src:d.src,alt:d.alt??"",className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105",draggable:false}),n&&jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:pt}}),jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 translate-y-full bg-linear-to-t from-black/70 to-transparent p-2 pt-6 transition-transform duration-300 group-hover:translate-y-0",children:jsx("span",{className:"text-xs font-medium text-white/90",children:d.title})})]})]},v))})]})}function cn({photos:e,onPhotoClick:t,showGrain:n,className:u}){let[f,c]=useState(false),[d,v]=useState(null),y=Math.min(e.length,8),h=e.slice(0,y),L=l=>{let m=Math.sin(l*137.508+1)*1e4,P=(m%12-6).toFixed(1),N=(m/7%8-4).toFixed(1),H=(m/13%6-3).toFixed(1);return `rotate(${P}deg) translate(${N}px, ${H}px)`},w=(l,m)=>{let P=(m-1)/2,N=((l-P)*7).toFixed(1),H=((l-P)*110).toFixed(0),E=(-Math.abs(l-P)*10+(d===l?-18:0)).toFixed(0);return `translateX(${H}px) translateY(${E}px) rotate(${N}deg)`};return jsxs("div",{className:o("flex flex-col items-center gap-4",u),children:[jsx("div",{className:"relative flex h-85 w-full items-center justify-center",onMouseEnter:()=>c(true),onMouseLeave:()=>{c(false),v(null);},children:h.map((l,m)=>jsx("div",{className:"absolute cursor-pointer rounded-lg shadow-xl transition-all duration-500",style:{transitionTimingFunction:"cubic-bezier(0.34, 1.56, 0.64, 1)",transitionDelay:f?`${m*35}ms`:`${(y-m)*25}ms`,transform:f?w(m,h.length):L(m),zIndex:f?m+1:h.length-m,width:220,height:147},onClick:()=>t(m),onMouseEnter:()=>f&&v(m),onMouseLeave:()=>v(null),children:jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-lg border transition-shadow duration-300",style:{borderColor:f&&d===m?"rgba(217,171,89,0.5)":St,boxShadow:f&&d===m?"0 25px 50px rgba(0,0,0,0.5), 0 0 30px rgba(217,171,89,0.1)":"0 10px 30px rgba(0,0,0,0.4)"},children:[jsx("img",{src:l.src,alt:l.alt??"",className:"h-full w-full object-cover",draggable:false}),n&&jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:pt}}),jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.35) 100%)"}}),f&&d===m&&jsx("div",{className:"absolute inset-x-0 bottom-0 bg-linear-to-t from-black/80 to-transparent p-3 pt-8",style:{animation:"reveal-up 0.25s ease-out"},children:jsx("span",{className:"text-sm font-medium text-white/90",children:l.title})})]})},m))}),e.length>y&&jsxs("span",{className:"font-mono text-xs",style:{color:et},children:["+ ",e.length-y," more"]}),jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] transition-opacity duration-300",style:{color:et,opacity:f?0:.7},children:"Hover to explore"})]})}function dn({photos:e,currentIndex:t,onIndexChange:n,onClose:u,actions:f,activeActions:c,onAction:d,showGrain:v}){let y=e[t],[h,L]=useState(1),[w,l]=useState({x:0,y:0}),[m,P]=useState(false),[N,H]=useState(false),E=useRef(false),z=useRef({x:0,y:0}),V=useRef(null);useLayoutEffect(()=>{requestAnimationFrame(()=>H(true));},[]),useEffect(()=>{let s=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=s;}},[]),useEffect(()=>{let s=A=>{switch(A.key){case "Escape":u();break;case "ArrowLeft":O(-1);break;case "ArrowRight":O(1);break;case "i":case "I":P(Y=>!Y);break}};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)}),useEffect(()=>{let s=V.current;if(!s)return;let A=Y=>{Y.preventDefault();let ne=Y.deltaY<0?1.12:.89;L(q=>{let ve=Math.min(8,Math.max(1,q*ne));return ve<=1&&l({x:0,y:0}),ve});};return s.addEventListener("wheel",A,{passive:false}),()=>s.removeEventListener("wheel",A)},[]);let O=useCallback(s=>{let A=t+s;A>=0&&A<e.length&&(n(A),L(1),l({x:0,y:0}));},[t,e.length,n]),$=useCallback(s=>{h<=1||(E.current=true,z.current={x:s.clientX,y:s.clientY},s.target.setPointerCapture(s.pointerId));},[h]),me=useCallback(s=>{if(!E.current)return;let A=s.clientX-z.current.x,Y=s.clientY-z.current.y;z.current={x:s.clientX,y:s.clientY},l(ne=>({x:ne.x+A/h,y:ne.y+Y/h}));},[h]),b=useCallback(()=>{E.current=false;},[]),M=useCallback(()=>{h>1?(L(1),l({x:0,y:0})):L(2.5);},[h]),_=s=>c.has(`${t}-${s}`),R=y.metadata;return jsxs("div",{className:"fixed inset-0 z-200 flex flex-col",style:{animation:"lightbox-backdrop-in 0.35s ease-out"},children:[jsx("div",{className:"absolute inset-0 bg-black/95",onClick:u}),v&&jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.025]",style:{backgroundImage:pt,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsxs("div",{className:"relative z-10 flex h-12 shrink-0 items-center justify-between px-4",children:[jsxs("span",{className:"font-mono text-sm text-white/50",children:[t+1," / ",e.length]}),jsxs("div",{className:"flex items-center gap-1",children:[jsxs("span",{className:"mr-2 font-mono text-xs text-white/40",children:[h.toFixed(1),"x"]}),jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>L(s=>Math.min(8,s*1.3)),title:"Zoom in",children:jsx(ZoomIn,{className:"h-4 w-4"})}),jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>{L(s=>{let A=Math.max(1,s*.7);return A<=1&&l({x:0,y:0}),A});},title:"Zoom out",children:jsx(ZoomOut,{className:"h-4 w-4"})}),jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:u,title:"Close",children:jsx(X,{className:"h-5 w-5"})})]})]}),jsxs("div",{ref:V,className:"relative flex flex-1 items-center justify-center overflow-hidden",style:{cursor:h>1?"grab":"default"},onPointerDown:$,onPointerMove:me,onPointerUp:b,onDoubleClick:M,children:[jsx("img",{src:y.src,alt:y.alt??y.title??"",className:"max-h-full max-w-full select-none object-contain",style:{animation:"lightbox-photo-in 0.35s cubic-bezier(0.16, 1, 0.3, 1)",transform:`scale(${h}) translate(${w.x}px, ${w.y}px)`,transition:E.current?"none":"transform 0.15s ease-out"},draggable:false},t),t>0&&jsx("button",{className:"absolute left-3 top-1/2 -translate-y-1/2 rounded-full bg-black/40 p-2.5 text-white/70 backdrop-blur-sm transition-all hover:bg-black/60 hover:text-white",onClick:s=>{s.stopPropagation(),O(-1);},children:jsx(ChevronLeft,{className:"h-6 w-6"})}),t<e.length-1&&jsx("button",{className:"absolute right-3 top-1/2 -translate-y-1/2 rounded-full bg-black/40 p-2.5 text-white/70 backdrop-blur-sm transition-all hover:bg-black/60 hover:text-white",onClick:s=>{s.stopPropagation(),O(1);},children:jsx(ChevronRight,{className:"h-6 w-6"})})]}),jsx("div",{className:o("absolute inset-x-0 bottom-0 z-20 transition-all duration-400",m?"translate-y-0 opacity-100":"pointer-events-none translate-y-full opacity-0"),children:jsxs("div",{className:"bg-linear-to-t from-black/90 via-black/75 to-transparent px-6 pb-24 pt-16",children:[y.title&&jsx("h3",{className:"mb-3 text-xl font-semibold text-white",children:y.title}),y.description&&jsx("p",{className:"mb-4 max-w-xl border-l-2 border-amber-500/40 pl-4 text-sm leading-relaxed text-white/60 italic",style:{animation:"reveal-up 0.4s ease-out 0.1s both"},children:y.description}),R&&jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-sm text-white/70",children:[R.camera&&jsxs("span",{className:"flex items-center gap-1.5",children:[jsx(Camera,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",R.camera,R.lens&&jsx("span",{className:"text-white/40",children:"\xB7"}),R.lens&&R.lens]}),(R.aperture||R.shutter||R.iso)&&jsxs("span",{className:"flex items-center gap-1.5",children:[jsx(Aperture,{className:"h-3.5 w-3.5 text-amber-400/80"}),[R.aperture,R.shutter,R.iso&&`ISO ${R.iso}`].filter(Boolean).join(" \xB7 ")]}),R.date&&jsxs("span",{className:"flex items-center gap-1.5",children:[jsx(Calendar,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",R.date]}),R.location&&jsxs("span",{className:"flex items-center gap-1.5",children:[jsx(MapPin,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",R.location]})]})]})}),jsx("div",{className:"relative z-20 flex h-16 shrink-0 items-center justify-center gap-1",children:jsxs("div",{className:"flex items-center gap-0.5 rounded-full bg-white/6 px-2 py-1.5 backdrop-blur-xl",children:[f.map(s=>{let A=s.toggle&&_(s.key);return jsx("button",{className:o("rounded-full p-2.5 transition-all duration-200",A?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>d(s.key,t),title:s.label,children:A&&s.activeIcon?s.activeIcon:s.icon},s.key)}),jsx("div",{className:"mx-1 h-5 w-px bg-white/10"}),jsx("button",{className:o("rounded-full p-2.5 transition-all duration-200",m?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>P(s=>!s),title:"Photo info (I)",children:jsx(Info,{className:"h-5 w-5"})})]})})]})}var Lt="data:image/svg+xml,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">
2
2
  <rect width="200" height="200" fill="#1e1b2e"/>
3
3
  <circle cx="100" cy="100" r="60" fill="none" stroke="#6366f1" stroke-width="1.5" opacity="0.3"/>
4
4
  <circle cx="100" cy="100" r="20" fill="none" stroke="#6366f1" stroke-width="1" opacity="0.4"/>
5
5
  <text x="100" y="108" text-anchor="middle" font-family="monospace" font-size="18" fill="#6366f1" opacity="0.6">\u266A</text>
6
- </svg>`);function qt(e){if(!isFinite(e)||e<0)return "0:00";let n=Math.floor(e/60),i=Math.floor(e%60);return `${n}:${i.toString().padStart(2,"0")}`}function er(e){return e.startsWith("bottom")?"bottom":e.startsWith("top")?"top":"right"}var tr={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},nr={"bottom-right":"bottom-4 right-0","bottom-left":"bottom-4 left-0","top-right":"top-4 right-0","top-left":"top-4 left-0"},rr={"bottom-right":"bottom-8 right-0 w-1.5 h-16 rounded-l-full","bottom-left":"bottom-8 left-0 w-1.5 h-16 rounded-r-full","top-right":"top-8 right-0 w-1.5 h-16 rounded-l-full","top-left":"top-8 left-0 w-1.5 h-16 rounded-r-full"};function Mt({playlist:e,initialTrack:n=0,position:i="bottom-right",entrance:g,theme:k,docked:m=false,visible:h,onVisibleChange:D,onTrackChange:S,onLike:x,autoPlay:j=true,shuffle:T=false,loop:N=false,accent:w="#8b5cf6",className:_}){let [y,B]=useState(n),[z,G]=useState(false),[A,X$1]=useState(0),[I,ge]=useState(0),[d,b]=useState(.8),[E,C]=useState(false),[o,L]=useState(new Set),[K,ne]=useState(false),[U,be]=useState(h??!m),[V,he]=useState(false),[$e,Se]=useState(false),[ce,ze]=useState(T),[me,Fe]=useState(N),Pe=useRef(false),F=useRef(null),ye=useRef(null),ee=useRef(void 0),Z=useRef(null),te=useRef(null),pe=h??U,Ne=g??er(i),P=e[y],Q=m,de=k==="dark"?"dark":k==="light"?"light":"",we="bg-(--mp-bg)",Ce="text-(--mp-text)",re="text-(--mp-text-muted)",Ee="text-(--accent)",J="border-(--mp-border)";useEffect(()=>{let a=F.current;a&&(a.src=P.src,a.load(),z&&a.play().catch(()=>{}));},[y,P.src]),useEffect(()=>{if(!j||Pe.current)return;let a=F.current;if(!a)return;let R=()=>{Pe.current=true,G(true),a.play().catch(()=>{});};return a.addEventListener("canplaythrough",R,{once:true}),()=>a.removeEventListener("canplaythrough",R)},[j]),useEffect(()=>{let a=F.current;a&&(z?a.play().catch(()=>{}):a.pause());},[z]),useEffect(()=>{let a=F.current;a&&(a.muted=E,te.current?te.current.gain.value=E?0:d:a.volume=d);},[d,E]),useEffect(()=>{let a=F.current;if(!a)return;let R=()=>X$1(a.currentTime),oe=()=>ge(a.duration),Me=()=>{me?(a.currentTime=0,a.play().catch(()=>{})):Te();};return a.addEventListener("timeupdate",R),a.addEventListener("loadedmetadata",oe),a.addEventListener("ended",Me),()=>{a.removeEventListener("timeupdate",R),a.removeEventListener("loadedmetadata",oe),a.removeEventListener("ended",Me);}},[y,e.length]);let M=useCallback(a=>{let R=(a%e.length+e.length)%e.length;B(R),X$1(0),S?.(R,e[R]),pe||(be(true),D?.(true));},[e,pe,S,D]),Te=useCallback(()=>{if(ce){let a;do a=Math.floor(Math.random()*e.length);while(a===y&&e.length>1);M(a);}else M(y+1);},[M,y,ce,e.length]),Ye=useCallback(()=>{if(ce){let a;do a=Math.floor(Math.random()*e.length);while(a===y&&e.length>1);M(a);}else M(y-1);},[M,y,ce,e.length]),We=useCallback(()=>{let a=o.has(y);L(R=>{let oe=new Set(R);return a?oe.delete(y):oe.add(y),oe}),x?.(y,P,!a);},[y,o,x,P]),at=useCallback(a=>{let R=a.currentTarget.getBoundingClientRect(),Me=Math.max(0,Math.min(1,(a.clientX-R.left)/R.width))*I;F.current&&(F.current.currentTime=Me),X$1(Me);},[I]),le=useCallback(()=>{he(true);let a=Q?200:400;ee.current=setTimeout(()=>{he(false),be(false),D?.(false);},a);},[Q,D]);useEffect(()=>()=>{ee.current&&clearTimeout(ee.current);},[]),useEffect(()=>()=>{Z.current?.close();},[]);function fe(){if(Z.current||!F.current){Z.current?.resume();return}try{let a=window.AudioContext??window.webkitAudioContext;if(!a)return;let R=new a,oe=R.createGain();oe.gain.value=E?0:d,R.createMediaElementSource(F.current).connect(oe).connect(R.destination),Z.current=R,te.current=oe,R.resume();}catch{}}let r=$e?"fade-in 0.2s ease-out both":`mp-enter-${Ne} 0.45s cubic-bezier(0.16, 1, 0.3, 1) both`,v=$e?"fade-in 0.2s ease-in reverse both":`mp-exit-${Ne} 0.4s cubic-bezier(0.7, 0, 0.84, 0) both`,Y=I>0?A/I*100:0;return Q&&!pe&&!V?jsxs(Fragment,{children:[jsx("audio",{ref:F,preload:"metadata",crossOrigin:"anonymous"}),jsxs("div",{className:s("fixed z-100 cursor-pointer transition-all duration-300",rr[i]),style:{"--accent":w},onMouseEnter:()=>{Se(true),be(true),D?.(true);},children:[jsx("div",{className:s("h-full w-full rounded-full",z?"bg-(--accent)":"bg-(--mp-dock-strip)"),style:z?{animation:"mp-progress-glow 2s ease-in-out infinite",boxShadow:"0 0 12px color-mix(in srgb, var(--accent) 50%, transparent)"}:void 0}),z&&jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/30",style:{animation:"mp-pulse-ring 2s ease-out infinite"}})]})]}):!pe&&!V?jsx("audio",{ref:F,preload:"metadata",crossOrigin:"anonymous"}):jsxs(Fragment,{children:[jsx("audio",{ref:F,preload:"metadata",crossOrigin:"anonymous"}),jsx("div",{className:s("fixed z-100",Q?nr[i]:tr[i],de),style:{"--accent":w,...V?{animation:v}:{animation:r}},onMouseEnter:()=>{Q&&(ee.current&&(clearTimeout(ee.current),ee.current=void 0),V&&he(false),Se(true));},onMouseLeave:()=>{Q&&(Se(false),le());},children:jsxs("div",{className:s("w-[320px] overflow-hidden rounded-2xl border shadow-2xl backdrop-blur-xl",we,J,Q&&"rounded-none",i.endsWith("right")&&Q&&"rounded-l-2xl",i.endsWith("left")&&Q&&"rounded-r-2xl",_),children:[jsxs("div",{className:"relative",children:[jsx("div",{className:"absolute inset-0 overflow-hidden",children:jsx("img",{src:P.cover||Ct,alt:"",className:"h-full w-full scale-110 object-cover opacity-30 blur-2xl",draggable:false})}),jsxs("div",{className:"relative flex items-center gap-3.5 p-4 pb-3",children:[jsxs("div",{className:"relative h-14 w-14 shrink-0",children:[jsxs("div",{className:"h-14 w-14 overflow-hidden rounded-full border-2 border-white/10 shadow-lg",style:z?{animation:"mp-vinyl-spin 4s linear infinite"}:void 0,children:[jsx("img",{src:P.cover||Ct,alt:P.album??P.title,className:"h-full w-full object-cover",draggable:false}),jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsx("div",{className:"h-3 w-3 rounded-full bg-black/60 ring-1 ring-white/10"})})]}),z&&jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/20",style:{animation:"mp-pulse-ring 2.5s ease-out infinite"}})]}),jsxs("div",{className:"min-w-0 flex-1",children:[jsx("div",{className:s("truncate text-sm font-semibold",Ce),children:P.title}),P.artist&&jsx("div",{className:s("truncate text-xs",re),children:P.artist}),P.album&&jsx("div",{className:s("mt-0.5 truncate text-[10px] tracking-wide",re,"opacity-60"),children:P.album})]}),jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[jsx("button",{className:s("rounded-full p-1.5 transition-all duration-200",o.has(y)?"text-rose-500 hover:text-rose-400":s(re,"hover:text-rose-500")),onClick:We,title:"Like",children:jsx(Heart,{className:"h-4 w-4",fill:o.has(y)?"currentColor":"none"})}),jsx("button",{className:s("rounded-full p-1.5 transition-colors",re,"hover:"+Ce.split(" ")[0]),onClick:()=>ne(a=>!a),title:"Playlist",children:jsx(ListMusic,{className:"h-4 w-4"})}),!Q&&jsx("button",{className:s("rounded-full p-1.5 transition-colors",re,"hover:"+Ce.split(" ")[0]),onClick:le,title:"Dismiss",children:jsx(X,{className:"h-3.5 w-3.5"})})]})]})]}),jsxs("div",{className:"px-4",children:[jsxs("div",{ref:ye,className:"group relative h-1.5 cursor-pointer rounded-full bg-(--mp-surface)",onClick:at,children:[jsx("div",{className:"h-full rounded-full bg-(--accent) transition-[width] duration-150",style:{width:`${Y}%`}}),jsx("div",{className:"absolute top-1/2 h-3 w-3 -translate-y-1/2 rounded-full bg-(--accent) opacity-0 shadow-md transition-opacity group-hover:opacity-100",style:{left:`calc(${Y}% - 6px)`}})]}),jsxs("div",{className:s("mt-1 flex justify-between text-[10px] font-mono",re),children:[jsx("span",{children:qt(A)}),jsx("span",{children:qt(I)})]})]}),jsxs("div",{className:"flex items-center justify-center gap-2 px-4 pb-3 pt-1",children:[jsx("button",{className:s("rounded-full p-1.5 transition-colors",ce?Ee:re,"hover:text-(--mp-text)"),onClick:()=>ze(a=>!a),title:ce?"Shuffle On":"Shuffle Off",children:jsx(Shuffle,{className:"h-3.5 w-3.5"})}),jsx("button",{className:s("rounded-full p-1.5 transition-colors",me?Ee:re,"hover:text-(--mp-text)"),onClick:()=>Fe(a=>!a),title:me?"Loop On":"Loop Off",children:jsx(Repeat1,{className:"h-3.5 w-3.5"})}),jsx("button",{className:s("rounded-full p-2 transition-colors",re,"hover:text-(--mp-text)"),onClick:Ye,title:"Previous",children:jsx(SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsx("button",{className:s("flex h-10 w-10 items-center justify-center rounded-full transition-all duration-200","bg-(--accent) text-white shadow-lg active:scale-95"),style:{boxShadow:"0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent)"},onClick:()=>{fe(),G(a=>!a);},title:z?"Pause":"Play",children:z?jsx(Pause,{className:"h-4.5 w-4.5",fill:"currentColor"}):jsx(Play,{className:"h-4.5 w-4.5 translate-x-px",fill:"currentColor"})}),jsx("button",{className:s("rounded-full p-2 transition-colors",re,"hover:text-(--mp-text)"),onClick:Te,title:"Next",children:jsx(SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxs("div",{className:"ml-2 flex items-center gap-1.5",children:[jsx("button",{className:s("rounded-full p-1 transition-colors",re,"hover:text-(--mp-text)"),onClick:()=>{fe();let a=!E;C(a),te.current&&(te.current.gain.value=a?0:d);},title:E?"Unmute":"Mute",children:E||d===0?jsx(VolumeX,{className:"h-3.5 w-3.5"}):jsx(Volume2,{className:"h-3.5 w-3.5"})}),jsx("input",{type:"range",min:0,max:1,step:.01,value:E?0:d,onChange:a=>{fe();let R=Number(a.target.value);b(R),E&&C(false),te.current&&(te.current.gain.value=R);},className:"mp-volume-slider h-1 w-14 cursor-pointer appearance-none rounded-full bg-(--mp-surface) accent-(--accent)"})]})]}),jsx("div",{className:s("overflow-hidden transition-all duration-300 ease-in-out",K?"max-h-60":"max-h-0"),children:jsx("div",{className:s("border-t px-2 py-2",J),children:jsx("div",{className:"max-h-52 space-y-0.5 overflow-y-auto",children:e.map((a,R)=>{let oe=R===y;return jsxs("button",{className:s("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-all duration-200",oe?"bg-(--accent)/10 dark:bg-(--accent)/15":"hover:bg-(--mp-surface-hover)"),onClick:()=>{M(R),G(true);},children:[jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center",children:oe&&z?jsx("div",{className:"flex items-end gap-0.5",children:[1,2,3].map(Me=>jsx("div",{className:"w-0.75 rounded-full bg-(--accent)",style:{height:`${8+Me*4}px`,animation:`mp-eq-bar ${.4+Me*.15}s ease-in-out infinite alternate`}},Me))}):oe?jsx(Disc3,{className:s("h-4 w-4",Ee)}):jsx("span",{className:s("text-xs font-mono",re),children:R+1})}),jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded",children:jsx("img",{src:a.cover||Ct,alt:"",className:"h-full w-full object-cover",draggable:false})}),jsxs("div",{className:"min-w-0 flex-1",children:[jsx("div",{className:s("truncate text-xs font-medium",oe?Ee:Ce),children:a.title}),a.artist&&jsx("div",{className:s("truncate text-[10px]",re),children:a.artist})]}),o.has(R)&&jsx(Heart,{className:"h-3 w-3 shrink-0 text-rose-500",fill:"currentColor"})]},R)})})})})]})})]})}function ut(e){if(!isFinite(e)||e<0)return "0:00";let n=Math.floor(e/3600),i=Math.floor(e%3600/60),g=Math.floor(e%60);return n>0?`${n}:${i.toString().padStart(2,"0")}:${g.toString().padStart(2,"0")}`:`${i}:${g.toString().padStart(2,"0")}`}var vr={title:(e,n)=>e.title.localeCompare(n.title),type:(e,n)=>(e.type??"").localeCompare(n.type??""),duration:(e,n)=>(e.duration??0)-(n.duration??0)};function Tt({playlist:e,initialTrack:n=0,autoPlay:i=false,shuffle:g=false,loop:k=false,onTrackChange:m,onPlayChange:h,accent:D="#8b5cf6",className:S}){let[x,j]=useState(n),[T,N]=useState(false),[w,_]=useState(0),[y,B]=useState(0),[z,G]=useState(0),[A,X$1]=useState(.8),[I,ge]=useState(false),[d,b]=useState(g),[E,C]=useState(k),[o,L]=useState(false),[K,ne]=useState("title"),[U,be]=useState(true),[V,he]=useState(false),[$e,Se]=useState(false),[ce,ze]=useState(false),[me,Fe]=useState(true),[Pe,F]=useState(false),[ye,ee]=useState(null),Z=useRef(null),te=useRef(null),pe=useRef(void 0),Ne=useRef(false),P=e[x],Ke=ln.useMemo(()=>{let r=e.map((v,Y)=>({media:v,originalIndex:Y}));return r.sort((v,Y)=>{let a=vr[K](v.media,Y.media);return U?a:-a}),r},[e,K,U]);useEffect(()=>{let r=Z.current;if(!r)return;F(true),r.src=P.src,P.poster&&(r.poster=P.poster),r.load();let v=()=>{F(false),T&&r.play().catch(()=>{});};return r.addEventListener("loadeddata",v,{once:true}),()=>r.removeEventListener("loadeddata",v)},[x,P.src]),useEffect(()=>{if(!i||Ne.current)return;let r=Z.current;if(!r)return;let v=()=>{Ne.current=true,N(true),r.play().catch(()=>{});};return r.addEventListener("canplaythrough",v,{once:true}),()=>r.removeEventListener("canplaythrough",v)},[i]),useEffect(()=>{let r=Z.current;r&&(T?r.play().catch(()=>{}):r.pause(),h?.(T));},[T]),useEffect(()=>{let r=Z.current;r&&(r.volume=I?0:A);},[A,I]),useEffect(()=>{let r=Z.current;if(!r)return;let v=()=>_(r.currentTime),Y=()=>B(r.duration),a=()=>{r.buffered.length>0&&G(r.buffered.end(r.buffered.length-1));},R=()=>{E?(r.currentTime=0,r.play().catch(()=>{})):we();};return r.addEventListener("timeupdate",v),r.addEventListener("loadedmetadata",Y),r.addEventListener("progress",a),r.addEventListener("ended",R),()=>{r.removeEventListener("timeupdate",v),r.removeEventListener("loadedmetadata",Y),r.removeEventListener("progress",a),r.removeEventListener("ended",R);}},[x,e.length,E]);let Q=useCallback(()=>{Fe(true),pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>{T&&Fe(false);},3e3);},[T]);useEffect(()=>{T?Q():(Fe(true),pe.current&&clearTimeout(pe.current));},[T,Q]),useEffect(()=>()=>{pe.current&&clearTimeout(pe.current);},[]);let de=useCallback(r=>{let v=(r%e.length+e.length)%e.length;j(v),_(0),N(true),m?.(v,e[v]);},[e,m]),we=useCallback(()=>{if(d){let r;do r=Math.floor(Math.random()*e.length);while(r===x&&e.length>1);de(r);}else de(x+1);},[de,x,d,e.length]),Ce=useCallback(()=>{if(d){let r;do r=Math.floor(Math.random()*e.length);while(r===x&&e.length>1);de(r);}else de(x-1);},[de,x,d,e.length]),re=useCallback(r=>{let v=r.currentTarget.getBoundingClientRect(),a=Math.max(0,Math.min(1,(r.clientX-v.left)/v.width))*y;Z.current&&(Z.current.currentTime=a),_(a);},[y]),Ee=useCallback(r=>{let v=r.currentTarget.getBoundingClientRect(),Y=Math.max(0,Math.min(1,(r.clientX-v.left)/v.width));ee(Y*y);},[y]),J=useCallback(()=>{te.current&&(document.fullscreenElement?document.exitFullscreen():te.current.requestFullscreen());},[]);useEffect(()=>{let r=()=>ze(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",r),()=>document.removeEventListener("fullscreenchange",r)},[]);let M=useCallback(()=>{V?(Se(true),setTimeout(()=>{he(false),Se(false);},500)):he(true);},[V]),Te=useCallback(()=>{L(r=>!r);},[]),Ye=useCallback(()=>{let r=["title","type","duration"],v=r.indexOf(K);U?be(false):(be(true),ne(r[(v+1)%r.length]));},[K,U]);useEffect(()=>{let r=v=>{if(!(v.target instanceof HTMLInputElement||v.target instanceof HTMLTextAreaElement))switch(v.key){case " ":case "k":v.preventDefault(),N(Y=>!Y);break;case "f":v.preventDefault(),J();break;case "t":v.preventDefault(),M();break;case "ArrowLeft":v.preventDefault(),Z.current&&(Z.current.currentTime=Math.max(0,w-5));break;case "ArrowRight":v.preventDefault(),Z.current&&(Z.current.currentTime=Math.min(y,w+5));break;case "ArrowUp":v.preventDefault(),X$1(Y=>Math.min(1,Y+.05));break;case "ArrowDown":v.preventDefault(),X$1(Y=>Math.max(0,Y-.05));break;case "Escape":V&&M();break;case "n":v.preventDefault(),we();break;case "p":v.preventDefault(),Ce();break;case "l":v.preventDefault(),Te();break}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[J,M,Te,we,Ce,w,y,V]);let We=y>0?w/y*100:0,at=y>0?z/y*100:0,le="text-(--accent)",fe=jsxs("div",{ref:te,className:s("group flex overflow-hidden",ce?"h-full w-full":"aspect-video w-full",!ce&&"rounded-xl",!ce&&T&&"shadow-2xl",!ce&&!T&&"animate-[cp-glow-pulse_4s_ease-in-out_infinite] will-change-[box-shadow]",S),style:{"--accent":D,background:"var(--cp-bg)"},tabIndex:0,children:[jsxs("div",{className:s("relative flex-1 min-w-0 h-full overflow-hidden",Pe&&"animate-[cp-track-transition_0.6s_ease-out]"),onMouseMove:Q,onMouseLeave:()=>{T&&Fe(false);},children:[jsx("video",{ref:Z,className:"h-full w-full object-contain",poster:P.poster,playsInline:true,preload:"metadata",onClick:()=>N(r=>!r)}),!T&&!Pe&&jsx("div",{className:"absolute inset-0 flex cursor-pointer items-center justify-center",style:{background:"var(--cp-overlay)"},onClick:()=>N(true),children:jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full backdrop-blur-md transition-transform hover:scale-110 active:scale-95",style:{background:"var(--cp-surface-hover)"},children:jsx(Play,{className:"h-10 w-10 translate-x-0.5",fill:"currentColor",style:{color:"var(--cp-text-strong)"}})})}),Pe&&!me&&jsx("div",{className:"absolute left-6 top-6 z-20 animate-[fade-in_0.4s_ease-out]",children:jsxs("div",{className:"rounded-lg px-4 py-2 backdrop-blur-md",style:{background:"var(--cp-panel-bg)"},children:[jsx("div",{className:"text-sm font-semibold",style:{color:"var(--cp-text-strong)"},children:P.title}),P.subtitle&&jsx("div",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:P.subtitle})]})}),jsx("div",{className:s("absolute inset-x-0 top-0 z-10 bg-linear-to-b from-black/70 to-transparent px-5 pb-8 pt-4 transition-opacity duration-500",me?"opacity-100":"pointer-events-none opacity-0"),children:jsxs("div",{className:"flex items-center justify-between",children:[jsxs("div",{children:[jsx("h3",{className:"text-sm font-semibold drop-shadow-md",style:{color:"var(--cp-text-strong)"},children:P.title}),P.subtitle&&jsx("p",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:P.subtitle})]}),P.type&&jsx("span",{className:"rounded-full bg-(--accent)/70 px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider backdrop-blur-sm",style:{color:"var(--cp-text-strong)"},children:P.type})]})}),jsxs("div",{className:s("absolute inset-x-0 bottom-0 z-10 bg-linear-to-t from-black/80 via-black/40 to-transparent px-4 pb-3 pt-10 transition-all duration-500",me?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:[jsxs("div",{className:"group/seek relative mb-3 h-1 cursor-pointer rounded-full transition-[height] duration-200 hover:h-1.5",style:{background:"var(--cp-seek-track)"},onClick:re,onMouseMove:Ee,onMouseLeave:()=>ee(null),children:[jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:`${at}%`,background:"var(--cp-seek-buffer)"}}),jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-(--accent) transition-[width] duration-100",style:{width:`${We}%`}}),ye!==null&&jsx("div",{className:"absolute -top-8 -translate-x-1/2 rounded px-2 py-0.5 text-[10px] font-mono",style:{left:`${ye/y*100}%`,background:"var(--cp-panel-bg)",color:"var(--cp-text-strong)"},children:ut(ye)}),jsx("div",{className:"absolute top-1/2 h-3.5 w-3.5 -translate-y-1/2 rounded-full border-2 border-(--accent) bg-white opacity-0 shadow-lg transition-opacity group-hover/seek:opacity-100",style:{left:`calc(${We}% - 7px)`}})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{className:"cp-btn",onClick:()=>N(r=>!r),title:T?"Pause (k)":"Play (k)",children:T?jsx(Pause,{className:"h-5 w-5",fill:"currentColor"}):jsx(Play,{className:"h-5 w-5 translate-x-px",fill:"currentColor"})}),jsx("button",{className:"cp-btn",onClick:Ce,title:"Previous (p)",children:jsx(SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsx("button",{className:"cp-btn",onClick:we,title:"Next (n)",children:jsx(SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxs("div",{className:"group/vol ml-1 flex items-center",children:[jsx("button",{className:"cp-btn",onClick:()=>ge(r=>!r),title:I?"Unmute":"Mute",children:I||A===0?jsx(VolumeX,{className:"h-4 w-4"}):jsx(Volume2,{className:"h-4 w-4"})}),jsx("div",{className:"flex w-0 items-center overflow-hidden transition-all duration-300 group-hover/vol:w-20",children:jsx("input",{type:"range",min:0,max:1,step:.01,value:I?0:A,onChange:r=>{X$1(Number(r.target.value)),I&&ge(false);},className:"h-1 w-full cursor-pointer appearance-none rounded-full accent-(--accent)",style:{background:"var(--cp-seek-track)"}})})]}),jsxs("span",{className:"ml-2 min-w-0 shrink-0 font-mono text-xs",style:{color:"var(--cp-text-muted)"},children:[ut(w)," / ",ut(y)]}),jsx("div",{className:"flex-1"}),jsx("button",{className:s("cp-btn",d&&le),onClick:()=>b(r=>!r),title:"Shuffle",children:jsx(Shuffle,{className:"h-4 w-4"})}),jsx("button",{className:s("cp-btn",E&&le),onClick:()=>C(r=>!r),title:"Loop",children:jsx(Repeat1,{className:"h-4 w-4"})}),jsx("button",{className:s("cp-btn",o&&le),onClick:Te,title:"Playlist",children:jsx(ListVideo,{className:"h-4 w-4"})}),jsx("button",{className:s("cp-btn",V&&le),onClick:M,title:"Cinema mode (t)",children:jsx(Theater,{className:"h-4 w-4"})}),jsx("button",{className:"cp-btn",onClick:J,title:"Fullscreen (f)",children:ce?jsx(Minimize,{className:"h-4 w-4"}):jsx(Maximize,{className:"h-4 w-4"})})]})]})]}),jsx("div",{className:s("h-full shrink-0 overflow-hidden transition-[width] duration-300 ease-out",o?"w-72":"w-0"),children:jsxs("div",{className:"flex h-full w-72 flex-col backdrop-blur-xl",style:{borderLeft:"1px solid var(--cp-border)",background:"var(--cp-panel-bg)"},children:[jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--cp-border)"},children:[jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--cp-text)"},children:"Playlist"}),jsxs("div",{className:"flex items-center gap-1",children:[jsxs("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium transition-colors",style:{color:"var(--cp-text-muted)"},onClick:Ye,title:`Sort: ${K} ${U?"\u2191":"\u2193"}`,children:[jsx(ArrowUpDown,{className:"h-3 w-3"}),K,U?" \u2191":" \u2193"]}),jsx("button",{className:"cp-btn p-1!",onClick:Te,title:"Close",children:jsx(X,{className:"h-3.5 w-3.5"})})]})]}),jsx("div",{className:"flex-1 overflow-y-auto",children:Ke.map(({media:r,originalIndex:v})=>{let Y=v===x;return jsxs("button",{className:s("flex w-full items-center gap-3 px-4 py-2.5 text-left transition-all duration-200",Y?"bg-(--accent)/20 text-(--accent)":"hover:text-(--cp-text-strong)"),style:Y?void 0:{color:"var(--cp-text)"},onClick:()=>{de(v);},children:[jsxs("div",{className:"relative h-10 w-16 shrink-0 overflow-hidden rounded",style:{background:"var(--cp-surface)"},children:[r.poster?jsx("img",{src:r.poster,alt:"",className:"h-full w-full object-cover",draggable:false}):jsx("div",{className:"flex h-full w-full items-center justify-center",children:jsx(Play,{className:"h-4 w-4",style:{color:"var(--cp-seek-track)"}})}),Y&&T&&jsx("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"var(--cp-overlay)"},children:jsx("div",{className:"flex items-end gap-px",children:[1,2,3,4].map(a=>jsx("div",{className:"w-0.5 rounded-full bg-(--accent)",style:{height:`${6+a*3}px`,animation:`mp-eq-bar ${.3+a*.12}s ease-in-out infinite alternate`}},a))})})]}),jsxs("div",{className:"min-w-0 flex-1",children:[jsx("div",{className:"truncate text-xs font-medium",children:r.title}),jsxs("div",{className:"flex items-center gap-2",children:[r.type&&jsx("span",{className:"text-[10px] uppercase tracking-wide opacity-50",children:r.type}),r.duration!=null&&jsx("span",{className:"font-mono text-[10px] opacity-40",children:ut(r.duration)})]})]}),Y&&jsx(ChevronRight,{className:"h-3.5 w-3.5 shrink-0 text-(--accent)"})]},v)})})]})}),jsx("style",{children:`
6
+ </svg>`);function or(e){if(!isFinite(e)||e<0)return "0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return `${t}:${n.toString().padStart(2,"0")}`}function Nn(e){return e.startsWith("bottom")?"bottom":e.startsWith("top")?"top":"right"}var Cn={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},Mn={"bottom-right":"bottom-4 right-0","bottom-left":"bottom-4 left-0","top-right":"top-4 right-0","top-left":"top-4 left-0"},Tn={"bottom-right":"bottom-8 right-0 w-1.5 h-16 rounded-l-full","bottom-left":"bottom-8 left-0 w-1.5 h-16 rounded-r-full","top-right":"top-8 right-0 w-1.5 h-16 rounded-l-full","top-left":"top-8 left-0 w-1.5 h-16 rounded-r-full"};function Rt({playlist:e,initialTrack:t=0,position:n="bottom-right",entrance:u,theme:f,docked:c=false,visible:d,onVisibleChange:v,onTrackChange:y,onLike:h,autoPlay:L=true,shuffle:w=false,loop:l=false,accent:m="#8b5cf6",className:P}){let [N,H]=useState(t),[E,z]=useState(false),[V,O]=useState(0),[$,me]=useState(0),[b,M]=useState(.8),[_,R]=useState(false),[s,A]=useState(new Set),[Y,ne]=useState(false),[q,ve]=useState(d??!c),[X$1,ye]=useState(false),[Xe,Fe]=useState(false),[pe,He]=useState(w),[be,Ve]=useState(l),_e=useRef(false),j=useRef(null),Ne=useRef(null),te=useRef(void 0),Z=useRef(null),re=useRef(null),he=d??q,Ee=u??Nn(n),I=e[N],J=c,fe=f==="dark"?"dark":f==="light"?"light":"",Ce="bg-(--mp-bg)",Se="text-(--mp-text)",ae="text-(--mp-text-muted)",Re="text-(--accent)",ee="border-(--mp-border)";useEffect(()=>{let i=j.current;i&&(i.src=I.src,i.load(),E&&i.play().catch(()=>{}));},[N,I.src]),useEffect(()=>{if(!L||_e.current)return;let i=j.current;if(!i)return;let F=()=>{_e.current=true,z(true),i.play().catch(()=>{});};return i.addEventListener("canplaythrough",F,{once:true}),()=>i.removeEventListener("canplaythrough",F)},[L]),useEffect(()=>{let i=j.current;i&&(E?i.play().catch(()=>{}):i.pause());},[E]),useEffect(()=>{let i=j.current;i&&(i.muted=_,re.current?re.current.gain.value=_?0:b:i.volume=b);},[b,_]),useEffect(()=>{let i=j.current;if(!i)return;let F=()=>O(i.currentTime),oe=()=>me(i.duration),Pe=()=>{be?(i.currentTime=0,i.play().catch(()=>{})):De();};return i.addEventListener("timeupdate",F),i.addEventListener("loadedmetadata",oe),i.addEventListener("ended",Pe),()=>{i.removeEventListener("timeupdate",F),i.removeEventListener("loadedmetadata",oe),i.removeEventListener("ended",Pe);}},[N,e.length]);let D=useCallback(i=>{let F=(i%e.length+e.length)%e.length;H(F),O(0),y?.(F,e[F]),he||(ve(true),v?.(true));},[e,he,y,v]),De=useCallback(()=>{if(pe){let i;do i=Math.floor(Math.random()*e.length);while(i===N&&e.length>1);D(i);}else D(N+1);},[D,N,pe,e.length]),qe=useCallback(()=>{if(pe){let i;do i=Math.floor(Math.random()*e.length);while(i===N&&e.length>1);D(i);}else D(N-1);},[D,N,pe,e.length]),Qe=useCallback(()=>{let i=s.has(N);A(F=>{let oe=new Set(F);return i?oe.delete(N):oe.add(N),oe}),h?.(N,I,!i);},[N,s,h,I]),ct=useCallback(i=>{let F=i.currentTarget.getBoundingClientRect(),Pe=Math.max(0,Math.min(1,(i.clientX-F.left)/F.width))*$;j.current&&(j.current.currentTime=Pe),O(Pe);},[$]),ce=useCallback(()=>{ye(true);let i=J?200:400;te.current=setTimeout(()=>{ye(false),ve(false),v?.(false);},i);},[J,v]);useEffect(()=>()=>{te.current&&clearTimeout(te.current);},[]),useEffect(()=>()=>{Z.current?.close();},[]);function xe(){if(Z.current||!j.current){Z.current?.resume();return}try{let i=window.AudioContext??window.webkitAudioContext;if(!i)return;let F=new i,oe=F.createGain();oe.gain.value=_?0:b,F.createMediaElementSource(j.current).connect(oe).connect(F.destination),Z.current=F,re.current=oe,F.resume();}catch{}}let a=Xe?"fade-in 0.2s ease-out both":`mp-enter-${Ee} 0.45s cubic-bezier(0.16, 1, 0.3, 1) both`,T=Xe?"fade-in 0.2s ease-in reverse both":`mp-exit-${Ee} 0.4s cubic-bezier(0.7, 0, 0.84, 0) both`,W=$>0?V/$*100:0;return J&&!he&&!X$1?jsxs(Fragment,{children:[jsx("audio",{ref:j,preload:"metadata",crossOrigin:"anonymous"}),jsxs("div",{className:o("fixed z-100 cursor-pointer transition-all duration-300",Tn[n]),style:{"--accent":m},onMouseEnter:()=>{Fe(true),ve(true),v?.(true);},children:[jsx("div",{className:o("h-full w-full rounded-full",E?"bg-(--accent)":"bg-(--mp-dock-strip)"),style:E?{animation:"mp-progress-glow 2s ease-in-out infinite",boxShadow:"0 0 12px color-mix(in srgb, var(--accent) 50%, transparent)"}:void 0}),E&&jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/30",style:{animation:"mp-pulse-ring 2s ease-out infinite"}})]})]}):!he&&!X$1?jsx("audio",{ref:j,preload:"metadata",crossOrigin:"anonymous"}):jsxs(Fragment,{children:[jsx("audio",{ref:j,preload:"metadata",crossOrigin:"anonymous"}),jsx("div",{className:o("fixed z-100",J?Mn[n]:Cn[n],fe),style:{"--accent":m,...X$1?{animation:T}:{animation:a}},onMouseEnter:()=>{J&&(te.current&&(clearTimeout(te.current),te.current=void 0),X$1&&ye(false),Fe(true));},onMouseLeave:()=>{J&&(Fe(false),ce());},children:jsxs("div",{className:o("w-[320px] overflow-hidden rounded-2xl border shadow-2xl backdrop-blur-xl",Ce,ee,J&&"rounded-none",n.endsWith("right")&&J&&"rounded-l-2xl",n.endsWith("left")&&J&&"rounded-r-2xl",P),children:[jsxs("div",{className:"relative",children:[jsx("div",{className:"absolute inset-0 overflow-hidden",children:jsx("img",{src:I.cover||Lt,alt:"",className:"h-full w-full scale-110 object-cover opacity-30 blur-2xl",draggable:false})}),jsxs("div",{className:"relative flex items-center gap-3.5 p-4 pb-3",children:[jsxs("div",{className:"relative h-14 w-14 shrink-0",children:[jsxs("div",{className:"h-14 w-14 overflow-hidden rounded-full border-2 border-white/10 shadow-lg",style:E?{animation:"mp-vinyl-spin 4s linear infinite"}:void 0,children:[jsx("img",{src:I.cover||Lt,alt:I.album??I.title,className:"h-full w-full object-cover",draggable:false}),jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsx("div",{className:"h-3 w-3 rounded-full bg-black/60 ring-1 ring-white/10"})})]}),E&&jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/20",style:{animation:"mp-pulse-ring 2.5s ease-out infinite"}})]}),jsxs("div",{className:"min-w-0 flex-1",children:[jsx("div",{className:o("truncate text-sm font-semibold",Se),children:I.title}),I.artist&&jsx("div",{className:o("truncate text-xs",ae),children:I.artist}),I.album&&jsx("div",{className:o("mt-0.5 truncate text-[10px] tracking-wide",ae,"opacity-60"),children:I.album})]}),jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[jsx("button",{className:o("rounded-full p-1.5 transition-all duration-200",s.has(N)?"text-rose-500 hover:text-rose-400":o(ae,"hover:text-rose-500")),onClick:Qe,title:"Like",children:jsx(Heart,{className:"h-4 w-4",fill:s.has(N)?"currentColor":"none"})}),jsx("button",{className:o("rounded-full p-1.5 transition-colors",ae,"hover:"+Se.split(" ")[0]),onClick:()=>ne(i=>!i),title:"Playlist",children:jsx(ListMusic,{className:"h-4 w-4"})}),!J&&jsx("button",{className:o("rounded-full p-1.5 transition-colors",ae,"hover:"+Se.split(" ")[0]),onClick:ce,title:"Dismiss",children:jsx(X,{className:"h-3.5 w-3.5"})})]})]})]}),jsxs("div",{className:"px-4",children:[jsxs("div",{ref:Ne,className:"group relative h-1.5 cursor-pointer rounded-full bg-(--mp-surface)",onClick:ct,children:[jsx("div",{className:"h-full rounded-full bg-(--accent) transition-[width] duration-150",style:{width:`${W}%`}}),jsx("div",{className:"absolute top-1/2 h-3 w-3 -translate-y-1/2 rounded-full bg-(--accent) opacity-0 shadow-md transition-opacity group-hover:opacity-100",style:{left:`calc(${W}% - 6px)`}})]}),jsxs("div",{className:o("mt-1 flex justify-between text-[10px] font-mono",ae),children:[jsx("span",{children:or(V)}),jsx("span",{children:or($)})]})]}),jsxs("div",{className:"flex items-center justify-center gap-2 px-4 pb-3 pt-1",children:[jsx("button",{className:o("rounded-full p-1.5 transition-colors",pe?Re:ae,"hover:text-(--mp-text)"),onClick:()=>He(i=>!i),title:pe?"Shuffle On":"Shuffle Off",children:jsx(Shuffle,{className:"h-3.5 w-3.5"})}),jsx("button",{className:o("rounded-full p-1.5 transition-colors",be?Re:ae,"hover:text-(--mp-text)"),onClick:()=>Ve(i=>!i),title:be?"Loop On":"Loop Off",children:jsx(Repeat1,{className:"h-3.5 w-3.5"})}),jsx("button",{className:o("rounded-full p-2 transition-colors",ae,"hover:text-(--mp-text)"),onClick:qe,title:"Previous",children:jsx(SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsx("button",{className:o("flex h-10 w-10 items-center justify-center rounded-full transition-all duration-200","bg-(--accent) text-white shadow-lg active:scale-95"),style:{boxShadow:"0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent)"},onClick:()=>{xe(),z(i=>!i);},title:E?"Pause":"Play",children:E?jsx(Pause,{className:"h-4.5 w-4.5",fill:"currentColor"}):jsx(Play,{className:"h-4.5 w-4.5 translate-x-px",fill:"currentColor"})}),jsx("button",{className:o("rounded-full p-2 transition-colors",ae,"hover:text-(--mp-text)"),onClick:De,title:"Next",children:jsx(SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxs("div",{className:"ml-2 flex items-center gap-1.5",children:[jsx("button",{className:o("rounded-full p-1 transition-colors",ae,"hover:text-(--mp-text)"),onClick:()=>{xe();let i=!_;R(i),re.current&&(re.current.gain.value=i?0:b);},title:_?"Unmute":"Mute",children:_||b===0?jsx(VolumeX,{className:"h-3.5 w-3.5"}):jsx(Volume2,{className:"h-3.5 w-3.5"})}),jsx("input",{type:"range",min:0,max:1,step:.01,value:_?0:b,onChange:i=>{xe();let F=Number(i.target.value);M(F),_&&R(false),re.current&&(re.current.gain.value=F);},className:"mp-volume-slider h-1 w-14 cursor-pointer appearance-none rounded-full bg-(--mp-surface) accent-(--accent)"})]})]}),jsx("div",{className:o("overflow-hidden transition-all duration-300 ease-in-out",Y?"max-h-60":"max-h-0"),children:jsx("div",{className:o("border-t px-2 py-2",ee),children:jsx("div",{className:"max-h-52 space-y-0.5 overflow-y-auto",children:e.map((i,F)=>{let oe=F===N;return jsxs("button",{className:o("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-all duration-200",oe?"bg-(--accent)/10 dark:bg-(--accent)/15":"hover:bg-(--mp-surface-hover)"),onClick:()=>{D(F),z(true);},children:[jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center",children:oe&&E?jsx("div",{className:"flex items-end gap-0.5",children:[1,2,3].map(Pe=>jsx("div",{className:"w-0.75 rounded-full bg-(--accent)",style:{height:`${8+Pe*4}px`,animation:`mp-eq-bar ${.4+Pe*.15}s ease-in-out infinite alternate`}},Pe))}):oe?jsx(Disc3,{className:o("h-4 w-4",Re)}):jsx("span",{className:o("text-xs font-mono",ae),children:F+1})}),jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded",children:jsx("img",{src:i.cover||Lt,alt:"",className:"h-full w-full object-cover",draggable:false})}),jsxs("div",{className:"min-w-0 flex-1",children:[jsx("div",{className:o("truncate text-xs font-medium",oe?Re:Se),children:i.title}),i.artist&&jsx("div",{className:o("truncate text-[10px]",ae),children:i.artist})]}),s.has(F)&&jsx(Heart,{className:"h-3 w-3 shrink-0 text-rose-500",fill:"currentColor"})]},F)})})})})]})})]})}function gt(e){if(!isFinite(e)||e<0)return "0:00";let t=Math.floor(e/3600),n=Math.floor(e%3600/60),u=Math.floor(e%60);return t>0?`${t}:${n.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}`:`${n}:${u.toString().padStart(2,"0")}`}var jn={title:(e,t)=>e.title.localeCompare(t.title),type:(e,t)=>(e.type??"").localeCompare(t.type??""),duration:(e,t)=>(e.duration??0)-(t.duration??0)};function zt({playlist:e,initialTrack:t=0,autoPlay:n=false,shuffle:u=false,loop:f=false,onTrackChange:c,onPlayChange:d,accent:v="#8b5cf6",className:y}){let[h,L]=useState(t),[w,l]=useState(false),[m,P]=useState(0),[N,H]=useState(0),[E,z]=useState(0),[V,O]=useState(.8),[$,me]=useState(false),[b,M]=useState(u),[_,R]=useState(f),[s,A]=useState(false),[Y,ne]=useState("title"),[q,ve]=useState(true),[X$1,ye]=useState(false),[Xe,Fe]=useState(false),[pe,He]=useState(false),[be,Ve]=useState(true),[_e,j]=useState(false),[Ne,te]=useState(null),Z=useRef(null),re=useRef(null),he=useRef(void 0),Ee=useRef(false),I=e[h],Ue=br.useMemo(()=>{let a=e.map((T,W)=>({media:T,originalIndex:W}));return a.sort((T,W)=>{let i=jn[Y](T.media,W.media);return q?i:-i}),a},[e,Y,q]);useEffect(()=>{let a=Z.current;if(!a)return;j(true),a.src=I.src,I.poster&&(a.poster=I.poster),a.load();let T=()=>{j(false),w&&a.play().catch(()=>{});};return a.addEventListener("loadeddata",T,{once:true}),()=>a.removeEventListener("loadeddata",T)},[h,I.src]),useEffect(()=>{if(!n||Ee.current)return;let a=Z.current;if(!a)return;let T=()=>{Ee.current=true,l(true),a.play().catch(()=>{});};return a.addEventListener("canplaythrough",T,{once:true}),()=>a.removeEventListener("canplaythrough",T)},[n]),useEffect(()=>{let a=Z.current;a&&(w?a.play().catch(()=>{}):a.pause(),d?.(w));},[w]),useEffect(()=>{let a=Z.current;a&&(a.volume=$?0:V);},[V,$]),useEffect(()=>{let a=Z.current;if(!a)return;let T=()=>P(a.currentTime),W=()=>H(a.duration),i=()=>{a.buffered.length>0&&z(a.buffered.end(a.buffered.length-1));},F=()=>{_?(a.currentTime=0,a.play().catch(()=>{})):Ce();};return a.addEventListener("timeupdate",T),a.addEventListener("loadedmetadata",W),a.addEventListener("progress",i),a.addEventListener("ended",F),()=>{a.removeEventListener("timeupdate",T),a.removeEventListener("loadedmetadata",W),a.removeEventListener("progress",i),a.removeEventListener("ended",F);}},[h,e.length,_]);let J=useCallback(()=>{Ve(true),he.current&&clearTimeout(he.current),he.current=setTimeout(()=>{w&&Ve(false);},3e3);},[w]);useEffect(()=>{w?J():(Ve(true),he.current&&clearTimeout(he.current));},[w,J]),useEffect(()=>()=>{he.current&&clearTimeout(he.current);},[]);let fe=useCallback(a=>{let T=(a%e.length+e.length)%e.length;L(T),P(0),l(true),c?.(T,e[T]);},[e,c]),Ce=useCallback(()=>{if(b){let a;do a=Math.floor(Math.random()*e.length);while(a===h&&e.length>1);fe(a);}else fe(h+1);},[fe,h,b,e.length]),Se=useCallback(()=>{if(b){let a;do a=Math.floor(Math.random()*e.length);while(a===h&&e.length>1);fe(a);}else fe(h-1);},[fe,h,b,e.length]),ae=useCallback(a=>{let T=a.currentTarget.getBoundingClientRect(),i=Math.max(0,Math.min(1,(a.clientX-T.left)/T.width))*N;Z.current&&(Z.current.currentTime=i),P(i);},[N]),Re=useCallback(a=>{let T=a.currentTarget.getBoundingClientRect(),W=Math.max(0,Math.min(1,(a.clientX-T.left)/T.width));te(W*N);},[N]),ee=useCallback(()=>{re.current&&(document.fullscreenElement?document.exitFullscreen():re.current.requestFullscreen());},[]);useEffect(()=>{let a=()=>He(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]);let D=useCallback(()=>{X$1?(Fe(true),setTimeout(()=>{ye(false),Fe(false);},500)):ye(true);},[X$1]),De=useCallback(()=>{A(a=>!a);},[]),qe=useCallback(()=>{let a=["title","type","duration"],T=a.indexOf(Y);q?ve(false):(ve(true),ne(a[(T+1)%a.length]));},[Y,q]);useEffect(()=>{let a=T=>{if(!(T.target instanceof HTMLInputElement||T.target instanceof HTMLTextAreaElement))switch(T.key){case " ":case "k":T.preventDefault(),l(W=>!W);break;case "f":T.preventDefault(),ee();break;case "t":T.preventDefault(),D();break;case "ArrowLeft":T.preventDefault(),Z.current&&(Z.current.currentTime=Math.max(0,m-5));break;case "ArrowRight":T.preventDefault(),Z.current&&(Z.current.currentTime=Math.min(N,m+5));break;case "ArrowUp":T.preventDefault(),O(W=>Math.min(1,W+.05));break;case "ArrowDown":T.preventDefault(),O(W=>Math.max(0,W-.05));break;case "Escape":X$1&&D();break;case "n":T.preventDefault(),Ce();break;case "p":T.preventDefault(),Se();break;case "l":T.preventDefault(),De();break}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[ee,D,De,Ce,Se,m,N,X$1]);let Qe=N>0?m/N*100:0,ct=N>0?E/N*100:0,ce="text-(--accent)",xe=jsxs("div",{ref:re,className:o("group flex overflow-hidden",pe?"h-full w-full":"aspect-video w-full",!pe&&"rounded-xl",!pe&&w&&"shadow-2xl",!pe&&!w&&"animate-[cp-glow-pulse_4s_ease-in-out_infinite] will-change-[box-shadow]",y),style:{"--accent":v,background:"var(--cp-bg)"},tabIndex:0,children:[jsxs("div",{className:o("relative flex-1 min-w-0 h-full overflow-hidden",_e&&"animate-[cp-track-transition_0.6s_ease-out]"),onMouseMove:J,onMouseLeave:()=>{w&&Ve(false);},children:[jsx("video",{ref:Z,className:"h-full w-full object-contain",poster:I.poster,playsInline:true,preload:"metadata",onClick:()=>l(a=>!a)}),!w&&!_e&&jsx("div",{className:"absolute inset-0 flex cursor-pointer items-center justify-center",style:{background:"var(--cp-overlay)"},onClick:()=>l(true),children:jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full backdrop-blur-md transition-transform hover:scale-110 active:scale-95",style:{background:"var(--cp-surface-hover)"},children:jsx(Play,{className:"h-10 w-10 translate-x-0.5",fill:"currentColor",style:{color:"var(--cp-text-strong)"}})})}),_e&&!be&&jsx("div",{className:"absolute left-6 top-6 z-20 animate-[fade-in_0.4s_ease-out]",children:jsxs("div",{className:"rounded-lg px-4 py-2 backdrop-blur-md",style:{background:"var(--cp-panel-bg)"},children:[jsx("div",{className:"text-sm font-semibold",style:{color:"var(--cp-text-strong)"},children:I.title}),I.subtitle&&jsx("div",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:I.subtitle})]})}),jsx("div",{className:o("absolute inset-x-0 top-0 z-10 bg-linear-to-b from-black/70 to-transparent px-5 pb-8 pt-4 transition-opacity duration-500",be?"opacity-100":"pointer-events-none opacity-0"),children:jsxs("div",{className:"flex items-center justify-between",children:[jsxs("div",{children:[jsx("h3",{className:"text-sm font-semibold drop-shadow-md",style:{color:"var(--cp-text-strong)"},children:I.title}),I.subtitle&&jsx("p",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:I.subtitle})]}),I.type&&jsx("span",{className:"rounded-full bg-(--accent)/70 px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider backdrop-blur-sm",style:{color:"var(--cp-text-strong)"},children:I.type})]})}),jsxs("div",{className:o("absolute inset-x-0 bottom-0 z-10 bg-linear-to-t from-black/80 via-black/40 to-transparent px-4 pb-3 pt-10 transition-all duration-500",be?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:[jsxs("div",{className:"group/seek relative mb-3 h-1 cursor-pointer rounded-full transition-[height] duration-200 hover:h-1.5",style:{background:"var(--cp-seek-track)"},onClick:ae,onMouseMove:Re,onMouseLeave:()=>te(null),children:[jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:`${ct}%`,background:"var(--cp-seek-buffer)"}}),jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-(--accent) transition-[width] duration-100",style:{width:`${Qe}%`}}),Ne!==null&&jsx("div",{className:"absolute -top-8 -translate-x-1/2 rounded px-2 py-0.5 text-[10px] font-mono",style:{left:`${Ne/N*100}%`,background:"var(--cp-panel-bg)",color:"var(--cp-text-strong)"},children:gt(Ne)}),jsx("div",{className:"absolute top-1/2 h-3.5 w-3.5 -translate-y-1/2 rounded-full border-2 border-(--accent) bg-white opacity-0 shadow-lg transition-opacity group-hover/seek:opacity-100",style:{left:`calc(${Qe}% - 7px)`}})]}),jsxs("div",{className:"flex items-center gap-1",children:[jsx("button",{className:"cp-btn",onClick:()=>l(a=>!a),title:w?"Pause (k)":"Play (k)",children:w?jsx(Pause,{className:"h-5 w-5",fill:"currentColor"}):jsx(Play,{className:"h-5 w-5 translate-x-px",fill:"currentColor"})}),jsx("button",{className:"cp-btn",onClick:Se,title:"Previous (p)",children:jsx(SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsx("button",{className:"cp-btn",onClick:Ce,title:"Next (n)",children:jsx(SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxs("div",{className:"group/vol ml-1 flex items-center",children:[jsx("button",{className:"cp-btn",onClick:()=>me(a=>!a),title:$?"Unmute":"Mute",children:$||V===0?jsx(VolumeX,{className:"h-4 w-4"}):jsx(Volume2,{className:"h-4 w-4"})}),jsx("div",{className:"flex w-0 items-center overflow-hidden transition-all duration-300 group-hover/vol:w-20",children:jsx("input",{type:"range",min:0,max:1,step:.01,value:$?0:V,onChange:a=>{O(Number(a.target.value)),$&&me(false);},className:"h-1 w-full cursor-pointer appearance-none rounded-full accent-(--accent)",style:{background:"var(--cp-seek-track)"}})})]}),jsxs("span",{className:"ml-2 min-w-0 shrink-0 font-mono text-xs",style:{color:"var(--cp-text-muted)"},children:[gt(m)," / ",gt(N)]}),jsx("div",{className:"flex-1"}),jsx("button",{className:o("cp-btn",b&&ce),onClick:()=>M(a=>!a),title:"Shuffle",children:jsx(Shuffle,{className:"h-4 w-4"})}),jsx("button",{className:o("cp-btn",_&&ce),onClick:()=>R(a=>!a),title:"Loop",children:jsx(Repeat1,{className:"h-4 w-4"})}),jsx("button",{className:o("cp-btn",s&&ce),onClick:De,title:"Playlist",children:jsx(ListVideo,{className:"h-4 w-4"})}),jsx("button",{className:o("cp-btn",X$1&&ce),onClick:D,title:"Cinema mode (t)",children:jsx(Theater,{className:"h-4 w-4"})}),jsx("button",{className:"cp-btn",onClick:ee,title:"Fullscreen (f)",children:pe?jsx(Minimize,{className:"h-4 w-4"}):jsx(Maximize,{className:"h-4 w-4"})})]})]})]}),jsx("div",{className:o("h-full shrink-0 overflow-hidden transition-[width] duration-300 ease-out",s?"w-72":"w-0"),children:jsxs("div",{className:"flex h-full w-72 flex-col backdrop-blur-xl",style:{borderLeft:"1px solid var(--cp-border)",background:"var(--cp-panel-bg)"},children:[jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--cp-border)"},children:[jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--cp-text)"},children:"Playlist"}),jsxs("div",{className:"flex items-center gap-1",children:[jsxs("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-[10px] font-medium transition-colors",style:{color:"var(--cp-text-muted)"},onClick:qe,title:`Sort: ${Y} ${q?"\u2191":"\u2193"}`,children:[jsx(ArrowUpDown,{className:"h-3 w-3"}),Y,q?" \u2191":" \u2193"]}),jsx("button",{className:"cp-btn p-1!",onClick:De,title:"Close",children:jsx(X,{className:"h-3.5 w-3.5"})})]})]}),jsx("div",{className:"flex-1 overflow-y-auto",children:Ue.map(({media:a,originalIndex:T})=>{let W=T===h;return jsxs("button",{className:o("flex w-full items-center gap-3 px-4 py-2.5 text-left transition-all duration-200",W?"bg-(--accent)/20 text-(--accent)":"hover:text-(--cp-text-strong)"),style:W?void 0:{color:"var(--cp-text)"},onClick:()=>{fe(T);},children:[jsxs("div",{className:"relative h-10 w-16 shrink-0 overflow-hidden rounded",style:{background:"var(--cp-surface)"},children:[a.poster?jsx("img",{src:a.poster,alt:"",className:"h-full w-full object-cover",draggable:false}):jsx("div",{className:"flex h-full w-full items-center justify-center",children:jsx(Play,{className:"h-4 w-4",style:{color:"var(--cp-seek-track)"}})}),W&&w&&jsx("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"var(--cp-overlay)"},children:jsx("div",{className:"flex items-end gap-px",children:[1,2,3,4].map(i=>jsx("div",{className:"w-0.5 rounded-full bg-(--accent)",style:{height:`${6+i*3}px`,animation:`mp-eq-bar ${.3+i*.12}s ease-in-out infinite alternate`}},i))})})]}),jsxs("div",{className:"min-w-0 flex-1",children:[jsx("div",{className:"truncate text-xs font-medium",children:a.title}),jsxs("div",{className:"flex items-center gap-2",children:[a.type&&jsx("span",{className:"text-[10px] uppercase tracking-wide opacity-50",children:a.type}),a.duration!=null&&jsx("span",{className:"font-mono text-[10px] opacity-40",children:gt(a.duration)})]})]}),W&&jsx(ChevronRight,{className:"h-3.5 w-3.5 shrink-0 text-(--accent)"})]},T)})})]})}),jsx("style",{children:`
7
7
  .cp-btn {
8
8
  display: flex;
9
9
  align-items: center;
@@ -19,7 +19,7 @@ import ln,{createContext,useState,useCallback,useRef,useLayoutEffect,useEffect,u
19
19
  0%, 100% { box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 25%, transparent), 0 25px 50px -12px rgba(0,0,0,0.25); }
20
20
  50% { box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 55%, transparent), 0 25px 50px -12px rgba(0,0,0,0.25); }
21
21
  }
22
- `})]});return jsx("div",{className:s(V&&"fixed inset-0 z-100 flex items-center justify-center p-8",V&&($e?"animate-[cp-cinema-out_0.5s_ease-in_both]":"animate-[cp-cinema-in_0.5s_ease-out_both]")),onClick:V?r=>{r.target===r.currentTarget&&M();}:void 0,children:jsx("div",{className:s(V&&"w-full",V&&!ce&&"max-w-5xl"),children:fe})})}var Lt=cva("rounded-lg bg-white p-6 shadow-xl dark:bg-primary-900",{variants:{size:{sm:"w-full max-w-sm",md:"w-full max-w-lg",lg:"w-full max-w-2xl",xl:"w-full max-w-4xl",full:"h-[calc(100vh-4rem)] w-[calc(100vw-4rem)]"}},defaultVariants:{size:"md"}});cva("absolute z-50 rounded px-2 py-1 text-xs shadow-md animate-fade-in",{variants:{intent:{default:"bg-primary-900 text-white dark:bg-primary-100 dark:text-primary-900",light:"border border-primary-200 bg-white text-primary-700 dark:border-primary-600 dark:bg-primary-800 dark:text-primary-200"}},defaultVariants:{intent:"default"}});var He=[];function Cr(e){He.push(e);}function Mr(e){let n=He.indexOf(e);n!==-1&&He.splice(n,1);}function Rt(e){return He.length>0&&He[He.length-1]===e}function Er(e){let n=He.indexOf(e);return n!==-1?n:He.length}var Jt=createContext(null);function en({open:e,onOpenChange:n,modal:i=true,closeOnOutsideClick:g=false,children:k}){let m=useId();return useEffect(()=>{if(e)return Cr(m),()=>Mr(m)},[e,m]),useEffect(()=>{if(!e||!i)return;let h=D=>{D.key==="Escape"&&Rt(m)&&n(false);};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,i,n,m]),useEffect(()=>{if(!e||!i)return;let h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h;}},[e,i]),e?jsx(Jt.Provider,{value:{id:m,onOpenChange:n,modal:i,closeOnOutsideClick:g},children:createPortal(k,document.body)}):null}function tn({size:e,position:n="center",className:i,children:g,...k}){let m=useContext(Jt);if(!m)return null;let D=200+Er(m.id)*10,S=()=>{m.closeOnOutsideClick&&Rt(m.id)&&m.onOpenChange(false);},x=n==="bottom";return m.modal?jsx("div",{className:s("animate-fade-in fixed inset-0 bg-black/50",x?"flex items-end justify-center":"flex items-center justify-center p-4"),style:{zIndex:D},onClick:S,children:jsx("div",{className:s(Lt({size:e}),x?"animate-slide-in-bottom w-full rounded-b-none rounded-t-(--dialog-sheet-radius) max-h-[85vh] overflow-y-auto":"animate-scale-in",i),role:"dialog","aria-modal":"true",onClick:j=>j.stopPropagation(),...k,children:g})}):jsx("div",{className:s("fixed inset-0 flex items-center justify-center p-4",m.closeOnOutsideClick?"pointer-events-auto":"pointer-events-none"),style:{zIndex:D},onClick:m.closeOnOutsideClick&&Rt(m.id)?()=>m.onOpenChange(false):void 0,children:jsx("div",{className:s(Lt({size:e}),"animate-scale-in pointer-events-auto shadow-2xl",i),role:"dialog",onClick:m.closeOnOutsideClick?j=>j.stopPropagation():void 0,...k,children:g})})}function nn({className:e,...n}){return jsx("div",{className:s("mb-4 space-y-1",e),...n})}function rn({className:e,...n}){return jsx("h2",{className:s("text-primary-900 dark:text-primary-100 flex items-center gap-1.5 text-lg font-semibold [&_svg]:h-5 [&_svg]:w-5 [&_svg]:shrink-0",e),...n})}function on({className:e,...n}){return jsx("p",{className:s("text-primary-500 dark:text-primary-400 text-sm",e),...n})}function an({className:e,...n}){return jsx("div",{className:s("mt-6 flex justify-end gap-2",e),...n})}var sn=cva("inline-flex cursor-pointer items-center justify-center gap-1.5 rounded font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0",{variants:{intent:{primary:"bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-700",secondary:"bg-secondary-500 text-white hover:bg-secondary-600 active:bg-secondary-700",danger:"bg-danger-500 text-white hover:bg-danger-600 active:bg-danger-700",warning:"bg-warning-500 text-white hover:bg-warning-600 active:bg-warning-700",ghost:"bg-transparent text-primary-700 hover:bg-primary-100 active:bg-primary-200 dark:text-primary-300 dark:hover:bg-primary-800",outline:"border border-primary-300 bg-transparent text-primary-700 hover:bg-primary-50 dark:border-primary-600 dark:text-primary-300 dark:hover:bg-primary-800"},size:{sm:"h-7 px-3 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"h-9 px-4 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"h-11 px-6 text-base [&_svg]:h-5 [&_svg]:w-5"}},defaultVariants:{intent:"primary",size:"md"}});cva("inline-flex items-center gap-1 rounded border font-semibold [&_svg]:shrink-0",{variants:{intent:{success:"border-success-200 bg-success-100 text-success-800 dark:border-success-800 dark:bg-success-900/30 dark:text-success-400",warning:"border-warning-200 bg-warning-100 text-warning-800 dark:border-warning-800 dark:bg-warning-900/30 dark:text-warning-400",error:"border-danger-200 bg-danger-100 text-danger-800 dark:border-danger-800 dark:bg-danger-900/30 dark:text-danger-400",info:"border-primary-200 bg-primary-100 text-primary-800 dark:border-primary-800 dark:bg-primary-900/30 dark:text-primary-400",primary:"border-secondary-200 bg-secondary-100 text-secondary-700 dark:border-secondary-700 dark:bg-secondary-800 dark:text-secondary-300"},size:{sm:"px-1.5 py-0 text-[0.625rem] [&_svg]:h-2.5 [&_svg]:w-2.5",md:"px-2.5 py-0.5 text-xs [&_svg]:h-3 [&_svg]:w-3",lg:"px-3 py-1 text-sm [&_svg]:h-3.5 [&_svg]:w-3.5"}},defaultVariants:{intent:"primary",size:"md"}});cva("absolute flex items-center justify-center rounded-full font-bold leading-none ring-2 ring-white select-none pointer-events-none z-10 dark:ring-primary-900",{variants:{intent:{danger:"bg-danger-500 text-white",success:"bg-success-500 text-white",warning:"bg-warning-500 text-white",info:"bg-primary-500 text-white",primary:"bg-secondary-500 text-white"},size:{sm:"text-[0.5rem]",md:"text-[0.625rem]",lg:"text-xs"},dot:{true:"",false:""},placement:{"top-right":"top-0 right-0 translate-x-1/2 -translate-y-1/2","top-left":"top-0 left-0 -translate-x-1/2 -translate-y-1/2","bottom-right":"bottom-0 right-0 translate-x-1/2 translate-y-1/2","bottom-left":"bottom-0 left-0 -translate-x-1/2 translate-y-1/2"}},compoundVariants:[{dot:true,size:"sm",class:"h-1.5 w-1.5 min-w-0 ring-1"},{dot:true,size:"md",class:"h-2 w-2 min-w-0"},{dot:true,size:"lg",class:"h-2.5 w-2.5 min-w-0"},{dot:false,size:"sm",class:"h-4 min-w-4 px-1"},{dot:false,size:"md",class:"h-5 min-w-5 px-1.5"},{dot:false,size:"lg",class:"h-6 min-w-6 px-2"}],defaultVariants:{intent:"danger",size:"md",dot:false,placement:"top-right"}});cva("w-full rounded-md border bg-white text-secondary-900 transition-colors placeholder:text-secondary-400 focus:outline-none focus:ring-2 dark:bg-secondary-900 dark:text-secondary-100 dark:placeholder:text-secondary-600",{variants:{state:{default:"border-secondary-300 focus:border-primary-500 focus:ring-primary-500/20 dark:border-secondary-600",error:"border-danger-400 focus:border-danger-500 focus:ring-danger-500/20"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 py-2 text-sm",lg:"h-11 px-4 py-2.5 text-base"}},defaultVariants:{state:"default",size:"md"}});cva("inline-flex items-center gap-1 font-medium [&_svg]:shrink-0",{variants:{size:{sm:"text-xs [&_svg]:h-3 [&_svg]:w-3",md:"text-sm [&_svg]:h-3.5 [&_svg]:w-3.5",lg:"text-base [&_svg]:h-4 [&_svg]:w-4"},intent:{default:"text-primary-700 dark:text-primary-300",muted:"text-primary-400 dark:text-primary-500",required:"text-primary-700 dark:text-primary-300 after:ml-0.5 after:text-danger-500 after:content-['*']"}},defaultVariants:{size:"md",intent:"default"}});cva("relative inline-flex shrink-0 items-center justify-center rounded border-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:"border-primary-300 dark:border-primary-600 focus-visible:ring-primary-500/40",secondary:"border-secondary-300 dark:border-secondary-600 focus-visible:ring-secondary-500/40",danger:"border-danger-300 dark:border-danger-600 focus-visible:ring-danger-500/40",warning:"border-warning-300 dark:border-warning-600 focus-visible:ring-warning-500/40",success:"border-success-300 dark:border-success-600 focus-visible:ring-success-500/40"},size:{sm:"h-4 w-4 rounded-[3px]",md:"h-5 w-5 rounded",lg:"h-6 w-6 rounded-[5px]"},checked:{on:"",off:"bg-white dark:bg-primary-900"}},compoundVariants:[{intent:"primary",checked:"on",class:"border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"border-secondary-500 bg-secondary-500 dark:border-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"border-danger-500 bg-danger-500 dark:border-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"border-warning-500 bg-warning-500 dark:border-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"border-success-500 bg-success-500 dark:border-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}});cva("relative inline-flex shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:"border-primary-300 dark:border-primary-600 focus-visible:ring-primary-500/40",secondary:"border-secondary-300 dark:border-secondary-600 focus-visible:ring-secondary-500/40",danger:"border-danger-300 dark:border-danger-600 focus-visible:ring-danger-500/40",warning:"border-warning-300 dark:border-warning-600 focus-visible:ring-warning-500/40",success:"border-success-300 dark:border-success-600 focus-visible:ring-success-500/40"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},checked:{on:"",off:"bg-white dark:bg-primary-900"}},compoundVariants:[{intent:"primary",checked:"on",class:"border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"border-secondary-500 bg-secondary-500 dark:border-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"border-danger-500 bg-danger-500 dark:border-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"border-warning-500 bg-warning-500 dark:border-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"border-success-500 bg-success-500 dark:border-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}});cva("",{variants:{intent:{primary:"",secondary:"",danger:"",warning:"",success:""},size:{sm:"",md:"",lg:""},checked:{on:"",off:"bg-primary-300 dark:bg-primary-800"}},compoundVariants:[{intent:"primary",checked:"on",class:"bg-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"bg-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"bg-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"bg-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"bg-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}});function Dt({intent:e,size:n,className:i,...g}){return jsx("button",{className:s(sn({intent:e,size:n}),i),...g})}function mt(e){let n=e.lastIndexOf(".");return n>0?e.slice(n).toLowerCase():""}function mn(e){return e==null?"\u2014":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function At(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"\u2014"}var Vr={".png":Image,".jpg":Image,".jpeg":Image,".gif":Image,".svg":Image,".webp":Image,".ico":Image,".bmp":Image,".mp3":Music,".wav":Music,".flac":Music,".ogg":Music,".aac":Music,".m4a":Music,".mp4":Video,".mkv":Video,".avi":Video,".mov":Video,".wmv":Video,".webm":Video,".ts":FileCode,".tsx":FileCode,".js":FileCode,".jsx":FileCode,".json":FileCode,".html":FileCode,".css":FileCode,".scss":FileCode,".py":FileCode,".rs":FileCode,".go":FileCode,".java":FileCode,".c":FileCode,".cpp":FileCode,".h":FileCode,".sh":Terminal,".bat":Terminal,".ps1":Terminal,".md":FileText,".txt":FileText,".pdf":FileText,".doc":FileText,".docx":FileText,".rtf":FileText,".csv":FileSpreadsheet,".xls":FileSpreadsheet,".xlsx":FileSpreadsheet,".db":Database,".sqlite":Database,".sql":Database,".zip":FileArchive,".tar":FileArchive,".gz":FileArchive,".rar":FileArchive,".7z":FileArchive};function It(e){if(e.type==="directory")return Folder;let n=e.extension||mt(e.name);return Vr[n]||File}function rt(e,n,i){return Math.max(n,Math.min(i,e))}function pn(e){return e<480?"xs":e<640?"sm":e<1024?"md":"lg"}function fn(e,n){if(e<480)return {size:{width:e-16,height:n-48},pos:{x:8,y:24}};if(e<640){let k=e-24,m=Math.min(n-64,540);return {size:{width:k,height:m},pos:{x:12,y:32}}}if(e<1024){let k=Math.min(640,e-32),m=Math.min(480,n-64);return {size:{width:k,height:m},pos:{x:Math.max(0,Math.round((e-k)/2)),y:Math.max(0,Math.round((n-m)/2))}}}let i=720,g=520;return {size:{width:i,height:g},pos:{x:Math.max(0,Math.round((e-i)/2)),y:Math.max(0,Math.round((n-g)/2))}}}function Ht({files:e,title:n="File Explorer",accent:i="#8b5cf6",defaultView:g="list",initialPosition:k,initialSize:m,dockable:h=false,dockSide:D="right",visible:S=true,onFileOpen:x,onSelectionChange:j,onNavigate:T,onDelete:N,onClose:w,onMinimize:_,onPathSubmit:y,defaultInputMode:B="search",actions:z,resizable:G=true,minSize:A={width:400,height:300},className:X$1}){let[I,ge]=useState(g),[d,b]=useState(new Set),[E,C]=useState(null),[o,L]=useState(false),[K,ne]=useState(false),[U,be]=useState(""),[V,he]=useState(B),[$e,Se]=useState(S),[ce,ze]=useState(false),[me,Fe]=useState({w:window.innerWidth,h:window.innerHeight}),Pe=fn(window.innerWidth,window.innerHeight),[F,ye]=useState(k??Pe.pos),[ee,Z]=useState(m??Pe.size),[te,pe]=useState(null),Ne=useRef(false),P=useRef({x:0,y:0}),Ke=useRef(null),Q=useRef(false),de=useRef({x:0,y:0,w:0,h:0,px:0,py:0}),we=useRef(false),Ce=useRef(o);useEffect(()=>{Ce.current=o;},[o]);let re=S!==void 0?S:$e,Ee=useMemo(()=>{let t=e.filter(H=>H.type==="directory"),p=e.filter(H=>H.type==="file");return t.sort((H,O)=>H.name.localeCompare(O.name)),p.sort((H,O)=>H.name.localeCompare(O.name)),[...t,...p]},[e]),J=useMemo(()=>{if(V!=="search"||!U.trim())return Ee;let t=U.toLowerCase();return Ee.filter(p=>p.name.toLowerCase().includes(t))},[Ee,U,V]),M=E!=null?J[E]:null;useEffect(()=>{let t=pn(window.innerWidth),p=()=>{let H=window.innerWidth,O=window.innerHeight;if(Fe({w:H,h:O}),Ce.current)return;let q=pn(H);if(q!==t&&!we.current&&!m){let ke=fn(H,O);Z(ke.size),ye(ke.pos);}t=q;};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[m]);let Te=useCallback((t,p)=>{b(H=>{let O=new Set(H);return p.ctrlKey||p.metaKey?O.has(t)?O.delete(t):O.add(t):(O.clear(),O.add(t)),O}),C(t);},[]);useEffect(()=>{if(!j)return;let t=Array.from(d).map(p=>J[p]).filter(Boolean);j(t);},[d]);let Ye=useCallback(t=>{let p=J[t];p&&(p.type==="directory"?T?.(p.path):x?.(p));},[J,x,T]),We=useCallback(t=>{o||t.target.closest("button")||(we.current=true,Ne.current=true,P.current={x:t.clientX-F.x,y:t.clientY-F.y},t.preventDefault());},[F,o]),at=useCallback(t=>{if(o||t.target.closest("button"))return;we.current=true;let p=t.touches[0];Ne.current=true,P.current={x:p.clientX-F.x,y:p.clientY-F.y};},[F,o]);useEffect(()=>{let t=O=>{if(!Ne.current)return;let q=window.innerWidth-100,ke=window.innerHeight-40;ye({x:rt(O.clientX-P.current.x,0,q),y:rt(O.clientY-P.current.y,0,ke)});},p=O=>{if(!Ne.current)return;O.preventDefault();let q=O.touches[0],ke=window.innerWidth-100,je=window.innerHeight-40;ye({x:rt(q.clientX-P.current.x,0,ke),y:rt(q.clientY-P.current.y,0,je)});},H=()=>{Ne.current=false,Q.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",H),window.addEventListener("touchmove",p,{passive:false}),window.addEventListener("touchend",H),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",H),window.removeEventListener("touchmove",p),window.removeEventListener("touchend",H);}},[]);let le=useCallback((t,p)=>{o||(p.preventDefault(),p.stopPropagation(),we.current=true,Q.current=t,de.current={x:p.clientX,y:p.clientY,w:ee.width,h:ee.height,px:F.x,py:F.y},document.body.style.cursor=t==="e"||t==="w"?"ew-resize":t==="n"||t==="s"?"ns-resize":t==="nw"||t==="se"?"nwse-resize":"nesw-resize",document.body.style.userSelect="none");},[o,ee,F]),fe=useCallback((t,p)=>{if(o)return;p.preventDefault(),p.stopPropagation(),we.current=true;let H=p.touches[0];Q.current=t,de.current={x:H.clientX,y:H.clientY,w:ee.width,h:ee.height,px:F.x,py:F.y},document.body.style.userSelect="none";},[o,ee,F]);useEffect(()=>{let t=(q,ke)=>{let je=Q.current;if(!je)return;let jt=q-de.current.x,Bt=ke-de.current.y,{w:Ge,h:Ue,px:vt,py:yt}=de.current;if(je.includes("e")&&(Ge=Math.max(A.width,Ge+jt)),je.includes("w")){let st=Math.max(A.width,Ge-jt);vt=vt+(Ge-st),Ge=st;}if(je.includes("s")&&(Ue=Math.max(A.height,Ue+Bt)),je.includes("n")){let st=Math.max(A.height,Ue-Bt);yt=yt+(Ue-st),Ue=st;}Z({width:Ge,height:Ue}),ye({x:vt,y:yt});},p=q=>{Q.current&&t(q.clientX,q.clientY);},H=q=>{Q.current&&(q.preventDefault(),t(q.touches[0].clientX,q.touches[0].clientY));},O=()=>{Q.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",p),window.addEventListener("mouseup",O),window.addEventListener("touchmove",H,{passive:false}),window.addEventListener("touchend",O),()=>{window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",O),window.removeEventListener("touchmove",H),window.removeEventListener("touchend",O);}},[A]);let r=useCallback(()=>{o?(te&&(ye(te.pos),Z(te.size)),L(false)):(pe({pos:F,size:ee}),L(true));},[o,F,ee,te]),v=useCallback(()=>{K?ne(false):(o&&(L(false),te&&(ye(te.pos),Z(te.size))),ne(true),_?.());},[K,o,te,_]);useEffect(()=>{if(!re||K)return;let t=p=>{if(!(!Ke.current?.contains(document.activeElement)&&document.activeElement!==Ke.current)){if(p.key==="Escape"&&(C(null),b(new Set)),p.ctrlKey&&p.key==="a"){p.preventDefault();let H=new Set(J.map((O,q)=>q));b(H);}p.key==="Delete"&&d.size>0&&N&&(p.preventDefault(),ze(true));}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[re,K,J,d,N]);let Y={"--fe-accent":i};if(K)return jsx("div",{className:s("fixed z-100 cursor-pointer transition-all duration-300",D==="right"?"right-0 top-1/2 -translate-y-1/2":"left-0 top-1/2 -translate-y-1/2"),style:Y,onClick:()=>ne(false),title:`Restore ${n}`,children:jsxs("div",{className:"fe-dock flex items-center gap-1.5 rounded-l-lg px-2 py-3 backdrop-blur-md",style:{writingMode:"vertical-rl",textOrientation:"mixed"},children:[jsx(HardDrive,{className:"h-3.5 w-3.5 text-(--fe-accent)"}),jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-(--fe-text)",children:n})]})});if(!re)return null;let a=o?me.w:Math.min(ee.width,me.w-8),R=o?me.h:Math.min(ee.height,me.h-8),oe=o?0:rt(F.x,0,Math.max(0,me.w-a)),Me=o?0:rt(F.y,0,Math.max(0,me.h-40)),xt=a<500;return jsxs("div",{ref:Ke,className:s("fe-window fixed z-100 flex flex-col overflow-hidden","rounded-xl border border-(--fe-border)","animate-[fe-window-in_0.35s_cubic-bezier(0.16,1,0.3,1)_both]",o&&"rounded-none",X$1),style:{...Y,left:oe,top:Me,width:a,height:R,transition:o?"left 0.3s, top 0.3s, width 0.3s, height 0.3s":void 0},tabIndex:0,children:[jsxs("div",{className:"fe-titlebar group/titlebar flex h-10 shrink-0 cursor-grab items-center justify-between px-3 select-none active:cursor-grabbing",onMouseDown:We,onTouchStart:at,onDoubleClick:r,children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:"color-mix(in srgb, var(--fe-accent) 25%, transparent)"},children:jsx(HardDrive,{className:"h-3 w-3 text-(--fe-accent)"})}),jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-(--fe-text)",children:n}),jsx("div",{className:"ml-2 hidden h-px w-20 md:block",style:{background:"linear-gradient(90deg, var(--fe-accent), transparent)",opacity:.3}})]}),jsxs("div",{className:"flex items-center gap-0.5",children:[jsx("button",{className:"fe-btn mr-1",onClick:()=>ge(t=>t==="list"?"grid":"list"),title:I==="list"?"Grid view":"List view",children:I==="list"?jsx(LayoutGrid,{className:"h-3.5 w-3.5"}):jsx(LayoutList,{className:"h-3.5 w-3.5"})}),h&&jsx("button",{className:"fe-btn",onClick:v,title:"Dock to edge",children:jsx(Minus,{className:"h-3.5 w-3.5"})}),jsx("button",{className:"fe-btn",onClick:r,title:o?"Restore":"Maximize",children:o?jsx(Minimize2,{className:"h-3.5 w-3.5"}):jsx(Maximize2,{className:"h-3.5 w-3.5"})}),jsx("button",{className:"fe-btn hover:bg-red-500/40! hover:text-red-300!",onClick:()=>{w?.(),Se(false);},title:"Close",children:jsx(X,{className:"h-3.5 w-3.5"})})]})]}),jsxs("div",{className:"fe-toolbar flex h-9 shrink-0 items-center gap-2 px-3",children:[jsx("button",{className:"fe-btn p-1",onClick:()=>T?.(".."),title:"Go up",children:jsx(FolderUp,{className:"h-3.5 w-3.5"})}),jsx("button",{className:"fe-btn shrink-0 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider",style:V==="navigate"?{color:"var(--fe-accent)",background:"color-mix(in srgb, var(--fe-accent) 15%, transparent)"}:void 0,onClick:()=>he(t=>t==="search"?"navigate":"search"),title:V==="search"?"Switch to path navigation":"Switch to file search",children:V==="search"?jsx(Search,{className:"h-3 w-3"}):jsx(CornerRightDown,{className:"h-3 w-3"})}),jsx("div",{className:"relative flex-1",children:jsx("input",{type:"text",value:U,onChange:t=>be(t.target.value),onKeyDown:t=>{t.key==="Enter"&&U.trim()&&V==="navigate"&&(y?y(U.trim()):T?.(U.trim()));},placeholder:V==="search"?"Search files\u2026":"Enter path and press Enter\u2026",className:"h-6 w-full rounded border border-(--fe-input-border) bg-(--fe-input-bg) px-2 text-[11px] text-(--fe-text-strong) placeholder:text-(--fe-text-muted) outline-none transition-colors focus:border-(--fe-accent)/40 focus:bg-(--fe-input-bg)"})}),jsxs("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:[J.length," item",J.length!==1?"s":"",d.size>0&&` \xB7 ${d.size} selected`]})]}),jsxs("div",{className:"relative flex flex-1 min-h-0",children:[jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-1.5",onClick:t=>{t.target===t.currentTarget&&(b(new Set),C(null));},children:J.length===0?jsxs("div",{className:"flex h-full flex-col items-center justify-center text-(--fe-text-muted)",children:[jsx(Folder,{className:"mb-2 h-10 w-10"}),jsx("span",{className:"text-xs",children:"No files found"})]}):I==="list"?jsx("div",{className:"space-y-px",children:J.map((t,p)=>{let H=It(t),O=d.has(p),q=t.extension||mt(t.name);return jsxs("div",{className:s("fe-item group/item flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-(--fe-text) transition-all duration-150 cursor-pointer",O?"bg-(--fe-accent)/15 text-(--fe-text-strong)":"hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),style:O?{boxShadow:"inset 2px 0 0 var(--fe-accent)"}:void 0,onClick:ke=>Te(p,ke),onDoubleClick:()=>Ye(p),children:[jsx(H,{className:s("h-4 w-4 shrink-0",t.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsx("span",{className:"flex-1 truncate text-xs font-medium",children:t.name}),q&&t.type==="file"&&jsx("span",{className:"shrink-0 rounded bg-(--fe-badge-bg) px-1.5 py-0.5 font-mono text-[9px] uppercase text-(--fe-text-muted)",children:q}),t.size!=null&&jsx("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:mn(t.size)}),t.modifiedAt&&jsx("span",{className:"hidden shrink-0 font-mono text-[10px] text-(--fe-text-muted) lg:inline",children:At(t.modifiedAt)})]},t.path+p)})}):jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(90px,1fr))] gap-1.5 p-1",children:J.map((t,p)=>{let H=It(t),O=d.has(p),q=t.extension||mt(t.name);return jsxs("div",{className:s("fe-item group/item flex cursor-pointer flex-col items-center gap-1 rounded-lg px-2 py-2.5 text-center transition-all duration-150",O?"bg-(--fe-accent)/15 text-(--fe-text-strong) ring-1 ring-(--fe-accent)/30":"text-(--fe-text) hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),onClick:ke=>Te(p,ke),onDoubleClick:()=>Ye(p),children:[jsx(H,{className:s("h-7 w-7",t.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsx("span",{className:"w-full truncate text-[10px] font-medium leading-tight",children:t.name}),q&&t.type==="file"&&jsx("span",{className:"font-mono text-[8px] uppercase text-(--fe-text-muted)",children:q})]},t.path+p)})})}),jsx("div",{className:s("overflow-hidden transition-[width,opacity] duration-300 ease-out",xt?s("absolute right-0 top-0 bottom-0 z-10",M?"w-44 opacity-100":"w-0 opacity-0 pointer-events-none"):s("shrink-0",M?"w-56":"w-0")),children:M&&jsxs("div",{className:s("flex h-full flex-col p-4",xt?"fe-panel-narrow w-44":"fe-panel w-56 border-l border-(--fe-border)"),children:[xt&&jsx("button",{className:"fe-btn mb-2 self-end",onClick:()=>{C(null),b(new Set);},title:"Close panel",children:jsx(X,{className:"h-3.5 w-3.5"})}),jsxs("div",{className:"mb-3 flex flex-col items-center",children:[ln.createElement(It(M),{className:s("h-10 w-10 mb-2",M.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsx("span",{className:"w-full text-center text-xs font-semibold text-(--fe-text-strong) break-all leading-tight",children:M.name})]}),jsxs("div",{className:"space-y-2.5 text-[10px]",children:[jsx(ot,{label:"Type",value:M.type==="directory"?"Directory":M.mimeType||M.extension||mt(M.name)||"File"}),M.size!=null&&jsx(ot,{label:"Size",value:mn(M.size)}),jsx(ot,{label:"Path",value:M.path,mono:true}),M.extension&&jsx(ot,{label:"Extension",value:M.extension}),M.modifiedAt&&jsx(ot,{label:"Modified",value:At(M.modifiedAt)}),M.createdAt&&jsx(ot,{label:"Created",value:At(M.createdAt)})]}),jsxs("div",{className:"mt-auto flex flex-col gap-1.5",children:[M.type==="file"&&x&&jsxs("button",{className:"flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text-strong) transition-colors",style:{background:"color-mix(in srgb, var(--fe-accent) 20%, transparent)",border:"1px solid color-mix(in srgb, var(--fe-accent) 30%, transparent)"},onClick:()=>x(M),children:[jsx(ArrowUp,{className:"h-3 w-3 rotate-45"}),"Open"]}),z?.map(t=>jsxs("button",{className:"fe-action flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text) transition-colors hover:text-(--fe-text-strong)",onClick:()=>t.onClick(M),children:[t.icon&&ln.createElement(t.icon,{className:"h-3 w-3"}),t.label]},t.key))]})]})})]}),jsxs("div",{className:"fe-statusbar flex h-6 shrink-0 items-center justify-between px-3 text-[9px] font-mono text-(--fe-text-muted)",children:[jsxs("span",{children:[J.length," items"]}),jsxs("div",{className:"flex items-center gap-2",children:[d.size>0&&jsxs("span",{className:"text-(--fe-accent)/70",children:[d.size," selected"]}),jsx("span",{className:"opacity-50",children:"Ctrl+Click multi-select \xB7 Esc clear"})]})]}),G&&!o&&jsxs(Fragment,{children:[jsx("div",{className:"absolute top-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:t=>le("n",t),onTouchStart:t=>fe("n",t)}),jsx("div",{className:"absolute bottom-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:t=>le("s",t),onTouchStart:t=>fe("s",t)}),jsx("div",{className:"absolute top-4 left-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:t=>le("w",t),onTouchStart:t=>fe("w",t)}),jsx("div",{className:"absolute top-4 right-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:t=>le("e",t),onTouchStart:t=>fe("e",t)}),jsx("div",{className:"absolute top-0 left-0 h-6 w-6 cursor-nwse-resize",onMouseDown:t=>le("nw",t),onTouchStart:t=>fe("nw",t)}),jsx("div",{className:"absolute top-0 right-0 h-6 w-6 cursor-nesw-resize",onMouseDown:t=>le("ne",t),onTouchStart:t=>fe("ne",t)}),jsx("div",{className:"absolute bottom-0 left-0 h-6 w-6 cursor-nesw-resize",onMouseDown:t=>le("sw",t),onTouchStart:t=>fe("sw",t)}),jsx("div",{className:"absolute bottom-0 right-0 h-6 w-6 cursor-nwse-resize",onMouseDown:t=>le("se",t),onTouchStart:t=>fe("se",t)})]}),jsx("style",{children:`
22
+ `})]});return jsx("div",{className:o(X$1&&"fixed inset-0 z-100 flex items-center justify-center p-8",X$1&&(Xe?"animate-[cp-cinema-out_0.5s_ease-in_both]":"animate-[cp-cinema-in_0.5s_ease-out_both]")),onClick:X$1?a=>{a.target===a.currentTarget&&D();}:void 0,children:jsx("div",{className:o(X$1&&"w-full",X$1&&!pe&&"max-w-5xl"),children:xe})})}var _t=cva("rounded-lg bg-white p-6 shadow-xl dark:bg-primary-900",{variants:{size:{sm:"w-full max-w-sm",md:"w-full max-w-lg",lg:"w-full max-w-2xl",xl:"w-full max-w-4xl",full:"h-[calc(100vh-4rem)] w-[calc(100vw-4rem)]"}},defaultVariants:{size:"md"}});cva("absolute z-50 rounded px-2 py-1 text-xs shadow-md animate-fade-in",{variants:{intent:{default:"bg-primary-900 text-white dark:bg-primary-100 dark:text-primary-900",light:"border border-primary-200 bg-white text-primary-700 dark:border-primary-600 dark:bg-primary-800 dark:text-primary-200"}},defaultVariants:{intent:"default"}});var je=[];function Yn(e){je.push(e);}function Wn(e){let t=je.indexOf(e);t!==-1&&je.splice(t,1);}function It(e){return je.length>0&&je[je.length-1]===e}function Un(e){let t=je.indexOf(e);return t!==-1?t:je.length}var lr=createContext(null);function cr({open:e,onOpenChange:t,modal:n=true,closeOnOutsideClick:u=false,children:f}){let c=useId();return useEffect(()=>{if(e)return Yn(c),()=>Wn(c)},[e,c]),useEffect(()=>{if(!e||!n)return;let d=v=>{v.key==="Escape"&&It(c)&&t(false);};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e,n,t,c]),useEffect(()=>{if(!e||!n)return;let d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=d;}},[e,n]),e?jsx(lr.Provider,{value:{id:c,onOpenChange:t,modal:n,closeOnOutsideClick:u},children:createPortal(f,document.body)}):null}function dr({size:e,position:t="center",className:n,children:u,...f}){let c=useContext(lr);if(!c)return null;let v=200+Un(c.id)*10,y=()=>{c.closeOnOutsideClick&&It(c.id)&&c.onOpenChange(false);},h=t==="bottom";return c.modal?jsx("div",{className:o("animate-fade-in fixed inset-0 bg-black/50",h?"flex items-end justify-center":"flex items-center justify-center p-4"),style:{zIndex:v},onClick:y,children:jsx("div",{className:o(_t({size:e}),h?"animate-slide-in-bottom w-full rounded-b-none rounded-t-(--dialog-sheet-radius) max-h-[85vh] overflow-y-auto":"animate-scale-in",n),role:"dialog","aria-modal":"true",onClick:L=>L.stopPropagation(),...f,children:u})}):jsx("div",{className:o("fixed inset-0 flex items-center justify-center p-4",c.closeOnOutsideClick?"pointer-events-auto":"pointer-events-none"),style:{zIndex:v},onClick:c.closeOnOutsideClick&&It(c.id)?()=>c.onOpenChange(false):void 0,children:jsx("div",{className:o(_t({size:e}),"animate-scale-in pointer-events-auto shadow-2xl",n),role:"dialog",onClick:c.closeOnOutsideClick?L=>L.stopPropagation():void 0,...f,children:u})})}function ur({className:e,...t}){return jsx("div",{className:o("mb-4 space-y-1",e),...t})}function mr({className:e,...t}){return jsx("h2",{className:o("text-primary-900 dark:text-primary-100 flex items-center gap-1.5 text-lg font-semibold [&_svg]:h-5 [&_svg]:w-5 [&_svg]:shrink-0",e),...t})}function pr({className:e,...t}){return jsx("p",{className:o("text-primary-500 dark:text-primary-400 text-sm",e),...t})}function fr({className:e,...t}){return jsx("div",{className:o("mt-6 flex justify-end gap-2",e),...t})}var gr=cva("inline-flex cursor-pointer items-center justify-center gap-1.5 rounded font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0",{variants:{intent:{primary:"bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-700",secondary:"bg-secondary-500 text-white hover:bg-secondary-600 active:bg-secondary-700",danger:"bg-danger-500 text-white hover:bg-danger-600 active:bg-danger-700",warning:"bg-warning-500 text-white hover:bg-warning-600 active:bg-warning-700",ghost:"bg-transparent text-primary-700 hover:bg-primary-100 active:bg-primary-200 dark:text-primary-300 dark:hover:bg-primary-800",outline:"border border-primary-300 bg-transparent text-primary-700 hover:bg-primary-50 dark:border-primary-600 dark:text-primary-300 dark:hover:bg-primary-800"},size:{sm:"h-7 px-3 text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",md:"h-9 px-4 text-sm [&_svg]:h-4 [&_svg]:w-4",lg:"h-11 px-6 text-base [&_svg]:h-5 [&_svg]:w-5"}},defaultVariants:{intent:"primary",size:"md"}});cva("inline-flex items-center gap-1 rounded border font-semibold [&_svg]:shrink-0",{variants:{intent:{success:"border-success-200 bg-success-100 text-success-800 dark:border-success-800 dark:bg-success-900/30 dark:text-success-400",warning:"border-warning-200 bg-warning-100 text-warning-800 dark:border-warning-800 dark:bg-warning-900/30 dark:text-warning-400",error:"border-danger-200 bg-danger-100 text-danger-800 dark:border-danger-800 dark:bg-danger-900/30 dark:text-danger-400",info:"border-primary-200 bg-primary-100 text-primary-800 dark:border-primary-800 dark:bg-primary-900/30 dark:text-primary-400",primary:"border-secondary-200 bg-secondary-100 text-secondary-700 dark:border-secondary-700 dark:bg-secondary-800 dark:text-secondary-300"},size:{sm:"px-1.5 py-0 text-[0.625rem] [&_svg]:h-2.5 [&_svg]:w-2.5",md:"px-2.5 py-0.5 text-xs [&_svg]:h-3 [&_svg]:w-3",lg:"px-3 py-1 text-sm [&_svg]:h-3.5 [&_svg]:w-3.5"}},defaultVariants:{intent:"primary",size:"md"}});cva("absolute flex items-center justify-center rounded-full font-bold leading-none ring-2 ring-white select-none pointer-events-none z-10 dark:ring-primary-900",{variants:{intent:{danger:"bg-danger-500 text-white",success:"bg-success-500 text-white",warning:"bg-warning-500 text-white",info:"bg-primary-500 text-white",primary:"bg-secondary-500 text-white"},size:{sm:"text-[0.5rem]",md:"text-[0.625rem]",lg:"text-xs"},dot:{true:"",false:""},placement:{"top-right":"top-0 right-0 translate-x-1/2 -translate-y-1/2","top-left":"top-0 left-0 -translate-x-1/2 -translate-y-1/2","bottom-right":"bottom-0 right-0 translate-x-1/2 translate-y-1/2","bottom-left":"bottom-0 left-0 -translate-x-1/2 translate-y-1/2"}},compoundVariants:[{dot:true,size:"sm",class:"h-1.5 w-1.5 min-w-0 ring-1"},{dot:true,size:"md",class:"h-2 w-2 min-w-0"},{dot:true,size:"lg",class:"h-2.5 w-2.5 min-w-0"},{dot:false,size:"sm",class:"h-4 min-w-4 px-1"},{dot:false,size:"md",class:"h-5 min-w-5 px-1.5"},{dot:false,size:"lg",class:"h-6 min-w-6 px-2"}],defaultVariants:{intent:"danger",size:"md",dot:false,placement:"top-right"}});cva("w-full rounded-md border bg-white text-secondary-900 transition-colors placeholder:text-secondary-400 focus:outline-none focus:ring-2 dark:bg-secondary-900 dark:text-secondary-100 dark:placeholder:text-secondary-600",{variants:{state:{default:"border-secondary-300 focus:border-primary-500 focus:ring-primary-500/20 dark:border-secondary-600",error:"border-danger-400 focus:border-danger-500 focus:ring-danger-500/20"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 py-2 text-sm",lg:"h-11 px-4 py-2.5 text-base"}},defaultVariants:{state:"default",size:"md"}});cva("inline-flex items-center gap-1 font-medium [&_svg]:shrink-0",{variants:{size:{sm:"text-xs [&_svg]:h-3 [&_svg]:w-3",md:"text-sm [&_svg]:h-3.5 [&_svg]:w-3.5",lg:"text-base [&_svg]:h-4 [&_svg]:w-4"},intent:{default:"text-primary-700 dark:text-primary-300",muted:"text-primary-400 dark:text-primary-500",required:"text-primary-700 dark:text-primary-300 after:ml-0.5 after:text-danger-500 after:content-['*']"}},defaultVariants:{size:"md",intent:"default"}});cva("relative inline-flex shrink-0 items-center justify-center rounded border-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:"border-primary-300 dark:border-primary-600 focus-visible:ring-primary-500/40",secondary:"border-secondary-300 dark:border-secondary-600 focus-visible:ring-secondary-500/40",danger:"border-danger-300 dark:border-danger-600 focus-visible:ring-danger-500/40",warning:"border-warning-300 dark:border-warning-600 focus-visible:ring-warning-500/40",success:"border-success-300 dark:border-success-600 focus-visible:ring-success-500/40"},size:{sm:"h-4 w-4 rounded-[3px]",md:"h-5 w-5 rounded",lg:"h-6 w-6 rounded-[5px]"},checked:{on:"",off:"bg-white dark:bg-primary-900"}},compoundVariants:[{intent:"primary",checked:"on",class:"border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"border-secondary-500 bg-secondary-500 dark:border-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"border-danger-500 bg-danger-500 dark:border-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"border-warning-500 bg-warning-500 dark:border-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"border-success-500 bg-success-500 dark:border-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}});cva("relative inline-flex shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:"border-primary-300 dark:border-primary-600 focus-visible:ring-primary-500/40",secondary:"border-secondary-300 dark:border-secondary-600 focus-visible:ring-secondary-500/40",danger:"border-danger-300 dark:border-danger-600 focus-visible:ring-danger-500/40",warning:"border-warning-300 dark:border-warning-600 focus-visible:ring-warning-500/40",success:"border-success-300 dark:border-success-600 focus-visible:ring-success-500/40"},size:{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},checked:{on:"",off:"bg-white dark:bg-primary-900"}},compoundVariants:[{intent:"primary",checked:"on",class:"border-primary-500 bg-primary-500 dark:border-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"border-secondary-500 bg-secondary-500 dark:border-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"border-danger-500 bg-danger-500 dark:border-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"border-warning-500 bg-warning-500 dark:border-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"border-success-500 bg-success-500 dark:border-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}});cva("",{variants:{intent:{primary:"",secondary:"",danger:"",warning:"",success:""},size:{sm:"",md:"",lg:""},checked:{on:"",off:"bg-primary-300 dark:bg-primary-800"}},compoundVariants:[{intent:"primary",checked:"on",class:"bg-primary-500 dark:bg-primary-500"},{intent:"secondary",checked:"on",class:"bg-secondary-500 dark:bg-secondary-500"},{intent:"danger",checked:"on",class:"bg-danger-500 dark:bg-danger-500"},{intent:"warning",checked:"on",class:"bg-warning-500 dark:bg-warning-500"},{intent:"success",checked:"on",class:"bg-success-500 dark:bg-success-500"}],defaultVariants:{intent:"primary",size:"md",checked:"off"}});cva("bg-primary-200 text-primary-700 dark:bg-primary-700 dark:text-primary-200",{variants:{size:{xs:"h-6 w-6 text-[10px]",sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base",xl:"h-16 w-16 text-lg"},shape:{circular:"rounded-full",rounded:"rounded-lg",square:"rounded-none"}},defaultVariants:{size:"md",shape:"circular"}});cva("relative flex w-full touch-none select-none items-center",{variants:{intent:{primary:"[&_.slider-fill]:bg-primary-500 [&_.slider-thumb]:border-primary-500",secondary:"[&_.slider-fill]:bg-secondary-500 [&_.slider-thumb]:border-secondary-500",success:"[&_.slider-fill]:bg-success-500 [&_.slider-thumb]:border-success-500",danger:"[&_.slider-fill]:bg-danger-500 [&_.slider-thumb]:border-danger-500",warning:"[&_.slider-fill]:bg-warning-500 [&_.slider-thumb]:border-warning-500"},size:{sm:"h-4",md:"h-5",lg:"h-6"}},defaultVariants:{intent:"primary",size:"md"}});cva("inline-flex items-center gap-1 rounded-full font-medium select-none transition-colors [&_svg]:shrink-0",{variants:{intent:{primary:"bg-primary-100 text-primary-700 dark:bg-primary-800 dark:text-primary-200",secondary:"bg-secondary-100 text-secondary-700 dark:bg-secondary-800 dark:text-secondary-200",success:"bg-success-100 text-success-700 dark:bg-success-900/40 dark:text-success-300",danger:"bg-danger-100 text-danger-700 dark:bg-danger-900/40 dark:text-danger-300",warning:"bg-warning-100 text-warning-700 dark:bg-warning-900/40 dark:text-warning-300",info:"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300"},size:{sm:"h-5 px-2 text-[0.6875rem] gap-0.5",md:"h-6 px-2.5 text-xs gap-1",lg:"h-7 px-3 text-sm gap-1"},variant:{solid:"",outline:"bg-transparent border",soft:""}},compoundVariants:[{intent:"primary",variant:"outline",class:"border-primary-300 text-primary-700 dark:border-primary-600 dark:text-primary-300"},{intent:"secondary",variant:"outline",class:"border-secondary-300 text-secondary-700 dark:border-secondary-600 dark:text-secondary-300"},{intent:"success",variant:"outline",class:"border-success-400 text-success-700 dark:border-success-600 dark:text-success-300"},{intent:"danger",variant:"outline",class:"border-danger-400 text-danger-700 dark:border-danger-600 dark:text-danger-300"},{intent:"warning",variant:"outline",class:"border-warning-400 text-warning-700 dark:border-warning-600 dark:text-warning-300"},{intent:"info",variant:"outline",class:"border-blue-400 text-blue-700 dark:border-blue-600 dark:text-blue-300"}],defaultVariants:{intent:"primary",size:"md",variant:"solid"}});cva("relative w-full cursor-pointer rounded-md border bg-white text-sm transition-colors dark:bg-primary-900",{variants:{intent:{default:"border-primary-300 text-primary-900 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 dark:border-primary-600 dark:text-primary-100 dark:hover:border-primary-500 dark:focus-within:border-primary-400",danger:"border-danger-500 text-primary-900 focus-within:ring-2 focus-within:ring-danger-500/20 dark:border-danger-500 dark:text-primary-100"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-11 px-4 text-base"}},defaultVariants:{intent:"default",size:"md"}});function Ft({intent:e,size:t,className:n,...u}){return jsx("button",{className:o(gr({intent:e,size:t}),n),...u})}function bt(e){let t=e.lastIndexOf(".");return t>0?e.slice(t).toLowerCase():""}function yr(e){return e==null?"\u2014":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function $t(e){return e?(typeof e=="string"?new Date(e):e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"\u2014"}var ca={".png":Image,".jpg":Image,".jpeg":Image,".gif":Image,".svg":Image,".webp":Image,".ico":Image,".bmp":Image,".mp3":Music,".wav":Music,".flac":Music,".ogg":Music,".aac":Music,".m4a":Music,".mp4":Video,".mkv":Video,".avi":Video,".mov":Video,".wmv":Video,".webm":Video,".ts":FileCode,".tsx":FileCode,".js":FileCode,".jsx":FileCode,".json":FileCode,".html":FileCode,".css":FileCode,".scss":FileCode,".py":FileCode,".rs":FileCode,".go":FileCode,".java":FileCode,".c":FileCode,".cpp":FileCode,".h":FileCode,".sh":Terminal,".bat":Terminal,".ps1":Terminal,".md":FileText,".txt":FileText,".pdf":FileText,".doc":FileText,".docx":FileText,".rtf":FileText,".csv":FileSpreadsheet,".xls":FileSpreadsheet,".xlsx":FileSpreadsheet,".db":Database,".sqlite":Database,".sql":Database,".zip":FileArchive,".tar":FileArchive,".gz":FileArchive,".rar":FileArchive,".7z":FileArchive};function jt(e){if(e.type==="directory")return Folder;let t=e.extension||bt(e.name);return ca[t]||File}function it(e,t,n){return Math.max(t,Math.min(n,e))}function wr(e){return e<480?"xs":e<640?"sm":e<1024?"md":"lg"}function kr(e,t){if(e<480)return {size:{width:e-16,height:t-48},pos:{x:8,y:24}};if(e<640){let f=e-24,c=Math.min(t-64,540);return {size:{width:f,height:c},pos:{x:12,y:32}}}if(e<1024){let f=Math.min(640,e-32),c=Math.min(480,t-64);return {size:{width:f,height:c},pos:{x:Math.max(0,Math.round((e-f)/2)),y:Math.max(0,Math.round((t-c)/2))}}}let n=720,u=520;return {size:{width:n,height:u},pos:{x:Math.max(0,Math.round((e-n)/2)),y:Math.max(0,Math.round((t-u)/2))}}}function Bt({files:e,title:t="File Explorer",accent:n="#8b5cf6",defaultView:u="list",initialPosition:f,initialSize:c,dockable:d=false,dockSide:v="right",visible:y=true,onFileOpen:h,onSelectionChange:L,onNavigate:w,onDelete:l,onClose:m,onMinimize:P,onPathSubmit:N,defaultInputMode:H="search",actions:E,resizable:z=true,minSize:V={width:400,height:300},className:O}){let[$,me]=useState(u),[b,M]=useState(new Set),[_,R]=useState(null),[s,A]=useState(false),[Y,ne]=useState(false),[q,ve]=useState(""),[X$1,ye]=useState(H),[Xe,Fe]=useState(y),[pe,He]=useState(false),[be,Ve]=useState({w:window.innerWidth,h:window.innerHeight}),_e=kr(window.innerWidth,window.innerHeight),[j,Ne]=useState(f??_e.pos),[te,Z]=useState(c??_e.size),[re,he]=useState(null),Ee=useRef(false),I=useRef({x:0,y:0}),Ue=useRef(null),J=useRef(false),fe=useRef({x:0,y:0,w:0,h:0,px:0,py:0}),Ce=useRef(false),Se=useRef(s);useEffect(()=>{Se.current=s;},[s]);let ae=y!==void 0?y:Xe,Re=useMemo(()=>{let r=e.filter(B=>B.type==="directory"),k=e.filter(B=>B.type==="file");return r.sort((B,K)=>B.name.localeCompare(K.name)),k.sort((B,K)=>B.name.localeCompare(K.name)),[...r,...k]},[e]),ee=useMemo(()=>{if(X$1!=="search"||!q.trim())return Re;let r=q.toLowerCase();return Re.filter(k=>k.name.toLowerCase().includes(r))},[Re,q,X$1]),D=_!=null?ee[_]:null;useEffect(()=>{let r=wr(window.innerWidth),k=()=>{let B=window.innerWidth,K=window.innerHeight;if(Ve({w:B,h:K}),Se.current)return;let Q=wr(B);if(Q!==r&&!Ce.current&&!c){let Me=kr(B,K);Z(Me.size),Ne(Me.pos);}r=Q;};return window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[c]);let De=useCallback((r,k)=>{M(B=>{let K=new Set(B);return k.ctrlKey||k.metaKey?K.has(r)?K.delete(r):K.add(r):(K.clear(),K.add(r)),K}),R(r);},[]);useEffect(()=>{if(!L)return;let r=Array.from(b).map(k=>ee[k]).filter(Boolean);L(r);},[b]);let qe=useCallback(r=>{let k=ee[r];k&&(k.type==="directory"?w?.(k.path):h?.(k));},[ee,h,w]),Qe=useCallback(r=>{s||r.target.closest("button")||(Ce.current=true,Ee.current=true,I.current={x:r.clientX-j.x,y:r.clientY-j.y},r.preventDefault());},[j,s]),ct=useCallback(r=>{if(s||r.target.closest("button"))return;Ce.current=true;let k=r.touches[0];Ee.current=true,I.current={x:k.clientX-j.x,y:k.clientY-j.y};},[j,s]);useEffect(()=>{let r=K=>{if(!Ee.current)return;let Q=window.innerWidth-100,Me=window.innerHeight-40;Ne({x:it(K.clientX-I.current.x,0,Q),y:it(K.clientY-I.current.y,0,Me)});},k=K=>{if(!Ee.current)return;K.preventDefault();let Q=K.touches[0],Me=window.innerWidth-100,Ge=window.innerHeight-40;Ne({x:it(Q.clientX-I.current.x,0,Me),y:it(Q.clientY-I.current.y,0,Ge)});},B=()=>{Ee.current=false,J.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",r),window.addEventListener("mouseup",B),window.addEventListener("touchmove",k,{passive:false}),window.addEventListener("touchend",B),()=>{window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",B),window.removeEventListener("touchmove",k),window.removeEventListener("touchend",B);}},[]);let ce=useCallback((r,k)=>{s||(k.preventDefault(),k.stopPropagation(),Ce.current=true,J.current=r,fe.current={x:k.clientX,y:k.clientY,w:te.width,h:te.height,px:j.x,py:j.y},document.body.style.cursor=r==="e"||r==="w"?"ew-resize":r==="n"||r==="s"?"ns-resize":r==="nw"||r==="se"?"nwse-resize":"nesw-resize",document.body.style.userSelect="none");},[s,te,j]),xe=useCallback((r,k)=>{if(s)return;k.preventDefault(),k.stopPropagation(),Ce.current=true;let B=k.touches[0];J.current=r,fe.current={x:B.clientX,y:B.clientY,w:te.width,h:te.height,px:j.x,py:j.y},document.body.style.userSelect="none";},[s,te,j]);useEffect(()=>{let r=(Q,Me)=>{let Ge=J.current;if(!Ge)return;let Qt=Q-fe.current.x,Zt=Me-fe.current.y,{w:Ze,h:Je,px:Mt,py:Tt}=fe.current;if(Ge.includes("e")&&(Ze=Math.max(V.width,Ze+Qt)),Ge.includes("w")){let dt=Math.max(V.width,Ze-Qt);Mt=Mt+(Ze-dt),Ze=dt;}if(Ge.includes("s")&&(Je=Math.max(V.height,Je+Zt)),Ge.includes("n")){let dt=Math.max(V.height,Je-Zt);Tt=Tt+(Je-dt),Je=dt;}Z({width:Ze,height:Je}),Ne({x:Mt,y:Tt});},k=Q=>{J.current&&r(Q.clientX,Q.clientY);},B=Q=>{J.current&&(Q.preventDefault(),r(Q.touches[0].clientX,Q.touches[0].clientY));},K=()=>{J.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",k),window.addEventListener("mouseup",K),window.addEventListener("touchmove",B,{passive:false}),window.addEventListener("touchend",K),()=>{window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",K),window.removeEventListener("touchmove",B),window.removeEventListener("touchend",K);}},[V]);let a=useCallback(()=>{s?(re&&(Ne(re.pos),Z(re.size)),A(false)):(he({pos:j,size:te}),A(true));},[s,j,te,re]),T=useCallback(()=>{Y?ne(false):(s&&(A(false),re&&(Ne(re.pos),Z(re.size))),ne(true),P?.());},[Y,s,re,P]);useEffect(()=>{if(!ae||Y)return;let r=k=>{if(!(!Ue.current?.contains(document.activeElement)&&document.activeElement!==Ue.current)){if(k.key==="Escape"&&(R(null),M(new Set)),k.ctrlKey&&k.key==="a"){k.preventDefault();let B=new Set(ee.map((K,Q)=>Q));M(B);}k.key==="Delete"&&b.size>0&&l&&(k.preventDefault(),He(true));}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[ae,Y,ee,b,l]);let W={"--fe-accent":n};if(Y)return jsx("div",{className:o("fixed z-100 cursor-pointer transition-all duration-300",v==="right"?"right-0 top-1/2 -translate-y-1/2":"left-0 top-1/2 -translate-y-1/2"),style:W,onClick:()=>ne(false),title:`Restore ${t}`,children:jsxs("div",{className:"fe-dock flex items-center gap-1.5 rounded-l-lg px-2 py-3 backdrop-blur-md",style:{writingMode:"vertical-rl",textOrientation:"mixed"},children:[jsx(HardDrive,{className:"h-3.5 w-3.5 text-(--fe-accent)"}),jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-(--fe-text)",children:t})]})});if(!ae)return null;let i=s?be.w:Math.min(te.width,be.w-8),F=s?be.h:Math.min(te.height,be.h-8),oe=s?0:it(j.x,0,Math.max(0,be.w-i)),Pe=s?0:it(j.y,0,Math.max(0,be.h-40)),Ct=i<500;return jsxs("div",{ref:Ue,className:o("fe-window fixed z-100 flex flex-col overflow-hidden","rounded-xl border border-(--fe-border)","animate-[fe-window-in_0.35s_cubic-bezier(0.16,1,0.3,1)_both]",s&&"rounded-none",O),style:{...W,left:oe,top:Pe,width:i,height:F,transition:s?"left 0.3s, top 0.3s, width 0.3s, height 0.3s":void 0},tabIndex:0,children:[jsxs("div",{className:"fe-titlebar group/titlebar flex h-10 shrink-0 cursor-grab items-center justify-between px-3 select-none active:cursor-grabbing",onMouseDown:Qe,onTouchStart:ct,onDoubleClick:a,children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("div",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:"color-mix(in srgb, var(--fe-accent) 25%, transparent)"},children:jsx(HardDrive,{className:"h-3 w-3 text-(--fe-accent)"})}),jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-(--fe-text)",children:t}),jsx("div",{className:"ml-2 hidden h-px w-20 md:block",style:{background:"linear-gradient(90deg, var(--fe-accent), transparent)",opacity:.3}})]}),jsxs("div",{className:"flex items-center gap-0.5",children:[jsx("button",{className:"fe-btn mr-1",onClick:()=>me(r=>r==="list"?"grid":"list"),title:$==="list"?"Grid view":"List view",children:$==="list"?jsx(LayoutGrid,{className:"h-3.5 w-3.5"}):jsx(LayoutList,{className:"h-3.5 w-3.5"})}),d&&jsx("button",{className:"fe-btn",onClick:T,title:"Dock to edge",children:jsx(Minus,{className:"h-3.5 w-3.5"})}),jsx("button",{className:"fe-btn",onClick:a,title:s?"Restore":"Maximize",children:s?jsx(Minimize2,{className:"h-3.5 w-3.5"}):jsx(Maximize2,{className:"h-3.5 w-3.5"})}),jsx("button",{className:"fe-btn hover:bg-red-500/40! hover:text-red-300!",onClick:()=>{m?.(),Fe(false);},title:"Close",children:jsx(X,{className:"h-3.5 w-3.5"})})]})]}),jsxs("div",{className:"fe-toolbar flex h-9 shrink-0 items-center gap-2 px-3",children:[jsx("button",{className:"fe-btn p-1",onClick:()=>w?.(".."),title:"Go up",children:jsx(FolderUp,{className:"h-3.5 w-3.5"})}),jsx("button",{className:"fe-btn shrink-0 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider",style:X$1==="navigate"?{color:"var(--fe-accent)",background:"color-mix(in srgb, var(--fe-accent) 15%, transparent)"}:void 0,onClick:()=>ye(r=>r==="search"?"navigate":"search"),title:X$1==="search"?"Switch to path navigation":"Switch to file search",children:X$1==="search"?jsx(Search,{className:"h-3 w-3"}):jsx(CornerRightDown,{className:"h-3 w-3"})}),jsx("div",{className:"relative flex-1",children:jsx("input",{type:"text",value:q,onChange:r=>ve(r.target.value),onKeyDown:r=>{r.key==="Enter"&&q.trim()&&X$1==="navigate"&&(N?N(q.trim()):w?.(q.trim()));},placeholder:X$1==="search"?"Search files\u2026":"Enter path and press Enter\u2026",className:"h-6 w-full rounded border border-(--fe-input-border) bg-(--fe-input-bg) px-2 text-[11px] text-(--fe-text-strong) placeholder:text-(--fe-text-muted) outline-none transition-colors focus:border-(--fe-accent)/40 focus:bg-(--fe-input-bg)"})}),jsxs("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:[ee.length," item",ee.length!==1?"s":"",b.size>0&&` \xB7 ${b.size} selected`]})]}),jsxs("div",{className:"relative flex flex-1 min-h-0",children:[jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-1.5",onClick:r=>{r.target===r.currentTarget&&(M(new Set),R(null));},children:ee.length===0?jsxs("div",{className:"flex h-full flex-col items-center justify-center text-(--fe-text-muted)",children:[jsx(Folder,{className:"mb-2 h-10 w-10"}),jsx("span",{className:"text-xs",children:"No files found"})]}):$==="list"?jsx("div",{className:"space-y-px",children:ee.map((r,k)=>{let B=jt(r),K=b.has(k),Q=r.extension||bt(r.name);return jsxs("div",{className:o("fe-item group/item flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-(--fe-text) transition-all duration-150 cursor-pointer",K?"bg-(--fe-accent)/15 text-(--fe-text-strong)":"hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),style:K?{boxShadow:"inset 2px 0 0 var(--fe-accent)"}:void 0,onClick:Me=>De(k,Me),onDoubleClick:()=>qe(k),children:[jsx(B,{className:o("h-4 w-4 shrink-0",r.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsx("span",{className:"flex-1 truncate text-xs font-medium",children:r.name}),Q&&r.type==="file"&&jsx("span",{className:"shrink-0 rounded bg-(--fe-badge-bg) px-1.5 py-0.5 font-mono text-[9px] uppercase text-(--fe-text-muted)",children:Q}),r.size!=null&&jsx("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:yr(r.size)}),r.modifiedAt&&jsx("span",{className:"hidden shrink-0 font-mono text-[10px] text-(--fe-text-muted) lg:inline",children:$t(r.modifiedAt)})]},r.path+k)})}):jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(90px,1fr))] gap-1.5 p-1",children:ee.map((r,k)=>{let B=jt(r),K=b.has(k),Q=r.extension||bt(r.name);return jsxs("div",{className:o("fe-item group/item flex cursor-pointer flex-col items-center gap-1 rounded-lg px-2 py-2.5 text-center transition-all duration-150",K?"bg-(--fe-accent)/15 text-(--fe-text-strong) ring-1 ring-(--fe-accent)/30":"text-(--fe-text) hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),onClick:Me=>De(k,Me),onDoubleClick:()=>qe(k),children:[jsx(B,{className:o("h-7 w-7",r.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsx("span",{className:"w-full truncate text-[10px] font-medium leading-tight",children:r.name}),Q&&r.type==="file"&&jsx("span",{className:"font-mono text-[8px] uppercase text-(--fe-text-muted)",children:Q})]},r.path+k)})})}),jsx("div",{className:o("overflow-hidden transition-[width,opacity] duration-300 ease-out",Ct?o("absolute right-0 top-0 bottom-0 z-10",D?"w-44 opacity-100":"w-0 opacity-0 pointer-events-none"):o("shrink-0",D?"w-56":"w-0")),children:D&&jsxs("div",{className:o("flex h-full flex-col p-4",Ct?"fe-panel-narrow w-44":"fe-panel w-56 border-l border-(--fe-border)"),children:[Ct&&jsx("button",{className:"fe-btn mb-2 self-end",onClick:()=>{R(null),M(new Set);},title:"Close panel",children:jsx(X,{className:"h-3.5 w-3.5"})}),jsxs("div",{className:"mb-3 flex flex-col items-center",children:[br.createElement(jt(D),{className:o("h-10 w-10 mb-2",D.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsx("span",{className:"w-full text-center text-xs font-semibold text-(--fe-text-strong) break-all leading-tight",children:D.name})]}),jsxs("div",{className:"space-y-2.5 text-[10px]",children:[jsx(lt,{label:"Type",value:D.type==="directory"?"Directory":D.mimeType||D.extension||bt(D.name)||"File"}),D.size!=null&&jsx(lt,{label:"Size",value:yr(D.size)}),jsx(lt,{label:"Path",value:D.path,mono:true}),D.extension&&jsx(lt,{label:"Extension",value:D.extension}),D.modifiedAt&&jsx(lt,{label:"Modified",value:$t(D.modifiedAt)}),D.createdAt&&jsx(lt,{label:"Created",value:$t(D.createdAt)})]}),jsxs("div",{className:"mt-auto flex flex-col gap-1.5",children:[D.type==="file"&&h&&jsxs("button",{className:"flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text-strong) transition-colors",style:{background:"color-mix(in srgb, var(--fe-accent) 20%, transparent)",border:"1px solid color-mix(in srgb, var(--fe-accent) 30%, transparent)"},onClick:()=>h(D),children:[jsx(ArrowUp,{className:"h-3 w-3 rotate-45"}),"Open"]}),E?.map(r=>jsxs("button",{className:"fe-action flex items-center justify-center gap-1.5 rounded-lg py-1.5 text-[10px] font-semibold uppercase tracking-wider text-(--fe-text) transition-colors hover:text-(--fe-text-strong)",onClick:()=>r.onClick(D),children:[r.icon&&br.createElement(r.icon,{className:"h-3 w-3"}),r.label]},r.key))]})]})})]}),jsxs("div",{className:"fe-statusbar flex h-6 shrink-0 items-center justify-between px-3 text-[9px] font-mono text-(--fe-text-muted)",children:[jsxs("span",{children:[ee.length," items"]}),jsxs("div",{className:"flex items-center gap-2",children:[b.size>0&&jsxs("span",{className:"text-(--fe-accent)/70",children:[b.size," selected"]}),jsx("span",{className:"opacity-50",children:"Ctrl+Click multi-select \xB7 Esc clear"})]})]}),z&&!s&&jsxs(Fragment,{children:[jsx("div",{className:"absolute top-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:r=>ce("n",r),onTouchStart:r=>xe("n",r)}),jsx("div",{className:"absolute bottom-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:r=>ce("s",r),onTouchStart:r=>xe("s",r)}),jsx("div",{className:"absolute top-4 left-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:r=>ce("w",r),onTouchStart:r=>xe("w",r)}),jsx("div",{className:"absolute top-4 right-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:r=>ce("e",r),onTouchStart:r=>xe("e",r)}),jsx("div",{className:"absolute top-0 left-0 h-6 w-6 cursor-nwse-resize",onMouseDown:r=>ce("nw",r),onTouchStart:r=>xe("nw",r)}),jsx("div",{className:"absolute top-0 right-0 h-6 w-6 cursor-nesw-resize",onMouseDown:r=>ce("ne",r),onTouchStart:r=>xe("ne",r)}),jsx("div",{className:"absolute bottom-0 left-0 h-6 w-6 cursor-nesw-resize",onMouseDown:r=>ce("sw",r),onTouchStart:r=>xe("sw",r)}),jsx("div",{className:"absolute bottom-0 right-0 h-6 w-6 cursor-nwse-resize",onMouseDown:r=>ce("se",r),onTouchStart:r=>xe("se",r)})]}),jsx("style",{children:`
23
23
  .fe-window {
24
24
  background: var(--fe-bg);
25
25
  box-shadow: var(--fe-shadow);
@@ -80,4 +80,4 @@ import ln,{createContext,useState,useCallback,useRef,useLayoutEffect,useEffect,u
80
80
  from { opacity: 0; transform: translateX(-4px); }
81
81
  to { opacity: 1; transform: translateX(0); }
82
82
  }
83
- `}),jsx(en,{open:ce,onOpenChange:ze,children:jsxs(tn,{size:"sm",children:[jsxs(nn,{children:[jsxs(rn,{children:[jsx(AlertTriangle,{className:"text-danger-500"}),"Confirm Deletion"]}),jsxs(on,{children:[d.size===1?`Are you sure you want to delete "${J[Array.from(d)[0]]?.name}"?`:`Are you sure you want to delete ${d.size} selected items?`," ","This action cannot be undone."]})]}),jsxs(an,{children:[jsx(Dt,{intent:"ghost",onClick:()=>ze(false),children:"Cancel"}),jsxs(Dt,{intent:"danger",onClick:()=>{let t=Array.from(d).map(p=>J[p]).filter(Boolean);N?.(t),b(new Set),C(null),ze(false);},children:[jsx(Trash2,{className:"h-4 w-4"}),"Delete"]})]})]})})]})}function ot({label:e,value:n,mono:i}){return jsxs("div",{children:[jsx("div",{className:"mb-0.5 font-semibold uppercase tracking-wider text-(--fe-text-muted)",children:e}),jsx("div",{className:s("text-(--fe-text) break-all leading-snug",i&&"font-mono text-[9px]"),children:n})]})}function Br(e,n){let i=n.getBoundingClientRect(),g=Math.max(i.width,i.height)*1.2,k=e.clientX-i.left,m=e.clientY-i.top,h=document.createElement("span");h.className="masonry-ripple",h.style.width=`${g}px`,h.style.height=`${g}px`,h.style.left=`${k}px`,h.style.top=`${m}px`,n.appendChild(h),h.addEventListener("animationend",()=>h.remove());}function $t({columns:e,columnWidth:n=240,gap:i=16,items:g,onItemClick:k,className:m,style:h,children:D,...S}){let x=useRef(null),j=useRef([]),[T,N]=useState(()=>e??1),[w,_]=useState([]),[y,B]=useState(0),z=g?g.map((d,b)=>({key:d.key??b,node:d.content})):ln.Children.toArray(D).map((d,b)=>({key:d.key??b,node:d})),G=z.length,A=useCallback(d=>e??Math.max(1,Math.floor((d+i)/(n+i))),[e,n,i]),X=useCallback(()=>{let d=x.current;if(!d)return;let b=d.clientWidth,E=A(b);N(E);let C=(b-(E-1)*i)/E,o=new Array(E).fill(0),L=[];for(let ne=0;ne<G;ne++){let U=j.current[ne],be=U?U.offsetHeight:0,V=0;for(let he=1;he<E;he++)o[he]<o[V]&&(V=he);L.push({top:o[V],left:V*(C+i),width:C}),o[V]+=be+i;}let K=Math.max(0,...o)-(G?i:0);_(L),B(K);},[G,A,i]);useEffect(()=>{let d=x.current;if(!d)return;let b=new ResizeObserver(()=>X());return b.observe(d),()=>b.disconnect()},[X]),useEffect(()=>{let d=requestAnimationFrame(X);return ()=>cancelAnimationFrame(d)},[X]),useEffect(()=>{let d=new ResizeObserver(()=>X());return j.current.forEach(b=>{b&&d.observe(b);}),()=>d.disconnect()},[G,T,X]);let I=useCallback((d,b)=>{let E=d.currentTarget;Br(d,E),k?.(g?.[b],b);},[k,g]),ge=d=>{if(!g)return false;let b=g[d];return !!(b.title||b.description||b.actions)};return jsx("div",{ref:x,className:s("relative",m),style:{...h,height:y},...S,children:z.map((d,b)=>jsxs("div",{ref:E=>{j.current[b]=E;},className:"masonry-item",role:"button",tabIndex:0,onClick:E=>I(E,b),onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),k?.(g?.[b],b));},style:{position:"absolute",top:w[b]?.top??0,left:w[b]?.left??0,width:w[b]?.width??"100%"},children:[d.node,ge(b)&&jsxs("div",{className:"masonry-item-overlay",children:[g[b].title&&jsx("p",{className:"masonry-item-overlay-title",children:g[b].title}),g[b].description&&jsx("p",{className:"masonry-item-overlay-desc",children:g[b].description}),g[b].actions&&jsx("div",{className:"masonry-item-overlay-actions",children:g[b].actions})]})]},d.key))})}function ht({text:e="",mode:n="typewriter",speed:i=40,cursor:g=true,cursorChar:k="\u258B",thinking:m=false,streaming:h=false,delay:D=0,onComplete:S,as:x="span",className:j}){let[T,N]=useState(n==="instant"?e:""),[w,_]=useState(false),[y,B]=useState(n==="instant"),[z,G]=useState(false),A=useRef(0),X=useRef(S);X.current=S;let I=useRef(e);I.current=e,useEffect(()=>{if(n!=="typewriter")return;if(N(""),B(false),G(false),_(false),!e){B(true);return}let C=Math.max(10,1e3/i),o=0,L,K=()=>{_(true),L=setInterval(()=>{let U=I.current;o++,N(U.slice(0,o)),o>=U.length&&(clearInterval(L),_(false),B(true),X.current?.());},C);},ne;return D>0?ne=setTimeout(K,D):K(),()=>{clearTimeout(ne),clearInterval(L);}},[e,n]),useEffect(()=>{if(n!=="stream")return;if(e.length===0){A.current=0,N(""),_(false),B(false),G(false);return}if(e.length<=A.current)return;let C=Math.max(10,1e3/i),o=A.current;_(true),B(false),G(false);let L=setInterval(()=>{o++,A.current=o,N(I.current.slice(0,o)),o>=I.current.length&&(clearInterval(L),_(false),X.current?.());},C);return ()=>clearInterval(L)},[e,n]),useEffect(()=>{n==="instant"&&(N(e),_(false),B(true));},[e,n]);let ge=useRef(h);useEffect(()=>{let C=ge.current;if(ge.current=h,C&&!h&&!w&&n==="stream"){G(true);let o=setTimeout(()=>{G(false),B(true);},650);return ()=>clearTimeout(o)}},[h,w,n]);let d=g&&(m||w||z||n==="stream"&&h&&!y||n==="typewriter"&&!y),b=m?"tw-cursor--blink":w?"tw-cursor--solid":z?"tw-cursor--out":"tw-cursor--blink";return jsxs(x,{className:s(j),children:[m&&!T&&jsx("span",{"aria-hidden":"true",children:"\u200B"}),T,d&&jsx("span",{className:s("tw-cursor",b),"aria-hidden":"true",children:k})]})}var Kr={FilmReel:Nt,MiniPlayer:Mt,CinePlayer:Tt,FileExplorer:Ht,Masonry:$t,TypewriterText:ht},va=Kr;export{Tt as CinePlayer,Kr as Extras,Ht as FileExplorer,Nt as FilmReel,$t as Masonry,Mt as MiniPlayer,ht as TypewriterText,va as default};
83
+ `}),jsx(cr,{open:pe,onOpenChange:He,children:jsxs(dr,{size:"sm",children:[jsxs(ur,{children:[jsxs(mr,{children:[jsx(AlertTriangle,{className:"text-danger-500"}),"Confirm Deletion"]}),jsxs(pr,{children:[b.size===1?`Are you sure you want to delete "${ee[Array.from(b)[0]]?.name}"?`:`Are you sure you want to delete ${b.size} selected items?`," ","This action cannot be undone."]})]}),jsxs(fr,{children:[jsx(Ft,{intent:"ghost",onClick:()=>He(false),children:"Cancel"}),jsxs(Ft,{intent:"danger",onClick:()=>{let r=Array.from(b).map(k=>ee[k]).filter(Boolean);l?.(r),M(new Set),R(null),He(false);},children:[jsx(Trash2,{className:"h-4 w-4"}),"Delete"]})]})]})})]})}function lt({label:e,value:t,mono:n}){return jsxs("div",{children:[jsx("div",{className:"mb-0.5 font-semibold uppercase tracking-wider text-(--fe-text-muted)",children:e}),jsx("div",{className:o("text-(--fe-text) break-all leading-snug",n&&"font-mono text-[9px]"),children:t})]})}function ma(e,t){let n=t.getBoundingClientRect(),u=Math.max(n.width,n.height)*1.2,f=e.clientX-n.left,c=e.clientY-n.top,d=document.createElement("span");d.className="masonry-ripple",d.style.width=`${u}px`,d.style.height=`${u}px`,d.style.left=`${f}px`,d.style.top=`${c}px`,t.appendChild(d),d.addEventListener("animationend",()=>d.remove());}function Yt({columns:e,columnWidth:t=240,gap:n=16,items:u,onItemClick:f,className:c,style:d,children:v,...y}){let h=useRef(null),L=useRef([]),[w,l]=useState(()=>e??1),[m,P]=useState([]),[N,H]=useState(0),E=u?u.map((b,M)=>({key:b.key??M,node:b.content})):br.Children.toArray(v).map((b,M)=>({key:b.key??M,node:b})),z=E.length,V=useCallback(b=>e??Math.max(1,Math.floor((b+n)/(t+n))),[e,t,n]),O=useCallback(()=>{let b=h.current;if(!b)return;let M=b.clientWidth,_=V(M);l(_);let R=(M-(_-1)*n)/_,s=new Array(_).fill(0),A=[];for(let ne=0;ne<z;ne++){let q=L.current[ne],ve=q?q.offsetHeight:0,X=0;for(let ye=1;ye<_;ye++)s[ye]<s[X]&&(X=ye);A.push({top:s[X],left:X*(R+n),width:R}),s[X]+=ve+n;}let Y=Math.max(0,...s)-(z?n:0);P(A),H(Y);},[z,V,n]);useEffect(()=>{let b=h.current;if(!b)return;let M=new ResizeObserver(()=>O());return M.observe(b),()=>M.disconnect()},[O]),useEffect(()=>{let b=requestAnimationFrame(O);return ()=>cancelAnimationFrame(b)},[O]),useEffect(()=>{let b=new ResizeObserver(()=>O());return L.current.forEach(M=>{M&&b.observe(M);}),()=>b.disconnect()},[z,w,O]);let $=useCallback((b,M)=>{let _=b.currentTarget;ma(b,_),f?.(u?.[M],M);},[f,u]),me=b=>{if(!u)return false;let M=u[b];return !!(M.title||M.description||M.actions)};return jsx("div",{ref:h,className:o("relative",c),style:{...d,height:N},...y,children:E.map((b,M)=>jsxs("div",{ref:_=>{L.current[M]=_;},className:"masonry-item",role:"button",tabIndex:0,onClick:_=>$(_,M),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),f?.(u?.[M],M));},style:{position:"absolute",top:m[M]?.top??0,left:m[M]?.left??0,width:m[M]?.width??"100%"},children:[b.node,me(M)&&jsxs("div",{className:"masonry-item-overlay",children:[u[M].title&&jsx("p",{className:"masonry-item-overlay-title",children:u[M].title}),u[M].description&&jsx("p",{className:"masonry-item-overlay-desc",children:u[M].description}),u[M].actions&&jsx("div",{className:"masonry-item-overlay-actions",children:u[M].actions})]})]},b.key))})}function wt({text:e="",mode:t="typewriter",speed:n=40,cursor:u=true,cursorChar:f="\u258B",thinking:c=false,streaming:d=false,delay:v=0,onComplete:y,as:h="span",className:L}){let[w,l]=useState(t==="instant"?e:""),[m,P]=useState(false),[N,H]=useState(t==="instant"),[E,z]=useState(false),V=useRef(0),O=useRef(y);O.current=y;let $=useRef(e);$.current=e,useEffect(()=>{if(t!=="typewriter")return;if(l(""),H(false),z(false),P(false),!e){H(true);return}let R=Math.max(10,1e3/n),s=0,A,Y=()=>{P(true),A=setInterval(()=>{let q=$.current;s++,l(q.slice(0,s)),s>=q.length&&(clearInterval(A),P(false),H(true),O.current?.());},R);},ne;return v>0?ne=setTimeout(Y,v):Y(),()=>{clearTimeout(ne),clearInterval(A);}},[e,t]),useEffect(()=>{if(t!=="stream")return;if(e.length===0){V.current=0,l(""),P(false),H(false),z(false);return}if(e.length<=V.current)return;let R=Math.max(10,1e3/n),s=V.current;P(true),H(false),z(false);let A=setInterval(()=>{s++,V.current=s,l($.current.slice(0,s)),s>=$.current.length&&(clearInterval(A),P(false),O.current?.());},R);return ()=>clearInterval(A)},[e,t]),useEffect(()=>{t==="instant"&&(l(e),P(false),H(true));},[e,t]);let me=useRef(d);useEffect(()=>{let R=me.current;if(me.current=d,R&&!d&&!m&&t==="stream"){z(true);let s=setTimeout(()=>{z(false),H(true);},650);return ()=>clearTimeout(s)}},[d,m,t]);let b=u&&(c||m||E||t==="stream"&&d&&!N||t==="typewriter"&&!N),M=c?"tw-cursor--blink":m?"tw-cursor--solid":E?"tw-cursor--out":"tw-cursor--blink";return jsxs(h,{className:o(L),children:[c&&!w&&jsx("span",{"aria-hidden":"true",children:"\u200B"}),w,b&&jsx("span",{className:o("tw-cursor",M),"aria-hidden":"true",children:f})]})}function kt(e){return e.toLowerCase().replace(/\s+/g," ").trim()}function fa(e,t){if(!t)return true;let n=kt(t);return kt(e.label).includes(n)||(e.description?kt(e.description).includes(n):false)||(e.keywords?e.keywords.some(u=>kt(u).includes(n)):false)}function ga(e){let t=new Map;for(let n of e){let u=n.group??"";t.has(u)||t.set(u,[]),t.get(u).push(n);}return Array.from(t.entries()).map(([n,u])=>({label:n,items:u}))}function Lr(e,t,n,u){let[f,c]=useState(""),[d,v]=useState(0);useEffect(()=>{t&&(c(""),v(0));},[t]);let y=useMemo(()=>e.filter(l=>!l.disabled&&fa(l,f)),[e,f]),h=useMemo(()=>ga(y),[y]);useEffect(()=>{v(l=>Math.min(l,Math.max(0,y.length-1)));},[y.length]);let L=useCallback(()=>{let l=y[d];l&&(l.onSelect(),n(false));},[y,d,n]),w=useCallback(l=>{switch(l.key){case "ArrowDown":l.preventDefault(),v(m=>(m+1)%Math.max(1,y.length));break;case "ArrowUp":l.preventDefault(),v(m=>(m-1+Math.max(1,y.length))%Math.max(1,y.length));break;case "Enter":l.preventDefault(),L();break;case "Escape":l.preventDefault(),n(false);break}},[y.length,L,n]);return useEffect(()=>{if(!u)return;function l(m){(m.metaKey||m.ctrlKey)&&m.key==="k"&&(m.preventDefault(),n(!t));}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[u,t,n]),{query:f,setQuery:c,groups:h,filtered:y,activeIndex:d,setActiveIndex:v,handleKeyDown:w}}function Nt({open:e,onOpenChange:t,commands:n,placeholder:u="Type a command or search\u2026",hotkey:f=true,maxItems:c=8,className:d}){let v=useRef(null),y=useRef(null),{query:h,setQuery:L,groups:w,filtered:l,activeIndex:m,setActiveIndex:P,handleKeyDown:N}=Lr(n,e,t,f);if(useEffect(()=>{if(e){let E=setTimeout(()=>v.current?.focus(),40);return ()=>clearTimeout(E)}},[e]),useEffect(()=>{y.current?.querySelector("[data-active='true']")?.scrollIntoView({block:"nearest"});},[m]),!e)return null;let H=0;return createPortal(jsx("div",{className:"cmd-backdrop fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",onClick:()=>t(false),role:"presentation",children:jsxs("div",{className:o("cmd-panel relative flex w-full max-w-lg flex-col overflow-hidden rounded-xl","border border-primary-200 bg-white shadow-2xl","dark:border-primary-700 dark:bg-primary-900",d),onClick:E=>E.stopPropagation(),onKeyDown:N,role:"dialog","aria-label":"Command palette","aria-modal":"true",children:[jsxs("div",{className:"flex items-center gap-3 border-b border-primary-100 px-4 dark:border-primary-700",children:[jsx(Search,{className:"h-4 w-4 shrink-0 text-secondary-400","aria-hidden":"true"}),jsx("input",{ref:v,value:h,onChange:E=>L(E.target.value),placeholder:u,className:"flex-1 bg-transparent py-3.5 text-sm text-primary-900 outline-none placeholder:text-secondary-400 dark:text-primary-50","aria-label":"Search commands","aria-controls":"cmd-results","aria-autocomplete":"list","aria-activedescendant":l[m]?`cmd-item-${l[m].id}`:void 0,spellCheck:false,autoComplete:"off"}),jsx("kbd",{className:"hidden shrink-0 rounded border border-primary-200 px-1.5 py-0.5 text-xs text-secondary-400 dark:border-primary-600 sm:block",children:"esc"})]}),jsx("div",{id:"cmd-results",ref:y,className:"overflow-y-auto py-2",style:{maxHeight:`${c*2.75}rem`},role:"listbox","aria-label":"Commands",children:l.length===0?jsxs("div",{className:"flex flex-col items-center gap-2 py-8 text-sm text-secondary-400",children:[jsx(Command,{className:"h-8 w-8 opacity-30"}),jsx("span",{children:"No commands found"})]}):w.map(E=>jsxs("div",{className:"mb-1 last:mb-0",children:[E.label&&jsx("p",{className:"px-4 pb-1 pt-2 text-xs font-semibold uppercase tracking-wide text-secondary-400 dark:text-secondary-500",children:E.label}),E.items.map(z=>{let V=H++,O=V===m;return jsxs("button",{id:`cmd-item-${z.id}`,"data-active":O,role:"option","aria-selected":O,className:o("cmd-item group flex w-full items-center gap-3 px-4 py-2.5 text-left text-sm",O?"bg-primary-100 text-primary-900 dark:bg-primary-800 dark:text-primary-50":"text-primary-700 hover:bg-primary-50 dark:text-primary-300 dark:hover:bg-primary-800/50"),onMouseEnter:()=>P(V),onClick:()=>{z.onSelect(),t(false);},children:[z.icon&&jsx("span",{className:o("flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-xs",O?"border-primary-300 bg-white text-primary-700 dark:border-primary-600 dark:bg-primary-700 dark:text-primary-200":"border-primary-200 bg-primary-50 text-primary-500 dark:border-primary-700 dark:bg-primary-800 dark:text-primary-400"),children:z.icon}),jsxs("span",{className:"min-w-0 flex-1",children:[jsx("span",{className:"block truncate font-medium",children:z.label}),z.description&&jsx("span",{className:"block truncate text-xs text-secondary-400 dark:text-secondary-500",children:z.description})]}),z.shortcut&&jsx("span",{className:"flex shrink-0 items-center gap-0.5",children:z.shortcut.map(($,me)=>jsx("kbd",{className:"rounded border border-primary-200 px-1.5 py-0.5 text-xs text-secondary-500 dark:border-primary-700 dark:text-secondary-400",children:$},me))})]},z.id)})]},E.label||"_default"))}),l.length>0&&jsxs("div",{className:"flex items-center justify-between border-t border-primary-100 px-4 py-2 dark:border-primary-700",children:[jsxs("span",{className:"text-xs text-secondary-400",children:[l.length," result",l.length!==1?"s":""]}),jsxs("span",{className:"flex items-center gap-3 text-xs text-secondary-400",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u2191"}),jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u2193"}),"Navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u21B5"}),"Select"]})]})]})]})}),document.body)}var Ar={complete:"bg-success-500 border-success-500 text-white dark:bg-success-600 dark:border-success-600",active:"bg-primary-500 border-primary-500 text-white dark:bg-primary-400 dark:border-primary-400",error:"bg-danger-500 border-danger-500 text-white dark:bg-danger-600 dark:border-danger-600",pending:"bg-white border-primary-300 text-secondary-400 dark:bg-primary-800 dark:border-primary-600"},Ir={complete:"shadow-[0_0_0_4px_theme(colors.success.100)] dark:shadow-[0_0_0_4px_theme(colors.success.900/30)]",active:"shadow-[0_0_0_4px_theme(colors.primary.100)] dark:shadow-[0_0_0_4px_theme(colors.primary.800/50)] animate-pulse",error:"shadow-[0_0_0_4px_theme(colors.danger.100)] dark:shadow-[0_0_0_4px_theme(colors.danger.900/30)]",pending:""};function Fr({status:e,icon:t}){return t?jsx(Fragment,{children:t}):e==="complete"?jsx(Check,{className:"h-3 w-3"}):e==="error"?jsx(AlertCircle,{className:"h-3 w-3"}):e==="active"?jsx(Dot,{className:"h-4 w-4"}):jsx(Clock,{className:"h-3 w-3"})}function Hr({images:e,title:t}){let n=e.slice(0,4),u=e.length>4?e.length-4:0,f=(c,d,v)=>jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:o("relative block overflow-hidden",v),onClick:y=>y.stopPropagation(),children:[jsx("img",{src:c,alt:`${t} ${d+1}`,className:"h-full w-full object-cover transition-transform duration-300 hover:scale-105"}),d===n.length-1&&u>0&&jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/60",children:jsxs("span",{className:"text-sm font-semibold text-white",children:["+",u]})})]},d);return n.length===0?null:n.length===1?jsx("div",{className:"mt-2.5 h-36 overflow-hidden rounded-xl",children:f(n[0],0,"h-full")}):n.length===2?jsx("div",{className:"mt-2.5 grid h-28 grid-cols-2 gap-0.5 overflow-hidden rounded-xl",children:n.map((c,d)=>f(c,d))}):n.length===3?jsxs("div",{className:"mt-2.5 grid h-36 grid-cols-2 grid-rows-2 gap-0.5 overflow-hidden rounded-xl",children:[f(n[0],0,"row-span-2"),f(n[1],1),f(n[2],2)]}):jsx("div",{className:"mt-2.5 grid h-44 grid-cols-2 grid-rows-2 gap-0.5 overflow-hidden rounded-xl",children:n.map((c,d)=>f(c,d))})}function Vr({actions:e}){let t=e.filter(d=>d.variant!=="primary"),n=e.filter(d=>d.variant==="primary"),u="inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium text-secondary-500 transition-colors hover:bg-secondary-100/80 hover:text-secondary-700 dark:text-secondary-400 dark:hover:bg-primary-800/60 dark:hover:text-secondary-200",f="inline-flex items-center gap-1.5 rounded-lg border border-primary-200/70 bg-primary-50/80 px-3 py-1 text-xs font-semibold text-primary-700 transition-colors hover:bg-primary-100 dark:border-primary-600/60 dark:bg-primary-800/60 dark:text-primary-300 dark:hover:bg-primary-700/60",c=(d,v,y)=>d.href?jsxs("a",{href:d.href,target:"_blank",rel:"noopener noreferrer",className:y,onClick:h=>h.stopPropagation(),children:[d.icon,d.label]},v):jsxs("button",{type:"button",onClick:d.onClick,className:y,children:[d.icon,d.label]},v);return jsxs("div",{className:"mt-3 flex items-center gap-1 border-t border-primary-100/50 pt-2.5 dark:border-primary-700/40",children:[t.map((d,v)=>c(d,v,u)),n.length>0&&jsx("span",{className:"flex-1"}),n.map((d,v)=>c(d,v,f))]})}function Or({item:e,isActive:t,animated:n,visible:u,orientation:f}){let c=e.status??"pending",d={complete:"bg-gradient-to-br from-white to-success-50/40 dark:from-primary-900 dark:to-success-900/10",active:"bg-gradient-to-br from-white to-primary-50/60 dark:from-primary-900 dark:to-primary-800/40",error:"bg-gradient-to-br from-white to-danger-50/40 dark:from-primary-900 dark:to-danger-900/10",pending:"bg-white dark:bg-primary-900"}[c],v={complete:"border-success-200/70 dark:border-success-800/50",active:"border-primary-300/80 dark:border-primary-600/70",error:"border-danger-200/70 dark:border-danger-800/50",pending:"border-primary-200/60 dark:border-primary-700/50"}[c],y=t?"shadow-lg shadow-primary-300/30 dark:shadow-primary-500/20":c==="complete"?"shadow-md shadow-success-300/20 dark:shadow-success-400/10":c==="error"?"shadow-md shadow-danger-300/20 dark:shadow-danger-400/10":"shadow-sm shadow-primary-100/50 dark:shadow-black/20",h=c==="complete"?"conic-gradient(from 30deg, transparent 0%, var(--tl-glow-complete-1) 18%, var(--tl-glow-complete-2) 30%, var(--tl-holo-cyan) 44%, transparent 60%)":c==="error"?"conic-gradient(from 150deg, transparent 0%, var(--tl-glow-error-1) 18%, var(--tl-glow-error-2) 32%, var(--tl-glow-error-3) 44%, transparent 58%)":null,L={complete:"bg-success-100 text-success-700 dark:bg-success-900/40 dark:text-success-300",active:"bg-primary-100 text-primary-700 dark:bg-primary-800/60 dark:text-primary-300",error:"bg-danger-100 text-danger-700 dark:bg-danger-900/40 dark:text-danger-300",pending:"bg-secondary-100 text-secondary-600 dark:bg-primary-800/50 dark:text-secondary-400"}[c];return jsxs("div",{className:o("relative isolate",n&&"transition-all duration-700",n?u?"opacity-100 translate-y-0":f==="vertical"?"opacity-0 translate-y-6":"opacity-0 translate-x-6":"",f==="horizontal"?"w-56 shrink-0":"flex-1",e.className),children:[!t&&h&&jsx("div",{className:"pointer-events-none absolute animate-[tl-glow-pulse_5s_ease-in-out_infinite]",style:{inset:"-6px",borderRadius:"1.5rem",zIndex:-1,background:h,filter:"blur(14px)",opacity:.22},"aria-hidden":true}),t&&jsxs(Fragment,{children:[jsx("div",{className:"pointer-events-none absolute",style:{inset:"-7px",borderRadius:"1.5rem",zIndex:-1,background:"conic-gradient(from var(--tl-angle, 0deg) at 50% 50%, var(--tl-holo-base) 0%, var(--tl-holo-indigo) 18%, var(--tl-holo-violet) 30%, var(--tl-holo-cyan) 45%, var(--tl-holo-mid) 62%, var(--tl-holo-base) 100%)",filter:"blur(10px)",animation:"tl-breathe 2.8s ease-in-out infinite, tl-holo-spin 9s linear infinite"},"aria-hidden":true}),jsx("div",{className:"pointer-events-none absolute",style:{inset:"-1.5px",borderRadius:"1.0625rem",zIndex:-1,padding:"1.5px",background:"conic-gradient(from var(--tl-angle, 0deg) at 50% 50%, transparent 0deg, var(--tl-holo-indigo) 55deg, var(--tl-holo-violet) 85deg, var(--tl-holo-cyan) 115deg, transparent 175deg, transparent 360deg)",WebkitMask:"linear-gradient(white 0 0) content-box, linear-gradient(white 0 0)",WebkitMaskComposite:"xor",maskComposite:"exclude",animation:"tl-holo-spin 5s linear infinite"},"aria-hidden":true})]}),jsx("div",{className:o("relative overflow-hidden rounded-2xl border backdrop-blur-[2px]",t?"border-transparent":o("border",v),d,y),children:e.imagePosition==="left"&&e.image?jsxs("div",{className:"flex min-h-[8rem]",children:[jsx("a",{href:e.image,target:"_blank",rel:"noopener noreferrer",className:"w-28 shrink-0 overflow-hidden",onClick:l=>l.stopPropagation(),"aria-label":e.title,children:jsx("img",{src:e.image,alt:e.title,className:"h-full w-full object-cover transition-transform duration-500 hover:scale-105"})}),jsxs("div",{className:"flex flex-1 flex-col p-4",children:[e.date&&jsx("span",{className:o("mb-2 inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[0.65rem] font-semibold tracking-wide",L),children:e.date}),jsx("h3",{className:o("text-sm font-semibold leading-snug",t?"text-primary-900 dark:text-white":"text-primary-800 dark:text-primary-100"),children:e.title}),e.description&&jsx("p",{className:"mt-1 text-xs leading-relaxed text-secondary-500 dark:text-secondary-400",children:e.description}),e.images&&e.images.length>0&&jsx(Hr,{images:e.images,title:e.title}),e.actions&&e.actions.length>0&&jsx(Vr,{actions:e.actions})]})]}):jsxs(Fragment,{children:[e.image&&jsx("div",{className:"overflow-hidden",children:jsx("img",{src:e.image,alt:e.title,className:"h-32 w-full object-cover transition-transform duration-500 hover:scale-105"})}),e.svg&&!e.image&&jsx("div",{className:"flex items-center justify-center bg-primary-50/60 p-4 dark:bg-primary-800/40",children:e.svg}),jsxs("div",{className:o("p-4",(e.image||e.svg)&&"pt-3"),children:[e.date&&jsx("span",{className:o("mb-2.5 inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[0.65rem] font-semibold tracking-wide",L),children:e.date}),jsx("h3",{className:o("text-sm font-semibold leading-snug",t?"text-primary-900 dark:text-white":"text-primary-800 dark:text-primary-100"),children:e.title}),e.description&&jsx("p",{className:"mt-1 text-xs leading-relaxed text-secondary-500 dark:text-secondary-400",children:e.description}),e.images&&e.images.length>0&&jsx(Hr,{images:e.images,title:e.title}),e.actions&&e.actions.length>0&&jsx(Vr,{actions:e.actions})]})]})})]})}function qt({items:e,orientation:t="vertical",activeIndex:n,animated:u=true,lineStyle:f="solid",className:c}){let d=useRef(null),v=useRef([]),[y,h]=useState(new Set);useEffect(()=>{if(!u){h(new Set(e.map((l,m)=>m)));return}let w=new IntersectionObserver(l=>{h(m=>{let P=new Set(m);return l.forEach(N=>{let H=Number(N.target.dataset.idx);N.isIntersecting&&P.add(H);}),P});},{threshold:.15});return v.current.forEach(l=>l&&w.observe(l)),()=>w.disconnect()},[e,u]),useEffect(()=>{if(n==null)return;let w=v.current[n];w&&w.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[n]);let L=f==="dashed"?"border-dashed":"";return t==="vertical"?jsxs("div",{ref:d,className:o("relative",c),children:[jsx("div",{className:"absolute left-5 top-0 h-full w-px bg-primary-200 dark:bg-primary-700"}),jsx("div",{className:"space-y-6",children:e.map((w,l)=>{let m=w.status??"pending",P=l===n;return jsxs("div",{ref:N=>{v.current[l]=N;},"data-idx":l,className:"relative flex gap-4",children:[jsx("div",{className:"relative z-10 flex shrink-0 flex-col items-center",children:jsx("div",{className:o("flex h-10 w-10 items-center justify-center rounded-full border-2 transition-all duration-300 [&_svg]:shrink-0",Ar[m],P&&Ir[m]),children:jsx(Fr,{status:m,icon:w.icon})})}),jsx(Or,{item:w,isActive:P,animated:u,visible:y.has(l),orientation:"vertical"})]},w.id??l)})})]}):jsx("div",{ref:d,className:o("relative overflow-x-auto pb-4",c),children:jsx("div",{className:"flex min-w-max gap-6 px-4",children:e.map((w,l)=>{let m=w.status??"pending",P=l===n,N=l===e.length-1;return jsxs("div",{ref:H=>{v.current[l]=H;},"data-idx":l,className:"relative flex flex-col items-center gap-3",children:[jsxs("div",{className:"flex items-center",children:[jsx("div",{className:o("flex h-10 w-10 items-center justify-center rounded-full border-2 transition-all duration-300 z-10 [&_svg]:shrink-0",Ar[m],P&&Ir[m]),children:jsx(Fr,{status:m,icon:w.icon})}),!N&&jsx("div",{className:o("h-px w-28 border-t-2",L,m==="complete"?"border-success-400":"border-primary-200 dark:border-primary-700")})]}),jsx(Or,{item:w,isActive:P,animated:u,visible:y.has(l),orientation:"horizontal"})]},w.id??l)})})})}var Ca={FilmReel:Pt,MiniPlayer:Rt,CinePlayer:zt,FileExplorer:Bt,Masonry:Yt,TypewriterText:wt,CommandPalette:Nt,Timeline:qt},Ss=Ca;export{zt as CinePlayer,Nt as CommandPalette,Ca as Extras,Bt as FileExplorer,Pt as FilmReel,Yt as Masonry,Rt as MiniPlayer,qt as Timeline,wt as TypewriterText,Ss as default};
@@ -1 +1 @@
1
- 'use strict';var react=require('react'),reactDom=require('react-dom'),client=require('react-dom/client'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime');function i(...t){return tailwindMerge.twMerge(clsx.clsx(t))}classVarianceAuthority.cva("relative w-full overflow-hidden rounded-full bg-primary-200 dark:bg-primary-700",{variants:{size:{xs:"h-1",sm:"h-2",md:"h-3",lg:"h-4"},intent:{primary:"[&_.progress-fill]:bg-primary-500",success:"[&_.progress-fill]:bg-success-500",warning:"[&_.progress-fill]:bg-warning-500",danger:"[&_.progress-fill]:bg-danger-500"},edge:{none:"rounded-full",top:"fixed top-0 left-0 right-0 z-50 rounded-none",bottom:"fixed bottom-0 left-0 right-0 z-50 rounded-none"}},defaultVariants:{size:"md",intent:"primary",edge:"none"}});classVarianceAuthority.cva("text-primary-500 dark:text-primary-400",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}});var p=classVarianceAuthority.cva("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg transition-all",{variants:{intent:{success:"border-success-200 bg-success-50 text-success-800 dark:border-success-800 dark:bg-success-900/80 dark:text-success-200",warning:"border-warning-200 bg-warning-50 text-warning-800 dark:border-warning-800 dark:bg-warning-900/80 dark:text-warning-200",error:"border-danger-200 bg-danger-50 text-danger-800 dark:border-danger-800 dark:bg-danger-900/80 dark:text-danger-200",info:"border-primary-200 bg-primary-50 text-primary-800 dark:border-primary-800 dark:bg-primary-900/80 dark:text-primary-200"}},defaultVariants:{intent:"info"}});function et({intent:t,className:e,children:n,...r}){return jsxRuntime.jsx("div",{className:i(p({intent:t}),e),role:"alert",...r,children:n})}function rt({className:t,...e}){return jsxRuntime.jsx("h5",{className:i("flex items-center gap-1.5 font-semibold [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",t),...e})}function nt({className:t,...e}){return jsxRuntime.jsx("span",{className:i("mt-0.5 shrink-0 [&_svg]:h-5 [&_svg]:w-5",t),...e})}function ot({className:t,...e}){return jsxRuntime.jsx("div",{className:i("flex-1 min-w-0 space-y-1",t),...e})}function it({className:t,...e}){return jsxRuntime.jsx("p",{className:i("text-sm opacity-90",t),...e})}var I=0,a=[],m=new Map,d=new Set;function M(){return a}function u(){d.forEach(t=>t());}function g(t){let e=m.get(t);e&&(clearTimeout(e),m.delete(t)),a=a.map(n=>n.id===t?{...n,exiting:true}:n),u(),setTimeout(()=>{a=a.filter(n=>n.id!==t),u();},200);}function H(t){let e=`alert-${++I}`;a=[...a,{...t,id:e}],u();let n=t.duration??5e3;if(n>0){let r=setTimeout(()=>{m.delete(e),g(e);},n);m.set(e,r);}return e}var f=16;function st(t){f=t;}var E={"top-right":"right-4 items-end","top-left":"left-4 items-start","bottom-right":"bottom-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","top-center":"left-1/2 -translate-x-1/2 items-center","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center"},L={"top-right":"animate-slide-in-right","top-left":"animate-slide-in-left","bottom-right":"animate-slide-in-right","bottom-left":"animate-slide-in-left","top-center":"animate-slide-in-top","bottom-center":"animate-slide-in-bottom"},_={success:lucideReact.CircleCheck,warning:lucideReact.TriangleAlert,error:lucideReact.CircleX,info:lucideReact.Info};function S({alert:t,onClose:e}){let n=t.intent??"info",r=_[n],l=t.position??"top-right";return jsxRuntime.jsxs("div",{className:i(p({intent:n}),L[l],t.exiting&&"opacity-0 transition-opacity duration-200","w-80 max-w-[calc(100vw-2rem)]"),role:"alert",children:[jsxRuntime.jsx(r,{className:"mt-0.5 h-5 w-5 shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[t.title&&jsxRuntime.jsx("p",{className:"font-semibold",children:t.title}),jsxRuntime.jsx("p",{className:i(t.title&&"text-sm opacity-90"),children:t.message})]}),jsxRuntime.jsx("button",{onClick:e,"aria-label":"Close notification",className:"shrink-0 cursor-pointer opacity-50 transition-opacity hover:opacity-100",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}var z=t=>t.startsWith("top");function O(){let t=react.useSyncExternalStore(r=>(d.add(r),()=>d.delete(r)),M),e=react.useRef(f);if(react.useEffect(()=>{e.current=f;},[]),t.length===0)return null;let n=t.reduce((r,l)=>{let s=l.position??"top-right";return (r[s]??(r[s]=[])).push(l),r},{});return reactDom.createPortal(jsxRuntime.jsx(jsxRuntime.Fragment,{children:Object.entries(n).map(([r,l])=>jsxRuntime.jsx("div",{style:z(r)?{top:`${e.current}px`}:void 0,className:i("pointer-events-none fixed z-100 flex flex-col gap-2",E[r]),children:l.map(s=>jsxRuntime.jsx(S,{alert:s,onClose:()=>g(s.id)},s.id))},r))}),document.body)}var b=false;function D(){if(b)return;b=true;let t=document.createElement("div");t.id="alert-toast-root",document.body.appendChild(t),client.createRoot(t).render(jsxRuntime.jsx(O,{}));}function at(){return react.useEffect(()=>{D();},[]),{addAlert:H,removeAlert:g}}exports.Alert=et;exports.AlertContent=ot;exports.AlertDescription=it;exports.AlertIcon=nt;exports.AlertTitle=rt;exports.configureAlertTopOffset=st;exports.useAlert=at;
1
+ 'use strict';var react=require('react'),reactDom=require('react-dom'),client=require('react-dom/client'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime');function i(...t){return tailwindMerge.twMerge(clsx.clsx(t))}classVarianceAuthority.cva("relative w-full overflow-hidden rounded-full bg-primary-200 dark:bg-primary-700",{variants:{size:{xs:"h-1",sm:"h-2",md:"h-3",lg:"h-4"},intent:{primary:"[&_.progress-fill]:bg-primary-500",success:"[&_.progress-fill]:bg-success-500",warning:"[&_.progress-fill]:bg-warning-500",danger:"[&_.progress-fill]:bg-danger-500"},edge:{none:"rounded-full",top:"fixed top-0 left-0 right-0 z-50 rounded-none",bottom:"fixed bottom-0 left-0 right-0 z-50 rounded-none"}},defaultVariants:{size:"md",intent:"primary",edge:"none"}});classVarianceAuthority.cva("text-primary-500 dark:text-primary-400",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}});var c=classVarianceAuthority.cva("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg transition-all",{variants:{intent:{success:"border-success-200 bg-success-50 text-success-800 dark:border-success-800 dark:bg-success-900/80 dark:text-success-200",warning:"border-warning-200 bg-warning-50 text-warning-800 dark:border-warning-800 dark:bg-warning-900/80 dark:text-warning-200",error:"border-danger-200 bg-danger-50 text-danger-800 dark:border-danger-800 dark:bg-danger-900/80 dark:text-danger-200",info:"border-primary-200 bg-primary-50 text-primary-800 dark:border-primary-800 dark:bg-primary-900/80 dark:text-primary-200"}},defaultVariants:{intent:"info"}});classVarianceAuthority.cva("skeleton-base bg-secondary-200 dark:bg-secondary-700",{variants:{variant:{text:"skeleton-text w-full rounded-sm",circular:"rounded-full",rectangular:"rounded-none",rounded:"rounded-md"},animation:{pulse:"animate-pulse",wave:"skeleton-wave",none:""}},defaultVariants:{variant:"text",animation:"pulse"}});classVarianceAuthority.cva("border",{variants:{variant:{default:"bg-primary-800 text-primary-50 border-primary-700 dark:bg-primary-100 dark:text-primary-900 dark:border-primary-200",success:"bg-success-500 text-white border-success-600 dark:bg-success-600 dark:border-success-700",danger:"bg-danger-500 text-white border-danger-600 dark:bg-danger-600 dark:border-danger-700",warning:"bg-warning-500 text-warning-900 border-warning-600 dark:bg-warning-600 dark:text-white dark:border-warning-700",info:"bg-primary-500 text-white border-primary-600 dark:bg-primary-600 dark:border-primary-700"}},defaultVariants:{variant:"default"}});function nt({intent:t,className:e,children:n,...r}){return jsxRuntime.jsx("div",{className:i(c({intent:t}),e),role:"alert",...r,children:n})}function ot({className:t,...e}){return jsxRuntime.jsx("h5",{className:i("flex items-center gap-1.5 font-semibold [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",t),...e})}function it({className:t,...e}){return jsxRuntime.jsx("span",{className:i("mt-0.5 shrink-0 [&_svg]:h-5 [&_svg]:w-5",t),...e})}function at({className:t,...e}){return jsxRuntime.jsx("div",{className:i("flex-1 min-w-0 space-y-1",t),...e})}function st({className:t,...e}){return jsxRuntime.jsx("p",{className:i("text-sm opacity-90",t),...e})}var I=0,s=[],m=new Map,p=new Set;function M(){return s}function u(){p.forEach(t=>t());}function f(t){let e=m.get(t);e&&(clearTimeout(e),m.delete(t)),s=s.map(n=>n.id===t?{...n,exiting:true}:n),u(),setTimeout(()=>{s=s.filter(n=>n.id!==t),u();},200);}function H(t){let e=`alert-${++I}`;s=[...s,{...t,id:e}],u();let n=t.duration??5e3;if(n>0){let r=setTimeout(()=>{m.delete(e),f(e);},n);m.set(e,r);}return e}var g=16;function lt(t){g=t;}var E={"top-right":"right-4 items-end","top-left":"left-4 items-start","bottom-right":"bottom-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","top-center":"left-1/2 -translate-x-1/2 items-center","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center"},L={"top-right":"animate-slide-in-right","top-left":"animate-slide-in-left","bottom-right":"animate-slide-in-right","bottom-left":"animate-slide-in-left","top-center":"animate-slide-in-top","bottom-center":"animate-slide-in-bottom"},_={success:lucideReact.CircleCheck,warning:lucideReact.TriangleAlert,error:lucideReact.CircleX,info:lucideReact.Info};function S({alert:t,onClose:e}){let n=t.intent??"info",r=_[n],l=t.position??"top-right";return jsxRuntime.jsxs("div",{className:i(c({intent:n}),L[l],t.exiting&&"opacity-0 transition-opacity duration-200","w-80 max-w-[calc(100vw-2rem)]"),role:"alert",children:[jsxRuntime.jsx(r,{className:"mt-0.5 h-5 w-5 shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[t.title&&jsxRuntime.jsx("p",{className:"font-semibold",children:t.title}),jsxRuntime.jsx("p",{className:i(t.title&&"text-sm opacity-90"),children:t.message})]}),jsxRuntime.jsx("button",{onClick:e,"aria-label":"Close notification",className:"shrink-0 cursor-pointer opacity-50 transition-opacity hover:opacity-100",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}var z=t=>t.startsWith("top");function O(){let t=react.useSyncExternalStore(r=>(p.add(r),()=>p.delete(r)),M),e=react.useRef(g);if(react.useEffect(()=>{e.current=g;},[]),t.length===0)return null;let n=t.reduce((r,l)=>{let a=l.position??"top-right";return (r[a]??(r[a]=[])).push(l),r},{});return reactDom.createPortal(jsxRuntime.jsx(jsxRuntime.Fragment,{children:Object.entries(n).map(([r,l])=>jsxRuntime.jsx("div",{style:z(r)?{top:`${e.current}px`}:void 0,className:i("pointer-events-none fixed z-100 flex flex-col gap-2",E[r]),children:l.map(a=>jsxRuntime.jsx(S,{alert:a,onClose:()=>f(a.id)},a.id))},r))}),document.body)}var b=false;function D(){if(b)return;b=true;let t=document.createElement("div");t.id="alert-toast-root",document.body.appendChild(t),client.createRoot(t).render(jsxRuntime.jsx(O,{}));}function dt(){return react.useEffect(()=>{D();},[]),{addAlert:H,removeAlert:f}}exports.Alert=nt;exports.AlertContent=at;exports.AlertDescription=st;exports.AlertIcon=it;exports.AlertTitle=ot;exports.configureAlertTopOffset=lt;exports.useAlert=dt;
@@ -1 +1 @@
1
- import {useEffect,useSyncExternalStore,useRef}from'react';import {createPortal}from'react-dom';import {createRoot}from'react-dom/client';import {Info,CircleX,TriangleAlert,CircleCheck,X}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {cva}from'class-variance-authority';import {jsx,Fragment,jsxs}from'react/jsx-runtime';function i(...t){return twMerge(clsx(t))}cva("relative w-full overflow-hidden rounded-full bg-primary-200 dark:bg-primary-700",{variants:{size:{xs:"h-1",sm:"h-2",md:"h-3",lg:"h-4"},intent:{primary:"[&_.progress-fill]:bg-primary-500",success:"[&_.progress-fill]:bg-success-500",warning:"[&_.progress-fill]:bg-warning-500",danger:"[&_.progress-fill]:bg-danger-500"},edge:{none:"rounded-full",top:"fixed top-0 left-0 right-0 z-50 rounded-none",bottom:"fixed bottom-0 left-0 right-0 z-50 rounded-none"}},defaultVariants:{size:"md",intent:"primary",edge:"none"}});cva("text-primary-500 dark:text-primary-400",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}});var p=cva("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg transition-all",{variants:{intent:{success:"border-success-200 bg-success-50 text-success-800 dark:border-success-800 dark:bg-success-900/80 dark:text-success-200",warning:"border-warning-200 bg-warning-50 text-warning-800 dark:border-warning-800 dark:bg-warning-900/80 dark:text-warning-200",error:"border-danger-200 bg-danger-50 text-danger-800 dark:border-danger-800 dark:bg-danger-900/80 dark:text-danger-200",info:"border-primary-200 bg-primary-50 text-primary-800 dark:border-primary-800 dark:bg-primary-900/80 dark:text-primary-200"}},defaultVariants:{intent:"info"}});function et({intent:t,className:e,children:n,...r}){return jsx("div",{className:i(p({intent:t}),e),role:"alert",...r,children:n})}function rt({className:t,...e}){return jsx("h5",{className:i("flex items-center gap-1.5 font-semibold [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",t),...e})}function nt({className:t,...e}){return jsx("span",{className:i("mt-0.5 shrink-0 [&_svg]:h-5 [&_svg]:w-5",t),...e})}function ot({className:t,...e}){return jsx("div",{className:i("flex-1 min-w-0 space-y-1",t),...e})}function it({className:t,...e}){return jsx("p",{className:i("text-sm opacity-90",t),...e})}var I=0,a=[],m=new Map,d=new Set;function M(){return a}function u(){d.forEach(t=>t());}function g(t){let e=m.get(t);e&&(clearTimeout(e),m.delete(t)),a=a.map(n=>n.id===t?{...n,exiting:true}:n),u(),setTimeout(()=>{a=a.filter(n=>n.id!==t),u();},200);}function H(t){let e=`alert-${++I}`;a=[...a,{...t,id:e}],u();let n=t.duration??5e3;if(n>0){let r=setTimeout(()=>{m.delete(e),g(e);},n);m.set(e,r);}return e}var f=16;function st(t){f=t;}var E={"top-right":"right-4 items-end","top-left":"left-4 items-start","bottom-right":"bottom-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","top-center":"left-1/2 -translate-x-1/2 items-center","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center"},L={"top-right":"animate-slide-in-right","top-left":"animate-slide-in-left","bottom-right":"animate-slide-in-right","bottom-left":"animate-slide-in-left","top-center":"animate-slide-in-top","bottom-center":"animate-slide-in-bottom"},_={success:CircleCheck,warning:TriangleAlert,error:CircleX,info:Info};function S({alert:t,onClose:e}){let n=t.intent??"info",r=_[n],l=t.position??"top-right";return jsxs("div",{className:i(p({intent:n}),L[l],t.exiting&&"opacity-0 transition-opacity duration-200","w-80 max-w-[calc(100vw-2rem)]"),role:"alert",children:[jsx(r,{className:"mt-0.5 h-5 w-5 shrink-0"}),jsxs("div",{className:"flex-1",children:[t.title&&jsx("p",{className:"font-semibold",children:t.title}),jsx("p",{className:i(t.title&&"text-sm opacity-90"),children:t.message})]}),jsx("button",{onClick:e,"aria-label":"Close notification",className:"shrink-0 cursor-pointer opacity-50 transition-opacity hover:opacity-100",children:jsx(X,{className:"h-4 w-4"})})]})}var z=t=>t.startsWith("top");function O(){let t=useSyncExternalStore(r=>(d.add(r),()=>d.delete(r)),M),e=useRef(f);if(useEffect(()=>{e.current=f;},[]),t.length===0)return null;let n=t.reduce((r,l)=>{let s=l.position??"top-right";return (r[s]??(r[s]=[])).push(l),r},{});return createPortal(jsx(Fragment,{children:Object.entries(n).map(([r,l])=>jsx("div",{style:z(r)?{top:`${e.current}px`}:void 0,className:i("pointer-events-none fixed z-100 flex flex-col gap-2",E[r]),children:l.map(s=>jsx(S,{alert:s,onClose:()=>g(s.id)},s.id))},r))}),document.body)}var b=false;function D(){if(b)return;b=true;let t=document.createElement("div");t.id="alert-toast-root",document.body.appendChild(t),createRoot(t).render(jsx(O,{}));}function at(){return useEffect(()=>{D();},[]),{addAlert:H,removeAlert:g}}export{et as Alert,ot as AlertContent,it as AlertDescription,nt as AlertIcon,rt as AlertTitle,st as configureAlertTopOffset,at as useAlert};
1
+ import {useEffect,useSyncExternalStore,useRef}from'react';import {createPortal}from'react-dom';import {createRoot}from'react-dom/client';import {Info,CircleX,TriangleAlert,CircleCheck,X}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {cva}from'class-variance-authority';import {jsx,Fragment,jsxs}from'react/jsx-runtime';function i(...t){return twMerge(clsx(t))}cva("relative w-full overflow-hidden rounded-full bg-primary-200 dark:bg-primary-700",{variants:{size:{xs:"h-1",sm:"h-2",md:"h-3",lg:"h-4"},intent:{primary:"[&_.progress-fill]:bg-primary-500",success:"[&_.progress-fill]:bg-success-500",warning:"[&_.progress-fill]:bg-warning-500",danger:"[&_.progress-fill]:bg-danger-500"},edge:{none:"rounded-full",top:"fixed top-0 left-0 right-0 z-50 rounded-none",bottom:"fixed bottom-0 left-0 right-0 z-50 rounded-none"}},defaultVariants:{size:"md",intent:"primary",edge:"none"}});cva("text-primary-500 dark:text-primary-400",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}});var c=cva("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg transition-all",{variants:{intent:{success:"border-success-200 bg-success-50 text-success-800 dark:border-success-800 dark:bg-success-900/80 dark:text-success-200",warning:"border-warning-200 bg-warning-50 text-warning-800 dark:border-warning-800 dark:bg-warning-900/80 dark:text-warning-200",error:"border-danger-200 bg-danger-50 text-danger-800 dark:border-danger-800 dark:bg-danger-900/80 dark:text-danger-200",info:"border-primary-200 bg-primary-50 text-primary-800 dark:border-primary-800 dark:bg-primary-900/80 dark:text-primary-200"}},defaultVariants:{intent:"info"}});cva("skeleton-base bg-secondary-200 dark:bg-secondary-700",{variants:{variant:{text:"skeleton-text w-full rounded-sm",circular:"rounded-full",rectangular:"rounded-none",rounded:"rounded-md"},animation:{pulse:"animate-pulse",wave:"skeleton-wave",none:""}},defaultVariants:{variant:"text",animation:"pulse"}});cva("border",{variants:{variant:{default:"bg-primary-800 text-primary-50 border-primary-700 dark:bg-primary-100 dark:text-primary-900 dark:border-primary-200",success:"bg-success-500 text-white border-success-600 dark:bg-success-600 dark:border-success-700",danger:"bg-danger-500 text-white border-danger-600 dark:bg-danger-600 dark:border-danger-700",warning:"bg-warning-500 text-warning-900 border-warning-600 dark:bg-warning-600 dark:text-white dark:border-warning-700",info:"bg-primary-500 text-white border-primary-600 dark:bg-primary-600 dark:border-primary-700"}},defaultVariants:{variant:"default"}});function nt({intent:t,className:e,children:n,...r}){return jsx("div",{className:i(c({intent:t}),e),role:"alert",...r,children:n})}function ot({className:t,...e}){return jsx("h5",{className:i("flex items-center gap-1.5 font-semibold [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0",t),...e})}function it({className:t,...e}){return jsx("span",{className:i("mt-0.5 shrink-0 [&_svg]:h-5 [&_svg]:w-5",t),...e})}function at({className:t,...e}){return jsx("div",{className:i("flex-1 min-w-0 space-y-1",t),...e})}function st({className:t,...e}){return jsx("p",{className:i("text-sm opacity-90",t),...e})}var I=0,s=[],m=new Map,p=new Set;function M(){return s}function u(){p.forEach(t=>t());}function f(t){let e=m.get(t);e&&(clearTimeout(e),m.delete(t)),s=s.map(n=>n.id===t?{...n,exiting:true}:n),u(),setTimeout(()=>{s=s.filter(n=>n.id!==t),u();},200);}function H(t){let e=`alert-${++I}`;s=[...s,{...t,id:e}],u();let n=t.duration??5e3;if(n>0){let r=setTimeout(()=>{m.delete(e),f(e);},n);m.set(e,r);}return e}var g=16;function lt(t){g=t;}var E={"top-right":"right-4 items-end","top-left":"left-4 items-start","bottom-right":"bottom-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","top-center":"left-1/2 -translate-x-1/2 items-center","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center"},L={"top-right":"animate-slide-in-right","top-left":"animate-slide-in-left","bottom-right":"animate-slide-in-right","bottom-left":"animate-slide-in-left","top-center":"animate-slide-in-top","bottom-center":"animate-slide-in-bottom"},_={success:CircleCheck,warning:TriangleAlert,error:CircleX,info:Info};function S({alert:t,onClose:e}){let n=t.intent??"info",r=_[n],l=t.position??"top-right";return jsxs("div",{className:i(c({intent:n}),L[l],t.exiting&&"opacity-0 transition-opacity duration-200","w-80 max-w-[calc(100vw-2rem)]"),role:"alert",children:[jsx(r,{className:"mt-0.5 h-5 w-5 shrink-0"}),jsxs("div",{className:"flex-1",children:[t.title&&jsx("p",{className:"font-semibold",children:t.title}),jsx("p",{className:i(t.title&&"text-sm opacity-90"),children:t.message})]}),jsx("button",{onClick:e,"aria-label":"Close notification",className:"shrink-0 cursor-pointer opacity-50 transition-opacity hover:opacity-100",children:jsx(X,{className:"h-4 w-4"})})]})}var z=t=>t.startsWith("top");function O(){let t=useSyncExternalStore(r=>(p.add(r),()=>p.delete(r)),M),e=useRef(g);if(useEffect(()=>{e.current=g;},[]),t.length===0)return null;let n=t.reduce((r,l)=>{let a=l.position??"top-right";return (r[a]??(r[a]=[])).push(l),r},{});return createPortal(jsx(Fragment,{children:Object.entries(n).map(([r,l])=>jsx("div",{style:z(r)?{top:`${e.current}px`}:void 0,className:i("pointer-events-none fixed z-100 flex flex-col gap-2",E[r]),children:l.map(a=>jsx(S,{alert:a,onClose:()=>f(a.id)},a.id))},r))}),document.body)}var b=false;function D(){if(b)return;b=true;let t=document.createElement("div");t.id="alert-toast-root",document.body.appendChild(t),createRoot(t).render(jsx(O,{}));}function dt(){return useEffect(()=>{D();},[]),{addAlert:H,removeAlert:f}}export{nt as Alert,at as AlertContent,st as AlertDescription,it as AlertIcon,ot as AlertTitle,lt as configureAlertTopOffset,dt as useAlert};
@@ -1 +1 @@
1
- 'use strict';var react=require('react'),reactDom=require('react-dom'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime');function o(...a){return tailwindMerge.twMerge(clsx.clsx(a))}var m=classVarianceAuthority.cva("relative w-full overflow-hidden rounded-full bg-primary-200 dark:bg-primary-700",{variants:{size:{xs:"h-1",sm:"h-2",md:"h-3",lg:"h-4"},intent:{primary:"[&_.progress-fill]:bg-primary-500",success:"[&_.progress-fill]:bg-success-500",warning:"[&_.progress-fill]:bg-warning-500",danger:"[&_.progress-fill]:bg-danger-500"},edge:{none:"rounded-full",top:"fixed top-0 left-0 right-0 z-50 rounded-none",bottom:"fixed bottom-0 left-0 right-0 z-50 rounded-none"}},defaultVariants:{size:"md",intent:"primary",edge:"none"}});classVarianceAuthority.cva("text-primary-500 dark:text-primary-400",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}});classVarianceAuthority.cva("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg transition-all",{variants:{intent:{success:"border-success-200 bg-success-50 text-success-800 dark:border-success-800 dark:bg-success-900/80 dark:text-success-200",warning:"border-warning-200 bg-warning-50 text-warning-800 dark:border-warning-800 dark:bg-warning-900/80 dark:text-warning-200",error:"border-danger-200 bg-danger-50 text-danger-800 dark:border-danger-800 dark:bg-danger-900/80 dark:text-danger-200",info:"border-primary-200 bg-primary-50 text-primary-800 dark:border-primary-800 dark:bg-primary-900/80 dark:text-primary-200"}},defaultVariants:{intent:"info"}});function W({value:a=0,size:t,intent:p,edge:s,showLabel:u=false,indeterminate:r=false,animated:g=false,duration:f=500,className:c,...b}){let e=Math.max(0,Math.min(100,a)),[x,h]=react.useState(0),n=react.useRef(0);react.useEffect(()=>{if(!r)return n.current=requestAnimationFrame(()=>{h(e);}),()=>{n.current&&cancelAnimationFrame(n.current);}},[e,r]);let y=u&&!r&&t!=="xs"&&t!=="sm",d=jsxRuntime.jsx("div",{role:"progressbar","aria-valuenow":r?void 0:e,"aria-valuemin":0,"aria-valuemax":100,className:o(m({size:t,intent:p,edge:s}),c),...b,children:r?jsxRuntime.jsx("div",{className:"progress-fill absolute top-0 h-full rounded-full animate-progress-indeterminate"}):jsxRuntime.jsx("div",{className:o("progress-fill h-full rounded-full transition-[width] ease-out",g&&"animate-progress-shine"),style:{width:`${x}%`,transitionDuration:`${f}ms`},children:y&&jsxRuntime.jsxs("span",{className:"flex h-full items-center justify-end pr-2 text-[10px] font-semibold text-white",children:[Math.round(e),"%"]})})});return s==="top"||s==="bottom"?reactDom.createPortal(d,document.body):d}exports.ProgressBar=W;
1
+ 'use strict';var react=require('react'),reactDom=require('react-dom'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime');function i(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var u=classVarianceAuthority.cva("relative w-full overflow-hidden rounded-full bg-primary-200 dark:bg-primary-700",{variants:{size:{xs:"h-1",sm:"h-2",md:"h-3",lg:"h-4"},intent:{primary:"[&_.progress-fill]:bg-primary-500",success:"[&_.progress-fill]:bg-success-500",warning:"[&_.progress-fill]:bg-warning-500",danger:"[&_.progress-fill]:bg-danger-500"},edge:{none:"rounded-full",top:"fixed top-0 left-0 right-0 z-50 rounded-none",bottom:"fixed bottom-0 left-0 right-0 z-50 rounded-none"}},defaultVariants:{size:"md",intent:"primary",edge:"none"}});classVarianceAuthority.cva("text-primary-500 dark:text-primary-400",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}});classVarianceAuthority.cva("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg transition-all",{variants:{intent:{success:"border-success-200 bg-success-50 text-success-800 dark:border-success-800 dark:bg-success-900/80 dark:text-success-200",warning:"border-warning-200 bg-warning-50 text-warning-800 dark:border-warning-800 dark:bg-warning-900/80 dark:text-warning-200",error:"border-danger-200 bg-danger-50 text-danger-800 dark:border-danger-800 dark:bg-danger-900/80 dark:text-danger-200",info:"border-primary-200 bg-primary-50 text-primary-800 dark:border-primary-800 dark:bg-primary-900/80 dark:text-primary-200"}},defaultVariants:{intent:"info"}});classVarianceAuthority.cva("skeleton-base bg-secondary-200 dark:bg-secondary-700",{variants:{variant:{text:"skeleton-text w-full rounded-sm",circular:"rounded-full",rectangular:"rounded-none",rounded:"rounded-md"},animation:{pulse:"animate-pulse",wave:"skeleton-wave",none:""}},defaultVariants:{variant:"text",animation:"pulse"}});classVarianceAuthority.cva("border",{variants:{variant:{default:"bg-primary-800 text-primary-50 border-primary-700 dark:bg-primary-100 dark:text-primary-900 dark:border-primary-200",success:"bg-success-500 text-white border-success-600 dark:bg-success-600 dark:border-success-700",danger:"bg-danger-500 text-white border-danger-600 dark:bg-danger-600 dark:border-danger-700",warning:"bg-warning-500 text-warning-900 border-warning-600 dark:bg-warning-600 dark:text-white dark:border-warning-700",info:"bg-primary-500 text-white border-primary-600 dark:bg-primary-600 dark:border-primary-700"}},defaultVariants:{variant:"default"}});function q({value:t=0,size:n,intent:g,edge:s,showLabel:m=false,indeterminate:r=false,animated:p=false,duration:b=500,className:c,...f}){let a=Math.max(0,Math.min(100,t)),[x,y]=react.useState(0),o=react.useRef(0);react.useEffect(()=>{if(!r)return o.current=requestAnimationFrame(()=>{y(a);}),()=>{o.current&&cancelAnimationFrame(o.current);}},[a,r]);let w=m&&!r&&n!=="xs"&&n!=="sm",l=jsxRuntime.jsx("div",{role:"progressbar","aria-valuenow":r?void 0:a,"aria-valuemin":0,"aria-valuemax":100,className:i(u({size:n,intent:g,edge:s}),c),...f,children:r?jsxRuntime.jsx("div",{className:"progress-fill absolute top-0 h-full rounded-full animate-progress-indeterminate"}):jsxRuntime.jsx("div",{className:i("progress-fill h-full rounded-full transition-[width] ease-out",p&&"animate-progress-shine"),style:{width:`${x}%`,transitionDuration:`${b}ms`},children:w&&jsxRuntime.jsxs("span",{className:"flex h-full items-center justify-end pr-2 text-[10px] font-semibold text-white",children:[Math.round(a),"%"]})})});return s==="top"||s==="bottom"?reactDom.createPortal(l,document.body):l}exports.ProgressBar=q;