@jacshuo/onyx 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +358 -361
- package/dist/Extras/DateTimePicker.cjs +1 -0
- package/dist/Extras/DateTimePicker.css +1 -0
- package/dist/Extras/DateTimePicker.d.cts +5 -0
- package/dist/Extras/DateTimePicker.d.ts +5 -0
- package/dist/Extras/DateTimePicker.js +1 -0
- package/dist/Extras/index.cjs +4 -4
- package/dist/Extras/index.css +1 -1
- package/dist/Extras/index.d.cts +5 -0
- package/dist/Extras/index.d.ts +5 -0
- package/dist/Extras/index.js +4 -4
- package/dist/Navigation/SideNav.cjs +1 -1
- package/dist/Navigation/SideNav.js +1 -1
- package/dist/Navigation/index.cjs +2 -2
- package/dist/Navigation/index.js +2 -2
- package/dist/Primitives/Dropdown.cjs +1 -1
- package/dist/Primitives/Dropdown.js +1 -1
- package/dist/Primitives/Input.cjs +1 -1
- package/dist/Primitives/Input.js +1 -1
- package/dist/Primitives/Slider.cjs +1 -1
- package/dist/Primitives/Slider.js +1 -1
- package/dist/Primitives/index.cjs +1 -1
- package/dist/Primitives/index.js +1 -1
- package/dist/_tsup-dts-rollup.d.cts +165 -3
- package/dist/_tsup-dts-rollup.d.ts +165 -3
- package/dist/index.cjs +5 -5
- package/dist/index.css +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -5
- package/dist/styles/Extras/DateTimePicker.css +566 -0
- package/dist/styles/base.css +39 -12
- package/dist/styles.css +497 -12
- package/package.json +1 -1
package/dist/Extras/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var br=require('react'),reactDom=require('react-dom'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime'),classVarianceAuthority=require('class-variance-authority');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var br__default=/*#__PURE__*/_interopDefault(br);function o(...e){return tailwindMerge.twMerge(clsx.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:jsxRuntime.jsx(lucideReact.Heart,{className:"h-5 w-5"}),activeIcon:jsxRuntime.jsx(lucideReact.Heart,{className:"h-5 w-5",fill:"currentColor"}),label:"Like",toggle:true},{key:"dislike",icon:jsxRuntime.jsx(lucideReact.ThumbsDown,{className:"h-5 w-5"}),label:"Dislike"},{key:"bookmark",icon:jsxRuntime.jsx(lucideReact.Bookmark,{className:"h-5 w-5"}),activeIcon:jsxRuntime.jsx(lucideReact.Bookmark,{className:"h-5 w-5",fill:"currentColor"}),label:"Bookmark",toggle:true},{key:"share",icon:jsxRuntime.jsx(lucideReact.Share2,{className:"h-5 w-5"}),label:"Share"},{key:"download",icon:jsxRuntime.jsx(lucideReact.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]=br.useState(null),[L,w]=br.useState(new Set),l=br.useCallback(H=>h(H),[]),m=br.useCallback(()=>h(null),[]),P=br.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 jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(t==="strip"?sn:t==="sheet"?ln:cn,{photos:e,onPhotoClick:l,showGrain:c,className:f,sheetTitle:d,sheetLabel:v}),y!==null&&reactDom.createPortal(jsxRuntime.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 jsxRuntime.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)=>jsxRuntime.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=br.useRef(null);return jsxRuntime.jsxs("div",{className:o("select-none rounded-lg overflow-hidden",u),style:{background:nr},children:[jsxRuntime.jsx(tr,{count:Math.max(30,e.length*6)}),jsxRuntime.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)=>jsxRuntime.jsxs("div",{className:"group relative shrink-0 cursor-pointer",style:{scrollSnapAlign:"center"},onClick:()=>t(d),children:[jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-xs border",style:{borderColor:St,width:280,height:187},children:[jsxRuntime.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}),jsxRuntime.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&&jsxRuntime.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"}}),jsxRuntime.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%)"}})]}),jsxRuntime.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))}),jsxRuntime.jsx(tr,{count:Math.max(30,e.length*6)})]})}function ln({photos:e,onPhotoClick:t,showGrain:n,className:u,sheetTitle:f,sheetLabel:c}){return jsxRuntime.jsxs("div",{className:o("rounded-lg p-5",u),style:{background:nr},children:[jsxRuntime.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:et},children:f??`JAC\xB7Film 35mm \xB7 ${e.length} exposures`}),jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:et},children:c??"Contact Sheet"})]}),jsxRuntime.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)=>jsxRuntime.jsxs("div",{className:"group cursor-pointer",style:{animation:`reveal-up 0.4s ease-out ${v*50}ms both`},onClick:()=>t(v),children:[jsxRuntime.jsx("div",{className:"mb-0.5 font-mono text-[9px] tracking-wider",style:{color:et},children:String(v+1).padStart(2,"0")}),jsxRuntime.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:[jsxRuntime.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&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:pt}}),jsxRuntime.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:jsxRuntime.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]=br.useState(false),[d,v]=br.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 jsxRuntime.jsxs("div",{className:o("flex flex-col items-center gap-4",u),children:[jsxRuntime.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)=>jsxRuntime.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:jsxRuntime.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:[jsxRuntime.jsx("img",{src:l.src,alt:l.alt??"",className:"h-full w-full object-cover",draggable:false}),n&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:pt}}),jsxRuntime.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&&jsxRuntime.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:jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90",children:l.title})})]})},m))}),e.length>y&&jsxRuntime.jsxs("span",{className:"font-mono text-xs",style:{color:et},children:["+ ",e.length-y," more"]}),jsxRuntime.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]=br.useState(1),[w,l]=br.useState({x:0,y:0}),[m,P]=br.useState(false),[N,H]=br.useState(false),E=br.useRef(false),z=br.useRef({x:0,y:0}),V=br.useRef(null);br.useLayoutEffect(()=>{requestAnimationFrame(()=>H(true));},[]),br.useEffect(()=>{let s=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=s;}},[]),br.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)}),br.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=br.useCallback(s=>{let A=t+s;A>=0&&A<e.length&&(n(A),L(1),l({x:0,y:0}));},[t,e.length,n]),$=br.useCallback(s=>{h<=1||(E.current=true,z.current={x:s.clientX,y:s.clientY},s.target.setPointerCapture(s.pointerId));},[h]),me=br.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=br.useCallback(()=>{E.current=false;},[]),M=br.useCallback(()=>{h>1?(L(1),l({x:0,y:0})):L(2.5);},[h]),_=s=>c.has(`${t}-${s}`),R=y.metadata;return jsxRuntime.jsxs("div",{className:"fixed inset-0 z-200 flex flex-col",style:{animation:"lightbox-backdrop-in 0.35s ease-out"},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/95",onClick:u}),v&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.025]",style:{backgroundImage:pt,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsxRuntime.jsxs("div",{className:"relative z-10 flex h-12 shrink-0 items-center justify-between px-4",children:[jsxRuntime.jsxs("span",{className:"font-mono text-sm text-white/50",children:[t+1," / ",e.length]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("span",{className:"mr-2 font-mono text-xs text-white/40",children:[h.toFixed(1),"x"]}),jsxRuntime.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:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"h-4 w-4"})}),jsxRuntime.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:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:u,title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-5 w-5"})})]})]}),jsxRuntime.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:[jsxRuntime.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&&jsxRuntime.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:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-6 w-6"})}),t<e.length-1&&jsxRuntime.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:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-6 w-6"})})]}),jsxRuntime.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:jsxRuntime.jsxs("div",{className:"bg-linear-to-t from-black/90 via-black/75 to-transparent px-6 pb-24 pt-16",children:[y.title&&jsxRuntime.jsx("h3",{className:"mb-3 text-xl font-semibold text-white",children:y.title}),y.description&&jsxRuntime.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&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-sm text-white/70",children:[R.camera&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Camera,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",R.camera,R.lens&&jsxRuntime.jsx("span",{className:"text-white/40",children:"\xB7"}),R.lens&&R.lens]}),(R.aperture||R.shutter||R.iso)&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.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&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",R.date]}),R.location&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",R.location]})]})]})}),jsxRuntime.jsx("div",{className:"relative z-20 flex h-16 shrink-0 items-center justify-center gap-1",children:jsxRuntime.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 jsxRuntime.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)}),jsxRuntime.jsx("div",{className:"mx-1 h-5 w-px bg-white/10"}),jsxRuntime.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:jsxRuntime.jsx(lucideReact.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">
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var Pr=require('react'),reactDom=require('react-dom'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime'),classVarianceAuthority=require('class-variance-authority');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Pr__default=/*#__PURE__*/_interopDefault(Pr);function c(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var br="#1c1914",hr="#130f0b",In="#2e261e",Yt="#504638",ot="#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")`,_n=[{key:"like",icon:jsxRuntime.jsx(lucideReact.Heart,{className:"h-5 w-5"}),activeIcon:jsxRuntime.jsx(lucideReact.Heart,{className:"h-5 w-5",fill:"currentColor"}),label:"Like",toggle:true},{key:"dislike",icon:jsxRuntime.jsx(lucideReact.ThumbsDown,{className:"h-5 w-5"}),label:"Dislike"},{key:"bookmark",icon:jsxRuntime.jsx(lucideReact.Bookmark,{className:"h-5 w-5"}),activeIcon:jsxRuntime.jsx(lucideReact.Bookmark,{className:"h-5 w-5",fill:"currentColor"}),label:"Bookmark",toggle:true},{key:"share",icon:jsxRuntime.jsx(lucideReact.Share2,{className:"h-5 w-5"}),label:"Share"},{key:"download",icon:jsxRuntime.jsx(lucideReact.Download,{className:"h-5 w-5"}),label:"Download"}];function jt({photos:e,layout:t="strip",actions:r=_n,onAction:a,className:l,showGrain:o=true,sheetTitle:n,sheetLabel:f}){let[m,d]=Pr.useState(null),[v,b]=Pr.useState(new Set),i=Pr.useCallback(L=>d(L),[]),p=Pr.useCallback(()=>d(null),[]),P=Pr.useCallback((L,T)=>{if(r.find(F=>F.key===L)?.toggle){let F=`${T}-${L}`;b(H=>{let j=new Set(H);return j.has(F)?j.delete(F):j.add(F),j});}a?.(L,e[T],T);},[r,a,e]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(t==="strip"?On:t==="sheet"?Fn:Hn,{photos:e,onPhotoClick:i,showGrain:o,className:l,sheetTitle:n,sheetLabel:f}),m!==null&&reactDom.createPortal(jsxRuntime.jsx(Vn,{photos:e,currentIndex:m,onIndexChange:d,onClose:p,actions:r,activeActions:v,onAction:P,showGrain:o}),document.body)]})}function gr({count:e=30}){return jsxRuntime.jsx("div",{className:"flex shrink-0 items-center justify-between px-3",style:{height:22,background:br},children:Array.from({length:e}).map((t,r)=>jsxRuntime.jsx("div",{className:"rounded-xs",style:{width:12,height:8,background:In}},r))})}function On({photos:e,onPhotoClick:t,showGrain:r,className:a}){let l=Pr.useRef(null);return jsxRuntime.jsxs("div",{className:c("select-none rounded-lg overflow-hidden",a),style:{background:hr},children:[jsxRuntime.jsx(gr,{count:Math.max(30,e.length*6)}),jsxRuntime.jsx("div",{ref:l,className:"flex gap-1 overflow-x-auto scroll-smooth px-1 py-1",style:{background:br,scrollSnapType:"x mandatory"},children:e.map((o,n)=>jsxRuntime.jsxs("div",{className:"group relative shrink-0 cursor-pointer",style:{scrollSnapAlign:"center"},onClick:()=>t(n),children:[jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-xs border",style:{borderColor:Yt,width:280,height:187},children:[jsxRuntime.jsx("img",{src:o.src,alt:o.alt??o.title??"",className:"h-full w-full object-cover transition-transform duration-700 ease-out group-hover:scale-110",draggable:false}),jsxRuntime.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)"}}),r&&jsxRuntime.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"}}),jsxRuntime.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%)"}})]}),jsxRuntime.jsxs("div",{className:"mt-0.5 text-center font-mono text-[9px] tracking-widest",style:{color:ot},children:[String(n+1).padStart(2,"0"),n%2===0?"":"A"]})]},n))}),jsxRuntime.jsx(gr,{count:Math.max(30,e.length*6)})]})}function Fn({photos:e,onPhotoClick:t,showGrain:r,className:a,sheetTitle:l,sheetLabel:o}){return jsxRuntime.jsxs("div",{className:c("rounded-lg p-5",a),style:{background:hr},children:[jsxRuntime.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:ot},children:l??`JAC\xB7Film 35mm \xB7 ${e.length} exposures`}),jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.25em]",style:{color:ot},children:o??"Contact Sheet"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6",children:e.map((n,f)=>jsxRuntime.jsxs("div",{className:"group cursor-pointer",style:{animation:`reveal-up 0.4s ease-out ${f*50}ms both`},onClick:()=>t(f),children:[jsxRuntime.jsx("div",{className:"mb-0.5 font-mono text-[9px] tracking-wider",style:{color:ot},children:String(f+1).padStart(2,"0")}),jsxRuntime.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:Yt,aspectRatio:"3/2"},children:[jsxRuntime.jsx("img",{src:n.src,alt:n.alt??"",className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105",draggable:false}),r&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:Ct}}),jsxRuntime.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:jsxRuntime.jsx("span",{className:"text-xs font-medium text-white/90",children:n.title})})]})]},f))})]})}function Hn({photos:e,onPhotoClick:t,showGrain:r,className:a}){let[l,o]=Pr.useState(false),[n,f]=Pr.useState(null),m=Math.min(e.length,8),d=e.slice(0,m),v=i=>{let p=Math.sin(i*137.508+1)*1e4,P=(p%12-6).toFixed(1),w=(p/7%8-4).toFixed(1),L=(p/13%6-3).toFixed(1);return `rotate(${P}deg) translate(${w}px, ${L}px)`},b=(i,p)=>{let P=(p-1)/2,w=((i-P)*7).toFixed(1),L=((i-P)*110).toFixed(0),T=(-Math.abs(i-P)*10+(n===i?-18:0)).toFixed(0);return `translateX(${L}px) translateY(${T}px) rotate(${w}deg)`};return jsxRuntime.jsxs("div",{className:c("flex flex-col items-center gap-4",a),children:[jsxRuntime.jsx("div",{className:"relative flex h-85 w-full items-center justify-center",onMouseEnter:()=>o(true),onMouseLeave:()=>{o(false),f(null);},children:d.map((i,p)=>jsxRuntime.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:l?`${p*35}ms`:`${(m-p)*25}ms`,transform:l?b(p,d.length):v(p),zIndex:l?p+1:d.length-p,width:220,height:147},onClick:()=>t(p),onMouseEnter:()=>l&&f(p),onMouseLeave:()=>f(null),children:jsxRuntime.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-lg border transition-shadow duration-300",style:{borderColor:l&&n===p?"rgba(217,171,89,0.5)":Yt,boxShadow:l&&n===p?"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:[jsxRuntime.jsx("img",{src:i.src,alt:i.alt??"",className:"h-full w-full object-cover",draggable:false}),r&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.04]",style:{backgroundImage:Ct}}),jsxRuntime.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%)"}}),l&&n===p&&jsxRuntime.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:jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90",children:i.title})})]})},p))}),e.length>m&&jsxRuntime.jsxs("span",{className:"font-mono text-xs",style:{color:ot},children:["+ ",e.length-m," more"]}),jsxRuntime.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.3em] transition-opacity duration-300",style:{color:ot,opacity:l?0:.7},children:"Hover to explore"})]})}function Vn({photos:e,currentIndex:t,onIndexChange:r,onClose:a,actions:l,activeActions:o,onAction:n,showGrain:f}){let m=e[t],[d,v]=Pr.useState(1),[b,i]=Pr.useState({x:0,y:0}),[p,P]=Pr.useState(false),[w,L]=Pr.useState(false),T=Pr.useRef(false),R=Pr.useRef({x:0,y:0}),F=Pr.useRef(null);Pr.useLayoutEffect(()=>{requestAnimationFrame(()=>L(true));},[]),Pr.useEffect(()=>{let u=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=u;}},[]),Pr.useEffect(()=>{let u=V=>{switch(V.key){case "Escape":a();break;case "ArrowLeft":H(-1);break;case "ArrowRight":H(1);break;case "i":case "I":P(W=>!W);break}};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)}),Pr.useEffect(()=>{let u=F.current;if(!u)return;let V=W=>{W.preventDefault();let ie=W.deltaY<0?1.12:.89;v(G=>{let be=Math.min(8,Math.max(1,G*ie));return be<=1&&i({x:0,y:0}),be});};return u.addEventListener("wheel",V,{passive:false}),()=>u.removeEventListener("wheel",V)},[]);let H=Pr.useCallback(u=>{let V=t+u;V>=0&&V<e.length&&(r(V),v(1),i({x:0,y:0}));},[t,e.length,r]),j=Pr.useCallback(u=>{d<=1||(T.current=true,R.current={x:u.clientX,y:u.clientY},u.target.setPointerCapture(u.pointerId));},[d]),le=Pr.useCallback(u=>{if(!T.current)return;let V=u.clientX-R.current.x,W=u.clientY-R.current.y;R.current={x:u.clientX,y:u.clientY},i(ie=>({x:ie.x+V/d,y:ie.y+W/d}));},[d]),x=Pr.useCallback(()=>{T.current=false;},[]),C=Pr.useCallback(()=>{d>1?(v(1),i({x:0,y:0})):v(2.5);},[d]),S=u=>o.has(`${t}-${u}`),A=m.metadata;return jsxRuntime.jsxs("div",{className:"fixed inset-0 z-200 flex flex-col",style:{animation:"lightbox-backdrop-in 0.35s ease-out"},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/95",onClick:a}),f&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-[0.025]",style:{backgroundImage:Ct,animation:"film-grain-shift 0.6s steps(5) infinite"}}),jsxRuntime.jsxs("div",{className:"relative z-10 flex h-12 shrink-0 items-center justify-between px-4",children:[jsxRuntime.jsxs("span",{className:"font-mono text-sm text-white/50",children:[t+1," / ",e.length]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("span",{className:"mr-2 font-mono text-xs text-white/40",children:[d.toFixed(1),"x"]}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>v(u=>Math.min(8,u*1.3)),title:"Zoom in",children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:()=>{v(u=>{let V=Math.max(1,u*.7);return V<=1&&i({x:0,y:0}),V});},title:"Zoom out",children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"rounded-full p-2 text-white/60 transition-colors hover:bg-white/10 hover:text-white",onClick:a,title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-5 w-5"})})]})]}),jsxRuntime.jsxs("div",{ref:F,className:"relative flex flex-1 items-center justify-center overflow-hidden",style:{cursor:d>1?"grab":"default"},onPointerDown:j,onPointerMove:le,onPointerUp:x,onDoubleClick:C,children:[jsxRuntime.jsx("img",{src:m.src,alt:m.alt??m.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(${d}) translate(${b.x}px, ${b.y}px)`,transition:T.current?"none":"transform 0.15s ease-out"},draggable:false},t),t>0&&jsxRuntime.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:u=>{u.stopPropagation(),H(-1);},children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-6 w-6"})}),t<e.length-1&&jsxRuntime.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:u=>{u.stopPropagation(),H(1);},children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-6 w-6"})})]}),jsxRuntime.jsx("div",{className:c("absolute inset-x-0 bottom-0 z-20 transition-all duration-400",p?"translate-y-0 opacity-100":"pointer-events-none translate-y-full opacity-0"),children:jsxRuntime.jsxs("div",{className:"bg-linear-to-t from-black/90 via-black/75 to-transparent px-6 pb-24 pt-16",children:[m.title&&jsxRuntime.jsx("h3",{className:"mb-3 text-xl font-semibold text-white",children:m.title}),m.description&&jsxRuntime.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:m.description}),A&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2 text-sm text-white/70",children:[A.camera&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Camera,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",A.camera,A.lens&&jsxRuntime.jsx("span",{className:"text-white/40",children:"\xB7"}),A.lens&&A.lens]}),(A.aperture||A.shutter||A.iso)&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Aperture,{className:"h-3.5 w-3.5 text-amber-400/80"}),[A.aperture,A.shutter,A.iso&&`ISO ${A.iso}`].filter(Boolean).join(" \xB7 ")]}),A.date&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",A.date]}),A.location&&jsxRuntime.jsxs("span",{className:"flex items-center gap-1.5",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-3.5 w-3.5 text-amber-400/80"})," ",A.location]})]})]})}),jsxRuntime.jsx("div",{className:"relative z-20 flex h-16 shrink-0 items-center justify-center gap-1",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5 rounded-full bg-white/6 px-2 py-1.5 backdrop-blur-xl",children:[l.map(u=>{let V=u.toggle&&S(u.key);return jsxRuntime.jsx("button",{className:c("rounded-full p-2.5 transition-all duration-200",V?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>n(u.key,t),title:u.label,children:V&&u.activeIcon?u.activeIcon:u.icon},u.key)}),jsxRuntime.jsx("div",{className:"mx-1 h-5 w-px bg-white/10"}),jsxRuntime.jsx("button",{className:c("rounded-full p-2.5 transition-all duration-200",p?"text-amber-400 hover:text-amber-300":"text-white/60 hover:bg-white/10 hover:text-white"),onClick:()=>P(u=>!u),title:"Photo info (I)",children:jsxRuntime.jsx(lucideReact.Info,{className:"h-5 w-5"})})]})})]})}var $t="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 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]=br.useState(t),[E,z]=br.useState(false),[V,O]=br.useState(0),[$,me]=br.useState(0),[b,M]=br.useState(.8),[_,R]=br.useState(false),[s,A]=br.useState(new Set),[Y,ne]=br.useState(false),[q,ve]=br.useState(d??!c),[X,ye]=br.useState(false),[Xe,Fe]=br.useState(false),[pe,He]=br.useState(w),[be,Ve]=br.useState(l),_e=br.useRef(false),j=br.useRef(null),Ne=br.useRef(null),te=br.useRef(void 0),Z=br.useRef(null),re=br.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)";br.useEffect(()=>{let i=j.current;i&&(i.src=I.src,i.load(),E&&i.play().catch(()=>{}));},[N,I.src]),br.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]),br.useEffect(()=>{let i=j.current;i&&(E?i.play().catch(()=>{}):i.pause());},[E]),br.useEffect(()=>{let i=j.current;i&&(i.muted=_,re.current?re.current.gain.value=_?0:b:i.volume=b);},[b,_]),br.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=br.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=br.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=br.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=br.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=br.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=br.useCallback(()=>{ye(true);let i=J?200:400;te.current=setTimeout(()=>{ye(false),ve(false),v?.(false);},i);},[J,v]);br.useEffect(()=>()=>{te.current&&clearTimeout(te.current);},[]),br.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?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("audio",{ref:j,preload:"metadata",crossOrigin:"anonymous"}),jsxRuntime.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:[jsxRuntime.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&&jsxRuntime.jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/30",style:{animation:"mp-pulse-ring 2s ease-out infinite"}})]})]}):!he&&!X?jsxRuntime.jsx("audio",{ref:j,preload:"metadata",crossOrigin:"anonymous"}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("audio",{ref:j,preload:"metadata",crossOrigin:"anonymous"}),jsxRuntime.jsx("div",{className:o("fixed z-100",J?Mn[n]:Cn[n],fe),style:{"--accent":m,...X?{animation:T}:{animation:a}},onMouseEnter:()=>{J&&(te.current&&(clearTimeout(te.current),te.current=void 0),X&&ye(false),Fe(true));},onMouseLeave:()=>{J&&(Fe(false),ce());},children:jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 overflow-hidden",children:jsxRuntime.jsx("img",{src:I.cover||Lt,alt:"",className:"h-full w-full scale-110 object-cover opacity-30 blur-2xl",draggable:false})}),jsxRuntime.jsxs("div",{className:"relative flex items-center gap-3.5 p-4 pb-3",children:[jsxRuntime.jsxs("div",{className:"relative h-14 w-14 shrink-0",children:[jsxRuntime.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:[jsxRuntime.jsx("img",{src:I.cover||Lt,alt:I.album??I.title,className:"h-full w-full object-cover",draggable:false}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"h-3 w-3 rounded-full bg-black/60 ring-1 ring-white/10"})})]}),E&&jsxRuntime.jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/20",style:{animation:"mp-pulse-ring 2.5s ease-out infinite"}})]}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:o("truncate text-sm font-semibold",Se),children:I.title}),I.artist&&jsxRuntime.jsx("div",{className:o("truncate text-xs",ae),children:I.artist}),I.album&&jsxRuntime.jsx("div",{className:o("mt-0.5 truncate text-[10px] tracking-wide",ae,"opacity-60"),children:I.album})]}),jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[jsxRuntime.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:jsxRuntime.jsx(lucideReact.Heart,{className:"h-4 w-4",fill:s.has(N)?"currentColor":"none"})}),jsxRuntime.jsx("button",{className:o("rounded-full p-1.5 transition-colors",ae,"hover:"+Se.split(" ")[0]),onClick:()=>ne(i=>!i),title:"Playlist",children:jsxRuntime.jsx(lucideReact.ListMusic,{className:"h-4 w-4"})}),!J&&jsxRuntime.jsx("button",{className:o("rounded-full p-1.5 transition-colors",ae,"hover:"+Se.split(" ")[0]),onClick:ce,title:"Dismiss",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]})]}),jsxRuntime.jsxs("div",{className:"px-4",children:[jsxRuntime.jsxs("div",{ref:Ne,className:"group relative h-1.5 cursor-pointer rounded-full bg-(--mp-surface)",onClick:ct,children:[jsxRuntime.jsx("div",{className:"h-full rounded-full bg-(--accent) transition-[width] duration-150",style:{width:`${W}%`}}),jsxRuntime.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)`}})]}),jsxRuntime.jsxs("div",{className:o("mt-1 flex justify-between text-[10px] font-mono",ae),children:[jsxRuntime.jsx("span",{children:or(V)}),jsxRuntime.jsx("span",{children:or($)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 pb-3 pt-1",children:[jsxRuntime.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:jsxRuntime.jsx(lucideReact.Shuffle,{className:"h-3.5 w-3.5"})}),jsxRuntime.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:jsxRuntime.jsx(lucideReact.Repeat1,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:o("rounded-full p-2 transition-colors",ae,"hover:text-(--mp-text)"),onClick:qe,title:"Previous",children:jsxRuntime.jsx(lucideReact.SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.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?jsxRuntime.jsx(lucideReact.Pause,{className:"h-4.5 w-4.5",fill:"currentColor"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-4.5 w-4.5 translate-x-px",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:o("rounded-full p-2 transition-colors",ae,"hover:text-(--mp-text)"),onClick:De,title:"Next",children:jsxRuntime.jsx(lucideReact.SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsxs("div",{className:"ml-2 flex items-center gap-1.5",children:[jsxRuntime.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?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-3.5 w-3.5"})}),jsxRuntime.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)"})]})]}),jsxRuntime.jsx("div",{className:o("overflow-hidden transition-all duration-300 ease-in-out",Y?"max-h-60":"max-h-0"),children:jsxRuntime.jsx("div",{className:o("border-t px-2 py-2",ee),children:jsxRuntime.jsx("div",{className:"max-h-52 space-y-0.5 overflow-y-auto",children:e.map((i,F)=>{let oe=F===N;return jsxRuntime.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:[jsxRuntime.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center",children:oe&&E?jsxRuntime.jsx("div",{className:"flex items-end gap-0.5",children:[1,2,3].map(Pe=>jsxRuntime.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?jsxRuntime.jsx(lucideReact.Disc3,{className:o("h-4 w-4",Re)}):jsxRuntime.jsx("span",{className:o("text-xs font-mono",ae),children:F+1})}),jsxRuntime.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded",children:jsxRuntime.jsx("img",{src:i.cover||Lt,alt:"",className:"h-full w-full object-cover",draggable:false})}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:o("truncate text-xs font-medium",oe?Re:Se),children:i.title}),i.artist&&jsxRuntime.jsx("div",{className:o("truncate text-[10px]",ae),children:i.artist})]}),s.has(F)&&jsxRuntime.jsx(lucideReact.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]=br.useState(t),[w,l]=br.useState(false),[m,P]=br.useState(0),[N,H]=br.useState(0),[E,z]=br.useState(0),[V,O]=br.useState(.8),[$,me]=br.useState(false),[b,M]=br.useState(u),[_,R]=br.useState(f),[s,A]=br.useState(false),[Y,ne]=br.useState("title"),[q,ve]=br.useState(true),[X,ye]=br.useState(false),[Xe,Fe]=br.useState(false),[pe,He]=br.useState(false),[be,Ve]=br.useState(true),[_e,j]=br.useState(false),[Ne,te]=br.useState(null),Z=br.useRef(null),re=br.useRef(null),he=br.useRef(void 0),Ee=br.useRef(false),I=e[h],Ue=br__default.default.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]);br.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]),br.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]),br.useEffect(()=>{let a=Z.current;a&&(w?a.play().catch(()=>{}):a.pause(),d?.(w));},[w]),br.useEffect(()=>{let a=Z.current;a&&(a.volume=$?0:V);},[V,$]),br.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=br.useCallback(()=>{Ve(true),he.current&&clearTimeout(he.current),he.current=setTimeout(()=>{w&&Ve(false);},3e3);},[w]);br.useEffect(()=>{w?J():(Ve(true),he.current&&clearTimeout(he.current));},[w,J]),br.useEffect(()=>()=>{he.current&&clearTimeout(he.current);},[]);let fe=br.useCallback(a=>{let T=(a%e.length+e.length)%e.length;L(T),P(0),l(true),c?.(T,e[T]);},[e,c]),Ce=br.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=br.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=br.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=br.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=br.useCallback(()=>{re.current&&(document.fullscreenElement?document.exitFullscreen():re.current.requestFullscreen());},[]);br.useEffect(()=>{let a=()=>He(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]);let D=br.useCallback(()=>{X?(Fe(true),setTimeout(()=>{ye(false),Fe(false);},500)):ye(true);},[X]),De=br.useCallback(()=>{A(a=>!a);},[]),qe=br.useCallback(()=>{let a=["title","type","duration"],T=a.indexOf(Y);q?ve(false):(ve(true),ne(a[(T+1)%a.length]));},[Y,q]);br.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&&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]);let Qe=N>0?m/N*100:0,ct=N>0?E/N*100:0,ce="text-(--accent)",xe=jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsx("video",{ref:Z,className:"h-full w-full object-contain",poster:I.poster,playsInline:true,preload:"metadata",onClick:()=>l(a=>!a)}),!w&&!_e&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex cursor-pointer items-center justify-center",style:{background:"var(--cp-overlay)"},onClick:()=>l(true),children:jsxRuntime.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:jsxRuntime.jsx(lucideReact.Play,{className:"h-10 w-10 translate-x-0.5",fill:"currentColor",style:{color:"var(--cp-text-strong)"}})})}),_e&&!be&&jsxRuntime.jsx("div",{className:"absolute left-6 top-6 z-20 animate-[fade-in_0.4s_ease-out]",children:jsxRuntime.jsxs("div",{className:"rounded-lg px-4 py-2 backdrop-blur-md",style:{background:"var(--cp-panel-bg)"},children:[jsxRuntime.jsx("div",{className:"text-sm font-semibold",style:{color:"var(--cp-text-strong)"},children:I.title}),I.subtitle&&jsxRuntime.jsx("div",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:I.subtitle})]})}),jsxRuntime.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:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold drop-shadow-md",style:{color:"var(--cp-text-strong)"},children:I.title}),I.subtitle&&jsxRuntime.jsx("p",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:I.subtitle})]}),I.type&&jsxRuntime.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})]})}),jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:`${ct}%`,background:"var(--cp-seek-buffer)"}}),jsxRuntime.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-(--accent) transition-[width] duration-100",style:{width:`${Qe}%`}}),Ne!==null&&jsxRuntime.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)}),jsxRuntime.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)`}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{className:"cp-btn",onClick:()=>l(a=>!a),title:w?"Pause (k)":"Play (k)",children:w?jsxRuntime.jsx(lucideReact.Pause,{className:"h-5 w-5",fill:"currentColor"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-5 w-5 translate-x-px",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:Se,title:"Previous (p)",children:jsxRuntime.jsx(lucideReact.SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:Ce,title:"Next (n)",children:jsxRuntime.jsx(lucideReact.SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsxs("div",{className:"group/vol ml-1 flex items-center",children:[jsxRuntime.jsx("button",{className:"cp-btn",onClick:()=>me(a=>!a),title:$?"Unmute":"Mute",children:$||V===0?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"flex w-0 items-center overflow-hidden transition-all duration-300 group-hover/vol:w-20",children:jsxRuntime.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)"}})})]}),jsxRuntime.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)]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:o("cp-btn",b&&ce),onClick:()=>M(a=>!a),title:"Shuffle",children:jsxRuntime.jsx(lucideReact.Shuffle,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:o("cp-btn",_&&ce),onClick:()=>R(a=>!a),title:"Loop",children:jsxRuntime.jsx(lucideReact.Repeat1,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:o("cp-btn",s&&ce),onClick:De,title:"Playlist",children:jsxRuntime.jsx(lucideReact.ListVideo,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:o("cp-btn",X&&ce),onClick:D,title:"Cinema mode (t)",children:jsxRuntime.jsx(lucideReact.Theater,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:ee,title:"Fullscreen (f)",children:pe?jsxRuntime.jsx(lucideReact.Minimize,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Maximize,{className:"h-4 w-4"})})]})]})]}),jsxRuntime.jsx("div",{className:o("h-full shrink-0 overflow-hidden transition-[width] duration-300 ease-out",s?"w-72":"w-0"),children:jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--cp-border)"},children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--cp-text)"},children:"Playlist"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.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:[jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"h-3 w-3"}),Y,q?" \u2191":" \u2193"]}),jsxRuntime.jsx("button",{className:"cp-btn p-1!",onClick:De,title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:Ue.map(({media:a,originalIndex:T})=>{let W=T===h;return jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"relative h-10 w-16 shrink-0 overflow-hidden rounded",style:{background:"var(--cp-surface)"},children:[a.poster?jsxRuntime.jsx("img",{src:a.poster,alt:"",className:"h-full w-full object-cover",draggable:false}):jsxRuntime.jsx("div",{className:"flex h-full w-full items-center justify-center",children:jsxRuntime.jsx(lucideReact.Play,{className:"h-4 w-4",style:{color:"var(--cp-seek-track)"}})}),W&&w&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"var(--cp-overlay)"},children:jsxRuntime.jsx("div",{className:"flex items-end gap-px",children:[1,2,3,4].map(i=>jsxRuntime.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))})})]}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:"truncate text-xs font-medium",children:a.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[a.type&&jsxRuntime.jsx("span",{className:"text-[10px] uppercase tracking-wide opacity-50",children:a.type}),a.duration!=null&&jsxRuntime.jsx("span",{className:"font-mono text-[10px] opacity-40",children:gt(a.duration)})]})]}),W&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3.5 w-3.5 shrink-0 text-(--accent)"})]},T)})})]})}),jsxRuntime.jsx("style",{children:`
|
|
6
|
+
</svg>`);function xr(e){if(!isFinite(e)||e<0)return "0:00";let t=Math.floor(e/60),r=Math.floor(e%60);return `${t}:${r.toString().padStart(2,"0")}`}function Jn(e){return e.startsWith("bottom")?"bottom":e.startsWith("top")?"top":"right"}var ea={"bottom-right":"bottom-4 right-4","bottom-left":"bottom-4 left-4","top-right":"top-4 right-4","top-left":"top-4 left-4"},ta={"bottom-right":"bottom-4 right-0","bottom-left":"bottom-4 left-0","top-right":"top-4 right-0","top-left":"top-4 left-0"},ra={"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 Bt({playlist:e,initialTrack:t=0,position:r="bottom-right",entrance:a,theme:l,docked:o=false,visible:n,onVisibleChange:f,onTrackChange:m,onLike:d,autoPlay:v=true,shuffle:b=false,loop:i=false,accent:p="#8b5cf6",className:P}){let [w,L]=Pr.useState(t),[T,R]=Pr.useState(false),[F,H]=Pr.useState(0),[j,le]=Pr.useState(0),[x,C]=Pr.useState(.8),[S,A]=Pr.useState(false),[u,V]=Pr.useState(new Set),[W,ie]=Pr.useState(false),[G,be]=Pr.useState(n??!o),[U,ue]=Pr.useState(false),[Pe,ye]=Pr.useState(false),[X,he]=Pr.useState(b),[ce,Te]=Pr.useState(i),Re=Pr.useRef(false),E=Pr.useRef(null),J=Pr.useRef(null),ee=Pr.useRef(void 0),B=Pr.useRef(null),ne=Pr.useRef(null),we=n??G,Se=a??Jn(r),Y=e[w],ae=o,ve=l==="dark"?"dark":l==="light"?"light":"",I="bg-(--mp-bg)",te="text-(--mp-text)",me="text-(--mp-text-muted)",Fe="text-(--accent)",de="border-(--mp-border)";Pr.useEffect(()=>{let h=E.current;h&&(h.src=Y.src,h.load(),T&&h.play().catch(()=>{}));},[w,Y.src]),Pr.useEffect(()=>{if(!v||Re.current)return;let h=E.current;if(!h)return;let K=()=>{Re.current=true,R(true),h.play().catch(()=>{});};return h.addEventListener("canplaythrough",K,{once:true}),()=>h.removeEventListener("canplaythrough",K)},[v]),Pr.useEffect(()=>{let h=E.current;h&&(T?h.play().catch(()=>{}):h.pause());},[T]),Pr.useEffect(()=>{let h=E.current;h&&(h.muted=S,ne.current?ne.current.gain.value=S?0:x:h.volume=x);},[x,S]),Pr.useEffect(()=>{let h=E.current;if(!h)return;let K=()=>H(h.currentTime),pe=()=>le(h.duration),_e=()=>{ce?(h.currentTime=0,h.play().catch(()=>{})):He();};return h.addEventListener("timeupdate",K),h.addEventListener("loadedmetadata",pe),h.addEventListener("ended",_e),()=>{h.removeEventListener("timeupdate",K),h.removeEventListener("loadedmetadata",pe),h.removeEventListener("ended",_e);}},[w,e.length]);let $=Pr.useCallback(h=>{let K=(h%e.length+e.length)%e.length;L(K),H(0),m?.(K,e[K]),we||(be(true),f?.(true));},[e,we,m,f]),He=Pr.useCallback(()=>{if(X){let h;do h=Math.floor(Math.random()*e.length);while(h===w&&e.length>1);$(h);}else $(w+1);},[$,w,X,e.length]),tt=Pr.useCallback(()=>{if(X){let h;do h=Math.floor(Math.random()*e.length);while(h===w&&e.length>1);$(h);}else $(w-1);},[$,w,X,e.length]),rt=Pr.useCallback(()=>{let h=u.has(w);V(K=>{let pe=new Set(K);return h?pe.delete(w):pe.add(w),pe}),d?.(w,Y,!h);},[w,u,d,Y]),bt=Pr.useCallback(h=>{let K=h.currentTarget.getBoundingClientRect(),_e=Math.max(0,Math.min(1,(h.clientX-K.left)/K.width))*j;E.current&&(E.current.currentTime=_e),H(_e);},[j]),ke=Pr.useCallback(()=>{ue(true);let h=ae?200:400;ee.current=setTimeout(()=>{ue(false),be(false),f?.(false);},h);},[ae,f]);Pr.useEffect(()=>()=>{ee.current&&clearTimeout(ee.current);},[]),Pr.useEffect(()=>()=>{B.current?.close();},[]);function Ee(){if(B.current||!E.current){B.current?.resume();return}try{let h=window.AudioContext??window.webkitAudioContext;if(!h)return;let K=new h,pe=K.createGain();pe.gain.value=S?0:x,K.createMediaElementSource(E.current).connect(pe).connect(K.destination),B.current=K,ne.current=pe,K.resume();}catch{}}let g=Pe?"fade-in 0.2s ease-out both":`mp-enter-${Se} 0.45s cubic-bezier(0.16, 1, 0.3, 1) both`,z=Pe?"fade-in 0.2s ease-in reverse both":`mp-exit-${Se} 0.4s cubic-bezier(0.7, 0, 0.84, 0) both`,re=j>0?F/j*100:0;return ae&&!we&&!U?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("audio",{ref:E,preload:"metadata",crossOrigin:"anonymous"}),jsxRuntime.jsxs("div",{className:c("fixed z-100 cursor-pointer transition-all duration-300",ra[r]),style:{"--accent":p},onMouseEnter:()=>{ye(true),be(true),f?.(true);},children:[jsxRuntime.jsx("div",{className:c("h-full w-full rounded-full",T?"bg-(--accent)":"bg-(--mp-dock-strip)"),style:T?{animation:"mp-progress-glow 2s ease-in-out infinite",boxShadow:"0 0 12px color-mix(in srgb, var(--accent) 50%, transparent)"}:void 0}),T&&jsxRuntime.jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/30",style:{animation:"mp-pulse-ring 2s ease-out infinite"}})]})]}):!we&&!U?jsxRuntime.jsx("audio",{ref:E,preload:"metadata",crossOrigin:"anonymous"}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("audio",{ref:E,preload:"metadata",crossOrigin:"anonymous"}),jsxRuntime.jsx("div",{className:c("fixed z-100",ae?ta[r]:ea[r],ve),style:{"--accent":p,...U?{animation:z}:{animation:g}},onMouseEnter:()=>{ae&&(ee.current&&(clearTimeout(ee.current),ee.current=void 0),U&&ue(false),ye(true));},onMouseLeave:()=>{ae&&(ye(false),ke());},children:jsxRuntime.jsxs("div",{className:c("w-[320px] overflow-hidden rounded-2xl border shadow-2xl backdrop-blur-xl",I,de,ae&&"rounded-none",r.endsWith("right")&&ae&&"rounded-l-2xl",r.endsWith("left")&&ae&&"rounded-r-2xl",P),children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 overflow-hidden",children:jsxRuntime.jsx("img",{src:Y.cover||$t,alt:"",className:"h-full w-full scale-110 object-cover opacity-30 blur-2xl",draggable:false})}),jsxRuntime.jsxs("div",{className:"relative flex items-center gap-3.5 p-4 pb-3",children:[jsxRuntime.jsxs("div",{className:"relative h-14 w-14 shrink-0",children:[jsxRuntime.jsxs("div",{className:"h-14 w-14 overflow-hidden rounded-full border-2 border-white/10 shadow-lg",style:T?{animation:"mp-vinyl-spin 4s linear infinite"}:void 0,children:[jsxRuntime.jsx("img",{src:Y.cover||$t,alt:Y.album??Y.title,className:"h-full w-full object-cover",draggable:false}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"h-3 w-3 rounded-full bg-black/60 ring-1 ring-white/10"})})]}),T&&jsxRuntime.jsx("div",{className:"absolute inset-0 rounded-full bg-(--accent)/20",style:{animation:"mp-pulse-ring 2.5s ease-out infinite"}})]}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:c("truncate text-sm font-semibold",te),children:Y.title}),Y.artist&&jsxRuntime.jsx("div",{className:c("truncate text-xs",me),children:Y.artist}),Y.album&&jsxRuntime.jsx("div",{className:c("mt-0.5 truncate text-[10px] tracking-wide",me,"opacity-60"),children:Y.album})]}),jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:c("rounded-full p-1.5 transition-all duration-200",u.has(w)?"text-rose-500 hover:text-rose-400":c(me,"hover:text-rose-500")),onClick:rt,title:"Like",children:jsxRuntime.jsx(lucideReact.Heart,{className:"h-4 w-4",fill:u.has(w)?"currentColor":"none"})}),jsxRuntime.jsx("button",{className:c("rounded-full p-1.5 transition-colors",me,"hover:"+te.split(" ")[0]),onClick:()=>ie(h=>!h),title:"Playlist",children:jsxRuntime.jsx(lucideReact.ListMusic,{className:"h-4 w-4"})}),!ae&&jsxRuntime.jsx("button",{className:c("rounded-full p-1.5 transition-colors",me,"hover:"+te.split(" ")[0]),onClick:ke,title:"Dismiss",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]})]}),jsxRuntime.jsxs("div",{className:"px-4",children:[jsxRuntime.jsxs("div",{ref:J,className:"group relative h-1.5 cursor-pointer rounded-full bg-(--mp-surface)",onClick:bt,children:[jsxRuntime.jsx("div",{className:"h-full rounded-full bg-(--accent) transition-[width] duration-150",style:{width:`${re}%`}}),jsxRuntime.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(${re}% - 6px)`}})]}),jsxRuntime.jsxs("div",{className:c("mt-1 flex justify-between text-[10px] font-mono",me),children:[jsxRuntime.jsx("span",{children:xr(F)}),jsxRuntime.jsx("span",{children:xr(j)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 pb-3 pt-1",children:[jsxRuntime.jsx("button",{className:c("rounded-full p-1.5 transition-colors",X?Fe:me,"hover:text-(--mp-text)"),onClick:()=>he(h=>!h),title:X?"Shuffle On":"Shuffle Off",children:jsxRuntime.jsx(lucideReact.Shuffle,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:c("rounded-full p-1.5 transition-colors",ce?Fe:me,"hover:text-(--mp-text)"),onClick:()=>Te(h=>!h),title:ce?"Loop On":"Loop Off",children:jsxRuntime.jsx(lucideReact.Repeat1,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:c("rounded-full p-2 transition-colors",me,"hover:text-(--mp-text)"),onClick:tt,title:"Previous",children:jsxRuntime.jsx(lucideReact.SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:c("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:()=>{Ee(),R(h=>!h);},title:T?"Pause":"Play",children:T?jsxRuntime.jsx(lucideReact.Pause,{className:"h-4.5 w-4.5",fill:"currentColor"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-4.5 w-4.5 translate-x-px",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:c("rounded-full p-2 transition-colors",me,"hover:text-(--mp-text)"),onClick:He,title:"Next",children:jsxRuntime.jsx(lucideReact.SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsxs("div",{className:"ml-2 flex items-center gap-1.5",children:[jsxRuntime.jsx("button",{className:c("rounded-full p-1 transition-colors",me,"hover:text-(--mp-text)"),onClick:()=>{Ee();let h=!S;A(h),ne.current&&(ne.current.gain.value=h?0:x);},title:S?"Unmute":"Mute",children:S||x===0?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:S?0:x,onChange:h=>{Ee();let K=Number(h.target.value);C(K),S&&A(false),ne.current&&(ne.current.gain.value=K);},className:"mp-volume-slider h-1 w-14 cursor-pointer appearance-none rounded-full bg-(--mp-surface) accent-(--accent)"})]})]}),jsxRuntime.jsx("div",{className:c("overflow-hidden transition-all duration-300 ease-in-out",W?"max-h-60":"max-h-0"),children:jsxRuntime.jsx("div",{className:c("border-t px-2 py-2",de),children:jsxRuntime.jsx("div",{className:"max-h-52 space-y-0.5 overflow-y-auto",children:e.map((h,K)=>{let pe=K===w;return jsxRuntime.jsxs("button",{className:c("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2 text-left transition-all duration-200",pe?"bg-(--accent)/10 dark:bg-(--accent)/15":"hover:bg-(--mp-surface-hover)"),onClick:()=>{$(K),R(true);},children:[jsxRuntime.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center",children:pe&&T?jsxRuntime.jsx("div",{className:"flex items-end gap-0.5",children:[1,2,3].map(_e=>jsxRuntime.jsx("div",{className:"w-0.75 rounded-full bg-(--accent)",style:{height:`${8+_e*4}px`,animation:`mp-eq-bar ${.4+_e*.15}s ease-in-out infinite alternate`}},_e))}):pe?jsxRuntime.jsx(lucideReact.Disc3,{className:c("h-4 w-4",Fe)}):jsxRuntime.jsx("span",{className:c("text-xs font-mono",me),children:K+1})}),jsxRuntime.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded",children:jsxRuntime.jsx("img",{src:h.cover||$t,alt:"",className:"h-full w-full object-cover",draggable:false})}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:c("truncate text-xs font-medium",pe?Fe:te),children:h.title}),h.artist&&jsxRuntime.jsx("div",{className:c("truncate text-[10px]",me),children:h.artist})]}),u.has(K)&&jsxRuntime.jsx(lucideReact.Heart,{className:"h-3 w-3 shrink-0 text-rose-500",fill:"currentColor"})]},K)})})})})]})})]})}function Dt(e){if(!isFinite(e)||e<0)return "0:00";let t=Math.floor(e/3600),r=Math.floor(e%3600/60),a=Math.floor(e%60);return t>0?`${t}:${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`:`${r}:${a.toString().padStart(2,"0")}`}var va={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 Kt({playlist:e,initialTrack:t=0,autoPlay:r=false,shuffle:a=false,loop:l=false,onTrackChange:o,onPlayChange:n,accent:f="#8b5cf6",className:m}){let[d,v]=Pr.useState(t),[b,i]=Pr.useState(false),[p,P]=Pr.useState(0),[w,L]=Pr.useState(0),[T,R]=Pr.useState(0),[F,H]=Pr.useState(.8),[j,le]=Pr.useState(false),[x,C]=Pr.useState(a),[S,A]=Pr.useState(l),[u,V]=Pr.useState(false),[W,ie]=Pr.useState("title"),[G,be]=Pr.useState(true),[U,ue]=Pr.useState(false),[Pe,ye]=Pr.useState(false),[X,he]=Pr.useState(false),[ce,Te]=Pr.useState(true),[Re,E]=Pr.useState(false),[J,ee]=Pr.useState(null),B=Pr.useRef(null),ne=Pr.useRef(null),we=Pr.useRef(void 0),Se=Pr.useRef(false),Y=e[d],Ye=Pr__default.default.useMemo(()=>{let g=e.map((z,re)=>({media:z,originalIndex:re}));return g.sort((z,re)=>{let h=va[W](z.media,re.media);return G?h:-h}),g},[e,W,G]);Pr.useEffect(()=>{let g=B.current;if(!g)return;E(true),g.src=Y.src,Y.poster&&(g.poster=Y.poster),g.load();let z=()=>{E(false),b&&g.play().catch(()=>{});};return g.addEventListener("loadeddata",z,{once:true}),()=>g.removeEventListener("loadeddata",z)},[d,Y.src]),Pr.useEffect(()=>{if(!r||Se.current)return;let g=B.current;if(!g)return;let z=()=>{Se.current=true,i(true),g.play().catch(()=>{});};return g.addEventListener("canplaythrough",z,{once:true}),()=>g.removeEventListener("canplaythrough",z)},[r]),Pr.useEffect(()=>{let g=B.current;g&&(b?g.play().catch(()=>{}):g.pause(),n?.(b));},[b]),Pr.useEffect(()=>{let g=B.current;g&&(g.volume=j?0:F);},[F,j]),Pr.useEffect(()=>{let g=B.current;if(!g)return;let z=()=>P(g.currentTime),re=()=>L(g.duration),h=()=>{g.buffered.length>0&&R(g.buffered.end(g.buffered.length-1));},K=()=>{S?(g.currentTime=0,g.play().catch(()=>{})):I();};return g.addEventListener("timeupdate",z),g.addEventListener("loadedmetadata",re),g.addEventListener("progress",h),g.addEventListener("ended",K),()=>{g.removeEventListener("timeupdate",z),g.removeEventListener("loadedmetadata",re),g.removeEventListener("progress",h),g.removeEventListener("ended",K);}},[d,e.length,S]);let ae=Pr.useCallback(()=>{Te(true),we.current&&clearTimeout(we.current),we.current=setTimeout(()=>{b&&Te(false);},3e3);},[b]);Pr.useEffect(()=>{b?ae():(Te(true),we.current&&clearTimeout(we.current));},[b,ae]),Pr.useEffect(()=>()=>{we.current&&clearTimeout(we.current);},[]);let ve=Pr.useCallback(g=>{let z=(g%e.length+e.length)%e.length;v(z),P(0),i(true),o?.(z,e[z]);},[e,o]),I=Pr.useCallback(()=>{if(x){let g;do g=Math.floor(Math.random()*e.length);while(g===d&&e.length>1);ve(g);}else ve(d+1);},[ve,d,x,e.length]),te=Pr.useCallback(()=>{if(x){let g;do g=Math.floor(Math.random()*e.length);while(g===d&&e.length>1);ve(g);}else ve(d-1);},[ve,d,x,e.length]),me=Pr.useCallback(g=>{let z=g.currentTarget.getBoundingClientRect(),h=Math.max(0,Math.min(1,(g.clientX-z.left)/z.width))*w;B.current&&(B.current.currentTime=h),P(h);},[w]),Fe=Pr.useCallback(g=>{let z=g.currentTarget.getBoundingClientRect(),re=Math.max(0,Math.min(1,(g.clientX-z.left)/z.width));ee(re*w);},[w]),de=Pr.useCallback(()=>{ne.current&&(document.fullscreenElement?document.exitFullscreen():ne.current.requestFullscreen());},[]);Pr.useEffect(()=>{let g=()=>he(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",g),()=>document.removeEventListener("fullscreenchange",g)},[]);let $=Pr.useCallback(()=>{U?(ye(true),setTimeout(()=>{ue(false),ye(false);},500)):ue(true);},[U]),He=Pr.useCallback(()=>{V(g=>!g);},[]),tt=Pr.useCallback(()=>{let g=["title","type","duration"],z=g.indexOf(W);G?be(false):(be(true),ie(g[(z+1)%g.length]));},[W,G]);Pr.useEffect(()=>{let g=z=>{if(!(z.target instanceof HTMLInputElement||z.target instanceof HTMLTextAreaElement))switch(z.key){case " ":case "k":z.preventDefault(),i(re=>!re);break;case "f":z.preventDefault(),de();break;case "t":z.preventDefault(),$();break;case "ArrowLeft":z.preventDefault(),B.current&&(B.current.currentTime=Math.max(0,p-5));break;case "ArrowRight":z.preventDefault(),B.current&&(B.current.currentTime=Math.min(w,p+5));break;case "ArrowUp":z.preventDefault(),H(re=>Math.min(1,re+.05));break;case "ArrowDown":z.preventDefault(),H(re=>Math.max(0,re-.05));break;case "Escape":U&&$();break;case "n":z.preventDefault(),I();break;case "p":z.preventDefault(),te();break;case "l":z.preventDefault(),He();break}};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[de,$,He,I,te,p,w,U]);let rt=w>0?p/w*100:0,bt=w>0?T/w*100:0,ke="text-(--accent)",Ee=jsxRuntime.jsxs("div",{ref:ne,className:c("group flex overflow-hidden",X?"h-full w-full":"aspect-video w-full",!X&&"rounded-xl",!X&&b&&"shadow-2xl",!X&&!b&&"animate-[cp-glow-pulse_4s_ease-in-out_infinite] will-change-[box-shadow]",m),style:{"--accent":f,background:"var(--cp-bg)"},tabIndex:0,children:[jsxRuntime.jsxs("div",{className:c("relative flex-1 min-w-0 h-full overflow-hidden",Re&&"animate-[cp-track-transition_0.6s_ease-out]"),onMouseMove:ae,onMouseLeave:()=>{b&&Te(false);},children:[jsxRuntime.jsx("video",{ref:B,className:"h-full w-full object-contain",poster:Y.poster,playsInline:true,preload:"metadata",onClick:()=>i(g=>!g)}),!b&&!Re&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex cursor-pointer items-center justify-center",style:{background:"var(--cp-overlay)"},onClick:()=>i(true),children:jsxRuntime.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:jsxRuntime.jsx(lucideReact.Play,{className:"h-10 w-10 translate-x-0.5",fill:"currentColor",style:{color:"var(--cp-text-strong)"}})})}),Re&&!ce&&jsxRuntime.jsx("div",{className:"absolute left-6 top-6 z-20 animate-[fade-in_0.4s_ease-out]",children:jsxRuntime.jsxs("div",{className:"rounded-lg px-4 py-2 backdrop-blur-md",style:{background:"var(--cp-panel-bg)"},children:[jsxRuntime.jsx("div",{className:"text-sm font-semibold",style:{color:"var(--cp-text-strong)"},children:Y.title}),Y.subtitle&&jsxRuntime.jsx("div",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:Y.subtitle})]})}),jsxRuntime.jsx("div",{className:c("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",ce?"opacity-100":"pointer-events-none opacity-0"),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold drop-shadow-md",style:{color:"var(--cp-text-strong)"},children:Y.title}),Y.subtitle&&jsxRuntime.jsx("p",{className:"text-xs",style:{color:"var(--cp-text-muted)"},children:Y.subtitle})]}),Y.type&&jsxRuntime.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:Y.type})]})}),jsxRuntime.jsxs("div",{className:c("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",ce?"translate-y-0 opacity-100":"pointer-events-none translate-y-2 opacity-0"),children:[jsxRuntime.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:me,onMouseMove:Fe,onMouseLeave:()=>ee(null),children:[jsxRuntime.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:`${bt}%`,background:"var(--cp-seek-buffer)"}}),jsxRuntime.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-(--accent) transition-[width] duration-100",style:{width:`${rt}%`}}),J!==null&&jsxRuntime.jsx("div",{className:"absolute -top-8 -translate-x-1/2 rounded px-2 py-0.5 text-[10px] font-mono",style:{left:`${J/w*100}%`,background:"var(--cp-panel-bg)",color:"var(--cp-text-strong)"},children:Dt(J)}),jsxRuntime.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(${rt}% - 7px)`}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{className:"cp-btn",onClick:()=>i(g=>!g),title:b?"Pause (k)":"Play (k)",children:b?jsxRuntime.jsx(lucideReact.Pause,{className:"h-5 w-5",fill:"currentColor"}):jsxRuntime.jsx(lucideReact.Play,{className:"h-5 w-5 translate-x-px",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:te,title:"Previous (p)",children:jsxRuntime.jsx(lucideReact.SkipBack,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:I,title:"Next (n)",children:jsxRuntime.jsx(lucideReact.SkipForward,{className:"h-4 w-4",fill:"currentColor"})}),jsxRuntime.jsxs("div",{className:"group/vol ml-1 flex items-center",children:[jsxRuntime.jsx("button",{className:"cp-btn",onClick:()=>le(g=>!g),title:j?"Unmute":"Mute",children:j||F===0?jsxRuntime.jsx(lucideReact.VolumeX,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Volume2,{className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"flex w-0 items-center overflow-hidden transition-all duration-300 group-hover/vol:w-20",children:jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:j?0:F,onChange:g=>{H(Number(g.target.value)),j&&le(false);},className:"h-1 w-full cursor-pointer appearance-none rounded-full accent-(--accent)",style:{background:"var(--cp-seek-track)"}})})]}),jsxRuntime.jsxs("span",{className:"ml-2 min-w-0 shrink-0 font-mono text-xs",style:{color:"var(--cp-text-muted)"},children:[Dt(p)," / ",Dt(w)]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:c("cp-btn",x&&ke),onClick:()=>C(g=>!g),title:"Shuffle",children:jsxRuntime.jsx(lucideReact.Shuffle,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:c("cp-btn",S&&ke),onClick:()=>A(g=>!g),title:"Loop",children:jsxRuntime.jsx(lucideReact.Repeat1,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:c("cp-btn",u&&ke),onClick:He,title:"Playlist",children:jsxRuntime.jsx(lucideReact.ListVideo,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:c("cp-btn",U&&ke),onClick:$,title:"Cinema mode (t)",children:jsxRuntime.jsx(lucideReact.Theater,{className:"h-4 w-4"})}),jsxRuntime.jsx("button",{className:"cp-btn",onClick:de,title:"Fullscreen (f)",children:X?jsxRuntime.jsx(lucideReact.Minimize,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Maximize,{className:"h-4 w-4"})})]})]})]}),jsxRuntime.jsx("div",{className:c("h-full shrink-0 overflow-hidden transition-[width] duration-300 ease-out",u?"w-72":"w-0"),children:jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--cp-border)"},children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--cp-text)"},children:"Playlist"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.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:tt,title:`Sort: ${W} ${G?"\u2191":"\u2193"}`,children:[jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"h-3 w-3"}),W,G?" \u2191":" \u2193"]}),jsxRuntime.jsx("button",{className:"cp-btn p-1!",onClick:He,title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:Ye.map(({media:g,originalIndex:z})=>{let re=z===d;return jsxRuntime.jsxs("button",{className:c("flex w-full items-center gap-3 px-4 py-2.5 text-left transition-all duration-200",re?"bg-(--accent)/20 text-(--accent)":"hover:text-(--cp-text-strong)"),style:re?void 0:{color:"var(--cp-text)"},onClick:()=>{ve(z);},children:[jsxRuntime.jsxs("div",{className:"relative h-10 w-16 shrink-0 overflow-hidden rounded",style:{background:"var(--cp-surface)"},children:[g.poster?jsxRuntime.jsx("img",{src:g.poster,alt:"",className:"h-full w-full object-cover",draggable:false}):jsxRuntime.jsx("div",{className:"flex h-full w-full items-center justify-center",children:jsxRuntime.jsx(lucideReact.Play,{className:"h-4 w-4",style:{color:"var(--cp-seek-track)"}})}),re&&b&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",style:{background:"var(--cp-overlay)"},children:jsxRuntime.jsx("div",{className:"flex items-end gap-px",children:[1,2,3,4].map(h=>jsxRuntime.jsx("div",{className:"w-0.5 rounded-full bg-(--accent)",style:{height:`${6+h*3}px`,animation:`mp-eq-bar ${.3+h*.12}s ease-in-out infinite alternate`}},h))})})]}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("div",{className:"truncate text-xs font-medium",children:g.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[g.type&&jsxRuntime.jsx("span",{className:"text-[10px] uppercase tracking-wide opacity-50",children:g.type}),g.duration!=null&&jsxRuntime.jsx("span",{className:"font-mono text-[10px] opacity-40",children:Dt(g.duration)})]})]}),re&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3.5 w-3.5 shrink-0 text-(--accent)"})]},z)})})]})}),jsxRuntime.jsx("style",{children:`
|
|
7
7
|
.cp-btn {
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
@@ -19,7 +19,7 @@
|
|
|
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 jsxRuntime.jsx("div",{className:o(X&&"fixed inset-0 z-100 flex items-center justify-center p-8",X&&(Xe?"animate-[cp-cinema-out_0.5s_ease-in_both]":"animate-[cp-cinema-in_0.5s_ease-out_both]")),onClick:X?a=>{a.target===a.currentTarget&&D();}:void 0,children:jsxRuntime.jsx("div",{className:o(X&&"w-full",X&&!pe&&"max-w-5xl"),children:xe})})}var _t=classVarianceAuthority.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"}});classVarianceAuthority.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=br.createContext(null);function cr({open:e,onOpenChange:t,modal:n=true,closeOnOutsideClick:u=false,children:f}){let c=br.useId();return br.useEffect(()=>{if(e)return Yn(c),()=>Wn(c)},[e,c]),br.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]),br.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?jsxRuntime.jsx(lr.Provider,{value:{id:c,onOpenChange:t,modal:n,closeOnOutsideClick:u},children:reactDom.createPortal(f,document.body)}):null}function dr({size:e,position:t="center",className:n,children:u,...f}){let c=br.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?jsxRuntime.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:jsxRuntime.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})}):jsxRuntime.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:jsxRuntime.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 jsxRuntime.jsx("div",{className:o("mb-4 space-y-1",e),...t})}function mr({className:e,...t}){return jsxRuntime.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 jsxRuntime.jsx("p",{className:o("text-primary-500 dark:text-primary-400 text-sm",e),...t})}function fr({className:e,...t}){return jsxRuntime.jsx("div",{className:o("mt-6 flex justify-end gap-2",e),...t})}var gr=classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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 jsxRuntime.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":lucideReact.Image,".jpg":lucideReact.Image,".jpeg":lucideReact.Image,".gif":lucideReact.Image,".svg":lucideReact.Image,".webp":lucideReact.Image,".ico":lucideReact.Image,".bmp":lucideReact.Image,".mp3":lucideReact.Music,".wav":lucideReact.Music,".flac":lucideReact.Music,".ogg":lucideReact.Music,".aac":lucideReact.Music,".m4a":lucideReact.Music,".mp4":lucideReact.Video,".mkv":lucideReact.Video,".avi":lucideReact.Video,".mov":lucideReact.Video,".wmv":lucideReact.Video,".webm":lucideReact.Video,".ts":lucideReact.FileCode,".tsx":lucideReact.FileCode,".js":lucideReact.FileCode,".jsx":lucideReact.FileCode,".json":lucideReact.FileCode,".html":lucideReact.FileCode,".css":lucideReact.FileCode,".scss":lucideReact.FileCode,".py":lucideReact.FileCode,".rs":lucideReact.FileCode,".go":lucideReact.FileCode,".java":lucideReact.FileCode,".c":lucideReact.FileCode,".cpp":lucideReact.FileCode,".h":lucideReact.FileCode,".sh":lucideReact.Terminal,".bat":lucideReact.Terminal,".ps1":lucideReact.Terminal,".md":lucideReact.FileText,".txt":lucideReact.FileText,".pdf":lucideReact.FileText,".doc":lucideReact.FileText,".docx":lucideReact.FileText,".rtf":lucideReact.FileText,".csv":lucideReact.FileSpreadsheet,".xls":lucideReact.FileSpreadsheet,".xlsx":lucideReact.FileSpreadsheet,".db":lucideReact.Database,".sqlite":lucideReact.Database,".sql":lucideReact.Database,".zip":lucideReact.FileArchive,".tar":lucideReact.FileArchive,".gz":lucideReact.FileArchive,".rar":lucideReact.FileArchive,".7z":lucideReact.FileArchive};function jt(e){if(e.type==="directory")return lucideReact.Folder;let t=e.extension||bt(e.name);return ca[t]||lucideReact.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]=br.useState(u),[b,M]=br.useState(new Set),[_,R]=br.useState(null),[s,A]=br.useState(false),[Y,ne]=br.useState(false),[q,ve]=br.useState(""),[X,ye]=br.useState(H),[Xe,Fe]=br.useState(y),[pe,He]=br.useState(false),[be,Ve]=br.useState({w:window.innerWidth,h:window.innerHeight}),_e=kr(window.innerWidth,window.innerHeight),[j,Ne]=br.useState(f??_e.pos),[te,Z]=br.useState(c??_e.size),[re,he]=br.useState(null),Ee=br.useRef(false),I=br.useRef({x:0,y:0}),Ue=br.useRef(null),J=br.useRef(false),fe=br.useRef({x:0,y:0,w:0,h:0,px:0,py:0}),Ce=br.useRef(false),Se=br.useRef(s);br.useEffect(()=>{Se.current=s;},[s]);let ae=y!==void 0?y:Xe,Re=br.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=br.useMemo(()=>{if(X!=="search"||!q.trim())return Re;let r=q.toLowerCase();return Re.filter(k=>k.name.toLowerCase().includes(r))},[Re,q,X]),D=_!=null?ee[_]:null;br.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=br.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);},[]);br.useEffect(()=>{if(!L)return;let r=Array.from(b).map(k=>ee[k]).filter(Boolean);L(r);},[b]);let qe=br.useCallback(r=>{let k=ee[r];k&&(k.type==="directory"?w?.(k.path):h?.(k));},[ee,h,w]),Qe=br.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=br.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]);br.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=br.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=br.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]);br.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=br.useCallback(()=>{s?(re&&(Ne(re.pos),Z(re.size)),A(false)):(he({pos:j,size:te}),A(true));},[s,j,te,re]),T=br.useCallback(()=>{Y?ne(false):(s&&(A(false),re&&(Ne(re.pos),Z(re.size))),ne(true),P?.());},[Y,s,re,P]);br.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 jsxRuntime.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:jsxRuntime.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:[jsxRuntime.jsx(lucideReact.HardDrive,{className:"h-3.5 w-3.5 text-(--fe-accent)"}),jsxRuntime.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 jsxRuntime.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:[jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.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:jsxRuntime.jsx(lucideReact.HardDrive,{className:"h-3 w-3 text-(--fe-accent)"})}),jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-(--fe-text)",children:t}),jsxRuntime.jsx("div",{className:"ml-2 hidden h-px w-20 md:block",style:{background:"linear-gradient(90deg, var(--fe-accent), transparent)",opacity:.3}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:"fe-btn mr-1",onClick:()=>me(r=>r==="list"?"grid":"list"),title:$==="list"?"Grid view":"List view",children:$==="list"?jsxRuntime.jsx(lucideReact.LayoutGrid,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.LayoutList,{className:"h-3.5 w-3.5"})}),d&&jsxRuntime.jsx("button",{className:"fe-btn",onClick:T,title:"Dock to edge",children:jsxRuntime.jsx(lucideReact.Minus,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn",onClick:a,title:s?"Restore":"Maximize",children:s?jsxRuntime.jsx(lucideReact.Minimize2,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.Maximize2,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn hover:bg-red-500/40! hover:text-red-300!",onClick:()=>{m?.(),Fe(false);},title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]}),jsxRuntime.jsxs("div",{className:"fe-toolbar flex h-9 shrink-0 items-center gap-2 px-3",children:[jsxRuntime.jsx("button",{className:"fe-btn p-1",onClick:()=>w?.(".."),title:"Go up",children:jsxRuntime.jsx(lucideReact.FolderUp,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn shrink-0 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider",style:X==="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==="search"?"Switch to path navigation":"Switch to file search",children:X==="search"?jsxRuntime.jsx(lucideReact.Search,{className:"h-3 w-3"}):jsxRuntime.jsx(lucideReact.CornerRightDown,{className:"h-3 w-3"})}),jsxRuntime.jsx("div",{className:"relative flex-1",children:jsxRuntime.jsx("input",{type:"text",value:q,onChange:r=>ve(r.target.value),onKeyDown:r=>{r.key==="Enter"&&q.trim()&&X==="navigate"&&(N?N(q.trim()):w?.(q.trim()));},placeholder:X==="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)"})}),jsxRuntime.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`]})]}),jsxRuntime.jsxs("div",{className:"relative flex flex-1 min-h-0",children:[jsxRuntime.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?jsxRuntime.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-(--fe-text-muted)",children:[jsxRuntime.jsx(lucideReact.Folder,{className:"mb-2 h-10 w-10"}),jsxRuntime.jsx("span",{className:"text-xs",children:"No files found"})]}):$==="list"?jsxRuntime.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 jsxRuntime.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:[jsxRuntime.jsx(B,{className:o("h-4 w-4 shrink-0",r.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"flex-1 truncate text-xs font-medium",children:r.name}),Q&&r.type==="file"&&jsxRuntime.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&&jsxRuntime.jsx("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:yr(r.size)}),r.modifiedAt&&jsxRuntime.jsx("span",{className:"hidden shrink-0 font-mono text-[10px] text-(--fe-text-muted) lg:inline",children:$t(r.modifiedAt)})]},r.path+k)})}):jsxRuntime.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 jsxRuntime.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:[jsxRuntime.jsx(B,{className:o("h-7 w-7",r.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"w-full truncate text-[10px] font-medium leading-tight",children:r.name}),Q&&r.type==="file"&&jsxRuntime.jsx("span",{className:"font-mono text-[8px] uppercase text-(--fe-text-muted)",children:Q})]},r.path+k)})})}),jsxRuntime.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&&jsxRuntime.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&&jsxRuntime.jsx("button",{className:"fe-btn mb-2 self-end",onClick:()=>{R(null),M(new Set);},title:"Close panel",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsxs("div",{className:"mb-3 flex flex-col items-center",children:[br__default.default.createElement(jt(D),{className:o("h-10 w-10 mb-2",D.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"w-full text-center text-xs font-semibold text-(--fe-text-strong) break-all leading-tight",children:D.name})]}),jsxRuntime.jsxs("div",{className:"space-y-2.5 text-[10px]",children:[jsxRuntime.jsx(lt,{label:"Type",value:D.type==="directory"?"Directory":D.mimeType||D.extension||bt(D.name)||"File"}),D.size!=null&&jsxRuntime.jsx(lt,{label:"Size",value:yr(D.size)}),jsxRuntime.jsx(lt,{label:"Path",value:D.path,mono:true}),D.extension&&jsxRuntime.jsx(lt,{label:"Extension",value:D.extension}),D.modifiedAt&&jsxRuntime.jsx(lt,{label:"Modified",value:$t(D.modifiedAt)}),D.createdAt&&jsxRuntime.jsx(lt,{label:"Created",value:$t(D.createdAt)})]}),jsxRuntime.jsxs("div",{className:"mt-auto flex flex-col gap-1.5",children:[D.type==="file"&&h&&jsxRuntime.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:[jsxRuntime.jsx(lucideReact.ArrowUp,{className:"h-3 w-3 rotate-45"}),"Open"]}),E?.map(r=>jsxRuntime.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__default.default.createElement(r.icon,{className:"h-3 w-3"}),r.label]},r.key))]})]})})]}),jsxRuntime.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:[jsxRuntime.jsxs("span",{children:[ee.length," items"]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[b.size>0&&jsxRuntime.jsxs("span",{className:"text-(--fe-accent)/70",children:[b.size," selected"]}),jsxRuntime.jsx("span",{className:"opacity-50",children:"Ctrl+Click multi-select \xB7 Esc clear"})]})]}),z&&!s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.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)}),jsxRuntime.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)}),jsxRuntime.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)}),jsxRuntime.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)}),jsxRuntime.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)}),jsxRuntime.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)}),jsxRuntime.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)}),jsxRuntime.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)})]}),jsxRuntime.jsx("style",{children:`
|
|
22
|
+
`})]});return jsxRuntime.jsx("div",{className:c(U&&"fixed inset-0 z-100 flex items-center justify-center p-8",U&&(Pe?"animate-[cp-cinema-out_0.5s_ease-in_both]":"animate-[cp-cinema-in_0.5s_ease-out_both]")),onClick:U?g=>{g.target===g.currentTarget&&$();}:void 0,children:jsxRuntime.jsx("div",{className:c(U&&"w-full",U&&!X&&"max-w-5xl"),children:Ee})})}var Wt=classVarianceAuthority.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"}});classVarianceAuthority.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 We=[];function Na(e){We.push(e);}function Ca(e){let t=We.indexOf(e);t!==-1&&We.splice(t,1);}function Gt(e){return We.length>0&&We[We.length-1]===e}function Ma(e){let t=We.indexOf(e);return t!==-1?t:We.length}var kr=Pr.createContext(null);function Nr({open:e,onOpenChange:t,modal:r=true,closeOnOutsideClick:a=false,children:l}){let o=Pr.useId();return Pr.useEffect(()=>{if(e)return Na(o),()=>Ca(o)},[e,o]),Pr.useEffect(()=>{if(!e||!r)return;let n=f=>{f.key==="Escape"&&Gt(o)&&t(false);};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,r,t,o]),Pr.useEffect(()=>{if(!e||!r)return;let n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n;}},[e,r]),e?jsxRuntime.jsx(kr.Provider,{value:{id:o,onOpenChange:t,modal:r,closeOnOutsideClick:a},children:reactDom.createPortal(l,document.body)}):null}function Cr({size:e,position:t="center",className:r,children:a,...l}){let o=Pr.useContext(kr);if(!o)return null;let f=200+Ma(o.id)*10,m=()=>{o.closeOnOutsideClick&&Gt(o.id)&&o.onOpenChange(false);},d=t==="bottom";return o.modal?jsxRuntime.jsx("div",{className:c("animate-fade-in fixed inset-0 bg-black/50",d?"flex items-end justify-center":"flex items-center justify-center p-4"),style:{zIndex:f},onClick:m,children:jsxRuntime.jsx("div",{className:c(Wt({size:e}),d?"animate-slide-in-bottom w-full rounded-b-none rounded-t-(--dialog-sheet-radius) max-h-[85vh] overflow-y-auto":"animate-scale-in",r),role:"dialog","aria-modal":"true",onClick:v=>v.stopPropagation(),...l,children:a})}):jsxRuntime.jsx("div",{className:c("fixed inset-0 flex items-center justify-center p-4",o.closeOnOutsideClick?"pointer-events-auto":"pointer-events-none"),style:{zIndex:f},onClick:o.closeOnOutsideClick&&Gt(o.id)?()=>o.onOpenChange(false):void 0,children:jsxRuntime.jsx("div",{className:c(Wt({size:e}),"animate-scale-in pointer-events-auto shadow-2xl",r),role:"dialog",onClick:o.closeOnOutsideClick?v=>v.stopPropagation():void 0,...l,children:a})})}function Mr({className:e,...t}){return jsxRuntime.jsx("div",{className:c("mb-4 space-y-1",e),...t})}function Dr({className:e,...t}){return jsxRuntime.jsx("h2",{className:c("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 Tr({className:e,...t}){return jsxRuntime.jsx("p",{className:c("text-primary-500 dark:text-primary-400 text-sm",e),...t})}function Sr({className:e,...t}){return jsxRuntime.jsx("div",{className:c("mt-6 flex justify-end gap-2",e),...t})}var Er=classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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"}});classVarianceAuthority.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 qt({intent:e,size:t,className:r,...a}){return jsxRuntime.jsx("button",{className:c(Er({intent:e,size:t}),r),...a})}function Tt(e){let t=e.lastIndexOf(".");return t>0?e.slice(t).toLowerCase():""}function Ar(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 er(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 Ha={".png":lucideReact.Image,".jpg":lucideReact.Image,".jpeg":lucideReact.Image,".gif":lucideReact.Image,".svg":lucideReact.Image,".webp":lucideReact.Image,".ico":lucideReact.Image,".bmp":lucideReact.Image,".mp3":lucideReact.Music,".wav":lucideReact.Music,".flac":lucideReact.Music,".ogg":lucideReact.Music,".aac":lucideReact.Music,".m4a":lucideReact.Music,".mp4":lucideReact.Video,".mkv":lucideReact.Video,".avi":lucideReact.Video,".mov":lucideReact.Video,".wmv":lucideReact.Video,".webm":lucideReact.Video,".ts":lucideReact.FileCode,".tsx":lucideReact.FileCode,".js":lucideReact.FileCode,".jsx":lucideReact.FileCode,".json":lucideReact.FileCode,".html":lucideReact.FileCode,".css":lucideReact.FileCode,".scss":lucideReact.FileCode,".py":lucideReact.FileCode,".rs":lucideReact.FileCode,".go":lucideReact.FileCode,".java":lucideReact.FileCode,".c":lucideReact.FileCode,".cpp":lucideReact.FileCode,".h":lucideReact.FileCode,".sh":lucideReact.Terminal,".bat":lucideReact.Terminal,".ps1":lucideReact.Terminal,".md":lucideReact.FileText,".txt":lucideReact.FileText,".pdf":lucideReact.FileText,".doc":lucideReact.FileText,".docx":lucideReact.FileText,".rtf":lucideReact.FileText,".csv":lucideReact.FileSpreadsheet,".xls":lucideReact.FileSpreadsheet,".xlsx":lucideReact.FileSpreadsheet,".db":lucideReact.Database,".sqlite":lucideReact.Database,".sql":lucideReact.Database,".zip":lucideReact.FileArchive,".tar":lucideReact.FileArchive,".gz":lucideReact.FileArchive,".rar":lucideReact.FileArchive,".7z":lucideReact.FileArchive};function tr(e){if(e.type==="directory")return lucideReact.Folder;let t=e.extension||Tt(e.name);return Ha[t]||lucideReact.File}function mt(e,t,r){return Math.max(t,Math.min(r,e))}function Ir(e){return e<480?"xs":e<640?"sm":e<1024?"md":"lg"}function _r(e,t){if(e<480)return {size:{width:e-16,height:t-48},pos:{x:8,y:24}};if(e<640){let l=e-24,o=Math.min(t-64,540);return {size:{width:l,height:o},pos:{x:12,y:32}}}if(e<1024){let l=Math.min(640,e-32),o=Math.min(480,t-64);return {size:{width:l,height:o},pos:{x:Math.max(0,Math.round((e-l)/2)),y:Math.max(0,Math.round((t-o)/2))}}}let r=720,a=520;return {size:{width:r,height:a},pos:{x:Math.max(0,Math.round((e-r)/2)),y:Math.max(0,Math.round((t-a)/2))}}}function rr({files:e,title:t="File Explorer",accent:r="#8b5cf6",defaultView:a="list",initialPosition:l,initialSize:o,dockable:n=false,dockSide:f="right",visible:m=true,onFileOpen:d,onSelectionChange:v,onNavigate:b,onDelete:i,onClose:p,onMinimize:P,onPathSubmit:w,defaultInputMode:L="search",actions:T,resizable:R=true,minSize:F={width:400,height:300},className:H}){let[j,le]=Pr.useState(a),[x,C]=Pr.useState(new Set),[S,A]=Pr.useState(null),[u,V]=Pr.useState(false),[W,ie]=Pr.useState(false),[G,be]=Pr.useState(""),[U,ue]=Pr.useState(L),[Pe,ye]=Pr.useState(m),[X,he]=Pr.useState(false),[ce,Te]=Pr.useState({w:window.innerWidth,h:window.innerHeight}),Re=_r(window.innerWidth,window.innerHeight),[E,J]=Pr.useState(l??Re.pos),[ee,B]=Pr.useState(o??Re.size),[ne,we]=Pr.useState(null),Se=Pr.useRef(false),Y=Pr.useRef({x:0,y:0}),Ye=Pr.useRef(null),ae=Pr.useRef(false),ve=Pr.useRef({x:0,y:0,w:0,h:0,px:0,py:0}),I=Pr.useRef(false),te=Pr.useRef(u);Pr.useEffect(()=>{te.current=u;},[u]);let me=m!==void 0?m:Pe,Fe=Pr.useMemo(()=>{let s=e.filter(q=>q.type==="directory"),M=e.filter(q=>q.type==="file");return s.sort((q,Q)=>q.name.localeCompare(Q.name)),M.sort((q,Q)=>q.name.localeCompare(Q.name)),[...s,...M]},[e]),de=Pr.useMemo(()=>{if(U!=="search"||!G.trim())return Fe;let s=G.toLowerCase();return Fe.filter(M=>M.name.toLowerCase().includes(s))},[Fe,G,U]),$=S!=null?de[S]:null;Pr.useEffect(()=>{let s=Ir(window.innerWidth),M=()=>{let q=window.innerWidth,Q=window.innerHeight;if(Te({w:q,h:Q}),te.current)return;let se=Ir(q);if(se!==s&&!I.current&&!o){let Ae=_r(q,Q);B(Ae.size),J(Ae.pos);}s=se;};return window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[o]);let He=Pr.useCallback((s,M)=>{C(q=>{let Q=new Set(q);return M.ctrlKey||M.metaKey?Q.has(s)?Q.delete(s):Q.add(s):(Q.clear(),Q.add(s)),Q}),A(s);},[]);Pr.useEffect(()=>{if(!v)return;let s=Array.from(x).map(M=>de[M]).filter(Boolean);v(s);},[x]);let tt=Pr.useCallback(s=>{let M=de[s];M&&(M.type==="directory"?b?.(M.path):d?.(M));},[de,d,b]),rt=Pr.useCallback(s=>{u||s.target.closest("button")||(I.current=true,Se.current=true,Y.current={x:s.clientX-E.x,y:s.clientY-E.y},s.preventDefault());},[E,u]),bt=Pr.useCallback(s=>{if(u||s.target.closest("button"))return;I.current=true;let M=s.touches[0];Se.current=true,Y.current={x:M.clientX-E.x,y:M.clientY-E.y};},[E,u]);Pr.useEffect(()=>{let s=Q=>{if(!Se.current)return;let se=window.innerWidth-100,Ae=window.innerHeight-40;J({x:mt(Q.clientX-Y.current.x,0,se),y:mt(Q.clientY-Y.current.y,0,Ae)});},M=Q=>{if(!Se.current)return;Q.preventDefault();let se=Q.touches[0],Ae=window.innerWidth-100,Qe=window.innerHeight-40;J({x:mt(se.clientX-Y.current.x,0,Ae),y:mt(se.clientY-Y.current.y,0,Qe)});},q=()=>{Se.current=false,ae.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",s),window.addEventListener("mouseup",q),window.addEventListener("touchmove",M,{passive:false}),window.addEventListener("touchend",q),()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",q),window.removeEventListener("touchmove",M),window.removeEventListener("touchend",q);}},[]);let ke=Pr.useCallback((s,M)=>{u||(M.preventDefault(),M.stopPropagation(),I.current=true,ae.current=s,ve.current={x:M.clientX,y:M.clientY,w:ee.width,h:ee.height,px:E.x,py:E.y},document.body.style.cursor=s==="e"||s==="w"?"ew-resize":s==="n"||s==="s"?"ns-resize":s==="nw"||s==="se"?"nwse-resize":"nesw-resize",document.body.style.userSelect="none");},[u,ee,E]),Ee=Pr.useCallback((s,M)=>{if(u)return;M.preventDefault(),M.stopPropagation(),I.current=true;let q=M.touches[0];ae.current=s,ve.current={x:q.clientX,y:q.clientY,w:ee.width,h:ee.height,px:E.x,py:E.y},document.body.style.userSelect="none";},[u,ee,E]);Pr.useEffect(()=>{let s=(se,Ae)=>{let Qe=ae.current;if(!Qe)return;let ur=se-ve.current.x,mr=Ae-ve.current.y,{w:nt,h:at,px:Ft,py:Ht}=ve.current;if(Qe.includes("e")&&(nt=Math.max(F.width,nt+ur)),Qe.includes("w")){let ht=Math.max(F.width,nt-ur);Ft=Ft+(nt-ht),nt=ht;}if(Qe.includes("s")&&(at=Math.max(F.height,at+mr)),Qe.includes("n")){let ht=Math.max(F.height,at-mr);Ht=Ht+(at-ht),at=ht;}B({width:nt,height:at}),J({x:Ft,y:Ht});},M=se=>{ae.current&&s(se.clientX,se.clientY);},q=se=>{ae.current&&(se.preventDefault(),s(se.touches[0].clientX,se.touches[0].clientY));},Q=()=>{ae.current=false,document.body.style.cursor="",document.body.style.userSelect="";};return window.addEventListener("mousemove",M),window.addEventListener("mouseup",Q),window.addEventListener("touchmove",q,{passive:false}),window.addEventListener("touchend",Q),()=>{window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",Q),window.removeEventListener("touchmove",q),window.removeEventListener("touchend",Q);}},[F]);let g=Pr.useCallback(()=>{u?(ne&&(J(ne.pos),B(ne.size)),V(false)):(we({pos:E,size:ee}),V(true));},[u,E,ee,ne]),z=Pr.useCallback(()=>{W?ie(false):(u&&(V(false),ne&&(J(ne.pos),B(ne.size))),ie(true),P?.());},[W,u,ne,P]);Pr.useEffect(()=>{if(!me||W)return;let s=M=>{if(!(!Ye.current?.contains(document.activeElement)&&document.activeElement!==Ye.current)){if(M.key==="Escape"&&(A(null),C(new Set)),M.ctrlKey&&M.key==="a"){M.preventDefault();let q=new Set(de.map((Q,se)=>se));C(q);}M.key==="Delete"&&x.size>0&&i&&(M.preventDefault(),he(true));}};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[me,W,de,x,i]);let re={"--fe-accent":r};if(W)return jsxRuntime.jsx("div",{className:c("fixed z-100 cursor-pointer transition-all duration-300",f==="right"?"right-0 top-1/2 -translate-y-1/2":"left-0 top-1/2 -translate-y-1/2"),style:re,onClick:()=>ie(false),title:`Restore ${t}`,children:jsxRuntime.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:[jsxRuntime.jsx(lucideReact.HardDrive,{className:"h-3.5 w-3.5 text-(--fe-accent)"}),jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-(--fe-text)",children:t})]})});if(!me)return null;let h=u?ce.w:Math.min(ee.width,ce.w-8),K=u?ce.h:Math.min(ee.height,ce.h-8),pe=u?0:mt(E.x,0,Math.max(0,ce.w-h)),_e=u?0:mt(E.y,0,Math.max(0,ce.h-40)),Ot=h<500;return jsxRuntime.jsxs("div",{ref:Ye,className:c("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]",u&&"rounded-none",H),style:{...re,left:pe,top:_e,width:h,height:K,transition:u?"left 0.3s, top 0.3s, width 0.3s, height 0.3s":void 0},tabIndex:0,children:[jsxRuntime.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:rt,onTouchStart:bt,onDoubleClick:g,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.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:jsxRuntime.jsx(lucideReact.HardDrive,{className:"h-3 w-3 text-(--fe-accent)"})}),jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-widest text-(--fe-text)",children:t}),jsxRuntime.jsx("div",{className:"ml-2 hidden h-px w-20 md:block",style:{background:"linear-gradient(90deg, var(--fe-accent), transparent)",opacity:.3}})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{className:"fe-btn mr-1",onClick:()=>le(s=>s==="list"?"grid":"list"),title:j==="list"?"Grid view":"List view",children:j==="list"?jsxRuntime.jsx(lucideReact.LayoutGrid,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.LayoutList,{className:"h-3.5 w-3.5"})}),n&&jsxRuntime.jsx("button",{className:"fe-btn",onClick:z,title:"Dock to edge",children:jsxRuntime.jsx(lucideReact.Minus,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn",onClick:g,title:u?"Restore":"Maximize",children:u?jsxRuntime.jsx(lucideReact.Minimize2,{className:"h-3.5 w-3.5"}):jsxRuntime.jsx(lucideReact.Maximize2,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn hover:bg-red-500/40! hover:text-red-300!",onClick:()=>{p?.(),ye(false);},title:"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]})]}),jsxRuntime.jsxs("div",{className:"fe-toolbar flex h-9 shrink-0 items-center gap-2 px-3",children:[jsxRuntime.jsx("button",{className:"fe-btn p-1",onClick:()=>b?.(".."),title:"Go up",children:jsxRuntime.jsx(lucideReact.FolderUp,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsx("button",{className:"fe-btn shrink-0 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider",style:U==="navigate"?{color:"var(--fe-accent)",background:"color-mix(in srgb, var(--fe-accent) 15%, transparent)"}:void 0,onClick:()=>ue(s=>s==="search"?"navigate":"search"),title:U==="search"?"Switch to path navigation":"Switch to file search",children:U==="search"?jsxRuntime.jsx(lucideReact.Search,{className:"h-3 w-3"}):jsxRuntime.jsx(lucideReact.CornerRightDown,{className:"h-3 w-3"})}),jsxRuntime.jsx("div",{className:"relative flex-1",children:jsxRuntime.jsx("input",{type:"text",value:G,onChange:s=>be(s.target.value),onKeyDown:s=>{s.key==="Enter"&&G.trim()&&U==="navigate"&&(w?w(G.trim()):b?.(G.trim()));},placeholder:U==="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)"})}),jsxRuntime.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:[de.length," item",de.length!==1?"s":"",x.size>0&&` \xB7 ${x.size} selected`]})]}),jsxRuntime.jsxs("div",{className:"relative flex flex-1 min-h-0",children:[jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden p-1.5",onClick:s=>{s.target===s.currentTarget&&(C(new Set),A(null));},children:de.length===0?jsxRuntime.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-(--fe-text-muted)",children:[jsxRuntime.jsx(lucideReact.Folder,{className:"mb-2 h-10 w-10"}),jsxRuntime.jsx("span",{className:"text-xs",children:"No files found"})]}):j==="list"?jsxRuntime.jsx("div",{className:"space-y-px",children:de.map((s,M)=>{let q=tr(s),Q=x.has(M),se=s.extension||Tt(s.name);return jsxRuntime.jsxs("div",{className:c("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",Q?"bg-(--fe-accent)/15 text-(--fe-text-strong)":"hover:bg-(--fe-surface-hover) hover:text-(--fe-text-strong)"),style:Q?{boxShadow:"inset 2px 0 0 var(--fe-accent)"}:void 0,onClick:Ae=>He(M,Ae),onDoubleClick:()=>tt(M),children:[jsxRuntime.jsx(q,{className:c("h-4 w-4 shrink-0",s.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"flex-1 truncate text-xs font-medium",children:s.name}),se&&s.type==="file"&&jsxRuntime.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:se}),s.size!=null&&jsxRuntime.jsx("span",{className:"shrink-0 font-mono text-[10px] text-(--fe-text-muted)",children:Ar(s.size)}),s.modifiedAt&&jsxRuntime.jsx("span",{className:"hidden shrink-0 font-mono text-[10px] text-(--fe-text-muted) lg:inline",children:er(s.modifiedAt)})]},s.path+M)})}):jsxRuntime.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(90px,1fr))] gap-1.5 p-1",children:de.map((s,M)=>{let q=tr(s),Q=x.has(M),se=s.extension||Tt(s.name);return jsxRuntime.jsxs("div",{className:c("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",Q?"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:Ae=>He(M,Ae),onDoubleClick:()=>tt(M),children:[jsxRuntime.jsx(q,{className:c("h-7 w-7",s.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"w-full truncate text-[10px] font-medium leading-tight",children:s.name}),se&&s.type==="file"&&jsxRuntime.jsx("span",{className:"font-mono text-[8px] uppercase text-(--fe-text-muted)",children:se})]},s.path+M)})})}),jsxRuntime.jsx("div",{className:c("overflow-hidden transition-[width,opacity] duration-300 ease-out",Ot?c("absolute right-0 top-0 bottom-0 z-10",$?"w-44 opacity-100":"w-0 opacity-0 pointer-events-none"):c("shrink-0",$?"w-56":"w-0")),children:$&&jsxRuntime.jsxs("div",{className:c("flex h-full flex-col p-4",Ot?"fe-panel-narrow w-44":"fe-panel w-56 border-l border-(--fe-border)"),children:[Ot&&jsxRuntime.jsx("button",{className:"fe-btn mb-2 self-end",onClick:()=>{A(null),C(new Set);},title:"Close panel",children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})}),jsxRuntime.jsxs("div",{className:"mb-3 flex flex-col items-center",children:[Pr__default.default.createElement(tr($),{className:c("h-10 w-10 mb-2",$.type==="directory"?"text-(--fe-accent)":"text-(--fe-text-muted)")}),jsxRuntime.jsx("span",{className:"w-full text-center text-xs font-semibold text-(--fe-text-strong) break-all leading-tight",children:$.name})]}),jsxRuntime.jsxs("div",{className:"space-y-2.5 text-[10px]",children:[jsxRuntime.jsx(pt,{label:"Type",value:$.type==="directory"?"Directory":$.mimeType||$.extension||Tt($.name)||"File"}),$.size!=null&&jsxRuntime.jsx(pt,{label:"Size",value:Ar($.size)}),jsxRuntime.jsx(pt,{label:"Path",value:$.path,mono:true}),$.extension&&jsxRuntime.jsx(pt,{label:"Extension",value:$.extension}),$.modifiedAt&&jsxRuntime.jsx(pt,{label:"Modified",value:er($.modifiedAt)}),$.createdAt&&jsxRuntime.jsx(pt,{label:"Created",value:er($.createdAt)})]}),jsxRuntime.jsxs("div",{className:"mt-auto flex flex-col gap-1.5",children:[$.type==="file"&&d&&jsxRuntime.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:()=>d($),children:[jsxRuntime.jsx(lucideReact.ArrowUp,{className:"h-3 w-3 rotate-45"}),"Open"]}),T?.map(s=>jsxRuntime.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:()=>s.onClick($),children:[s.icon&&Pr__default.default.createElement(s.icon,{className:"h-3 w-3"}),s.label]},s.key))]})]})})]}),jsxRuntime.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:[jsxRuntime.jsxs("span",{children:[de.length," items"]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[x.size>0&&jsxRuntime.jsxs("span",{className:"text-(--fe-accent)/70",children:[x.size," selected"]}),jsxRuntime.jsx("span",{className:"opacity-50",children:"Ctrl+Click multi-select \xB7 Esc clear"})]})]}),R&&!u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"absolute top-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:s=>ke("n",s),onTouchStart:s=>Ee("n",s)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-4 right-4 h-3 cursor-ns-resize",onMouseDown:s=>ke("s",s),onTouchStart:s=>Ee("s",s)}),jsxRuntime.jsx("div",{className:"absolute top-4 left-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:s=>ke("w",s),onTouchStart:s=>Ee("w",s)}),jsxRuntime.jsx("div",{className:"absolute top-4 right-0 bottom-4 w-3 cursor-ew-resize",onMouseDown:s=>ke("e",s),onTouchStart:s=>Ee("e",s)}),jsxRuntime.jsx("div",{className:"absolute top-0 left-0 h-6 w-6 cursor-nwse-resize",onMouseDown:s=>ke("nw",s),onTouchStart:s=>Ee("nw",s)}),jsxRuntime.jsx("div",{className:"absolute top-0 right-0 h-6 w-6 cursor-nesw-resize",onMouseDown:s=>ke("ne",s),onTouchStart:s=>Ee("ne",s)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-0 h-6 w-6 cursor-nesw-resize",onMouseDown:s=>ke("sw",s),onTouchStart:s=>Ee("sw",s)}),jsxRuntime.jsx("div",{className:"absolute bottom-0 right-0 h-6 w-6 cursor-nwse-resize",onMouseDown:s=>ke("se",s),onTouchStart:s=>Ee("se",s)})]}),jsxRuntime.jsx("style",{children:`
|
|
23
23
|
.fe-window {
|
|
24
24
|
background: var(--fe-bg);
|
|
25
25
|
box-shadow: var(--fe-shadow);
|
|
@@ -80,4 +80,4 @@
|
|
|
80
80
|
from { opacity: 0; transform: translateX(-4px); }
|
|
81
81
|
to { opacity: 1; transform: translateX(0); }
|
|
82
82
|
}
|
|
83
|
-
`}),jsxRuntime.jsx(cr,{open:pe,onOpenChange:He,children:jsxRuntime.jsxs(dr,{size:"sm",children:[jsxRuntime.jsxs(ur,{children:[jsxRuntime.jsxs(mr,{children:[jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"text-danger-500"}),"Confirm Deletion"]}),jsxRuntime.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."]})]}),jsxRuntime.jsxs(fr,{children:[jsxRuntime.jsx(Ft,{intent:"ghost",onClick:()=>He(false),children:"Cancel"}),jsxRuntime.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:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4"}),"Delete"]})]})]})})]})}function lt({label:e,value:t,mono:n}){return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"mb-0.5 font-semibold uppercase tracking-wider text-(--fe-text-muted)",children:e}),jsxRuntime.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=br.useRef(null),L=br.useRef([]),[w,l]=br.useState(()=>e??1),[m,P]=br.useState([]),[N,H]=br.useState(0),E=u?u.map((b,M)=>({key:b.key??M,node:b.content})):br__default.default.Children.toArray(v).map((b,M)=>({key:b.key??M,node:b})),z=E.length,V=br.useCallback(b=>e??Math.max(1,Math.floor((b+n)/(t+n))),[e,t,n]),O=br.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]);br.useEffect(()=>{let b=h.current;if(!b)return;let M=new ResizeObserver(()=>O());return M.observe(b),()=>M.disconnect()},[O]),br.useEffect(()=>{let b=requestAnimationFrame(O);return ()=>cancelAnimationFrame(b)},[O]),br.useEffect(()=>{let b=new ResizeObserver(()=>O());return L.current.forEach(M=>{M&&b.observe(M);}),()=>b.disconnect()},[z,w,O]);let $=br.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 jsxRuntime.jsx("div",{ref:h,className:o("relative",c),style:{...d,height:N},...y,children:E.map((b,M)=>jsxRuntime.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)&&jsxRuntime.jsxs("div",{className:"masonry-item-overlay",children:[u[M].title&&jsxRuntime.jsx("p",{className:"masonry-item-overlay-title",children:u[M].title}),u[M].description&&jsxRuntime.jsx("p",{className:"masonry-item-overlay-desc",children:u[M].description}),u[M].actions&&jsxRuntime.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]=br.useState(t==="instant"?e:""),[m,P]=br.useState(false),[N,H]=br.useState(t==="instant"),[E,z]=br.useState(false),V=br.useRef(0),O=br.useRef(y);O.current=y;let $=br.useRef(e);$.current=e,br.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]),br.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]),br.useEffect(()=>{t==="instant"&&(l(e),P(false),H(true));},[e,t]);let me=br.useRef(d);br.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 jsxRuntime.jsxs(h,{className:o(L),children:[c&&!w&&jsxRuntime.jsx("span",{"aria-hidden":"true",children:"\u200B"}),w,b&&jsxRuntime.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]=br.useState(""),[d,v]=br.useState(0);br.useEffect(()=>{t&&(c(""),v(0));},[t]);let y=br.useMemo(()=>e.filter(l=>!l.disabled&&fa(l,f)),[e,f]),h=br.useMemo(()=>ga(y),[y]);br.useEffect(()=>{v(l=>Math.min(l,Math.max(0,y.length-1)));},[y.length]);let L=br.useCallback(()=>{let l=y[d];l&&(l.onSelect(),n(false));},[y,d,n]),w=br.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 br.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=br.useRef(null),y=br.useRef(null),{query:h,setQuery:L,groups:w,filtered:l,activeIndex:m,setActiveIndex:P,handleKeyDown:N}=Lr(n,e,t,f);if(br.useEffect(()=>{if(e){let E=setTimeout(()=>v.current?.focus(),40);return ()=>clearTimeout(E)}},[e]),br.useEffect(()=>{y.current?.querySelector("[data-active='true']")?.scrollIntoView({block:"nearest"});},[m]),!e)return null;let H=0;return reactDom.createPortal(jsxRuntime.jsx("div",{className:"cmd-backdrop fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",onClick:()=>t(false),role:"presentation",children:jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 border-b border-primary-100 px-4 dark:border-primary-700",children:[jsxRuntime.jsx(lucideReact.Search,{className:"h-4 w-4 shrink-0 text-secondary-400","aria-hidden":"true"}),jsxRuntime.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"}),jsxRuntime.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"})]}),jsxRuntime.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?jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 text-sm text-secondary-400",children:[jsxRuntime.jsx(lucideReact.Command,{className:"h-8 w-8 opacity-30"}),jsxRuntime.jsx("span",{children:"No commands found"})]}):w.map(E=>jsxRuntime.jsxs("div",{className:"mb-1 last:mb-0",children:[E.label&&jsxRuntime.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 jsxRuntime.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&&jsxRuntime.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}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:"block truncate font-medium",children:z.label}),z.description&&jsxRuntime.jsx("span",{className:"block truncate text-xs text-secondary-400 dark:text-secondary-500",children:z.description})]}),z.shortcut&&jsxRuntime.jsx("span",{className:"flex shrink-0 items-center gap-0.5",children:z.shortcut.map(($,me)=>jsxRuntime.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&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-t border-primary-100 px-4 py-2 dark:border-primary-700",children:[jsxRuntime.jsxs("span",{className:"text-xs text-secondary-400",children:[l.length," result",l.length!==1?"s":""]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-3 text-xs text-secondary-400",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u2191"}),jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u2193"}),"Navigate"]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.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?jsxRuntime.jsx(jsxRuntime.Fragment,{children:t}):e==="complete"?jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3"}):e==="error"?jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-3 w-3"}):e==="active"?jsxRuntime.jsx(lucideReact.Dot,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.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)=>jsxRuntime.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:o("relative block overflow-hidden",v),onClick:y=>y.stopPropagation(),children:[jsxRuntime.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&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/60",children:jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-white",children:["+",u]})})]},d);return n.length===0?null:n.length===1?jsxRuntime.jsx("div",{className:"mt-2.5 h-36 overflow-hidden rounded-xl",children:f(n[0],0,"h-full")}):n.length===2?jsxRuntime.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?jsxRuntime.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)]}):jsxRuntime.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?jsxRuntime.jsxs("a",{href:d.href,target:"_blank",rel:"noopener noreferrer",className:y,onClick:h=>h.stopPropagation(),children:[d.icon,d.label]},v):jsxRuntime.jsxs("button",{type:"button",onClick:d.onClick,className:y,children:[d.icon,d.label]},v);return jsxRuntime.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&&jsxRuntime.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 jsxRuntime.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&&jsxRuntime.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&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.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}),jsxRuntime.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})]}),jsxRuntime.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?jsxRuntime.jsxs("div",{className:"flex min-h-[8rem]",children:[jsxRuntime.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:jsxRuntime.jsx("img",{src:e.image,alt:e.title,className:"h-full w-full object-cover transition-transform duration-500 hover:scale-105"})}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[e.date&&jsxRuntime.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}),jsxRuntime.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&&jsxRuntime.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&&jsxRuntime.jsx(Hr,{images:e.images,title:e.title}),e.actions&&e.actions.length>0&&jsxRuntime.jsx(Vr,{actions:e.actions})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.image&&jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.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&&jsxRuntime.jsx("div",{className:"flex items-center justify-center bg-primary-50/60 p-4 dark:bg-primary-800/40",children:e.svg}),jsxRuntime.jsxs("div",{className:o("p-4",(e.image||e.svg)&&"pt-3"),children:[e.date&&jsxRuntime.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}),jsxRuntime.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&&jsxRuntime.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&&jsxRuntime.jsx(Hr,{images:e.images,title:e.title}),e.actions&&e.actions.length>0&&jsxRuntime.jsx(Vr,{actions:e.actions})]})]})})]})}function qt({items:e,orientation:t="vertical",activeIndex:n,animated:u=true,lineStyle:f="solid",className:c}){let d=br.useRef(null),v=br.useRef([]),[y,h]=br.useState(new Set);br.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]),br.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"?jsxRuntime.jsxs("div",{ref:d,className:o("relative",c),children:[jsxRuntime.jsx("div",{className:"absolute left-5 top-0 h-full w-px bg-primary-200 dark:bg-primary-700"}),jsxRuntime.jsx("div",{className:"space-y-6",children:e.map((w,l)=>{let m=w.status??"pending",P=l===n;return jsxRuntime.jsxs("div",{ref:N=>{v.current[l]=N;},"data-idx":l,className:"relative flex gap-4",children:[jsxRuntime.jsx("div",{className:"relative z-10 flex shrink-0 flex-col items-center",children:jsxRuntime.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:jsxRuntime.jsx(Fr,{status:m,icon:w.icon})})}),jsxRuntime.jsx(Or,{item:w,isActive:P,animated:u,visible:y.has(l),orientation:"vertical"})]},w.id??l)})})]}):jsxRuntime.jsx("div",{ref:d,className:o("relative overflow-x-auto pb-4",c),children:jsxRuntime.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 jsxRuntime.jsxs("div",{ref:H=>{v.current[l]=H;},"data-idx":l,className:"relative flex flex-col items-center gap-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.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:jsxRuntime.jsx(Fr,{status:m,icon:w.icon})}),!N&&jsxRuntime.jsx("div",{className:o("h-px w-28 border-t-2",L,m==="complete"?"border-success-400":"border-primary-200 dark:border-primary-700")})]}),jsxRuntime.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;exports.CinePlayer=zt;exports.CommandPalette=Nt;exports.Extras=Ca;exports.FileExplorer=Bt;exports.FilmReel=Pt;exports.Masonry=Yt;exports.MiniPlayer=Rt;exports.Timeline=qt;exports.TypewriterText=wt;exports.default=Ss;
|
|
83
|
+
`}),jsxRuntime.jsx(Nr,{open:X,onOpenChange:he,children:jsxRuntime.jsxs(Cr,{size:"sm",children:[jsxRuntime.jsxs(Mr,{children:[jsxRuntime.jsxs(Dr,{children:[jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"text-danger-500"}),"Confirm Deletion"]}),jsxRuntime.jsxs(Tr,{children:[x.size===1?`Are you sure you want to delete "${de[Array.from(x)[0]]?.name}"?`:`Are you sure you want to delete ${x.size} selected items?`," ","This action cannot be undone."]})]}),jsxRuntime.jsxs(Sr,{children:[jsxRuntime.jsx(qt,{intent:"ghost",onClick:()=>he(false),children:"Cancel"}),jsxRuntime.jsxs(qt,{intent:"danger",onClick:()=>{let s=Array.from(x).map(M=>de[M]).filter(Boolean);i?.(s),C(new Set),A(null),he(false);},children:[jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4"}),"Delete"]})]})]})})]})}function pt({label:e,value:t,mono:r}){return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"mb-0.5 font-semibold uppercase tracking-wider text-(--fe-text-muted)",children:e}),jsxRuntime.jsx("div",{className:c("text-(--fe-text) break-all leading-snug",r&&"font-mono text-[9px]"),children:t})]})}function ja(e,t){let r=t.getBoundingClientRect(),a=Math.max(r.width,r.height)*1.2,l=e.clientX-r.left,o=e.clientY-r.top,n=document.createElement("span");n.className="masonry-ripple",n.style.width=`${a}px`,n.style.height=`${a}px`,n.style.left=`${l}px`,n.style.top=`${o}px`,t.appendChild(n),n.addEventListener("animationend",()=>n.remove());}function sr({columns:e,columnWidth:t=240,gap:r=16,items:a,onItemClick:l,className:o,style:n,children:f,...m}){let d=Pr.useRef(null),v=Pr.useRef([]),[b,i]=Pr.useState(()=>e??1),[p,P]=Pr.useState([]),[w,L]=Pr.useState(0),T=a?a.map((x,C)=>({key:x.key??C,node:x.content})):Pr__default.default.Children.toArray(f).map((x,C)=>({key:x.key??C,node:x})),R=T.length,F=Pr.useCallback(x=>e??Math.max(1,Math.floor((x+r)/(t+r))),[e,t,r]),H=Pr.useCallback(()=>{let x=d.current;if(!x)return;let C=x.clientWidth,S=F(C);i(S);let A=(C-(S-1)*r)/S,u=new Array(S).fill(0),V=[];for(let ie=0;ie<R;ie++){let G=v.current[ie],be=G?G.offsetHeight:0,U=0;for(let ue=1;ue<S;ue++)u[ue]<u[U]&&(U=ue);V.push({top:u[U],left:U*(A+r),width:A}),u[U]+=be+r;}let W=Math.max(0,...u)-(R?r:0);P(V),L(W);},[R,F,r]);Pr.useEffect(()=>{let x=d.current;if(!x)return;let C=new ResizeObserver(()=>H());return C.observe(x),()=>C.disconnect()},[H]),Pr.useEffect(()=>{let x=requestAnimationFrame(H);return ()=>cancelAnimationFrame(x)},[H]),Pr.useEffect(()=>{let x=new ResizeObserver(()=>H());return v.current.forEach(C=>{C&&x.observe(C);}),()=>x.disconnect()},[R,b,H]);let j=Pr.useCallback((x,C)=>{let S=x.currentTarget;ja(x,S),l?.(a?.[C],C);},[l,a]),le=x=>{if(!a)return false;let C=a[x];return !!(C.title||C.description||C.actions)};return jsxRuntime.jsx("div",{ref:d,className:c("relative",o),style:{...n,height:w},...m,children:T.map((x,C)=>jsxRuntime.jsxs("div",{ref:S=>{v.current[C]=S;},className:"masonry-item",role:"button",tabIndex:0,onClick:S=>j(S,C),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),l?.(a?.[C],C));},style:{position:"absolute",top:p[C]?.top??0,left:p[C]?.left??0,width:p[C]?.width??"100%"},children:[x.node,le(C)&&jsxRuntime.jsxs("div",{className:"masonry-item-overlay",children:[a[C].title&&jsxRuntime.jsx("p",{className:"masonry-item-overlay-title",children:a[C].title}),a[C].description&&jsxRuntime.jsx("p",{className:"masonry-item-overlay-desc",children:a[C].description}),a[C].actions&&jsxRuntime.jsx("div",{className:"masonry-item-overlay-actions",children:a[C].actions})]})]},x.key))})}function Lt({text:e="",mode:t="typewriter",speed:r=40,cursor:a=true,cursorChar:l="\u258B",thinking:o=false,streaming:n=false,delay:f=0,onComplete:m,as:d="span",className:v}){let[b,i]=Pr.useState(t==="instant"?e:""),[p,P]=Pr.useState(false),[w,L]=Pr.useState(t==="instant"),[T,R]=Pr.useState(false),F=Pr.useRef(0),H=Pr.useRef(m);H.current=m;let j=Pr.useRef(e);j.current=e,Pr.useEffect(()=>{if(t!=="typewriter")return;if(i(""),L(false),R(false),P(false),!e){L(true);return}let A=Math.max(10,1e3/r),u=0,V,W=()=>{P(true),V=setInterval(()=>{let G=j.current;u++,i(G.slice(0,u)),u>=G.length&&(clearInterval(V),P(false),L(true),H.current?.());},A);},ie;return f>0?ie=setTimeout(W,f):W(),()=>{clearTimeout(ie),clearInterval(V);}},[e,t]),Pr.useEffect(()=>{if(t!=="stream")return;if(e.length===0){F.current=0,i(""),P(false),L(false),R(false);return}if(e.length<=F.current)return;let A=Math.max(10,1e3/r),u=F.current;P(true),L(false),R(false);let V=setInterval(()=>{u++,F.current=u,i(j.current.slice(0,u)),u>=j.current.length&&(clearInterval(V),P(false),H.current?.());},A);return ()=>clearInterval(V)},[e,t]),Pr.useEffect(()=>{t==="instant"&&(i(e),P(false),L(true));},[e,t]);let le=Pr.useRef(n);Pr.useEffect(()=>{let A=le.current;if(le.current=n,A&&!n&&!p&&t==="stream"){R(true);let u=setTimeout(()=>{R(false),L(true);},650);return ()=>clearTimeout(u)}},[n,p,t]);let x=a&&(o||p||T||t==="stream"&&n&&!w||t==="typewriter"&&!w),C=o?"tw-cursor--blink":p?"tw-cursor--solid":T?"tw-cursor--out":"tw-cursor--blink";return jsxRuntime.jsxs(d,{className:c(v),children:[o&&!b&&jsxRuntime.jsx("span",{"aria-hidden":"true",children:"\u200B"}),b,x&&jsxRuntime.jsx("span",{className:c("tw-cursor",C),"aria-hidden":"true",children:l})]})}function zt(e){return e.toLowerCase().replace(/\s+/g," ").trim()}function Ba(e,t){if(!t)return true;let r=zt(t);return zt(e.label).includes(r)||(e.description?zt(e.description).includes(r):false)||(e.keywords?e.keywords.some(a=>zt(a).includes(r)):false)}function Ua(e){let t=new Map;for(let r of e){let a=r.group??"";t.has(a)||t.set(a,[]),t.get(a).push(r);}return Array.from(t.entries()).map(([r,a])=>({label:r,items:a}))}function Br(e,t,r,a){let[l,o]=Pr.useState(""),[n,f]=Pr.useState(0);Pr.useEffect(()=>{t&&(o(""),f(0));},[t]);let m=Pr.useMemo(()=>e.filter(i=>!i.disabled&&Ba(i,l)),[e,l]),d=Pr.useMemo(()=>Ua(m),[m]);Pr.useEffect(()=>{f(i=>Math.min(i,Math.max(0,m.length-1)));},[m.length]);let v=Pr.useCallback(()=>{let i=m[n];i&&(i.onSelect(),r(false));},[m,n,r]),b=Pr.useCallback(i=>{switch(i.key){case "ArrowDown":i.preventDefault(),f(p=>(p+1)%Math.max(1,m.length));break;case "ArrowUp":i.preventDefault(),f(p=>(p-1+Math.max(1,m.length))%Math.max(1,m.length));break;case "Enter":i.preventDefault(),v();break;case "Escape":i.preventDefault(),r(false);break}},[m.length,v,r]);return Pr.useEffect(()=>{if(!a)return;function i(p){(p.metaKey||p.ctrlKey)&&p.key==="k"&&(p.preventDefault(),r(!t));}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[a,t,r]),{query:l,setQuery:o,groups:d,filtered:m,activeIndex:n,setActiveIndex:f,handleKeyDown:b}}function At({open:e,onOpenChange:t,commands:r,placeholder:a="Type a command or search\u2026",hotkey:l=true,maxItems:o=8,className:n}){let f=Pr.useRef(null),m=Pr.useRef(null),{query:d,setQuery:v,groups:b,filtered:i,activeIndex:p,setActiveIndex:P,handleKeyDown:w}=Br(r,e,t,l);if(Pr.useEffect(()=>{if(e){let T=setTimeout(()=>f.current?.focus(),40);return ()=>clearTimeout(T)}},[e]),Pr.useEffect(()=>{m.current?.querySelector("[data-active='true']")?.scrollIntoView({block:"nearest"});},[p]),!e)return null;let L=0;return reactDom.createPortal(jsxRuntime.jsx("div",{className:"cmd-backdrop fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",onClick:()=>t(false),role:"presentation",children:jsxRuntime.jsxs("div",{className:c("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",n),onClick:T=>T.stopPropagation(),onKeyDown:w,role:"dialog","aria-label":"Command palette","aria-modal":"true",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 border-b border-primary-100 px-4 dark:border-primary-700",children:[jsxRuntime.jsx(lucideReact.Search,{className:"h-4 w-4 shrink-0 text-secondary-400","aria-hidden":"true"}),jsxRuntime.jsx("input",{ref:f,value:d,onChange:T=>v(T.target.value),placeholder:a,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":i[p]?`cmd-item-${i[p].id}`:void 0,spellCheck:false,autoComplete:"off"}),jsxRuntime.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"})]}),jsxRuntime.jsx("div",{id:"cmd-results",ref:m,className:"overflow-y-auto py-2",style:{maxHeight:`${o*2.75}rem`},role:"listbox","aria-label":"Commands",children:i.length===0?jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2 py-8 text-sm text-secondary-400",children:[jsxRuntime.jsx(lucideReact.Command,{className:"h-8 w-8 opacity-30"}),jsxRuntime.jsx("span",{children:"No commands found"})]}):b.map(T=>jsxRuntime.jsxs("div",{className:"mb-1 last:mb-0",children:[T.label&&jsxRuntime.jsx("p",{className:"px-4 pb-1 pt-2 text-xs font-semibold uppercase tracking-wide text-secondary-400 dark:text-secondary-500",children:T.label}),T.items.map(R=>{let F=L++,H=F===p;return jsxRuntime.jsxs("button",{id:`cmd-item-${R.id}`,"data-active":H,role:"option","aria-selected":H,className:c("cmd-item group flex w-full items-center gap-3 px-4 py-2.5 text-left text-sm",H?"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(F),onClick:()=>{R.onSelect(),t(false);},children:[R.icon&&jsxRuntime.jsx("span",{className:c("flex h-7 w-7 shrink-0 items-center justify-center rounded-md border text-xs",H?"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:R.icon}),jsxRuntime.jsxs("span",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("span",{className:"block truncate font-medium",children:R.label}),R.description&&jsxRuntime.jsx("span",{className:"block truncate text-xs text-secondary-400 dark:text-secondary-500",children:R.description})]}),R.shortcut&&jsxRuntime.jsx("span",{className:"flex shrink-0 items-center gap-0.5",children:R.shortcut.map((j,le)=>jsxRuntime.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:j},le))})]},R.id)})]},T.label||"_default"))}),i.length>0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-t border-primary-100 px-4 py-2 dark:border-primary-700",children:[jsxRuntime.jsxs("span",{className:"text-xs text-secondary-400",children:[i.length," result",i.length!==1?"s":""]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-3 text-xs text-secondary-400",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u2191"}),jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u2193"}),"Navigate"]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"rounded border border-primary-200 px-1 dark:border-primary-700",children:"\u21B5"}),"Select"]})]})]})]})}),document.body)}var Gr={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"},qr={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 Qr({status:e,icon:t}){return t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:t}):e==="complete"?jsxRuntime.jsx(lucideReact.Check,{className:"h-3 w-3"}):e==="error"?jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-3 w-3"}):e==="active"?jsxRuntime.jsx(lucideReact.Dot,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.Clock,{className:"h-3 w-3"})}function Zr({images:e,title:t}){let r=e.slice(0,4),a=e.length>4?e.length-4:0,l=(o,n,f)=>jsxRuntime.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:c("relative block overflow-hidden",f),onClick:m=>m.stopPropagation(),children:[jsxRuntime.jsx("img",{src:o,alt:`${t} ${n+1}`,className:"h-full w-full object-cover transition-transform duration-300 hover:scale-105"}),n===r.length-1&&a>0&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/60",children:jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-white",children:["+",a]})})]},n);return r.length===0?null:r.length===1?jsxRuntime.jsx("div",{className:"mt-2.5 h-36 overflow-hidden rounded-xl",children:l(r[0],0,"h-full")}):r.length===2?jsxRuntime.jsx("div",{className:"mt-2.5 grid h-28 grid-cols-2 gap-0.5 overflow-hidden rounded-xl",children:r.map((o,n)=>l(o,n))}):r.length===3?jsxRuntime.jsxs("div",{className:"mt-2.5 grid h-36 grid-cols-2 grid-rows-2 gap-0.5 overflow-hidden rounded-xl",children:[l(r[0],0,"row-span-2"),l(r[1],1),l(r[2],2)]}):jsxRuntime.jsx("div",{className:"mt-2.5 grid h-44 grid-cols-2 grid-rows-2 gap-0.5 overflow-hidden rounded-xl",children:r.map((o,n)=>l(o,n))})}function Jr({actions:e}){let t=e.filter(n=>n.variant!=="primary"),r=e.filter(n=>n.variant==="primary"),a="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",l="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",o=(n,f,m)=>n.href?jsxRuntime.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:m,onClick:d=>d.stopPropagation(),children:[n.icon,n.label]},f):jsxRuntime.jsxs("button",{type:"button",onClick:n.onClick,className:m,children:[n.icon,n.label]},f);return jsxRuntime.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((n,f)=>o(n,f,a)),r.length>0&&jsxRuntime.jsx("span",{className:"flex-1"}),r.map((n,f)=>o(n,f,l))]})}function en({item:e,isActive:t,animated:r,visible:a,orientation:l}){let o=e.status??"pending",n={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"}[o],f={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"}[o],m=t?"shadow-lg shadow-primary-300/30 dark:shadow-primary-500/20":o==="complete"?"shadow-md shadow-success-300/20 dark:shadow-success-400/10":o==="error"?"shadow-md shadow-danger-300/20 dark:shadow-danger-400/10":"shadow-sm shadow-primary-100/50 dark:shadow-black/20",d=o==="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%)":o==="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,v={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"}[o];return jsxRuntime.jsxs("div",{className:c("relative isolate",r&&"transition-all duration-700",r?a?"opacity-100 translate-y-0":l==="vertical"?"opacity-0 translate-y-6":"opacity-0 translate-x-6":"",l==="horizontal"?"w-56 shrink-0":"flex-1",e.className),children:[!t&&d&&jsxRuntime.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:d,filter:"blur(14px)",opacity:.22},"aria-hidden":true}),t&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.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}),jsxRuntime.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})]}),jsxRuntime.jsx("div",{className:c("relative overflow-hidden rounded-2xl border backdrop-blur-[2px]",t?"border-transparent":c("border",f),n,m),children:e.imagePosition==="left"&&e.image?jsxRuntime.jsxs("div",{className:"flex min-h-[8rem]",children:[jsxRuntime.jsx("a",{href:e.image,target:"_blank",rel:"noopener noreferrer",className:"w-28 shrink-0 overflow-hidden",onClick:i=>i.stopPropagation(),"aria-label":e.title,children:jsxRuntime.jsx("img",{src:e.image,alt:e.title,className:"h-full w-full object-cover transition-transform duration-500 hover:scale-105"})}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[e.date&&jsxRuntime.jsx("span",{className:c("mb-2 inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[0.65rem] font-semibold tracking-wide",v),children:e.date}),jsxRuntime.jsx("h3",{className:c("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&&jsxRuntime.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&&jsxRuntime.jsx(Zr,{images:e.images,title:e.title}),e.actions&&e.actions.length>0&&jsxRuntime.jsx(Jr,{actions:e.actions})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.image&&jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.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&&jsxRuntime.jsx("div",{className:"flex items-center justify-center bg-primary-50/60 p-4 dark:bg-primary-800/40",children:e.svg}),jsxRuntime.jsxs("div",{className:c("p-4",(e.image||e.svg)&&"pt-3"),children:[e.date&&jsxRuntime.jsx("span",{className:c("mb-2.5 inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[0.65rem] font-semibold tracking-wide",v),children:e.date}),jsxRuntime.jsx("h3",{className:c("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&&jsxRuntime.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&&jsxRuntime.jsx(Zr,{images:e.images,title:e.title}),e.actions&&e.actions.length>0&&jsxRuntime.jsx(Jr,{actions:e.actions})]})]})})]})}function cr({items:e,orientation:t="vertical",activeIndex:r,animated:a=true,lineStyle:l="solid",className:o}){let n=Pr.useRef(null),f=Pr.useRef([]),[m,d]=Pr.useState(new Set);Pr.useEffect(()=>{if(!a){d(new Set(e.map((i,p)=>p)));return}let b=new IntersectionObserver(i=>{d(p=>{let P=new Set(p);return i.forEach(w=>{let L=Number(w.target.dataset.idx);w.isIntersecting&&P.add(L);}),P});},{threshold:.15});return f.current.forEach(i=>i&&b.observe(i)),()=>b.disconnect()},[e,a]),Pr.useEffect(()=>{if(r==null)return;let b=f.current[r];b&&b.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});},[r]);let v=l==="dashed"?"border-dashed":"";return t==="vertical"?jsxRuntime.jsxs("div",{ref:n,className:c("relative",o),children:[jsxRuntime.jsx("div",{className:"absolute left-5 top-0 h-full w-px bg-primary-200 dark:bg-primary-700"}),jsxRuntime.jsx("div",{className:"space-y-6",children:e.map((b,i)=>{let p=b.status??"pending",P=i===r;return jsxRuntime.jsxs("div",{ref:w=>{f.current[i]=w;},"data-idx":i,className:"relative flex gap-4",children:[jsxRuntime.jsx("div",{className:"relative z-10 flex shrink-0 flex-col items-center",children:jsxRuntime.jsx("div",{className:c("flex h-10 w-10 items-center justify-center rounded-full border-2 transition-all duration-300 [&_svg]:shrink-0",Gr[p],P&&qr[p]),children:jsxRuntime.jsx(Qr,{status:p,icon:b.icon})})}),jsxRuntime.jsx(en,{item:b,isActive:P,animated:a,visible:m.has(i),orientation:"vertical"})]},b.id??i)})})]}):jsxRuntime.jsx("div",{ref:n,className:c("relative overflow-x-auto pb-4",o),children:jsxRuntime.jsx("div",{className:"flex min-w-max gap-6 px-4",children:e.map((b,i)=>{let p=b.status??"pending",P=i===r,w=i===e.length-1;return jsxRuntime.jsxs("div",{ref:L=>{f.current[i]=L;},"data-idx":i,className:"relative flex flex-col items-center gap-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:c("flex h-10 w-10 items-center justify-center rounded-full border-2 transition-all duration-300 z-10 [&_svg]:shrink-0",Gr[p],P&&qr[p]),children:jsxRuntime.jsx(Qr,{status:p,icon:b.icon})}),!w&&jsxRuntime.jsx("div",{className:c("h-px w-28 border-t-2",v,p==="complete"?"border-success-400":"border-primary-200 dark:border-primary-700")})]}),jsxRuntime.jsx(en,{item:b,isActive:P,animated:a,visible:m.has(i),orientation:"horizontal"})]},b.id??i)})})})}function xt(e="en-US",t="long"){return Array.from({length:12},(r,a)=>new Intl.DateTimeFormat(e,{month:t}).format(new Date(2e3,a,1)))}function tn(e="en-US",t="narrow"){let r=new Date(2e3,0,2);return Array.from({length:7},(a,l)=>{let o=new Date(r);return o.setDate(r.getDate()+l),new Intl.DateTimeFormat(e,{weekday:t}).format(o)})}function rn(e,t=true,r=true){return e==="date"?"YYYY-MM-DD":e==="time"?t?r?"HH:mm:ss":"HH:mm":r?"hh:mm:ss A":"hh:mm A":t?r?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD HH:mm":r?"YYYY-MM-DD hh:mm:ss A":"YYYY-MM-DD hh:mm A"}function eo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nn(e,t,r="en-US"){let a=e.getHours(),l=xt(r,"long"),o=xt(r,"short"),n={YYYY:String(e.getFullYear()),YY:String(e.getFullYear()).slice(-2),MMMM:l[e.getMonth()],MMM:o[e.getMonth()],MM:String(e.getMonth()+1).padStart(2,"0"),M:String(e.getMonth()+1),DD:String(e.getDate()).padStart(2,"0"),D:String(e.getDate()),HH:String(a).padStart(2,"0"),H:String(a),hh:String(a%12||12).padStart(2,"0"),h:String(a%12||12),mm:String(e.getMinutes()).padStart(2,"0"),ss:String(e.getSeconds()).padStart(2,"0"),A:a<12?"AM":"PM",a:a<12?"am":"pm"},f=Object.keys(n).sort((d,v)=>v.length-d.length),m=new RegExp(f.map(eo).join("|"),"g");return t.replace(m,d=>n[d]??d)}function ft(e,t){return new Date(e,t+1,0).getDate()}function an(e,t){let r=new Date(e,t,1).getDay(),a=ft(e,t),l=ft(e,t-1),o=[];for(let f=r-1;f>=0;f--)o.push({date:new Date(e,t-1,l-f),thisMonth:false});for(let f=1;f<=a;f++)o.push({date:new Date(e,t,f),thisMonth:true});let n=42-o.length;for(let f=1;f<=n;f++)o.push({date:new Date(e,t+1,f),thisMonth:false});return o}function gt(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function dr(e,t){return gt(e).getTime()===gt(t).getTime()}function on(e,t){return gt(e)<gt(t)}function sn(e,t){return gt(e)>gt(t)}function It(e,t,r){return t&&e<t?new Date(t):r&&e>r?new Date(r):e}function ln(e,t,r,a){let l=new Date(e),n=t*(a==="future"?1:-1);switch(r){case "day":l.setDate(l.getDate()+n);break;case "week":l.setDate(l.getDate()+n*7);break;case "month":l.setMonth(l.getMonth()+n);break;case "year":l.setFullYear(l.getFullYear()+n);break}return l}function cn(e,t=200){let r=e-Math.floor(t/2);return Array.from({length:t},(a,l)=>r+l)}function dn(e){let{value:t,defaultValue:r,onChange:a,mode:l="datetime",minDate:o,maxDate:n,use24Hour:f=true,showSeconds:m=true,locale:d="en-US",format:v,onOpen:b,onClose:i}=e,p=t!==void 0,[P,w]=Pr.useState(r??null),L=p?t??null:P,[T,R]=Pr.useState(false),[F,H]=Pr.useState(()=>L??new Date),[j,le]=Pr.useState("drum"),[x,C]=Pr.useState(()=>(L??new Date).getFullYear()),[S,A]=Pr.useState(()=>(L??new Date).getMonth()),[u,V]=Pr.useState(1),[W,ie]=Pr.useState("day"),[G,be]=Pr.useState("future"),U=v??rn(l,f,m),ue=L?nn(L,U,d):"",Pe=Pr.useCallback(()=>{let E=L??new Date;H(new Date(E)),C(E.getFullYear()),A(E.getMonth()),le("drum"),R(true),b?.();},[L,b]),ye=Pr.useCallback(()=>{R(false),i?.();},[i]),X=Pr.useCallback(()=>{let E=It(F,o,n);p||w(E),a?.(E),ye();},[F,o,n,p,a,ye]),he=Pr.useCallback(()=>{p||w(null),a?.(null),ye();},[p,a,ye]),ce=Pr.useCallback((E,J)=>{H(ee=>{let B=new Date(ee);switch(E){case "year":B.setFullYear(J);break;case "month":{B.setMonth(J);let ne=ft(B.getFullYear(),J);B.getDate()>ne&&B.setDate(ne);break}case "day":B.setDate(J);break;case "hour":B.setHours(J);break;case "minute":B.setMinutes(J);break;case "second":B.setSeconds(J);break}return It(B,o,n)});},[o,n]),Te=Pr.useCallback(()=>{let E=It(ln(new Date,u,W,G),o,n);H(E),C(E.getFullYear()),A(E.getMonth());},[u,W,G,o,n]),Re=Pr.useCallback(E=>{let J=S+E,ee=x;J<0&&(J=11,ee--),J>11&&(J=0,ee++),A(J),C(ee);},[S,x]);return {isOpen:T,displayValue:ue,workingDate:F,view:j,calYear:x,calMonth:S,offsetAmount:u,offsetUnit:W,offsetDirection:G,mode:l,use24Hour:f,showSeconds:m,locale:d,minDate:o,maxDate:n,openPicker:Pe,closePicker:ye,confirm:X,clear:he,updateField:ce,setView:le,setCalYear:C,setCalMonth:A,setOffsetAmount:V,setOffsetUnit:ie,setOffsetDirection:be,applyQuickOffset:Te,navigateCalendar:Re}}var wt=40;function pn(e,t,r=true){let a=Pr.useRef(t);a.current=t,Pr.useEffect(()=>{if(!r)return;function l(o){let n=o.target;e.some(m=>m.current?.contains(n))||a.current();}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[e,r]);}function fn(e,t,r){let a=Pr.useRef(false),l=Pr.useRef(void 0),o=Pr.useRef(r);o.current=r;let n=Pr.useRef(t);n.current=t;let f=Pr.useCallback((d,v="smooth")=>{let b=e.current;if(!b)return;let i=d*wt;Math.abs(b.scrollTop-i)<2&&v!=="instant"||(v==="instant"?b.scrollTop=i:b.scrollTo({top:i,behavior:v}));},[e]),m=Pr.useCallback(()=>{e.current&&(a.current=true,clearTimeout(l.current),l.current=setTimeout(()=>{a.current=false;let v=e.current;if(!v)return;let b=Math.round(v.scrollTop/wt),i=Math.max(0,Math.min(n.current-1,b)),p=i*wt;Math.abs(v.scrollTop-p)>1&&v.scrollTo({top:p,behavior:"smooth"}),o.current(i);},120));},[e]);return {scrollToIndex:f,handleScroll:m,isScrollingRef:a}}function gn(e,t,r){Pr.useEffect(()=>{if(!r)return;function a(){let o=e.current,n=t.current;if(!o||!n)return;if(window.innerWidth<=640){n.style.top="",n.style.left="";return}let f=o.getBoundingClientRect(),m=window.innerHeight,d=window.innerWidth,v=n.offsetHeight||460,b=n.offsetWidth||340,i=f.bottom+8,p=f.left;i+v>m-16&&(i=Math.max(16,f.top-v-8)),p+b>d-16&&(p=Math.max(16,d-b-16)),p<16&&(p=16),n.style.top=`${Math.round(i)}px`,n.style.left=`${Math.round(p)}px`;}let l=setTimeout(a,0);return window.addEventListener("resize",a),window.addEventListener("scroll",a,true),()=>{clearTimeout(l),window.removeEventListener("resize",a),window.removeEventListener("scroll",a,true);}},[r,e,t]);}function qe({items:e,selectedValue:t,onSelect:r,label:a}){let l=Pr.useRef(null),o=Pr.useRef(t),n=Pr.useRef(false),{scrollToIndex:f,handleScroll:m}=fn(l,e.length,d=>{let v=e[d];v&&(n.current=true,r(v.value),setTimeout(()=>{n.current=false;},200));});return Pr.useEffect(()=>{let d=l.current;if(!d)return;let v=e.findIndex(b=>b.value===t);v>=0&&(d.scrollTop=v*wt);},[]),Pr.useEffect(()=>{if(o.current!==t&&(o.current=t,!n.current)){let d=e.findIndex(v=>v.value===t);d>=0&&f(d,"smooth");}},[t,e,f]),jsxRuntime.jsxs("div",{className:"dtp-column",role:"group","aria-label":a,children:[jsxRuntime.jsx("div",{className:"dtp-column-highlight","aria-hidden":"true"}),jsxRuntime.jsx("div",{ref:l,className:"dtp-column-list",onScroll:m,role:"listbox","aria-label":a,children:e.map(d=>jsxRuntime.jsx("div",{className:c("dtp-item",d.value===t&&"dtp-item--selected"),onClick:()=>{let v=e.findIndex(b=>b.value===d.value);v>=0&&f(v,"smooth"),r(d.value);},role:"option","aria-selected":d.value===t,children:d.label},d.value))}),jsxRuntime.jsx("div",{className:"dtp-fade-top","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"dtp-fade-bottom","aria-hidden":"true"})]})}function so({year:e,month:t,selectedDate:r,today:a,minDate:l,maxDate:o,locale:n,onSelectDay:f,onPrev:m,onNext:d}){let v=tn(n,"narrow"),b=xt(n,"long"),i=an(e,t);return jsxRuntime.jsxs("div",{className:"dtp-calendar",children:[jsxRuntime.jsxs("div",{className:"dtp-cal-nav",children:[jsxRuntime.jsx("button",{type:"button",className:"dtp-cal-nav-btn",onClick:m,"aria-label":"Previous month",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsxs("span",{className:"dtp-cal-title",children:[b[t]," ",e]}),jsxRuntime.jsx("button",{type:"button",className:"dtp-cal-nav-btn",onClick:d,"aria-label":"Next month",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})})]}),jsxRuntime.jsx("div",{className:"dtp-cal-weekdays",role:"row",children:v.map((p,P)=>jsxRuntime.jsx("div",{className:"dtp-cal-weekday",role:"columnheader","aria-label":p,children:p},P))}),jsxRuntime.jsx("div",{className:"dtp-cal-days",role:"grid",children:i.map(({date:p,thisMonth:P},w)=>{let L=dr(p,r),T=dr(p,a),R=l!=null&&on(p,l)||o!=null&&sn(p,o);return jsxRuntime.jsx("button",{type:"button",role:"gridcell",className:c("dtp-cal-day",!P&&"dtp-cal-day--other",L&&"dtp-cal-day--selected",T&&!L&&"dtp-cal-day--today",R&&"dtp-cal-day--disabled"),onClick:()=>!R&&f(p),disabled:R,"aria-current":T?"date":void 0,"aria-selected":L,"aria-disabled":R,children:p.getDate()},w)})})]})}function io({amount:e,unit:t,direction:r,onAmountChange:a,onUnitChange:l,onDirectionChange:o,onApply:n,locale:f}){let m=f.startsWith("zh"),d=[{value:"day",label:m?"\u5929":"Day"},{value:"week",label:m?"\u5468":"Week"},{value:"month",label:m?"\u6708":"Month"},{value:"year",label:m?"\u5E74":"Year"}],v=[{value:"future",label:m?"\u4EE5\u540E":"from now"},{value:"past",label:m?"\u4EE5\u524D":"before now"}];return jsxRuntime.jsxs("div",{className:"dtp-quick-offset","aria-label":m?"\u5FEB\u901F\u504F\u79FB":"Quick offset",children:[jsxRuntime.jsx("input",{type:"number",className:"dtp-offset-input",value:e,min:1,max:9999,"aria-label":m?"\u504F\u79FB\u6570\u91CF":"Offset amount",onChange:b=>{let i=parseInt(b.target.value,10);!isNaN(i)&&i>=1&&a(i);}}),jsxRuntime.jsx("select",{className:"dtp-offset-select",value:t,"aria-label":m?"\u504F\u79FB\u5355\u4F4D":"Offset unit",onChange:b=>l(b.target.value),children:d.map(b=>jsxRuntime.jsx("option",{value:b.value,children:b.label},b.value))}),jsxRuntime.jsx("select",{className:"dtp-offset-select",value:r,"aria-label":m?"\u504F\u79FB\u65B9\u5411":"Offset direction",onChange:b=>o(b.target.value),children:v.map(b=>jsxRuntime.jsx("option",{value:b.value,children:b.label},b.value))}),jsxRuntime.jsx("button",{type:"button",className:"dtp-offset-apply",onClick:n,children:m?"\u5E94\u7528":"Apply"})]})}function _t({className:e,popupClassName:t,triggerClassName:r,disabled:a=false,placeholder:l,...o}){let{isOpen:n,displayValue:f,workingDate:m,view:d,calYear:v,calMonth:b,offsetAmount:i,offsetUnit:p,offsetDirection:P,mode:w,use24Hour:L,showSeconds:T,locale:R,minDate:F,maxDate:H,openPicker:j,closePicker:le,confirm:x,clear:C,updateField:S,setView:A,setCalYear:u,setCalMonth:V,setOffsetAmount:W,setOffsetUnit:ie,setOffsetDirection:G,applyQuickOffset:be,navigateCalendar:U}=dn({...o}),ue=Pr.useRef(null),Pe=Pr.useRef(null),ye=new Date;pn([ue,Pe],le,n),gn(ue,Pe,n);let X=R.startsWith("zh"),he={cancel:X?"\u53D6\u6D88":"Cancel",confirm:X?"\u786E\u5B9A":"Confirm",calendarView:X?"\u65E5\u5386":"Calendar",scrollView:X?"\u6EDA\u8F6E":"Scroll",placeholder:l??(X?"\u9009\u62E9\u65E5\u671F\u65F6\u95F4":"Select date / time")},ce=w==="date"||w==="datetime",Te=w==="time"||w==="datetime",Re=cn(m.getFullYear(),200).map(I=>({label:String(I),value:I})),E=xt(R,"short").map((I,te)=>({label:I,value:te})),J=ft(m.getFullYear(),m.getMonth()),ee=Array.from({length:J},(I,te)=>({label:String(te+1).padStart(2,"0"),value:te+1})),B=Array.from({length:24},(I,te)=>({label:String(te).padStart(2,"0"),value:te})),ne=Array.from({length:12},(I,te)=>({label:String(te===0?12:te).padStart(2,"0"),value:te})),we=[{label:"AM",value:0},{label:"PM",value:1}],Se=Array.from({length:60},(I,te)=>({label:String(te).padStart(2,"0"),value:te})),Y=m.getHours(),Ye=Y%12,ae=Y<12?0:1,ve=Te&&!ce?lucideReact.Clock:lucideReact.Calendar;return jsxRuntime.jsxs("div",{className:c("dtp-root",e),children:[jsxRuntime.jsxs("div",{className:"dtp-trigger-wrap",children:[jsxRuntime.jsxs("button",{ref:ue,type:"button",className:c("dtp-trigger",f&&"dtp-trigger--has-clear",a&&"dtp-trigger--disabled",r),onClick:()=>!a&&(n?le():j()),disabled:a,"aria-haspopup":"dialog","aria-expanded":n,children:[jsxRuntime.jsx(ve,{className:"dtp-trigger-icon","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:c("dtp-trigger-text",!f&&"dtp-trigger-placeholder"),children:f||he.placeholder})]}),f&&jsxRuntime.jsx("button",{type:"button",className:"dtp-trigger-clear","aria-label":X?"\u6E05\u9664":"Clear value",onClick:()=>!a&&C(),children:jsxRuntime.jsx(lucideReact.X,{className:"h-3.5 w-3.5"})})]}),n&&reactDom.createPortal(jsxRuntime.jsxs("div",{ref:Pe,className:c("dtp-panel",t),role:"dialog","aria-modal":"true","aria-label":X?"\u65E5\u671F\u65F6\u95F4\u9009\u62E9\u5668":"Date time picker",children:[jsxRuntime.jsxs("div",{className:"dtp-panel-header",children:[jsxRuntime.jsx("span",{className:"dtp-panel-preview",children:f||he.placeholder}),jsxRuntime.jsx("div",{className:"dtp-panel-actions",children:ce&&jsxRuntime.jsx("button",{type:"button",className:c("dtp-view-btn",d==="calendar"&&"dtp-view-btn--active"),"aria-pressed":d==="calendar",title:d==="calendar"?he.scrollView:he.calendarView,onClick:()=>{d!=="calendar"&&(u(m.getFullYear()),V(m.getMonth())),A(d==="calendar"?"drum":"calendar");},children:jsxRuntime.jsx(lucideReact.Calendar,{className:"h-4 w-4"})})})]}),jsxRuntime.jsx("div",{className:"dtp-panel-body",children:d==="drum"?jsxRuntime.jsxs("div",{className:"dtp-drum",children:[ce&&jsxRuntime.jsxs("div",{className:"dtp-drum-date",children:[jsxRuntime.jsx(qe,{label:X?"\u5E74":"Year",items:Re,selectedValue:m.getFullYear(),onSelect:I=>S("year",I)}),jsxRuntime.jsx(qe,{label:X?"\u6708":"Month",items:E,selectedValue:m.getMonth(),onSelect:I=>S("month",I)}),jsxRuntime.jsx(qe,{label:X?"\u65E5":"Day",items:ee,selectedValue:m.getDate(),onSelect:I=>S("day",I)})]}),ce&&Te&&jsxRuntime.jsx("div",{className:"dtp-drum-sep","aria-hidden":"true"}),Te&&jsxRuntime.jsxs("div",{className:"dtp-drum-time",children:[L?jsxRuntime.jsx(qe,{label:X?"\u65F6":"Hour",items:B,selectedValue:Y,onSelect:I=>S("hour",I)}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(qe,{label:X?"\u65F6":"Hour",items:ne,selectedValue:Ye,onSelect:I=>{S("hour",ae===1?I+12:I);}}),jsxRuntime.jsx(qe,{label:"AM/PM",items:we,selectedValue:ae,onSelect:I=>{S("hour",Ye+(I===1?12:0));}})]}),jsxRuntime.jsx(qe,{label:X?"\u5206":"Min",items:Se,selectedValue:m.getMinutes(),onSelect:I=>S("minute",I)}),T&&jsxRuntime.jsx(qe,{label:X?"\u79D2":"Sec",items:Se,selectedValue:m.getSeconds(),onSelect:I=>S("second",I)})]})]}):jsxRuntime.jsx(so,{year:v,month:b,selectedDate:m,today:ye,minDate:F,maxDate:H,locale:R,onSelectDay:I=>{S("year",I.getFullYear()),S("month",I.getMonth()),S("day",I.getDate()),A("drum");},onPrev:()=>U(-1),onNext:()=>U(1)})}),ce&&jsxRuntime.jsx("div",{className:"dtp-panel-offset",children:jsxRuntime.jsx(io,{amount:i,unit:p,direction:P,onAmountChange:W,onUnitChange:ie,onDirectionChange:G,onApply:be,locale:R})}),jsxRuntime.jsxs("div",{className:"dtp-panel-footer",children:[jsxRuntime.jsx("button",{type:"button",className:"dtp-btn-cancel",onClick:le,children:he.cancel}),jsxRuntime.jsx("button",{type:"button",className:"dtp-btn-confirm",onClick:x,children:he.confirm})]})]}),document.body)]})}var co={FilmReel:jt,MiniPlayer:Bt,CinePlayer:Kt,FileExplorer:rr,Masonry:sr,TypewriterText:Lt,CommandPalette:At,Timeline:cr,DateTimePicker:_t},_i=co;exports.CinePlayer=Kt;exports.CommandPalette=At;exports.DateTimePicker=_t;exports.Extras=co;exports.FileExplorer=rr;exports.FilmReel=jt;exports.Masonry=sr;exports.MiniPlayer=Bt;exports.Timeline=cr;exports.TypewriterText=Lt;exports.default=_i;
|