@gradeui/ui 1.2.0 → 2.0.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/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import {z}from'zod';import*as S from'react';import {useRef,useEffect}from'react';import*as nt from'@radix-ui/react-accordion';import {ChevronDown,X,ChevronLeft,ChevronRight,Check,Circle,Search,XCircle,ChevronUp,Image,Box,Code2,Music,Video,UtensilsCrossed,Package,Film,Mountain,User,Book,Gamepad2,Clapperboard,Tv,Disc3,Pause,Play,Paperclip,Square,Send,Bold,Italic,Underline,Strikethrough,Code,Heading1,Heading2,Heading3,Quote,List,ListOrdered,ChevronLeftIcon,ChevronRightIcon,ChevronDownIcon,CalendarIcon,GripVertical,MoreHorizontal,Palette,Download,Trash2,SunDim,Sun,Moon,MoonStar}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {cva}from'class-variance-authority';import {Slot}from'@radix-ui/react-slot';import*as Et from'@radix-ui/react-avatar';import {getDefaultClassNames,DayPicker}from'react-day-picker';import Pc from'embla-carousel-react';import*as Yo from'@radix-ui/react-checkbox';import {Highlight}from'prism-react-renderer';import {useInView,motion,AnimatePresence,useReducedMotion}from'motion/react';import {LexicalComposer}from'@lexical/react/LexicalComposer';import {RichTextPlugin}from'@lexical/react/LexicalRichTextPlugin';import {ContentEditable}from'@lexical/react/LexicalContentEditable';import {LexicalErrorBoundary}from'@lexical/react/LexicalErrorBoundary';import {HistoryPlugin}from'@lexical/react/LexicalHistoryPlugin';import {OnChangePlugin}from'@lexical/react/LexicalOnChangePlugin';import {ListPlugin}from'@lexical/react/LexicalListPlugin';import {LinkPlugin}from'@lexical/react/LexicalLinkPlugin';import {useLexicalComposerContext}from'@lexical/react/LexicalComposerContext';import {HeadingNode,QuoteNode,$createHeadingNode,$createQuoteNode}from'@lexical/rich-text';import {ListNode,ListItemNode,INSERT_UNORDERED_LIST_COMMAND,INSERT_ORDERED_LIST_COMMAND}from'@lexical/list';import {LinkNode,AutoLinkNode}from'@lexical/link';import {CodeNode,CodeHighlightNode}from'@lexical/code';import {$setBlocksType}from'@lexical/selection';import {mergeRegister}from'@lexical/utils';import {$getSelection,$isRangeSelection,$getRoot,$createParagraphNode,$createTextNode,FORMAT_TEXT_COMMAND,KEY_ENTER_COMMAND,COMMAND_PRIORITY_HIGH}from'lexical';import {BeautifulMentionNode,BeautifulMentionsPlugin,$createBeautifulMentionNode}from'lexical-beautiful-mentions';import {format}from'date-fns';import*as ft from'@radix-ui/react-popover';import*as ye from'@radix-ui/react-dialog';import*as U from'@radix-ui/react-dropdown-menu';import*as Sa from'@radix-ui/react-label';import*as er from'@radix-ui/react-progress';import {Command}from'cmdk';import*as Na from'@radix-ui/react-separator';import*as Kt from'@radix-ui/react-radio-group';import*as Po from'react-resizable-panels';import*as it from'@radix-ui/react-scroll-area';import*as K from'@radix-ui/react-select';import*as It from'@radix-ui/react-slider';import {useSensors,useSensor,PointerSensor,KeyboardSensor,DndContext,closestCorners,closestCenter,useDroppable}from'@dnd-kit/core';import {sortableKeyboardCoordinates,arrayMove,SortableContext,rectSortingStrategy,horizontalListSortingStrategy,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import {CSS}from'@dnd-kit/utilities';import*as nr from'@radix-ui/react-switch';import*as vt from'@radix-ui/react-tabs';import*as bt from'@radix-ui/react-tooltip';import*as Va from'@radix-ui/react-toggle';import*as Mo from'@radix-ui/react-toggle-group';import {createPortal}from'react-dom';import*as fe from'three';import {EffectComposer,RenderPass,BloomEffect,KernelSize,NoiseEffect,BlendFunction,ScanlineEffect,VignetteEffect,ChromaticAberrationEffect,GlitchEffect,EffectPass}from'postprocessing';import Xg from'lenis';var Fd=Object.defineProperty;var vr=(e,t)=>()=>(e&&(t=e(e=0)),t);var ca=(e,t)=>{for(var o in t)Fd(e,o,{get:t[o],enumerable:true});};var oa,sd,ld=vr(()=>{oa="2pMfyvhpuKonkf7h8HzH",sd=()=>oa!=="YOUR_KEY_HERE"&&oa.length>0;});var pd={};ca(pd,{createMaplibreAdapter:()=>ju});function Uu(){if(typeof document>"u"||document.getElementById(cd))return;let e=document.createElement("link");e.id=cd,e.rel="stylesheet",e.href=Wu,document.head.appendChild(e);}var Gu,dd,Wu,cd,ju,md=vr(()=>{ld();Gu={light:"dataviz-light",dark:"dataviz-dark",satellite:"satellite"},dd=(e,t)=>`https://api.maptiler.com/maps/${Gu[e]}/style.json?key=${encodeURIComponent(t)}`,Wu="https://unpkg.com/maplibre-gl@4/dist/maplibre-gl.css",cd="gds-maplibre-gl-css";ju=async(e,t,o)=>{Uu();let r;try{r=await import('maplibre-gl'),r.default&&(r=r.default);}catch(c){throw o.onError({code:"sdk-missing",message:'@gradeui/ui Map: `maplibre-gl` is not installed. Run `pnpm add maplibre-gl` (or your package manager\'s equivalent) to use provider="maplibre".',cause:c}),c}let n=t.tilerKey??oa;process.env.NODE_ENV!=="production"&&!t.tilerKey&&!sd()&&console.warn("@gradeui/ui Map: no `tilerKey` prop and the bundled MapTiler demo key is unset. Tile requests will 403. Set `tilerKey` or paste a key into demo-config.ts.");let a=t.styleUrl??dd(t.appearance,n),l=new r.Map({container:e,style:a,center:t.center,zoom:t.zoom,interactive:t.interactive,attributionControl:{compact:true}});t.bounds&&l.fitBounds([t.bounds[0],t.bounds[1]],{animate:false}),await new Promise(c=>{l.once("load",()=>c());}),o.onLoad(),l.on("error",c=>{let d=String(c?.error?.message??c?.message??"MapLibre error"),m=d.toLowerCase().includes("style");o.onError({code:m?"style-load-failed":"tile-load-failed",message:d,cause:c?.error??c});});let p=new globalThis.Map;return {setCenter:c=>l.setCenter(c),setZoom:c=>l.setZoom(c),setBounds:(c,d)=>l.fitBounds([c,d],{animate:false}),setAppearance:c=>{let d=t.styleUrl??dd(c,n);l.setStyle(d,{diff:false});},setInteractive:c=>{let d=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"];for(let m of d){let g=l[m];g&&(c?g.enable():g.disable());}},flyTo:(c,d)=>l.flyTo({center:c,zoom:d?.zoom,duration:d?.durationMs??800}),panTo:(c,d)=>l.panTo(c,{duration:d?.durationMs??600}),fitBounds:(c,d)=>{if(c.length===0)return;let m=1/0,g=1/0,u=-1/0,b=-1/0;for(let[h,f]of c)h<m&&(m=h),f<g&&(g=f),h>u&&(u=h),f>b&&(b=f);l.fitBounds([[m,g],[u,b]],{padding:d?.paddingPx??40,duration:d?.durationMs??800});},getCenter:()=>{let c=l.getCenter();return [c.lng,c.lat]},getZoom:()=>l.getZoom(),getBounds:()=>{let c=l.getBounds();return [[c.getWest(),c.getSouth()],[c.getEast(),c.getNorth()]]},addMarker:(c,d,m)=>{let g=document.createElement("div");g.dataset.gdsPart="map-marker",g.dataset.gdsState="idle",g.style.cursor="pointer",g.addEventListener("mouseenter",()=>o.onMarkerHover(c)),g.addEventListener("mouseleave",()=>o.onMarkerHover(null)),g.addEventListener("click",h=>{o.onMarkerClick(c,b.coords,h);});let u=new r.Marker({element:g,anchor:m==="center"?"center":"bottom"}).setLngLat(d).addTo(l),b={element:g,coords:d,setHovered:h=>{g.dataset.gdsState=h?"hovered":"idle",g.style.zIndex=h?"10":"1";},setPosition:h=>{b.coords=h,u.setLngLat(h);},remove:()=>{u.remove(),p.delete(c);}};return p.set(c,{marker:u,handle:b}),b},destroy:()=>{p.forEach(({marker:c})=>c.remove()),p.clear(),l.remove();},instance:l}};});var fd={};ca(fd,{createMapboxAdapter:()=>qu});function Ku(){if(typeof document>"u"||document.getElementById(gd))return;let e=document.createElement("link");e.id=gd,e.rel="stylesheet",e.href=$u,document.head.appendChild(e);}var ud,$u,gd,qu,hd=vr(()=>{ud={light:"mapbox://styles/mapbox/light-v11",dark:"mapbox://styles/mapbox/dark-v11",satellite:"mapbox://styles/mapbox/satellite-streets-v12"},$u="https://unpkg.com/mapbox-gl@3/dist/mapbox-gl.css",gd="gds-mapbox-gl-css";qu=async(e,t,o)=>{if(!t.accessToken)throw o.onError({code:"api-key-missing",message:'@gradeui/ui Map: provider="mapbox" requires an `accessToken` prop.'}),new Error("mapbox accessToken missing");Ku();let r;try{r=await import('mapbox-gl'),r.default&&(r=r.default);}catch(i){throw o.onError({code:"sdk-missing",message:'@gradeui/ui Map: `mapbox-gl` is not installed. Run `pnpm add mapbox-gl` to use provider="mapbox".',cause:i}),i}r.accessToken=t.accessToken;let n=t.styleUrl??ud[t.appearance],a=new r.Map({container:e,style:n,center:t.center,zoom:t.zoom,interactive:t.interactive});t.bounds&&a.fitBounds([t.bounds[0],t.bounds[1]],{animate:false}),await new Promise(i=>{a.once("load",()=>i());}),o.onLoad(),a.on("error",i=>{let c=String(i?.error?.message??i?.message??"Mapbox error"),d=c.toLowerCase().includes("style");o.onError({code:d?"style-load-failed":"tile-load-failed",message:c,cause:i?.error??i});});let l=new globalThis.Map;return {setCenter:i=>a.setCenter(i),setZoom:i=>a.setZoom(i),setBounds:(i,c)=>a.fitBounds([i,c],{animate:false}),setAppearance:i=>{let c=t.styleUrl??ud[i];a.setStyle(c,{diff:false});},setInteractive:i=>{let c=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"];for(let d of c){let m=a[d];m&&(i?m.enable():m.disable());}},flyTo:(i,c)=>a.flyTo({center:i,zoom:c?.zoom,duration:c?.durationMs??800}),panTo:(i,c)=>a.panTo(i,{duration:c?.durationMs??600}),fitBounds:(i,c)=>{if(i.length===0)return;let d=1/0,m=1/0,g=-1/0,u=-1/0;for(let[b,h]of i)b<d&&(d=b),h<m&&(m=h),b>g&&(g=b),h>u&&(u=h);a.fitBounds([[d,m],[g,u]],{padding:c?.paddingPx??40,duration:c?.durationMs??800});},getCenter:()=>{let i=a.getCenter();return [i.lng,i.lat]},getZoom:()=>a.getZoom(),getBounds:()=>{let i=a.getBounds();return [[i.getWest(),i.getSouth()],[i.getEast(),i.getNorth()]]},addMarker:(i,c,d)=>{let m=document.createElement("div");m.dataset.gdsPart="map-marker",m.dataset.gdsState="idle",m.style.cursor="pointer",m.addEventListener("mouseenter",()=>o.onMarkerHover(i)),m.addEventListener("mouseleave",()=>o.onMarkerHover(null)),m.addEventListener("click",b=>{o.onMarkerClick(i,u.coords,b);});let g=new r.Marker({element:m,anchor:d==="center"?"center":"bottom"}).setLngLat(c).addTo(a),u={element:m,coords:c,setHovered:b=>{m.dataset.gdsState=b?"hovered":"idle",m.style.zIndex=b?"10":"1";},setPosition:b=>{u.coords=b,g.setLngLat(b);},remove:()=>{g.remove(),l.delete(i);}};return l.set(i,{marker:g,handle:u}),u},destroy:()=>{l.forEach(({marker:i})=>i.remove()),l.clear(),a.remove();},instance:a}};});var vd={};ca(vd,{createGoogleAdapter:()=>Xu});var Yu,Zu,bd,Xu,yd=vr(()=>{Yu=[{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"transit",stylers:[{visibility:"simplified"}]}],Zu=[{elementType:"geometry",stylers:[{color:"#1a1a1a"}]},{elementType:"labels.text.stroke",stylers:[{color:"#1a1a1a"}]},{elementType:"labels.text.fill",stylers:[{color:"#9ca3af"}]},{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#262626"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca3af"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#0f172a"}]},{featureType:"transit",stylers:[{visibility:"simplified"},{color:"#3a3a3a"}]}],bd=e=>e==="dark"?Zu:Yu,Xu=async(e,t,o)=>{if(!t.apiKey)throw o.onError({code:"api-key-missing",message:'@gradeui/ui Map: provider="google" requires an `apiKey` prop.'}),new Error("google apiKey missing");let r;try{let d=await import('@googlemaps/js-api-loader');r=d.Loader??d.default?.Loader;}catch(d){throw o.onError({code:"sdk-missing",message:'@gradeui/ui Map: `@googlemaps/js-api-loader` is not installed. Run `pnpm add @googlemaps/js-api-loader` to use provider="google".',cause:d}),d}let n=new r({apiKey:t.apiKey,version:"weekly",libraries:["maps","marker"]}),a;try{a=await n.load();}catch(d){throw o.onError({code:"provider-init-failed",message:"@gradeui/ui Map: Google Maps loader failed.",cause:d}),d}let l=t.appearance==="satellite",p=new a.maps.Map(e,{center:{lat:t.center[1],lng:t.center[0]},zoom:t.zoom,mapTypeId:l?a.maps.MapTypeId.HYBRID:a.maps.MapTypeId.ROADMAP,mapId:t.mapId,styles:l?void 0:bd(t.appearance==="dark"?"dark":"light"),disableDefaultUI:!t.interactive,gestureHandling:t.interactive?"auto":"none",keyboardShortcuts:t.interactive});if(t.bounds){let d=new a.maps.LatLngBounds({lat:t.bounds[0][1],lng:t.bounds[0][0]},{lat:t.bounds[1][1],lng:t.bounds[1][0]});p.fitBounds(d);}await new Promise(d=>{a.maps.event.addListenerOnce(p,"idle",()=>d());}),o.onLoad();let i=new globalThis.Map;return {setCenter:d=>p.setCenter({lat:d[1],lng:d[0]}),setZoom:d=>p.setZoom(d),setBounds:(d,m)=>{let g=new a.maps.LatLngBounds({lat:d[1],lng:d[0]},{lat:m[1],lng:m[0]});p.fitBounds(g);},setAppearance:d=>{d==="satellite"?(p.setMapTypeId(a.maps.MapTypeId.HYBRID),p.setOptions({styles:void 0})):(p.setMapTypeId(a.maps.MapTypeId.ROADMAP),p.setOptions({styles:bd(d)}));},setInteractive:d=>{p.setOptions({disableDefaultUI:!d,gestureHandling:d?"auto":"none",keyboardShortcuts:d});},flyTo:(d,m)=>{p.panTo({lat:d[1],lng:d[0]}),m?.zoom!=null&&p.setZoom(m.zoom);},panTo:d=>p.panTo({lat:d[1],lng:d[0]}),fitBounds:(d,m)=>{if(d.length===0)return;let g=new a.maps.LatLngBounds;for(let[u,b]of d)g.extend({lat:b,lng:u});p.fitBounds(g,m?.paddingPx??40);},getCenter:()=>{let d=p.getCenter();return d?[d.lng(),d.lat()]:[0,0]},getZoom:()=>p.getZoom()??0,getBounds:()=>{let d=p.getBounds();if(!d)return [[0,0],[0,0]];let m=d.getSouthWest(),g=d.getNorthEast();return [[m.lng(),m.lat()],[g.lng(),g.lat()]]},addMarker:(d,m,g)=>{let u=document.createElement("div");u.dataset.gdsPart="map-marker",u.dataset.gdsState="idle",u.style.cursor="pointer",g==="center"&&(u.style.transform="translateY(50%)"),u.addEventListener("mouseenter",()=>o.onMarkerHover(d)),u.addEventListener("mouseleave",()=>o.onMarkerHover(null)),u.addEventListener("click",f=>{o.onMarkerClick(d,h.coords,f);});let b=new a.maps.marker.AdvancedMarkerElement({map:p,position:{lat:m[1],lng:m[0]},content:u}),h={element:u,coords:m,setHovered:f=>{u.dataset.gdsState=f?"hovered":"idle",b.zIndex=f?10:1;},setPosition:f=>{h.coords=f,b.position={lat:f[1],lng:f[0]};},remove:()=>{b.map=null,i.delete(d);}};return i.set(d,{marker:b,handle:h}),h},destroy:()=>{i.forEach(({marker:d})=>{d.map=null;}),i.clear();},instance:p}};});var fn={name:"Accordion",description:`Long-form content that would overwhelm if shown all at once \u2014 FAQs, settings groups, "what's included" sections, nested help. For tab-style peer views with one always visible, reach for Tabs. For a single show/hide reveal use Collapsible.`,import:"@gradeui/ui",aliases:["accordion","faq","expand","collapse list","disclosure list","disclosure group","outline group","expandable list","sectionlist"],subcomponents:["AccordionItem","AccordionTrigger","AccordionContent"],composesWith:["Card (as a faq inside a card body)","Section primitives"],props:{type:{schema:z.enum(["single","multiple"]),design:"knob",description:"single keeps one open at a time, multiple lets several be open at once"},collapsible:{schema:z.boolean().optional(),design:"knob",description:'only valid with type="single"; allows the open item to be toggled shut'},defaultValue:{schema:z.string().optional(),design:"content",description:"initial open item(s)"},value:{schema:z.string().optional(),design:"content",description:"controlled"},onValueChange:{schema:z.unknown().optional(),design:"event"},children:{schema:z.unknown(),design:"plumbing",description:"the row label users click to expand"}}};var hn={name:"AiChat",description:'A flexible chat block \u2014 header + scrollable message list + composer. Out of the box it looks like a polished "AI panel"; under it, every region is a slot so hosts can compose richer chat surfaces (e.g. Studio\'s left column with selection chip + settings panel above the composer, an error banner inline, per-message usage / refs / actions). Per-turn token usage, refs, and actions are optional and gated by `showUsage` / `showRefs` / `showActions` \u2014 leave them off for product-facing chats, turn them on for developer-facing ones where transparency matters. Composes with [[AIChatComposer]] (rendered internally; can be slotted in with custom props via `composerSlot`).',import:"@gradeui/ui",aliases:["ai chat","chat panel","chat block","llm chat","assistant panel","copilot chat","ai assistant"],composesWith:["Card (host in a sidebar panel)","Sheet (mobile drawer)","Stack (place above other content)","AIChatComposer (internal composer; slot to override)"],props:{messages:{schema:z.unknown().optional(),design:"plumbing",description:'`{ id, role: "user" | "assistant", content, timestamp, thinking?, steps?, usage?, refs?, actions?, duration? }`; defaults to empty'},onSendMessage:{schema:z.unknown().optional(),design:"event",description:"fires when the user submits via the default composer; ignored if `composerSlot` is set"},isLoading:{schema:z.boolean().optional(),design:"knob",description:"shows a typing indicator at the bottom of the message list"},placeholder:{schema:z.string().optional(),design:"content",description:"composer placeholder text (ignored if `composerSlot` is set)"},title:{schema:z.string().optional(),design:"plumbing",description:'header title; defaults to "AI Assistant"'},titleIcon:{schema:z.unknown().optional(),design:"plumbing",description:"optional icon rendered before the title (e.g. `<Sparkles />`)"},headerTokens:{schema:z.number().optional(),design:"knob",description:'optional session-level token total shown on the right of the header; rendered as "N tokens" with a small gauge icon when set'},headerEnd:{schema:z.unknown().optional(),design:"plumbing",description:"optional arbitrary content appended after `headerTokens` on the right of the header"},showUsage:{schema:z.boolean().optional(),design:"knob",description:"show the per-turn `usage` strip below the assistant bubble; default false"},showRefs:{schema:z.boolean().optional(),design:"knob",description:"show the per-turn `refs` strip below the assistant bubble; default false"},showActions:{schema:z.boolean().optional(),design:"knob",description:"render per-turn `actions` chips when a message has them; default true"},showDuration:{schema:z.boolean().optional(),design:"knob",description:'render the per-turn wall-clock duration ("2.3s") below the assistant bubble when a message carries `duration`; default false'},showThinking:{schema:z.boolean().optional(),design:"knob",description:'render the per-turn reasoning ("Thoughts") disclosure above the assistant prose when a message carries `thinking`; collapsed by default, click to expand; default false'},showSteps:{schema:z.boolean().optional(),design:"knob",description:'render the per-turn step timeline above the assistant prose when a message carries `steps`; collapsed view shows the current running step (or "N steps completed"), click to expand the vertical timeline with status glyphs; default false'},thinkingPhrase:{schema:z.string().optional(),design:"content",description:'override the "Thinking" label in the loading indicator'},suggestedPrompts:{schema:z.unknown().optional(),design:"plumbing",description:"empty-state quick prompts (ignored if `emptyStateSlot` is set)"},emptyStateSlot:{schema:z.unknown().optional(),design:"plumbing",description:"replaces the default empty state entirely"},errorSlot:{schema:z.unknown().optional(),design:"plumbing",description:"rendered after the messages list (typically an error banner)"},composerAboveSlot:{schema:z.unknown().optional(),design:"plumbing",description:"rendered between the messages and the composer (selection chip, settings panel)"},composerBelowSlot:{schema:z.unknown().optional(),design:"plumbing",description:"rendered below the composer (disclaimer, char counter)"},composerSlot:{schema:z.unknown().optional(),design:"plumbing",description:"full override of the composer; when provided, `onSendMessage` + `placeholder` are unused"},bare:{schema:z.boolean().optional(),design:"knob",description:"strip the outer card chrome (background, border, rounded corners) so the chat takes the surface of its container; default false (keeps the canned card look)"},assistantBubble:{schema:z.boolean().optional(),design:"knob",description:"whether assistant messages render with a bubble (background + border + padding + rounded corners); default true. Set false for a Claude.ai-style chromeless transcript where assistant text sits on the surface and only user turns wear a bubble."},className:{schema:z.string().optional(),design:"plumbing"}}};var bn={name:"AiChatComposer",description:"The reusable \"input card\" for any chat surface \u2014 auto-growing textarea, image attachments via paperclip and clipboard paste, attachment chips with previews, Send/Stop toggle, controlled value. Drop in below any messages list. Use this when you want the input affordances of `<AIChat>` but you're rendering your own messages list / scrollarea / header (e.g. Studio's left-column chat, where SelectionChip and SettingsPanel sit between messages and composer). For the full canned chat block, use `<AIChat>` instead.",import:"@gradeui/ui",aliases:["chat composer","chat input","prompt composer","message input"],composesWith:["AIChat (uses this internally)","Card (host above)","ScrollArea (place messages above)"],props:{value:{schema:z.string(),design:"content",description:"controlled textarea value"},onChange:{schema:z.unknown(),design:"event",description:"fires for every textarea change"},onSend:{schema:z.unknown(),design:"event",description:"fires when the user submits (Enter or click Send); composer validates that text or attachments exist before firing"},isLoading:{schema:z.boolean().optional(),design:"knob",description:"disables the textarea + paperclip and swaps Send for Stop"},onStop:{schema:z.unknown().optional(),design:"event",description:"fires when the user clicks Stop; without this, Stop renders disabled"},placeholder:{schema:z.string().optional(),design:"content"},maxLength:{schema:z.number().optional(),design:"knob",description:"hard cap passed to the underlying `<textarea>`"},showHint:{schema:z.boolean().optional(),design:"knob",description:'show the "Press Enter\u2026 \xB7 Paste images" hint below the card; default true, set false when the host renders its own footer'},className:{schema:z.string().optional(),design:"plumbing"}}};var vn={name:"AppShell",description:`The top-level page scaffold for any app-like or marketing layout. Reach for AppShell
2
+ import {z}from'zod';import*as C from'react';import {useRef,useEffect}from'react';import*as gt from'@radix-ui/react-accordion';import {ChevronDown,X as X$1,ChevronLeft,ChevronRight,Check,Circle,Search,XCircle,ChevronUp,Image,Box,Code2,Music,Video,UtensilsCrossed,Package,Film,Mountain,User,Book,Gamepad2,Clapperboard,Tv,Disc3,Pause,Play,Paperclip,Square,Send,Bold,Italic,Underline,Strikethrough,Code,Heading1,Heading2,Heading3,Quote,List,ListOrdered,ChevronLeftIcon,ChevronRightIcon,ChevronDownIcon,CalendarIcon,GripVertical,MoreHorizontal,Plus,Minus,Blend,Grid3x3,Sparkles,Palette,Download,Trash2,SunDim,Sun,Moon,MoonStar}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {cva}from'class-variance-authority';import {Slot}from'@radix-ui/react-slot';import*as jt from'@radix-ui/react-avatar';import {getDefaultClassNames,DayPicker}from'react-day-picker';import qp from'embla-carousel-react';import*as Rr from'@radix-ui/react-checkbox';import*as lo from'@radix-ui/react-radio-group';import*as Ir from'@radix-ui/react-switch';import {Highlight}from'prism-react-renderer';import {useInView,motion,AnimatePresence,useReducedMotion}from'motion/react';import {LexicalComposer}from'@lexical/react/LexicalComposer';import {RichTextPlugin}from'@lexical/react/LexicalRichTextPlugin';import {ContentEditable}from'@lexical/react/LexicalContentEditable';import {LexicalErrorBoundary}from'@lexical/react/LexicalErrorBoundary';import {HistoryPlugin}from'@lexical/react/LexicalHistoryPlugin';import {OnChangePlugin}from'@lexical/react/LexicalOnChangePlugin';import {ListPlugin}from'@lexical/react/LexicalListPlugin';import {LinkPlugin}from'@lexical/react/LexicalLinkPlugin';import {useLexicalComposerContext}from'@lexical/react/LexicalComposerContext';import {HeadingNode,QuoteNode,$createHeadingNode,$createQuoteNode}from'@lexical/rich-text';import {ListNode,ListItemNode,INSERT_UNORDERED_LIST_COMMAND,INSERT_ORDERED_LIST_COMMAND}from'@lexical/list';import {LinkNode,AutoLinkNode}from'@lexical/link';import {CodeNode,CodeHighlightNode}from'@lexical/code';import {$setBlocksType}from'@lexical/selection';import {mergeRegister}from'@lexical/utils';import {$getSelection,$isRangeSelection,$getRoot,$createParagraphNode,$createTextNode,FORMAT_TEXT_COMMAND,KEY_ENTER_COMMAND,COMMAND_PRIORITY_HIGH}from'lexical';import {BeautifulMentionNode,BeautifulMentionsPlugin,$createBeautifulMentionNode}from'lexical-beautiful-mentions';import {format}from'date-fns';import*as kt from'@radix-ui/react-popover';import*as ke from'@radix-ui/react-dialog';import*as X from'@radix-ui/react-dropdown-menu';import*as mn from'@radix-ui/react-label';import*as Mr from'@radix-ui/react-progress';import {Command}from'cmdk';import*as vn from'@radix-ui/react-separator';import*as Jo from'react-resizable-panels';import*as ft from'@radix-ui/react-scroll-area';import*as ee from'@radix-ui/react-select';import*as Yt from'@radix-ui/react-slider';import {useSensors,useSensor,PointerSensor,KeyboardSensor,DndContext,closestCorners,closestCenter,useDroppable}from'@dnd-kit/core';import {sortableKeyboardCoordinates,arrayMove,SortableContext,rectSortingStrategy,horizontalListSortingStrategy,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import {CSS}from'@dnd-kit/utilities';import*as Pt from'@radix-ui/react-tabs';import*as Tt from'@radix-ui/react-tooltip';import*as Ln from'@radix-ui/react-toggle';import*as Qo from'@radix-ui/react-toggle-group';import {createPortal}from'react-dom';import*as Re from'three';import {EffectComposer,RenderPass,BloomEffect,KernelSize,NoiseEffect,BlendFunction,ScanlineEffect,VignetteEffect,ChromaticAberrationEffect,GlitchEffect,GlitchMode,EffectPass}from'postprocessing';import sb from'lenis';var op=Object.defineProperty;var $r=(e,t)=>()=>(e&&(t=e(e=0)),t);var Za=(e,t)=>{for(var o in t)op(e,o,{get:t[o],enumerable:true});};var Oa,hc,bc=$r(()=>{Oa="2pMfyvhpuKonkf7h8HzH",hc=()=>Oa!=="YOUR_KEY_HERE"&&Oa.length>0;});var xc={};Za(xc,{createMaplibreAdapter:()=>Sf});function Rf(){if(typeof document>"u"||document.getElementById(yc))return;let e=document.createElement("link");e.id=yc,e.rel="stylesheet",e.href=wf,document.head.appendChild(e);}var xf,vc,wf,yc,Sf,wc=$r(()=>{bc();xf={light:"dataviz-light",dark:"dataviz-dark",satellite:"satellite"},vc=(e,t)=>`https://api.maptiler.com/maps/${xf[e]}/style.json?key=${encodeURIComponent(t)}`,wf="https://unpkg.com/maplibre-gl@4/dist/maplibre-gl.css",yc="gds-maplibre-gl-css";Sf=async(e,t,o)=>{Rf();let r;try{r=await import('maplibre-gl'),r.default&&(r=r.default);}catch(c){throw o.onError({code:"sdk-missing",message:'@gradeui/ui Map: `maplibre-gl` is not installed. Run `pnpm add maplibre-gl` (or your package manager\'s equivalent) to use provider="maplibre".',cause:c}),c}let n=t.tilerKey??Oa;process.env.NODE_ENV!=="production"&&!t.tilerKey&&!hc()&&console.warn("@gradeui/ui Map: no `tilerKey` prop and the bundled MapTiler demo key is unset. Tile requests will 403. Set `tilerKey` or paste a key into demo-config.ts.");let a=t.styleUrl??vc(t.appearance,n),i=new r.Map({container:e,style:a,center:t.center,zoom:t.zoom,interactive:t.interactive,attributionControl:{compact:true}});t.bounds&&i.fitBounds([t.bounds[0],t.bounds[1]],{animate:false}),await new Promise(c=>{i.once("load",()=>c());}),o.onLoad(),i.on("error",c=>{let d=String(c?.error?.message??c?.message??"MapLibre error"),m=d.toLowerCase().includes("style");o.onError({code:m?"style-load-failed":"tile-load-failed",message:d,cause:c?.error??c});});let p=new globalThis.Map;return {setCenter:c=>i.setCenter(c),setZoom:c=>i.setZoom(c),setBounds:(c,d)=>i.fitBounds([c,d],{animate:false}),setAppearance:c=>{let d=t.styleUrl??vc(c,n);i.setStyle(d,{diff:false});},setInteractive:c=>{let d=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"];for(let m of d){let g=i[m];g&&(c?g.enable():g.disable());}},flyTo:(c,d)=>i.flyTo({center:c,zoom:d?.zoom,duration:d?.durationMs??800}),panTo:(c,d)=>i.panTo(c,{duration:d?.durationMs??600}),fitBounds:(c,d)=>{if(c.length===0)return;let m=1/0,g=1/0,u=-1/0,b=-1/0;for(let[f,h]of c)f<m&&(m=f),h<g&&(g=h),f>u&&(u=f),h>b&&(b=h);i.fitBounds([[m,g],[u,b]],{padding:d?.paddingPx??40,duration:d?.durationMs??800});},getCenter:()=>{let c=i.getCenter();return [c.lng,c.lat]},getZoom:()=>i.getZoom(),getBounds:()=>{let c=i.getBounds();return [[c.getWest(),c.getSouth()],[c.getEast(),c.getNorth()]]},addMarker:(c,d,m)=>{let g=document.createElement("div");g.dataset.gdsPart="map-marker",g.dataset.gdsState="idle",g.style.cursor="pointer",g.addEventListener("mouseenter",()=>o.onMarkerHover(c)),g.addEventListener("mouseleave",()=>o.onMarkerHover(null)),g.addEventListener("click",f=>{o.onMarkerClick(c,b.coords,f);});let u=new r.Marker({element:g,anchor:m==="center"?"center":"bottom"}).setLngLat(d).addTo(i),b={element:g,coords:d,setHovered:f=>{g.dataset.gdsState=f?"hovered":"idle",g.style.zIndex=f?"10":"1";},setPosition:f=>{b.coords=f,u.setLngLat(f);},remove:()=>{u.remove(),p.delete(c);}};return p.set(c,{marker:u,handle:b}),b},destroy:()=>{p.forEach(({marker:c})=>c.remove()),p.clear(),i.remove();},instance:i}};});var kc={};Za(kc,{createMapboxAdapter:()=>Tf});function Cf(){if(typeof document>"u"||document.getElementById(Sc))return;let e=document.createElement("link");e.id=Sc,e.rel="stylesheet",e.href=kf,document.head.appendChild(e);}var Rc,kf,Sc,Tf,Cc=$r(()=>{Rc={light:"mapbox://styles/mapbox/light-v11",dark:"mapbox://styles/mapbox/dark-v11",satellite:"mapbox://styles/mapbox/satellite-streets-v12"},kf="https://unpkg.com/mapbox-gl@3/dist/mapbox-gl.css",Sc="gds-mapbox-gl-css";Tf=async(e,t,o)=>{if(!t.accessToken)throw o.onError({code:"api-key-missing",message:'@gradeui/ui Map: provider="mapbox" requires an `accessToken` prop.'}),new Error("mapbox accessToken missing");Cf();let r;try{r=await import('mapbox-gl'),r.default&&(r=r.default);}catch(s){throw o.onError({code:"sdk-missing",message:'@gradeui/ui Map: `mapbox-gl` is not installed. Run `pnpm add mapbox-gl` to use provider="mapbox".',cause:s}),s}r.accessToken=t.accessToken;let n=t.styleUrl??Rc[t.appearance],a=new r.Map({container:e,style:n,center:t.center,zoom:t.zoom,interactive:t.interactive});t.bounds&&a.fitBounds([t.bounds[0],t.bounds[1]],{animate:false}),await new Promise(s=>{a.once("load",()=>s());}),o.onLoad(),a.on("error",s=>{let c=String(s?.error?.message??s?.message??"Mapbox error"),d=c.toLowerCase().includes("style");o.onError({code:d?"style-load-failed":"tile-load-failed",message:c,cause:s?.error??s});});let i=new globalThis.Map;return {setCenter:s=>a.setCenter(s),setZoom:s=>a.setZoom(s),setBounds:(s,c)=>a.fitBounds([s,c],{animate:false}),setAppearance:s=>{let c=t.styleUrl??Rc[s];a.setStyle(c,{diff:false});},setInteractive:s=>{let c=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"];for(let d of c){let m=a[d];m&&(s?m.enable():m.disable());}},flyTo:(s,c)=>a.flyTo({center:s,zoom:c?.zoom,duration:c?.durationMs??800}),panTo:(s,c)=>a.panTo(s,{duration:c?.durationMs??600}),fitBounds:(s,c)=>{if(s.length===0)return;let d=1/0,m=1/0,g=-1/0,u=-1/0;for(let[b,f]of s)b<d&&(d=b),f<m&&(m=f),b>g&&(g=b),f>u&&(u=f);a.fitBounds([[d,m],[g,u]],{padding:c?.paddingPx??40,duration:c?.durationMs??800});},getCenter:()=>{let s=a.getCenter();return [s.lng,s.lat]},getZoom:()=>a.getZoom(),getBounds:()=>{let s=a.getBounds();return [[s.getWest(),s.getSouth()],[s.getEast(),s.getNorth()]]},addMarker:(s,c,d)=>{let m=document.createElement("div");m.dataset.gdsPart="map-marker",m.dataset.gdsState="idle",m.style.cursor="pointer",m.addEventListener("mouseenter",()=>o.onMarkerHover(s)),m.addEventListener("mouseleave",()=>o.onMarkerHover(null)),m.addEventListener("click",b=>{o.onMarkerClick(s,u.coords,b);});let g=new r.Marker({element:m,anchor:d==="center"?"center":"bottom"}).setLngLat(c).addTo(a),u={element:m,coords:c,setHovered:b=>{m.dataset.gdsState=b?"hovered":"idle",m.style.zIndex=b?"10":"1";},setPosition:b=>{u.coords=b,g.setLngLat(b);},remove:()=>{g.remove(),i.delete(s);}};return i.set(s,{marker:g,handle:u}),u},destroy:()=>{i.forEach(({marker:s})=>s.remove()),i.clear(),a.remove();},instance:a}};});var Pc={};Za(Pc,{createGoogleAdapter:()=>Mf});var Pf,Nf,Tc,Mf,Nc=$r(()=>{Pf=[{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"transit",stylers:[{visibility:"simplified"}]}],Nf=[{elementType:"geometry",stylers:[{color:"#1a1a1a"}]},{elementType:"labels.text.stroke",stylers:[{color:"#1a1a1a"}]},{elementType:"labels.text.fill",stylers:[{color:"#9ca3af"}]},{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#262626"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca3af"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#0f172a"}]},{featureType:"transit",stylers:[{visibility:"simplified"},{color:"#3a3a3a"}]}],Tc=e=>e==="dark"?Nf:Pf,Mf=async(e,t,o)=>{if(!t.apiKey)throw o.onError({code:"api-key-missing",message:'@gradeui/ui Map: provider="google" requires an `apiKey` prop.'}),new Error("google apiKey missing");let r;try{let d=await import('@googlemaps/js-api-loader');r=d.Loader??d.default?.Loader;}catch(d){throw o.onError({code:"sdk-missing",message:'@gradeui/ui Map: `@googlemaps/js-api-loader` is not installed. Run `pnpm add @googlemaps/js-api-loader` to use provider="google".',cause:d}),d}let n=new r({apiKey:t.apiKey,version:"weekly",libraries:["maps","marker"]}),a;try{a=await n.load();}catch(d){throw o.onError({code:"provider-init-failed",message:"@gradeui/ui Map: Google Maps loader failed.",cause:d}),d}let i=t.appearance==="satellite",p=new a.maps.Map(e,{center:{lat:t.center[1],lng:t.center[0]},zoom:t.zoom,mapTypeId:i?a.maps.MapTypeId.HYBRID:a.maps.MapTypeId.ROADMAP,mapId:t.mapId,styles:i?void 0:Tc(t.appearance==="dark"?"dark":"light"),disableDefaultUI:!t.interactive,gestureHandling:t.interactive?"auto":"none",keyboardShortcuts:t.interactive});if(t.bounds){let d=new a.maps.LatLngBounds({lat:t.bounds[0][1],lng:t.bounds[0][0]},{lat:t.bounds[1][1],lng:t.bounds[1][0]});p.fitBounds(d);}await new Promise(d=>{a.maps.event.addListenerOnce(p,"idle",()=>d());}),o.onLoad();let s=new globalThis.Map;return {setCenter:d=>p.setCenter({lat:d[1],lng:d[0]}),setZoom:d=>p.setZoom(d),setBounds:(d,m)=>{let g=new a.maps.LatLngBounds({lat:d[1],lng:d[0]},{lat:m[1],lng:m[0]});p.fitBounds(g);},setAppearance:d=>{d==="satellite"?(p.setMapTypeId(a.maps.MapTypeId.HYBRID),p.setOptions({styles:void 0})):(p.setMapTypeId(a.maps.MapTypeId.ROADMAP),p.setOptions({styles:Tc(d)}));},setInteractive:d=>{p.setOptions({disableDefaultUI:!d,gestureHandling:d?"auto":"none",keyboardShortcuts:d});},flyTo:(d,m)=>{p.panTo({lat:d[1],lng:d[0]}),m?.zoom!=null&&p.setZoom(m.zoom);},panTo:d=>p.panTo({lat:d[1],lng:d[0]}),fitBounds:(d,m)=>{if(d.length===0)return;let g=new a.maps.LatLngBounds;for(let[u,b]of d)g.extend({lat:b,lng:u});p.fitBounds(g,m?.paddingPx??40);},getCenter:()=>{let d=p.getCenter();return d?[d.lng(),d.lat()]:[0,0]},getZoom:()=>p.getZoom()??0,getBounds:()=>{let d=p.getBounds();if(!d)return [[0,0],[0,0]];let m=d.getSouthWest(),g=d.getNorthEast();return [[m.lng(),m.lat()],[g.lng(),g.lat()]]},addMarker:(d,m,g)=>{let u=document.createElement("div");u.dataset.gdsPart="map-marker",u.dataset.gdsState="idle",u.style.cursor="pointer",g==="center"&&(u.style.transform="translateY(50%)"),u.addEventListener("mouseenter",()=>o.onMarkerHover(d)),u.addEventListener("mouseleave",()=>o.onMarkerHover(null)),u.addEventListener("click",h=>{o.onMarkerClick(d,f.coords,h);});let b=new a.maps.marker.AdvancedMarkerElement({map:p,position:{lat:m[1],lng:m[0]},content:u}),f={element:u,coords:m,setHovered:h=>{u.dataset.gdsState=h?"hovered":"idle",b.zIndex=h?10:1;},setPosition:h=>{f.coords=h,b.position={lat:h[1],lng:h[0]};},remove:()=>{b.map=null,s.delete(d);}};return s.set(d,{marker:b,handle:f}),f},destroy:()=>{s.forEach(({marker:d})=>{d.map=null;}),s.clear();},instance:p}};});var ci={name:"Accordion",description:`Long-form content that would overwhelm if shown all at once \u2014 FAQs, settings groups, "what's included" sections, nested help. For tab-style peer views with one always visible, reach for Tabs. For a single show/hide reveal use Collapsible.`,import:"@gradeui/ui",aliases:["accordion","faq","expand","collapse list","disclosure list","disclosure group","outline group","expandable list","sectionlist"],subcomponents:["AccordionItem","AccordionTrigger","AccordionContent"],composesWith:["Card (as a faq inside a card body)","Section primitives"],styleDefaults:{AccordionItem:"border-b",AccordionTrigger:"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",AccordionContent:"pb-4 pt-0"},props:{type:{schema:z.enum(["single","multiple"]),design:"knob",description:"single keeps one open at a time, multiple lets several be open at once"},collapsible:{schema:z.boolean().optional(),design:"knob",description:'only valid with type="single"; allows the open item to be toggled shut'},defaultValue:{schema:z.union([z.string(),z.array(z.string())]).optional(),design:"knob",description:"initial open item(s)"},value:{schema:z.union([z.string(),z.array(z.string())]).optional(),design:"knob",description:"controlled"},onValueChange:{schema:z.unknown().optional(),design:"event"},children:{schema:z.unknown(),design:"plumbing",description:"the row label users click to expand"}}};var pi={name:"AiChat",description:'A flexible chat block \u2014 header + scrollable message list + composer. Out of the box it looks like a polished "AI panel"; under it, every region is a slot so hosts can compose richer chat surfaces (e.g. Studio\'s left column with selection chip + settings panel above the composer, an error banner inline, per-message usage / refs / actions). Per-turn token usage, refs, and actions are optional and gated by `showUsage` / `showRefs` / `showActions` \u2014 leave them off for product-facing chats, turn them on for developer-facing ones where transparency matters. Composes with [[AIChatComposer]] (rendered internally; can be slotted in with custom props via `composerSlot`).',import:"@gradeui/ui",aliases:["ai chat","chat panel","chat block","llm chat","assistant panel","copilot chat","ai assistant"],composesWith:["Card (host in a sidebar panel)","Sheet (mobile drawer)","Stack (place above other content)","AIChatComposer (internal composer; slot to override)"],styleDefaults:{MessageActions:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px]",ThinkingDisclosure:"w-3.5 h-3.5 text-gds-gray-500 dark:text-gds-gray-400 shrink-0",StepsDisclosure:"w-3.5 h-3.5 text-gds-gray-500 dark:text-gds-gray-400 transition-transform shrink-0",AIChat:"flex flex-col overflow-hidden"},props:{messages:{schema:z.unknown().optional(),design:"plumbing",description:'`{ id, role: "user" | "assistant", content, timestamp, thinking?, steps?, usage?, refs?, actions?, duration? }`; defaults to empty'},onSendMessage:{schema:z.unknown().optional(),design:"event",description:"fires when the user submits via the default composer; ignored if `composerSlot` is set"},isLoading:{schema:z.boolean().optional(),design:"knob",description:"shows a typing indicator at the bottom of the message list"},placeholder:{schema:z.string().optional(),design:"content",description:"composer placeholder text (ignored if `composerSlot` is set)"},title:{schema:z.string().optional(),design:"plumbing",description:'header title; defaults to "AI Assistant"'},titleIcon:{schema:z.unknown().optional(),design:"plumbing",description:"optional icon rendered before the title (e.g. `<Sparkles />`)"},headerTokens:{schema:z.number().optional(),design:"knob",description:'optional session-level token total shown on the right of the header; rendered as "N tokens" with a small gauge icon when set'},headerEnd:{schema:z.unknown().optional(),design:"plumbing",description:"optional arbitrary content appended after `headerTokens` on the right of the header"},showUsage:{schema:z.boolean().optional(),design:"knob",description:"show the per-turn `usage` strip below the assistant bubble; default false"},showRefs:{schema:z.boolean().optional(),design:"knob",description:"show the per-turn `refs` strip below the assistant bubble; default false"},showActions:{schema:z.boolean().optional(),design:"knob",description:"render per-turn `actions` chips when a message has them; default true"},showDuration:{schema:z.boolean().optional(),design:"knob",description:'render the per-turn wall-clock duration ("2.3s") below the assistant bubble when a message carries `duration`; default false'},showThinking:{schema:z.boolean().optional(),design:"knob",description:'render the per-turn reasoning ("Thoughts") disclosure above the assistant prose when a message carries `thinking`; collapsed by default, click to expand; default false'},showSteps:{schema:z.boolean().optional(),design:"knob",description:'render the per-turn step timeline above the assistant prose when a message carries `steps`; collapsed view shows the current running step (or "N steps completed"), click to expand the vertical timeline with status glyphs; default false'},thinkingPhrase:{schema:z.string().optional(),design:"content",description:'override the "Thinking" label in the loading indicator'},suggestedPrompts:{schema:z.unknown().optional(),design:"plumbing",description:"empty-state quick prompts (ignored if `emptyStateSlot` is set)"},emptyStateSlot:{schema:z.unknown().optional(),design:"plumbing",description:"replaces the default empty state entirely"},errorSlot:{schema:z.unknown().optional(),design:"plumbing",description:"rendered after the messages list (typically an error banner)"},composerAboveSlot:{schema:z.unknown().optional(),design:"plumbing",description:"rendered between the messages and the composer (selection chip, settings panel)"},composerBelowSlot:{schema:z.unknown().optional(),design:"plumbing",description:"rendered below the composer (disclaimer, char counter)"},composerSlot:{schema:z.unknown().optional(),design:"plumbing",description:"full override of the composer; when provided, `onSendMessage` + `placeholder` are unused"},bare:{schema:z.boolean().optional(),design:"knob",description:"strip the outer card chrome (background, border, rounded corners) so the chat takes the surface of its container; default false (keeps the canned card look)"},assistantBubble:{schema:z.boolean().optional(),design:"knob",description:"whether assistant messages render with a bubble (background + border + padding + rounded corners); default true. Set false for a Claude.ai-style chromeless transcript where assistant text sits on the surface and only user turns wear a bubble."},className:{schema:z.string().optional(),design:"plumbing"}}};var mi={name:"AiChatComposer",description:"The reusable \"input card\" for any chat surface \u2014 auto-growing textarea, image attachments via paperclip and clipboard paste, attachment chips with previews, Send/Stop toggle, controlled value. Drop in below any messages list. Use this when you want the input affordances of `<AIChat>` but you're rendering your own messages list / scrollarea / header (e.g. Studio's left-column chat, where SelectionChip and SettingsPanel sit between messages and composer). For the full canned chat block, use `<AIChat>` instead.",import:"@gradeui/ui",aliases:["chat composer","chat input","prompt composer","message input"],composesWith:["AIChat (uses this internally)","Card (host above)","ScrollArea (place messages above)"],styleDefaults:{AIChatComposer:"w-full"},props:{value:{schema:z.string(),design:"content",description:"controlled textarea value"},onChange:{schema:z.unknown(),design:"event",description:"fires for every textarea change"},onSend:{schema:z.unknown(),design:"event",description:"fires when the user submits (Enter or click Send); composer validates that text or attachments exist before firing"},isLoading:{schema:z.boolean().optional(),design:"knob",description:"disables the textarea + paperclip and swaps Send for Stop"},onStop:{schema:z.unknown().optional(),design:"event",description:"fires when the user clicks Stop; without this, Stop renders disabled"},placeholder:{schema:z.string().optional(),design:"content"},maxLength:{schema:z.number().optional(),design:"knob",description:"hard cap passed to the underlying `<textarea>`"},showHint:{schema:z.boolean().optional(),design:"knob",description:'show the "Press Enter\u2026 \xB7 Paste images" hint below the card; default true, set false when the host renders its own footer'},className:{schema:z.string().optional(),design:"plumbing"}}};var ui={name:"AppShell",description:`The top-level page scaffold for any app-like or marketing layout. Reach for AppShell
3
3
  instead of hand-rolling \`grid grid-cols-[auto_1fr]\` so the layout shape (top nav,
4
4
  side nav, three-pane Slack/Mail/Notion shape, constrained vs full-width main) is a
5
5
  prop the settings panel can mutate. Don't compose top-level layouts from raw grid
@@ -14,7 +14,7 @@ Pick the \`nav\` variant from the source:
14
14
  shape. ANY time you see a vertical icon rail next to
15
15
  a separate list/sidebar, this is the answer \u2014 don't
16
16
  reach for raw \`<div className="grid">\` with three
17
- column tracks.`,import:"@gradeui/ui",subcomponents:["AppShellHeader","AppShellNav","AppShellAside","AppShellMain","AppShellFooter"],composesWith:["Stack","Row","Card","Button","Separator","Sidebar","Toolbar","any page content"],props:{nav:{schema:z.enum(["none","top","side","three-pane"]).optional(),design:"knob",description:"layout structure",default:"none"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"render as the child element via Slot",default:false},className:{schema:z.string().optional(),design:"plumbing"},children:{schema:z.unknown(),design:"plumbing"}}};var yn={name:"Avatar",description:"User/entity identity for PEOPLE \u2014 profile pictures, author rows, member lists, account headers. Circular by default; the AvatarFallback initials read as a person's name. Always include AvatarFallback so load failure doesn't leave a gap.",import:"@gradeui/ui",aliases:["profile picture","user image","account image","avatar","person glyph","user avatar","profile image","react native avatar"],subcomponents:["AvatarImage","AvatarFallback"],composesWith:["Card (in CardHeader)","Table cells","Badge (placed next to for status)","Skeleton (loading state)"],props:{className:{schema:z.unknown().optional(),design:"plumbing",description:"set size via utilities (default h-10 w-10)"},src:{schema:z.unknown(),design:"plumbing"},initials:{schema:z.unknown(),design:"plumbing"}}};var wn={name:"Badge",description:"Compact status chips, counts, tags, pills. For higher-signal inline status \u2192 use Callout. For solid CTAs \u2192 Button. Soft/outline variants are quieter; solid variants are loud.",import:"@gradeui/ui",aliases:["chip","tag","pill","label chip","badge","tag view","status pill","token","count badge"],composesWith:["Card","Table (inside a cell)","Avatar (next to it)","anywhere inline"],props:{variant:{schema:z.enum(["see list above"]).optional(),design:"knob"},rounded:{schema:z.enum(["default","full"]).optional(),design:"knob",description:'"full" gives a pill shape'}}};var Rn={name:"Banner",description:`A full-width horizontal strip surfacing system-level state, announcements, or first-run guidance \u2014 "you're previewing a draft", "investigating incident", "new feature available", "send your design to Figma". Distinct from Callout (inline boxed message in the layout flow), Toast (transient floating notification), Dialog (modal interrupt). Banner is what lives at the TOP of an AppShellHeader, page, or panel.`,import:"@gradeui/ui",aliases:["banner","notification banner","system banner","header banner","announcement bar","top bar","status bar","promo banner","incident banner","draft banner","first run banner","glass banner","sticky banner"],composesWith:["AppShellHeader (most common host \u2014 banner sits ABOVE the header content)","Button (in the action slot)","Link (inside the content)","Lucide icons (in the icon slot)"],props:{variant:{schema:z.enum(["default","info","success","warning","destructive","announcement"]).optional(),design:"knob",description:'intent + tonal direction. `default` is a calm muted strip; `announcement` is a low-alpha brand tint for "new feature" messaging; status variants pick up the soft+deep token pairs.'},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"material applied over the variant tint. `glass` for banners that sit over imagery / generative backdrops."},align:{schema:z.enum(["start","center","between"]).optional(),design:"knob",description:"justify behaviour of the inner flex row. Defaults to `between` so the action / dismiss button right-align."},sticky:{schema:z.boolean().optional(),design:"knob",description:"stick to the top of the scroll container."},dismissible:{schema:z.boolean().optional(),design:"knob",description:"render the trailing X close button. Pair with `onDismiss` to react."},onDismiss:{schema:z.unknown().optional(),design:"event"},icon:{schema:z.unknown().optional(),design:"plumbing",description:"leading icon slot. NOT inferred from variant; pass what fits the message."},action:{schema:z.unknown().optional(),design:"plumbing",description:'trailing slot before dismiss. Usually a `<Button size="sm">` or `<a>`.'},role:{schema:z.string().optional(),design:"plumbing",description:"overrides the automatic role mapping (warning/destructive \u2192 alert, others \u2192 status)."}}};var Sn={name:"Breadcrumb",description:'Reach for Breadcrumb whenever a screen sits inside a hierarchy and you want the path back to the top to be visible. Common spots: above page titles in admin/CMS screens, top of Settings detail pages, after a router redirect when the URL implies depth. Use the current page as a <BreadcrumbPage> (non-clickable) and prior levels as <BreadcrumbLink>. For a horizontal "top nav" of peer destinations use Side Menu or Tabs instead \u2014 Breadcrumb is strictly for hierarchical path.',import:"@gradeui/ui",aliases:["breadcrumb","breadcrumbs","crumbs","path","page hierarchy","path bar","navigation trail","finder path"],subcomponents:["BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbPage","BreadcrumbSeparator","BreadcrumbEllipsis"],composesWith:["AppShellMain","Card (in CardHeader)","Dialog"],props:{"aria-label":{schema:z.unknown().optional(),design:"plumbing",description:"passed to the underlying <nav>"},separator:{schema:z.unknown().optional(),design:"plumbing",description:'**tree-wide default** for every <BreadcrumbSeparator/> inside. Pass a string ("/", "\u203A", "\u2022"), a lucide icon (`<Slash/>`, `<ChevronRight/>`), or any ReactNode. Default: `<ChevronRight/>`. Set once on the root; every separator below picks it up via context.'},className:{schema:z.unknown().optional(),design:"plumbing",description:"the <ol> wrapper; usually no overrides needed"},href:{schema:z.unknown().optional(),design:"plumbing",description:"renders as <a> when set, <button> when not; asChild? wraps a custom element"},children:{schema:z.unknown().optional(),design:"plumbing",description:"per-instance override of the separator glyph. When set, beats the root's `separator` prop for this one slot. When not set, falls back to the root's `separator`, then to `<ChevronRight/>`."}}};var Cn={name:"Button",description:'Any clickable action. Use size="icon" for square icon-only buttons, variant="link" for inline links that should look like Button, variant="raised" for high-commitment / weighty actions where the chrome can afford a tactile "physical key" treatment. A Button placed next to a TabsList of the same size lines up edge-to-edge without per-call overrides.',import:"@gradeui/ui",aliases:["button","push button","plain button","bordered button","destructive button","capsule button","link button","action button","cta","raised button","pill button","key button"],composesWith:["Dialog","DropdownMenu","Tooltip","Card (in CardFooter)","Row","Form controls"],props:{variant:{schema:z.enum(["default","destructive","outline","secondary","ghost","link","raised"]).optional(),design:"knob"},size:{schema:z.enum(["sm","md","lg","icon"]).optional(),design:"knob",description:"t-shirt scale aligned with Tabs/ToggleGroup heights (sm=h-7, md=h-8, lg=h-10). `default` still works as an alias for `md`."},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"renders as the child element (use to wrap <a>/<Link>)"},disabled:{schema:z.boolean().optional(),design:"knob"}}};var kn={name:"Calendar",description:'An inline date grid \u2014 date-of-birth pickers in profile forms, scheduling screens with a month view, range selection in reporting filters. For a compact trigger-and-popover input, use DatePicker / DateRangePicker (which wrap Calendar internally). For one-off relative dates ("yesterday", "last week") use a Select instead.',import:"@gradeui/ui",aliases:["calendar","date grid","month view","scheduler grid","calendar view","multidate picker","react native calendars"],subcomponents:["CalendarDayButton"],composesWith:["Popover (DatePicker composes them)","Card (inline scheduling card)","Dialog (full-screen mobile date pick)"],props:{mode:{schema:z.enum(["single","multiple","range"]).optional(),design:"knob",description:"picks one date, several dates, or a [from, to] range"},selected:{schema:z.unknown().optional(),design:"plumbing",description:"controlled selection; shape matches `mode`"},onSelect:{schema:z.unknown().optional(),design:"event",description:"fires with the new selection"},month:{schema:z.unknown().optional(),design:"plumbing",description:"controlled displayed month"},defaultMonth:{schema:z.unknown().optional(),design:"plumbing",description:"uncontrolled initial month"},onMonthChange:{schema:z.unknown().optional(),design:"event"},numberOfMonths:{schema:z.number().optional(),design:"knob",description:"render multiple months side by side, useful for range pickers"},disabled:{schema:z.unknown().optional(),design:"plumbing"},captionLayout:{schema:z.enum(["label","dropdown","dropdown-months","dropdown-years"]).optional(),design:"knob"},className:{schema:z.string().optional(),design:"plumbing"}}};var Tn={name:"Callout",description:"Inline, ambient, non-blocking status/feedback that sits inside the layout flow. Form-level validation summaries, settings-page notices, page-level banners. NOT a toast (use Sonner for transient). NOT a modal (use Dialog when the user must respond). Put an icon as first child \u2014 it's auto-positioned; CalloutTitle + CalloutDescription follow.",import:"@gradeui/ui",aliases:["callout","banner","notice","inline alert","in-app notification","status banner","info banner","info callout","warning callout","success callout"],subcomponents:["CalloutTitle","CalloutDescription"],composesWith:["lucide-react icons as first child","Button (inside CalloutDescription)","Card (as a section callout)"],props:{variant:{schema:z.enum(["default","destructive","success","warning","info"]).optional(),design:"knob",description:"semantic colouring; `default` is neutral"}}};var Mn={name:"Card",description:'Grouped content with a distinct surface \u2014 settings panels, dashboard tiles, list-of-cards layouts, marketing hero containers, AI suggestion overlays. Pair CardHeader (title + description) with CardContent and optional CardFooter (actions). Reach for `surface="glass"` whenever the card sits over a busy backdrop (gradient mesh, dot grid, generative art, image hero).',import:"@gradeui/ui",aliases:["card","group box","groupbox","panel","tile","surface","glass card","frosted card","floating panel","hero card","ai suggestion card","dashboard tile","settings panel"],subcomponents:["CardHeader","CardTitle","CardDescription","CardContent","CardFooter"],composesWith:["Button (in CardFooter)","Badge","Separator","Avatar","Code","MediaSurface","any form controls"],props:{surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the card surface is *made of*. `solid` is the default opaque `bg-card`. `translucent` is ~82% opacity for menu sheets. `glass` is ~58% opacity + 14px blur + edge highlight for floating panels. `glass-strong` is ~42% + 24px blur for full-page overlays. Composes with `shadow-elevation-*` (depth) and `gds-aura-*` (state signal)."},Each:{schema:z.unknown(),design:"plumbing"}}};var zd=z.enum(["start","center","end"]),Od=z.object({delay:z.number().int().positive().optional(),pauseOnHover:z.boolean().optional(),pauseWhenOffscreen:z.boolean().optional()}),Vd=z.union([z.boolean(),Od]),Nn={name:"Carousel",description:"Token-driven slideshow primitive. Embla under the hood, custom autoplay loop with per-slide duration overrides, and a VideoSlide variant that autoplays muted+loop with a poster fallback. Reach for it for marketing hero rotations, app onboarding tours, image galleries, TV/streaming featured rails \u2014 anywhere a horizontal stack of slides cycles automatically or on user input.",import:"@gradeui/ui",aliases:["carousel","slideshow","slider","hero rotation","image gallery","featured row","swipe deck"],subcomponents:["Carousel.Slide","Carousel.VideoSlide","Carousel.Dots","Carousel.Arrows","Carousel.Prev","Carousel.Next"],composesWith:["MediaSurface (inside Carousel.Slide for posters / album art)","Card (slide content)","Stack / Row (slide composition)"],props:{loop:{schema:z.boolean().optional(),design:"knob",label:"Loop",default:true,description:"Wrap from the last slide back to the first. Default true \u2014 the natural fit for hero rotations. Turn off for finite onboarding sequences."},align:{schema:zd.optional(),design:"knob",control:"toggle-group",label:"Slide alignment",default:"start",description:"How slides line up inside the viewport when not at 100% width. 'start' is full-bleed; 'center' gives the 'peek of neighbours' carousel look."},slidesPerView:{schema:z.number().int().positive().optional(),design:"knob",label:"Slides per view",default:1,description:"How many slides show at once. 1 for hero rotations; 3 for thumbnail strips; etc. For media-query responsive layouts, leave this at 1 and override `--gds-carousel-slide-basis` on each Slide via CSS."},autoplay:{schema:Vd.optional(),design:"structured",label:"Autoplay",default:false,description:"`true` for sensible defaults (5s, pause on hover, pause offscreen). Object form: `{ delay, pauseOnHover, pauseWhenOffscreen }`. Per-slide overrides go on `<Carousel.Slide duration={ms}>`."},draggable:{schema:z.boolean().optional(),design:"knob",label:"Drag to swipe",default:true,description:"Disable when slide content (a Map, a chart, a draggable card) needs to swallow drag events."},onSlideChange:{schema:z.function().optional(),design:"event",description:"Fires with the new slide index whenever the active slide changes (programmatic, autoplay, or user swipe)."},className:{schema:z.string().optional(),design:"plumbing"},style:{schema:z.record(z.string(),z.unknown()).optional(),design:"plumbing"},children:{schema:z.unknown(),design:"plumbing",description:"Carousel.Slide / Carousel.VideoSlide children, plus optionally Carousel.Dots and Carousel.Arrows."}}};var En={name:"Chart",description:"Reporting dashboards, single-purpose analytics cards (revenue, conversions, active users), or anywhere you'd otherwise hand-roll a Recharts setup. Bring the actual chart type from `recharts` \u2014 ChartContainer doesn't pick the chart shape for you, it themes whatever you nest. For sparkline-style decorative trends consider just rendering a small SVG line directly; ChartContainer is overkill for non-interactive ornament.",import:"@gradeui/ui",aliases:["chart","charts","graph","bar chart","line chart","area chart","recharts","analytics chart","swift chart","swiftui chart","victory chart","victory native"],subcomponents:["ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","ChartStyle"],composesWith:["Card (chart-in-a-card pattern)","Tabs (multi-metric switcher)","Recharts components (Bar","Line","Area","Pie",'Radar from "recharts")'],props:{config:{schema:z.unknown(),design:"plumbing",description:'`{ [seriesKey]: { label: string; color?: string; theme?: { light: string; dark: string } } }`; the keys here are the names you reference in your Recharts <Bar dataKey="\u2026" /> calls'},id:{schema:z.string().optional(),design:"plumbing",description:"used for the inlined <style> tag"},children:{schema:z.unknown(),design:"plumbing",description:"typically a single Recharts ResponsiveContainer or chart"},passes:{schema:z.unknown(),design:"plumbing",description:"pair with `content={<ChartTooltipContent />}`"},indicator:{schema:z.enum(["dot","line","dashed"]).optional(),design:"knob"},ChartLegend:{schema:z.unknown(),design:"plumbing"}}};var Ln={name:"Checkbox",description:"Binary on/off tied to a list (select multiple, agree to terms). Single on/off that controls a setting is better with Switch.",import:"@gradeui/ui",aliases:["checkbox","tickbox","tick box","check","multi-select item"],composesWith:["Label (via htmlFor)","Card","Form rows","Table (for row selection)"],props:{checked:{schema:z.boolean().optional(),design:"knob"},onCheckedChange:{schema:z.unknown().optional(),design:"event"},defaultChecked:{schema:z.boolean().optional(),design:"knob"},disabled:{schema:z.boolean().optional(),design:"knob"},id:{schema:z.string().optional(),design:"plumbing",description:"bind a Label's htmlFor to this"}}};var Dn={name:"Code",description:'Read-only code surface for marketing heroes, docs, changelog entries, AI-output displays. Use `diff` for the "diff hero" pattern (before/after side-by-side or stacked). Use `reveal="lines"` with `trigger="inView"` for scroll-driven marketing pages. Use `reveal="typewriter"` for AI-output / chat-style displays. Use `bare` for inline code inside prose. NOT a code editor \u2014 for editable code, reach for an external editor primitive (CodeMirror / Monaco).',import:"@gradeui/ui",aliases:["code block","code","code snippet","code surface","syntax highlighted code","diff hero","diff view","diff block","changelog code","before after code","scroll-triggered code","typewriter code"],composesWith:["SectionBlock","Card","Tabs (for multi-file examples)","Carousel (slide-to-slide code progression)"],props:{source:{schema:z.string(),design:"content",description:"the code to render"},language:{schema:z.enum(["tsx","jsx","ts","js","html","css","json","bash","md","py","go","rust"]).optional(),design:"knob",description:"Prism language id; defaults to `tsx`"},highlight:{schema:z.unknown().optional(),design:"plumbing",description:"1-indexed line number, array of numbers, or array of `[start, end]` ranges to emphasise"},diff:{schema:z.unknown().optional(),design:"plumbing",description:"`{ added?: number[]; removed?: number[] }` \u2014 1-indexed lines for diff hero / changelog mode"},reveal:{schema:z.enum(["none","lines","typewriter","diff"]).optional(),design:"knob",description:"entrance animation; defaults to `none`"},trigger:{schema:z.enum(["mount","inView","manual"]).optional(),design:"knob",description:"what kicks the reveal off; defaults to `mount`"},play:{schema:z.boolean().optional(),design:"knob",description:'for `trigger="manual"`, set true to play'},speed:{schema:z.enum(["slow","normal","fast"]).optional(),design:"knob",description:"animation feel preset. `normal` (default) maps to the canonical 50ms/22ms staggers + 180ms pre-delay. Pick a feel; don't tune individual numbers unless you have to."},delay:{schema:z.number().optional(),design:"knob",description:"explicit delay before reveal starts (ms) \u2014 overrides the `speed` preset"},stagger:{schema:z.number().optional(),design:"knob",description:"explicit per-line stagger for `lines`/`diff`, per-token for `typewriter` (ms) \u2014 overrides the `speed` preset"},prompt:{schema:z.string().optional(),design:"content",description:'string prepended to each line. Use for terminal emulation: `prompt="$ "` for bash, `prompt="> "` for PowerShell, `prompt=">>> "` for Python REPL. Prompt characters render in muted token colour, don\'t pick up the typewriter stagger, and are hidden from screen readers.'},showLineNumbers:{schema:z.boolean().optional(),design:"knob"},filename:{schema:z.string().optional(),design:"content",description:"optional label rendered in the header chrome"},wrap:{schema:z.boolean().optional(),design:"knob",description:"wrap long lines instead of horizontal scroll"},bare:{schema:z.boolean().optional(),design:"knob",description:"drop chrome (border, header, padding) \u2014 for inline use"},size:{schema:z.enum(["xs","sm","md"]).optional(),design:"knob",description:"type-scale preset. `xs` (12px) for dense changelog cards / inline blocks; `sm` (14px, default) for marketing heroes and docs; `md` (16px) for focal-point displays."},height:{schema:z.enum(["auto","number","string"]).optional(),design:"knob",description:'container sizing. `auto` (default) grows with content. Number = pixels (`300` \u2192 `300px`). String passes through as CSS (`"20rem"`, `"50vh"`).'},maxLines:{schema:z.number().optional(),design:"knob",description:"cap the visible line count at exactly N line-heights. Wins over `height`. Inherits the current size's line-height automatically."}}};var An={name:"Collapsible",description:'A single show/hide reveal \u2014 "Show advanced settings" rows, expandable inline help, "More details" sections inside cards. For multiple rows of expandable content where one-at-a-time matters, reach for Accordion. For a separate panel that floats above content, use Popover.',import:"@gradeui/ui",aliases:["collapsible","expand","show more","disclosure","advanced settings","disclosure group","expandable section","expandable view","show hide"],subcomponents:["CollapsibleTrigger","CollapsibleContent"],composesWith:["Button (as the trigger","asChild)","Card (expandable settings group)","Row (header + chevron)"],props:{open:{schema:z.boolean().optional(),design:"knob",description:"controlled open state"},defaultOpen:{schema:z.boolean().optional(),design:"knob",description:"uncontrolled initial state"},onOpenChange:{schema:z.unknown().optional(),design:"event"},children:{schema:z.unknown(),design:"plumbing",description:"the clickable header (often a Button asChild)"}}};var Hn={name:"Command",description:'A searchable list of actions or destinations \u2014 global \u2318K palettes, "jump to" inputs, account switchers with filter. Wrap in CommandDialog when it should pop over the entire app on a hotkey. For straight forms with filter, prefer a Select with a search input. For free-text autocomplete tied to a single value, prefer Combobox built on Popover + Command.',import:"@gradeui/ui",aliases:["command palette","command menu","cmd k","quick switcher","action menu","spotlight","spotlight search","quick open","fuzzy finder"],subcomponents:["CommandInput","CommandList","CommandEmpty","CommandGroup","CommandItem","CommandSeparator","CommandShortcut","CommandDialog"],composesWith:["Dialog (CommandDialog wraps it)","Popover (inline combobox)","Tooltip"],props:{value:{schema:z.string().optional(),design:"content",description:"controlled active item value"},onValueChange:{schema:z.unknown().optional(),design:"event"},placeholder:{schema:z.string().optional(),design:"content"},children:{schema:z.unknown(),design:"plumbing",description:"wraps groups and empty state"},heading:{schema:z.string().optional(),design:"content"},onSelect:{schema:z.unknown().optional(),design:"event"},disabled:{schema:z.boolean().optional(),design:"knob"},open:{schema:z.unknown(),design:"plumbing",description:"when you want the command palette mounted in a modal (cmd+k pattern)"}}};var In={name:"Composer",description:`THE PRIMITIVE for any text composition surface \u2014 Slack / Discord /
17
+ column tracks.`,import:"@gradeui/ui",subcomponents:["AppShellHeader","AppShellNav","AppShellAside","AppShellMain","AppShellFooter"],composesWith:["Stack","Row","Card","Button","Separator","Sidebar","Toolbar","any page content"],styleDefaults:{AppShell:"gds-app-shell min-h-screen w-full bg-background text-foreground grid",AppShellHeader:"gds-app-shell-header",AppShellNav:"gds-app-shell-nav border-b bg-background",AppShellAside:"gds-app-shell-aside min-w-0 border-r bg-background",AppShellMain:"gds-app-shell-main min-w-0 w-full",AppShellFooter:"gds-app-shell-footer border-t bg-background"},variantDefaults:{nav:"none"},props:{nav:{schema:z.enum(["none","top","side","three-pane"]).optional(),design:"knob",description:"layout structure",default:"none"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"render as the child element via Slot",default:false},className:{schema:z.string().optional(),design:"plumbing"},children:{schema:z.unknown(),design:"plumbing"}}};var gi={name:"Avatar",description:"User/entity identity for PEOPLE \u2014 profile pictures, author rows, member lists, account headers. Circular by default; the AvatarFallback initials read as a person's name. Always include AvatarFallback so load failure doesn't leave a gap.",import:"@gradeui/ui",aliases:["profile picture","user image","account image","avatar","person glyph","user avatar","profile image","react native avatar"],subcomponents:["AvatarImage","AvatarFallback"],composesWith:["Card (in CardHeader)","Table cells","Badge (placed next to for status)","Skeleton (loading state)"],styleDefaults:{AvatarImage:"aspect-square h-full w-full"},props:{className:{schema:z.unknown().optional(),design:"plumbing",description:"set size via utilities (default h-10 w-10)"},src:{schema:z.unknown(),design:"plumbing"},initials:{schema:z.unknown(),design:"plumbing"}}};var fi={name:"BackgroundFill",description:"The background *paint* of a frame \u2014 a generative shader, image, video, gradient, repeating texture, or solid token rendered as a layer BEHIND the frame's content. Use it as the first child of a `relative` frame; it paints an `absolute inset-0`, `z-0`, `pointer-events-none` layer, so content carrying `relative z-10` sits on top. This is the canonical way to give any container a rich background \u2014 never drop a full-bleed `<ThreeScene>` or `<img>` as a free-standing sibling. For a sized, in-flow media element (a hero card, a thumbnail), use ThreeScene / MediaSurface / VideoPlayer directly instead.",import:"@gradeui/ui",aliases:["background","fill","frame fill","backdrop","surface fill","background image","background video","background gradient","background shader","texture","paint"],composesWith:["AppShell","Card","Stack","Row","Grid (any relative container)","ThreeScene (shader fill)","MediaSurface"],styleDefaults:{BackgroundFill:"absolute inset-0 h-full w-full"},props:{type:{schema:z.enum(["none","solid","gradient","image","video","shader"]),design:"knob",description:"which paint to render (required)"},color:{schema:z.string().optional(),design:"content",description:"solid fill; a token name (`primary`, `card`, `muted`, `accent`, `secondary`, `destructive`, `background`, `transparent`) or any CSS colour"},gradient:{schema:z.unknown().optional(),design:"plumbing",description:'stops are token names or CSS colours. shape: "linear" (default, uses `angle`, default 135\xB0) | "radial" (uses `at` \u2014 CSS position like "top" / "30% 20%", default "center" \u2014 and optional `size` like "45rem 50rem", default farthest-corner)'},src:{schema:z.string().optional(),design:"content",description:"image or video URL"},fit:{schema:z.enum(["cover","contain","fill","none"]).optional(),design:"knob",description:'object-fit for image/video (default "cover")'},position:{schema:z.string().optional(),design:"content",description:'CSS object/background position (default "center")'},repeat:{schema:z.boolean().optional(),design:"knob",description:"tile the image (background-repeat) instead of a single <img>"},tileSize:{schema:z.string().optional(),design:"content",description:'CSS background-size when repeating (e.g. "120px")'},preset:{schema:z.string().optional(),design:"content",description:"shader preset id (see ThreeScene)"},fragmentShader:{schema:z.string().optional(),design:"content",description:"custom GLSL (takes precedence over preset)"},palette:{schema:z.unknown().optional(),design:"plumbing",description:"shader palette overrides; wrap tokens as `oklch(var(--token))`"},postPreset:{schema:z.string().optional(),design:"content",description:"shader post-FX"},opacity:{schema:z.number().optional(),design:"knob",description:"layer opacity 0\u20131"},blendMode:{schema:z.unknown().optional(),design:"plumbing",description:"blend against the frame behind it"},radius:{schema:z.enum(["none","sm","md","lg","xl"]).optional(),design:"knob",description:"match the frame's radius so the paint clips cleanly"}}};var bi={name:"Badge",description:"Compact status chips, counts, tags, pills. For higher-signal inline status \u2192 use Callout. For solid CTAs \u2192 Button. Soft/outline variants are quieter; solid variants are loud.",import:"@gradeui/ui",aliases:["chip","tag","pill","label chip","badge","tag view","status pill","token","count badge"],composesWith:["Card","Table (inside a cell)","Avatar (next to it)","anywhere inline"],styleDefaults:{Badge:"inline-flex items-center gap-1 border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 [&_svg]:size-3 [&_svg]:shrink-0 border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80 rounded-md"},variantDefaults:{variant:"default",rounded:"default"},props:{variant:{schema:z.enum(["see list above"]).optional(),design:"knob"},rounded:{schema:z.enum(["default","full"]).optional(),design:"knob",description:'"full" gives a pill shape'}}};var vi={name:"Banner",description:`A full-width horizontal strip surfacing system-level state, announcements, or first-run guidance \u2014 "you're previewing a draft", "investigating incident", "new feature available", "send your design to Figma". Distinct from Callout (inline boxed message in the layout flow), Toast (transient floating notification), Dialog (modal interrupt). Banner is what lives at the TOP of an AppShellHeader, page, or panel.`,import:"@gradeui/ui",aliases:["banner","notification banner","system banner","header banner","announcement bar","top bar","status bar","promo banner","incident banner","draft banner","first run banner","glass banner","sticky banner"],composesWith:["AppShellHeader (most common host \u2014 banner sits ABOVE the header content)","Button (in the action slot)","Link (inside the content)","Lucide icons (in the icon slot)"],styleDefaults:{Banner:"relative flex items-center gap-3 px-4 py-2.5 text-sm leading-relaxed border-b bg-muted text-foreground border-border [&>svg]:text-muted-foreground justify-between"},variantDefaults:{variant:"default",align:"between"},props:{variant:{schema:z.enum(["default","info","success","warning","destructive","announcement"]).optional(),design:"knob",description:'intent + tonal direction. `default` is a calm muted strip; `announcement` is a low-alpha brand tint for "new feature" messaging; status variants pick up the soft+deep token pairs.'},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"material applied over the variant tint. `glass` for banners that sit over imagery / generative backdrops."},align:{schema:z.enum(["start","center","between"]).optional(),design:"knob",description:"justify behaviour of the inner flex row. Defaults to `between` so the action / dismiss button right-align."},sticky:{schema:z.boolean().optional(),design:"knob",description:"stick to the top of the scroll container."},dismissible:{schema:z.boolean().optional(),design:"knob",description:"render the trailing X close button. Pair with `onDismiss` to react."},onDismiss:{schema:z.unknown().optional(),design:"event"},icon:{schema:z.unknown().optional(),design:"plumbing",description:"leading icon slot. NOT inferred from variant; pass what fits the message."},action:{schema:z.unknown().optional(),design:"plumbing",description:'trailing slot before dismiss. Usually a `<Button size="sm">` or `<a>`.'},role:{schema:z.string().optional(),design:"plumbing",description:"overrides the automatic role mapping (warning/destructive \u2192 alert, others \u2192 status)."}}};var yi={name:"Breadcrumb",description:'Reach for Breadcrumb whenever a screen sits inside a hierarchy and you want the path back to the top to be visible. Common spots: above page titles in admin/CMS screens, top of Settings detail pages, after a router redirect when the URL implies depth. Use the current page as a <BreadcrumbPage> (non-clickable) and prior levels as <BreadcrumbLink>. For a horizontal "top nav" of peer destinations use Side Menu or Tabs instead \u2014 Breadcrumb is strictly for hierarchical path.',import:"@gradeui/ui",aliases:["breadcrumb","breadcrumbs","crumbs","path","page hierarchy","path bar","navigation trail","finder path"],subcomponents:["BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbPage","BreadcrumbSeparator","BreadcrumbEllipsis"],composesWith:["AppShellMain","Card (in CardHeader)","Dialog"],styleDefaults:{BreadcrumbList:"flex flex-wrap items-center gap-1.5 break-words text-xs text-muted-foreground",BreadcrumbItem:"inline-flex items-center gap-1.5",BreadcrumbPage:"inline-flex items-center gap-1.5 px-0.5 text-xs font-medium text-foreground",BreadcrumbSeparator:"[&_svg]:size-3 [&_svg]:shrink-0 text-muted-foreground/60",BreadcrumbEllipsis:"flex h-5 w-5 items-center justify-center",BreadcrumbMenuTrigger:"h-3 w-3 text-muted-foreground transition-transform"},props:{"aria-label":{schema:z.unknown().optional(),design:"plumbing",description:"passed to the underlying <nav>"},separator:{schema:z.unknown().optional(),design:"plumbing",description:'**tree-wide default** for every <BreadcrumbSeparator/> inside. Pass a string ("/", "\u203A", "\u2022"), a lucide icon (`<Slash/>`, `<ChevronRight/>`), or any ReactNode. Default: `<ChevronRight/>`. Set once on the root; every separator below picks it up via context.'},className:{schema:z.unknown().optional(),design:"plumbing",description:"the <ol> wrapper; usually no overrides needed"},href:{schema:z.unknown().optional(),design:"plumbing",description:"renders as <a> when set, <button> when not; asChild? wraps a custom element"},children:{schema:z.unknown().optional(),design:"plumbing",description:"per-instance override of the separator glyph. When set, beats the root's `separator` prop for this one slot. When not set, falls back to the root's `separator`, then to `<ChevronRight/>`."}}};var xi={name:"Button",description:'Any clickable action. Use size="icon" for square icon-only buttons, variant="link" for inline links that should look like Button, variant="raised" for high-commitment / weighty actions where the chrome can afford a tactile "physical key" treatment. A Button placed next to a TabsList of the same size lines up edge-to-edge without per-call overrides.',import:"@gradeui/ui",aliases:["button","push button","plain button","bordered button","destructive button","capsule button","link button","action button","cta","raised button","pill button","key button"],composesWith:["Dialog","DropdownMenu","Tooltip","Card (in CardFooter)","Row","Form controls"],styleDefaults:{Button:"inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 bg-primary text-primary-foreground shadow hover:bg-primary/90 h-8 gap-1.5 px-3 text-base [&_svg]:size-4"},variantDefaults:{variant:"default",size:"md"},props:{variant:{schema:z.enum(["default","destructive","outline","secondary","ghost","link","raised"]).optional(),design:"knob"},size:{schema:z.enum(["sm","md","lg","icon"]).optional(),design:"knob",description:"t-shirt scale aligned with Tabs/ToggleGroup heights (sm=h-7, md=h-8, lg=h-10). `default` still works as an alias for `md`."},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"renders as the child element (use to wrap <a>/<Link>)"},disabled:{schema:z.boolean().optional(),design:"knob"}}};var wi={name:"Calendar",description:'An inline date grid \u2014 date-of-birth pickers in profile forms, scheduling screens with a month view, range selection in reporting filters. For a compact trigger-and-popover input, use DatePicker / DateRangePicker (which wrap Calendar internally). For one-off relative dates ("yesterday", "last week") use a Select instead.',import:"@gradeui/ui",aliases:["calendar","date grid","month view","scheduler grid","calendar view","multidate picker","react native calendars"],subcomponents:["CalendarDayButton"],composesWith:["Popover (DatePicker composes them)","Card (inline scheduling card)","Dialog (full-screen mobile date pick)"],styleDefaults:{Calendar:"bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent"},props:{mode:{schema:z.enum(["single","multiple","range"]).optional(),design:"knob",description:"picks one date, several dates, or a [from, to] range"},selected:{schema:z.unknown().optional(),design:"plumbing",description:"controlled selection; shape matches `mode`"},onSelect:{schema:z.unknown().optional(),design:"event",description:"fires with the new selection"},month:{schema:z.unknown().optional(),design:"plumbing",description:"controlled displayed month"},defaultMonth:{schema:z.unknown().optional(),design:"plumbing",description:"uncontrolled initial month"},onMonthChange:{schema:z.unknown().optional(),design:"event"},numberOfMonths:{schema:z.number().optional(),design:"knob",description:"render multiple months side by side, useful for range pickers"},disabled:{schema:z.unknown().optional(),design:"plumbing"},captionLayout:{schema:z.enum(["label","dropdown","dropdown-months","dropdown-years"]).optional(),design:"knob"},className:{schema:z.string().optional(),design:"plumbing"}}};var Ri={name:"Callout",description:"Inline, ambient, non-blocking status/feedback that sits inside the layout flow. Form-level validation summaries, settings-page notices, page-level banners. NOT a toast (use Sonner for transient). NOT a modal (use Dialog when the user must respond). Put an icon as first child \u2014 it's auto-positioned; CalloutTitle + CalloutDescription follow.",import:"@gradeui/ui",aliases:["callout","banner","notice","inline alert","in-app notification","status banner","info banner","info callout","warning callout","success callout"],subcomponents:["CalloutTitle","CalloutDescription"],composesWith:["lucide-react icons as first child","Button (inside CalloutDescription)","Card (as a section callout)"],styleDefaults:{CalloutTitle:"mb-1 font-medium leading-none tracking-tight",CalloutDescription:"text-sm [&_p]:leading-relaxed"},props:{variant:{schema:z.enum(["default","destructive","success","warning","info"]).optional(),design:"knob",description:"semantic colouring; `default` is neutral"}}};var ki={name:"Card",description:'Grouped content with a distinct surface \u2014 settings panels, dashboard tiles, list-of-cards layouts, marketing hero containers, AI suggestion overlays. Pair CardHeader (title + description) with CardContent and optional CardFooter (actions). Reach for `surface="glass"` whenever the card sits over a busy backdrop (gradient mesh, dot grid, generative art, image hero).',import:"@gradeui/ui",aliases:["card","group box","groupbox","panel","tile","surface","glass card","frosted card","floating panel","hero card","ai suggestion card","dashboard tile","settings panel"],subcomponents:["CardHeader","CardTitle","CardDescription","CardContent","CardFooter"],composesWith:["Button (in CardFooter)","Badge","Separator","Avatar","Code","MediaSurface","any form controls"],styleDefaults:{Card:"gds-card rounded-xl border text-card-foreground shadow",CardHeader:"flex flex-col space-y-1.5 p-6",CardTitle:"font-semibold leading-none tracking-tight",CardDescription:"text-sm text-muted-foreground",CardContent:"p-6 pt-0",CardFooter:"flex items-center p-6 pt-0"},props:{surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the card surface is *made of*. `solid` is the default opaque `bg-card`. `translucent` is ~82% opacity for menu sheets. `glass` is ~58% opacity + 14px blur + edge highlight for floating panels. `glass-strong` is ~42% + 24px blur for full-page overlays. Composes with `shadow-elevation-*` (depth) and `gds-aura-*` (state signal)."},Each:{schema:z.unknown(),design:"plumbing"}}};var ap=z.enum(["start","center","end"]),np=z.object({delay:z.number().int().positive().optional(),pauseOnHover:z.boolean().optional(),pauseWhenOffscreen:z.boolean().optional()}),ip=z.union([z.boolean(),np]),Ci={name:"Carousel",description:"Token-driven slideshow primitive. Embla under the hood, custom autoplay loop with per-slide duration overrides, and a VideoSlide variant that autoplays muted+loop with a poster fallback. Reach for it for marketing hero rotations, app onboarding tours, image galleries, TV/streaming featured rails \u2014 anywhere a horizontal stack of slides cycles automatically or on user input.",import:"@gradeui/ui",aliases:["carousel","slideshow","slider","hero rotation","image gallery","featured row","swipe deck"],subcomponents:["Carousel.Slide","Carousel.VideoSlide","Carousel.Dots","Carousel.Arrows","Carousel.Prev","Carousel.Next"],composesWith:["MediaSurface (inside Carousel.Slide for posters / album art)","Card (slide content)","Stack / Row (slide composition)"],props:{loop:{schema:z.boolean().optional(),design:"knob",label:"Loop",default:true,description:"Wrap from the last slide back to the first. Default true \u2014 the natural fit for hero rotations. Turn off for finite onboarding sequences."},align:{schema:ap.optional(),design:"knob",control:"toggle-group",label:"Slide alignment",default:"start",description:"How slides line up inside the viewport when not at 100% width. 'start' is full-bleed; 'center' gives the 'peek of neighbours' carousel look."},slidesPerView:{schema:z.number().int().positive().optional(),design:"knob",label:"Slides per view",default:1,description:"How many slides show at once. 1 for hero rotations; 3 for thumbnail strips; etc. For media-query responsive layouts, leave this at 1 and override `--gds-carousel-slide-basis` on each Slide via CSS."},autoplay:{schema:ip.optional(),design:"structured",label:"Autoplay",default:false,description:"`true` for sensible defaults (5s, pause on hover, pause offscreen). Object form: `{ delay, pauseOnHover, pauseWhenOffscreen }`. Per-slide overrides go on `<Carousel.Slide duration={ms}>`."},draggable:{schema:z.boolean().optional(),design:"knob",label:"Drag to swipe",default:true,description:"Disable when slide content (a Map, a chart, a draggable card) needs to swallow drag events."},onSlideChange:{schema:z.function().optional(),design:"event",description:"Fires with the new slide index whenever the active slide changes (programmatic, autoplay, or user swipe)."},className:{schema:z.string().optional(),design:"plumbing"},style:{schema:z.record(z.string(),z.unknown()).optional(),design:"plumbing"},children:{schema:z.unknown(),design:"plumbing",description:"Carousel.Slide / Carousel.VideoSlide children, plus optionally Carousel.Dots and Carousel.Arrows."}}};var Ti={name:"Chart",description:"Reporting dashboards, single-purpose analytics cards (revenue, conversions, active users), or anywhere you'd otherwise hand-roll a Recharts setup. Bring the actual chart type from `recharts` \u2014 ChartContainer doesn't pick the chart shape for you, it themes whatever you nest. For sparkline-style decorative trends consider just rendering a small SVG line directly; ChartContainer is overkill for non-interactive ornament.",import:"@gradeui/ui",aliases:["chart","charts","graph","bar chart","line chart","area chart","recharts","analytics chart","swift chart","swiftui chart","victory chart","victory native"],subcomponents:["ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","ChartStyle"],composesWith:["Card (chart-in-a-card pattern)","Tabs (multi-metric switcher)","Recharts components (Bar","Line","Area","Pie",'Radar from "recharts")'],styleDefaults:{ChartContainer:"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",ChartTooltipContent:"font-medium",ChartLegendContent:"flex items-center justify-center gap-4"},props:{config:{schema:z.unknown(),design:"plumbing",description:'`{ [seriesKey]: { label: string; color?: string; theme?: { light: string; dark: string } } }`; the keys here are the names you reference in your Recharts <Bar dataKey="\u2026" /> calls'},id:{schema:z.string().optional(),design:"plumbing",description:"used for the inlined <style> tag"},children:{schema:z.unknown(),design:"plumbing",description:"typically a single Recharts ResponsiveContainer or chart"},passes:{schema:z.unknown(),design:"plumbing",description:"pair with `content={<ChartTooltipContent />}`"},indicator:{schema:z.enum(["dot","line","dashed"]).optional(),design:"knob"},ChartLegend:{schema:z.unknown(),design:"plumbing"}}};var Pi={name:"Checkbox",description:"Binary on/off tied to a list (select multiple, agree to terms). Single on/off that controls a setting is better with Switch. For a label + description row, wrap in Field. When each option should be a whole selectable card (label + description, selected state on the card surface), use CheckboxCard.",import:"@gradeui/ui",aliases:["checkbox","tickbox","tick box","check","multi-select item"],composesWith:["Label (via htmlFor)","Field (label + description row)","CheckboxCard (whole-card selectable option)","Card","Form rows","Table (for row selection)"],styleDefaults:{Checkbox:"flex items-center justify-center text-current"},props:{checked:{schema:z.boolean().optional(),design:"knob"},onCheckedChange:{schema:z.unknown().optional(),design:"event"},defaultChecked:{schema:z.boolean().optional(),design:"knob"},disabled:{schema:z.boolean().optional(),design:"knob"},id:{schema:z.string().optional(),design:"plumbing",description:"bind a Label's htmlFor to this"}}};var Ni={name:"CheckboxCard",description:"Multi-select where each option is a whole selectable card (add-ons, feature toggles, opt-ins). The whole card is the control, so focus and the checked state live on the card surface. Standalone (not in a group). Static content only \u2014 never nest an interactive control inside. For a plain checkbox + label row use Field instead.",import:"@gradeui/ui",aliases:["checkbox card","selectable card","multi-select card","add-on card","feature card","opt-in card"],composesWith:["Badge (in aside)","MediaSurface (custom children)","Stack / Grid (laying out several)"],props:{checked:{schema:z.unknown().optional(),design:"plumbing",description:"standard checkbox state"},label:{schema:z.unknown().optional(),design:"plumbing",description:"title line"},description:{schema:z.unknown().optional(),design:"plumbing",description:"secondary line"},aside:{schema:z.unknown().optional(),design:"plumbing",description:"slot before the indicator (a Badge, price, hint)"},hideIndicator:{schema:z.boolean().optional(),design:"knob",description:"hide the check; selection shown by the card border + background"},indicatorPosition:{schema:z.enum(["leading","trailing"]).optional(),design:"knob",description:"default trailing"},children:{schema:z.unknown().optional(),design:"plumbing",description:"arbitrary static content instead of label/description"}}};var Mi={name:"Code",description:'Read-only code surface for marketing heroes, docs, changelog entries, AI-output displays. Use `diff` for the "diff hero" pattern (before/after side-by-side or stacked). Use `reveal="lines"` with `trigger="inView"` for scroll-driven marketing pages. Use `reveal="typewriter"` for AI-output / chat-style displays. Use `bare` for inline code inside prose. NOT a code editor \u2014 for editable code, reach for an external editor primitive (CodeMirror / Monaco).',import:"@gradeui/ui",aliases:["code block","code","code snippet","code surface","syntax highlighted code","diff hero","diff view","diff block","changelog code","before after code","scroll-triggered code","typewriter code"],composesWith:["SectionBlock","Card","Tabs (for multi-file examples)","Carousel (slide-to-slide code progression)"],styleDefaults:{Code:"gds-code relative w-full overflow-hidden"},props:{source:{schema:z.string(),design:"content",description:"the code to render"},language:{schema:z.enum(["tsx","jsx","ts","js","html","css","json","bash","md","py","go","rust"]).optional(),design:"knob",description:"Prism language id; defaults to `tsx`"},highlight:{schema:z.unknown().optional(),design:"plumbing",description:"1-indexed line number, array of numbers, or array of `[start, end]` ranges to emphasise"},diff:{schema:z.unknown().optional(),design:"plumbing",description:"`{ added?: number[]; removed?: number[] }` \u2014 1-indexed lines for diff hero / changelog mode"},reveal:{schema:z.enum(["none","lines","typewriter","diff"]).optional(),design:"knob",description:"entrance animation; defaults to `none`"},trigger:{schema:z.enum(["mount","inView","manual"]).optional(),design:"knob",description:"what kicks the reveal off; defaults to `mount`"},play:{schema:z.boolean().optional(),design:"knob",description:'for `trigger="manual"`, set true to play'},speed:{schema:z.enum(["slow","normal","fast"]).optional(),design:"knob",description:"animation feel preset. `normal` (default) maps to the canonical 50ms/22ms staggers + 180ms pre-delay. Pick a feel; don't tune individual numbers unless you have to."},delay:{schema:z.number().optional(),design:"knob",description:"explicit delay before reveal starts (ms) \u2014 overrides the `speed` preset"},stagger:{schema:z.number().optional(),design:"knob",description:"explicit per-line stagger for `lines`/`diff`, per-token for `typewriter` (ms) \u2014 overrides the `speed` preset"},prompt:{schema:z.string().optional(),design:"content",description:'string prepended to each line. Use for terminal emulation: `prompt="$ "` for bash, `prompt="> "` for PowerShell, `prompt=">>> "` for Python REPL. Prompt characters render in muted token colour, don\'t pick up the typewriter stagger, and are hidden from screen readers.'},showLineNumbers:{schema:z.boolean().optional(),design:"knob"},filename:{schema:z.string().optional(),design:"content",description:"optional label rendered in the header chrome"},wrap:{schema:z.boolean().optional(),design:"knob",description:"wrap long lines instead of horizontal scroll"},bare:{schema:z.boolean().optional(),design:"knob",description:"drop chrome (border, header, padding) \u2014 for inline use"},size:{schema:z.enum(["xs","sm","md"]).optional(),design:"knob",description:"type-scale preset. `xs` (12px) for dense changelog cards / inline blocks; `sm` (14px, default) for marketing heroes and docs; `md` (16px) for focal-point displays."},height:{schema:z.enum(["auto","number","string"]).optional(),design:"knob",description:'container sizing. `auto` (default) grows with content. Number = pixels (`300` \u2192 `300px`). String passes through as CSS (`"20rem"`, `"50vh"`).'},maxLines:{schema:z.number().optional(),design:"knob",description:"cap the visible line count at exactly N line-heights. Wins over `height`. Inherits the current size's line-height automatically."}}};var Ei={name:"Collapsible",description:'A single show/hide reveal \u2014 "Show advanced settings" rows, expandable inline help, "More details" sections inside cards. For multiple rows of expandable content where one-at-a-time matters, reach for Accordion. For a separate panel that floats above content, use Popover.',import:"@gradeui/ui",aliases:["collapsible","expand","show more","disclosure","advanced settings","disclosure group","expandable section","expandable view","show hide"],subcomponents:["CollapsibleTrigger","CollapsibleContent"],composesWith:["Button (as the trigger","asChild)","Card (expandable settings group)","Row (header + chevron)"],props:{open:{schema:z.boolean().optional(),design:"knob",description:"controlled open state"},defaultOpen:{schema:z.boolean().optional(),design:"knob",description:"uncontrolled initial state"},onOpenChange:{schema:z.unknown().optional(),design:"event"},children:{schema:z.unknown(),design:"plumbing",description:"the clickable header (often a Button asChild)"}}};var Li={name:"Command",description:'A searchable list of actions or destinations \u2014 global \u2318K palettes, "jump to" inputs, account switchers with filter. Wrap in CommandDialog when it should pop over the entire app on a hotkey. For straight forms with filter, prefer a Select with a search input. For free-text autocomplete tied to a single value, prefer Combobox built on Popover + Command.',import:"@gradeui/ui",aliases:["command palette","command menu","cmd k","quick switcher","action menu","spotlight","spotlight search","quick open","fuzzy finder"],subcomponents:["CommandInput","CommandList","CommandEmpty","CommandGroup","CommandItem","CommandSeparator","CommandShortcut","CommandDialog"],composesWith:["Dialog (CommandDialog wraps it)","Popover (inline combobox)","Tooltip"],styleDefaults:{Command:"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",CommandInput:"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",CommandList:"max-h-[300px] overflow-y-auto overflow-x-hidden",CommandGroup:"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",CommandSeparator:"-mx-1 h-px bg-border",CommandItem:"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",CommandShortcut:"ml-auto text-xs tracking-widest text-muted-foreground"},props:{value:{schema:z.string().optional(),design:"content",description:"controlled active item value"},onValueChange:{schema:z.unknown().optional(),design:"event"},placeholder:{schema:z.string().optional(),design:"content"},children:{schema:z.unknown(),design:"plumbing",description:"wraps groups and empty state"},heading:{schema:z.string().optional(),design:"content"},onSelect:{schema:z.unknown().optional(),design:"event"},disabled:{schema:z.boolean().optional(),design:"knob"},open:{schema:z.unknown(),design:"plumbing",description:"when you want the command palette mounted in a modal (cmd+k pattern)"}}};var Di={name:"Composer",description:`THE PRIMITIVE for any text composition surface \u2014 Slack / Discord /
18
18
  Teams chat input, AI chat / copilot prompt box, comment thread input,
19
19
  GitHub / Linear / Jira comment box, Reddit / Twitter reply box,
20
20
  Notion / Linear document body, email composer, post body, anywhere
@@ -44,7 +44,7 @@ toolbar buttons render when \`toolbar\` is on.
44
44
 
45
45
  Shares the lib/demo step vocabulary with <Code> so scripted
46
46
  typing/format/mention demos animate in the same rhythm as your
47
- terminal demos.`,import:"@gradeui/ui",composesWith:["AIChatComposer (preset wrapping this with paperclip + send + attachments)","ComposerReply (preset for comment threads)","AIChat (uses AIChatComposer internally)","Card (host above for reply boxes)",'Avatar (in leftActions slot for "your" avatar next to the input)'],props:{placeholder:{schema:z.string().optional(),design:"content"},initialText:{schema:z.string().optional(),design:"content",description:"plain text content to seed on mount"},initialJson:{schema:z.string().optional(),design:"content",description:"Lexical state JSON (from a previous onSubmit round-trip)"},formats:{schema:z.unknown().optional(),design:"plumbing",description:"available formats (defaults to bold/italic/underline/strikethrough/code/h1/h2/blockquote/ul/ol); pass false for plain text only"},toolbar:{schema:z.boolean().optional(),design:"knob",description:"show the formatting toolbar above the editor; default false"},triggers:{schema:z.unknown().optional(),design:"plumbing",description:'mention/slash configs, eg. `[{ char: "@", items: people }, { char: "/", items: commands }]`'},attachments:{schema:z.boolean().optional(),design:"knob",description:"enable image paste + paperclip when true/object; default off"},onSubmit:{schema:z.unknown().optional(),design:"event"},isLoading:{schema:z.boolean().optional(),design:"knob",description:"disables editor, swaps default Send for Stop"},onStop:{schema:z.unknown().optional(),design:"event"},maxLength:{schema:z.number().optional(),design:"knob"},autoFocus:{schema:z.boolean().optional(),design:"plumbing"},submitOnEnter:{schema:z.boolean().optional(),design:"knob",description:"default true (Shift-Enter still inserts newline)"},leftActions:{schema:z.unknown().optional(),design:"plumbing",description:"override the default paperclip"},rightActions:{schema:z.unknown().optional(),design:"plumbing",description:"override the default Send/Stop"},hideSend:{schema:z.boolean().optional(),design:"knob",description:"hide the default Send without replacing it"},steps:{schema:z.unknown().optional(),design:"plumbing",description:"scripted demo sequence"},trigger:{schema:z.unknown().optional(),design:"plumbing",description:'"mount" | "inView" | "manual"; default "mount"'},play:{schema:z.boolean().optional(),design:"knob",description:'for trigger="manual"'},speed:{schema:z.unknown().optional(),design:"plumbing",description:'"slow" | "normal" | "fast"; default "normal"'},loop:{schema:z.boolean().optional(),design:"knob"},loopDelay:{schema:z.number().optional(),design:"knob",description:"ms between loop iterations, default 2000"},readOnly:{schema:z.boolean().optional(),design:"knob",description:"disables editing AND focusability; programmatic playback still works; use for marketing demos so the script doesn't steal focus"},bare:{schema:z.boolean().optional(),design:"knob",description:"strip the card chrome"},className:{schema:z.string().optional(),design:"plumbing"}}};var Fn={name:"DatePicker",description:'Any date or date-range entry. Use DatePicker for a single date (DOB, due date, booking). Use DateRangePicker for a span (report period, stay dates, filter window). Prefer these over <Input type="date"> \u2014 consistent theming, keyboard nav, a11y, and no browser-native UI drift.',import:"@gradeui/ui",aliases:["datepicker","calendar input","date field","date range","datepickerios","react native date picker","calendar input field","date field control"],subcomponents:["DateRangePicker"],composesWith:["Label","Form","Card (in CardContent)","Button (form submit)"],props:{value:{schema:z.unknown().optional(),design:"plumbing"},onChange:{schema:z.unknown().optional(),design:"event",description:"called on select or clear"},placeholder:{schema:z.string().optional(),design:"content",description:'trigger label when empty (default "Pick a date" / "Pick a date range")'},disabled:{schema:z.boolean().optional(),design:"knob"},format:{schema:z.string().optional(),design:"content",description:'date-fns format token for the trigger label (default "PPP" single, "LLL dd, y" range)'},align:{schema:z.enum(["start","center","end"]).optional(),design:"knob",description:'popover align (default "start")'},side:{schema:z.enum(["top","right","bottom","left"]).optional(),design:"knob",description:"popover side"},captionLayout:{schema:z.enum(["label","dropdown","dropdown-months","dropdown-years"]).optional(),design:"knob"},className:{schema:z.string().optional(),design:"plumbing",description:"on the trigger button"},contentClassName:{schema:z.string().optional(),design:"content",description:"on the PopoverContent"},icon:{schema:z.unknown().optional(),design:"plumbing",description:"replaces the default CalendarIcon"},numberOfMonths:{schema:z.number().optional(),design:"knob",description:"DateRangePicker only, default 2"}}};var Bn={name:"Dialog",description:'Modal interruptions \u2014 confirmations, focused forms, detail views, AI suggestion sheets. Dialog is the right primitive for Apple HIG / React Native "Alert" (modal) semantics. For non-blocking inline messaging use Callout; for transient notifications use Toaster (Sonner). Always include DialogTitle (a11y requirement).',import:"@gradeui/ui",aliases:["modal","popup","overlay","alert","system alert","alert dialog","modal dialog","confirm dialog","react native modal","rn alert","glass modal","frosted modal","ai suggestion modal"],subcomponents:["DialogTrigger","DialogContent","DialogHeader","DialogTitle","DialogDescription","DialogFooter","DialogClose"],composesWith:["Button (as DialogTrigger asChild","and inside DialogFooter)","Input/Textarea/Select inside DialogContent","Code (for changelog / diff modals)","MediaSurface (for image / preview modals)"],props:{open:{schema:z.unknown().optional(),design:"plumbing",description:"Radix controlled/uncontrolled pattern"},asChild:{schema:z.enum(["wrap a Button"]).optional(),design:"plumbing"},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the modal panel is *made of*. Defaults to `solid` (opaque `bg-background`). `glass` lets the page show through softly \u2014 pairs with rich backdrops or AI-suggestion modals."},accepts:{schema:z.unknown(),design:"plumbing"},used:{schema:z.unknown(),design:"plumbing"}}};var zn={name:"DropdownMenu",description:'A small action menu attached to a trigger \u2014 overflow "\u2026" buttons on cards, user-avatar menus in headers, "Insert" menus in editors. For a full searchable list, use Command. For ONE primary action plus a secondary, use a Button next to a smaller ghost Button instead of a dropdown.',import:"@gradeui/ui",aliases:["dropdown","dropdown menu","overflow menu","kebab menu","more menu","action menu","context-style menu","menu","pull-down menu","pulldown menu","context menu","popup menu","actions menu","glass menu","frosted menu","ios menu","hig menu"],subcomponents:["DropdownMenuTrigger","DropdownMenuContent","DropdownMenuItem","DropdownMenuCheckboxItem","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuGroup","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent"],composesWith:["Button (as trigger asChild)","Avatar (user menu)","Card (overflow on a tile)","Tooltip (on the trigger)"],props:{open:{schema:z.unknown().optional(),design:"plumbing"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"usually wraps a Button"},align:{schema:z.enum(["start","center","end","top","right","bottom","left"]).optional(),design:"knob"},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the menu surface is *made of*. `solid` (default) is `bg-popover`. `translucent` matches Apple HIG / iOS menu sheets. `glass` for menus floating over rich canvases."},onSelect:{schema:z.unknown().optional(),design:"event"},DropdownMenuCheckboxItem:{schema:z.unknown(),design:"plumbing"},DropdownMenuSub:{schema:z.unknown(),design:"plumbing",description:"sub-trigger shows children, sub-content holds the deeper items"},children:{schema:z.unknown(),design:"plumbing",description:"right-aligned kbd hint"}}};var On={name:"Flex",description:"The unopinionated flexbox primitive \u2014 reach for Flex when Stack, Row, or Grid don't quite fit. Specifically when you need reverse direction (`row-reverse` / `col-reverse`), CSS defaults instead of Row's baked-in `items-center gap-md`, or baseline alignment. Otherwise prefer Stack / Row / Grid \u2014 they're easier to read and tuned for the 95% case. Flex is the escape hatch, not the default.",import:"@gradeui/ui",aliases:["flex","flexbox","flex container","hstack","vstack","horizontal","vertical","generic container","layout view"],composesWith:["any content component"],props:{direction:{schema:z.enum(["row","col","row-reverse","col-reverse"]).optional(),design:"knob",description:"main-axis direction",default:"row"},gap:{schema:z.enum(["none","xs","sm","md","lg","xl","2xl"]).optional(),design:"knob",description:"gap between children",default:"none"},align:{schema:z.enum(["start","center","end","stretch","baseline"]).optional(),design:"knob",description:"cross-axis alignment",default:"stretch"},justify:{schema:z.enum(["start","center","end","between","around","evenly"]).optional(),design:"knob",description:"main-axis distribution",default:"start"},wrap:{schema:z.enum(["nowrap","wrap","wrap-reverse"]).optional(),design:"knob",description:"wrap behaviour when children overflow",default:"nowrap"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"render as the child element via Slot",default:false},className:{schema:z.string().optional(),design:"plumbing"},children:{schema:z.unknown(),design:"plumbing"}}};var Vn={name:"Grid",description:"2D layouts where Stack (vertical) and Row (horizontal) don't fit \u2014 stat-card grids, feature tiles, pricing columns, photo grids. Reach for Grid over hand-rolled `grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4` so the column count is a prop the settings panel can mutate and the responsive ladder stays consistent across designs.",import:"@gradeui/ui",aliases:["grid","tiles","cards grid","stat grid","columns","feature grid","grid view","lazy v grid","lazyvgrid","lazy h grid","lazyhgrid","tile grid","masonry"],composesWith:["Card","Stack (inside each cell)","Row","Button","any content component"],props:{cols:{schema:z.enum(["1","2","3","4","5","6","12"]).optional(),design:"knob",description:'desktop column count; each value has a baked-in responsive ladder (e.g. "4" \u2192 1 col mobile, 2 tablet, 4 desktop)',default:"3"},gap:{schema:z.enum(["none","xs","sm","md","lg","xl","2xl"]).optional(),design:"knob",description:"gap between grid cells (same scale as Stack/Row)",default:"md"},align:{schema:z.enum(["start","center","end","stretch"]).optional(),design:"knob",description:"cross-axis alignment of cells",default:"stretch"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"render as the child element via Slot",default:false},className:{schema:z.string().optional(),design:"plumbing"},children:{schema:z.unknown(),design:"plumbing"}}};var _n={name:"HoverCard",description:"Rich preview content surfaced on hover \u2014 user profile mini-cards on @-mentions, link previews, definition popups, layer-thumbnail peeks. Pointer-only by design (no touch-friendly trigger); pair with a click target for touch devices, or fall back to Popover. NEVER use HoverCard for critical info \u2014 if the user can't reach it via keyboard or touch, it might as well not exist for accessibility.",import:"@gradeui/ui",aliases:["hover card","hover preview","mention preview","profile peek","link preview","rich tooltip","link preview card","profile hover","peek card","glass preview","frosted preview"],subcomponents:["HoverCardTrigger","HoverCardContent"],composesWith:["Avatar (user preview)","Card (richer content)","Link (the trigger)","MediaSurface (link/layer previews)","Code (snippet previews)"],props:{open:{schema:z.unknown().optional(),design:"plumbing"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"usually a Link or Button"},side:{schema:z.unknown().optional(),design:"plumbing"},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the preview surface is *made of*. `solid` (default) is `bg-popover`. `glass` for hover previews over rich content (a media feed, a layout canvas)."}}};var Gn={name:"Input",description:"Any single-line text entry. Always pair with a Label for accessibility.",import:"@gradeui/ui",aliases:["text field","textbox","textfield","form field","text input","secure field","search field","url field","number field","textinput","text input field","react native textinput"],composesWith:["Label","Form","Card (in CardContent)","Button (form submit)"],props:{type:{schema:z.string().optional(),design:"content"}}};var Wn={name:"Label",description:"Every Input / Textarea / Checkbox / Switch / RadioGroup. Always use htmlFor so clicking the label focuses the control.",import:"@gradeui/ui",aliases:["label","form label","field label","caption"],composesWith:["Input","Textarea","Checkbox","Switch","RadioGroup","Select"],props:{htmlFor:{schema:z.string().optional(),design:"content",description:"binds to the input's id"}}};var Un={name:"Map",description:"Any layout that needs a real map \u2014 listings (real estate, Airbnb-style), fleet/logistics dashboards, store locators, anywhere a user picks a location from a viewport. Reach for the controlled `hoveredId` prop when a sibling list and the map need to highlight each other.",import:"@gradeui/ui",aliases:["map","maps","mapbox","maplibre","google maps","geo","location","latlng","coordinates","marker","pin","airbnb","listings","fleet","real estate","logistics","map view","mapkit","mapview","react native maps","rn maps"],subcomponents:["MapMarker"],composesWith:["Card (as marker content)","Badge","Avatar","Button","Row","Stack","Skeleton"],props:{provider:{schema:z.unknown(),design:"plumbing",description:'"maplibre" (default, free, no key) | "mapbox" (needs accessToken) | "google" (needs apiKey). Switching is one prop change.'},center:{schema:z.unknown(),design:"plumbing",description:"`[lng, lat]` tuple. ALWAYS lng first. Required."},zoom:{schema:z.unknown(),design:"plumbing",description:"number, 0\u201322. Required."},bounds:{schema:z.unknown(),design:"plumbing",description:"`[[swLng, swLat], [neLng, neLat]]`. When set, takes precedence over center+zoom."},appearance:{schema:z.unknown(),design:"plumbing",description:'"light" | "dark" | "satellite" | "auto" (default "auto", follows GradeThemeProvider mode).'},hoveredId:{schema:z.unknown(),design:"plumbing",description:'controlled string id, pairs with onHoveredIdChange. The matching MapMarker gets `data-gds-state="hovered"` automatically. This is how you build list \u2194 map two-way sync.'},interactive:{schema:z.unknown(),design:"plumbing",description:"false freezes pan/zoom, useful for static cards."},onLoad:{schema:z.unknown(),design:"event",description:"handle exposes flyTo, panTo, fitBounds, getCenter, getZoom, getBounds, instance."},tilerKey:{schema:z.enum(["maplibre"]),design:"knob",description:"only needed off `gradeui.com`/`localhost`. Default key is referrer-locked."},accessToken:{schema:z.enum(["mapbox), apiKey (google"]),design:"knob",description:"required for those providers."}}};var Wd=z.object({kind:z.literal("album"),artist:z.string(),title:z.string(),year:z.number().optional(),description:z.string().optional()}),Ud=z.object({kind:z.literal("tv-show"),title:z.string(),year:z.number().optional(),description:z.string().optional()}),jd=z.object({kind:z.literal("movie"),title:z.string(),year:z.number().optional(),description:z.string().optional()}),$d=z.object({kind:z.literal("game"),title:z.string(),description:z.string().optional()}),Kd=z.object({kind:z.literal("book"),title:z.string().optional(),author:z.string().optional(),isbn:z.string().optional(),description:z.string().optional()}),qd=z.object({kind:z.literal("poster"),title:z.string(),year:z.number().optional(),description:z.string().optional()}),Yd=z.object({kind:z.literal("portrait"),name:z.string().optional(),role:z.string().optional()}),Zd=z.object({kind:z.literal("landscape"),location:z.string().optional(),mood:z.string().optional()}),Xd=z.object({kind:z.literal("product"),name:z.string().optional(),brand:z.string().optional()}),Jd=z.object({kind:z.literal("food"),dish:z.string().optional(),cuisine:z.string().optional()}),Qd=z.object({kind:z.literal("generic"),prompt:z.string()}),ec=z.union([z.object({kind:z.literal("video")}),z.object({kind:z.literal("audio")}),z.object({kind:z.literal("embed")}),z.object({kind:z.literal("3d")})]),tc=z.union([Wd,Ud,jd,$d,Kd,qd,Yd,Zd,Xd,Jd,Qd,ec]),oc=z.enum(["video","square","portrait","wide","auto"]),rc=z.enum(["none","sm","md","lg","xl"]),ac=z.enum(["album","tv-show","movie","game","book","portrait","landscape","poster","product","food","video","audio","embed","3d","generic"]),nc=z.union([z.literal("auto"),z.literal("icon"),z.literal("none")]),ma={name:"MediaSurface",description:"The canonical media slot for ALL non-person imagery \u2014 album art, posters, hero images, landscape photos, video and 3D containers.",when:"Pass `hint` + `alt` + (optionally) `source` so the empty-state placeholder is meaningful and the generation pipeline can later fill the slot with a real image. Use directly for declarative slots; the higher-level VideoPlayer / RivePlayer / ThreeScene wrap this for runtime-heavy media.",antipatterns:["Don't wrap <Avatar> inside <MediaSurface> to get an initials fallback. Set `alt` + `hint` on MediaSurface directly \u2014 the placeholder renders initials at small sizes derived from `alt`.","Don't use <Avatar> for album art, posters, products, food, landscapes, etc. Avatar is for PEOPLE only.","Don't inline manual gradient backgrounds (`bg-gradient-to-br \u2026`) on MediaSurface as a 'placeholder vibe' \u2014 the empty-state is already styled via `--gds-media-placeholder-bg/-fg` tokens."],composesWith:["Card","CardBlock","MediaBlock","VideoPlayer","RivePlayer","ThreeScene"],aliases:["media","image slot","media slot","image placeholder","cover","thumbnail","poster slot"],import:"@gradeui/ui",props:{hint:{schema:ac.optional(),design:"knob",control:"glyph-picker",label:"Slot kind",description:"Picks the placeholder glyph + the default aspect + the future generation provider. Defaults to 'generic'.",default:"generic",examples:["album","portrait","landscape","poster"]},aspect:{schema:oc.optional(),design:"knob",control:"toggle-group",label:"Aspect ratio",description:"Override the slot's natural framing. When omitted, derived from `hint`: album/product/food \u2192 square, portrait/poster \u2192 portrait, landscape \u2192 wide, video/audio/embed/generic \u2192 video."},radius:{schema:rc.optional(),design:"knob",control:"toggle-group",label:"Corner radius",default:"lg",description:"Driven by the `--gds-media-radius` CSS variable."},border:{schema:z.boolean().optional(),design:"knob",label:"Show border",default:false},loading:{schema:z.boolean().optional(),design:"knob",label:"Loading state",default:false,description:"Overlays the muted-pulse skeleton on top of the slot."},emptyState:{schema:nc.optional(),design:"knob",control:"select",label:"Empty state",default:"auto",description:"'auto' renders the size-tiered placeholder (initials \u2192 glyph \u2192 glyph + caption). 'icon' is a legacy alias. 'none' renders a truly empty surface."},alt:{schema:z.string().optional(),design:"content",control:"text",label:"Alt text",description:"Becomes the eventual `<img alt>`. Also drives the placeholder caption (>160px slots) and the 2-letter initials fallback (<64px slots).",examples:["Travelling Without Moving \u2014 Jamiroquai","Sunset over Mount Fuji"]},src:{schema:z.string().url().optional(),design:"content",control:"url",label:"Image URL",description:"When set, renders an `<img>` filling the slot via object-cover. The wrapper keeps its aspect/radius/border. Generators patch this prop; manual values always win."},source:{schema:tc.optional(),design:"structured",label:"Source descriptor",description:"Structured metadata for the generation pipeline. Opaque to MediaSurface itself; read by the resolver to look up real imagery from the right provider (MusicBrainz / Pollinations / etc.).",perKindFields:{album:{artist:"string",title:"string",year:"number?"},poster:{title:"string",year:"number?"},portrait:{name:"string?",role:"string?"},landscape:{location:"string?",mood:"string?"},product:{name:"string?",brand:"string?"},food:{dish:"string?",cuisine:"string?"},generic:{prompt:"string"},video:{},audio:{},embed:{},"3d":{}}},className:{schema:z.string().optional(),design:"plumbing"},style:{schema:z.record(z.string(),z.unknown()).optional(),design:"plumbing"},children:{schema:z.unknown().optional(),design:"plumbing",description:"Escape hatch for putting a custom <video>, <canvas>, Rive runtime, etc. inside. When supplied, the placeholder is suppressed."},overlay:{schema:z.unknown().optional(),design:"plumbing",description:"Decorative layer rendered ABOVE the media/placeholder (play buttons, hover gradients, corner badges). Does NOT suppress the placeholder."},glyph:{schema:z.unknown().optional(),design:"plumbing",description:"Per-instance override of the hint-derived placeholder glyph. Most consumers should pick a `hint` and let the map decide."},fallback:{schema:z.unknown().optional(),design:"plumbing",description:"Custom node shown while `loading` is true."},onVisibilityChange:{schema:z.function().optional(),design:"event",description:"Fires when the surface enters / leaves the viewport (IntersectionObserver)."}},actions:{fill:{label:"Fill image",icon:"Sparkles",description:"Resolve this slot's source via the free providers (MusicBrainz \u2192 Pollinations \u2192 Picsum) and patch the result into the runtime URL map.",kind:"resolve-media-source",enabledWhen:{propPresent:"source"}},refresh:{label:"Refresh",icon:"RotateCw",description:"Re-fetch this slot's resolved URL (cache-busts the browser AND the local URL map). Useful when a Pollinations URL failed to load on first hit \u2014 Pollinations has typically finished its cold-start by now, so a retry usually succeeds.",kind:"refresh-media-source",enabledWhen:{propPresent:"source"}}}};var jn={name:"Message",description:`The canonical "avatar + author + timestamp + body" row. THE PRIMITIVE
47
+ terminal demos.`,import:"@gradeui/ui",composesWith:["AIChatComposer (preset wrapping this with paperclip + send + attachments)","ComposerReply (preset for comment threads)","AIChat (uses AIChatComposer internally)","Card (host above for reply boxes)",'Avatar (in leftActions slot for "your" avatar next to the input)'],styleDefaults:{ComposerToolbar:"flex flex-wrap items-center gap-0.5",AttachmentChips:"absolute -top-1.5 -right-1.5 h-5 w-5 rounded-full",ComposerInner:"w-full"},props:{placeholder:{schema:z.string().optional(),design:"content"},initialText:{schema:z.string().optional(),design:"content",description:"plain text content to seed on mount"},initialJson:{schema:z.string().optional(),design:"content",description:"Lexical state JSON (from a previous onSubmit round-trip)"},formats:{schema:z.unknown().optional(),design:"plumbing",description:"available formats (defaults to bold/italic/underline/strikethrough/code/h1/h2/blockquote/ul/ol); pass false for plain text only"},toolbar:{schema:z.boolean().optional(),design:"knob",description:"show the formatting toolbar above the editor; default false"},triggers:{schema:z.unknown().optional(),design:"plumbing",description:'mention/slash configs, eg. `[{ char: "@", items: people }, { char: "/", items: commands }]`'},attachments:{schema:z.boolean().optional(),design:"knob",description:"enable image paste + paperclip when true/object; default off"},onSubmit:{schema:z.unknown().optional(),design:"event"},isLoading:{schema:z.boolean().optional(),design:"knob",description:"disables editor, swaps default Send for Stop"},onStop:{schema:z.unknown().optional(),design:"event"},maxLength:{schema:z.number().optional(),design:"knob"},autoFocus:{schema:z.boolean().optional(),design:"plumbing"},submitOnEnter:{schema:z.boolean().optional(),design:"knob",description:"default true (Shift-Enter still inserts newline)"},leftActions:{schema:z.unknown().optional(),design:"plumbing",description:"override the default paperclip"},rightActions:{schema:z.unknown().optional(),design:"plumbing",description:"override the default Send/Stop"},hideSend:{schema:z.boolean().optional(),design:"knob",description:"hide the default Send without replacing it"},steps:{schema:z.unknown().optional(),design:"plumbing",description:"scripted demo sequence"},trigger:{schema:z.unknown().optional(),design:"plumbing",description:'"mount" | "inView" | "manual"; default "mount"'},play:{schema:z.boolean().optional(),design:"knob",description:'for trigger="manual"'},speed:{schema:z.unknown().optional(),design:"plumbing",description:'"slow" | "normal" | "fast"; default "normal"'},loop:{schema:z.boolean().optional(),design:"knob"},loopDelay:{schema:z.number().optional(),design:"knob",description:"ms between loop iterations, default 2000"},readOnly:{schema:z.boolean().optional(),design:"knob",description:"disables editing AND focusability; programmatic playback still works; use for marketing demos so the script doesn't steal focus"},bare:{schema:z.boolean().optional(),design:"knob",description:"strip the card chrome"},className:{schema:z.string().optional(),design:"plumbing"}}};var Ai={name:"DatePicker",description:'Any date or date-range entry. Use DatePicker for a single date (DOB, due date, booking). Use DateRangePicker for a span (report period, stay dates, filter window). Prefer these over <Input type="date"> \u2014 consistent theming, keyboard nav, a11y, and no browser-native UI drift.',import:"@gradeui/ui",aliases:["datepicker","calendar input","date field","date range","datepickerios","react native date picker","calendar input field","date field control"],subcomponents:["DateRangePicker"],composesWith:["Label","Form","Card (in CardContent)","Button (form submit)"],styleDefaults:{DatePicker:"w-[280px] justify-start text-left font-normal data-[empty=true]:text-muted-foreground",DateRangePicker:"w-[300px] justify-start text-left font-normal data-[empty=true]:text-muted-foreground"},props:{value:{schema:z.unknown().optional(),design:"plumbing"},onChange:{schema:z.unknown().optional(),design:"event",description:"called on select or clear"},placeholder:{schema:z.string().optional(),design:"content",description:'trigger label when empty (default "Pick a date" / "Pick a date range")'},disabled:{schema:z.boolean().optional(),design:"knob"},format:{schema:z.string().optional(),design:"content",description:'date-fns format token for the trigger label (default "PPP" single, "LLL dd, y" range)'},align:{schema:z.enum(["start","center","end"]).optional(),design:"knob",description:'popover align (default "start")'},side:{schema:z.enum(["top","right","bottom","left"]).optional(),design:"knob",description:"popover side"},captionLayout:{schema:z.enum(["label","dropdown","dropdown-months","dropdown-years"]).optional(),design:"knob"},className:{schema:z.string().optional(),design:"plumbing",description:"on the trigger button"},contentClassName:{schema:z.string().optional(),design:"content",description:"on the PopoverContent"},icon:{schema:z.unknown().optional(),design:"plumbing",description:"replaces the default CalendarIcon"},numberOfMonths:{schema:z.number().optional(),design:"knob",description:"DateRangePicker only, default 2"}}};var Ii={name:"Dialog",description:'Modal interruptions \u2014 confirmations, focused forms, detail views, AI suggestion sheets. Dialog is the right primitive for Apple HIG / React Native "Alert" (modal) semantics. For non-blocking inline messaging use Callout; for transient notifications use Toaster (Sonner). Always include DialogTitle (a11y requirement).',import:"@gradeui/ui",aliases:["modal","popup","overlay","alert","system alert","alert dialog","modal dialog","confirm dialog","react native modal","rn alert","glass modal","frosted modal","ai suggestion modal"],subcomponents:["DialogTrigger","DialogContent","DialogHeader","DialogTitle","DialogDescription","DialogFooter","DialogClose"],composesWith:["Button (as DialogTrigger asChild","and inside DialogFooter)","Input/Textarea/Select inside DialogContent","Code (for changelog / diff modals)","MediaSurface (for image / preview modals)"],styleDefaults:{DialogOverlay:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",DialogContent:"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",DialogHeader:"flex flex-col space-y-1.5 text-center sm:text-left",DialogFooter:"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",DialogTitle:"text-lg font-semibold leading-none tracking-tight",DialogDescription:"text-sm text-muted-foreground"},props:{open:{schema:z.unknown().optional(),design:"plumbing",description:"Radix controlled/uncontrolled pattern"},asChild:{schema:z.enum(["wrap a Button"]).optional(),design:"plumbing"},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the modal panel is *made of*. Defaults to `solid` (opaque `bg-background`). `glass` lets the page show through softly \u2014 pairs with rich backdrops or AI-suggestion modals."},accepts:{schema:z.unknown(),design:"plumbing"},used:{schema:z.unknown(),design:"plumbing"}}};var Hi={name:"DropdownMenu",description:'A small action menu attached to a trigger \u2014 overflow "\u2026" buttons on cards, user-avatar menus in headers, "Insert" menus in editors. For a full searchable list, use Command. For ONE primary action plus a secondary, use a Button next to a smaller ghost Button instead of a dropdown.',import:"@gradeui/ui",aliases:["dropdown","dropdown menu","overflow menu","kebab menu","more menu","action menu","context-style menu","menu","pull-down menu","pulldown menu","context menu","popup menu","actions menu","glass menu","frosted menu","ios menu","hig menu"],subcomponents:["DropdownMenuTrigger","DropdownMenuContent","DropdownMenuItem","DropdownMenuCheckboxItem","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuGroup","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent"],composesWith:["Button (as trigger asChild)","Avatar (user menu)","Card (overflow on a tile)","Tooltip (on the trigger)"],styleDefaults:{DropdownMenuSubTrigger:"flex cursor-default select-none items-center gap-2 rounded-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:shrink-0",DropdownMenuSubContent:"z-50 min-w-[8rem] overflow-hidden rounded-md border text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",DropdownMenuContent:"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border text-popover-foreground shadow-md",DropdownMenuItem:"relative flex cursor-default select-none items-center gap-2 rounded-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:shrink-0",DropdownMenuCheckboxItem:"relative flex cursor-default select-none items-center rounded-sm pr-2 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",DropdownMenuRadioItem:"relative flex cursor-default select-none items-center rounded-sm pr-2 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",DropdownMenuLabel:"font-semibold",DropdownMenuSeparator:"-mx-1 my-1 h-px bg-muted",DropdownMenuShortcut:"ml-auto text-xs tracking-widest opacity-60"},props:{open:{schema:z.unknown().optional(),design:"plumbing"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"usually wraps a Button"},align:{schema:z.enum(["start","center","end","top","right","bottom","left"]).optional(),design:"knob"},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the menu surface is *made of*. `solid` (default) is `bg-popover`. `translucent` matches Apple HIG / iOS menu sheets. `glass` for menus floating over rich canvases."},size:{schema:z.enum(["default","sm","xs"]).optional(),design:"knob",description:'menu density; cascades to every item (Item, Checkbox, Radio, SubTrigger, Label) via context so a compact trigger gets a compact menu. Use "xs" in dense tool panels.'},onSelect:{schema:z.unknown().optional(),design:"event"},DropdownMenuCheckboxItem:{schema:z.unknown(),design:"plumbing"},DropdownMenuSub:{schema:z.unknown(),design:"plumbing",description:"sub-trigger shows children, sub-content holds the deeper items"},children:{schema:z.unknown(),design:"plumbing",description:"right-aligned kbd hint"}}};var zi={name:"Field",description:'Pair a bare control with a label and optional description in a row, with id + aria-describedby wired automatically. Use layout="setting" for the classic settings row (label on the left, Switch on the right). For a selectable CARD where the whole surface is the control, use RadioCard / CheckboxCard / SwitchCard instead.',import:"@gradeui/ui",aliases:["field","form field","control row","label and description","two line checkbox","option row","setting row","toggle row"],composesWith:["Checkbox","RadioGroup","RadioGroupItem","Switch","Badge (inside Field.Trailing)"],styleDefaults:{FieldLabel:"text-sm font-medium leading-none text-foreground cursor-pointer peer-disabled:cursor-not-allowed peer-disabled:opacity-70",FieldDescription:"text-sm text-muted-foreground",FieldTrailing:"flex shrink-0 items-center gap-2",FieldRoot:"flex gap-3"},props:{layout:{schema:z.enum(["option","setting"]).optional(),design:"knob",description:"option (default): control leads, text beside it; setting: text leads, control pinned trailing"},children:{schema:z.unknown(),design:"plumbing",description:"order does not matter"}}};var _i={name:"FillPicker",description:"Grade's paint picker \u2014 the control for choosing a frame's background fill, modelled on Figma's fill popover. A fill-type icon row (solid \xB7 gradient \xB7 image \xB7 pattern \xB7 video \xB7 shader) switches the panel below; a global opacity sits at the foot. Emits a FillValue that maps 1:1 onto BackgroundFill props. This is a Studio/inspector chrome control \u2014 pair it with BackgroundFill, which renders the chosen paint. Not for app content.",import:"@gradeui/ui",aliases:["fill picker","paint picker","background picker","fill chooser","fill popover"],composesWith:["BackgroundFill (renders the FillValue)","Popover (host it in a popover)","ShaderPresetPicker (the shader tab)","the inspector Fill section"],styleDefaults:{Swatch:"h-7 w-7 rounded-md border border-border/60 transition-shadow",FillPicker:"flex flex-col gap-3"},props:{value:{schema:z.unknown(),design:"plumbing",description:"current paint ({ type, color?, gradient?, src?, fit?, repeat?, tileSize?, preset?, palette?, postPreset?, opacity? }) (required)"},onChange:{schema:z.unknown(),design:"event",description:"called on any change (required)"}}};var Oi={name:"Flex",description:"The unopinionated flexbox primitive \u2014 reach for Flex when Stack, Row, or Grid don't quite fit. Specifically when you need reverse direction (`row-reverse` / `col-reverse`), CSS defaults instead of Row's baked-in `items-center gap-md`, or baseline alignment. Otherwise prefer Stack / Row / Grid \u2014 they're easier to read and tuned for the 95% case. Flex is the escape hatch, not the default.",import:"@gradeui/ui",aliases:["flex","flexbox","flex container","hstack","vstack","horizontal","vertical","generic container","layout view"],composesWith:["any content component"],props:{direction:{schema:z.enum(["row","col","row-reverse","col-reverse"]).optional(),design:"knob",description:"main-axis direction",default:"row"},gap:{schema:z.enum(["none","xs","sm","md","lg","xl","2xl"]).optional(),design:"knob",description:"gap between children",default:"none"},align:{schema:z.enum(["start","center","end","stretch","baseline"]).optional(),design:"knob",description:"cross-axis alignment",default:"stretch"},justify:{schema:z.enum(["start","center","end","between","around","evenly"]).optional(),design:"knob",description:"main-axis distribution",default:"start"},wrap:{schema:z.enum(["nowrap","wrap","wrap-reverse"]).optional(),design:"knob",description:"wrap behaviour when children overflow",default:"nowrap"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"render as the child element via Slot",default:false},className:{schema:z.string().optional(),design:"plumbing"},children:{schema:z.unknown(),design:"plumbing"}}};var Vi={name:"Grid",description:"2D layouts where Stack (vertical) and Row (horizontal) don't fit \u2014 stat-card grids, feature tiles, pricing columns, photo grids. Reach for Grid over hand-rolled `grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4` so the column count is a prop the settings panel can mutate and the responsive ladder stays consistent across designs.",import:"@gradeui/ui",aliases:["grid","tiles","cards grid","stat grid","columns","feature grid","grid view","lazy v grid","lazyvgrid","lazy h grid","lazyhgrid","tile grid","masonry"],composesWith:["Card","Stack (inside each cell)","Row","Button","any content component"],styleDefaults:{Grid:"gds-grid grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 items-stretch"},variantDefaults:{cols:"3",gap:"md",align:"stretch"},props:{cols:{schema:z.enum(["1","2","3","4","5","6","12"]).optional(),design:"knob",description:'desktop column count; each value has a baked-in responsive ladder (e.g. "4" \u2192 1 col mobile, 2 tablet, 4 desktop)',default:"3"},gap:{schema:z.enum(["none","xs","sm","md","lg","xl","2xl"]).optional(),design:"knob",description:"gap between grid cells (same scale as Stack/Row)",default:"md"},align:{schema:z.enum(["start","center","end","stretch"]).optional(),design:"knob",description:"cross-axis alignment of cells",default:"stretch"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"render as the child element via Slot",default:false},className:{schema:z.string().optional(),design:"plumbing"},children:{schema:z.unknown(),design:"plumbing"}}};var Gi={name:"HoverCard",description:"Rich preview content surfaced on hover \u2014 user profile mini-cards on @-mentions, link previews, definition popups, layer-thumbnail peeks. Pointer-only by design (no touch-friendly trigger); pair with a click target for touch devices, or fall back to Popover. NEVER use HoverCard for critical info \u2014 if the user can't reach it via keyboard or touch, it might as well not exist for accessibility.",import:"@gradeui/ui",aliases:["hover card","hover preview","mention preview","profile peek","link preview","rich tooltip","link preview card","profile hover","peek card","glass preview","frosted preview"],subcomponents:["HoverCardTrigger","HoverCardContent"],composesWith:["Avatar (user preview)","Card (richer content)","Link (the trigger)","MediaSurface (link/layer previews)","Code (snippet previews)"],styleDefaults:{HoverCardContent:"z-50 w-64 rounded-md border p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]"},props:{open:{schema:z.unknown().optional(),design:"plumbing"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"usually a Link or Button"},side:{schema:z.unknown().optional(),design:"plumbing"},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the preview surface is *made of*. `solid` (default) is `bg-popover`. `glass` for hover previews over rich content (a media feed, a layout canvas)."}}};var ji={name:"Input",description:'Any single-line text entry. Always pair with a Label for accessibility. Use startSlot/endSlot for icons, prefixes and units instead of hand-positioning absolute children; use size="sm"/"xs" in dense tool panels.',import:"@gradeui/ui",aliases:["text field","textbox","textfield","form field","text input","secure field","search field","url field","number field","textinput","text input field","react native textinput","unit input","input with icon"],composesWith:["Label","Form","Card (in CardContent)","Button (form submit)"],styleDefaults:{Input:"pointer-events-none absolute inset-y-0 left-0 flex items-center text-muted-foreground [&_svg]:size-3.5"},props:{type:{schema:z.string().optional(),design:"content"},size:{schema:z.enum(["default","sm","xs"]).optional(),design:"knob",description:"control density. `default` (h-9) for forms; `sm` (h-8) and `xs` (h-7) for dense tool panels like the inspector."},startSlot:{schema:z.unknown().optional(),design:"plumbing",description:"adornment rendered inside the leading edge (icon, prefix, currency symbol). Non-interactive by default so clicks focus the input."},endSlot:{schema:z.unknown().optional(),design:"plumbing",description:'adornment rendered inside the trailing edge (unit like "px", a clear button, a stepper). Same pointer rules as startSlot.'}}};var Ui={name:"Label",description:'Every Input / Textarea / Checkbox / Switch / RadioGroup. Always use htmlFor so clicking the label focuses the control. Match `size` to the field it labels (size="xs" label over a size="xs" input).',import:"@gradeui/ui",aliases:["label","form label","field label","caption"],composesWith:["Input","Textarea","Checkbox","Switch","RadioGroup","Select"],styleDefaults:{Label:"font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-sm"},variantDefaults:{size:"default"},props:{htmlFor:{schema:z.string().optional(),design:"content",description:"binds to the input's id"},size:{schema:z.enum(["default","sm","xs"]).optional(),design:"knob",description:"text size, mirrors Input/Select/Textarea so a field and its label scale together. default = text-sm; xs = 11px for dense tool panels."}}};var $i={name:"Logo",description:"A brand mark with built-in variations \u2014 a square mark for tight",import:"@gradeui/ui",aliases:["logo","brand","brandmark","wordmark","lockup","brand logo","app logo","logotype"],composesWith:["AppShell","AppShellHeader","Sidebar","SidebarHeader","Row","Stack"],styleDefaults:{Logo:"gds-logo inline-flex shrink-0 select-none items-center",LogoPlaceholder:"inline-flex h-full items-center gap-1.5 rounded-md border border-dashed px-2 text-xs font-medium"},props:{sources:{schema:z.unknown().optional(),design:"plumbing",description:"artwork keyed by lockup then appearance:"}}};var Ki={name:"Map",description:"Any layout that needs a real map \u2014 listings (real estate, Airbnb-style), fleet/logistics dashboards, store locators, anywhere a user picks a location from a viewport. Reach for the controlled `hoveredId` prop when a sibling list and the map need to highlight each other.",import:"@gradeui/ui",aliases:["map","maps","mapbox","maplibre","google maps","geo","location","latlng","coordinates","marker","pin","airbnb","listings","fleet","real estate","logistics","map view","mapkit","mapview","react native maps","rn maps"],subcomponents:["MapMarker"],composesWith:["Card (as marker content)","Badge","Avatar","Button","Row","Stack","Skeleton"],props:{provider:{schema:z.unknown(),design:"plumbing",description:'"maplibre" (default, free, no key) | "mapbox" (needs accessToken) | "google" (needs apiKey). Switching is one prop change.'},center:{schema:z.unknown(),design:"plumbing",description:"`[lng, lat]` tuple. ALWAYS lng first. Required."},zoom:{schema:z.unknown(),design:"plumbing",description:"number, 0\u201322. Required."},bounds:{schema:z.unknown(),design:"plumbing",description:"`[[swLng, swLat], [neLng, neLat]]`. When set, takes precedence over center+zoom."},appearance:{schema:z.unknown(),design:"plumbing",description:'"light" | "dark" | "satellite" | "auto" (default "auto", follows GradeThemeProvider mode).'},hoveredId:{schema:z.unknown(),design:"plumbing",description:'controlled string id, pairs with onHoveredIdChange. The matching MapMarker gets `data-gds-state="hovered"` automatically. This is how you build list \u2194 map two-way sync.'},interactive:{schema:z.unknown(),design:"plumbing",description:"false freezes pan/zoom, useful for static cards."},onLoad:{schema:z.unknown(),design:"event",description:"handle exposes flyTo, panTo, fitBounds, getCenter, getZoom, getBounds, instance."},tilerKey:{schema:z.enum(["maplibre"]),design:"knob",description:"only needed off `gradeui.com`/`localhost`. Default key is referrer-locked."},accessToken:{schema:z.enum(["mapbox), apiKey (google"]),design:"knob",description:"required for those providers."}}};var lp=z.object({kind:z.literal("album"),artist:z.string(),title:z.string(),year:z.number().optional(),description:z.string().optional()}),dp=z.object({kind:z.literal("tv-show"),title:z.string(),year:z.number().optional(),description:z.string().optional()}),cp=z.object({kind:z.literal("movie"),title:z.string(),year:z.number().optional(),description:z.string().optional()}),pp=z.object({kind:z.literal("game"),title:z.string(),description:z.string().optional()}),mp=z.object({kind:z.literal("book"),title:z.string().optional(),author:z.string().optional(),isbn:z.string().optional(),description:z.string().optional()}),up=z.object({kind:z.literal("poster"),title:z.string(),year:z.number().optional(),description:z.string().optional()}),gp=z.object({kind:z.literal("portrait"),name:z.string().optional(),role:z.string().optional()}),fp=z.object({kind:z.literal("landscape"),location:z.string().optional(),mood:z.string().optional()}),hp=z.object({kind:z.literal("product"),name:z.string().optional(),brand:z.string().optional()}),bp=z.object({kind:z.literal("food"),dish:z.string().optional(),cuisine:z.string().optional()}),vp=z.object({kind:z.literal("generic"),prompt:z.string()}),yp=z.union([z.object({kind:z.literal("video")}),z.object({kind:z.literal("audio")}),z.object({kind:z.literal("embed")}),z.object({kind:z.literal("3d")})]),xp=z.union([lp,dp,cp,pp,mp,up,gp,fp,hp,bp,vp,yp]),wp=z.enum(["video","square","portrait","wide","auto"]),Rp=z.enum(["none","sm","md","lg","xl"]),Sp=z.enum(["album","tv-show","movie","game","book","portrait","landscape","poster","product","food","video","audio","embed","3d","generic"]),kp=z.union([z.literal("auto"),z.literal("icon"),z.literal("none")]),Ja={name:"MediaSurface",description:"The canonical media slot for ALL non-person imagery \u2014 album art, posters, hero images, landscape photos, video and 3D containers.",when:"Pass `hint` + `alt` + (optionally) `source` so the empty-state placeholder is meaningful and the generation pipeline can later fill the slot with a real image. Use directly for declarative slots; the higher-level VideoPlayer / RivePlayer / ThreeScene wrap this for runtime-heavy media.",antipatterns:["Don't wrap <Avatar> inside <MediaSurface> to get an initials fallback. Set `alt` + `hint` on MediaSurface directly \u2014 the placeholder renders initials at small sizes derived from `alt`.","Don't use <Avatar> for album art, posters, products, food, landscapes, etc. Avatar is for PEOPLE only.","Don't inline manual gradient backgrounds (`bg-gradient-to-br \u2026`) on MediaSurface as a 'placeholder vibe' \u2014 the empty-state is already styled via `--gds-media-placeholder-bg/-fg` tokens."],composesWith:["Card","CardBlock","MediaBlock","VideoPlayer","RivePlayer","ThreeScene"],aliases:["media","image slot","media slot","image placeholder","cover","thumbnail","poster slot"],import:"@gradeui/ui",props:{hint:{schema:Sp.optional(),design:"knob",group:"image",control:"glyph-picker",label:"Slot kind",description:"Picks the placeholder glyph + the default aspect + the future generation provider. Defaults to 'generic'.",default:"generic",examples:["album","portrait","landscape","poster"]},aspect:{schema:wp.optional(),design:"knob",control:"toggle-group",label:"Aspect ratio",description:"Override the slot's natural framing. When omitted, derived from `hint`: album/product/food \u2192 square, portrait/poster \u2192 portrait, landscape \u2192 wide, video/audio/embed/generic \u2192 video."},radius:{schema:Rp.optional(),design:"knob",control:"toggle-group",label:"Corner radius",default:"lg",description:"Driven by the `--gds-media-radius` CSS variable."},border:{schema:z.boolean().optional(),design:"knob",label:"Show border",default:false},loading:{schema:z.boolean().optional(),design:"knob",label:"Loading state",default:false,description:"Overlays the muted-pulse skeleton on top of the slot."},emptyState:{schema:kp.optional(),design:"knob",control:"select",label:"Empty state",default:"auto",description:"'auto' renders the size-tiered placeholder (initials \u2192 glyph \u2192 glyph + caption). 'icon' is a legacy alias. 'none' renders a truly empty surface."},alt:{schema:z.string().optional(),design:"content",group:"image",control:"text",label:"Alt text",description:"Becomes the eventual `<img alt>`. Also drives the placeholder caption (>160px slots) and the 2-letter initials fallback (<64px slots).",examples:["Travelling Without Moving \u2014 Jamiroquai","Sunset over Mount Fuji"]},src:{schema:z.string().url().optional(),design:"content",group:"image",control:"url",label:"Image URL",description:"When set, renders an `<img>` filling the slot via object-cover. The wrapper keeps its aspect/radius/border. Generators patch this prop; manual values always win."},source:{schema:xp.optional(),design:"structured",label:"Source descriptor",description:"Structured metadata for the generation pipeline. Opaque to MediaSurface itself; read by the resolver to look up real imagery from the right provider (MusicBrainz / Pollinations / etc.).",perKindFields:{album:{artist:"string",title:"string",year:"number?"},poster:{title:"string",year:"number?"},portrait:{name:"string?",role:"string?"},landscape:{location:"string?",mood:"string?"},product:{name:"string?",brand:"string?"},food:{dish:"string?",cuisine:"string?"},generic:{prompt:"string"},video:{},audio:{},embed:{},"3d":{}}},className:{schema:z.string().optional(),design:"plumbing"},style:{schema:z.record(z.string(),z.unknown()).optional(),design:"plumbing"},children:{schema:z.unknown().optional(),design:"plumbing",description:"Escape hatch for putting a custom <video>, <canvas>, Rive runtime, etc. inside. When supplied, the placeholder is suppressed."},overlay:{schema:z.unknown().optional(),design:"plumbing",description:"Decorative layer rendered ABOVE the media/placeholder (play buttons, hover gradients, corner badges). Does NOT suppress the placeholder."},glyph:{schema:z.unknown().optional(),design:"plumbing",description:"Per-instance override of the hint-derived placeholder glyph. Most consumers should pick a `hint` and let the map decide."},fallback:{schema:z.unknown().optional(),design:"plumbing",description:"Custom node shown while `loading` is true."},onVisibilityChange:{schema:z.function().optional(),design:"event",description:"Fires when the surface enters / leaves the viewport (IntersectionObserver)."}},actions:{fill:{label:"Fill image",icon:"Sparkles",description:"Resolve this slot's source via the free providers (MusicBrainz \u2192 Pollinations \u2192 Picsum) and patch the result into the runtime URL map.",kind:"resolve-media-source",enabledWhen:{propPresent:"source"}}}};var qi={name:"Message",description:`The canonical "avatar + author + timestamp + body" row. THE PRIMITIVE
48
48
  for any chat surface, comment thread, post-reply, activity log, or
49
49
  notification feed that follows the people-and-text shape.
50
50
 
@@ -58,7 +58,7 @@ Notion comment sidebars, in-app activity logs, notification rows \u2014
58
58
  every one of these IS \`<Message>\`. Do not roll the layout inline.
59
59
 
60
60
  For non-people activity (system events, log lines, status pings) use
61
- Callout or a plain Row instead \u2014 Message implies a human author.`,import:"@gradeui/ui",composesWith:['Avatar (in the avatar slot \u2014 pair with AvatarFallback tone="..." for stable per-author colour)',"Badge (in the badge slot for role / OP / bot tags)","Button (in actions",'typically size="icon" + variant="ghost")',"Stack (host multiple Messages in a thread)","Card (wrap a Stack of Messages for a comment-thread block)"],props:{author:{schema:z.string(),design:"content",description:"display name of the message author"},timestamp:{schema:z.unknown().optional(),design:"plumbing",description:'string ("11:24", "2 hours ago") or any node for custom formatting'},avatar:{schema:z.unknown().optional(),design:"plumbing",description:"slot for any `<Avatar>` composition; omit for grouped messages from the same author"},badge:{schema:z.unknown().optional(),design:"plumbing",description:"small chip(s) next to the author name (OP, Bot, Admin, role tag)"},edited:{schema:z.boolean().optional(),design:"knob",description:'renders "(edited)" hint next to timestamp; pass a string to customise ("(edited 2 minutes ago)")'},pinned:{schema:z.boolean().optional(),design:"knob",description:'renders a pin glyph + "Pinned" label above the header row for sticky / pinned messages'},actions:{schema:z.unknown().optional(),design:"plumbing",description:"end-of-header slot, typically hover-revealed icon buttons (reply / react / more)"},reactions:{schema:z.unknown().optional(),design:"plumbing",description:"slot below the body, typically a Row of reaction chips (emoji + count)"},threadCount:{schema:z.number().optional(),design:"knob",description:'renders a "N replies" link affordance below the body'},onThreadClick:{schema:z.unknown().optional(),design:"event",description:"handler for the threadCount affordance"},align:{schema:z.enum(["start","end"]).optional(),design:"knob",description:'`start` (default) puts the avatar on the left; `end` mirrors for "your messages" in DM threads'},children:{schema:z.unknown(),design:"plumbing",description:"body content (plain text or rich nodes)"},className:{schema:z.string().optional(),design:"plumbing"}}};var $n={name:"MultiSelect",description:`Picking multiple items from a finite list \u2014 tag selectors, filter chips,
61
+ Callout or a plain Row instead \u2014 Message implies a human author.`,import:"@gradeui/ui",composesWith:['Avatar (in the avatar slot \u2014 pair with AvatarFallback tone="..." for stable per-author colour)',"Badge (in the badge slot for role / OP / bot tags)","Button (in actions",'typically size="icon" + variant="ghost")',"Stack (host multiple Messages in a thread)","Card (wrap a Stack of Messages for a comment-thread block)"],styleDefaults:{Message:"flex items-start"},props:{author:{schema:z.string(),design:"content",description:"display name of the message author"},timestamp:{schema:z.unknown().optional(),design:"plumbing",description:'string ("11:24", "2 hours ago") or any node for custom formatting'},avatar:{schema:z.unknown().optional(),design:"plumbing",description:"slot for any `<Avatar>` composition; omit for grouped messages from the same author"},badge:{schema:z.unknown().optional(),design:"plumbing",description:"small chip(s) next to the author name (OP, Bot, Admin, role tag)"},edited:{schema:z.union([z.boolean(),z.string()]).optional(),design:"knob",description:'renders "(edited)" hint next to timestamp; pass a string to customise ("(edited 2 minutes ago)")'},pinned:{schema:z.boolean().optional(),design:"knob",description:'renders a pin glyph + "Pinned" label above the header row for sticky / pinned messages'},actions:{schema:z.unknown().optional(),design:"plumbing",description:"end-of-header slot, typically hover-revealed icon buttons (reply / react / more)"},reactions:{schema:z.unknown().optional(),design:"plumbing",description:"slot below the body, typically a Row of reaction chips (emoji + count)"},threadCount:{schema:z.number().optional(),design:"knob",description:'renders a "N replies" link affordance below the body'},onThreadClick:{schema:z.unknown().optional(),design:"event",description:"handler for the threadCount affordance"},align:{schema:z.enum(["start","end"]).optional(),design:"knob",description:'`start` (default) puts the avatar on the left; `end` mirrors for "your messages" in DM threads'},density:{schema:z.enum(["default","compact"]).optional(),design:"knob",description:'`default` is the canonical chat / channel-feed rhythm; `compact` tightens text sizes + gaps for dense side panels (Studio comments, activity feeds). Pair with `Avatar size="xs"` for the tightest stack.'},children:{schema:z.unknown(),design:"plumbing",description:"body content (plain text or rich nodes)"},className:{schema:z.string().optional(),design:"plumbing"}}};var Yi={name:"MultiSelect",description:`Picking multiple items from a finite list \u2014 tag selectors, filter chips,
62
62
  "share with N people", multi-region settings.
63
63
 
64
64
  **This is the answer for ANY "removable-chips-inside-an-input" pattern.**
@@ -76,7 +76,7 @@ already covers the trigger-with-badges shape.
76
76
 
77
77
  Use \`<Select>\` instead for SINGLE selection. Use \`<Command>\` directly
78
78
  (no MultiSelect wrapper) when the option set is unbounded or async
79
- (users to @-mention, email recipients, search-as-you-type API results).`,import:"@gradeui/ui",composesWith:["Popover","Command","Badge","Checkbox-style row indicator","Separator"],props:{options:{schema:z.unknown(),design:"plumbing"},value:{schema:z.string().optional(),design:"content",description:"controlled selection"},defaultValue:{schema:z.string().optional(),design:"content",description:"uncontrolled initial selection"},onValueChange:{schema:z.unknown().optional(),design:"event"},placeholder:{schema:z.string().optional(),design:"content",default:"Select\u2026"},searchPlaceholder:{schema:z.string().optional(),design:"content",default:"Search\u2026"},emptyMessage:{schema:z.string().optional(),design:"content",default:"Nothing matches."},maxCount:{schema:z.number().optional(),design:"knob",description:'badges shown on the trigger before collapsing to "+N more"'},searchable:{schema:z.boolean().optional(),design:"knob",description:"hide for short option lists",default:true},badgeDismissible:{schema:z.boolean().optional(),design:"knob",description:"show \xD7 on each selected badge",default:true},disabled:{schema:z.boolean().optional(),design:"knob"},modalPopover:{schema:z.boolean().optional(),design:"knob",description:"Popover modal mode",default:false},className:{schema:z.string().optional(),design:"plumbing"}}};var Kn={name:"Popover",description:'A floating panel anchored to a trigger that contains interactive content \u2014 date pickers, color pickers, filter pickers, "more info" panels, inline forms. Differs from Tooltip (hover-only, no focusable content) and Dialog (modal, blocks the page). DatePicker, DateRangePicker, and the Combobox pattern all compose Popover internally.',import:"@gradeui/ui",aliases:["popover","dropdown panel","floating panel","inline editor","attached panel","filter pop","popover view","popoverpresentation","attached popover","glass popover","frosted popover","inspector popover"],subcomponents:["PopoverTrigger","PopoverContent","PopoverAnchor"],composesWith:["Button (as trigger)","Calendar (date picker)","Command (combobox)","Form controls (inline edit popover)","Code (code-detail popovers)"],props:{open:{schema:z.unknown().optional(),design:"plumbing"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"usually a Button"},side:{schema:z.enum(["top","right","bottom","left","start","center","end"]).optional(),design:"knob"},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the popover surface is *made of*. `solid` is the default opaque `bg-popover`. `translucent` is the Apple HIG menu-sheet feel. `glass` for floating panels over rich canvases (Studio inspector, image-tool palette)."}}};var qn={name:"Progress",description:"Determinate progress \u2014 file uploads, multi-step forms, quota meters. Indeterminate state \u2192 use Skeleton or animated Loader icon.",import:"@gradeui/ui",aliases:["progress","progress view","progress indicator","progress bar","determinate progress","loading bar","completion bar"],composesWith:["Card (as a section)","Badge (showing % next to it)","Label (describing what's loading)"],props:{value:{schema:z.number().optional(),design:"knob",description:"percent complete"},max:{schema:z.number().optional(),design:"knob"},className:{schema:z.string().optional(),design:"plumbing"}}};var Yn={name:"RadioGroup",description:"A small set of mutually-exclusive options where the user needs to SEE all of them at once \u2014 pricing tiers (3-4 options), shipping speed, payment method radio cards. For 5+ options use Select. For a segmented control as part of a toolbar use ToggleGroup. For yes/no use Switch.",import:"@gradeui/ui",aliases:["radio group","radio buttons","single-choice","pricing options","payment method","radio buttons","radio control","single-select"],subcomponents:["RadioGroupItem"],composesWith:["Label (paired with each item via htmlFor)","Stack (vertical list)","Card (radio card pattern)"],props:{value:{schema:z.string().optional(),design:"content",description:"controlled selection"},defaultValue:{schema:z.string().optional(),design:"content",description:"uncontrolled initial"},onValueChange:{schema:z.unknown().optional(),design:"event"},disabled:{schema:z.boolean().optional(),design:"knob"},orientation:{schema:z.enum(["horizontal","vertical"]).optional(),design:"knob",default:"vertical"},name:{schema:z.string().optional(),design:"content",description:"form name when posting natively"},id:{schema:z.string().optional(),design:"plumbing",description:"pair with a <Label htmlFor> for click-on-label"}}};var Zn={name:"Resizable",description:`A multi-pane layout where the user wants to drag the divider \u2014 Slack/Mail-style list+detail, IDE editor+terminal, side-by-side compare view. Static layouts shouldn't use this \u2014 reach for AppShell with nav="three-pane" (fixed widths) or Grid (responsive ladder). Built on react-resizable-panels under the hood.`,import:"@gradeui/ui",aliases:["resizable","splitter","split pane","drag divider","adjustable panels","resizer","split view","draggable divider","split pane resizer","ns split view"],subcomponents:["ResizablePanelGroup","ResizablePanel","ResizableHandle"],composesWith:["AppShellMain (host the splitter inside main)","ScrollArea (each panel's content)","Card"],props:{direction:{schema:z.enum(["horizontal","vertical"]),design:"knob",description:"required; sets the axis the user drags along"},autoSaveId:{schema:z.string().optional(),design:"content",description:"persists user-adjusted sizes to localStorage under this id"},onLayout:{schema:z.unknown().optional(),design:"event"},defaultSize:{schema:z.number().optional(),design:"knob",description:"percent of group (0-100); siblings should sum to ~100"},minSize:{schema:z.unknown().optional(),design:"plumbing",description:"percent bounds"},collapsible:{schema:z.boolean().optional(),design:"knob",description:"allow this panel to collapse to zero"},collapsedSize:{schema:z.unknown().optional(),design:"plumbing",description:"collapse behaviour controls"},withHandle:{schema:z.boolean().optional(),design:"knob",description:"show a visible drag affordance (default just a hit-zone)"}}};var Xn={name:"RivePlayer",description:"Rive runtime wrapped in the shared media surface. Reach for Rive when you need interactive state-machine animations driven by scroll/hover/input. For non-interactive looping video, use VideoPlayer; for shader-driven backgrounds, use ThreeScene.",import:"@gradeui/ui",aliases:["rive","riv","animation","animated","lottie"],composesWith:["MediaSurface (internal)","Card","any container"],props:{src:{schema:z.string(),design:"content",description:"URL or path to the .riv file"},stateMachines:{schema:z.string().optional(),design:"content",description:"state machine(s) to run"},artboard:{schema:z.string().optional(),design:"content",description:"artboard name; omit to use default"},controls:{schema:z.boolean().optional(),design:"knob",description:"viewer mode by default; set true for play/pause overlay",default:false},autoPlay:{schema:z.boolean().optional(),design:"knob",description:"respects reduced-motion",default:true},loop:{schema:z.boolean().optional(),design:"knob",default:true},pauseOffscreen:{schema:z.boolean().optional(),design:"knob",default:true},fit:{schema:z.enum(["contain","cover","fill","fitWidth","fitHeight","none"]).optional(),design:"knob",default:"contain"},stateMachineInputs:{schema:z.unknown().optional(),design:"plumbing"},aspect:{schema:z.enum(["video","square","portrait","wide","auto"]).optional(),design:"knob",default:"square"},radius:{schema:z.enum(["none","sm","md","lg","xl"]).optional(),design:"knob",default:"lg"},poster:{schema:z.string().optional(),design:"content",description:"image shown while the runtime loads"}}};var Jn={name:"Row",description:"Horizontal composition \u2014 button groups, inline form rows, logo + nav rows, anything on one line. Reach for Row instead of `flex items-center gap-*` so the alignment and spacing are editable through the settings panel. For two-pane layouts with an explicit ratio (sidebar + content, 1/3 + 2/3) use Split instead \u2014 Row evenly flows whatever children it holds.",import:"@gradeui/ui",aliases:["row","hstack","horizontal","inline","horizontal layout","hstack","h-stack","horizontal stack","lazyhstack"],composesWith:["Button","Input","NavItem","Stack (can wrap a Row)","any content component"],props:{gap:{schema:z.enum(["none","xs","sm","md","lg","xl","2xl"]).optional(),design:"knob",description:"gap between children",default:"md"},align:{schema:z.enum(["start","center","end","stretch","baseline"]).optional(),design:"knob",description:"cross-axis (vertical) alignment",default:"center"},justify:{schema:z.enum(["start","center","end","between","around","evenly"]).optional(),design:"knob",description:"main-axis distribution",default:"start"},wrap:{schema:z.boolean().optional(),design:"knob",description:"allow children to wrap onto additional lines when they overflow",default:false},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"render as the child element via Slot",default:false},className:{schema:z.string().optional(),design:"plumbing"},children:{schema:z.unknown(),design:"plumbing"}}};var Qn={name:"ScrollArea",description:"Bounded content that needs custom scroll chrome \u2014 sidebars with long item lists, chat transcripts, table panels inside a dashboard, anywhere the OS scrollbar would feel out of place against the design tokens. The wrapping element has to have a height constraint (`h-`, `max-h-`, or grid row sizing) or nothing scrolls \u2014 scroll-area can't infer a bound on its own. For body-level scrolling, leave the document to the browser.",import:"@gradeui/ui",aliases:["scroll area","scroll container","custom scrollbar","sidebar scroll","panel scroll","scroll view","scrollview","react native scrollview"],subcomponents:["ScrollBar"],composesWith:["Card (long card body)","AppShellNav (long sidebar)","Sheet (long modal body)","Table (sticky-header scrolling list)"],props:{type:{schema:z.enum(["auto","always","scroll","hover"]).optional(),design:"knob",description:"when the scrollbar shows"},scrollHideDelay:{schema:z.number().optional(),design:"knob",description:'ms before "scroll"/"hover" scrollbars fade'},dir:{schema:z.enum(["ltr","rtl"]).optional(),design:"plumbing"},className:{schema:z.string().optional(),design:"plumbing",description:"set a height/max-height here, otherwise nothing scrolls"},orientation:{schema:z.enum(["vertical","horizontal"]).optional(),design:"knob",default:"vertical"}}};var ei={name:"SectionBlock",description:'The top-level container for a marketing page section \u2014 hero, feature row, pricing table, testimonial strip, FAQ section. Always reach for SectionBlock over a hand-rolled `<section>` so vertical rhythm, container width, and tonal background stay consistent across the page. Pair `background="gradient"` + `surface="glass"` inner Cards for the "modern marketing hero" pattern.',import:"@gradeui/ui",aliases:["section","section block","hero section","marketing section","page section","content section","container section","feature section","hero","page hero","marketing hero","glass section","gradient section","mesh hero"],composesWith:['Card (the most common child \u2014 especially with surface="glass")',"Grid (feature rows)","Stack (hero column)","MediaSurface (hero imagery)","Code (developer hero)","Carousel (logo strips)"],props:{padding:{schema:z.enum(["none","sm","md","lg","xl"]).optional(),design:"knob",description:"vertical rhythm. Defaults to `lg`."},background:{schema:z.enum(["transparent","muted","card","primary","gradient"]).optional(),design:"knob",description:"tonal direction of the section bg."},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the section is *made of*. Orthogonal to `background`. Use `glass` for hero sections that float over a generative backdrop / image / dot grid."},container:{schema:z.enum(["default","wide","narrow","full"]).optional(),design:"knob",description:"max-width of the inner content."},alignment:{schema:z.enum(["left","center","right"]).optional(),design:"knob",description:"header / CTA alignment."},titleSize:{schema:z.enum(["sm","md","lg","xl"]).optional(),design:"knob"},title:{schema:z.string().optional(),design:"plumbing"},subtitle:{schema:z.string().optional(),design:"content"},cta1:{schema:z.unknown().optional(),design:"plumbing",description:"string or `{ text, variant, href, onClick }` config"},backgroundImage:{schema:z.string().optional(),design:"content",description:"direct CSS background image url"},as:{schema:z.enum(["section","div","article"]).optional(),design:"knob",description:"semantic root"},fullBleed:{schema:z.boolean().optional(),design:"knob"}}};var ti={name:"Select",description:"Single-choice from 3+ known options. Fewer than 3 \u2192 RadioGroup. Huge list with search \u2192 use a Combobox (not in DS yet). Multi-select \u2192 not supported by this primitive.",import:"@gradeui/ui",aliases:["dropdown","combobox","picker","select","pop-up button","popup button","popup picker","picker view","rnpickerselect","react native picker","native picker"],subcomponents:["SelectTrigger","SelectValue","SelectContent","SelectItem","SelectGroup","SelectLabel","SelectSeparator"],composesWith:["Label (above SelectTrigger)","Form","Card"],props:{value:{schema:z.unknown().optional(),design:"plumbing",description:"Radix root"},wraps:{schema:z.unknown(),design:"plumbing"},placeholder:{schema:z.string().optional(),design:"content",description:"text when nothing is selected"},accepts:{schema:z.unknown(),design:"plumbing"}}};var oi={name:"Separator",description:"Light divider between sibling blocks in a Card, list, or header. For section-level partition use extra spacing instead.",import:"@gradeui/ui",aliases:["divider","rule","hr","line","horizontal rule"],composesWith:["Card (between CardHeader/Content/Footer)","navigation menus","any vertical stacks"],props:{orientation:{schema:z.enum(["horizontal","vertical"]).optional(),design:"knob",description:'default "horizontal"'},decorative:{schema:z.boolean().optional(),design:"knob",description:"hide from a11y tree",default:true},className:{schema:z.string().optional(),design:"plumbing"}}};var ri={name:"ShaderPresetPicker",description:"Runtime gallery of shader presets \u2014 click to select. Use with ThreeScene as a controlled input so the user can pick a background shader. For a single preview card, use ShaderPresetPreview directly.",import:"@gradeui/ui",aliases:["shader picker","preset picker","shader gallery","preset gallery"],composesWith:["ShaderPresetPreview (internal)","ThreeScene (the typical downstream consumer)"],props:{value:{schema:z.string().optional(),design:"content",description:"currently selected preset id (controlled)"},onChange:{schema:z.unknown().optional(),design:"event",description:"called when the user clicks a preset card"},filterTags:{schema:z.string().optional(),design:"content",description:'only show presets matching at least one tag ("space" | "retro" | "motion" | "hero" | "background" \u2026)'},live:{schema:z.enum(["never","hover","always"]).optional(),design:"knob",description:"thumbnail render mode",default:"hover"},postPreset:{schema:z.string().optional(),design:"content",description:"shared post-FX preset applied to every thumbnail"},palette:{schema:z.unknown().optional(),design:"plumbing",description:"shared palette applied to every thumbnail"},columns:{schema:z.unknown().optional(),design:"plumbing",description:"grid columns at md+ breakpoint"}}};var ai={name:"ShaderPresetPreview",description:"Thumbnail-sized preview card for a shader preset. Defaults to a cheap static placeholder until hovered, at which point the live WebGL render kicks in. Use directly when you want a single preset card; use ShaderPresetPicker for a filterable grid.",import:"@gradeui/ui",aliases:["shader preview","preset preview","shader card"],composesWith:["ThreeScene (internal)","ShaderPresetPicker (wraps this)"],props:{preset:{schema:z.string(),design:"content",description:"shader preset id from the registry"},live:{schema:z.enum(["never","hover","always"]).optional(),design:"knob",description:"when to run the live WebGL render",default:"hover"},postPreset:{schema:z.string().optional(),design:"content",description:"override the preset's default post-FX"},palette:{schema:z.unknown().optional(),design:"plumbing",description:"palette overrides for the preview"},aspect:{schema:z.enum(["video","square","portrait","wide"]).optional(),design:"knob",default:"video"},hideLabel:{schema:z.boolean().optional(),design:"knob",description:"hide the label strip under the preview",default:false},onClick:{schema:z.unknown().optional(),design:"event"}}};var ni={name:"Sheet",description:"A panel that slides in from a screen edge \u2014 mobile nav drawers, side panels for editing a single record without leaving the list, filter trays on small viewports, Studio-style inspector panels. For a centered focus modal use Dialog. For a transient announcement use Toast (Sonner). For inline reveals use Collapsible.",import:"@gradeui/ui",aliases:["sheet","drawer","side panel","slide-in","nav drawer","mobile drawer","slide-over","action sheet","modal sheet","bottom sheet","side sheet","react native modal sheet","bottom-sheet","ios action sheet","inspector panel","glass sheet","frosted drawer"],subcomponents:["SheetTrigger","SheetContent","SheetHeader","SheetTitle","SheetDescription","SheetFooter","SheetClose"],composesWith:["Form controls (an inline edit sheet)","Button (trigger + close)","AppShellNav (mobile-only swap)","Code (changelog drawers)","MediaSurface (image-detail sheets)"],props:{open:{schema:z.unknown().optional(),design:"plumbing"},asChild:{schema:z.boolean().optional(),design:"plumbing"},side:{schema:z.enum(["top","right","bottom","left"]).optional(),design:"knob",default:"right"},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the sheet panel is *made of*. `solid` is the default opaque `bg-background`. Reach for `glass` whenever the canvas behind the sheet (a layout in progress, a media gallery, a dashboard) should remain visible."},className:{schema:z.string().optional(),design:"plumbing",description:"usually set a width (right/left) or height (top/bottom)"},SheetTitle:{schema:z.unknown(),design:"plumbing"}}};var ii={name:"Sidebar",description:'Vertical app navigation. Drop inside `<AppShellNav placement="side">` for full-page layouts. Compound API \u2014 `<SidebarHeader>` for brand, `<SidebarContent>` for the scrollable body of `<SidebarSection>` + `<SidebarItem>` rows, `<SidebarFooter>` for user / settings chrome. For top nav reach for TopMenu; for command-palette style search reach for Command.',import:"@gradeui/ui",aliases:["sidebar","side menu","sidemenu","navigation sidebar","app sidebar","side nav","side nav rail","master pane","sidebarmenu","navigation rail","react native drawer"],subcomponents:["SidebarHeader","SidebarContent","SidebarFooter","SidebarSection","SidebarItem"],composesWith:["AppShell (inside AppShellNav)","Avatar (in Footer)","Tooltip (auto-wrapped on collapsed items)","Button (asChild for custom routing)"],props:{collapsed:{schema:z.boolean().optional(),design:"knob",description:"controlled collapsed state (wire onCollapsedChange when set)"},defaultCollapsed:{schema:z.boolean().optional(),design:"knob",description:"uncontrolled initial value (default false)"},onCollapsedChange:{schema:z.unknown().optional(),design:"event"},collapsible:{schema:z.boolean().optional(),design:"knob",description:"show the affordance for the user to collapse (default true)"},variant:{schema:z.enum(["rail","panel"]).optional(),design:"knob",description:'outer chrome treatment. `rail` (default) is the classic nav rail with a single right-border + tracked width via `--gds-sidebar-width`; drops cleanly into `<AppShellNav placement="side">`. `panel` is a card-style floating sidebar with full border + rounded corners + parent-controlled width; use when the sidebar is one of several adjacent panes in a body row (e.g. Projects | Canvas | Settings). The compound children (Header/Content/Footer/Section/Item) are identical in both treatments.'},any:{schema:z.unknown(),design:"plumbing",description:"brand / logo / org switcher; hides nothing when collapsed (centred)"},title:{schema:z.unknown().optional(),design:"plumbing",description:'group label; **uppercase tracking-wide muted** styling auto-applied (Notion / Linear / Slack-style "GAMES", "FAVORITES", "WORKSPACE" headers); hidden when sidebar is collapsed'},icon:{schema:z.unknown().optional(),design:"plumbing",description:"optional icon beside the title"},trailing:{schema:z.unknown().optional(),design:"plumbing",description:`**action(s) on the right edge of the header** \u2014 the canonical "+" / "..." slot (Notion's "+ Add page" next to Pages, Linear's "+" next to Favorites, Slack's "+" next to Channels). Pointer events isolated so a Button here doesn't toggle collapse.`},defaultExpanded:{schema:z.boolean().optional(),design:"knob",description:"initial open state (default true)"},badge:{schema:z.unknown().optional(),design:"plumbing",description:"trailing count / label (hidden when collapsed)"},active:{schema:z.boolean().optional(),design:"knob",description:'current route; adds aria-current="page"'},href:{schema:z.string().optional(),design:"content",description:"renders as <a>; for routing use `asChild` with your link component"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"wrap a custom link (<Link href> from Next.js etc.) via Radix Slot"},asButton:{schema:z.boolean().optional(),design:"knob",description:"render as <button> for action rows (open dialog, log out)"},disabled:{schema:z.boolean().optional(),design:"knob"},collapsedLabel:{schema:z.unknown().optional(),design:"plumbing",description:"tooltip override when sidebar is collapsed (defaults to children text)"},size:{schema:z.enum(["sm","md"]).optional(),design:"knob",description:"row size. `md` (default) is the standard `text-sm font-medium` nav row; `sm` is `text-xs` + lighter weight + tighter padding for visually subordinate rows (nested screens under a project, sub-pages under a section). Active state still wins on color + weight so the current row pops at either size."},description:{schema:z.unknown().optional(),design:"plumbing",description:"secondary line beneath the label (metadata like 'Edited 2m ago', '12 items', a brief description). Row layout adapts: label + description stacked vertically; icon vertically-centered against the stack; badge stays on trailing edge. Hidden when sidebar collapsed."}}};var si={name:"Skeleton",description:'Loading placeholder for content whose shape you know. Set width/height via className to mimic the real content (e.g. "h-4 w-32"). Not a spinner \u2014 use it where the real thing will drop in.',import:"@gradeui/ui",aliases:["placeholder","shimmer","loader","loading state","redacted","redacted placeholder","shimmer placeholder","content placeholder","lottie placeholder"],composesWith:["Card","Avatar (inside a Skeleton for avatar loading)","any layout"],props:{className:{schema:z.string().optional(),design:"plumbing",description:"required in practice; supply width/height utilities"}}};var li={name:"Slider",description:'A continuous-ish numeric pick \u2014 volume, opacity, font size, price-range filters. Use a single-thumb slider for one value, two-thumb for a range. For a small set of discrete options (1-5 stars, sm/md/lg) prefer ToggleGroup. For free-text numeric entry use an Input type="number".',import:"@gradeui/ui",aliases:["slider","range slider","range input","volume","opacity slider","scrub","drag value","slider control","value slider","react native slider"],composesWith:["Label (mandatory above)","Row (label + current value display)","Card (settings rows)"],props:{value:{schema:z.number().optional(),design:"knob",description:"controlled value; ALWAYS an array even for a single-thumb slider (`[50]`)"},defaultValue:{schema:z.number().optional(),design:"knob",description:"uncontrolled initial; `[20, 80]` for a two-thumb range"},onValueChange:{schema:z.unknown().optional(),design:"event"},min:{schema:z.number().optional(),design:"knob"},max:{schema:z.number().optional(),design:"knob"},step:{schema:z.number().optional(),design:"knob"},disabled:{schema:z.boolean().optional(),design:"knob"},orientation:{schema:z.enum(["horizontal","vertical"]).optional(),design:"knob",default:"horizontal"},dir:{schema:z.enum(["ltr","rtl"]).optional(),design:"plumbing"},inverted:{schema:z.boolean().optional(),design:"knob",description:"flip the visual direction"},name:{schema:z.string().optional(),design:"content",description:"form name when posting natively"}}};var di={name:"Sortable",description:"Drag-to-reorder lists, kanban-column reordering, sortable shelves, tab strips the user can rearrange. Pairs with any layout primitive \u2014 Stack for vertical lists, Row for horizontal strips, Grid for 2D card walls. For cross-container drag (drag a card from one column to another) hand-roll DndContext at the page level \u2014 Sortable v1 covers single-list reorder; Sortable.Group for cross-container is a planned follow-up. Reach for raw `@dnd-kit/core` if you need custom collision detection, drag overlays with arbitrary chrome, or non-list use cases (kanban swimlanes, draggable canvas nodes).",import:"@gradeui/ui",aliases:["sortable","reorder","drag and drop","dnd","draggable list","sortable list","kanban","drag to reorder","drag-drop","dragdroplist","drag handle","react native draggable flatlist"],subcomponents:["Sortable.Item","Sortable.Handle"],composesWith:["Stack (vertical lists)","Row (horizontal strips)","Grid (2D card walls)","Card (typical item content)","Button (as Sortable.Handle asChild)"],props:{values:{schema:z.unknown(),design:"plumbing",description:"ordered list of unique ids; the source of truth for the order"},onReorder:{schema:z.unknown().optional(),design:"event",description:"fires with the new order after a drag that changed it"},strategy:{schema:z.enum(["vertical","horizontal","grid"]).optional(),design:"knob",description:"match the layout your items render in",default:"vertical"},disabled:{schema:z.boolean().optional(),design:"knob",description:"disable drag on every item"},Sortable:{schema:z.unknown(),design:"plumbing",description:"must match one entry in the parent `values` array (identity, not React key)"}}};var ci={name:"Stack",description:"Default top-level layout inside the main slot when composing two or more stacked regions (hero + content + footer, auth card + subtext, etc.). Prefer Stack over hand-rolled `flex flex-col gap-*` so the vertical rhythm is editable through the settings panel.",import:"@gradeui/ui",aliases:["stack","vstack","vertical","column","vertical layout","v-stack","vertical stack","lazyvstack"],composesWith:["Section","Row","Split","Hero","any content component"],props:{gap:{schema:z.enum(["none","xs","sm","md","lg","xl","2xl"]).optional(),design:"knob",description:"vertical gap between children",default:"md"},align:{schema:z.enum(["start","center","end","stretch"]).optional(),design:"knob",description:"cross-axis (horizontal) alignment of children",default:"stretch"},justify:{schema:z.enum(["start","center","end","between","around","evenly"]).optional(),design:"knob",description:'main-axis (vertical) distribution. Reach for this on absolute-positioned overlays (`justify="end"` pins children to the bottom) and split footers (`justify="between"`).',default:"start"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"render as the child element via Slot, so `<Stack asChild><section>\u2026</section></Stack>` stamps Stack's classes onto the `<section>` rather than nesting a wrapper div",default:false},className:{schema:z.string().optional(),design:"plumbing"},children:{schema:z.unknown(),design:"plumbing"}}};var pi={name:"Switch",description:'Instant on/off setting ("Enable notifications", "Dark mode"). Commits on toggle \u2014 no submit button needed. For selecting-from-a-list use Checkbox.',import:"@gradeui/ui",aliases:["toggle","switch","on/off switch","ios toggle","toggle switch","switch control","react native switch"],composesWith:["Label (via htmlFor)","Card (settings rows)"],props:{checked:{schema:z.boolean().optional(),design:"knob"},onCheckedChange:{schema:z.unknown().optional(),design:"event"},defaultChecked:{schema:z.boolean().optional(),design:"knob"},disabled:{schema:z.boolean().optional(),design:"knob"},id:{schema:z.string().optional(),design:"plumbing"}}};var ui={name:"Table",description:"Structured tabular data \u2014 rows \xD7 columns with alignment requirements. NOT a layout grid \u2014 for that use div+Tailwind grid utilities. Keep to <100 rows; larger datasets need virtualisation (not in DS).",import:"@gradeui/ui",aliases:["table","table view","data table","datatable","grid view","data grid","rows and columns"],subcomponents:["TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption"],composesWith:["Card (wrap the table)","Badge (inside TableCell for status)","Checkbox (row selection)","Button (row actions)"],props:{Each:{schema:z.unknown(),design:"plumbing"},No:{schema:z.unknown(),design:"plumbing",description:"styling follows the active theme tokens"}}};var gi={name:"Tabs",description:'A small set of peer views within one surface (2\u20135 tabs). For primary nav use Side Menu/routing. For filters use a filter control, not tabs. Pick `variant="pill"` for app chrome (settings panels, in-card tab strips). Pick `variant="underlined"` for marketing/docs pages and browser-tab-style treatments.',import:"@gradeui/ui",aliases:["tabs","tab strip","tab bar","tab view","tabbed interface","pageviewcontroller","react native tab view","underlined tabs","page tabs","segment switcher","simple tabs"],subcomponents:["TabsList","TabsTrigger","TabsContent"],composesWith:["Card (tabs inside a card body)","Dialog","TooltipProvider (required for tooltip prop)"],props:{defaultValue:{schema:z.unknown().optional(),design:"plumbing"},size:{schema:z.enum(["sm","md","lg, default md"]).optional(),design:"knob",description:"t-shirt scale aligned with Button/ToggleGroup heights; cascades to every TabsTrigger via context so set it once on the list"},variant:{schema:z.enum(["pill","underlined, default pill"]).optional(),design:"knob",description:"`pill` is the shadcn chip-on-muted look; `underlined` is the minimal text + bottom-border treatment (formerly the separate SimpleTabs component, collapsed into Tabs in May 2026). Cascades to triggers."},value:{schema:z.string(),design:"content",description:"matches a TabsContent value; tooltip?: string \u2014 when set, wraps the trigger in the design-system Tooltip and auto-applies aria-label (useful for icon-only triggers); requires a TooltipProvider somewhere above the tabs"}}};var fi={name:"Textarea",description:"Multi-line text entry (descriptions, messages, comments). Pair with a Label. Single-line input \u2192 use Input instead.",import:"@gradeui/ui",aliases:["text area","multiline","comment box","message field","text editor","multi-line text","multiline input","multiline text field","comments box","multiline textinput"],composesWith:["Label","Form","Card (in CardContent)"],props:{}};var hi={name:"ThreeScene",description:"WebGL primitive for shader backgrounds, generative visuals, and bespoke three.js scenes. Three authoring paths, in order of preference \u2014 (1) pick a `preset` id; (2) if nothing in the registry fits, write a `fragmentShader` against the fixed uniform contract; (3) only as a last resort, pass a full `createScene` factory. For looping video, use VideoPlayer; for interactive animations, use RivePlayer.",import:"@gradeui/ui",aliases:["three","threejs","webgl","shader","scene","3d","generative","hero background","fragment shader","glsl"],composesWith:["MediaSurface (internal)","foreground content stacked above with `position: absolute/relative z-10`"],props:{preset:{schema:z.enum(["space","plasma","voronoi","synthwave"]).optional(),design:"knob",description:"shader preset id from the registry"},fragmentShader:{schema:z.string().optional(),design:"content",description:"user-authored GLSL body; takes precedence over preset"},onShaderError:{schema:z.unknown().optional(),design:"event",description:'fires on compile failure; scene falls back to `preset="space"`'},postPreset:{schema:z.enum(["none","vhs","cinematic","synthwave","crt"]).optional(),design:"knob",description:"post-processing pass",default:"vhs"},palette:{schema:z.unknown().optional(),design:"plumbing",description:"any CSS-legal colour string per slot. Re-tints automatically when the theme changes. Unset slots fall back to defaults."},createScene:{schema:z.unknown().optional(),design:"plumbing",description:"custom full scene factory; takes precedence over preset AND fragmentShader"},controls:{schema:z.boolean().optional(),design:"knob",description:"play/pause overlay",default:false},autoPlay:{schema:z.boolean().optional(),design:"knob",description:"respects reduced-motion",default:true},pauseOffscreen:{schema:z.boolean().optional(),design:"knob",description:"big win for WebGL battery life",default:true},aspect:{schema:z.enum(["video","square","portrait","wide","auto"]).optional(),design:"knob",default:"video"},maxDpr:{schema:z.number().optional(),design:"knob",description:"lower for thumbnails / low-end devices"},radius:{schema:z.enum(["none","sm","md","lg","xl"]).optional(),design:"knob",default:"lg"}}};var bi={name:"Toast",description:'Transient, non-blocking feedback that confirms or warns about an action \u2014 "Saved", "Failed to upload", "Copied to clipboard", "Invitation sent". For permanent inline messages reach for Callout. For confirmations that block until acknowledged use Dialog. Mount <Toaster /> ONCE at the root of the app; everywhere else, call the `toast` helper.',import:"@gradeui/ui",aliases:["toast","toaster","sonner","notification","snackbar","alert toast","transient alert","transient banner","banner notification","toastandroid"],composesWith:["App root layout (single <Toaster /> mount)","Form submit handlers (success/error toasts)","Async actions"],props:{position:{schema:z.enum(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]).optional(),design:"knob",default:"bottom-right"},theme:{schema:z.enum(["light","dark","system"]).optional(),design:"knob"},richColors:{schema:z.boolean().optional(),design:"knob",description:"colored variants for success/error/warning/info"},expand:{schema:z.boolean().optional(),design:"knob",description:"keep multiple toasts visually separated rather than stacked"},visibleToasts:{schema:z.number().optional(),design:"knob",description:"max concurrent toasts on screen (default 3)"},duration:{schema:z.number().optional(),design:"knob",description:"default ms before auto-dismiss"}}};var vi={name:"Toggle",description:`A standalone on/off button \u2014 Bold/Italic in a toolbar, "Show grid" in a header, single binary toggle that doesn't belong inside a Switch row. For two-or-more mutually-exclusive options use ToggleGroup. For a labeled settings switch ("Active: on/off") use Switch.`,import:"@gradeui/ui",aliases:["toggle","toggle button","press button","bold button","italic button"],composesWith:["Tooltip (wrap an icon-only Toggle)","Row","TabsList (sibling)"],props:{variant:{schema:z.enum(["default","outline"]).optional(),design:"knob",description:"outline adds a border, default is borderless and ghost-like"},size:{schema:z.enum(["default","sm","lg"]).optional(),design:"knob"},pressed:{schema:z.boolean().optional(),design:"knob",description:"controlled pressed state"},defaultPressed:{schema:z.boolean().optional(),design:"knob",description:"uncontrolled initial state"},onPressedChange:{schema:z.unknown().optional(),design:"event"},disabled:{schema:z.boolean().optional(),design:"knob"},children:{schema:z.unknown(),design:"plumbing",description:"usually an icon or short label"}}};var yi={name:"ToggleGroup",description:'A small set of mutually-exclusive (`type="single"`) or independent (`type="multiple"`) binary options that live side-by-side as a segmented control \u2014 viewport size picker (Mobile/Tablet/Desktop), text alignment, view density. Reads identically to a TabsList of the same size; reach for ToggleGroup when each option emits a value (like a form input) rather than swapping panels. Use Tabs for panel switching, Toggle for a single on/off.',import:"@gradeui/ui",aliases:["toggle group","segmented control","segmented buttons","button group","pill group","view selector","segmented picker","segmentedcontrolios","segmented buttons group","rn segmented control"],subcomponents:["ToggleGroupItem"],composesWith:["Card (header controls)","Row","AppShellHeader chrome","settings panels"],props:{type:{schema:z.enum(["single","multiple"]),design:"knob",description:"single picks one, multiple picks any number"},value:{schema:z.string().optional(),design:"content",description:"controlled; matches `type` (string for single, string[] for multiple)"},defaultValue:{schema:z.string().optional(),design:"content",description:"uncontrolled initial"},onValueChange:{schema:z.unknown().optional(),design:"event"},size:{schema:z.enum(["sm","md","lg, default md"]).optional(),design:"knob",description:"cascades to every ToggleGroupItem via context, matches Tabs/Button heights"},variant:{schema:z.enum(["default","outline"]).optional(),design:"knob"},tooltip:{schema:z.unknown().optional(),design:"plumbing",description:"when set, wraps the item in a Tooltip; required for icon-only items where the visible chrome doesn't carry a label"},tooltipSide:{schema:z.enum(["top","right","bottom",'left", default "top']).optional(),design:"knob",description:"side the tooltip renders on"},tooltipDelay:{schema:z.number().optional(),design:"knob",description:"per-item delay override; falls back to the upstream TooltipProvider's delayDuration"}}};var xi={name:"Toolbar",description:`ANY three-region chrome bar \u2014 the leading/center/trailing pattern Apple HIG
79
+ (users to @-mention, email recipients, search-as-you-type API results).`,import:"@gradeui/ui",composesWith:["Popover","Command","Badge","Checkbox-style row indicator","Separator"],styleDefaults:{MultiSelect:"mr-2 flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-primary"},props:{options:{schema:z.unknown(),design:"plumbing"},value:{schema:z.string().optional(),design:"content",description:"controlled selection"},defaultValue:{schema:z.string().optional(),design:"content",description:"uncontrolled initial selection"},onValueChange:{schema:z.unknown().optional(),design:"event"},placeholder:{schema:z.string().optional(),design:"content",default:"Select\u2026"},searchPlaceholder:{schema:z.string().optional(),design:"content",default:"Search\u2026"},emptyMessage:{schema:z.string().optional(),design:"content",default:"Nothing matches."},maxCount:{schema:z.number().optional(),design:"knob",description:'badges shown on the trigger before collapsing to "+N more"'},searchable:{schema:z.boolean().optional(),design:"knob",description:"hide for short option lists",default:true},badgeDismissible:{schema:z.boolean().optional(),design:"knob",description:"show \xD7 on each selected badge",default:true},disabled:{schema:z.boolean().optional(),design:"knob"},modalPopover:{schema:z.boolean().optional(),design:"knob",description:"Popover modal mode",default:false},className:{schema:z.string().optional(),design:"plumbing"}}};var Zi={name:"Popover",description:'A floating panel anchored to a trigger that contains interactive content \u2014 date pickers, color pickers, filter pickers, "more info" panels, inline forms. Differs from Tooltip (hover-only, no focusable content) and Dialog (modal, blocks the page). DatePicker, DateRangePicker, and the Combobox pattern all compose Popover internally.',import:"@gradeui/ui",aliases:["popover","dropdown panel","floating panel","inline editor","attached panel","filter pop","popover view","popoverpresentation","attached popover","glass popover","frosted popover","inspector popover"],subcomponents:["PopoverTrigger","PopoverContent","PopoverAnchor"],composesWith:["Button (as trigger)","Calendar (date picker)","Command (combobox)","Form controls (inline edit popover)","Code (code-detail popovers)"],styleDefaults:{PopoverContent:"z-50 w-72 rounded-md border p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]"},props:{open:{schema:z.unknown().optional(),design:"plumbing"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"usually a Button"},side:{schema:z.enum(["top","right","bottom","left","start","center","end"]).optional(),design:"knob"},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the popover surface is *made of*. `solid` is the default opaque `bg-popover`. `translucent` is the Apple HIG menu-sheet feel. `glass` for floating panels over rich canvases (Studio inspector, image-tool palette)."}}};var Xi={name:"Progress",description:"Determinate progress \u2014 file uploads, multi-step forms, quota meters. Indeterminate state \u2192 use Skeleton or animated Loader icon.",import:"@gradeui/ui",aliases:["progress","progress view","progress indicator","progress bar","determinate progress","loading bar","completion bar"],composesWith:["Card (as a section)","Badge (showing % next to it)","Label (describing what's loading)"],styleDefaults:{Progress:"relative h-4 w-full overflow-hidden rounded-full bg-secondary"},props:{value:{schema:z.number().optional(),design:"knob",description:"percent complete"},max:{schema:z.number().optional(),design:"knob"},className:{schema:z.string().optional(),design:"plumbing"}}};var Ji={name:"RadioCard",description:"Single-select where each option is a whole selectable card (shipping options, plan picker, onboarding choices). The whole card is the control, so focus and the checked state live on the card surface and the entire card is clickable. MUST sit inside a RadioGroup (keeps roving focus + single-select). Static content only \u2014 never nest an interactive control (Slider/Input/Button/link) inside. For a plain radio + label row use Field instead.",import:"@gradeui/ui",aliases:["radio card","selectable card","option card","plan picker","choice card","pricing tier","segmented choice card"],composesWith:["RadioGroup (required parent)","Badge (in aside)","MediaSurface (custom children)"],props:{value:{schema:z.string(),design:"content",description:"the radio value"},label:{schema:z.unknown().optional(),design:"plumbing",description:"title line"},description:{schema:z.unknown().optional(),design:"plumbing",description:"secondary line"},aside:{schema:z.unknown().optional(),design:"plumbing",description:"slot before the indicator (a Badge, price, hint)"},hideIndicator:{schema:z.boolean().optional(),design:"knob",description:"hide the dot; selection shown by the card border + background"},indicatorPosition:{schema:z.enum(["leading","trailing"]).optional(),design:"knob",description:"default trailing"},children:{schema:z.unknown().optional(),design:"plumbing",description:"arbitrary static content (image, custom layout) instead of label/description"}}};var Qi={name:"RadioGroup",description:"A small set of mutually-exclusive options where the user needs to SEE all of them at once \u2014 pricing tiers (3-4 options), shipping speed, payment method radio cards. When each option should be a whole clickable card (label + description, selected state on the card), use RadioCard inside the RadioGroup instead of a Card with a radio in the corner. For a plain label + description row, wrap RadioGroupItem in Field. For 5+ options use Select. For a segmented control as part of a toolbar use ToggleGroup. For yes/no use Switch.",import:"@gradeui/ui",aliases:["radio group","radio buttons","single-choice","pricing options","payment method","radio buttons","radio control","single-select"],subcomponents:["RadioGroupItem"],composesWith:["Label (paired with each item via htmlFor)","Field (label + description row)","RadioCard (whole-card selectable option)","Stack (vertical list)"],styleDefaults:{RadioGroup:"grid gap-2",RadioGroupItem:"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"},props:{value:{schema:z.string().optional(),design:"content",description:"controlled selection"},defaultValue:{schema:z.string().optional(),design:"content",description:"uncontrolled initial"},onValueChange:{schema:z.unknown().optional(),design:"event"},disabled:{schema:z.boolean().optional(),design:"knob"},orientation:{schema:z.enum(["horizontal","vertical"]).optional(),design:"knob",default:"vertical"},name:{schema:z.string().optional(),design:"content",description:"form name when posting natively"},id:{schema:z.string().optional(),design:"plumbing",description:"pair with a <Label htmlFor> for click-on-label"}}};var es={name:"Resizable",description:`A multi-pane layout where the user wants to drag the divider \u2014 Slack/Mail-style list+detail, IDE editor+terminal, side-by-side compare view. Static layouts shouldn't use this \u2014 reach for AppShell with nav="three-pane" (fixed widths) or Grid (responsive ladder). Built on react-resizable-panels under the hood.`,import:"@gradeui/ui",aliases:["resizable","splitter","split pane","drag divider","adjustable panels","resizer","split view","draggable divider","split pane resizer","ns split view"],subcomponents:["ResizablePanelGroup","ResizablePanel","ResizableHandle"],composesWith:["AppShellMain (host the splitter inside main)","ScrollArea (each panel's content)","Card"],styleDefaults:{ResizablePanelGroup:"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",ResizableHandle:"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90"},props:{direction:{schema:z.enum(["horizontal","vertical"]),design:"knob",description:"required; sets the axis the user drags along"},autoSaveId:{schema:z.string().optional(),design:"content",description:"persists user-adjusted sizes to localStorage under this id"},onLayout:{schema:z.unknown().optional(),design:"event"},defaultSize:{schema:z.number().optional(),design:"knob",description:"percent of group (0-100); siblings should sum to ~100"},minSize:{schema:z.unknown().optional(),design:"plumbing",description:"percent bounds"},collapsible:{schema:z.boolean().optional(),design:"knob",description:"allow this panel to collapse to zero"},collapsedSize:{schema:z.unknown().optional(),design:"plumbing",description:"collapse behaviour controls"},withHandle:{schema:z.boolean().optional(),design:"knob",description:"show a visible drag affordance (default just a hit-zone)"}}};var ts={name:"RivePlayer",description:"Rive runtime wrapped in the shared media surface. Reach for Rive when you need interactive state-machine animations driven by scroll/hover/input. For non-interactive looping video, use VideoPlayer; for shader-driven backgrounds, use ThreeScene.",import:"@gradeui/ui",aliases:["rive","riv","animation","animated","lottie"],composesWith:["MediaSurface (internal)","Card","any container"],styleDefaults:{RiveInner:"absolute inset-0 flex items-end justify-end p-2"},props:{src:{schema:z.string(),design:"content",description:"URL or path to the .riv file"},stateMachines:{schema:z.union([z.string(),z.array(z.string())]).optional(),design:"knob",description:"state machine(s) to run"},artboard:{schema:z.string().optional(),design:"content",description:"artboard name; omit to use default"},controls:{schema:z.boolean().optional(),design:"knob",description:"viewer mode by default; set true for play/pause overlay",default:false},autoPlay:{schema:z.boolean().optional(),design:"knob",description:"respects reduced-motion",default:true},loop:{schema:z.boolean().optional(),design:"knob",default:true},pauseOffscreen:{schema:z.boolean().optional(),design:"knob",default:true},fit:{schema:z.enum(["contain","cover","fill","fitWidth","fitHeight","none"]).optional(),design:"knob",default:"contain"},stateMachineInputs:{schema:z.unknown().optional(),design:"plumbing"},aspect:{schema:z.enum(["video","square","portrait","wide","auto"]).optional(),design:"knob",default:"square"},radius:{schema:z.enum(["none","sm","md","lg","xl"]).optional(),design:"knob",default:"lg"},poster:{schema:z.string().optional(),design:"content",description:"image shown while the runtime loads"}}};var os={name:"Row",description:"Horizontal composition \u2014 button groups, inline form rows, logo + nav rows, anything on one line. Reach for Row instead of `flex items-center gap-*` so the alignment and spacing are editable through the settings panel. For two-pane layouts with an explicit ratio (sidebar + content, 1/3 + 2/3) use Split instead \u2014 Row evenly flows whatever children it holds.",import:"@gradeui/ui",aliases:["row","hstack","horizontal","inline","horizontal layout","hstack","h-stack","horizontal stack","lazyhstack"],composesWith:["Button","Input","NavItem","Stack (can wrap a Row)","any content component"],styleDefaults:{Row:"gds-row flex flex-row gap-4 items-center justify-start"},variantDefaults:{gap:"md",align:"center",justify:"start"},props:{gap:{schema:z.enum(["none","xs","sm","md","lg","xl","2xl"]).optional(),design:"knob",description:"gap between children",default:"md"},align:{schema:z.enum(["start","center","end","stretch","baseline"]).optional(),design:"knob",description:"cross-axis (vertical) alignment",default:"center"},justify:{schema:z.enum(["start","center","end","between","around","evenly"]).optional(),design:"knob",description:"main-axis distribution",default:"start"},wrap:{schema:z.boolean().optional(),design:"knob",description:"allow children to wrap onto additional lines when they overflow",default:false},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"render as the child element via Slot",default:false},className:{schema:z.string().optional(),design:"plumbing"},children:{schema:z.unknown(),design:"plumbing"}}};var rs={name:"ScreenAnimator",description:'Wrap ANY screen or section in a directed camera \u2014 a "live demo',import:"@gradeui/ui",aliases:["screen animator","camera","camera tour","director","demo","product demo","zoom pan","spotlight","ken burns","presenter"],composesWith:["AppShell","ThreeScene","Card","Grid","the whole component set (it wraps a screen)"],styleDefaults:{ScreenAnimator:"gds-screen-animator"},props:{shots:{schema:z.unknown().optional(),design:"plumbing",description:"the tour. Each"}}};var as={name:"ScrollArea",description:"Bounded content that needs custom scroll chrome \u2014 sidebars with long item lists, chat transcripts, table panels inside a dashboard, anywhere the OS scrollbar would feel out of place against the design tokens. The wrapping element has to have a height constraint (`h-`, `max-h-`, or grid row sizing) or nothing scrolls \u2014 scroll-area can't infer a bound on its own. For body-level scrolling, leave the document to the browser.",import:"@gradeui/ui",aliases:["scroll area","scroll container","custom scrollbar","sidebar scroll","panel scroll","scroll view","scrollview","react native scrollview"],subcomponents:["ScrollBar"],composesWith:["Card (long card body)","AppShellNav (long sidebar)","Sheet (long modal body)","Table (sticky-header scrolling list)"],styleDefaults:{ScrollArea:"relative overflow-hidden",ScrollBar:"flex touch-none select-none transition-colors"},props:{type:{schema:z.enum(["auto","always","scroll","hover"]).optional(),design:"knob",description:"when the scrollbar shows"},scrollHideDelay:{schema:z.number().optional(),design:"knob",description:'ms before "scroll"/"hover" scrollbars fade'},dir:{schema:z.enum(["ltr","rtl"]).optional(),design:"plumbing"},className:{schema:z.string().optional(),design:"plumbing",description:"set a height/max-height here, otherwise nothing scrolls"},orientation:{schema:z.enum(["vertical","horizontal"]).optional(),design:"knob",default:"vertical"}}};var ns={name:"SectionBlock",description:'The top-level container for a marketing page section \u2014 hero, feature row, pricing table, testimonial strip, FAQ section. Always reach for SectionBlock over a hand-rolled `<section>` so vertical rhythm, container width, and tonal background stay consistent across the page. Pair `background="gradient"` + `surface="glass"` inner Cards for the "modern marketing hero" pattern.',import:"@gradeui/ui",aliases:["section","section block","hero section","marketing section","page section","content section","container section","feature section","hero","page hero","marketing hero","glass section","gradient section","mesh hero"],composesWith:['Card (the most common child \u2014 especially with surface="glass")',"Grid (feature rows)","Stack (hero column)","MediaSurface (hero imagery)","Code (developer hero)","Carousel (logo strips)"],styleDefaults:{SectionBlock:"relative w-full py-16 md:py-24 bg-transparent"},variantDefaults:{padding:"lg",background:"transparent"},props:{padding:{schema:z.enum(["none","sm","md","lg","xl"]).optional(),design:"knob",description:"vertical rhythm. Defaults to `lg`."},background:{schema:z.enum(["transparent","muted","card","primary","gradient"]).optional(),design:"knob",description:"tonal direction of the section bg."},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the section is *made of*. Orthogonal to `background`. Use `glass` for hero sections that float over a generative backdrop / image / dot grid."},container:{schema:z.enum(["default","wide","narrow","full"]).optional(),design:"knob",description:"max-width of the inner content."},alignment:{schema:z.enum(["left","center","right"]).optional(),design:"knob",description:"header / CTA alignment."},titleSize:{schema:z.enum(["sm","md","lg","xl"]).optional(),design:"knob"},title:{schema:z.string().optional(),design:"plumbing"},subtitle:{schema:z.string().optional(),design:"content"},cta1:{schema:z.unknown().optional(),design:"plumbing",description:"string or `{ text, variant, href, onClick }` config"},backgroundImage:{schema:z.string().optional(),design:"content",description:"direct CSS background image url"},as:{schema:z.enum(["section","div","article"]).optional(),design:"knob",description:"semantic root"},fullBleed:{schema:z.boolean().optional(),design:"knob"}}};var is={name:"Select",description:'Single-choice from 3+ known options. Fewer than 3 \u2192 RadioGroup. Huge list with search \u2192 use a Combobox (not in DS yet). Multi-select \u2192 not supported by this primitive. In dense tool panels, set size="xs" on BOTH the trigger and the content so the closed control and open menu match.',import:"@gradeui/ui",aliases:["dropdown","combobox","picker","select","pop-up button","popup button","popup picker","picker view","rnpickerselect","react native picker","native picker"],subcomponents:["SelectTrigger","SelectValue","SelectContent","SelectItem","SelectGroup","SelectLabel","SelectSeparator"],composesWith:["Label (above SelectTrigger)","Form","Card"],styleDefaults:{SelectTrigger:"flex w-full items-center justify-between rounded-md border border-input bg-background ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 h-10 px-3 py-2 text-sm",SelectScrollUpButton:"flex cursor-default items-center justify-center py-1",SelectScrollDownButton:"flex cursor-default items-center justify-center py-1",SelectContent:"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",SelectLabel:"py-1.5 pl-8 pr-2 text-sm font-semibold",SelectItem:"relative flex w-full cursor-default select-none items-center rounded-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 py-1.5 pl-8 pr-2 text-sm",SelectSeparator:"-mx-1 my-1 h-px bg-muted"},props:{value:{schema:z.unknown().optional(),design:"plumbing",description:"Radix root"},size:{schema:z.enum(["default","sm","xs"]).optional(),design:"knob",description:"control density; wraps the clickable control, nest SelectValue inside"},placeholder:{schema:z.string().optional(),design:"content",description:"text when nothing is selected"}}};var ss={name:"Separator",description:"Light divider between sibling blocks in a Card, list, or header. For section-level partition use extra spacing instead.",import:"@gradeui/ui",aliases:["divider","rule","hr","line","horizontal rule"],composesWith:["Card (between CardHeader/Content/Footer)","navigation menus","any vertical stacks"],styleDefaults:{Separator:"shrink-0 bg-border"},props:{orientation:{schema:z.enum(["horizontal","vertical"]).optional(),design:"knob",description:'default "horizontal"'},decorative:{schema:z.boolean().optional(),design:"knob",description:"hide from a11y tree",default:true},className:{schema:z.string().optional(),design:"plumbing"}}};var ls={name:"ShaderPresetPicker",description:"Runtime gallery of shader presets \u2014 click to select. Use with ThreeScene as a controlled input so the user can pick a background shader. For a single preview card, use ShaderPresetPreview directly.",import:"@gradeui/ui",aliases:["shader picker","preset picker","shader gallery","preset gallery"],composesWith:["ShaderPresetPreview (internal)","ThreeScene (the typical downstream consumer)"],styleDefaults:{ShaderPresetPicker:"grid grid-cols-2 gap-3"},props:{value:{schema:z.string().optional(),design:"content",description:"currently selected preset id (controlled)"},onChange:{schema:z.unknown().optional(),design:"event",description:"called when the user clicks a preset card"},filterTags:{schema:z.string().optional(),design:"content",description:'only show presets matching at least one tag ("space" | "retro" | "motion" | "hero" | "background" \u2026)'},live:{schema:z.enum(["never","hover","always"]).optional(),design:"knob",description:"thumbnail render mode",default:"hover"},postPreset:{schema:z.string().optional(),design:"content",description:"shared post-FX preset applied to every thumbnail"},palette:{schema:z.unknown().optional(),design:"plumbing",description:"shared palette applied to every thumbnail"},columns:{schema:z.unknown().optional(),design:"plumbing",description:"grid columns at md+ breakpoint"}}};var ds={name:"ShaderPresetPreview",description:"Thumbnail-sized preview card for a shader preset. Defaults to a cheap static placeholder until hovered, at which point the live WebGL render kicks in. Use directly when you want a single preset card; use ShaderPresetPicker for a filterable grid.",import:"@gradeui/ui",aliases:["shader preview","preset preview","shader card"],composesWith:["ThreeScene (internal)","ShaderPresetPicker (wraps this)"],styleDefaults:{ShaderPresetPreview:"group cursor-pointer flex flex-col gap-2"},props:{preset:{schema:z.string(),design:"content",description:"shader preset id from the registry"},live:{schema:z.enum(["never","hover","always"]).optional(),design:"knob",description:"when to run the live WebGL render",default:"hover"},postPreset:{schema:z.string().optional(),design:"content",description:"override the preset's default post-FX"},palette:{schema:z.unknown().optional(),design:"plumbing",description:"palette overrides for the preview"},aspect:{schema:z.enum(["video","square","portrait","wide"]).optional(),design:"knob",default:"video"},hideLabel:{schema:z.boolean().optional(),design:"knob",description:"hide the label strip under the preview",default:false},onClick:{schema:z.unknown().optional(),design:"event"}}};var cs={name:"Sheet",description:"A panel that slides in from a screen edge \u2014 mobile nav drawers, side panels for editing a single record without leaving the list, filter trays on small viewports, Studio-style inspector panels. For a centered focus modal use Dialog. For a transient announcement use Toast (Sonner). For inline reveals use Collapsible.",import:"@gradeui/ui",aliases:["sheet","drawer","side panel","slide-in","nav drawer","mobile drawer","slide-over","action sheet","modal sheet","bottom sheet","side sheet","react native modal sheet","bottom-sheet","ios action sheet","inspector panel","glass sheet","frosted drawer"],subcomponents:["SheetTrigger","SheetContent","SheetHeader","SheetTitle","SheetDescription","SheetFooter","SheetClose"],composesWith:["Form controls (an inline edit sheet)","Button (trigger + close)","AppShellNav (mobile-only swap)","Code (changelog drawers)","MediaSurface (image-detail sheets)"],styleDefaults:{SheetOverlay:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",SheetContent:"fixed z-50 gap-4 p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",SheetHeader:"flex flex-col space-y-2 text-center sm:text-left",SheetFooter:"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",SheetTitle:"text-lg font-semibold text-foreground",SheetDescription:"text-sm text-muted-foreground"},props:{open:{schema:z.unknown().optional(),design:"plumbing"},asChild:{schema:z.boolean().optional(),design:"plumbing"},side:{schema:z.enum(["top","right","bottom","left"]).optional(),design:"knob",default:"right"},surface:{schema:z.enum(["solid","translucent","glass","glass-strong"]).optional(),design:"knob",description:"what the sheet panel is *made of*. `solid` is the default opaque `bg-background`. Reach for `glass` whenever the canvas behind the sheet (a layout in progress, a media gallery, a dashboard) should remain visible."},className:{schema:z.string().optional(),design:"plumbing",description:"usually set a width (right/left) or height (top/bottom)"},SheetTitle:{schema:z.unknown(),design:"plumbing"}}};var ps={name:"Sidebar",description:'Vertical app navigation. Drop inside `<AppShellNav placement="side">` for full-page layouts. Compound API \u2014 `<SidebarHeader>` for brand, `<SidebarContent>` for the scrollable body of `<SidebarSection>` + `<SidebarItem>` rows, `<SidebarFooter>` for user / settings chrome. For top nav reach for TopMenu; for command-palette style search reach for Command.',import:"@gradeui/ui",aliases:["sidebar","side menu","sidemenu","navigation sidebar","app sidebar","side nav","side nav rail","master pane","sidebarmenu","navigation rail","react native drawer"],subcomponents:["SidebarHeader","SidebarContent","SidebarFooter","SidebarSection","SidebarItem"],composesWith:["AppShell (inside AppShellNav)","Avatar (in Footer)","Tooltip (auto-wrapped on collapsed items)","Button (asChild for custom routing)"],styleDefaults:{Sidebar:"relative flex h-full flex-col bg-card text-card-foreground",SidebarHeader:"flex shrink-0 items-center border-b border-border",SidebarContent:"flex-1 overflow-y-auto overflow-x-hidden",SidebarFooter:"shrink-0 border-t border-border",SidebarSection:"px-[var(--gds-sidebar-section-px,0.5rem)] space-y-[var(--gds-sidebar-section-gap,0.125rem)]",SidebarItem:"group flex items-center gap-2.5 rounded-md transition-colors",SidebarTreeItem:"group flex w-full items-center gap-1.5 rounded-md py-1 text-sm font-medium transition-colors"},props:{collapsed:{schema:z.boolean().optional(),design:"knob",description:"controlled collapsed state (wire onCollapsedChange when set)"},defaultCollapsed:{schema:z.boolean().optional(),design:"knob",description:"uncontrolled initial value (default false)"},onCollapsedChange:{schema:z.unknown().optional(),design:"event"},collapsible:{schema:z.boolean().optional(),design:"knob",description:"show the affordance for the user to collapse (default true)"},variant:{schema:z.enum(["rail","panel"]).optional(),design:"knob",description:'outer chrome treatment. `rail` (default) is the classic nav rail with a single right-border + tracked width via `--gds-sidebar-width`; drops cleanly into `<AppShellNav placement="side">`. `panel` is a card-style floating sidebar with full border + rounded corners + parent-controlled width; use when the sidebar is one of several adjacent panes in a body row (e.g. Projects | Canvas | Settings). The compound children (Header/Content/Footer/Section/Item) are identical in both treatments.'},any:{schema:z.unknown(),design:"plumbing",description:"brand / logo / org switcher; hides nothing when collapsed (centred)"},title:{schema:z.unknown().optional(),design:"plumbing",description:'group label; **uppercase tracking-wide muted** styling auto-applied (Notion / Linear / Slack-style "GAMES", "FAVORITES", "WORKSPACE" headers); hidden when sidebar is collapsed'},icon:{schema:z.unknown().optional(),design:"plumbing",description:"optional icon beside the title"},trailing:{schema:z.unknown().optional(),design:"plumbing",description:`**action(s) on the right edge of the header** \u2014 the canonical "+" / "..." slot (Notion's "+ Add page" next to Pages, Linear's "+" next to Favorites, Slack's "+" next to Channels). Pointer events isolated so a Button here doesn't toggle collapse.`},defaultExpanded:{schema:z.boolean().optional(),design:"knob",description:"initial open state (default true)"},badge:{schema:z.unknown().optional(),design:"plumbing",description:"trailing count / label (hidden when collapsed)"},active:{schema:z.boolean().optional(),design:"knob",description:'current route; adds aria-current="page"'},href:{schema:z.string().optional(),design:"content",description:"renders as <a>; for routing use `asChild` with your link component"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"wrap a custom link (<Link href> from Next.js etc.) via Radix Slot"},asButton:{schema:z.boolean().optional(),design:"knob",description:"render as <button> for action rows (open dialog, log out)"},disabled:{schema:z.boolean().optional(),design:"knob"},collapsedLabel:{schema:z.unknown().optional(),design:"plumbing",description:"tooltip override when sidebar is collapsed (defaults to children text)"},size:{schema:z.enum(["sm","md"]).optional(),design:"knob",description:"row size. `md` (default) is the standard `text-sm font-medium` nav row; `sm` is `text-xs` + lighter weight + tighter padding for visually subordinate rows (nested screens under a project, sub-pages under a section). Active state still wins on color + weight so the current row pops at either size."},description:{schema:z.unknown().optional(),design:"plumbing",description:"secondary line beneath the label (metadata like 'Edited 2m ago', '12 items', a brief description). Row layout adapts: label + description stacked vertically; icon vertically-centered against the stack; badge stays on trailing edge. Hidden when sidebar collapsed."}}};var ms={name:"Skeleton",description:'Loading placeholder for content whose shape you know. Set width/height via className to mimic the real content (e.g. "h-4 w-32"). Not a spinner \u2014 use it where the real thing will drop in.',import:"@gradeui/ui",aliases:["placeholder","shimmer","loader","loading state","redacted","redacted placeholder","shimmer placeholder","content placeholder","lottie placeholder"],composesWith:["Card","Avatar (inside a Skeleton for avatar loading)","any layout"],styleDefaults:{Skeleton:"animate-pulse rounded-md bg-muted"},props:{className:{schema:z.string().optional(),design:"plumbing",description:"required in practice; supply width/height utilities"}}};var us={name:"Slider",description:'A continuous-ish numeric pick \u2014 volume, opacity, font size, price-range filters. Use a single-thumb slider for one value, two-thumb for a range. For a small set of discrete options (1-5 stars, sm/md/lg) prefer ToggleGroup. For free-text numeric entry use an Input type="number".',import:"@gradeui/ui",aliases:["slider","range slider","range input","volume","opacity slider","scrub","drag value","slider control","value slider","react native slider"],composesWith:["Label (mandatory above)","Row (label + current value display)","Card (settings rows)"],styleDefaults:{Slider:"relative flex w-full touch-none select-none items-center"},props:{value:{schema:z.number().optional(),design:"knob",description:"controlled value; ALWAYS an array even for a single-thumb slider (`[50]`)"},defaultValue:{schema:z.number().optional(),design:"knob",description:"uncontrolled initial; `[20, 80]` for a two-thumb range"},onValueChange:{schema:z.unknown().optional(),design:"event"},min:{schema:z.number().optional(),design:"knob"},max:{schema:z.number().optional(),design:"knob"},step:{schema:z.number().optional(),design:"knob"},disabled:{schema:z.boolean().optional(),design:"knob"},orientation:{schema:z.enum(["horizontal","vertical"]).optional(),design:"knob",default:"horizontal"},dir:{schema:z.enum(["ltr","rtl"]).optional(),design:"plumbing"},inverted:{schema:z.boolean().optional(),design:"knob",description:"flip the visual direction"},name:{schema:z.string().optional(),design:"content",description:"form name when posting natively"}}};var gs={name:"Sortable",description:"Drag-to-reorder lists, kanban-column reordering, sortable shelves, tab strips the user can rearrange. Pairs with any layout primitive \u2014 Stack for vertical lists, Row for horizontal strips, Grid for 2D card walls. For cross-container drag (drag a card from one column to another) hand-roll DndContext at the page level \u2014 Sortable v1 covers single-list reorder; Sortable.Group for cross-container is a planned follow-up. Reach for raw `@dnd-kit/core` if you need custom collision detection, drag overlays with arbitrary chrome, or non-list use cases (kanban swimlanes, draggable canvas nodes).",import:"@gradeui/ui",aliases:["sortable","reorder","drag and drop","dnd","draggable list","sortable list","kanban","drag to reorder","drag-drop","dragdroplist","drag handle","react native draggable flatlist"],subcomponents:["Sortable.Item","Sortable.Handle"],composesWith:["Stack (vertical lists)","Row (horizontal strips)","Grid (2D card walls)","Card (typical item content)","Button (as Sortable.Handle asChild)"],styleDefaults:{SortableHandle:"cursor-grab touch-none select-none"},props:{values:{schema:z.unknown(),design:"plumbing",description:"ordered list of unique ids; the source of truth for the order"},onReorder:{schema:z.unknown().optional(),design:"event",description:"fires with the new order after a drag that changed it"},strategy:{schema:z.enum(["vertical","horizontal","grid"]).optional(),design:"knob",description:"match the layout your items render in",default:"vertical"},disabled:{schema:z.boolean().optional(),design:"knob",description:"disable drag on every item"},Sortable:{schema:z.unknown(),design:"plumbing",description:"must match one entry in the parent `values` array (identity, not React key)"}}};var fs={name:"Stack",description:"Default top-level layout inside the main slot when composing two or more stacked regions (hero + content + footer, auth card + subtext, etc.). Prefer Stack over hand-rolled `flex flex-col gap-*` so the vertical rhythm is editable through the settings panel.",import:"@gradeui/ui",aliases:["stack","vstack","vertical","column","vertical layout","v-stack","vertical stack","lazyvstack"],composesWith:["Section","Row","Split","Hero","any content component"],props:{gap:{schema:z.enum(["none","xs","sm","md","lg","xl","2xl"]).optional(),design:"knob",description:"vertical gap between children",default:"md"},align:{schema:z.enum(["start","center","end","stretch"]).optional(),design:"knob",description:"cross-axis (horizontal) alignment of children",default:"stretch"},justify:{schema:z.enum(["start","center","end","between","around","evenly"]).optional(),design:"knob",description:'main-axis (vertical) distribution. Reach for this on absolute-positioned overlays (`justify="end"` pins children to the bottom) and split footers (`justify="between"`).',default:"start"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"render as the child element via Slot, so `<Stack asChild><section>\u2026</section></Stack>` stamps Stack's classes onto the `<section>` rather than nesting a wrapper div",default:false},className:{schema:z.string().optional(),design:"plumbing"},children:{schema:z.unknown(),design:"plumbing"}}};var hs={name:"Switch",description:'Instant on/off setting ("Enable notifications", "Dark mode"). Commits on toggle \u2014 no submit button needed. For selecting-from-a-list use Checkbox. For a settings row (label + description on the left, Switch on the right) use Field layout="setting". For a prominent on/off presented as a whole selectable card, use SwitchCard.',import:"@gradeui/ui",aliases:["toggle","switch","on/off switch","ios toggle","toggle switch","switch control","react native switch"],composesWith:["Label (via htmlFor)",'Field (layout="setting" settings row)',"SwitchCard (whole-card toggle)","Card (settings rows)"],styleDefaults:{Switch:"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input h-6 w-11"},variantDefaults:{size:"default"},props:{checked:{schema:z.boolean().optional(),design:"knob"},onCheckedChange:{schema:z.unknown().optional(),design:"event"},defaultChecked:{schema:z.boolean().optional(),design:"knob"},disabled:{schema:z.boolean().optional(),design:"knob"},id:{schema:z.string().optional(),design:"plumbing"}}};var bs={name:"SwitchCard",description:'A prominent on/off setting presented as a whole selectable card. The whole card is the switch, so the toggled state lives on the card surface. Standalone. For a row of compact settings (label left, small Switch right) use Field layout="setting" instead \u2014 SwitchCard is for the heavier, card-sized toggle.',import:"@gradeui/ui",aliases:["switch card","toggle card","setting card","feature toggle card"],composesWith:["Badge (in aside)","Stack (stacking several)"],props:{checked:{schema:z.unknown().optional(),design:"plumbing",description:"standard switch state"},label:{schema:z.unknown().optional(),design:"plumbing",description:"title line"},description:{schema:z.unknown().optional(),design:"plumbing",description:"secondary line"},aside:{schema:z.unknown().optional(),design:"plumbing",description:"slot before the indicator (a Badge, price, hint)"},hideIndicator:{schema:z.boolean().optional(),design:"knob",description:"hide the switch glyph; state shown by the card border + background"},indicatorPosition:{schema:z.enum(["leading","trailing"]).optional(),design:"knob",description:"default trailing"},children:{schema:z.unknown().optional(),design:"plumbing",description:"arbitrary static content instead of label/description"}}};var ys={name:"Table",description:"Structured tabular data \u2014 rows \xD7 columns with alignment requirements. NOT a layout grid \u2014 for that use div+Tailwind grid utilities. Keep to <100 rows; larger datasets need virtualisation (not in DS).",import:"@gradeui/ui",aliases:["table","table view","data table","datatable","grid view","data grid","rows and columns"],subcomponents:["TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption"],composesWith:["Card (wrap the table)","Badge (inside TableCell for status)","Checkbox (row selection)","Button (row actions)"],styleDefaults:{Table:"w-full caption-bottom text-sm",TableHeader:"[&_tr]:border-b",TableBody:"[&_tr:last-child]:border-0",TableFooter:"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",TableRow:"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",TableHead:"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",TableCell:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",TableCaption:"mt-4 text-sm text-muted-foreground"},props:{Each:{schema:z.unknown(),design:"plumbing"},No:{schema:z.unknown(),design:"plumbing",description:"styling follows the active theme tokens"}}};var xs={name:"Tabs",description:'A small set of peer views within one surface (2\u20135 tabs). For primary nav use Side Menu/routing. For filters use a filter control, not tabs. Pick `variant="pill"` for app chrome (settings panels, in-card tab strips). Pick `variant="underlined"` for marketing/docs pages and browser-tab-style treatments.',import:"@gradeui/ui",aliases:["tabs","tab strip","tab bar","tab view","tabbed interface","pageviewcontroller","react native tab view","underlined tabs","page tabs","segment switcher","simple tabs"],subcomponents:["TabsList","TabsTrigger","TabsContent"],composesWith:["Card (tabs inside a card body)","Dialog","TooltipProvider (required for tooltip prop)"],styleDefaults:{TabsList:"inline-flex items-center text-muted-foreground justify-center rounded-lg bg-muted",TabsContent:"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"},props:{defaultValue:{schema:z.unknown().optional(),design:"plumbing"},size:{schema:z.enum(["sm","md","lg, default md"]).optional(),design:"knob",description:"t-shirt scale aligned with Button/ToggleGroup heights; cascades to every TabsTrigger via context so set it once on the list"},variant:{schema:z.enum(["pill","underlined, default pill"]).optional(),design:"knob",description:"`pill` is the shadcn chip-on-muted look; `underlined` is the minimal text + bottom-border treatment (formerly the separate SimpleTabs component, collapsed into Tabs in May 2026). Cascades to triggers."},value:{schema:z.string(),design:"content",description:"matches a TabsContent value; tooltip?: string \u2014 when set, wraps the trigger in the design-system Tooltip and auto-applies aria-label (useful for icon-only triggers); requires a TooltipProvider somewhere above the tabs"}}};var ws={name:"Textarea",description:'Multi-line text entry (descriptions, messages, comments). Pair with a Label. Single-line input \u2192 use Input instead. Use size="sm"/"xs" in dense tool panels.',import:"@gradeui/ui",aliases:["text area","multiline","comment box","message field","text editor","multi-line text","multiline input","multiline text field","comments box","multiline textinput"],composesWith:["Label","Form","Card (in CardContent)"],styleDefaults:{Textarea:"flex w-full rounded-md border border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 min-h-[80px] px-3 py-2 text-sm"},variantDefaults:{size:"default"},props:{size:{schema:z.enum(["default","sm","xs"]).optional(),design:"knob",description:"control density, mirrors Input. default = min-h-80 / text-sm; sm and xs shrink the min-height + padding for dense panels."}}};var Rs={name:"ThreeScene",description:"WebGL primitive for shader backgrounds, generative visuals, and bespoke three.js scenes. Three authoring paths, in order of preference \u2014 (1) pick a `preset` id; (2) if nothing in the registry fits, write a `fragmentShader` against the fixed uniform contract; (3) only as a last resort, pass a full `createScene` factory. For looping video, use VideoPlayer; for interactive animations, use RivePlayer.",import:"@gradeui/ui",aliases:["three","threejs","webgl","shader","scene","3d","generative","hero background","fragment shader","glsl"],composesWith:["MediaSurface (internal)","foreground content stacked above with `position: absolute/relative z-10`"],styleDefaults:{ThreeScene:"absolute inset-0 flex items-end justify-end p-2"},props:{preset:{schema:z.enum(["mesh","waves","space","plasma","voronoi","synthwave"]).optional(),design:"knob",description:"shader preset id from the registry"},fragmentShader:{schema:z.string().optional(),design:"content",description:"user-authored GLSL body; takes precedence over preset"},onShaderError:{schema:z.unknown().optional(),design:"event",description:'fires on compile failure; scene falls back to `preset="space"`'},postPreset:{schema:z.enum(["none","vhs","cinematic","synthwave","crt"]).optional(),design:"knob",description:"post-processing pass",default:"vhs"},palette:{schema:z.unknown().optional(),design:"plumbing",description:"any CSS-legal colour string per slot. Re-tints automatically when the theme changes. Unset slots fall back to defaults."},createScene:{schema:z.unknown().optional(),design:"plumbing",description:"custom full scene factory; takes precedence over preset AND fragmentShader"},controls:{schema:z.boolean().optional(),design:"knob",description:"play/pause overlay",default:false},autoPlay:{schema:z.boolean().optional(),design:"knob",description:"respects reduced-motion",default:true},pauseOffscreen:{schema:z.boolean().optional(),design:"knob",description:"big win for WebGL battery life",default:true},aspect:{schema:z.enum(["video","square","portrait","wide","auto"]).optional(),design:"knob",default:"video"},maxDpr:{schema:z.number().optional(),design:"knob",description:"lower for thumbnails / low-end devices"},radius:{schema:z.enum(["none","sm","md","lg","xl"]).optional(),design:"knob",default:"lg"}}};var Ss={name:"Toast",description:'Transient, non-blocking feedback that confirms or warns about an action \u2014 "Saved", "Failed to upload", "Copied to clipboard", "Invitation sent". For permanent inline messages reach for Callout. For confirmations that block until acknowledged use Dialog. Mount <Toaster /> ONCE at the root of the app; everywhere else, call the `toast` helper.',import:"@gradeui/ui",aliases:["toast","toaster","sonner","notification","snackbar","alert toast","transient alert","transient banner","banner notification","toastandroid"],composesWith:["App root layout (single <Toaster /> mount)","Form submit handlers (success/error toasts)","Async actions"],props:{position:{schema:z.enum(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]).optional(),design:"knob",default:"bottom-right"},theme:{schema:z.enum(["light","dark","system"]).optional(),design:"knob"},richColors:{schema:z.boolean().optional(),design:"knob",description:"colored variants for success/error/warning/info"},expand:{schema:z.boolean().optional(),design:"knob",description:"keep multiple toasts visually separated rather than stacked"},visibleToasts:{schema:z.number().optional(),design:"knob",description:"max concurrent toasts on screen (default 3)"},duration:{schema:z.number().optional(),design:"knob",description:"default ms before auto-dismiss"}}};var ks={name:"Toggle",description:`A standalone on/off button \u2014 Bold/Italic in a toolbar, "Show grid" in a header, single binary toggle that doesn't belong inside a Switch row. For two-or-more mutually-exclusive options use ToggleGroup. For a labeled settings switch ("Active: on/off") use Switch.`,import:"@gradeui/ui",aliases:["toggle","toggle button","press button","bold button","italic button"],composesWith:["Tooltip (wrap an icon-only Toggle)","Row","TabsList (sibling)"],styleDefaults:{Toggle:"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-transparent h-9 px-2 min-w-9"},variantDefaults:{variant:"default",size:"default"},props:{variant:{schema:z.enum(["default","outline"]).optional(),design:"knob",description:"outline adds a border, default is borderless and ghost-like"},size:{schema:z.enum(["default","sm","lg"]).optional(),design:"knob"},pressed:{schema:z.boolean().optional(),design:"knob",description:"controlled pressed state"},defaultPressed:{schema:z.boolean().optional(),design:"knob",description:"uncontrolled initial state"},onPressedChange:{schema:z.unknown().optional(),design:"event"},disabled:{schema:z.boolean().optional(),design:"knob"},children:{schema:z.unknown(),design:"plumbing",description:"usually an icon or short label"}}};var Cs={name:"ToggleGroup",description:'A small set of mutually-exclusive (`type="single"`) or independent (`type="multiple"`) binary options that live side-by-side as a segmented control \u2014 viewport size picker (Mobile/Tablet/Desktop), text alignment, view density. Reads identically to a TabsList of the same size; reach for ToggleGroup when each option emits a value (like a form input) rather than swapping panels. Use Tabs for panel switching, Toggle for a single on/off.',import:"@gradeui/ui",aliases:["toggle group","segmented control","segmented buttons","button group","pill group","view selector","segmented picker","segmentedcontrolios","segmented buttons group","rn segmented control"],subcomponents:["ToggleGroupItem"],composesWith:["Card (header controls)","Row","AppShellHeader chrome","settings panels"],styleDefaults:{ToggleGroup:"inline-flex items-center justify-center rounded-lg bg-muted text-muted-foreground h-8 p-0.5",ToggleGroupItem:"inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[state=on]:bg-background data-[state=on]:text-foreground h-7 px-2 text-xs gap-1.5 [&_svg]:size-3.5"},variantDefaults:{size:"md"},props:{type:{schema:z.enum(["single","multiple"]),design:"knob",description:"single picks one, multiple picks any number"},value:{schema:z.union([z.string(),z.array(z.string())]).optional(),design:"knob",description:"controlled; matches `type` (string for single, string[] for multiple)"},defaultValue:{schema:z.union([z.string(),z.array(z.string())]).optional(),design:"knob",description:"uncontrolled initial"},onValueChange:{schema:z.unknown().optional(),design:"event"},size:{schema:z.enum(["sm","md","lg, default md"]).optional(),design:"knob",description:"cascades to every ToggleGroupItem via context, matches Tabs/Button heights"},variant:{schema:z.enum(["default","outline"]).optional(),design:"knob"},tooltip:{schema:z.unknown().optional(),design:"plumbing",description:"when set, wraps the item in a Tooltip; required for icon-only items where the visible chrome doesn't carry a label"},tooltipSide:{schema:z.enum(["top","right","bottom",'left", default "top']).optional(),design:"knob",description:"side the tooltip renders on"},tooltipDelay:{schema:z.number().optional(),design:"knob",description:"per-item delay override; falls back to the upstream TooltipProvider's delayDuration"}}};var Ts={name:"Toolbar",description:`ANY three-region chrome bar \u2014 the leading/center/trailing pattern Apple HIG
80
80
  describes as a "Toolbar." App window chrome (Reddit, Twitter, GitHub, Linear,
81
81
  most desktop apps), section toolbars inside Cards or panels, bottom action
82
82
  bars on mobile layouts, persistent footer toolbars.
@@ -104,18 +104,18 @@ Use directly inside a Card or page section for section-scoped toolbars:
104
104
  <Card>
105
105
  <Toolbar size="sm" variant="subtle" leading={...} trailing={...} />
106
106
  {content}
107
- </Card>`,import:"@gradeui/ui",subcomponents:["ToolbarSlot"],composesWith:["Button","Avatar","Input","Logo","Badge","AppShellHeader","Card","Row","Stack"],props:{leading:{schema:z.unknown().optional(),design:"plumbing",description:"left-aligned region (logo + primary nav)"},center:{schema:z.unknown().optional(),design:"plumbing",description:"center region (search, page title, segmented control)"},trailing:{schema:z.unknown().optional(),design:"plumbing",description:"right-aligned region (action icons, avatar, primary CTA)"},children:{schema:z.unknown().optional(),design:"plumbing",description:"escape hatch; bypasses slot layout"},position:{schema:z.enum(["top","bottom","inline"]).optional(),design:"knob",description:"border placement",default:"top"},variant:{schema:z.enum(["default","subtle","transparent"]).optional(),design:"knob",default:"default"},size:{schema:z.enum(["sm","md","lg"]).optional(),design:"knob",description:"height + padding",default:"md"},sticky:{schema:z.boolean().optional(),design:"knob",description:"pin to top/bottom of scroll container",default:false},"aria-label":{schema:z.string().optional(),design:"content",description:"required by WAI-ARIA toolbar pattern",default:"Toolbar"},className:{schema:z.string().optional(),design:"plumbing"}}};var wi={name:"Tooltip",description:"A short, non-essential label that explains a control on hover/focus \u2014 icon-only buttons in toolbars, abbreviated column headers, status dots. NEVER hide critical info inside a tooltip \u2014 they're invisible on touch and can be skipped by screen readers if implemented carelessly. For richer hover content use HoverCard. For inline help text that's always visible, use a description paragraph.",import:"@gradeui/ui",aliases:["tooltip","tip","hover tip","hint","label on hover","help tag","hint","helper text bubble","info tip"],subcomponents:["TooltipTrigger","TooltipContent","TooltipProvider"],composesWith:["Button (icon-only)","Toggle","TabsTrigger (the canonical tabs already have a `tooltip` prop that wraps this)","Avatar (status badge meaning)"],props:{delayDuration:{schema:z.number().optional(),design:"knob",description:"ms hover before show; mount ONCE near the app root"},skipDelayDuration:{schema:z.number().optional(),design:"knob",description:'ms gap that still feels like "same hover"'},open:{schema:z.unknown().optional(),design:"plumbing"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"usually wraps a Button or icon"},side:{schema:z.enum(["top","right","bottom","left","start","center","end"]).optional(),design:"knob",default:"top"}}};var Ri={name:"VideoPlayer",description:"HTML5 video wrapped in the shared media surface. Controls-on for a standard player, controls-off (+ autoplay/muted/loop) for hero / background video. Prefer Rive for anything interactive, Three Scene for shader backgrounds.",import:"@gradeui/ui",aliases:["video","mp4","movie","webm","clip","video view","av player","react native video","video element"],composesWith:["MediaSurface (internal)","Card (wrap for thumbnail grids)"],props:{src:{schema:z.string(),design:"content",description:"video URL"},controls:{schema:z.boolean().optional(),design:"knob",description:"show native controls; false for chromeless hero/background video",default:true},autoPlay:{schema:z.boolean().optional(),design:"knob",description:"forces muted=true (browser restriction)",default:false},loop:{schema:z.boolean().optional(),design:"knob",default:false},muted:{schema:z.boolean().optional(),design:"knob",default:false},pauseOffscreen:{schema:z.boolean().optional(),design:"knob",description:"pause when scrolled out of viewport",default:true},aspect:{schema:z.enum(["video","square","portrait","wide","auto"]).optional(),design:"knob",default:"video"},radius:{schema:z.enum(["none","sm","md","lg","xl"]).optional(),design:"knob",description:"driven by `--gds-media-radius`",default:"lg"},objectFit:{schema:z.enum(["cover","contain","fill"]).optional(),design:"knob",default:"cover"},poster:{schema:z.string().optional(),design:"content",description:'image shown before playback. Always rendered as a `loading="lazy"` `<img>` overlay (not the native `poster` attribute, which fetches eagerly).'},playbackRate:{schema:z.number().optional(),design:"knob"}}};var fa={Accordion:fn,AiChat:hn,AiChatComposer:bn,AppShell:vn,Avatar:yn,Badge:wn,Banner:Rn,Breadcrumb:Sn,Button:Cn,Calendar:kn,Callout:Tn,Card:Mn,Carousel:Nn,Chart:En,Checkbox:Ln,Code:Dn,Collapsible:An,Command:Hn,Composer:In,DatePicker:Fn,Dialog:Bn,DropdownMenu:zn,Flex:On,Grid:Vn,HoverCard:_n,Input:Gn,Label:Wn,Map:Un,MediaSurface:ma,Message:jn,MultiSelect:$n,Popover:Kn,Progress:qn,RadioGroup:Yn,Resizable:Zn,RivePlayer:Xn,Row:Jn,ScrollArea:Qn,SectionBlock:ei,Select:ti,Separator:oi,ShaderPresetPicker:ri,ShaderPresetPreview:ai,Sheet:ni,Sidebar:ii,Skeleton:si,Slider:li,Sortable:di,Stack:ci,Switch:pi,Table:ui,Tabs:gi,Textarea:fi,ThreeScene:hi,Toast:bi,Toggle:vi,ToggleGroup:yi,Toolbar:xi,Tooltip:wi,VideoPlayer:Ri};function sc(e){return e?fa[e]??null:null}function lc(){return Object.keys(fa)}function s(...e){return twMerge(clsx(e))}var mc=nt.Root,Si=S.forwardRef(({className:e,...t},o)=>S.createElement(nt.Item,{ref:o,className:s("border-b",e),...t}));Si.displayName="AccordionItem";var Ci=S.forwardRef(({className:e,children:t,...o},r)=>S.createElement(nt.Header,{className:"flex"},S.createElement(nt.Trigger,{ref:r,className:s("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...o},t,S.createElement(ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"}))));Ci.displayName=nt.Trigger.displayName;var ki=S.forwardRef(({className:e,children:t,...o},r)=>S.createElement(nt.Content,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...o},S.createElement("div",{className:s("pb-4 pt-0",e)},t)));ki.displayName=nt.Content.displayName;var Ti=cva("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4",{variants:{variant:{default:"bg-background text-foreground [&>svg]:text-foreground",destructive:"border-destructive/30 bg-destructive-soft text-destructive-deep [&>svg]:text-destructive-deep",success:"border-success/30 bg-success-soft text-success-deep [&>svg]:text-success-deep",warning:"border-warning/30 bg-warning-soft text-warning-deep [&>svg]:text-warning-deep",info:"border-info/30 bg-info-soft text-info-deep [&>svg]:text-info-deep"}},defaultVariants:{variant:"default"}}),gc={destructive:"alert",warning:"alert",info:"status",success:"status",default:"status"},Pi=S.forwardRef(({className:e,variant:t,role:o,...r},n)=>S.createElement("div",{ref:n,role:o??gc[t??"default"],"data-gds-part":"callout",className:s(Ti({variant:t}),e),...r}));Pi.displayName="Callout";var Mi=S.forwardRef(({className:e,...t},o)=>S.createElement("h5",{ref:o,"data-gds-part":"callout-title",className:s("mb-1 font-medium leading-none tracking-tight",e),...t}));Mi.displayName="CalloutTitle";var Ni=S.forwardRef(({className:e,...t},o)=>S.createElement("div",{ref:o,"data-gds-part":"callout-description",className:s("text-sm [&_p]:leading-relaxed",e),...t}));Ni.displayName="CalloutDescription";var Ei=cva("gds-app-shell min-h-screen w-full bg-background text-foreground grid",{variants:{nav:{none:"",top:"",side:"","three-pane":""}},defaultVariants:{nav:"none"}}),Li=cva("gds-app-shell-header",{variants:{sticky:{true:"sticky top-0 z-30",false:""}},defaultVariants:{sticky:false}}),Di=cva("gds-app-shell-nav",{variants:{placement:{top:"border-b bg-background",side:"border-r bg-background",none:"hidden"},sticky:{true:"",false:""}},compoundVariants:[{placement:"top",sticky:true,className:"sticky top-0 z-30"},{placement:"side",sticky:true,className:"sticky top-0 h-screen self-start"}],defaultVariants:{placement:"top",sticky:true}}),Ai=cva("gds-app-shell-aside min-w-0 border-r bg-background",{variants:{sticky:{true:"sticky top-0 h-screen self-start",false:""}},defaultVariants:{sticky:false}}),Hi=cva("gds-app-shell-main min-w-0",{variants:{maxWidth:{full:"w-full",container:"w-full mx-auto max-w-7xl px-4 md:px-6 lg:px-8"}},defaultVariants:{maxWidth:"full"}}),Ii=cva("gds-app-shell-footer border-t bg-background"),Fi=S.forwardRef(({className:e,nav:t,asChild:o=false,...r},n)=>S.createElement(o?Slot:"div",{ref:n,"data-gds-part":"app-shell","data-nav":t??"none",className:s(Ei({nav:t,className:e})),...r}));Fi.displayName="AppShell";var Bi=S.forwardRef(({className:e,sticky:t,asChild:o=false,...r},n)=>S.createElement(o?Slot:"header",{ref:n,"data-gds-part":"app-shell-header",className:s(Li({sticky:t,className:e})),...r}));Bi.displayName="AppShellHeader";var zi=S.forwardRef(({className:e,placement:t,sticky:o,asChild:r=false,...n},a)=>S.createElement(r?Slot:"nav",{ref:a,"data-gds-part":"app-shell-nav","data-placement":t??"top",className:s(Di({placement:t,sticky:o,className:e})),...n}));zi.displayName="AppShellNav";var Oi=S.forwardRef(({className:e,sticky:t,asChild:o=false,...r},n)=>S.createElement(o?Slot:"aside",{ref:n,"data-gds-part":"app-shell-aside",className:s(Ai({sticky:t,className:e})),...r}));Oi.displayName="AppShellAside";var Vi=S.forwardRef(({className:e,maxWidth:t,asChild:o=false,...r},n)=>S.createElement(o?Slot:"main",{ref:n,"data-gds-part":"app-shell-main",className:s(Hi({maxWidth:t,className:e})),...r}));Vi.displayName="AppShellMain";var _i=S.forwardRef(({className:e,asChild:t=false,...o},r)=>S.createElement(t?Slot:"footer",{ref:r,"data-gds-part":"app-shell-footer",className:s(Ii({className:e})),...o}));_i.displayName="AppShellFooter";var fc=cva("relative flex shrink-0 overflow-hidden rounded-full",{variants:{size:{xs:"h-6 w-6",sm:"h-7 w-7",md:"h-10 w-10",lg:"h-14 w-14",xl:"h-20 w-20"}},defaultVariants:{size:"md"}}),Wi=S.forwardRef(({className:e,size:t,...o},r)=>S.createElement(Et.Root,{ref:r,"data-gds-part":"avatar","data-gds-size":t??"md",className:s(fc({size:t}),e),...o}));Wi.displayName=Et.Root.displayName;var Ui=S.forwardRef(({className:e,...t},o)=>S.createElement(Et.Image,{ref:o,"data-gds-part":"avatar-image",className:s("aspect-square h-full w-full",e),...t}));Ui.displayName=Et.Image.displayName;var hc=cva("flex h-full w-full items-center justify-center rounded-full font-semibold",{variants:{tone:{muted:"bg-muted text-foreground",primary:"bg-primary/15 text-primary",violet:"bg-violet-500/20 text-violet-600 dark:text-violet-400",amber:"bg-amber-500/20 text-amber-600 dark:text-amber-400",emerald:"bg-emerald-500/20 text-emerald-600 dark:text-emerald-400",sky:"bg-sky-500/20 text-sky-600 dark:text-sky-400",rose:"bg-rose-500/20 text-rose-600 dark:text-rose-400",plum:"bg-fuchsia-500/20 text-fuchsia-600 dark:text-fuchsia-400",lime:"bg-lime-500/20 text-lime-600 dark:text-lime-400"}},defaultVariants:{tone:"muted"}}),ji=S.forwardRef(({className:e,tone:t,...o},r)=>S.createElement(Et.Fallback,{ref:r,"data-gds-part":"avatar-fallback","data-gds-tone":t??"muted",className:s(hc({tone:t}),e),...o}));ji.displayName=Et.Fallback.displayName;var Ki=cva("inline-flex items-center gap-1 border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 [&_svg]:size-3 [&_svg]:shrink-0",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",highlight:"border-transparent bg-gds-yellow-400 text-gds-gray-900 shadow hover:bg-gds-yellow-500",success:"border-transparent bg-gds-green-500 text-gds-gray-900 shadow hover:bg-gds-green-600",warning:"border-transparent bg-orange-500 text-white shadow hover:bg-orange-600",info:"border-transparent bg-blue-500 text-white shadow hover:bg-blue-600","success-soft":"border-gds-green-500/20 bg-gds-green-500/10 text-gds-green-600 dark:text-gds-green-400","warning-soft":"border-orange-500/20 bg-orange-500/10 text-orange-600 dark:text-orange-400","destructive-soft":"border-destructive/20 bg-destructive/10 text-destructive dark:text-red-400","info-soft":"border-blue-500/20 bg-blue-500/10 text-blue-600 dark:text-blue-400","highlight-soft":"border-gds-yellow-500/20 bg-gds-yellow-400/10 text-gds-yellow-600 dark:text-gds-yellow-400","success-outline":"border-gds-green-500/50 bg-transparent text-gds-green-600 dark:text-gds-green-400","warning-outline":"border-orange-500/50 bg-transparent text-orange-600 dark:text-orange-400","destructive-outline":"border-destructive/50 bg-transparent text-destructive dark:text-red-400","info-outline":"border-blue-500/50 bg-transparent text-blue-600 dark:text-blue-400"},rounded:{default:"rounded-md",full:"rounded-full"}},defaultVariants:{variant:"default",rounded:"default"}});function Tr({className:e,variant:t,rounded:o,...r}){return S.createElement("div",{className:s(Ki({variant:t,rounded:o}),e),...r})}var Xe={solid:"",translucent:"gds-surface-translucent",glass:"gds-surface-glass","glass-strong":"gds-surface-glass-strong"};function gt(e,t){return e==="solid"?t:""}var qi=cva("relative flex items-center gap-3 px-4 py-2.5 text-sm leading-relaxed border-b",{variants:{variant:{default:"bg-muted text-foreground border-border [&>svg]:text-muted-foreground",info:"bg-info-soft text-info-deep border-info/30 [&>svg]:text-info-deep",success:"bg-success-soft text-success-deep border-success/30 [&>svg]:text-success-deep",warning:"bg-warning-soft text-warning-deep border-warning/30 [&>svg]:text-warning-deep",destructive:"bg-destructive-soft text-destructive-deep border-destructive/30 [&>svg]:text-destructive-deep",announcement:"bg-[oklch(var(--primary)_/_0.06)] text-foreground border-[oklch(var(--primary)_/_0.18)] [&>svg]:text-primary"},align:{start:"justify-start",center:"justify-center",between:"justify-between"},sticky:{true:"sticky top-0 z-30",false:""}},defaultVariants:{variant:"default",align:"between",sticky:false}}),xc={destructive:"alert",warning:"alert",info:"status",success:"status",default:"status",announcement:"status"},Yi=S.forwardRef(({className:e,variant:t="default",align:o,sticky:r,surface:n="solid",dismissible:a,onDismiss:l,icon:p,action:i,role:c,children:d,...m},g)=>{let u=t??"default",b=c??xc[u];return S.createElement("div",{ref:g,role:b,"data-gds-part":"banner","data-variant":u,"data-surface":n,className:s(qi({variant:t,align:o,sticky:r}),Xe[n],e),...m},p?S.createElement("span",{"data-gds-part":"banner-icon","aria-hidden":true,className:"shrink-0"},p):null,S.createElement("div",{"data-gds-part":"banner-content",className:"flex-1 min-w-0"},d),i?S.createElement("span",{"data-gds-part":"banner-action",className:"shrink-0"},i):null,a?S.createElement("button",{type:"button","data-gds-part":"banner-dismiss",onClick:l,"aria-label":"Dismiss",className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md opacity-70 hover:opacity-100 hover:bg-black/5 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 transition-opacity"},S.createElement(X,{className:"h-4 w-4"})):null)});Yi.displayName="Banner";var jo=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",raised:"gds-button-raised"},size:{sm:"h-7 gap-1.5 px-2.5 text-xs [&_svg]:size-3.5",md:"h-8 gap-1.5 px-3 text-xs [&_svg]:size-3.5",default:"h-8 gap-1.5 px-3 text-xs [&_svg]:size-3.5",lg:"h-10 gap-2 px-4 text-sm [&_svg]:size-4",icon:"h-8 w-8 [&_svg]:size-3.5"}},defaultVariants:{variant:"default",size:"md"}}),We=S.forwardRef(({className:e,variant:t,size:o,asChild:r=false,...n},a)=>S.createElement(r?Slot:"button",{"data-gds-part":"button",className:s("gds-button",jo({variant:t,size:o,className:e})),ref:a,...n}));We.displayName="Button";function Mr({className:e,classNames:t,showOutsideDays:o=true,captionLayout:r="label",buttonVariant:n="ghost",formatters:a,components:l,...p}){let i=getDefaultClassNames();return S.createElement(DayPicker,{showOutsideDays:o,className:s("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:c=>c.toLocaleString("default",{month:"short"}),...a},classNames:{root:s("w-fit",i.root),months:s("relative flex flex-col gap-4 md:flex-row",i.months),month:s("flex w-full flex-col gap-4",i.month),nav:s("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",i.nav),button_previous:s(jo({variant:n}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",i.button_previous),button_next:s(jo({variant:n}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",i.button_next),month_caption:s("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",i.month_caption),dropdowns:s("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",i.dropdowns),dropdown_root:s("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",i.dropdown_root),dropdown:s("bg-popover absolute inset-0 opacity-0",i.dropdown),caption_label:s("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",i.caption_label),table:"w-full border-collapse",weekdays:s("flex",i.weekdays),weekday:s("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",i.weekday),week:s("mt-2 flex w-full",i.week),week_number_header:s("w-[--cell-size] select-none",i.week_number_header),week_number:s("text-muted-foreground select-none text-[0.8rem]",i.week_number),day:s("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",i.day),range_start:s("bg-accent rounded-l-md",i.range_start),range_middle:s("rounded-none",i.range_middle),range_end:s("bg-accent rounded-r-md",i.range_end),today:s("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",i.today),outside:s("text-muted-foreground aria-selected:text-muted-foreground",i.outside),disabled:s("text-muted-foreground opacity-50",i.disabled),hidden:s("invisible",i.hidden),...t},components:{Root:({className:c,rootRef:d,...m})=>S.createElement("div",{"data-slot":"calendar",ref:d,className:s(c),...m}),Chevron:({className:c,orientation:d,...m})=>d==="left"?S.createElement(ChevronLeftIcon,{className:s("size-4",c),...m}):d==="right"?S.createElement(ChevronRightIcon,{className:s("size-4",c),...m}):S.createElement(ChevronDownIcon,{className:s("size-4",c),...m}),DayButton:Xi,WeekNumber:({children:c,...d})=>S.createElement("td",{...d},S.createElement("div",{className:"flex size-[--cell-size] items-center justify-center text-center"},c)),...l},...p})}function Xi({className:e,day:t,modifiers:o,...r}){let n=getDefaultClassNames(),a=S.useRef(null);return S.useEffect(()=>{o.focused&&a.current?.focus();},[o.focused]),S.createElement(We,{ref:a,variant:"ghost",size:"icon","data-day":`${t.date.getFullYear()}-${String(t.date.getMonth()+1).padStart(2,"0")}-${String(t.date.getDate()).padStart(2,"0")}`,"data-selected-single":o.selected&&!o.range_start&&!o.range_end&&!o.range_middle,"data-range-start":o.range_start,"data-range-end":o.range_end,"data-range-middle":o.range_middle,className:s("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",n.day,e),...r})}var ha=S.createContext(null);function qo(e){let t=S.useContext(ha);if(!t)throw new Error(`<${e}> must be rendered inside a <Carousel> root.`);return t}var Ec=5e3,Ut=S.forwardRef(({loop:e=true,align:t="start",slidesPerView:o=1,autoplay:r=false,draggable:n=true,onSlideChange:a,className:l,style:p,children:i,...c},d)=>{let m=S.useMemo(()=>({loop:e,align:t,slidesToScroll:1,watchDrag:n,containScroll:e?false:"trimSnaps"}),[e,t,n]),[g,u]=Pc(m),[b,h]=S.useState(0),[f,y]=S.useState(0),[R,x]=S.useState(false),[k,T]=S.useState(false),O=S.useRef(new Map),D=S.useRef(a);D.current=a;let E=S.useMemo(()=>r?r===true?{}:r:null,[r]);S.useEffect(()=>{if(!u)return;let v=()=>{h(u.selectedScrollSnap()),y(u.scrollSnapList().length),x(u.canScrollPrev()),T(u.canScrollNext()),D.current?.(u.selectedScrollSnap());};return v(),u.on("select",v),u.on("reInit",v),()=>{u.off("select",v),u.off("reInit",v);}},[u]);let $=S.useCallback(v=>{u&&u.selectedScrollSnap()===v&&u.scrollNext();},[u]),H=S.useRef(false),F=S.useRef(true),j=S.useRef(null);S.useImperativeHandle(d,()=>j.current),S.useEffect(()=>{if(!E?.pauseWhenOffscreen){F.current=true;return}let v=j.current;if(!v||typeof IntersectionObserver>"u")return;let W=new IntersectionObserver(I=>{F.current=I.some(le=>le.isIntersecting);},{threshold:.25});return W.observe(v),()=>W.disconnect()},[E?.pauseWhenOffscreen]),S.useEffect(()=>{if(!u||!E)return;let v=null,W=()=>{v&&clearTimeout(v);let he=u.selectedScrollSnap(),ne=O.current.get(he)??E.delay??Ec;v=setTimeout(()=>{if(H.current||!F.current){W();return}u.scrollNext();},ne);},I=()=>W(),le=()=>{v&&clearTimeout(v);},J=()=>W();return u.on("select",I),u.on("pointerDown",le),u.on("settle",J),W(),()=>{v&&clearTimeout(v),u.off("select",I),u.off("pointerDown",le),u.off("settle",J);}},[u,E]);let N=()=>{E?.pauseOnHover!==false&&(H.current=true);},X=()=>{H.current=false;},L=S.useMemo(()=>({api:u,selectedIndex:b,slideCount:f,canScrollPrev:R,canScrollNext:k,durationsRef:O,advanceFromSlide:$}),[u,b,f,R,k,$]),Y=`calc(100% / ${o})`;return S.createElement(ha.Provider,{value:L},S.createElement("div",{ref:j,"data-gds-part":"carousel",className:s("relative",l),style:{"--gds-carousel-slide-basis":Y,...p},onMouseEnter:N,onMouseLeave:X,...c},S.createElement("div",{ref:g,"data-gds-part":"carousel-viewport",className:"overflow-hidden",style:{borderRadius:"var(--gds-carousel-radius, var(--gds-media-radius, 0.5rem))"}},S.createElement("div",{"data-gds-part":"carousel-track",className:"flex",style:{gap:"var(--gds-carousel-gap, 0)",touchAction:"pan-y pinch-zoom"}},i))))});Ut.displayName="Carousel";var Nr=S.forwardRef(({duration:e,className:t,style:o,children:r,...n},a)=>{let{durationsRef:l}=qo("Carousel.Slide"),p=S.useRef(null);return S.useImperativeHandle(a,()=>p.current),S.useEffect(()=>{if(e==null)return;let i=p.current;if(!i?.parentElement)return;let c=Array.from(i.parentElement.children).indexOf(i);if(c<0)return;let d=l.current;return d.set(c,e),()=>{d.delete(c);}},[e,l]),S.createElement("div",{ref:p,"data-gds-part":"carousel-slide",className:s("min-w-0 shrink-0 grow-0",t),style:{flexBasis:"var(--gds-carousel-slide-basis, 100%)",...o},...n},r)});Nr.displayName="Carousel.Slide";var ba=S.forwardRef(({src:e,poster:t,alt:o,controls:r=false,loop:n=true,fit:a="cover",duration:l,className:p,style:i,...c},d)=>{let{api:m,selectedIndex:g,advanceFromSlide:u}=qo("Carousel.VideoSlide"),b=S.useRef(null),h=S.useRef(null);S.useImperativeHandle(d,()=>b.current);let[f,y]=S.useState(null);S.useEffect(()=>{let x=b.current;x?.parentElement&&y(Array.from(x.parentElement.children).indexOf(x));},[m]);let R=f!=null&&f===g;return S.useEffect(()=>{let x=h.current;if(x)if(R){let k=x.play();k&&typeof k.catch=="function"&&k.catch(()=>{});}else x.pause(),x.currentTime=0;},[R]),S.createElement(Nr,{ref:b,duration:l,className:s("relative overflow-hidden bg-[var(--gds-media-placeholder-bg)]",p),style:i,"data-gds-part":"carousel-video-slide",...c},t&&S.createElement("img",{src:t,alt:o??"","aria-hidden":R,className:"absolute inset-0 h-full w-full",style:{objectFit:a,opacity:R?0:1,transition:"opacity var(--gds-carousel-fade-ms, 200ms) ease-out"}}),S.createElement("video",{ref:h,src:e,muted:true,playsInline:true,loop:n,controls:r,preload:"metadata","aria-label":o,className:"block h-full w-full",style:{objectFit:a,opacity:R?1:0,transition:"opacity var(--gds-carousel-fade-ms, 200ms) ease-out"},onEnded:()=>{n||f!=null&&u(f);}}))});ba.displayName="Carousel.VideoSlide";var va=S.forwardRef(({position:e="below",renderDot:t,className:o,style:r,...n},a)=>{let{api:l,selectedIndex:p,slideCount:i}=qo("Carousel.Dots");if(i<=1)return null;let c=Array.from({length:i},(m,g)=>g),d=e==="overlay"?{position:"absolute",insetInlineStart:0,insetInlineEnd:0,bottom:"var(--gds-carousel-dots-inset, 0.75rem)",zIndex:1}:{marginBlockStart:"var(--gds-carousel-dots-gap, 0.75rem)"};return S.createElement("div",{ref:a,"data-gds-part":"carousel-dots",className:s("flex items-center justify-center",o),style:{gap:"var(--gds-carousel-dots-spacing, 0.5rem)",...d,...r},...n},c.map(m=>{let g=m===p,u=()=>l?.scrollTo(m);return t?t({index:m,active:g,onClick:u}):S.createElement("button",{key:m,type:"button",onClick:u,"aria-label":`Go to slide ${m+1}`,"aria-current":g?"true":void 0,"data-active":g||void 0,className:"rounded-full transition-all",style:{width:g?"var(--gds-carousel-dot-active-width, 1.25rem)":"var(--gds-carousel-dot-size, 0.5rem)",height:"var(--gds-carousel-dot-size, 0.5rem)",background:g?"var(--gds-carousel-dot-active-color, oklch(var(--primary)))":"var(--gds-carousel-dot-color, oklch(var(--muted-foreground) / 0.4))"}})}))});va.displayName="Carousel.Dots";var ya=S.forwardRef(({position:e="overlay",className:t,style:o,...r},n)=>e==="outside"?S.createElement("div",{ref:n,"data-gds-part":"carousel-arrows",className:s("flex items-center justify-end gap-2 pt-2",t),style:o,...r},S.createElement($o,null),S.createElement(Ko,null)):S.createElement("div",{ref:n,"data-gds-part":"carousel-arrows",className:s("pointer-events-none absolute inset-0 z-[1]",t),style:o,...r},S.createElement($o,{className:"pointer-events-auto absolute left-[var(--gds-carousel-arrow-inset,0.75rem)] top-1/2 -translate-y-1/2"}),S.createElement(Ko,{className:"pointer-events-auto absolute right-[var(--gds-carousel-arrow-inset,0.75rem)] top-1/2 -translate-y-1/2"})));ya.displayName="Carousel.Arrows";var $o=S.forwardRef(({className:e,style:t,children:o,...r},n)=>{let{api:a,canScrollPrev:l}=qo("Carousel.Prev");return S.createElement("button",{ref:n,type:"button","data-gds-part":"carousel-prev","aria-label":"Previous slide",disabled:!l,onClick:()=>a?.scrollPrev(),className:s("inline-flex items-center justify-center rounded-full","transition disabled:opacity-40 disabled:cursor-not-allowed","hover:[background:var(--gds-carousel-arrow-hover-bg,oklch(var(--background)))]",e),style:{width:"var(--gds-carousel-arrow-size, 2.25rem)",height:"var(--gds-carousel-arrow-size, 2.25rem)",background:"var(--gds-carousel-arrow-bg, oklch(var(--background) / 0.85))",color:"var(--gds-carousel-arrow-fg, oklch(var(--foreground)))",backdropFilter:"var(--gds-carousel-arrow-backdrop, blur(6px))",boxShadow:"var(--gds-carousel-arrow-shadow, 0 2px 8px oklch(0 0 0 / 0.12))",...t},...r},o??S.createElement(ChevronLeft,{className:"h-4 w-4","aria-hidden":true}))});$o.displayName="Carousel.Prev";var Ko=S.forwardRef(({className:e,style:t,children:o,...r},n)=>{let{api:a,canScrollNext:l}=qo("Carousel.Next");return S.createElement("button",{ref:n,type:"button","data-gds-part":"carousel-next","aria-label":"Next slide",disabled:!l,onClick:()=>a?.scrollNext(),className:s("inline-flex items-center justify-center rounded-full","transition disabled:opacity-40 disabled:cursor-not-allowed","hover:[background:var(--gds-carousel-arrow-hover-bg,oklch(var(--background)))]",e),style:{width:"var(--gds-carousel-arrow-size, 2.25rem)",height:"var(--gds-carousel-arrow-size, 2.25rem)",background:"var(--gds-carousel-arrow-bg, oklch(var(--background) / 0.85))",color:"var(--gds-carousel-arrow-fg, oklch(var(--foreground)))",backdropFilter:"var(--gds-carousel-arrow-backdrop, blur(6px))",boxShadow:"var(--gds-carousel-arrow-shadow, 0 2px 8px oklch(0 0 0 / 0.12))",...t},...r},o??S.createElement(ChevronRight,{className:"h-4 w-4","aria-hidden":true}))});Ko.displayName="Carousel.Next";Ut.Slide=Nr;Ut.VideoSlide=ba;Ut.Dots=va;Ut.Arrows=ya;Ut.Prev=$o;Ut.Next=Ko;var Lc=Ut;function Dc(){return S.useContext(ha)?.api}var Ji=S.forwardRef(({className:e,surface:t="solid",...o},r)=>S.createElement("div",{ref:r,"data-gds-part":"card","data-surface":t,className:s("gds-card rounded-xl border text-card-foreground shadow",gt(t,"bg-card"),Xe[t],e),...o}));Ji.displayName="Card";var Qi=S.forwardRef(({className:e,...t},o)=>S.createElement("div",{ref:o,"data-gds-part":"card-header",className:s("flex flex-col space-y-1.5 p-6",e),...t}));Qi.displayName="CardHeader";var es=S.forwardRef(({className:e,...t},o)=>S.createElement("div",{ref:o,"data-gds-part":"card-title",className:s("font-semibold leading-none tracking-tight",e),...t}));es.displayName="CardTitle";var ts=S.forwardRef(({className:e,...t},o)=>S.createElement("div",{ref:o,"data-gds-part":"card-description",className:s("text-sm text-muted-foreground",e),...t}));ts.displayName="CardDescription";var os=S.forwardRef(({className:e,...t},o)=>S.createElement("div",{ref:o,"data-gds-part":"card-content",className:s("p-6 pt-0",e),...t}));os.displayName="CardContent";var rs=S.forwardRef(({className:e,...t},o)=>S.createElement("div",{ref:o,"data-gds-part":"card-footer",className:s("flex items-center p-6 pt-0",e),...t}));rs.displayName="CardFooter";var as=S.forwardRef(({className:e,...t},o)=>S.createElement(Yo.Root,{ref:o,className:s("gds-checkbox peer h-4 w-4 shrink-0 rounded-[3px] border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t},S.createElement(Yo.Indicator,{className:s("flex items-center justify-center text-current")},S.createElement(Check,{className:"h-4 w-4"}))));as.displayName=Yo.Root.displayName;var ko={slow:{tokenStagger:70,lineStagger:200,preDelay:500,fadeMs:480},normal:{tokenStagger:22,lineStagger:55,preDelay:200,fadeMs:280},fast:{tokenStagger:8,lineStagger:18,preDelay:60,fadeMs:160}},xa=.55;function re(e,t){return e<=0?Promise.resolve():new Promise((o,r)=>{if(t?.aborted){r(new DOMException("Aborted","AbortError"));return}let n=window.setTimeout(()=>{t?.removeEventListener("abort",a),o();},e),a=()=>{window.clearTimeout(n),r(new DOMException("Aborted","AbortError"));};t?.addEventListener("abort",a,{once:true});})}async function Er(e,t,o=22,r){for(let n=1;n<=e.length;n++)t(e.slice(0,n)),n<e.length&&await re(o,r);}function wa(e){return e instanceof DOMException&&e.name==="AbortError"}var Ic=2e3;function jt(e){let{steps:t,interpret:o,speed:r="normal",trigger:n="mount",play:a,loop:l=false,loopDelay:p=Ic,containerRef:i,onComplete:c,onLoopReset:d}=e,m=ko[r],[g,u]=S.useState(false),[b,h]=S.useState(false),[f,y]=S.useState(-1),R=S.useRef(null),x=useInView(i??R,{once:true,amount:xa}),[k,T]=S.useState(0),O=S.useMemo(()=>n==="mount"?true:n==="inView"?x:!!a||k>0,[n,x,a,k]),D=S.useRef(o);D.current=o;let E=S.useRef(c);E.current=c;let $=S.useRef(d);$.current=d;let H=S.useRef(null),F=S.useRef(null),j=S.useCallback(()=>{H.current?.abort(),H.current=null,F.current!==null&&(window.clearTimeout(F.current),F.current=null),u(false);},[]),N=S.useCallback(()=>{T(L=>L+1);},[]),X=S.useCallback((L=0)=>{if(H.current?.abort(),H.current=null,F.current!==null&&(window.clearTimeout(F.current),F.current=null),L>0){F.current=window.setTimeout(()=>{F.current=null,T(Y=>Y+1);},L);return}T(Y=>Y+1);},[]);return S.useEffect(()=>()=>{F.current!==null&&(window.clearTimeout(F.current),F.current=null);},[]),S.useEffect(()=>{if(!t||t.length===0||!O)return;let L=new AbortController;H.current=L;let{signal:Y}=L,W={speed:m,signal:Y,cancelled:()=>Y.aborted},I=true;return (async()=>{do{u(true),h(false),y(-1);try{await re(n==="inView"?m.preDelay:0,Y);for(let J=0;J<t.length;J++){if(Y.aborted)return;y(J),await D.current(t[J],W);}if(Y.aborted)return;if(y(-1),h(!0),E.current?.(),!l){u(!1);return}if(await re(p,Y),Y.aborted)return;$.current?.();}catch(J){if(wa(J))return;process.env.NODE_ENV!=="production"&&console.error("[useScriptedDemo] step error:",J),u(false);return}}while(I&&l&&!Y.aborted)})(),()=>{I=false,L.abort(),H.current===L&&(H.current=null);}},[t,O,l,p,m,n,k]),{isPlaying:g,isComplete:b,currentIndex:f,play:N,stop:j,restart:X}}var Dr=S.forwardRef(function({variant:t="inline",className:o,...r},n){return S.createElement("span",{ref:n,"data-gds-part":"demo-cursor","data-gds-variant":t,"aria-hidden":true,className:s("gds-demo-cursor",o),...r})});var ns=S.createContext({visible:new Set,hasStage:false,reducedMotion:false,defaultAnimation:"fade-up"});function is({steps:e,speed:t="normal",trigger:o="mount",play:r,loop:n=false,defaultAnimation:a="fade-up",visibleWhenIdle:l=true,className:p,children:i}){let c=useReducedMotion()??false,d=S.useRef(null),[m,g]=S.useState(()=>new Set),u=!!(e&&e.length);jt({steps:u?e:void 0,speed:t,trigger:o,play:r,loop:n,containerRef:d,onLoopReset:()=>g(new Set),interpret:async(f,y)=>{if(f.type==="wait")return re(f.ms,y.signal);if(f.type==="reset")return g(new Set),re(y.speed.preDelay,y.signal);if(f.type==="reveal")return g(R=>{if(R.has(f.target))return R;let x=new Set(R);return x.add(f.target),x}),re(y.speed.lineStagger,y.signal);if(f.type==="reveal-all")return g(R=>{let x=new Set(R);return x.add("__all__"),x}),re(y.speed.lineStagger,y.signal);if(f.type==="hide")return g(R=>{if(!R.has(f.target))return R;let x=new Set(R);return x.delete(f.target),x}),re(y.speed.fadeMs,y.signal)}});let b=S.useMemo(()=>({visible:u?m:new Set(["__all__"]),hasStage:true,reducedMotion:c,defaultAnimation:a}),[u,m,c,a]),h=!u&&!l?{...b,visible:new Set}:b;return S.createElement("div",{ref:d,"data-gds-part":"demo-stage","data-gds-stage-playing":u?"true":"false",className:p},S.createElement(ns.Provider,{value:h},i))}var zc={fade:{initial:{opacity:0},animate:{opacity:1}},"fade-up":{initial:{opacity:0,y:12},animate:{opacity:1,y:0}},"fade-down":{initial:{opacity:0,y:-12},animate:{opacity:1,y:0}},"fade-left":{initial:{opacity:0,x:12},animate:{opacity:1,x:0}},"fade-right":{initial:{opacity:0,x:-12},animate:{opacity:1,x:0}},scale:{initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1}},none:{initial:{opacity:1},animate:{opacity:1}}};function ss({id:e,animation:t,durationMs:o,hideOutsideStage:r=false,onReveal:n,onHide:a,className:l,children:p}){let i=S.useContext(ns),c=i.hasStage?i.visible.has("__all__")||i.visible.has(e):!r,d=S.useRef(c),m=S.useRef(n),g=S.useRef(a);m.current=n,g.current=a,S.useEffect(()=>{c!==d.current&&(d.current=c,c?m.current?.():g.current?.());},[c]);let u=t??i.defaultAnimation,b=zc[u],h=(o??280)/1e3;return i.reducedMotion?S.createElement("div",{"data-gds-part":"reveal","data-gds-reveal-id":e,"data-gds-revealed":c?"true":"false",className:l,style:{opacity:c?1:0}},p):S.createElement(motion.div,{"data-gds-part":"reveal","data-gds-reveal-id":e,"data-gds-revealed":c?"true":"false",className:l,initial:b.initial,animate:c?b.animate:b.initial,transition:{duration:h,ease:[.22,1,.36,1]}},p)}var _c={xs:"text-xs",sm:"text-sm",md:"text-base"},Gc={slow:{lineStagger:200,tokenStagger:70,preDelay:500,fadeMs:480},normal:{lineStagger:55,tokenStagger:22,preDelay:200,fadeMs:280},fast:{lineStagger:18,tokenStagger:8,preDelay:60,fadeMs:160}},Wc={plain:{color:"var(--gds-code-fg)",backgroundColor:"transparent"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"var(--gds-code-comment)",fontStyle:"normal"}},{types:["punctuation"],style:{color:"var(--gds-code-punctuation)"}},{types:["property","constant","symbol","deleted"],style:{color:"var(--gds-code-property)"}},{types:["boolean","number"],style:{color:"var(--gds-code-number)"}},{types:["selector","attr-name","string","char","builtin","inserted"],style:{color:"var(--gds-code-string)"}},{types:["operator","entity","url"],style:{color:"var(--gds-code-operator)"}},{types:["atrule","keyword"],style:{color:"var(--gds-code-keyword)"}},{types:["function","class-name"],style:{color:"var(--gds-code-function)"}},{types:["regex","important","variable"],style:{color:"var(--gds-code-variable)"}},{types:["tag"],style:{color:"var(--gds-code-tag)"}},{types:["attr-name"],style:{color:"var(--gds-code-attr-name)"}},{types:["attr-value"],style:{color:"var(--gds-code-attr-value)"}}]};function Uc(e){let t=new Set;if(e==null)return t;let o=Array.isArray(e)?e:[e];for(let r of o)if(typeof r=="number")t.add(r);else if(Array.isArray(r)&&r.length===2){let[n,a]=r;for(let l=n;l<=a;l++)t.add(l);}return t}function jc(e,t,o){return t?.added?.includes(e)?"added":t?.removed?.includes(e)?"removed":o.has(e)?"highlight":"default"}var ds=S.forwardRef(function({source:t,language:o="tsx",highlight:r,diff:n,reveal:a="none",trigger:l="mount",play:p,speed:i="normal",delay:c,stagger:d,showLineNumbers:m=false,filename:g,wrap:u=false,bare:b=false,prompt:h,cursor:f,steps:y,loop:R=false,size:x="sm",height:k,maxLines:T,className:O,style:D,...E},$){let H=Gc[i],F=c??0,j=d??(a==="typewriter"?H.tokenStagger:H.lineStagger),N=!!(y&&y.length),[X,L]=S.useState(""),[Y,v]=S.useState(()=>new Set),W=N?X:t??"",I=S.useMemo(()=>W.replace(/\n$/,""),[W]),le=S.useMemo(()=>Uc(r),[r]),J=!!(n?.added?.length||n?.removed?.length),he=m||J,ne=S.useRef(null);S.useImperativeHandle($,()=>ne.current);let[be,Be]=S.useState(a==="none"),A=useInView(ne,{once:true,amount:.55}),ce=l==="inView"?H.preDelay:0,Q=l==="mount"?true:l==="inView"?A:!!p,Ge=j,oe=I.split(`
108
- `).length,Re=a==="typewriter"?I.replace(/\s+/g," ").split(" ").length:oe,Z=ce+F+Re*Ge+280;S.useEffect(()=>{if(N)return;if(!Q||a==="none"){Be(a==="none");return}Be(false);let ge=window.setTimeout(()=>Be(true),Z);return ()=>window.clearTimeout(ge)},[Q,a,Z,N]);let ie=S.useRef(""),ze=S.useRef(new Set),to=S.useCallback(ge=>{ie.current=ge,L(ge);},[]),la=S.useCallback(ge=>{ze.current=ge,v(ge);},[]),{isComplete:gn}=jt({steps:N?y:void 0,speed:i,trigger:"manual",play:Q,loop:R,containerRef:ne,onLoopReset:()=>{to(""),la(new Set),Be(false);},interpret:async(ge,br)=>{let Bt=br.signal;if(ge.type==="wait")return re(ge.ms,Bt);if(ge.type==="clear"){to(""),la(new Set);return}if(ge.type==="output"){let Oe=ie.current,ct=Oe.length>0&&!Oe.endsWith(`
109
- `)?Oe+`
110
- `:Oe,Io=ct+ge.text,Fo=ct.split(`
111
- `).length,da=ge.text.split(`
112
- `).length,Bo=new Set(ze.current);for(let fo=0;fo<da;fo++)Bo.add(Fo+fo);return to(Io),la(Bo),to(Io+(Io.endsWith(`
107
+ </Card>`,import:"@gradeui/ui",subcomponents:["ToolbarSlot"],composesWith:["Button","Avatar","Input","Logo","Badge","AppShellHeader","Card","Row","Stack"],styleDefaults:{ToolbarSlot:"flex items-center min-w-0"},props:{leading:{schema:z.unknown().optional(),design:"plumbing",description:"left-aligned region (logo + primary nav)"},center:{schema:z.unknown().optional(),design:"plumbing",description:"center region (search, page title, segmented control)"},trailing:{schema:z.unknown().optional(),design:"plumbing",description:"right-aligned region (action icons, avatar, primary CTA)"},children:{schema:z.unknown().optional(),design:"plumbing",description:"escape hatch; bypasses slot layout"},position:{schema:z.enum(["top","bottom","inline"]).optional(),design:"knob",description:"border placement",default:"top"},variant:{schema:z.enum(["default","subtle","transparent"]).optional(),design:"knob",default:"default"},size:{schema:z.enum(["sm","md","lg"]).optional(),design:"knob",description:"height + padding",default:"md"},sticky:{schema:z.boolean().optional(),design:"knob",description:"pin to top/bottom of scroll container",default:false},"aria-label":{schema:z.string().optional(),design:"content",description:"required by WAI-ARIA toolbar pattern",default:"Toolbar"},className:{schema:z.string().optional(),design:"plumbing"}}};var Ps={name:"Tooltip",description:"A short, non-essential label that explains a control on hover/focus \u2014 icon-only buttons in toolbars, abbreviated column headers, status dots. NEVER hide critical info inside a tooltip \u2014 they're invisible on touch and can be skipped by screen readers if implemented carelessly. For richer hover content use HoverCard. For inline help text that's always visible, use a description paragraph.",import:"@gradeui/ui",aliases:["tooltip","tip","hover tip","hint","label on hover","help tag","hint","helper text bubble","info tip"],subcomponents:["TooltipTrigger","TooltipContent","TooltipProvider"],composesWith:["Button (icon-only)","Toggle","TabsTrigger (the canonical tabs already have a `tooltip` prop that wraps this)","Avatar (status badge meaning)"],styleDefaults:{TooltipContent:"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]"},props:{delayDuration:{schema:z.number().optional(),design:"knob",description:"ms hover before show; mount ONCE near the app root"},skipDelayDuration:{schema:z.number().optional(),design:"knob",description:'ms gap that still feels like "same hover"'},open:{schema:z.unknown().optional(),design:"plumbing"},asChild:{schema:z.boolean().optional(),design:"plumbing",description:"usually wraps a Button or icon"},side:{schema:z.enum(["top","right","bottom","left","start","center","end"]).optional(),design:"knob",default:"top"}}};var Ns={name:"VideoPlayer",description:"HTML5 video wrapped in the shared media surface. Controls-on for a standard player, controls-off (+ autoplay/muted/loop) for hero / background video. Prefer Rive for anything interactive, Three Scene for shader backgrounds.",import:"@gradeui/ui",aliases:["video","mp4","movie","webm","clip","video view","av player","react native video","video element"],composesWith:["MediaSurface (internal)","Card (wrap for thumbnail grids)"],styleDefaults:{VideoPlayer:"w-full h-full"},props:{src:{schema:z.string(),design:"content",description:"video URL"},controls:{schema:z.boolean().optional(),design:"knob",description:"show native controls; false for chromeless hero/background video",default:true},autoPlay:{schema:z.boolean().optional(),design:"knob",description:"forces muted=true (browser restriction)",default:false},loop:{schema:z.boolean().optional(),design:"knob",default:false},muted:{schema:z.boolean().optional(),design:"knob",default:false},pauseOffscreen:{schema:z.boolean().optional(),design:"knob",description:"pause when scrolled out of viewport",default:true},aspect:{schema:z.enum(["video","square","portrait","wide","auto"]).optional(),design:"knob",default:"video"},radius:{schema:z.enum(["none","sm","md","lg","xl"]).optional(),design:"knob",description:"driven by `--gds-media-radius`",default:"lg"},objectFit:{schema:z.enum(["cover","contain","fill"]).optional(),design:"knob",default:"cover"},poster:{schema:z.string().optional(),design:"content",description:'image shown before playback. Always rendered as a `loading="lazy"` `<img>` overlay (not the native `poster` attribute, which fetches eagerly).'},playbackRate:{schema:z.number().optional(),design:"knob"}}};var on={Accordion:ci,AiChat:pi,AiChatComposer:mi,AppShell:ui,Avatar:gi,BackgroundFill:fi,Badge:bi,Banner:vi,Breadcrumb:yi,Button:xi,Calendar:wi,Callout:Ri,Card:ki,Carousel:Ci,Chart:Ti,Checkbox:Pi,CheckboxCard:Ni,Code:Mi,Collapsible:Ei,Command:Li,Composer:Di,DatePicker:Ai,Dialog:Ii,DropdownMenu:Hi,Field:zi,FillPicker:_i,Flex:Oi,Grid:Vi,HoverCard:Gi,Input:ji,Label:Ui,Logo:$i,Map:Ki,MediaSurface:Ja,Message:qi,MultiSelect:Yi,Popover:Zi,Progress:Xi,RadioCard:Ji,RadioGroup:Qi,Resizable:es,RivePlayer:ts,Row:os,ScreenAnimator:rs,ScrollArea:as,SectionBlock:ns,Select:is,Separator:ss,ShaderPresetPicker:ls,ShaderPresetPreview:ds,Sheet:cs,Sidebar:ps,Skeleton:ms,Slider:us,Sortable:gs,Stack:fs,Switch:hs,SwitchCard:bs,Table:ys,Tabs:xs,Textarea:ws,ThreeScene:Rs,Toast:Ss,Toggle:ks,ToggleGroup:Cs,Toolbar:Ts,Tooltip:Ps,VideoPlayer:Ns};function Np(e){return e?on[e]??null:null}function Mp(){return Object.keys(on)}function l(...e){return twMerge(clsx(e))}var Ap=gt.Root,Ms=C.forwardRef(({className:e,...t},o)=>C.createElement(gt.Item,{ref:o,className:l("border-b",e),...t}));Ms.displayName="AccordionItem";var Es=C.forwardRef(({className:e,children:t,...o},r)=>C.createElement(gt.Header,{className:"flex"},C.createElement(gt.Trigger,{ref:r,className:l("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...o},t,C.createElement(ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"}))));Es.displayName=gt.Trigger.displayName;var Ls=C.forwardRef(({className:e,children:t,...o},r)=>C.createElement(gt.Content,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...o},C.createElement("div",{className:l("pb-4 pt-0",e)},t)));Ls.displayName=gt.Content.displayName;var Ds=cva("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4",{variants:{variant:{default:"bg-background text-foreground [&>svg]:text-foreground",destructive:"border-destructive/30 bg-destructive-soft text-destructive-deep [&>svg]:text-destructive-deep",success:"border-success/30 bg-success-soft text-success-deep [&>svg]:text-success-deep",warning:"border-warning/30 bg-warning-soft text-warning-deep [&>svg]:text-warning-deep",info:"border-info/30 bg-info-soft text-info-deep [&>svg]:text-info-deep"}},defaultVariants:{variant:"default"}}),Hp={destructive:"alert",warning:"alert",info:"status",success:"status",default:"status"},As=C.forwardRef(({className:e,variant:t,role:o,...r},n)=>C.createElement("div",{ref:n,role:o??Hp[t??"default"],"data-gds-part":"callout",className:l(Ds({variant:t}),e),...r}));As.displayName="Callout";var Is=C.forwardRef(({className:e,...t},o)=>C.createElement("h5",{ref:o,"data-gds-part":"callout-title",className:l("mb-1 font-medium leading-none tracking-tight",e),...t}));Is.displayName="CalloutTitle";var Hs=C.forwardRef(({className:e,...t},o)=>C.createElement("div",{ref:o,"data-gds-part":"callout-description",className:l("text-sm [&_p]:leading-relaxed",e),...t}));Hs.displayName="CalloutDescription";var Fs=cva("gds-app-shell min-h-screen w-full bg-background text-foreground grid",{variants:{nav:{none:"",top:"",side:"","three-pane":""}},defaultVariants:{nav:"none"}}),zs=cva("gds-app-shell-header",{variants:{sticky:{true:"sticky top-0 z-30",false:""}},defaultVariants:{sticky:false}}),Bs=cva("gds-app-shell-nav",{variants:{placement:{top:"border-b bg-background",side:"border-r bg-background",none:"hidden"},sticky:{true:"",false:""}},compoundVariants:[{placement:"top",sticky:true,className:"sticky top-0 z-30"},{placement:"side",sticky:true,className:"sticky top-0 h-screen self-start"}],defaultVariants:{placement:"top",sticky:true}}),_s=cva("gds-app-shell-aside min-w-0 border-r bg-background",{variants:{sticky:{true:"sticky top-0 h-screen self-start",false:""}},defaultVariants:{sticky:false}}),Os=cva("gds-app-shell-main min-w-0",{variants:{maxWidth:{full:"w-full",container:"w-full mx-auto max-w-7xl px-4 md:px-6 lg:px-8"}},defaultVariants:{maxWidth:"full"}}),Vs=cva("gds-app-shell-footer border-t bg-background"),Gs=C.forwardRef(({className:e,nav:t,asChild:o=false,...r},n)=>C.createElement(o?Slot:"div",{ref:n,"data-gds-part":"app-shell","data-nav":t??"none",className:l(Fs({nav:t,className:e})),...r}));Gs.displayName="AppShell";var js=C.forwardRef(({className:e,sticky:t,asChild:o=false,...r},n)=>C.createElement(o?Slot:"header",{ref:n,"data-gds-part":"app-shell-header",className:l(zs({sticky:t,className:e})),...r}));js.displayName="AppShellHeader";var Ws=C.forwardRef(({className:e,placement:t,sticky:o,asChild:r=false,...n},a)=>C.createElement(r?Slot:"nav",{ref:a,"data-gds-part":"app-shell-nav","data-placement":t??"top",className:l(Bs({placement:t,sticky:o,className:e})),...n}));Ws.displayName="AppShellNav";var Us=C.forwardRef(({className:e,sticky:t,asChild:o=false,...r},n)=>C.createElement(o?Slot:"aside",{ref:n,"data-gds-part":"app-shell-aside",className:l(_s({sticky:t,className:e})),...r}));Us.displayName="AppShellAside";var $s=C.forwardRef(({className:e,maxWidth:t,asChild:o=false,...r},n)=>C.createElement(o?Slot:"main",{ref:n,"data-gds-part":"app-shell-main",className:l(Os({maxWidth:t,className:e})),...r}));$s.displayName="AppShellMain";var Ks=C.forwardRef(({className:e,asChild:t=false,...o},r)=>C.createElement(t?Slot:"footer",{ref:r,"data-gds-part":"app-shell-footer",className:l(Vs({className:e})),...o}));Ks.displayName="AppShellFooter";var Fp=cva("relative flex shrink-0 overflow-hidden rounded-full",{variants:{size:{"2xs":"h-5 w-5",xs:"h-6 w-6",sm:"h-7 w-7",md:"h-10 w-10",lg:"h-14 w-14",xl:"h-20 w-20"}},defaultVariants:{size:"md"}}),Ys=C.forwardRef(({className:e,size:t,...o},r)=>C.createElement(jt.Root,{ref:r,"data-gds-part":"avatar","data-gds-size":t??"md",className:l(Fp({size:t}),e),...o}));Ys.displayName=jt.Root.displayName;var Zs=C.forwardRef(({className:e,...t},o)=>C.createElement(jt.Image,{ref:o,"data-gds-part":"avatar-image",className:l("aspect-square h-full w-full",e),...t}));Zs.displayName=jt.Image.displayName;var zp=cva("flex h-full w-full items-center justify-center rounded-full font-semibold",{variants:{tone:{muted:"bg-muted text-foreground",primary:"bg-primary/15 text-primary",violet:"bg-violet-500/20 text-violet-600 dark:text-violet-400",amber:"bg-amber-500/20 text-amber-600 dark:text-amber-400",emerald:"bg-emerald-500/20 text-emerald-600 dark:text-emerald-400",sky:"bg-sky-500/20 text-sky-600 dark:text-sky-400",rose:"bg-rose-500/20 text-rose-600 dark:text-rose-400",plum:"bg-fuchsia-500/20 text-fuchsia-600 dark:text-fuchsia-400",lime:"bg-lime-500/20 text-lime-600 dark:text-lime-400"}},defaultVariants:{tone:"muted"}}),Xs=C.forwardRef(({className:e,tone:t,...o},r)=>C.createElement(jt.Fallback,{ref:r,"data-gds-part":"avatar-fallback","data-gds-tone":t??"muted",className:l(zp({tone:t}),e),...o}));Xs.displayName=jt.Fallback.displayName;var Qs=cva("inline-flex items-center gap-1 border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 [&_svg]:size-3 [&_svg]:shrink-0",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",highlight:"border-transparent bg-gds-yellow-400 text-gds-gray-900 shadow hover:bg-gds-yellow-500",success:"border-transparent bg-gds-green-500 text-gds-gray-900 shadow hover:bg-gds-green-600",warning:"border-transparent bg-orange-500 text-white shadow hover:bg-orange-600",info:"border-transparent bg-blue-500 text-white shadow hover:bg-blue-600","success-soft":"border-gds-green-500/20 bg-gds-green-500/10 text-gds-green-600 dark:text-gds-green-400","warning-soft":"border-orange-500/20 bg-orange-500/10 text-orange-600 dark:text-orange-400","destructive-soft":"border-destructive/20 bg-destructive/10 text-destructive dark:text-red-400","info-soft":"border-blue-500/20 bg-blue-500/10 text-blue-600 dark:text-blue-400","highlight-soft":"border-gds-yellow-500/20 bg-gds-yellow-400/10 text-gds-yellow-600 dark:text-gds-yellow-400","success-outline":"border-gds-green-500/50 bg-transparent text-gds-green-600 dark:text-gds-green-400","warning-outline":"border-orange-500/50 bg-transparent text-orange-600 dark:text-orange-400","destructive-outline":"border-destructive/50 bg-transparent text-destructive dark:text-red-400","info-outline":"border-blue-500/50 bg-transparent text-blue-600 dark:text-blue-400"},rounded:{default:"rounded-md",full:"rounded-full"}},defaultVariants:{variant:"default",rounded:"default"}});function ea({className:e,variant:t,rounded:o,...r}){return C.createElement("div",{className:l(Qs({variant:t,rounded:o}),e),...r})}var it={solid:"",translucent:"gds-surface-translucent",glass:"gds-surface-glass","glass-strong":"gds-surface-glass-strong"};function St(e,t){return e==="solid"?t:""}var el=cva("relative flex items-center gap-3 px-4 py-2.5 text-sm leading-relaxed border-b",{variants:{variant:{default:"bg-muted text-foreground border-border [&>svg]:text-muted-foreground",info:"bg-info-soft text-info-deep border-info/30 [&>svg]:text-info-deep",success:"bg-success-soft text-success-deep border-success/30 [&>svg]:text-success-deep",warning:"bg-warning-soft text-warning-deep border-warning/30 [&>svg]:text-warning-deep",destructive:"bg-destructive-soft text-destructive-deep border-destructive/30 [&>svg]:text-destructive-deep",announcement:"bg-[oklch(var(--primary)_/_0.06)] text-foreground border-[oklch(var(--primary)_/_0.18)] [&>svg]:text-primary"},align:{start:"justify-start",center:"justify-center",between:"justify-between"},sticky:{true:"sticky top-0 z-30",false:""}},defaultVariants:{variant:"default",align:"between",sticky:false}}),Vp={destructive:"alert",warning:"alert",info:"status",success:"status",default:"status",announcement:"status"},tl=C.forwardRef(({className:e,variant:t="default",align:o,sticky:r,surface:n="solid",dismissible:a,onDismiss:i,icon:p,action:s,role:c,children:d,...m},g)=>{let u=t??"default",b=c??Vp[u];return C.createElement("div",{ref:g,role:b,"data-gds-part":"banner","data-variant":u,"data-surface":n,className:l(el({variant:t,align:o,sticky:r}),it[n],e),...m},p?C.createElement("span",{"data-gds-part":"banner-icon","aria-hidden":true,className:"shrink-0"},p):null,C.createElement("div",{"data-gds-part":"banner-content",className:"flex-1 min-w-0"},d),s?C.createElement("span",{"data-gds-part":"banner-action",className:"shrink-0"},s):null,a?C.createElement("button",{type:"button","data-gds-part":"banner-dismiss",onClick:i,"aria-label":"Dismiss",className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md opacity-70 hover:opacity-100 hover:bg-black/5 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 transition-opacity"},C.createElement(X$1,{className:"h-4 w-4"})):null)});tl.displayName="Banner";var vr=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",raised:"gds-button-raised"},size:{"2xs":"h-6 gap-1 px-1.5 text-2xs [&_svg]:size-3",xs:"h-6 gap-1 px-2 text-xs [&_svg]:size-3",sm:"h-7 gap-1.5 px-2.5 text-sm [&_svg]:size-3.5",md:"h-8 gap-1.5 px-3 text-base [&_svg]:size-4",default:"h-8 gap-1.5 px-3 text-base [&_svg]:size-4",lg:"h-10 gap-2 px-4 text-lg [&_svg]:size-5",icon:"h-8 w-8 [&_svg]:size-4"}},defaultVariants:{variant:"default",size:"md"}}),Xe=C.forwardRef(({className:e,variant:t,size:o,asChild:r=false,...n},a)=>C.createElement(r?Slot:"button",{"data-gds-part":"button",className:l("gds-button",vr({variant:t,size:o,className:e})),ref:a,...n}));Xe.displayName="Button";function oa({className:e,classNames:t,showOutsideDays:o=true,captionLayout:r="label",buttonVariant:n="ghost",formatters:a,components:i,...p}){let s=getDefaultClassNames();return C.createElement(DayPicker,{showOutsideDays:o,className:l("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:c=>c.toLocaleString("default",{month:"short"}),...a},classNames:{root:l("w-fit",s.root),months:l("relative flex flex-col gap-4 md:flex-row",s.months),month:l("flex w-full flex-col gap-4",s.month),nav:l("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",s.nav),button_previous:l(vr({variant:n}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",s.button_previous),button_next:l(vr({variant:n}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",s.button_next),month_caption:l("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",s.month_caption),dropdowns:l("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",s.dropdowns),dropdown_root:l("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",s.dropdown_root),dropdown:l("bg-popover absolute inset-0 opacity-0",s.dropdown),caption_label:l("select-none font-medium",r==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",s.caption_label),table:"w-full border-collapse",weekdays:l("flex",s.weekdays),weekday:l("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",s.weekday),week:l("mt-2 flex w-full",s.week),week_number_header:l("w-[--cell-size] select-none",s.week_number_header),week_number:l("text-muted-foreground select-none text-[0.8rem]",s.week_number),day:l("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",s.day),range_start:l("bg-accent rounded-l-md",s.range_start),range_middle:l("rounded-none",s.range_middle),range_end:l("bg-accent rounded-r-md",s.range_end),today:l("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",s.today),outside:l("text-muted-foreground aria-selected:text-muted-foreground",s.outside),disabled:l("text-muted-foreground opacity-50",s.disabled),hidden:l("invisible",s.hidden),...t},components:{Root:({className:c,rootRef:d,...m})=>C.createElement("div",{"data-slot":"calendar",ref:d,className:l(c),...m}),Chevron:({className:c,orientation:d,...m})=>d==="left"?C.createElement(ChevronLeftIcon,{className:l("size-4",c),...m}):d==="right"?C.createElement(ChevronRightIcon,{className:l("size-4",c),...m}):C.createElement(ChevronDownIcon,{className:l("size-4",c),...m}),DayButton:rl,WeekNumber:({children:c,...d})=>C.createElement("td",{...d},C.createElement("div",{className:"flex size-[--cell-size] items-center justify-center text-center"},c)),...i},...p})}function rl({className:e,day:t,modifiers:o,...r}){let n=getDefaultClassNames(),a=C.useRef(null);return C.useEffect(()=>{o.focused&&a.current?.focus();},[o.focused]),C.createElement(Xe,{ref:a,variant:"ghost",size:"icon","data-day":`${t.date.getFullYear()}-${String(t.date.getMonth()+1).padStart(2,"0")}-${String(t.date.getDate()).padStart(2,"0")}`,"data-selected-single":o.selected&&!o.range_start&&!o.range_end&&!o.range_middle,"data-range-start":o.range_start,"data-range-end":o.range_end,"data-range-middle":o.range_middle,className:l("hover:bg-accent/40 hover:text-foreground","data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",n.day,e),...r})}var rn=C.createContext(null);function wr(e){let t=C.useContext(rn);if(!t)throw new Error(`<${e}> must be rendered inside a <Carousel> root.`);return t}var Xp=5e3,ro=C.forwardRef(({loop:e=true,align:t="start",slidesPerView:o=1,autoplay:r=false,draggable:n=true,onSlideChange:a,className:i,style:p,children:s,...c},d)=>{let m=C.useMemo(()=>({loop:e,align:t,slidesToScroll:1,watchDrag:n,containScroll:e?false:"trimSnaps"}),[e,t,n]),[g,u]=qp(m),[b,f]=C.useState(0),[h,v]=C.useState(0),[w,y]=C.useState(false),[S,k]=C.useState(false),H=C.useRef(new Map),E=C.useRef(a);E.current=a;let D=C.useMemo(()=>r?r===true?{}:r:null,[r]);C.useEffect(()=>{if(!u)return;let x=()=>{f(u.selectedScrollSnap()),v(u.scrollSnapList().length),y(u.canScrollPrev()),k(u.canScrollNext()),E.current?.(u.selectedScrollSnap());};return x(),u.on("select",x),u.on("reInit",x),()=>{u.off("select",x),u.off("reInit",x);}},[u]);let U=C.useCallback(x=>{u&&u.selectedScrollSnap()===x&&u.scrollNext();},[u]),A=C.useRef(false),q=C.useRef(true),F=C.useRef(null);C.useImperativeHandle(d,()=>F.current),C.useEffect(()=>{if(!D?.pauseWhenOffscreen){q.current=true;return}let x=F.current;if(!x||typeof IntersectionObserver>"u")return;let I=new IntersectionObserver(P=>{q.current=P.some(te=>te.isIntersecting);},{threshold:.25});return I.observe(x),()=>I.disconnect()},[D?.pauseWhenOffscreen]),C.useEffect(()=>{if(!u||!D)return;let x=null,I=()=>{x&&clearTimeout(x);let ne=u.selectedScrollSnap(),B=H.current.get(ne)??D.delay??Xp;x=setTimeout(()=>{if(A.current||!q.current){I();return}u.scrollNext();},B);},P=()=>I(),te=()=>{x&&clearTimeout(x);},se=()=>I();return u.on("select",P),u.on("pointerDown",te),u.on("settle",se),I(),()=>{x&&clearTimeout(x),u.off("select",P),u.off("pointerDown",te),u.off("settle",se);}},[u,D]);let Y=()=>{D?.pauseOnHover!==false&&(A.current=true);},J=()=>{A.current=false;},z=C.useMemo(()=>({api:u,selectedIndex:b,slideCount:h,canScrollPrev:w,canScrollNext:S,durationsRef:H,advanceFromSlide:U}),[u,b,h,w,S,U]),pe=`calc(100% / ${o})`;return C.createElement(rn.Provider,{value:z},C.createElement("div",{ref:F,"data-gds-part":"carousel",className:l("relative",i),style:{"--gds-carousel-slide-basis":pe,...p},onMouseEnter:Y,onMouseLeave:J,...c},C.createElement("div",{ref:g,"data-gds-part":"carousel-viewport",className:"overflow-hidden",style:{borderRadius:"var(--gds-carousel-radius, var(--gds-media-radius, 0.5rem))"}},C.createElement("div",{"data-gds-part":"carousel-track",className:"flex",style:{gap:"var(--gds-carousel-gap, 0)",touchAction:"pan-y pinch-zoom"}},s))))});ro.displayName="Carousel";var ra=C.forwardRef(({duration:e,className:t,style:o,children:r,...n},a)=>{let{durationsRef:i}=wr("Carousel.Slide"),p=C.useRef(null);return C.useImperativeHandle(a,()=>p.current),C.useEffect(()=>{if(e==null)return;let s=p.current;if(!s?.parentElement)return;let c=Array.from(s.parentElement.children).indexOf(s);if(c<0)return;let d=i.current;return d.set(c,e),()=>{d.delete(c);}},[e,i]),C.createElement("div",{ref:p,"data-gds-part":"carousel-slide",className:l("min-w-0 shrink-0 grow-0",t),style:{flexBasis:"var(--gds-carousel-slide-basis, 100%)",...o},...n},r)});ra.displayName="Carousel.Slide";var an=C.forwardRef(({src:e,poster:t,alt:o,controls:r=false,loop:n=true,fit:a="cover",duration:i,className:p,style:s,...c},d)=>{let{api:m,selectedIndex:g,advanceFromSlide:u}=wr("Carousel.VideoSlide"),b=C.useRef(null),f=C.useRef(null);C.useImperativeHandle(d,()=>b.current);let[h,v]=C.useState(null);C.useEffect(()=>{let y=b.current;y?.parentElement&&v(Array.from(y.parentElement.children).indexOf(y));},[m]);let w=h!=null&&h===g;return C.useEffect(()=>{let y=f.current;if(y)if(w){let S=y.play();S&&typeof S.catch=="function"&&S.catch(()=>{});}else y.pause(),y.currentTime=0;},[w]),C.createElement(ra,{ref:b,duration:i,className:l("relative overflow-hidden bg-[var(--gds-media-placeholder-bg)]",p),style:s,"data-gds-part":"carousel-video-slide",...c},t&&C.createElement("img",{src:t,alt:o??"","aria-hidden":w,className:"absolute inset-0 h-full w-full",style:{objectFit:a,opacity:w?0:1,transition:"opacity var(--gds-carousel-fade-ms, 200ms) ease-out"}}),C.createElement("video",{ref:f,src:e,muted:true,playsInline:true,loop:n,controls:r,preload:"metadata","aria-label":o,className:"block h-full w-full",style:{objectFit:a,opacity:w?1:0,transition:"opacity var(--gds-carousel-fade-ms, 200ms) ease-out"},onEnded:()=>{n||h!=null&&u(h);}}))});an.displayName="Carousel.VideoSlide";var nn=C.forwardRef(({position:e="below",renderDot:t,className:o,style:r,...n},a)=>{let{api:i,selectedIndex:p,slideCount:s}=wr("Carousel.Dots");if(s<=1)return null;let c=Array.from({length:s},(m,g)=>g),d=e==="overlay"?{position:"absolute",insetInlineStart:0,insetInlineEnd:0,bottom:"var(--gds-carousel-dots-inset, 0.75rem)",zIndex:1}:{marginBlockStart:"var(--gds-carousel-dots-gap, 0.75rem)"};return C.createElement("div",{ref:a,"data-gds-part":"carousel-dots",className:l("flex items-center justify-center",o),style:{gap:"var(--gds-carousel-dots-spacing, 0.5rem)",...d,...r},...n},c.map(m=>{let g=m===p,u=()=>i?.scrollTo(m);return t?t({index:m,active:g,onClick:u}):C.createElement("button",{key:m,type:"button",onClick:u,"aria-label":`Go to slide ${m+1}`,"aria-current":g?"true":void 0,"data-active":g||void 0,className:"rounded-full transition-all",style:{width:g?"var(--gds-carousel-dot-active-width, 1.25rem)":"var(--gds-carousel-dot-size, 0.5rem)",height:"var(--gds-carousel-dot-size, 0.5rem)",background:g?"var(--gds-carousel-dot-active-color, oklch(var(--primary)))":"var(--gds-carousel-dot-color, oklch(var(--muted-foreground) / 0.4))"}})}))});nn.displayName="Carousel.Dots";var sn=C.forwardRef(({position:e="overlay",className:t,style:o,...r},n)=>e==="outside"?C.createElement("div",{ref:n,"data-gds-part":"carousel-arrows",className:l("flex items-center justify-end gap-2 pt-2",t),style:o,...r},C.createElement(yr,null),C.createElement(xr,null)):C.createElement("div",{ref:n,"data-gds-part":"carousel-arrows",className:l("pointer-events-none absolute inset-0 z-[1]",t),style:o,...r},C.createElement(yr,{className:"pointer-events-auto absolute left-[var(--gds-carousel-arrow-inset,0.75rem)] top-1/2 -translate-y-1/2"}),C.createElement(xr,{className:"pointer-events-auto absolute right-[var(--gds-carousel-arrow-inset,0.75rem)] top-1/2 -translate-y-1/2"})));sn.displayName="Carousel.Arrows";var yr=C.forwardRef(({className:e,style:t,children:o,...r},n)=>{let{api:a,canScrollPrev:i}=wr("Carousel.Prev");return C.createElement("button",{ref:n,type:"button","data-gds-part":"carousel-prev","aria-label":"Previous slide",disabled:!i,onClick:()=>a?.scrollPrev(),className:l("inline-flex items-center justify-center rounded-full","transition disabled:opacity-40 disabled:cursor-not-allowed","hover:[background:var(--gds-carousel-arrow-hover-bg,oklch(var(--background)))]",e),style:{width:"var(--gds-carousel-arrow-size, 2.25rem)",height:"var(--gds-carousel-arrow-size, 2.25rem)",background:"var(--gds-carousel-arrow-bg, oklch(var(--background) / 0.85))",color:"var(--gds-carousel-arrow-fg, oklch(var(--foreground)))",backdropFilter:"var(--gds-carousel-arrow-backdrop, blur(6px))",boxShadow:"var(--gds-carousel-arrow-shadow, 0 2px 8px oklch(0 0 0 / 0.12))",...t},...r},o??C.createElement(ChevronLeft,{className:"h-4 w-4","aria-hidden":true}))});yr.displayName="Carousel.Prev";var xr=C.forwardRef(({className:e,style:t,children:o,...r},n)=>{let{api:a,canScrollNext:i}=wr("Carousel.Next");return C.createElement("button",{ref:n,type:"button","data-gds-part":"carousel-next","aria-label":"Next slide",disabled:!i,onClick:()=>a?.scrollNext(),className:l("inline-flex items-center justify-center rounded-full","transition disabled:opacity-40 disabled:cursor-not-allowed","hover:[background:var(--gds-carousel-arrow-hover-bg,oklch(var(--background)))]",e),style:{width:"var(--gds-carousel-arrow-size, 2.25rem)",height:"var(--gds-carousel-arrow-size, 2.25rem)",background:"var(--gds-carousel-arrow-bg, oklch(var(--background) / 0.85))",color:"var(--gds-carousel-arrow-fg, oklch(var(--foreground)))",backdropFilter:"var(--gds-carousel-arrow-backdrop, blur(6px))",boxShadow:"var(--gds-carousel-arrow-shadow, 0 2px 8px oklch(0 0 0 / 0.12))",...t},...r},o??C.createElement(ChevronRight,{className:"h-4 w-4","aria-hidden":true}))});xr.displayName="Carousel.Next";ro.Slide=ra;ro.VideoSlide=an;ro.Dots=nn;ro.Arrows=sn;ro.Prev=yr;ro.Next=xr;var Jp=ro;function Qp(){return C.useContext(rn)?.api}var al=C.forwardRef(({className:e,surface:t="solid",...o},r)=>C.createElement("div",{ref:r,"data-gds-part":"card","data-surface":t,className:l("gds-card rounded-xl border text-card-foreground shadow",St(t,"bg-card"),it[t],e),...o}));al.displayName="Card";var nl=C.forwardRef(({className:e,...t},o)=>C.createElement("div",{ref:o,"data-gds-part":"card-header",className:l("flex flex-col space-y-1.5 p-6",e),...t}));nl.displayName="CardHeader";var il=C.forwardRef(({className:e,...t},o)=>C.createElement("div",{ref:o,"data-gds-part":"card-title",className:l("font-semibold leading-none tracking-tight",e),...t}));il.displayName="CardTitle";var sl=C.forwardRef(({className:e,...t},o)=>C.createElement("div",{ref:o,"data-gds-part":"card-description",className:l("text-sm text-muted-foreground",e),...t}));sl.displayName="CardDescription";var ll=C.forwardRef(({className:e,...t},o)=>C.createElement("div",{ref:o,"data-gds-part":"card-content",className:l("p-6 pt-0",e),...t}));ll.displayName="CardContent";var dl=C.forwardRef(({className:e,...t},o)=>C.createElement("div",{ref:o,"data-gds-part":"card-footer",className:l("flex items-center p-6 pt-0",e),...t}));dl.displayName="CardFooter";var cl=C.forwardRef(({className:e,...t},o)=>C.createElement(Rr.Root,{ref:o,className:l("gds-checkbox peer h-4 w-4 shrink-0 rounded-[3px] border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t},C.createElement(Rr.Indicator,{className:l("flex items-center justify-center text-current")},C.createElement(Check,{className:"h-4 w-4"}))));cl.displayName=Rr.Root.displayName;var ln=C.createContext(null),aa=C.forwardRef(({className:e,...t},o)=>{let r=C.useContext(ln);return C.createElement("label",{ref:o,htmlFor:r?.controlId,className:l("text-sm font-medium leading-none text-foreground cursor-pointer peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t})});aa.displayName="Field.Label";var na=C.forwardRef(({className:e,...t},o)=>{let r=C.useContext(ln);return C.createElement("p",{ref:o,id:r?.descriptionId,className:l("text-sm text-muted-foreground",e),...t})});na.displayName="Field.Description";var ia=C.forwardRef(({className:e,...t},o)=>C.createElement("div",{ref:o,className:l("flex shrink-0 items-center gap-2",e),...t}));ia.displayName="Field.Trailing";var pl=C.forwardRef(({layout:e="option",className:t,children:o,...r},n)=>{let a=C.useId(),i=null,p=null,s=null,c=null;C.Children.forEach(o,v=>{C.isValidElement(v)&&(v.type===aa?i=v:v.type===na?p=v:v.type===ia?s=v:c||(c=v));});let d=c,m=d?.props??{},g=m.id??`${a}-control`,u=p?`${a}-description`:void 0,b=[m["aria-describedby"],u].filter(Boolean).join(" ")||void 0,f=d?C.cloneElement(d,{id:g,"aria-describedby":b}):null,h=C.createElement("div",{className:"flex min-w-0 flex-col gap-0.5"},i,p);return C.createElement(ln.Provider,{value:{controlId:g,descriptionId:u}},C.createElement("div",{ref:n,"data-gds-part":"field","data-layout":e,className:l("flex gap-3",e==="setting"?"items-center justify-between":"items-start",t),...r},e==="setting"?C.createElement(C.Fragment,null,h,C.createElement("div",{className:"flex shrink-0 items-center gap-2"},s,f)):C.createElement(C.Fragment,null,C.createElement("div",{className:"mt-0.5 shrink-0"},f),C.createElement("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5"},i,p),s)))});pl.displayName="Field";var tm=Object.assign(pl,{Label:aa,Description:na,Trailing:ia});function dn({label:e,description:t,aside:o,hideIndicator:r,indicatorPosition:n="trailing",titleId:a,descriptionId:i,indicator:p,children:s}){let c=s!=null?C.createElement("div",{className:"gds-selection-card__slot"},s):C.createElement("div",{className:"gds-selection-card__content"},e!=null&&C.createElement("span",{id:a,className:"gds-selection-card__title"},e),t!=null&&C.createElement("span",{id:i,className:"gds-selection-card__desc"},t)),d=r?null:p;return n==="leading"?C.createElement(C.Fragment,null,d,c,o):C.createElement(C.Fragment,null,c,o,d)}var rm=C.createElement("span",{className:"gds-selection-indicator gds-selection-indicator--radio","aria-hidden":true},C.createElement(lo.Indicator,{className:"gds-selection-indicator__dot"})),am=C.createElement("span",{className:"gds-selection-indicator gds-selection-indicator--checkbox","aria-hidden":true},C.createElement(Rr.Indicator,{className:"gds-selection-indicator__check"},C.createElement(Check,{className:"h-3.5 w-3.5",strokeWidth:3}))),nm=C.createElement("span",{className:"gds-selection-indicator gds-selection-indicator--switch","aria-hidden":true},C.createElement(Ir.Thumb,{className:"gds-selection-indicator__thumb"})),ml=C.forwardRef(({className:e,label:t,description:o,aside:r,hideIndicator:n,indicatorPosition:a="trailing",children:i,...p},s)=>{let c=C.useId(),d=t!=null?`${c}-t`:void 0,m=o!=null?`${c}-d`:void 0;return C.createElement(lo.Item,{ref:s,"data-gds-part":"radio-card","data-indicator":a,"aria-labelledby":d,"aria-describedby":m,className:l("gds-selection-card",e),...p},C.createElement(dn,{label:t,description:o,aside:r,hideIndicator:n,indicatorPosition:a,titleId:d,descriptionId:m,indicator:rm},i))});ml.displayName="RadioCard";var ul=C.forwardRef(({className:e,label:t,description:o,aside:r,hideIndicator:n,indicatorPosition:a="trailing",children:i,...p},s)=>{let c=C.useId(),d=t!=null?`${c}-t`:void 0,m=o!=null?`${c}-d`:void 0;return C.createElement(Rr.Root,{ref:s,"data-gds-part":"checkbox-card","data-indicator":a,"aria-labelledby":d,"aria-describedby":m,className:l("gds-selection-card",e),...p},C.createElement(dn,{label:t,description:o,aside:r,hideIndicator:n,indicatorPosition:a,titleId:d,descriptionId:m,indicator:am},i))});ul.displayName="CheckboxCard";var gl=C.forwardRef(({className:e,label:t,description:o,aside:r,hideIndicator:n,indicatorPosition:a="trailing",children:i,...p},s)=>{let c=C.useId(),d=t!=null?`${c}-t`:void 0,m=o!=null?`${c}-d`:void 0;return C.createElement(Ir.Root,{ref:s,"data-gds-part":"switch-card","data-indicator":a,"aria-labelledby":d,"aria-describedby":m,className:l("gds-selection-card",e),...p},C.createElement(dn,{label:t,description:o,aside:r,hideIndicator:n,indicatorPosition:a,titleId:d,descriptionId:m,indicator:nm},i))});gl.displayName="SwitchCard";var qo={slow:{tokenStagger:70,lineStagger:200,preDelay:500,fadeMs:480},normal:{tokenStagger:22,lineStagger:55,preDelay:200,fadeMs:280},fast:{tokenStagger:8,lineStagger:18,preDelay:60,fadeMs:160}},ca=.55;function fe(e,t){return e<=0?Promise.resolve():new Promise((o,r)=>{if(t?.aborted){r(new DOMException("Aborted","AbortError"));return}let n=window.setTimeout(()=>{t?.removeEventListener("abort",a),o();},e),a=()=>{window.clearTimeout(n),r(new DOMException("Aborted","AbortError"));};t?.addEventListener("abort",a,{once:true});})}async function pa(e,t,o=22,r){if(o<=0){t(e);return}for(let n=1;n<=e.length;n++)t(e.slice(0,n)),n<e.length&&await fe(o,r);}function cn(e){return e instanceof DOMException&&e.name==="AbortError"}var Sr="data-motion",fl="off",hl="(prefers-reduced-motion: reduce)";function im(){if(typeof window>"u"||typeof document>"u")return false;let e=window.matchMedia(hl).matches,t=document.documentElement.getAttribute(Sr)===fl;return e||t}function Zo(){let[e,t]=C.useState(false);return C.useEffect(()=>{let o=()=>t(im());o();let r=window.matchMedia(hl);r.addEventListener("change",o);let n=new MutationObserver(o);return n.observe(document.documentElement,{attributes:true,attributeFilter:[Sr]}),()=>{r.removeEventListener("change",o),n.disconnect();}},[]),e}var ao=Zo;function kr(){let[e,t]=C.useState(true);return C.useEffect(()=>{let o=window.self!==window.top,r=()=>document.visibilityState!=="hidden"&&(o||document.hasFocus()),n=()=>t(r());return n(),document.addEventListener("visibilitychange",n),window.addEventListener("focus",n),window.addEventListener("blur",n),window.addEventListener("pageshow",n),()=>{document.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n),window.removeEventListener("blur",n),window.removeEventListener("pageshow",n);}},[]),e}function sm(e){if(typeof document>"u")return;let t=document.documentElement;e?t.removeAttribute(Sr):t.setAttribute(Sr,fl);}var lm=2e3,dm={tokenStagger:0,lineStagger:0,preDelay:0,fadeMs:0};function no(e){let{steps:t,interpret:o,speed:r="normal",trigger:n="mount",play:a,loop:i=false,loopDelay:p=lm,maxLoops:s=1/0,containerRef:c,onComplete:d,onLoopReset:m}=e,g=Zo(),u=g?dm:qo[r],b=g?false:i,f=kr(),[h,v]=C.useState(false),[w,y]=C.useState(false),[S,k]=C.useState(-1),H=C.useRef(null),E=useInView(c??H,{once:true,amount:ca}),D=useInView(c??H,{amount:ca}),U=f&&(c?D:true),[A,q]=C.useState(0),F=C.useMemo(()=>n==="mount"?true:n==="inView"?E:!!a||A>0,[n,E,a,A]),Y=C.useRef(o);Y.current=o;let J=C.useRef(d);J.current=d;let z=C.useRef(m);z.current=m;let pe=C.useRef(null),x=C.useRef(null),I=C.useCallback(()=>{pe.current?.abort(),pe.current=null,x.current!==null&&(window.clearTimeout(x.current),x.current=null),v(false);},[]),P=C.useCallback(()=>{q(se=>se+1);},[]),te=C.useCallback((se=0)=>{if(pe.current?.abort(),pe.current=null,x.current!==null&&(window.clearTimeout(x.current),x.current=null),se>0){x.current=window.setTimeout(()=>{x.current=null,q(ne=>ne+1);},se);return}q(ne=>ne+1);},[]);return C.useEffect(()=>()=>{x.current!==null&&(window.clearTimeout(x.current),x.current=null);},[]),C.useEffect(()=>{if(!t||t.length===0||!g&&(!F||!U))return;let se=new AbortController;pe.current=se;let{signal:ne}=se,Le={speed:u,signal:ne,cancelled:()=>ne.aborted,reduced:g},me=true,L=0;return (async()=>{do{v(true),y(false),k(-1);try{await fe(n==="inView"?u.preDelay:0,ne);for(let Z=0;Z<t.length;Z++){if(ne.aborted)return;k(Z),await Y.current(t[Z],Le);}if(ne.aborted)return;if(k(-1),y(!0),J.current?.(),L+=1,!b||L>=s){v(!1);return}if(await fe(p,ne),ne.aborted)return;z.current?.();}catch(Z){if(cn(Z))return;process.env.NODE_ENV!=="production"&&console.error("[useScriptedDemo] step error:",Z),v(false);return}}while(me&&b&&!ne.aborted)})(),()=>{me=false,se.abort(),pe.current===se&&(pe.current=null);}},[t,F,U,b,p,u,n,A,g]),{isPlaying:h,isComplete:w,currentIndex:S,play:P,stop:I,restart:te}}var ua=C.forwardRef(function({variant:t="inline",className:o,...r},n){return C.createElement("span",{ref:n,"data-gds-part":"demo-cursor","data-gds-variant":t,"aria-hidden":true,className:l("gds-demo-cursor",o),...r})});var vl=C.createContext({visible:new Set,hasStage:false,reducedMotion:false,defaultAnimation:"fade-up"});function yl({steps:e,speed:t="normal",trigger:o="mount",play:r,loop:n=false,defaultAnimation:a="fade-up",visibleWhenIdle:i=true,className:p,children:s}){let c=useReducedMotion()??false,d=C.useRef(null),[m,g]=C.useState(()=>new Set),u=!!(e&&e.length);no({steps:u?e:void 0,speed:t,trigger:o,play:r,loop:n,containerRef:d,onLoopReset:()=>g(new Set),interpret:async(h,v)=>{if(h.type==="wait")return fe(h.ms,v.signal);if(h.type==="reset")return g(new Set),fe(v.speed.preDelay,v.signal);if(h.type==="reveal")return g(w=>{if(w.has(h.target))return w;let y=new Set(w);return y.add(h.target),y}),fe(v.speed.lineStagger,v.signal);if(h.type==="reveal-all")return g(w=>{let y=new Set(w);return y.add("__all__"),y}),fe(v.speed.lineStagger,v.signal);if(h.type==="hide")return g(w=>{if(!w.has(h.target))return w;let y=new Set(w);return y.delete(h.target),y}),fe(v.speed.fadeMs,v.signal)}});let b=C.useMemo(()=>({visible:u?m:new Set(["__all__"]),hasStage:true,reducedMotion:c,defaultAnimation:a}),[u,m,c,a]),f=!u&&!i?{...b,visible:new Set}:b;return C.createElement("div",{ref:d,"data-gds-part":"demo-stage","data-gds-stage-playing":u?"true":"false",className:p},C.createElement(vl.Provider,{value:f},s))}var mm={fade:{initial:{opacity:0},animate:{opacity:1}},"fade-up":{initial:{opacity:0,y:12},animate:{opacity:1,y:0}},"fade-down":{initial:{opacity:0,y:-12},animate:{opacity:1,y:0}},"fade-left":{initial:{opacity:0,x:12},animate:{opacity:1,x:0}},"fade-right":{initial:{opacity:0,x:-12},animate:{opacity:1,x:0}},scale:{initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1}},none:{initial:{opacity:1},animate:{opacity:1}}};function xl({id:e,animation:t,durationMs:o,hideOutsideStage:r=false,onReveal:n,onHide:a,className:i,children:p}){let s=C.useContext(vl),c=s.hasStage?s.visible.has("__all__")||s.visible.has(e):!r,d=C.useRef(c),m=C.useRef(n),g=C.useRef(a);m.current=n,g.current=a,C.useEffect(()=>{c!==d.current&&(d.current=c,c?m.current?.():g.current?.());},[c]);let u=t??s.defaultAnimation,b=mm[u],f=(o??280)/1e3;return s.reducedMotion?C.createElement("div",{"data-gds-part":"reveal","data-gds-reveal-id":e,"data-gds-revealed":c?"true":"false",className:i,style:{opacity:c?1:0}},p):C.createElement(motion.div,{"data-gds-part":"reveal","data-gds-reveal-id":e,"data-gds-revealed":c?"true":"false",className:i,initial:b.initial,animate:c?b.animate:b.initial,transition:{duration:f,ease:[.22,1,.36,1]}},p)}var fm={xs:"text-xs",sm:"text-sm",md:"text-base"},hm={slow:{lineStagger:200,tokenStagger:70,preDelay:500,fadeMs:480},normal:{lineStagger:55,tokenStagger:22,preDelay:200,fadeMs:280},fast:{lineStagger:18,tokenStagger:8,preDelay:60,fadeMs:160}},bm={plain:{color:"var(--gds-code-fg)",backgroundColor:"transparent"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"var(--gds-code-comment)",fontStyle:"normal"}},{types:["punctuation"],style:{color:"var(--gds-code-punctuation)"}},{types:["property","constant","symbol","deleted"],style:{color:"var(--gds-code-property)"}},{types:["boolean","number"],style:{color:"var(--gds-code-number)"}},{types:["selector","attr-name","string","char","builtin","inserted"],style:{color:"var(--gds-code-string)"}},{types:["operator","entity","url"],style:{color:"var(--gds-code-operator)"}},{types:["atrule","keyword"],style:{color:"var(--gds-code-keyword)"}},{types:["function","class-name"],style:{color:"var(--gds-code-function)"}},{types:["regex","important","variable"],style:{color:"var(--gds-code-variable)"}},{types:["tag"],style:{color:"var(--gds-code-tag)"}},{types:["attr-name"],style:{color:"var(--gds-code-attr-name)"}},{types:["attr-value"],style:{color:"var(--gds-code-attr-value)"}}]};function vm(e){let t=new Set;if(e==null)return t;let o=Array.isArray(e)?e:[e];for(let r of o)if(typeof r=="number")t.add(r);else if(Array.isArray(r)&&r.length===2){let[n,a]=r;for(let i=n;i<=a;i++)t.add(i);}return t}function ym(e,t,o){return t?.added?.includes(e)?"added":t?.removed?.includes(e)?"removed":o.has(e)?"highlight":"default"}var Rl=C.forwardRef(function({source:t,language:o="tsx",highlight:r,diff:n,reveal:a="none",trigger:i="mount",play:p,speed:s="normal",delay:c,stagger:d,showLineNumbers:m=false,filename:g,wrap:u=false,bare:b=false,prompt:f,cursor:h,steps:v,loop:w=false,size:y="sm",height:S,maxLines:k,className:H,style:E,...D},U){let A=hm[s],q=c??0,F=d??(a==="typewriter"?A.tokenStagger:A.lineStagger),Y=!!(v&&v.length),[J,z]=C.useState(""),[pe,x]=C.useState(()=>new Set),I=Y?J:t??"",P=C.useMemo(()=>I.replace(/\n$/,""),[I]),te=C.useMemo(()=>vm(r),[r]),se=!!(n?.added?.length||n?.removed?.length),ne=m||se,B=C.useRef(null);C.useImperativeHandle(U,()=>B.current);let[Le,me]=C.useState(a==="none"),L=useInView(B,{once:true,amount:.55}),de=i==="inView"?A.preDelay:0,Z=i==="mount"?true:i==="inView"?L:!!p,$e=F,le=P.split(`
108
+ `).length,De=a==="typewriter"?P.replace(/\s+/g," ").split(" ").length:le,rt=de+q+De*$e+280;C.useEffect(()=>{if(Y)return;if(!Z||a==="none"){me(a==="none");return}me(false);let oe=window.setTimeout(()=>me(true),rt);return ()=>window.clearTimeout(oe)},[Z,a,rt,Y]);let Ke=C.useRef(""),at=C.useRef(new Set),Xt=C.useCallback(oe=>{Ke.current=oe,z(oe);},[]),Bo=C.useCallback(oe=>{at.current=oe,x(oe);},[]),{isComplete:bo}=no({steps:Y?v:void 0,speed:s,trigger:"manual",play:Z,loop:w,containerRef:B,onLoopReset:()=>{Xt(""),Bo(new Set),me(false);},interpret:async(oe,Nt)=>{let Mt=Nt.signal;if(oe.type==="wait")return fe(oe.ms,Mt);if(oe.type==="clear"){Xt(""),Bo(new Set);return}if(oe.type==="output"){let Ge=Ke.current,yt=Ge.length>0&&!Ge.endsWith(`
109
+ `)?Ge+`
110
+ `:Ge,lr=yt+oe.text,dr=yt.split(`
111
+ `).length,Ya=oe.text.split(`
112
+ `).length,cr=new Set(at.current);for(let _o=0;_o<Ya;_o++)cr.add(dr+_o);return Xt(lr),Bo(cr),Xt(lr+(lr.endsWith(`
113
113
  `)?"":`
114
- `)),re(240,Bt)}let Ao=ge.speed?ko[ge.speed].tokenStagger:br.speed.tokenStagger,dt=ie.current,Ho=dt.length>0&&!dt.endsWith(`
115
- `)?dt+`
116
- `:dt;await re(60,Bt);for(let Oe=0;Oe<ge.text.length;Oe++){if(Bt.aborted)return;let ct=Ho+ge.text.slice(0,Oe+1);to(ct),Oe<ge.text.length-1&&await re(Ao,Bt);}}});S.useEffect(()=>{N&&Be(gn);},[N,gn]);let Ad=f??(a==="typewriter"||N);return S.createElement("div",{ref:ne,"data-gds-part":"code","data-gds-reveal":a,"data-gds-trigger":l,"data-gds-size":x,className:s("gds-code relative w-full overflow-hidden",_c[x],!b&&["rounded-lg border bg-[var(--gds-code-bg)] text-[var(--gds-code-fg)]","border-border/60"],O),style:D,...E},g&&!b?S.createElement("div",{"data-gds-part":"code-header",className:"flex items-center justify-between border-b border-border/60 px-4 py-2 text-xs text-muted-foreground"},S.createElement("span",{className:"font-mono"},g),o?S.createElement("span",{className:"uppercase tracking-wider opacity-60"},o):null):null,S.createElement(Highlight,{code:I,language:o,theme:Wc},({tokens:ge,getLineProps:br,getTokenProps:Bt})=>S.createElement("pre",{"data-gds-part":"code-pre",className:s("font-mono leading-relaxed",b?"p-0":"px-0 py-3",u?"whitespace-pre-wrap break-words":"overflow-x-auto whitespace-pre",(k!==void 0||T!==void 0)&&"overflow-y-auto"),style:{background:"transparent",margin:0,...T!==void 0?{height:`calc(${T} * 1lh + 0.5rem)`}:k!==void 0&&k!=="auto"?{height:typeof k=="number"?`${k}px`:k}:null}},ge.map((Ao,dt)=>{let Ho=dt+1,Oe=jc(Ho,n,le),ct=br({line:Ao}),Io=dt===ge.length-1,Fo=N&&Y.has(Ho),da=Ad&&Io&&(!be||f===true),Bo=s("flex w-full pr-4",b?"pl-0":"pl-4",Oe==="added"&&"bg-[var(--gds-code-diff-added-bg)] text-[var(--gds-code-diff-added-fg)]",Oe==="removed"&&"bg-[var(--gds-code-diff-removed-bg)] text-[var(--gds-code-diff-removed-fg)]",Oe==="highlight"&&"bg-[var(--gds-code-line-highlight-bg)] shadow-[inset_2px_0_0_0_var(--gds-code-line-highlight-marker)]"),fo=S.createElement(S.Fragment,null,he?S.createElement("span",{"data-gds-part":"code-gutter",className:s("select-none pr-3 text-right font-mono text-xs leading-relaxed opacity-60",J?"w-10":"w-8"),"aria-hidden":true},J?S.createElement("span",{className:"inline-block w-3 text-center"},Oe==="added"?"+":Oe==="removed"?"-":" "):null,m?S.createElement("span",{className:"ml-1 tabular-nums"},Ho):null):null,S.createElement("span",{className:"flex-1",style:Fo?{color:"var(--gds-code-comment)"}:void 0},h&&!Fo?S.createElement("span",{"data-gds-part":"code-prompt","aria-hidden":true,className:"select-none opacity-60",style:{color:"var(--gds-code-comment)"}},h):null,a==="typewriter"&&Q&&!N?S.createElement($c,{line:Ao,getTokenProps:Bt,delay:ce+F+dt*Ge,stagger:Ge}):Ao.map((Hd,Id)=>S.createElement("span",{key:Id,...Bt({token:Hd})})),da&&!Fo?S.createElement(Dr,{"data-gds-part":"code-cursor"}):null));return a==="none"||a==="typewriter"||N||!Q?S.createElement("div",{key:dt,...ct,className:s(ct.className,Bo),style:{...ct.style,opacity:l!=="mount"&&!Q&&a!=="none"?0:void 0}},fo):S.createElement(motion.div,{key:dt,...ct,className:s(ct.className,Bo),initial:{opacity:0,y:a==="diff"?Oe==="removed"?-4:6:4},animate:{opacity:1,y:0},transition:{delay:(ce+F+dt*Ge)/1e3,duration:H.fadeMs/1e3,ease:[.22,1,.36,1]},style:ct.style},fo)}))))});ds.displayName="Code";function $c({line:e,getTokenProps:t,delay:o,stagger:r}){let n=0;return S.createElement(S.Fragment,null,e.map((a,l)=>{let p=/^\s*$/.test(a.content),i=t({token:a});if(p)return S.createElement("span",{key:l,...i});let c=n++;return S.createElement(motion.span,{key:l,...i,initial:{opacity:0},animate:{opacity:1},transition:{delay:(o+c*r)/1e3,duration:.12}})}))}var Kc=S.forwardRef(function({author:t,timestamp:o,avatar:r,badge:n,edited:a,pinned:l,actions:p,reactions:i,threadCount:c,onThreadClick:d,align:m="start",className:g,children:u,...b},h){let f=m==="end",y=a===true?"(edited)":a||void 0;return S.createElement("div",{ref:h,"data-gds-part":"message","data-gds-align":m,"data-gds-pinned":l?"true":void 0,className:s("flex items-start gap-3",f&&"flex-row-reverse",g),...b},r&&S.createElement("div",{"data-gds-part":"message-avatar",className:"flex-shrink-0"},r),S.createElement("div",{"data-gds-part":"message-content",className:s("flex-1 min-w-0 space-y-1",f&&"text-right")},l&&S.createElement("div",{"data-gds-part":"message-pinned",className:s("flex items-center gap-1 text-[10px] uppercase tracking-wider text-muted-foreground",f&&"flex-row-reverse")},S.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3",fill:"currentColor"},S.createElement("path",{d:"M9.828.722a.5.5 0 0 1 .707 0l4.743 4.743a.5.5 0 0 1 0 .707l-2.121 2.121a.5.5 0 0 1-.354.146h-1.792l-3.586 3.586v2.293a.5.5 0 0 1-.854.354L4.146 12.39 1 15.535V14.12l3.146-3.146-1.293-1.293a.5.5 0 0 1 .354-.854h2.293l3.586-3.586V3.45a.5.5 0 0 1 .146-.354L9.828.722Z"})),"Pinned"),S.createElement("div",{"data-gds-part":"message-header",className:s("flex items-baseline gap-2 flex-wrap",f&&"flex-row-reverse")},S.createElement("span",{"data-gds-part":"message-author",className:"text-sm font-semibold"},t),n&&S.createElement("div",{"data-gds-part":"message-badge"},n),o&&S.createElement("span",{"data-gds-part":"message-timestamp",className:"text-xs text-muted-foreground"},o),y&&S.createElement("span",{"data-gds-part":"message-edited",className:"text-xs text-muted-foreground"},y),p&&S.createElement("div",{"data-gds-part":"message-actions",className:s(f?"mr-auto":"ml-auto")},p)),S.createElement("div",{"data-gds-part":"message-body",className:"text-sm leading-relaxed"},u),i&&S.createElement("div",{"data-gds-part":"message-reactions",className:s("flex flex-wrap gap-1 pt-1",f&&"justify-end")},i),typeof c=="number"&&c>0&&S.createElement("button",{type:"button","data-gds-part":"message-thread",onClick:d,className:s("inline-flex items-center gap-1 text-xs font-medium","text-primary hover:underline","focus:outline-none focus-visible:ring-2 focus-visible:ring-primary rounded",f&&"flex-row-reverse")},S.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3",fill:"currentColor"},S.createElement("path",{d:"M2 3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H6.414l-2.707 2.707A1 1 0 0 1 2 12V3Z"})),c," ",c===1?"reply":"replies")))});function zp({onSubmit:e,enabled:t}){let[o]=useLexicalComposerContext();return S.useEffect(()=>{if(t)return o.registerCommand(KEY_ENTER_COMMAND,r=>r&&r.shiftKey?false:(r?.preventDefault(),e(),true),COMMAND_PRIORITY_HIGH)},[o,t,e]),null}function Op({onImageFiles:e,enabled:t}){let[o]=useLexicalComposerContext();return S.useEffect(()=>{if(!t)return;let r=o.getRootElement();if(!r)return;let n=a=>{let p=Array.from(a.clipboardData?.items??[]).filter(i=>i.kind==="file"&&i.type.startsWith("image/")).map(i=>i.getAsFile()).filter(i=>i!==null);p.length>0&&(a.preventDefault(),e(p));};return r.addEventListener("paste",n),()=>r.removeEventListener("paste",n)},[o,t,e]),null}function Vp({enabled:e}){let[t]=useLexicalComposerContext();return S.useEffect(()=>{e&&t.focus();},[t,e]),null}var ps={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikethrough",code:"code"};function ms(e,t){let o=ps[t];if(o){e.dispatchCommand(FORMAT_TEXT_COMMAND,o);return}if(t==="ul"){e.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND,void 0);return}if(t==="ol"){e.dispatchCommand(INSERT_ORDERED_LIST_COMMAND,void 0);return}e.update(()=>{let r=$getSelection();if($isRangeSelection(r)){if(t==="h1"||t==="h2"||t==="h3"){let n=t;$setBlocksType(r,()=>$createHeadingNode(n));return}(t==="blockquote"||t==="pullquote")&&$setBlocksType(r,()=>{let n=$createQuoteNode();return t==="pullquote"&&(n.__pullquote=true),n});}});}function _p(e,t,o,r){e.update(()=>{let n=$getSelection();if(!$isRangeSelection(n))return;let a=$createBeautifulMentionNode(t,o,r);n.insertNodes([a]),n.insertText(" ");});}function Gp(e,t){let o=false;return e.update(()=>{let r=$getRoot(),a=r.getTextContent().indexOf(t);if(a===-1)return;let l=0,p=null,i=0,c=null,d=0,m=g=>{if(!(p&&c)){if(g.getType()==="text"){let u=g,b=u.getTextContentSize(),h=l,f=l+b;!p&&a>=h&&a<f&&(p=u,i=a-h);let y=a+t.length;!c&&y>h&&y<=f&&(c=u,d=y-h),l=f;return}if("getChildren"in g)for(let u of g.getChildren())m(u);else l+=g.getTextContentSize();}};if(m(r),p&&c){let g=p,u=c;g.select(i,0).focus.set(u.getKey(),d,"text"),o=true;}}),o}function Zo(e){e.update(()=>{let t=$getRoot();t.clear();let o=$createParagraphNode();t.append(o),o.select();});}function us(e){let t="",o="",r=[];return e.getEditorState().read(()=>{t=$getRoot().getTextContent(),o=JSON.stringify(e.getEditorState().toJSON());let n=a=>{if(a.getType()==="beautifulMention"){let l=a;r.push({trigger:l.getTrigger(),value:l.getValue(),data:l.getData()});}if("getChildren"in a)for(let l of a.getChildren())n(l);};n($getRoot());}),{text:t,json:o,mentions:r}}var Wp=[{format:"bold",icon:Bold,label:"Bold"},{format:"italic",icon:Italic,label:"Italic"},{format:"underline",icon:Underline,label:"Underline"},{format:"strikethrough",icon:Strikethrough,label:"Strikethrough"},{format:"code",icon:Code,label:"Inline code"},{format:"h1",icon:Heading1,label:"Heading 1"},{format:"h2",icon:Heading2,label:"Heading 2"},{format:"h3",icon:Heading3,label:"Heading 3"},{format:"blockquote",icon:Quote,label:"Blockquote"},{format:"ul",icon:List,label:"Bulleted list"},{format:"ol",icon:ListOrdered,label:"Numbered list"}];function Up({formats:e}){let[t]=useLexicalComposerContext(),[o,r]=S.useState(()=>new Set);S.useEffect(()=>mergeRegister(t.registerUpdateListener(({editorState:a})=>{a.read(()=>{let l=$getSelection();if(!$isRangeSelection(l))return;let p=new Set;for(let i of ["bold","italic","underline","strikethrough","code"])l.hasFormat(i)&&p.add(i);r(p);});})),[t]);let n=Wp.filter(a=>e.includes(a.format));return S.createElement("div",{"data-gds-part":"composer-toolbar",className:s("flex flex-wrap items-center gap-0.5","px-2 py-1")},n.map(({format:a,icon:l,label:p})=>{let i=ps[a],c=i?o.has(i):false;return S.createElement("button",{key:a,type:"button","aria-label":p,title:p,"data-gds-part":"composer-toolbar-button","data-gds-active":c?"true":"false",onClick:()=>ms(t,a),className:s("h-7 w-7 inline-flex items-center justify-center rounded","text-[var(--gds-composer-toolbar-fg)]","hover:bg-[var(--gds-composer-toolbar-hover-bg)]","focus:outline-none focus:ring-2 focus:ring-primary",c&&"bg-[var(--gds-composer-toolbar-active-bg)] text-[var(--gds-composer-toolbar-active-fg)]")},S.createElement(l,{className:"h-3.5 w-3.5"}))}))}function jp({attachments:e,onRemove:t}){return S.createElement(AnimatePresence,{initial:false},e.length>0&&S.createElement(motion.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.18},className:"overflow-hidden"},S.createElement("div",{"data-gds-part":"composer-attachments",className:"flex flex-wrap gap-2 px-2 py-2"},e.map(o=>S.createElement("div",{key:o.id,className:"relative group"},o.file.type.startsWith("image/")?S.createElement("img",{src:o.previewUrl,alt:o.name,className:"h-14 w-14 rounded-md object-cover border border-[var(--gds-composer-border)]"}):S.createElement("div",{className:"h-14 w-14 rounded-md border border-[var(--gds-composer-border)] flex items-center justify-center text-xs px-1 text-center text-[var(--gds-composer-muted-fg)]"},o.name.slice(0,18)),S.createElement("button",{type:"button",onClick:()=>t(o.id),"aria-label":`Remove ${o.name}`,className:s("absolute -top-1.5 -right-1.5 h-5 w-5 rounded-full","bg-[var(--gds-composer-chip-remove-bg)]","text-[var(--gds-composer-chip-remove-fg)]","flex items-center justify-center","opacity-0 group-hover:opacity-100 focus:opacity-100","focus:outline-none focus:ring-2 focus:ring-primary","transition-opacity")},S.createElement(X,{className:"w-3 h-3"})))))))}function $p({placeholder:e,triggers:t,attachmentsCfg:o,formatList:r,showToolbar:n,isLoading:a,onStop:l,maxLength:p,autoFocus:i,submitOnEnter:c=true,leftActions:d,rightActions:m,hideSend:g,steps:u,trigger:b="mount",play:h,speed:f="normal",loop:y=false,loopDelay:R,onLoopReset:x,bare:k,className:T,onSubmit:O,onChange:D,readOnly:E,handleEditorReady:$,submitRef:H,restartRef:F,attachments:j,setAttachments:N,ingestImages:X}){let[L]=useLexicalComposerContext(),Y=S.useRef(null),v=S.useRef(null),[W,I]=S.useState(false);S.useEffect(()=>{$(L);},[L,$]),S.useEffect(()=>{L.setEditable(!E);},[L,E]);let le=S.useRef(D);le.current=D,S.useEffect(()=>L.registerUpdateListener(({editorState:A})=>{A.read(()=>{let ce=$getRoot().getTextContent();I(ce.trim().length>0),le.current?.(ce);});}),[L]);let J=S.useCallback(()=>{if(a)return;let A=us(L),ce=A.text.trim().length>0,Q=j.length>0;!ce&&!Q||(O?.(A,Q?j:void 0),Zo(L),j.forEach(Ge=>URL.revokeObjectURL(Ge.previewUrl)),N([]));},[L,a,j,O,N]);H.current=J;let{restart:he}=jt({steps:u,speed:f,trigger:b,play:h,loop:y,loopDelay:R,containerRef:Y,onLoopReset:()=>{Zo(L),x?.();},interpret:async(A,ce)=>{let Q=ce.signal;if(A.type==="wait")return re(A.ms,Q);if(A.type==="clear")return Zo(L),re(120,Q);if(A.type==="newline")return L.update(()=>{let oe=$getSelection();$isRangeSelection(oe)&&oe.insertParagraph();}),re(60,Q);if(A.type==="submit")return J(),re(120,Q);if(A.type==="format")return ms(L,A.format),L.update(()=>{let oe=$getSelection();if(!$isRangeSelection(oe)||oe.isCollapsed())return;let Re=oe.focus;oe.anchor.set(Re.key,Re.offset,Re.type);}),re(80,Q);if(A.type==="select")return Gp(L,A.text),re(120,Q);if(A.type==="mention")return A.query&&(L.update(()=>{let oe=$getSelection();$isRangeSelection(oe)&&oe.insertText(A.trigger);}),await Er(A.query,oe=>{L.update(()=>{let Re=$getRoot(),Z=Re.getTextContent(),ie=Z.slice(0,Z.length-A.trigger.length-(oe.length-1));Re.clear();let ze=$createParagraphNode();ie&&ze.append($createTextNode(ie)),ze.append($createTextNode(A.trigger+oe)),Re.append(ze);});},ce.speed.tokenStagger,Q),await re(180,Q),L.update(()=>{let oe=$getRoot(),Re=oe.getTextContent(),Z=A.trigger.length+A.query.length,ie=Re.slice(0,Re.length-Z);oe.clear();let ze=$createParagraphNode();ie&&ze.append($createTextNode(ie)),oe.append(ze),ze.select();})),_p(L,A.trigger,A.value),re(120,Q);let Ge=A.speed?{slow:70,normal:22,fast:8}[A.speed]:ce.speed.tokenStagger;for(let oe=0;oe<A.text.length;oe++){if(Q.aborted)return;let Re=A.text[oe];L.update(()=>{let Z=$getSelection();if(!$isRangeSelection(Z)){$getRoot().selectEnd();let ie=$getSelection();$isRangeSelection(ie)&&ie.insertText(Re);return}Z.insertText(Re);}),oe<A.text.length-1&&await re(Ge,Q);}}});S.useEffect(()=>{F.current=A=>{Zo(L),he(A);};},[L,he,F]);let ne=!E&&!m&&!g,be=!E&&!d&&o!==null,Be=!E&&(be||d||ne||m);return S.createElement("div",{ref:Y,"data-gds-part":"composer","data-gds-loading":a?"true":"false",className:s("w-full",!k&&["rounded-md","bg-transparent","border border-input","shadow-sm","focus-within:outline-none focus-within:ring-1 focus-within:ring-ring","transition-colors"],T)},n&&S.createElement(Up,{formats:r}),o&&S.createElement(jp,{attachments:j,onRemove:A=>{N(ce=>{let Q=ce.find(Ge=>Ge.id===A);return Q&&URL.revokeObjectURL(Q.previewUrl),ce.filter(Ge=>Ge.id!==A)});}}),S.createElement("div",{className:"relative"},S.createElement(RichTextPlugin,{contentEditable:S.createElement(ContentEditable,{"data-gds-part":"composer-editor",className:s("outline-none","px-3 sm:px-4 py-3","text-sm text-[var(--gds-composer-fg)]","min-h-[44px] max-h-[300px] overflow-y-auto","[&_p]:m-0 [&_p+p]:mt-2","[&_h1]:text-xl [&_h1]:font-semibold [&_h1]:mt-2","[&_h2]:text-lg [&_h2]:font-semibold [&_h2]:mt-2","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:mt-2","[&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5","[&_blockquote]:border-l-2 [&_blockquote]:border-[var(--gds-composer-border)] [&_blockquote]:pl-3 [&_blockquote]:italic","[&_code]:bg-[var(--gds-composer-toolbar-active-bg)] [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-xs [&_code]:font-mono",a&&"opacity-60 pointer-events-none"),"aria-placeholder":e??"",placeholder:S.createElement("div",{"data-gds-part":"composer-placeholder",className:"absolute top-3 left-3 sm:left-4 text-sm text-[var(--gds-composer-muted-fg)] pointer-events-none select-none"},e),spellCheck:true}),ErrorBoundary:LexicalErrorBoundary}),S.createElement(HistoryPlugin,null),S.createElement(ListPlugin,null),S.createElement(LinkPlugin,null),S.createElement(OnChangePlugin,{onChange:()=>{}}),S.createElement(Vp,{enabled:!!i}),S.createElement(zp,{onSubmit:J,enabled:c}),o&&S.createElement(Op,{onImageFiles:X,enabled:true}),t.length>0&&S.createElement(BeautifulMentionsPlugin,{items:t.reduce((A,ce)=>(typeof ce.items=="function"||(A[ce.char]=ce.items.map(Q=>({value:Q.value}))),A),{})})),Be&&S.createElement("div",{"data-gds-part":"composer-actions",className:"flex items-center justify-between gap-2 px-2 pb-2 pt-1"},S.createElement("div",{className:"flex items-center gap-1"},d??(be&&S.createElement("button",{type:"button",onClick:()=>v.current?.click(),disabled:a,"aria-label":"Attach image",title:"Attach image",className:s("h-8 w-8 rounded-lg flex items-center justify-center","text-[var(--gds-composer-action-fg)]","hover:text-[var(--gds-composer-fg)]","hover:bg-[var(--gds-composer-toolbar-hover-bg)]","focus:outline-none focus:ring-2 focus:ring-primary","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed")},S.createElement(Paperclip,{className:"w-4 h-4"})))),m??(ne&&S.createElement("button",{type:"button",onClick:a?l:J,disabled:a?!l:!W&&j.length===0,"aria-label":a?"Stop":"Send",className:s("h-8 w-8 rounded-lg flex items-center justify-center transition-colors flex-shrink-0","focus:outline-none focus:ring-2 focus:ring-primary",a?"bg-red-500 hover:bg-red-600 text-white disabled:opacity-50":W||j.length>0?"bg-primary hover:bg-primary/90 text-primary-foreground":"bg-[var(--gds-composer-toolbar-active-bg)] text-[var(--gds-composer-muted-fg)] cursor-not-allowed")},a?S.createElement(Square,{className:"w-3.5 h-3.5"}):S.createElement(Send,{className:"w-3.5 h-3.5"}))),o&&S.createElement("input",{ref:v,type:"file",accept:o.accept,multiple:o.multiple,onChange:A=>{A.target.files&&X(Array.from(A.target.files)),A.target.value="";},className:"sr-only",tabIndex:-1,"aria-hidden":"true"})))}var gs=S.forwardRef(function(t,o){let{initialText:r,initialJson:n,formats:a,toolbar:l,triggers:p,attachments:i,...c}=t,d=S.useMemo(()=>a===false?[]:a??["bold","italic","underline","strikethrough","code","h1","h2","blockquote","ul","ol"],[a]),m=l===true||l==="top",g=S.useMemo(()=>{if(!i)return null;let H=i===true?{}:i;return H.enabled===false?null:{enabled:true,accept:H.accept??"image/*",maxItems:H.maxItems??10,multiple:H.multiple??true}},[i]),[u,b]=S.useState([]),h=S.useRef(u);h.current=u,S.useEffect(()=>()=>{h.current.forEach(H=>URL.revokeObjectURL(H.previewUrl));},[]);let f=S.useCallback(H=>{if(!g)return;let F=H.filter(j=>g.accept?g.accept==="image/*"?j.type.startsWith("image/"):g.accept.split(",").some(N=>{let X=N.trim();return X.endsWith("/*")?j.type.startsWith(X.slice(0,-1)):j.type===X||j.name.toLowerCase().endsWith(X)}):true);F.length!==0&&b(j=>{let N=g.maxItems-j.length;if(N<=0)return j;let X=F.slice(0,N).map(L=>({id:`${L.name}-${L.size}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,file:L,previewUrl:URL.createObjectURL(L),name:L.name}));return [...j,...X]});},[g]),y=S.useRef(null),R=S.useRef(()=>{}),x=S.useRef(()=>{}),k=S.useCallback(H=>{y.current=H;},[]);S.useImperativeHandle(o,()=>({play:H=>{console.warn('[Composer] handle.play(steps) is not wired in v1 \u2014 pass `steps` + `trigger="manual"` and toggle `play` instead.');},stop:()=>{},restart:H=>x.current(H),focus:()=>y.current?.focus(),clear:()=>{let H=y.current;H&&Zo(H);},insert:H=>{y.current?.update(()=>{let F=$getSelection();$isRangeSelection(F)&&F.insertText(H);});},getContent:()=>y.current?us(y.current):{text:"",json:"",mentions:[]},getEditor:()=>y.current}),[]);let T=S.useMemo(()=>({paragraph:"gds-composer-paragraph",quote:"gds-composer-quote",heading:{h1:"gds-composer-h1",h2:"gds-composer-h2",h3:"gds-composer-h3"},list:{ul:"gds-composer-ul",ol:"gds-composer-ol",listitem:"gds-composer-li"},text:{bold:"font-semibold",italic:"italic",underline:"underline",strikethrough:"line-through",code:"gds-composer-code"},beautifulMentions:{"@":"gds-composer-mention px-1.5 py-0.5 mx-0.5 rounded bg-primary/10 text-primary font-medium","/":"gds-composer-mention px-1.5 py-0.5 mx-0.5 rounded bg-violet-500/15 text-violet-600 dark:text-violet-400 font-medium"}}),[]),O=S.useMemo(()=>({namespace:"gds-composer",theme:T,onError:H=>{console.error("[Composer]",H);},nodes:[HeadingNode,QuoteNode,ListNode,ListItemNode,LinkNode,AutoLinkNode,CodeNode,CodeHighlightNode,BeautifulMentionNode],editorState:n||(r?H=>{let F=$getRoot(),j=$createParagraphNode();j.append($createTextNode(r)),F.append(j);}:void 0)}),[T,n,r]),D=d.length>0,{readOnly:E=false,...$}=c;return S.createElement(LexicalComposer,{initialConfig:{...O,editable:!E}},S.createElement($p,{...$,readOnly:E,triggers:p??[],attachmentsCfg:E?null:g,formatList:d,showToolbar:m&&D&&!E,handleEditorReady:k,submitRef:R,restartRef:x,attachments:u,setAttachments:b,ingestImages:f}))}),Kp=S.forwardRef(function(t,o){return S.createElement(gs,{ref:o,placeholder:"Write a reply\u2026",formats:false,submitOnEnter:false,...t})});var Rt=ft.Root,St=ft.Trigger,qp=ft.Anchor,ht=S.forwardRef(({className:e,align:t="center",sideOffset:o=4,surface:r="solid",...n},a)=>S.createElement(ft.Portal,null,S.createElement(ft.Content,{ref:a,align:t,sideOffset:o,"data-surface":r,className:s("z-50 w-72 rounded-md border p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",gt(r,"bg-popover"),Xe[r],e),...n})));ht.displayName=ft.Content.displayName;var Yp="PPP",Zp="LLL dd, y";function Xp({value:e,onChange:t,placeholder:o="Pick a date",disabled:r,className:n,contentClassName:a,align:l="start",side:p,format:i=Yp,captionLayout:c,icon:d,"aria-label":m}){return S.createElement(Rt,null,S.createElement(St,{asChild:true},S.createElement(We,{type:"button",variant:"outline",disabled:r,"aria-label":m??(e?void 0:o),"data-empty":!e,className:s("w-[280px] justify-start text-left font-normal data-[empty=true]:text-muted-foreground",n)},d??S.createElement(CalendarIcon,{className:"mr-2 h-4 w-4","aria-hidden":true}),e?format(e,i):S.createElement("span",null,o))),S.createElement(ht,{className:s("w-auto p-0",a),align:l,side:p},S.createElement(Mr,{mode:"single",selected:e,onSelect:t,captionLayout:c,initialFocus:true})))}function Jp({value:e,onChange:t,placeholder:o="Pick a date range",disabled:r,className:n,contentClassName:a,align:l="start",side:p,format:i=Zp,captionLayout:c,icon:d,numberOfMonths:m=2,"aria-label":g}){let u=!!e?.from;return S.createElement(Rt,null,S.createElement(St,{asChild:true},S.createElement(We,{type:"button",variant:"outline",disabled:r,"aria-label":g??(u?void 0:o),"data-empty":!u,className:s("w-[300px] justify-start text-left font-normal data-[empty=true]:text-muted-foreground",n)},d??S.createElement(CalendarIcon,{className:"mr-2 h-4 w-4","aria-hidden":true}),e?.from?e.to?S.createElement(S.Fragment,null,format(e.from,i)," \u2013"," ",format(e.to,i)):format(e.from,i):S.createElement("span",null,o))),S.createElement(ht,{className:s("w-auto p-0",a),align:l,side:p},S.createElement(Mr,{mode:"range",selected:e,onSelect:t,defaultMonth:e?.from,numberOfMonths:m,captionLayout:c,initialFocus:true})))}var em=ye.Root,tm=ye.Trigger,hs=ye.Portal,om=ye.Close,Ra=S.forwardRef(({className:e,...t},o)=>S.createElement(ye.Overlay,{ref:o,className:s("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Ra.displayName=ye.Overlay.displayName;var bs=S.forwardRef(({className:e,children:t,surface:o="solid",...r},n)=>S.createElement(hs,null,S.createElement(Ra,null),S.createElement(ye.Content,{ref:n,"data-surface":o,className:s("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",gt(o,"bg-background"),Xe[o],e),...r},t,S.createElement(ye.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},S.createElement(X,{className:"h-4 w-4"}),S.createElement("span",{className:"sr-only"},"Close")))));bs.displayName=ye.Content.displayName;var vs=({className:e,...t})=>S.createElement("div",{className:s("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});vs.displayName="DialogHeader";var ys=({className:e,...t})=>S.createElement("div",{className:s("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ys.displayName="DialogFooter";var xs=S.forwardRef(({className:e,...t},o)=>S.createElement(ye.Title,{ref:o,className:s("text-lg font-semibold leading-none tracking-tight",e),...t}));xs.displayName=ye.Title.displayName;var ws=S.forwardRef(({className:e,...t},o)=>S.createElement(ye.Description,{ref:o,className:s("text-sm text-muted-foreground",e),...t}));ws.displayName=ye.Description.displayName;var im=U.Root,sm=U.Trigger,lm=U.Group,dm=U.Portal,cm=U.Sub,pm=U.RadioGroup,Rs=S.forwardRef(({className:e,inset:t,children:o,...r},n)=>S.createElement(U.SubTrigger,{ref:n,className:s("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r},o,S.createElement(ChevronRight,{className:"ml-auto"})));Rs.displayName=U.SubTrigger.displayName;var Ss=S.forwardRef(({className:e,surface:t="solid",...o},r)=>S.createElement(U.SubContent,{ref:r,"data-surface":t,className:s("z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",gt(t,"bg-popover"),Xe[t],e),...o}));Ss.displayName=U.SubContent.displayName;var Cs=S.forwardRef(({className:e,sideOffset:t=4,surface:o="solid",...r},n)=>S.createElement(U.Portal,null,S.createElement(U.Content,{ref:n,sideOffset:t,"data-surface":o,className:s("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",gt(o,"bg-popover"),Xe[o],e),...r})));Cs.displayName=U.Content.displayName;var ks=S.forwardRef(({className:e,inset:t,...o},r)=>S.createElement(U.Item,{ref:r,className:s("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...o}));ks.displayName=U.Item.displayName;var Ts=S.forwardRef(({className:e,children:t,checked:o,...r},n)=>S.createElement(U.CheckboxItem,{ref:n,className:s("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r},S.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},S.createElement(U.ItemIndicator,null,S.createElement(Check,{className:"h-4 w-4"}))),t));Ts.displayName=U.CheckboxItem.displayName;var Ps=S.forwardRef(({className:e,children:t,...o},r)=>S.createElement(U.RadioItem,{ref:r,className:s("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o},S.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},S.createElement(U.ItemIndicator,null,S.createElement(Circle,{className:"h-2 w-2 fill-current"}))),t));Ps.displayName=U.RadioItem.displayName;var Ms=S.forwardRef(({className:e,inset:t,...o},r)=>S.createElement(U.Label,{ref:r,className:s("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));Ms.displayName=U.Label.displayName;var Ns=S.forwardRef(({className:e,...t},o)=>S.createElement(U.Separator,{ref:o,className:s("-mx-1 my-1 h-px bg-muted",e),...t}));Ns.displayName=U.Separator.displayName;var Es=({className:e,...t})=>S.createElement("span",{className:s("ml-auto text-xs tracking-widest opacity-60",e),...t});Es.displayName="DropdownMenuShortcut";var um=cva("flex w-full rounded-md border border-input bg-transparent shadow-sm transition-colors file:border-0 file:bg-transparent file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{default:"h-9 pl-3 pr-3 py-1 text-base file:text-sm md:text-sm",sm:"h-8 pl-2 pr-2 py-1 text-xs file:text-xs"}},defaultVariants:{size:"default"}}),Ls=S.forwardRef(({className:e,type:t,size:o="default",...r},n)=>S.createElement("input",{type:t,className:s(um({size:o}),e),ref:n,...r}));Ls.displayName="Input";var fm=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ds=S.forwardRef(({className:e,...t},o)=>S.createElement(Sa.Root,{ref:o,className:s(fm(),e),...t}));Ds.displayName=Sa.Root.displayName;var As=S.forwardRef(({className:e,value:t,...o},r)=>S.createElement(er.Root,{ref:r,className:s("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...o},S.createElement(er.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})));As.displayName=er.Root.displayName;var Ca=S.forwardRef(({className:e,...t},o)=>S.createElement(Command,{ref:o,className:s("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Ca.displayName=Command.displayName;var ka=S.forwardRef(({className:e,...t},o)=>S.createElement("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":""},S.createElement(Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),S.createElement(Command.Input,{ref:o,className:s("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})));ka.displayName=Command.Input.displayName;var Ta=S.forwardRef(({className:e,...t},o)=>S.createElement(Command.List,{ref:o,className:s("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Ta.displayName=Command.List.displayName;var Pa=S.forwardRef((e,t)=>S.createElement(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Pa.displayName=Command.Empty.displayName;var zr=S.forwardRef(({className:e,...t},o)=>S.createElement(Command.Group,{ref:o,className:s("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));zr.displayName=Command.Group.displayName;var Ma=S.forwardRef(({className:e,...t},o)=>S.createElement(Command.Separator,{ref:o,className:s("-mx-1 h-px bg-border",e),...t}));Ma.displayName=Command.Separator.displayName;var To=S.forwardRef(({className:e,...t},o)=>S.createElement(Command.Item,{ref:o,className:s("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));To.displayName=Command.Item.displayName;var tr=S.forwardRef(({className:e,orientation:t="horizontal",decorative:o=true,...r},n)=>S.createElement(Na.Root,{ref:n,decorative:o,orientation:t,className:s("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));tr.displayName=Na.Root.displayName;var Rm=3,Hs=S.forwardRef(function({options:t,value:o,defaultValue:r,onValueChange:n,placeholder:a="Select\u2026",searchPlaceholder:l="Search\u2026",emptyMessage:p="Nothing matches.",maxCount:i=Rm,searchable:c=true,badgeDismissible:d=true,disabled:m=false,modalPopover:g=false,className:u,id:b,"aria-label":h,...f},y){let R=o!==void 0,[x,k]=S.useState(r??[]),T=R?o:x,[O,D]=S.useState(false),E=S.useMemo(()=>{let v=new Map;for(let W of t)v.set(W.value,W);return v},[t]),$=S.useCallback(v=>{R||k(v),n?.(v);},[R,n]),H=v=>{T.includes(v)?$(T.filter(W=>W!==v)):$([...T,v]);},F=(v,W)=>{v.preventDefault(),v.stopPropagation(),$(T.filter(I=>I!==W));},j=v=>{v?.preventDefault(),v?.stopPropagation(),$([]);},N=()=>{let v=t.filter(W=>!W.disabled).map(W=>W.value);$(v);},X$1=t.length>0&&t.filter(v=>!v.disabled).every(v=>T.includes(v.value)),L=T.slice(0,i),Y=Math.max(0,T.length-i);return S.createElement(Rt,{open:O,onOpenChange:D,modal:g},S.createElement(St,{asChild:true},S.createElement("button",{ref:y,type:"button",id:b,role:"combobox","aria-expanded":O,"aria-haspopup":"listbox","aria-label":h,disabled:m,"data-gds-part":"multi-select",className:s("flex min-h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-transparent pl-2 pr-2 text-sm shadow-sm","ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50","[&[data-state=open]]:ring-1 [&[data-state=open]]:ring-ring",u)},T.length===0?S.createElement("span",{className:"text-muted-foreground px-1"},a):S.createElement("div",{className:"flex flex-1 flex-wrap items-center gap-1 py-1","data-gds-part":"multi-select-badges"},L.map(v=>{let W=E.get(v);if(!W)return null;let I=W.icon;return S.createElement(Tr,{key:v,variant:"secondary",className:"gap-1 pr-1","data-gds-part":"multi-select-badge"},I?S.createElement(I,{className:"h-3 w-3"}):null,S.createElement("span",{className:"truncate max-w-[12rem]"},W.label),d&&!m&&S.createElement("span",{role:"button","aria-label":`Remove ${W.label}`,tabIndex:0,onClick:le=>F(le,v),onKeyDown:le=>{(le.key==="Enter"||le.key===" ")&&F(le,v);},className:"ml-0.5 inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-sm hover:bg-muted-foreground/20"},S.createElement(X,{className:"h-3 w-3","aria-hidden":true})))}),Y>0&&S.createElement(Tr,{variant:"outline",className:"text-muted-foreground","data-gds-part":"multi-select-overflow",title:T.slice(i).map(v=>E.get(v)?.label??v).join(", ")},"+",Y," more")),S.createElement("div",{className:"flex shrink-0 items-center gap-1"},T.length>0&&!m&&S.createElement("span",{role:"button","aria-label":"Clear all",tabIndex:0,onClick:v=>j(v),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&j(v);},className:"inline-flex h-5 w-5 cursor-pointer items-center justify-center rounded-sm text-muted-foreground hover:text-foreground hover:bg-muted"},S.createElement(XCircle,{className:"h-3.5 w-3.5","aria-hidden":true})),S.createElement(ChevronDown,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":true})))),S.createElement(ht,{align:"start",className:"w-[var(--radix-popover-trigger-width)] p-0","data-gds-part":"multi-select-content"},S.createElement(Ca,null,c&&S.createElement(ka,{placeholder:l}),S.createElement(Ta,null,S.createElement(Pa,null,p),S.createElement(zr,null,t.map(v=>{let W=v.icon,I=T.includes(v.value);return S.createElement(To,{key:v.value,value:v.label,onSelect:()=>H(v.value),disabled:v.disabled,"data-gds-part":"multi-select-item","data-selected":I||void 0},S.createElement("div",{className:s("mr-2 flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-primary",I?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),"aria-hidden":true},S.createElement(Check,{className:"h-3 w-3"})),W?S.createElement(W,{className:"mr-2 h-4 w-4 text-muted-foreground"}):null,S.createElement("span",{className:"truncate"},v.label))})),S.createElement(Ma,null),S.createElement(zr,null,S.createElement("div",{className:"flex items-center justify-between gap-1 p-1"},S.createElement(To,{onSelect:N,className:"flex-1 justify-center text-xs",disabled:X$1},"Select all"),S.createElement(tr,{orientation:"vertical",className:"h-5"}),S.createElement(To,{onSelect:()=>j(),className:"flex-1 justify-center text-xs",disabled:T.length===0},"Clear"),S.createElement(tr,{orientation:"vertical",className:"h-5"}),S.createElement(To,{onSelect:()=>D(false),className:"flex-1 justify-center text-xs"},"Close")))))))});Hs.displayName="MultiSelect";var Is=S.forwardRef(({className:e,...t},o)=>S.createElement(Kt.Root,{className:s("grid gap-2",e),...t,ref:o}));Is.displayName=Kt.Root.displayName;var Fs=S.forwardRef(({className:e,...t},o)=>S.createElement(Kt.Item,{ref:o,className:s("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t},S.createElement(Kt.Indicator,{className:"flex items-center justify-center"},S.createElement(Circle,{className:"h-2.5 w-2.5 fill-current text-current"}))));Fs.displayName=Kt.Item.displayName;var km=({className:e,...t})=>S.createElement(Po.PanelGroup,{"data-gds-part":"resizable-panel-group",className:s("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),Tm=Po.Panel,Pm=({withHandle:e,className:t,...o})=>S.createElement(Po.PanelResizeHandle,{"data-gds-part":"resizable-handle",className:s("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...o},e&&S.createElement("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border"},S.createElement(GripVertical,{className:"h-2.5 w-2.5"})));var Bs=cva("gds-row flex flex-row",{variants:{gap:{none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"},align:{start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},wrap:{true:"flex-wrap",false:"flex-nowrap"}},defaultVariants:{gap:"md",align:"center",justify:"start",wrap:false}}),zs=S.forwardRef(({className:e,gap:t,align:o,justify:r,wrap:n,asChild:a=false,...l},p)=>S.createElement(a?Slot:"div",{ref:p,"data-gds-part":"row",className:s(Bs({gap:t,align:o,justify:r,wrap:n,className:e})),...l}));zs.displayName="Row";var Os=cva("gds-grid grid",{variants:{cols:{1:"grid-cols-1",2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",5:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-5",6:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-6",12:"grid-cols-4 md:grid-cols-6 lg:grid-cols-12"},gap:{none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"},align:{start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"}},defaultVariants:{cols:"3",gap:"md",align:"stretch"}}),Vs=S.forwardRef(({className:e,cols:t,gap:o,align:r,asChild:n=false,...a},l)=>S.createElement(n?Slot:"div",{ref:l,"data-gds-part":"grid",className:s(Os({cols:t,gap:o,align:r,className:e})),...a}));Vs.displayName="Grid";var _s=cva("gds-flex flex",{variants:{direction:{row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},gap:{none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"},align:{start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse"}},defaultVariants:{direction:"row",gap:"none",align:"stretch",justify:"start",wrap:"nowrap"}}),Gs=S.forwardRef(({className:e,direction:t,gap:o,align:r,justify:n,wrap:a,asChild:l=false,...p},i)=>S.createElement(l?Slot:"div",{ref:i,"data-gds-part":"flex",className:s(_s({direction:t,gap:o,align:r,justify:n,wrap:a,className:e})),...p}));Gs.displayName="Flex";var Ws=S.forwardRef(({className:e,children:t,...o},r)=>S.createElement(it.Root,{ref:r,className:s("relative overflow-hidden",e),...o},S.createElement(it.Viewport,{className:"h-full w-full rounded-[inherit]"},t),S.createElement(Ea,null),S.createElement(it.Corner,null)));Ws.displayName=it.Root.displayName;var Ea=S.forwardRef(({className:e,orientation:t="vertical",...o},r)=>S.createElement(it.ScrollAreaScrollbar,{ref:r,orientation:t,className:s("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o},S.createElement(it.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})));Ea.displayName=it.ScrollAreaScrollbar.displayName;var Bm=K.Root,zm=K.Group,Om=K.Value,Vm=cva("flex w-full items-center justify-between rounded-md border border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",{variants:{size:{default:"h-10 px-3 py-2 text-sm",sm:"h-8 px-2 py-1 text-xs"}},defaultVariants:{size:"default"}}),js=S.forwardRef(({className:e,children:t,size:o="default",...r},n)=>S.createElement(K.Trigger,{ref:n,className:s(Vm({size:o}),e),...r},t,S.createElement(K.Icon,{asChild:true},S.createElement(ChevronDown,{className:s("opacity-50",o==="sm"?"h-3.5 w-3.5":"h-4 w-4")}))));js.displayName=K.Trigger.displayName;var La=S.forwardRef(({className:e,...t},o)=>S.createElement(K.ScrollUpButton,{ref:o,className:s("flex cursor-default items-center justify-center py-1",e),...t},S.createElement(ChevronUp,{className:"h-4 w-4"})));La.displayName=K.ScrollUpButton.displayName;var Da=S.forwardRef(({className:e,...t},o)=>S.createElement(K.ScrollDownButton,{ref:o,className:s("flex cursor-default items-center justify-center py-1",e),...t},S.createElement(ChevronDown,{className:"h-4 w-4"})));Da.displayName=K.ScrollDownButton.displayName;var $s=S.forwardRef(({className:e,children:t,position:o="popper",...r},n)=>S.createElement(K.Portal,null,S.createElement(K.Content,{ref:n,className:s("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...r},S.createElement(La,null),S.createElement(K.Viewport,{className:s("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},t),S.createElement(Da,null))));$s.displayName=K.Content.displayName;var Ks=S.forwardRef(({className:e,...t},o)=>S.createElement(K.Label,{ref:o,className:s("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Ks.displayName=K.Label.displayName;var qs=S.forwardRef(({className:e,children:t,...o},r)=>S.createElement(K.Item,{ref:r,className:s("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o},S.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},S.createElement(K.ItemIndicator,null,S.createElement(Check,{className:"h-4 w-4"}))),S.createElement(K.ItemText,null,t)));qs.displayName=K.Item.displayName;var Ys=S.forwardRef(({className:e,...t},o)=>S.createElement(K.Separator,{ref:o,className:s("-mx-1 my-1 h-px bg-muted",e),...t}));Ys.displayName=K.Separator.displayName;var Wm=ye.Root,Um=ye.Trigger,jm=ye.Close,Zs=ye.Portal,Aa=S.forwardRef(({className:e,...t},o)=>S.createElement(ye.Overlay,{className:s("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:o}));Aa.displayName=ye.Overlay.displayName;var $m=cva("fixed z-50 gap-4 p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Xs=S.forwardRef(({side:e="right",surface:t="solid",className:o,children:r,...n},a)=>S.createElement(Zs,null,S.createElement(Aa,null),S.createElement(ye.Content,{ref:a,"data-surface":t,className:s($m({side:e}),gt(t,"bg-background"),Xe[t],o),...n},r,S.createElement(ye.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},S.createElement(X,{className:"h-4 w-4"}),S.createElement("span",{className:"sr-only"},"Close")))));Xs.displayName=ye.Content.displayName;var Js=({className:e,...t})=>S.createElement("div",{className:s("flex flex-col space-y-2 text-center sm:text-left",e),...t});Js.displayName="SheetHeader";var Qs=({className:e,...t})=>S.createElement("div",{className:s("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Qs.displayName="SheetFooter";var el=S.forwardRef(({className:e,...t},o)=>S.createElement(ye.Title,{ref:o,className:s("text-lg font-semibold text-foreground",e),...t}));el.displayName=ye.Title.displayName;var tl=S.forwardRef(({className:e,...t},o)=>S.createElement(ye.Description,{ref:o,className:s("text-sm text-muted-foreground",e),...t}));tl.displayName=ye.Description.displayName;function Km({className:e,...t}){return React.createElement("div",{className:s("animate-pulse rounded-md bg-muted",e),...t})}var ol=S.forwardRef(({className:e,...t},o)=>S.createElement(It.Root,{ref:o,className:s("relative flex w-full touch-none select-none items-center",e),...t},S.createElement(It.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary"},S.createElement(It.Range,{className:"absolute h-full bg-primary"})),S.createElement(It.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})));ol.displayName=It.Root.displayName;var ru={vertical:verticalListSortingStrategy,horizontal:horizontalListSortingStrategy,grid:rectSortingStrategy},Ha=S.createContext(null),cl=S.createContext(null),Ia=S.forwardRef(function({disabled:t=false,className:o,children:r,...n},a){let l=S.useRef(new Map),p=S.useCallback(m=>(l.current.set(m.id,m),()=>{l.current.delete(m.id);}),[]),i=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),c=m=>{let g=l.current,u=g.get(String(m));if(u)return u;for(let b of g.values())if(b.values.some(h=>h===m))return b;return null},d=S.useCallback(m=>{if(t)return;let{active:g,over:u}=m;if(!u)return;let b=c(g.id),h=c(u.id);if(!b||!h)return;if(b.id===h.id){if(g.id===u.id)return;let x=b.values.findIndex(T=>T===g.id),k=b.values.findIndex(T=>T===u.id);if(x===-1||k===-1)return;b.onReorder?.(arrayMove(b.values,x,k));return}let f=b.values.filter(x=>x!==g.id),y=u.id===h.id?h.values.length:Math.max(0,h.values.findIndex(x=>x===u.id)),R=[...h.values.slice(0,y),g.id,...h.values.slice(y)];b.onReorder?.(f),h.onReorder?.(R);},[t]);return S.createElement(cl.Provider,{value:{registerContainer:p}},S.createElement(DndContext,{sensors:i,collisionDetection:closestCorners,onDragEnd:d},S.createElement("div",{ref:a,"data-gds-part":"sortable-group","data-disabled":t||void 0,className:s(o),...n},r)))});Ia.displayName="Sortable.Group";var rr=S.forwardRef(function({values:t,onReorder:o,strategy:r="vertical",disabled:n=false,id:a,className:l,children:p,...i},c){let d=S.useContext(cl),m=d!==null,g=S.useId(),u=a??g;S.useEffect(()=>{if(m)return d.registerContainer({id:u,values:t,onReorder:o})},[m,d,u,t,o]);let b=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),h=S.useCallback(R=>{let{active:x,over:k}=R;if(!k||x.id===k.id)return;let T=t.findIndex(D=>D===x.id),O=t.findIndex(D=>D===k.id);T===-1||O===-1||o?.(arrayMove(t,T,O));},[t,o]),f=S.useMemo(()=>({disabled:n}),[n]),y=S.createElement(SortableContext,{items:t,strategy:ru[r]},S.createElement(au,{id:u,enabled:m,forwardedRef:c,strategy:r,disabled:n,className:l,...i},p));return m?S.createElement(Ha.Provider,{value:f},y):S.createElement(Ha.Provider,{value:f},S.createElement(DndContext,{sensors:b,collisionDetection:closestCenter,onDragEnd:h},y))});rr.displayName="Sortable";function au({id:e,enabled:t,forwardedRef:o,strategy:r,disabled:n,className:a,children:l,...p}){let i=useDroppable({id:e,disabled:!t}),c=S.useCallback(d=>{t&&i.setNodeRef(d),typeof o=="function"?o(d):o&&(o.current=d);},[t,i,o]);return S.createElement("div",{ref:c,"data-gds-part":"sortable","data-strategy":r,"data-disabled":n||void 0,className:s(a),...p},l)}var pl=S.createContext(null),Fa=S.forwardRef(function({value:t,asChild:o=false,disabled:r,className:n,style:a,children:l,...p},i){let c=S.useContext(Ha);if(!c)throw new Error("<Sortable.Item> must be rendered inside <Sortable>.");let d=c.disabled||r||false,{attributes:m,listeners:g,setNodeRef:u,setActivatorNodeRef:b,transform:h,transition:f,isDragging:y}=useSortable({id:t,disabled:d}),R=S.useRef(false),x=S.useCallback(D=>{u(D),typeof i=="function"?i(D):i&&(i.current=D);},[u,i]),k=S.useMemo(()=>({listeners:g,setActivatorNodeRef:b,hasHandle:R,disabled:d}),[g,b,d]),T={transform:CSS.Transform.toString(h),transition:f,zIndex:y?1:void 0,cursor:d?"default":R.current?void 0:"grab",...a},O=o?Slot:"div";return S.createElement(pl.Provider,{value:k},S.createElement(O,{ref:x,"data-gds-part":"sortable-item","data-value":String(t),"data-dragging":y||void 0,className:s(n),style:T,...m,...R.current?{}:g,...p},l))});Fa.displayName="Sortable.Item";var Ba=S.forwardRef(function({asChild:t=false,className:o,children:r,...n},a){let l=S.useContext(pl);if(!l)throw new Error("<Sortable.Handle> must be rendered inside <Sortable.Item>.");S.useLayoutEffect(()=>(l.hasHandle.current=true,()=>{l.hasHandle.current=false;}),[l.hasHandle]);let p=S.useCallback(c=>{l.setActivatorNodeRef(c),typeof a=="function"?a(c):a&&(a.current=c);},[l,a]),i={"data-gds-part":"sortable-handle","aria-label":"Drag to reorder",className:s("cursor-grab touch-none select-none",l.disabled&&"cursor-default opacity-50",o),...l.disabled?{}:l.listeners,...n};return t?S.createElement(Slot,{ref:p,...i},r):S.createElement("button",{type:"button",ref:p,...i},r)});Ba.displayName="Sortable.Handle";rr.Item=Fa;rr.Handle=Ba;rr.Group=Ia;var nu=rr;var ml=cva("gds-stack flex flex-col",{variants:{gap:{none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"},align:{start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"}},defaultVariants:{gap:"md",align:"stretch",justify:"start"}}),ul=S.forwardRef(({className:e,gap:t,align:o,justify:r,asChild:n=false,...a},l)=>S.createElement(n?Slot:"div",{ref:l,"data-gds-part":"stack",className:s(ml({gap:t,align:o,justify:r,className:e})),...a}));ul.displayName="Stack";var gl=S.forwardRef(({className:e,...t},o)=>S.createElement(nr.Root,{className:s("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:o},S.createElement(nr.Thumb,{className:s("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})));gl.displayName=nr.Root.displayName;var fl=S.forwardRef(({className:e,...t},o)=>S.createElement("div",{className:"relative w-full overflow-auto"},S.createElement("table",{ref:o,className:s("w-full caption-bottom text-sm",e),...t})));fl.displayName="Table";var hl=S.forwardRef(({className:e,...t},o)=>S.createElement("thead",{ref:o,className:s("[&_tr]:border-b",e),...t}));hl.displayName="TableHeader";var bl=S.forwardRef(({className:e,...t},o)=>S.createElement("tbody",{ref:o,className:s("[&_tr:last-child]:border-0",e),...t}));bl.displayName="TableBody";var vl=S.forwardRef(({className:e,...t},o)=>S.createElement("tfoot",{ref:o,className:s("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));vl.displayName="TableFooter";var yl=S.forwardRef(({className:e,...t},o)=>S.createElement("tr",{ref:o,className:s("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));yl.displayName="TableRow";var xl=S.forwardRef(({className:e,...t},o)=>S.createElement("th",{ref:o,className:s("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xl.displayName="TableHead";var wl=S.forwardRef(({className:e,...t},o)=>S.createElement("td",{ref:o,className:s("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));wl.displayName="TableCell";var Rl=S.forwardRef(({className:e,...t},o)=>S.createElement("caption",{ref:o,className:s("mt-4 text-sm text-muted-foreground",e),...t}));Rl.displayName="TableCaption";var Sl=S.createContext(S.createElement(ChevronRight,null)),Cl=S.forwardRef(({separator:e,children:t,...o},r)=>S.createElement(Sl.Provider,{value:e??S.createElement(ChevronRight,null)},S.createElement("nav",{ref:r,"aria-label":"breadcrumb",...o},t)));Cl.displayName="Breadcrumb";var kl=S.forwardRef(({className:e,...t},o)=>S.createElement("ol",{ref:o,className:s("flex flex-wrap items-center gap-1.5 break-words text-xs text-muted-foreground",e),...t}));kl.displayName="BreadcrumbList";var Tl=S.forwardRef(({className:e,...t},o)=>S.createElement("li",{ref:o,className:s("inline-flex items-center gap-1.5",e),...t}));Tl.displayName="BreadcrumbItem";var jr=s("inline-flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs","transition-colors hover:text-foreground hover:bg-muted/60","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","[&_svg]:pointer-events-none [&_svg]:size-3.5 [&_svg]:shrink-0"),Pl=S.forwardRef(({asChild:e,className:t,href:o,...r},n)=>e?S.createElement("span",{ref:n,className:s(jr,t),...r}):o?S.createElement("a",{ref:n,href:o,className:s(jr,t),...r}):S.createElement("button",{ref:n,type:"button",className:s(jr,t),...r}));Pl.displayName="BreadcrumbLink";var Ml=S.forwardRef(({className:e,...t},o)=>S.createElement("span",{ref:o,role:"link","aria-disabled":"true","aria-current":"page",className:s("inline-flex items-center gap-1.5 px-0.5 text-xs font-medium text-foreground","[&_svg]:pointer-events-none [&_svg]:size-3.5 [&_svg]:shrink-0",e),...t}));Ml.displayName="BreadcrumbPage";var Nl=({children:e,className:t,...o})=>{let r=S.useContext(Sl);return S.createElement("li",{role:"presentation","aria-hidden":"true",className:s("[&_svg]:size-3 [&_svg]:shrink-0 text-muted-foreground/60",t),...o},e??r)};Nl.displayName="BreadcrumbSeparator";var El=({className:e,...t})=>S.createElement("span",{role:"presentation","aria-hidden":"true",className:s("flex h-5 w-5 items-center justify-center",e),...t},S.createElement(MoreHorizontal,{className:"h-3.5 w-3.5"}),S.createElement("span",{className:"sr-only"},"More"));El.displayName="BreadcrumbEllipsis";var Ll=S.forwardRef(({label:e,items:t,onSelect:o,onSelectLabel:r,current:n,className:a},l)=>{let[p,i]=S.useState(false);return S.createElement(Rt,{open:p,onOpenChange:i},S.createElement(St,{asChild:true},S.createElement("button",{ref:l,type:"button",className:s(jr,n&&"font-medium text-foreground",a),onClick:()=>{r?r():i(c=>!c);}},S.createElement("span",null,e),S.createElement(ChevronDown,{className:s("h-3 w-3 text-muted-foreground transition-transform",p&&"rotate-180"),onClick:c=>{c.stopPropagation(),i(d=>!d);},role:"button","aria-label":`Show ${e} children`}))),S.createElement(ht,{align:"start",className:"w-64 p-1 max-h-80 overflow-y-auto"},t.length===0?S.createElement("p",{className:"px-2 py-1.5 text-xs text-muted-foreground"},"No items here yet."):S.createElement("ul",{className:"flex flex-col gap-0.5"},t.map(c=>S.createElement("li",{key:c.id},S.createElement("button",{type:"button",onClick:()=>{o(c.id),i(false);},className:s("w-full text-left rounded-md px-2 py-1.5","flex items-start gap-2","hover:bg-muted transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",c.active&&"bg-muted/60")},S.createElement("span",{className:"flex-1 min-w-0"},S.createElement("span",{className:"flex items-center gap-1.5"},S.createElement("span",{className:"text-xs font-medium text-foreground truncate"},c.label),c.active&&S.createElement(Check,{className:"h-3 w-3 text-primary shrink-0"})),c.summary&&S.createElement("span",{className:"block text-[10px] text-muted-foreground leading-snug truncate"},c.summary)),c.hasChildren&&S.createElement(ChevronRight,{className:"h-3 w-3 text-muted-foreground/70 shrink-0 mt-0.5"})))))))});Ll.displayName="BreadcrumbMenuTrigger";var Oa=bt.Provider,lo=bt.Root,co=bt.Trigger,qt=S.forwardRef(({className:e,sideOffset:t=4,...o},r)=>S.createElement(bt.Portal,null,S.createElement(bt.Content,{ref:r,sideOffset:t,className:s("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...o})));qt.displayName=bt.Content.displayName;var Al=S.createContext({size:"md",variant:"pill"}),pu=vt.Root,mu=cva("inline-flex items-center text-muted-foreground",{variants:{variant:{pill:"justify-center rounded-lg bg-muted",underlined:"justify-start border-b border-border"},size:{sm:"",md:"",lg:""}},compoundVariants:[{variant:"pill",size:"sm",className:"h-7 p-0.5"},{variant:"pill",size:"md",className:"h-8 p-0.5"},{variant:"pill",size:"lg",className:"h-10 p-1"},{variant:"underlined",size:"sm",className:"gap-3"},{variant:"underlined",size:"md",className:"gap-4"},{variant:"underlined",size:"lg",className:"gap-6"}],defaultVariants:{variant:"pill",size:"md"}}),uu=cva("inline-flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{pill:"rounded-md data-[state=active]:bg-background data-[state=active]:text-foreground",underlined:"rounded-none bg-transparent border-b-2 border-transparent -mb-px hover:text-foreground data-[state=active]:border-primary data-[state=active]:text-primary"},size:{sm:"text-[11px] gap-1 [&_svg]:size-3",md:"text-xs gap-1.5 [&_svg]:size-3.5",lg:"text-sm gap-2 [&_svg]:size-4"}},compoundVariants:[{variant:"pill",size:"sm",className:"h-6 px-1.5"},{variant:"pill",size:"md",className:"h-7 px-2"},{variant:"pill",size:"lg",className:"h-8 px-2.5"},{variant:"underlined",size:"sm",className:"pb-1.5 pt-1 px-1"},{variant:"underlined",size:"md",className:"pb-2 pt-1.5 px-1.5"},{variant:"underlined",size:"lg",className:"pb-2.5 pt-2 px-2"}],defaultVariants:{variant:"pill",size:"md"}}),Hl=S.forwardRef(({className:e,size:t="md",variant:o="pill",children:r,...n},a)=>S.createElement(Al.Provider,{value:{size:t??"md",variant:o??"pill"}},S.createElement(vt.List,{ref:a,className:s(mu({size:t,variant:o}),e),...n},r)));Hl.displayName=vt.List.displayName;var Il=S.forwardRef(({className:e,size:t,variant:o,tooltip:r,...n},a)=>{let l=S.useContext(Al),p=t??l.size,i=o??l.variant,c=n["aria-label"]??(typeof r=="string"?r:void 0),d=S.createElement(vt.Trigger,{ref:a,className:s(uu({size:p,variant:i}),e),"aria-label":c,...n});return r?S.createElement(lo,null,S.createElement(co,{asChild:true},d),S.createElement(qt,null,r)):d});Il.displayName=vt.Trigger.displayName;var Fl=S.forwardRef(({className:e,...t},o)=>S.createElement(vt.Content,{ref:o,className:s("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Fl.displayName=vt.Content.displayName;var Bl=S.forwardRef(({className:e,...t},o)=>S.createElement("textarea",{className:s("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));Bl.displayName="Textarea";var zl=cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ol=S.forwardRef(({className:e,variant:t,size:o,...r},n)=>S.createElement(Va.Root,{ref:n,className:s(zl({variant:t,size:o,className:e})),...r}));Ol.displayName=Va.Root.displayName;var _l=S.createContext("md"),fu=cva("inline-flex items-center justify-center rounded-lg bg-muted text-muted-foreground",{variants:{size:{sm:"h-7 p-0.5",md:"h-8 p-0.5",lg:"h-10 p-1"}},defaultVariants:{size:"md"}}),hu=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[state=on]:bg-background data-[state=on]:text-foreground",{variants:{size:{sm:"h-6 px-1.5 text-[11px] gap-1 [&_svg]:size-3",md:"h-7 px-2 text-xs gap-1.5 [&_svg]:size-3.5",lg:"h-8 px-2.5 text-sm gap-2 [&_svg]:size-4"}},defaultVariants:{size:"md"}}),Gl=S.forwardRef(({className:e,size:t="md",children:o,...r},n)=>S.createElement(_l.Provider,{value:t??"md"},S.createElement(Mo.Root,{ref:n,className:s(fu({size:t}),e),...r},o)));Gl.displayName=Mo.Root.displayName;var Wl=S.forwardRef(({className:e,size:t,tooltip:o,tooltipSide:r="top",tooltipDelay:n,"aria-label":a,...l},p)=>{let i=S.useContext(_l),c=t??i,d=a??(typeof o=="string"?o:void 0),m=S.createElement(Mo.Item,{ref:p,className:s(hu({size:c}),e),"aria-label":d,...l});return o==null?m:S.createElement(lo,{delayDuration:n},S.createElement(co,{asChild:true},S.createElement("span",{className:"inline-flex"},m)),S.createElement(qt,{side:r},o))});Wl.displayName=Mo.Item.displayName;var vu=cva("grid items-center w-full gap-3 [grid-template-columns:auto_1fr_auto]",{variants:{position:{top:"border-b border-border",bottom:"border-t border-border",inline:""},variant:{default:"bg-background",subtle:"bg-muted/30",transparent:"bg-transparent"},size:{sm:"min-h-10 px-3",md:"min-h-12 px-4",lg:"min-h-14 px-6"},sticky:{true:"",false:""}},compoundVariants:[{sticky:true,position:"top",className:"sticky top-0 z-20"},{sticky:true,position:"bottom",className:"sticky bottom-0 z-20"}],defaultVariants:{position:"top",variant:"default",size:"md",sticky:false}}),Ul=S.forwardRef(({className:e,position:t,variant:o,size:r,sticky:n,leading:a,center:l,trailing:p,children:i,"aria-label":c,...d},m)=>{let g=i==null;return S.createElement("div",{ref:m,role:"toolbar","aria-label":c??"Toolbar","data-gds-part":"toolbar","data-position":t??"top",className:s(vu({position:t,variant:o,size:r,sticky:n}),e),...d},g?S.createElement(S.Fragment,null,S.createElement("div",{"data-gds-part":"toolbar-leading",className:"flex items-center min-w-0"},a),S.createElement("div",{"data-gds-part":"toolbar-center",className:"flex items-center min-w-0 justify-center"},l),S.createElement("div",{"data-gds-part":"toolbar-trailing",className:"flex items-center min-w-0 justify-end"},p)):i)});Ul.displayName="Toolbar";var jl=S.forwardRef(({className:e,align:t="leading",...o},r)=>S.createElement("div",{ref:r,"data-gds-part":`toolbar-${t}`,className:s("flex items-center min-w-0",t==="center"&&"justify-center",t==="trailing"&&"justify-end",e),...o}));jl.displayName="ToolbarSlot";var Kl=S.createContext(null),_a=S.createContext(0);function ql(){return S.useContext(_a)}function sr(e){let t=S.useContext(Kl);if(!t)throw new Error(`<${e}> must be rendered inside a <Sidebar> root.`);return t}var Yt=S.forwardRef(({collapsed:e,defaultCollapsed:t=false,onCollapsedChange:o,collapsible:r=true,variant:n="rail",className:a,style:l,children:p,...i},c)=>{let d=e!==void 0,[m,g]=S.useState(t),u=d?e:m,b=n==="panel",h=()=>{let f=!u;d||g(f),o?.(f);};return S.createElement(Oa,{delayDuration:0},S.createElement(Kl.Provider,{value:{collapsed:u}},S.createElement("aside",{ref:c,"data-gds-part":"sidebar","data-collapsed":u||void 0,"data-variant":n,className:s("relative flex h-full flex-col bg-card text-card-foreground",b?"w-full border border-border rounded-lg overflow-hidden":"border-r border-border transition-[width] duration-200 ease-out",a),style:b?l:{width:u?"var(--gds-sidebar-collapsed-width, 4rem)":"var(--gds-sidebar-width, 16rem)",...l},...i},p,r&&!b&&S.createElement("button",{type:"button",onClick:h,"aria-label":u?"Expand sidebar":"Collapse sidebar","data-gds-part":"sidebar-collapse-toggle",className:s("absolute -right-3 top-6 z-10 flex h-6 w-6 items-center justify-center","rounded-full border border-border bg-card text-muted-foreground shadow-sm","hover:text-foreground hover:bg-muted transition-colors")},u?S.createElement(ChevronRight,{className:"h-3 w-3"}):S.createElement(ChevronLeft,{className:"h-3 w-3"})))))});Yt.displayName="Sidebar";var Wa=S.forwardRef(({className:e,...t},o)=>{let{collapsed:r}=sr("SidebarHeader");return S.createElement("div",{ref:o,"data-gds-part":"sidebar-header","data-collapsed":r||void 0,className:s("flex shrink-0 items-center border-b border-border",r?"justify-center px-2":"px-3","h-[var(--gds-sidebar-header-height,3.25rem)]",e),...t})});Wa.displayName="SidebarHeader";var Ua=S.forwardRef(({className:e,...t},o)=>S.createElement("nav",{ref:o,"data-gds-part":"sidebar-content",className:s("flex-1 overflow-y-auto overflow-x-hidden","py-[var(--gds-sidebar-content-py,0.5rem)]",e),...t}));Ua.displayName="SidebarContent";var ja=S.forwardRef(({className:e,...t},o)=>{let{collapsed:r}=sr("SidebarFooter");return S.createElement("div",{ref:o,"data-gds-part":"sidebar-footer","data-collapsed":r||void 0,className:s("shrink-0 border-t border-border",r?"px-2 py-2":"px-3 py-2",e),...t})});ja.displayName="SidebarFooter";var $a=S.forwardRef(({title:e,icon:t,trailing:o,collapsible:r=true,defaultExpanded:n=true,className:a,children:l,...p},i)=>{let{collapsed:c}=sr("SidebarSection"),[d,m]=S.useState(n),g=!!e&&r;return c?S.createElement("div",{ref:i,"data-gds-part":"sidebar-section",className:s("px-[var(--gds-sidebar-section-px,0.5rem)] space-y-[var(--gds-sidebar-section-gap,0.125rem)]",a),...p},l):S.createElement("div",{ref:i,"data-gds-part":"sidebar-section",className:s("px-[var(--gds-sidebar-section-px,0.5rem)] pb-1",a),...p},e&&(g?S.createElement("div",{className:s("group/header flex w-full items-center gap-1 rounded-md px-2 py-1.5 text-xs font-medium uppercase tracking-wide","text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors")},S.createElement("button",{type:"button",onClick:()=>m(u=>!u),"aria-expanded":d,className:"flex flex-1 items-center gap-2 text-left min-w-0"},t,S.createElement("span",{className:"flex-1 text-left normal-case truncate"},e),d?S.createElement(ChevronDown,{className:"h-3 w-3 shrink-0",strokeWidth:1.5}):S.createElement(ChevronRight,{className:"h-3 w-3 shrink-0",strokeWidth:1.5})),o&&S.createElement("span",{className:"flex items-center shrink-0",onClick:u=>u.stopPropagation(),onKeyDown:u=>u.stopPropagation()},o)):S.createElement("div",{className:s("flex items-center gap-2 px-2 py-1.5 text-xs font-medium uppercase tracking-wide","text-muted-foreground")},t,S.createElement("span",{className:"flex-1 truncate"},e),o&&S.createElement("span",{className:"shrink-0"},o))),d&&S.createElement("div",{className:s("mt-[var(--gds-sidebar-section-gap,0.125rem)]","space-y-[var(--gds-sidebar-section-gap,0.125rem)]")},l))});$a.displayName="SidebarSection";var Ka=S.forwardRef(({icon:e,badge:t,active:o=false,asButton:r=false,asChild:n=false,disabled:a=false,collapsedLabel:l,size:p="md",description:i,className:c,children:d,...m},g)=>{let{collapsed:u}=sr("SidebarItem"),b=ql(),h=!u&&b>0?{paddingLeft:`calc(0.5rem + ${b} * var(--gds-sidebar-tree-indent, 1.5rem))`}:void 0,f=p==="sm",y=f?"text-xs px-2 py-1":"text-sm px-2 py-1.5",R=f&&!o?"font-normal":"font-medium",x=o?"bg-primary/10 text-primary":f?"text-muted-foreground hover:bg-muted hover:text-foreground":"text-foreground/80 hover:bg-muted hover:text-foreground",k=!u&&i!=null,T=s("group flex items-center gap-2.5 rounded-md transition-colors",y,R,k&&(f?"py-1.5":"py-2"),u?"justify-center px-2 py-2":null,x,a&&"opacity-50 pointer-events-none",c),O=k?S.createElement("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 text-left leading-tight"},S.createElement("span",{className:"truncate"},d),S.createElement("span",{className:s("truncate font-normal text-muted-foreground",f?"text-[10px]":"text-[11px]")},i)):S.createElement("span",{className:"flex-1 truncate text-left"},d),D=S.createElement(S.Fragment,null,e&&S.createElement("span",{className:"shrink-0 [&>svg]:h-4 [&>svg]:w-4","aria-hidden":true},e),!u&&O,!u&&t!==void 0&&t!==null&&S.createElement("span",{className:"ml-auto inline-flex items-center justify-center rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground"},t)),E;if(n)E=S.createElement(Slot,{"data-gds-part":"sidebar-item","data-active":o||void 0,"aria-current":o?"page":void 0,className:T,style:h},d);else if(r){let{href:H,target:F,rel:j,download:N,hrefLang:X,ping:L,referrerPolicy:Y,type:v,...W}=m;E=S.createElement("button",{type:"button","data-gds-part":"sidebar-item","data-active":o||void 0,"aria-current":o?"page":void 0,disabled:a,className:s(T,"w-full text-left"),style:h,...W},D);}else E=S.createElement("a",{ref:g,"data-gds-part":"sidebar-item","data-active":o||void 0,"aria-current":o?"page":void 0,"aria-disabled":a||void 0,className:T,style:h,...m},D);if(!u)return E;let $=l??(typeof d=="string"?d:null);return $?S.createElement(lo,null,S.createElement(co,{asChild:true},E),S.createElement(qt,{side:"right",sideOffset:8},$,t!=null&&S.createElement("span",{className:"ml-2 inline-flex items-center justify-center rounded bg-foreground/10 px-1.5 py-0 text-[10px]"},t))):E});Ka.displayName="SidebarItem";var qa=S.forwardRef(function({label:t,icon:o,badge:r,active:n=false,defaultExpanded:a=true,expanded:l,onExpandedChange:p,disabled:i,description:c,trailing:d,className:m,style:g,children:u,...b},h){let{collapsed:f}=sr("SidebarTreeItem"),y=ql(),R=l!==void 0,[x,k]=S.useState(a),T=R?l:x,O=()=>{let E=!T;R||k(E),p?.(E);};if(f)return S.createElement(_a.Provider,{value:y},u);let D=y*1.5;return S.createElement("div",{"data-gds-part":"sidebar-tree-item"},S.createElement("div",{className:"group/row relative"},S.createElement("button",{ref:h,type:"button",onClick:O,"aria-expanded":T,"aria-current":n?"page":void 0,"data-active":n||void 0,disabled:i,className:s("group flex w-full items-center gap-1.5 rounded-md py-1 text-sm font-medium transition-colors",n?"bg-primary/10 text-primary":"text-foreground/80 hover:bg-muted hover:text-foreground",i&&"opacity-50 pointer-events-none",d!=null&&"pr-12",m),style:{paddingLeft:`calc(0.25rem + ${D}rem)`,paddingRight:d!=null?"3rem":"0.5rem",...g},...b},S.createElement("span",{className:"inline-flex h-4 w-4 items-center justify-center text-muted-foreground shrink-0","aria-hidden":true},T?S.createElement(ChevronDown,{className:"h-3 w-3"}):S.createElement(ChevronRight,{className:"h-3 w-3"})),o&&S.createElement("span",{className:"shrink-0 [&>svg]:h-4 [&>svg]:w-4","aria-hidden":true},o),c!=null?S.createElement("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 text-left leading-tight"},S.createElement("span",{className:"truncate"},t),S.createElement("span",{className:"truncate text-[11px] font-normal text-muted-foreground"},c)):S.createElement("span",{className:"flex-1 truncate text-left"},t),r!=null&&S.createElement("span",{className:"ml-auto inline-flex items-center justify-center rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground"},r)),d!=null&&S.createElement("div",{onClick:E=>E.stopPropagation(),className:"pointer-events-auto absolute inset-y-0 right-1.5 flex items-center gap-0.5"},d)),T&&u&&S.createElement(_a.Provider,{value:y+1},S.createElement("div",{className:"space-y-[var(--gds-sidebar-section-gap,0.125rem)]"},u)))});qa.displayName="SidebarTreeItem";Yt.Header=Wa;Yt.Content=Ua;Yt.Footer=ja;Yt.Section=$a;Yt.Item=Ka;Yt.TreeItem=qa;var Zt=[50,100,200,300,400,500,600,700,800,900,950],Yl=[.985,.955,.895,.82,.72,.61,.51,.415,.325,.245,.17],wu=[.015,.04,.075,.11,.14,.17,.17,.15,.12,.08,.04];function qr({hue:e,chromaScale:t=1}){let o=(e%360+360)%360,r={};for(let n=0;n<Zt.length;n++){let a=Yl[n],l=wu[n]*t;r[Zt[n]]=`${a.toFixed(4)} ${l.toFixed(4)} ${o.toFixed(2)}`;}return r}function Zl(){let e={};for(let t=0;t<Zt.length;t++){let o=Yl[t];e[Zt[t]]=`${o.toFixed(4)} 0 0`;}return e}var Ya={light:{destructive:"0.560 0.220 27.0",destructiveFg:"0.990 0.005 27.0",success:"0.610 0.180 145.0",warning:"0.720 0.180 60.0",info:"0.580 0.200 240.0",highlight:"0.860 0.180 95.0"},dark:{destructive:"0.680 0.220 27.0",destructiveFg:"0.990 0.005 27.0",success:"0.720 0.180 145.0",warning:"0.800 0.180 60.0",info:"0.700 0.200 240.0",highlight:"0.880 0.180 95.0"}},lr="1 0 0",Xl="0 0 0";function No(e,t){let[,o,r]=e.split(/\s+/).map(d=>d.trim()),n=Number(o),a=r;if(t==="light"){let m=Math.min(n*.22,.045),g=.38,u=n;return {soft:`${.965.toFixed(3)} ${m.toFixed(3)} ${a}`,deep:`${g.toFixed(3)} ${u.toFixed(3)} ${a}`}}let l=.22,p=Math.min(n*.45,.075),i=.82,c=n*.9;return {soft:`${l.toFixed(3)} ${p.toFixed(3)} ${a}`,deep:`${i.toFixed(3)} ${c.toFixed(3)} ${a}`}}var Yr={geist:"var(--font-geist), system-ui, sans-serif",inter:"var(--font-inter), system-ui, sans-serif",manrope:"var(--font-manrope), system-ui, sans-serif",figtree:"var(--font-figtree), system-ui, sans-serif",dmSans:"var(--font-dm-sans), system-ui, sans-serif",lexend:"var(--font-lexend), system-ui, sans-serif",outfit:"var(--font-outfit), system-ui, sans-serif",plusJakarta:"var(--font-plus-jakarta), system-ui, sans-serif",spaceGrotesk:"var(--font-space-grotesk), system-ui, sans-serif",fraunces:"var(--font-fraunces), Georgia, serif",instrumentSerif:"var(--font-instrument-serif), Georgia, serif",sourceSerif:"var(--font-source-serif), Georgia, serif",jetbrainsMono:"var(--font-jetbrains-mono), ui-monospace, monospace",geistMono:"var(--font-geist-mono), ui-monospace, monospace",ibmPlexMono:"var(--font-ibm-plex-mono), ui-monospace, monospace",system:"system-ui, -apple-system, sans-serif",serif:"Georgia, 'Times New Roman', serif",mono:"ui-monospace, Menlo, monospace"};var Ru=["superLight","light","dark","superDark"],Su={muted:.6,default:1,vibrant:1.3};function Cu(e,t,o){let r=t.primary*o,n=t.accent*o,a=(r+n)/2*.8,l=p=>(p%360+360)%360;return {1:`0.600 ${(.17*r).toFixed(4)} ${e.primary.toFixed(2)}`,2:`0.640 ${(.17*a).toFixed(4)} ${l(e.primary+140).toFixed(2)}`,3:`0.580 ${(.17*a).toFixed(4)} ${l(e.primary+220).toFixed(2)}`,4:`0.510 0.0250 ${e.neutral.toFixed(2)}`,5:`0.620 ${(.17*n).toFixed(4)} ${e.accent.toFixed(2)}`}}var G=e=>({source:"neutral",step:e}),lt=e=>({source:"primary",step:e}),Xt=e=>({source:"accent",step:e}),dr=e=>({source:"pure",value:e}),ku={superLight:{background:G(50),foreground:G(800),card:dr(lr),cardForeground:G(800),popover:dr(lr),popoverForeground:G(800),primary:lt(600),primaryForeground:lt(50),secondary:G(100),secondaryForeground:G(700),muted:G(100),mutedForeground:G(500),accent:Xt(600),accentForeground:Xt(50),border:G(200),input:G(200),ring:lt(500)},light:{background:G(50),foreground:G(950),card:dr(lr),cardForeground:G(950),popover:dr(lr),popoverForeground:G(950),primary:lt(500),primaryForeground:lt(50),secondary:G(100),secondaryForeground:G(700),muted:G(100),mutedForeground:G(500),accent:Xt(500),accentForeground:Xt(50),border:G(200),input:G(200),ring:lt(500)},dark:{background:G(950),foreground:G(50),card:G(900),cardForeground:G(50),popover:G(900),popoverForeground:G(50),primary:lt(400),primaryForeground:lt(950),secondary:G(800),secondaryForeground:G(200),muted:G(800),mutedForeground:G(400),accent:Xt(400),accentForeground:Xt(950),border:G(800),input:G(800),ring:lt(400)},superDark:{background:dr(Xl),foreground:G(100),card:G(950),cardForeground:G(100),popover:G(950),popoverForeground:G(100),primary:lt(300),primaryForeground:lt(950),secondary:G(900),secondaryForeground:G(300),muted:G(900),mutedForeground:G(500),accent:Xt(300),accentForeground:Xt(950),border:G(900),input:G(900),ring:lt(300)}};function Ae(e,t){return e.source==="pure"?e.value:t[e.source][e.step]}function Tu(e,t){let o=ku[t],r=t==="superLight"||t==="light",n=r?Ya.light:Ya.dark;return {background:Ae(o.background,e),foreground:Ae(o.foreground,e),card:Ae(o.card,e),cardForeground:Ae(o.cardForeground,e),popover:Ae(o.popover,e),popoverForeground:Ae(o.popoverForeground,e),primary:Ae(o.primary,e),primaryForeground:Ae(o.primaryForeground,e),secondary:Ae(o.secondary,e),secondaryForeground:Ae(o.secondaryForeground,e),muted:Ae(o.muted,e),mutedForeground:Ae(o.mutedForeground,e),accent:Ae(o.accent,e),accentForeground:Ae(o.accentForeground,e),border:Ae(o.border,e),input:Ae(o.input,e),ring:Ae(o.ring,e),destructive:n.destructive,destructiveForeground:n.destructiveFg,success:n.success,warning:n.warning,info:n.info,highlight:n.highlight,...(()=>{let a=r?"light":"dark",l=No(n.destructive,a),p=No(n.success,a),i=No(n.warning,a),c=No(n.info,a),d=No(n.highlight,a);return {destructiveSoft:l.soft,destructiveDeep:l.deep,successSoft:p.soft,successDeep:p.deep,warningSoft:i.soft,warningDeep:i.deep,infoSoft:c.soft,infoDeep:c.deep,highlightSoft:d.soft,highlightDeep:d.deep}})()}}var Ft={display:3.75,h1:2.5,h2:2,h3:1.5,h4:1.25,h5:1.125,h6:1,body:1,bodySm:.875},Pu={compact:.85,default:1,spacious:1.18};function Mu(e){let t=Pu[e.scale],o=r=>`${(r*t).toFixed(3)}rem`;return {fontSans:Yr[e.body],fontMono:Yr[e.mono],fontDisplay:Yr[e.display],headingWeight:e.headingWeight??600,bodyWeight:e.bodyWeight??400,headingTracking:e.headingTracking??"-0.01em",scale:{display:o(Ft.display),h1:o(Ft.h1),h2:o(Ft.h2),h3:o(Ft.h3),h4:o(Ft.h4),h5:o(Ft.h5),h6:o(Ft.h6),body:o(Ft.body),bodySm:o(Ft.bodySm)}}}var Nu={sharp:0,subtle:.25,soft:.5,round:.875,pill:1.25};function Eu(e){let t=Nu[e.style],o=r=>`${r.toFixed(3)}rem`;return {base:o(t),sm:o(Math.max(0,t-.25)),md:o(t),lg:o(t+.25),xl:o(t+.5),"2xl":o(t+1),full:"9999px"}}var Lu={tight:.85,default:1,roomy:1.2};function Du(e){return {baseUnit:"1rem",densityFactor:Lu[e.density]}}var Au={none:{sm:"none",md:"none",lg:"none",xl:"none","2xl":"none",inner:"none"},subtle:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.03)",md:"0 2px 4px -1px rgb(0 0 0 / 0.04), 0 1px 2px -1px rgb(0 0 0 / 0.03)",lg:"0 6px 14px -2px rgb(0 0 0 / 0.05)",xl:"0 12px 24px -4px rgb(0 0 0 / 0.06)","2xl":"0 24px 48px -12px rgb(0 0 0 / 0.12)",inner:"inset 0 1px 2px 0 rgb(0 0 0 / 0.03)"},default:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)"},dramatic:{sm:"0 2px 4px 0 rgb(0 0 0 / 0.12)",md:"0 8px 16px -2px rgb(0 0 0 / 0.18), 0 4px 8px -4px rgb(0 0 0 / 0.12)",lg:"0 20px 32px -4px rgb(0 0 0 / 0.22), 0 8px 16px -8px rgb(0 0 0 / 0.18)",xl:"0 32px 48px -6px rgb(0 0 0 / 0.28), 0 12px 24px -10px rgb(0 0 0 / 0.22)","2xl":"0 48px 80px -16px rgb(0 0 0 / 0.45)",inner:"inset 0 4px 8px 0 rgb(0 0 0 / 0.1)"}};function Hu(e){let t=e?.shadows??"default",o=e?.motionIntensity??1,r=n=>`${Math.round(n*o)}ms`;return {shadows:Au[t],motion:{fast:r(150),base:r(200),slow:r(300),slower:r(500)},borderWidth:e?.borderWidth??"1px"}}function po(e){let t=Su[e.intensity??"default"],o=e.neutralPureGray??false,r=(e.chroma?.neutral??.08)*t,n=(e.chroma?.primary??1)*t,a=(e.chroma?.accent??1)*t,l=o?Zl():qr({hue:e.hues.neutral,chromaScale:r}),p=qr({hue:e.hues.primary,chromaScale:n}),i=qr({hue:e.hues.accent,chromaScale:a}),c={neutral:l,primary:p,accent:i},d=Cu(e.hues,{primary:n,accent:a},t),m=Object.fromEntries(Ru.map(y=>[y,Tu(c,y)])),g=Mu(e.typography),u=Eu(e.radius),b=Du(e.spacing),h=Hu(e.effects),f={buttonShape:e.components?.buttonShape??"default",inputStyle:e.components?.inputStyle??"outlined",cardStyle:e.components?.cardStyle??"flat"};return {id:e.id,name:e.name,description:e.description,tagline:e.tagline,input:e,ramps:c,colors:m,chart:d,typography:g,radius:u,spacing:b,effects:h,components:f}}var cr={id:"calm",name:"Calm",description:"Warm neutrals, terracotta primary, serif typography.",tagline:"Signature",hues:{neutral:40,primary:20,accent:40},chroma:{neutral:.15,primary:.75,accent:.8},intensity:"muted",typography:{display:"fraunces",body:"fraunces",mono:"jetbrainsMono",scale:"default",headingWeight:600,headingTracking:"-0.02em"},spacing:{density:"roomy"},radius:{style:"round"},effects:{shadows:"subtle",motionIntensity:1.25},components:{buttonShape:"pill",inputStyle:"outlined",cardStyle:"outlined"}},Za={id:"energy",name:"Energy",description:"Teal + indigo \u2014 punchy, cool-tone, modern sans.",tagline:"Alternate",hues:{neutral:175,primary:175,accent:235},chroma:{neutral:.08,primary:1,accent:1},intensity:"vibrant",typography:{display:"geist",body:"geist",mono:"geistMono",scale:"default",headingWeight:600},spacing:{density:"default"},radius:{style:"soft"},effects:{shadows:"default",motionIntensity:1},components:{buttonShape:"default",inputStyle:"outlined",cardStyle:"flat"}},Zr=[cr,Za];function Iu(e){return {"--background":e.background,"--foreground":e.foreground,"--card":e.card,"--card-foreground":e.cardForeground,"--popover":e.popover,"--popover-foreground":e.popoverForeground,"--primary":e.primary,"--primary-foreground":e.primaryForeground,"--secondary":e.secondary,"--secondary-foreground":e.secondaryForeground,"--muted":e.muted,"--muted-foreground":e.mutedForeground,"--accent":e.accent,"--accent-foreground":e.accentForeground,"--destructive":e.destructive,"--destructive-foreground":e.destructiveForeground,"--border":e.border,"--input":e.input,"--ring":e.ring,"--success":e.success,"--warning":e.warning,"--info":e.info,"--highlight":e.highlight,"--destructive-soft":e.destructiveSoft,"--destructive-deep":e.destructiveDeep,"--success-soft":e.successSoft,"--success-deep":e.successDeep,"--warning-soft":e.warningSoft,"--warning-deep":e.warningDeep,"--info-soft":e.infoSoft,"--info-deep":e.infoDeep,"--highlight-soft":e.highlightSoft,"--highlight-deep":e.highlightDeep}}function Ja(e,t){let o=e.colors[t];return {...Iu(o),...Xa("neutral",e.ramps.neutral),...Xa("primary",e.ramps.primary),...Xa("accent",e.ramps.accent),"--chart-1":e.chart[1],"--chart-2":e.chart[2],"--chart-3":e.chart[3],"--chart-4":e.chart[4],"--chart-5":e.chart[5],"--font-sans":e.typography.fontSans,"--font-mono":e.typography.fontMono,"--font-display":e.typography.fontDisplay,"--font-heading-weight":String(e.typography.headingWeight),"--font-body-weight":String(e.typography.bodyWeight),"--font-heading-tracking":e.typography.headingTracking,"--text-display":e.typography.scale.display,"--text-h1":e.typography.scale.h1,"--text-h2":e.typography.scale.h2,"--text-h3":e.typography.scale.h3,"--text-h4":e.typography.scale.h4,"--text-h5":e.typography.scale.h5,"--text-h6":e.typography.scale.h6,"--text-body":e.typography.scale.body,"--text-body-sm":e.typography.scale.bodySm,"--radius":e.radius.base,"--gds-radius-sm":e.radius.sm,"--gds-radius-md":e.radius.md,"--gds-radius-lg":e.radius.lg,"--gds-radius-xl":e.radius.xl,"--gds-radius-2xl":e.radius["2xl"],"--gds-radius-full":e.radius.full,"--gds-density":String(e.spacing.densityFactor),"--gds-shadow-sm":e.effects.shadows.sm,"--gds-shadow-md":e.effects.shadows.md,"--gds-shadow-lg":e.effects.shadows.lg,"--gds-shadow-xl":e.effects.shadows.xl,"--gds-shadow-2xl":e.effects.shadows["2xl"],"--gds-shadow-inner":e.effects.shadows.inner,"--gds-transition-fast":e.effects.motion.fast,"--gds-transition-base":e.effects.motion.base,"--gds-transition-slow":e.effects.motion.slow,"--gds-transition-slower":e.effects.motion.slower,"--gds-border-width":e.effects.borderWidth}}function Xa(e,t){let o={};for(let r of Zt)o[`--ramp-${e}-${r}`]=t[r];return o}function Xr(e,t){if(typeof document>"u")return;let o=document.documentElement,r=Ja(e,t);for(let[n,a]of Object.entries(r))o.style.setProperty(n,a);o.setAttribute("data-grade-theme",e.id),o.setAttribute("data-mode",t),o.setAttribute("data-button-shape",e.components.buttonShape??"default"),o.setAttribute("data-input-style",e.components.inputStyle??"outlined"),o.setAttribute("data-card-style",e.components.cardStyle??"flat");}function pr(e){if(typeof document>"u")return "";let t=document.createElement("span");t.style.color=`oklch(${e})`,t.style.position="absolute",t.style.visibility="hidden",document.body.appendChild(t);let o=getComputedStyle(t).color;document.body.removeChild(t);let r=o.match(/\d+/g);if(!r||r.length<3)return "";let[n,a,l]=r.slice(0,3).map(Number);return "#"+[n,a,l].map(p=>Math.max(0,Math.min(255,p)).toString(16).padStart(2,"0")).join("").toUpperCase()}function Fu(e){let t=e.trim().split(/\s+/);if(t.length<3)return {oklch:e,hex:""};let[o,r,n]=t.map(Number),a=`${o.toFixed(3)} ${r.toFixed(3)} ${Math.round(n)}`,l=pr(e);return {oklch:a,hex:l}}function Qa(e,t,o){let r=[`### ${e} ramp (hue ${Math.round(o)}\xB0)`,"","| Step | OKLCH | Hex |","|------|-------|-----|"];for(let n of Zt){let{oklch:a,hex:l}=Fu(t[n]);r.push(`| ${n} | \`${a}\` | \`${l||"\u2014"}\` |`);}return r.join(`
117
- `)}function Jl(e,t){let o=[`### ${e}`,"","| Token | Usage | Light (hex) | Dark (hex) |","|-------|-------|-------------|------------|"];for(let r of t){let n=pr(r.light)||"\u2014",a=pr(r.dark)||"\u2014";o.push(`| \`--${r.token}\` | ${r.usage} | \`${n}\` (\`${r.light}\`) | \`${a}\` (\`${r.dark}\`) |`);}return o.join(`
118
- `)}function Ql(e){return !e||e.input==null?"{}":JSON.stringify(e.input,null,2)??"{}"}function ed(e){let{input:t,ramps:o,colors:r,chart:n,typography:a,radius:l,spacing:p,effects:i,components:c}=e,d=t.intensity??"default",m=h=>({token:h,usage:Bu[h]??"",light:r.light[h],dark:r.dark[h]}),g=["background","foreground","card","cardForeground","popover","popoverForeground","primary","primaryForeground","secondary","secondaryForeground","muted","mutedForeground","accent","accentForeground","border","input","ring"].map(m),u=["destructive","destructiveForeground","success","warning","info","highlight"].map(m),b=[1,2,3,4,5].map(h=>{let f=n[h];return {slot:h,triplet:f,hex:pr(f)||"\u2014"}});return `# ${e.name} \u2014 Grade Design System Theme
114
+ `)),fe(240,Mt)}let ir=oe.speed?qo[oe.speed].tokenStagger:Nt.speed.tokenStagger,vt=Ke.current,sr=vt.length>0&&!vt.endsWith(`
115
+ `)?vt+`
116
+ `:vt;await fe(60,Mt);for(let Ge=0;Ge<oe.text.length;Ge++){if(Mt.aborted)return;let yt=sr+oe.text.slice(0,Ge+1);Xt(yt),Ge<oe.text.length-1&&await fe(ir,Mt);}}});C.useEffect(()=>{Y&&me(bo);},[Y,bo]);let ue=h??(a==="typewriter"||Y);return C.createElement("div",{ref:B,"data-gds-part":"code","data-gds-reveal":a,"data-gds-trigger":i,"data-gds-size":y,className:l("gds-code relative w-full overflow-hidden",fm[y],!b&&["rounded-lg border bg-[var(--gds-code-bg)] text-[var(--gds-code-fg)]","border-border/60"],H),style:E,...D},g&&!b?C.createElement("div",{"data-gds-part":"code-header",className:"flex items-center justify-between border-b border-border/60 px-4 py-2 text-xs text-muted-foreground"},C.createElement("span",{className:"font-mono"},g),o?C.createElement("span",{className:"uppercase tracking-wider opacity-60"},o):null):null,C.createElement(Highlight,{code:P,language:o,theme:bm},({tokens:oe,getLineProps:Nt,getTokenProps:Mt})=>C.createElement("pre",{"data-gds-part":"code-pre",className:l("font-mono leading-relaxed",b?"p-0":"px-0 py-3",u?"whitespace-pre-wrap break-words":"overflow-x-auto whitespace-pre",(S!==void 0||k!==void 0)&&"overflow-y-auto"),style:{background:"transparent",margin:0,...k!==void 0?{height:`calc(${k} * 1lh + 0.5rem)`}:S!==void 0&&S!=="auto"?{height:typeof S=="number"?`${S}px`:S}:null}},oe.map((ir,vt)=>{let sr=vt+1,Ge=ym(sr,n,te),yt=Nt({line:ir}),lr=vt===oe.length-1,dr=Y&&pe.has(sr),Ya=ue&&lr&&(!Le||h===true),cr=l("flex w-full pr-4",b?"pl-0":"pl-4",Ge==="added"&&"bg-[var(--gds-code-diff-added-bg)] text-[var(--gds-code-diff-added-fg)]",Ge==="removed"&&"bg-[var(--gds-code-diff-removed-bg)] text-[var(--gds-code-diff-removed-fg)]",Ge==="highlight"&&"bg-[var(--gds-code-line-highlight-bg)] shadow-[inset_2px_0_0_0_var(--gds-code-line-highlight-marker)]"),_o=C.createElement(C.Fragment,null,ne?C.createElement("span",{"data-gds-part":"code-gutter",className:l("select-none pr-3 text-right font-mono text-xs leading-relaxed opacity-60",se?"w-10":"w-8"),"aria-hidden":true},se?C.createElement("span",{className:"inline-block w-3 text-center"},Ge==="added"?"+":Ge==="removed"?"-":" "):null,m?C.createElement("span",{className:"ml-1 tabular-nums"},sr):null):null,C.createElement("span",{className:"flex-1",style:dr?{color:"var(--gds-code-comment)"}:void 0},f&&!dr?C.createElement("span",{"data-gds-part":"code-prompt","aria-hidden":true,className:"select-none opacity-60",style:{color:"var(--gds-code-comment)"}},f):null,a==="typewriter"&&Z&&!Y?C.createElement(xm,{line:ir,getTokenProps:Mt,delay:de+q+vt*$e,stagger:$e}):ir.map((ep,tp)=>C.createElement("span",{key:tp,...Mt({token:ep})})),Ya&&!dr?C.createElement(ua,{"data-gds-part":"code-cursor"}):null));return a==="none"||a==="typewriter"||Y||!Z?C.createElement("div",{key:vt,...yt,className:l(yt.className,cr),style:{...yt.style,opacity:i!=="mount"&&!Z&&a!=="none"?0:void 0}},_o):C.createElement(motion.div,{key:vt,...yt,className:l(yt.className,cr),initial:{opacity:0,y:a==="diff"?Ge==="removed"?-4:6:4},animate:{opacity:1,y:0},transition:{delay:(de+q+vt*$e)/1e3,duration:A.fadeMs/1e3,ease:[.22,1,.36,1]},style:yt.style},_o)}))))});Rl.displayName="Code";function xm({line:e,getTokenProps:t,delay:o,stagger:r}){let n=0;return C.createElement(C.Fragment,null,e.map((a,i)=>{let p=/^\s*$/.test(a.content),s=t({token:a});if(p)return C.createElement("span",{key:i,...s});let c=n++;return C.createElement(motion.span,{key:i,...s,initial:{opacity:0},animate:{opacity:1},transition:{delay:(o+c*r)/1e3,duration:.12}})}))}var wm={default:{row:"gap-3",content:"space-y-1",author:"text-sm font-semibold",meta:"text-xs",body:"text-sm leading-relaxed",thread:"text-xs"},compact:{row:"gap-2",content:"space-y-0.5",author:"text-xs font-semibold",meta:"text-[10px]",body:"text-xs leading-relaxed",thread:"text-[11px]"}},Rm=C.forwardRef(function({author:t,timestamp:o,avatar:r,badge:n,edited:a,pinned:i,actions:p,reactions:s,threadCount:c,onThreadClick:d,align:m="start",density:g="default",className:u,children:b,...f},h){let v=m==="end",w=a===true?"(edited)":a||void 0,y=wm[g];return C.createElement("div",{ref:h,"data-gds-part":"message","data-gds-align":m,"data-gds-density":g,"data-gds-pinned":i?"true":void 0,className:l("flex items-start",y.row,v&&"flex-row-reverse",u),...f},r&&C.createElement("div",{"data-gds-part":"message-avatar",className:"flex-shrink-0"},r),C.createElement("div",{"data-gds-part":"message-content",className:l("flex-1 min-w-0",y.content,v&&"text-right")},i&&C.createElement("div",{"data-gds-part":"message-pinned",className:l("flex items-center gap-1 text-[10px] uppercase tracking-wider text-muted-foreground",v&&"flex-row-reverse")},C.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3",fill:"currentColor"},C.createElement("path",{d:"M9.828.722a.5.5 0 0 1 .707 0l4.743 4.743a.5.5 0 0 1 0 .707l-2.121 2.121a.5.5 0 0 1-.354.146h-1.792l-3.586 3.586v2.293a.5.5 0 0 1-.854.354L4.146 12.39 1 15.535V14.12l3.146-3.146-1.293-1.293a.5.5 0 0 1 .354-.854h2.293l3.586-3.586V3.45a.5.5 0 0 1 .146-.354L9.828.722Z"})),"Pinned"),C.createElement("div",{"data-gds-part":"message-header",className:l("flex items-baseline gap-2 flex-wrap",v&&"flex-row-reverse")},C.createElement("span",{"data-gds-part":"message-author",className:y.author},t),n&&C.createElement("div",{"data-gds-part":"message-badge"},n),o&&C.createElement("span",{"data-gds-part":"message-timestamp",className:l(y.meta,"text-muted-foreground")},o),w&&C.createElement("span",{"data-gds-part":"message-edited",className:l(y.meta,"text-muted-foreground")},w),p&&C.createElement("div",{"data-gds-part":"message-actions",className:l(v?"mr-auto":"ml-auto")},p)),C.createElement("div",{"data-gds-part":"message-body",className:y.body},b),s&&C.createElement("div",{"data-gds-part":"message-reactions",className:l("flex flex-wrap gap-1 pt-1",v&&"justify-end")},s),typeof c=="number"&&c>0&&C.createElement("button",{type:"button","data-gds-part":"message-thread",onClick:d,className:l("inline-flex items-center gap-1 font-medium",y.thread,"text-primary hover:underline","focus:outline-none focus-visible:ring-2 focus-visible:ring-primary rounded",v&&"flex-row-reverse")},C.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3 w-3",fill:"currentColor"},C.createElement("path",{d:"M2 3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H6.414l-2.707 2.707A1 1 0 0 1 2 12V3Z"})),c," ",c===1?"reply":"replies")))});function uu({onSubmit:e,enabled:t}){let[o]=useLexicalComposerContext();return C.useEffect(()=>{if(t)return o.registerCommand(KEY_ENTER_COMMAND,r=>r&&r.shiftKey?false:(r?.preventDefault(),e(),true),COMMAND_PRIORITY_HIGH)},[o,t,e]),null}function gu({onImageFiles:e,enabled:t}){let[o]=useLexicalComposerContext();return C.useEffect(()=>{if(!t)return;let r=o.getRootElement();if(!r)return;let n=a=>{let p=Array.from(a.clipboardData?.items??[]).filter(s=>s.kind==="file"&&s.type.startsWith("image/")).map(s=>s.getAsFile()).filter(s=>s!==null);p.length>0&&(a.preventDefault(),e(p));};return r.addEventListener("paste",n),()=>r.removeEventListener("paste",n)},[o,t,e]),null}function fu({enabled:e}){let[t]=useLexicalComposerContext();return C.useEffect(()=>{e&&t.focus();},[t,e]),null}var kl={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikethrough",code:"code"};function Cl(e,t){let o=kl[t];if(o){e.dispatchCommand(FORMAT_TEXT_COMMAND,o);return}if(t==="ul"){e.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND,void 0);return}if(t==="ol"){e.dispatchCommand(INSERT_ORDERED_LIST_COMMAND,void 0);return}e.update(()=>{let r=$getSelection();if($isRangeSelection(r)){if(t==="h1"||t==="h2"||t==="h3"){let n=t;$setBlocksType(r,()=>$createHeadingNode(n));return}(t==="blockquote"||t==="pullquote")&&$setBlocksType(r,()=>{let n=$createQuoteNode();return t==="pullquote"&&(n.__pullquote=true),n});}});}function hu(e,t,o,r){e.update(()=>{let n=$getSelection();if(!$isRangeSelection(n))return;let a=$createBeautifulMentionNode(t,o,r);n.insertNodes([a]),n.insertText(" ");});}function bu(e,t){let o=false;return e.update(()=>{let r=$getRoot(),a=r.getTextContent().indexOf(t);if(a===-1)return;let i=0,p=null,s=0,c=null,d=0,m=g=>{if(!(p&&c)){if(g.getType()==="text"){let u=g,b=u.getTextContentSize(),f=i,h=i+b;!p&&a>=f&&a<h&&(p=u,s=a-f);let v=a+t.length;!c&&v>f&&v<=h&&(c=u,d=v-f),i=h;return}if("getChildren"in g)for(let u of g.getChildren())m(u);else i+=g.getTextContentSize();}};if(m(r),p&&c){let g=p,u=c;g.select(s,0).focus.set(u.getKey(),d,"text"),o=true;}}),o}function Cr(e){e.update(()=>{let t=$getRoot();t.clear();let o=$createParagraphNode();t.append(o),o.select();});}function Tl(e){let t="",o="",r=[];return e.getEditorState().read(()=>{t=$getRoot().getTextContent(),o=JSON.stringify(e.getEditorState().toJSON());let n=a=>{if(a.getType()==="beautifulMention"){let i=a;r.push({trigger:i.getTrigger(),value:i.getValue(),data:i.getData()});}if("getChildren"in a)for(let i of a.getChildren())n(i);};n($getRoot());}),{text:t,json:o,mentions:r}}var vu=[{format:"bold",icon:Bold,label:"Bold"},{format:"italic",icon:Italic,label:"Italic"},{format:"underline",icon:Underline,label:"Underline"},{format:"strikethrough",icon:Strikethrough,label:"Strikethrough"},{format:"code",icon:Code,label:"Inline code"},{format:"h1",icon:Heading1,label:"Heading 1"},{format:"h2",icon:Heading2,label:"Heading 2"},{format:"h3",icon:Heading3,label:"Heading 3"},{format:"blockquote",icon:Quote,label:"Blockquote"},{format:"ul",icon:List,label:"Bulleted list"},{format:"ol",icon:ListOrdered,label:"Numbered list"}];function yu({formats:e}){let[t]=useLexicalComposerContext(),[o,r]=C.useState(()=>new Set);C.useEffect(()=>mergeRegister(t.registerUpdateListener(({editorState:a})=>{a.read(()=>{let i=$getSelection();if(!$isRangeSelection(i))return;let p=new Set;for(let s of ["bold","italic","underline","strikethrough","code"])i.hasFormat(s)&&p.add(s);r(p);});})),[t]);let n=vu.filter(a=>e.includes(a.format));return C.createElement("div",{"data-gds-part":"composer-toolbar",className:l("flex flex-wrap items-center gap-0.5","px-2 py-1")},n.map(({format:a,icon:i,label:p})=>{let s=kl[a],c=s?o.has(s):false;return C.createElement("button",{key:a,type:"button","aria-label":p,title:p,"data-gds-part":"composer-toolbar-button","data-gds-active":c?"true":"false",onClick:()=>Cl(t,a),className:l("h-7 w-7 inline-flex items-center justify-center rounded","text-[var(--gds-composer-toolbar-fg)]","hover:bg-[var(--gds-composer-toolbar-hover-bg)]","focus:outline-none focus:ring-2 focus:ring-primary",c&&"bg-[var(--gds-composer-toolbar-active-bg)] text-[var(--gds-composer-toolbar-active-fg)]")},C.createElement(i,{className:"h-3.5 w-3.5"}))}))}function xu({attachments:e,onRemove:t}){return C.createElement(AnimatePresence,{initial:false},e.length>0&&C.createElement(motion.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.18},className:"overflow-hidden"},C.createElement("div",{"data-gds-part":"composer-attachments",className:"flex flex-wrap gap-2 px-2 py-2"},e.map(o=>C.createElement("div",{key:o.id,className:"relative group"},o.file.type.startsWith("image/")?C.createElement("img",{src:o.previewUrl,alt:o.name,className:"h-14 w-14 rounded-md object-cover border border-[var(--gds-composer-border)]"}):C.createElement("div",{className:"h-14 w-14 rounded-md border border-[var(--gds-composer-border)] flex items-center justify-center text-xs px-1 text-center text-[var(--gds-composer-muted-fg)]"},o.name.slice(0,18)),C.createElement("button",{type:"button",onClick:()=>t(o.id),"aria-label":`Remove ${o.name}`,className:l("absolute -top-1.5 -right-1.5 h-5 w-5 rounded-full","bg-[var(--gds-composer-chip-remove-bg)]","text-[var(--gds-composer-chip-remove-fg)]","flex items-center justify-center","opacity-0 group-hover:opacity-100 focus:opacity-100","focus:outline-none focus:ring-2 focus:ring-primary","transition-opacity")},C.createElement(X$1,{className:"w-3 h-3"})))))))}function wu({placeholder:e,triggers:t,attachmentsCfg:o,formatList:r,showToolbar:n,isLoading:a,onStop:i,maxLength:p,autoFocus:s,submitOnEnter:c=true,leftActions:d,rightActions:m,hideSend:g,steps:u,trigger:b="mount",play:f,speed:h="normal",loop:v=false,loopDelay:w,onLoopReset:y,bare:S,className:k,onSubmit:H,onChange:E,readOnly:D,handleEditorReady:U,submitRef:A,restartRef:q,attachments:F,setAttachments:Y,ingestImages:J}){let[z]=useLexicalComposerContext(),pe=C.useRef(null),x=C.useRef(null),[I,P]=C.useState(false);C.useEffect(()=>{U(z);},[z,U]),C.useEffect(()=>{z.setEditable(!D);},[z,D]);let te=C.useRef(E);te.current=E,C.useEffect(()=>z.registerUpdateListener(({editorState:L})=>{L.read(()=>{let de=$getRoot().getTextContent();P(de.trim().length>0),te.current?.(de);});}),[z]);let se=C.useCallback(()=>{if(a)return;let L=Tl(z),de=L.text.trim().length>0,Z=F.length>0;!de&&!Z||(H?.(L,Z?F:void 0),Cr(z),F.forEach($e=>URL.revokeObjectURL($e.previewUrl)),Y([]));},[z,a,F,H,Y]);A.current=se;let{restart:ne}=no({steps:u,speed:h,trigger:b,play:f,loop:v,loopDelay:w,containerRef:pe,onLoopReset:()=>{Cr(z),y?.();},interpret:async(L,de)=>{let Z=de.signal;if(L.type==="wait")return fe(L.ms,Z);if(L.type==="clear")return Cr(z),fe(120,Z);if(L.type==="newline")return z.update(()=>{let le=$getSelection();$isRangeSelection(le)&&le.insertParagraph();}),fe(60,Z);if(L.type==="submit")return se(),fe(120,Z);if(L.type==="format")return Cl(z,L.format),z.update(()=>{let le=$getSelection();if(!$isRangeSelection(le)||le.isCollapsed())return;let De=le.focus;le.anchor.set(De.key,De.offset,De.type);}),fe(80,Z);if(L.type==="select")return bu(z,L.text),fe(120,Z);if(L.type==="mention")return L.query&&(z.update(()=>{let le=$getSelection();$isRangeSelection(le)&&le.insertText(L.trigger);}),await pa(L.query,le=>{z.update(()=>{let De=$getRoot(),rt=De.getTextContent(),Ke=rt.slice(0,rt.length-L.trigger.length-(le.length-1));De.clear();let at=$createParagraphNode();Ke&&at.append($createTextNode(Ke)),at.append($createTextNode(L.trigger+le)),De.append(at);});},de.speed.tokenStagger,Z),await fe(180,Z),z.update(()=>{let le=$getRoot(),De=le.getTextContent(),rt=L.trigger.length+L.query.length,Ke=De.slice(0,De.length-rt);le.clear();let at=$createParagraphNode();Ke&&at.append($createTextNode(Ke)),le.append(at),at.select();})),hu(z,L.trigger,L.value),fe(120,Z);let $e=L.speed?{slow:70,normal:22,fast:8}[L.speed]:de.speed.tokenStagger;for(let le=0;le<L.text.length;le++){if(Z.aborted)return;let De=L.text[le];z.update(()=>{let rt=$getSelection();if(!$isRangeSelection(rt)){$getRoot().selectEnd();let Ke=$getSelection();$isRangeSelection(Ke)&&Ke.insertText(De);return}rt.insertText(De);}),le<L.text.length-1&&await fe($e,Z);}}});C.useEffect(()=>{q.current=L=>{Cr(z),ne(L);};},[z,ne,q]);let B=!D&&!m&&!g,Le=!D&&!d&&o!==null,me=!D&&(Le||d||B||m);return C.createElement("div",{ref:pe,"data-gds-part":"composer","data-gds-loading":a?"true":"false",className:l("w-full",!S&&["rounded-md","bg-transparent","border border-input","shadow-sm","focus-within:outline-none focus-within:ring-1 focus-within:ring-ring","transition-colors"],k)},n&&C.createElement(yu,{formats:r}),o&&C.createElement(xu,{attachments:F,onRemove:L=>{Y(de=>{let Z=de.find($e=>$e.id===L);return Z&&URL.revokeObjectURL(Z.previewUrl),de.filter($e=>$e.id!==L)});}}),C.createElement("div",{className:"relative"},C.createElement(RichTextPlugin,{contentEditable:C.createElement(ContentEditable,{"data-gds-part":"composer-editor",className:l("outline-none","px-3 sm:px-4 py-3","text-sm text-[var(--gds-composer-fg)]","min-h-[44px] max-h-[300px] overflow-y-auto","[&_p]:m-0 [&_p+p]:mt-2","[&_h1]:text-xl [&_h1]:font-semibold [&_h1]:mt-2","[&_h2]:text-lg [&_h2]:font-semibold [&_h2]:mt-2","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:mt-2","[&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5","[&_blockquote]:border-l-2 [&_blockquote]:border-[var(--gds-composer-border)] [&_blockquote]:pl-3 [&_blockquote]:italic","[&_code]:bg-[var(--gds-composer-toolbar-active-bg)] [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-xs [&_code]:font-mono",a&&"opacity-60 pointer-events-none"),"aria-placeholder":e??"",placeholder:C.createElement("div",{"data-gds-part":"composer-placeholder",className:"absolute top-3 left-3 sm:left-4 text-sm text-muted-foreground pointer-events-none select-none"},e),spellCheck:true}),ErrorBoundary:LexicalErrorBoundary}),C.createElement(HistoryPlugin,null),C.createElement(ListPlugin,null),C.createElement(LinkPlugin,null),C.createElement(OnChangePlugin,{onChange:()=>{}}),C.createElement(fu,{enabled:!!s}),C.createElement(uu,{onSubmit:se,enabled:c}),o&&C.createElement(gu,{onImageFiles:J,enabled:true}),t.length>0&&C.createElement(BeautifulMentionsPlugin,{items:t.reduce((L,de)=>(typeof de.items=="function"||(L[de.char]=de.items.map(Z=>({value:Z.value}))),L),{})})),me&&C.createElement("div",{"data-gds-part":"composer-actions",className:"flex items-center justify-between gap-2 px-2 pb-2 pt-1"},C.createElement("div",{className:"flex items-center gap-1"},d??(Le&&C.createElement("button",{type:"button",onClick:()=>x.current?.click(),disabled:a,"aria-label":"Attach image",title:"Attach image",className:l("h-8 w-8 rounded-lg flex items-center justify-center","text-[var(--gds-composer-action-fg)]","hover:text-[var(--gds-composer-fg)]","hover:bg-[var(--gds-composer-toolbar-hover-bg)]","focus:outline-none focus:ring-2 focus:ring-primary","transition-colors","disabled:opacity-50 disabled:cursor-not-allowed")},C.createElement(Paperclip,{className:"w-4 h-4"})))),m??(B&&C.createElement("button",{type:"button",onClick:a?i:se,disabled:a?!i:!I&&F.length===0,"aria-label":a?"Stop":"Send",className:l("h-8 w-8 rounded-lg flex items-center justify-center transition-colors flex-shrink-0","focus:outline-none focus:ring-2 focus:ring-primary",a?"bg-red-500 hover:bg-red-600 text-white disabled:opacity-50":I||F.length>0?"bg-primary hover:bg-primary/90 text-primary-foreground":"bg-[var(--gds-composer-toolbar-active-bg)] text-[var(--gds-composer-muted-fg)] cursor-not-allowed")},a?C.createElement(Square,{className:"w-3.5 h-3.5"}):C.createElement(Send,{className:"w-3.5 h-3.5"}))),o&&C.createElement("input",{ref:x,type:"file",accept:o.accept,multiple:o.multiple,onChange:L=>{L.target.files&&J(Array.from(L.target.files)),L.target.value="";},className:"sr-only",tabIndex:-1,"aria-hidden":"true"})))}var Pl=C.forwardRef(function(t,o){let{initialText:r,initialJson:n,formats:a,toolbar:i,triggers:p,attachments:s,...c}=t,d=C.useMemo(()=>a===false?[]:a??["bold","italic","underline","strikethrough","code","h1","h2","blockquote","ul","ol"],[a]),m=i===true||i==="top",g=C.useMemo(()=>{if(!s)return null;let A=s===true?{}:s;return A.enabled===false?null:{enabled:true,accept:A.accept??"image/*",maxItems:A.maxItems??10,multiple:A.multiple??true}},[s]),[u,b]=C.useState([]),f=C.useRef(u);f.current=u,C.useEffect(()=>()=>{f.current.forEach(A=>URL.revokeObjectURL(A.previewUrl));},[]);let h=C.useCallback(A=>{if(!g)return;let q=A.filter(F=>g.accept?g.accept==="image/*"?F.type.startsWith("image/"):g.accept.split(",").some(Y=>{let J=Y.trim();return J.endsWith("/*")?F.type.startsWith(J.slice(0,-1)):F.type===J||F.name.toLowerCase().endsWith(J)}):true);q.length!==0&&b(F=>{let Y=g.maxItems-F.length;if(Y<=0)return F;let J=q.slice(0,Y).map(z=>({id:`${z.name}-${z.size}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,file:z,previewUrl:URL.createObjectURL(z),name:z.name}));return [...F,...J]});},[g]),v=C.useRef(null),w=C.useRef(()=>{}),y=C.useRef(()=>{}),S=C.useCallback(A=>{v.current=A;},[]);C.useImperativeHandle(o,()=>({play:A=>{console.warn('[Composer] handle.play(steps) is not wired in v1 \u2014 pass `steps` + `trigger="manual"` and toggle `play` instead.');},stop:()=>{},restart:A=>y.current(A),focus:()=>v.current?.focus(),clear:()=>{let A=v.current;A&&Cr(A);},insert:A=>{v.current?.update(()=>{let q=$getSelection();$isRangeSelection(q)&&q.insertText(A);});},getContent:()=>v.current?Tl(v.current):{text:"",json:"",mentions:[]},getEditor:()=>v.current}),[]);let k=C.useMemo(()=>({paragraph:"gds-composer-paragraph",quote:"gds-composer-quote",heading:{h1:"gds-composer-h1",h2:"gds-composer-h2",h3:"gds-composer-h3"},list:{ul:"gds-composer-ul",ol:"gds-composer-ol",listitem:"gds-composer-li"},text:{bold:"font-semibold",italic:"italic",underline:"underline",strikethrough:"line-through",code:"gds-composer-code"},beautifulMentions:{"@":"gds-composer-mention px-1.5 py-0.5 mx-0.5 rounded bg-primary/10 text-primary font-medium","/":"gds-composer-mention px-1.5 py-0.5 mx-0.5 rounded bg-violet-500/15 text-violet-600 dark:text-violet-400 font-medium"}}),[]),H=C.useMemo(()=>({namespace:"gds-composer",theme:k,onError:A=>{console.error("[Composer]",A);},nodes:[HeadingNode,QuoteNode,ListNode,ListItemNode,LinkNode,AutoLinkNode,CodeNode,CodeHighlightNode,BeautifulMentionNode],editorState:n||(r?A=>{let q=$getRoot(),F=$createParagraphNode();F.append($createTextNode(r)),q.append(F);}:void 0)}),[k,n,r]),E=d.length>0,{readOnly:D=false,...U}=c;return C.createElement(LexicalComposer,{initialConfig:{...H,editable:!D}},C.createElement(wu,{...U,readOnly:D,triggers:p??[],attachmentsCfg:D?null:g,formatList:d,showToolbar:m&&E&&!D,handleEditorReady:S,submitRef:w,restartRef:y,attachments:u,setAttachments:b,ingestImages:h}))}),Ru=C.forwardRef(function(t,o){return C.createElement(Pl,{ref:o,placeholder:"Write a reply\u2026",formats:false,submitOnEnter:false,...t})});var At=kt.Root,It=kt.Trigger,Su=kt.Anchor,Ct=C.forwardRef(({className:e,align:t="center",sideOffset:o=4,surface:r="solid",...n},a)=>C.createElement(kt.Portal,null,C.createElement(kt.Content,{ref:a,align:t,sideOffset:o,"data-surface":r,className:l("z-50 w-72 rounded-md border p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",St(r,"bg-popover"),it[r],e),...n})));Ct.displayName=kt.Content.displayName;var ku="PPP",Cu="LLL dd, y";function Tu({value:e,onChange:t,placeholder:o="Pick a date",disabled:r,className:n,contentClassName:a,align:i="start",side:p,format:s=ku,captionLayout:c,icon:d,"aria-label":m}){return C.createElement(At,null,C.createElement(It,{asChild:true},C.createElement(Xe,{type:"button",variant:"outline",disabled:r,"aria-label":m??(e?void 0:o),"data-empty":!e,className:l("w-[280px] justify-start text-left font-normal data-[empty=true]:text-muted-foreground",n)},d??C.createElement(CalendarIcon,{className:"mr-2 h-4 w-4","aria-hidden":true}),e?format(e,s):C.createElement("span",null,o))),C.createElement(Ct,{className:l("w-auto p-0",a),align:i,side:p},C.createElement(oa,{mode:"single",selected:e,onSelect:t,captionLayout:c,initialFocus:true})))}function Pu({value:e,onChange:t,placeholder:o="Pick a date range",disabled:r,className:n,contentClassName:a,align:i="start",side:p,format:s=Cu,captionLayout:c,icon:d,numberOfMonths:m=2,"aria-label":g}){let u=!!e?.from;return C.createElement(At,null,C.createElement(It,{asChild:true},C.createElement(Xe,{type:"button",variant:"outline",disabled:r,"aria-label":g??(u?void 0:o),"data-empty":!u,className:l("w-[300px] justify-start text-left font-normal data-[empty=true]:text-muted-foreground",n)},d??C.createElement(CalendarIcon,{className:"mr-2 h-4 w-4","aria-hidden":true}),e?.from?e.to?C.createElement(C.Fragment,null,format(e.from,s)," \u2013"," ",format(e.to,s)):format(e.from,s):C.createElement("span",null,o))),C.createElement(Ct,{className:l("w-auto p-0",a),align:i,side:p},C.createElement(oa,{mode:"range",selected:e,onSelect:t,defaultMonth:e?.from,numberOfMonths:m,captionLayout:c,initialFocus:true})))}var Mu=ke.Root,Eu=ke.Trigger,Ml=ke.Portal,Lu=ke.Close,pn=C.forwardRef(({className:e,...t},o)=>C.createElement(ke.Overlay,{ref:o,className:l("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));pn.displayName=ke.Overlay.displayName;var El=C.forwardRef(({className:e,children:t,surface:o="solid",...r},n)=>C.createElement(Ml,null,C.createElement(pn,null),C.createElement(ke.Content,{ref:n,"data-surface":o,className:l("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",St(o,"bg-background"),it[o],e),...r},t,C.createElement(ke.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},C.createElement(X$1,{className:"h-4 w-4"}),C.createElement("span",{className:"sr-only"},"Close")))));El.displayName=ke.Content.displayName;var Ll=({className:e,...t})=>C.createElement("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ll.displayName="DialogHeader";var Dl=({className:e,...t})=>C.createElement("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Dl.displayName="DialogFooter";var Al=C.forwardRef(({className:e,...t},o)=>C.createElement(ke.Title,{ref:o,className:l("text-lg font-semibold leading-none tracking-tight",e),...t}));Al.displayName=ke.Title.displayName;var Il=C.forwardRef(({className:e,...t},o)=>C.createElement(ke.Description,{ref:o,className:l("text-sm text-muted-foreground",e),...t}));Il.displayName=ke.Description.displayName;var Hu=X.Root,Fu=X.Trigger,To=C.createContext("default"),Hl=e=>e==="default"?"px-2 py-1.5 text-sm":"px-2 py-1 text-xs",zu=X.Group,Bu=X.Portal,_u=X.Sub,Ou=X.RadioGroup,Fl=C.forwardRef(({className:e,inset:t,children:o,...r},n)=>{let a=C.useContext(To);return C.createElement(X.SubTrigger,{ref:n,className:l("flex cursor-default select-none items-center gap-2 rounded-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:shrink-0",Hl(a),a==="default"?"[&_svg]:size-4":"[&_svg]:size-3.5",t&&(a==="default"?"pl-8":"pl-7"),e),...r},o,C.createElement(ChevronRight,{className:"ml-auto"}))});Fl.displayName=X.SubTrigger.displayName;var zl=C.forwardRef(({className:e,surface:t="solid",size:o="default",children:r,...n},a)=>C.createElement(X.SubContent,{ref:a,"data-surface":t,className:l("z-50 min-w-[8rem] overflow-hidden rounded-md border text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",o==="default"?"p-1":"p-0.5",St(t,"bg-popover"),it[t],e),...n},C.createElement(To.Provider,{value:o},r)));zl.displayName=X.SubContent.displayName;var Bl=C.forwardRef(({className:e,sideOffset:t=4,surface:o="solid",size:r="default",children:n,...a},i)=>C.createElement(X.Portal,null,C.createElement(X.Content,{ref:i,sideOffset:t,"data-surface":o,className:l("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border text-popover-foreground shadow-md",r==="default"?"p-1":"p-0.5","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",St(o,"bg-popover"),it[o],e),...a},C.createElement(To.Provider,{value:r},n))));Bl.displayName=X.Content.displayName;var _l=C.forwardRef(({className:e,inset:t,...o},r)=>{let n=C.useContext(To);return C.createElement(X.Item,{ref:r,className:l("relative flex cursor-default select-none items-center gap-2 rounded-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:shrink-0",Hl(n),n==="default"?"[&>svg]:size-4":"[&>svg]:size-3.5",t&&(n==="default"?"pl-8":"pl-7"),e),...o})});_l.displayName=X.Item.displayName;var Ol=C.forwardRef(({className:e,children:t,checked:o,...r},n)=>{let i=C.useContext(To)!=="default";return C.createElement(X.CheckboxItem,{ref:n,className:l("relative flex cursor-default select-none items-center rounded-sm pr-2 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",i?"py-1 pl-7 text-xs":"py-1.5 pl-8 text-sm",e),checked:o,...r},C.createElement("span",{className:l("absolute flex items-center justify-center",i?"left-1.5 h-3 w-3":"left-2 h-3.5 w-3.5")},C.createElement(X.ItemIndicator,null,C.createElement(Check,{className:i?"h-3 w-3":"h-4 w-4"}))),t)});Ol.displayName=X.CheckboxItem.displayName;var Vl=C.forwardRef(({className:e,children:t,...o},r)=>{let a=C.useContext(To)!=="default";return C.createElement(X.RadioItem,{ref:r,className:l("relative flex cursor-default select-none items-center rounded-sm pr-2 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a?"py-1 pl-7 text-xs":"py-1.5 pl-8 text-sm",e),...o},C.createElement("span",{className:l("absolute flex items-center justify-center",a?"left-1.5 h-3 w-3":"left-2 h-3.5 w-3.5")},C.createElement(X.ItemIndicator,null,C.createElement(Circle,{className:"h-2 w-2 fill-current"}))),t)});Vl.displayName=X.RadioItem.displayName;var Gl=C.forwardRef(({className:e,inset:t,...o},r)=>{let n=C.useContext(To);return C.createElement(X.Label,{ref:r,className:l("font-semibold",n==="default"?"px-2 py-1.5 text-sm":"px-2 py-1 text-xs",t&&(n==="default"?"pl-8":"pl-7"),e),...o})});Gl.displayName=X.Label.displayName;var jl=C.forwardRef(({className:e,...t},o)=>C.createElement(X.Separator,{ref:o,className:l("-mx-1 my-1 h-px bg-muted",e),...t}));jl.displayName=X.Separator.displayName;var Wl=({className:e,...t})=>C.createElement("span",{className:l("ml-auto text-xs tracking-widest opacity-60",e),...t});Wl.displayName="DropdownMenuShortcut";var Ul=cva("flex w-full rounded-md border border-input bg-transparent shadow-sm transition-colors file:border-0 file:bg-transparent file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{default:"h-9 pl-3 pr-3 py-1 text-base file:text-sm md:text-sm",sm:"h-8 pl-2 pr-2 py-1 text-sm file:text-xs",xs:"h-7 pl-2 pr-2 py-0 text-xs file:text-xs shadow-none","2xs":"h-6 rounded-lg pl-1.5 pr-2 py-0 text-2xs file:text-2xs shadow-none"}},defaultVariants:{size:"default"}}),Gu={default:{startPad:"pl-9",endPad:"pr-9",startInset:"pl-3",endInset:"pr-3"},sm:{startPad:"pl-7",endPad:"pr-6",startInset:"pl-2",endInset:"pr-2"},xs:{startPad:"pl-6",endPad:"pr-5",startInset:"pl-2",endInset:"pr-2"},"2xs":{startPad:"pl-6",endPad:"pr-5",startInset:"pl-1.5",endInset:"pr-2"}},qt=C.forwardRef(({className:e,type:t,size:o="default",startSlot:r,endSlot:n,...a},i)=>{if(!r&&!n)return C.createElement("input",{type:t,className:l(Ul({size:o}),e),ref:i,...a});let p=Gu[o];return C.createElement("div",{className:"relative flex w-full items-center"},r?C.createElement("span",{className:l("pointer-events-none absolute inset-y-0 left-0 flex items-center text-muted-foreground [&_svg]:size-3.5",p.startInset)},r):null,C.createElement("input",{type:t,ref:i,className:l(Ul({size:o}),r&&p.startPad,n&&p.endPad,e),...a}),n?C.createElement("span",{className:l("pointer-events-none absolute inset-y-0 right-0 flex items-center text-muted-foreground [&_svg]:size-3.5",p.endInset)},n):null)});qt.displayName="Input";var Wu=cva("font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{size:{default:"text-sm",sm:"text-sm",xs:"text-xs","2xs":"text-2xs"}},defaultVariants:{size:"default"}}),Po=C.forwardRef(({className:e,size:t,...o},r)=>C.createElement(mn.Root,{ref:r,className:l(Wu({size:t}),e),...o}));Po.displayName=mn.Root.displayName;var $l=C.forwardRef(({className:e,value:t,...o},r)=>C.createElement(Mr.Root,{ref:r,className:l("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...o},C.createElement(Mr.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})));$l.displayName=Mr.Root.displayName;var un=C.forwardRef(({className:e,...t},o)=>C.createElement(Command,{ref:o,className:l("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));un.displayName=Command.displayName;var gn=C.forwardRef(({className:e,...t},o)=>C.createElement("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":""},C.createElement(Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),C.createElement(Command.Input,{ref:o,className:l("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})));gn.displayName=Command.Input.displayName;var fn=C.forwardRef(({className:e,...t},o)=>C.createElement(Command.List,{ref:o,className:l("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));fn.displayName=Command.List.displayName;var hn=C.forwardRef((e,t)=>C.createElement(Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));hn.displayName=Command.Empty.displayName;var va=C.forwardRef(({className:e,...t},o)=>C.createElement(Command.Group,{ref:o,className:l("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));va.displayName=Command.Group.displayName;var bn=C.forwardRef(({className:e,...t},o)=>C.createElement(Command.Separator,{ref:o,className:l("-mx-1 h-px bg-border",e),...t}));bn.displayName=Command.Separator.displayName;var Xo=C.forwardRef(({className:e,...t},o)=>C.createElement(Command.Item,{ref:o,className:l("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Xo.displayName=Command.Item.displayName;var Er=C.forwardRef(({className:e,orientation:t="horizontal",decorative:o=true,...r},n)=>C.createElement(vn.Root,{ref:n,decorative:o,orientation:t,className:l("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Er.displayName=vn.Root.displayName;var Xu=3,Kl=C.forwardRef(function({options:t,value:o,defaultValue:r,onValueChange:n,placeholder:a="Select\u2026",searchPlaceholder:i="Search\u2026",emptyMessage:p="Nothing matches.",maxCount:s=Xu,searchable:c=true,badgeDismissible:d=true,disabled:m=false,modalPopover:g=false,className:u,id:b,"aria-label":f,...h},v){let w=o!==void 0,[y,S]=C.useState(r??[]),k=w?o:y,[H,E]=C.useState(false),D=C.useMemo(()=>{let x=new Map;for(let I of t)x.set(I.value,I);return x},[t]),U=C.useCallback(x=>{w||S(x),n?.(x);},[w,n]),A=x=>{k.includes(x)?U(k.filter(I=>I!==x)):U([...k,x]);},q=(x,I)=>{x.preventDefault(),x.stopPropagation(),U(k.filter(P=>P!==I));},F=x=>{x?.preventDefault(),x?.stopPropagation(),U([]);},Y=()=>{let x=t.filter(I=>!I.disabled).map(I=>I.value);U(x);},J=t.length>0&&t.filter(x=>!x.disabled).every(x=>k.includes(x.value)),z=k.slice(0,s),pe=Math.max(0,k.length-s);return C.createElement(At,{open:H,onOpenChange:E,modal:g},C.createElement(It,{asChild:true},C.createElement("button",{ref:v,type:"button",id:b,role:"combobox","aria-expanded":H,"aria-haspopup":"listbox","aria-label":f,disabled:m,"data-gds-part":"multi-select",className:l("flex min-h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-transparent pl-2 pr-2 text-sm shadow-sm","ring-offset-background placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50","[&[data-state=open]]:ring-1 [&[data-state=open]]:ring-ring",u)},k.length===0?C.createElement("span",{className:"text-muted-foreground px-1"},a):C.createElement("div",{className:"flex flex-1 flex-wrap items-center gap-1 py-1","data-gds-part":"multi-select-badges"},z.map(x=>{let I=D.get(x);if(!I)return null;let P=I.icon;return C.createElement(ea,{key:x,variant:"secondary",className:"gap-1 pr-1","data-gds-part":"multi-select-badge"},P?C.createElement(P,{className:"h-3 w-3"}):null,C.createElement("span",{className:"truncate max-w-[12rem]"},I.label),d&&!m&&C.createElement("span",{role:"button","aria-label":`Remove ${I.label}`,tabIndex:0,onClick:te=>q(te,x),onKeyDown:te=>{(te.key==="Enter"||te.key===" ")&&q(te,x);},className:"ml-0.5 inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-sm hover:bg-muted-foreground/20"},C.createElement(X$1,{className:"h-3 w-3","aria-hidden":true})))}),pe>0&&C.createElement(ea,{variant:"outline",className:"text-muted-foreground","data-gds-part":"multi-select-overflow",title:k.slice(s).map(x=>D.get(x)?.label??x).join(", ")},"+",pe," more")),C.createElement("div",{className:"flex shrink-0 items-center gap-1"},k.length>0&&!m&&C.createElement("span",{role:"button","aria-label":"Clear all",tabIndex:0,onClick:x=>F(x),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&F(x);},className:"inline-flex h-5 w-5 cursor-pointer items-center justify-center rounded-sm text-muted-foreground hover:text-foreground hover:bg-muted"},C.createElement(XCircle,{className:"h-3.5 w-3.5","aria-hidden":true})),C.createElement(ChevronDown,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":true})))),C.createElement(Ct,{align:"start",className:"w-[var(--radix-popover-trigger-width)] p-0","data-gds-part":"multi-select-content"},C.createElement(un,null,c&&C.createElement(gn,{placeholder:i}),C.createElement(fn,null,C.createElement(hn,null,p),C.createElement(va,null,t.map(x=>{let I=x.icon,P=k.includes(x.value);return C.createElement(Xo,{key:x.value,value:x.label,onSelect:()=>A(x.value),disabled:x.disabled,"data-gds-part":"multi-select-item","data-selected":P||void 0},C.createElement("div",{className:l("mr-2 flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-primary",P?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),"aria-hidden":true},C.createElement(Check,{className:"h-3 w-3"})),I?C.createElement(I,{className:"mr-2 h-4 w-4 text-muted-foreground"}):null,C.createElement("span",{className:"truncate"},x.label))})),C.createElement(bn,null),C.createElement(va,null,C.createElement("div",{className:"flex items-center justify-between gap-1 p-1"},C.createElement(Xo,{onSelect:Y,className:"flex-1 justify-center text-xs",disabled:J},"Select all"),C.createElement(Er,{orientation:"vertical",className:"h-5"}),C.createElement(Xo,{onSelect:()=>F(),className:"flex-1 justify-center text-xs",disabled:k.length===0},"Clear"),C.createElement(Er,{orientation:"vertical",className:"h-5"}),C.createElement(Xo,{onSelect:()=>E(false),className:"flex-1 justify-center text-xs"},"Close")))))))});Kl.displayName="MultiSelect";var ql=C.forwardRef(({className:e,...t},o)=>C.createElement(lo.Root,{className:l("grid gap-2",e),...t,ref:o}));ql.displayName=lo.Root.displayName;var Yl=C.forwardRef(({className:e,...t},o)=>C.createElement(lo.Item,{ref:o,className:l("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t},C.createElement(lo.Indicator,{className:"flex items-center justify-center"},C.createElement(Circle,{className:"h-2.5 w-2.5 fill-current text-current"}))));Yl.displayName=lo.Item.displayName;var eg=({className:e,...t})=>C.createElement(Jo.PanelGroup,{"data-gds-part":"resizable-panel-group",className:l("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),tg=Jo.Panel,og=({withHandle:e,className:t,...o})=>C.createElement(Jo.PanelResizeHandle,{"data-gds-part":"resizable-handle",className:l("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...o},e&&C.createElement("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border"},C.createElement(GripVertical,{className:"h-2.5 w-2.5"})));var Zl=cva("gds-row flex flex-row",{variants:{gap:{none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"},align:{start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},wrap:{true:"flex-wrap",false:"flex-nowrap"}},defaultVariants:{gap:"md",align:"center",justify:"start",wrap:false}}),Xl=C.forwardRef(({className:e,gap:t,align:o,justify:r,wrap:n,asChild:a=false,...i},p)=>C.createElement(a?Slot:"div",{ref:p,"data-gds-part":"row",className:l(Zl({gap:t,align:o,justify:r,wrap:n,className:e})),...i}));Xl.displayName="Row";var Jl=cva("gds-grid grid",{variants:{cols:{1:"grid-cols-1",2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 md:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",5:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-5",6:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-6",12:"grid-cols-4 md:grid-cols-6 lg:grid-cols-12"},gap:{none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"},align:{start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"}},defaultVariants:{cols:"3",gap:"md",align:"stretch"}}),Ql=C.forwardRef(({className:e,cols:t,gap:o,align:r,asChild:n=false,...a},i)=>C.createElement(n?Slot:"div",{ref:i,"data-gds-part":"grid",className:l(Jl({cols:t,gap:o,align:r,className:e})),...a}));Ql.displayName="Grid";var ed=cva("gds-flex flex",{variants:{direction:{row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},gap:{none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"},align:{start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},wrap:{nowrap:"flex-nowrap",wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse"}},defaultVariants:{direction:"row",gap:"none",align:"stretch",justify:"start",wrap:"nowrap"}}),td=C.forwardRef(({className:e,direction:t,gap:o,align:r,justify:n,wrap:a,asChild:i=false,...p},s)=>C.createElement(i?Slot:"div",{ref:s,"data-gds-part":"flex",className:l(ed({direction:t,gap:o,align:r,justify:n,wrap:a,className:e})),...p}));td.displayName="Flex";var od=C.forwardRef(({className:e,children:t,...o},r)=>C.createElement(ft.Root,{ref:r,className:l("relative overflow-hidden",e),...o},C.createElement(ft.Viewport,{className:"h-full w-full rounded-[inherit]"},t),C.createElement(yn,null),C.createElement(ft.Corner,null)));od.displayName=ft.Root.displayName;var yn=C.forwardRef(({className:e,orientation:t="vertical",...o},r)=>C.createElement(ft.ScrollAreaScrollbar,{ref:r,orientation:t,className:l("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o},C.createElement(ft.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})));yn.displayName=ft.ScrollAreaScrollbar.displayName;var xn=ee.Root,pg=ee.Group,wn=ee.Value,nd=C.createContext("default"),mg=cva("flex w-full items-center justify-between rounded-md border border-input bg-background ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",{variants:{size:{default:"h-10 px-3 py-2 text-sm",sm:"h-8 px-2 py-1 text-sm",xs:"h-7 px-2 py-0 text-xs","2xs":"h-6 rounded-lg pl-1.5 pr-2 py-0 text-2xs"}},defaultVariants:{size:"default"}}),Sa=C.forwardRef(({className:e,children:t,size:o="default",startSlot:r,chevron:n=true,...a},i)=>C.createElement(ee.Trigger,{ref:i,className:l(mg({size:o}),e),...a},r?C.createElement("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 [&>span]:truncate"},C.createElement("span",{className:"pointer-events-none flex shrink-0 items-center text-muted-foreground/70 [&_svg]:size-4"},r),t):t,n?C.createElement(ee.Icon,{asChild:true},C.createElement(ChevronDown,{className:l("opacity-50",o==="sm"?"h-3.5 w-3.5":"h-4 w-4")})):null));Sa.displayName=ee.Trigger.displayName;var Rn=C.forwardRef(({className:e,...t},o)=>C.createElement(ee.ScrollUpButton,{ref:o,className:l("flex cursor-default items-center justify-center py-1",e),...t},C.createElement(ChevronUp,{className:"h-4 w-4"})));Rn.displayName=ee.ScrollUpButton.displayName;var Sn=C.forwardRef(({className:e,...t},o)=>C.createElement(ee.ScrollDownButton,{ref:o,className:l("flex cursor-default items-center justify-center py-1",e),...t},C.createElement(ChevronDown,{className:"h-4 w-4"})));Sn.displayName=ee.ScrollDownButton.displayName;var ka=C.forwardRef(({className:e,children:t,position:o="popper",size:r="default",...n},a)=>C.createElement(ee.Portal,null,C.createElement(ee.Content,{ref:a,className:l("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...n},C.createElement(Rn,null),C.createElement(ee.Viewport,{className:l(r==="default"?"p-1":"p-0.5",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},C.createElement(nd.Provider,{value:r},t)),C.createElement(Sn,null))));ka.displayName=ee.Content.displayName;var id=C.forwardRef(({className:e,...t},o)=>C.createElement(ee.Label,{ref:o,className:l("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));id.displayName=ee.Label.displayName;var ug=cva("relative flex w-full cursor-default select-none items-center rounded-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{size:{default:"py-1.5 pl-8 pr-2 text-sm",sm:"py-1 pl-7 pr-2 text-sm",xs:"py-1 pl-6 pr-2 text-xs","2xs":"py-0.5 pl-6 pr-2 text-2xs"}},defaultVariants:{size:"default"}}),Ca=C.forwardRef(({className:e,children:t,hint:o,...r},n)=>{let a=C.useContext(nd),i=a!=="default";return C.createElement(ee.Item,{ref:n,className:l("group",ug({size:a}),e),...r},C.createElement("span",{className:l("absolute flex items-center justify-center",i?"left-1.5 h-3 w-3":"left-2 h-3.5 w-3.5")},C.createElement(ee.ItemIndicator,null,C.createElement(Check,{className:i?"h-3 w-3":"h-4 w-4"}))),C.createElement(ee.ItemText,null,t),o!=null?C.createElement("span",{className:"ml-auto pl-3 tabular-nums text-muted-foreground/60 group-focus:text-accent-foreground/80 group-data-[highlighted]:text-accent-foreground/80"},o):null)});Ca.displayName=ee.Item.displayName;var sd=C.forwardRef(({className:e,...t},o)=>C.createElement(ee.Separator,{ref:o,className:l("-mx-1 my-1 h-px bg-muted",e),...t}));sd.displayName=ee.Separator.displayName;var hg=ke.Root,bg=ke.Trigger,vg=ke.Close,ld=ke.Portal,kn=C.forwardRef(({className:e,...t},o)=>C.createElement(ke.Overlay,{className:l("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:o}));kn.displayName=ke.Overlay.displayName;var yg=cva("fixed z-50 gap-4 p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),dd=C.forwardRef(({side:e="right",surface:t="solid",className:o,children:r,...n},a)=>C.createElement(ld,null,C.createElement(kn,null),C.createElement(ke.Content,{ref:a,"data-surface":t,className:l(yg({side:e}),St(t,"bg-background"),it[t],o),...n},r,C.createElement(ke.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"},C.createElement(X$1,{className:"h-4 w-4"}),C.createElement("span",{className:"sr-only"},"Close")))));dd.displayName=ke.Content.displayName;var cd=({className:e,...t})=>C.createElement("div",{className:l("flex flex-col space-y-2 text-center sm:text-left",e),...t});cd.displayName="SheetHeader";var pd=({className:e,...t})=>C.createElement("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});pd.displayName="SheetFooter";var md=C.forwardRef(({className:e,...t},o)=>C.createElement(ke.Title,{ref:o,className:l("text-lg font-semibold text-foreground",e),...t}));md.displayName=ke.Title.displayName;var ud=C.forwardRef(({className:e,...t},o)=>C.createElement(ke.Description,{ref:o,className:l("text-sm text-muted-foreground",e),...t}));ud.displayName=ke.Description.displayName;function xg({className:e,...t}){return React.createElement("div",{className:l("animate-pulse rounded-md bg-muted",e),...t})}var Mo=C.forwardRef(({className:e,...t},o)=>C.createElement(Yt.Root,{ref:o,className:l("relative flex w-full touch-none select-none items-center",e),...t},C.createElement(Yt.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary"},C.createElement(Yt.Range,{className:"absolute h-full bg-primary"})),C.createElement(Yt.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})));Mo.displayName=Yt.Root.displayName;var Eg={vertical:verticalListSortingStrategy,horizontal:horizontalListSortingStrategy,grid:rectSortingStrategy},Cn=C.createContext(null),wd=C.createContext(null),Tn=C.forwardRef(function({disabled:t=false,className:o,children:r,...n},a){let i=C.useRef(new Map),p=C.useCallback(m=>(i.current.set(m.id,m),()=>{i.current.delete(m.id);}),[]),s=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),c=m=>{let g=i.current,u=g.get(String(m));if(u)return u;for(let b of g.values())if(b.values.some(f=>f===m))return b;return null},d=C.useCallback(m=>{if(t)return;let{active:g,over:u}=m;if(!u)return;let b=c(g.id),f=c(u.id);if(!b||!f)return;if(b.id===f.id){if(g.id===u.id)return;let y=b.values.findIndex(k=>k===g.id),S=b.values.findIndex(k=>k===u.id);if(y===-1||S===-1)return;b.onReorder?.(arrayMove(b.values,y,S));return}let h=b.values.filter(y=>y!==g.id),v=u.id===f.id?f.values.length:Math.max(0,f.values.findIndex(y=>y===u.id)),w=[...f.values.slice(0,v),g.id,...f.values.slice(v)];b.onReorder?.(h),f.onReorder?.(w);},[t]);return C.createElement(wd.Provider,{value:{registerContainer:p}},C.createElement(DndContext,{sensors:s,collisionDetection:closestCorners,onDragEnd:d},C.createElement("div",{ref:a,"data-gds-part":"sortable-group","data-disabled":t||void 0,className:l(o),...n},r)))});Tn.displayName="Sortable.Group";var Dr=C.forwardRef(function({values:t,onReorder:o,strategy:r="vertical",disabled:n=false,id:a,className:i,children:p,...s},c){let d=C.useContext(wd),m=d!==null,g=C.useId(),u=a??g;C.useEffect(()=>{if(m)return d.registerContainer({id:u,values:t,onReorder:o})},[m,d,u,t,o]);let b=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),f=C.useCallback(w=>{let{active:y,over:S}=w;if(!S||y.id===S.id)return;let k=t.findIndex(E=>E===y.id),H=t.findIndex(E=>E===S.id);k===-1||H===-1||o?.(arrayMove(t,k,H));},[t,o]),h=C.useMemo(()=>({disabled:n}),[n]),v=C.createElement(SortableContext,{items:t,strategy:Eg[r]},C.createElement(Lg,{id:u,enabled:m,forwardedRef:c,strategy:r,disabled:n,className:i,...s},p));return m?C.createElement(Cn.Provider,{value:h},v):C.createElement(Cn.Provider,{value:h},C.createElement(DndContext,{sensors:b,collisionDetection:closestCenter,onDragEnd:f},v))});Dr.displayName="Sortable";function Lg({id:e,enabled:t,forwardedRef:o,strategy:r,disabled:n,className:a,children:i,...p}){let s=useDroppable({id:e,disabled:!t}),c=C.useCallback(d=>{t&&s.setNodeRef(d),typeof o=="function"?o(d):o&&(o.current=d);},[t,s,o]);return C.createElement("div",{ref:c,"data-gds-part":"sortable","data-strategy":r,"data-disabled":n||void 0,className:l(a),...p},i)}var Rd=C.createContext(null),Pn=C.forwardRef(function({value:t,asChild:o=false,disabled:r,className:n,style:a,children:i,...p},s){let c=C.useContext(Cn);if(!c)throw new Error("<Sortable.Item> must be rendered inside <Sortable>.");let d=c.disabled||r||false,{attributes:m,listeners:g,setNodeRef:u,setActivatorNodeRef:b,transform:f,transition:h,isDragging:v}=useSortable({id:t,disabled:d}),w=C.useRef(false),y=C.useCallback(E=>{u(E),typeof s=="function"?s(E):s&&(s.current=E);},[u,s]),S=C.useMemo(()=>({listeners:g,setActivatorNodeRef:b,hasHandle:w,disabled:d}),[g,b,d]),k={transform:CSS.Transform.toString(f),transition:h,zIndex:v?1:void 0,cursor:d?"default":w.current?void 0:"grab",...a},H=o?Slot:"div";return C.createElement(Rd.Provider,{value:S},C.createElement(H,{ref:y,"data-gds-part":"sortable-item","data-value":String(t),"data-dragging":v||void 0,className:l(n),style:k,...m,...w.current?{}:g,...p},i))});Pn.displayName="Sortable.Item";var Nn=C.forwardRef(function({asChild:t=false,className:o,children:r,...n},a){let i=C.useContext(Rd);if(!i)throw new Error("<Sortable.Handle> must be rendered inside <Sortable.Item>.");C.useLayoutEffect(()=>(i.hasHandle.current=true,()=>{i.hasHandle.current=false;}),[i.hasHandle]);let p=C.useCallback(c=>{i.setActivatorNodeRef(c),typeof a=="function"?a(c):a&&(a.current=c);},[i,a]),s={"data-gds-part":"sortable-handle","aria-label":"Drag to reorder",className:l("cursor-grab touch-none select-none",i.disabled&&"cursor-default opacity-50",o),...i.disabled?{}:i.listeners,...n};return t?C.createElement(Slot,{ref:p,...s},r):C.createElement("button",{type:"button",ref:p,...s},r)});Nn.displayName="Sortable.Handle";Dr.Item=Pn;Dr.Handle=Nn;Dr.Group=Tn;var Dg=Dr;var Sd=cva("gds-stack flex flex-col",{variants:{gap:{none:"gap-0",xs:"gap-1",sm:"gap-2",md:"gap-4",lg:"gap-6",xl:"gap-8","2xl":"gap-12"},align:{start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},justify:{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"}},defaultVariants:{gap:"md",align:"stretch",justify:"start"}}),kd=C.forwardRef(({className:e,gap:t,align:o,justify:r,asChild:n=false,...a},i)=>C.createElement(n?Slot:"div",{ref:i,"data-gds-part":"stack",className:l(Sd({gap:t,align:o,justify:r,className:e})),...a}));kd.displayName="Stack";var Hg=cva("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",{variants:{size:{default:"h-6 w-11",sm:"h-5 w-9",xs:"h-4 w-7","2xs":"h-3 w-5"}},defaultVariants:{size:"default"}}),Fg=cva("pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=unchecked]:translate-x-0",{variants:{size:{default:"h-5 w-5 data-[state=checked]:translate-x-5",sm:"h-4 w-4 data-[state=checked]:translate-x-4",xs:"h-3 w-3 data-[state=checked]:translate-x-3","2xs":"h-2 w-2 data-[state=checked]:translate-x-2"}},defaultVariants:{size:"default"}}),Na=C.forwardRef(({className:e,size:t="default",...o},r)=>C.createElement(Ir.Root,{className:l(Hg({size:t}),e),...o,ref:r},C.createElement(Ir.Thumb,{className:l(Fg({size:t}))})));Na.displayName=Ir.Root.displayName;var Td=C.forwardRef(({className:e,...t},o)=>C.createElement("div",{className:"relative w-full overflow-auto"},C.createElement("table",{ref:o,className:l("w-full caption-bottom text-sm",e),...t})));Td.displayName="Table";var Pd=C.forwardRef(({className:e,...t},o)=>C.createElement("thead",{ref:o,className:l("[&_tr]:border-b",e),...t}));Pd.displayName="TableHeader";var Nd=C.forwardRef(({className:e,...t},o)=>C.createElement("tbody",{ref:o,className:l("[&_tr:last-child]:border-0",e),...t}));Nd.displayName="TableBody";var Md=C.forwardRef(({className:e,...t},o)=>C.createElement("tfoot",{ref:o,className:l("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Md.displayName="TableFooter";var Ed=C.forwardRef(({className:e,...t},o)=>C.createElement("tr",{ref:o,className:l("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Ed.displayName="TableRow";var Ld=C.forwardRef(({className:e,...t},o)=>C.createElement("th",{ref:o,className:l("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Ld.displayName="TableHead";var Dd=C.forwardRef(({className:e,...t},o)=>C.createElement("td",{ref:o,className:l("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Dd.displayName="TableCell";var Ad=C.forwardRef(({className:e,...t},o)=>C.createElement("caption",{ref:o,className:l("mt-4 text-sm text-muted-foreground",e),...t}));Ad.displayName="TableCaption";var Id=C.createContext(C.createElement(ChevronRight,null)),Hd=C.forwardRef(({separator:e,children:t,...o},r)=>C.createElement(Id.Provider,{value:e??C.createElement(ChevronRight,null)},C.createElement("nav",{ref:r,"aria-label":"breadcrumb",...o},t)));Hd.displayName="Breadcrumb";var Fd=C.forwardRef(({className:e,...t},o)=>C.createElement("ol",{ref:o,className:l("flex flex-wrap items-center gap-1.5 break-words text-xs text-muted-foreground",e),...t}));Fd.displayName="BreadcrumbList";var zd=C.forwardRef(({className:e,...t},o)=>C.createElement("li",{ref:o,className:l("inline-flex items-center gap-1.5",e),...t}));zd.displayName="BreadcrumbItem";var Ma=l("inline-flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs","transition-colors hover:text-foreground hover:bg-muted/60","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","[&_svg]:pointer-events-none [&_svg]:size-3.5 [&_svg]:shrink-0"),Bd=C.forwardRef(({asChild:e,className:t,href:o,...r},n)=>e?C.createElement("span",{ref:n,className:l(Ma,t),...r}):o?C.createElement("a",{ref:n,href:o,className:l(Ma,t),...r}):C.createElement("button",{ref:n,type:"button",className:l(Ma,t),...r}));Bd.displayName="BreadcrumbLink";var _d=C.forwardRef(({className:e,...t},o)=>C.createElement("span",{ref:o,role:"link","aria-disabled":"true","aria-current":"page",className:l("inline-flex items-center gap-1.5 px-0.5 text-xs font-medium text-foreground","[&_svg]:pointer-events-none [&_svg]:size-3.5 [&_svg]:shrink-0",e),...t}));_d.displayName="BreadcrumbPage";var Od=({children:e,className:t,...o})=>{let r=C.useContext(Id);return C.createElement("li",{role:"presentation","aria-hidden":"true",className:l("[&_svg]:size-3 [&_svg]:shrink-0 text-muted-foreground/60",t),...o},e??r)};Od.displayName="BreadcrumbSeparator";var Vd=({className:e,...t})=>C.createElement("span",{role:"presentation","aria-hidden":"true",className:l("flex h-5 w-5 items-center justify-center",e),...t},C.createElement(MoreHorizontal,{className:"h-3.5 w-3.5"}),C.createElement("span",{className:"sr-only"},"More"));Vd.displayName="BreadcrumbEllipsis";var Gd=C.forwardRef(({label:e,items:t,onSelect:o,onSelectLabel:r,current:n,className:a},i)=>{let[p,s]=C.useState(false);return C.createElement(At,{open:p,onOpenChange:s},C.createElement(It,{asChild:true},C.createElement("button",{ref:i,type:"button",className:l(Ma,n&&"font-medium text-foreground",a),onClick:()=>{r?r():s(c=>!c);}},C.createElement("span",null,e),C.createElement(ChevronDown,{className:l("h-3 w-3 text-muted-foreground transition-transform",p&&"rotate-180"),onClick:c=>{c.stopPropagation(),s(d=>!d);},role:"button","aria-label":`Show ${e} children`}))),C.createElement(Ct,{align:"start",className:"w-64 p-1 max-h-80 overflow-y-auto"},t.length===0?C.createElement("p",{className:"px-2 py-1.5 text-xs text-muted-foreground"},"No items here yet."):C.createElement("ul",{className:"flex flex-col gap-0.5"},t.map(c=>C.createElement("li",{key:c.id},C.createElement("button",{type:"button",onClick:()=>{o(c.id),s(false);},className:l("w-full text-left rounded-md px-2 py-1.5","flex items-start gap-2","hover:bg-muted transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",c.active&&"bg-muted/60")},C.createElement("span",{className:"flex-1 min-w-0"},C.createElement("span",{className:"flex items-center gap-1.5"},C.createElement("span",{className:"text-xs font-medium text-foreground truncate"},c.label),c.active&&C.createElement(Check,{className:"h-3 w-3 text-primary shrink-0"})),c.summary&&C.createElement("span",{className:"block text-[10px] text-muted-foreground leading-snug truncate"},c.summary)),c.hasChildren&&C.createElement(ChevronRight,{className:"h-3 w-3 text-muted-foreground/70 shrink-0 mt-0.5"})))))))});Gd.displayName="BreadcrumbMenuTrigger";var En=Tt.Provider,Eo=Tt.Root,Lo=Tt.Trigger,co=C.forwardRef(({className:e,sideOffset:t=4,...o},r)=>C.createElement(Tt.Portal,null,C.createElement(Tt.Content,{ref:r,sideOffset:t,className:l("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...o})));co.displayName=Tt.Content.displayName;var Wd=C.createContext({size:"md",variant:"pill"}),Og=Pt.Root,Vg=cva("inline-flex items-center text-muted-foreground",{variants:{variant:{pill:"justify-center rounded-lg bg-muted",underlined:"justify-start border-b border-border"},size:{sm:"",md:"",lg:""}},compoundVariants:[{variant:"pill",size:"sm",className:"h-7 p-0.5"},{variant:"pill",size:"md",className:"h-8 p-0.5"},{variant:"pill",size:"lg",className:"h-10 p-1"},{variant:"underlined",size:"sm",className:"gap-3"},{variant:"underlined",size:"md",className:"gap-4"},{variant:"underlined",size:"lg",className:"gap-6"}],defaultVariants:{variant:"pill",size:"md"}}),Gg=cva("inline-flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{pill:"rounded-md data-[state=active]:bg-background data-[state=active]:text-foreground",underlined:"rounded-none bg-transparent border-b-2 border-transparent -mb-px hover:text-foreground data-[state=active]:border-primary data-[state=active]:text-primary"},size:{sm:"text-2xs gap-1 [&_svg]:size-3",md:"text-xs gap-1.5 [&_svg]:size-3.5",lg:"text-sm gap-2 [&_svg]:size-4"}},compoundVariants:[{variant:"pill",size:"sm",className:"h-6 px-1.5"},{variant:"pill",size:"md",className:"h-7 px-2"},{variant:"pill",size:"lg",className:"h-8 px-2.5"},{variant:"underlined",size:"sm",className:"pb-1.5 pt-1 px-1"},{variant:"underlined",size:"md",className:"pb-2 pt-1.5 px-1.5"},{variant:"underlined",size:"lg",className:"pb-2.5 pt-2 px-2"}],defaultVariants:{variant:"pill",size:"md"}}),Ud=C.forwardRef(({className:e,size:t="md",variant:o="pill",children:r,...n},a)=>C.createElement(Wd.Provider,{value:{size:t??"md",variant:o??"pill"}},C.createElement(Pt.List,{ref:a,className:l(Vg({size:t,variant:o}),e),...n},r)));Ud.displayName=Pt.List.displayName;var $d=C.forwardRef(({className:e,size:t,variant:o,tooltip:r,...n},a)=>{let i=C.useContext(Wd),p=t??i.size,s=o??i.variant,c=n["aria-label"]??(typeof r=="string"?r:void 0),d=C.createElement(Pt.Trigger,{ref:a,className:l(Gg({size:p,variant:s}),e),"aria-label":c,...n});return r?C.createElement(Eo,null,C.createElement(Lo,{asChild:true},d),C.createElement(co,null,r)):d});$d.displayName=Pt.Trigger.displayName;var Kd=C.forwardRef(({className:e,...t},o)=>C.createElement(Pt.Content,{ref:o,className:l("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Kd.displayName=Pt.Content.displayName;var Wg=cva("flex w-full rounded-md border border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{size:{default:"min-h-[80px] px-3 py-2 text-sm",sm:"min-h-[64px] px-2 py-1.5 text-sm",xs:"min-h-[52px] px-2 py-1 text-xs","2xs":"min-h-[44px] px-2 py-1 text-2xs"}},defaultVariants:{size:"default"}}),qd=C.forwardRef(({className:e,size:t="default",...o},r)=>C.createElement("textarea",{className:l(Wg({size:t}),e),ref:r,...o}));qd.displayName="Textarea";var Yd=cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",xs:"h-7 px-1 min-w-7","2xs":"h-6 px-1 min-w-6",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),Zd=C.forwardRef(({className:e,variant:t,size:o,...r},n)=>C.createElement(Ln.Root,{ref:n,className:l(Yd({variant:t,size:o,className:e})),...r}));Zd.displayName=Ln.Root.displayName;var Jd=C.createContext("md"),$g=cva("inline-flex items-center justify-center rounded-lg bg-muted text-muted-foreground",{variants:{size:{sm:"h-7 p-0.5",md:"h-8 p-0.5",lg:"h-10 p-1"}},defaultVariants:{size:"md"}}),Kg=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[state=on]:bg-background data-[state=on]:text-foreground",{variants:{size:{sm:"h-6 px-1.5 text-2xs gap-1 [&_svg]:size-3",md:"h-7 px-2 text-xs gap-1.5 [&_svg]:size-3.5",lg:"h-8 px-2.5 text-sm gap-2 [&_svg]:size-4"}},defaultVariants:{size:"md"}}),Do=C.forwardRef(({className:e,size:t="md",children:o,...r},n)=>C.createElement(Jd.Provider,{value:t??"md"},C.createElement(Qo.Root,{ref:n,className:l($g({size:t}),e),...r},o)));Do.displayName=Qo.Root.displayName;var Ao=C.forwardRef(({className:e,size:t,tooltip:o,tooltipSide:r="top",tooltipDelay:n,"aria-label":a,...i},p)=>{let s=C.useContext(Jd),c=t??s,d=a??(typeof o=="string"?o:void 0),m=C.createElement(Qo.Item,{ref:p,className:l(Kg({size:c}),e),"aria-label":d,...i});return o==null?m:C.createElement(Eo,{delayDuration:n},C.createElement(Lo,{asChild:true},C.createElement("span",{className:"inline-flex"},m)),C.createElement(co,{side:r},o))});Ao.displayName=Qo.Item.displayName;var Yg=cva("grid items-center w-full gap-3 [grid-template-columns:auto_1fr_auto]",{variants:{position:{top:"border-b border-border",bottom:"border-t border-border",inline:""},variant:{default:"bg-background",subtle:"bg-muted/30",transparent:"bg-transparent"},size:{sm:"min-h-10 px-3",md:"min-h-12 px-4",lg:"min-h-14 px-6"},sticky:{true:"",false:""}},compoundVariants:[{sticky:true,position:"top",className:"sticky top-0 z-20"},{sticky:true,position:"bottom",className:"sticky bottom-0 z-20"}],defaultVariants:{position:"top",variant:"default",size:"md",sticky:false}}),Qd=C.forwardRef(({className:e,position:t,variant:o,size:r,sticky:n,leading:a,center:i,trailing:p,children:s,"aria-label":c,...d},m)=>{let g=s==null;return C.createElement("div",{ref:m,role:"toolbar","aria-label":c??"Toolbar","data-gds-part":"toolbar","data-position":t??"top",className:l(Yg({position:t,variant:o,size:r,sticky:n}),e),...d},g?C.createElement(C.Fragment,null,C.createElement("div",{"data-gds-part":"toolbar-leading",className:"flex items-center min-w-0"},a),C.createElement("div",{"data-gds-part":"toolbar-center",className:"flex items-center min-w-0 justify-center"},i),C.createElement("div",{"data-gds-part":"toolbar-trailing",className:"flex items-center min-w-0 justify-end"},p)):s)});Qd.displayName="Toolbar";var ec=C.forwardRef(({className:e,align:t="leading",...o},r)=>C.createElement("div",{ref:r,"data-gds-part":`toolbar-${t}`,className:l("flex items-center min-w-0",t==="center"&&"justify-center",t==="trailing"&&"justify-end",e),...o}));ec.displayName="ToolbarSlot";var oc=C.createContext(null),Dn=C.createContext(0);function rc(){return C.useContext(Dn)}function Fr(e){let t=C.useContext(oc);if(!t)throw new Error(`<${e}> must be rendered inside a <Sidebar> root.`);return t}var po=C.forwardRef(({collapsed:e,defaultCollapsed:t=false,onCollapsedChange:o,collapsible:r=true,variant:n="rail",className:a,style:i,children:p,...s},c)=>{let d=e!==void 0,[m,g]=C.useState(t),u=d?e:m,b=n==="panel",f=()=>{let h=!u;d||g(h),o?.(h);};return C.createElement(En,{delayDuration:0},C.createElement(oc.Provider,{value:{collapsed:u}},C.createElement("aside",{ref:c,"data-gds-part":"sidebar","data-collapsed":u||void 0,"data-variant":n,className:l("relative flex h-full flex-col bg-card text-card-foreground",b?"w-full border border-border rounded-lg overflow-hidden":"border-r border-border transition-[width] duration-200 ease-out",a),style:b?i:{width:u?"var(--gds-sidebar-collapsed-width, 4rem)":"var(--gds-sidebar-width, 16rem)",...i},...s},p,r&&!b&&C.createElement("button",{type:"button",onClick:f,"aria-label":u?"Expand sidebar":"Collapse sidebar","data-gds-part":"sidebar-collapse-toggle",className:l("absolute -right-3 top-6 z-10 flex h-6 w-6 items-center justify-center","rounded-full border border-border bg-card text-muted-foreground shadow-sm","hover:text-foreground hover:bg-muted transition-colors")},u?C.createElement(ChevronRight,{className:"h-3 w-3"}):C.createElement(ChevronLeft,{className:"h-3 w-3"})))))});po.displayName="Sidebar";var In=C.forwardRef(({className:e,...t},o)=>{let{collapsed:r}=Fr("SidebarHeader");return C.createElement("div",{ref:o,"data-gds-part":"sidebar-header","data-collapsed":r||void 0,className:l("flex shrink-0 items-center border-b border-border",r?"justify-center px-2":"px-3","h-[var(--gds-sidebar-header-height,3.25rem)]",e),...t})});In.displayName="SidebarHeader";var Hn=C.forwardRef(({className:e,...t},o)=>C.createElement("nav",{ref:o,"data-gds-part":"sidebar-content",className:l("flex-1 overflow-y-auto overflow-x-hidden","py-[var(--gds-sidebar-content-py,0.5rem)]",e),...t}));Hn.displayName="SidebarContent";var Fn=C.forwardRef(({className:e,...t},o)=>{let{collapsed:r}=Fr("SidebarFooter");return C.createElement("div",{ref:o,"data-gds-part":"sidebar-footer","data-collapsed":r||void 0,className:l("shrink-0 border-t border-border",r?"px-2 py-2":"px-3 py-2",e),...t})});Fn.displayName="SidebarFooter";var zn=C.forwardRef(({title:e,icon:t,trailing:o,collapsible:r=true,defaultExpanded:n=true,className:a,children:i,...p},s)=>{let{collapsed:c}=Fr("SidebarSection"),[d,m]=C.useState(n),g=!!e&&r;return c?C.createElement("div",{ref:s,"data-gds-part":"sidebar-section",className:l("px-[var(--gds-sidebar-section-px,0.5rem)] space-y-[var(--gds-sidebar-section-gap,0.125rem)]",a),...p},i):C.createElement("div",{ref:s,"data-gds-part":"sidebar-section",className:l("px-[var(--gds-sidebar-section-px,0.5rem)] pb-1",a),...p},e&&(g?C.createElement("div",{className:l("group/header flex w-full items-center gap-1 rounded-md px-2 py-1.5 text-xs font-medium uppercase tracking-wide","text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors")},C.createElement("button",{type:"button",onClick:()=>m(u=>!u),"aria-expanded":d,className:"flex flex-1 items-center gap-2 text-left min-w-0"},t,C.createElement("span",{className:"flex-1 text-left normal-case truncate"},e),d?C.createElement(ChevronDown,{className:"h-3 w-3 shrink-0",strokeWidth:1.5}):C.createElement(ChevronRight,{className:"h-3 w-3 shrink-0",strokeWidth:1.5})),o&&C.createElement("span",{className:"flex items-center shrink-0",onClick:u=>u.stopPropagation(),onKeyDown:u=>u.stopPropagation()},o)):C.createElement("div",{className:l("flex items-center gap-2 px-2 py-1.5 text-xs font-medium uppercase tracking-wide","text-muted-foreground")},t,C.createElement("span",{className:"flex-1 truncate"},e),o&&C.createElement("span",{className:"shrink-0"},o))),d&&C.createElement("div",{className:l("mt-[var(--gds-sidebar-section-gap,0.125rem)]","space-y-[var(--gds-sidebar-section-gap,0.125rem)]")},i))});zn.displayName="SidebarSection";var Bn=C.forwardRef(({icon:e,badge:t,active:o=false,asButton:r=false,asChild:n=false,disabled:a=false,collapsedLabel:i,size:p="md",description:s,className:c,children:d,...m},g)=>{let{collapsed:u}=Fr("SidebarItem"),b=rc(),f=!u&&b>0?{paddingLeft:`calc(0.5rem + ${b} * var(--gds-sidebar-tree-indent, 1.5rem))`}:void 0,h=p==="sm",v=h?"text-xs px-2 py-1":"text-sm px-2 py-1.5",w=h&&!o?"font-normal":"font-medium",y=o?"bg-primary/10 text-primary":h?"text-muted-foreground hover:bg-muted hover:text-foreground":"text-foreground/80 hover:bg-muted hover:text-foreground",S=!u&&s!=null,k=l("group flex items-center gap-2.5 rounded-md transition-colors",v,w,S&&(h?"py-1.5":"py-2"),u?"justify-center px-2 py-2":null,y,a&&"opacity-50 pointer-events-none",c),H=S?C.createElement("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 text-left leading-tight"},C.createElement("span",{className:"truncate"},d),C.createElement("span",{className:l("truncate font-normal text-muted-foreground",h?"text-[10px]":"text-[11px]")},s)):C.createElement("span",{className:"flex-1 truncate text-left"},d),E=C.createElement(C.Fragment,null,e&&C.createElement("span",{className:"shrink-0 [&>svg]:h-4 [&>svg]:w-4","aria-hidden":true},e),!u&&H,!u&&t!==void 0&&t!==null&&C.createElement("span",{className:"ml-auto inline-flex items-center justify-center rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground"},t)),D;if(n)D=C.createElement(Slot,{"data-gds-part":"sidebar-item","data-active":o||void 0,"aria-current":o?"page":void 0,className:k,style:f},d);else if(r){let{href:A,target:q,rel:F,download:Y,hrefLang:J,ping:z,referrerPolicy:pe,type:x,...I}=m;D=C.createElement("button",{type:"button","data-gds-part":"sidebar-item","data-active":o||void 0,"aria-current":o?"page":void 0,disabled:a,className:l(k,"w-full text-left"),style:f,...I},E);}else D=C.createElement("a",{ref:g,"data-gds-part":"sidebar-item","data-active":o||void 0,"aria-current":o?"page":void 0,"aria-disabled":a||void 0,className:k,style:f,...m},E);if(!u)return D;let U=i??(typeof d=="string"?d:null);return U?C.createElement(Eo,null,C.createElement(Lo,{asChild:true},D),C.createElement(co,{side:"right",sideOffset:8},U,t!=null&&C.createElement("span",{className:"ml-2 inline-flex items-center justify-center rounded bg-foreground/10 px-1.5 py-0 text-[10px]"},t))):D});Bn.displayName="SidebarItem";var _n=C.forwardRef(function({label:t,icon:o,badge:r,active:n=false,defaultExpanded:a=true,expanded:i,onExpandedChange:p,disabled:s,description:c,trailing:d,className:m,style:g,children:u,...b},f){let{collapsed:h}=Fr("SidebarTreeItem"),v=rc(),w=i!==void 0,[y,S]=C.useState(a),k=w?i:y,H=()=>{let D=!k;w||S(D),p?.(D);};if(h)return C.createElement(Dn.Provider,{value:v},u);let E=v*1.5;return C.createElement("div",{"data-gds-part":"sidebar-tree-item"},C.createElement("div",{className:"group/row relative"},C.createElement("button",{ref:f,type:"button",onClick:H,"aria-expanded":k,"aria-current":n?"page":void 0,"data-active":n||void 0,disabled:s,className:l("group flex w-full items-center gap-1.5 rounded-md py-1 text-sm font-medium transition-colors",n?"bg-primary/10 text-primary":"text-foreground/80 hover:bg-muted hover:text-foreground",s&&"opacity-50 pointer-events-none",d!=null&&"pr-12",m),style:{paddingLeft:`calc(0.25rem + ${E}rem)`,paddingRight:d!=null?"3rem":"0.5rem",...g},...b},C.createElement("span",{className:"inline-flex h-4 w-4 items-center justify-center text-muted-foreground shrink-0","aria-hidden":true},k?C.createElement(ChevronDown,{className:"h-3 w-3"}):C.createElement(ChevronRight,{className:"h-3 w-3"})),o&&C.createElement("span",{className:"shrink-0 [&>svg]:h-4 [&>svg]:w-4","aria-hidden":true},o),c!=null?C.createElement("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5 text-left leading-tight"},C.createElement("span",{className:"truncate"},t),C.createElement("span",{className:"truncate text-[11px] font-normal text-muted-foreground"},c)):C.createElement("span",{className:"flex-1 truncate text-left"},t),r!=null&&C.createElement("span",{className:"ml-auto inline-flex items-center justify-center rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground"},r)),d!=null&&C.createElement("div",{onClick:D=>D.stopPropagation(),className:"pointer-events-auto absolute inset-y-0 right-1.5 flex items-center gap-0.5"},d)),k&&u&&C.createElement(Dn.Provider,{value:v+1},C.createElement("div",{className:"space-y-[var(--gds-sidebar-section-gap,0.125rem)]"},u)))});_n.displayName="SidebarTreeItem";po.Header=In;po.Content=Hn;po.Footer=Fn;po.Section=zn;po.Item=Bn;po.TreeItem=_n;var mo=[50,100,200,300,400,500,600,700,800,900,950],ac=[.985,.955,.895,.82,.72,.61,.51,.415,.325,.245,.17],Jg=[.015,.04,.075,.11,.14,.17,.17,.15,.12,.08,.04];function Da({hue:e,chromaScale:t=1}){let o=(e%360+360)%360,r={};for(let n=0;n<mo.length;n++){let a=ac[n],i=Jg[n]*t;r[mo[n]]=`${a.toFixed(4)} ${i.toFixed(4)} ${o.toFixed(2)}`;}return r}function nc(){let e={};for(let t=0;t<mo.length;t++){let o=ac[t];e[mo[t]]=`${o.toFixed(4)} 0 0`;}return e}var On={light:{destructive:"0.560 0.220 27.0",destructiveFg:"0.990 0.005 27.0",success:"0.610 0.180 145.0",warning:"0.720 0.180 60.0",info:"0.580 0.200 240.0",highlight:"0.860 0.180 95.0"},dark:{destructive:"0.680 0.220 27.0",destructiveFg:"0.990 0.005 27.0",success:"0.720 0.180 145.0",warning:"0.800 0.180 60.0",info:"0.700 0.200 240.0",highlight:"0.880 0.180 95.0"}},zr="1 0 0",ic="0 0 0";function er(e,t){let[,o,r]=e.split(/\s+/).map(d=>d.trim()),n=Number(o),a=r;if(t==="light"){let m=Math.min(n*.22,.045),g=.38,u=n;return {soft:`${.965.toFixed(3)} ${m.toFixed(3)} ${a}`,deep:`${g.toFixed(3)} ${u.toFixed(3)} ${a}`}}let i=.22,p=Math.min(n*.45,.075),s=.82,c=n*.9;return {soft:`${i.toFixed(3)} ${p.toFixed(3)} ${a}`,deep:`${s.toFixed(3)} ${c.toFixed(3)} ${a}`}}var Aa={geist:"var(--font-geist), system-ui, sans-serif",inter:"var(--font-inter), system-ui, sans-serif",manrope:"var(--font-manrope), system-ui, sans-serif",figtree:"var(--font-figtree), system-ui, sans-serif",dmSans:"var(--font-dm-sans), system-ui, sans-serif",lexend:"var(--font-lexend), system-ui, sans-serif",outfit:"var(--font-outfit), system-ui, sans-serif",plusJakarta:"var(--font-plus-jakarta), system-ui, sans-serif",spaceGrotesk:"var(--font-space-grotesk), system-ui, sans-serif",fraunces:"var(--font-fraunces), Georgia, serif",instrumentSerif:"var(--font-instrument-serif), Georgia, serif",sourceSerif:"var(--font-source-serif), Georgia, serif",jetbrainsMono:"var(--font-jetbrains-mono), ui-monospace, monospace",geistMono:"var(--font-geist-mono), ui-monospace, monospace",ibmPlexMono:"var(--font-ibm-plex-mono), ui-monospace, monospace",system:"system-ui, -apple-system, sans-serif",serif:"Georgia, 'Times New Roman', serif",mono:"ui-monospace, Menlo, monospace"};var Qg=["superLight","light","dark","superDark"],ef={muted:.6,default:1,vibrant:1.3};function tf(e,t,o){let r=t.primary*o,n=t.accent*o,a=(r+n)/2*.8,i=p=>(p%360+360)%360;return {1:`0.600 ${(.17*r).toFixed(4)} ${e.primary.toFixed(2)}`,2:`0.640 ${(.17*a).toFixed(4)} ${i(e.primary+140).toFixed(2)}`,3:`0.580 ${(.17*a).toFixed(4)} ${i(e.primary+220).toFixed(2)}`,4:`0.510 0.0250 ${e.neutral.toFixed(2)}`,5:`0.620 ${(.17*n).toFixed(4)} ${e.accent.toFixed(2)}`}}var $=e=>({source:"neutral",step:e}),bt=e=>({source:"primary",step:e}),uo=e=>({source:"accent",step:e}),Br=e=>({source:"pure",value:e}),of={superLight:{background:$(50),foreground:$(800),card:Br(zr),cardForeground:$(800),popover:Br(zr),popoverForeground:$(800),primary:bt(600),primaryForeground:bt(50),secondary:$(100),secondaryForeground:$(700),muted:$(100),mutedForeground:$(500),accent:uo(600),accentForeground:uo(50),border:$(200),input:$(200),ring:bt(500)},light:{background:$(50),foreground:$(950),card:Br(zr),cardForeground:$(950),popover:Br(zr),popoverForeground:$(950),primary:bt(500),primaryForeground:bt(50),secondary:$(100),secondaryForeground:$(700),muted:$(100),mutedForeground:$(500),accent:uo(500),accentForeground:uo(50),border:$(200),input:$(200),ring:bt(500)},dark:{background:$(950),foreground:$(50),card:$(900),cardForeground:$(50),popover:$(900),popoverForeground:$(50),primary:bt(400),primaryForeground:bt(950),secondary:$(800),secondaryForeground:$(200),muted:$(800),mutedForeground:$(400),accent:uo(400),accentForeground:uo(950),border:$(800),input:$(800),ring:bt(400)},superDark:{background:Br(ic),foreground:$(100),card:$(950),cardForeground:$(100),popover:$(950),popoverForeground:$(100),primary:bt(300),primaryForeground:bt(950),secondary:$(900),secondaryForeground:$(300),muted:$(900),mutedForeground:$(500),accent:uo(300),accentForeground:uo(950),border:$(900),input:$(900),ring:bt(300)}};function Be(e,t){return e.source==="pure"?e.value:t[e.source][e.step]}function rf(e,t){let o=of[t],r=t==="superLight"||t==="light",n=r?On.light:On.dark;return {background:Be(o.background,e),foreground:Be(o.foreground,e),card:Be(o.card,e),cardForeground:Be(o.cardForeground,e),popover:Be(o.popover,e),popoverForeground:Be(o.popoverForeground,e),primary:Be(o.primary,e),primaryForeground:Be(o.primaryForeground,e),secondary:Be(o.secondary,e),secondaryForeground:Be(o.secondaryForeground,e),muted:Be(o.muted,e),mutedForeground:Be(o.mutedForeground,e),accent:Be(o.accent,e),accentForeground:Be(o.accentForeground,e),border:Be(o.border,e),input:Be(o.input,e),ring:Be(o.ring,e),destructive:n.destructive,destructiveForeground:n.destructiveFg,success:n.success,warning:n.warning,info:n.info,highlight:n.highlight,...(()=>{let a=r?"light":"dark",i=er(n.destructive,a),p=er(n.success,a),s=er(n.warning,a),c=er(n.info,a),d=er(n.highlight,a);return {destructiveSoft:i.soft,destructiveDeep:i.deep,successSoft:p.soft,successDeep:p.deep,warningSoft:s.soft,warningDeep:s.deep,infoSoft:c.soft,infoDeep:c.deep,highlightSoft:d.soft,highlightDeep:d.deep}})()}}var Zt={display:3.75,h1:2.5,h2:2,h3:1.5,h4:1.25,h5:1.125,h6:1,body:1,bodySm:.875},af={compact:.85,default:1,spacious:1.18};function nf(e){let t=af[e.scale],o=r=>`${(r*t).toFixed(3)}rem`;return {fontSans:Aa[e.body],fontMono:Aa[e.mono],fontDisplay:Aa[e.display],headingWeight:e.headingWeight??600,bodyWeight:e.bodyWeight??400,headingTracking:e.headingTracking??"-0.01em",scale:{display:o(Zt.display),h1:o(Zt.h1),h2:o(Zt.h2),h3:o(Zt.h3),h4:o(Zt.h4),h5:o(Zt.h5),h6:o(Zt.h6),body:o(Zt.body),bodySm:o(Zt.bodySm)}}}var sf={sharp:0,subtle:.25,soft:.5,round:.875,pill:1.25};function lf(e){let t=sf[e.style],o=r=>`${r.toFixed(3)}rem`;return {base:o(t),sm:o(Math.max(0,t-.25)),md:o(t),lg:o(t+.25),xl:o(t+.5),"2xl":o(t+1),full:"9999px"}}var df={tight:.85,default:1,roomy:1.2};function cf(e){return {baseUnit:"1rem",densityFactor:df[e.density]}}var pf={none:{sm:"none",md:"none",lg:"none",xl:"none","2xl":"none",inner:"none"},subtle:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.03)",md:"0 2px 4px -1px rgb(0 0 0 / 0.04), 0 1px 2px -1px rgb(0 0 0 / 0.03)",lg:"0 6px 14px -2px rgb(0 0 0 / 0.05)",xl:"0 12px 24px -4px rgb(0 0 0 / 0.06)","2xl":"0 24px 48px -12px rgb(0 0 0 / 0.12)",inner:"inset 0 1px 2px 0 rgb(0 0 0 / 0.03)"},default:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)"},dramatic:{sm:"0 2px 4px 0 rgb(0 0 0 / 0.12)",md:"0 8px 16px -2px rgb(0 0 0 / 0.18), 0 4px 8px -4px rgb(0 0 0 / 0.12)",lg:"0 20px 32px -4px rgb(0 0 0 / 0.22), 0 8px 16px -8px rgb(0 0 0 / 0.18)",xl:"0 32px 48px -6px rgb(0 0 0 / 0.28), 0 12px 24px -10px rgb(0 0 0 / 0.22)","2xl":"0 48px 80px -16px rgb(0 0 0 / 0.45)",inner:"inset 0 4px 8px 0 rgb(0 0 0 / 0.1)"}};function mf(e){let t=e?.shadows??"default",o=e?.motionIntensity??1,r=n=>`${Math.round(n*o)}ms`;return {shadows:pf[t],motion:{fast:r(150),base:r(200),slow:r(300),slower:r(500)},borderWidth:e?.borderWidth??"1px"}}function Io(e){let t=ef[e.intensity??"default"],o=e.neutralPureGray??false,r=(e.chroma?.neutral??.08)*t,n=(e.chroma?.primary??1)*t,a=(e.chroma?.accent??1)*t,i=o?nc():Da({hue:e.hues.neutral,chromaScale:r}),p=Da({hue:e.hues.primary,chromaScale:n}),s=Da({hue:e.hues.accent,chromaScale:a}),c={neutral:i,primary:p,accent:s},d=tf(e.hues,{primary:n,accent:a},t),m=Object.fromEntries(Qg.map(v=>[v,rf(c,v)])),g=nf(e.typography),u=lf(e.radius),b=cf(e.spacing),f=mf(e.effects),h={buttonShape:e.components?.buttonShape??"default",inputStyle:e.components?.inputStyle??"outlined",cardStyle:e.components?.cardStyle??"flat"};return {id:e.id,name:e.name,description:e.description,tagline:e.tagline,input:e,ramps:c,colors:m,chart:d,typography:g,radius:u,spacing:b,effects:f,components:h}}var _r={id:"calm",name:"Calm",description:"Warm neutrals, terracotta primary, serif typography.",tagline:"Signature",hues:{neutral:40,primary:20,accent:40},chroma:{neutral:.15,primary:.75,accent:.8},intensity:"muted",typography:{display:"fraunces",body:"fraunces",mono:"jetbrainsMono",scale:"default",headingWeight:600,headingTracking:"-0.02em"},spacing:{density:"roomy"},radius:{style:"round"},effects:{shadows:"subtle",motionIntensity:1.25},components:{buttonShape:"pill",inputStyle:"outlined",cardStyle:"outlined"}},Vn={id:"energy",name:"Energy",description:"Teal + indigo \u2014 punchy, cool-tone, modern sans.",tagline:"Alternate",hues:{neutral:175,primary:175,accent:235},chroma:{neutral:.08,primary:1,accent:1},intensity:"vibrant",typography:{display:"geist",body:"geist",mono:"geistMono",scale:"default",headingWeight:600},spacing:{density:"default"},radius:{style:"soft"},effects:{shadows:"default",motionIntensity:1},components:{buttonShape:"default",inputStyle:"outlined",cardStyle:"flat"}},Ia=[_r,Vn];function uf(e){return {"--background":e.background,"--foreground":e.foreground,"--card":e.card,"--card-foreground":e.cardForeground,"--popover":e.popover,"--popover-foreground":e.popoverForeground,"--primary":e.primary,"--primary-foreground":e.primaryForeground,"--secondary":e.secondary,"--secondary-foreground":e.secondaryForeground,"--muted":e.muted,"--muted-foreground":e.mutedForeground,"--accent":e.accent,"--accent-foreground":e.accentForeground,"--destructive":e.destructive,"--destructive-foreground":e.destructiveForeground,"--border":e.border,"--input":e.input,"--ring":e.ring,"--success":e.success,"--warning":e.warning,"--info":e.info,"--highlight":e.highlight,"--destructive-soft":e.destructiveSoft,"--destructive-deep":e.destructiveDeep,"--success-soft":e.successSoft,"--success-deep":e.successDeep,"--warning-soft":e.warningSoft,"--warning-deep":e.warningDeep,"--info-soft":e.infoSoft,"--info-deep":e.infoDeep,"--highlight-soft":e.highlightSoft,"--highlight-deep":e.highlightDeep}}function jn(e,t){let o=e.colors[t];return {...uf(o),...Gn("neutral",e.ramps.neutral),...Gn("primary",e.ramps.primary),...Gn("accent",e.ramps.accent),"--chart-1":e.chart[1],"--chart-2":e.chart[2],"--chart-3":e.chart[3],"--chart-4":e.chart[4],"--chart-5":e.chart[5],"--font-sans":e.typography.fontSans,"--font-mono":e.typography.fontMono,"--font-display":e.typography.fontDisplay,"--font-heading-weight":String(e.typography.headingWeight),"--font-body-weight":String(e.typography.bodyWeight),"--font-heading-tracking":e.typography.headingTracking,"--text-display":e.typography.scale.display,"--text-h1":e.typography.scale.h1,"--text-h2":e.typography.scale.h2,"--text-h3":e.typography.scale.h3,"--text-h4":e.typography.scale.h4,"--text-h5":e.typography.scale.h5,"--text-h6":e.typography.scale.h6,"--text-body":e.typography.scale.body,"--text-body-sm":e.typography.scale.bodySm,"--radius":e.radius.base,"--gds-radius-sm":e.radius.sm,"--gds-radius-md":e.radius.md,"--gds-radius-lg":e.radius.lg,"--gds-radius-xl":e.radius.xl,"--gds-radius-2xl":e.radius["2xl"],"--gds-radius-full":e.radius.full,"--gds-density":String(e.spacing.densityFactor),"--gds-shadow-sm":e.effects.shadows.sm,"--gds-shadow-md":e.effects.shadows.md,"--gds-shadow-lg":e.effects.shadows.lg,"--gds-shadow-xl":e.effects.shadows.xl,"--gds-shadow-2xl":e.effects.shadows["2xl"],"--gds-shadow-inner":e.effects.shadows.inner,"--gds-transition-fast":e.effects.motion.fast,"--gds-transition-base":e.effects.motion.base,"--gds-transition-slow":e.effects.motion.slow,"--gds-transition-slower":e.effects.motion.slower,"--gds-border-width":e.effects.borderWidth}}function Gn(e,t){let o={};for(let r of mo)o[`--ramp-${e}-${r}`]=t[r];return o}function Ha(e,t){if(typeof document>"u")return;let o=document.documentElement,r=jn(e,t);for(let[n,a]of Object.entries(r))o.style.setProperty(n,a);o.setAttribute("data-grade-theme",e.id),o.setAttribute("data-mode",t),o.setAttribute("data-button-shape",e.components.buttonShape??"default"),o.setAttribute("data-input-style",e.components.inputStyle??"outlined"),o.setAttribute("data-card-style",e.components.cardStyle??"flat");}function Or(e){if(typeof document>"u")return "";let t=document.createElement("span");t.style.color=`oklch(${e})`,t.style.position="absolute",t.style.visibility="hidden",document.body.appendChild(t);let o=getComputedStyle(t).color;document.body.removeChild(t);let r=o.match(/\d+/g);if(!r||r.length<3)return "";let[n,a,i]=r.slice(0,3).map(Number);return "#"+[n,a,i].map(p=>Math.max(0,Math.min(255,p)).toString(16).padStart(2,"0")).join("").toUpperCase()}function gf(e){let t=e.trim().split(/\s+/);if(t.length<3)return {oklch:e,hex:""};let[o,r,n]=t.map(Number),a=`${o.toFixed(3)} ${r.toFixed(3)} ${Math.round(n)}`,i=Or(e);return {oklch:a,hex:i}}function Wn(e,t,o){let r=[`### ${e} ramp (hue ${Math.round(o)}\xB0)`,"","| Step | OKLCH | Hex |","|------|-------|-----|"];for(let n of mo){let{oklch:a,hex:i}=gf(t[n]);r.push(`| ${n} | \`${a}\` | \`${i||"\u2014"}\` |`);}return r.join(`
117
+ `)}function sc(e,t){let o=[`### ${e}`,"","| Token | Usage | Light (hex) | Dark (hex) |","|-------|-------|-------------|------------|"];for(let r of t){let n=Or(r.light)||"\u2014",a=Or(r.dark)||"\u2014";o.push(`| \`--${r.token}\` | ${r.usage} | \`${n}\` (\`${r.light}\`) | \`${a}\` (\`${r.dark}\`) |`);}return o.join(`
118
+ `)}function lc(e){return !e||e.input==null?"{}":JSON.stringify(e.input,null,2)??"{}"}function dc(e){let{input:t,ramps:o,colors:r,chart:n,typography:a,radius:i,spacing:p,effects:s,components:c}=e,d=t.intensity??"default",m=f=>({token:f,usage:ff[f]??"",light:r.light[f],dark:r.dark[f]}),g=["background","foreground","card","cardForeground","popover","popoverForeground","primary","primaryForeground","secondary","secondaryForeground","muted","mutedForeground","accent","accentForeground","border","input","ring"].map(m),u=["destructive","destructiveForeground","success","warning","info","highlight"].map(m),b=[1,2,3,4,5].map(f=>{let h=n[f];return {slot:f,triplet:h,hex:Or(h)||"\u2014"}});return `# ${e.name} \u2014 Grade Design System Theme
119
119
 
120
120
  > **Portable theme spec.** Paste this entire file into a fresh LLM prompt along with your design brief. The model will have everything it needs to produce UI that matches this exact theme \u2014 colors, typography, spacing, shapes, and the "feel" we're after.
121
121
 
@@ -128,7 +128,7 @@ ${t.description?`- **Description**: ${t.description}
128
128
  - **Intensity**: \`${d}\` ${d==="muted"?"(quieter chroma across the board)":d==="vibrant"?"(punchier chroma across the board)":"(balanced)"}
129
129
  - **Typography**: ${t.typography.display} display \xB7 ${t.typography.body} body \xB7 ${t.typography.mono} mono \xB7 scale \`${t.typography.scale}\`
130
130
  - **Spacing density**: \`${t.spacing.density}\`
131
- - **Radius style**: \`${t.radius.style}\` (base \`${l.base}\`)
131
+ - **Radius style**: \`${t.radius.style}\` (base \`${i.base}\`)
132
132
  - **Button shape**: \`${c.buttonShape}\` \xB7 **Input style**: \`${c.inputStyle}\` \xB7 **Card style**: \`${c.cardStyle}\`
133
133
  - **Shadow preset**: \`${t.effects?.shadows??"default"}\` \xB7 **Motion intensity**: \`${t.effects?.motionIntensity??1}\`
134
134
 
@@ -145,30 +145,30 @@ A \`ThemeInput\` is a small object (three hues plus a handful of presets). The g
145
145
  ## Full ThemeInput (round-trippable)
146
146
 
147
147
  \`\`\`json
148
- ${Ql(e)}
148
+ ${lc(e)}
149
149
  \`\`\`
150
150
 
151
151
  ## Color ramps
152
152
 
153
153
  Three 11-stop OKLCH ramps, generated from the input hues + chromas + global intensity. Every color elsewhere in the theme resolves back to one of these stops.
154
154
 
155
- ${Qa("Neutral",o.neutral,t.hues.neutral)}
155
+ ${Wn("Neutral",o.neutral,t.hues.neutral)}
156
156
 
157
- ${Qa("Primary",o.primary,t.hues.primary)}
157
+ ${Wn("Primary",o.primary,t.hues.primary)}
158
158
 
159
- ${Qa("Accent",o.accent,t.hues.accent)}
159
+ ${Wn("Accent",o.accent,t.hues.accent)}
160
160
 
161
161
  ## Semantic tokens (hue-derived)
162
162
 
163
163
  Purpose-based tokens drawn from the ramps. Two values per token \u2014 the generator produces them for all four brightness modes, but only light + dark are shown here for brevity.
164
164
 
165
- ${Jl("Core semantic tokens",g)}
165
+ ${sc("Core semantic tokens",g)}
166
166
 
167
167
  ## Fixed semantic tokens (not hue-derived)
168
168
 
169
169
  Status colors stay consistent across themes so users always read green as success, red as destructive, etc. Accessibility wins over brand cohesion.
170
170
 
171
- ${Jl("Status colors",u)}
171
+ ${sc("Status colors",u)}
172
172
 
173
173
  ## Chart palette
174
174
 
@@ -176,7 +176,7 @@ ${Jl("Status colors",u)}
176
176
 
177
177
  | Slot | OKLCH | Hex |
178
178
  |------|-------|-----|
179
- ${b.map(h=>`| \`--chart-${h.slot}\` | \`${h.triplet}\` | \`${h.hex}\` |`).join(`
179
+ ${b.map(f=>`| \`--chart-${f.slot}\` | \`${f.triplet}\` | \`${f.hex}\` |`).join(`
180
180
  `)}
181
181
 
182
182
  ## Typography
@@ -208,13 +208,13 @@ ${b.map(h=>`| \`--chart-${h.slot}\` | \`${h.triplet}\` | \`${h.hex}\` |`).join(`
208
208
 
209
209
  | Step | Value |
210
210
  |------|-------|
211
- | \`--radius\` (base) | \`${l.base}\` |
212
- | \`--gds-radius-sm\` | \`${l.sm}\` |
213
- | \`--gds-radius-md\` | \`${l.md}\` |
214
- | \`--gds-radius-lg\` | \`${l.lg}\` |
215
- | \`--gds-radius-xl\` | \`${l.xl}\` |
216
- | \`--gds-radius-2xl\` | \`${l["2xl"]}\` |
217
- | \`--gds-radius-full\` | \`${l.full}\` |
211
+ | \`--radius\` (base) | \`${i.base}\` |
212
+ | \`--gds-radius-sm\` | \`${i.sm}\` |
213
+ | \`--gds-radius-md\` | \`${i.md}\` |
214
+ | \`--gds-radius-lg\` | \`${i.lg}\` |
215
+ | \`--gds-radius-xl\` | \`${i.xl}\` |
216
+ | \`--gds-radius-2xl\` | \`${i["2xl"]}\` |
217
+ | \`--gds-radius-full\` | \`${i.full}\` |
218
218
 
219
219
  ### Spacing
220
220
 
@@ -225,10 +225,10 @@ ${b.map(h=>`| \`--chart-${h.slot}\` | \`${h.triplet}\` | \`${h.hex}\` |`).join(`
225
225
 
226
226
  | Var | Duration |
227
227
  |-----|----------|
228
- | \`--gds-transition-fast\` | \`${i.motion.fast}\` |
229
- | \`--gds-transition-base\` | \`${i.motion.base}\` |
230
- | \`--gds-transition-slow\` | \`${i.motion.slow}\` |
231
- | \`--gds-transition-slower\` | \`${i.motion.slower}\` |
228
+ | \`--gds-transition-fast\` | \`${s.motion.fast}\` |
229
+ | \`--gds-transition-base\` | \`${s.motion.base}\` |
230
+ | \`--gds-transition-slow\` | \`${s.motion.slow}\` |
231
+ | \`--gds-transition-slower\` | \`${s.motion.slower}\` |
232
232
 
233
233
  ### Shadows
234
234
 
@@ -236,10 +236,10 @@ All shadows are applied via Tailwind's \`shadow-*\` utilities mapped to these va
236
236
 
237
237
  | Var | Value |
238
238
  |-----|-------|
239
- | \`--gds-shadow-sm\` | \`${i.shadows.sm}\` |
240
- | \`--gds-shadow-md\` | \`${i.shadows.md}\` |
241
- | \`--gds-shadow-lg\` | \`${i.shadows.lg}\` |
242
- | \`--gds-shadow-xl\` | \`${i.shadows.xl}\` |
239
+ | \`--gds-shadow-sm\` | \`${s.shadows.sm}\` |
240
+ | \`--gds-shadow-md\` | \`${s.shadows.md}\` |
241
+ | \`--gds-shadow-lg\` | \`${s.shadows.lg}\` |
242
+ | \`--gds-shadow-xl\` | \`${s.shadows.xl}\` |
243
243
 
244
244
  ## CSS variable conventions
245
245
 
@@ -297,7 +297,7 @@ Every component accepts a \`className\` for layout tweaks. Variants are passed v
297
297
 
298
298
  When generating UI in the ${e.name} theme, match this character:
299
299
 
300
- ${zu(e)}
300
+ ${hf(e)}
301
301
 
302
302
  ## Instructions for the generating LLM
303
303
 
@@ -316,7 +316,7 @@ To recreate this theme in code:
316
316
  \`\`\`ts
317
317
  import { generateTheme, applyThemeToRoot, type ThemeInput } from "@gradeui/ui";
318
318
 
319
- const input: ThemeInput = ${Ql(e).replace(/\n/g,`
319
+ const input: ThemeInput = ${lc(e).replace(/\n/g,`
320
320
  `)};
321
321
 
322
322
  const theme = generateTheme(input);
@@ -325,11 +325,11 @@ applyThemeToRoot(theme, "light"); // or "dark" / "superLight" / "superDark"
325
325
 
326
326
  ---
327
327
  *Generated from Grade Design System v1 \xB7 ${new Date().toISOString()}*
328
- `}var Bu={background:"Page / body background",foreground:"Primary text",card:"Elevated surface background",cardForeground:"Text on cards",popover:"Floating menu background",popoverForeground:"Text inside floating menus",primary:"Primary actions, links, default button",primaryForeground:"Text on primary-tinted fills",secondary:"Secondary surfaces + quiet buttons",secondaryForeground:"Text on secondary surfaces",muted:"Subtle surfaces (hover states, skeletons)",mutedForeground:"Secondary / less-important text",accent:"Highlights, hover accents",accentForeground:"Text on accent surfaces",border:"Default borders",input:"Form input borders",ring:"Focus ring color",destructive:"Destructive actions, errors",destructiveForeground:"Text on destructive surfaces",success:"Success states",warning:"Warning states",info:"Informational states",highlight:"Emphasis, new features, callouts"};function zu(e){let t=[],{input:o,components:r}=e;o.intensity==="muted"?t.push("- **Quiet and restrained.** Avoid heavy saturation, glowing effects, or loud contrast jumps. Let whitespace do the work."):o.intensity==="vibrant"?t.push("- **Loud and confident.** Primary color wants to lead. Use it on hero CTAs, key metrics, empty states. Don't be shy."):t.push("- **Balanced.** Neither shouty nor sleepy \u2014 a workhorse feel suited to product interfaces."),o.spacing.density==="roomy"?t.push("- **Generous spacing.** Stretch things out \u2014 reach for `gap-6`, `gap-8`, `p-6`, `p-8`. Airy is the vibe."):o.spacing.density==="tight"?t.push("- **Dense layouts.** Pack information in \u2014 `gap-2`, `gap-3`, `p-3`, `p-4`. Scan-friendly dashboard energy."):t.push("- **Standard density.** Use Tailwind's default spacing ladder."),o.radius.style==="pill"?t.push("- **Fully rounded.** Controls are pill-shaped. Use `rounded-full` on custom chips / pills too."):o.radius.style==="sharp"?t.push("- **Square corners.** Zero radius everywhere \u2014 very architectural. Do not add curves."):o.radius.style==="round"?t.push("- **Rounded and friendly.** Corner radius is noticeable (\u224814px base). Avoid sharp edges."):t.push("- **Standard rounded corners.**");let n=o.typography.display;return n==="fraunces"||n==="instrumentSerif"||n==="sourceSerif"?t.push("- **Editorial serif headings.** Treat headings like magazine titles \u2014 give them space and weight. Serifs reward larger sizes."):(n==="geist"||n==="inter")&&t.push("- **Modern technical sans.** Clean, functional, neutral. Good for product UIs."),r.cardStyle==="outlined"?t.push("- **Cards are outlined**, not shadowed. Rely on borders + spacing for hierarchy."):r.cardStyle==="elevated"?t.push("- **Cards have real elevation.** Use shadows to stack content visually."):r.cardStyle==="glass"&&t.push("- **Glass / frosted cards.** Use translucent surfaces over background imagery or gradients."),r.buttonShape==="pill"&&t.push("- **Buttons are pills** \u2014 don't override with square corners."),t.join(`
329
- `)}function en(e){if(typeof window>"u"||typeof document>"u")return;let t=ed(e),o=new Blob([t],{type:"text/markdown;charset=utf-8"}),r=URL.createObjectURL(o),n=document.createElement("a");n.href=r,n.download=`grade-theme-${e.input.id}.md`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r);}var kt=Object.fromEntries(Zr.map(e=>[e.id,po(e)])),Eo=cr.id;function mo(e){if(e in kt)return kt[e];let t=on(e);if(t)return po(t)}function tn(){return [...Object.values(kt),...rd()]}var td="grade-user-themes";function Jr(){if(typeof localStorage>"u")return {};try{let e=localStorage.getItem(td);if(!e)return {};let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return {}}}function od(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(td,JSON.stringify(e));}catch{}}function rd(){return Object.values(Jr()).map(po)}function on(e){return Jr()[e]}function Qr(e){let t=Jr();return t[e.id]=e,od(t),po(e)}function rn(e){if(e in kt)return;let t=Jr();delete t[e],od(t);}function Ou(e,t,o){let r=kt[e]?.input??on(e);if(!r)return;let n={...r,id:t,name:o};return Qr(n),n}var an="grade-theme",ea="grade-mode",nd=["superLight","light","dark","superDark"],ad=new Set(["dark","superDark"]),Vu=`
328
+ `}var ff={background:"Page / body background",foreground:"Primary text",card:"Elevated surface background",cardForeground:"Text on cards",popover:"Floating menu background",popoverForeground:"Text inside floating menus",primary:"Primary actions, links, default button",primaryForeground:"Text on primary-tinted fills",secondary:"Secondary surfaces + quiet buttons",secondaryForeground:"Text on secondary surfaces",muted:"Subtle surfaces (hover states, skeletons)",mutedForeground:"Secondary / less-important text",accent:"Highlights, hover accents",accentForeground:"Text on accent surfaces",border:"Default borders",input:"Form input borders",ring:"Focus ring color",destructive:"Destructive actions, errors",destructiveForeground:"Text on destructive surfaces",success:"Success states",warning:"Warning states",info:"Informational states",highlight:"Emphasis, new features, callouts"};function hf(e){let t=[],{input:o,components:r}=e;o.intensity==="muted"?t.push("- **Quiet and restrained.** Avoid heavy saturation, glowing effects, or loud contrast jumps. Let whitespace do the work."):o.intensity==="vibrant"?t.push("- **Loud and confident.** Primary color wants to lead. Use it on hero CTAs, key metrics, empty states. Don't be shy."):t.push("- **Balanced.** Neither shouty nor sleepy \u2014 a workhorse feel suited to product interfaces."),o.spacing.density==="roomy"?t.push("- **Generous spacing.** Stretch things out \u2014 reach for `gap-6`, `gap-8`, `p-6`, `p-8`. Airy is the vibe."):o.spacing.density==="tight"?t.push("- **Dense layouts.** Pack information in \u2014 `gap-2`, `gap-3`, `p-3`, `p-4`. Scan-friendly dashboard energy."):t.push("- **Standard density.** Use Tailwind's default spacing ladder."),o.radius.style==="pill"?t.push("- **Fully rounded.** Controls are pill-shaped. Use `rounded-full` on custom chips / pills too."):o.radius.style==="sharp"?t.push("- **Square corners.** Zero radius everywhere \u2014 very architectural. Do not add curves."):o.radius.style==="round"?t.push("- **Rounded and friendly.** Corner radius is noticeable (\u224814px base). Avoid sharp edges."):t.push("- **Standard rounded corners.**");let n=o.typography.display;return n==="fraunces"||n==="instrumentSerif"||n==="sourceSerif"?t.push("- **Editorial serif headings.** Treat headings like magazine titles \u2014 give them space and weight. Serifs reward larger sizes."):(n==="geist"||n==="inter")&&t.push("- **Modern technical sans.** Clean, functional, neutral. Good for product UIs."),r.cardStyle==="outlined"?t.push("- **Cards are outlined**, not shadowed. Rely on borders + spacing for hierarchy."):r.cardStyle==="elevated"?t.push("- **Cards have real elevation.** Use shadows to stack content visually."):r.cardStyle==="glass"&&t.push("- **Glass / frosted cards.** Use translucent surfaces over background imagery or gradients."),r.buttonShape==="pill"&&t.push("- **Buttons are pills** \u2014 don't override with square corners."),t.join(`
329
+ `)}function Un(e){if(typeof window>"u"||typeof document>"u")return;let t=dc(e),o=new Blob([t],{type:"text/markdown;charset=utf-8"}),r=URL.createObjectURL(o),n=document.createElement("a");n.href=r,n.download=`grade-theme-${e.input.id}.md`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r);}var Ft=Object.fromEntries(Ia.map(e=>[e.id,Io(e)])),tr=_r.id;function Ho(e){if(e in Ft)return Ft[e];let t=Kn(e);if(t)return Io(t)}function $n(){return [...Object.values(Ft),...mc()]}var cc="grade-user-themes";function Fa(){if(typeof localStorage>"u")return {};try{let e=localStorage.getItem(cc);if(!e)return {};let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return {}}}function pc(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(cc,JSON.stringify(e));}catch{}}function mc(){return Object.values(Fa()).map(Io)}function Kn(e){return Fa()[e]}function za(e){let t=Fa();return t[e.id]=e,pc(t),Io(e)}function qn(e){if(e in Ft)return;let t=Fa();delete t[e],pc(t);}function bf(e,t,o){let r=Ft[e]?.input??Kn(e);if(!r)return;let n={...r,id:t,name:o};return za(n),n}var Yn="grade-theme",Ba="grade-mode",gc=["superLight","light","dark","superDark"],uc=new Set(["dark","superDark"]),vf=`
330
330
  (function() {
331
331
  try {
332
- var mode = localStorage.getItem('${ea}');
332
+ var mode = localStorage.getItem('${Ba}');
333
333
  var valid = ['superLight','light','dark','superDark'];
334
334
  if (!mode || valid.indexOf(mode) === -1) {
335
335
  mode = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
@@ -338,11 +338,14 @@ applyThemeToRoot(theme, "light"); // or "dark" / "superLight" / "superDark"
338
338
  document.documentElement.classList.add('dark');
339
339
  }
340
340
  document.documentElement.setAttribute('data-mode', mode);
341
- var themeId = localStorage.getItem('${an}');
341
+ var themeId = localStorage.getItem('${Yn}');
342
342
  if (themeId) document.documentElement.setAttribute('data-grade-theme', themeId);
343
343
  } catch(e) {}
344
344
  })();
345
- `,nn=S.createContext(null);function _u({children:e,defaultTheme:t=Eo,defaultMode:o="light"}){let[r,n]=S.useState(t),[a,l]=S.useState(o),[p,i]=S.useState(0);S.useEffect(()=>{try{let h=localStorage.getItem(an);h&&mo(h)&&n(h);let f=localStorage.getItem(ea);if(f&&nd.includes(f))l(f);else if(typeof window<"u"){let y=window.matchMedia("(prefers-color-scheme: dark)").matches;l(y?"dark":"light");}}catch{}},[]),S.useEffect(()=>{let h=mo(r)??mo(Eo);h&&(Xr(h,a),typeof document<"u"&&document.documentElement.classList.toggle("dark",ad.has(a)));},[r,a,p]),S.useEffect(()=>{if(typeof window>"u")return;let h=window.matchMedia("(prefers-color-scheme: dark)"),f=y=>{try{if(localStorage.getItem(ea))return}catch{return}l(y.matches?"dark":"light");};return h.addEventListener("change",f),()=>h.removeEventListener("change",f)},[]);let c=S.useCallback(h=>{n(h);try{localStorage.setItem(an,h);}catch{}},[]),d=S.useCallback(h=>{l(h);try{localStorage.setItem(ea,h);}catch{}},[]),m=S.useCallback(h=>{Qr(h),i(f=>f+1),c(h.id);},[c]),g=S.useCallback(h=>{h in kt||(rn(h),i(f=>f+1),n(f=>f===h?Eo:f));},[]),u=S.useCallback(()=>{i(h=>h+1);},[]),b=S.useMemo(()=>{let h=mo(r)??mo(Eo);return {theme:h,themeId:h.id,mode:a,isDark:ad.has(a),setThemeId:c,setMode:d,themes:tn(),saveAndActivate:m,deleteTheme:g,refresh:u}},[r,a,p,c,d,m,g,u]);return S.createElement(nn.Provider,{value:b},e)}function sn(){let e=S.useContext(nn);if(!e)throw new Error("useGradeTheme must be used inside <GradeThemeProvider>. Wrap your app (typically in app/layout.tsx).");return e}function uo(){return S.useContext(nn)}var ln=S.createContext(null);function id(){return S.useContext(ln)}var Ju={maplibre:()=>Promise.resolve().then(()=>(md(),pd)).then(e=>e.createMaplibreAdapter),mapbox:()=>Promise.resolve().then(()=>(hd(),fd)).then(e=>e.createMapboxAdapter),google:()=>Promise.resolve().then(()=>(yd(),vd)).then(e=>e.createGoogleAdapter)},Qu=500,dn=S.forwardRef(function(t,o){let{center:r,zoom:n,bounds:a,appearance:l="auto",interactive:p=true,hoveredId:i,onHoveredIdChange:c,onLoad:d,onError:m,className:g,style:u,children:b,...h}=t,f=h.provider??"maplibre",y=h.styleUrl,R=h.tilerKey,x=h.accessToken,k=h.apiKey,T=h.mapId,O=S.useRef(null),D=S.useRef(null),E=S.useRef(new globalThis.Map),$=S.useRef(null),[H,F]=S.useState(false),j=S.useRef(c),N=S.useRef(m),X=S.useRef(d);S.useEffect(()=>{j.current=c,N.current=m,X.current=d;});let Y=uo()?.isDark??false,v=l==="auto"?Y?"dark":"light":l;S.useEffect(()=>{let I=false,le=O.current;if(!le)return;let J=l==="auto"?Y?"dark":"light":l;return (async()=>{try{let he=await Ju[f]();if(I)return;let ne=await he(le,{center:r,zoom:n,bounds:a,appearance:J,interactive:p,styleUrl:y,tilerKey:R,accessToken:x,apiKey:k,mapId:T},{onLoad:()=>{},onError:be=>N.current?.(be),onMarkerHover:be=>j.current?.(be),onMarkerClick:()=>{}});if(I){ne.destroy();return}D.current=ne,F(!0),X.current?.(xd(D,E));}catch(he){if(I)return;he?.code||N.current?.({code:"provider-init-failed",message:he?.message??"Map init failed",cause:he});}})(),()=>{I=true,D.current?.destroy(),D.current=null,F(false),E.current.clear(),$.current=null;}},[f,y,x,k,T,R]),S.useEffect(()=>{D.current?.setAppearance(v);},[v]),S.useEffect(()=>{D.current?.setInteractive(p);},[p]),S.useEffect(()=>{D.current&&(a?D.current.setBounds(a[0],a[1]):(D.current.setCenter(r),D.current.setZoom(n)));},[r[0],r[1],n,a?.[0]?.[0],a?.[0]?.[1],a?.[1]?.[0],a?.[1]?.[1]]),S.useEffect(()=>{let I=$.current;I&&I!==i&&E.current.get(I)?.setHovered(false),i&&E.current.get(i)?.setHovered(true),$.current=i??null;},[i]),S.useImperativeHandle(o,()=>xd(D,E),[]);let W=S.useMemo(()=>({registerMarker:(I,le,J)=>{let he=D.current;if(!he)return null;let ne=he.addMarker(I,le,J);E.current.set(I,ne),process.env.NODE_ENV!=="production"&&E.current.size===Qu+1&&console.warn(`@gradeui/ui Map: rendering ${E.current.size} markers. DOM markers degrade past ~1k. Consider clustering via the .instance escape hatch.`);let be=ne.remove;return ne.remove=()=>{be(),E.current.delete(I),$.current===I&&($.current=null);},i===I&&ne.setHovered(true),ne}}),[H]);return S.createElement("div",{ref:O,"data-gds-part":"map",className:s("gds-map relative isolate overflow-hidden",g),style:{borderRadius:"var(--gds-map-radius, var(--radius, 0.5rem))",border:"var(--gds-map-border, 1px solid var(--border, transparent))",...u}},S.createElement(ln.Provider,{value:W},b))});dn.displayName="Map";function xd(e,t){let o=()=>{};return {flyTo:(r,n)=>{let a=e.current;if(!a)return;let l;if(typeof r=="string"){if(l=t.current.get(r)?.coords??null,!l){console.warn(`@gradeui/ui Map.flyTo: no marker registered with id "${r}".`);return}}else l=r;a.flyTo(l,n);},panTo:(r,n)=>e.current?.panTo(r,n)??o(),fitBounds:(r,n)=>e.current?.fitBounds(r,n)??o(),getCenter:()=>e.current?.getCenter()??[0,0],getZoom:()=>e.current?.getZoom()??0,getBounds:()=>e.current?.getBounds()??[[0,0],[0,0]],get instance(){return e.current?.instance??null}}}var cn=S.memo(function({id:t,at:o,anchor:r="bottom",className:n,children:a,onClick:l}){let p=id(),[i,c]=S.useState(null),d=S.useRef(null),m=S.useRef(l);return S.useEffect(()=>{m.current=l;}),S.useEffect(()=>{if(!p)return;let g=p.registerMarker(t,o,r);if(g){d.current=g,c(g.element);let u=b=>{m.current?.({id:t,coords:g.coords,native:b});};return g.element.addEventListener("click",u),()=>{g.element.removeEventListener("click",u),g.remove(),d.current=null,c(null);}}},[p,t]),S.useEffect(()=>{d.current?.setPosition(o);},[o[0],o[1]]),i?createPortal(S.createElement("div",{"data-gds-part":"map-marker-content",className:s("pointer-events-auto",n)},a),i):null});cn.displayName="MapMarker";var fg={video:"aspect-video",square:"aspect-square",portrait:"aspect-[3/4]",wide:"aspect-[21/9]",auto:""},hg={none:"0",sm:"var(--radius, 0.25rem)",md:"calc(var(--radius, 0.375rem) * 1.25)",lg:"calc(var(--radius, 0.5rem) * 1.5)",xl:"calc(var(--radius, 0.75rem) * 2)"},bg={album:Disc3,"tv-show":Tv,movie:Clapperboard,game:Gamepad2,book:Book,portrait:User,landscape:Mountain,poster:Film,product:Package,food:UtensilsCrossed,video:Video,audio:Music,embed:Code2,"3d":Box,generic:Image},vg={album:"square","tv-show":"portrait",movie:"portrait",game:"portrait",book:"portrait",portrait:"portrait",landscape:"wide",poster:"portrait",product:"square",food:"square",video:"video",audio:"video",embed:"video","3d":"square",generic:"video"};function yg(e){if(!e)return "";let t=/^(the|a|an|and|for|by|of|in|on|at|to)$/i,o=e.trim().split(/\s+/).filter(r=>r&&!t.test(r));return o.length===0?e.replace(/\s+/g,"").slice(0,2).toUpperCase():o.length===1?o[0].slice(0,2).toUpperCase():(o[0][0]+o[1][0]).toUpperCase()}function xg(e){return e<64?"sm":e>=160?"lg":"md"}var Tt=S.forwardRef(({className:e,aspect:t,radius:o="lg",border:r=false,loading:n=false,onVisibilityChange:a,fallback:l,emptyState:p="auto",hint:i="generic",alt:c,source:d,src:m,glyph:g,overlay:u,instanceId:b,style:h,children:f,...y},R)=>{let x=S.useRef(null);S.useImperativeHandle(R,()=>x.current);let k=i,T=t,O=o,D=r,E=n,$=c,H=m,F=p,j=T??vg[k];S.useEffect(()=>{if(!a||!x.current)return;let be=x.current,Be=new IntersectionObserver(([A])=>a(A.isIntersecting),{threshold:.05});return Be.observe(be),()=>Be.disconnect()},[a]);let N=!f&&F!=="none",[X,L]=S.useState("md");S.useEffect(()=>{if(!N)return;let be=x.current;if(!be)return;let Be=new ResizeObserver(([A])=>{let ce=A.contentRect.width;L(xg(ce));});return Be.observe(be),()=>Be.disconnect()},[N]);let Y=S.useMemo(()=>yg($),[$]),v=bg[k]??Image,W=F==="auto"||F==="icon",I=H,le=S.useMemo(()=>d?JSON.stringify(d):void 0,[d]),[J,he]=S.useState(false);S.useEffect(()=>{he(false);},[I]);let ne=J?void 0:I;return S.createElement("div",{ref:x,"data-gds-part":"media-surface","data-media-hint":k,"data-media-source-kind":d?.kind,"data-media-source":le,"data-media-alt":$,"data-gds-instance-id":b,className:s("gds-media-surface relative w-full overflow-hidden",fg[j],D&&"border border-border",e),style:{borderRadius:`var(--gds-media-radius, ${hg[O]})`,...h},...y},N&&S.createElement("div",{"data-gds-part":"media-surface-placeholder","data-tier":X,className:"absolute inset-0 z-0 flex flex-col items-center justify-center gap-2 pointer-events-none px-3 text-center",style:{background:"var(--gds-media-placeholder-bg)",color:"var(--gds-media-placeholder-fg)"},"aria-hidden":true},W?X==="sm"?Y?S.createElement("span",{className:"font-semibold text-sm tracking-tight"},Y):S.createElement(v,{className:"h-1/2 w-1/2 max-h-6 max-w-6"}):X==="md"?S.createElement(S.Fragment,null,g??S.createElement(v,{className:"h-1/3 w-1/3 max-h-10 max-w-10"})):S.createElement(S.Fragment,null,g??S.createElement(v,{className:"h-1/4 w-1/4 max-h-12 max-w-12"}),$&&S.createElement("span",{className:"text-xs leading-snug line-clamp-2 max-w-[80%]","data-gds-part":"media-surface-caption"},$)):F),(ne||f)&&S.createElement("div",{"data-gds-part":"media-surface-content",className:"absolute inset-0 z-[1]"},ne&&S.createElement("img",{src:ne,alt:$??"",onError:()=>he(true),className:"absolute inset-0 h-full w-full object-cover","data-gds-part":"media-surface-img"}),f),E&&S.createElement("div",{className:"absolute inset-0 z-[2] flex items-center justify-center bg-muted animate-pulse","aria-hidden":true},l),u&&S.createElement("div",{"data-gds-part":"media-surface-overlay",className:"absolute inset-0 z-10"},u))});Tt.displayName="MediaSurface";function go(){let[e,t]=S.useState(false);return S.useEffect(()=>{let o=window.matchMedia("(prefers-reduced-motion: reduce)");t(o.matches);let r=n=>t(n.matches);return o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[]),e}var Rd=S.forwardRef(({src:e,controls:t=true,autoPlay:o=false,loop:r=false,muted:n,pauseOffscreen:a=true,aspect:l="video",radius:p="lg",border:i=false,poster:c,label:d,className:m,style:g,playbackRate:u=1,objectFit:b="cover"},h)=>{let f=S.useRef(null),y=go(),[R,x]=S.useState(!!c);S.useImperativeHandle(h,()=>f.current);let k=n??o,T=o&&!y;S.useEffect(()=>{f.current&&(f.current.playbackRate=u);},[u]),S.useEffect(()=>{x(!!c);},[c]);let O=S.useCallback(D=>{!a||!f.current||(D&&T?f.current.play().catch(()=>{}):f.current.pause());},[a,T]);return S.createElement(Tt,{aspect:l,radius:p,border:i,"aria-label":d,className:m,style:g,onVisibilityChange:a?O:void 0},S.createElement("video",{ref:f,src:e,controls:t,autoPlay:T,loop:r,muted:k,playsInline:true,preload:T?"auto":"metadata",onPlaying:()=>x(false),className:s("w-full h-full",b==="cover"&&"object-cover",b==="contain"&&"object-contain",b==="fill"&&"object-fill")},"Your browser does not support the video tag."),c&&R&&S.createElement("img",{src:c,alt:"","aria-hidden":"true",loading:"lazy",decoding:"async","data-gds-part":"video-poster",className:s("absolute inset-0 w-full h-full pointer-events-none transition-opacity duration-200",b==="cover"&&"object-cover",b==="contain"&&"object-contain",b==="fill"&&"object-fill")}))});Rd.displayName="VideoPlayer";var Sd=S.forwardRef(({src:e,controls:t=false,autoPlay:o=true,loop:r=true,pauseOffscreen:n=true,aspect:a="square",radius:l="lg",border:p=false,poster:i,label:c,className:d,style:m,stateMachines:g,artboard:u,fit:b="contain",stateMachineInputs:h},f)=>{let y=go(),[R,x]=S.useState(null),[k,T]=S.useState(null);return S.useEffect(()=>{let O=false;return import('@rive-app/react-canvas').then(D=>{O||x(D);}).catch(()=>{O||T("Rive runtime not installed. Run `npm install @rive-app/react-canvas`.");}),()=>{O=true;}},[]),S.createElement(Tt,{ref:f,aspect:a,radius:l,border:p,"aria-label":c,className:d,style:m},k?S.createElement("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground p-4 text-center"},k):R&&e?S.createElement(Sg,{Mod:R,src:e,stateMachines:g,artboard:u,fit:b,stateMachineInputs:h,autoPlay:o&&!y,loop:r,pauseOffscreen:n,controls:t,poster:i}):i&&S.createElement("img",{src:i,alt:"",className:"w-full h-full object-contain"}))});Sd.displayName="RivePlayer";function Sg({Mod:e,src:t,stateMachines:o,artboard:r,fit:n,autoPlay:a,loop:l,pauseOffscreen:p,controls:i,poster:c}){let{useRive:d,Layout:m,Fit:g,Alignment:u,EventType:b}=e,h={contain:g.Contain,cover:g.Cover,fill:g.Fill,fitWidth:g.FitWidth,fitHeight:g.FitHeight,none:g.None},{rive:f,RiveComponent:y}=d({src:t,stateMachines:o,artboard:r,autoplay:a,layout:new m({fit:h[n],alignment:u.Center})}),[R,x]=S.useState(a);S.useEffect(()=>{if(!f||!l)return;let T=()=>{f.play();};return f.on(b.Stop,T),()=>{f.off(b.Stop,T);}},[f,l,b]),S.useEffect(()=>{if(!p||!f)return;let T=f.canvas;if(!T)return;let O=new IntersectionObserver(([D])=>{D.isIntersecting&&a?f.play():f.pause();},{threshold:.05});return O.observe(T),()=>O.disconnect()},[f,p,a]);let k=()=>{f&&(R?(f.pause(),x(false)):(f.play(),x(true)));};return S.createElement(S.Fragment,null,S.createElement(y,{className:"w-full h-full"}),!f&&c&&S.createElement("img",{src:c,alt:"",className:"absolute inset-0 w-full h-full object-contain pointer-events-none"}),i&&S.createElement("div",{className:s("absolute inset-0 flex items-end justify-end p-2","opacity-0 hover:opacity-100 transition-opacity","bg-gradient-to-t from-black/40 to-transparent")},S.createElement(We,{size:"icon",variant:"secondary",onClick:k},R?S.createElement(Pause,{className:"h-4 w-4"}):S.createElement(Play,{className:"h-4 w-4"}))))}var kd=({renderer:e,scene:t,camera:o,preset:r,width:n,height:a})=>{let l=new EffectComposer(e);l.setSize(n,a),l.addPass(new RenderPass(t,o));let p=new BloomEffect({intensity:0,luminanceThreshold:.6,radius:.6,kernelSize:KernelSize.MEDIUM}),i=new NoiseEffect({blendFunction:BlendFunction.OVERLAY});i.blendMode.opacity.value=0;let c=new ScanlineEffect({blendFunction:BlendFunction.OVERLAY,density:1.25});c.blendMode.opacity.value=0;let d=new VignetteEffect({darkness:0,offset:.5}),m=new ChromaticAberrationEffect({offset:new fe.Vector2(0,0),radialModulation:false,modulationOffset:.15}),g=new GlitchEffect({chromaticAberrationOffset:new fe.Vector2(0,0),columns:.05});g.minStrength=0,g.maxStrength=0,l.addPass(new EffectPass(o,p)),l.addPass(new EffectPass(o,i,c,d)),l.addPass(new EffectPass(o,m)),l.addPass(new EffectPass(o,g));function u(b){let h=b.effects;p.intensity=h.bloom?.intensity??0,p.luminanceMaterial&&h.bloom?.luminanceThreshold!==void 0&&(p.luminanceMaterial.threshold=h.bloom.luminanceThreshold),i.blendMode.opacity.value=h.noise?.intensity??0,c.density=h.scanlines?.density??1.25,c.blendMode.opacity.value=h.scanlines?.opacity??0,d.darkness=h.vignette?.darkness??0,d.offset=h.vignette?.offset??.5;let f=h.chromatic?.offset??0;m.offset?.set(f,f),h.glitch?(g.minStrength=h.glitch.strength?.[0]??0,g.maxStrength=h.glitch.strength?.[1]??0):(g.minStrength=0,g.maxStrength=0);}return u(r),{composer:l,setPreset:u,resize:(b,h)=>l.setSize(b,h),dispose:()=>{l.dispose();}}};var Lo=3e3,mn=400,Ag=80,Td=({width:e,height:t,palette:o})=>{let r=new fe.Scene;r.background=new fe.Color(o.background);let n=new fe.PerspectiveCamera(70,e/t,.1,mn*2);n.position.z=0;let a=new Float32Array(Lo*6),l=new Float32Array(Lo*6),p=new Float32Array(Lo),i=new fe.Color(o.primary),c=new fe.Color(o.accent);function d(f,y){let R=Math.random()*Math.PI*2,x=Ag*Math.pow(Math.random(),.6),k=Math.cos(R)*x,T=Math.sin(R)*x,O=y?-Math.random()*mn:-mn;p[f]=O,a[f*6+0]=k,a[f*6+1]=T,a[f*6+2]=O,a[f*6+3]=k,a[f*6+4]=T,a[f*6+5]=O-2,l[f*6+0]=i.r,l[f*6+1]=i.g,l[f*6+2]=i.b,l[f*6+3]=c.r,l[f*6+4]=c.g,l[f*6+5]=c.b;}for(let f=0;f<Lo;f++)d(f,true);let m=new fe.BufferGeometry;m.setAttribute("position",new fe.BufferAttribute(a,3)),m.setAttribute("color",new fe.BufferAttribute(l,3));let g=new fe.LineBasicMaterial({vertexColors:true,transparent:true,opacity:.95,blending:fe.AdditiveBlending}),u=new fe.LineSegments(m,g);r.add(u);let b=60,h=6;return {scene:r,camera:n,update:(f,y)=>{let R=m.attributes.position.array;for(let x=0;x<Lo;x++){let k=x*6;R[k+2]+=b*y,R[k+5]=R[k+2]-h,R[k+2]>5&&d(x,false);}m.attributes.position.needsUpdate=true;},resize:(f,y)=>{let R=n;R.aspect=f/y,R.updateProjectionMatrix();},setPalette:f=>{r.background=new fe.Color(f.background);let y=new fe.Color(f.primary),R=new fe.Color(f.accent),x=m.attributes.color.array;for(let k=0;k<Lo;k++)x[k*6+0]=y.r,x[k*6+1]=y.g,x[k*6+2]=y.b,x[k*6+3]=R.r,x[k*6+4]=R.g,x[k*6+5]=R.b;m.attributes.color.needsUpdate=true;},dispose:()=>{m.dispose(),g.dispose();}}};var Hg=`
345
+ `,Zn=C.createContext(null);function yf({children:e,defaultTheme:t=tr,defaultMode:o="light"}){let[r,n]=C.useState(t),[a,i]=C.useState(o),[p,s]=C.useState(0);C.useEffect(()=>{try{let f=localStorage.getItem(Yn);f&&Ho(f)&&n(f);let h=localStorage.getItem(Ba);if(h&&gc.includes(h))i(h);else if(typeof window<"u"){let v=window.matchMedia("(prefers-color-scheme: dark)").matches;i(v?"dark":"light");}}catch{}},[]),C.useEffect(()=>{let f=Ho(r)??Ho(tr);f&&(Ha(f,a),typeof document<"u"&&document.documentElement.classList.toggle("dark",uc.has(a)));},[r,a,p]),C.useEffect(()=>{if(typeof window>"u")return;let f=window.matchMedia("(prefers-color-scheme: dark)"),h=v=>{try{if(localStorage.getItem(Ba))return}catch{return}i(v.matches?"dark":"light");};return f.addEventListener("change",h),()=>f.removeEventListener("change",h)},[]);let c=C.useCallback(f=>{n(f);try{localStorage.setItem(Yn,f);}catch{}},[]),d=C.useCallback(f=>{i(f);try{localStorage.setItem(Ba,f);}catch{}},[]),m=C.useCallback(f=>{za(f),s(h=>h+1),c(f.id);},[c]),g=C.useCallback(f=>{f in Ft||(qn(f),s(h=>h+1),n(h=>h===f?tr:h));},[]),u=C.useCallback(()=>{s(f=>f+1);},[]),b=C.useMemo(()=>{let f=Ho(r)??Ho(tr);return {theme:f,themeId:f.id,mode:a,isDark:uc.has(a),setThemeId:c,setMode:d,themes:$n(),saveAndActivate:m,deleteTheme:g,refresh:u}},[r,a,p,c,d,m,g,u]);return C.createElement(Zn.Provider,{value:b},e)}function Xn(){let e=C.useContext(Zn);if(!e)throw new Error("useGradeTheme must be used inside <GradeThemeProvider>. Wrap your app (typically in app/layout.tsx).");return e}function Fo(){return C.useContext(Zn)}var Jn=C.createContext(null);function fc(){return C.useContext(Jn)}var Ef={maplibre:()=>Promise.resolve().then(()=>(wc(),xc)).then(e=>e.createMaplibreAdapter),mapbox:()=>Promise.resolve().then(()=>(Cc(),kc)).then(e=>e.createMapboxAdapter),google:()=>Promise.resolve().then(()=>(Nc(),Pc)).then(e=>e.createGoogleAdapter)},Lf=500,Qn=C.forwardRef(function(t,o){let{center:r,zoom:n,bounds:a,appearance:i="auto",interactive:p=true,hoveredId:s,onHoveredIdChange:c,onLoad:d,onError:m,className:g,style:u,children:b,...f}=t,h=f.provider??"maplibre",v=f.styleUrl,w=f.tilerKey,y=f.accessToken,S=f.apiKey,k=f.mapId,H=C.useRef(null),E=C.useRef(null),D=C.useRef(new globalThis.Map),U=C.useRef(null),[A,q]=C.useState(false),F=C.useRef(c),Y=C.useRef(m),J=C.useRef(d);C.useEffect(()=>{F.current=c,Y.current=m,J.current=d;});let pe=Fo()?.isDark??false,x=i==="auto"?pe?"dark":"light":i;C.useEffect(()=>{let P=false,te=H.current;if(!te)return;let se=i==="auto"?pe?"dark":"light":i;return (async()=>{try{let ne=await Ef[h]();if(P)return;let B=await ne(te,{center:r,zoom:n,bounds:a,appearance:se,interactive:p,styleUrl:v,tilerKey:w,accessToken:y,apiKey:S,mapId:k},{onLoad:()=>{},onError:Le=>Y.current?.(Le),onMarkerHover:Le=>F.current?.(Le),onMarkerClick:()=>{}});if(P){B.destroy();return}E.current=B,q(!0),J.current?.(Mc(E,D));}catch(ne){if(P)return;ne?.code||Y.current?.({code:"provider-init-failed",message:ne?.message??"Map init failed",cause:ne});}})(),()=>{P=true,E.current?.destroy(),E.current=null,q(false),D.current.clear(),U.current=null;}},[h,v,y,S,k,w]),C.useEffect(()=>{E.current?.setAppearance(x);},[x]),C.useEffect(()=>{E.current?.setInteractive(p);},[p]),C.useEffect(()=>{E.current&&(a?E.current.setBounds(a[0],a[1]):(E.current.setCenter(r),E.current.setZoom(n)));},[r[0],r[1],n,a?.[0]?.[0],a?.[0]?.[1],a?.[1]?.[0],a?.[1]?.[1]]),C.useEffect(()=>{let P=U.current;P&&P!==s&&D.current.get(P)?.setHovered(false),s&&D.current.get(s)?.setHovered(true),U.current=s??null;},[s]),C.useImperativeHandle(o,()=>Mc(E,D),[]);let I=C.useMemo(()=>({registerMarker:(P,te,se)=>{let ne=E.current;if(!ne)return null;let B=ne.addMarker(P,te,se);D.current.set(P,B),process.env.NODE_ENV!=="production"&&D.current.size===Lf+1&&console.warn(`@gradeui/ui Map: rendering ${D.current.size} markers. DOM markers degrade past ~1k. Consider clustering via the .instance escape hatch.`);let Le=B.remove;return B.remove=()=>{Le(),D.current.delete(P),U.current===P&&(U.current=null);},s===P&&B.setHovered(true),B}}),[A]);return C.createElement("div",{ref:H,"data-gds-part":"map",className:l("gds-map relative isolate overflow-hidden",g),style:{borderRadius:"var(--gds-map-radius, var(--radius, 0.5rem))",border:"var(--gds-map-border, 1px solid var(--border, transparent))",...u}},C.createElement(Jn.Provider,{value:I},b))});Qn.displayName="Map";function Mc(e,t){let o=()=>{};return {flyTo:(r,n)=>{let a=e.current;if(!a)return;let i;if(typeof r=="string"){if(i=t.current.get(r)?.coords??null,!i){console.warn(`@gradeui/ui Map.flyTo: no marker registered with id "${r}".`);return}}else i=r;a.flyTo(i,n);},panTo:(r,n)=>e.current?.panTo(r,n)??o(),fitBounds:(r,n)=>e.current?.fitBounds(r,n)??o(),getCenter:()=>e.current?.getCenter()??[0,0],getZoom:()=>e.current?.getZoom()??0,getBounds:()=>e.current?.getBounds()??[[0,0],[0,0]],get instance(){return e.current?.instance??null}}}var ei=C.memo(function({id:t,at:o,anchor:r="bottom",className:n,children:a,onClick:i}){let p=fc(),[s,c]=C.useState(null),d=C.useRef(null),m=C.useRef(i);return C.useEffect(()=>{m.current=i;}),C.useEffect(()=>{if(!p)return;let g=p.registerMarker(t,o,r);if(g){d.current=g,c(g.element);let u=b=>{m.current?.({id:t,coords:g.coords,native:b});};return g.element.addEventListener("click",u),()=>{g.element.removeEventListener("click",u),g.remove(),d.current=null,c(null);}}},[p,t]),C.useEffect(()=>{d.current?.setPosition(o);},[o[0],o[1]]),s?createPortal(C.createElement("div",{"data-gds-part":"map-marker-content",className:l("pointer-events-auto",n)},a),s):null});ei.displayName="MapMarker";var Kf={video:"aspect-video",standard:"aspect-[4/3]",square:"aspect-square",portrait:"aspect-[3/4]",wide:"aspect-[21/9]",auto:""},qf={none:"0",sm:"var(--radius, 0.25rem)",md:"calc(var(--radius, 0.375rem) * 1.25)",lg:"calc(var(--radius, 0.5rem) * 1.5)",xl:"calc(var(--radius, 0.75rem) * 2)"},Yf={album:Disc3,"tv-show":Tv,movie:Clapperboard,game:Gamepad2,book:Book,portrait:User,landscape:Mountain,poster:Film,product:Package,food:UtensilsCrossed,video:Video,audio:Music,embed:Code2,"3d":Box,generic:Image},Zf={album:"square","tv-show":"portrait",movie:"portrait",game:"portrait",book:"portrait",portrait:"portrait",landscape:"wide",poster:"portrait",product:"square",food:"square",video:"video",audio:"video",embed:"video","3d":"square",generic:"video"};function Xf(e){if(!e)return null;switch(e.kind){case "album":return `album:${e.artist}|${e.title}|${e.year??""}`;case "tv-show":return `tv-show:${e.title}|${e.year??""}`;case "movie":return `movie:${e.title}|${e.year??""}`;case "game":return `game:${e.title}`;case "book":return `book:${e.isbn??""}|${e.title??""}|${e.author??""}`;case "poster":return `poster:${e.title}|${e.year??""}`;case "portrait":return `portrait:${e.name??""}|${e.role??""}`;case "landscape":return `landscape:${e.location??""}|${e.mood??""}`;case "product":return `product:${e.brand??""}|${e.name??""}`;case "food":return `food:${e.dish??""}|${e.cuisine??""}`;case "generic":return `generic:${e.prompt}`;default:return `${e.kind}:`}}function Jf(e){let t=Xf(e),[o,r]=C.useState(0);return C.useEffect(()=>{if(typeof window>"u")return;let n=()=>r(a=>a+1);return window.addEventListener("grade:media-pending-updated",n),()=>window.removeEventListener("grade:media-pending-updated",n)},[]),C.useEffect(()=>{},[o]),!t||typeof window>"u"?false:!!window.__gradeMediaPending?.[t]}function Qf(e){if(!e)return "";let t=/^(the|a|an|and|for|by|of|in|on|at|to)$/i,o=e.trim().split(/\s+/).filter(r=>r&&!t.test(r));return o.length===0?e.replace(/\s+/g,"").slice(0,2).toUpperCase():o.length===1?o[0].slice(0,2).toUpperCase():(o[0][0]+o[1][0]).toUpperCase()}function eh(e){return e<64?"sm":e>=160?"lg":"md"}var zt=C.forwardRef(({className:e,aspect:t,radius:o="lg",border:r=false,loading:n=false,onVisibilityChange:a,fallback:i,emptyState:p="auto",hint:s="generic",alt:c,source:d,src:m,glyph:g,overlay:u,instanceId:b,style:f,children:h,...v},w)=>{let y=C.useRef(null);C.useImperativeHandle(w,()=>y.current);let S=s,k=t,H=o,E=r,D=n,U=c,A=m,q=p,F=k??Zf[S];C.useEffect(()=>{if(!a||!y.current)return;let me=y.current,L=new IntersectionObserver(([de])=>a(de.isIntersecting),{threshold:.05});return L.observe(me),()=>L.disconnect()},[a]);let Y=!h&&q!=="none",[J,z]=C.useState("md");C.useEffect(()=>{if(!Y)return;let me=y.current;if(!me)return;let L=new ResizeObserver(([de])=>{let Z=de.contentRect.width;z(eh(Z));});return L.observe(me),()=>L.disconnect()},[Y]);let pe=C.useMemo(()=>Qf(U),[U]),x=Yf[S]??Image,I=q==="auto"||q==="icon",P=A,te=C.useMemo(()=>d?JSON.stringify(d):void 0,[d]),[se,ne]=C.useState(false);C.useEffect(()=>{ne(false);},[P]);let B=se?void 0:P,Le=Jf(d)&&!B;return C.createElement("div",{ref:y,"data-gds-part":"media-surface","data-media-hint":S,"data-media-source-kind":d?.kind,"data-media-source":te,"data-media-alt":U,"data-gds-instance-id":b,className:l("gds-media-surface relative w-full overflow-hidden",Kf[F],E&&"border border-border",e),style:{borderRadius:`var(--gds-media-radius, ${qf[H]})`,...f},...v},Y&&C.createElement("div",{"data-gds-part":"media-surface-placeholder","data-tier":J,"data-fill-pending":Le||void 0,className:l("absolute inset-0 z-0 flex flex-col items-center justify-center gap-2 pointer-events-none px-3 text-center",Le&&"gds-aura-shimmer"),style:{position:"absolute",background:"var(--gds-media-placeholder-bg)",color:"var(--gds-media-placeholder-fg)",...Le?{"--aura-shimmer-duration":"1400ms","--aura-shimmer-delay-between":"400ms"}:null},"aria-hidden":true},I?J==="sm"?pe?C.createElement("span",{className:"font-semibold text-sm tracking-tight"},pe):C.createElement(x,{className:"h-1/2 w-1/2 max-h-6 max-w-6"}):J==="md"?C.createElement(C.Fragment,null,g??C.createElement(x,{className:"h-1/3 w-1/3 max-h-10 max-w-10"})):C.createElement(C.Fragment,null,g??C.createElement(x,{className:"h-1/4 w-1/4 max-h-12 max-w-12"}),U&&C.createElement("span",{className:"text-xs leading-snug line-clamp-2 max-w-[80%]","data-gds-part":"media-surface-caption"},U)):q),(B||h)&&C.createElement("div",{"data-gds-part":"media-surface-content",className:"absolute inset-0 z-[1]"},B&&C.createElement("img",{src:B,alt:U??"",onError:()=>ne(true),className:"absolute inset-0 h-full w-full object-cover","data-gds-part":"media-surface-img"}),h),D&&C.createElement("div",{className:"absolute inset-0 z-[2] flex items-center justify-center bg-muted animate-pulse","aria-hidden":true},i),u&&C.createElement("div",{"data-gds-part":"media-surface-overlay",className:"absolute inset-0 z-10"},u))});zt.displayName="MediaSurface";var Lc=C.forwardRef(({src:e,controls:t=true,autoPlay:o=false,loop:r=false,muted:n,pauseOffscreen:a=true,aspect:i="video",radius:p="lg",border:s=false,poster:c,label:d,className:m,style:g,playbackRate:u=1,objectFit:b="cover"},f)=>{let h=C.useRef(null),v=ao(),[w,y]=C.useState(!!c);C.useImperativeHandle(f,()=>h.current);let S=n??o,k=o&&!v;C.useEffect(()=>{h.current&&(h.current.playbackRate=u);},[u]),C.useEffect(()=>{y(!!c);},[c]);let H=C.useCallback(E=>{!a||!h.current||(E&&k?h.current.play().catch(()=>{}):h.current.pause());},[a,k]);return C.createElement(zt,{aspect:i,radius:p,border:s,"aria-label":d,className:m,style:g,onVisibilityChange:a?H:void 0},C.createElement("video",{ref:h,src:e,controls:t,autoPlay:k,loop:r,muted:S,playsInline:true,preload:k?"auto":"metadata",onPlaying:()=>y(false),className:l("w-full h-full",b==="cover"&&"object-cover",b==="contain"&&"object-contain",b==="fill"&&"object-fill")},"Your browser does not support the video tag."),c&&w&&C.createElement("img",{src:c,alt:"","aria-hidden":"true",loading:"lazy",decoding:"async","data-gds-part":"video-poster",className:l("absolute inset-0 w-full h-full pointer-events-none transition-opacity duration-200",b==="cover"&&"object-cover",b==="contain"&&"object-contain",b==="fill"&&"object-fill")}))});Lc.displayName="VideoPlayer";var Dc=C.forwardRef(({src:e,controls:t=false,autoPlay:o=true,loop:r=true,pauseOffscreen:n=true,aspect:a="square",radius:i="lg",border:p=false,poster:s,label:c,className:d,style:m,stateMachines:g,artboard:u,fit:b="contain",stateMachineInputs:f},h)=>{let v=ao(),[w,y]=C.useState(null),[S,k]=C.useState(null);return C.useEffect(()=>{let H=false;return import('@rive-app/react-canvas').then(E=>{H||y(E);}).catch(()=>{H||k("Rive runtime not installed. Run `npm install @rive-app/react-canvas`.");}),()=>{H=true;}},[]),C.createElement(zt,{ref:h,aspect:a,radius:i,border:p,"aria-label":c,className:d,style:m},S?C.createElement("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground p-4 text-center"},S):w&&e?C.createElement(rh,{Mod:w,src:e,stateMachines:g,artboard:u,fit:b,stateMachineInputs:f,autoPlay:o&&!v,loop:r,pauseOffscreen:n,controls:t,poster:s}):s&&C.createElement("img",{src:s,alt:"",className:"w-full h-full object-contain"}))});Dc.displayName="RivePlayer";function rh({Mod:e,src:t,stateMachines:o,artboard:r,fit:n,autoPlay:a,loop:i,pauseOffscreen:p,controls:s,poster:c}){let{useRive:d,Layout:m,Fit:g,Alignment:u,EventType:b}=e,f={contain:g.Contain,cover:g.Cover,fill:g.Fill,fitWidth:g.FitWidth,fitHeight:g.FitHeight,none:g.None},{rive:h,RiveComponent:v}=d({src:t,stateMachines:o,artboard:r,autoplay:a,layout:new m({fit:f[n],alignment:u.Center})}),[w,y]=C.useState(a);C.useEffect(()=>{if(!h||!i)return;let k=()=>{h.play();};return h.on(b.Stop,k),()=>{h.off(b.Stop,k);}},[h,i,b]),C.useEffect(()=>{if(!p||!h)return;let k=h.canvas;if(!k)return;let H=new IntersectionObserver(([E])=>{E.isIntersecting&&a?h.play():h.pause();},{threshold:.05});return H.observe(k),()=>H.disconnect()},[h,p,a]);let S=()=>{h&&(w?(h.pause(),y(false)):(h.play(),y(true)));};return C.createElement(C.Fragment,null,C.createElement(v,{className:"w-full h-full"}),!h&&c&&C.createElement("img",{src:c,alt:"",className:"absolute inset-0 w-full h-full object-contain pointer-events-none"}),s&&C.createElement("div",{className:l("absolute inset-0 flex items-end justify-end p-2","opacity-0 hover:opacity-100 transition-opacity","bg-gradient-to-t from-black/40 to-transparent")},C.createElement(Xe,{size:"icon",variant:"secondary",onClick:S},w?C.createElement(Pause,{className:"h-4 w-4"}):C.createElement(Play,{className:"h-4 w-4"}))))}var ah={sm:20,md:28,lg:40,xl:56},nh={horizontal:["horizontal","square","icon"],square:["square","icon","horizontal"],icon:["icon","square","horizontal"]};function ih(e,t,o,r){for(let n of nh[t]){let a=e[n];if(!a)continue;let i=o==="dark"?a.dark??a.light:a.light??a.dark,p=r?a.mono??i:i??a.mono;if(p!=null)return p}return null}var sh=C.forwardRef(function({sources:t={},lockup:o="horizontal",mode:r="light",mono:n=false,size:a="md",label:i,decorative:p=false,href:s,className:c,style:d,...m},g){let u=typeof a=="number"?a:ah[a],b=ih(t,o,r,n),f=p?{"aria-hidden":true}:i?s?{}:{role:"img","aria-label":i}:{},h=b??C.createElement(lh,{label:i,mono:n}),v=C.createElement("span",{className:l("gds-logo inline-flex shrink-0 select-none items-center","[&_img]:h-full [&_img]:w-auto [&_svg]:h-full [&_svg]:w-auto",c),style:{height:u,...d},"data-gds-part":"logo","data-gds-lockup":o,"data-gds-mode":r,...s?{}:f,...s?{}:m},h);return s?C.createElement("a",{ref:g,href:s,"aria-label":p?void 0:i,className:"inline-flex",...p?{"aria-hidden":true}:{},...m},v):C.cloneElement(v,{ref:g})});function lh({label:e,mono:t}){return C.createElement("span",{className:l("inline-flex h-full items-center gap-1.5 rounded-md border border-dashed px-2 text-xs font-medium",t?"border-current/40 text-current":"border-border bg-muted text-muted-foreground")},C.createElement("span",{"aria-hidden":true,className:"inline-block h-3.5 w-3.5 rounded-[3px] bg-current opacity-60"}),e??"Logo")}var ti=1150,oi=1500,ch="translate(101%, 95%) scale(0.18)",ph="translate(122%, 36%) scale(0.2)",mh="var(--gds-canvas-fill, radial-gradient(circle at 50% 38%, #1b1b22, #0b0b0e))",uh="cubic-bezier(0.34, 1.16, 0.64, 1)",gh="cubic-bezier(0.65, 0, 0.35, 1)";function ri(e,t){let o=e.zoom??1,r=e.cx??.5,n=e.cy??.5;return {transform:`translate(${(.5-r*o)*100}%, ${(.5-n*o)*100}%) scale(${o})`,zoom:o,label:e.label??null,opacity:1,hold:e.hold??2400,trans:t}}var Ac={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:999,border:"none",background:"transparent",color:"#fff",cursor:"pointer"};function fh(){return C.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":true},C.createElement("path",{d:"M8 5v14l11-7z"}))}function hh(){return C.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":true},C.createElement("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1"}),C.createElement("rect",{x:"14",y:"5",width:"4",height:"14",rx:"1"}))}function Ic(){return C.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":true},C.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),C.createElement("path",{d:"M3 3v5h5"}))}function bh({shots:e,autoplay:t=true,loop:o=true,maxLoops:r=1/0,controls:n=true,spotlight:a=false,cursor:i=true,enter:p=true,captionPosition:s="bottom",stage:c=mh,backdrop:d,className:m,style:g,children:u}){let b=Zo(),f=C.useRef(null),h=kr(),v=useInView(f,{amount:.25}),w=h&&v,y=C.useMemo(()=>{let I=e&&e.length>0?e:[{zoom:1}],P=[];p&&P.push({transform:ch,zoom:.18,label:null,opacity:0,hold:360,trans:0}),P.push(ri(I[0],p?oi:0));for(let te=1;te<I.length;te++)P.push(ri(I[te],ti));return o&&(P.push(ri(I[0],oi)),P.push({transform:ph,zoom:.2,label:null,opacity:0,hold:520,trans:oi})),P},[e,p,o]),S=p&&y.length>1?1:0,[k,H]=C.useState(t?0:S),[E,D]=C.useState(t),[U,A]=C.useState(false),q=C.useRef(0),F=C.useCallback(()=>{q.current=0,A(false),H(0),D(true);},[]);C.useEffect(()=>{if(b||!E||!w||y.length<=1)return;let I=setTimeout(()=>{H(P=>{let te=P+1;return te>=y.length?o&&q.current+1<r?(q.current+=1,0):(D(false),A(true),S):te});},y[k].hold);return ()=>clearTimeout(I)},[k,E,w,b,y,o,r,S]);let Y=b?S:Math.min(k,y.length-1),J=y[Y]??y[0],z=J.opacity===1&&J.zoom>1.05,pe=b?0:J.trans,x=J.zoom<=1.05?uh:gh;return C.createElement("div",{ref:f,className:l("gds-screen-animator",m),"data-gds-part":"screen-animator",style:{position:"absolute",inset:0,overflow:"hidden",background:c,...g}},C.createElement("style",null,`
346
+ @keyframes gdsSaPing { from { transform: scale(0.4); opacity: 0.9 } to { transform: scale(1.8); opacity: 0 } }
347
+ @keyframes gdsSaPulse { 0%,100% { opacity: 1 } 50% { opacity: 0.5 } }
348
+ `),d&&C.createElement("div",{"aria-hidden":true,style:{position:"absolute",inset:0,pointerEvents:"none"}},d),C.createElement("div",{style:{position:"absolute",inset:0,transform:J.transform,transformOrigin:"0 0",opacity:J.opacity,transition:`transform ${pe}ms ${x}, opacity 700ms ease`}},u),a&&C.createElement("div",{"aria-hidden":true,style:{position:"absolute",inset:0,pointerEvents:"none",background:"radial-gradient(circle at 50% 50%, transparent 26%, rgba(0,0,0,0.46) 80%)",opacity:z?1:0,transition:`opacity ${ti}ms ease`}}),i&&C.createElement("div",{key:Y,"aria-hidden":true,style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",opacity:z?1:0,transition:`opacity ${ti}ms ease`}},C.createElement("span",{style:{position:"absolute",left:-19,top:-19,width:38,height:38,borderRadius:999,border:"2px solid rgba(59,130,246,0.75)",animation:"gdsSaPing 1100ms ease-out 0.4s 1"}}),C.createElement("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none"},C.createElement("path",{d:"M5 3l14 7-6 1.5L10 18 5 3z",fill:"#fff",stroke:"#111",strokeWidth:"1.5",strokeLinejoin:"round"}))),C.createElement("div",{role:"status","aria-live":"polite","aria-atomic":"true",style:{position:"absolute",left:"50%",[s==="top"?"top":"bottom"]:22,transform:"translateX(-50%)",pointerEvents:"none"}},J.label&&C.createElement("span",{style:{display:"inline-flex",alignItems:"center",gap:9,padding:"8px 14px",borderRadius:999,background:"rgba(15,15,17,0.62)",color:"#fff",fontSize:13.5,fontWeight:600,backdropFilter:"blur(10px)",boxShadow:"0 6px 22px rgba(0,0,0,0.25)"}},C.createElement("span",{"aria-hidden":true,style:{width:7,height:7,borderRadius:999,background:"#34d399",animation:"gdsSaPulse 1600ms ease-in-out infinite"}}),J.label)),n&&y.length>1&&!b&&C.createElement("div",{role:"group","aria-label":"Demo playback controls",style:{position:"absolute",right:16,bottom:16,display:"flex",gap:4,alignItems:"center",padding:"4px 6px",borderRadius:999,background:"rgba(15,15,17,0.55)",backdropFilter:"blur(10px)",boxShadow:"0 6px 22px rgba(0,0,0,0.25)"}},C.createElement("button",{type:"button",onClick:()=>U?F():D(I=>!I),"aria-label":U?"Replay":E?"Pause":"Play",style:Ac},U?C.createElement(Ic,null):E?C.createElement(hh,null):C.createElement(fh,null)),C.createElement("button",{type:"button",onClick:F,"aria-label":"Restart",style:Ac},C.createElement(Ic,null))),U&&!b&&C.createElement("button",{type:"button",onClick:F,"aria-label":"Replay",style:{position:"absolute",inset:0,margin:"auto",width:64,height:64,display:"grid",placeItems:"center",borderRadius:999,border:"none",color:"#fff",background:"rgba(15,15,17,0.55)",backdropFilter:"blur(10px)",boxShadow:"0 8px 30px rgba(0,0,0,0.35)",cursor:"pointer"}},C.createElement("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":true},C.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),C.createElement("path",{d:"M3 3v5h5"}))))}var Fc=({renderer:e,scene:t,camera:o,preset:r,width:n,height:a})=>{let i=new EffectComposer(e);i.setSize(n,a),i.addPass(new RenderPass(t,o));let p=new BloomEffect({intensity:0,luminanceThreshold:.6,radius:.6,kernelSize:KernelSize.MEDIUM}),s=new NoiseEffect({blendFunction:BlendFunction.OVERLAY});s.blendMode.opacity.value=0;let c=new ScanlineEffect({blendFunction:BlendFunction.OVERLAY,density:1.25});c.blendMode.opacity.value=0;let d=new VignetteEffect({darkness:0,offset:.5}),m=new ChromaticAberrationEffect({offset:new Re.Vector2(0,0),radialModulation:false,modulationOffset:.15}),g=new GlitchEffect({chromaticAberrationOffset:new Re.Vector2(0,0),columns:.05});g.minStrength=0,g.maxStrength=0,g.mode=GlitchMode.DISABLED,g.blendMode.opacity.value=0,i.addPass(new EffectPass(o,p)),i.addPass(new EffectPass(o,s,c,d)),i.addPass(new EffectPass(o,m)),i.addPass(new EffectPass(o,g));function u(b){let f=b.effects;p.intensity=f.bloom?.intensity??0,p.luminanceMaterial&&f.bloom?.luminanceThreshold!==void 0&&(p.luminanceMaterial.threshold=f.bloom.luminanceThreshold),s.blendMode.opacity.value=f.noise?.intensity??0,c.density=f.scanlines?.density??1.25,c.blendMode.opacity.value=f.scanlines?.opacity??0,d.darkness=f.vignette?.darkness??0,d.offset=f.vignette?.offset??.5;let h=f.chromatic?.offset??0;m.offset?.set(h,h);let v=f.glitch?.strength?.[1]??0;f.glitch&&v>0?(g.mode=GlitchMode.SPORADIC,g.blendMode.opacity.value=1,g.minStrength=f.glitch.strength?.[0]??0,g.maxStrength=v):(g.mode=GlitchMode.DISABLED,g.blendMode.opacity.value=0,g.minStrength=0,g.maxStrength=0);}return u(r),{composer:i,setPreset:u,resize:(b,f)=>i.setSize(b,f),dispose:()=>{i.dispose();}}};var or=3e3,ii=400,Ph=80,zc=({width:e,height:t,palette:o})=>{let r=new Re.Scene;r.background=new Re.Color(o.background);let n=new Re.PerspectiveCamera(70,e/t,.1,ii*2);n.position.z=0;let a=new Float32Array(or*6),i=new Float32Array(or*6),p=new Float32Array(or),s=new Re.Color(o.primary),c=new Re.Color(o.accent);function d(h,v){let w=Math.random()*Math.PI*2,y=Ph*Math.pow(Math.random(),.6),S=Math.cos(w)*y,k=Math.sin(w)*y,H=v?-Math.random()*ii:-ii;p[h]=H,a[h*6+0]=S,a[h*6+1]=k,a[h*6+2]=H,a[h*6+3]=S,a[h*6+4]=k,a[h*6+5]=H-2,i[h*6+0]=s.r,i[h*6+1]=s.g,i[h*6+2]=s.b,i[h*6+3]=c.r,i[h*6+4]=c.g,i[h*6+5]=c.b;}for(let h=0;h<or;h++)d(h,true);let m=new Re.BufferGeometry;m.setAttribute("position",new Re.BufferAttribute(a,3)),m.setAttribute("color",new Re.BufferAttribute(i,3));let g=new Re.LineBasicMaterial({vertexColors:true,transparent:true,opacity:.95,blending:Re.AdditiveBlending}),u=new Re.LineSegments(m,g);r.add(u);let b=60,f=6;return {scene:r,camera:n,update:(h,v)=>{let w=m.attributes.position.array;for(let y=0;y<or;y++){let S=y*6;w[S+2]+=b*v,w[S+5]=w[S+2]-f,w[S+2]>5&&d(y,false);}m.attributes.position.needsUpdate=true;},resize:(h,v)=>{let w=n;w.aspect=h/v,w.updateProjectionMatrix();},setPalette:h=>{r.background=new Re.Color(h.background);let v=new Re.Color(h.primary),w=new Re.Color(h.accent),y=m.attributes.color.array;for(let S=0;S<or;S++)y[S*6+0]=v.r,y[S*6+1]=v.g,y[S*6+2]=v.b,y[S*6+3]=w.r,y[S*6+4]=w.g,y[S*6+5]=w.b;m.attributes.color.needsUpdate=true;},dispose:()=>{m.dispose(),g.dispose();}}};var Nh=`
346
349
  precision highp float;
347
350
  varying vec2 vUv;
348
351
  uniform float uTime;
@@ -380,19 +383,19 @@ applyThemeToRoot(theme, "light"); // or "dark" / "superLight" / "superDark"
380
383
 
381
384
  gl_FragColor = vec4(col, 1.0);
382
385
  }
383
- `,Ig=`
386
+ `,Mh=`
384
387
  varying vec2 vUv;
385
388
  void main() {
386
389
  vUv = uv;
387
390
  gl_Position = vec4(position.xy, 0.0, 1.0);
388
391
  }
389
- `,Pd=({width:e,height:t,palette:o})=>{let r=new fe.Scene,n=new fe.OrthographicCamera(-1,1,1,-1,0,1),a={uTime:{value:0},uResolution:{value:new fe.Vector2(e,t)},uBackground:{value:new fe.Color(o.background)},uPrimary:{value:new fe.Color(o.primary)},uSecondary:{value:new fe.Color(o.secondary)},uAccent:{value:new fe.Color(o.accent)}},l=new fe.ShaderMaterial({uniforms:a,vertexShader:Ig,fragmentShader:Hg,depthTest:false,depthWrite:false}),p=new fe.PlaneGeometry(2,2),i=new fe.Mesh(p,l);return r.add(i),{scene:r,camera:n,update:d=>{a.uTime.value=d;},resize:(d,m)=>{a.uResolution.value.set(d,m);},setPalette:d=>{a.uBackground.value.set(d.background),a.uPrimary.value.set(d.primary),a.uSecondary.value.set(d.secondary),a.uAccent.value.set(d.accent);},dispose:()=>{p.dispose(),l.dispose();}}};var Fg=`
392
+ `,Bc=({width:e,height:t,palette:o})=>{let r=new Re.Scene,n=new Re.OrthographicCamera(-1,1,1,-1,0,1),a={uTime:{value:0},uResolution:{value:new Re.Vector2(e,t)},uBackground:{value:new Re.Color(o.background)},uPrimary:{value:new Re.Color(o.primary)},uSecondary:{value:new Re.Color(o.secondary)},uAccent:{value:new Re.Color(o.accent)}},i=new Re.ShaderMaterial({uniforms:a,vertexShader:Mh,fragmentShader:Nh,depthTest:false,depthWrite:false}),p=new Re.PlaneGeometry(2,2),s=new Re.Mesh(p,i);return r.add(s),{scene:r,camera:n,update:d=>{a.uTime.value=d;},resize:(d,m)=>{a.uResolution.value.set(d,m);},setPalette:d=>{a.uBackground.value.set(d.background),a.uPrimary.value.set(d.primary),a.uSecondary.value.set(d.secondary),a.uAccent.value.set(d.accent);},dispose:()=>{p.dispose(),i.dispose();}}};var Eh=`
390
393
  varying vec2 vUv;
391
394
  void main() {
392
395
  vUv = uv;
393
396
  gl_Position = vec4(position.xy, 0.0, 1.0);
394
397
  }
395
- `,Bg=`
398
+ `,Lh=`
396
399
  precision highp float;
397
400
  varying vec2 vUv;
398
401
  uniform float uTime;
@@ -449,13 +452,13 @@ applyThemeToRoot(theme, "light"); // or "dark" / "superLight" / "superDark"
449
452
 
450
453
  gl_FragColor = vec4(col, 1.0);
451
454
  }
452
- `,Md=({width:e,height:t,palette:o})=>{let r=new fe.Scene,n=new fe.OrthographicCamera(-1,1,1,-1,0,1),a={uTime:{value:0},uResolution:{value:new fe.Vector2(e,t)},uBackground:{value:new fe.Color(o.background)},uPrimary:{value:new fe.Color(o.primary)},uSecondary:{value:new fe.Color(o.secondary)},uAccent:{value:new fe.Color(o.accent)}},l=new fe.ShaderMaterial({uniforms:a,vertexShader:Fg,fragmentShader:Bg,depthTest:false,depthWrite:false}),p=new fe.PlaneGeometry(2,2),i=new fe.Mesh(p,l);return r.add(i),{scene:r,camera:n,update:d=>{a.uTime.value=d;},resize:(d,m)=>{a.uResolution.value.set(d,m);},setPalette:d=>{a.uBackground.value.set(d.background),a.uPrimary.value.set(d.primary),a.uSecondary.value.set(d.secondary),a.uAccent.value.set(d.accent);},dispose:()=>{p.dispose(),l.dispose();}}};var zg=`
455
+ `,_c=({width:e,height:t,palette:o})=>{let r=new Re.Scene,n=new Re.OrthographicCamera(-1,1,1,-1,0,1),a={uTime:{value:0},uResolution:{value:new Re.Vector2(e,t)},uBackground:{value:new Re.Color(o.background)},uPrimary:{value:new Re.Color(o.primary)},uSecondary:{value:new Re.Color(o.secondary)},uAccent:{value:new Re.Color(o.accent)}},i=new Re.ShaderMaterial({uniforms:a,vertexShader:Eh,fragmentShader:Lh,depthTest:false,depthWrite:false}),p=new Re.PlaneGeometry(2,2),s=new Re.Mesh(p,i);return r.add(s),{scene:r,camera:n,update:d=>{a.uTime.value=d;},resize:(d,m)=>{a.uResolution.value.set(d,m);},setPalette:d=>{a.uBackground.value.set(d.background),a.uPrimary.value.set(d.primary),a.uSecondary.value.set(d.secondary),a.uAccent.value.set(d.accent);},dispose:()=>{p.dispose(),i.dispose();}}};var Dh=`
453
456
  varying vec2 vUv;
454
457
  void main() {
455
458
  vUv = uv;
456
459
  gl_Position = vec4(position.xy, 0.0, 1.0);
457
460
  }
458
- `,Og=`
461
+ `,Ah=`
459
462
  precision highp float;
460
463
  varying vec2 vUv;
461
464
  uniform float uTime;
@@ -525,7 +528,7 @@ applyThemeToRoot(theme, "light"); // or "dark" / "superLight" / "superDark"
525
528
 
526
529
  gl_FragColor = vec4(col, 1.0);
527
530
  }
528
- `,Nd=({palette:e})=>{let t=new fe.Scene,o=new fe.OrthographicCamera(-1,1,1,-1,0,1),r={uTime:{value:0},uBackground:{value:new fe.Color(e.background)},uPrimary:{value:new fe.Color(e.primary)},uSecondary:{value:new fe.Color(e.secondary)},uAccent:{value:new fe.Color(e.accent)}},n=new fe.ShaderMaterial({uniforms:r,vertexShader:zg,fragmentShader:Og,depthTest:false,depthWrite:false}),a=new fe.PlaneGeometry(2,2),l=new fe.Mesh(a,n);return t.add(l),{scene:t,camera:o,update:i=>{r.uTime.value=i;},setPalette:i=>{r.uBackground.value.set(i.background),r.uPrimary.value.set(i.primary),r.uSecondary.value.set(i.secondary),r.uAccent.value.set(i.accent);},dispose:()=>{a.dispose(),n.dispose();}}};var mr={space:Td,plasma:Pd,voronoi:Md,synthwave:Nd},ur=[{id:"space",label:"Hyperspace",description:"Classic 'jump to hyperspace' \u2014 streaking stars flying past camera. Pairs well with VHS or Cinematic post-FX.",tags:["space","retro","motion","hero","background"],scene:"space",defaultPostPreset:"vhs"},{id:"plasma",label:"Plasma",description:"Soft rolling colour clouds \u2014 overlapping sines warping a palette ramp. Classic demoscene vibe. Pairs well with Synthwave or Cinematic.",tags:["abstract","soft","ambient","hero","background","gradient"],scene:"plasma",defaultPostPreset:"synthwave"},{id:"voronoi",label:"Voronoi",description:"Jittered cellular grid \u2014 orbiting seed points form animated cells with glowing edges. Great for data / organic / network moods. Pairs well with CRT or VHS.",tags:["abstract","cells","organic","network","hero","background"],scene:"voronoi",defaultPostPreset:"crt"},{id:"synthwave",label:"Synthwave Grid",description:"Retro-future perspective grid receding to a banded sun disc on the horizon. Pairs beautifully with the Synthwave post preset (its namesake).",tags:["retro","synthwave","80s","hero","background","grid","sun"],scene:"synthwave",defaultPostPreset:"synthwave"}],gr=Object.fromEntries(ur.map(e=>[e.id,e]));var fr={none:{id:"none",label:"Clean",effects:{}},vhs:{id:"vhs",label:"VHS",effects:{bloom:{intensity:.35,luminanceThreshold:.5,radius:.7},noise:{intensity:.04},scanlines:{density:1.5,opacity:.12},vignette:{darkness:.4,offset:.45},chromatic:{offset:.0015}}},cinematic:{id:"cinematic",label:"Cinematic",effects:{bloom:{intensity:.5,luminanceThreshold:.55,radius:.8},vignette:{darkness:.5,offset:.5}}},synthwave:{id:"synthwave",label:"Synthwave",effects:{bloom:{intensity:.8,luminanceThreshold:.3,radius:.9},chromatic:{offset:.002},vignette:{darkness:.3,offset:.55}}},crt:{id:"crt",label:"CRT",effects:{bloom:{intensity:.2,luminanceThreshold:.7,radius:.4},scanlines:{density:2,opacity:.25},vignette:{darkness:.6,offset:.4},chromatic:{offset:.0025}}}},aa="vhs";var Ed=`
531
+ `,Oc=({palette:e})=>{let t=new Re.Scene,o=new Re.OrthographicCamera(-1,1,1,-1,0,1),r={uTime:{value:0},uBackground:{value:new Re.Color(e.background)},uPrimary:{value:new Re.Color(e.primary)},uSecondary:{value:new Re.Color(e.secondary)},uAccent:{value:new Re.Color(e.accent)}},n=new Re.ShaderMaterial({uniforms:r,vertexShader:Dh,fragmentShader:Ah,depthTest:false,depthWrite:false}),a=new Re.PlaneGeometry(2,2),i=new Re.Mesh(a,n);return t.add(i),{scene:t,camera:o,update:s=>{r.uTime.value=s;},setPalette:s=>{r.uBackground.value.set(s.background),r.uPrimary.value.set(s.primary),r.uSecondary.value.set(s.secondary),r.uAccent.value.set(s.accent);},dispose:()=>{a.dispose(),n.dispose();}}};var Vc=`
529
532
  precision highp float;
530
533
  varying vec2 vUv;
531
534
  uniform float uTime;
@@ -535,13 +538,44 @@ applyThemeToRoot(theme, "light"); // or "dark" / "superLight" / "superDark"
535
538
  uniform vec3 uSecondary;
536
539
  uniform vec3 uAccent;
537
540
  uniform vec3 uBackground;
538
- `,Vg=`
541
+ `,Ih=`
539
542
  varying vec2 vUv;
540
543
  void main() {
541
544
  vUv = uv;
542
545
  gl_Position = vec4(position.xy, 0.0, 1.0);
543
546
  }
544
- `,Do=class extends Error{log;source;constructor(t,o){super(`Fragment shader failed to compile:
545
- ${t.trim()}`),this.name="ShaderCompileError",this.log=t,this.source=o;}};function _g(e,t){let o=e.getContext(),r=o.createShader(o.FRAGMENT_SHADER);if(!r)throw new Error("Unable to allocate fragment shader");o.shaderSource(r,t),o.compileShader(r);let n=o.getShaderParameter(r,o.COMPILE_STATUS),a=o.getShaderInfoLog(r)||"";if(o.deleteShader(r),!n)throw new Do(a,t)}function un(e){return ({renderer:t,width:o,height:r,palette:n})=>{let a=`${Ed}
546
- ${e}`;_g(t,a);let l=new fe.Scene,p=new fe.OrthographicCamera(-1,1,1,-1,0,1),i={uTime:{value:0},uResolution:{value:new fe.Vector2(o,r)},uMouse:{value:new fe.Vector2(.5,.5)},uPrimary:{value:new fe.Color(n.primary)},uSecondary:{value:new fe.Color(n.secondary)},uAccent:{value:new fe.Color(n.accent)},uBackground:{value:new fe.Color(n.background)}},c=new fe.ShaderMaterial({uniforms:i,vertexShader:Vg,fragmentShader:a,depthTest:false,depthWrite:false}),d=new fe.PlaneGeometry(2,2),m=new fe.Mesh(d,c);return l.add(m),{scene:l,camera:p,update:u=>{i.uTime.value=u;},resize:(u,b)=>{i.uResolution.value.set(u,b);},setPalette:u=>{i.uPrimary.value.set(u.primary),i.uSecondary.value.set(u.secondary),i.uAccent.value.set(u.accent),i.uBackground.value.set(u.background);},setMouse:(u,b)=>{i.uMouse.value.set(u,b);},dispose:()=>{d.dispose(),c.dispose();}}}}var hr={primary:"#ff5fb9",secondary:"#9fe8ff",accent:"#ffc857",background:"#0a0a14"},Ug=/^[\d.]+\s+[\d.]+\s+[\d.]+(?:\s*\/\s*[\d.%]+)?$/,jg=/^[\d.]+\s+[\d.]+%\s+[\d.]+%(?:\s*\/\s*[\d.%]+)?$/,$g=/^\s*var\(\s*(--[^,)\s]+)(?:\s*,[^)]*)?\s*\)\s*$/;function na(e,t,o){if(typeof document>"u")return o;let r=e,n=$g.exec(e);if(n){let p=getComputedStyle(t).getPropertyValue(n[1]).trim();p&&(Ug.test(p)?r=`oklch(${p})`:jg.test(p)&&(r=`hsl(${p})`));}let a=document.createElement("span");if(a.style.color="",a.style.color=r,a.style.color==="")return o;a.style.display="none",t.appendChild(a);let l=getComputedStyle(a).color;if(t.removeChild(a),!l)return o;if(l.startsWith("rgb"))return l;try{let p=document.createElement("canvas");p.width=1,p.height=1;let i=p.getContext("2d");if(!i)return l;i.clearRect(0,0,1,1),i.fillStyle=l,i.fillRect(0,0,1,1);let[c,d,m]=i.getImageData(0,0,1,1).data;return `rgb(${c}, ${d}, ${m})`}catch{return l}}function Ld(e,t){return {primary:na(e.primary,t,hr.primary),secondary:na(e.secondary,t,hr.secondary),accent:na(e.accent,t,hr.accent),background:na(e.background,t,hr.background)}}var ia=S.forwardRef(({preset:e,fragmentShader:t,onShaderError:o,postPreset:r,palette:n,createScene:a,controls:l=false,autoPlay:p=true,pauseOffscreen:i=true,aspect:c="video",radius:d="lg",border:m=false,poster:g,label:u,className:b,style:h,maxDpr:f},y)=>{let R=S.useRef(null),[x,k]=S.useState(p),[T,O]=S.useState(false),D=go(),E=S.useMemo(()=>({...hr,...n}),[n]),$=S.useMemo(()=>a||(t?un(t):e&&mr[e]?mr[e]:null),[a,t,e]),H=S.useMemo(()=>{if(r)return r;if(e){let N=gr[e];if(N?.defaultPostPreset)return N.defaultPostPreset}return aa},[r,e]);S.useEffect(()=>{let N=R.current;if(!N||!$)return;let X=N.clientWidth||1,L=N.clientHeight||1,Y=Ld(E,N),v=new fe.WebGLRenderer({antialias:true,alpha:false,powerPreference:"high-performance"}),W=f??Math.min(window.devicePixelRatio||1,2);v.setPixelRatio(W),v.setSize(X,L),v.setClearColor(new fe.Color(Y.background),1),v.domElement.dataset.gdsPart="shader-canvas",v.domElement.style.width="100%",v.domElement.style.height="100%",v.domElement.style.display="block",N.appendChild(v.domElement);let I;try{I=$({renderer:v,width:X,height:L,palette:Y});}catch(Z){if(Z instanceof Do)o?.(Z),I=mr.space({renderer:v,width:X,height:L,palette:Y});else throw v.dispose(),v.domElement.parentElement===N&&N.removeChild(v.domElement),Z}let le=fr[H]??fr[aa],J=kd({renderer:v,scene:I.scene,camera:I.camera,preset:le,width:X,height:L}),he=new fe.Clock,ne=0,be=p&&!D,Be=true,A=()=>{if(ne=requestAnimationFrame(A),!be||i&&!Be)return;let Z=he.getDelta(),ie=he.getElapsedTime();I.update?.(ie,Z),J.composer.render(Z);};A(),be&&O(true);let ce=new ResizeObserver(([Z])=>{let ie=Math.max(1,Math.floor(Z.contentRect.width)),ze=Math.max(1,Math.floor(Z.contentRect.height));v.setSize(ie,ze),J.resize(ie,ze),I.resize?.(ie,ze);});ce.observe(N);let Q=new IntersectionObserver(([Z])=>{Be=Z.isIntersecting;},{threshold:.05});Q.observe(N);let Ge=new MutationObserver(()=>{if(!R.current)return;let Z=Ld(E,R.current);v.setClearColor(new fe.Color(Z.background),1),I.setPalette?.(Z);});Ge.observe(document.documentElement,{attributes:true,attributeFilter:["class","style","data-theme","data-gds-theme","data-grade-mode"]});let oe=I,Re=oe.setMouse?Z=>{let ie=N.getBoundingClientRect(),ze=(Z.clientX-ie.left)/ie.width,to=1-(Z.clientY-ie.top)/ie.height;oe.setMouse(ze,to);}:null;return Re&&N.addEventListener("pointermove",Re),F.current={toggle:()=>{be=!be,k(be);},setPalette:Z=>{v.setClearColor(new fe.Color(Z.background),1),I.setPalette?.(Z);},setPostPreset:Z=>{let ie=fr[Z];ie&&J.setPreset(ie);}},()=>{cancelAnimationFrame(ne),ce.disconnect(),Q.disconnect(),Ge.disconnect(),Re&&N.removeEventListener("pointermove",Re),J.dispose(),I.dispose?.(),v.dispose(),v.domElement.parentElement===N&&N.removeChild(v.domElement),F.current=null;}},[$,H,E,p,D,i,f,o]);let F=S.useRef(null),j=()=>F.current?.toggle();return S.createElement(Tt,{ref:N=>{R.current=N,typeof y=="function"?y(N):y&&(y.current=N);},aspect:c,radius:d,border:m,"aria-label":u,className:b,style:h,"data-gds-part":"three-scene"},!T&&g&&S.createElement("img",{src:g,alt:"",className:"absolute inset-0 w-full h-full object-cover","data-gds-part":"scene-poster"}),l&&S.createElement("div",{"data-gds-part":"scene-controls",className:s("absolute inset-0 flex items-end justify-end p-2","opacity-0 hover:opacity-100 transition-opacity","bg-gradient-to-t from-black/30 to-transparent")},S.createElement(We,{size:"icon",variant:"secondary",onClick:j},x?S.createElement(Pause,{className:"h-4 w-4"}):S.createElement(Play,{className:"h-4 w-4"}))))});ia.displayName="ThreeScene";var sa=S.forwardRef(({preset:e,live:t="hover",postPreset:o,palette:r,className:n,aspect:a="video",radius:l="lg",label:p,hideLabel:i=false,onClick:c},d)=>{let m=gr[e],[g,u]=S.useState(false),b=t==="always"||t==="hover"&&g;return S.createElement("div",{ref:d,"data-gds-part":"picker-card","data-gds-preset":e,onMouseEnter:()=>u(true),onMouseLeave:()=>u(false),onClick:c,className:s("group cursor-pointer flex flex-col gap-2",n)},b?S.createElement(ia,{preset:e,postPreset:o,palette:r,aspect:a,radius:l,autoPlay:true,controls:false,pauseOffscreen:true,poster:m?.poster,maxDpr:1}):S.createElement(Tt,{aspect:a,radius:l,"data-gds-part":"preset-poster",className:"bg-gradient-to-br from-muted to-muted/50"},m?.poster?S.createElement("img",{src:m.poster,alt:m.label,className:"w-full h-full object-cover"}):S.createElement("div",{className:"absolute inset-0 flex items-center justify-center text-xs text-muted-foreground"},m?.label??e)),!i&&S.createElement("div",{className:"flex items-baseline justify-between text-xs"},S.createElement("span",{className:"font-medium text-foreground","data-gds-part":"preset-label"},p??m?.label??e),m?.tags?.[0]&&S.createElement("span",{className:"text-muted-foreground"},m.tags[0])))});sa.displayName="ShaderPresetPreview";function qg({value:e,onChange:t,filterTags:o,live:r="hover",postPreset:n,palette:a,columns:l=3,className:p}){let i=S.useMemo(()=>o?.length?ur.filter(d=>o.some(m=>d.tags.includes(m))):ur,[o]);return S.createElement("div",{"data-gds-part":"preset-grid",role:"radiogroup",className:s("grid grid-cols-2 gap-3",l===2?"md:grid-cols-2":l===4?"md:grid-cols-4":"md:grid-cols-3",p)},i.map(d=>{let m=e===d.id;return S.createElement("div",{key:d.id,className:"relative",role:"radio","aria-checked":m},S.createElement(sa,{preset:d.id,postPreset:n,palette:a,live:r,onClick:()=>t?.(d.id),className:s("transition-all",m&&"ring-2 ring-primary ring-offset-2 ring-offset-background rounded-lg")}),m&&S.createElement("div",{"data-gds-part":"picker-selected-badge",className:"absolute top-2 right-2 rounded-full bg-primary text-primary-foreground p-1 shadow-sm"},S.createElement(Check,{className:"h-3.5 w-3.5"})))}))}function Jg({children:e}){let t=useRef(null);return useEffect(()=>{let o=new Xg({duration:1.2,easing:n=>Math.min(1,1.001-Math.pow(2,-10*n)),orientation:"vertical",gestureOrientation:"vertical",smoothWheel:true});t.current=o;function r(n){o.raf(n),requestAnimationFrame(r);}return requestAnimationFrame(r),()=>{o.destroy(),t.current=null;}},[]),React.createElement(React.Fragment,null,e)}function rf({className:e}){let t=uo();if(!t)return null;let{theme:o,themes:r,setThemeId:n,deleteTheme:a}=t;return S.createElement(Rt,null,S.createElement(St,{asChild:true},S.createElement(We,{variant:"ghost",size:"sm",className:s("gap-2",e),"aria-label":"Switch theme"},S.createElement(Palette,{className:"h-4 w-4"}),S.createElement("span",{className:"hidden sm:inline"},o.name))),S.createElement(ht,{className:"w-80 p-2",align:"end"},S.createElement("div",{className:"flex items-start justify-between gap-2 px-2 py-1.5 mb-1"},S.createElement("div",null,S.createElement("div",{className:"text-xs font-medium text-muted-foreground"},"Theme"),S.createElement("div",{className:"text-xs text-muted-foreground/80"},"Switch the skin applied site-wide.")),S.createElement("button",{type:"button",onClick:()=>en(o),className:"flex items-center gap-1 rounded-md border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",title:"Download the active theme as a markdown spec \u2014 paste into a fresh LLM prompt"},S.createElement(Download,{className:"h-3 w-3"}),".md")),S.createElement("div",{className:"flex flex-col gap-0.5"},r.map(l=>{let p=l.id===o.id,i=l.id in kt,c=l.ramps.primary[500],d=l.ramps.accent[500],m=l.ramps.neutral[500];return S.createElement("div",{key:l.id,className:s("group flex items-start gap-3 rounded-md px-2 py-2 text-left transition-colors","hover:bg-muted",p&&"bg-muted")},S.createElement("button",{type:"button",onClick:()=>n(l.id),className:"flex items-start gap-3 flex-1 min-w-0 text-left"},S.createElement("div",{className:"mt-0.5 flex shrink-0 overflow-hidden rounded-md border border-border"},S.createElement("div",{className:"h-5 w-2.5",style:{background:`oklch(${c})`},"aria-hidden":true}),S.createElement("div",{className:"h-5 w-2.5",style:{background:`oklch(${d})`},"aria-hidden":true}),S.createElement("div",{className:"h-5 w-2.5",style:{background:`oklch(${m})`},"aria-hidden":true})),S.createElement("div",{className:"min-w-0 flex-1"},S.createElement("div",{className:"flex items-center gap-2"},S.createElement("span",{className:"text-sm font-medium truncate text-foreground"},l.name),l.tagline&&S.createElement("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground shrink-0"},l.tagline)),l.description&&S.createElement("div",{className:"text-xs text-muted-foreground line-clamp-2"},l.description))),p&&S.createElement(Check,{className:"mt-2 h-4 w-4 shrink-0 text-primary"}),!i&&!p&&S.createElement("button",{type:"button",onClick:g=>{g.stopPropagation(),a(l.id);},className:"mt-1 opacity-0 group-hover:opacity-100 transition-opacity rounded p-1 hover:bg-destructive/10 hover:text-destructive","aria-label":`Delete theme ${l.name}`},S.createElement(Trash2,{className:"h-3.5 w-3.5"})))}))))}var Dd=[{mode:"superLight",label:"Super light",icon:SunDim,tooltip:"Super light \u2014 airy, low contrast"},{mode:"light",label:"Light",icon:Sun,tooltip:"Light"},{mode:"dark",label:"Dark",icon:Moon,tooltip:"Dark"},{mode:"superDark",label:"Super dark",icon:MoonStar,tooltip:"Super dark \u2014 OLED, high contrast"}];function df({className:e,variant:t="icons"}){let o=uo();if(!o)return null;let{mode:r,setMode:n}=o;return t==="labeled"?S.createElement("div",{role:"radiogroup","aria-label":"Brightness mode",className:s("inline-flex flex-wrap gap-1 rounded-md border border-border bg-background p-1",e)},Dd.map(({mode:a,label:l,icon:p})=>{let i=r===a;return S.createElement("button",{key:a,type:"button",role:"radio","aria-checked":i,onClick:()=>n(a),className:s("flex items-center gap-2 rounded px-3 py-1.5 text-sm transition-colors",i?"bg-primary text-primary-foreground":"hover:bg-accent hover:text-accent-foreground")},S.createElement(p,{className:"h-4 w-4"}),S.createElement("span",null,l))})):S.createElement("div",{role:"radiogroup","aria-label":"Brightness mode",className:s("inline-flex items-center gap-0.5 rounded-md border border-border bg-background p-0.5",e)},Dd.map(({mode:a,icon:l,tooltip:p})=>{let i=r===a;return S.createElement("button",{key:a,type:"button",role:"radio","aria-checked":i,"aria-label":p,title:p,onClick:()=>n(a),className:s("flex h-7 w-7 items-center justify-center rounded transition-colors",i?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground")},S.createElement(l,{className:"h-3.5 w-3.5"}))}))}function mf(){let{isDark:e,setMode:t}=sn();return React.createElement(We,{variant:"ghost",size:"sm",onClick:()=>t(e?"light":"dark"),className:"gap-2","aria-label":e?"Switch to light mode":"Switch to dark mode"},e?React.createElement(React.Fragment,null,React.createElement(Sun,{className:"h-4 w-4"}),React.createElement("span",{className:"hidden sm:inline"},"Light")):React.createElement(React.Fragment,null,React.createElement(Moon,{className:"h-4 w-4"}),React.createElement("span",{className:"hidden sm:inline"},"Dark")))}export{nd as ALL_MODES,mc as Accordion,ki as AccordionContent,Si as AccordionItem,Ci as AccordionTrigger,Fi as AppShell,Oi as AppShellAside,_i as AppShellFooter,Bi as AppShellHeader,Vi as AppShellMain,zi as AppShellNav,Wi as Avatar,ji as AvatarFallback,Ui as AvatarImage,Zr as BUILT_IN_INPUTS,Tr as Badge,Yi as Banner,Dr as BlinkingCursor,Cl as Breadcrumb,El as BreadcrumbEllipsis,Tl as BreadcrumbItem,Pl as BreadcrumbLink,kl as BreadcrumbList,Ll as BreadcrumbMenuTrigger,Ml as BreadcrumbPage,Nl as BreadcrumbSeparator,We as Button,fa as COMPONENT_CONTRACTS,Mr as Calendar,Xi as CalendarDayButton,Pi as Callout,Ni as CalloutDescription,Mi as CalloutTitle,Ji as Card,os as CardContent,ts as CardDescription,rs as CardFooter,Qi as CardHeader,es as CardTitle,Lc as Carousel,ya as CarouselArrows,va as CarouselDots,Ko as CarouselNext,$o as CarouselPrev,Nr as CarouselSlide,ba as CarouselVideoSlide,as as Checkbox,ds as Code,gs as Composer,Kp as ComposerReply,ko as DEMO_SPEED_PRESETS,Xp as DatePicker,Jp as DateRangePicker,is as DemoStage,em as Dialog,om as DialogClose,bs as DialogContent,ws as DialogDescription,ys as DialogFooter,vs as DialogHeader,Ra as DialogOverlay,hs as DialogPortal,xs as DialogTitle,tm as DialogTrigger,im as DropdownMenu,Ts as DropdownMenuCheckboxItem,Cs as DropdownMenuContent,lm as DropdownMenuGroup,ks as DropdownMenuItem,Ms as DropdownMenuLabel,dm as DropdownMenuPortal,pm as DropdownMenuRadioGroup,Ps as DropdownMenuRadioItem,Ns as DropdownMenuSeparator,Es as DropdownMenuShortcut,cm as DropdownMenuSub,Ss as DropdownMenuSubContent,Rs as DropdownMenuSubTrigger,sm as DropdownMenuTrigger,Ed as FRAGMENT_HEADER,Gs as Flex,Vu as GRADE_PRE_HYDRATION_SCRIPT,df as GradeModeSwitcher,_u as GradeThemeProvider,rf as GradeThemeSwitcher,Vs as Grid,Ls as Input,Ds as Label,Jg as LenisProvider,dn as Map,cn as MapMarker,Tt as MediaSurface,ma as MediaSurfaceContract,Kc as Message,Hs as MultiSelect,Rt as Popover,qp as PopoverAnchor,ht as PopoverContent,St as PopoverTrigger,As as Progress,Is as RadioGroup,Fs as RadioGroupItem,Pm as ResizableHandle,Tm as ResizablePanel,km as ResizablePanelGroup,ss as Reveal,Sd as RivePlayer,zs as Row,Ws as ScrollArea,Ea as ScrollBar,Bm as Select,$s as SelectContent,zm as SelectGroup,qs as SelectItem,Ks as SelectLabel,Da as SelectScrollDownButton,La as SelectScrollUpButton,Ys as SelectSeparator,js as SelectTrigger,Om as SelectValue,tr as Separator,Do as ShaderCompileError,qg as ShaderPresetPicker,sa as ShaderPresetPreview,Wm as Sheet,jm as SheetClose,Xs as SheetContent,tl as SheetDescription,Qs as SheetFooter,Js as SheetHeader,Aa as SheetOverlay,Zs as SheetPortal,el as SheetTitle,Um as SheetTrigger,Yt as Sidebar,Ua as SidebarContent,ja as SidebarFooter,Wa as SidebarHeader,Ka as SidebarItem,$a as SidebarSection,qa as SidebarTreeItem,Km as Skeleton,ol as Slider,nu as Sortable,Ia as SortableGroup,Ba as SortableHandle,Fa as SortableItem,ul as Stack,gl as Switch,fl as Table,bl as TableBody,Rl as TableCaption,wl as TableCell,vl as TableFooter,xl as TableHead,hl as TableHeader,yl as TableRow,pu as Tabs,Fl as TabsContent,Hl as TabsList,Il as TabsTrigger,Bl as Textarea,mf as ThemeToggle,ia as ThreeScene,Ol as Toggle,Gl as ToggleGroup,Wl as ToggleGroupItem,Ul as Toolbar,jl as ToolbarSlot,lo as Tooltip,qt as TooltipContent,Oa as TooltipProvider,co as TooltipTrigger,Rd as VideoPlayer,Ai as appShellAsideVariants,Ii as appShellFooterVariants,Li as appShellHeaderVariants,Hi as appShellMainVariants,Di as appShellNavVariants,Xr as applyThemeToRoot,Ki as badgeVariants,qi as bannerVariants,un as buildFragmentShaderScene,kt as builtInThemes,jo as buttonVariants,Ti as calloutVariants,cr as calmInput,s as cn,aa as defaultPostPreset,Eo as defaultThemeId,rn as deleteUserTheme,re as demoSleep,Er as demoTypeText,Ou as duplicateTheme,Za as energyInput,_s as flexVariants,po as generateTheme,sc as getComponentContract,mo as getTheme,Os as gridVariants,lc as listContractedComponents,tn as listThemes,rd as listUserThemes,on as loadUserThemeInput,fr as postPresets,Bs as rowVariants,Qr as saveUserTheme,mr as sceneRegistry,gr as shaderPresetById,ur as shaderPresets,Ei as shellVariants,ml as stackVariants,Ja as themeToCSSVars,zl as toggleVariants,Dc as useCarouselApi,sn as useGradeTheme,uo as useMaybeGradeTheme,go as usePrefersReducedMotion,jt as useScriptedDemo};//# sourceMappingURL=index.mjs.map
547
+ `,rr=class extends Error{log;source;constructor(t,o){super(`Fragment shader failed to compile:
548
+ ${t.trim()}`),this.name="ShaderCompileError",this.log=t,this.source=o;}};function Hh(e,t){let o=e.getContext(),r=o.createShader(o.FRAGMENT_SHADER);if(!r)throw new Error("Unable to allocate fragment shader");o.shaderSource(r,t),o.compileShader(r);let n=o.getShaderParameter(r,o.COMPILE_STATUS),a=o.getShaderInfoLog(r)||"";if(o.deleteShader(r),!n)throw new rr(a,t)}function ar(e){return ({renderer:t,width:o,height:r,palette:n})=>{let a=`${Vc}
549
+ ${e}`;Hh(t,a);let i=new Re.Scene,p=new Re.OrthographicCamera(-1,1,1,-1,0,1),s={uTime:{value:0},uResolution:{value:new Re.Vector2(o,r)},uMouse:{value:new Re.Vector2(.5,.5)},uPrimary:{value:new Re.Color(n.primary)},uSecondary:{value:new Re.Color(n.secondary)},uAccent:{value:new Re.Color(n.accent)},uBackground:{value:new Re.Color(n.background)}},c=new Re.ShaderMaterial({uniforms:s,vertexShader:Ih,fragmentShader:a,depthTest:false,depthWrite:false}),d=new Re.PlaneGeometry(2,2),m=new Re.Mesh(d,c);return i.add(m),{scene:i,camera:p,update:u=>{s.uTime.value=u;},resize:(u,b)=>{s.uResolution.value.set(u,b);},setPalette:u=>{s.uPrimary.value.set(u.primary),s.uSecondary.value.set(u.secondary),s.uAccent.value.set(u.accent),s.uBackground.value.set(u.background);},setMouse:(u,b)=>{s.uMouse.value.set(u,b);},dispose:()=>{d.dispose(),c.dispose();}}}}var Gc=ar(`
550
+ void main() {
551
+ vec2 uv = vUv;
552
+ float t = uTime * 0.15;
553
+
554
+ vec2 p1 = vec2(0.5 + 0.36 * sin(t * 1.1), 0.5 + 0.30 * cos(t * 0.9));
555
+ vec2 p2 = vec2(0.5 + 0.40 * cos(t * 0.7 + 1.0), 0.4 + 0.34 * sin(t * 1.3));
556
+ vec2 p3 = vec2(0.45 + 0.32 * sin(t * 0.5 + 2.0),0.6 + 0.30 * cos(t * 1.7));
557
+
558
+ float w1 = smoothstep(0.62, 0.0, distance(uv, p1));
559
+ float w2 = smoothstep(0.62, 0.0, distance(uv, p2));
560
+ float w3 = smoothstep(0.62, 0.0, distance(uv, p3));
561
+
562
+ vec3 col = uBackground;
563
+ col = mix(col, uPrimary, w1);
564
+ col = mix(col, uSecondary, w2 * 0.9);
565
+ col = mix(col, uAccent, w3 * 0.85);
566
+ gl_FragColor = vec4(col, 1.0);
567
+ }
568
+ `),jc=ar(`
569
+ void main() {
570
+ vec2 uv = vUv;
571
+ float t = uTime * 0.4;
572
+ float band = sin(uv.x * 6.2831 + sin(uv.y * 4.0 + t) * 1.5 + t);
573
+ float m = 0.5 + 0.5 * band;
574
+ vec3 col = mix(uBackground, uPrimary, smoothstep(0.3, 0.7, m));
575
+ col = mix(col, uSecondary, smoothstep(0.6, 1.0, m));
576
+ col = mix(col, uAccent, smoothstep(0.85, 1.0, m));
577
+ gl_FragColor = vec4(col, 1.0);
578
+ }
579
+ `);var Vr={space:zc,plasma:Bc,voronoi:_c,synthwave:Oc,mesh:Gc,waves:jc},Gr=[{id:"mesh",label:"Mesh gradient",description:"Smooth moving blobs of the primary / secondary / accent colours over the background \u2014 the go-to soft, theme-reactive background.",tags:["gradient","mesh","abstract","hero","background"],scene:"mesh",defaultPostPreset:"none"},{id:"waves",label:"Waves",description:"Flowing banded ribbons that ripple across the surface. Clean motion for headers and hero backdrops.",tags:["waves","motion","abstract","hero"],scene:"waves",defaultPostPreset:"none"},{id:"space",label:"Hyperspace",description:"Classic 'jump to hyperspace' \u2014 streaking stars flying past camera. Pairs well with VHS or Cinematic post-FX.",tags:["space","retro","motion","hero","background"],scene:"space",defaultPostPreset:"vhs"},{id:"plasma",label:"Plasma",description:"Soft rolling colour clouds \u2014 overlapping sines warping a palette ramp. Classic demoscene vibe. Pairs well with Synthwave or Cinematic.",tags:["abstract","soft","ambient","hero","background","gradient"],scene:"plasma",defaultPostPreset:"synthwave"},{id:"voronoi",label:"Voronoi",description:"Jittered cellular grid \u2014 orbiting seed points form animated cells with glowing edges. Great for data / organic / network moods. Pairs well with CRT or VHS.",tags:["abstract","cells","organic","network","hero","background"],scene:"voronoi",defaultPostPreset:"crt"},{id:"synthwave",label:"Synthwave Grid",description:"Retro-future perspective grid receding to a banded sun disc on the horizon. Pairs beautifully with the Synthwave post preset (its namesake).",tags:["retro","synthwave","80s","hero","background","grid","sun"],scene:"synthwave",defaultPostPreset:"synthwave"}],jr=Object.fromEntries(Gr.map(e=>[e.id,e]));var Wr={none:{id:"none",label:"Clean",effects:{}},vhs:{id:"vhs",label:"VHS",effects:{bloom:{intensity:.35,luminanceThreshold:.5,radius:.7},noise:{intensity:.04},scanlines:{density:1.5,opacity:.12},vignette:{darkness:.4,offset:.45},chromatic:{offset:.0015}}},cinematic:{id:"cinematic",label:"Cinematic",effects:{bloom:{intensity:.5,luminanceThreshold:.55,radius:.8},vignette:{darkness:.5,offset:.5}}},synthwave:{id:"synthwave",label:"Synthwave",effects:{bloom:{intensity:.8,luminanceThreshold:.3,radius:.9},chromatic:{offset:.002},vignette:{darkness:.3,offset:.55}}},crt:{id:"crt",label:"CRT",effects:{bloom:{intensity:.2,luminanceThreshold:.7,radius:.4},scanlines:{density:2,opacity:.25},vignette:{darkness:.6,offset:.4},chromatic:{offset:.0025}}}},Ga="vhs";var Ur={primary:"#ff5fb9",secondary:"#9fe8ff",accent:"#ffc857",background:"#0a0a14"},Bh=/^[\d.]+\s+[\d.]+\s+[\d.]+(?:\s*\/\s*[\d.%]+)?$/,_h=/^[\d.]+\s+[\d.]+%\s+[\d.]+%(?:\s*\/\s*[\d.%]+)?$/,Oh=/^\s*var\(\s*(--[^,)\s]+)(?:\s*,[^)]*)?\s*\)\s*$/;function ja(e,t,o){if(typeof document>"u")return o;let r=e,n=Oh.exec(e);if(n){let p=getComputedStyle(t).getPropertyValue(n[1]).trim();p&&(Bh.test(p)?r=`oklch(${p})`:_h.test(p)&&(r=`hsl(${p})`));}let a=document.createElement("span");if(a.style.color="",a.style.color=r,a.style.color==="")return o;a.style.display="none",t.appendChild(a);let i=getComputedStyle(a).color;if(t.removeChild(a),!i)return o;if(i.startsWith("rgb"))return i;try{let p=document.createElement("canvas");p.width=1,p.height=1;let s=p.getContext("2d");if(!s)return i;s.clearRect(0,0,1,1),s.fillStyle=i,s.fillRect(0,0,1,1);let[c,d,m]=s.getImageData(0,0,1,1).data;return `rgb(${c}, ${d}, ${m})`}catch{return i}}function Wc(e,t){return {primary:ja(e.primary,t,Ur.primary),secondary:ja(e.secondary,t,Ur.secondary),accent:ja(e.accent,t,Ur.accent),background:ja(e.background,t,Ur.background)}}var nr=C.forwardRef(({preset:e,fragmentShader:t,onShaderError:o,postPreset:r,palette:n,createScene:a,controls:i=false,autoPlay:p=true,play:s,pauseOffscreen:c=true,aspect:d="video",radius:m="lg",border:g=false,poster:u,label:b,className:f,style:h,maxDpr:v,...w},y)=>{let S=C.useRef(null),[k,H]=C.useState(s??p),[E,D]=C.useState(false),U=ao(),A=C.useMemo(()=>({...Ur,...n}),[n]),q=C.useMemo(()=>a||(t?ar(t):e&&Vr[e]?Vr[e]:null),[a,t,e]),F=C.useMemo(()=>{if(r&&typeof r=="object")return r;let P=typeof r=="string"?r:(e?jr[e]?.defaultPostPreset:void 0)??Ga;return Wr[P]??Wr[Ga]},[r,e]),Y=C.useRef(F);Y.current=F;let J=C.useRef(A);J.current=A;let z=C.useMemo(()=>JSON.stringify(A??null),[A]),pe=C.useRef(o);pe.current=o,C.useEffect(()=>{let P=S.current;if(!P||!q)return;let te=P.clientWidth||1,se=P.clientHeight||1,ne=Wc(J.current,P),B=new Re.WebGLRenderer({antialias:true,alpha:false,powerPreference:"high-performance"}),Le=v??Math.min(window.devicePixelRatio||1,2);B.setPixelRatio(Le),B.setSize(te,se),B.setClearColor(new Re.Color(ne.background),1),B.domElement.dataset.gdsPart="shader-canvas",B.domElement.style.width="100%",B.domElement.style.height="100%",B.domElement.style.display="block",P.appendChild(B.domElement);let me;try{me=q({renderer:B,width:te,height:se,palette:ne});}catch(ue){if(ue instanceof rr)pe.current?.(ue),me=Vr.space({renderer:B,width:te,height:se,palette:ne});else throw B.dispose(),B.domElement.parentElement===P&&P.removeChild(B.domElement),ue}let L=Y.current,de=Fc({renderer:B,scene:me.scene,camera:me.camera,preset:L,width:te,height:se}),Z=new Re.Clock,$e=0,le=(s??p)&&!U,De=true,rt=()=>{if($e=requestAnimationFrame(rt),!le||c&&!De)return;let ue=Z.getDelta(),oe=Z.getElapsedTime();me.update?.(oe,ue),de.composer.render(ue);};me.update?.(0,0),de.composer.render(0),D(true),rt();let Ke=new ResizeObserver(([ue])=>{let oe=Math.max(1,Math.floor(ue.contentRect.width)),Nt=Math.max(1,Math.floor(ue.contentRect.height));B.setSize(oe,Nt),de.resize(oe,Nt),me.resize?.(oe,Nt),le||(me.update?.(Z.getElapsedTime(),0),de.composer.render(0));});Ke.observe(P);let at=new IntersectionObserver(([ue])=>{De=ue.isIntersecting;},{threshold:.05});at.observe(P);let Xt=new MutationObserver(()=>{if(!S.current)return;let ue=Wc(J.current,S.current);B.setClearColor(new Re.Color(ue.background),1),me.setPalette?.(ue);});Xt.observe(document.documentElement,{attributes:true,attributeFilter:["class","style","data-theme","data-gds-theme","data-grade-mode"]});let Bo=me,bo=Bo.setMouse?ue=>{let oe=P.getBoundingClientRect(),Nt=(ue.clientX-oe.left)/oe.width,Mt=1-(ue.clientY-oe.top)/oe.height;Bo.setMouse(Nt,Mt);}:null;return bo&&P.addEventListener("pointermove",bo),x.current={toggle:()=>{le=!le,H(le);},setRunning:ue=>{le=ue&&!U,H(le);},setPalette:ue=>{B.setClearColor(new Re.Color(ue.background),1),me.setPalette?.(ue);},setPostPreset:ue=>{let oe=typeof ue=="string"?Wr[ue]:ue;oe&&de.setPreset(oe);}},()=>{cancelAnimationFrame($e),Ke.disconnect(),at.disconnect(),Xt.disconnect(),bo&&P.removeEventListener("pointermove",bo),de.dispose(),me.dispose?.(),B.dispose(),B.domElement.parentElement===P&&P.removeChild(B.domElement),x.current=null;}},[q,z,p,U,c,v]);let x=C.useRef(null);C.useEffect(()=>{x.current?.setPostPreset(F);},[F]),C.useEffect(()=>{s!==void 0&&x.current?.setRunning(s);},[s]);let I=()=>x.current?.toggle();return C.createElement(zt,{...w,ref:P=>{S.current=P,typeof y=="function"?y(P):y&&(y.current=P);},aspect:d,radius:m,border:g,"aria-label":b,className:f,style:h,"data-gds-part":"three-scene"},!E&&u&&C.createElement("img",{src:u,alt:"",className:"absolute inset-0 w-full h-full object-cover","data-gds-part":"scene-poster"}),i&&C.createElement("div",{"data-gds-part":"scene-controls",className:l("absolute inset-0 flex items-end justify-end p-2","opacity-0 hover:opacity-100 transition-opacity","bg-gradient-to-t from-black/30 to-transparent")},C.createElement(Xe,{size:"icon",variant:"secondary",onClick:I},k?C.createElement(Pause,{className:"h-4 w-4"}):C.createElement(Play,{className:"h-4 w-4"}))))});nr.displayName="ThreeScene";function Uc(e,t,o){let r=e[t];return typeof r=="number"?r:o}function Wa(e,t,o){let r=e[t];return typeof r=="string"?r:o}function $c(e,t,o){let r=e[t];return typeof r=="boolean"?r:o}function Kc(e,t,o){let r=e[t];return Array.isArray(r)?r:o}var Ua="text-[11px] font-medium text-foreground";function jh({controls:e,state:t,onChange:o,disabled:r,className:n}){return C.createElement("div",{className:l("flex flex-col",n)},e.map(a=>{if(a.type==="divider")return C.createElement("div",{key:a.key,className:"mt-3 mb-1 border-t border-border/60 pt-2 first:mt-0 first:border-t-0 first:pt-0"},a.label?C.createElement("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-foreground/80"},a.label):null);if(a.type==="slider")return C.createElement(Wh,{key:a.key,spec:a,value:Uc(t,a.key,a.default),disabled:r,onChange:p=>o(a.key,p)});if(a.type==="segmented"){let p=Wa(t,a.key,a.default);return C.createElement(si,{key:a.key,label:a.label},C.createElement(Do,{type:"single",size:"sm",value:p,onValueChange:s=>s&&o(a.key,s),disabled:r,className:"w-full justify-start"},a.options.map(s=>C.createElement(Ao,{key:s.value,value:s.value,className:"flex-1"},s.label))))}if(a.type==="select"){let p=Wa(t,a.key,a.default);return C.createElement(si,{key:a.key,label:a.label},C.createElement(xn,{value:p,onValueChange:s=>o(a.key,s),disabled:r},C.createElement(Sa,{size:"xs",className:"w-full"},C.createElement(wn,null)),C.createElement(ka,{size:"xs"},a.options.map(s=>C.createElement(Ca,{key:s.value,value:s.value},s.label)))))}if(a.type==="toggle"){let p=$c(t,a.key,a.default);return C.createElement("div",{key:a.key,className:"flex items-center justify-between gap-2 py-1"},C.createElement(Po,{className:Ua},a.label),C.createElement(Na,{checked:p,onCheckedChange:s=>o(a.key,s),disabled:r}))}if(a.type==="color"){let p=Wa(t,a.key,a.default);return C.createElement(si,{key:a.key,label:a.label,hint:a.slot?`\u2192 ${a.slot}`:void 0},C.createElement(qc,{value:p,disabled:r,onChange:s=>o(a.key,s)}))}let i=Kc(t,a.key,a.default);return C.createElement($h,{key:a.key,spec:a,value:i,disabled:r,onChange:p=>o(a.key,p)})}))}function si({label:e,hint:t,children:o}){return C.createElement("div",{className:"space-y-1 py-1"},C.createElement("div",{className:"flex items-baseline justify-between gap-2"},C.createElement(Po,{className:Ua},e),t?C.createElement("span",{className:"text-[10px] text-muted-foreground/70"},t):null),o)}function Wh({spec:e,value:t,disabled:o,onChange:r}){let n=e.step<1?e.step<.1?3:2:0,a=d=>Math.min(e.max,Math.max(e.min,d)),[i,p]=C.useState(null),s=i??t.toFixed(n),c=d=>{let m=Number(d);Number.isFinite(m)&&r(a(m)),p(null);};return C.createElement("div",{className:"space-y-1 py-1"},C.createElement("div",{className:"flex items-center justify-between gap-2"},C.createElement(Po,{className:Ua},e.label),C.createElement(qt,{size:"xs",type:"text",inputMode:"decimal","aria-label":e.label,value:s,disabled:o,endSlot:e.unit?C.createElement("span",{className:"text-[9px] text-muted-foreground/60"},e.unit):void 0,className:"w-16 tabular-nums",onChange:d=>p(d.currentTarget.value),onBlur:d=>c(d.currentTarget.value),onKeyDown:d=>{d.key==="Enter"&&c(d.currentTarget.value);}})),C.createElement(Mo,{value:[t],min:e.min,max:e.max,step:e.step,disabled:o,onValueChange:d=>r(a(d[0]??e.default))}))}var Uh=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function qc({value:e,disabled:t,onChange:o}){let r=Uh.test(e)?e:"#000000";return C.createElement("div",{className:"flex items-center gap-1.5"},C.createElement("input",{type:"color",value:r,disabled:t,onChange:n=>o(n.currentTarget.value),"aria-label":"Colour swatch",className:"h-7 w-9 shrink-0 cursor-pointer rounded-md border border-input bg-transparent disabled:opacity-50"}),C.createElement(qt,{size:"xs",value:e,disabled:t,onChange:n=>o(n.currentTarget.value),className:"font-mono"}))}function $h({spec:e,value:t,disabled:o,onChange:r}){let n=e.min??1,a=e.max??8,i=(c,d)=>r(t.map((m,g)=>g===c?d:m)),p=()=>t.length<a&&r([...t,t[t.length-1]??"#ffffff"]),s=c=>t.length>n&&r(t.filter((d,m)=>m!==c));return C.createElement("div",{className:"space-y-1 py-1"},C.createElement("div",{className:"flex items-baseline justify-between gap-2"},C.createElement(Po,{className:Ua},e.label),C.createElement("button",{type:"button",onClick:p,disabled:o||t.length>=a,"aria-label":"Add colour",className:"inline-flex h-5 w-5 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40 [&_svg]:size-3.5"},C.createElement(Plus,null))),C.createElement("div",{className:"space-y-1.5"},t.map((c,d)=>C.createElement("div",{key:d,className:"flex items-center gap-1.5"},C.createElement(qc,{value:c,disabled:o,onChange:m=>i(d,m)}),C.createElement("button",{type:"button",onClick:()=>s(d),disabled:o||t.length<=n,"aria-label":"Remove colour",className:"inline-flex h-7 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40 [&_svg]:size-3.5"},C.createElement(Minus,null))))))}var Kh={background:"oklch(var(--background))",card:"oklch(var(--card))",muted:"oklch(var(--muted))",secondary:"oklch(var(--secondary))",accent:"oklch(var(--accent))",primary:"oklch(var(--primary))",destructive:"oklch(var(--destructive))",transparent:"transparent"};function $a(e){if(e)return Kh[e]??e}var qh={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},Yc={cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none"},Zc=C.forwardRef(({type:e,color:t,gradient:o,src:r,fit:n="cover",position:a="center",repeat:i=false,tileSize:p,preset:s,fragmentShader:c,palette:d,postPreset:m,opacity:g,blendMode:u,radius:b="none",className:f,style:h},v)=>{if(e==="none")return null;let w={opacity:g,mixBlendMode:u,...h},y=null;if(e==="solid")w.background=$a(t)??"oklch(var(--background))";else if(e==="gradient"){let S=[$a(o?.from)??"oklch(var(--primary))",$a(o?.via),$a(o?.to)??"oklch(var(--accent))"].filter(Boolean);if(o?.shape==="radial"){let k=o.at??"center",H=o.size?`${o.size} `:"";w.backgroundImage=`radial-gradient(${H}at ${k}, ${S.join(", ")})`;}else {let k=o?.angle??135;w.backgroundImage=`linear-gradient(${k}deg, ${S.join(", ")})`;}}else e==="image"?i&&r?(w.backgroundImage=`url(${r})`,w.backgroundRepeat="repeat",w.backgroundPosition=a,p&&(w.backgroundSize=p)):r&&(y=C.createElement("img",{src:r,alt:"",className:l("absolute inset-0 h-full w-full",Yc[n]),style:{objectPosition:a}})):e==="video"?r&&(y=C.createElement("video",{src:r,autoPlay:true,muted:true,loop:true,playsInline:true,className:l("absolute inset-0 h-full w-full",Yc[n]),style:{objectPosition:a}})):e==="shader"&&(y=C.createElement(nr,{preset:s,fragmentShader:c,palette:d,postPreset:m,aspect:"auto",radius:"none",className:"absolute inset-0"}));return C.createElement("div",{ref:v,"data-gds-part":"frame-fill","data-gds-fill-type":e,"aria-hidden":"true",className:l("absolute inset-0 z-0 overflow-hidden pointer-events-none",b!=="none"&&qh[b],f),style:w},y)});Zc.displayName="BackgroundFill";var Xc={primary:"oklch(var(--primary))",secondary:"oklch(var(--accent))",accent:"oklch(var(--primary))",background:"oklch(var(--foreground))"};var Ka=C.forwardRef(({preset:e,live:t="hover",postPreset:o,palette:r,className:n,aspect:a="video",radius:i="lg",label:p,hideLabel:s=false,onClick:c},d)=>{let m=jr[e],[g,u]=C.useState(false),b=t!=="never",f=t==="always"||t==="hover"&&g;return C.createElement("div",{ref:d,"data-gds-part":"picker-card","data-gds-preset":e,onMouseEnter:()=>u(true),onMouseLeave:()=>u(false),onClick:c,className:l("group cursor-pointer flex flex-col gap-2",n)},b?C.createElement(nr,{key:e,preset:e,postPreset:o,palette:r??Xc,aspect:a,radius:i,autoPlay:false,play:f,controls:false,pauseOffscreen:true,poster:m?.poster,maxDpr:1}):C.createElement(zt,{aspect:a,radius:i,"data-gds-part":"preset-poster",className:"bg-gradient-to-br from-muted to-muted/50"},m?.poster?C.createElement("img",{src:m.poster,alt:m.label,className:"w-full h-full object-cover"}):C.createElement("div",{className:"absolute inset-0 flex items-center justify-center text-xs text-muted-foreground"},m?.label??e)),!s&&C.createElement("div",{className:"flex items-baseline justify-between text-xs"},C.createElement("span",{className:"font-medium text-foreground","data-gds-part":"preset-label"},p??m?.label??e),m?.tags?.[0]&&C.createElement("span",{className:"text-muted-foreground"},m.tags[0])))});Ka.displayName="ShaderPresetPreview";function li({value:e,onChange:t,filterTags:o,live:r="hover",postPreset:n,palette:a,columns:i=3,className:p}){let s=C.useMemo(()=>o?.length?Gr.filter(d=>o.some(m=>d.tags.includes(m))):Gr,[o]);return C.createElement("div",{"data-gds-part":"preset-grid",role:"radiogroup",className:l("grid grid-cols-2 gap-3",i===2?"md:grid-cols-2":i===4?"md:grid-cols-4":"md:grid-cols-3",p)},s.map(d=>{let m=e===d.id;return C.createElement("div",{key:d.id,className:"relative",role:"radio","aria-checked":m},C.createElement(Ka,{preset:d.id,postPreset:n,palette:a,live:r,onClick:()=>t?.(d.id),className:l("transition-all",m&&"ring-2 ring-primary ring-offset-2 ring-offset-background rounded-lg")}),m&&C.createElement("div",{"data-gds-part":"picker-selected-badge",className:"absolute top-2 right-2 rounded-full bg-primary text-primary-foreground p-1 shadow-sm"},C.createElement(Check,{className:"h-3.5 w-3.5"})))}))}var qa=["primary","accent","secondary","muted","card","background","destructive","transparent"];function ob(e){return e==="transparent"?"transparent":`oklch(var(--${e}))`}var rb=[{tab:"solid",icon:Square,label:"Solid"},{tab:"gradient",icon:Blend,label:"Gradient"},{tab:"image",icon:Image,label:"Image"},{tab:"pattern",icon:Grid3x3,label:"Pattern"},{tab:"video",icon:Video,label:"Video"},{tab:"shader",icon:Sparkles,label:"Shader"}];function ab(e){return e.type==="image"&&e.repeat?"pattern":e.type==="image"?"image":e.type}var _t="text-[11px] font-medium text-muted-foreground";function di({token:e,active:t,onClick:o}){return C.createElement("button",{type:"button",title:e,onClick:o,className:l("h-7 w-7 rounded-md border border-border/60 transition-shadow",e==="transparent"&&"bg-[linear-gradient(45deg,#bbb_25%,transparent_25%,transparent_75%,#bbb_75%),linear-gradient(45deg,#bbb_25%,transparent_25%,transparent_75%,#bbb_75%)] bg-[length:8px_8px] bg-[position:0_0,4px_4px]",t&&"ring-2 ring-primary ring-offset-1 ring-offset-background"),style:e==="transparent"?void 0:{background:ob(e)}})}function Jc({value:e,onChange:t,className:o}){let r=ab(e),n=i=>t({...e,...i}),a=i=>{i&&n(i==="pattern"?{type:"image",repeat:true}:i==="image"?{type:"image",repeat:false}:{type:i});};return C.createElement("div",{className:l("flex flex-col gap-3",o)},C.createElement(Do,{type:"single",size:"sm",value:r,onValueChange:i=>a(i),className:"justify-start gap-0.5"},rb.map(({tab:i,icon:p,label:s})=>C.createElement(Ao,{key:i,value:i,"aria-label":s,title:s},C.createElement(p,{className:"h-4 w-4"})))),r==="solid"&&C.createElement("div",{className:"flex flex-col gap-1.5"},C.createElement("span",{className:_t},"Token"),C.createElement("div",{className:"flex flex-wrap gap-1.5"},qa.map(i=>C.createElement(di,{key:i,token:i,active:e.color===i,onClick:()=>n({color:i})})))),r==="gradient"&&C.createElement("div",{className:"flex flex-col gap-2"},C.createElement("div",{className:"flex flex-col gap-1.5"},C.createElement("span",{className:_t},"From"),C.createElement("div",{className:"flex flex-wrap gap-1.5"},qa.map(i=>C.createElement(di,{key:i,token:i,active:e.gradient?.from===i,onClick:()=>n({gradient:{...e.gradient,from:i}})})))),C.createElement("div",{className:"flex flex-col gap-1.5"},C.createElement("span",{className:_t},"To"),C.createElement("div",{className:"flex flex-wrap gap-1.5"},qa.map(i=>C.createElement(di,{key:i,token:i,active:e.gradient?.to===i,onClick:()=>n({gradient:{...e.gradient,to:i}})})))),C.createElement("div",{className:"flex flex-col gap-1.5"},C.createElement("span",{className:_t},"Angle \u2014 ",e.gradient?.angle??135,"\xB0"),C.createElement(Mo,{value:[e.gradient?.angle??135],min:0,max:360,step:5,onValueChange:([i])=>n({gradient:{...e.gradient,angle:i}})}))),(r==="image"||r==="pattern")&&C.createElement("div",{className:"flex flex-col gap-2"},C.createElement("div",{className:"flex flex-col gap-1.5"},C.createElement("span",{className:_t},"Image URL"),C.createElement(qt,{size:"sm",value:e.src??"",placeholder:"https://\u2026 or /asset.png",onChange:i=>n({src:i.target.value})})),r==="image"&&C.createElement("div",{className:"flex flex-col gap-1.5"},C.createElement("span",{className:_t},"Fit"),C.createElement(Do,{type:"single",size:"sm",value:e.fit??"cover",onValueChange:i=>i&&n({fit:i}),className:"justify-start gap-0.5"},["cover","contain","fill","none"].map(i=>C.createElement(Ao,{key:i,value:i,className:"px-2 text-[11px] capitalize"},i)))),r==="pattern"&&C.createElement("div",{className:"flex flex-col gap-1.5"},C.createElement("span",{className:_t},"Tile size"),C.createElement(qt,{size:"sm",value:e.tileSize??"",placeholder:"120px",onChange:i=>n({tileSize:i.target.value})}))),r==="video"&&C.createElement("div",{className:"flex flex-col gap-1.5"},C.createElement("span",{className:_t},"Video URL"),C.createElement(qt,{size:"sm",value:e.src??"",placeholder:"https://\u2026.mp4",onChange:i=>n({src:i.target.value})})),r==="shader"&&C.createElement("div",{className:"flex flex-col gap-1.5"},C.createElement("span",{className:_t},"Shader"),C.createElement(li,{value:e.preset,onChange:i=>n({preset:i}),live:"hover",columns:3})),e.type!=="none"&&C.createElement("div",{className:"flex items-center gap-2 border-t border-border/50 pt-2.5"},C.createElement("span",{className:l(_t,"shrink-0")},"Opacity"),C.createElement(Mo,{value:[e.opacity??1],min:0,max:1,step:.05,onValueChange:([i])=>n({opacity:i}),className:"flex-1"}),C.createElement("span",{className:"w-9 shrink-0 text-right text-[11px] tabular-nums text-foreground"},Math.round((e.opacity??1)*100),"%")))}Jc.displayName="FillPicker";function lb({children:e}){let t=useRef(null);return useEffect(()=>{let o=new sb({duration:1.2,easing:n=>Math.min(1,1.001-Math.pow(2,-10*n)),orientation:"vertical",gestureOrientation:"vertical",smoothWheel:true});t.current=o;function r(n){o.raf(n),requestAnimationFrame(r);}return requestAnimationFrame(r),()=>{o.destroy(),t.current=null;}},[]),React.createElement(React.Fragment,null,e)}function ub({className:e}){let t=Fo();if(!t)return null;let{theme:o,themes:r,setThemeId:n,deleteTheme:a}=t;return C.createElement(At,null,C.createElement(It,{asChild:true},C.createElement(Xe,{variant:"ghost",size:"sm",className:l("gap-2",e),"aria-label":"Switch theme"},C.createElement(Palette,{className:"h-4 w-4"}),C.createElement("span",{className:"hidden sm:inline"},o.name))),C.createElement(Ct,{className:"w-80 p-2",align:"end"},C.createElement("div",{className:"flex items-start justify-between gap-2 px-2 py-1.5 mb-1"},C.createElement("div",null,C.createElement("div",{className:"text-xs font-medium text-muted-foreground"},"Theme"),C.createElement("div",{className:"text-xs text-muted-foreground/80"},"Switch the skin applied site-wide.")),C.createElement("button",{type:"button",onClick:()=>Un(o),className:"flex items-center gap-1 rounded-md border border-border px-2 py-1 text-[10px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",title:"Download the active theme as a markdown spec \u2014 paste into a fresh LLM prompt"},C.createElement(Download,{className:"h-3 w-3"}),".md")),C.createElement("div",{className:"flex flex-col gap-0.5"},r.map(i=>{let p=i.id===o.id,s=i.id in Ft,c=i.ramps.primary[500],d=i.ramps.accent[500],m=i.ramps.neutral[500];return C.createElement("div",{key:i.id,className:l("group flex items-start gap-3 rounded-md px-2 py-2 text-left transition-colors","hover:bg-muted",p&&"bg-muted")},C.createElement("button",{type:"button",onClick:()=>n(i.id),className:"flex items-start gap-3 flex-1 min-w-0 text-left"},C.createElement("div",{className:"mt-0.5 flex shrink-0 overflow-hidden rounded-md border border-border"},C.createElement("div",{className:"h-5 w-2.5",style:{background:`oklch(${c})`},"aria-hidden":true}),C.createElement("div",{className:"h-5 w-2.5",style:{background:`oklch(${d})`},"aria-hidden":true}),C.createElement("div",{className:"h-5 w-2.5",style:{background:`oklch(${m})`},"aria-hidden":true})),C.createElement("div",{className:"min-w-0 flex-1"},C.createElement("div",{className:"flex items-center gap-2"},C.createElement("span",{className:"text-sm font-medium truncate text-foreground"},i.name),i.tagline&&C.createElement("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground shrink-0"},i.tagline)),i.description&&C.createElement("div",{className:"text-xs text-muted-foreground line-clamp-2"},i.description))),p&&C.createElement(Check,{className:"mt-2 h-4 w-4 shrink-0 text-primary"}),!s&&!p&&C.createElement("button",{type:"button",onClick:g=>{g.stopPropagation(),a(i.id);},className:"mt-1 opacity-0 group-hover:opacity-100 transition-opacity rounded p-1 hover:bg-destructive/10 hover:text-destructive","aria-label":`Delete theme ${i.name}`},C.createElement(Trash2,{className:"h-3.5 w-3.5"})))}))))}var Qc=[{mode:"superLight",label:"Super light",icon:SunDim,tooltip:"Super light \u2014 airy, low contrast"},{mode:"light",label:"Light",icon:Sun,tooltip:"Light"},{mode:"dark",label:"Dark",icon:Moon,tooltip:"Dark"},{mode:"superDark",label:"Super dark",icon:MoonStar,tooltip:"Super dark \u2014 OLED, high contrast"}];function vb({className:e,variant:t="icons"}){let o=Fo();if(!o)return null;let{mode:r,setMode:n}=o;return t==="labeled"?C.createElement("div",{role:"radiogroup","aria-label":"Brightness mode",className:l("inline-flex flex-wrap gap-1 rounded-md border border-border bg-background p-1",e)},Qc.map(({mode:a,label:i,icon:p})=>{let s=r===a;return C.createElement("button",{key:a,type:"button",role:"radio","aria-checked":s,onClick:()=>n(a),className:l("flex items-center gap-2 rounded px-3 py-1.5 text-sm transition-colors",s?"bg-primary text-primary-foreground":"hover:bg-accent hover:text-accent-foreground")},C.createElement(p,{className:"h-4 w-4"}),C.createElement("span",null,i))})):C.createElement("div",{role:"radiogroup","aria-label":"Brightness mode",className:l("inline-flex items-center gap-0.5 rounded-md border border-border bg-background p-0.5",e)},Qc.map(({mode:a,icon:i,tooltip:p})=>{let s=r===a;return C.createElement("button",{key:a,type:"button",role:"radio","aria-checked":s,"aria-label":p,title:p,onClick:()=>n(a),className:l("flex h-7 w-7 items-center justify-center rounded transition-colors",s?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground")},C.createElement(i,{className:"h-3.5 w-3.5"}))}))}function wb(){let{isDark:e,setMode:t}=Xn();return React.createElement(Xe,{variant:"ghost",size:"sm",onClick:()=>t(e?"light":"dark"),className:"gap-2","aria-label":e?"Switch to light mode":"Switch to dark mode"},e?React.createElement(React.Fragment,null,React.createElement(Sun,{className:"h-4 w-4"}),React.createElement("span",{className:"hidden sm:inline"},"Light")):React.createElement(React.Fragment,null,React.createElement(Moon,{className:"h-4 w-4"}),React.createElement("span",{className:"hidden sm:inline"},"Dark")))}
580
+ export{gc as ALL_MODES,Ap as Accordion,Ls as AccordionContent,Ms as AccordionItem,Es as AccordionTrigger,Gs as AppShell,Us as AppShellAside,Ks as AppShellFooter,js as AppShellHeader,$s as AppShellMain,Ws as AppShellNav,Ys as Avatar,Xs as AvatarFallback,Zs as AvatarImage,Ia as BUILT_IN_INPUTS,Zc as BackgroundFill,ea as Badge,tl as Banner,ua as BlinkingCursor,Hd as Breadcrumb,Vd as BreadcrumbEllipsis,zd as BreadcrumbItem,Bd as BreadcrumbLink,Fd as BreadcrumbList,Gd as BreadcrumbMenuTrigger,_d as BreadcrumbPage,Od as BreadcrumbSeparator,Xe as Button,on as COMPONENT_CONTRACTS,oa as Calendar,rl as CalendarDayButton,As as Callout,Hs as CalloutDescription,Is as CalloutTitle,al as Card,ll as CardContent,sl as CardDescription,dl as CardFooter,nl as CardHeader,il as CardTitle,Jp as Carousel,sn as CarouselArrows,nn as CarouselDots,xr as CarouselNext,yr as CarouselPrev,ra as CarouselSlide,an as CarouselVideoSlide,cl as Checkbox,ul as CheckboxCard,Rl as Code,Pl as Composer,Ru as ComposerReply,qo as DEMO_SPEED_PRESETS,Tu as DatePicker,Pu as DateRangePicker,yl as DemoStage,Mu as Dialog,Lu as DialogClose,El as DialogContent,Il as DialogDescription,Dl as DialogFooter,Ll as DialogHeader,pn as DialogOverlay,Ml as DialogPortal,Al as DialogTitle,Eu as DialogTrigger,Hu as DropdownMenu,Ol as DropdownMenuCheckboxItem,Bl as DropdownMenuContent,zu as DropdownMenuGroup,_l as DropdownMenuItem,Gl as DropdownMenuLabel,Bu as DropdownMenuPortal,Ou as DropdownMenuRadioGroup,Vl as DropdownMenuRadioItem,jl as DropdownMenuSeparator,Wl as DropdownMenuShortcut,_u as DropdownMenuSub,zl as DropdownMenuSubContent,Fl as DropdownMenuSubTrigger,Fu as DropdownMenuTrigger,qa as FILL_TOKENS,Vc as FRAGMENT_HEADER,tm as Field,na as FieldDescription,aa as FieldLabel,ia as FieldTrailing,Jc as FillPicker,td as Flex,vf as GRADE_PRE_HYDRATION_SCRIPT,vb as GradeModeSwitcher,yf as GradeThemeProvider,ub as GradeThemeSwitcher,Ql as Grid,qt as Input,Po as Label,lb as LenisProvider,sh as Logo,Sr as MOTION_ATTR,Qn as Map,ei as MapMarker,zt as MediaSurface,Ja as MediaSurfaceContract,Rm as Message,Kl as MultiSelect,At as Popover,Su as PopoverAnchor,Ct as PopoverContent,It as PopoverTrigger,$l as Progress,ml as RadioCard,ql as RadioGroup,Yl as RadioGroupItem,og as ResizableHandle,tg as ResizablePanel,eg as ResizablePanelGroup,xl as Reveal,Dc as RivePlayer,Xl as Row,bh as ScreenAnimator,od as ScrollArea,yn as ScrollBar,xn as Select,ka as SelectContent,pg as SelectGroup,Ca as SelectItem,id as SelectLabel,Sn as SelectScrollDownButton,Rn as SelectScrollUpButton,sd as SelectSeparator,Sa as SelectTrigger,wn as SelectValue,Er as Separator,rr as ShaderCompileError,jh as ShaderControls,li as ShaderPresetPicker,Ka as ShaderPresetPreview,hg as Sheet,vg as SheetClose,dd as SheetContent,ud as SheetDescription,pd as SheetFooter,cd as SheetHeader,kn as SheetOverlay,ld as SheetPortal,md as SheetTitle,bg as SheetTrigger,po as Sidebar,Hn as SidebarContent,Fn as SidebarFooter,In as SidebarHeader,Bn as SidebarItem,zn as SidebarSection,_n as SidebarTreeItem,xg as Skeleton,Mo as Slider,Dg as Sortable,Tn as SortableGroup,Nn as SortableHandle,Pn as SortableItem,kd as Stack,Na as Switch,gl as SwitchCard,Td as Table,Nd as TableBody,Ad as TableCaption,Dd as TableCell,Md as TableFooter,Ld as TableHead,Pd as TableHeader,Ed as TableRow,Og as Tabs,Kd as TabsContent,Ud as TabsList,$d as TabsTrigger,qd as Textarea,wb as ThemeToggle,nr as ThreeScene,Zd as Toggle,Do as ToggleGroup,Ao as ToggleGroupItem,Qd as Toolbar,ec as ToolbarSlot,Eo as Tooltip,co as TooltipContent,En as TooltipProvider,Lo as TooltipTrigger,Lc as VideoPlayer,_s as appShellAsideVariants,Vs as appShellFooterVariants,zs as appShellHeaderVariants,Os as appShellMainVariants,Bs as appShellNavVariants,Ha as applyThemeToRoot,Qs as badgeVariants,el as bannerVariants,ar as buildFragmentShaderScene,Ft as builtInThemes,vr as buttonVariants,Ds as calloutVariants,_r as calmInput,l as cn,Ga as defaultPostPreset,tr as defaultThemeId,qn as deleteUserTheme,fe as demoSleep,pa as demoTypeText,bf as duplicateTheme,Vn as energyInput,ed as flexVariants,Io as generateTheme,Np as getComponentContract,Ho as getTheme,Jl as gridVariants,Mp as listContractedComponents,$n as listThemes,mc as listUserThemes,Kn as loadUserThemeInput,Wr as postPresets,Zl as rowVariants,za as saveUserTheme,Vr as sceneRegistry,sm as setMotion,jr as shaderPresetById,Gr as shaderPresets,Fs as shellVariants,Sd as stackVariants,jn as themeToCSSVars,Yd as toggleVariants,Qp as useCarouselApi,Xn as useGradeTheme,Fo as useMaybeGradeTheme,kr as usePageActive,ao as usePrefersReducedMotion,Zo as useReducedMotion,no as useScriptedDemo};//# sourceMappingURL=index.mjs.map
547
581
  //# sourceMappingURL=index.mjs.map