@texturehq/edges 1.0.0 → 1.0.1

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.cjs CHANGED
@@ -1,7 +1,70 @@
1
- 'use strict';var Ee=require('react'),reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),react=require('@phosphor-icons/react'),jsxRuntime=require('react/jsx-runtime'),reactStately=require('react-stately');require('luxon');var lucideReact=require('lucide-react'),ed=require('react-ace');require('ace-builds/src-noconflict/mode-json'),require('ace-builds/src-noconflict/mode-javascript'),require('ace-builds/src-noconflict/mode-typescript'),require('ace-builds/src-noconflict/mode-html'),require('ace-builds/src-noconflict/mode-css'),require('ace-builds/src-noconflict/mode-markdown'),require('ace-builds/src-noconflict/mode-yaml'),require('ace-builds/src-noconflict/mode-xml'),require('ace-builds/src-noconflict/mode-python'),require('ace-builds/src-noconflict/mode-sql'),require('ace-builds/src-noconflict/theme-github_dark'),require('ace-builds/src-noconflict/theme-github'),require('ace-builds/src-noconflict/ext-language_tools');var curve=require('@visx/curve'),shape=require('@visx/shape'),framerMotion=require('framer-motion'),axis=require('@visx/axis'),scale=require('@visx/scale'),d3Array=require('d3-array'),responsive=require('@visx/responsive'),fileSaver=require('file-saver'),Dd=require('papaparse'),sm=require('react-map-gl');require('mapbox-gl/dist/mapbox-gl.css');var reactDom=require('react-dom'),cp=require('@tiptap/extension-link'),react$1=require('@tiptap/react'),menus=require('@tiptap/react/menus'),pp=require('@tiptap/starter-kit');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ee__default=/*#__PURE__*/_interopDefault(Ee);var ed__default=/*#__PURE__*/_interopDefault(ed);var Dd__default=/*#__PURE__*/_interopDefault(Dd);var sm__default=/*#__PURE__*/_interopDefault(sm);var cp__default=/*#__PURE__*/_interopDefault(cp);var pp__default=/*#__PURE__*/_interopDefault(pp);var Rn=Object.defineProperty;var Ln=(e,r,t)=>r in e?Rn(e,r,{enumerable:true,configurable:true,writable:true,value:t}):e[r]=t;var yr=(e,r,t)=>Ln(e,typeof r!="symbol"?r+"":r,t);function It(e,r=300){let[t,o]=Ee.useState(e);return Ee.useEffect(()=>{let a=setTimeout(()=>o(e),r);return ()=>clearTimeout(a)},[e,r]),t}var qs=()=>jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),Zs=()=>jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),vo={AppWindow:react.AppWindow,ArrowCircleUp:react.ArrowCircleUp,ArrowDown:react.ArrowDown,ArrowLeft:react.ArrowLeft,ArrowLineLeft:react.ArrowLineLeft,ArrowRight:react.ArrowRight,ArrowSquareOut:react.ArrowSquareOut,ArrowUp:react.ArrowUp,ArrowsClockwise:react.ArrowsClockwise,BatteryCharging:react.BatteryCharging,BatteryEmpty:react.BatteryEmpty,BatteryFull:react.BatteryFull,BatteryHigh:react.BatteryHigh,BatteryLow:react.BatteryLow,BatteryMedium:react.BatteryMedium,BatteryWarning:react.BatteryWarning,BookOpen:react.BookOpen,BookmarkSimple:react.BookmarkSimple,BracketsCurly:react.BracketsCurly,Broadcast:react.Broadcast,Buildings:react.Buildings,CalendarBlank:react.CalendarBlank,CaretDown:react.CaretDown,CaretLeft:react.CaretLeft,CaretRight:react.CaretRight,CaretUp:react.CaretUp,CarSimple:react.CarSimple,ChargingStation:react.ChargingStation,ChartBar:react.ChartBar,ChartLine:react.ChartLine,ChartLineUp:react.ChartLineUp,Check:react.Check,CheckCircle:react.CheckCircle,CheckSquare:react.CheckSquare,Circle:react.Circle,CircleDashed:react.CircleDashed,CircleNotch:react.CircleNotch,ClipboardText:react.ClipboardText,ClockCountdown:react.ClockCountdown,Cloud:react.Cloud,CloudArrowDown:react.CloudArrowDown,CloudFog:react.CloudFog,CloudLightning:react.CloudLightning,CloudRain:react.CloudRain,CloudSnow:react.CloudSnow,CloudSun:react.CloudSun,Code:react.Code,Columns:react.Columns,Copy:react.Copy,Cursor:react.Cursor,Database:react.Database,DotsSix:react.DotsSix,DotsThree:react.DotsThree,DownloadSimple:react.DownloadSimple,EnvelopeSimple:react.EnvelopeSimple,Eye:react.Eye,EyeClosed:react.EyeClosed,EyeSlash:react.EyeSlash,Export:react.Export,FireSimple:react.FireSimple,Flag:react.Flag,Gauge:react.Gauge,GearSix:react.GearSix,GitBranch:react.GitBranch,HandPointing:react.HandPointing,Handshake:react.Handshake,Info:react.Info,IntersectSquare:react.IntersectSquare,Lightning:react.Lightning,LightningSlash:react.LightningSlash,List:react.List,ListBullets:react.ListBullets,ListNumbers:react.ListNumbers,Lock:react.Lock,MagnifyingGlass:react.MagnifyingGlass,MapPin:react.MapPin,MapPinArea:react.MapPinArea,MaskHappy:react.MaskHappy,Moon:react.Moon,PaperPlaneRight:react.PaperPlaneRight,PaperPlaneTilt:react.PaperPlaneTilt,PaperclipHorizontal:react.PaperclipHorizontal,PencilSimple:react.PencilSimple,Plugs:react.Plugs,PlugsConnected:react.PlugsConnected,Plus:react.Plus,Power:react.Power,Pulse:react.Pulse,Question:react.Question,Repeat:react.Repeat,Rocket:react.Rocket,ShareNetwork:react.ShareNetwork,ShieldCheck:react.ShieldCheck,SignOut:react.SignOut,SlackLogo:react.SlackLogo,Sliders:react.Sliders,SlidersHorizontal:react.SlidersHorizontal,Snowflake:react.Snowflake,SolarPanel:react.SolarPanel,Square:react.Square,SquaresFour:react.SquaresFour,Stack:react.Stack,Sun:react.Sun,Terminal:react.Terminal,ThermometerCold:react.ThermometerCold,ThermometerHot:react.ThermometerHot,ThermometerSimple:react.ThermometerSimple,Trash:react.Trash,TreeEvergreen:react.TreeEvergreen,User:react.User,UserCircle:react.UserCircle,UserPlus:react.UserPlus,Users:react.Users,UsersFour:react.UsersFour,Warning:react.Warning,WarningCircle:react.WarningCircle,WebhooksLogo:react.WebhooksLogo,Wind:react.Wind,X:react.X,TextureMenuLight:qs,TextureMenuDark:Zs,WaveSine:react.WaveSine},h=Ee.memo(({name:e,size:r=24,color:t,weight:o="regular",className:a,title:n,ariaLabel:i,grow:l,variant:s="default",rounded:d=false,bgColor:m,...c})=>{if(!e)return null;let u=vo[e];if(!u)return process.env.NODE_ENV==="development"&&console.error(`Icon with name "${e}" does not exist.`),null;let f=e==="TextureMenuLight"||e==="TextureMenuDark",g=i||n||`${e} icon`,p=s==="container"?"bg-[#F3F4F6":s==="brand"?"bg-gray-light":"",x=tailwindMerge.twMerge("inline-flex items-center justify-center w-12 h-12 p-3 rounded-xl bg-brand-light",m,d?"rounded-md":"",l?"w-full h-full":"",a),y=["inline-flex items-center justify-center",m||p,d?"rounded-md":"",l?"w-full h-full":`w-[${r}px] h-[${r}px]`].filter(Boolean).join(" "),P=jsxRuntime.jsx(u,{size:l?void 0:r,color:s==="brand"&&!f?void 0:t,className:s==="brand"&&!f?"text-brand-dark w-6 h-6":a||"",weight:o,"aria-label":g,"data-testid":`${e}-icon`,...c});return s==="brand"?jsxRuntime.jsx("div",{className:x,children:P}):s==="default"?P:jsxRuntime.jsx("div",{className:y,children:P})});h.displayName="Icon";function So({children:e,items:r,className:t,align:o="left",textAlign:a="left",size:n="md",onAction:i}){return jsxRuntime.jsx("div",{className:t,children:jsxRuntime.jsxs(reactAriaComponents.MenuTrigger,{children:[e,jsxRuntime.jsx(reactAriaComponents.Popover,{className:tailwindMerge.twMerge("w-fit min-w-[180px] overflow-auto rounded-md border border-border-default","bg-background-surface p-1 shadow-lg","entering:animate-in entering:fade-in entering:zoom-in-95","exiting:animate-out exiting:fade-out exiting:zoom-out-95"),placement:o==="right"?"bottom end":"bottom start",children:jsxRuntime.jsx(reactAriaComponents.Menu,{className:"outline-none",children:r.map(l=>jsxRuntime.jsx(Qs,{id:l.id,onAction:()=>l.onAction?.()||i?.(l),textAlign:a,size:n,iconName:l.iconName,isDisabled:l.disabled,variant:l.variant,"data-testid":l.testId,children:l.name},l.id))})})]})})}function Qs({textAlign:e="left",iconName:r,size:t="md",isDisabled:o,children:a,variant:n="default",...i}){let l={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base"},s={default:"text-text-body hover:bg-background-hover focus:bg-background-hover",destructive:"text-feedback-error-text hover:bg-feedback-error-background focus:bg-feedback-error-background"};return jsxRuntime.jsxs(reactAriaComponents.MenuItem,{...i,isDisabled:o,className:tailwindMerge.twMerge("group box-border flex w-full cursor-pointer items-center rounded-sm outline-none transition-colors",l[t],s[n],e==="right"?"justify-end":"justify-start",o&&"pointer-events-none opacity-50"),children:[r&&e==="left"&&jsxRuntime.jsx(h,{name:r,size:t==="sm"?16:20,className:"mr-2 flex-shrink-0"}),jsxRuntime.jsx("span",{className:"flex-1",children:a}),r&&e==="right"&&jsxRuntime.jsx(h,{name:r,size:t==="sm"?16:20,className:"ml-2 flex-shrink-0"})]})}var $t={prefix:String(Math.round(Math.random()*1e10)),current:0},wo=Ee__default.default.createContext($t),tl=Ee__default.default.createContext(false);var rl=!!(typeof window<"u"&&window.document&&window.document.createElement),vr=new WeakMap;function ol(e=false){let r=Ee.useContext(wo),t=Ee.useRef(null);if(t.current===null&&!e){var o,a;let n=(a=Ee__default.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||a===void 0||(o=a.ReactCurrentOwner)===null||o===void 0?void 0:o.current;if(n){let i=vr.get(n);i==null?vr.set(n,{id:r.current,state:n.memoizedState}):n.memoizedState!==i.state&&(r.current=i.id,vr.delete(n));}t.current=++r.current;}return t.current}function al(e){let r=Ee.useContext(wo);r===$t&&!rl&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let t=ol(!!e),o=r===$t&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${r.prefix}`;return e||`${o}-${t}`}function nl(e){let r=Ee__default.default.useId(),[t]=Ee.useState(At()),o=t||process.env.NODE_ENV==="test"?"react-aria":`react-aria${$t.prefix}`;return e||`${o}-${r}`}typeof Ee__default.default.useId=="function"?nl:al;function sl(){return false}function ll(){return true}function cl(e){return ()=>{}}function At(){return typeof Ee__default.default.useSyncExternalStore=="function"?Ee__default.default.useSyncExternalStore(cl,sl,ll):Ee.useContext(tl)}var dl=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),ul=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Po(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),o=typeof t.getTextInfo=="function"?t.getTextInfo():t.textInfo;if(o)return o.direction==="rtl";if(t.script)return dl.has(t.script)}let r=e.split("-")[0];return ul.has(r)}var fl=Symbol.for("react-aria.i18n.locale");function To(){let e=typeof window<"u"&&window[fl]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e]);}catch{e="en-US";}return {locale:e,direction:Po(e)?"rtl":"ltr"}}var Sr=To(),bt=new Set;function ko(){Sr=To();for(let e of bt)e(Sr);}function Ro(){let e=At(),[r,t]=Ee.useState(Sr);return Ee.useEffect(()=>(bt.size===0&&window.addEventListener("languagechange",ko),bt.add(t),()=>{bt.delete(t),bt.size===0&&window.removeEventListener("languagechange",ko);}),[]),e?{locale:"en-US",direction:"ltr"}:r}var xl=Ee__default.default.createContext(null);function Nr(){let e=Ro();return Ee.useContext(xl)||e}var wr=new Map;function Pr(e){let{locale:r}=Nr(),t=r+(e?Object.entries(e).sort((a,n)=>a[0]<n[0]?-1:1).join():"");if(wr.has(t))return wr.get(t);let o=new Intl.Collator(r,e);return wr.set(t,o),o}function Vt(e){let r=Pr({usage:"search",...e}),t=Ee.useCallback((n,i)=>i.length===0?true:(n=n.normalize("NFC"),i=i.normalize("NFC"),r.compare(n.slice(0,i.length),i)===0),[r]),o=Ee.useCallback((n,i)=>i.length===0?true:(n=n.normalize("NFC"),i=i.normalize("NFC"),r.compare(n.slice(-i.length),i)===0),[r]),a=Ee.useCallback((n,i)=>{if(i.length===0)return true;n=n.normalize("NFC"),i=i.normalize("NFC");let l=0,s=i.length;for(;l+s<=n.length;l++){let d=n.slice(l,l+s);if(r.compare(i,d)===0)return true}return false},[r]);return Ee.useMemo(()=>({startsWith:t,endsWith:o,contains:a}),[t,o,a])}function ee(e=false){return `${e?"outline outline-1 outline-border-input focus:outline-2 focus:outline-border-focus focus:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-border-focus focus-visible:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}function W(e,r){return reactAriaComponents.composeRenderProps(e,t=>tailwindMerge.twMerge(r,t))}var H={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",gap:"gap-[var(--control-gap-xl)]"}};function ke(){let[e,r]=Ee__default.default.useState(false),t=Ee__default.default.useCallback((a,n)=>{r(true),n?.(a);},[]),o=Ee__default.default.useCallback((a,n)=>{r(false),n?.(a);},[]);return {isFocused:e,handleFocus:t,handleBlur:o}}function Te({children:e,className:r}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative w-full",r),children:e})}function Lo({onClick:e,size:r="md",className:t}){return jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.preventDefault(),o.stopPropagation(),e();},className:tailwindMerge.twMerge("absolute right-2 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body",t),"aria-label":"Clear input",onMouseDown:o=>{o.preventDefault(),o.stopPropagation();},children:jsxRuntime.jsx(h,{name:"X",size:r==="sm"?16:20})})}function Xe(e){let{isInvalid:r,isDisabled:t,isFocused:o}=e,a="border rounded-[var(--control-border-radius)] ";return t?`${a} border-border-muted focus:outline-none`:r&&o?`${a} border-feedback-error-border outline-[1.5px] outline-[var(--control-focus-ring-color-error)]`:r?`${a} border-feedback-error-border`:o?`${a} !outline-[1.5px] !outline-[var(--control-focus-ring-color)] ![--tw-outline-style:solid]`:`${a}`}function zt(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function Ne(e){let{isInvalid:r,isDisabled:t,isFocused:o,transparent:a,size:n="md",className:i}=e;return tailwindMerge.twMerge("w-full",Xe({isInvalid:r,isDisabled:t,isFocused:o}),zt({transparent:a,isDisabled:t}),H[n].text,H[n].height,H[n].padding,i)}function xt(e){let{size:r="md",isFocusWithin:t,isInvalid:o,isDisabled:a,transparent:n,className:i}=e;return tailwindMerge.twMerge("group flex items-center rounded-sm overflow-hidden",zt({transparent:n,isDisabled:a}),H[r].height,Xe({isFocused:t,isInvalid:o,isDisabled:a}),i)}function Z({children:e,size:r="md",tooltip:t,isRequired:o,className:a,htmlFor:n}){return jsxRuntime.jsxs("label",{htmlFor:n,className:tailwindMerge.twMerge(H[r].text,"!text-text-caption flex items-center gap-1",a),children:[e,o&&jsxRuntime.jsx("span",{children:"*"}),t&&jsxRuntime.jsx("span",{className:"text-text-muted",children:jsxRuntime.jsx(h,{name:"Info",size:r==="sm"?16:20})})]})}function j({size:e="md",className:r,children:t,...o}){return jsxRuntime.jsx("div",{...o,className:tailwindMerge.twMerge("leading-[2.25] text-text-muted",H[e].text,r),children:t})}function _({children:e,size:r="md",className:t}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge(H[r].text,"text-feedback-error-text",t),children:e})}function Bo({size:e="md",isInvalid:r,isDisabled:t,isFocused:o,transparent:a,className:n,...i}){return jsxRuntime.jsx("input",{className:Ne({isInvalid:r,isDisabled:t,isFocused:o,transparent:a,size:e,className:n}),...i})}function Ht(e){let{children:r,...t}=e;return jsxRuntime.jsx("div",{...t,className:xt(e),children:typeof r=="function"?r(e):r})}var wl={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"},Pl={sm:"text-controlElementSm",md:"text-controlElementMd",lg:"text-controlElementLg",xl:"text-controlElementXl"};function $e({size:e="md",className:r,...t}){return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{...t,className:tailwindMerge.twMerge("flex cursor-default items-center gap-2 rounded-sm px-3 text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium",wl[e],Pl[e],r)})}function Fl({isEntering:e,isExiting:r,className:t=""}){let o=["bg-white","dark:bg-zinc-900/70","dark:backdrop-blur-2xl","dark:backdrop-saturate-200","forced-colors:bg-[Canvas]","shadow-md","rounded-md","overflow-hidden","bg-clip-padding","border","border-gray-100","dark:border-white/5","dark:text-zinc-300"].join(" "),a=e?["animate-in","fade-in","placement-bottom:slide-in-from-top-1","placement-top:slide-in-from-bottom-1","placement-left:slide-in-from-right-1","placement-right:slide-in-from-left-1","ease-out","duration-200"].join(" "):"",n=r?["animate-out","fade-out","placement-bottom:slide-out-to-top-1","placement-top:slide-out-to-bottom-1","placement-left:slide-out-to-right-1","placement-right:slide-out-to-left-1","ease-in","duration-150"].join(" "):"";return [o,a,n,t].filter(Boolean).join(" ")}function Ae({children:e,showArrow:r,className:t,...o}){let n=reactAriaComponents.useSlottedContext(reactAriaComponents.PopoverContext)?.trigger==="SubmenuTrigger",i=r?12:8;return i=n?i-6:i,jsxRuntime.jsxs(reactAriaComponents.Popover,{offset:i,...o,className:reactAriaComponents.composeRenderProps(t,(l,s)=>Fl({...s,className:l})),children:[r&&jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{className:"group",children:jsxRuntime.jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"block fill-white stroke-black/10 stroke-1 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 dark:fill-[#1f1f21] dark:stroke-zinc-600 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L6 6 L12 0"})})}),e]})}var Gl={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},Wl={sm:"pl-7",md:"pl-9",lg:"pl-10",xl:"pl-12"},Mo={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"};function _l(){let e=Ee__default.default.useContext(reactAriaComponents.ComboBoxStateContext);return jsxRuntime.jsx(reactAriaComponents.Button,{slot:null,className:"clear-button","aria-label":"Clear",onPress:()=>e?.setSelectedKey(null),children:"\u2715"})}var Mr=(e,r,t)=>{if(e==null||e==="")return "";let a=(t?t.flatMap(n=>n.items):r||[]).find(n=>n.id===e);return a?a.name:""};async function Ul(e,r,t){try{let o=e.url.replace("{q}",r),a=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([s,d])=>{a.append(s,d.toString());});let n=`${o}${a.toString()?"?"+a.toString():""}`,i=await fetch(n,{method:"GET",headers:e.headers,signal:t});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let l=await i.json();return {items:e.transformResponse(l)}}catch(o){console.error("Error in REST request:",o);let a=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:a}}}async function ql(e,r,t){try{let o=e.graphqlQuery.replace(`$${e.variableKey||"filter"}`,`"${r}"`),a=await fetch(e.url,{method:"POST",headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify({query:o}),signal:t});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);let n=await a.json();if(n.errors)throw new Error(n.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(n=e.responsePath.split(".").reduce((i,l)=>i?.[l],n)),{items:e.transformResponse(n)}}catch(o){console.error("Error in GraphQL request:",o);let a=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:a}}}function Ot({label:e,staticItems:r=[],sections:t,selectedKey:o,defaultSelectedKey:a,onSelectionChange:n,requestConfig:i,defaultFilter:l,placeholder:s,errorMessage:d,description:m,size:c="md",tooltip:u,isRequired:f,isDisabled:g,isInvalid:p,validationResult:x,showErrors:y=true,renderItem:N,renderLeftIcon:T,renderSection:E,autoFocus:P=false}){let v=Ee__default.default.useRef(null),[M,C]=Ee__default.default.useState(),[L,F]=Ee.useState(()=>Mr(o||a,r,t)),[V,b]=Ee.useState(false),D=It(L),{contains:Q}=Vt({sensitivity:"base"}),[U,ie]=Ee.useState(),ce=H[c].text,Pe=H[c].height,k=null;Ee.useEffect(()=>{P&&b(true);},[P]),Ee.useEffect(()=>{let w=()=>{v.current&&C(v.current.offsetWidth);};return w(),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]),Ee.useEffect(()=>{k&&k.setFilterText(D);},[D,k]),i&&(k=reactStately.useAsyncList({async load({signal:w,filterText:S=""}){if(!i.url||i.shouldLoad&&!i.shouldLoad(S))return {items:[]};try{let R;return i.requestType==="GraphQL"?R=await ql(i,S,w):R=await Ul(i,S,w),ie(R.error),{items:R.items}}catch(R){return console.error("Error loading items:",R),ie(R instanceof Error?R.message:"Unknown error occurred"),{items:[]}}},initialFilterText:""})),D===""&&(k=null);let I=w=>{let S=Mr(w,r,t);F(S),n&&n(w);},G=w=>{F(w);let S=Mr(o,r,t);o!=null&&w!==S&&n&&n(null);};return jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:I,selectedKey:o||void 0,defaultSelectedKey:a||void 0,defaultItems:t?t.flatMap(w=>w.items):r,items:k?k.items:void 0,className:W("group flex flex-col","w-full"),menuTrigger:"focus",isDisabled:g,isInvalid:p||!!d,inputValue:L,onInputChange:G,autoFocus:P,defaultFilter:l||Q,"aria-label":e||s||"Autocomplete",children:w=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Z,{size:c,tooltip:u,isRequired:f,children:e}),jsxRuntime.jsxs(reactAriaComponents.Group,{ref:v,className:xt({size:c,isInvalid:p||!!d,isDisabled:g,isFocusWithin:V||w.isOpen,className:"w-full cursor-pointer"}),"aria-label":e||s||"Autocomplete",style:{position:"relative"},children:[T?jsxRuntime.jsx("div",{className:"absolute left-3",children:T(!!k?.isLoading)}):jsxRuntime.jsx(h,{name:"MagnifyingGlass",className:`${Gl[c]} absolute left-3 text-inherit`}),jsxRuntime.jsx(reactAriaComponents.Input,{className:`flex-1 min-w-0 border-none pr-3 outline-0 placeholder:text-text-placeholder ${Wl[c]} ${ce} ${Pe} ${g?"bg-background-muted":"bg-background-input"}`,placeholder:s,disabled:g,onFocus:()=>b(true),onBlur:()=>b(false)}),L&&!g&&jsxRuntime.jsx(_l,{}),jsxRuntime.jsx(reactAriaComponents.Button,{className:`px-2 text-text-body ${ce} ${Pe} ${g?"bg-background-muted":"bg-background-input"}`,"aria-label":"Toggle menu",isDisabled:g,children:({isPressed:S})=>jsxRuntime.jsx(h,{name:S?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),m&&jsxRuntime.jsx(j,{size:c,children:m}),y&&U&&jsxRuntime.jsx(_,{size:c,className:"text-feedback-error-text",children:U}),y&&typeof d=="string"&&jsxRuntime.jsx(_,{size:c,className:"text-feedback-error-text",children:d}),y&&typeof d=="function"&&x&&jsxRuntime.jsx(_,{size:c,className:"text-feedback-error-text",children:d(x)}),jsxRuntime.jsx(Ae,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5",style:{minWidth:M?`${M}px`:void 0},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{className:`max-h-[300px] overflow-auto bg-background-input outline-none ${ce}`,children:t?t.map(S=>{let R=S.items.map(B=>jsxRuntime.jsx($e,{id:B.id,textValue:B.name,size:c,className:`flex cursor-default items-center gap-2 rounded-sm px-3 ${Mo[c]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:N?N(B):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[B.name,jsxRuntime.jsx(h,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},B.id));return E?E(S,R):jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-muted",children:S.name}),R]},S.name)}):S=>jsxRuntime.jsx($e,{id:S.id,textValue:S.name,size:c,className:`flex cursor-default items-center gap-2 rounded-sm px-3 ${Mo[c]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:N?N(S):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[S.name,jsxRuntime.jsx(h,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},S.id)})})]})})}function Eo({src:e,alt:r,firstName:t,lastName:o,fullName:a,onClick:n,size:i="md",shape:l="circle",variant:s="user",className:d,status:m,bordered:c=false}){let[u,f]=Ee.useState(false),g={xs:"h-6 w-6 text-xs",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-16 w-16 text-xl"},p={xs:"h-1.5 w-1.5",sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3",xl:"h-4 w-4"},x={xs:"bottom-0 right-0",sm:"bottom-0 right-0",md:"bottom-0 right-0",lg:"bottom-0.5 right-0.5",xl:"bottom-1 right-1"},y={online:"bg-feedback-success-background border-feedback-success-border",offline:"bg-text-muted border-border-muted",away:"bg-feedback-warning-background border-feedback-warning-border",busy:"bg-feedback-error-background border-feedback-error-border"},N={user:"bg-action-primary/10 text-action-primary",team:"bg-feedback-info-background text-feedback-info-text",organization:"bg-feedback-success-background text-feedback-success-text"},T=l==="circle"?"rounded-full":"rounded-md",E=tailwindMerge.twMerge("relative inline-flex items-center justify-center overflow-hidden transition-opacity",g[i],T,n&&"cursor-pointer hover:opacity-80",c&&"ring-2 ring-background-surface",d),v=(()=>{if(t||o){let L=t?.[0]||"",F=o?.[0]||"";return (L+F).toUpperCase()}if(a){let L=a.split(" "),F=L[0]?.[0]||"",V=L[L.length-1]?.[0]||"";return F===V?F.toUpperCase():(F+V).toUpperCase()}return ""})(),M=()=>{let L={xs:14,sm:16,md:20,lg:24,xl:32}[i];switch(s){case "team":return jsxRuntime.jsx(lucideReact.Users,{size:L});case "organization":return jsxRuntime.jsx(lucideReact.Building2,{size:L});default:return jsxRuntime.jsx(lucideReact.User,{size:L})}},C=()=>e&&!u?jsxRuntime.jsx("img",{src:e,alt:r||a||"Avatar",className:"h-full w-full object-cover",onError:()=>f(true)}):v?jsxRuntime.jsx("span",{className:"font-semibold",children:v}):M();return jsxRuntime.jsxs("div",{className:"relative inline-block",children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(E,!e||u?N[s]:""),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,children:C()}),m&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("absolute border-2 border-background-surface",T,p[i],x[i],y[m]),"aria-label":`Status: ${m}`})]})}var Ql={default:"bg-feedback-info-background text-feedback-info-text",success:"bg-feedback-success-background text-feedback-success-text",error:"bg-feedback-error-background text-feedback-error-text",warning:"bg-feedback-warning-background text-feedback-warning-text",info:"bg-feedback-info-background text-feedback-info-text",primary:"bg-action-primary/10 text-action-primary",secondary:"bg-action-secondary/10 text-action-secondary",neutral:"bg-background-muted text-text-muted"},Jl={sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-3.5 py-2.5 text-base"},ec={pill:"rounded-full",rounded:"rounded-lg",square:"rounded-sm"},tc={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};function Gt({children:e,variant:r="default",size:t="sm",shape:o="square",dot:a=false,dotPosition:n="left",className:i}){let l=a&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("rounded-full bg-current opacity-75",tc[t]),"aria-hidden":"true"});return jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge("inline-flex items-center gap-1.5 font-medium",Jl[t],ec[o],Ql[r],i),children:[a&&n==="left"&&l,e,a&&n==="right"&&l]})}var Er=({href:e,children:r,className:t="",external:o=false,title:a,variant:n="default",onClick:i,asButton:l=false,onPress:s,showArrow:d=false})=>{let m=o?{target:"_blank",rel:"noopener noreferrer"}:{},f=`hover:underline hover:decoration-1 hover:underline-offset-4 cursor-pointer ${{default:"text-text-link-default hover:text-text-link-hover visited:text-text-link-default",primary:"text-action-primary hover:text-action-primary-hover visited:text-action-primary",muted:"text-text-muted hover:text-text-muted visited:text-text-muted"}[n]} ${t}`,g=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r,d&&jsxRuntime.jsxs("span",{children:["\xA0","\u2192"]})]});return l?jsxRuntime.jsx("button",{type:"button",className:f,onClick:s,title:a,children:g}):jsxRuntime.jsx("a",{href:e||"#",className:f,...m,title:a,onClick:i,children:g})};function Vo(e){return jsxRuntime.jsx(reactAriaComponents.Breadcrumbs,{...e,className:tailwindMerge.twMerge("flex gap-1",e.className)})}function zo(e){let{className:r,children:t,href:o,...a}=e;return jsxRuntime.jsx(reactAriaComponents.Breadcrumb,{className:W(r,"flex items-center gap-1"),...a,children:n=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Er,{variant:"muted",href:o,children:typeof t=="function"?t(n):t}),o&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3 w-3 text-text-muted"})]})})}var pc="flex font-medium justify-center items-center gap-2 text-center transition rounded-sm whitespace-nowrap box-border",fc={default:"bg-neutral-black text-neutral-white hover:brightness-90 forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",primary:"bg-action-primary text-neutral-white hover:brightness-90 forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",secondary:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-action-destructive border-2 border-border-muted hover:bg-action-destructive/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-2 flex-shrink-0",unstyled:"bg-transparent"},Ho={full:"w-full",default:"w-fit"},gc="opacity-control-hover cursor-not-allowed pointer-events-none grayscale",bc="opacity-100 cursor-pointer",xc={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},hc={primary:"bg-action-primary text-white",destructive:"bg-action-destructive text-white"};function yc(e){let{variant:r="default",size:t="md",isDisabled:o,fullWidth:a=false,isLoading:n=false}=e,i=r==="unstyled"?"":`${pc} ${fc[r]}`;return r!=="unstyled"&&(i+=` ${H[t].text} ${H[t].height} ${H[t].padding} ${H[t].gap}`),o||n?i+=` ${gc}`:i+=` ${bc}`,a?i+=` ${Ho.full}`:i+=` ${Ho.default}`,`${i} ${ee()}`}function $(e){let{icon:r,children:t,isLoading:o=false,loadingText:a,loadingIndicator:n,size:i="md",iconPosition:l="left",iconWeight:s,href:d,className:m,badgeNumber:c,badgeVariant:u="primary",badgePosition:f="top-right",style:g,...p}=e,x=r?jsxRuntime.jsx(h,{name:r,className:`icon-[--control-icon-size-${i}]`,weight:s}):null,y=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&x,typeof t=="function"?null:t,l==="right"&&x]}),N=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n||jsxRuntime.jsx(h,{name:"CircleNotch",className:`animate-spin icon-[--control-icon-size-${i}]`,"aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:y}),a&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:a})]}),T=[yc(e),m,o?"aria-busy":""].filter(Boolean).join(" "),E=d?jsxRuntime.jsx(reactAriaComponents.Link,{href:d,...p,style:g,className:T,children:o?N:typeof t=="function"?function(P){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&x,t(P),l==="right"&&x]})}:y}):jsxRuntime.jsx(reactAriaComponents.Button,{...p,style:g,className:T,children:o?N:typeof t=="function"?function(P){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&x,t(P),l==="right"&&x]})}:y});return c&&c>0?jsxRuntime.jsxs("div",{className:"relative",children:[E,jsxRuntime.jsx("span",{className:`absolute ${xc[f]} flex h-5 w-5 items-center justify-center rounded-full ${hc[u]} text-xs`,"aria-label":`${c} items`,children:c})]}):E}function Lc({isSelected:e,isDisabled:r}){let t=[ee,"w-9 h-9 text-base cursor-default rounded-full flex items-center justify-center forced-color-adjust-none"];return r?t.push("text-gray-300 dark:text-zinc-600 forced-colors:text-[GrayText]"):e?t.push("bg-blue-600 invalid:bg-red-600 text-white forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):t.push("text-zinc-900 dark:text-zinc-200 hover:bg-gray-100 dark:hover:bg-zinc-700 pressed:bg-gray-200 dark:pressed:bg-zinc-600"),t.join(" ")}function _t({errorMessage:e,...r}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...r,children:[jsxRuntime.jsx(Ut,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{children:[jsxRuntime.jsx(qt,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:t=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:t,className:({isSelected:o,isDisabled:a})=>Lc({isSelected:o,isDisabled:a})})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-red-600",children:e})]})}function Ut(){let{direction:e}=reactAriaComponents.useLocale(),r=18;return jsxRuntime.jsxs("header",{className:"flex w-full items-center gap-1 px-1 pb-4",children:[jsxRuntime.jsx($,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(h,{name:"CaretRight","aria-hidden":true,size:r}):jsxRuntime.jsx(h,{name:"CaretLeft","aria-hidden":true,size:r})}),jsxRuntime.jsx(reactAriaComponents.Heading,{className:"text-md mx-2 flex-1 text-center font-semibold text-zinc-900 dark:text-zinc-200"}),jsxRuntime.jsx($,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(h,{name:"CaretLeft","aria-hidden":true,size:r}):jsxRuntime.jsx(h,{name:"CaretRight","aria-hidden":true,size:r})})]})}function qt(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-caption",children:e})})}var Mc={xs:"text-lg font-semibold",sm:"text-xl font-semibold",md:"text-2xl font-semibold",lg:"text-3xl font-semibold",xl:"text-4xl font-semibold"},Fc={page:"h-16 leading-[62px]"};function Ye({tag:e="h1",size:r="lg",height:t,className:o="",children:a}){let n=Mc[r],i=t?Fc[t]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(n,i,o),children:a})}var K=({width:e,height:r,variant:t="rect",animation:o="pulse",gradient:a=false,flex:n=false,stack:i,responsive:l,delay:s=0,adjustAnimationSpeedBasedOnWidth:d=false,ariaLabel:m,className:c,"data-testid":u})=>{let[f,g]=Ee.useState(s===0);if(Ee.useEffect(()=>{if(s>0){let P=setTimeout(()=>g(true),s);return ()=>clearTimeout(P)}},[s]),!f)return null;let p=a?"bg-gradient-to-r from-[var(--skeleton-base)] via-[var(--skeleton-highlight)] to-[var(--skeleton-base)]":"bg-[var(--skeleton-base)]",x=d&&e?(()=>{let P=typeof e=="number"?e:parseFloat(String(e));return isNaN(P)?"":`animation-duration-[${Math.max(.8,P/100)}s]`})():"",y=o==="pulse"?`animate-pulse ${x}`:o==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--skeleton-wave)] before:to-transparent before:animate-wave ${x}`:"",N="rounded-sm";t==="circle"&&(N="rounded-full"),t==="text"&&(N="h-4 w-full rounded-sm");let T=n?"flex-1 min-w-0":"",E=l?Object.entries(l).map(([P,v])=>`${P}:w-[${v}]`).join(" "):"";return i?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":u,children:i.map((P,v)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(p,y,N,T,E,c),style:{width:P,height:r}},v))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(p,y,N,T,E,c),style:{width:e,height:r},role:"presentation","aria-hidden":!m,"aria-label":m??void 0,"data-testid":u})};var Zt=({heading:e,upperRightText:r,withPadding:t=true,isGhost:o=false,children:a,className:n="",isLoading:i})=>{let m=`w-full rounded md:border-x border-y bg-background-surface ${t?"p-6":""} ${o?"md:border-x-0 border-y-0 shadow-none p-0":"shadow-sm"} ${n}`.trim();return jsxRuntime.jsx("div",{className:m,"data-testid":"card",children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx("div",{className:"mb-4 h-[28px] min-h-[28px]",children:i?jsxRuntime.jsx(K,{width:100,height:16,"data-testid":"skeleton"}):jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:typeof e=="string"?jsxRuntime.jsx(Ye,{size:"xs",children:e}):e}),r&&jsxRuntime.jsx("span",{className:"text-sm text-textFaint",children:r})]})}),a]})})};function Oc({isDisabled:e}){return `flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-caption"}`}function Gc({isSelected:e,isInvalid:r,isDisabled:t,isIndeterminate:o}){let a="w-5 h-5 flex-shrink-0 rounded flex items-center justify-center border-2 transition ring-offset-2 focus:ring-2 focus:ring-border-focus",n="";return t?n="border-border-muted bg-background-muted":r?n="border-feedback-error-border bg-feedback-error-background":e||o?n="bg-action-primary border-action-primary hover:bg-action-primary-hover hover:border-action-primary-hover":n="bg-background-input border-border-input hover:border-border-focus",`${a} ${n}`}var Wo="w-4 h-4 text-text-onPrimary group-disabled:text-text-disabled";function Vr(e){let{children:r,...t}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...t,className:reactAriaComponents.composeRenderProps(e.className,(o,a)=>`${Oc(a)} ${o||""}`),children:o=>{let{isSelected:a,isIndeterminate:n,...i}=o,l=jsxRuntime.jsx("div",{className:Gc({isSelected:a,isIndeterminate:n,...i}),children:n?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:Wo}):a?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:Wo}):null});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l,typeof r=="function"?r(o):r]})}})}var qc={default:"bg-background-muted text-text-body border border-border-muted hover:bg-background-hover",primary:"bg-action-primary/10 text-action-primary border border-action-primary/20 hover:bg-action-primary/15",secondary:"bg-background-input text-text-body border border-border-input hover:bg-background-hover"},Zc={sm:"px-2 py-1 gap-1",md:"px-3 py-1.5 gap-1.5",lg:"px-3 py-2 gap-2",xl:"px-4 py-2.5 gap-2"},Kc="opacity-75 cursor-not-allowed pointer-events-none";function _o(e){let{variant:r,size:t,isDisabled:o,isClickable:a,className:n}=e;return tailwindMerge.twMerge("inline-flex items-center justify-center rounded-full font-medium transition-colors","whitespace-nowrap select-none",Zc[t],H[t].text,qc[r],a&&!o&&"cursor-pointer",o&&Kc,n)}function jt({children:e,onRemove:r,size:t="md",variant:o="default",isRemovable:a=true,isDisabled:n=false,className:i,onClick:l}){let s=!!l&&!n,d=a&&r&&!n,m=f=>{f.stopPropagation(),f.preventDefault(),r&&!n&&r();},c=()=>{l&&!n&&l();},u=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"truncate",children:e}),d&&jsxRuntime.jsx("button",{type:"button",onClick:m,className:"flex-shrink-0 rounded-full p-0.5 hover:bg-black/10 transition-colors cursor-pointer","aria-label":"Remove",tabIndex:-1,children:jsxRuntime.jsx(h,{name:"X",size:t==="sm"?12:t==="md"?14:16,className:"text-current opacity-70 hover:opacity-100"})})]});return s?jsxRuntime.jsx("button",{type:"button",onClick:c,className:_o({variant:o,size:t,isDisabled:n,isClickable:s,className:i}),disabled:n,children:u}):jsxRuntime.jsx("span",{className:_o({variant:o,size:t,isDisabled:n,isClickable:s,className:i}),children:u})}function qo({value:e,readOnly:r=false,onChange:t,language:o="json",theme:a="github_dark",height:n,width:i="100%",className:l,lineHeight:s=19,minLines:d=3,maxLines:m=50,showLineNumbers:c=true,showGutter:u=true,fontSize:f=14,wrapEnabled:g=false}){let p=Ee.useRef(null),x=Ee.useMemo(()=>{if(n)return n;let y=(e.match(/\n/g)||[]).length+1;return `${Math.max(d,Math.min(y,m))*s+10}px`},[e,n,s,d,m]);return Ee.useEffect(()=>{p.current?.editor&&p.current.editor.resize();},[x]),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden rounded-md border border-border-input",l),style:{width:i,height:x},children:jsxRuntime.jsx(ed__default.default,{ref:p,mode:o,theme:a,value:e,onChange:t,readOnly:r,width:"100%",height:"100%",fontSize:f,showPrintMargin:false,showGutter:u,highlightActiveLine:!r,setOptions:{useWorker:true,showLineNumbers:c,tabSize:2,enableBasicAutocompletion:!r,enableLiveAutocompletion:!r,enableSnippets:!r,showFoldWidgets:true,wrap:g},editorProps:{$blockScrolling:true}})})}var id=({isEntering:e,isExiting:r,className:t})=>["max-w-[200px] group bg-slate-700 dark:bg-slate-600 border border-slate-800 dark:border-white/10 shadow-[inset_0_1px_0_0_theme(colors.gray.600)] dark:shadow-none text-white text-sm rounded-lg drop-shadow-lg will-change-transform px-3 py-1",e?"animate-in fade-in placement-bottom:slide-in-from-top-0.5 placement-top:slide-in-from-bottom-0.5 placement-left:slide-in-from-right-0.5 placement-right:slide-in-from-left-0.5 ease-out duration-200":"",r?"animate-out fade-out placement-bottom:slide-out-to-top-0.5 placement-top:slide-out-to-bottom-0.5 placement-left:slide-out-to-right-0.5 placement-right:slide-out-to-left-0.5 ease-in duration-150":"",t].filter(Boolean).join(" ");function Hr({children:e,content:r,...t}){return jsxRuntime.jsxs(reactAriaComponents.TooltipTrigger,{delay:200,children:[e,jsxRuntime.jsxs(reactAriaComponents.Tooltip,{...t,offset:10,className:reactAriaComponents.composeRenderProps(t.className,(o,a)=>id({...a,className:o})),children:[jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-slate-700 stroke-gray-800 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 dark:fill-slate-600 dark:stroke-white/10 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),r]})]})}function cd({value:e,children:r,className:t,size:o="sm"}){let[a,n]=Ee.useState(false),s=jsxRuntime.jsx($,{variant:"icon",size:o,onPress:()=>{let d=e||(typeof r=="string"?r:"");navigator.clipboard.writeText(d),n(true),setTimeout(()=>{n(false);},2e3);},className:"!px-2",children:jsxRuntime.jsx(h,{name:"Copy",size:o==="sm"?14:16})});return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1",t),children:[r,a?jsxRuntime.jsx(Hr,{content:"Copied!",children:s}):s]})}var Ko={duration:.5,ease:"easeInOut"},Xt=Ee.createContext(null),ze=()=>{let e=Ee.useContext(Xt);if(!e)throw new Error("useChartContext must be used within a ChartContextProvider");return e};var Je=({data:e,color:r="#6b7280"})=>{let t=Ee.useId(),o=Ee.useId(),{xScale:a,yScale:n,animationSettings:i}=ze(),l=a.range(),s=n.range();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:t,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsxRuntime.jsx("stop",{offset:"50%",stopColor:r,stopOpacity:.1}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:r,stopOpacity:0})]}),jsxRuntime.jsx("clipPath",{id:o,children:jsxRuntime.jsx("rect",{x:l[0],y:s[1],width:l[1]-l[0],height:s[0]-s[1]})})]}),jsxRuntime.jsx("g",{clipPath:`url(#${o})`,children:jsxRuntime.jsxs(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:i.duration,ease:i.ease},style:{transformOrigin:`0 ${s[0]}px`,transformBox:"fill-box",isolation:"isolate"},children:[jsxRuntime.jsx(shape.AreaClosed,{data:e,x:d=>a(d.xValue),y:d=>n(d.yValue),yScale:n,fill:`url(#${t})`,curve:curve.curveLinear}),jsxRuntime.jsx(shape.LinePath,{data:e,x:d=>a(d.xValue),y:d=>n(d.yValue),stroke:r,strokeWidth:3,curve:curve.curveLinear})]})})]})};var tt=({data:e,color:r="#6b7280",opacity:t=1,categoryColors:o={}})=>{let{xScale:a,yScale:n,animationSettings:i}=ze(),l=Ee.useId(),s=a.range(),d=n.range(),m=[...e].sort((f,g)=>f.xValue.getTime()-g.xValue.getTime()),c=m.length>1?m[1].xValue.getTime()-m[0].xValue.getTime():15*6e4,u=Math.abs(a(new Date(m[0].xValue.getTime()+c))-a(m[0].xValue));return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:l,children:jsxRuntime.jsx("rect",{x:s[0],y:d[1],width:s[1]-s[0],height:d[0]-d[1]})})}),jsxRuntime.jsx("g",{clipPath:`url(#${l})`,children:jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:i.duration,ease:i.ease},style:{transformOrigin:`0 ${d[0]}px`,transformBox:"fill-box",isolation:"isolate"},children:m.map((f,g)=>{let p=a(f.xValue),x=n(f.yValue),y=d[0]-x,N=m[g+1],T=N?Math.abs(a(N.xValue)-p):u,E=f.category&&o[f.category]?o[f.category]:r;return jsxRuntime.jsx(shape.Bar,{x:p-T/2,y:x,width:T,height:y,fill:E,opacity:t,rx:1},f.xValue.getTime())})})})]})};var X={top:20,right:20,bottom:50,left:60};function rt(e,r="$"){let t=(o,a)=>o==null?"-":a(o);switch(e){case "number":return {format:o=>t(o,a=>a.toLocaleString()),tickFormat:o=>t(o,a=>a.toLocaleString())};case "percent":return {format:o=>t(o,a=>`${a.toFixed(1)}%`),tickFormat:o=>t(o,a=>`${a.toFixed(0)}%`),min:0,max:100,tickInterval:20};case "kWh":return {format:o=>t(o,a=>`${(a/1e3).toFixed(1)} kWh`),tickFormat:o=>t(o,a=>`${(a/1e3).toFixed(1)}`)};case "kW":return {format:o=>t(o,a=>`${(a/1e3).toFixed(1)} kW`),tickFormat:o=>t(o,a=>`${(a/1e3).toFixed(1)}`)};case "amperes":return {format:o=>t(o,a=>`${a.toFixed(1)} A`),tickFormat:o=>t(o,a=>`${a.toFixed(1)} A`)};case "temperature":return {format:o=>t(o,a=>`${a.toFixed(1)}\xB0`),tickFormat:o=>t(o,a=>`${a.toFixed(0)}\xB0`)};case "percentageChange":return {format:o=>t(o,a=>`${a>0?"+":""}${(a*100).toFixed(1)}%`),tickFormat:o=>t(o,a=>`${a>0?"+":""}${(a*100).toFixed(0)}%`),min:-100,max:100};case "decimal":return {format:o=>t(o,a=>a.toFixed(2)),tickFormat:o=>t(o,a=>a.toFixed(1))};case "currency":return {format:o=>t(o,a=>`${r}${a.toLocaleString()}`),tickFormat:o=>t(o,a=>`${r}${a.toLocaleString()}`)};case "scientific":return {format:o=>t(o,a=>a.toExponential(2)),tickFormat:o=>t(o,a=>a.toExponential(1))};case "integer":return {format:o=>t(o,a=>Math.round(a).toLocaleString()),tickFormat:o=>t(o,a=>Math.round(a).toLocaleString())};case "logarithmic":return {format:o=>t(o,a=>a.toExponential(1)),tickFormat:o=>t(o,a=>a.toExponential(0)),min:1,tickInterval:10};case "timeDuration":return {format:o=>t(o,a=>`${Math.floor(a/60)}:${(a%60).toString().padStart(2,"0")} min`),tickFormat:o=>t(o,a=>`${Math.floor(a/60)}m`),min:0};case "compact":return {format:o=>t(o,a=>new Intl.NumberFormat("en",{notation:"compact"}).format(a)),tickFormat:o=>t(o,a=>new Intl.NumberFormat("en",{notation:"compact"}).format(a))};case "si":return {format:o=>t(o,a=>new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:2}).format(a)),tickFormat:o=>t(o,a=>new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(a))};case "bytes":return {format:o=>t(o,a=>{let n=["B","KB","MB","GB","TB"],i=0,l=a;for(;l>=1024&&i<n.length-1;)l/=1024,i++;return `${l.toFixed(1)} ${n[i]}`}),tickFormat:o=>t(o,a=>{let n=["B","KB","MB","GB","TB"],i=0,l=a;for(;l>=1024&&i<n.length-1;)l/=1024,i++;return `${l.toFixed(0)} ${n[i]}`}),min:0};case "rate":return {format:o=>t(o,a=>`${a.toFixed(1)} req/sec`),tickFormat:o=>t(o,a=>`${a.toFixed(0)}/s`)};case "ordinal":return {format:o=>t(o,a=>{let n=["th","st","nd","rd"],i=a%100;return a+(n[(i-20)%10]||n[i]||n[0])}),tickFormat:o=>t(o,a=>a.toString()),min:1};case "date":return {format:o=>t(o,a=>new Intl.DateTimeFormat("en",{dateStyle:"medium"}).format(new Date(a))),tickFormat:o=>t(o,a=>new Intl.DateTimeFormat("en",{dateStyle:"short"}).format(new Date(a))),min:0};case "largeCurrency":return {format:o=>t(o,a=>`${r}${(a/1e6).toFixed(2)}M`),tickFormat:o=>t(o,a=>`${r}${(a/1e6).toFixed(0)}M`)};case "coordinates":return {format:o=>t(o,a=>`${Math.abs(a).toFixed(3)}\xB0 ${a>=0?"N":"S"}`),tickFormat:o=>t(o,a=>`${Math.abs(a).toFixed(1)}\xB0 ${a>=0?"N":"S"}`),min:-90,max:90};case "ranked":return {format:o=>t(o,a=>`Rank: ${a}`),tickFormat:o=>t(o,a=>a.toString()),min:1};default:return {format:o=>t(o,a=>a.toLocaleString()),tickFormat:o=>t(o,a=>a.toLocaleString())}}}var Gr=(e,r)=>{let t=d3Array.extent(e,o=>o.xValue);return scale.scaleTime({range:[X.left,r-X.right],domain:t,nice:true})},Wr=(e,r,t)=>{let o=rt(t),a=d3Array.min(e,s=>s.yValue)||0,n=d3Array.max(e,s=>s.yValue)||0,i=o.min!==void 0?o.min:a>=0?0:a*1.1,l=o.max!==void 0?o.max:n<=0?0:n*1.1;return scale.scaleLinear({range:[r-X.bottom,X.top],domain:[i,l],nice:true})};var Td=({top:e,scale:r,width:t})=>jsxRuntime.jsx(axis.Axis,{orientation:"bottom",top:e,scale:r,numTicks:Math.min(6,Math.floor(t/100)),tickFormat:o=>{let a=o;return new Intl.DateTimeFormat("en",{month:"short",day:"numeric"}).format(a)},stroke:"#e5e7eb",tickStroke:"#e5e7eb",tickLabelProps:()=>({fill:"#6b7280",fontSize:12,textAnchor:"middle"})}),Rd=({left:e,scale:r,yFormatType:t})=>{let o=rt(t);return jsxRuntime.jsx(axis.Axis,{orientation:"left",left:e,scale:r,numTicks:5,tickFormat:a=>(o.tickFormat||o.format)(a),stroke:"#e5e7eb",tickStroke:"#e5e7eb",tickLabelProps:()=>({fill:"#6b7280",fontSize:12,textAnchor:"end",dy:"0.33em"})})},Ct={Bottom:Td,Left:Rd};var Fd=({items:e})=>e.length===0?null:jsxRuntime.jsx("div",{className:"flex items-center gap-4",children:e.map(r=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-3 w-3 rounded-sm",style:{backgroundColor:r.fill}}),jsxRuntime.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:r.category})]},r.category))}),Qt=({items:e,onExport:r})=>{let[t,o]=Ee__default.default.useState(false),[a,n]=Ee__default.default.useState(null),i=Ee__default.default.useCallback(async l=>{let s=l;o(true),n(s);try{await r(s);}catch(d){console.error("Export failed:",d);}finally{o(false),n(null);}},[r]);return jsxRuntime.jsxs("div",{className:"mt-4 flex items-center justify-between overflow-y-hidden",children:[jsxRuntime.jsx(Fd,{items:e}),jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsxs($,{variant:"secondary",size:"sm",isDisabled:t,children:[jsxRuntime.jsx(h,{name:"Export",size:16}),t?"Exporting...":"Export"]}),jsxRuntime.jsx(reactAriaComponents.Popover,{placement:"top end",className:"min-w-48 p-1 bg-white dark:bg-gray-800 rounded-lg shadow-xl ring-1 ring-gray-200 dark:ring-gray-700",children:jsxRuntime.jsxs(reactAriaComponents.Menu,{onAction:i,className:"outline-none",children:[jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"csv",className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 rounded cursor-pointer outline-none",isDisabled:t,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(h,{name:"List",size:14}),a==="csv"?"Exporting...":"Export as CSV"]})}),jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"svg",className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 rounded cursor-pointer outline-none",isDisabled:t,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(h,{name:"Code",size:14}),a==="svg"?"Exporting...":"Export as SVG"]})}),jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"png",className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 rounded cursor-pointer outline-none",isDisabled:t,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(h,{name:"DownloadSimple",size:14}),a==="png"?"Exporting...":"Export as PNG"]})})]})})]})]})};function Zr(e,r,t=true){let o=e||"chart";if(t){let a=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return `${o}-${a}.${r}`}return `${o}.${r}`}async function Kr(e,r,t={},o){let a=Array.isArray(r[0])?r:[r];try{switch(e){case "csv":await Ed(a,t);break;case "svg":await Id(o,t);break;case "png":await $d(o,t);break;default:throw new Error(`Unsupported export type: ${e}`)}}catch(n){throw console.error("Export failed:",n),new Error(`Failed to export chart as ${e}: ${n instanceof Error?n.message:"Unknown error"}`)}}async function Ed(e,r){try{let t=new Map;e.forEach(s=>{s.forEach(d=>{let m=d.xValue.getTime();t.has(m)||t.set(m,d.xValue);});});let a=Array.from(t.values()).sort((s,d)=>s.getTime()-d.getTime()).map(s=>{let d={[r.xLabel||"Date"]:s.toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})};return e.forEach((m,c)=>{let u=r.seriesLabels?.[c]||`Series ${c+1}`,f=m.find(g=>g.xValue.getTime()===s.getTime());d[u]=f?f.yValue:"",f?.category&&(d[`${u} Category`]=f.category);}),d}),n=Dd__default.default.unparse(a,{header:!0,skipEmptyLines:!0}),i=new Blob([n],{type:"text/csv;charset=utf-8;"}),l=Zr(r.filename||"chart-data","csv",r.timestamp!==!1);fileSaver.saveAs(i,l);}catch(t){throw new Error(`CSV export failed: ${t instanceof Error?t.message:"Unknown error"}`)}}async function Id(e,r){if(!e.current)throw new Error("SVG element not found");try{let o=e.current.cloneNode(!0);if(!o.querySelector("rect[data-background]")){let d=document.createElementNS("http://www.w3.org/2000/svg","rect");d.setAttribute("width",o.getAttribute("width")||"100%"),d.setAttribute("height",o.getAttribute("height")||"100%"),d.setAttribute("fill","white"),d.setAttribute("data-background","true"),o.insertBefore(d,o.firstChild);}let i=new XMLSerializer().serializeToString(o);i.includes("<?xml")||(i=`<?xml version="1.0" encoding="UTF-8"?>
2
- `+i),i.includes("xmlns=")||(i=i.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));let l=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),s=Zr(r.filename||"chart","svg",r.timestamp!==!1);fileSaver.saveAs(l,s);}catch(t){throw new Error(`SVG export failed: ${t instanceof Error?t.message:"Unknown error"}`)}}async function $d(e,r,t=2){if(!e.current)throw new Error("SVG element not found");let o="";try{let a=e.current,n=a.getBoundingClientRect(),i=a.cloneNode(!0);i.setAttribute("width",String(n.width)),i.setAttribute("height",String(n.height)),i.removeAttribute("transform");let l=i.getElementsByTagName("text");Array.from(l).forEach(u=>{u.style.fontFamily||(u.style.fontFamily="system-ui, -apple-system, sans-serif"),u.style.fontSize||(u.style.fontSize="12px");});let s=document.createElementNS("http://www.w3.org/2000/svg","rect");s.setAttribute("width",String(n.width)),s.setAttribute("height",String(n.height)),s.setAttribute("fill","white"),i.insertBefore(s,i.firstChild);let m=new XMLSerializer().serializeToString(i);m.includes("xmlns=")||(m=m.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));let c=new Blob([m],{type:"image/svg+xml;charset=utf-8"});return o=URL.createObjectURL(c),new Promise((u,f)=>{let g=new Image,p=setTimeout(()=>{o&&URL.revokeObjectURL(o),f(new Error("Image loading timeout"));},1e4);g.onload=()=>{clearTimeout(p);try{let x=document.createElement("canvas");x.width=n.width*t,x.height=n.height*t;let y=x.getContext("2d");if(!y)throw new Error("Canvas context not available");y.imageSmoothingEnabled=!0,y.imageSmoothingQuality="high",y.scale(t,t),y.fillStyle="white",y.fillRect(0,0,n.width,n.height),y.drawImage(g,0,0,n.width,n.height),x.toBlob(N=>{if(N){let T=Zr(r.filename||"chart","png",r.timestamp!==!1);fileSaver.saveAs(N,T),u();}else f(new Error("Failed to create PNG blob"));o&&URL.revokeObjectURL(o);},"image/png",1);}catch(x){o&&URL.revokeObjectURL(o),f(x);}},g.onerror=()=>{clearTimeout(p),o&&URL.revokeObjectURL(o),f(new Error("Failed to load SVG as image"));},g.src=o;})}catch(a){throw o&&URL.revokeObjectURL(o),new Error(`PNG export failed: ${a instanceof Error?a.message:"Unknown error"}`)}}function Ad(e){if(typeof window>"u")return false;switch(e){case "csv":return true;case "svg":return typeof XMLSerializer<"u";case "png":return typeof HTMLCanvasElement<"u"&&typeof HTMLCanvasElement.prototype.toBlob=="function";default:return false}}function Vd(e){return {csv:"CSV Spreadsheet",svg:"SVG Vector Image",png:"PNG Image"}[e]||"Unknown Format"}var St=new Map,Nt=(e,r="#000000")=>{if(typeof window>"u")return r;let t=e.startsWith("var(")?e.slice(4,-1):e.startsWith("--")?e:`--${e}`;if(St.has(t))return St.get(t);try{let o=document.documentElement,n=getComputedStyle(o).getPropertyValue(t).trim();if(n)return St.set(t,n),n;let i=document.createElement("div");i.style.color=`var(${t})`,document.body.appendChild(i);let l=getComputedStyle(i).color;return document.body.removeChild(i),l&&l!=="rgb(0, 0, 0)"?(St.set(t,l),l):r}catch(o){return console.warn(`Failed to resolve color for ${e}:`,o),r}},zd=()=>{St.clear();},Jt=()=>{let e=[];for(let r=1;r<=10;r++){let t=Nt(`--data-categorical-${r}`);t&&e.push(t);}return e.length===0?Jo():e},Jo=()=>["#444ae1","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#f97316","#14b8a6","#6366f1"],jr=()=>Nt("--data-default","#444ae1"),Hd=(e,r)=>{let t={},o=Jt();return e.forEach((a,n)=>{r&&r[a]?t[a]=r[a]:t[a]=o[n%o.length];}),t},ea=e=>{let r=e.match(/\d+/g);if(!r||r.length<3)return true;let[t,o,a]=r.map(Number);return (.299*t+.587*o+.114*a)/255>.5},Od=e=>ea(e)?Nt("--text-body","#333333"):Nt("--neutral-white","#ffffff");var er=({data:e,formatType:r})=>{if(!e)return null;let t=rt(r),o=Ee__default.default.useRef(null),[a,n]=Ee__default.default.useState({x:0,y:0,translate:"translate(-50%, -100%)"});Ee__default.default.useEffect(()=>{if(!o.current)return;let s=o.current.getBoundingClientRect(),d=window.innerHeight,m=e.x,c=e.y,u=e.position==="left"?"translate(calc(-100% - 16px), -50%)":"translate(16px, -50%)";c-s.height/2<0?c=s.height/2:c+s.height/2>d&&(c=d-s.height/2),n({x:m,y:c,translate:u});},[e.x,e.y,e.position]);let i=l=>new Intl.DateTimeFormat("en",{month:"short",day:"numeric",year:"numeric"}).format(l);return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsxs(framerMotion.motion.div,{ref:o,role:"tooltip","aria-live":"polite",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},"data-testid":"tooltip",className:"pointer-events-none absolute z-50 rounded-lg bg-white p-4 text-sm shadow-xl ring-1 ring-gray-200 dark:bg-gray-800 dark:ring-gray-700",style:{left:a.x,top:a.y,transform:a.translate},children:[jsxRuntime.jsx("time",{className:"mb-1 font-medium text-gray-900 dark:text-gray-100",children:i(e.xValue)}),jsxRuntime.jsx("ul",{className:"list-none p-0",children:e.series.map(l=>jsxRuntime.jsxs("li",{className:"flex items-center gap-2 py-0.5",children:[jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:l.color}}),jsxRuntime.jsxs("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:[l.label,":"]}),jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:t.format(l.value)})]},l.label))})]})})};var ot=({data:e,color:r="#6b7280",strokeWidth:t=3,strokeDasharray:o})=>{let{xScale:a,yScale:n,animationSettings:i}=ze(),l=n.range();return jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:i.duration,ease:i.ease},style:{transformOrigin:`0 ${l[0]}px`,transformBox:"fill-box",isolation:"isolate"},children:jsxRuntime.jsx(shape.LinePath,{data:e,x:s=>a(s.xValue),y:s=>n(s.yValue),stroke:r,strokeWidth:t,strokeDasharray:o,strokeLinecap:"round",curve:curve.curveLinear})})};var Qd=d3Array.bisector(e=>e.xValue).left,Jd=()=>jsxRuntime.jsx("div",{className:"flex h-full items-center justify-center",children:jsxRuntime.jsx("p",{className:"text-gray-500",children:"No data available"})}),eu=()=>jsxRuntime.jsxs("div",{className:"flex h-full flex-col gap-4 p-4",children:[jsxRuntime.jsx(K,{className:"h-full w-full"}),jsxRuntime.jsxs("div",{className:"flex gap-4",children:[jsxRuntime.jsx(K,{className:"h-4 w-24"}),jsxRuntime.jsx(K,{className:"h-4 w-24"})]})]}),tu=({parentWidth:e,parentHeight:r,yFormatType:t="number",isLoading:o=false,children:a})=>{let[n,i]=Ee.useState(null),l=Ee.useRef(null),s=Ee.useRef(0),d=Ee.useMemo(()=>Jt(),[]),m=Ee.useMemo(()=>jr(),[]),{datasets:c,seriesMetadata:u}=Ee.useMemo(()=>{let C=[],L=[],F=0,V=Ee.Children.toArray(a).filter(b=>Ee.isValidElement(b)&&(b.type===Je||b.type===ot||b.type===tt)&&b.props.data).length;return Ee.Children.forEach(a,b=>{if(Ee.isValidElement(b)&&(b.type===Je||b.type===ot||b.type===tt)&&b.props.data){C.push(b.props.data);let D=b.props.color||(V===1?m:d[F%d.length]);L.push({label:b.props.label||`Series ${C.length}`,color:D}),F++;}}),{datasets:C,seriesMetadata:L}},[a]),f=e,g=r-60,p=Ee.useMemo(()=>c.flat(),[c]),x=Ee.useMemo(()=>Gr(p,f),[p,f]),y=Ee.useMemo(()=>Wr(p,g,t),[p,g,t]),N=Ee.useCallback(C=>{let{left:L}=l.current?.getBoundingClientRect()||{left:0},F=C.clientX-L;if(C.timeStamp-(s.current||0)<16)return;s.current=C.timeStamp;let V=x.invert(F),b=c.map((U,ie)=>{if(!U||U.length===0)return null;let ce=Qd(U,V,1);if(ce===0)return {point:U[0],datasetIndex:ie};if(ce>=U.length)return {point:U[U.length-1],datasetIndex:ie};let Pe=U[ce-1],k=U[ce];if(!Pe||!k)return null;let I=Math.abs(Pe.xValue.getTime()-V.getTime()),G=Math.abs(k.xValue.getTime()-V.getTime());return {point:I<G?Pe:k,datasetIndex:ie}}).filter(U=>U!==null&&u[U.datasetIndex]!==void 0).map(({point:U,datasetIndex:ie})=>({label:u[ie].label,value:U.yValue,color:u[ie].color,point:U}));if(b.length===0){i(null);return}let D=x(b[0].point.xValue),Q=D>(f-X.right-X.left)/2+X.left;i({xValue:b[0].point.xValue,series:b.map(({label:U,value:ie,color:ce})=>({label:U,value:ie,color:ce})),x:D,y:y(b[0].value),position:Q?"left":"right"});},[c,u,x,y,f]),T=()=>{i(null);},E={width:f,height:g,xScale:x,yScale:y,yFormatType:t,animationSettings:Ko,tooltip:{data:n,show:i,hide:()=>i(null)}},P=Ee.Children.map(a,(C,L)=>Ee.isValidElement(C)&&(C.type===Je||C.type===ot||C.type===tt)?Ee__default.default.cloneElement(C,{...C.props,color:u[L]?.color}):C),v=u.map(C=>({category:C.label,fill:C.color})),M=Ee.useCallback(async C=>{try{await Kr(C,c,{xLabel:"Date",yLabel:"Value",seriesLabels:u.map(L=>L.label),timestamp:!0},l);}catch(L){console.error("Export failed:",L);}},[c,u]);return o?jsxRuntime.jsx(eu,{}):c.length===0?jsxRuntime.jsx(Jd,{}):jsxRuntime.jsx("div",{className:"relative flex h-full flex-col",children:jsxRuntime.jsxs(Xt.Provider,{value:E,children:[jsxRuntime.jsxs("svg",{width:f,height:g,className:"overflow-visible",ref:l,children:[jsxRuntime.jsx("g",{children:y.ticks(5).map(C=>jsxRuntime.jsx(shape.Line,{from:{x:X.left,y:y(C)},to:{x:f-X.right,y:y(C)},stroke:"#e5e7eb",strokeWidth:1},`grid-line-${C}`))}),P,jsxRuntime.jsx(Ct.Bottom,{top:g-X.bottom,scale:x,width:f-X.left-X.right}),jsxRuntime.jsx(Ct.Left,{left:X.left,scale:y,yFormatType:t}),n?.series.map(C=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:x(n.xValue),cy:y(C.value),r:8,fill:"white",stroke:C.color,strokeWidth:2,style:{transition:"all 100ms ease-out"}}),jsxRuntime.jsx("circle",{cx:x(n.xValue),cy:y(C.value),r:4,fill:C.color,style:{transition:"all 100ms ease-out"}})]},`highlight-${C.label}`)),jsxRuntime.jsx("rect",{x:X.left,y:X.top,width:f-X.left-X.right,height:g-X.top-X.bottom,fill:"transparent",style:{cursor:"crosshair"},onMouseMove:N,onMouseLeave:T})]}),jsxRuntime.jsx(er,{data:n,formatType:t}),jsxRuntime.jsx(Qt,{onExport:M,items:v})]})})},aa=responsive.withParentSize(tu);function eo(e="left"){switch(e){case "center":return "justify-center text-center";case "right":return "justify-end text-right";default:return "justify-start text-left"}}function he(e="normal",r){return tailwindMerge.twMerge({high:"font-semibold text-text-body",normal:"text-text-body",low:"text-text-muted"}[e],r&&"hover:text-action-primary cursor-pointer transition-colors")}function J(e="left",r){return tailwindMerge.twMerge("flex items-center gap-1",eo(e),r)}function rr(e,r="\u2014"){return e==null||e===""?r:String(e)}var Oe={xs:"h-4 w-12",sm:"h-4 w-20",md:"h-4 w-24",lg:"h-4 w-32",xl:"h-4 w-40"};function ye(e="normal"){return {high:Oe.lg,normal:Oe.md,low:Oe.sm}[e]}function le(e,r){return typeof e=="function"?e(r):e}function na(e="neutral",r="sm"){return tailwindMerge.twMerge("inline-flex items-center rounded-full font-medium",r==="sm"?"px-2 py-0.5 text-xs":"px-2.5 py-1 text-sm",{success:"bg-green-100 text-green-800",error:"bg-red-100 text-red-800",warning:"bg-yellow-100 text-yellow-800",info:"bg-blue-100 text-blue-800",neutral:"bg-gray-100 text-gray-800"}[e])}function ia(e){return e?"success":"neutral"}function or(e,r=false){return r?e>0?"text-green-600":e<0?"text-red-600":"text-text-body":"text-text-body"}function sa(e="hover"){switch(e){case "visible":return "text-action-primary underline hover:text-action-primary-hover cursor-pointer";case "hover":return "hover:underline hover:text-action-primary cursor-pointer transition-colors";case "none":return "cursor-pointer";default:return ""}}function Ge(e,r,t,o="hover",a){if(!r)return e;let n=typeof r=="function"&&t?r(t):r,i=sa(o);return jsxRuntime.jsx("a",{href:n,className:tailwindMerge.twMerge(i,a),onClick:l=>{l.metaKey||l.ctrlKey;},children:e})}function la({row:e,context:r,actions:t,align:o="right",size:a="sm"}){let{isLoading:n}=r;if(n)return jsxRuntime.jsx(K,{className:Oe.sm});let i=t.filter(s=>!le(s.hidden,e));if(i.length===0)return null;let l=J(o);return jsxRuntime.jsx("div",{className:l,children:i.map(s=>{let d=le(s.disabled,e);return s.variant==="icon"||!s.label?jsxRuntime.jsx($,{variant:"icon",size:a,onPress:()=>{s.onClick(e);},isDisabled:d,"aria-label":s.label||s.id,children:jsxRuntime.jsx(h,{name:s.icon||"DotsThree",size:a==="sm"?16:20})},s.id):jsxRuntime.jsxs($,{variant:s.variant||"secondary",size:a,onPress:()=>{s.onClick(e);},isDisabled:d,children:[s.icon&&jsxRuntime.jsx(h,{name:s.icon,size:a==="sm"?14:16}),s.label]},s.id)})})}function ca({value:e,context:r,format:t="icon",trueText:o="Yes",falseText:a="No",trueIcon:n="Check",falseIcon:i="X",showFalse:l=true,align:s="center",emphasis:d="normal"}){let{isLoading:m}=r;if(m)return jsxRuntime.jsx(K,{className:ye(d)});let c=!!e;if(!c&&!l)return jsxRuntime.jsx("div",{className:J(s)});let u=J(s);switch(t){case "icon":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx(h,{name:c?n:i,size:16,className:c?"text-green-600":"text-gray-400"})});case "text":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx("span",{className:he(d),children:c?o:a})});case "badge":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx(Gt,{variant:c?"success":"neutral",size:"sm",children:c?o:a})});default:return null}}function da({value:e,row:r,context:t,format:o="date",customFormat:a,emptyText:n="\u2014",align:i="left",emphasis:l="normal",href:s,linkBehavior:d="hover"}){let{isLoading:m}=t;if(m)return jsxRuntime.jsx(K,{className:ye(l)});if(!e)return jsxRuntime.jsx("div",{className:J(i,"text-text-muted"),children:n});let c=e instanceof Date?e:new Date(e);if(isNaN(c.getTime()))return jsxRuntime.jsx("div",{className:J(i,"text-text-muted"),children:n});let u;switch(o){case "date":u=c.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});break;case "time":u=c.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});break;case "datetime":u=c.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});break;case "relative":u=au(c);break;case "custom":u=a?c.toLocaleString("en-US",a):c.toISOString();break;default:u=c.toLocaleDateString();}let f=J(i,he(l)),g=le(s,r);return g?jsxRuntime.jsx("div",{className:f,children:Ge(u,g,r,d)}):jsxRuntime.jsx("div",{className:f,children:u})}function au(e){let t=new Date().getTime()-e.getTime(),o=Math.floor(t/1e3),a=Math.floor(o/60),n=Math.floor(a/60),i=Math.floor(n/24);return o<60?"just now":a<60?`${a} minute${a!==1?"s":""} ago`:n<24?`${n} hour${n!==1?"s":""} ago`:i<7?`${i} day${i!==1?"s":""} ago`:e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function ua({value:e,row:r,context:t,format:o="number",decimals:a=0,prefix:n,suffix:i,emptyText:l="\u2014",align:s="right",emphasis:d="normal",href:m,linkBehavior:c="hover",showPositiveSign:u=false,colorCode:f=false}){let{isLoading:g}=t;if(g)return jsxRuntime.jsx(K,{className:ye(d)});if(e==null||isNaN(Number(e)))return jsxRuntime.jsx("div",{className:J(s,"text-text-muted"),children:l});let p=Number(e),x;switch(o){case "currency":x=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:a,maximumFractionDigits:a}).format(p);break;case "percent":x=new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:a,maximumFractionDigits:a}).format(p/100);break;case "compact":x=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:a>0?1:0,maximumFractionDigits:a}).format(p);break;default:x=new Intl.NumberFormat("en-US",{minimumFractionDigits:a,maximumFractionDigits:a}).format(p);}let N=`${u&&p>0?"+":""}${x}`,T=f?or(p,true):he(d),E=J(s,T),P=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx("span",{className:"text-text-muted",children:n}),jsxRuntime.jsx("span",{children:N}),i&&jsxRuntime.jsx("span",{className:"text-text-muted",children:i})]}),v=le(m,r);return v?jsxRuntime.jsx("div",{className:E,children:Ge(P,v,r,c)}):jsxRuntime.jsx("div",{className:E,children:P})}function ma({row:e,context:r,isSelected:t=false,onSelect:o,isDisabled:a=false,align:n="center"}){let{isLoading:i}=r;if(i)return jsxRuntime.jsx("div",{className:J(n),children:jsxRuntime.jsx(K,{className:"h-4 w-4 rounded"})});let l=le(a,e),s=J(n);return jsxRuntime.jsx("div",{className:s,children:jsxRuntime.jsx(Vr,{isSelected:t,onChange:d=>{o?.(e,d);},isDisabled:l,"aria-label":"Select row"})})}function pa({value:e,row:r,context:t,prefix:o,suffix:a,emptyText:n="\u2014",href:i,linkBehavior:l="visible",emphasis:s="normal",truncate:d=true,align:m="left"}){let{isLoading:c}=t;if(c)return jsxRuntime.jsx(K,{className:ye(s)});let u=rr(e,n),f=le(i,r),g=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx("span",{className:"text-text-muted",children:o}),jsxRuntime.jsx("span",{className:d?"truncate":"",children:u}),a&&jsxRuntime.jsx("span",{className:"text-text-muted",children:a})]}),p=J(m,he(s));return f?jsxRuntime.jsx("div",{className:p,children:Ge(g,f,r,l)}):jsxRuntime.jsx("div",{className:p,children:g})}var cu={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},du={sm:"hidden sm:grid",md:"hidden md:grid",lg:"hidden lg:grid",xl:"hidden xl:grid"};function nr(e,r){return r.accessor?typeof r.accessor=="function"?r.accessor(e):e[r.accessor]:null}function ir(e,r,t,o){if(t.cell){let a=t.cell,n=typeof t.cellProps=="function"?t.cellProps(e,r):t.cellProps;return jsxRuntime.jsx(a,{value:e,row:r,context:o,...n})}return t.render?t.render(e,r,o):e?.toString()??"\u2014"}function lr({row:e,columns:r,density:t,isLoading:o,onClick:a}){let n=r.filter(c=>c.mobile!==false).map(c=>{let u=c.mobile===false?null:c.mobile;return {...c,mobilePriority:u?.priority??2,mobileFormat:u?.format??"secondary",showLabel:u?.label??u?.format==="secondary",icon:u?.icon}}).sort((c,u)=>c.mobilePriority-u.mobilePriority),i=n.filter(c=>c.mobilePriority===1||c.mobileFormat==="primary"),l=n.filter(c=>c.mobilePriority===2&&c.mobileFormat!=="primary"),s=n.filter(c=>c.mobileFormat==="badge"),d={isLoading:!!o,rowIndex:0,columnIndex:0,density:t};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",a&&"cursor-pointer hover:bg-background-hover active:bg-background-pressed",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[t]),onClick:a,role:a?"button":void 0,tabIndex:a?0:void 0,children:[i.length>0&&jsxRuntime.jsxs("div",{className:"mb-2 flex items-start justify-between",children:[jsxRuntime.jsx("div",{className:"flex-1",children:i.map(c=>{let u=nr(e,c);return jsxRuntime.jsx("div",{className:"font-medium text-text-body [&>*]:!justify-start [&>*]:!text-left",children:ir(u,e,c,d)},c.id)})}),s.length>0&&jsxRuntime.jsx("div",{className:"ml-2 flex flex-wrap gap-1",children:s.map(c=>{let u=nr(e,c);return jsxRuntime.jsx("div",{className:"inline-flex",children:ir(u,e,c,d)},c.id)})})]}),l.length>0&&jsxRuntime.jsx("div",{className:"space-y-1",children:l.map(c=>{let u=nr(e,c),f=c.showLabel&&c.label;return jsxRuntime.jsxs("div",{className:"flex items-center text-sm text-text-muted",children:[c.icon&&jsxRuntime.jsx(h,{name:c.icon,className:"mr-1.5 h-4 w-4 flex-shrink-0"}),f&&jsxRuntime.jsxs("span",{className:"mr-1 font-medium",children:[c.label,":"]}),jsxRuntime.jsx("span",{className:"truncate [&>*]:!justify-start [&>*]:!text-left",children:ir(u,e,c,d)})]},c.id)})})]})}function cr({row:e,columns:r,density:t,isLoading:o,onClick:a}){let n=r.filter(s=>s.mobile!==false),i={isLoading:!!o,rowIndex:0,columnIndex:0,density:t};return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",a&&"cursor-pointer hover:bg-background-hover active:bg-background-pressed",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[t]),onClick:a,role:a?"button":void 0,tabIndex:a?0:void 0,children:jsxRuntime.jsx("div",{className:"space-y-2",children:n.map((s,d)=>{let m=nr(e,s),c=d===0;return jsxRuntime.jsxs("div",{children:[!c&&jsxRuntime.jsx("div",{className:"text-xs text-text-muted",children:s.label}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(c?"font-medium text-text-body":"text-sm text-text-body","[&>*]:!justify-start [&>*]:!text-left"),children:ir(m,e,s,i)})]},s.id)})})})}function fa(e="md"){return {mobile:cu[e],desktop:du[e]}}function ga({density:e}){return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[e]),children:[jsxRuntime.jsx("div",{className:"mb-2 h-5 w-3/4 animate-pulse rounded bg-background-muted"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-background-muted"}),jsxRuntime.jsx("div",{className:"h-4 w-2/3 animate-pulse rounded bg-background-muted"})]})]})}var ro={compact:"py-1.5 px-3 text-sm",default:"py-3 px-4 text-sm",relaxed:"py-4 px-4 text-base"},oo={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"},mu={full:"w-full",auto:"w-auto inline-block",contained:"w-full max-w-6xl mx-auto"},pu={auto:"table-auto",fixed:"table-fixed",responsive:"table-auto"};function ao(e){let r={};return e.width!==void 0&&(r.width=typeof e.width=="number"?`${e.width}px`:e.width),e.minWidth!==void 0&&(r.minWidth=typeof e.minWidth=="number"?`${e.minWidth}px`:e.minWidth),e.maxWidth!==void 0&&(r.maxWidth=typeof e.maxWidth=="number"?`${e.maxWidth}px`:e.maxWidth),e.flex!==void 0&&(r.flex=`${e.flex} 1 0`),r}function fu(e,r){return r.accessor?typeof r.accessor=="function"?r.accessor(e):e[r.accessor]:null}function gu({column:e,sortConfig:r,onSort:t,stickyHeader:o,density:a="default"}){let n=r?.columnId===e.id,i=n?r.direction:null;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1 border-b border-border-default bg-background-surface font-medium text-text-muted",ro[a],oo[e.align||"left"],o&&"sticky top-0 z-10",e.sortable&&"cursor-pointer hover:bg-background-hover"),onClick:()=>e.sortable&&t(e.id),role:"columnheader","aria-sort":n?i==="asc"?"ascending":"descending":"none",style:ao(e),children:[jsxRuntime.jsx("span",{className:"truncate",children:e.label}),e.sortable&&jsxRuntime.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsx(h,{name:i==="asc"?"CaretUp":i==="desc"?"CaretDown":"CaretUp",size:12,className:n?"text-text-body":"text-text-muted opacity-50"})})]})}function bu({column:e,row:r,rowIndex:t,columnIndex:o,isHovered:a,density:n="default",className:i}){let l=fu(r,e),s={isLoading:false,isHovered:a,rowIndex:t,columnIndex:o,density:n},d;if(e.cell){let m=e.cell,c=typeof e.cellProps=="function"?e.cellProps(l,r):e.cellProps;d=jsxRuntime.jsx(m,{value:l,row:r,context:s,...c});}else e.render?d=e.render(l,r,s):d=jsxRuntime.jsx("span",{className:"truncate",children:l?.toString()??""});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default",ro[n],oo[e.align||"left"],i),role:"cell",style:ao(e),children:d})}function xu({column:e,rowIndex:r,columnIndex:t,density:o="default"}){let a={isLoading:true,rowIndex:r,columnIndex:t,density:o},n;if(e.cell){let i=e.cell,l=typeof e.cellProps=="function"?e.cellProps(null,{}):e.cellProps;n=jsxRuntime.jsx(i,{value:null,row:{},context:a,...l});}else e.render?n=e.render(null,{},a):n=jsxRuntime.jsx(K,{className:"h-4 w-full max-w-[200px]"});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default",ro[o],oo[e.align||"left"]),role:"cell",style:ao(e),children:n})}function hu({columns:e,row:r,rowIndex:t,density:o="default",onClick:a}){let[n,i]=Ee.useState(false),l=Ee.useCallback(()=>{a&&a(r);},[a,r]);return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("contents group",a&&"cursor-pointer"),role:"row",onClick:l,onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),children:e.map((s,d)=>jsxRuntime.jsx(bu,{column:s,row:r,rowIndex:t,columnIndex:d,isHovered:n,density:o,className:a?"group-hover:bg-background-hover":""},s.id))})}function yu({columns:e,rowIndex:r,density:t="default"}){return jsxRuntime.jsx("div",{className:"contents",role:"row",children:e.map((o,a)=>jsxRuntime.jsx(xu,{column:o,rowIndex:r,columnIndex:a,density:t},o.id))})}function ha({columns:e,data:r,className:t,density:o="default",width:a="full",height:n,maxHeight:i,layout:l="auto",mobileRenderer:s="auto",customMobileRowRender:d,mobileBreakpoint:m="md",isLoading:c=false,loadingRowCount:u=5,stickyHeader:f=false,onRowClick:g,getRowId:p,hideHeader:x=false,onSort:y,"aria-label":N}){let[T,E]=Ee.useState(null),P=Ee.useMemo(()=>e.map(b=>{if(b.width)return typeof b.width=="number"?`${b.width}px`:b.width;if(b.flex)return `${b.flex}fr`;if(b.minWidth&&b.maxWidth){let D=typeof b.minWidth=="number"?`${b.minWidth}px`:b.minWidth,Q=typeof b.maxWidth=="number"?`${b.maxWidth}px`:b.maxWidth;return `minmax(${D}, ${Q})`}return b.minWidth?`minmax(${typeof b.minWidth=="number"?`${b.minWidth}px`:b.minWidth}, 1fr)`:b.maxWidth?`minmax(0, ${typeof b.maxWidth=="number"?`${b.maxWidth}px`:b.maxWidth})`:"1fr"}).join(" "),[e]),v=Ee.useCallback(b=>{if(!e.find(U=>U.id===b)?.sortable)return;let Q=null;T?.columnId===b?T.direction==="asc"?Q={columnId:b,direction:"desc"}:Q=null:Q={columnId:b,direction:"asc"},E(Q),y?.(Q);},[e,T,y]),M={};n&&(M.height=typeof n=="number"?`${n}px`:n,M.overflowY="auto"),i&&(M.maxHeight=typeof i=="number"?`${i}px`:i,M.overflowY="auto");let C=tailwindMerge.twMerge(mu[a],l==="responsive"?"overflow-x-auto":"overflow-auto",t),L=fa(m),F=s!=="none",V=(b,D)=>F?s==="custom"&&d?d(b,D):jsxRuntime.jsx(s==="cards"?cr:lr,{row:b,columns:e,density:o,isLoading:c,onClick:g?()=>g(b):void 0}):null;return jsxRuntime.jsxs("div",{className:C,style:M,children:[jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("grid border-separate border-spacing-0",pu[l],a==="auto"?"inline-grid w-auto":"w-full",F&&L.desktop),role:"table","aria-label":N,style:{gridTemplateColumns:P},children:[!x&&jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:e.map(b=>jsxRuntime.jsx(gu,{column:b,sortConfig:T,onSort:v,stickyHeader:f,density:o},b.id))}),jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:c?Array.from({length:u}).map((b,D)=>jsxRuntime.jsx(yu,{columns:e,rowIndex:D,density:o},`loading-${D}`)):r.length>0?r.map((b,D)=>{let Q=p?p(b):`row-${D}`;return jsxRuntime.jsx(hu,{columns:e,row:b,rowIndex:D,density:o,onClick:g},Q)}):jsxRuntime.jsx("div",{className:"col-span-full py-12 text-center text-text-muted",role:"row",children:jsxRuntime.jsx("div",{role:"cell",children:"No data available"})})})]}),F&&jsxRuntime.jsx("div",{className:L.mobile,children:c?Array.from({length:u}).map((b,D)=>jsxRuntime.jsx(ga,{density:o},`mobile-loading-${D}`)):r.length>0?r.map((b,D)=>{let Q=p?p(b):`mobile-row-${D}`;return jsxRuntime.jsx("div",{children:V(b,D)},Q)}):jsxRuntime.jsx("div",{className:"py-12 text-center text-text-muted",children:"No data available"})})]})}function ya({label:e,description:r,errorMessage:t,showCalendar:o=false,...a}){let[n,i]=Ee.useState(false),l=s=>{a.onChange&&s&&a.onChange(s),i(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...a,className:W(a.className,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(Z,{children:e}),o?jsxRuntime.jsxs(Ht,{className:"w-auto min-w-[208px]",children:[jsxRuntime.jsx(st,{className:"min-w-[150px] flex-1"}),jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:n,onOpenChange:i,children:[jsxRuntime.jsx($,{variant:"icon",className:"mr-1 w-6 rounded outline-offset-0",children:jsxRuntime.jsx(lucideReact.CalendarIcon,{"aria-hidden":true,className:"h-4 w-4"})}),jsxRuntime.jsx(reactAriaComponents.Popover,{children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"p-4",children:jsxRuntime.jsx(_t,{value:a.value,onChange:l,minValue:a.minValue,maxValue:a.maxValue,isDisabled:a.isDisabled,isReadOnly:a.isReadOnly,isDateUnavailable:a.isDateUnavailable})})})]})]}):jsxRuntime.jsx(st,{}),r&&jsxRuntime.jsx(j,{children:r}),typeof t=="string"?jsxRuntime.jsx(_,{children:t}):null]})}function Ru({isPlaceholder:e,isDisabled:r}){return ["inline box-content px-0.5 -my-0.5 rounded outline-none tabular-nums text-center transition-colors",e?"text-text-muted italic":"text-text-body",r?"text-text-disabled cursor-not-allowed":"cursor-text","hover:bg-text-body/5","data-[focused]:!outline-[1.5px] data-[focused]:!outline-[var(--control-focus-ring-color)] data-[focused]:![--tw-outline-style:solid]"].filter(Boolean).join(" ")}function st(e){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:r=>xt({...r,className:typeof e.className=="string"?e.className:"min-w-[150px] px-2 py-1.5 text-sm flex items-center gap-0.5"}),...e,children:r=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:r,className:Ru({isPlaceholder:r.isPlaceholder,isDisabled:!r.isEditable})})})}function lt(e){return jsxRuntime.jsx(reactAriaComponents.Dialog,{...e,className:tailwindMerge.twMerge("relative h-auto max-h-[inherit] overflow-auto outline-none [[data-placement]>&]:p-4",e.className),role:"dialog"})}function Au({selectionState:e,isDisabled:r}){let t=`${ee} w-full h-full flex items-center justify-center rounded-sm forced-color-adjust-none font-semibold`,o={none:"text-text-body group-hover:bg-gray-200 group-pressed:bg-gray-200",middle:["group-hover:bg-gray-300 forced-colors:group-hover:bg-[Highlight]","group-invalid:group-hover:bg-red-200 forced-colors:group-invalid:group-hover:bg-[Mark]","group-pressed:bg-blue-300 forced-colors:group-pressed:bg-[Highlight] forced-colors:text-[HighlightText]","group-invalid:group-pressed:bg-red-300 forced-colors:group-invalid:group-pressed:bg-[Mark]"].join(" "),cap:" group-invalid:bg-red-600 forced-colors:bg-[Highlight] forced-colors:group-invalid:bg-[Mark] text-white forced-colors:text-white !bg-neutral-black"},a=r?"text-textFaint dark:text-zinc-600 forced-colors:text-textFaint font-light":"";return [t,o[e],a].filter(Boolean).join(" ")}function dr({errorMessage:e,...r}){return jsxRuntime.jsxs(reactAriaComponents.RangeCalendar,{...r,children:[jsxRuntime.jsx(Ut,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"w-full [&_td]:px-0",children:[jsxRuntime.jsx(qt,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:t=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:t,className:"selection-start:rounded-s-end selection-end:rounded-e-end [td:last-child_&]:rounded-e-end group h-9 w-9 cursor-default text-sm outline-none outside-month:text-gray-300 selected:bg-background-selected invalid:selected:bg-red-100 forced-colors:selected:bg-[Highlight] forced-colors:selected:text-white forced-colors:invalid:selected:bg-[Mark] [td:first-child_&]:rounded-s-full",children:({formattedDate:o,isSelected:a,isSelectionStart:n,isSelectionEnd:i,isFocusVisible:l,isDisabled:s})=>jsxRuntime.jsx("span",{className:Au({selectionState:a&&(n||i)?"cap":a?"middle":"none",isDisabled:s}),children:o})})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-red-600",children:e})]})}function Sa({label:e,description:r,errorMessage:t,...o}){return jsxRuntime.jsxs(reactAriaComponents.DateRangePicker,{...o,className:W(o.className,"group flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(Z,{children:e}),jsxRuntime.jsxs(Ht,{className:"w-auto min-w-[208px]",children:[jsxRuntime.jsx(st,{slot:"start",className:"px-2 py-1.5 text-sm"}),jsxRuntime.jsx("span",{"aria-hidden":"true",className:"text-gray-800 group-disabled:text-gray-200 dark:text-zinc-200 group-disabled:dark:text-zinc-600 forced-colors:text-[ButtonText] group-disabled:forced-colors:text-[GrayText]",children:"\u2013"}),jsxRuntime.jsx(st,{slot:"end",className:"flex-1 px-2 py-1.5 text-sm"}),jsxRuntime.jsx($,{variant:"icon",className:"mr-1 w-6 rounded outline-offset-0",children:jsxRuntime.jsx(lucideReact.CalendarIcon,{"aria-hidden":true,className:"h-4 w-4"})})]}),r&&jsxRuntime.jsx(j,{children:r}),typeof t=="string"?jsxRuntime.jsx(_,{children:t}):null,jsxRuntime.jsx(Ae,{children:jsxRuntime.jsx(lt,{children:jsxRuntime.jsx(dr,{})})})]})}var dt=({title:e,onClose:r,hideCloseIcon:t=false,titleAlign:o="left",hasBackArrow:a=false,onBack:n,headerContent:i})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full items-center justify-between border-b px-4",e&&"border-b",o==="center"?"justify-center":""),children:[a&&jsxRuntime.jsx($,{variant:"unstyled",onPress:n,className:"absolute left-4",children:jsxRuntime.jsx(h,{name:"CaretLeft","data-testid":"back-arrow"})}),i||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(Ye,{size:"xs",children:e}),r&&!t&&jsxRuntime.jsx($,{variant:"unstyled",onPress:r,"aria-label":"Close dialog",children:jsxRuntime.jsx(h,{name:"X","data-testid":"close-button"})})]})]});var ut=class extends Ee.Component{constructor(){super(...arguments);yr(this,"state",{hasError:false});yr(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(t){return {hasError:true,error:t}}componentDidCatch(t,o){console.error("Error Boundary caught an error:",t,o);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsx(Zt,{heading:this.props.title,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-6","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-red-500",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-600",onClick:this.handleRetry,children:"Retry"})]})}):this.props.children}};var lo=({children:e,title:r,headerContent:t,isOpen:o,slideInFrom:a="right",transparentOverlay:n=false,onClose:i,className:l,primaryAction:s,secondaryAction:d,footerContent:m,contentPadding:c=true,maxWidth:u="400px"})=>{let[f,g]=Ee.useState(false);if(Ee.useEffect(()=>{if(o){let y=setTimeout(()=>g(true),10);return ()=>clearTimeout(y)}else g(false);},[o]),!o)return null;let p=s||d,x=p||m;return jsxRuntime.jsx(ut,{children:jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{isOpen:o,onOpenChange:i,isDismissable:true,className:`fixed inset-0 z-50 ${n?"bg-transparent":"bg-black/50"}`,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"flex justify-end",isDismissable:true,children:jsxRuntime.jsxs(lt,{className:`fixed bottom-0 top-0 z-50 flex w-full flex-col bg-background-surface shadow-xl duration-300 h-full min-h-0 overflow-hidden dark:bg-gray-800 ${f?a==="right"?"animate-in slide-in-from-right":"animate-in slide-in-from-left":""} ${l||""}`,style:{[a==="right"?"right":"left"]:0,maxWidth:u,transform:f?void 0:a==="right"?"translateX(100%)":"translateX(-100%)"},children:[(r||t)&&jsxRuntime.jsx(dt,{title:r,headerContent:t,onClose:i||(()=>{})}),jsxRuntime.jsx("div",{className:`flex-1 overflow-y-auto overscroll-contain ${c?"p-6":"p-0"}`,children:e}),x&&jsxRuntime.jsxs("div",{className:"flex h-28 w-full flex-col items-center justify-center border-t p-4",children:[m&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:m}),p&&jsxRuntime.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[d&&jsxRuntime.jsx($,{size:d.size||"lg",fullWidth:true,variant:d.variant||"secondary",onPress:d.onPress,isLoading:d.isLoading,isDisabled:d.isDisabled,children:d.label}),s&&jsxRuntime.jsx($,{size:s.size||"lg",fullWidth:true,onPress:s.onPress,isLoading:s.isLoading,isDisabled:s.isDisabled,children:s.label})]})]})]})})})})};lo.displayName="Drawer";function Pa({value:e,onChange:r,onUrlChange:t,accept:o="image/*",maxSize:a,isDisabled:n=false,onUpload:i,className:l,showPreview:s=true,placeholder:d="Drop files here or click to browse"}){let[m,c]=Ee.useState(false),[u,f]=Ee.useState(false),[g,p]=Ee.useState(null),[x,y]=Ee.useState(e),N=Ee.useRef(null),T=async v=>{if(p(null),a&&v.size>a){p(`File size must be less than ${(a/1024/1024).toFixed(2)}MB`);return}if(s&&v.type.startsWith("image/")){let M=new FileReader;M.onloadend=()=>{y(M.result);},M.readAsDataURL(v);}if(i){f(true);try{let M=await i(v);y(M),t?.(M);}catch(M){p("Failed to upload file"),console.error("Upload error:",M);}finally{f(false);}}r?.(v,x);},E=v=>{let M=v.items;if(M.length>0){let C=M[0];if(C.kind==="file"){let L=C.getAsFile();L&&T(L);}}c(false);},P=()=>{y(void 0),p(null),r?.(null),t?.(""),N.current&&(N.current.value="");};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("w-full",l),children:[jsxRuntime.jsxs(reactAriaComponents.DropZone,{className:tailwindMerge.twMerge("relative flex min-h-[200px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",m?"border-action-primary bg-action-primary/5":"border-border-muted hover:border-border-default",n&&"pointer-events-none opacity-50",g&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:E,onDropEnter:()=>c(true),onDropExit:()=>c(false),children:[x?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[s&&x.startsWith("data:image")?jsxRuntime.jsx("img",{src:x,alt:"Preview",className:"max-h-48 max-w-full rounded-md object-contain"}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Image,{className:"h-12 w-12 text-text-muted"}),jsxRuntime.jsx("span",{className:"text-sm text-text-muted",children:"File uploaded"})]}),!n&&jsxRuntime.jsx($,{variant:"icon",size:"sm",onPress:P,className:"absolute right-2 top-2 bg-background-surface shadow-md",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"h-12 w-12 text-text-muted"}),jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-sm text-text-body",children:d}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-text-muted",children:o==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${o}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:o.split(","),onSelect:v=>{let M=Array.from(v||[]);M.length>0&&T(M[0]);},children:jsxRuntime.jsx($,{variant:"secondary",size:"sm",isDisabled:n,children:"Choose File"})})]}),u&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg bg-background-surface/80",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-action-primary border-t-transparent"}),jsxRuntime.jsx("span",{className:"text-sm text-text-muted",children:"Uploading..."})]})})]}),g&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-feedback-error-text",children:g})]})}function ka(e){return jsxRuntime.jsx(reactAriaComponents.Form,{...e,className:tailwindMerge.twMerge("flex flex-col gap-4",e.className)})}function am({children:e,...r}){return jsxRuntime.jsx(reactAriaComponents.ListBox,{...r,className:W(r.className,"outline-0"),children:e})}var Ra=({className:e,size:r=24,color:t="text-action-primary"})=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent",t,e),style:{width:r,height:r},role:"status","aria-label":"loading",children:jsxRuntime.jsx("span",{className:"sr-only",children:"Loading..."})});var La=({className:e,showWordmark:r=true})=>{let t=e||"fill-[#333333]";return r?jsxRuntime.jsxs("svg",{width:"270",height:"80",viewBox:"0 0 270 80",xmlns:"http://www.w3.org/2000/svg",className:t,children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_796_283)",children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.223654 20.2934C0.417233 19.8234 0.873598 19.517 1.37984 19.517H20.5909C21.282 19.517 21.8422 20.0798 21.8422 20.774V40.049C21.8422 40.5572 21.5375 41.0155 21.0702 41.2102C20.6028 41.405 20.0647 41.2977 19.7067 40.9385L0.495628 21.6635C0.137428 21.3041 0.030075 20.7633 0.223654 20.2934ZM4.40349 22.0311L19.3396 37.017V22.0311H4.40349Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 20.2934C38.8394 19.8234 39.2958 19.517 39.802 19.517H59.013C59.7041 19.517 60.2642 20.0798 60.2642 20.774V40.049C60.2642 40.5572 59.9597 41.0155 59.4923 41.2102C59.025 41.405 58.4867 41.2977 58.1289 40.9385L38.9178 21.6635C38.5595 21.3041 38.4522 20.7633 38.6458 20.2934ZM42.8255 22.0311L57.7618 37.017V22.0311H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4347 58.8447C19.6283 58.3747 20.0847 58.0685 20.5909 58.0685H39.802C40.493 58.0685 41.0532 58.6312 41.0532 59.3255V78.6005C41.0532 79.1087 40.7486 79.567 40.2813 79.7617C39.8139 79.9562 39.2757 79.849 38.9178 79.49L19.7067 60.215C19.3485 59.8555 19.2411 59.3147 19.4347 58.8447ZM23.6146 60.5825L38.5508 75.5682V60.5825H23.6146Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 58.1643C39.79 57.9695 40.3283 58.0768 40.6861 58.436L59.8972 77.711C60.2555 78.0703 60.3628 78.6113 60.1692 79.081C59.9756 79.551 59.5192 79.8575 59.013 79.8575H39.802C39.1109 79.8575 38.5508 79.2948 38.5508 78.6005V59.3255C38.5508 58.8173 38.8554 58.359 39.3227 58.1643ZM41.0532 62.3575V77.3433H55.9893L41.0532 62.3575Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 19.6129C39.79 19.4182 40.3283 19.5254 40.6861 19.8846L59.8972 39.1595C60.2555 39.519 60.3628 40.0598 60.1692 40.5298C59.9756 40.9995 59.5192 41.306 59.013 41.306H39.802C39.1109 41.306 38.5508 40.7433 38.5508 40.049V20.7741C38.5508 20.2658 38.8554 19.8075 39.3227 19.6129ZM41.0532 23.8061V38.792H55.9893L41.0532 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 38.8885C39.79 38.694 40.3283 38.8012 40.6861 39.1602L59.8972 58.4352C60.2555 58.7945 60.3628 59.3355 60.1692 59.8055C59.9756 60.2752 59.5192 60.5817 59.013 60.5817H39.802C39.1109 60.5817 38.5508 60.019 38.5508 59.3247V40.0497C38.5508 39.5415 38.8554 39.0832 39.3227 38.8885ZM41.0532 43.0817V58.0675H55.9893L41.0532 43.0817Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 39.569C38.8394 39.0992 39.2958 38.7927 39.802 38.7927H59.013C59.7041 38.7927 60.2642 39.3555 60.2642 40.0497V59.3247C60.2642 59.833 59.9597 60.2912 59.4923 60.486C59.025 60.6805 58.4867 60.5732 58.1289 60.2142L38.9178 40.9392C38.5595 40.5797 38.4522 40.039 38.6458 39.569ZM42.8255 41.3067L57.7618 56.2927V41.3067H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 58.8447C38.8394 58.3747 39.2958 58.0685 39.802 58.0685H59.013C59.7041 58.0685 60.2642 58.6312 60.2642 59.3255V78.6005C60.2642 79.1087 59.9597 79.567 59.4923 79.7617C59.025 79.9562 58.4867 79.849 58.1289 79.49L38.9178 60.215C38.5595 59.8555 38.4522 59.3147 38.6458 58.8447ZM42.8255 60.5825L57.7618 75.5682V60.5825H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 19.6129C59.0011 19.4182 59.5394 19.5254 59.8972 19.8846L79.1083 39.1595C79.4666 39.519 79.5739 40.0598 79.3803 40.5298C79.1867 40.9995 78.7303 41.306 78.2241 41.306H59.013C58.322 41.306 57.7618 40.7433 57.7618 40.049V20.7741C57.7618 20.2658 58.0664 19.8075 58.5338 19.6129ZM60.2643 23.8061V38.792H75.2006L60.2643 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 0.338803C59.0011 0.144135 59.5394 0.251385 59.8972 0.610565L79.1083 19.8855C79.4666 20.2449 79.5739 20.7857 79.3803 21.2556C79.1867 21.7256 78.7303 22.032 78.2241 22.032H59.013C58.322 22.032 57.7618 21.4692 57.7618 20.775V1.50003C57.7618 0.99174 58.0664 0.533468 58.5338 0.338803ZM60.2643 4.53208V19.5179H75.2006L60.2643 4.53208Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8569 20.2934C58.0505 19.8234 58.5069 19.517 59.013 19.517H78.2241C78.9151 19.517 79.4753 20.0798 79.4753 20.774V40.049C79.4753 40.5572 79.1707 41.0155 78.7034 41.2102C78.236 41.405 77.6978 41.2977 77.3399 40.9385L58.1289 21.6635C57.7705 21.3041 57.6633 20.7633 57.8569 20.2934ZM62.0365 22.0311L76.9729 37.017V22.0311H62.0365Z"}),jsxRuntime.jsx("path",{d:"M269.838 49.4457H249.005C249.266 51.801 250.162 53.6985 251.695 55.1377C253.225 56.577 255.134 57.2967 257.416 57.2967C259.307 57.2967 260.887 56.8715 262.159 56.021C263.463 55.1377 264.408 53.9927 264.996 52.5862H269.251C268.502 54.9415 267.084 56.937 264.996 58.5725C262.943 60.208 260.414 61.026 257.416 61.026C255.069 61.026 252.917 60.4697 250.961 59.3575C249.037 58.2127 247.504 56.6587 246.363 54.696C245.255 52.7332 244.7 50.558 244.7 48.17C244.7 45.782 245.255 43.6067 246.363 41.644C247.504 39.6812 249.037 38.1437 250.961 37.0315C252.917 35.8867 255.069 35.3142 257.416 35.3142C259.73 35.3142 261.833 35.8702 263.724 36.9825C265.615 38.0947 267.098 39.6485 268.176 41.644C269.283 43.6395 269.838 45.913 269.838 48.4645V49.4457ZM257.416 39.0432C255.263 39.0432 253.439 39.6812 251.939 40.957C250.47 42.2327 249.542 43.9337 249.152 46.06H265.583C265.192 43.9992 264.262 42.3145 262.796 41.006C261.36 39.6975 259.568 39.0432 257.416 39.0432Z"}),jsxRuntime.jsx("path",{d:"M228.356 60.5352V35.8049H232.219V39.7794H232.464C233.05 38.5689 233.963 37.5712 235.202 36.7862C236.474 35.9684 237.974 35.5594 239.701 35.5594H243.125V39.4359H239.701C237.517 39.4359 235.757 40.1554 234.42 41.5949C233.083 43.0342 232.414 44.9152 232.414 47.2377V60.5352H228.356Z"}),jsxRuntime.jsx("path",{d:"M208.607 61.0259C205.64 61.0259 203.326 60.1262 201.663 58.3272C200 56.4952 199.169 53.8947 199.169 50.5252V35.8047H203.228V49.8874C203.228 52.2427 203.766 54.0744 204.842 55.3829C205.95 56.6587 207.532 57.2967 209.586 57.2967C211.02 57.2967 212.308 56.9694 213.449 56.3152C214.623 55.6284 215.536 54.6959 216.188 53.5184C216.84 52.3407 217.166 50.9997 217.166 49.4949V35.8047H221.225V60.5352H217.313V56.5607H217.068C216.286 57.9019 215.161 58.9814 213.694 59.7992C212.226 60.6169 210.531 61.0259 208.607 61.0259Z"}),jsxRuntime.jsx("path",{d:"M186.736 39.534V56.806H194.756V60.5352H182.677V39.534H177.199V35.8047H182.677V29.5732H186.736V35.8047H193.24V39.534H186.736Z"}),jsxRuntime.jsx("path",{d:"M156.585 60.5352H151.988L158.394 48.0227L152.33 35.8047H156.976L162.062 46.0599H165.388L170.474 35.8047H175.022L168.958 48.0227L175.365 60.5352H170.67L165.29 49.7892H162.013L156.585 60.5352Z"}),jsxRuntime.jsx("path",{d:"M150.138 49.1315H129.304C129.565 51.4867 130.461 53.3842 131.994 54.8235C133.526 56.2627 135.433 56.9825 137.715 56.9825C139.606 56.9825 141.188 56.5572 142.459 55.7067C143.763 54.8235 144.709 53.6785 145.296 52.272H149.551C148.801 54.6272 147.382 56.6227 145.296 58.2582C143.242 59.8937 140.715 60.7118 137.715 60.7118C135.368 60.7118 133.216 60.1555 131.26 59.0432C129.336 57.8985 127.804 56.3445 126.663 54.3817C125.554 52.419 125 50.2437 125 47.8557C125 45.4677 125.554 43.2925 126.663 41.3298C127.804 39.367 129.336 37.8295 131.26 36.7173C133.216 35.5725 135.368 35 137.715 35C140.03 35 142.133 35.556 144.024 36.6682C145.915 37.7805 147.399 39.3342 148.475 41.3298C149.583 43.3252 150.138 45.5987 150.138 48.1502V49.1315ZM137.715 38.729C135.564 38.729 133.738 39.367 132.238 40.6427C130.771 41.9185 129.842 43.6195 129.45 45.7458H145.883C145.491 43.685 144.562 42.0002 143.095 40.6917C141.661 39.3832 139.867 38.729 137.715 38.729Z"}),jsxRuntime.jsx("path",{d:"M116.961 60.5353H112.559V30.4072H101.164V26.1875H128.307V30.4072H116.961V60.5353Z"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_796_283",children:jsxRuntime.jsx("rect",{width:"270",height:"80",fill:"white"})})})]}):jsxRuntime.jsxs("svg",{width:"80",height:"80",viewBox:"0 0 80 80",xmlns:"http://www.w3.org/2000/svg",className:t,children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.223654 20.2934C0.417233 19.8234 0.873598 19.517 1.37984 19.517H20.5909C21.282 19.517 21.8422 20.0798 21.8422 20.774V40.049C21.8422 40.5572 21.5375 41.0155 21.0702 41.2102C20.6028 41.405 20.0647 41.2977 19.7067 40.9385L0.495628 21.6635C0.137428 21.3041 0.030075 20.7633 0.223654 20.2934ZM4.40349 22.0311L19.3396 37.017V22.0311H4.40349Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 20.2934C38.8394 19.8234 39.2958 19.517 39.802 19.517H59.013C59.7041 19.517 60.2642 20.0798 60.2642 20.774V40.049C60.2642 40.5572 59.9597 41.0155 59.4923 41.2102C59.025 41.405 58.4867 41.2977 58.1289 40.9385L38.9178 21.6635C38.5595 21.3041 38.4522 20.7633 38.6458 20.2934ZM42.8255 22.0311L57.7618 37.017V22.0311H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4347 58.8447C19.6283 58.3747 20.0847 58.0685 20.5909 58.0685H39.802C40.493 58.0685 41.0532 58.6312 41.0532 59.3255V78.6005C41.0532 79.1087 40.7486 79.567 40.2813 79.7617C39.8139 79.9562 39.2757 79.849 38.9178 79.49L19.7067 60.215C19.3485 59.8555 19.2411 59.3147 19.4347 58.8447ZM23.6146 60.5825L38.5508 75.5682V60.5825H23.6146Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 58.1643C39.79 57.9695 40.3283 58.0768 40.6861 58.436L59.8972 77.711C60.2555 78.0703 60.3628 78.6113 60.1692 79.081C59.9756 79.551 59.5192 79.8575 59.013 79.8575H39.802C39.1109 79.8575 38.5508 79.2948 38.5508 78.6005V59.3255C38.5508 58.8173 38.8554 58.359 39.3227 58.1643ZM41.0532 62.3575V77.3433H55.9893L41.0532 62.3575Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 19.6129C39.79 19.4182 40.3283 19.5254 40.6861 19.8846L59.8972 39.1595C60.2555 39.519 60.3628 40.0598 60.1692 40.5298C59.9756 40.9995 59.5192 41.306 59.013 41.306H39.802C39.1109 41.306 38.5508 40.7433 38.5508 40.049V20.7741C38.5508 20.2658 38.8554 19.8075 39.3227 19.6129ZM41.0532 23.8061V38.792H55.9893L41.0532 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 38.8885C39.79 38.694 40.3283 38.8012 40.6861 39.1602L59.8972 58.4352C60.2555 58.7945 60.3628 59.3355 60.1692 59.8055C59.9756 60.2752 59.5192 60.5817 59.013 60.5817H39.802C39.1109 60.5817 38.5508 60.019 38.5508 59.3247V40.0497C38.5508 39.5415 38.8554 39.0832 39.3227 38.8885ZM41.0532 43.0817V58.0675H55.9893L41.0532 43.0817Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 39.569C38.8394 39.0992 39.2958 38.7927 39.802 38.7927H59.013C59.7041 38.7927 60.2642 39.3555 60.2642 40.0497V59.3247C60.2642 59.833 59.9597 60.2912 59.4923 60.486C59.025 60.6805 58.4867 60.5732 58.1289 60.2142L38.9178 40.9392C38.5595 40.5797 38.4522 40.039 38.6458 39.569ZM42.8255 41.3067L57.7618 56.2927V41.3067H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 58.8447C38.8394 58.3747 39.2958 58.0685 39.802 58.0685H59.013C59.7041 58.0685 60.2642 58.6312 60.2642 59.3255V78.6005C60.2642 79.1087 59.9597 79.567 59.4923 79.7617C59.025 79.9562 58.4867 79.849 58.1289 79.49L38.9178 60.215C38.5595 59.8555 38.4522 59.3147 38.6458 58.8447ZM42.8255 60.5825L57.7618 75.5682V60.5825H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 19.6129C59.0011 19.4182 59.5394 19.5254 59.8972 19.8846L79.1083 39.1595C79.4666 39.519 79.5739 40.0598 79.3803 40.5298C79.1867 40.9995 78.7303 41.306 78.2241 41.306H59.013C58.322 41.306 57.7618 40.7433 57.7618 40.049V20.7741C57.7618 20.2658 58.0664 19.8075 58.5338 19.6129ZM60.2643 23.8061V38.792H75.2006L60.2643 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 0.338803C59.0011 0.144135 59.5394 0.251385 59.8972 0.610565L79.1083 19.8855C79.4666 20.2449 79.5739 20.7857 79.3803 21.2556C79.1867 21.7256 78.7303 22.032 78.2241 22.032H59.013C58.322 22.032 57.7618 21.4692 57.7618 20.775V1.50003C57.7618 0.99174 58.0664 0.533468 58.5338 0.338803ZM60.2643 4.53208V19.5179H75.2006L60.2643 4.53208Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8569 20.2934C58.0505 19.8234 58.5069 19.517 59.013 19.517H78.2241C78.9151 19.517 79.4753 20.0798 79.4753 20.774V40.049C79.4753 40.5572 79.1707 41.0155 78.7034 41.2102C78.236 41.405 77.6978 41.2977 77.3399 40.9385L58.1289 21.6635C57.7705 21.3041 57.6633 20.7633 57.8569 20.2934ZM62.0365 22.0311L76.9729 37.017V22.0311H62.0365Z"})]})};var Lt={dark:"mapbox://styles/mapbox/dark-v11",light:"mapbox://styles/mapbox/light-v11",streets:"mapbox://styles/mapbox/streets-v12",satellite:"mapbox://styles/mapbox/satellite-streets-v12"};function Ma({width:e="100%",height:r="100%",initialViewState:t={longitude:-122.4194,latitude:37.7749,zoom:14},isLoading:o=false,theme:a="streets",mapboxAccessToken:n,showMarker:i=true,className:l}){let s={width:typeof e=="number"?`${e}px`:e,height:typeof r=="number"?`${r}px`:r};return o?jsxRuntime.jsx("div",{style:s,className:l,children:jsxRuntime.jsx(K,{width:s.width,height:s.height})}):n?jsxRuntime.jsx("div",{style:s,className:l,children:jsxRuntime.jsxs(sm__default.default,{mapboxAccessToken:n,initialViewState:t,style:s,mapStyle:Lt[a],scrollZoom:false,dragPan:false,dragRotate:false,doubleClickZoom:false,touchZoomRotate:false,attributionControl:false,interactive:false,children:[i&&jsxRuntime.jsx(sm.Marker,{longitude:t.longitude,latitude:t.latitude,anchor:"bottom",children:jsxRuntime.jsx(h,{name:"MapPin",size:36,className:"text-action-primary",weight:"fill"})}),jsxRuntime.jsx(sm.AttributionControl,{compact:true,position:"bottom-right"})]})}):jsxRuntime.jsx("div",{style:s,className:`flex items-center justify-center bg-background-muted text-text-muted ${l}`,children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(h,{name:"MapPin",size:48,className:"mx-auto mb-2 opacity-50"}),jsxRuntime.jsx("p",{className:"text-sm",children:"Map requires Mapbox token"})]})})}function bm(e){return {type:"FeatureCollection",features:e.map(r=>({type:"Feature",properties:{id:r.id,...r.properties},geometry:{type:"Point",coordinates:[r.longitude,r.latitude]}}))}}function xm(e){if(e.length===0)return null;let r=e[0].latitude,t=e[0].latitude,o=e[0].longitude,a=e[0].longitude;return e.forEach(n=>{r=Math.min(r,n.latitude),t=Math.max(t,n.latitude),o=Math.min(o,n.longitude),a=Math.max(a,n.longitude);}),{longitude:(o+a)/2,latitude:(r+t)/2,zoom:10}}function Ia({data:e,initialViewState:r,viewState:t,onViewStateChange:o,onPointClick:a,selectedPointId:n,scrollEnabled:i=true,className:l,theme:s="streets",mapboxAccessToken:d,enableClustering:m=true,renderMarker:c}){let u=Ee.useRef(null),[f,g]=Ee.useState(false),p=Ee.useMemo(()=>r||xm(e)||{longitude:-122.4194,latitude:37.7749,zoom:10},[r,e]),x=Ee.useCallback(v=>{o?.(v.viewState);let M=Math.abs(v.viewState.longitude-p.longitude)>.01||Math.abs(v.viewState.latitude-p.latitude)>.01||Math.abs(v.viewState.zoom-p.zoom)>.5;g(M);},[o,p]),y=Ee.useCallback(()=>{u.current?.flyTo({center:[p.longitude,p.latitude],zoom:p.zoom,duration:1e3}),g(false);},[p]),N=Ee.useCallback(v=>{let M=v.features?.[0];M&&M.properties?.id&&a?.(M.properties.id);},[a]),T=Ee.useMemo(()=>bm(e),[e]),E=Ee.useMemo(()=>n?e.find(v=>v.id===n):null,[n,e]),P=Ee.useMemo(()=>{let v={id:"unclustered-points",type:"circle",source:"points",filter:m?["!",["has","point_count"]]:void 0,paint:{"circle-color":["case",["==",["get","id"],n||""],"#3B82F6","#10B981"],"circle-radius":["case",["==",["get","id"],n||""],10,8],"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}};return m?[{id:"clusters",type:"circle",source:"points",filter:["has","point_count"],paint:{"circle-color":"#F59E0B","circle-radius":["step",["get","point_count"],20,10,25,30,30],"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}},{id:"cluster-count",type:"symbol",source:"points",filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["DIN Offc Pro Medium","Arial Unicode MS Bold"],"text-size":12},paint:{"text-color":"#ffffff"}},v]:[v]},[n,m]);return d?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative h-full w-full",l),children:jsxRuntime.jsxs(sm__default.default,{ref:u,initialViewState:t||p,style:{width:"100%",height:"100%"},mapStyle:Lt[s],mapboxAccessToken:d,onMove:x,onClick:N,interactiveLayerIds:["unclustered-points","clusters"],scrollZoom:i,cursor:"pointer",children:[jsxRuntime.jsx(sm.NavigationControl,{position:"top-right"}),f&&jsxRuntime.jsx($,{className:"absolute bottom-4 right-4 shadow-lg",onPress:y,variant:"secondary",size:"sm",children:"Reset View"}),T&&jsxRuntime.jsx(sm.Source,{id:"points",type:"geojson",data:T,cluster:m,clusterMaxZoom:14,clusterRadius:50,children:P.map(v=>jsxRuntime.jsx(sm.Layer,{...v},v.id))}),E&&!c&&jsxRuntime.jsx(sm.Marker,{longitude:E.longitude,latitude:E.latitude,children:jsxRuntime.jsx(h,{name:"MapPin",size:40,className:"text-action-primary relative -top-5",weight:"fill"})}),c&&e.map(v=>jsxRuntime.jsx(sm.Marker,{longitude:v.longitude,latitude:v.latitude,children:c(v,v.id===n)},v.id))]})}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center justify-center h-96 bg-background-muted text-text-muted",l),children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(h,{name:"MapPin",size:48,className:"mx-auto mb-2 opacity-50"}),jsxRuntime.jsx("p",{className:"text-sm",children:"Map requires Mapbox token"})]})})}var vm={sm:{bar:"h-1.5 w-48",text:"text-xs",icon:"h-3 w-3"},md:{bar:"h-2 w-64",text:"text-sm",icon:"h-4 w-4"},lg:{bar:"h-3 w-80",text:"text-base",icon:"h-5 w-5"}};function $a({label:e,size:r="md",variant:t="default",showWarningIndicator:o=true,warningThreshold:a=80,className:n,...i}){let l=vm[r];return jsxRuntime.jsx(reactAriaComponents.Meter,{...i,className:W(n,"flex flex-col gap-1"),children:({percentage:s,valueText:d})=>{let m=o&&s>=a,c=t==="default"?Cm(s):t;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex justify-between gap-2",children:[e&&jsxRuntime.jsx(Z,{children:e}),jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge(l.text,m?"text-feedback-error-text":"text-text-muted"),children:[m&&jsxRuntime.jsx(lucideReact.AlertTriangle,{"aria-label":"Warning: High value",className:tailwindMerge.twMerge("inline-block align-text-bottom mr-1",l.icon)}),d]})]}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative rounded-full bg-background-muted","ring-1 ring-inset ring-border-muted",l.bar),children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute left-0 top-0 h-full rounded-full transition-all duration-300","forced-colors:bg-[Highlight]",Sm(c)),style:{width:`${Math.min(100,Math.max(0,s))}%`},role:"presentation","aria-hidden":"true"})})]})}})}function Cm(e){return e<50?"success":e<70?"info":e<90?"warning":"error"}function Sm(e){switch(e){case "success":return "bg-feedback-success-text";case "warning":return "bg-feedback-warning-text";case "error":return "bg-feedback-error-text";case "info":return "bg-feedback-info-text";default:return "bg-action-primary-background"}}var Fm={success:{container:"bg-feedback-success-background border-feedback-success-border text-feedback-success-text",icon:lucideReact.CheckCircle},error:{container:"bg-feedback-error-background border-feedback-error-border text-feedback-error-text",icon:lucideReact.XCircle},warning:{container:"bg-feedback-warning-background border-feedback-warning-border text-feedback-warning-text",icon:lucideReact.AlertCircle},info:{container:"bg-feedback-info-background border-feedback-info-border text-feedback-info-text",icon:lucideReact.Info}};function gr({id:e,message:r,variant:t="info",duration:o=5e3,dismissible:a=true,onDismiss:n,className:i}){let{container:l,icon:s}=Fm[t];return Ee.useEffect(()=>{if(o>0){let d=setTimeout(()=>{n?.();},o);return ()=>clearTimeout(d)}},[o,n]),jsxRuntime.jsxs(framerMotion.motion.div,{layout:true,initial:{opacity:0,y:-20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.95,transition:{duration:.2}},className:tailwindMerge.twMerge("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg",l,i),children:[jsxRuntime.jsx(s,{className:"h-5 w-5 flex-shrink-0"}),jsxRuntime.jsx("p",{className:"flex-1 text-sm font-medium",children:r}),a&&jsxRuntime.jsx("button",{onClick:n,className:"flex-shrink-0 rounded-md p-1 transition-colors hover:bg-black/10","aria-label":"Dismiss notification",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}var zm={"top-left":"top-4 left-4 items-start","top-center":"top-4 left-1/2 -translate-x-1/2 items-center","top-right":"top-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center","bottom-right":"bottom-4 right-4 items-end"};function br({notices:e,onDismiss:r,position:t="top-right",className:o}){let[a,n]=Ee.useState(false);if(Ee.useEffect(()=>{n(true);},[]),!a)return null;let i=jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("pointer-events-none fixed z-50 flex flex-col gap-2",zm[t],o),"aria-live":"polite","aria-atomic":"true",children:jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"sync",children:e.map(l=>jsxRuntime.jsx(gr,{id:l.id,message:l.message,variant:l.variant,duration:l.duration,dismissible:l.dismissible,onDismiss:()=>r(l.id)},l.id))})});return reactDom.createPortal(i,document.body)}var Aa=Ee.createContext(void 0);function Va({children:e,position:r="top-right",maxNotices:t=5,defaultDuration:o=5e3,defaultDismissible:a=true}){let[n,i]=Ee.useState([]),l=Ee.useCallback((c,u)=>{let f=`notice-${Date.now()}-${Math.random()}`,g={id:f,message:c,variant:u?.variant||"info",duration:u?.duration??o,dismissible:u?.dismissible??a};return i(p=>{let x=[...p,g];return x.length>t?x.slice(-t):x}),f},[t,o,a]),s=Ee.useCallback(c=>{i(u=>u.filter(f=>f.id!==c));},[]),d=Ee.useCallback(()=>{i([]);},[]),m={notices:n,addNotice:l,removeNotice:s,clearNotices:d};return jsxRuntime.jsxs(Aa.Provider,{value:m,children:[e,jsxRuntime.jsx(br,{notices:n,onDismiss:s,position:r})]})}function za(){let e=Ee.useContext(Aa);if(!e)throw new Error("useNoticeContext must be used within a NoticeProvider");return e}function Ha(){let{addNotice:e,removeNotice:r,clearNotices:t}=za(),o=Ee.useCallback((s,d)=>e(s,d),[e]),a=Ee.useCallback((s,d)=>e(s,{...d,variant:"success"}),[e]),n=Ee.useCallback((s,d)=>e(s,{...d,variant:"error"}),[e]),i=Ee.useCallback((s,d)=>e(s,{...d,variant:"warning"}),[e]),l=Ee.useCallback((s,d)=>e(s,{...d,variant:"info"}),[e]);return {show:o,success:a,error:n,warning:i,info:l,dismiss:r,clear:t}}var Xm=e=>tailwindMerge.twMerge(Xe({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused}),e.transparent?"bg-transparent":"bg-background-input","pr-9","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",e.className);function Ga({label:e,description:r,errorMessage:t,size:o,tooltip:a,isRequired:n,transparent:i,validationResult:l,...s}){let d=Ee.useId();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...s,id:d,isRequired:n,className:W(s.className,"group flex flex-col gap-1"),step:s.step??1,onChange:m=>{typeof m=="number"&&(s.maxValue!=null&&m>s.maxValue?s.onChange?.(s.maxValue):s.minValue!=null&&m<s.minValue?s.onChange?.(s.minValue):s.onChange?.(m));},isInvalid:!!t||typeof s.value=="number"&&(s.maxValue!=null&&s.value>s.maxValue||s.minValue!=null&&s.value<s.minValue),children:({isDisabled:m,isInvalid:c})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Z,{size:o,tooltip:a,isRequired:n,htmlFor:d,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{className:Xm({isInvalid:c||!!t,isDisabled:m,transparent:i,className:typeof s.className=="string"?s.className:void 0})}),jsxRuntime.jsxs("div",{className:"absolute inset-y-[1px] right-[1px] flex flex-col divide-y border-l overflow-hidden rounded-r-[calc(var(--control-border-radius)-1px)]",children:[jsxRuntime.jsx(reactAriaComponents.Button,{slot:"increment",isDisabled:m,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(h,{name:"CaretUp",size:14})}),jsxRuntime.jsx(reactAriaComponents.Button,{slot:"decrement",isDisabled:m,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(h,{name:"CaretDown",size:14})})]})]})}),r&&jsxRuntime.jsx(j,{size:o,className:"mt-3",children:r}),t&&jsxRuntime.jsx(_,{size:o,className:"mt-3",children:typeof t=="function"?t(l):t})]})})}function Ym(e){return typeof e=="object"&&e!==null&&"features"in e&&Array.isArray(e.features)&&"type"in e&&typeof e.type=="string"}var Qm=process.env.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN||"";function Ua({label:e="Search for a place",selectedKey:r,defaultSelectedKey:t,onSelectionChange:o,placeholder:a="Enter a location...",errorMessage:n,description:i,size:l="md",tooltip:s,isRequired:d,isDisabled:m,showErrors:c=true,autoFocus:u=false,onSelect:f,searchTypes:g=["place","address"],defaultFilter:p,validationResult:x,countryRestrictions:y,proximity:N="ip"}){let T=Ee.useRef(new WeakMap),E=Ee.useRef([]),P={requestType:"REST",method:"GET",url:"https://api.mapbox.com/geocoding/v5/mapbox.places/{q}.json",extraParams:{access_token:Qm,types:g.join(","),limit:"5",...y?.length?{country:y.join(",").toLowerCase()}:{},...N?{proximity:N==="ip"?"ip":N.join(",")}:{}},shouldLoad:C=>C.length>0,transformResponse:C=>{if(!Ym(C))return [];let L=C.features.map(F=>{let V={id:F.id,name:F.place_name};return T.current.set(V,{type:F.place_type[0],center:F.center}),V});return L.length>0&&(E.current=L),L}},v=C=>{let L=T.current.get(C),F=C.name.split(", "),V=F[0],b=F.slice(1).join(", ");return jsxRuntime.jsxs("div",{className:"flex items-center gap-3 py-0.5",children:[jsxRuntime.jsx(h,{name:L?.type==="address"?"MapPin":L?.type==="place"?"Buildings":L?.type==="region"?"MapPinArea":L?.type==="country"?"Flag":"Circle",className:"h-5 w-5 flex-shrink-0 text-text-muted"}),jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-col",children:[jsxRuntime.jsx("span",{className:"truncate font-medium text-text-body",children:V}),b&&jsxRuntime.jsx("span",{className:"truncate text-sm text-text-muted",children:b})]})]})},M=C=>C?jsxRuntime.jsx(h,{name:"CircleNotch",className:"h-4 w-4 animate-spin text-text-muted"}):jsxRuntime.jsx(h,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-muted"});return jsxRuntime.jsx(Ot,{"data-testid":"autocomplete","data-config":JSON.stringify({types:g.join(","),country:y?.join(",").toLowerCase(),proximity:N==="ip"?"ip":N?.join(",")}),label:e,selectedKey:r,defaultSelectedKey:t,onSelectionChange:C=>{if(o?.(C),C){let F=E.current.find(V=>V.id===C);if(F){let V=T.current.get(F);V&&f({id:F.id,place_name:F.name,place_type:[V.type],center:V.center});}}},requestConfig:P,placeholder:a,errorMessage:n,description:i,size:l,tooltip:s,isRequired:d,isDisabled:m,showErrors:c,autoFocus:u,renderItem:v,renderLeftIcon:M,defaultFilter:p,validationResult:x})}function Za({label:e,rightLabel:r,progressWidth:t=64,hideLabels:o=false,...a}){return jsxRuntime.jsx(reactAriaComponents.ProgressBar,{...a,className:W(a.className,"flex flex-col gap-1"),children:({percentage:n,valueText:i,isIndeterminate:l})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!o&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-sm text-text-heading",children:e}),jsxRuntime.jsx("span",{className:"text-sm text-text-heading",children:r||i})]}),jsxRuntime.jsx("div",{className:`relative h-2 w-${t} overflow-hidden rounded-full bg-background-muted outline-none`,children:jsxRuntime.jsx("div",{className:`absolute top-0 h-full rounded-full bg-blue-600 dark:bg-blue-500 forced-colors:bg-[Highlight] ${l?"left-full duration-1000 ease-out animate-in slide-out-to-right-full repeat-infinite [--tw-enter-translate-x:calc(-16rem-100%)]":"left-0"}`,style:{width:(l?40:n)+"%"}})})]})})}function Ka(e){return jsxRuntime.jsxs(reactAriaComponents.RadioGroup,{...e,className:W(e.className,"group flex flex-col gap-2"),children:[jsxRuntime.jsx(Z,{children:e.label}),jsxRuntime.jsx("div",{className:"flex gap-2 group-orientation-horizontal:gap-4 group-orientation-vertical:flex-col",children:e.children}),e.description&&jsxRuntime.jsx(j,{children:e.description}),jsxRuntime.jsx(_,{children:typeof e.errorMessage=="function"&&e.validationResult?e.errorMessage(e.validationResult):typeof e.errorMessage=="string"?e.errorMessage:null})]})}function op({isSelected:e,isInvalid:r,isDisabled:t}){let o=[ee(),"w-5 h-5 rounded-full border-2 bg-background-surface transition-all"];return t?o.push("border-border-muted forced-colors:!border-[GrayText]"):r?o.push("border-feedback-error-border group-pressed:border-feedback-error-border dark:group-pressed:border-feedback-error-border forced-colors:!border-[Mark]"):e?o.push("border-[7px] border-action-primary forced-colors:!border-[Highlight] group-pressed:border-action-primary-hover dark:group-pressed:border-action-primary-hover"):o.push("border-border-default group-pressed:border-border-focus dark:group-pressed:border-border-focus"),o.join(" ")}function ja(e){return jsxRuntime.jsx(reactAriaComponents.Radio,{...e,className:W(e.className,"group flex items-center gap-2 text-sm text-text-body transition disabled:text-text-muted dark:text-text-body dark:disabled:text-text-muted forced-colors:disabled:text-[GrayText]"),children:r=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:op(r)}),e.children]})})}var lp=e=>{let r=Ne({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),t=[e.showSearchIcon?"pl-8":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(r,t,e.className)};function xr({label:e,description:r,errorMessage:t,size:o="md",tooltip:a,isRequired:n,transparent:i,showSearchIcon:l,isClearable:s,onClear:d,type:m,validationResult:c,...u}){let[f,g]=Ee__default.default.useState(false),{isFocused:p,handleFocus:x,handleBlur:y}=ke(),N=m==="password";return jsxRuntime.jsx(reactAriaComponents.TextField,{...u,isRequired:n,className:W(u.className,"group flex flex-col"),children:({isDisabled:T,isInvalid:E})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Z,{size:o,tooltip:a,isRequired:n,children:e}),jsxRuntime.jsxs(Te,{children:[l&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 transform",children:jsxRuntime.jsx(h,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-muted"})}),jsxRuntime.jsx(Bo,{size:o,disabled:T,type:N?f?"text":"password":m,value:u.value,defaultValue:u.defaultValue,placeholder:u.placeholder,onFocus:P=>x(P,u.onFocus),onBlur:P=>y(P,u.onBlur),onChange:P=>u.onChange?.(P.target.value),className:lp({isInvalid:E,isDisabled:T,isFocused:p,size:o,transparent:i,showSearchIcon:l,isClearable:s,hasValue:!!u.value,isPassword:N,className:typeof u.className=="string"?u.className:void 0})}),s&&u.value&&!T&&jsxRuntime.jsx(Lo,{onClick:()=>{d?d():u.onChange&&u.onChange("");},size:o}),N&&!T&&jsxRuntime.jsx("button",{type:"button",onClick:()=>g(!f),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body","aria-label":f?"Hide password":"Show password",onMouseDown:P=>{P.preventDefault(),P.stopPropagation();},children:jsxRuntime.jsx(h,{name:f?"EyeSlash":"Eye",size:o==="sm"?16:20,className:"text-text-body"})})]}),r&&jsxRuntime.jsx(j,{size:o,className:"mt-3",children:r}),typeof t=="string"&&jsxRuntime.jsx(_,{size:o,className:"mt-1",children:t}),typeof t=="function"&&c&&jsxRuntime.jsx(_,{size:o,className:"mt-1",children:t(c)})]})})}var qe=({isActive:e=false,onPress:r,children:t})=>jsxRuntime.jsx($,{variant:e?"secondary":"ghost",size:"sm",onPress:r,className:"p-1",children:t});function xp({initialUrl:e,isOpen:r,onClose:t,onSubmit:o}){let[a,n]=Ee.useState(e);return Ee__default.default.useEffect(()=>{n(e);},[e]),jsxRuntime.jsx(reactAriaComponents.Modal,{isDismissable:true,isOpen:r,onOpenChange:l=>!l&&t(),children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"relative",children:jsxRuntime.jsxs("form",{onSubmit:l=>{l.preventDefault(),o(a),t();},children:[jsxRuntime.jsx(dt,{title:"Insert Link",onClose:t}),jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(xr,{label:"URL",type:"url",value:a,onChange:n,autoFocus:true,className:"w-full"})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 border-t border-border-muted p-4",children:[jsxRuntime.jsx($,{variant:"secondary",onPress:t,children:"Cancel"}),jsxRuntime.jsx($,{type:"submit",children:"Save"})]})]})})})}function Ja({initialContent:e="",onChange:r,className:t,isDisabled:o=false,placeholder:a="Start typing..."}){let[n,i]=Ee.useState(false),l=react$1.useEditor({extensions:[pp__default.default.configure({heading:{levels:[1,2]}}),cp__default.default.configure({openOnClick:false,HTMLAttributes:{class:"text-text-link-default hover:text-text-link-hover underline decoration-text-link-default/30 hover:decoration-text-link-hover cursor-pointer"}})],content:e,editable:!o,onUpdate:({editor:m})=>{r?.(m.getHTML());},editorProps:{attributes:{class:tailwindMerge.twMerge("prose prose-sm max-w-none","focus:outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0")}}}),s=()=>{i(true);},d=m=>{m===""?l?.chain().focus().unsetLink().run():l?.chain().focus().setLink({href:m}).run();};return l?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex flex-col rounded-md border border-border-input bg-background-input",o&&"opacity-50",t),children:[l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(menus.BubbleMenu,{editor:l,shouldShow:({editor:m})=>m.isActive("link")&&!n,className:"flex items-center gap-1 rounded-md border border-border-input bg-background-surface p-1 shadow-md",children:[jsxRuntime.jsxs($,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>{let m=l.getAttributes("link").href;window.open(m,"_blank");},children:[jsxRuntime.jsx(h,{name:"ArrowSquareOut",className:"mr-1 h-4 w-4"}),"Open"]}),jsxRuntime.jsxs($,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:s,children:[jsxRuntime.jsx(h,{name:"PencilSimple",className:"mr-1 h-4 w-4"}),"Edit"]}),jsxRuntime.jsxs($,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>l.chain().focus().unsetLink().run(),children:[jsxRuntime.jsx(h,{name:"X",className:"mr-1 h-4 w-4"}),"Remove"]})]}),jsxRuntime.jsx(xp,{isOpen:n,onClose:()=>i(false),onSubmit:d,initialUrl:l.getAttributes("link").href||""})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 border-b border-border-input p-2",children:[jsxRuntime.jsx(qe,{isActive:l.isActive("heading",{level:1}),onPress:()=>l.chain().focus().toggleHeading({level:1}).run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"H1"})}),jsxRuntime.jsx(qe,{isActive:l.isActive("heading",{level:2}),onPress:()=>l.chain().focus().toggleHeading({level:2}).run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"H2"})}),jsxRuntime.jsx(qe,{isActive:l.isActive("bold"),onPress:()=>l.chain().focus().toggleBold().run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"B"})}),jsxRuntime.jsx(qe,{isActive:l.isActive("italic"),onPress:()=>l.chain().focus().toggleItalic().run(),children:jsxRuntime.jsx("span",{className:"text-xs italic",children:"I"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(qe,{isActive:l.isActive("bulletList"),onPress:()=>l.chain().focus().toggleBulletList().run(),children:jsxRuntime.jsx(h,{name:"ListBullets",className:"h-4 w-4"})}),jsxRuntime.jsx(qe,{isActive:l.isActive("orderedList"),onPress:()=>l.chain().focus().toggleOrderedList().run(),children:jsxRuntime.jsx(h,{name:"ListNumbers",className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(qe,{isActive:l.isActive("link"),onPress:s,children:jsxRuntime.jsx(h,{name:"PaperclipHorizontal",className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:"relative min-h-[200px] w-full",children:[jsxRuntime.jsx(react$1.EditorContent,{editor:l,className:tailwindMerge.twMerge("w-full p-4","[&_.ProseMirror]:min-h-[inherit]","[&_.ProseMirror]:outline-none","[&_.ProseMirror_h1]:mb-4 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold","[&_.ProseMirror_h2]:mb-3 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-semibold","[&_.ProseMirror_p]:mb-2","[&_.ProseMirror_ul]:mb-2 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ul]:list-disc","[&_.ProseMirror_ol]:mb-2 [&_.ProseMirror_ol]:ml-6 [&_.ProseMirror_ol]:list-decimal","[&_.ProseMirror_li]:mb-1","[&_.ProseMirror_blockquote]:border-l-4 [&_.ProseMirror_blockquote]:border-border-muted [&_.ProseMirror_blockquote]:pl-4 [&_.ProseMirror_blockquote]:italic","[&_.ProseMirror_code]:rounded [&_.ProseMirror_code]:bg-background-muted [&_.ProseMirror_code]:px-1 [&_.ProseMirror_code]:py-0.5 [&_.ProseMirror_code]:font-mono [&_.ProseMirror_code]:text-sm","[&_.ProseMirror_pre]:rounded-md [&_.ProseMirror_pre]:bg-background-muted [&_.ProseMirror_pre]:p-3 [&_.ProseMirror_pre]:font-mono [&_.ProseMirror_pre]:text-sm","[&_.ProseMirror_hr]:border-border-muted",o&&"pointer-events-none")}),l.isEmpty&&!o&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-4 top-4 text-text-muted",children:a})]})]}):null}var vp={sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base",xl:"h-14 text-lg"},Cp={sm:14,md:16,lg:18,xl:20},Sp=({isSelected:e,isFirst:r,isLast:t,isDisabled:o})=>tailwindMerge.twMerge(ee(),"px-3 text-center transition cursor-pointer forced-color-adjust-none -ml-px first:ml-0 flex items-center justify-center h-full gap-2",e?"bg-background-selected text-text-body font-semibold forced-colors:!bg-[Highlight] forced-colors:!text-[HighlightText]":"text-text-muted hover:bg-background-hover pressed:bg-background-selected forced-colors:!bg-[ButtonFace] forced-colors:!text-[ButtonText] hover:font-semibold",!t&&"border-r border-border-muted",o&&"bg-background-muted text-text-disabled forced-colors:!bg-[ButtonFace] forced-colors:!text-[GrayText] border-border-muted forced-colors:border-[GrayText] cursor-not-allowed");function rn({options:e,value:r,onChange:t,size:o="md",className:a,isDisabled:n,"aria-label":i}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-flex overflow-hidden rounded-md border-2 border-border-muted",vp[o],a),role:"group","aria-label":i,children:e.map((l,s)=>jsxRuntime.jsxs(reactAriaComponents.ToggleButton,{isSelected:r===l.id,onChange:()=>t(l.id),className:Sp({isSelected:r===l.id,isFirst:s===0,isLast:s===e.length-1,isDisabled:n}),isDisabled:n,"aria-label":l.label,children:[l.icon&&jsxRuntime.jsx(h,{name:l.icon,size:Cp[o]}),l.label]},l.id))})}function Tp(e="md"){return `flex-1 text-start data-[placeholder]:text-text-placeholder ${H[e].text}`}function Rp(){let e=Ee__default.default.useCallback((t,o)=>{o?.(t);},[]),r=Ee__default.default.useCallback((t,o)=>{o?.(t);},[]);return {handleFocus:e,handleBlur:r}}function cn({label:e,description:r,errorMessage:t,children:o,items:a,renderItem:n,size:i="md",selectedKey:l,defaultSelectedKey:s,onSelectionChange:d,placeholder:m,showErrors:c=false,tooltip:u,isRequired:f,transparent:g,...p}){let[x,y]=Ee.useState(null),[N,T]=Ee.useState(null),E=l??x??s,{handleFocus:P,handleBlur:v}=Rp(),M=F=>{d?d(F):y(F);},C=Ee.useRef(null),L=Ee.useRef(null);return jsxRuntime.jsx(reactAriaComponents.Select,{...p,selectedKey:E,defaultSelectedKey:s,onSelectionChange:M,placeholder:m,className:W(p.className,"group flex w-full flex-col"),ref:C,onOpenChange:F=>{F&&L.current?T(L.current.offsetWidth):F||C.current?.blur();},children:({isDisabled:F,isInvalid:V,isOpen:b})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Z,{size:i,tooltip:u,isRequired:f,children:e}),jsxRuntime.jsx(Te,{children:jsxRuntime.jsx("div",{ref:L,children:jsxRuntime.jsxs($,{variant:"unstyled",className:tailwindMerge.twMerge(Ne({isInvalid:V||c&&!!t,isDisabled:F,isFocused:b,transparent:g,size:i}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:D=>P(D,p.onFocus),onBlur:D=>v(D,p.onBlur),"data-open":b,children:[jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:Tp(i)}),jsxRuntime.jsx(h,{name:"CaretDown","aria-hidden":true,className:tailwindMerge.twMerge("h-4 w-4 text-text-body group-disabled:text-gray-200 forced-colors:text-[ButtonText] transition-transform",b&&"rotate-180")})]})})}),r&&jsxRuntime.jsx(j,{size:i,className:"mt-3",children:r}),c&&jsxRuntime.jsx(_,{size:i,className:"mt-3 text-feedback-error-text",children:typeof t=="function"&&p.validationResult?t(p.validationResult):typeof t=="string"?t:null}),jsxRuntime.jsx(Ae,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm",style:{minWidth:N?`${N}px`:void 0},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:a,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:n&&a?D=>jsxRuntime.jsx($e,{id:D.id,textValue:D.label,size:i,children:n(D)},D.id):o})})]})})}function dn({label:e,description:r,tooltip:t,errorMessage:o,size:a="md",className:n,value:i,defaultValue:l=0,onChange:s,min:d=0,max:m=100,step:c=1,disabled:u,showValue:f=true}){let g=typeof i=="number",[p,x]=Ee__default.default.useState(l),y=g?i:p,N=Math.min(Math.max(y,d),m),T=Math.max(m-d,1e-5),E=(N-d)/T*100;return jsxRuntime.jsxs("div",{className:W(n,"group flex w-full flex-col gap-1"),children:[e&&jsxRuntime.jsx(Z,{size:a,tooltip:t,className:"mb-1",children:e}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("div",{className:"relative w-full select-none",children:[jsxRuntime.jsx("div",{className:"h-1.5 w-full rounded-full bg-background-muted"}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-0 top-1/2 h-1.5 -translate-y-1/2 rounded-full bg-action-primary",style:{width:`${E}%`},"aria-hidden":true}),jsxRuntime.jsx("input",{type:"range",min:d,max:m,step:c,value:y,disabled:u,"aria-invalid":!!o,onChange:P=>{let v=Number(P.currentTarget.value);g||x(v),s?.(v);},className:tailwindMerge.twMerge("absolute inset-0 w-full cursor-pointer appearance-none bg-transparent outline-none","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-background-input [&::-webkit-slider-thumb]:border [&::-webkit-slider-thumb]:border-border-input","hover:[&::-webkit-slider-thumb]:shadow-sm focus-visible:[&::-webkit-slider-thumb]:outline-2 focus-visible:[&::-webkit-slider-thumb]:outline-border-focus","[&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-background-input [&::-moz-range-thumb]:border [&::-moz-range-thumb]:border-border-input","hover:[&::-moz-range-thumb]:shadow-sm focus-visible:[&::-moz-range-thumb]:outline-2 focus-visible:[&::-moz-range-thumb]:outline-border-focus",u?"cursor-not-allowed opacity-60":void 0)})]}),f&&jsxRuntime.jsx("div",{className:"min-w-10 text-right text-sm text-text-heading tabular-nums",children:Math.round(N)})]}),r&&jsxRuntime.jsx(j,{className:"mt-2 text-text-muted",children:r}),o&&jsxRuntime.jsx(_,{className:"mt-1",children:o})]})}function Fp({isSelected:e,isDisabled:r}){return ["flex h-4 w-7 px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent",ee,e?"bg-gray-700 dark:bg-zinc-300 forced-colors:!bg-[Highlight] group-pressed:bg-gray-800 dark:group-pressed:bg-zinc-200":"bg-gray-400 dark:bg-zinc-400 group-pressed:bg-gray-500 dark:group-pressed:bg-zinc-300",r?"bg-gray-200 dark:bg-zinc-700 forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]":""].filter(Boolean).join(" ")}function Dp({isSelected:e,isDisabled:r}){return ["h-3 w-3 transform rounded-full bg-white dark:bg-zinc-900 outline-none shadow transition duration-200 ease-in-out",e?"translate-x-[100%]":"translate-x-0",r?"forced-colors:outline-[GrayText]":""].filter(Boolean).join(" ")}function un({children:e,...r}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...r,className:W(r.className,"group flex items-center gap-2 text-sm text-gray-800 transition disabled:text-gray-300 dark:text-zinc-200 dark:disabled:text-zinc-600 forced-colors:disabled:text-[GrayText]"),children:t=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:Fp(t),children:jsxRuntime.jsx("span",{className:Dp(t)})}),e]})})}function Hp({orientation:e,className:r=""}){return `flex flex-col w-full ${{horizontal:"",vertical:"flex-row"}[e]||""} ${r}`.trim()}function mn(e){return jsxRuntime.jsx("div",{className:"w-full",children:jsxRuntime.jsx(reactAriaComponents.Tabs,{...e,className:reactAriaComponents.composeRenderProps(e.className,(r,t)=>Hp({...t,className:r}))})})}function Op({orientation:e,className:r=""}){return `flex gap-10 relative after:absolute after:bottom-0 after:left-0 after:right-0 after:h-[2px] after:bg-border-default ${{horizontal:"flex-row w-full",vertical:"flex-col items-start"}[e]||""} ${r}`.trim()}function pn(e){return jsxRuntime.jsx(reactAriaComponents.TabList,{...e,className:reactAriaComponents.composeRenderProps(e.className,(r,t)=>Op({...t,className:r||""}))})}function Gp({isSelected:e,isDisabled:r,className:t=""}){let o="flex items-center cursor-default px-1 py-2 font-medium transition hover:cursor-pointer relative",a=ee(),n="";return r?n="text-gray-200 forced-colors:text-[GrayText] selected:text-gray-300 forced-colors:selected:text-[HighlightText] selected:bg-gray-200 forced-colors:selected:bg-[GrayText]":e?n="text-action-primary border-b-2 border-action-primary z-10 forced-colors:bg-[Highlight]":n="text-text-muted hover:text-text-body",`${o} ${a} ${n} ${t}`.trim()}function fn(e){return jsxRuntime.jsx(reactAriaComponents.Tab,{...e,"data-testid":e.id?`tab-${e.id}`:void 0,className:reactAriaComponents.composeRenderProps(e.className,(r,t)=>Gp({...t,className:r,isSelected:t.isSelected}))})}function Wp({className:e=""}){let r="block w-full mt-4 text-text-body",t=ee();return `${r} ${t} ${e}`.trim()}function gn(e){return jsxRuntime.jsx(reactAriaComponents.TabPanel,{...e,className:reactAriaComponents.composeRenderProps(e.className,(r,t)=>Wp({...t,className:r||""}))})}var Up=e=>{let r=Ne({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),t=`min-h-[100px] py-2 ${e.isDisabled?"resize-none":"resize-y"}`;return tailwindMerge.twMerge(r,t,e.className)};function bn({label:e,description:r,errorMessage:t,size:o="md",tooltip:a,required:n,transparent:i,isInvalid:l,isDisabled:s,className:d,validationResult:m,...c}){let{isFocused:u,handleFocus:f,handleBlur:g}=ke();return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Z,{size:o,tooltip:a,isRequired:n,children:e}),jsxRuntime.jsx(Te,{children:jsxRuntime.jsx("textarea",{...c,required:n,onFocus:p=>{c.onFocus&&c.onFocus(p),f(p);},onBlur:p=>{c.onBlur&&c.onBlur(p),g(p);},className:Up({isInvalid:l,isDisabled:s,isFocused:u,size:o,transparent:i,className:d}),disabled:s})}),r&&jsxRuntime.jsx(j,{size:o,className:"mt-3",children:r}),typeof t=="string"&&jsxRuntime.jsx(_,{size:o,className:"mt-1",children:t}),typeof t=="function"&&m&&jsxRuntime.jsx(_,{size:o,className:"mt-1",children:t(m)})]})})}function vn({label:e,description:r,errorMessage:t,size:o="md",tooltip:a,required:n,transparent:i,isInvalid:l,isDisabled:s,className:d,validationResult:m,value:c="",onChange:u,chips:f=[],onChipsChange:g,triggerPattern:p="{{",onTriggerDetected:x,onTriggerDismissed:y,renderChip:N,chipVariant:T="primary",chipSize:E,...P}){let v=Ee.useRef(null),{isFocused:M,handleFocus:C,handleBlur:L}=ke(),F=E||"sm",V=Ee.useRef(null),b=Ee.useCallback(k=>{let I="",G=w=>{if(w.nodeType===Node.TEXT_NODE){if(!w.parentElement?.closest("[data-chip-id]")){let R=w.textContent||"";I+=R;}}else if(w.nodeType===Node.ELEMENT_NODE){let S=w;if(S.hasAttribute("data-chip-id")){let R=S.getAttribute("data-chip-id");I+=`{{${R}}}`;return}else if(S.tagName==="BR"){I+=`
3
- `;return}else S.tagName;}for(let S=0;S<w.childNodes.length;S++)G(w.childNodes[S]);};return G(k),I},[]),D=Ee.useCallback((k,I)=>{let G=document.createTreeWalker(k,NodeFilter.SHOW_TEXT,{acceptNode:A=>{let te=A.parentElement;return te&&te.closest("[data-chip-id]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),w=G.nextNode(),S=Math.max(0,I);for(;w;){let A=w.nodeValue||"";if(A.length>=S){let te=document.createRange();te.setStart(w,S),te.collapse(true);let Fe=window.getSelection();Fe?.removeAllRanges(),Fe?.addRange(te);return}S-=A.length,w=G.nextNode();}let R=window.getSelection(),B=document.createRange();B.selectNodeContents(k),B.collapse(false),R?.removeAllRanges(),R?.addRange(B);},[]);Ee.useEffect(()=>{v.current&&!c&&v.current.textContent!==""&&(v.current.textContent="");},[c]),Ee.useLayoutEffect(()=>{if(v.current){if(c===""){if(M)try{v.current.focus({preventScroll:!0}),D(v.current,0);}catch{}return}if(V.current!=null)try{D(v.current,V.current);}finally{V.current=null;}}},[c,D,M]);let Q=Ee.useCallback((k,I)=>{if(u?.(k),k===""){y?.();return}if(p&&x&&I!==void 0){let G=k.slice(0,I),w=typeof p=="string"?new RegExp(`\\${p}([^\\s]*)$`):p,S=G.match(w);if(S){let R=S[1]||"",B=I-S[0].length;x({query:R,position:I,startIndex:B});}else y?.();}},[u,p,x,y]),U=Ee.useCallback(k=>{if(!g||!u)return;let I=f.filter(w=>w.id!==k);g(I);let G=c.replace(new RegExp(`\\{\\{${k}\\}\\}`,"g"),"");u(G);},[f,g,c,u]),ie=Ee.useCallback(k=>N?N(k,()=>U(k.id)):jsxRuntime.jsx(jt,{variant:T,size:F,onRemove:s?void 0:()=>U(k.id),isDisabled:s,className:"py-0.5 px-1.5 gap-1 text-xs leading-none rounded-md",children:k.label},k.id),[N,T,F,U,s]),ce=()=>{let k=Ne({isInvalid:l,isDisabled:s,isFocused:M,transparent:i,size:o}),I=`min-h-[100px] py-2 px-3 ${s?"resize-none":"resize-y"}`,G=tailwindMerge.twMerge("focus:outline-none overflow-auto","[&_[data-chip-id]::selection]:bg-action-primary/20","[&:empty]:before:content-[attr(data-placeholder)] [&:empty]:before:text-text-placeholder [&:empty]:before:pointer-events-none");return tailwindMerge.twMerge(k,I,G,d)},Pe=()=>c?c.split(/(\{\{[^}]+\}\})/g).map((I,G)=>{let w=I.match(/\{\{([^}]+)\}\}/);if(w){let S=w[1],R=f.find(B=>B.id===S);if(R)return jsxRuntime.jsx("span",{className:"inline-block align-baseline cursor-pointer",contentEditable:false,suppressContentEditableWarning:true,"data-chip-id":S,style:{userSelect:"none",verticalAlign:"baseline",lineHeight:"1"},onClick:B=>{B.preventDefault();let A=window.getSelection(),te=document.createRange();te.selectNode(B.currentTarget),A?.removeAllRanges(),A?.addRange(te);},children:ie(R)},`chip-${S}-${G}`)}return I.includes(`
1
+ 'use strict';var Ve=require('react'),reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),react=require('@phosphor-icons/react'),jsxRuntime=require('react/jsx-runtime'),reactStately=require('react-stately');require('luxon');var lucideReact=require('lucide-react'),Td=require('react-ace');require('ace-builds/src-noconflict/mode-json'),require('ace-builds/src-noconflict/mode-javascript'),require('ace-builds/src-noconflict/mode-typescript'),require('ace-builds/src-noconflict/mode-html'),require('ace-builds/src-noconflict/mode-css'),require('ace-builds/src-noconflict/mode-markdown'),require('ace-builds/src-noconflict/mode-yaml'),require('ace-builds/src-noconflict/mode-xml'),require('ace-builds/src-noconflict/mode-python'),require('ace-builds/src-noconflict/mode-sql'),require('ace-builds/src-noconflict/theme-github_dark'),require('ace-builds/src-noconflict/theme-github'),require('ace-builds/src-noconflict/ext-language_tools');var curve=require('@visx/curve'),shape=require('@visx/shape'),framerMotion=require('framer-motion'),axis=require('@visx/axis'),scale=require('@visx/scale'),d3Array=require('d3-array'),responsive=require('@visx/responsive'),fileSaver=require('file-saver'),nu=require('papaparse'),Em=require('react-map-gl');require('mapbox-gl/dist/mapbox-gl.css');var reactDom=require('react-dom'),Dp=require('@tiptap/extension-link'),react$1=require('@tiptap/react'),menus=require('@tiptap/react/menus'),zp=require('@tiptap/starter-kit');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ve__default=/*#__PURE__*/_interopDefault(Ve);var Td__default=/*#__PURE__*/_interopDefault(Td);var nu__default=/*#__PURE__*/_interopDefault(nu);var Em__default=/*#__PURE__*/_interopDefault(Em);var Dp__default=/*#__PURE__*/_interopDefault(Dp);var zp__default=/*#__PURE__*/_interopDefault(zp);var qn=Object.defineProperty;var Zn=(e,t,o)=>t in e?qn(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var To=(e,t,o)=>Zn(e,typeof t!="symbol"?t+"":t,o);function Ot(e,t=300){let[o,r]=Ve.useState(e);return Ve.useEffect(()=>{let a=setTimeout(()=>r(e),t);return ()=>clearTimeout(a)},[e,t]),o}function Mr(e,t){let[o,r]=Ve.useState(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.error(`Error reading localStorage key "${e}":`,i),t}});Ve.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,JSON.stringify(o));}catch(i){console.error(`Error writing to localStorage key "${e}":`,i);}},[e,o]);let a=Ve.useCallback(i=>{try{r(l=>i instanceof Function?i(l):i);}catch(l){console.error(`Error setting value for localStorage key "${e}":`,l);}},[e]),n=Ve.useCallback(()=>{try{typeof window<"u"&&window.localStorage.removeItem(e),r(t);}catch(i){console.error(`Error removing localStorage key "${e}":`,i);}},[e,t]);return [o,a,n]}var ml=()=>jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),pl=()=>jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),Br={AppWindow:react.AppWindow,ArrowCircleUp:react.ArrowCircleUp,ArrowDown:react.ArrowDown,ArrowLeft:react.ArrowLeft,ArrowLineLeft:react.ArrowLineLeft,ArrowRight:react.ArrowRight,ArrowSquareOut:react.ArrowSquareOut,ArrowUp:react.ArrowUp,ArrowsClockwise:react.ArrowsClockwise,BatteryCharging:react.BatteryCharging,BatteryEmpty:react.BatteryEmpty,BatteryFull:react.BatteryFull,BatteryHigh:react.BatteryHigh,BatteryLow:react.BatteryLow,BatteryMedium:react.BatteryMedium,BatteryWarning:react.BatteryWarning,BookOpen:react.BookOpen,BookmarkSimple:react.BookmarkSimple,BracketsCurly:react.BracketsCurly,Broadcast:react.Broadcast,Buildings:react.Buildings,CalendarBlank:react.CalendarBlank,CaretDown:react.CaretDown,CaretLeft:react.CaretLeft,CaretRight:react.CaretRight,CaretUp:react.CaretUp,CarSimple:react.CarSimple,ChargingStation:react.ChargingStation,ChartBar:react.ChartBar,ChartLine:react.ChartLine,ChartLineUp:react.ChartLineUp,Check:react.Check,CheckCircle:react.CheckCircle,CheckSquare:react.CheckSquare,Circle:react.Circle,CircleDashed:react.CircleDashed,CircleNotch:react.CircleNotch,ClipboardText:react.ClipboardText,ClockCountdown:react.ClockCountdown,Cloud:react.Cloud,CloudArrowDown:react.CloudArrowDown,CloudFog:react.CloudFog,CloudLightning:react.CloudLightning,CloudRain:react.CloudRain,CloudSnow:react.CloudSnow,CloudSun:react.CloudSun,Code:react.Code,Columns:react.Columns,Copy:react.Copy,Cursor:react.Cursor,Database:react.Database,DotsSix:react.DotsSix,DotsThree:react.DotsThree,DownloadSimple:react.DownloadSimple,EnvelopeSimple:react.EnvelopeSimple,Eye:react.Eye,EyeClosed:react.EyeClosed,EyeSlash:react.EyeSlash,Export:react.Export,FireSimple:react.FireSimple,Flag:react.Flag,Gauge:react.Gauge,GearSix:react.GearSix,GitBranch:react.GitBranch,HandPointing:react.HandPointing,Handshake:react.Handshake,Info:react.Info,IntersectSquare:react.IntersectSquare,Lightning:react.Lightning,LightningSlash:react.LightningSlash,List:react.List,ListBullets:react.ListBullets,ListNumbers:react.ListNumbers,Lock:react.Lock,MagnifyingGlass:react.MagnifyingGlass,MapPin:react.MapPin,MapPinArea:react.MapPinArea,MaskHappy:react.MaskHappy,Moon:react.Moon,PaperPlaneRight:react.PaperPlaneRight,PaperPlaneTilt:react.PaperPlaneTilt,PaperclipHorizontal:react.PaperclipHorizontal,PencilSimple:react.PencilSimple,Plugs:react.Plugs,PlugsConnected:react.PlugsConnected,Plus:react.Plus,Power:react.Power,Pulse:react.Pulse,Question:react.Question,Repeat:react.Repeat,Rocket:react.Rocket,ShareNetwork:react.ShareNetwork,ShieldCheck:react.ShieldCheck,SignOut:react.SignOut,SlackLogo:react.SlackLogo,Sliders:react.Sliders,SlidersHorizontal:react.SlidersHorizontal,Snowflake:react.Snowflake,SolarPanel:react.SolarPanel,Square:react.Square,SquaresFour:react.SquaresFour,Stack:react.Stack,Sun:react.Sun,Terminal:react.Terminal,ThermometerCold:react.ThermometerCold,ThermometerHot:react.ThermometerHot,ThermometerSimple:react.ThermometerSimple,Trash:react.Trash,TreeEvergreen:react.TreeEvergreen,User:react.User,UserCircle:react.UserCircle,UserPlus:react.UserPlus,Users:react.Users,UsersFour:react.UsersFour,Warning:react.Warning,WarningCircle:react.WarningCircle,WebhooksLogo:react.WebhooksLogo,Wind:react.Wind,X:react.X,TextureMenuLight:ml,TextureMenuDark:pl,WaveSine:react.WaveSine},h=Ve.memo(({name:e,size:t=24,color:o,weight:r="regular",className:a,title:n,ariaLabel:i,grow:l,variant:s="default",rounded:c=false,bgColor:m,...d})=>{if(!e)return null;let u=Br[e];if(!u)return process.env.NODE_ENV==="development"&&console.error(`Icon with name "${e}" does not exist.`),null;let f=e==="TextureMenuLight"||e==="TextureMenuDark",g=i||n||`${e} icon`,p=s==="container"?"bg-[#F3F4F6":s==="brand"?"bg-gray-light":"",x=tailwindMerge.twMerge("inline-flex items-center justify-center w-12 h-12 p-3 rounded-xl bg-brand-light",m,c?"rounded-md":"",l?"w-full h-full":"",a),v=["inline-flex items-center justify-center",m||p,c?"rounded-md":"",l?"w-full h-full":`w-[${t}px] h-[${t}px]`].filter(Boolean).join(" "),S=jsxRuntime.jsx(u,{size:l?void 0:t,color:s==="brand"&&!f?void 0:o,className:s==="brand"&&!f?"text-brand-dark w-6 h-6":a||"",weight:r,"aria-label":g,"data-testid":`${e}-icon`,...d});return s==="brand"?jsxRuntime.jsx("div",{className:x,children:S}):s==="default"?S:jsxRuntime.jsx("div",{className:v,children:S})});h.displayName="Icon";function Er({children:e,items:t,className:o,align:r="left",textAlign:a="left",size:n="md",onAction:i}){return jsxRuntime.jsx("div",{className:o,children:jsxRuntime.jsxs(reactAriaComponents.MenuTrigger,{children:[e,jsxRuntime.jsx(reactAriaComponents.Popover,{className:tailwindMerge.twMerge("w-fit min-w-[180px] overflow-auto rounded-md border border-border-default","bg-background-surface p-1 shadow-lg","entering:animate-in entering:fade-in entering:zoom-in-95","exiting:animate-out exiting:fade-out exiting:zoom-out-95"),placement:r==="right"?"bottom end":"bottom start",children:jsxRuntime.jsx(reactAriaComponents.Menu,{className:"outline-none",children:t.map(l=>jsxRuntime.jsx(hl,{id:l.id,onAction:()=>l.onAction?.()||i?.(l),textAlign:a,size:n,iconName:l.iconName,isDisabled:l.disabled,variant:l.variant,"data-testid":l.testId,children:l.name},l.id))})})]})})}function hl({textAlign:e="left",iconName:t,size:o="md",isDisabled:r,children:a,variant:n="default",...i}){let l={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base"},s={default:"text-text-body hover:bg-background-hover focus:bg-background-hover",destructive:"text-feedback-error-text hover:bg-feedback-error-background focus:bg-feedback-error-background"};return jsxRuntime.jsxs(reactAriaComponents.MenuItem,{...i,isDisabled:r,className:tailwindMerge.twMerge("group box-border flex w-full cursor-pointer items-center rounded-sm outline-none transition-colors",l[o],s[n],e==="right"?"justify-end":"justify-start",r&&"pointer-events-none opacity-50"),children:[t&&e==="left"&&jsxRuntime.jsx(h,{name:t,size:o==="sm"?16:20,className:"mr-2 flex-shrink-0"}),jsxRuntime.jsx("span",{className:"flex-1",children:a}),t&&e==="right"&&jsxRuntime.jsx(h,{name:t,size:o==="sm"?16:20,className:"ml-2 flex-shrink-0"})]})}var Gt=({className:e,showWordmark:t=true,width:o,fill:r})=>{let a,n;if(r?r.startsWith("fill-")?n=r:a=r:e?n=e:a="var(--color-text-body)",t){let s=o||270,c=s/270*80;return jsxRuntime.jsxs("svg",{width:s,height:c,viewBox:"0 0 270 80",xmlns:"http://www.w3.org/2000/svg",className:n,style:a?{fill:a}:void 0,children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_796_283)",children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.223654 20.2934C0.417233 19.8234 0.873598 19.517 1.37984 19.517H20.5909C21.282 19.517 21.8422 20.0798 21.8422 20.774V40.049C21.8422 40.5572 21.5375 41.0155 21.0702 41.2102C20.6028 41.405 20.0647 41.2977 19.7067 40.9385L0.495628 21.6635C0.137428 21.3041 0.030075 20.7633 0.223654 20.2934ZM4.40349 22.0311L19.3396 37.017V22.0311H4.40349Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 20.2934C38.8394 19.8234 39.2958 19.517 39.802 19.517H59.013C59.7041 19.517 60.2642 20.0798 60.2642 20.774V40.049C60.2642 40.5572 59.9597 41.0155 59.4923 41.2102C59.025 41.405 58.4867 41.2977 58.1289 40.9385L38.9178 21.6635C38.5595 21.3041 38.4522 20.7633 38.6458 20.2934ZM42.8255 22.0311L57.7618 37.017V22.0311H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4347 58.8447C19.6283 58.3747 20.0847 58.0685 20.5909 58.0685H39.802C40.493 58.0685 41.0532 58.6312 41.0532 59.3255V78.6005C41.0532 79.1087 40.7486 79.567 40.2813 79.7617C39.8139 79.9562 39.2757 79.849 38.9178 79.49L19.7067 60.215C19.3485 59.8555 19.2411 59.3147 19.4347 58.8447ZM23.6146 60.5825L38.5508 75.5682V60.5825H23.6146Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 58.1643C39.79 57.9695 40.3283 58.0768 40.6861 58.436L59.8972 77.711C60.2555 78.0703 60.3628 78.6113 60.1692 79.081C59.9756 79.551 59.5192 79.8575 59.013 79.8575H39.802C39.1109 79.8575 38.5508 79.2948 38.5508 78.6005V59.3255C38.5508 58.8173 38.8554 58.359 39.3227 58.1643ZM41.0532 62.3575V77.3433H55.9893L41.0532 62.3575Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 19.6129C39.79 19.4182 40.3283 19.5254 40.6861 19.8846L59.8972 39.1595C60.2555 39.519 60.3628 40.0598 60.1692 40.5298C59.9756 40.9995 59.5192 41.306 59.013 41.306H39.802C39.1109 41.306 38.5508 40.7433 38.5508 40.049V20.7741C38.5508 20.2658 38.8554 19.8075 39.3227 19.6129ZM41.0532 23.8061V38.792H55.9893L41.0532 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 38.8885C39.79 38.694 40.3283 38.8012 40.6861 39.1602L59.8972 58.4352C60.2555 58.7945 60.3628 59.3355 60.1692 59.8055C59.9756 60.2752 59.5192 60.5817 59.013 60.5817H39.802C39.1109 60.5817 38.5508 60.019 38.5508 59.3247V40.0497C38.5508 39.5415 38.8554 39.0832 39.3227 38.8885ZM41.0532 43.0817V58.0675H55.9893L41.0532 43.0817Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 39.569C38.8394 39.0992 39.2958 38.7927 39.802 38.7927H59.013C59.7041 38.7927 60.2642 39.3555 60.2642 40.0497V59.3247C60.2642 59.833 59.9597 60.2912 59.4923 60.486C59.025 60.6805 58.4867 60.5732 58.1289 60.2142L38.9178 40.9392C38.5595 40.5797 38.4522 40.039 38.6458 39.569ZM42.8255 41.3067L57.7618 56.2927V41.3067H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 58.8447C38.8394 58.3747 39.2958 58.0685 39.802 58.0685H59.013C59.7041 58.0685 60.2642 58.6312 60.2642 59.3255V78.6005C60.2642 79.1087 59.9597 79.567 59.4923 79.7617C59.025 79.9562 58.4867 79.849 58.1289 79.49L38.9178 60.215C38.5595 59.8555 38.4522 59.3147 38.6458 58.8447ZM42.8255 60.5825L57.7618 75.5682V60.5825H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 19.6129C59.0011 19.4182 59.5394 19.5254 59.8972 19.8846L79.1083 39.1595C79.4666 39.519 79.5739 40.0598 79.3803 40.5298C79.1867 40.9995 78.7303 41.306 78.2241 41.306H59.013C58.322 41.306 57.7618 40.7433 57.7618 40.049V20.7741C57.7618 20.2658 58.0664 19.8075 58.5338 19.6129ZM60.2643 23.8061V38.792H75.2006L60.2643 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 0.338803C59.0011 0.144135 59.5394 0.251385 59.8972 0.610565L79.1083 19.8855C79.4666 20.2449 79.5739 20.7857 79.3803 21.2556C79.1867 21.7256 78.7303 22.032 78.2241 22.032H59.013C58.322 22.032 57.7618 21.4692 57.7618 20.775V1.50003C57.7618 0.99174 58.0664 0.533468 58.5338 0.338803ZM60.2643 4.53208V19.5179H75.2006L60.2643 4.53208Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8569 20.2934C58.0505 19.8234 58.5069 19.517 59.013 19.517H78.2241C78.9151 19.517 79.4753 20.0798 79.4753 20.774V40.049C79.4753 40.5572 79.1707 41.0155 78.7034 41.2102C78.236 41.405 77.6978 41.2977 77.3399 40.9385L58.1289 21.6635C57.7705 21.3041 57.6633 20.7633 57.8569 20.2934ZM62.0365 22.0311L76.9729 37.017V22.0311H62.0365Z"}),jsxRuntime.jsx("path",{d:"M269.838 49.4457H249.005C249.266 51.801 250.162 53.6985 251.695 55.1377C253.225 56.577 255.134 57.2967 257.416 57.2967C259.307 57.2967 260.887 56.8715 262.159 56.021C263.463 55.1377 264.408 53.9927 264.996 52.5862H269.251C268.502 54.9415 267.084 56.937 264.996 58.5725C262.943 60.208 260.414 61.026 257.416 61.026C255.069 61.026 252.917 60.4697 250.961 59.3575C249.037 58.2127 247.504 56.6587 246.363 54.696C245.255 52.7332 244.7 50.558 244.7 48.17C244.7 45.782 245.255 43.6067 246.363 41.644C247.504 39.6812 249.037 38.1437 250.961 37.0315C252.917 35.8867 255.069 35.3142 257.416 35.3142C259.73 35.3142 261.833 35.8702 263.724 36.9825C265.615 38.0947 267.098 39.6485 268.176 41.644C269.283 43.6395 269.838 45.913 269.838 48.4645V49.4457ZM257.416 39.0432C255.263 39.0432 253.439 39.6812 251.939 40.957C250.47 42.2327 249.542 43.9337 249.152 46.06H265.583C265.192 43.9992 264.262 42.3145 262.796 41.006C261.36 39.6975 259.568 39.0432 257.416 39.0432Z"}),jsxRuntime.jsx("path",{d:"M228.356 60.5352V35.8049H232.219V39.7794H232.464C233.05 38.5689 233.963 37.5712 235.202 36.7862C236.474 35.9684 237.974 35.5594 239.701 35.5594H243.125V39.4359H239.701C237.517 39.4359 235.757 40.1554 234.42 41.5949C233.083 43.0342 232.414 44.9152 232.414 47.2377V60.5352H228.356Z"}),jsxRuntime.jsx("path",{d:"M208.607 61.0259C205.64 61.0259 203.326 60.1262 201.663 58.3272C200 56.4952 199.169 53.8947 199.169 50.5252V35.8047H203.228V49.8874C203.228 52.2427 203.766 54.0744 204.842 55.3829C205.95 56.6587 207.532 57.2967 209.586 57.2967C211.02 57.2967 212.308 56.9694 213.449 56.3152C214.623 55.6284 215.536 54.6959 216.188 53.5184C216.84 52.3407 217.166 50.9997 217.166 49.4949V35.8047H221.225V60.5352H217.313V56.5607H217.068C216.286 57.9019 215.161 58.9814 213.694 59.7992C212.226 60.6169 210.531 61.0259 208.607 61.0259Z"}),jsxRuntime.jsx("path",{d:"M186.736 39.534V56.806H194.756V60.5352H182.677V39.534H177.199V35.8047H182.677V29.5732H186.736V35.8047H193.24V39.534H186.736Z"}),jsxRuntime.jsx("path",{d:"M156.585 60.5352H151.988L158.394 48.0227L152.33 35.8047H156.976L162.062 46.0599H165.388L170.474 35.8047H175.022L168.958 48.0227L175.365 60.5352H170.67L165.29 49.7892H162.013L156.585 60.5352Z"}),jsxRuntime.jsx("path",{d:"M150.138 49.1315H129.304C129.565 51.4867 130.461 53.3842 131.994 54.8235C133.526 56.2627 135.433 56.9825 137.715 56.9825C139.606 56.9825 141.188 56.5572 142.459 55.7067C143.763 54.8235 144.709 53.6785 145.296 52.272H149.551C148.801 54.6272 147.382 56.6227 145.296 58.2582C143.242 59.8937 140.715 60.7118 137.715 60.7118C135.368 60.7118 133.216 60.1555 131.26 59.0432C129.336 57.8985 127.804 56.3445 126.663 54.3817C125.554 52.419 125 50.2437 125 47.8557C125 45.4677 125.554 43.2925 126.663 41.3298C127.804 39.367 129.336 37.8295 131.26 36.7173C133.216 35.5725 135.368 35 137.715 35C140.03 35 142.133 35.556 144.024 36.6682C145.915 37.7805 147.399 39.3342 148.475 41.3298C149.583 43.3252 150.138 45.5987 150.138 48.1502V49.1315ZM137.715 38.729C135.564 38.729 133.738 39.367 132.238 40.6427C130.771 41.9185 129.842 43.6195 129.45 45.7458H145.883C145.491 43.685 144.562 42.0002 143.095 40.6917C141.661 39.3832 139.867 38.729 137.715 38.729Z"}),jsxRuntime.jsx("path",{d:"M116.961 60.5353H112.559V30.4072H101.164V26.1875H128.307V30.4072H116.961V60.5353Z"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_796_283",children:jsxRuntime.jsx("rect",{width:"270",height:"80",fill:"white"})})})]})}let i=o||80;return jsxRuntime.jsxs("svg",{width:i,height:i,viewBox:"0 0 80 80",xmlns:"http://www.w3.org/2000/svg",className:n,style:a?{fill:a}:void 0,children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.223654 20.2934C0.417233 19.8234 0.873598 19.517 1.37984 19.517H20.5909C21.282 19.517 21.8422 20.0798 21.8422 20.774V40.049C21.8422 40.5572 21.5375 41.0155 21.0702 41.2102C20.6028 41.405 20.0647 41.2977 19.7067 40.9385L0.495628 21.6635C0.137428 21.3041 0.030075 20.7633 0.223654 20.2934ZM4.40349 22.0311L19.3396 37.017V22.0311H4.40349Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 20.2934C38.8394 19.8234 39.2958 19.517 39.802 19.517H59.013C59.7041 19.517 60.2642 20.0798 60.2642 20.774V40.049C60.2642 40.5572 59.9597 41.0155 59.4923 41.2102C59.025 41.405 58.4867 41.2977 58.1289 40.9385L38.9178 21.6635C38.5595 21.3041 38.4522 20.7633 38.6458 20.2934ZM42.8255 22.0311L57.7618 37.017V22.0311H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4347 58.8447C19.6283 58.3747 20.0847 58.0685 20.5909 58.0685H39.802C40.493 58.0685 41.0532 58.6312 41.0532 59.3255V78.6005C41.0532 79.1087 40.7486 79.567 40.2813 79.7617C39.8139 79.9562 39.2757 79.849 38.9178 79.49L19.7067 60.215C19.3485 59.8555 19.2411 59.3147 19.4347 58.8447ZM23.6146 60.5825L38.5508 75.5682V60.5825H23.6146Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 58.1643C39.79 57.9695 40.3283 58.0768 40.6861 58.436L59.8972 77.711C60.2555 78.0703 60.3628 78.6113 60.1692 79.081C59.9756 79.551 59.5192 79.8575 59.013 79.8575H39.802C39.1109 79.8575 38.5508 79.2948 38.5508 78.6005V59.3255C38.5508 58.8173 38.8554 58.359 39.3227 58.1643ZM41.0532 62.3575V77.3433H55.9893L41.0532 62.3575Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 19.6129C39.79 19.4182 40.3283 19.5254 40.6861 19.8846L59.8972 39.1595C60.2555 39.519 60.3628 40.0598 60.1692 40.5298C59.9756 40.9995 59.5192 41.306 59.013 41.306H39.802C39.1109 41.306 38.5508 40.7433 38.5508 40.049V20.7741C38.5508 20.2658 38.8554 19.8075 39.3227 19.6129ZM41.0532 23.8061V38.792H55.9893L41.0532 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 38.8885C39.79 38.694 40.3283 38.8012 40.6861 39.1602L59.8972 58.4352C60.2555 58.7945 60.3628 59.3355 60.1692 59.8055C59.9756 60.2752 59.5192 60.5817 59.013 60.5817H39.802C39.1109 60.5817 38.5508 60.019 38.5508 59.3247V40.0497C38.5508 39.5415 38.8554 39.0832 39.3227 38.8885ZM41.0532 43.0817V58.0675H55.9893L41.0532 43.0817Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 39.569C38.8394 39.0992 39.2958 38.7927 39.802 38.7927H59.013C59.7041 38.7927 60.2642 39.3555 60.2642 40.0497V59.3247C60.2642 59.833 59.9597 60.2912 59.4923 60.486C59.025 60.6805 58.4867 60.5732 58.1289 60.2142L38.9178 40.9392C38.5595 40.5797 38.4522 40.039 38.6458 39.569ZM42.8255 41.3067L57.7618 56.2927V41.3067H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 58.8447C38.8394 58.3747 39.2958 58.0685 39.802 58.0685H59.013C59.7041 58.0685 60.2642 58.6312 60.2642 59.3255V78.6005C60.2642 79.1087 59.9597 79.567 59.4923 79.7617C59.025 79.9562 58.4867 79.849 58.1289 79.49L38.9178 60.215C38.5595 59.8555 38.4522 59.3147 38.6458 58.8447ZM42.8255 60.5825L57.7618 75.5682V60.5825H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 19.6129C59.0011 19.4182 59.5394 19.5254 59.8972 19.8846L79.1083 39.1595C79.4666 39.519 79.5739 40.0598 79.3803 40.5298C79.1867 40.9995 78.7303 41.306 78.2241 41.306H59.013C58.322 41.306 57.7618 40.7433 57.7618 40.049V20.7741C57.7618 20.2658 58.0664 19.8075 58.5338 19.6129ZM60.2643 23.8061V38.792H75.2006L60.2643 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 0.338803C59.0011 0.144135 59.5394 0.251385 59.8972 0.610565L79.1083 19.8855C79.4666 20.2449 79.5739 20.7857 79.3803 21.2556C79.1867 21.7256 78.7303 22.032 78.2241 22.032H59.013C58.322 22.032 57.7618 21.4692 57.7618 20.775V1.50003C57.7618 0.99174 58.0664 0.533468 58.5338 0.338803ZM60.2643 4.53208V19.5179H75.2006L60.2643 4.53208Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8569 20.2934C58.0505 19.8234 58.5069 19.517 59.013 19.517H78.2241C78.9151 19.517 79.4753 20.0798 79.4753 20.774V40.049C79.4753 40.5572 79.1707 41.0155 78.7034 41.2102C78.236 41.405 77.6978 41.2977 77.3399 40.9385L58.1289 21.6635C57.7705 21.3041 57.6633 20.7633 57.8569 20.2934ZM62.0365 22.0311L76.9729 37.017V22.0311H62.0365Z"})]})};var Wt=({topItems:e=[],bottomItems:t=[],logo:o,showLogo:r=true,linkComponent:a="a",className:n="",mobileMenuId:i="app-mobile-menu",sidebarCollapseId:l="app-sidebar-collapse"})=>{let s=(c,m=false)=>{if(c.children&&c.children.length>0){let f=`category-${c.id}`;return jsxRuntime.jsxs("div",{className:"group/category",children:[jsxRuntime.jsx("input",{type:"checkbox",id:f,className:"peer/category hidden",defaultChecked:c.isExpanded,"aria-hidden":"true"}),jsxRuntime.jsxs("label",{htmlFor:f,className:"flex items-center gap-3 px-6 py-2.5 text-text-body hover:bg-background-hover hover:text-text-heading cursor-pointer transition-all duration-200","data-collapse-center":"",children:[c.icon&&jsxRuntime.jsx("span",{className:"flex-shrink-0 w-5 h-5 flex items-center justify-center transition-all duration-200",children:c.icon}),jsxRuntime.jsx("span",{className:"transition-all duration-200","data-collapse-hide":"",children:c.label}),jsxRuntime.jsx("span",{className:"flex-1","data-collapse-hide":""}),jsxRuntime.jsx("svg",{className:"w-4 h-4 transform transition-transform duration-200 peer-checked/category:rotate-180 ml-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-collapse-hide":"",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsx("div",{className:"hidden peer-checked/category:block bg-background-subtle border-l-2 border-border-subtle ml-6","data-collapse-hide-category":"",children:c.children.map(g=>s(g,true))})]},c.id)}let d={href:c.href||"#",className:`flex items-center gap-3 transition-all duration-200 hover:bg-background-hover ${m?"pl-8 pr-6 py-2 text-sm":"px-6 py-2.5"} ${c.isActive?"bg-action-primary-light text-action-primary border-l-2 border-action-primary":"text-text-body hover:text-text-heading"}`,"aria-current":c.isActive?"page":void 0,"data-collapse-center":m?void 0:""},u=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c.icon&&!m&&jsxRuntime.jsx("span",{className:"flex-shrink-0 w-5 h-5 flex items-center justify-center transition-all duration-200",children:c.icon}),jsxRuntime.jsx("span",{className:"transition-all duration-200","data-collapse-hide":"",children:c.label})]});return a==="a"?jsxRuntime.jsx("a",{...d,children:u},c.id):jsxRuntime.jsx(a,{...d,children:u},c.id)};return jsxRuntime.jsxs("div",{className:`flex flex-col h-full ${n}`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between h-[60px] px-6 border-b border-border-default",children:[r&&jsxRuntime.jsx("div",{className:"transition-all duration-200","data-collapse-hide":"",children:o||jsxRuntime.jsx(Gt,{showWordmark:true,width:120})}),jsxRuntime.jsx("label",{htmlFor:l,className:"hidden md:flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-all duration-200","aria-label":"Toggle sidebar","data-collapse-toggle":"",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),jsxRuntime.jsx("label",{htmlFor:i,className:"md:hidden flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-colors","aria-label":"Close menu",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),jsxRuntime.jsxs("nav",{className:"flex-1 flex flex-col overflow-y-auto",children:[e&&e.length>0&&jsxRuntime.jsx("div",{className:"flex-1 pb-4",children:jsxRuntime.jsx("div",{className:"space-y-1",children:e.map(c=>s(c))})}),t&&t.length>0&&jsxRuntime.jsx("div",{className:"pb-4",children:jsxRuntime.jsx("div",{className:"space-y-1",children:t.map(c=>s(c))})})]})]})};var Ct=({rightContent:e,showMobileMenu:t=true,avatar:o,showColorModeSwitcher:r=false,toggleTheme:a,isDarkThemeEnabled:n=false,actions:i,className:l="",mobileMenuId:s="app-mobile-menu"})=>jsxRuntime.jsx("header",{className:`h-[60px] bg-background-surface border-b ${l}`,children:jsxRuntime.jsxs("div",{className:"flex h-full items-center justify-between",children:[jsxRuntime.jsx("div",{className:"flex items-center h-full",children:t&&jsxRuntime.jsx("label",{htmlFor:s,className:"md:hidden cursor-pointer","aria-label":"Open menu",children:jsxRuntime.jsx("div",{className:"flex h-full w-14 flex-col items-center justify-center border-r hover:bg-background-hover transition-colors",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4 px-4",children:[e,r&&a&&jsxRuntime.jsx("button",{onClick:a,className:"hidden md:flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",children:n?jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})}),i,o&&jsxRuntime.jsx("div",{className:"flex items-center",children:o}),!o&&r&&a&&jsxRuntime.jsx("button",{onClick:a,className:"md:hidden flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",children:n?jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})})]})]})});function $r({sideNav:e,topNav:t,children:o,contentPaddingX:r="px-4 md:px-6",contentPaddingY:a="py-4 md:py-6",showSidebarBorder:n=true,mainClassName:i,enableJsEnhancements:l=false}){let s="app-mobile-menu",c="app-sidebar-collapse";return jsxRuntime.jsxs("div",{className:"min-h-screen bg-background text-text-body relative",children:[jsxRuntime.jsx("input",{type:"checkbox",id:c,className:"sr-only peer/sidebar","aria-hidden":"true"}),jsxRuntime.jsx("a",{href:"#app-content",className:"sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-4 z-50 rounded px-3 py-2 bg-background-surface shadow",children:"Skip to content"}),jsxRuntime.jsx(Ct,{...t,mobileMenuId:s,className:["sticky top-0 flex-shrink-0 z-30 md:hidden",t?.className].filter(Boolean).join(" ")}),jsxRuntime.jsxs("div",{className:"flex w-full h-[calc(100vh-60px)] md:h-screen relative overflow-hidden",children:[jsxRuntime.jsx("input",{type:"checkbox",id:s,className:"sr-only peer/mobile","aria-hidden":"true"}),jsxRuntime.jsx("label",{htmlFor:s,className:"absolute inset-0 bg-black/50 z-40 opacity-0 pointer-events-none peer-checked/mobile:opacity-100 peer-checked/mobile:pointer-events-auto transition-opacity md:hidden","aria-label":"Close menu"}),jsxRuntime.jsx("aside",{id:"app-sidebar",className:["h-full md:h-screen","bg-background-surface","border-r border-border-default","transition-all duration-300 ease-in-out","absolute md:relative","left-0 top-0 bottom-0","z-[60]","w-64","-translate-x-full","peer-checked/mobile:translate-x-0","md:translate-x-0",n?"":"!border-r-0",e?.className||""].filter(Boolean).join(" "),children:jsxRuntime.jsx(Wt,{...e,mobileMenuId:s,sidebarCollapseId:c,className:"h-full"})}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:[jsxRuntime.jsx("div",{className:"sticky top-0 flex-shrink-0 hidden md:block z-20",children:jsxRuntime.jsx(Ct,{...t,className:t?.className})}),jsxRuntime.jsx("main",{id:"app-content",className:["flex-1 overflow-y-auto bg-background-body",r,a,i||""].join(" "),role:"main",children:o})]})]}),jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:`
2
+ @media (min-width: 768px) {
3
+ /* Collapse sidebar width */
4
+ #${c}:checked ~ * #app-sidebar {
5
+ width: 5rem !important;
6
+ }
7
+
8
+ /* Collapse sidebar text */
9
+ #${c}:checked ~ * [data-collapse-hide] {
10
+ display: none !important;
11
+ }
12
+
13
+ /* Center nav items */
14
+ #${c}:checked ~ * [data-collapse-center] {
15
+ justify-content: center;
16
+ padding-left: 0;
17
+ padding-right: 0;
18
+ gap: 0;
19
+ }
20
+
21
+ /* Rotate toggle icon */
22
+ #${c}:checked ~ * [data-collapse-toggle] {
23
+ transform: scaleX(-1);
24
+ }
25
+
26
+ /* Hide category expansions */
27
+ #${c}:checked ~ * [data-collapse-hide-category] {
28
+ display: none;
29
+ }
30
+ }
31
+ `}}),l&&jsxRuntime.jsx("script",{dangerouslySetInnerHTML:{__html:`
32
+ (function() {
33
+ // Close mobile menu on Escape key
34
+ document.addEventListener('keydown', function(e) {
35
+ if (e.key === 'Escape') {
36
+ var menuToggle = document.getElementById('${s}');
37
+ if (menuToggle) menuToggle.checked = false;
38
+ }
39
+ });
40
+
41
+ // Save sidebar collapse preference to localStorage
42
+ var sidebarToggle = document.getElementById('${c}');
43
+ if (sidebarToggle) {
44
+ // Restore from localStorage
45
+ var saved = localStorage.getItem('sidebar-collapsed');
46
+ if (saved !== null) {
47
+ sidebarToggle.checked = saved === 'true';
48
+ }
49
+
50
+ // Save on change
51
+ sidebarToggle.addEventListener('change', function() {
52
+ localStorage.setItem('sidebar-collapsed', this.checked);
53
+ });
54
+ }
55
+
56
+ // Prevent body scroll when mobile menu is open
57
+ var mobileToggle = document.getElementById('${s}');
58
+ if (mobileToggle) {
59
+ mobileToggle.addEventListener('change', function() {
60
+ document.body.style.overflow = this.checked ? 'hidden' : '';
61
+ });
62
+ }
63
+ })();
64
+ `}})]})}var _t={prefix:String(Math.round(Math.random()*1e10)),current:0},Ar=Ve__default.default.createContext(_t),Nl=Ve__default.default.createContext(false);var wl=!!(typeof window<"u"&&window.document&&window.document.createElement),Mo=new WeakMap;function Sl(e=false){let t=Ve.useContext(Ar),o=Ve.useRef(null);if(o.current===null&&!e){var r,a;let n=(a=Ve__default.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||a===void 0||(r=a.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(n){let i=Mo.get(n);i==null?Mo.set(n,{id:t.current,state:n.memoizedState}):n.memoizedState!==i.state&&(t.current=i.id,Mo.delete(n));}o.current=++t.current;}return o.current}function kl(e){let t=Ve.useContext(Ar);t===_t&&!wl&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let o=Sl(!!e),r=t===_t&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${r}-${o}`}function Pl(e){let t=Ve__default.default.useId(),[o]=Ve.useState(Ut()),r=o||process.env.NODE_ENV==="test"?"react-aria":`react-aria${_t.prefix}`;return e||`${r}-${t}`}typeof Ve__default.default.useId=="function"?Pl:kl;function Rl(){return false}function Ll(){return true}function Ml(e){return ()=>{}}function Ut(){return typeof Ve__default.default.useSyncExternalStore=="function"?Ve__default.default.useSyncExternalStore(Ml,Rl,Ll):Ve.useContext(Nl)}var Bl=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Fl=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Vr(e){if(Intl.Locale){let o=new Intl.Locale(e).maximize(),r=typeof o.getTextInfo=="function"?o.getTextInfo():o.textInfo;if(r)return r.direction==="rtl";if(o.script)return Bl.has(o.script)}let t=e.split("-")[0];return Fl.has(t)}var Dl=Symbol.for("react-aria.i18n.locale");function Hr(){let e=typeof window<"u"&&window[Dl]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e]);}catch{e="en-US";}return {locale:e,direction:Vr(e)?"rtl":"ltr"}}var Fo=Hr(),Nt=new Set;function zr(){Fo=Hr();for(let e of Nt)e(Fo);}function Or(){let e=Ut(),[t,o]=Ve.useState(Fo);return Ve.useEffect(()=>(Nt.size===0&&window.addEventListener("languagechange",zr),Nt.add(o),()=>{Nt.delete(o),Nt.size===0&&window.removeEventListener("languagechange",zr);}),[]),e?{locale:"en-US",direction:"ltr"}:t}var Vl=Ve__default.default.createContext(null);function Eo(){let e=Or();return Ve.useContext(Vl)||e}var Io=new Map;function Do(e){let{locale:t}=Eo(),o=t+(e?Object.entries(e).sort((a,n)=>a[0]<n[0]?-1:1).join():"");if(Io.has(o))return Io.get(o);let r=new Intl.Collator(t,e);return Io.set(o,r),r}function qt(e){let t=Do({usage:"search",...e}),o=Ve.useCallback((n,i)=>i.length===0?true:(n=n.normalize("NFC"),i=i.normalize("NFC"),t.compare(n.slice(0,i.length),i)===0),[t]),r=Ve.useCallback((n,i)=>i.length===0?true:(n=n.normalize("NFC"),i=i.normalize("NFC"),t.compare(n.slice(-i.length),i)===0),[t]),a=Ve.useCallback((n,i)=>{if(i.length===0)return true;n=n.normalize("NFC"),i=i.normalize("NFC");let l=0,s=i.length;for(;l+s<=n.length;l++){let c=n.slice(l,l+s);if(t.compare(i,c)===0)return true}return false},[t]);return Ve.useMemo(()=>({startsWith:o,endsWith:r,contains:a}),[o,r,a])}var Ao=Ve.createContext({colorMode:"light",isDarkTheme:false,toggleTheme:()=>{}}),Wr=()=>Ve.useContext(Ao),_r=({children:e})=>{let[t,o]=Ve.useState("light"),r=t==="dark";Ve.useEffect(()=>{let n=localStorage.getItem("theme"),i=window.matchMedia("(prefers-color-scheme: dark)"),l=n||(i.matches?"dark":"light");o(l),l==="dark"&&document.body.classList.add("theme-dark");let s=c=>{if(!localStorage.getItem("theme")){let m=c.matches?"dark":"light";o(m),m==="dark"?document.body.classList.add("theme-dark"):document.body.classList.remove("theme-dark");}};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[]);let a=Ve.useCallback(()=>{o(n=>{let i=n==="light"?"dark":"light";return localStorage.setItem("theme",i),i==="dark"?document.body.classList.add("theme-dark"):document.body.classList.remove("theme-dark"),i});},[]);return jsxRuntime.jsx(Ao.Provider,{value:{colorMode:t,isDarkTheme:r,toggleTheme:a},children:e})};function te(e=false){return `${e?"outline outline-1 outline-border-input focus:outline-2 focus:outline-border-focus focus:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-border-focus focus-visible:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}function G(e,t){return reactAriaComponents.composeRenderProps(e,o=>tailwindMerge.twMerge(t,o))}var z={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",gap:"gap-[var(--control-gap-xl)]"}};function Me(){let[e,t]=Ve__default.default.useState(false),o=Ve__default.default.useCallback((a,n)=>{t(true),n?.(a);},[]),r=Ve__default.default.useCallback((a,n)=>{t(false),n?.(a);},[]);return {isFocused:e,handleFocus:o,handleBlur:r}}function Be({children:e,className:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative w-full",t),children:e})}function Ur({onClick:e,size:t="md",className:o}){return jsxRuntime.jsx("button",{type:"button",onClick:r=>{r.preventDefault(),r.stopPropagation(),e();},className:tailwindMerge.twMerge("absolute right-2 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body",o),"aria-label":"Clear input",onMouseDown:r=>{r.preventDefault(),r.stopPropagation();},children:jsxRuntime.jsx(h,{name:"X",size:t==="sm"?16:20})})}function tt(e){let{isInvalid:t,isDisabled:o,isFocused:r}=e,a="border rounded-[var(--control-border-radius)] ";return o?`${a} border-border-muted focus:outline-none`:t&&r?`${a} border-feedback-error-border outline-[1.5px] outline-[var(--control-focus-ring-color-error)]`:t?`${a} border-feedback-error-border`:r?`${a} !outline-[1.5px] !outline-[var(--control-focus-ring-color)] ![--tw-outline-style:solid]`:`${a}`}function Zt(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function Pe(e){let{isInvalid:t,isDisabled:o,isFocused:r,transparent:a,size:n="md",className:i}=e;return tailwindMerge.twMerge("w-full",tt({isInvalid:t,isDisabled:o,isFocused:r}),Zt({transparent:a,isDisabled:o}),z[n].text,z[n].height,z[n].padding,i)}function wt(e){let{size:t="md",isFocusWithin:o,isInvalid:r,isDisabled:a,transparent:n,className:i}=e;return tailwindMerge.twMerge("group flex items-center rounded-sm overflow-hidden",Zt({transparent:n,isDisabled:a}),z[t].height,tt({isFocused:o,isInvalid:r,isDisabled:a}),i)}function q({children:e,size:t="md",tooltip:o,isRequired:r,className:a,htmlFor:n}){return jsxRuntime.jsxs("label",{htmlFor:n,className:tailwindMerge.twMerge(z[t].text,"!text-text-caption flex items-center gap-1",a),children:[e,r&&jsxRuntime.jsx("span",{children:"*"}),o&&jsxRuntime.jsx("span",{className:"text-text-muted",children:jsxRuntime.jsx(h,{name:"Info",size:t==="sm"?16:20})})]})}function j({size:e="md",className:t,children:o,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-muted",z[e].text,t),children:o})}function W({children:e,size:t="md",className:o}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge(z[t].text,"text-feedback-error-text",o),children:e})}function qr({size:e="md",isInvalid:t,isDisabled:o,isFocused:r,transparent:a,className:n,...i}){return jsxRuntime.jsx("input",{className:Pe({isInvalid:t,isDisabled:o,isFocused:r,transparent:a,size:e,className:n}),...i})}function jt(e){let{children:t,...o}=e;return jsxRuntime.jsx("div",{...o,className:wt(e),children:typeof t=="function"?t(e):t})}var Yl={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"},Ql={sm:"text-controlElementSm",md:"text-controlElementMd",lg:"text-controlElementLg",xl:"text-controlElementXl"};function He({size:e="md",className:t,...o}){return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{...o,className:tailwindMerge.twMerge("flex cursor-default items-center gap-2 rounded-sm px-3 text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium",Yl[e],Ql[e],t)})}function nc({isEntering:e,isExiting:t,className:o=""}){let r=["bg-white","dark:bg-zinc-900/70","dark:backdrop-blur-2xl","dark:backdrop-saturate-200","forced-colors:bg-[Canvas]","shadow-md","rounded-md","overflow-hidden","bg-clip-padding","border","border-gray-100","dark:border-white/5","dark:text-zinc-300"].join(" "),a=e?["animate-in","fade-in","placement-bottom:slide-in-from-top-1","placement-top:slide-in-from-bottom-1","placement-left:slide-in-from-right-1","placement-right:slide-in-from-left-1","ease-out","duration-200"].join(" "):"",n=t?["animate-out","fade-out","placement-bottom:slide-out-to-top-1","placement-top:slide-out-to-bottom-1","placement-left:slide-out-to-right-1","placement-right:slide-out-to-left-1","ease-in","duration-150"].join(" "):"";return [r,a,n,o].filter(Boolean).join(" ")}function Oe({children:e,showArrow:t,className:o,...r}){let n=reactAriaComponents.useSlottedContext(reactAriaComponents.PopoverContext)?.trigger==="SubmenuTrigger",i=t?12:8;return i=n?i-6:i,jsxRuntime.jsxs(reactAriaComponents.Popover,{offset:i,...r,className:reactAriaComponents.composeRenderProps(o,(l,s)=>nc({...s,className:l})),children:[t&&jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{className:"group",children:jsxRuntime.jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"block fill-white stroke-black/10 stroke-1 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 dark:fill-[#1f1f21] dark:stroke-zinc-600 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L6 6 L12 0"})})}),e]})}var gc={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},bc={sm:"pl-7",md:"pl-9",lg:"pl-10",xl:"pl-12"},Zr={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"};function xc(){let e=Ve__default.default.useContext(reactAriaComponents.ComboBoxStateContext);return jsxRuntime.jsx(reactAriaComponents.Button,{slot:null,className:"clear-button","aria-label":"Clear",onPress:()=>e?.setSelectedKey(null),children:"\u2715"})}var Go=(e,t,o)=>{if(e==null||e==="")return "";let a=(o?o.flatMap(n=>n.items):t||[]).find(n=>n.id===e);return a?a.name:""};async function hc(e,t,o){try{let r=e.url.replace("{q}",t),a=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([s,c])=>{a.append(s,c.toString());});let n=`${r}${a.toString()?"?"+a.toString():""}`,i=await fetch(n,{method:"GET",headers:e.headers,signal:o});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let l=await i.json();return {items:e.transformResponse(l)}}catch(r){console.error("Error in REST request:",r);let a=r instanceof Error?r.message:"Unknown error occurred";return {items:[],error:a}}}async function vc(e,t,o){try{let r=e.graphqlQuery.replace(`$${e.variableKey||"filter"}`,`"${t}"`),a=await fetch(e.url,{method:"POST",headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify({query:r}),signal:o});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);let n=await a.json();if(n.errors)throw new Error(n.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(n=e.responsePath.split(".").reduce((i,l)=>i?.[l],n)),{items:e.transformResponse(n)}}catch(r){console.error("Error in GraphQL request:",r);let a=r instanceof Error?r.message:"Unknown error occurred";return {items:[],error:a}}}function Kt({label:e,staticItems:t=[],sections:o,selectedKey:r,defaultSelectedKey:a,onSelectionChange:n,requestConfig:i,defaultFilter:l,placeholder:s,errorMessage:c,description:m,size:d="md",tooltip:u,isRequired:f,isDisabled:g,isInvalid:p,validationResult:x,showErrors:v=true,renderItem:w,renderLeftIcon:L,renderSection:B,autoFocus:S=false}){let y=Ve__default.default.useRef(null),[P,C]=Ve__default.default.useState(),[F,$]=Ve.useState(()=>Go(r||a,t,o)),[O,b]=Ve.useState(false),E=Ot(F),{contains:J}=qt({sensitivity:"base"}),[U,le]=Ve.useState(),ue=z[d].text,Le=z[d].height,T=null;Ve.useEffect(()=>{S&&b(true);},[S]),Ve.useEffect(()=>{let k=()=>{y.current&&C(y.current.offsetWidth);};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]),Ve.useEffect(()=>{T&&T.setFilterText(E);},[E,T]),i&&(T=reactStately.useAsyncList({async load({signal:k,filterText:N=""}){if(!i.url||i.shouldLoad&&!i.shouldLoad(N))return {items:[]};try{let R;return i.requestType==="GraphQL"?R=await vc(i,N,k):R=await hc(i,N,k),le(R.error),{items:R.items}}catch(R){return console.error("Error loading items:",R),le(R instanceof Error?R.message:"Unknown error occurred"),{items:[]}}},initialFilterText:""})),E===""&&(T=null);let I=k=>{let N=Go(k,t,o);$(N),n&&n(k);},_=k=>{$(k);let N=Go(r,t,o);r!=null&&k!==N&&n&&n(null);};return jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:I,selectedKey:r||void 0,defaultSelectedKey:a||void 0,defaultItems:o?o.flatMap(k=>k.items):t,items:T?T.items:void 0,className:G("group flex flex-col","w-full"),menuTrigger:"focus",isDisabled:g,isInvalid:p||!!c,inputValue:F,onInputChange:_,autoFocus:S,defaultFilter:l||J,"aria-label":e||s||"Autocomplete",children:k=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:d,tooltip:u,isRequired:f,children:e}),jsxRuntime.jsxs(reactAriaComponents.Group,{ref:y,className:wt({size:d,isInvalid:p||!!c,isDisabled:g,isFocusWithin:O||k.isOpen,className:"w-full cursor-pointer"}),"aria-label":e||s||"Autocomplete",style:{position:"relative"},children:[L?jsxRuntime.jsx("div",{className:"absolute left-3",children:L(!!T?.isLoading)}):jsxRuntime.jsx(h,{name:"MagnifyingGlass",className:`${gc[d]} absolute left-3 text-inherit`}),jsxRuntime.jsx(reactAriaComponents.Input,{className:`flex-1 min-w-0 border-none pr-3 outline-0 placeholder:text-text-placeholder ${bc[d]} ${ue} ${Le} ${g?"bg-background-muted":"bg-background-input"}`,placeholder:s,disabled:g,onFocus:()=>b(true),onBlur:()=>b(false)}),F&&!g&&jsxRuntime.jsx(xc,{}),jsxRuntime.jsx(reactAriaComponents.Button,{className:`px-2 text-text-body ${ue} ${Le} ${g?"bg-background-muted":"bg-background-input"}`,"aria-label":"Toggle menu",isDisabled:g,children:({isPressed:N})=>jsxRuntime.jsx(h,{name:N?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),m&&jsxRuntime.jsx(j,{size:d,children:m}),v&&U&&jsxRuntime.jsx(W,{size:d,className:"text-feedback-error-text",children:U}),v&&typeof c=="string"&&jsxRuntime.jsx(W,{size:d,className:"text-feedback-error-text",children:c}),v&&typeof c=="function"&&x&&jsxRuntime.jsx(W,{size:d,className:"text-feedback-error-text",children:c(x)}),jsxRuntime.jsx(Oe,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5",style:{minWidth:P?`${P}px`:void 0},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{className:`max-h-[300px] overflow-auto bg-background-input outline-none ${ue}`,children:o?o.map(N=>{let R=N.items.map(M=>jsxRuntime.jsx(He,{id:M.id,textValue:M.name,size:d,className:`flex cursor-default items-center gap-2 rounded-sm px-3 ${Zr[d]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:w?w(M):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[M.name,jsxRuntime.jsx(h,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},M.id));return B?B(N,R):jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-muted",children:N.name}),R]},N.name)}):N=>jsxRuntime.jsx(He,{id:N.id,textValue:N.name,size:d,className:`flex cursor-default items-center gap-2 rounded-sm px-3 ${Zr[d]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:w?w(N):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[N.name,jsxRuntime.jsx(h,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},N.id)})})]})})}function Yr({src:e,alt:t,firstName:o,lastName:r,fullName:a,onClick:n,size:i="md",shape:l="circle",variant:s="user",className:c,status:m,bordered:d=false}){let u={xs:"h-6 w-6 text-xs",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-16 w-16 text-xl"},f={xs:"h-1.5 w-1.5",sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3",xl:"h-4 w-4"},g={xs:"bottom-0 right-0",sm:"bottom-0 right-0",md:"bottom-0 right-0",lg:"bottom-0.5 right-0.5",xl:"bottom-1 right-1"},p={online:"bg-feedback-success-background border-feedback-success-border",offline:"bg-text-muted border-border-muted",away:"bg-feedback-warning-background border-feedback-warning-border",busy:"bg-feedback-error-background border-feedback-error-border"},x={user:"bg-action-primary/10 text-action-primary",team:"bg-feedback-info-background text-feedback-info-text",organization:"bg-feedback-success-background text-feedback-success-text"},v=l==="circle"?"rounded-full":"rounded-md",w=tailwindMerge.twMerge("relative inline-flex items-center justify-center overflow-hidden transition-opacity",u[i],v,n&&"cursor-pointer hover:opacity-80",d&&"ring-2 ring-background-surface",c),B=(()=>{if(o||r){let P=o?.[0]||"",C=r?.[0]||"";return (P+C).toUpperCase()}if(a){let P=a.split(" "),C=P[0]?.[0]||"",F=P[P.length-1]?.[0]||"";return C===F?C.toUpperCase():(C+F).toUpperCase()}return ""})(),S=()=>{let P={xs:14,sm:16,md:20,lg:24,xl:32}[i];switch(s){case "team":return jsxRuntime.jsx(lucideReact.Users,{size:P});case "organization":return jsxRuntime.jsx(lucideReact.Building2,{size:P});default:return jsxRuntime.jsx(lucideReact.User,{size:P})}},y=()=>e?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("img",{src:e,alt:t||a||"Avatar",className:"h-full w-full object-cover",style:{fontSize:0}}),jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center -z-10",children:B?jsxRuntime.jsx("span",{className:"font-semibold",children:B}):S()})]}):B?jsxRuntime.jsx("span",{className:"font-semibold",children:B}):S();return jsxRuntime.jsxs("div",{className:"relative inline-block",children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(w,e?"":x[s]),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,children:y()}),m&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("absolute border-2 border-background-surface",v,f[i],g[i],p[m]),"aria-label":`Status: ${m}`})]})}var Sc={default:"bg-feedback-info-background text-feedback-info-text",success:"bg-feedback-success-background text-feedback-success-text",error:"bg-feedback-error-background text-feedback-error-text",warning:"bg-feedback-warning-background text-feedback-warning-text",info:"bg-feedback-info-background text-feedback-info-text",primary:"bg-action-primary/10 text-action-primary",secondary:"bg-action-secondary/10 text-action-secondary",neutral:"bg-background-muted text-text-muted"},kc={sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-3.5 py-2.5 text-base"},Pc={pill:"rounded-full",rounded:"rounded-lg",square:"rounded-sm"},Tc={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};function Xt({children:e,variant:t="default",size:o="sm",shape:r="square",dot:a=false,dotPosition:n="left",className:i}){let l=a&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("rounded-full bg-current opacity-75",Tc[o]),"aria-hidden":"true"});return jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge("inline-flex items-center gap-1.5 font-medium",kc[o],Pc[r],Sc[t],i),children:[a&&n==="left"&&l,e,a&&n==="right"&&l]})}var Uo=({href:e,children:t,className:o="",external:r=false,title:a,variant:n="default",onClick:i,asButton:l=false,onPress:s,showArrow:c=false})=>{let m=r?{target:"_blank",rel:"noopener noreferrer"}:{},f=`hover:underline hover:decoration-1 hover:underline-offset-4 cursor-pointer ${{default:"text-text-link-default hover:text-text-link-hover visited:text-text-link-default",primary:"text-action-primary hover:text-action-primary-hover visited:text-action-primary",muted:"text-text-muted hover:text-text-muted visited:text-text-muted"}[n]} ${o}`,g=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t,c&&jsxRuntime.jsxs("span",{children:["\xA0","\u2192"]})]});return l?jsxRuntime.jsx("button",{type:"button",className:f,onClick:s,title:a,children:g}):jsxRuntime.jsx("a",{href:e||"#",className:f,...m,title:a,onClick:i,children:g})};function ta(e){return jsxRuntime.jsx(reactAriaComponents.Breadcrumbs,{...e,className:tailwindMerge.twMerge("flex gap-1",e.className)})}function oa(e){let{className:t,children:o,href:r,...a}=e;return jsxRuntime.jsx(reactAriaComponents.Breadcrumb,{className:G(t,"flex items-center gap-1"),...a,children:n=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Uo,{variant:"muted",href:r,children:typeof o=="function"?o(n):o}),r&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3 w-3 text-text-muted"})]})})}var zc="flex font-medium justify-center items-center gap-2 text-center transition rounded-sm whitespace-nowrap box-border",Hc={default:"bg-neutral-black text-neutral-white hover:brightness-90 forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",primary:"bg-action-primary text-neutral-white hover:brightness-90 forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",secondary:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-action-destructive border-2 border-border-muted hover:bg-action-destructive/5 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-body hover:bg-text-body/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-2 flex-shrink-0",unstyled:"bg-transparent"},ra={full:"w-full",default:"w-fit"},Oc="opacity-control-hover cursor-not-allowed pointer-events-none grayscale",Gc="opacity-100 cursor-pointer",Wc={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},_c={primary:"bg-action-primary text-white",destructive:"bg-action-destructive text-white"};function Uc(e){let{variant:t="default",size:o="md",isDisabled:r,fullWidth:a=false,isLoading:n=false}=e,i=t==="unstyled"?"":`${zc} ${Hc[t]}`;return t!=="unstyled"&&(i+=` ${z[o].text} ${z[o].height} ${z[o].padding} ${z[o].gap}`),r||n?i+=` ${Oc}`:i+=` ${Gc}`,a?i+=` ${ra.full}`:i+=` ${ra.default}`,`${i} ${te()}`}function D(e){let{icon:t,children:o,isLoading:r=false,loadingText:a,loadingIndicator:n,size:i="md",iconPosition:l="left",iconWeight:s,href:c,className:m,badgeNumber:d,badgeVariant:u="primary",badgePosition:f="top-right",style:g,...p}=e,x=t?jsxRuntime.jsx(h,{name:t,className:`icon-[--control-icon-size-${i}]`,weight:s}):null,v=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&x,typeof o=="function"?null:o,l==="right"&&x]}),w=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n||jsxRuntime.jsx(h,{name:"CircleNotch",className:`animate-spin icon-[--control-icon-size-${i}]`,"aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:v}),a&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:a})]}),L=[Uc(e),m,r?"aria-busy":""].filter(Boolean).join(" "),B=c?jsxRuntime.jsx(reactAriaComponents.Link,{href:c,...p,style:g,className:L,children:r?w:typeof o=="function"?function(S){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&x,o(S),l==="right"&&x]})}:v}):jsxRuntime.jsx(reactAriaComponents.Button,{...p,style:g,className:L,children:r?w:typeof o=="function"?function(S){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&x,o(S),l==="right"&&x]})}:v});return d&&d>0?jsxRuntime.jsxs("div",{className:"relative",children:[B,jsxRuntime.jsx("span",{className:`absolute ${Wc[f]} flex h-5 w-5 items-center justify-center rounded-full ${_c[u]} text-xs`,"aria-label":`${d} items`,children:d})]}):B}function td({isSelected:e,isDisabled:t}){let o=[te,"w-9 h-9 text-base cursor-default rounded-full flex items-center justify-center forced-color-adjust-none"];return t?o.push("text-gray-300 dark:text-zinc-600 forced-colors:text-[GrayText]"):e?o.push("bg-blue-600 invalid:bg-red-600 text-white forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):o.push("text-zinc-900 dark:text-zinc-200 hover:bg-gray-100 dark:hover:bg-zinc-700 pressed:bg-gray-200 dark:pressed:bg-zinc-600"),o.join(" ")}function Qt({errorMessage:e,...t}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...t,children:[jsxRuntime.jsx(Jt,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{children:[jsxRuntime.jsx(eo,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:o=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:o,className:({isSelected:r,isDisabled:a})=>td({isSelected:r,isDisabled:a})})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-red-600",children:e})]})}function Jt(){let{direction:e}=reactAriaComponents.useLocale(),t=18;return jsxRuntime.jsxs("header",{className:"flex w-full items-center gap-1 px-1 pb-4",children:[jsxRuntime.jsx(D,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(h,{name:"CaretRight","aria-hidden":true,size:t}):jsxRuntime.jsx(h,{name:"CaretLeft","aria-hidden":true,size:t})}),jsxRuntime.jsx(reactAriaComponents.Heading,{className:"text-md mx-2 flex-1 text-center font-semibold text-zinc-900 dark:text-zinc-200"}),jsxRuntime.jsx(D,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(h,{name:"CaretLeft","aria-hidden":true,size:t}):jsxRuntime.jsx(h,{name:"CaretRight","aria-hidden":true,size:t})})]})}function eo(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-caption",children:e})})}var rd={xs:"text-lg font-semibold",sm:"text-xl font-semibold",md:"text-2xl font-semibold",lg:"text-3xl font-semibold",xl:"text-4xl font-semibold"},ad={page:"h-16 leading-[62px]"};function ot({tag:e="h1",size:t="lg",height:o,className:r="",children:a}){let n=rd[t],i=o?ad[o]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(n,i,r),children:a})}var X=({width:e,height:t,variant:o="rect",animation:r="pulse",gradient:a=false,flex:n=false,stack:i,responsive:l,delay:s=0,adjustAnimationSpeedBasedOnWidth:c=false,ariaLabel:m,className:d,"data-testid":u})=>{let[f,g]=Ve.useState(s===0);if(Ve.useEffect(()=>{if(s>0){let S=setTimeout(()=>g(true),s);return ()=>clearTimeout(S)}},[s]),!f)return null;let p=a?"bg-gradient-to-r from-[var(--skeleton-base)] via-[var(--skeleton-highlight)] to-[var(--skeleton-base)]":"bg-[var(--skeleton-base)]",x=c&&e?(()=>{let S=typeof e=="number"?e:parseFloat(String(e));return isNaN(S)?"":`animation-duration-[${Math.max(.8,S/100)}s]`})():"",v=r==="pulse"?`animate-pulse ${x}`:r==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--skeleton-wave)] before:to-transparent before:animate-wave ${x}`:"",w="rounded-sm";o==="circle"&&(w="rounded-full"),o==="text"&&(w="h-4 w-full rounded-sm");let L=n?"flex-1 min-w-0":"",B=l?Object.entries(l).map(([S,y])=>`${S}:w-[${y}]`).join(" "):"";return i?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":u,children:i.map((S,y)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(p,v,w,L,B,d),style:{width:S,height:t}},y))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(p,v,w,L,B,d),style:{width:e,height:t},role:"presentation","aria-hidden":!m,"aria-label":m??void 0,"data-testid":u})};var to=({heading:e,upperRightText:t,withPadding:o=true,isGhost:r=false,children:a,className:n="",isLoading:i})=>{let m=`w-full rounded md:border-x border-y bg-background-surface ${o?"p-6":""} ${r?"md:border-x-0 border-y-0 shadow-none p-0":"shadow-sm"} ${n}`.trim();return jsxRuntime.jsx("div",{className:m,"data-testid":"card",children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx("div",{className:"mb-4 h-[28px] min-h-[28px]",children:i?jsxRuntime.jsx(X,{width:100,height:16,"data-testid":"skeleton"}):jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:typeof e=="string"?jsxRuntime.jsx(ot,{size:"xs",children:e}):e}),t&&jsxRuntime.jsx("span",{className:"text-sm text-textFaint",children:t})]})}),a]})})};function fd(e){return jsxRuntime.jsxs(reactAriaComponents.CheckboxGroup,{...e,className:G(e.className,"flex flex-col gap-2"),children:[jsxRuntime.jsx(q,{children:e.label}),e.children,e.description&&jsxRuntime.jsx(j,{children:e.description}),jsxRuntime.jsx(W,{children:typeof e.errorMessage=="function"?void 0:e.errorMessage})]})}function gd({isDisabled:e}){return `flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-caption"}`}function bd({isSelected:e,isInvalid:t,isDisabled:o,isIndeterminate:r}){let a="w-5 h-5 flex-shrink-0 rounded flex items-center justify-center border-2 transition ring-offset-2 focus:ring-2 focus:ring-border-focus",n="";return o?n="border-border-muted bg-background-muted":t?n="border-feedback-error-border bg-feedback-error-background":e||r?n="bg-action-primary border-action-primary hover:bg-action-primary-hover hover:border-action-primary-hover":n="bg-background-input border-border-input hover:border-border-focus",`${a} ${n}`}var ia="w-4 h-4 text-text-onPrimary group-disabled:text-text-disabled";function Ko(e){let{children:t,...o}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...o,className:reactAriaComponents.composeRenderProps(e.className,(r,a)=>`${gd(a)} ${r||""}`),children:r=>{let{isSelected:a,isIndeterminate:n,...i}=r,l=jsxRuntime.jsx("div",{className:bd({isSelected:a,isIndeterminate:n,...i}),children:n?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:ia}):a?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:ia}):null});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l,typeof t=="function"?t(r):t]})}})}var vd={default:"bg-background-muted text-text-body border border-border-muted hover:bg-background-hover",primary:"bg-action-primary/10 text-action-primary border border-action-primary/20 hover:bg-action-primary/15",secondary:"bg-background-input text-text-body border border-border-input hover:bg-background-hover"},yd={sm:"px-2 py-1 gap-1",md:"px-3 py-1.5 gap-1.5",lg:"px-3 py-2 gap-2",xl:"px-4 py-2.5 gap-2"},Cd="opacity-75 cursor-not-allowed pointer-events-none";function la(e){let{variant:t,size:o,isDisabled:r,isClickable:a,className:n}=e;return tailwindMerge.twMerge("inline-flex items-center justify-center rounded-full font-medium transition-colors","whitespace-nowrap select-none",yd[o],z[o].text,vd[t],a&&!r&&"cursor-pointer",r&&Cd,n)}function oo({children:e,onRemove:t,size:o="md",variant:r="default",isRemovable:a=true,isDisabled:n=false,className:i,onClick:l}){let s=!!l&&!n,c=a&&t&&!n,m=f=>{f.stopPropagation(),f.preventDefault(),t&&!n&&t();},d=()=>{l&&!n&&l();},u=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"truncate",children:e}),c&&jsxRuntime.jsx("button",{type:"button",onClick:m,className:"flex-shrink-0 rounded-full p-0.5 hover:bg-black/10 transition-colors cursor-pointer","aria-label":"Remove",tabIndex:-1,children:jsxRuntime.jsx(h,{name:"X",size:o==="sm"?12:o==="md"?14:16,className:"text-current opacity-70 hover:opacity-100"})})]});return s?jsxRuntime.jsx("button",{type:"button",onClick:d,className:la({variant:r,size:o,isDisabled:n,isClickable:s,className:i}),disabled:n,children:u}):jsxRuntime.jsx("span",{className:la({variant:r,size:o,isDisabled:n,isClickable:s,className:i}),children:u})}function da({value:e,readOnly:t=false,onChange:o,language:r="json",theme:a="github_dark",height:n,width:i="100%",className:l,lineHeight:s=19,minLines:c=3,maxLines:m=50,showLineNumbers:d=true,showGutter:u=true,fontSize:f=14,wrapEnabled:g=false}){let p=Ve.useRef(null),x=Ve.useMemo(()=>{if(n)return n;let v=(e.match(/\n/g)||[]).length+1;return `${Math.max(c,Math.min(v,m))*s+10}px`},[e,n,s,c,m]);return Ve.useEffect(()=>{p.current?.editor&&p.current.editor.resize();},[x]),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden rounded-md border border-border-input",l),style:{width:i,height:x},children:jsxRuntime.jsx(Td__default.default,{ref:p,mode:r,theme:a,value:e,onChange:o,readOnly:t,width:"100%",height:"100%",fontSize:f,showPrintMargin:false,showGutter:u,highlightActiveLine:!t,setOptions:{useWorker:true,showLineNumbers:d,tabSize:2,enableBasicAutocompletion:!t,enableLiveAutocompletion:!t,enableSnippets:!t,showFoldWidgets:true,wrap:g},editorProps:{$blockScrolling:true}})})}var Ed=({isEntering:e,isExiting:t,className:o})=>["max-w-[200px] group bg-slate-700 dark:bg-slate-600 border border-slate-800 dark:border-white/10 shadow-[inset_0_1px_0_0_theme(colors.gray.600)] dark:shadow-none text-white text-sm rounded-lg drop-shadow-lg will-change-transform px-3 py-1",e?"animate-in fade-in placement-bottom:slide-in-from-top-0.5 placement-top:slide-in-from-bottom-0.5 placement-left:slide-in-from-right-0.5 placement-right:slide-in-from-left-0.5 ease-out duration-200":"",t?"animate-out fade-out placement-bottom:slide-out-to-top-0.5 placement-top:slide-out-to-bottom-0.5 placement-left:slide-out-to-right-0.5 placement-right:slide-out-to-left-0.5 ease-in duration-150":"",o].filter(Boolean).join(" ");function Yo({children:e,content:t,...o}){return jsxRuntime.jsxs(reactAriaComponents.TooltipTrigger,{delay:200,children:[e,jsxRuntime.jsxs(reactAriaComponents.Tooltip,{...o,offset:10,className:reactAriaComponents.composeRenderProps(o.className,(r,a)=>Ed({...a,className:r})),children:[jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-slate-700 stroke-gray-800 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 dark:fill-slate-600 dark:stroke-white/10 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),t]})]})}function ma({value:e,children:t,className:o,size:r="sm"}){let[a,n]=Ve.useState(false),s=jsxRuntime.jsx(D,{variant:"icon",size:r,onPress:()=>{let c=e||(typeof t=="string"?t:"");navigator.clipboard.writeText(c),n(true),setTimeout(()=>{n(false);},2e3);},className:"!px-2",children:jsxRuntime.jsx(h,{name:"Copy",size:r==="sm"?14:16})});return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1",o),children:[t,a?jsxRuntime.jsx(Yo,{content:"Copied!",children:s}):s]})}var pa={duration:.5,ease:"easeInOut"},ro=Ve.createContext(null),We=()=>{let e=Ve.useContext(ro);if(!e)throw new Error("useChartContext must be used within a ChartContextProvider");return e};var at=({data:e,color:t="#6b7280"})=>{let o=Ve.useId(),r=Ve.useId(),{xScale:a,yScale:n,animationSettings:i}=We(),l=a.range(),s=n.range();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:o,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsxRuntime.jsx("stop",{offset:"50%",stopColor:t,stopOpacity:.1}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:t,stopOpacity:0})]}),jsxRuntime.jsx("clipPath",{id:r,children:jsxRuntime.jsx("rect",{x:l[0],y:s[1],width:l[1]-l[0],height:s[0]-s[1]})})]}),jsxRuntime.jsx("g",{clipPath:`url(#${r})`,children:jsxRuntime.jsxs(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:i.duration,ease:i.ease},style:{transformOrigin:`0 ${s[0]}px`,transformBox:"fill-box",isolation:"isolate"},children:[jsxRuntime.jsx(shape.AreaClosed,{data:e,x:c=>a(c.xValue),y:c=>n(c.yValue),yScale:n,fill:`url(#${o})`,curve:curve.curveLinear}),jsxRuntime.jsx(shape.LinePath,{data:e,x:c=>a(c.xValue),y:c=>n(c.yValue),stroke:t,strokeWidth:3,curve:curve.curveLinear})]})})]})};var it=({data:e,color:t="#6b7280",opacity:o=1,categoryColors:r={}})=>{let{xScale:a,yScale:n,animationSettings:i}=We(),l=Ve.useId(),s=a.range(),c=n.range(),m=[...e].sort((f,g)=>f.xValue.getTime()-g.xValue.getTime()),d=m.length>1?m[1].xValue.getTime()-m[0].xValue.getTime():15*6e4,u=Math.abs(a(new Date(m[0].xValue.getTime()+d))-a(m[0].xValue));return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:l,children:jsxRuntime.jsx("rect",{x:s[0],y:c[1],width:s[1]-s[0],height:c[0]-c[1]})})}),jsxRuntime.jsx("g",{clipPath:`url(#${l})`,children:jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:i.duration,ease:i.ease},style:{transformOrigin:`0 ${c[0]}px`,transformBox:"fill-box",isolation:"isolate"},children:m.map((f,g)=>{let p=a(f.xValue),x=n(f.yValue),v=c[0]-x,w=m[g+1],L=w?Math.abs(a(w.xValue)-p):u,B=f.category&&r[f.category]?r[f.category]:t;return jsxRuntime.jsx(shape.Bar,{x:p-L/2,y:x,width:L,height:v,fill:B,opacity:o,rx:1},f.xValue.getTime())})})})]})};var Y={top:20,right:20,bottom:50,left:60};function st(e,t="$"){let o=(r,a)=>r==null?"-":a(r);switch(e){case "number":return {format:r=>o(r,a=>a.toLocaleString()),tickFormat:r=>o(r,a=>a.toLocaleString())};case "percent":return {format:r=>o(r,a=>`${a.toFixed(1)}%`),tickFormat:r=>o(r,a=>`${a.toFixed(0)}%`),min:0,max:100,tickInterval:20};case "kWh":return {format:r=>o(r,a=>`${(a/1e3).toFixed(1)} kWh`),tickFormat:r=>o(r,a=>`${(a/1e3).toFixed(1)}`)};case "kW":return {format:r=>o(r,a=>`${(a/1e3).toFixed(1)} kW`),tickFormat:r=>o(r,a=>`${(a/1e3).toFixed(1)}`)};case "amperes":return {format:r=>o(r,a=>`${a.toFixed(1)} A`),tickFormat:r=>o(r,a=>`${a.toFixed(1)} A`)};case "temperature":return {format:r=>o(r,a=>`${a.toFixed(1)}\xB0`),tickFormat:r=>o(r,a=>`${a.toFixed(0)}\xB0`)};case "percentageChange":return {format:r=>o(r,a=>`${a>0?"+":""}${(a*100).toFixed(1)}%`),tickFormat:r=>o(r,a=>`${a>0?"+":""}${(a*100).toFixed(0)}%`),min:-100,max:100};case "decimal":return {format:r=>o(r,a=>a.toFixed(2)),tickFormat:r=>o(r,a=>a.toFixed(1))};case "currency":return {format:r=>o(r,a=>`${t}${a.toLocaleString()}`),tickFormat:r=>o(r,a=>`${t}${a.toLocaleString()}`)};case "scientific":return {format:r=>o(r,a=>a.toExponential(2)),tickFormat:r=>o(r,a=>a.toExponential(1))};case "integer":return {format:r=>o(r,a=>Math.round(a).toLocaleString()),tickFormat:r=>o(r,a=>Math.round(a).toLocaleString())};case "logarithmic":return {format:r=>o(r,a=>a.toExponential(1)),tickFormat:r=>o(r,a=>a.toExponential(0)),min:1,tickInterval:10};case "timeDuration":return {format:r=>o(r,a=>`${Math.floor(a/60)}:${(a%60).toString().padStart(2,"0")} min`),tickFormat:r=>o(r,a=>`${Math.floor(a/60)}m`),min:0};case "compact":return {format:r=>o(r,a=>new Intl.NumberFormat("en",{notation:"compact"}).format(a)),tickFormat:r=>o(r,a=>new Intl.NumberFormat("en",{notation:"compact"}).format(a))};case "si":return {format:r=>o(r,a=>new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:2}).format(a)),tickFormat:r=>o(r,a=>new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(a))};case "bytes":return {format:r=>o(r,a=>{let n=["B","KB","MB","GB","TB"],i=0,l=a;for(;l>=1024&&i<n.length-1;)l/=1024,i++;return `${l.toFixed(1)} ${n[i]}`}),tickFormat:r=>o(r,a=>{let n=["B","KB","MB","GB","TB"],i=0,l=a;for(;l>=1024&&i<n.length-1;)l/=1024,i++;return `${l.toFixed(0)} ${n[i]}`}),min:0};case "rate":return {format:r=>o(r,a=>`${a.toFixed(1)} req/sec`),tickFormat:r=>o(r,a=>`${a.toFixed(0)}/s`)};case "ordinal":return {format:r=>o(r,a=>{let n=["th","st","nd","rd"],i=a%100;return a+(n[(i-20)%10]||n[i]||n[0])}),tickFormat:r=>o(r,a=>a.toString()),min:1};case "date":return {format:r=>o(r,a=>new Intl.DateTimeFormat("en",{dateStyle:"medium"}).format(new Date(a))),tickFormat:r=>o(r,a=>new Intl.DateTimeFormat("en",{dateStyle:"short"}).format(new Date(a))),min:0};case "largeCurrency":return {format:r=>o(r,a=>`${t}${(a/1e6).toFixed(2)}M`),tickFormat:r=>o(r,a=>`${t}${(a/1e6).toFixed(0)}M`)};case "coordinates":return {format:r=>o(r,a=>`${Math.abs(a).toFixed(3)}\xB0 ${a>=0?"N":"S"}`),tickFormat:r=>o(r,a=>`${Math.abs(a).toFixed(1)}\xB0 ${a>=0?"N":"S"}`),min:-90,max:90};case "ranked":return {format:r=>o(r,a=>`Rank: ${a}`),tickFormat:r=>o(r,a=>a.toString()),min:1};default:return {format:r=>o(r,a=>a.toLocaleString()),tickFormat:r=>o(r,a=>a.toLocaleString())}}}var Jo=(e,t)=>{let o=d3Array.extent(e,r=>r.xValue);return scale.scaleTime({range:[Y.left,t-Y.right],domain:o,nice:true})},er=(e,t,o)=>{let r=st(o),a=d3Array.min(e,s=>s.yValue)||0,n=d3Array.max(e,s=>s.yValue)||0,i=r.min!==void 0?r.min:a>=0?0:a*1.1,l=r.max!==void 0?r.max:n<=0?0:n*1.1;return scale.scaleLinear({range:[t-Y.bottom,Y.top],domain:[i,l],nice:true})};var Jd=({top:e,scale:t,width:o})=>jsxRuntime.jsx(axis.Axis,{orientation:"bottom",top:e,scale:t,numTicks:Math.min(6,Math.floor(o/100)),tickFormat:r=>{let a=r;return new Intl.DateTimeFormat("en",{month:"short",day:"numeric"}).format(a)},stroke:"#e5e7eb",tickStroke:"#e5e7eb",tickLabelProps:()=>({fill:"#6b7280",fontSize:12,textAnchor:"middle"})}),eu=({left:e,scale:t,yFormatType:o})=>{let r=st(o);return jsxRuntime.jsx(axis.Axis,{orientation:"left",left:e,scale:t,numTicks:5,tickFormat:a=>(r.tickFormat||r.format)(a),stroke:"#e5e7eb",tickStroke:"#e5e7eb",tickLabelProps:()=>({fill:"#6b7280",fontSize:12,textAnchor:"end",dy:"0.33em"})})},Tt={Bottom:Jd,Left:eu};var au=({items:e})=>e.length===0?null:jsxRuntime.jsx("div",{className:"flex items-center gap-4",children:e.map(t=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-3 w-3 rounded-sm",style:{backgroundColor:t.fill}}),jsxRuntime.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:t.category})]},t.category))}),no=({items:e,onExport:t})=>{let[o,r]=Ve__default.default.useState(false),[a,n]=Ve__default.default.useState(null),i=Ve__default.default.useCallback(async l=>{let s=l;r(true),n(s);try{await t(s);}catch(c){console.error("Export failed:",c);}finally{r(false),n(null);}},[t]);return jsxRuntime.jsxs("div",{className:"mt-4 flex items-center justify-between overflow-y-hidden",children:[jsxRuntime.jsx(au,{items:e}),jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsxs(D,{variant:"secondary",size:"sm",isDisabled:o,children:[jsxRuntime.jsx(h,{name:"Export",size:16}),o?"Exporting...":"Export"]}),jsxRuntime.jsx(reactAriaComponents.Popover,{placement:"top end",className:"min-w-48 p-1 bg-white dark:bg-gray-800 rounded-lg shadow-xl ring-1 ring-gray-200 dark:ring-gray-700",children:jsxRuntime.jsxs(reactAriaComponents.Menu,{onAction:i,className:"outline-none",children:[jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"csv",className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 rounded cursor-pointer outline-none",isDisabled:o,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(h,{name:"List",size:14}),a==="csv"?"Exporting...":"Export as CSV"]})}),jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"svg",className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 rounded cursor-pointer outline-none",isDisabled:o,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(h,{name:"Code",size:14}),a==="svg"?"Exporting...":"Export as SVG"]})}),jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"png",className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 rounded cursor-pointer outline-none",isDisabled:o,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(h,{name:"DownloadSimple",size:14}),a==="png"?"Exporting...":"Export as PNG"]})})]})})]})]})};function ar(e,t,o=true){let r=e||"chart";if(o){let a=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return `${r}-${a}.${t}`}return `${r}.${t}`}async function nr(e,t,o={},r){let a=Array.isArray(t[0])?t:[t];try{switch(e){case "csv":await iu(a,o);break;case "svg":await su(r,o);break;case "png":await lu(r,o);break;default:throw new Error(`Unsupported export type: ${e}`)}}catch(n){throw console.error("Export failed:",n),new Error(`Failed to export chart as ${e}: ${n instanceof Error?n.message:"Unknown error"}`)}}async function iu(e,t){try{let o=new Map;e.forEach(s=>{s.forEach(c=>{let m=c.xValue.getTime();o.has(m)||o.set(m,c.xValue);});});let a=Array.from(o.values()).sort((s,c)=>s.getTime()-c.getTime()).map(s=>{let c={[t.xLabel||"Date"]:s.toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})};return e.forEach((m,d)=>{let u=t.seriesLabels?.[d]||`Series ${d+1}`,f=m.find(g=>g.xValue.getTime()===s.getTime());c[u]=f?f.yValue:"",f?.category&&(c[`${u} Category`]=f.category);}),c}),n=nu__default.default.unparse(a,{header:!0,skipEmptyLines:!0}),i=new Blob([n],{type:"text/csv;charset=utf-8;"}),l=ar(t.filename||"chart-data","csv",t.timestamp!==!1);fileSaver.saveAs(i,l);}catch(o){throw new Error(`CSV export failed: ${o instanceof Error?o.message:"Unknown error"}`)}}async function su(e,t){if(!e.current)throw new Error("SVG element not found");try{let r=e.current.cloneNode(!0);if(!r.querySelector("rect[data-background]")){let c=document.createElementNS("http://www.w3.org/2000/svg","rect");c.setAttribute("width",r.getAttribute("width")||"100%"),c.setAttribute("height",r.getAttribute("height")||"100%"),c.setAttribute("fill","white"),c.setAttribute("data-background","true"),r.insertBefore(c,r.firstChild);}let i=new XMLSerializer().serializeToString(r);i.includes("<?xml")||(i=`<?xml version="1.0" encoding="UTF-8"?>
65
+ `+i),i.includes("xmlns=")||(i=i.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));let l=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),s=ar(t.filename||"chart","svg",t.timestamp!==!1);fileSaver.saveAs(l,s);}catch(o){throw new Error(`SVG export failed: ${o instanceof Error?o.message:"Unknown error"}`)}}async function lu(e,t,o=2){if(!e.current)throw new Error("SVG element not found");let r="";try{let a=e.current,n=a.getBoundingClientRect(),i=a.cloneNode(!0);i.setAttribute("width",String(n.width)),i.setAttribute("height",String(n.height)),i.removeAttribute("transform");let l=i.getElementsByTagName("text");Array.from(l).forEach(u=>{u.style.fontFamily||(u.style.fontFamily="system-ui, -apple-system, sans-serif"),u.style.fontSize||(u.style.fontSize="12px");});let s=document.createElementNS("http://www.w3.org/2000/svg","rect");s.setAttribute("width",String(n.width)),s.setAttribute("height",String(n.height)),s.setAttribute("fill","white"),i.insertBefore(s,i.firstChild);let m=new XMLSerializer().serializeToString(i);m.includes("xmlns=")||(m=m.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));let d=new Blob([m],{type:"image/svg+xml;charset=utf-8"});return r=URL.createObjectURL(d),new Promise((u,f)=>{let g=new Image,p=setTimeout(()=>{r&&URL.revokeObjectURL(r),f(new Error("Image loading timeout"));},1e4);g.onload=()=>{clearTimeout(p);try{let x=document.createElement("canvas");x.width=n.width*o,x.height=n.height*o;let v=x.getContext("2d");if(!v)throw new Error("Canvas context not available");v.imageSmoothingEnabled=!0,v.imageSmoothingQuality="high",v.scale(o,o),v.fillStyle="white",v.fillRect(0,0,n.width,n.height),v.drawImage(g,0,0,n.width,n.height),x.toBlob(w=>{if(w){let L=ar(t.filename||"chart","png",t.timestamp!==!1);fileSaver.saveAs(w,L),u();}else f(new Error("Failed to create PNG blob"));r&&URL.revokeObjectURL(r);},"image/png",1);}catch(x){r&&URL.revokeObjectURL(r),f(x);}},g.onerror=()=>{clearTimeout(p),r&&URL.revokeObjectURL(r),f(new Error("Failed to load SVG as image"));},g.src=r;})}catch(a){throw r&&URL.revokeObjectURL(r),new Error(`PNG export failed: ${a instanceof Error?a.message:"Unknown error"}`)}}function cu(e){if(typeof window>"u")return false;switch(e){case "csv":return true;case "svg":return typeof XMLSerializer<"u";case "png":return typeof HTMLCanvasElement<"u"&&typeof HTMLCanvasElement.prototype.toBlob=="function";default:return false}}function du(e){return {csv:"CSV Spreadsheet",svg:"SVG Vector Image",png:"PNG Image"}[e]||"Unknown Format"}var Rt=new Map,Lt=(e,t="#000000")=>{if(typeof window>"u")return t;let o=e.startsWith("var(")?e.slice(4,-1):e.startsWith("--")?e:`--${e}`;if(Rt.has(o))return Rt.get(o);try{let r=document.documentElement,n=getComputedStyle(r).getPropertyValue(o).trim();if(n)return Rt.set(o,n),n;let i=document.createElement("div");i.style.color=`var(${o})`,document.body.appendChild(i);let l=getComputedStyle(i).color;return document.body.removeChild(i),l&&l!=="rgb(0, 0, 0)"?(Rt.set(o,l),l):t}catch(r){return console.warn(`Failed to resolve color for ${e}:`,r),t}},uu=()=>{Rt.clear();},io=()=>{let e=[];for(let t=1;t<=10;t++){let o=Lt(`--data-categorical-${t}`);o&&e.push(o);}return e.length===0?ha():e},ha=()=>["#444ae1","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#f97316","#14b8a6","#6366f1"],ir=()=>Lt("--data-default","#444ae1"),mu=(e,t)=>{let o={},r=io();return e.forEach((a,n)=>{t&&t[a]?o[a]=t[a]:o[a]=r[n%r.length];}),o},va=e=>{let t=e.match(/\d+/g);if(!t||t.length<3)return true;let[o,r,a]=t.map(Number);return (.299*o+.587*r+.114*a)/255>.5},pu=e=>va(e)?Lt("--text-body","#333333"):Lt("--neutral-white","#ffffff");var so=({data:e,formatType:t})=>{if(!e)return null;let o=st(t),r=Ve__default.default.useRef(null),[a,n]=Ve__default.default.useState({x:0,y:0,translate:"translate(-50%, -100%)"});Ve__default.default.useEffect(()=>{if(!r.current)return;let s=r.current.getBoundingClientRect(),c=window.innerHeight,m=e.x,d=e.y,u=e.position==="left"?"translate(calc(-100% - 16px), -50%)":"translate(16px, -50%)";d-s.height/2<0?d=s.height/2:d+s.height/2>c&&(d=c-s.height/2),n({x:m,y:d,translate:u});},[e.x,e.y,e.position]);let i=l=>new Intl.DateTimeFormat("en",{month:"short",day:"numeric",year:"numeric"}).format(l);return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsxs(framerMotion.motion.div,{ref:r,role:"tooltip","aria-live":"polite",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},"data-testid":"tooltip",className:"pointer-events-none absolute z-50 rounded-lg bg-white p-4 text-sm shadow-xl ring-1 ring-gray-200 dark:bg-gray-800 dark:ring-gray-700",style:{left:a.x,top:a.y,transform:a.translate},children:[jsxRuntime.jsx("time",{className:"mb-1 font-medium text-gray-900 dark:text-gray-100",children:i(e.xValue)}),jsxRuntime.jsx("ul",{className:"list-none p-0",children:e.series.map(l=>jsxRuntime.jsxs("li",{className:"flex items-center gap-2 py-0.5",children:[jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:l.color}}),jsxRuntime.jsxs("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:[l.label,":"]}),jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:o.format(l.value)})]},l.label))})]})})};var lt=({data:e,color:t="#6b7280",strokeWidth:o=3,strokeDasharray:r})=>{let{xScale:a,yScale:n,animationSettings:i}=We(),l=n.range();return jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:i.duration,ease:i.ease},style:{transformOrigin:`0 ${l[0]}px`,transformBox:"fill-box",isolation:"isolate"},children:jsxRuntime.jsx(shape.LinePath,{data:e,x:s=>a(s.xValue),y:s=>n(s.yValue),stroke:t,strokeWidth:o,strokeDasharray:r,strokeLinecap:"round",curve:curve.curveLinear})})};var Su=d3Array.bisector(e=>e.xValue).left,ku=()=>jsxRuntime.jsx("div",{className:"flex h-full items-center justify-center",children:jsxRuntime.jsx("p",{className:"text-gray-500",children:"No data available"})}),Pu=()=>jsxRuntime.jsxs("div",{className:"flex h-full flex-col gap-4 p-4",children:[jsxRuntime.jsx(X,{className:"h-full w-full"}),jsxRuntime.jsxs("div",{className:"flex gap-4",children:[jsxRuntime.jsx(X,{className:"h-4 w-24"}),jsxRuntime.jsx(X,{className:"h-4 w-24"})]})]}),Tu=({parentWidth:e,parentHeight:t,yFormatType:o="number",isLoading:r=false,children:a})=>{let[n,i]=Ve.useState(null),l=Ve.useRef(null),s=Ve.useRef(0),c=Ve.useMemo(()=>io(),[]),m=Ve.useMemo(()=>ir(),[]),{datasets:d,seriesMetadata:u}=Ve.useMemo(()=>{let C=[],F=[],$=0,O=Ve.Children.toArray(a).filter(b=>Ve.isValidElement(b)&&(b.type===at||b.type===lt||b.type===it)&&b.props.data).length;return Ve.Children.forEach(a,b=>{if(Ve.isValidElement(b)&&(b.type===at||b.type===lt||b.type===it)&&b.props.data){C.push(b.props.data);let E=b.props.color||(O===1?m:c[$%c.length]);F.push({label:b.props.label||`Series ${C.length}`,color:E}),$++;}}),{datasets:C,seriesMetadata:F}},[a]),f=e,g=t-60,p=Ve.useMemo(()=>d.flat(),[d]),x=Ve.useMemo(()=>Jo(p,f),[p,f]),v=Ve.useMemo(()=>er(p,g,o),[p,g,o]),w=Ve.useCallback(C=>{let{left:F}=l.current?.getBoundingClientRect()||{left:0},$=C.clientX-F;if(C.timeStamp-(s.current||0)<16)return;s.current=C.timeStamp;let O=x.invert($),b=d.map((U,le)=>{if(!U||U.length===0)return null;let ue=Su(U,O,1);if(ue===0)return {point:U[0],datasetIndex:le};if(ue>=U.length)return {point:U[U.length-1],datasetIndex:le};let Le=U[ue-1],T=U[ue];if(!Le||!T)return null;let I=Math.abs(Le.xValue.getTime()-O.getTime()),_=Math.abs(T.xValue.getTime()-O.getTime());return {point:I<_?Le:T,datasetIndex:le}}).filter(U=>U!==null&&u[U.datasetIndex]!==void 0).map(({point:U,datasetIndex:le})=>({label:u[le].label,value:U.yValue,color:u[le].color,point:U}));if(b.length===0){i(null);return}let E=x(b[0].point.xValue),J=E>(f-Y.right-Y.left)/2+Y.left;i({xValue:b[0].point.xValue,series:b.map(({label:U,value:le,color:ue})=>({label:U,value:le,color:ue})),x:E,y:v(b[0].value),position:J?"left":"right"});},[d,u,x,v,f]),L=()=>{i(null);},B={width:f,height:g,xScale:x,yScale:v,yFormatType:o,animationSettings:pa,tooltip:{data:n,show:i,hide:()=>i(null)}},S=Ve.Children.map(a,(C,F)=>Ve.isValidElement(C)&&(C.type===at||C.type===lt||C.type===it)?Ve__default.default.cloneElement(C,{...C.props,color:u[F]?.color}):C),y=u.map(C=>({category:C.label,fill:C.color})),P=Ve.useCallback(async C=>{try{await nr(C,d,{xLabel:"Date",yLabel:"Value",seriesLabels:u.map(F=>F.label),timestamp:!0},l);}catch(F){console.error("Export failed:",F);}},[d,u]);return r?jsxRuntime.jsx(Pu,{}):d.length===0?jsxRuntime.jsx(ku,{}):jsxRuntime.jsx("div",{className:"relative flex h-full flex-col",children:jsxRuntime.jsxs(ro.Provider,{value:B,children:[jsxRuntime.jsxs("svg",{width:f,height:g,className:"overflow-visible",ref:l,children:[jsxRuntime.jsx("g",{children:v.ticks(5).map(C=>jsxRuntime.jsx(shape.Line,{from:{x:Y.left,y:v(C)},to:{x:f-Y.right,y:v(C)},stroke:"#e5e7eb",strokeWidth:1},`grid-line-${C}`))}),S,jsxRuntime.jsx(Tt.Bottom,{top:g-Y.bottom,scale:x,width:f-Y.left-Y.right}),jsxRuntime.jsx(Tt.Left,{left:Y.left,scale:v,yFormatType:o}),n?.series.map(C=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:x(n.xValue),cy:v(C.value),r:8,fill:"white",stroke:C.color,strokeWidth:2,style:{transition:"all 100ms ease-out"}}),jsxRuntime.jsx("circle",{cx:x(n.xValue),cy:v(C.value),r:4,fill:C.color,style:{transition:"all 100ms ease-out"}})]},`highlight-${C.label}`)),jsxRuntime.jsx("rect",{x:Y.left,y:Y.top,width:f-Y.left-Y.right,height:g-Y.top-Y.bottom,fill:"transparent",style:{cursor:"crosshair"},onMouseMove:w,onMouseLeave:L})]}),jsxRuntime.jsx(so,{data:n,formatType:o}),jsxRuntime.jsx(no,{onExport:P,items:y})]})})},wa=responsive.withParentSize(Tu);function ur(e="left"){switch(e){case "center":return "justify-center text-center";case "right":return "justify-end text-right";default:return "justify-start text-left"}}function Ce(e="normal",t){return tailwindMerge.twMerge({high:"font-semibold text-text-body",normal:"text-text-body",low:"text-text-muted"}[e],t&&"hover:text-action-primary cursor-pointer transition-colors")}function ee(e="left",t){return tailwindMerge.twMerge("flex items-center gap-1",ur(e),t)}function co(e,t="\u2014"){return e==null||e===""?t:String(e)}var Ue={xs:"h-4 w-12",sm:"h-4 w-20",md:"h-4 w-24",lg:"h-4 w-32",xl:"h-4 w-40"};function Ne(e="normal"){return {high:Ue.lg,normal:Ue.md,low:Ue.sm}[e]}function de(e,t){return typeof e=="function"?e(t):e}function Sa(e="neutral",t="sm"){return tailwindMerge.twMerge("inline-flex items-center rounded-full font-medium",t==="sm"?"px-2 py-0.5 text-xs":"px-2.5 py-1 text-sm",{success:"bg-green-100 text-green-800",error:"bg-red-100 text-red-800",warning:"bg-yellow-100 text-yellow-800",info:"bg-blue-100 text-blue-800",neutral:"bg-gray-100 text-gray-800"}[e])}function ka(e){return e?"success":"neutral"}function uo(e,t=false){return t?e>0?"text-green-600":e<0?"text-red-600":"text-text-body":"text-text-body"}function Pa(e="hover"){switch(e){case "visible":return "text-action-primary underline hover:text-action-primary-hover cursor-pointer";case "hover":return "hover:underline hover:text-action-primary cursor-pointer transition-colors";case "none":return "cursor-pointer";default:return ""}}function qe(e,t,o,r="hover",a){if(!t)return e;let n=typeof t=="function"&&o?t(o):t,i=Pa(r);return jsxRuntime.jsx("a",{href:n,className:tailwindMerge.twMerge(i,a),onClick:l=>{l.metaKey||l.ctrlKey;},children:e})}function Ta({row:e,context:t,actions:o,align:r="right",size:a="sm"}){let{isLoading:n}=t;if(n)return jsxRuntime.jsx(X,{className:Ue.sm});let i=o.filter(s=>!de(s.hidden,e));if(i.length===0)return null;let l=ee(r);return jsxRuntime.jsx("div",{className:l,children:i.map(s=>{let c=de(s.disabled,e);return s.variant==="icon"||!s.label?jsxRuntime.jsx(D,{variant:"icon",size:a,onPress:()=>{s.onClick(e);},isDisabled:c,"aria-label":s.label||s.id,children:jsxRuntime.jsx(h,{name:s.icon||"DotsThree",size:a==="sm"?16:20})},s.id):jsxRuntime.jsxs(D,{variant:s.variant||"secondary",size:a,onPress:()=>{s.onClick(e);},isDisabled:c,children:[s.icon&&jsxRuntime.jsx(h,{name:s.icon,size:a==="sm"?14:16}),s.label]},s.id)})})}function Ra({value:e,context:t,format:o="icon",trueText:r="Yes",falseText:a="No",trueIcon:n="Check",falseIcon:i="X",showFalse:l=true,align:s="center",emphasis:c="normal"}){let{isLoading:m}=t;if(m)return jsxRuntime.jsx(X,{className:Ne(c)});let d=!!e;if(!d&&!l)return jsxRuntime.jsx("div",{className:ee(s)});let u=ee(s);switch(o){case "icon":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx(h,{name:d?n:i,size:16,className:d?"text-green-600":"text-gray-400"})});case "text":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx("span",{className:Ce(c),children:d?r:a})});case "badge":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx(Xt,{variant:d?"success":"neutral",size:"sm",children:d?r:a})});default:return null}}function La({value:e,row:t,context:o,format:r="date",customFormat:a,emptyText:n="\u2014",align:i="left",emphasis:l="normal",href:s,linkBehavior:c="hover"}){let{isLoading:m}=o;if(m)return jsxRuntime.jsx(X,{className:Ne(l)});if(!e)return jsxRuntime.jsx("div",{className:ee(i,"text-text-muted"),children:n});let d=e instanceof Date?e:new Date(e);if(isNaN(d.getTime()))return jsxRuntime.jsx("div",{className:ee(i,"text-text-muted"),children:n});let u;switch(r){case "date":u=d.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});break;case "time":u=d.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});break;case "datetime":u=d.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});break;case "relative":u=Mu(d);break;case "custom":u=a?d.toLocaleString("en-US",a):d.toISOString();break;default:u=d.toLocaleDateString();}let f=ee(i,Ce(l)),g=de(s,t);return g?jsxRuntime.jsx("div",{className:f,children:qe(u,g,t,c)}):jsxRuntime.jsx("div",{className:f,children:u})}function Mu(e){let o=new Date().getTime()-e.getTime(),r=Math.floor(o/1e3),a=Math.floor(r/60),n=Math.floor(a/60),i=Math.floor(n/24);return r<60?"just now":a<60?`${a} minute${a!==1?"s":""} ago`:n<24?`${n} hour${n!==1?"s":""} ago`:i<7?`${i} day${i!==1?"s":""} ago`:e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function Ma({value:e,row:t,context:o,format:r="number",decimals:a=0,prefix:n,suffix:i,emptyText:l="\u2014",align:s="right",emphasis:c="normal",href:m,linkBehavior:d="hover",showPositiveSign:u=false,colorCode:f=false}){let{isLoading:g}=o;if(g)return jsxRuntime.jsx(X,{className:Ne(c)});if(e==null||isNaN(Number(e)))return jsxRuntime.jsx("div",{className:ee(s,"text-text-muted"),children:l});let p=Number(e),x;switch(r){case "currency":x=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:a,maximumFractionDigits:a}).format(p);break;case "percent":x=new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:a,maximumFractionDigits:a}).format(p/100);break;case "compact":x=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:a>0?1:0,maximumFractionDigits:a}).format(p);break;default:x=new Intl.NumberFormat("en-US",{minimumFractionDigits:a,maximumFractionDigits:a}).format(p);}let w=`${u&&p>0?"+":""}${x}`,L=f?uo(p,true):Ce(c),B=ee(s,L),S=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx("span",{className:"text-text-muted",children:n}),jsxRuntime.jsx("span",{children:w}),i&&jsxRuntime.jsx("span",{className:"text-text-muted",children:i})]}),y=de(m,t);return y?jsxRuntime.jsx("div",{className:B,children:qe(S,y,t,d)}):jsxRuntime.jsx("div",{className:B,children:S})}function Ba({row:e,context:t,isSelected:o=false,onSelect:r,isDisabled:a=false,align:n="center"}){let{isLoading:i}=t;if(i)return jsxRuntime.jsx("div",{className:ee(n),children:jsxRuntime.jsx(X,{className:"h-4 w-4 rounded"})});let l=de(a,e),s=ee(n);return jsxRuntime.jsx("div",{className:s,children:jsxRuntime.jsx(Ko,{isSelected:o,onChange:c=>{r?.(e,c);},isDisabled:l,"aria-label":"Select row"})})}function Fa({value:e,row:t,context:o,prefix:r,suffix:a,emptyText:n="\u2014",href:i,linkBehavior:l="visible",emphasis:s="normal",truncate:c=true,align:m="left"}){let{isLoading:d}=o;if(d)return jsxRuntime.jsx(X,{className:Ne(s)});let u=co(e,n),f=de(i,t),g=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r&&jsxRuntime.jsx("span",{className:"text-text-muted",children:r}),jsxRuntime.jsx("span",{className:c?"truncate":"",children:u}),a&&jsxRuntime.jsx("span",{className:"text-text-muted",children:a})]}),p=ee(m,Ce(s));return f?jsxRuntime.jsx("div",{className:p,children:qe(g,f,t,l)}):jsxRuntime.jsx("div",{className:p,children:g})}var Du={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},$u={sm:"hidden sm:grid",md:"hidden md:grid",lg:"hidden lg:grid",xl:"hidden xl:grid"};function po(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function fo(e,t,o,r){if(o.cell){let a=o.cell,n=typeof o.cellProps=="function"?o.cellProps(e,t):o.cellProps;return jsxRuntime.jsx(a,{value:e,row:t,context:r,...n})}return o.render?o.render(e,t,r):e?.toString()??"\u2014"}function bo({row:e,columns:t,density:o,isLoading:r,onClick:a}){let n=t.filter(d=>d.mobile!==false).map(d=>{let u=d.mobile===false?null:d.mobile;return {...d,mobilePriority:u?.priority??2,mobileFormat:u?.format??"secondary",showLabel:u?.label??u?.format==="secondary",icon:u?.icon}}).sort((d,u)=>d.mobilePriority-u.mobilePriority),i=n.filter(d=>d.mobilePriority===1||d.mobileFormat==="primary"),l=n.filter(d=>d.mobilePriority===2&&d.mobileFormat!=="primary"),s=n.filter(d=>d.mobileFormat==="badge"),c={isLoading:!!r,rowIndex:0,columnIndex:0,density:o};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",a&&"cursor-pointer hover:bg-background-hover active:bg-background-pressed",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[o]),onClick:a,role:a?"button":void 0,tabIndex:a?0:void 0,children:[i.length>0&&jsxRuntime.jsxs("div",{className:"mb-2 flex items-start justify-between",children:[jsxRuntime.jsx("div",{className:"flex-1",children:i.map(d=>{let u=po(e,d);return jsxRuntime.jsx("div",{className:"font-medium text-text-body [&>*]:!justify-start [&>*]:!text-left",children:fo(u,e,d,c)},d.id)})}),s.length>0&&jsxRuntime.jsx("div",{className:"ml-2 flex flex-wrap gap-1",children:s.map(d=>{let u=po(e,d);return jsxRuntime.jsx("div",{className:"inline-flex",children:fo(u,e,d,c)},d.id)})})]}),l.length>0&&jsxRuntime.jsx("div",{className:"space-y-1",children:l.map(d=>{let u=po(e,d),f=d.showLabel&&d.label;return jsxRuntime.jsxs("div",{className:"flex items-center text-sm text-text-muted",children:[d.icon&&jsxRuntime.jsx(h,{name:d.icon,className:"mr-1.5 h-4 w-4 flex-shrink-0"}),f&&jsxRuntime.jsxs("span",{className:"mr-1 font-medium",children:[d.label,":"]}),jsxRuntime.jsx("span",{className:"truncate [&>*]:!justify-start [&>*]:!text-left",children:fo(u,e,d,c)})]},d.id)})})]})}function xo({row:e,columns:t,density:o,isLoading:r,onClick:a}){let n=t.filter(s=>s.mobile!==false),i={isLoading:!!r,rowIndex:0,columnIndex:0,density:o};return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",a&&"cursor-pointer hover:bg-background-hover active:bg-background-pressed",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[o]),onClick:a,role:a?"button":void 0,tabIndex:a?0:void 0,children:jsxRuntime.jsx("div",{className:"space-y-2",children:n.map((s,c)=>{let m=po(e,s),d=c===0;return jsxRuntime.jsxs("div",{children:[!d&&jsxRuntime.jsx("div",{className:"text-xs text-text-muted",children:s.label}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(d?"font-medium text-text-body":"text-sm text-text-body","[&>*]:!justify-start [&>*]:!text-left"),children:fo(m,e,s,i)})]},s.id)})})})}function Ea(e="md"){return {mobile:Du[e],desktop:$u[e]}}function Ia({density:e}){return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[e]),children:[jsxRuntime.jsx("div",{className:"mb-2 h-5 w-3/4 animate-pulse rounded bg-background-muted"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-background-muted"}),jsxRuntime.jsx("div",{className:"h-4 w-2/3 animate-pulse rounded bg-background-muted"})]})]})}var pr={compact:"py-1.5 px-3 text-sm",default:"py-3 px-4 text-sm",relaxed:"py-4 px-4 text-base"},fr={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"},Vu={full:"w-full",auto:"w-auto inline-block",contained:"w-full max-w-6xl mx-auto"},zu={auto:"table-auto",fixed:"table-fixed",responsive:"table-auto"};function gr(e){let t={};return e.width!==void 0&&(t.width=typeof e.width=="number"?`${e.width}px`:e.width),e.minWidth!==void 0&&(t.minWidth=typeof e.minWidth=="number"?`${e.minWidth}px`:e.minWidth),e.maxWidth!==void 0&&(t.maxWidth=typeof e.maxWidth=="number"?`${e.maxWidth}px`:e.maxWidth),e.flex!==void 0&&(t.flex=`${e.flex} 1 0`),t}function Hu(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function Ou({column:e,sortConfig:t,onSort:o,stickyHeader:r,density:a="default"}){let n=t?.columnId===e.id,i=n?t.direction:null;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1 border-b border-border-default bg-background-surface font-medium text-text-muted",pr[a],fr[e.align||"left"],r&&"sticky top-0 z-10",e.sortable&&"cursor-pointer hover:bg-background-hover"),onClick:()=>e.sortable&&o(e.id),role:"columnheader","aria-sort":n?i==="asc"?"ascending":"descending":"none",style:gr(e),children:[jsxRuntime.jsx("span",{className:"truncate",children:e.label}),e.sortable&&jsxRuntime.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsx(h,{name:i==="asc"?"CaretUp":i==="desc"?"CaretDown":"CaretUp",size:12,className:n?"text-text-body":"text-text-muted opacity-50"})})]})}function Gu({column:e,row:t,rowIndex:o,columnIndex:r,isHovered:a,density:n="default",className:i}){let l=Hu(t,e),s={isLoading:false,isHovered:a,rowIndex:o,columnIndex:r,density:n},c;if(e.cell){let m=e.cell,d=typeof e.cellProps=="function"?e.cellProps(l,t):e.cellProps;c=jsxRuntime.jsx(m,{value:l,row:t,context:s,...d});}else e.render?c=e.render(l,t,s):c=jsxRuntime.jsx("span",{className:"truncate",children:l?.toString()??""});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default",pr[n],fr[e.align||"left"],i),role:"cell",style:gr(e),children:c})}function Wu({column:e,rowIndex:t,columnIndex:o,density:r="default"}){let a={isLoading:true,rowIndex:t,columnIndex:o,density:r},n;if(e.cell){let i=e.cell,l=typeof e.cellProps=="function"?e.cellProps(null,{}):e.cellProps;n=jsxRuntime.jsx(i,{value:null,row:{},context:a,...l});}else e.render?n=e.render(null,{},a):n=jsxRuntime.jsx(X,{className:"h-4 w-full max-w-[200px]"});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default",pr[r],fr[e.align||"left"]),role:"cell",style:gr(e),children:n})}function _u({columns:e,row:t,rowIndex:o,density:r="default",onClick:a}){let[n,i]=Ve.useState(false),l=Ve.useCallback(()=>{a&&a(t);},[a,t]);return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("contents group",a&&"cursor-pointer"),role:"row",onClick:l,onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),children:e.map((s,c)=>jsxRuntime.jsx(Gu,{column:s,row:t,rowIndex:o,columnIndex:c,isHovered:n,density:r,className:a?"group-hover:bg-background-hover":""},s.id))})}function Uu({columns:e,rowIndex:t,density:o="default"}){return jsxRuntime.jsx("div",{className:"contents",role:"row",children:e.map((r,a)=>jsxRuntime.jsx(Wu,{column:r,rowIndex:t,columnIndex:a,density:o},r.id))})}function Aa({columns:e,data:t,className:o,density:r="default",width:a="full",height:n,maxHeight:i,layout:l="auto",mobileRenderer:s="auto",customMobileRowRender:c,mobileBreakpoint:m="md",isLoading:d=false,loadingRowCount:u=5,stickyHeader:f=false,onRowClick:g,getRowId:p,hideHeader:x=false,onSort:v,"aria-label":w}){let[L,B]=Ve.useState(null),S=Ve.useMemo(()=>e.map(b=>{if(b.width)return typeof b.width=="number"?`${b.width}px`:b.width;if(b.flex)return `${b.flex}fr`;if(b.minWidth&&b.maxWidth){let E=typeof b.minWidth=="number"?`${b.minWidth}px`:b.minWidth,J=typeof b.maxWidth=="number"?`${b.maxWidth}px`:b.maxWidth;return `minmax(${E}, ${J})`}return b.minWidth?`minmax(${typeof b.minWidth=="number"?`${b.minWidth}px`:b.minWidth}, 1fr)`:b.maxWidth?`minmax(0, ${typeof b.maxWidth=="number"?`${b.maxWidth}px`:b.maxWidth})`:"1fr"}).join(" "),[e]),y=Ve.useCallback(b=>{if(!e.find(U=>U.id===b)?.sortable)return;let J=null;L?.columnId===b?L.direction==="asc"?J={columnId:b,direction:"desc"}:J=null:J={columnId:b,direction:"asc"},B(J),v?.(J);},[e,L,v]),P={};n&&(P.height=typeof n=="number"?`${n}px`:n,P.overflowY="auto"),i&&(P.maxHeight=typeof i=="number"?`${i}px`:i,P.overflowY="auto");let C=tailwindMerge.twMerge(Vu[a],l==="responsive"?"overflow-x-auto":"overflow-auto",o),F=Ea(m),$=s!=="none",O=(b,E)=>$?s==="custom"&&c?c(b,E):jsxRuntime.jsx(s==="cards"?xo:bo,{row:b,columns:e,density:r,isLoading:d,onClick:g?()=>g(b):void 0}):null;return jsxRuntime.jsxs("div",{className:C,style:P,children:[jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("grid border-separate border-spacing-0",zu[l],a==="auto"?"inline-grid w-auto":"w-full",$&&F.desktop),role:"table","aria-label":w,style:{gridTemplateColumns:S},children:[!x&&jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:e.map(b=>jsxRuntime.jsx(Ou,{column:b,sortConfig:L,onSort:y,stickyHeader:f,density:r},b.id))}),jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:d?Array.from({length:u}).map((b,E)=>jsxRuntime.jsx(Uu,{columns:e,rowIndex:E,density:r},`loading-${E}`)):t.length>0?t.map((b,E)=>{let J=p?p(b):`row-${E}`;return jsxRuntime.jsx(_u,{columns:e,row:b,rowIndex:E,density:r,onClick:g},J)}):jsxRuntime.jsx("div",{className:"col-span-full py-12 text-center text-text-muted",role:"row",children:jsxRuntime.jsx("div",{role:"cell",children:"No data available"})})})]}),$&&jsxRuntime.jsx("div",{className:F.mobile,children:d?Array.from({length:u}).map((b,E)=>jsxRuntime.jsx(Ia,{density:r},`mobile-loading-${E}`)):t.length>0?t.map((b,E)=>{let J=p?p(b):`mobile-row-${E}`;return jsxRuntime.jsx("div",{children:O(b,E)},J)}):jsxRuntime.jsx("div",{className:"py-12 text-center text-text-muted",children:"No data available"})})]})}function Va({label:e,description:t,errorMessage:o,showCalendar:r=false,...a}){let[n,i]=Ve.useState(false),l=s=>{a.onChange&&s&&a.onChange(s),i(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...a,className:G(a.className,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(q,{children:e}),r?jsxRuntime.jsxs(jt,{className:"w-auto min-w-[208px]",children:[jsxRuntime.jsx(mt,{className:"min-w-[150px] flex-1"}),jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:n,onOpenChange:i,children:[jsxRuntime.jsx(D,{variant:"icon",className:"mr-1 w-6 rounded outline-offset-0",children:jsxRuntime.jsx(lucideReact.CalendarIcon,{"aria-hidden":true,className:"h-4 w-4"})}),jsxRuntime.jsx(reactAriaComponents.Popover,{children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"p-4",children:jsxRuntime.jsx(Qt,{value:a.value,onChange:l,minValue:a.minValue,maxValue:a.maxValue,isDisabled:a.isDisabled,isReadOnly:a.isReadOnly,isDateUnavailable:a.isDateUnavailable})})})]})]}):jsxRuntime.jsx(mt,{}),t&&jsxRuntime.jsx(j,{children:t}),typeof o=="string"?jsxRuntime.jsx(W,{children:o}):null]})}function em({isPlaceholder:e,isDisabled:t}){return ["inline box-content px-0.5 -my-0.5 rounded outline-none tabular-nums text-center transition-colors",e?"text-text-muted italic":"text-text-body",t?"text-text-disabled cursor-not-allowed":"cursor-text","hover:bg-text-body/5","data-[focused]:!outline-[1.5px] data-[focused]:!outline-[var(--control-focus-ring-color)] data-[focused]:![--tw-outline-style:solid]"].filter(Boolean).join(" ")}function mt(e){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:t=>wt({...t,className:typeof e.className=="string"?e.className:"min-w-[150px] px-2 py-1.5 text-sm flex items-center gap-0.5"}),...e,children:t=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:t,className:em({isPlaceholder:t.isPlaceholder,isDisabled:!t.isEditable})})})}function pt(e){return jsxRuntime.jsx(reactAriaComponents.Dialog,{...e,className:tailwindMerge.twMerge("relative h-auto max-h-[inherit] overflow-auto outline-none [[data-placement]>&]:p-4",e.className),role:"dialog"})}function cm({selectionState:e,isDisabled:t}){let o=`${te} w-full h-full flex items-center justify-center rounded-sm forced-color-adjust-none font-semibold`,r={none:"text-text-body group-hover:bg-gray-200 group-pressed:bg-gray-200",middle:["group-hover:bg-gray-300 forced-colors:group-hover:bg-[Highlight]","group-invalid:group-hover:bg-red-200 forced-colors:group-invalid:group-hover:bg-[Mark]","group-pressed:bg-blue-300 forced-colors:group-pressed:bg-[Highlight] forced-colors:text-[HighlightText]","group-invalid:group-pressed:bg-red-300 forced-colors:group-invalid:group-pressed:bg-[Mark]"].join(" "),cap:" group-invalid:bg-red-600 forced-colors:bg-[Highlight] forced-colors:group-invalid:bg-[Mark] text-white forced-colors:text-white !bg-neutral-black"},a=t?"text-textFaint dark:text-zinc-600 forced-colors:text-textFaint font-light":"";return [o,r[e],a].filter(Boolean).join(" ")}function ho({errorMessage:e,...t}){return jsxRuntime.jsxs(reactAriaComponents.RangeCalendar,{...t,children:[jsxRuntime.jsx(Jt,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"w-full [&_td]:px-0",children:[jsxRuntime.jsx(eo,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:o=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:o,className:"selection-start:rounded-s-end selection-end:rounded-e-end [td:last-child_&]:rounded-e-end group h-9 w-9 cursor-default text-sm outline-none outside-month:text-gray-300 selected:bg-background-selected invalid:selected:bg-red-100 forced-colors:selected:bg-[Highlight] forced-colors:selected:text-white forced-colors:invalid:selected:bg-[Mark] [td:first-child_&]:rounded-s-full",children:({formattedDate:r,isSelected:a,isSelectionStart:n,isSelectionEnd:i,isFocusVisible:l,isDisabled:s})=>jsxRuntime.jsx("span",{className:cm({selectionState:a&&(n||i)?"cap":a?"middle":"none",isDisabled:s}),children:r})})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-red-600",children:e})]})}function Oa({label:e,description:t,errorMessage:o,...r}){return jsxRuntime.jsxs(reactAriaComponents.DateRangePicker,{...r,className:G(r.className,"group flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(q,{children:e}),jsxRuntime.jsxs(jt,{className:"w-auto min-w-[208px]",children:[jsxRuntime.jsx(mt,{slot:"start",className:"px-2 py-1.5 text-sm"}),jsxRuntime.jsx("span",{"aria-hidden":"true",className:"text-gray-800 group-disabled:text-gray-200 dark:text-zinc-200 group-disabled:dark:text-zinc-600 forced-colors:text-[ButtonText] group-disabled:forced-colors:text-[GrayText]",children:"\u2013"}),jsxRuntime.jsx(mt,{slot:"end",className:"flex-1 px-2 py-1.5 text-sm"}),jsxRuntime.jsx(D,{variant:"icon",className:"mr-1 w-6 rounded outline-offset-0",children:jsxRuntime.jsx(lucideReact.CalendarIcon,{"aria-hidden":true,className:"h-4 w-4"})})]}),t&&jsxRuntime.jsx(j,{children:t}),typeof o=="string"?jsxRuntime.jsx(W,{children:o}):null,jsxRuntime.jsx(Oe,{children:jsxRuntime.jsx(pt,{children:jsxRuntime.jsx(ho,{})})})]})}var gt=({title:e,onClose:t,hideCloseIcon:o=false,titleAlign:r="left",hasBackArrow:a=false,onBack:n,headerContent:i})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full items-center justify-between border-b px-4",e&&"border-b",r==="center"?"justify-center":""),children:[a&&jsxRuntime.jsx(D,{variant:"unstyled",onPress:n,className:"absolute left-4",children:jsxRuntime.jsx(h,{name:"CaretLeft","data-testid":"back-arrow"})}),i||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(ot,{size:"xs",children:e}),t&&!o&&jsxRuntime.jsx(D,{variant:"unstyled",onPress:t,"aria-label":"Close dialog",children:jsxRuntime.jsx(h,{name:"X","data-testid":"close-button"})})]})]});var bt=class extends Ve.Component{constructor(){super(...arguments);To(this,"state",{hasError:false});To(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(o){return {hasError:true,error:o}}componentDidCatch(o,r){console.error("Error Boundary caught an error:",o,r);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsx(to,{heading:this.props.title,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-6","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-red-500",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-600",onClick:this.handleRetry,children:"Retry"})]})}):this.props.children}};var vr=({children:e,title:t,headerContent:o,isOpen:r,slideInFrom:a="right",transparentOverlay:n=false,onClose:i,className:l,primaryAction:s,secondaryAction:c,footerContent:m,contentPadding:d=true,maxWidth:u="400px"})=>{let[f,g]=Ve.useState(false);if(Ve.useEffect(()=>{if(r){let v=setTimeout(()=>g(true),10);return ()=>clearTimeout(v)}else g(false);},[r]),!r)return null;let p=s||c,x=p||m;return jsxRuntime.jsx(bt,{children:jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{isOpen:r,onOpenChange:i,isDismissable:true,className:`fixed inset-0 z-50 ${n?"bg-transparent":"bg-black/50"}`,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"flex justify-end",isDismissable:true,children:jsxRuntime.jsxs(pt,{className:`fixed bottom-0 top-0 z-50 flex w-full flex-col bg-background-surface shadow-xl duration-300 h-full min-h-0 overflow-hidden dark:bg-gray-800 ${f?a==="right"?"animate-in slide-in-from-right":"animate-in slide-in-from-left":""} ${l||""}`,style:{[a==="right"?"right":"left"]:0,maxWidth:u,transform:f?void 0:a==="right"?"translateX(100%)":"translateX(-100%)"},children:[(t||o)&&jsxRuntime.jsx(gt,{title:t,headerContent:o,onClose:i||(()=>{})}),jsxRuntime.jsx("div",{className:`flex-1 overflow-y-auto overscroll-contain ${d?"p-6":"p-0"}`,children:e}),x&&jsxRuntime.jsxs("div",{className:"flex h-28 w-full flex-col items-center justify-center border-t p-4",children:[m&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:m}),p&&jsxRuntime.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[c&&jsxRuntime.jsx(D,{size:c.size||"lg",fullWidth:true,variant:c.variant||"secondary",onPress:c.onPress,isLoading:c.isLoading,isDisabled:c.isDisabled,children:c.label}),s&&jsxRuntime.jsx(D,{size:s.size||"lg",fullWidth:true,onPress:s.onPress,isLoading:s.isLoading,isDisabled:s.isDisabled,children:s.label})]})]})]})})})})};vr.displayName="Drawer";function _a({value:e,onChange:t,onUrlChange:o,accept:r="image/*",maxSize:a,isDisabled:n=false,onUpload:i,className:l,showPreview:s=true,placeholder:c="Drop files here or click to browse"}){let[m,d]=Ve.useState(false),[u,f]=Ve.useState(false),[g,p]=Ve.useState(null),[x,v]=Ve.useState(e),w=Ve.useRef(null),L=async y=>{if(p(null),a&&y.size>a){p(`File size must be less than ${(a/1024/1024).toFixed(2)}MB`);return}if(s&&y.type.startsWith("image/")){let P=new FileReader;P.onloadend=()=>{v(P.result);},P.readAsDataURL(y);}if(i){f(true);try{let P=await i(y);v(P),o?.(P);}catch(P){p("Failed to upload file"),console.error("Upload error:",P);}finally{f(false);}}t?.(y,x);},B=y=>{let P=y.items;if(P.length>0){let C=P[0];if(C.kind==="file"){let F=C.getAsFile();F&&L(F);}}d(false);},S=()=>{v(void 0),p(null),t?.(null),o?.(""),w.current&&(w.current.value="");};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("w-full",l),children:[jsxRuntime.jsxs(reactAriaComponents.DropZone,{className:tailwindMerge.twMerge("relative flex min-h-[200px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",m?"border-action-primary bg-action-primary/5":"border-border-muted hover:border-border-default",n&&"pointer-events-none opacity-50",g&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:B,onDropEnter:()=>d(true),onDropExit:()=>d(false),children:[x?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[s&&x.startsWith("data:image")?jsxRuntime.jsx("img",{src:x,alt:"Preview",className:"max-h-48 max-w-full rounded-md object-contain"}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Image,{className:"h-12 w-12 text-text-muted"}),jsxRuntime.jsx("span",{className:"text-sm text-text-muted",children:"File uploaded"})]}),!n&&jsxRuntime.jsx(D,{variant:"icon",size:"sm",onPress:S,className:"absolute right-2 top-2 bg-background-surface shadow-md",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"h-12 w-12 text-text-muted"}),jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-sm text-text-body",children:c}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-text-muted",children:r==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${r}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:r.split(","),onSelect:y=>{let P=Array.from(y||[]);P.length>0&&L(P[0]);},children:jsxRuntime.jsx(D,{variant:"secondary",size:"sm",isDisabled:n,children:"Choose File"})})]}),u&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg bg-background-surface/80",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-action-primary border-t-transparent"}),jsxRuntime.jsx("span",{className:"text-sm text-text-muted",children:"Uploading..."})]})})]}),g&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-feedback-error-text",children:g})]})}function Ua(e){return jsxRuntime.jsx(reactAriaComponents.Form,{...e,className:tailwindMerge.twMerge("flex flex-col gap-4",e.className)})}function Mm({children:e,...t}){return jsxRuntime.jsx(reactAriaComponents.ListBox,{...t,className:G(t.className,"outline-0"),children:e})}var Za=({className:e,size:t=24,color:o="text-action-primary"})=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent",o,e),style:{width:t,height:t},role:"status","aria-label":"loading",children:jsxRuntime.jsx("span",{className:"sr-only",children:"Loading..."})});var Dt={dark:"mapbox://styles/mapbox/dark-v11",light:"mapbox://styles/mapbox/light-v11",streets:"mapbox://styles/mapbox/streets-v12",satellite:"mapbox://styles/mapbox/satellite-streets-v12"};function Ka({width:e="100%",height:t="100%",initialViewState:o={longitude:-122.4194,latitude:37.7749,zoom:14},isLoading:r=false,theme:a="streets",mapboxAccessToken:n,showMarker:i=true,className:l}){let s={width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t};return r?jsxRuntime.jsx("div",{style:s,className:l,children:jsxRuntime.jsx(X,{width:s.width,height:s.height})}):n?jsxRuntime.jsx("div",{style:s,className:l,children:jsxRuntime.jsxs(Em__default.default,{mapboxAccessToken:n,initialViewState:o,style:s,mapStyle:Dt[a],scrollZoom:false,dragPan:false,dragRotate:false,doubleClickZoom:false,touchZoomRotate:false,attributionControl:false,interactive:false,children:[i&&jsxRuntime.jsx(Em.Marker,{longitude:o.longitude,latitude:o.latitude,anchor:"bottom",children:jsxRuntime.jsx(h,{name:"MapPin",size:36,className:"text-action-primary",weight:"fill"})}),jsxRuntime.jsx(Em.AttributionControl,{compact:true,position:"bottom-right"})]})}):jsxRuntime.jsx("div",{style:s,className:`flex items-center justify-center bg-background-muted text-text-muted ${l}`,children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(h,{name:"MapPin",size:48,className:"mx-auto mb-2 opacity-50"}),jsxRuntime.jsx("p",{className:"text-sm",children:"Map requires Mapbox token"})]})})}function Gm(e){return {type:"FeatureCollection",features:e.map(t=>({type:"Feature",properties:{id:t.id,...t.properties},geometry:{type:"Point",coordinates:[t.longitude,t.latitude]}}))}}function Wm(e){if(e.length===0)return null;let t=e[0].latitude,o=e[0].latitude,r=e[0].longitude,a=e[0].longitude;return e.forEach(n=>{t=Math.min(t,n.latitude),o=Math.max(o,n.latitude),r=Math.min(r,n.longitude),a=Math.max(a,n.longitude);}),{longitude:(r+a)/2,latitude:(t+o)/2,zoom:10}}function Ja({data:e,initialViewState:t,viewState:o,onViewStateChange:r,onPointClick:a,selectedPointId:n,scrollEnabled:i=true,className:l,theme:s="streets",mapboxAccessToken:c,enableClustering:m=true,renderMarker:d}){let u=Ve.useRef(null),[f,g]=Ve.useState(false),p=Ve.useMemo(()=>t||Wm(e)||{longitude:-122.4194,latitude:37.7749,zoom:10},[t,e]),x=Ve.useCallback(y=>{r?.(y.viewState);let P=Math.abs(y.viewState.longitude-p.longitude)>.01||Math.abs(y.viewState.latitude-p.latitude)>.01||Math.abs(y.viewState.zoom-p.zoom)>.5;g(P);},[r,p]),v=Ve.useCallback(()=>{u.current?.flyTo({center:[p.longitude,p.latitude],zoom:p.zoom,duration:1e3}),g(false);},[p]),w=Ve.useCallback(y=>{let P=y.features?.[0];P&&P.properties?.id&&a?.(P.properties.id);},[a]),L=Ve.useMemo(()=>Gm(e),[e]),B=Ve.useMemo(()=>n?e.find(y=>y.id===n):null,[n,e]),S=Ve.useMemo(()=>{let y={id:"unclustered-points",type:"circle",source:"points",filter:m?["!",["has","point_count"]]:void 0,paint:{"circle-color":["case",["==",["get","id"],n||""],"#3B82F6","#10B981"],"circle-radius":["case",["==",["get","id"],n||""],10,8],"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}};return m?[{id:"clusters",type:"circle",source:"points",filter:["has","point_count"],paint:{"circle-color":"#F59E0B","circle-radius":["step",["get","point_count"],20,10,25,30,30],"circle-stroke-width":2,"circle-stroke-color":"#ffffff"}},{id:"cluster-count",type:"symbol",source:"points",filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["DIN Offc Pro Medium","Arial Unicode MS Bold"],"text-size":12},paint:{"text-color":"#ffffff"}},y]:[y]},[n,m]);return c?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative h-full w-full",l),children:jsxRuntime.jsxs(Em__default.default,{ref:u,initialViewState:o||p,style:{width:"100%",height:"100%"},mapStyle:Dt[s],mapboxAccessToken:c,onMove:x,onClick:w,interactiveLayerIds:["unclustered-points","clusters"],scrollZoom:i,cursor:"pointer",children:[jsxRuntime.jsx(Em.NavigationControl,{position:"top-right"}),f&&jsxRuntime.jsx(D,{className:"absolute bottom-4 right-4 shadow-lg",onPress:v,variant:"secondary",size:"sm",children:"Reset View"}),L&&jsxRuntime.jsx(Em.Source,{id:"points",type:"geojson",data:L,cluster:m,clusterMaxZoom:14,clusterRadius:50,children:S.map(y=>jsxRuntime.jsx(Em.Layer,{...y},y.id))}),B&&!d&&jsxRuntime.jsx(Em.Marker,{longitude:B.longitude,latitude:B.latitude,children:jsxRuntime.jsx(h,{name:"MapPin",size:40,className:"text-action-primary relative -top-5",weight:"fill"})}),d&&e.map(y=>jsxRuntime.jsx(Em.Marker,{longitude:y.longitude,latitude:y.latitude,children:d(y,y.id===n)},y.id))]})}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center justify-center h-96 bg-background-muted text-text-muted",l),children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(h,{name:"MapPin",size:48,className:"mx-auto mb-2 opacity-50"}),jsxRuntime.jsx("p",{className:"text-sm",children:"Map requires Mapbox token"})]})})}var qm={sm:{bar:"h-1.5 w-48",text:"text-xs",icon:"h-3 w-3"},md:{bar:"h-2 w-64",text:"text-sm",icon:"h-4 w-4"},lg:{bar:"h-3 w-80",text:"text-base",icon:"h-5 w-5"}};function en({label:e,size:t="md",variant:o="default",showWarningIndicator:r=true,warningThreshold:a=80,className:n,...i}){let l=qm[t];return jsxRuntime.jsx(reactAriaComponents.Meter,{...i,className:G(n,"flex flex-col gap-1"),children:({percentage:s,valueText:c})=>{let m=r&&s>=a,d=o==="default"?Zm(s):o;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex justify-between gap-2",children:[e&&jsxRuntime.jsx(q,{children:e}),jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge(l.text,m?"text-feedback-error-text":"text-text-muted"),children:[m&&jsxRuntime.jsx(lucideReact.AlertTriangle,{"aria-label":"Warning: High value",className:tailwindMerge.twMerge("inline-block align-text-bottom mr-1",l.icon)}),c]})]}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative rounded-full bg-background-muted","ring-1 ring-inset ring-border-muted",l.bar),children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute left-0 top-0 h-full rounded-full transition-all duration-300","forced-colors:bg-[Highlight]",jm(d)),style:{width:`${Math.min(100,Math.max(0,s))}%`},role:"presentation","aria-hidden":"true"})})]})}})}function Zm(e){return e<50?"success":e<70?"info":e<90?"warning":"error"}function jm(e){switch(e){case "success":return "bg-feedback-success-text";case "warning":return "bg-feedback-warning-text";case "error":return "bg-feedback-error-text";case "info":return "bg-feedback-info-text";default:return "bg-action-primary-background"}}var ap={success:{container:"bg-feedback-success-background border-feedback-success-border text-feedback-success-text",icon:lucideReact.CheckCircle},error:{container:"bg-feedback-error-background border-feedback-error-border text-feedback-error-text",icon:lucideReact.XCircle},warning:{container:"bg-feedback-warning-background border-feedback-warning-border text-feedback-warning-text",icon:lucideReact.AlertCircle},info:{container:"bg-feedback-info-background border-feedback-info-border text-feedback-info-text",icon:lucideReact.Info}};function wo({id:e,message:t,variant:o="info",duration:r=5e3,dismissible:a=true,onDismiss:n,className:i}){let{container:l,icon:s}=ap[o];return Ve.useEffect(()=>{if(r>0){let c=setTimeout(()=>{n?.();},r);return ()=>clearTimeout(c)}},[r,n]),jsxRuntime.jsxs(framerMotion.motion.div,{layout:true,initial:{opacity:0,y:-20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.95,transition:{duration:.2}},className:tailwindMerge.twMerge("pointer-events-auto flex items-start gap-3 rounded-lg border p-4 shadow-lg",l,i),children:[jsxRuntime.jsx(s,{className:"h-5 w-5 flex-shrink-0"}),jsxRuntime.jsx("p",{className:"flex-1 text-sm font-medium",children:t}),a&&jsxRuntime.jsx("button",{onClick:n,className:"flex-shrink-0 rounded-md p-1 transition-colors hover:bg-black/10","aria-label":"Dismiss notification",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}var up={"top-left":"top-4 left-4 items-start","top-center":"top-4 left-1/2 -translate-x-1/2 items-center","top-right":"top-4 right-4 items-end","bottom-left":"bottom-4 left-4 items-start","bottom-center":"bottom-4 left-1/2 -translate-x-1/2 items-center","bottom-right":"bottom-4 right-4 items-end"};function So({notices:e,onDismiss:t,position:o="top-right",className:r}){let[a,n]=Ve.useState(false);if(Ve.useEffect(()=>{n(true);},[]),!a)return null;let i=jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("pointer-events-none fixed z-50 flex flex-col gap-2",up[o],r),"aria-live":"polite","aria-atomic":"true",children:jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"sync",children:e.map(l=>jsxRuntime.jsx(wo,{id:l.id,message:l.message,variant:l.variant,duration:l.duration,dismissible:l.dismissible,onDismiss:()=>t(l.id)},l.id))})});return reactDom.createPortal(i,document.body)}var tn=Ve.createContext(void 0);function on({children:e,position:t="top-right",maxNotices:o=5,defaultDuration:r=5e3,defaultDismissible:a=true}){let[n,i]=Ve.useState([]),l=Ve.useCallback((d,u)=>{let f=`notice-${Date.now()}-${Math.random()}`,g={id:f,message:d,variant:u?.variant||"info",duration:u?.duration??r,dismissible:u?.dismissible??a};return i(p=>{let x=[...p,g];return x.length>o?x.slice(-o):x}),f},[o,r,a]),s=Ve.useCallback(d=>{i(u=>u.filter(f=>f.id!==d));},[]),c=Ve.useCallback(()=>{i([]);},[]),m={notices:n,addNotice:l,removeNotice:s,clearNotices:c};return jsxRuntime.jsxs(tn.Provider,{value:m,children:[e,jsxRuntime.jsx(So,{notices:n,onDismiss:s,position:t})]})}function rn(){let e=Ve.useContext(tn);if(!e)throw new Error("useNoticeContext must be used within a NoticeProvider");return e}function an(){let{addNotice:e,removeNotice:t,clearNotices:o}=rn(),r=Ve.useCallback((s,c)=>e(s,c),[e]),a=Ve.useCallback((s,c)=>e(s,{...c,variant:"success"}),[e]),n=Ve.useCallback((s,c)=>e(s,{...c,variant:"error"}),[e]),i=Ve.useCallback((s,c)=>e(s,{...c,variant:"warning"}),[e]),l=Ve.useCallback((s,c)=>e(s,{...c,variant:"info"}),[e]);return {show:r,success:a,error:n,warning:i,info:l,dismiss:t,clear:o}}var Np=e=>tailwindMerge.twMerge(tt({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused}),e.transparent?"bg-transparent":"bg-background-input","pr-9","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",e.className);function sn({label:e,description:t,errorMessage:o,size:r,tooltip:a,isRequired:n,transparent:i,validationResult:l,...s}){let c=Ve.useId();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...s,id:c,isRequired:n,className:G(s.className,"group flex flex-col gap-1"),step:s.step??1,onChange:m=>{typeof m=="number"&&(s.maxValue!=null&&m>s.maxValue?s.onChange?.(s.maxValue):s.minValue!=null&&m<s.minValue?s.onChange?.(s.minValue):s.onChange?.(m));},isInvalid:!!o||typeof s.value=="number"&&(s.maxValue!=null&&s.value>s.maxValue||s.minValue!=null&&s.value<s.minValue),children:({isDisabled:m,isInvalid:d})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:a,isRequired:n,htmlFor:c,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{className:Np({isInvalid:d||!!o,isDisabled:m,transparent:i,className:typeof s.className=="string"?s.className:void 0})}),jsxRuntime.jsxs("div",{className:"absolute inset-y-[1px] right-[1px] flex flex-col divide-y border-l overflow-hidden rounded-r-[calc(var(--control-border-radius)-1px)]",children:[jsxRuntime.jsx(reactAriaComponents.Button,{slot:"increment",isDisabled:m,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(h,{name:"CaretUp",size:14})}),jsxRuntime.jsx(reactAriaComponents.Button,{slot:"decrement",isDisabled:m,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(h,{name:"CaretDown",size:14})})]})]})}),t&&jsxRuntime.jsx(j,{size:r,className:"mt-3",children:t}),o&&jsxRuntime.jsx(W,{size:r,className:"mt-3",children:typeof o=="function"?o(l):o})]})})}function wp(e){return typeof e=="object"&&e!==null&&"features"in e&&Array.isArray(e.features)&&"type"in e&&typeof e.type=="string"}var Sp=process.env.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN||"";function dn({label:e="Search for a place",selectedKey:t,defaultSelectedKey:o,onSelectionChange:r,placeholder:a="Enter a location...",errorMessage:n,description:i,size:l="md",tooltip:s,isRequired:c,isDisabled:m,showErrors:d=true,autoFocus:u=false,onSelect:f,searchTypes:g=["place","address"],defaultFilter:p,validationResult:x,countryRestrictions:v,proximity:w="ip"}){let L=Ve.useRef(new WeakMap),B=Ve.useRef([]),S={requestType:"REST",method:"GET",url:"https://api.mapbox.com/geocoding/v5/mapbox.places/{q}.json",extraParams:{access_token:Sp,types:g.join(","),limit:"5",...v?.length?{country:v.join(",").toLowerCase()}:{},...w?{proximity:w==="ip"?"ip":w.join(",")}:{}},shouldLoad:C=>C.length>0,transformResponse:C=>{if(!wp(C))return [];let F=C.features.map($=>{let O={id:$.id,name:$.place_name};return L.current.set(O,{type:$.place_type[0],center:$.center}),O});return F.length>0&&(B.current=F),F}},y=C=>{let F=L.current.get(C),$=C.name.split(", "),O=$[0],b=$.slice(1).join(", ");return jsxRuntime.jsxs("div",{className:"flex items-center gap-3 py-0.5",children:[jsxRuntime.jsx(h,{name:F?.type==="address"?"MapPin":F?.type==="place"?"Buildings":F?.type==="region"?"MapPinArea":F?.type==="country"?"Flag":"Circle",className:"h-5 w-5 flex-shrink-0 text-text-muted"}),jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-col",children:[jsxRuntime.jsx("span",{className:"truncate font-medium text-text-body",children:O}),b&&jsxRuntime.jsx("span",{className:"truncate text-sm text-text-muted",children:b})]})]})},P=C=>C?jsxRuntime.jsx(h,{name:"CircleNotch",className:"h-4 w-4 animate-spin text-text-muted"}):jsxRuntime.jsx(h,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-muted"});return jsxRuntime.jsx(Kt,{"data-testid":"autocomplete","data-config":JSON.stringify({types:g.join(","),country:v?.join(",").toLowerCase(),proximity:w==="ip"?"ip":w?.join(",")}),label:e,selectedKey:t,defaultSelectedKey:o,onSelectionChange:C=>{if(r?.(C),C){let $=B.current.find(O=>O.id===C);if($){let O=L.current.get($);O&&f({id:$.id,place_name:$.name,place_type:[O.type],center:O.center});}}},requestConfig:S,placeholder:a,errorMessage:n,description:i,size:l,tooltip:s,isRequired:c,isDisabled:m,showErrors:d,autoFocus:u,renderItem:y,renderLeftIcon:P,defaultFilter:p,validationResult:x})}function mn({label:e,rightLabel:t,progressWidth:o=64,hideLabels:r=false,...a}){return jsxRuntime.jsx(reactAriaComponents.ProgressBar,{...a,className:G(a.className,"flex flex-col gap-1"),children:({percentage:n,valueText:i,isIndeterminate:l})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!r&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("span",{className:"text-sm text-text-heading",children:e}),jsxRuntime.jsx("span",{className:"text-sm text-text-heading",children:t||i})]}),jsxRuntime.jsx("div",{className:`relative h-2 w-${o} overflow-hidden rounded-full bg-background-muted outline-none`,children:jsxRuntime.jsx("div",{className:`absolute top-0 h-full rounded-full bg-blue-600 dark:bg-blue-500 forced-colors:bg-[Highlight] ${l?"left-full duration-1000 ease-out animate-in slide-out-to-right-full repeat-infinite [--tw-enter-translate-x:calc(-16rem-100%)]":"left-0"}`,style:{width:(l?40:n)+"%"}})})]})})}function pn(e){return jsxRuntime.jsxs(reactAriaComponents.RadioGroup,{...e,className:G(e.className,"group flex flex-col gap-2"),children:[jsxRuntime.jsx(q,{children:e.label}),jsxRuntime.jsx("div",{className:"flex gap-2 group-orientation-horizontal:gap-4 group-orientation-vertical:flex-col",children:e.children}),e.description&&jsxRuntime.jsx(j,{children:e.description}),jsxRuntime.jsx(W,{children:typeof e.errorMessage=="function"&&e.validationResult?e.errorMessage(e.validationResult):typeof e.errorMessage=="string"?e.errorMessage:null})]})}function Lp({isSelected:e,isInvalid:t,isDisabled:o}){let r=[te(),"w-5 h-5 rounded-full border-2 bg-background-surface transition-all"];return o?r.push("border-border-muted forced-colors:!border-[GrayText]"):t?r.push("border-feedback-error-border group-pressed:border-feedback-error-border dark:group-pressed:border-feedback-error-border forced-colors:!border-[Mark]"):e?r.push("border-[7px] border-action-primary forced-colors:!border-[Highlight] group-pressed:border-action-primary-hover dark:group-pressed:border-action-primary-hover"):r.push("border-border-default group-pressed:border-border-focus dark:group-pressed:border-border-focus"),r.join(" ")}function fn(e){return jsxRuntime.jsx(reactAriaComponents.Radio,{...e,className:G(e.className,"group flex items-center gap-2 text-sm text-text-body transition disabled:text-text-muted dark:text-text-body dark:disabled:text-text-muted forced-colors:disabled:text-[GrayText]"),children:t=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:Lp(t)}),e.children]})})}var Ip=e=>{let t=Pe({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),o=[e.showSearchIcon?"pl-8":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(t,o,e.className)};function ko({label:e,description:t,errorMessage:o,size:r="md",tooltip:a,isRequired:n,transparent:i,showSearchIcon:l,isClearable:s,onClear:c,type:m,validationResult:d,...u}){let[f,g]=Ve__default.default.useState(false),{isFocused:p,handleFocus:x,handleBlur:v}=Me(),w=m==="password";return jsxRuntime.jsx(reactAriaComponents.TextField,{...u,isRequired:n,className:G(u.className,"group flex flex-col"),children:({isDisabled:L,isInvalid:B})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:a,isRequired:n,children:e}),jsxRuntime.jsxs(Be,{children:[l&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 transform",children:jsxRuntime.jsx(h,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-muted"})}),jsxRuntime.jsx(qr,{size:r,disabled:L,type:w?f?"text":"password":m,value:u.value,defaultValue:u.defaultValue,placeholder:u.placeholder,onFocus:S=>x(S,u.onFocus),onBlur:S=>v(S,u.onBlur),onChange:S=>u.onChange?.(S.target.value),className:Ip({isInvalid:B,isDisabled:L,isFocused:p,size:r,transparent:i,showSearchIcon:l,isClearable:s,hasValue:!!u.value,isPassword:w,className:typeof u.className=="string"?u.className:void 0})}),s&&u.value&&!L&&jsxRuntime.jsx(Ur,{onClick:()=>{c?c():u.onChange&&u.onChange("");},size:r}),w&&!L&&jsxRuntime.jsx("button",{type:"button",onClick:()=>g(!f),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body","aria-label":f?"Hide password":"Show password",onMouseDown:S=>{S.preventDefault(),S.stopPropagation();},children:jsxRuntime.jsx(h,{name:f?"EyeSlash":"Eye",size:r==="sm"?16:20,className:"text-text-body"})})]}),t&&jsxRuntime.jsx(j,{size:r,className:"mt-3",children:t}),typeof o=="string"&&jsxRuntime.jsx(W,{size:r,className:"mt-1",children:o}),typeof o=="function"&&d&&jsxRuntime.jsx(W,{size:r,className:"mt-1",children:o(d)})]})})}var Xe=({isActive:e=false,onPress:t,children:o})=>jsxRuntime.jsx(D,{variant:e?"secondary":"ghost",size:"sm",onPress:t,className:"p-1",children:o});function Wp({initialUrl:e,isOpen:t,onClose:o,onSubmit:r}){let[a,n]=Ve.useState(e);return Ve__default.default.useEffect(()=>{n(e);},[e]),jsxRuntime.jsx(reactAriaComponents.Modal,{isDismissable:true,isOpen:t,onOpenChange:l=>!l&&o(),children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"relative",children:jsxRuntime.jsxs("form",{onSubmit:l=>{l.preventDefault(),r(a),o();},children:[jsxRuntime.jsx(gt,{title:"Insert Link",onClose:o}),jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(ko,{label:"URL",type:"url",value:a,onChange:n,autoFocus:true,className:"w-full"})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 border-t border-border-muted p-4",children:[jsxRuntime.jsx(D,{variant:"secondary",onPress:o,children:"Cancel"}),jsxRuntime.jsx(D,{type:"submit",children:"Save"})]})]})})})}function hn({initialContent:e="",onChange:t,className:o,isDisabled:r=false,placeholder:a="Start typing..."}){let[n,i]=Ve.useState(false),l=react$1.useEditor({extensions:[zp__default.default.configure({heading:{levels:[1,2]}}),Dp__default.default.configure({openOnClick:false,HTMLAttributes:{class:"text-text-link-default hover:text-text-link-hover underline decoration-text-link-default/30 hover:decoration-text-link-hover cursor-pointer"}})],content:e,editable:!r,onUpdate:({editor:m})=>{t?.(m.getHTML());},editorProps:{attributes:{class:tailwindMerge.twMerge("prose prose-sm max-w-none","focus:outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0")}}}),s=()=>{i(true);},c=m=>{m===""?l?.chain().focus().unsetLink().run():l?.chain().focus().setLink({href:m}).run();};return l?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex flex-col rounded-md border border-border-input bg-background-input",r&&"opacity-50",o),children:[l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(menus.BubbleMenu,{editor:l,shouldShow:({editor:m})=>m.isActive("link")&&!n,className:"flex items-center gap-1 rounded-md border border-border-input bg-background-surface p-1 shadow-md",children:[jsxRuntime.jsxs(D,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>{let m=l.getAttributes("link").href;window.open(m,"_blank");},children:[jsxRuntime.jsx(h,{name:"ArrowSquareOut",className:"mr-1 h-4 w-4"}),"Open"]}),jsxRuntime.jsxs(D,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:s,children:[jsxRuntime.jsx(h,{name:"PencilSimple",className:"mr-1 h-4 w-4"}),"Edit"]}),jsxRuntime.jsxs(D,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>l.chain().focus().unsetLink().run(),children:[jsxRuntime.jsx(h,{name:"X",className:"mr-1 h-4 w-4"}),"Remove"]})]}),jsxRuntime.jsx(Wp,{isOpen:n,onClose:()=>i(false),onSubmit:c,initialUrl:l.getAttributes("link").href||""})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 border-b border-border-input p-2",children:[jsxRuntime.jsx(Xe,{isActive:l.isActive("heading",{level:1}),onPress:()=>l.chain().focus().toggleHeading({level:1}).run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"H1"})}),jsxRuntime.jsx(Xe,{isActive:l.isActive("heading",{level:2}),onPress:()=>l.chain().focus().toggleHeading({level:2}).run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"H2"})}),jsxRuntime.jsx(Xe,{isActive:l.isActive("bold"),onPress:()=>l.chain().focus().toggleBold().run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"B"})}),jsxRuntime.jsx(Xe,{isActive:l.isActive("italic"),onPress:()=>l.chain().focus().toggleItalic().run(),children:jsxRuntime.jsx("span",{className:"text-xs italic",children:"I"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(Xe,{isActive:l.isActive("bulletList"),onPress:()=>l.chain().focus().toggleBulletList().run(),children:jsxRuntime.jsx(h,{name:"ListBullets",className:"h-4 w-4"})}),jsxRuntime.jsx(Xe,{isActive:l.isActive("orderedList"),onPress:()=>l.chain().focus().toggleOrderedList().run(),children:jsxRuntime.jsx(h,{name:"ListNumbers",className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(Xe,{isActive:l.isActive("link"),onPress:s,children:jsxRuntime.jsx(h,{name:"PaperclipHorizontal",className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:"relative min-h-[200px] w-full",children:[jsxRuntime.jsx(react$1.EditorContent,{editor:l,className:tailwindMerge.twMerge("w-full p-4","[&_.ProseMirror]:min-h-[inherit]","[&_.ProseMirror]:outline-none","[&_.ProseMirror_h1]:mb-4 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold","[&_.ProseMirror_h2]:mb-3 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-semibold","[&_.ProseMirror_p]:mb-2","[&_.ProseMirror_ul]:mb-2 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ul]:list-disc","[&_.ProseMirror_ol]:mb-2 [&_.ProseMirror_ol]:ml-6 [&_.ProseMirror_ol]:list-decimal","[&_.ProseMirror_li]:mb-1","[&_.ProseMirror_blockquote]:border-l-4 [&_.ProseMirror_blockquote]:border-border-muted [&_.ProseMirror_blockquote]:pl-4 [&_.ProseMirror_blockquote]:italic","[&_.ProseMirror_code]:rounded [&_.ProseMirror_code]:bg-background-muted [&_.ProseMirror_code]:px-1 [&_.ProseMirror_code]:py-0.5 [&_.ProseMirror_code]:font-mono [&_.ProseMirror_code]:text-sm","[&_.ProseMirror_pre]:rounded-md [&_.ProseMirror_pre]:bg-background-muted [&_.ProseMirror_pre]:p-3 [&_.ProseMirror_pre]:font-mono [&_.ProseMirror_pre]:text-sm","[&_.ProseMirror_hr]:border-border-muted",r&&"pointer-events-none")}),l.isEmpty&&!r&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-4 top-4 text-text-muted",children:a})]})]}):null}var qp={sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base",xl:"h-14 text-lg"},Zp={sm:14,md:16,lg:18,xl:20},jp=({isSelected:e,isFirst:t,isLast:o,isDisabled:r})=>tailwindMerge.twMerge(te(),"px-3 text-center transition cursor-pointer forced-color-adjust-none -ml-px first:ml-0 flex items-center justify-center h-full gap-2",e?"bg-background-selected text-text-body font-semibold forced-colors:!bg-[Highlight] forced-colors:!text-[HighlightText]":"text-text-muted hover:bg-background-hover pressed:bg-background-selected forced-colors:!bg-[ButtonFace] forced-colors:!text-[ButtonText] hover:font-semibold",!o&&"border-r border-border-muted",r&&"bg-background-muted text-text-disabled forced-colors:!bg-[ButtonFace] forced-colors:!text-[GrayText] border-border-muted forced-colors:border-[GrayText] cursor-not-allowed");function Cn({options:e,value:t,onChange:o,size:r="md",className:a,isDisabled:n,"aria-label":i}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-flex overflow-hidden rounded-md border-2 border-border-muted",qp[r],a),role:"group","aria-label":i,children:e.map((l,s)=>jsxRuntime.jsxs(reactAriaComponents.ToggleButton,{isSelected:t===l.id,onChange:()=>o(l.id),className:jp({isSelected:t===l.id,isFirst:s===0,isLast:s===e.length-1,isDisabled:n}),isDisabled:n,"aria-label":l.label,children:[l.icon&&jsxRuntime.jsx(h,{name:l.icon,size:Zp[r]}),l.label]},l.id))})}function Jp(e="md"){return `flex-1 text-start data-[placeholder]:text-text-placeholder ${z[e].text}`}function ef(){let e=Ve__default.default.useCallback((o,r)=>{r?.(o);},[]),t=Ve__default.default.useCallback((o,r)=>{r?.(o);},[]);return {handleFocus:e,handleBlur:t}}function Tn({label:e,description:t,errorMessage:o,children:r,items:a,renderItem:n,size:i="md",selectedKey:l,defaultSelectedKey:s,onSelectionChange:c,placeholder:m,showErrors:d=false,tooltip:u,isRequired:f,transparent:g,...p}){let[x,v]=Ve.useState(null),[w,L]=Ve.useState(null),B=l??x??s,{handleFocus:S,handleBlur:y}=ef(),P=$=>{c?c($):v($);},C=Ve.useRef(null),F=Ve.useRef(null);return jsxRuntime.jsx(reactAriaComponents.Select,{...p,selectedKey:B,defaultSelectedKey:s,onSelectionChange:P,placeholder:m,className:G(p.className,"group flex w-full flex-col"),ref:C,onOpenChange:$=>{$&&F.current?L(F.current.offsetWidth):$||C.current?.blur();},children:({isDisabled:$,isInvalid:O,isOpen:b})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:i,tooltip:u,isRequired:f,children:e}),jsxRuntime.jsx(Be,{children:jsxRuntime.jsx("div",{ref:F,children:jsxRuntime.jsxs(D,{variant:"unstyled",className:tailwindMerge.twMerge(Pe({isInvalid:O||d&&!!o,isDisabled:$,isFocused:b,transparent:g,size:i}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:E=>S(E,p.onFocus),onBlur:E=>y(E,p.onBlur),"data-open":b,children:[jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:Jp(i)}),jsxRuntime.jsx(h,{name:"CaretDown","aria-hidden":true,className:tailwindMerge.twMerge("h-4 w-4 text-text-body group-disabled:text-gray-200 forced-colors:text-[ButtonText] transition-transform",b&&"rotate-180")})]})})}),t&&jsxRuntime.jsx(j,{size:i,className:"mt-3",children:t}),d&&jsxRuntime.jsx(W,{size:i,className:"mt-3 text-feedback-error-text",children:typeof o=="function"&&p.validationResult?o(p.validationResult):typeof o=="string"?o:null}),jsxRuntime.jsx(Oe,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm",style:{minWidth:w?`${w}px`:void 0},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:a,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:n&&a?E=>jsxRuntime.jsx(He,{id:E.id,textValue:E.label,size:i,children:n(E)},E.id):r})})]})})}function Rn({label:e,description:t,tooltip:o,errorMessage:r,size:a="md",className:n,value:i,defaultValue:l=0,onChange:s,min:c=0,max:m=100,step:d=1,disabled:u,showValue:f=true}){let g=typeof i=="number",[p,x]=Ve__default.default.useState(l),v=g?i:p,w=Math.min(Math.max(v,c),m),L=Math.max(m-c,1e-5),B=(w-c)/L*100;return jsxRuntime.jsxs("div",{className:G(n,"group flex w-full flex-col gap-1"),children:[e&&jsxRuntime.jsx(q,{size:a,tooltip:o,className:"mb-1",children:e}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("div",{className:"relative w-full select-none",children:[jsxRuntime.jsx("div",{className:"h-1.5 w-full rounded-full bg-background-muted"}),jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-0 top-1/2 h-1.5 -translate-y-1/2 rounded-full bg-action-primary",style:{width:`${B}%`},"aria-hidden":true}),jsxRuntime.jsx("input",{type:"range",min:c,max:m,step:d,value:v,disabled:u,"aria-invalid":!!r,onChange:S=>{let y=Number(S.currentTarget.value);g||x(y),s?.(y);},className:tailwindMerge.twMerge("absolute inset-0 w-full cursor-pointer appearance-none bg-transparent outline-none","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-background-input [&::-webkit-slider-thumb]:border [&::-webkit-slider-thumb]:border-border-input","hover:[&::-webkit-slider-thumb]:shadow-sm focus-visible:[&::-webkit-slider-thumb]:outline-2 focus-visible:[&::-webkit-slider-thumb]:outline-border-focus","[&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-background-input [&::-moz-range-thumb]:border [&::-moz-range-thumb]:border-border-input","hover:[&::-moz-range-thumb]:shadow-sm focus-visible:[&::-moz-range-thumb]:outline-2 focus-visible:[&::-moz-range-thumb]:outline-border-focus",u?"cursor-not-allowed opacity-60":void 0)})]}),f&&jsxRuntime.jsx("div",{className:"min-w-10 text-right text-sm text-text-heading tabular-nums",children:Math.round(w)})]}),t&&jsxRuntime.jsx(j,{className:"mt-2 text-text-muted",children:t}),r&&jsxRuntime.jsx(W,{className:"mt-1",children:r})]})}function af({isSelected:e,isDisabled:t}){return ["flex h-4 w-7 px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent",te,e?"bg-gray-700 dark:bg-zinc-300 forced-colors:!bg-[Highlight] group-pressed:bg-gray-800 dark:group-pressed:bg-zinc-200":"bg-gray-400 dark:bg-zinc-400 group-pressed:bg-gray-500 dark:group-pressed:bg-zinc-300",t?"bg-gray-200 dark:bg-zinc-700 forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]":""].filter(Boolean).join(" ")}function nf({isSelected:e,isDisabled:t}){return ["h-3 w-3 transform rounded-full bg-white dark:bg-zinc-900 outline-none shadow transition duration-200 ease-in-out",e?"translate-x-[100%]":"translate-x-0",t?"forced-colors:outline-[GrayText]":""].filter(Boolean).join(" ")}function Ln({children:e,...t}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...t,className:G(t.className,"group flex items-center gap-2 text-sm text-gray-800 transition disabled:text-gray-300 dark:text-zinc-200 dark:disabled:text-zinc-600 forced-colors:disabled:text-[GrayText]"),children:o=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:af(o),children:jsxRuntime.jsx("span",{className:nf(o)})}),e]})})}function pf({orientation:e,className:t=""}){return `flex flex-col w-full ${{horizontal:"",vertical:"flex-row"}[e]||""} ${t}`.trim()}function Mn(e){return jsxRuntime.jsx("div",{className:"w-full",children:jsxRuntime.jsx(reactAriaComponents.Tabs,{...e,className:reactAriaComponents.composeRenderProps(e.className,(t,o)=>pf({...o,className:t}))})})}function ff({orientation:e,className:t=""}){return `flex gap-10 relative after:absolute after:bottom-0 after:left-0 after:right-0 after:h-[2px] after:bg-border-default ${{horizontal:"flex-row w-full",vertical:"flex-col items-start"}[e]||""} ${t}`.trim()}function Bn(e){return jsxRuntime.jsx(reactAriaComponents.TabList,{...e,className:reactAriaComponents.composeRenderProps(e.className,(t,o)=>ff({...o,className:t||""}))})}function gf({isSelected:e,isDisabled:t,className:o=""}){let r="flex items-center cursor-default px-1 py-2 font-medium transition hover:cursor-pointer relative",a=te(),n="";return t?n="text-gray-200 forced-colors:text-[GrayText] selected:text-gray-300 forced-colors:selected:text-[HighlightText] selected:bg-gray-200 forced-colors:selected:bg-[GrayText]":e?n="text-action-primary border-b-2 border-action-primary z-10 forced-colors:bg-[Highlight]":n="text-text-muted hover:text-text-body",`${r} ${a} ${n} ${o}`.trim()}function Fn(e){return jsxRuntime.jsx(reactAriaComponents.Tab,{...e,"data-testid":e.id?`tab-${e.id}`:void 0,className:reactAriaComponents.composeRenderProps(e.className,(t,o)=>gf({...o,className:t,isSelected:o.isSelected}))})}function bf({className:e=""}){let t="block w-full mt-4 text-text-body",o=te();return `${t} ${o} ${e}`.trim()}function En(e){return jsxRuntime.jsx(reactAriaComponents.TabPanel,{...e,className:reactAriaComponents.composeRenderProps(e.className,(t,o)=>bf({...o,className:t||""}))})}var hf=e=>{let t=Pe({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),o=`min-h-[100px] py-2 ${e.isDisabled?"resize-none":"resize-y"}`;return tailwindMerge.twMerge(t,o,e.className)};function In({label:e,description:t,errorMessage:o,size:r="md",tooltip:a,required:n,transparent:i,isInvalid:l,isDisabled:s,className:c,validationResult:m,...d}){let{isFocused:u,handleFocus:f,handleBlur:g}=Me();return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:a,isRequired:n,children:e}),jsxRuntime.jsx(Be,{children:jsxRuntime.jsx("textarea",{...d,required:n,onFocus:p=>{d.onFocus&&d.onFocus(p),f(p);},onBlur:p=>{d.onBlur&&d.onBlur(p),g(p);},className:hf({isInvalid:l,isDisabled:s,isFocused:u,size:r,transparent:i,className:c}),disabled:s})}),t&&jsxRuntime.jsx(j,{size:r,className:"mt-3",children:t}),typeof o=="string"&&jsxRuntime.jsx(W,{size:r,className:"mt-1",children:o}),typeof o=="function"&&m&&jsxRuntime.jsx(W,{size:r,className:"mt-1",children:o(m)})]})})}function Vn({label:e,description:t,errorMessage:o,size:r="md",tooltip:a,required:n,transparent:i,isInvalid:l,isDisabled:s,className:c,validationResult:m,value:d="",onChange:u,chips:f=[],onChipsChange:g,triggerPattern:p="{{",onTriggerDetected:x,onTriggerDismissed:v,renderChip:w,chipVariant:L="primary",chipSize:B,...S}){let y=Ve.useRef(null),{isFocused:P,handleFocus:C,handleBlur:F}=Me(),$=B||"sm",O=Ve.useRef(null),b=Ve.useCallback(T=>{let I="",_=k=>{if(k.nodeType===Node.TEXT_NODE){if(!k.parentElement?.closest("[data-chip-id]")){let R=k.textContent||"";I+=R;}}else if(k.nodeType===Node.ELEMENT_NODE){let N=k;if(N.hasAttribute("data-chip-id")){let R=N.getAttribute("data-chip-id");I+=`{{${R}}}`;return}else if(N.tagName==="BR"){I+=`
66
+ `;return}else N.tagName;}for(let N=0;N<k.childNodes.length;N++)_(k.childNodes[N]);};return _(T),I},[]),E=Ve.useCallback((T,I)=>{let _=document.createTreeWalker(T,NodeFilter.SHOW_TEXT,{acceptNode:A=>{let oe=A.parentElement;return oe&&oe.closest("[data-chip-id]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),k=_.nextNode(),N=Math.max(0,I);for(;k;){let A=k.nodeValue||"";if(A.length>=N){let oe=document.createRange();oe.setStart(k,N),oe.collapse(true);let $e=window.getSelection();$e?.removeAllRanges(),$e?.addRange(oe);return}N-=A.length,k=_.nextNode();}let R=window.getSelection(),M=document.createRange();M.selectNodeContents(T),M.collapse(false),R?.removeAllRanges(),R?.addRange(M);},[]);Ve.useEffect(()=>{y.current&&!d&&y.current.textContent!==""&&(y.current.textContent="");},[d]),Ve.useLayoutEffect(()=>{if(y.current){if(d===""){if(P)try{y.current.focus({preventScroll:!0}),E(y.current,0);}catch{}return}if(O.current!=null)try{E(y.current,O.current);}finally{O.current=null;}}},[d,E,P]);let J=Ve.useCallback((T,I)=>{if(u?.(T),T===""){v?.();return}if(p&&x&&I!==void 0){let _=T.slice(0,I),k=typeof p=="string"?new RegExp(`\\${p}([^\\s]*)$`):p,N=_.match(k);if(N){let R=N[1]||"",M=I-N[0].length;x({query:R,position:I,startIndex:M});}else v?.();}},[u,p,x,v]),U=Ve.useCallback(T=>{if(!g||!u)return;let I=f.filter(k=>k.id!==T);g(I);let _=d.replace(new RegExp(`\\{\\{${T}\\}\\}`,"g"),"");u(_);},[f,g,d,u]),le=Ve.useCallback(T=>w?w(T,()=>U(T.id)):jsxRuntime.jsx(oo,{variant:L,size:$,onRemove:s?void 0:()=>U(T.id),isDisabled:s,className:"py-0.5 px-1.5 gap-1 text-xs leading-none rounded-md",children:T.label},T.id),[w,L,$,U,s]),ue=()=>{let T=Pe({isInvalid:l,isDisabled:s,isFocused:P,transparent:i,size:r}),I=`min-h-[100px] py-2 px-3 ${s?"resize-none":"resize-y"}`,_=tailwindMerge.twMerge("focus:outline-none overflow-auto","[&_[data-chip-id]::selection]:bg-action-primary/20","[&:empty]:before:content-[attr(data-placeholder)] [&:empty]:before:text-text-placeholder [&:empty]:before:pointer-events-none");return tailwindMerge.twMerge(T,I,_,c)},Le=()=>d?d.split(/(\{\{[^}]+\}\})/g).map((I,_)=>{let k=I.match(/\{\{([^}]+)\}\}/);if(k){let N=k[1],R=f.find(M=>M.id===N);if(R)return jsxRuntime.jsx("span",{className:"inline-block align-baseline cursor-pointer",contentEditable:false,suppressContentEditableWarning:true,"data-chip-id":N,style:{userSelect:"none",verticalAlign:"baseline",lineHeight:"1"},onClick:M=>{M.preventDefault();let A=window.getSelection(),oe=document.createRange();oe.selectNode(M.currentTarget),A?.removeAllRanges(),A?.addRange(oe);},children:le(R)},`chip-${N}-${_}`)}return I.includes(`
4
67
  `)?I.split(`
5
- `).map((S,R)=>jsxRuntime.jsxs(Ee__default.default.Fragment,{children:[S,R<I.split(`
6
- `).length-1&&jsxRuntime.jsx("br",{})]},`line-${G}-${R}`)):I}):null;return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(Z,{size:o,tooltip:a,isRequired:n,children:e}),jsxRuntime.jsx(Te,{children:jsxRuntime.jsx("div",{ref:v,contentEditable:!s,suppressContentEditableWarning:true,onInput:k=>{if(s)return;let I=k.target,G=I.querySelector("[data-chip-id]")!==null,w;if(G?(w=b(I),w=w.replace(/(\{\{[^}]+\}\})\s{2,}/g,"$1 ").replace(/\s{2,}(\{\{[^}]+\}\})/g," $1")):w=I.textContent||"",w===""){try{let B=document.createRange();B.selectNodeContents(I),B.collapse(!0);let A=window.getSelection();A?.removeAllRanges(),A?.addRange(B),V.current=0;}catch{}Q("",0);return}if(w===c)return;let S=window.getSelection(),R=0;if(S&&S.rangeCount>0)try{let B=S.getRangeAt(0);if(G){let A=0,te=!1,Fe=se=>{if(te)return !0;if(se===B.startContainer)return A+=B.startOffset,te=!0,!0;if(se.nodeType===Node.TEXT_NODE){if(!se.parentElement?.closest("[data-chip-id]")){if(se.contains(B.startContainer))return A+=B.startOffset,te=!0,!0;A+=(se.textContent||"").length;}}else if(se.nodeType===Node.ELEMENT_NODE){let de=se;if(de.hasAttribute("data-chip-id")){if(de.contains(B.startContainer)||de===B.startContainer){let Tn=de.getAttribute("data-chip-id");return A+=`{{${Tn}}}`.length,te=!0,!0}let kn=de.getAttribute("data-chip-id");return A+=`{{${kn}}}`.length,!1}else if(de.tagName==="BR")return de===B.startContainer?(te=!0,!0):(A+=1,!1)}for(let de=0;de<se.childNodes.length;de++)if(Fe(se.childNodes[de]))return !0;return !1};Fe(I),R=A;}else {let A=document.createRange();A.setStart(I,0),A.setEnd(B.startContainer,B.startOffset),R=A.toString().length;}}catch{R=w.length;}V.current=R,Q(w,R);},onKeyDown:k=>{if(s)return;let I=window.getSelection();if(!(!I||I.rangeCount===0))try{let G=I.getRangeAt(0),w=G.commonAncestorContainer;if(k.key==="ArrowLeft"||k.key==="ArrowRight"){let S=w.nodeType===Node.TEXT_NODE?w.parentElement?.closest("[data-chip-id]"):w.closest("[data-chip-id]");if(S){k.preventDefault();try{let R=document.createRange(),B=window.getSelection();k.key==="ArrowLeft"?R.setStartBefore(S):R.setStartAfter(S),R.collapse(!0),B?.removeAllRanges(),B?.addRange(R);}catch{}}}if(k.key==="Backspace"){let S=null;if(S=(w.nodeType===Node.TEXT_NODE?w.parentElement?.closest("[data-chip-id]"):w.closest("[data-chip-id]"))||null,!S)if(w.nodeType===Node.TEXT_NODE){let R=w;if(G.startOffset===0&&R.parentElement){let B=R.previousSibling;if(B&&B.nodeType===Node.ELEMENT_NODE){let A=B.closest("[data-chip-id]");A&&(S=A);}}}else {let R=w;if(G.startOffset>0){let B=R.childNodes[G.startOffset-1];if(B&&B.nodeType===Node.ELEMENT_NODE){let A=B.closest("[data-chip-id]");A&&(S=A);}}}if(S){k.preventDefault(),k.stopPropagation();let R=S.getAttribute("data-chip-id");if(!R)return;let B=`{{${R}}}`,A=c.indexOf(B);if(A!==-1){let te=c.slice(0,A)+c.slice(A+B.length),Fe=f.filter(se=>se.id!==R);V.current=A;try{window.getSelection()?.removeAllRanges();}catch{}g?.(Fe),u?.(te);}}}}catch{}},onFocus:k=>{s||(P.onFocus&&P.onFocus(k),C(k));},onBlur:k=>{s||(P.onBlur&&P.onBlur(k),L(k));},className:ce(),style:{whiteSpace:"pre-wrap",wordBreak:"break-word",...P.style},"data-placeholder":P.placeholder,children:Pe()},c===""?"empty":"content")}),r&&jsxRuntime.jsx(j,{size:o,className:"mt-3",children:r}),typeof t=="string"&&jsxRuntime.jsx(_,{size:o,className:"mt-1",children:t}),typeof t=="function"&&m&&jsxRuntime.jsx(_,{size:o,className:"mt-1",children:t(m)})]})})}var rf=e=>tailwindMerge.twMerge("w-full",Xe({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused}),zt({transparent:e.transparent,isDisabled:e.isDisabled}),H[e.size||"md"].text,H[e.size||"md"].height,H[e.size||"md"].padding,"pl-[var(--control-padding-sm)]","flex items-center gap-0.5",e.className),of=({isPlaceholder:e,isDisabled:r,isFocused:t,size:o="md"})=>tailwindMerge.twMerge("outline-none rounded transition-colors box-content tabular-nums text-center",e?"text-text-muted italic":"text-text-body",r?"text-text-disabled cursor-not-allowed":"cursor-text",H[o].text,"px-0.5 -my-0.5",t&&"!outline-[1.5px] !outline-[var(--control-focus-ring-color)] ![--tw-outline-style:solid]",!r&&!t&&"hover:bg-text-body/[0.05]");function Sn({label:e,description:r,errorMessage:t,size:o="md",tooltip:a,isRequired:n,transparent:i,validationResult:l,...s}){let{isFocused:d}=ke(),[m,c]=Ee.useState(null),u=Ee.useRef(null);return Ee.useEffect(()=>{let f=x=>{let y=x.target;y.hasAttribute("data-type")&&c(y.getAttribute("data-type"));},g=()=>{c(null);},p=u.current;return p&&(p.addEventListener("focusin",f),p.addEventListener("focusout",g)),()=>{p&&(p.removeEventListener("focusin",f),p.removeEventListener("focusout",g));}},[]),jsxRuntime.jsx(reactAriaComponents.TimeField,{...s,children:({isDisabled:f,isInvalid:g})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(Z,{isRequired:n,tooltip:a,children:e}),jsxRuntime.jsx(reactAriaComponents.DateInput,{ref:u,className:rf({size:o,transparent:i,isDisabled:f,isInvalid:g,isFocused:d}),children:p=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:p,className:of({isPlaceholder:p.isPlaceholder,isDisabled:!p.isEditable,isFocused:m===p.type,size:o})})}),r&&jsxRuntime.jsx(j,{children:r}),typeof t=="string"?jsxRuntime.jsx(_,{children:t}):null]})})}var lf="flex font-medium justify-center items-center gap-2 text-center transition whitespace-nowrap box-border",Nn={default:{selected:"bg-text-body text-white hover:brightness-[var(--control-hover-opacity)] forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",unselected:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/[0.05] forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]"},primary:{selected:"bg-action-primary text-white hover:brightness-[var(--control-hover-opacity)] forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",unselected:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/[0.05] forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]"}},cf="opacity-[--control-hover-opacity] cursor-not-allowed pointer-events-none grayscale",df="opacity-100 cursor-pointer",uf={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},mf={primary:"bg-action-primary text-white",destructive:"bg-action-destructive text-white"};function pf(e){let{variant:r="default",size:t="md",isDisabled:o,isSelected:a,borderRadius:n,borderRight:i,borderLeft:l}=e,s=`${lf} ${a?Nn[r].selected:Nn[r].unselected}`;return s+=` ${H[t].text} ${H[t].height} ${H[t].padding} ${H[t].gap}`,s+=` ${o?cf:df}`,n==="left"&&(s+=" rounded-l-sm"),n==="right"&&(s+=" rounded-r-sm"),i&&(s+=" border-r"),l&&(s+=" border-l"),s+=` ${ee()}`,tailwindMerge.twMerge(s)}function Pn(e){let{className:r,children:t,onPress:o,icon:a,iconPosition:n="left",iconWeight:i,isLoading:l=false,loadingText:s,loadingIndicator:d,size:m="md",badgeNumber:c,badgeVariant:u="primary",badgePosition:f="top-right",...g}=e,p=a?jsxRuntime.jsx(h,{name:a,className:`icon-[--control-icon-size-${m}]`,weight:i}):null,x=()=>{let N=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n==="left"&&p,t,n==="right"&&p]});return l?jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:d||jsxRuntime.jsx(h,{name:"CircleNotch",className:`animate-spin icon-[--control-icon-size-${m}]`,"aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:N}),s&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:s})]}):N},y=jsxRuntime.jsx(reactAriaComponents.ToggleButton,{onPress:o,...g,className:tailwindMerge.twMerge(pf(e),r),"aria-busy":l,children:x()});return c&&c>0?jsxRuntime.jsxs("div",{className:"relative",children:[y,jsxRuntime.jsx("span",{className:`absolute ${uf[f]} flex h-5 w-5 items-center justify-center rounded-full ${mf[u]} text-xs`,"aria-label":`${c} items`,children:c})]}):y}exports.ActionCell=la;exports.ActionMenu=So;exports.AreaSeries=Je;exports.AutoMobileRenderer=lr;exports.Autocomplete=Ot;exports.Avatar=Eo;exports.Badge=Gt;exports.BarSeries=tt;exports.BooleanCell=ca;exports.Breadcrumb=zo;exports.Breadcrumbs=Vo;exports.Button=$;exports.Calendar=_t;exports.Card=Zt;exports.CardMobileRenderer=cr;exports.ChartAxis=Ct;exports.ChartBottomBar=Qt;exports.ChartContainer=aa;exports.ChartContext=Xt;exports.ChartTooltip=er;exports.Checkbox=Vr;exports.Chip=jt;exports.ClearButton=Lo;exports.CodeEditor=qo;exports.CopyToClipboard=cd;exports.DataTable=ha;exports.DateCell=da;exports.DateField=ya;exports.DateRangePicker=Sa;exports.Description=j;exports.Dialog=lt;exports.DialogHeader=dt;exports.Drawer=lo;exports.ErrorBoundary=ut;exports.FieldError=_;exports.FieldGroup=Ht;exports.FileUpload=Pa;exports.Form=ka;exports.Heading=Ye;exports.Icon=h;exports.Input=Bo;exports.InputWrapper=Te;exports.InteractiveMap=Ia;exports.Label=Z;exports.LineSeries=ot;exports.ListBox=am;exports.ListBoxItem=$e;exports.Loader=Ra;exports.Logo=La;exports.MAPBOX_THEMES=Lt;exports.Meter=$a;exports.Notice=gr;exports.NoticeContainer=br;exports.NoticeProvider=Va;exports.NumberCell=ua;exports.NumberField=Ga;exports.PlaceSearch=Ua;exports.Popover=Ae;exports.ProgressBar=Za;exports.Radio=ja;exports.RadioGroup=Ka;exports.RangeCalendar=dr;exports.RichTextEditor=Ja;exports.SKELETON_SIZES=Oe;exports.SegmentedControl=rn;exports.Select=cn;exports.SelectCell=ma;exports.Skeleton=K;exports.Slider=dn;exports.StaticMap=Ma;exports.Switch=un;exports.Tab=fn;exports.TabList=pn;exports.TabPanel=gn;exports.Tabs=mn;exports.TextArea=bn;exports.TextAreaWithChips=vn;exports.TextCell=pa;exports.TextField=xr;exports.TextLink=Er;exports.TimeField=Sn;exports.ToggleButton=Pn;exports.Tooltip=Hr;exports.clearColorCache=zd;exports.createCategoryColorMap=Hd;exports.createXScale=Gr;exports.createYScale=Wr;exports.defaultMargin=X;exports.exportChart=Kr;exports.formatEmptyValue=rr;exports.getBadgeClasses=na;exports.getBooleanBadgeVariant=ia;exports.getCellAlignmentClasses=eo;exports.getCellContainerClasses=J;exports.getCellTextClasses=he;exports.getContrastingTextColor=Od;exports.getDefaultChartColor=jr;exports.getDefaultColors=Jo;exports.getExportFormatName=Vd;exports.getFieldGroupStyles=xt;exports.getInputBackgroundStyles=zt;exports.getInputBaseStyles=Ne;exports.getInputStateStyles=Xe;exports.getNumericColorClasses=or;exports.getResolvedColor=Nt;exports.getSkeletonSize=ye;exports.getThemeCategoricalColors=Jt;exports.getYFormatSettings=rt;exports.isExportSupported=Ad;exports.isLightColor=ea;exports.resolveValue=le;exports.useChartContext=ze;exports.useDebounce=It;exports.useInputFocus=ke;exports.useNotice=Ha;//# sourceMappingURL=index.cjs.map
68
+ `).map((N,R)=>jsxRuntime.jsxs(Ve__default.default.Fragment,{children:[N,R<I.split(`
69
+ `).length-1&&jsxRuntime.jsx("br",{})]},`line-${_}-${R}`)):I}):null;return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:r,tooltip:a,isRequired:n,children:e}),jsxRuntime.jsx(Be,{children:jsxRuntime.jsx("div",{ref:y,contentEditable:!s,suppressContentEditableWarning:true,onInput:T=>{if(s)return;let I=T.target,_=I.querySelector("[data-chip-id]")!==null,k;if(_?(k=b(I),k=k.replace(/(\{\{[^}]+\}\})\s{2,}/g,"$1 ").replace(/\s{2,}(\{\{[^}]+\}\})/g," $1")):k=I.textContent||"",k===""){try{let M=document.createRange();M.selectNodeContents(I),M.collapse(!0);let A=window.getSelection();A?.removeAllRanges(),A?.addRange(M),O.current=0;}catch{}J("",0);return}if(k===d)return;let N=window.getSelection(),R=0;if(N&&N.rangeCount>0)try{let M=N.getRangeAt(0);if(_){let A=0,oe=!1,$e=ce=>{if(oe)return !0;if(ce===M.startContainer)return A+=M.startOffset,oe=!0,!0;if(ce.nodeType===Node.TEXT_NODE){if(!ce.parentElement?.closest("[data-chip-id]")){if(ce.contains(M.startContainer))return A+=M.startOffset,oe=!0,!0;A+=(ce.textContent||"").length;}}else if(ce.nodeType===Node.ELEMENT_NODE){let me=ce;if(me.hasAttribute("data-chip-id")){if(me.contains(M.startContainer)||me===M.startContainer){let Un=me.getAttribute("data-chip-id");return A+=`{{${Un}}}`.length,oe=!0,!0}let _n=me.getAttribute("data-chip-id");return A+=`{{${_n}}}`.length,!1}else if(me.tagName==="BR")return me===M.startContainer?(oe=!0,!0):(A+=1,!1)}for(let me=0;me<ce.childNodes.length;me++)if($e(ce.childNodes[me]))return !0;return !1};$e(I),R=A;}else {let A=document.createRange();A.setStart(I,0),A.setEnd(M.startContainer,M.startOffset),R=A.toString().length;}}catch{R=k.length;}O.current=R,J(k,R);},onKeyDown:T=>{if(s)return;let I=window.getSelection();if(!(!I||I.rangeCount===0))try{let _=I.getRangeAt(0),k=_.commonAncestorContainer;if(T.key==="ArrowLeft"||T.key==="ArrowRight"){let N=k.nodeType===Node.TEXT_NODE?k.parentElement?.closest("[data-chip-id]"):k.closest("[data-chip-id]");if(N){T.preventDefault();try{let R=document.createRange(),M=window.getSelection();T.key==="ArrowLeft"?R.setStartBefore(N):R.setStartAfter(N),R.collapse(!0),M?.removeAllRanges(),M?.addRange(R);}catch{}}}if(T.key==="Backspace"){let N=null;if(N=(k.nodeType===Node.TEXT_NODE?k.parentElement?.closest("[data-chip-id]"):k.closest("[data-chip-id]"))||null,!N)if(k.nodeType===Node.TEXT_NODE){let R=k;if(_.startOffset===0&&R.parentElement){let M=R.previousSibling;if(M&&M.nodeType===Node.ELEMENT_NODE){let A=M.closest("[data-chip-id]");A&&(N=A);}}}else {let R=k;if(_.startOffset>0){let M=R.childNodes[_.startOffset-1];if(M&&M.nodeType===Node.ELEMENT_NODE){let A=M.closest("[data-chip-id]");A&&(N=A);}}}if(N){T.preventDefault(),T.stopPropagation();let R=N.getAttribute("data-chip-id");if(!R)return;let M=`{{${R}}}`,A=d.indexOf(M);if(A!==-1){let oe=d.slice(0,A)+d.slice(A+M.length),$e=f.filter(ce=>ce.id!==R);O.current=A;try{window.getSelection()?.removeAllRanges();}catch{}g?.($e),u?.(oe);}}}}catch{}},onFocus:T=>{s||(S.onFocus&&S.onFocus(T),C(T));},onBlur:T=>{s||(S.onBlur&&S.onBlur(T),F(T));},className:ue(),style:{whiteSpace:"pre-wrap",wordBreak:"break-word",...S.style},"data-placeholder":S.placeholder,children:Le()},d===""?"empty":"content")}),t&&jsxRuntime.jsx(j,{size:r,className:"mt-3",children:t}),typeof o=="string"&&jsxRuntime.jsx(W,{size:r,className:"mt-1",children:o}),typeof o=="function"&&m&&jsxRuntime.jsx(W,{size:r,className:"mt-1",children:o(m)})]})})}var Lf=e=>tailwindMerge.twMerge("w-full",tt({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused}),Zt({transparent:e.transparent,isDisabled:e.isDisabled}),z[e.size||"md"].text,z[e.size||"md"].height,z[e.size||"md"].padding,"pl-[var(--control-padding-sm)]","flex items-center gap-0.5",e.className),Mf=({isPlaceholder:e,isDisabled:t,isFocused:o,size:r="md"})=>tailwindMerge.twMerge("outline-none rounded transition-colors box-content tabular-nums text-center",e?"text-text-muted italic":"text-text-body",t?"text-text-disabled cursor-not-allowed":"cursor-text",z[r].text,"px-0.5 -my-0.5",o&&"!outline-[1.5px] !outline-[var(--control-focus-ring-color)] ![--tw-outline-style:solid]",!t&&!o&&"hover:bg-text-body/[0.05]");function Hn({label:e,description:t,errorMessage:o,size:r="md",tooltip:a,isRequired:n,transparent:i,validationResult:l,...s}){let{isFocused:c}=Me(),[m,d]=Ve.useState(null),u=Ve.useRef(null);return Ve.useEffect(()=>{let f=x=>{let v=x.target;v.hasAttribute("data-type")&&d(v.getAttribute("data-type"));},g=()=>{d(null);},p=u.current;return p&&(p.addEventListener("focusin",f),p.addEventListener("focusout",g)),()=>{p&&(p.removeEventListener("focusin",f),p.removeEventListener("focusout",g));}},[]),jsxRuntime.jsx(reactAriaComponents.TimeField,{...s,children:({isDisabled:f,isInvalid:g})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(q,{isRequired:n,tooltip:a,children:e}),jsxRuntime.jsx(reactAriaComponents.DateInput,{ref:u,className:Lf({size:r,transparent:i,isDisabled:f,isInvalid:g,isFocused:c}),children:p=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:p,className:Mf({isPlaceholder:p.isPlaceholder,isDisabled:!p.isEditable,isFocused:m===p.type,size:r})})}),t&&jsxRuntime.jsx(j,{children:t}),typeof o=="string"?jsxRuntime.jsx(W,{children:o}):null]})})}var If="flex font-medium justify-center items-center gap-2 text-center transition whitespace-nowrap box-border",On={default:{selected:"bg-text-body text-white hover:brightness-[var(--control-hover-opacity)] forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",unselected:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/[0.05] forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]"},primary:{selected:"bg-action-primary text-white hover:brightness-[var(--control-hover-opacity)] forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",unselected:"bg-transparent text-text-body border-2 border-border-muted hover:bg-text-body/[0.05] forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]"}},Df="opacity-[--control-hover-opacity] cursor-not-allowed pointer-events-none grayscale",$f="opacity-100 cursor-pointer",Af={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},Vf={primary:"bg-action-primary text-white",destructive:"bg-action-destructive text-white"};function zf(e){let{variant:t="default",size:o="md",isDisabled:r,isSelected:a,borderRadius:n,borderRight:i,borderLeft:l}=e,s=`${If} ${a?On[t].selected:On[t].unselected}`;return s+=` ${z[o].text} ${z[o].height} ${z[o].padding} ${z[o].gap}`,s+=` ${r?Df:$f}`,n==="left"&&(s+=" rounded-l-sm"),n==="right"&&(s+=" rounded-r-sm"),i&&(s+=" border-r"),l&&(s+=" border-l"),s+=` ${te()}`,tailwindMerge.twMerge(s)}function Wn(e){let{className:t,children:o,onPress:r,icon:a,iconPosition:n="left",iconWeight:i,isLoading:l=false,loadingText:s,loadingIndicator:c,size:m="md",badgeNumber:d,badgeVariant:u="primary",badgePosition:f="top-right",...g}=e,p=a?jsxRuntime.jsx(h,{name:a,className:`icon-[--control-icon-size-${m}]`,weight:i}):null,x=()=>{let w=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n==="left"&&p,o,n==="right"&&p]});return l?jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:c||jsxRuntime.jsx(h,{name:"CircleNotch",className:`animate-spin icon-[--control-icon-size-${m}]`,"aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:w}),s&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:s})]}):w},v=jsxRuntime.jsx(reactAriaComponents.ToggleButton,{onPress:r,...g,className:tailwindMerge.twMerge(zf(e),t),"aria-busy":l,children:x()});return d&&d>0?jsxRuntime.jsxs("div",{className:"relative",children:[v,jsxRuntime.jsx("span",{className:`absolute ${Af[f]} flex h-5 w-5 items-center justify-center rounded-full ${Vf[u]} text-xs`,"aria-label":`${d} items`,children:d})]}):v}exports.ActionCell=Ta;exports.ActionMenu=Er;exports.AppShell=$r;exports.AreaSeries=at;exports.AutoMobileRenderer=bo;exports.Autocomplete=Kt;exports.Avatar=Yr;exports.Badge=Xt;exports.BarSeries=it;exports.BooleanCell=Ra;exports.Breadcrumb=oa;exports.Breadcrumbs=ta;exports.Button=D;exports.Calendar=Qt;exports.Card=to;exports.CardMobileRenderer=xo;exports.ChartAxis=Tt;exports.ChartBottomBar=no;exports.ChartContainer=wa;exports.ChartContext=ro;exports.ChartTooltip=so;exports.Checkbox=Ko;exports.CheckboxGroup=fd;exports.Chip=oo;exports.ClearButton=Ur;exports.CodeEditor=da;exports.ColorModeProvider=_r;exports.CopyToClipboard=ma;exports.DataTable=Aa;exports.DateCell=La;exports.DateField=Va;exports.DateRangePicker=Oa;exports.Description=j;exports.Dialog=pt;exports.DialogHeader=gt;exports.Drawer=vr;exports.ErrorBoundary=bt;exports.FieldError=W;exports.FieldGroup=jt;exports.FileUpload=_a;exports.Form=Ua;exports.Heading=ot;exports.Icon=h;exports.Input=qr;exports.InputWrapper=Be;exports.InteractiveMap=Ja;exports.Label=q;exports.LineSeries=lt;exports.ListBox=Mm;exports.ListBoxItem=He;exports.Loader=Za;exports.Logo=Gt;exports.MAPBOX_THEMES=Dt;exports.Meter=en;exports.Notice=wo;exports.NoticeContainer=So;exports.NoticeProvider=on;exports.NumberCell=Ma;exports.NumberField=sn;exports.PlaceSearch=dn;exports.Popover=Oe;exports.ProgressBar=mn;exports.Radio=fn;exports.RadioGroup=pn;exports.RangeCalendar=ho;exports.RichTextEditor=hn;exports.SKELETON_SIZES=Ue;exports.SegmentedControl=Cn;exports.Select=Tn;exports.SelectCell=Ba;exports.SideNav=Wt;exports.Skeleton=X;exports.Slider=Rn;exports.StaticMap=Ka;exports.Switch=Ln;exports.Tab=Fn;exports.TabList=Bn;exports.TabPanel=En;exports.Tabs=Mn;exports.TextArea=In;exports.TextAreaWithChips=Vn;exports.TextCell=Fa;exports.TextField=ko;exports.TextLink=Uo;exports.TimeField=Hn;exports.ToggleButton=Wn;exports.Tooltip=Yo;exports.TopNav=Ct;exports.clearColorCache=uu;exports.createCategoryColorMap=mu;exports.createXScale=Jo;exports.createYScale=er;exports.defaultMargin=Y;exports.exportChart=nr;exports.formatEmptyValue=co;exports.getBadgeClasses=Sa;exports.getBooleanBadgeVariant=ka;exports.getCellAlignmentClasses=ur;exports.getCellContainerClasses=ee;exports.getCellTextClasses=Ce;exports.getContrastingTextColor=pu;exports.getDefaultChartColor=ir;exports.getDefaultColors=ha;exports.getExportFormatName=du;exports.getFieldGroupStyles=wt;exports.getInputBackgroundStyles=Zt;exports.getInputBaseStyles=Pe;exports.getInputStateStyles=tt;exports.getNumericColorClasses=uo;exports.getResolvedColor=Lt;exports.getSkeletonSize=Ne;exports.getThemeCategoricalColors=io;exports.getYFormatSettings=st;exports.isExportSupported=cu;exports.isLightColor=va;exports.resolveValue=de;exports.useChartContext=We;exports.useColorMode=Wr;exports.useDebounce=Ot;exports.useInputFocus=Me;exports.useLocalStorage=Mr;exports.useNotice=an;//# sourceMappingURL=index.cjs.map
7
70
  //# sourceMappingURL=index.cjs.map