@texturehq/edges 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
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:`
1
+ 'use strict';var rt=require('react'),luxon=require('luxon'),reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),wl=require('@phosphor-icons/react'),jsxRuntime=require('react/jsx-runtime'),reactStately=require('react-stately'),lucideReact=require('lucide-react'),Hd=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'),hu=require('papaparse'),lp=require('react-map-gl');require('mapbox-gl/dist/mapbox-gl.css');var reactDom=require('react-dom'),uf=require('@tiptap/extension-link'),react=require('@tiptap/react'),menus=require('@tiptap/react/menus'),gf=require('@tiptap/starter-kit');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var rt__namespace=/*#__PURE__*/_interopNamespace(rt);var wl__namespace=/*#__PURE__*/_interopNamespace(wl);var Hd__default=/*#__PURE__*/_interopDefault(Hd);var hu__default=/*#__PURE__*/_interopDefault(hu);var lp__default=/*#__PURE__*/_interopDefault(lp);var uf__default=/*#__PURE__*/_interopDefault(uf);var gf__default=/*#__PURE__*/_interopDefault(gf);var zs=Object.defineProperty;var Hs=(e,t,r)=>t in e?zs(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var Gt=(e,t,r)=>Hs(e,typeof t!="symbol"?t+"":t,r);function ur(e,t=300){let[r,o]=rt.useState(e);return rt.useEffect(()=>{let n=setTimeout(()=>o(e),t);return ()=>clearTimeout(n)},[e,t]),r}function yn(e,t){let[r,o]=rt.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}});rt.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,JSON.stringify(r));}catch(i){console.error(`Error writing to localStorage key "${e}":`,i);}},[e,r]);let n=rt.useCallback(i=>{try{o(l=>i instanceof Function?i(l):i);}catch(l){console.error(`Error setting value for localStorage key "${e}":`,l);}},[e]),a=rt.useCallback(()=>{try{typeof window<"u"&&window.localStorage.removeItem(e),o(t);}catch(i){console.error(`Error removing localStorage key "${e}":`,i);}},[e,t]);return [r,n,a]}var eo=class{constructor(){Gt(this,"formatters",new Map);}register(t,r){this.formatters.set(t,r);}format(t,r,...o){let n=this.formatters.get(t);return n?n(r,...o):(console.warn(`No formatter registered for key: ${t}`),null)}has(t){return this.formatters.has(t)}keys(){return Array.from(this.formatters.keys())}unregister(t){this.formatters.delete(t);}clear(){this.formatters.clear();}},S=new eo;var He=(e,t="Yes",r="No")=>e==null?null:e?t:r,Ks=e=>He(e,"Enabled","Disabled"),Us=e=>He(e,"On","Off"),js=e=>He(e,"Active","Inactive"),Zs=e=>He(e,"True","False"),qs=e=>He(e,"\u2713","\u2717"),Ge=e=>{if(e==null)return null;if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"||t==="on"||t==="enabled"?true:t==="false"||t==="no"||t==="0"||t==="off"||t==="disabled"?false:null}return typeof e=="number"?e!==0:null},vn=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=Ge(e);return r===null?t.nullText??null:He(r,t.trueText??"Yes",t.falseText??"No")};S.register("boolean",(e,t,r)=>{let o=Ge(e);return o!==null?He(o,typeof t=="string"?t:"Yes",typeof r=="string"?r:"No"):null});S.register("yesNo",e=>{let t=Ge(e);return t!==null?He(t,"Yes","No"):null});S.register("enabledDisabled",e=>{let t=Ge(e);return t!==null?Ks(t):null});S.register("onOff",e=>{let t=Ge(e);return t!==null?Us(t):null});S.register("activeInactive",e=>{let t=Ge(e);return t!==null?js(t):null});S.register("trueFalse",e=>{let t=Ge(e);return t!==null?Zs(t):null});S.register("checkmark",e=>{let t=Ge(e);return t!==null?qs(t):null});var Qe=e=>{if(e==null)return null;if(e instanceof Date)return luxon.DateTime.fromJSDate(e);if(typeof e=="string"){let t=luxon.DateTime.fromISO(e);return t.isValid?t:null}if(typeof e=="number"){let t=luxon.DateTime.fromMillis(e);return t.isValid?t:null}return null},Ys=(e,t=false,r)=>{if(!e)return null;let o=Qe(e);if(!o)return "Invalid Date";let n=r?o.setZone(r):o;return t?n.toLocaleString(luxon.DateTime.DATETIME_SHORT):n.toLocaleString(luxon.DateTime.DATE_SHORT)},Xs=e=>{if(!e)return null;let t=Qe(e);return t?t.toRelative():"Invalid Date"},Js=(e,t)=>{if(!e)return null;let r=Qe(e);return r?(t?r.setZone(t):r).toLocaleString(luxon.DateTime.DATETIME_MED_WITH_WEEKDAY):"Invalid Date"},Qs=e=>{if(!e)return null;let t=Qe(e);return t?t.toISO():null},el=(e,t,r)=>{if(!e)return null;let o=Qe(e);return o?(r?o.setZone(r):o).toFormat(t):"Invalid Date"},Og=e=>{let t=Qe(e);return t?{year:t.year,month:t.month,day:t.day,weekday:t.weekday,hour:t.hour,minute:t.minute,second:t.second,millisecond:t.millisecond,weekdayShort:t.weekdayShort,weekdayLong:t.weekdayLong,monthShort:t.monthShort,monthLong:t.monthLong}:null},Cn=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=Qe(e);if(!r)return t.nullText??"Invalid Date";let o=t.timezone?r.setZone(t.timezone):r;if(t.relative)return o.toRelative();if(t.format)return o.toFormat(t.format);if(t.dateStyle||t.timeStyle){let n={};if(t.dateStyle)switch(t.dateStyle){case "short":n.date=luxon.DateTime.DATE_SHORT;break;case "medium":n.date=luxon.DateTime.DATE_MED;break;case "long":n.date=luxon.DateTime.DATE_FULL;break;case "full":n.date=luxon.DateTime.DATE_HUGE;break}if(t.timeStyle)switch(t.timeStyle){case "short":n.time=luxon.DateTime.TIME_SIMPLE;break;case "medium":n.time=luxon.DateTime.TIME_WITH_SECONDS;break;case "long":case "full":n.time=luxon.DateTime.TIME_WITH_SHORT_OFFSET;break}if(n.date&&n.time)return o.toLocaleString({...n.date,...n.time});if(n.date)return o.toLocaleString(n.date);if(n.time)return o.toLocaleString(n.time)}return o.toLocaleString(luxon.DateTime.DATETIME_SHORT)};S.register("date",(e,t,r)=>Ys(e,typeof t=="boolean"?t:false,typeof r=="string"?r:void 0));S.register("relativeTime",e=>Xs(e));S.register("fullDateTime",(e,t)=>Js(e,typeof t=="string"?t:void 0));S.register("isoString",e=>Qs(e));S.register("customDateFormat",(e,t,r)=>typeof t=="string"?el(e,t,typeof r=="string"?r:void 0):null);var A=e=>e==null,tl=(e,t=0)=>A(e)?null:`${e.toFixed(t)}%`,rl=e=>A(e)?null:Math.round(e).toString(),ol=(e,t=1)=>A(e)?null:e.toFixed(t),nl=(e,t,r=true)=>{if(A(e))return null;let o={useGrouping:r};return t!==void 0&&(o.minimumFractionDigits=t,o.maximumFractionDigits=t),new Intl.NumberFormat("en-US",o).format(e)},al=(e,t="short")=>A(e)?null:new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:t}).format(e),il=(e,t=2)=>A(e)?null:e.toExponential(t),Nn=(e,t="USD",r)=>{if(A(e))return null;let o={style:"currency",currency:t,currencyDisplay:r?.currencyDisplay??"symbol",useGrouping:r?.thousandsSeparator??true};return r?.minimumFractionDigits!==void 0&&(o.minimumFractionDigits=r.minimumFractionDigits),r?.maximumFractionDigits!==void 0&&(o.maximumFractionDigits=r.maximumFractionDigits),new Intl.NumberFormat("en-US",o).format(e)},Sn=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o={useGrouping:t.thousandsSeparator??false};return t.decimals!==void 0&&(o.minimumFractionDigits=t.decimals,o.maximumFractionDigits=t.decimals),t.notation&&(o.notation=t.notation,t.notation==="compact"&&t.compactDisplay&&(o.compactDisplay=t.compactDisplay)),t.sign&&(o.signDisplay=t.sign),new Intl.NumberFormat("en-US",o).format(r)},wn=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);return isNaN(r)?t.nullText??null:Nn(r,t.currency,t)};S.register("percentage",(e,t)=>typeof e=="number"?tl(e,typeof t=="number"?t:0):null);S.register("integer",e=>typeof e=="number"?rl(e):null);S.register("float",(e,t)=>typeof e=="number"?ol(e,typeof t=="number"?t:1):null);S.register("number",(e,t,r)=>{let o=typeof e=="string"?parseFloat(e):Number(e);return isNaN(o)?null:nl(o,typeof t=="number"?t:void 0,typeof r=="boolean"?r:true)});S.register("compact",(e,t)=>typeof e=="number"?al(e,t==="long"?"long":"short"):null);S.register("scientific",(e,t)=>typeof e=="number"?il(e,typeof t=="number"?t:2):null);S.register("currency",(e,t,r)=>typeof e=="number"?Nn(e,typeof t=="string"?t:"USD",typeof r=="object"&&r!==null?r:{}):null);var to=(e,t=1)=>A(e)?null:`${e.toFixed(t)} m`,sl=(e,t=1)=>A(e)?null:`${(e*100).toFixed(t)} cm`,ll=(e,t=0)=>A(e)?null:`${(e*1e3).toFixed(t)} mm`,ro=(e,t=1)=>A(e)?null:`${(e/1e3).toFixed(t)} km`,oo=(e,t=0)=>A(e)?null:`${e.toFixed(t)} ft`,cl=(e,t=1)=>A(e)?null:`${e.toFixed(t)} in`,no=(e,t=1)=>A(e)?null:`${e.toFixed(t)} mi`,ao=(e,t=0)=>A(e)?null:`${e.toFixed(t)} yd`,Zg=(e,t=1)=>A(e)?null:`${e.toFixed(t)} nm`,qg=e=>e*3.28084,Yg=e=>e/3.28084,Xg=e=>e*1.60934,Jg=e=>e/1.60934,Qg=e=>e/5280,Pn=e=>e*5280,eb=e=>e/1609.34,tb=e=>e*1609.34,rb=e=>e*.9144,ob=e=>e/.9144,nb=e=>e*2.54,ab=e=>e/2.54,kn=(e,t=false,r=1)=>{if(A(e))return null;let o=Math.abs(e);return t?o>=1e3?ro(e,r):o<.01?ll(e*1e3,0):o<1?sl(e*100,r):to(e,r):o<.01?oo(Pn(e),0):o<.1?ao(Pn(e)/3,0):no(e,r)},Tn=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??1;if(t.autoScale){let n=t.unit==="m"||t.unit==="km";return kn(r,n,o)}switch(t.unit){case "km":return ro(r,o);case "ft":return oo(r,o);case "mi":return no(r,o);case "yd":return ao(r,o);case "m":default:return to(r,o)}};S.register("miles",(e,t)=>typeof e=="number"?no(e,typeof t=="number"?t:1):null);S.register("kilometers",(e,t)=>typeof e=="number"?ro(e,typeof t=="number"?t:1):null);S.register("meters",(e,t)=>typeof e=="number"?to(e,typeof t=="number"?t:1):null);S.register("feet",(e,t)=>typeof e=="number"?oo(e,typeof t=="number"?t:0):null);S.register("yards",(e,t)=>typeof e=="number"?ao(e,typeof t=="number"?t:0):null);S.register("inches",(e,t)=>typeof e=="number"?cl(e,typeof t=="number"?t:1):null);S.register("autoScaleDistance",(e,t,r)=>typeof e=="number"?kn(e,typeof t=="boolean"?t:false,typeof r=="number"?r:1):null);var Rn=(e,t=1)=>A(e)?null:`${e.toFixed(t)} Wh`,io=(e,t=1)=>A(e)?null:`${(e/1e3).toFixed(t)} kWh`,Fn=(e,t=1)=>A(e)?null:`${(e/1e6).toFixed(t)} MWh`,Mn=(e,t=1)=>A(e)?null:`${(e/1e9).toFixed(t)} GWh`,Ln=(e,t=1)=>{if(A(e))return null;let r=Math.abs(e);return r>=1e9?Mn(e,t):r>=1e6?Fn(e,t):r>=1e3?io(e,t):Rn(e,t)},In=e=>A(e)?null:`${Math.round(e)} W`,Dn=(e,t=1)=>A(e)?null:`${(e/1e3).toFixed(t)} kW`,dl=(e,t=1)=>A(e)?null:`${(e/1e6).toFixed(t)} MW`,ul=(e,t=1)=>{if(A(e))return null;let r=Math.abs(e);return r>=1e6?dl(e,t):r>=1e3?Dn(e,t):In(e)},$n=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??1;if(t.autoScale)return Ln(r,o);switch(t.unit){case "kWh":return io(r,o);case "MWh":return Fn(r,o);case "GWh":return Mn(r,o);case "Wh":default:return Rn(r,o)}},ml=(e,t=1)=>A(e)?null:`${e.toFixed(t)} A`,pl=e=>A(e)?null:`${Math.round(e)} V`,fl=e=>A(e)?null:`${Math.round(e*1e3)} mV`,gl=(e,t=1)=>A(e)?null:`${(e/1e3).toFixed(t)} kV`,bl=(e,t=1)=>A(e)?null:`${e.toFixed(t)} \u03A9`,xl=(e,t=1)=>A(e)?null:`${(e*1e3).toFixed(t)} m\u03A9`;S.register("kWh",e=>typeof e=="number"?io(e):null);S.register("kW",e=>typeof e=="number"?Dn(e):null);S.register("watts",e=>typeof e=="number"?In(e):null);S.register("autoScaleEnergy",(e,t)=>typeof e=="number"?Ln(e,typeof t=="number"?t:1):null);S.register("autoScalePower",(e,t)=>typeof e=="number"?ul(e,typeof t=="number"?t:1):null);S.register("amps",e=>typeof e=="number"?ml(e):null);S.register("volts",e=>typeof e=="number"?pl(e):null);S.register("millivolts",e=>typeof e=="number"?fl(e):null);S.register("kilovolts",(e,t)=>typeof e=="number"?gl(e,typeof t=="number"?t:1):null);S.register("ohms",(e,t)=>typeof e=="number"?bl(e,typeof t=="number"?t:1):null);S.register("milliohms",(e,t)=>typeof e=="number"?xl(e,typeof t=="number"?t:1):null);var mr=e=>{if(!e)return null;let t=e.replace(/\D/g,"");return t.length===10?t.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3"):t.length===11&&t.startsWith("1")?t.replace(/1(\d{3})(\d{3})(\d{4})/,"+1 ($1) $2-$3"):e},so=e=>{if(!e)return null;let t=e.replace(/[^\d+]/g,"");return t.startsWith("+")?t.length===12&&t.startsWith("+1")?t.replace(/\+1(\d{3})(\d{3})(\d{4})/,"+1 ($1) $2-$3"):t.length===13&&t.startsWith("+44")?t.replace(/\+44(\d{2})(\d{4})(\d{4})/,"+44 $1 $2 $3"):t.replace(/(\+\d{1,3})(\d{3,4})(\d{3,4})(\d{3,4})?/,"$1 $2 $3 $4").trim():mr(e)},En=e=>e?e.startsWith("+")||e.length>11?so(e):mr(e):null,Bn=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=String(e);if(t.international)return so(r);switch(t.country){case "US":case "CA":return mr(r);default:return En(r)}};S.register("phoneNumber",e=>typeof e=="string"?En(e):null);S.register("usPhone",e=>typeof e=="string"?mr(e):null);S.register("internationalPhone",e=>typeof e=="string"?so(e):null);var An=e=>{switch(e){case "FAHRENHEIT":return "F";case "CELSIUS":return "C";case "KELVIN":return "K";default:return "F"}},Vn=(e,t=0)=>A(e)?null:`${e.toFixed(t)}\xB0F`,zn=(e,t=true,r=0)=>A(e)?null:`${(t?(e-32)*(5/9):e).toFixed(r)}\xB0C`,Hn=(e,t=true,r=0)=>A(e)?null:`${(t?(e-32)*(5/9)+273.15:e+273.15).toFixed(r)}K`,hl=e=>e*9/5+32,yl=e=>(e-32)*(5/9),fb=e=>e+273.15,vl=e=>e-273.15,gb=e=>yl(e)+273.15,bb=e=>hl(vl(e)),Gn=(e,t="F",r=0)=>{if(A(e))return null;switch(typeof t=="string"&&t.length>1?An(t):t){case "C":return zn(e,true,r);case "K":return Hn(e,true,r);case "F":default:return Vn(e,r)}},On=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??0,n=t.unit??"F";if(t.showUnit===false)switch(typeof n=="string"&&n.length>1?An(n):n){case "C":return ((r-32)*.5555555555555556).toFixed(o);case "K":return ((r-32)*.5555555555555556+273.15).toFixed(o);case "F":default:return r.toFixed(o)}return Gn(r,n,o)};S.register("temperature",(e,t,r)=>typeof e=="number"?Gn(e,typeof t=="string"?t:"F",typeof r=="number"?r:0):null);S.register("fahrenheit",(e,t)=>typeof e=="number"?Vn(e,typeof t=="number"?t:0):null);S.register("celsius",(e,t,r)=>typeof e=="number"?zn(e,typeof t=="boolean"?t:true,typeof r=="number"?r:0):null);S.register("kelvin",(e,t,r)=>typeof e=="number"?Hn(e,typeof t=="boolean"?t:true,typeof r=="number"?r:0):null);var Cl=(e,t)=>!!(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0),Wn=e=>e?.toUpperCase()??"",_n=e=>e?.toLowerCase()??"",Kn=e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",Un=e=>{if(!e)return "";let t=new Set(["a","an","the","and","but","or","for","nor","on","at","of","to","with","in","as","by"]);return e.toLowerCase().split(/\s+/).map((r,o)=>t.has(r)&&o!==0?r:r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},jn=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" "):"",Zn=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"",qn=e=>e?e.replace(/([A-Z])/g," $1").replace(/^./,t=>t.toUpperCase()).trim():"",Yn=e=>e?e.toLowerCase().split("_").map(t=>Zn(t)).join(" "):"",Nl=e=>e?e.includes("_")?Yn(e):e.toUpperCase()===e?Zn(e.toLowerCase()):qn(e):"",Xn=(e,t=16)=>{if(!e)return "";if(t<5||e.length<=t)return e;let r=t-3,o=Math.ceil(r/2),n=Math.floor(r/2);return `${e.slice(0,o)}...${e.slice(-n)}`},Jn=(e,t=8)=>e?e.length<=t?e:`...${e.slice(-t)}`:"",Qn=(e,t=16,r="...")=>e?e.length<=t?e:e.slice(0,t)+r:"",Sl=e=>{if(!e)return "";let t=e.toString(),r=t.slice(-4),o=t.length-4;return o>0?"*".repeat(o)+r:t},ea=(e,t)=>{if(Cl(e,t))return null;if(e==null)return t.nullText??null;let r=String(e);if(t.transform&&(Array.isArray(t.transform)?t.transform:[t.transform]).forEach(n=>{switch(n){case "uppercase":r=Wn(r);break;case "lowercase":r=_n(r);break;case "capitalize":r=jn(r);break;case "titleCase":r=Un(r);break;case "sentenceCase":r=Kn(r);break}}),t.truncate){let{length:o,position:n,ellipsis:a="..."}=t.truncate;switch(n){case "start":r=Jn(r,o);break;case "middle":r=Xn(r,o);break;case "end":r=Qn(r,o,a);break}}return r};S.register("uppercase",e=>Wn(String(e)));S.register("lowercase",e=>_n(String(e)));S.register("sentenceCase",e=>Kn(String(e)));S.register("titleCase",e=>Un(String(e)));S.register("capitalize",e=>jn(String(e)));S.register("camelCaseToWords",e=>qn(String(e)));S.register("snakeCaseToWords",e=>Yn(String(e)));S.register("enumToSentenceCase",e=>Nl(String(e)));S.register("truncateMiddle",(e,t)=>Xn(String(e),typeof t=="number"?t:16));S.register("truncateStart",(e,t)=>Jn(String(e),typeof t=="number"?t:8));S.register("truncateEnd",(e,t,r)=>Qn(String(e),typeof t=="number"?t:16,typeof r=="string"?r:"..."));S.register("secret",e=>Sl(String(e)));var Rb=(e,t)=>{switch(t.type){case "text":return ea(e,t);case "number":return Sn(e,t);case "currency":return wn(e,t);case "date":return Cn(e,t);case "boolean":return vn(e,t);case "energy":return $n(e,t);case "temperature":return On(e,t);case "distance":return Tn(e,t);case "phone":return Bn(e,t);case "custom":{let r=t;return r.hideWhenNull&&e==null?null:e==null?r.nullText??null:r.formatter(e,r.options)}default:return e!=null?String(e):null}},Fb=(e,t)=>({type:e,...t});var vt={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},b=rt.memo(({name:e,size:t="md",color:r,weight:o="regular",className:n,ariaLabel:a,...i})=>{let l=wl__namespace[e];if(!l)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react`),null;let s=typeof t=="string"&&t in vt?vt[t]:t,c=tailwindMerge.twMerge("inline-block flex-shrink-0",!r&&"text-current",n);return jsxRuntime.jsx(l,{...i,size:s,color:r,weight:o,className:c,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});b.displayName="Icon";var oa=rt.memo(({variant:e="subtle",shape:t="square",containerSize:r,containerClassName:o,size:n="md",className:a,name:i,color:l,weight:s,ariaLabel:c,ref:m,...d})=>{let u=typeof n=="string"&&n in vt?vt[n]:n,p=r?typeof r=="string"&&r in vt?vt[r]:r:u*1.75,g=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",t==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-gray-100 dark:bg-gray-800",e==="solid"&&"bg-brand text-white",e==="outline"&&"border-2 border-current",o);return jsxRuntime.jsx("div",{className:g,style:{width:p,height:p},children:jsxRuntime.jsx(b,{...d,name:i,size:n,color:l,weight:s,className:a,ariaLabel:c})})});oa.displayName="IconWithContainer";function aa({children:e,items:t,className:r,align:o="left",textAlign:n="left",size:a="md",onAction:i}){return jsxRuntime.jsx("div",{className:r,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:t.map(l=>jsxRuntime.jsx(Fl,{id:l.id,onAction:()=>l.onAction?.()||i?.(l),textAlign:n,size:a,iconName:l.iconName,isDisabled:l.disabled,variant:l.variant,"data-testid":l.testId,children:l.name},l.id))})})]})})}function Fl({textAlign:e="left",iconName:t,size:r="md",isDisabled:o,children:n,variant:a="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[r],s[a],e==="right"?"justify-end":"justify-start",o&&"pointer-events-none opacity-50"),children:[t&&e==="left"&&jsxRuntime.jsx(b,{name:t,size:r==="sm"?16:20,className:"mr-2 flex-shrink-0"}),jsxRuntime.jsx("span",{className:"flex-1",children:n}),t&&e==="right"&&jsxRuntime.jsx(b,{name:t,size:r==="sm"?16:20,className:"ml-2 flex-shrink-0"})]})}var pr=({className:e,showWordmark:t=true,width:r,fill:o})=>{let n,a;if(o?o.startsWith("fill-")?a=o:n=o:e?a=e:n="var(--color-text-body)",t){let s=r||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:a,style:n?{fill:n}: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=r||80;return jsxRuntime.jsxs("svg",{width:i,height:i,viewBox:"0 0 80 80",xmlns:"http://www.w3.org/2000/svg",className:a,style:n?{fill:n}: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 fr=({topItems:e=[],bottomItems:t=[],logo:r,showLogo:o=true,linkComponent:n="a",className:a="",mobileMenuId:i="app-mobile-menu",sidebarCollapseId:l="app-sidebar-collapse"})=>{let s=u=>u.length>0&&"items"in u[0],c=u=>s(u)?u:[{id:"default-section",items:u}],m=(u,p,g)=>jsxRuntime.jsxs("div",{className:"space-y-1",children:[u.title&&jsxRuntime.jsx("div",{className:"px-6 py-2 text-xs font-medium text-text-subtle uppercase tracking-wider","data-collapse-hide":"",children:u.title}),jsxRuntime.jsx("div",{className:"space-y-1",children:u.items.map(f=>d(f))}),p<g-1&&jsxRuntime.jsx("div",{className:"border-b border-border-subtle mx-6 my-4","data-collapse-hide":""})]},u.id),d=(u,p=false)=>{if(u.children&&u.children.length>0){let h=`category-${u.id}`;return jsxRuntime.jsxs("div",{className:"group/category",children:[jsxRuntime.jsx("input",{type:"checkbox",id:h,className:"peer/category hidden",defaultChecked:u.isExpanded,"aria-hidden":"true"}),jsxRuntime.jsxs("label",{htmlFor:h,className:"flex items-center gap-3 px-6 py-1 text-text-body hover:bg-background-hover hover:text-text-heading cursor-pointer transition-all duration-200","data-collapse-center":"",children:[u.icon&&jsxRuntime.jsx("span",{className:"flex-shrink-0 w-4 h-4 flex items-center justify-center transition-all duration-200",children:u.icon}),jsxRuntime.jsx("span",{className:"transition-all duration-200","data-collapse-hide":"",children:u.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:u.children.map(y=>d(y,true))})]},u.id)}let g={href:u.href||"#",className:`flex items-center gap-3 transition-all duration-200 hover:bg-background-hover ${p?"pl-8 pr-6 py-1 text-sm":"px-6 py-1"} ${u.isActive?"bg-action-primary-light text-action-primary border-l-2 border-action-primary":"text-text-body hover:text-text-heading"}`,"aria-current":u.isActive?"page":void 0,"data-collapse-center":p?void 0:""},f=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u.icon&&!p&&jsxRuntime.jsx("span",{className:"flex-shrink-0 w-4 h-4 flex items-center justify-center transition-all duration-200",children:u.icon}),jsxRuntime.jsx("span",{className:"transition-all duration-200","data-collapse-hide":"",children:u.label})]});return n==="a"?jsxRuntime.jsx("a",{...g,children:f},u.id):jsxRuntime.jsx(n,{...g,children:f},u.id)};return jsxRuntime.jsxs("div",{className:`flex flex-col h-full ${a}`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between h-[60px] px-6 border-b border-border-default",children:[o&&jsxRuntime.jsx("div",{className:"transition-all duration-200","data-collapse-hide":"",children:r||jsxRuntime.jsx(pr,{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-hidden",children:[e&&e.length>0&&jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto pb-4 scrollbar-hide",children:c(e).map((u,p,g)=>m(u,p,g.length))}),t&&t.length>0&&jsxRuntime.jsx("div",{className:"flex-shrink-0 border-t bg-background-muted/30",children:jsxRuntime.jsx("div",{className:"mt-4 pb-4 space-y-1",children:t.map(u=>d(u))})})]})]})};var Ot=({rightContent:e,showMobileMenu:t=true,avatar:r,showColorModeSwitcher:o=false,toggleTheme:n,isDarkThemeEnabled:a=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,o&&n&&jsxRuntime.jsx("button",{onClick:n,className:"hidden md:flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover transition-colors","aria-label":a?"Switch to light mode":"Switch to dark mode",children:a?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,r&&jsxRuntime.jsx("div",{className:"flex items-center",children:r}),!r&&o&&n&&jsxRuntime.jsx("button",{onClick:n,className:"md:hidden flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover transition-colors","aria-label":a?"Switch to light mode":"Switch to dark mode",children:a?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 la({sideNav:e,topNav:t,children:r,contentPaddingX:o="px-4 md:px-6",contentPaddingY:n="py-4 md:py-6",showSidebarBorder:a=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(Ot,{...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",a?"":"!border-r-0",e?.className||""].filter(Boolean).join(" "),children:jsxRuntime.jsx(fr,{...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(Ot,{...t,className:t?.className})}),jsxRuntime.jsx("main",{id:"app-content",className:["flex-1 overflow-y-auto bg-background-body",o,n,i||""].join(" "),role:"main",children:r})]})]}),jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:`
2
2
  @media (min-width: 768px) {
3
3
  /* Collapse sidebar width */
4
4
  #${c}:checked ~ * #app-sidebar {
@@ -61,10 +61,10 @@
61
61
  });
62
62
  }
63
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(`
67
- `)?I.split(`
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
64
+ `}})]})}var gr={prefix:String(Math.round(Math.random()*1e10)),current:0},ca=rt__namespace.default.createContext(gr),Dl=rt__namespace.default.createContext(false);var $l=!!(typeof window<"u"&&window.document&&window.document.createElement),mo=new WeakMap;function El(e=false){let t=rt.useContext(ca),r=rt.useRef(null);if(r.current===null&&!e){var o,n;let a=(n=rt__namespace.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||n===void 0||(o=n.ReactCurrentOwner)===null||o===void 0?void 0:o.current;if(a){let i=mo.get(a);i==null?mo.set(a,{id:t.current,state:a.memoizedState}):a.memoizedState!==i.state&&(t.current=i.id,mo.delete(a));}r.current=++t.current;}return r.current}function Bl(e){let t=rt.useContext(ca);t===gr&&!$l&&process.env.NODE_ENV!=="production"&&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 r=El(!!e),o=t===gr&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${o}-${r}`}function Al(e){let t=rt__namespace.default.useId(),[r]=rt.useState(br()),o=r||process.env.NODE_ENV==="test"?"react-aria":`react-aria${gr.prefix}`;return e||`${o}-${t}`}typeof rt__namespace.default.useId=="function"?Al:Bl;function zl(){return false}function Hl(){return true}function Gl(e){return ()=>{}}function br(){return typeof rt__namespace.default.useSyncExternalStore=="function"?rt__namespace.default.useSyncExternalStore(Gl,zl,Hl):rt.useContext(Dl)}var Ol=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Wl=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function fo(e){if(Intl.Locale){let r=new Intl.Locale(e).maximize(),o=typeof r.getTextInfo=="function"?r.getTextInfo():r.textInfo;if(o)return o.direction==="rtl";if(r.script)return Ol.has(r.script)}let t=e.split("-")[0];return Wl.has(t)}var Ul=Symbol.for("react-aria.i18n.locale");function ua(){let e=typeof window<"u"&&window[Ul]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e]);}catch{e="en-US";}return {locale:e,direction:fo(e)?"rtl":"ltr"}}var go=ua(),Wt=new Set;function da(){go=ua();for(let e of Wt)e(go);}function ma(){let e=br(),[t,r]=rt.useState(go);return rt.useEffect(()=>(Wt.size===0&&window.addEventListener("languagechange",da),Wt.add(r),()=>{Wt.delete(r),Wt.size===0&&window.removeEventListener("languagechange",da);}),[]),e?{locale:"en-US",direction:"ltr"}:t}var ql=rt__namespace.default.createContext(null);function bo(){let e=ma();return rt.useContext(ql)||e}var xo=new Map;function ho(e){let{locale:t}=bo(),r=t+(e?Object.entries(e).sort((n,a)=>n[0]<a[0]?-1:1).join():"");if(xo.has(r))return xo.get(r);let o=new Intl.Collator(t,e);return xo.set(r,o),o}function xr(e){let t=ho({usage:"search",...e}),r=rt.useCallback((a,i)=>i.length===0?true:(a=a.normalize("NFC"),i=i.normalize("NFC"),t.compare(a.slice(0,i.length),i)===0),[t]),o=rt.useCallback((a,i)=>i.length===0?true:(a=a.normalize("NFC"),i=i.normalize("NFC"),t.compare(a.slice(-i.length),i)===0),[t]),n=rt.useCallback((a,i)=>{if(i.length===0)return true;a=a.normalize("NFC"),i=i.normalize("NFC");let l=0,s=i.length;for(;l+s<=a.length;l++){let c=a.slice(l,l+s);if(t.compare(i,c)===0)return true}return false},[t]);return rt.useMemo(()=>({startsWith:r,endsWith:o,contains:n}),[r,o,n])}var vo=rt.createContext({colorMode:"light",isDarkTheme:false,toggleTheme:()=>{}}),fa=()=>rt.useContext(vo),ga=({children:e})=>{let[t,r]=rt.useState("light"),o=t==="dark";rt.useEffect(()=>{let a=localStorage.getItem("theme"),i=window.matchMedia("(prefers-color-scheme: dark)"),l=a||(i.matches?"dark":"light");r(l),l==="dark"&&document.body.classList.add("theme-dark");let s=c=>{if(!localStorage.getItem("theme")){let m=c.matches?"dark":"light";r(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 n=rt.useCallback(()=>{r(a=>{let i=a==="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(vo.Provider,{value:{colorMode:t,isDarkTheme:o,toggleTheme:n},children:e})};function ae(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 K(e,t){return reactAriaComponents.composeRenderProps(e,r=>tailwindMerge.twMerge(t,r))}var W={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 Oe(){let[e,t]=rt__namespace.default.useState(false),r=rt__namespace.default.useCallback((n,a)=>{t(true),a?.(n);},[]),o=rt__namespace.default.useCallback((n,a)=>{t(false),a?.(n);},[]);return {isFocused:e,handleFocus:r,handleBlur:o}}function We({children:e,className:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative w-full",t),children:e})}function ba({onClick:e,size:t="md",className:r}){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",r),"aria-label":"Clear input",onMouseDown:o=>{o.preventDefault(),o.stopPropagation();},children:jsxRuntime.jsx(b,{name:"X",size:t==="sm"?16:20})})}function Ct(e){let{isInvalid:t,isDisabled:r,isFocused:o}=e,n="border rounded-[var(--control-border-radius)] ";return r?`${n} border-border-muted focus:outline-none`:t&&o?`${n} border-feedback-error-border outline-[1.5px] outline-[var(--control-focus-ring-color-error)]`:t?`${n} border-feedback-error-border`:o?`${n} !outline-[1.5px] !outline-[var(--control-focus-ring-color)] ![--tw-outline-style:solid]`:`${n}`}function hr(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function Be(e){let{isInvalid:t,isDisabled:r,isFocused:o,transparent:n,size:a="md",className:i}=e;return tailwindMerge.twMerge("w-full",Ct({isInvalid:t,isDisabled:r,isFocused:o}),hr({transparent:n,isDisabled:r}),W[a].text,W[a].height,W[a].padding,i)}function _t(e){let{size:t="md",isFocusWithin:r,isInvalid:o,isDisabled:n,transparent:a,className:i}=e;return tailwindMerge.twMerge("group flex items-center rounded-sm overflow-hidden",hr({transparent:a,isDisabled:n}),W[t].height,Ct({isFocused:r,isInvalid:o,isDisabled:n}),i)}function q({children:e,size:t="md",tooltip:r,isRequired:o,className:n,htmlFor:a}){return jsxRuntime.jsxs("label",{htmlFor:a,className:tailwindMerge.twMerge(W[t].text,"!text-text-caption flex items-center gap-1",n),children:[e,o&&jsxRuntime.jsx("span",{children:"*"}),r&&jsxRuntime.jsx("span",{className:"text-text-muted",children:jsxRuntime.jsx(b,{name:"Info",size:t==="sm"?16:20})})]})}function J({size:e="md",className:t,children:r,...o}){return jsxRuntime.jsx("div",{...o,className:tailwindMerge.twMerge("leading-[2.25] text-text-muted",W[e].text,t),children:r})}function U({children:e,size:t="md",className:r}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge(W[t].text,"text-feedback-error-text",r),children:e})}function xa({size:e="md",isInvalid:t,isDisabled:r,isFocused:o,transparent:n,className:a,...i}){return jsxRuntime.jsx("input",{className:Be({isInvalid:t,isDisabled:r,isFocused:o,transparent:n,size:e,className:a}),...i})}function yr(e){let{children:t,...r}=e;return jsxRuntime.jsx("div",{...r,className:_t(e),children:typeof t=="function"?t(e):t})}var lc={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"},cc={sm:"text-controlElementSm",md:"text-controlElementMd",lg:"text-controlElementLg",xl:"text-controlElementXl"};function nt({size:e="md",className:t,...r}){return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{...r,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",lc[e],cc[e],t)})}function bc({isEntering:e,isExiting:t,className:r=""}){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(" "),n=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(" "):"",a=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 [o,n,a,r].filter(Boolean).join(" ")}function at({children:e,showArrow:t,className:r,...o}){let a=reactAriaComponents.useSlottedContext(reactAriaComponents.PopoverContext)?.trigger==="SubmenuTrigger",i=t?12:8;return i=a?i-6:i,jsxRuntime.jsxs(reactAriaComponents.Popover,{offset:i,...o,className:reactAriaComponents.composeRenderProps(r,(l,s)=>bc({...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 kc={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},Tc={sm:"pl-7",md:"pl-9",lg:"pl-10",xl:"pl-12"},ha={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"};function Rc(){let e=rt__namespace.default.useContext(reactAriaComponents.ComboBoxStateContext);return jsxRuntime.jsx(reactAriaComponents.Button,{slot:null,className:"clear-button","aria-label":"Clear",onPress:()=>e?.setSelectedKey(null),children:"\u2715"})}var Po=(e,t,r)=>{if(e==null||e==="")return "";let n=(r?r.flatMap(a=>a.items):t||[]).find(a=>a.id===e);return n?n.name:""};async function Fc(e,t,r){try{let o=e.url.replace("{q}",t),n=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([s,c])=>{n.append(s,c.toString());});let a=`${o}${n.toString()?"?"+n.toString():""}`,i=await fetch(a,{method:"GET",headers:e.headers,signal:r});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 n=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:n}}}async function Mc(e,t,r){try{let o=e.graphqlQuery.replace(`$${e.variableKey||"filter"}`,`"${t}"`),n=await fetch(e.url,{method:"POST",headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify({query:o}),signal:r});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);let a=await n.json();if(a.errors)throw new Error(a.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(a=e.responsePath.split(".").reduce((i,l)=>i?.[l],a)),{items:e.transformResponse(a)}}catch(o){console.error("Error in GraphQL request:",o);let n=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:n}}}function vr({label:e,staticItems:t=[],sections:r,selectedKey:o,defaultSelectedKey:n,onSelectionChange:a,requestConfig:i,defaultFilter:l,placeholder:s,errorMessage:c,description:m,size:d="md",tooltip:u,isRequired:p,isDisabled:g,isInvalid:f,validationResult:h,showErrors:y=true,renderItem:w,renderLeftIcon:P,renderSection:L,autoFocus:N=false}){let C=rt__namespace.default.useRef(null),[T,v]=rt__namespace.default.useState(),[D,$]=rt.useState(()=>Po(o||n,t,r)),[O,x]=rt.useState(false),E=ur(D),{contains:re}=xr({sensitivity:"base"}),[j,de]=rt.useState(),he=W[d].text,ze=W[d].height,F=null;rt.useEffect(()=>{N&&x(true);},[N]),rt.useEffect(()=>{let R=()=>{C.current&&v(C.current.offsetWidth);};return R(),window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]),rt.useEffect(()=>{F&&F.setFilterText(E);},[E,F]),i&&(F=reactStately.useAsyncList({async load({signal:R,filterText:k=""}){if(!i.url||i.shouldLoad&&!i.shouldLoad(k))return {items:[]};try{let M;return i.requestType==="GraphQL"?M=await Mc(i,k,R):M=await Fc(i,k,R),de(M.error),{items:M.items}}catch(M){return console.error("Error loading items:",M),de(M instanceof Error?M.message:"Unknown error occurred"),{items:[]}}},initialFilterText:""})),E===""&&(F=null);let V=R=>{let k=Po(R,t,r);$(k),a&&a(R);},Z=R=>{$(R);let k=Po(o,t,r);o!=null&&R!==k&&a&&a(null);};return jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:V,selectedKey:o||void 0,defaultSelectedKey:n||void 0,defaultItems:r?r.flatMap(R=>R.items):t,items:F?F.items:void 0,className:K("group flex flex-col","w-full"),menuTrigger:"focus",isDisabled:g,isInvalid:f||!!c,inputValue:D,onInputChange:Z,autoFocus:N,defaultFilter:l||re,"aria-label":e||s||"Autocomplete",children:R=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:d,tooltip:u,isRequired:p,children:e}),jsxRuntime.jsxs(reactAriaComponents.Group,{ref:C,className:_t({size:d,isInvalid:f||!!c,isDisabled:g,isFocusWithin:O||R.isOpen,className:"w-full cursor-pointer"}),"aria-label":e||s||"Autocomplete",style:{position:"relative"},children:[P?jsxRuntime.jsx("div",{className:"absolute left-3",children:P(!!F?.isLoading)}):jsxRuntime.jsx(b,{name:"MagnifyingGlass",className:`${kc[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 ${Tc[d]} ${he} ${ze} ${g?"bg-background-muted":"bg-background-input"}`,placeholder:s,disabled:g,onFocus:()=>x(true),onBlur:()=>x(false)}),D&&!g&&jsxRuntime.jsx(Rc,{}),jsxRuntime.jsx(reactAriaComponents.Button,{className:`px-2 text-text-body ${he} ${ze} ${g?"bg-background-muted":"bg-background-input"}`,"aria-label":"Toggle menu",isDisabled:g,children:({isPressed:k})=>jsxRuntime.jsx(b,{name:k?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),m&&jsxRuntime.jsx(J,{size:d,children:m}),y&&j&&jsxRuntime.jsx(U,{size:d,className:"text-feedback-error-text",children:j}),y&&typeof c=="string"&&jsxRuntime.jsx(U,{size:d,className:"text-feedback-error-text",children:c}),y&&typeof c=="function"&&h&&jsxRuntime.jsx(U,{size:d,className:"text-feedback-error-text",children:c(h)}),jsxRuntime.jsx(at,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5",style:{minWidth:T?`${T}px`:void 0},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{className:`max-h-[300px] overflow-auto bg-background-input outline-none ${he}`,children:r?r.map(k=>{let M=k.items.map(I=>jsxRuntime.jsx(nt,{id:I.id,textValue:I.name,size:d,className:`flex cursor-default items-center gap-2 rounded-sm px-3 ${ha[d]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:w?w(I):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[I.name,jsxRuntime.jsx(b,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},I.id));return L?L(k,M):jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-muted",children:k.name}),M]},k.name)}):k=>jsxRuntime.jsx(nt,{id:k.id,textValue:k.name,size:d,className:`flex cursor-default items-center gap-2 rounded-sm px-3 ${ha[d]} text-text-body outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium`,children:w?w(k):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[k.name,jsxRuntime.jsx(b,{name:"X",className:"ml-auto h-4 w-4 text-text-muted opacity-0 data-[focused]:opacity-100 data-[selected]:opacity-100"})]})},k.id)})})]})})}function Na({src:e,alt:t,firstName:r,lastName:o,fullName:n,onClick:a,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"},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"},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"},f={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"},h={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"},y=l==="circle"?"rounded-full":"rounded-md",w=tailwindMerge.twMerge("relative inline-flex items-center justify-center overflow-hidden transition-opacity",u[i],y,a&&"cursor-pointer hover:opacity-80",d&&"ring-2 ring-background-surface",c),L=(()=>{if(r||o){let T=r?.[0]||"",v=o?.[0]||"";return (T+v).toUpperCase()}if(n){let T=n.split(" "),v=T[0]?.[0]||"",D=T[T.length-1]?.[0]||"";return v===D?v.toUpperCase():(v+D).toUpperCase()}return ""})(),N=()=>{let T={xs:14,sm:16,md:20,lg:24,xl:32}[i];switch(s){case "team":return jsxRuntime.jsx(lucideReact.Users,{size:T});case "organization":return jsxRuntime.jsx(lucideReact.Building2,{size:T});default:return jsxRuntime.jsx(lucideReact.User,{size:T})}},C=()=>e?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("img",{src:e,alt:t||n||"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:L?jsxRuntime.jsx("span",{className:"font-semibold",children:L}):N()})]}):L?jsxRuntime.jsx("span",{className:"font-semibold",children:L}):N();return jsxRuntime.jsxs("div",{className:"relative inline-block",children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(w,e?"":h[s]),onClick:a,role:a?"button":void 0,tabIndex:a?0:void 0,children:C()}),m&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("absolute border-2 border-background-surface",y,p[i],g[i],f[m]),"aria-label":`Status: ${m}`})]})}var Ec={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"},Bc={sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-3.5 py-2.5 text-base"},Ac={pill:"rounded-full",rounded:"rounded-lg",square:"rounded-sm"},Vc={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};function Nt({children:e,variant:t="default",size:r="sm",shape:o="square",dot:n=false,dotPosition:a="left",className:i}){let l=n&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("rounded-full bg-current opacity-75",Vc[r]),"aria-hidden":"true"});return jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge("inline-flex items-center gap-1.5 font-medium",Bc[r],Ac[o],Ec[t],i),children:[n&&a==="left"&&l,e,n&&a==="right"&&l]})}var Ro=({href:e,children:t,className:r="",external:o=false,title:n,variant:a="default",onClick:i,asButton:l=false,onPress:s,showArrow:c=false})=>{let m=o?{target:"_blank",rel:"noopener noreferrer"}:{},p=`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"}[a]} ${r}`,g=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t,c&&jsxRuntime.jsxs("span",{children:["\xA0","\u2192"]})]});return l?jsxRuntime.jsx("button",{type:"button",className:p,onClick:s,title:n,children:g}):jsxRuntime.jsx("a",{href:e||"#",className:p,...m,title:n,onClick:i,children:g})};function Nr(e){return jsxRuntime.jsx(reactAriaComponents.Breadcrumbs,{...e,className:tailwindMerge.twMerge("flex gap-1",e.className)})}function Sr(e){let{className:t,children:r,href:o,...n}=e;return jsxRuntime.jsx(reactAriaComponents.Breadcrumb,{className:K(t,"flex items-center gap-1"),...n,children:a=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ro,{variant:"muted",href:o,children:typeof r=="function"?r(a):r}),o&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-3 w-3 text-text-muted"})]})})}var Yc="flex font-medium justify-center items-center gap-2 text-center transition rounded-sm whitespace-nowrap box-border",Xc={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"},ka={full:"w-full",default:"w-fit"},Jc="opacity-control-hover cursor-not-allowed pointer-events-none grayscale",Qc="opacity-100 cursor-pointer",ed={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},td={primary:"bg-action-primary text-white",destructive:"bg-action-destructive text-white"};function rd(e){let{variant:t="default",size:r="md",isDisabled:o,fullWidth:n=false,isLoading:a=false}=e,i=t==="unstyled"?"":`${Yc} ${Xc[t]}`;return t!=="unstyled"&&(i+=` ${W[r].text} ${W[r].height} ${W[r].padding} ${W[r].gap}`),o||a?i+=` ${Jc}`:i+=` ${Qc}`,n?i+=` ${ka.full}`:i+=` ${ka.default}`,`${i} ${ae()}`}function z(e){let{icon:t,children:r,isLoading:o=false,loadingText:n,loadingIndicator:a,size:i="md",iconPosition:l="left",iconWeight:s,href:c,className:m,badgeNumber:d,badgeVariant:u="primary",badgePosition:p="top-right",style:g,target:f,rel:h,...y}=e,w=t?jsxRuntime.jsx(b,{name:t,className:`icon-[--control-icon-size-${i}]`,weight:s}):null,P=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&w,typeof r=="function"?null:r,l==="right"&&w]}),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:a||jsxRuntime.jsx(b,{name:"CircleNotch",className:`animate-spin icon-[--control-icon-size-${i}]`,"aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:P}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),N=[rd(e),m,o?"aria-busy":""].filter(Boolean).join(" "),C=c?{href:c,target:f,rel:h,...y}:{};if(c){let{onPress:v,onPressStart:D,onPressEnd:$,onPressChange:O,onPressUp:x,onAuxClick:E,onContextMenu:re,onDoubleClick:j,...de}=y;Object.assign(C,de);}let T=c?jsxRuntime.jsx(reactAriaComponents.Link,{...C,style:g,className:N,children:o?L:typeof r=="function"?(function(v){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&w,r(v),l==="right"&&w]})}):P}):jsxRuntime.jsx(reactAriaComponents.Button,{...y,style:g,className:N,children:o?L:typeof r=="function"?(function(v){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l==="left"&&w,r(v),l==="right"&&w]})}):P});return d&&d>0?jsxRuntime.jsxs("div",{className:"relative",children:[T,jsxRuntime.jsx("span",{className:`absolute ${ed[p]} flex h-5 w-5 items-center justify-center rounded-full ${td[u]} text-xs`,"aria-label":`${d} items`,children:d})]}):T}function md({isSelected:e,isDisabled:t}){let r=[ae,"w-9 h-9 text-base cursor-default rounded-full flex items-center justify-center forced-color-adjust-none"];return t?r.push("text-gray-300 dark:text-zinc-600 forced-colors:text-[GrayText]"):e?r.push("bg-blue-600 invalid:bg-red-600 text-white forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):r.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"),r.join(" ")}function wr({errorMessage:e,...t}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...t,children:[jsxRuntime.jsx(Pr,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{children:[jsxRuntime.jsx(kr,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:r=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:r,className:({isSelected:o,isDisabled:n})=>md({isSelected:o,isDisabled:n})})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-red-600",children:e})]})}function Pr(){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(z,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(b,{name:"CaretRight","aria-hidden":true,size:t}):jsxRuntime.jsx(b,{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(z,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(b,{name:"CaretLeft","aria-hidden":true,size:t}):jsxRuntime.jsx(b,{name:"CaretRight","aria-hidden":true,size:t})})]})}function kr(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-caption",children:e})})}var fd={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"},gd={page:"h-16 leading-[62px]"};function Re({tag:e="h1",size:t="lg",height:r,className:o="",children:n}){let a=fd[t],i=r?gd[r]:"";return jsxRuntime.jsx(e,{className:tailwindMerge.twMerge(a,i,o),children:n})}var B=({width:e,height:t,variant:r="rect",animation:o="pulse",gradient:n=false,flex:a=false,stack:i,responsive:l,delay:s=0,adjustAnimationSpeedBasedOnWidth:c=false,ariaLabel:m,className:d,"data-testid":u})=>{let[p,g]=rt.useState(s===0);if(rt.useEffect(()=>{if(s>0){let N=setTimeout(()=>g(true),s);return ()=>clearTimeout(N)}},[s]),!p)return null;let f=n?"bg-gradient-to-r from-[var(--skeleton-base)] via-[var(--skeleton-highlight)] to-[var(--skeleton-base)]":"bg-[var(--skeleton-base)]",h=c&&e?(()=>{let N=typeof e=="number"?e:parseFloat(String(e));return isNaN(N)?"":`animation-duration-[${Math.max(.8,N/100)}s]`})():"",y=o==="pulse"?`animate-pulse ${h}`: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 ${h}`:"",w="rounded-sm";r==="circle"&&(w="rounded-full"),r==="text"&&(w="h-4 w-full rounded-sm");let P=a?"flex-1 min-w-0":"",L=l?Object.entries(l).map(([N,C])=>`${N}:w-[${C}]`).join(" "):"";return i?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":u,children:i.map((N,C)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(f,y,w,P,L,d),style:{width:N,height:t}},C))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(f,y,w,P,L,d),style:{width:e,height:t},role:"presentation","aria-hidden":!m,"aria-label":m??void 0,"data-testid":u})};var yd={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},vd="rounded-lg",Io={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Cd={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function Me({variant:e="outlined",className:t,children:r,isLoading:o=false}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",yd[e],vd,t),"data-testid":"card",children:o?jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(B,{width:"100%",height:200})}):r})}function Ra({title:e,subtitle:t,actions:r,className:o,isLoading:n=false}){return n?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",o),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(B,{width:120,height:20}),jsxRuntime.jsx(B,{width:24,height:24})]}),t&&jsxRuntime.jsx(B,{width:200,height:16})]}):!e&&!t&&!r?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",o),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(Re,{tag:"h3",size:"sm",className:"text-text-heading",children:e}):e}),t&&jsxRuntime.jsx("div",{className:"text-sm text-text-muted",children:t})]}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r})]})})}function Fa({src:e,alt:t,aspectRatio:r="auto",className:o,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",Io[r],o),children:jsxRuntime.jsx(B,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",Io[r],o),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",Io[r],o),children:jsxRuntime.jsx("img",{src:e,alt:t||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function Ma({className:e,children:t,isLoading:r=false}){return r?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4",e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(B,{width:"100%",height:16}),jsxRuntime.jsx(B,{width:"80%",height:16}),jsxRuntime.jsx(B,{width:"60%",height:16})]})}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-body",e),children:t}):null}function La({className:e,children:t,align:r="end",isLoading:o=false}){return o?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(B,{width:80,height:32}),jsxRuntime.jsx(B,{width:60,height:32})]}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",Cd[r],e),children:t}):null}Me.Header=Ra;Me.Media=Fa;Me.Content=Ma;Me.Footer=La;function Td(e){return jsxRuntime.jsxs(reactAriaComponents.CheckboxGroup,{...e,className:K(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(U,{children:typeof e.errorMessage=="function"?void 0:e.errorMessage})]})}function Rd({isDisabled:e}){return `flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-caption"}`}function Fd({isSelected:e,isInvalid:t,isDisabled:r,isIndeterminate:o}){let n="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",a="";return r?a="border-border-muted bg-background-muted":t?a="border-feedback-error-border bg-feedback-error-background":e||o?a="bg-action-primary border-action-primary hover:bg-action-primary-hover hover:border-action-primary-hover":a="bg-background-input border-border-input hover:border-border-focus",`${n} ${a}`}var Ia="w-4 h-4 text-text-onPrimary group-disabled:text-text-disabled";function Do(e){let{children:t,...r}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...r,className:reactAriaComponents.composeRenderProps(e.className,(o,n)=>`${Rd(n)} ${o||""}`),children:o=>{let{isSelected:n,isIndeterminate:a,...i}=o,l=jsxRuntime.jsx("div",{className:Fd({isSelected:n,isIndeterminate:a,...i}),children:a?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:Ia}):n?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:Ia}):null});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[l,typeof t=="function"?t(o):t]})}})}var Id={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"},Dd={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"},$d="opacity-75 cursor-not-allowed pointer-events-none";function $a(e){let{variant:t,size:r,isDisabled:o,isClickable:n,className:a}=e;return tailwindMerge.twMerge("inline-flex items-center justify-center rounded-full font-medium transition-colors","whitespace-nowrap select-none",Dd[r],W[r].text,Id[t],n&&!o&&"cursor-pointer",o&&$d,a)}function Tr({children:e,onRemove:t,size:r="md",variant:o="default",isRemovable:n=true,isDisabled:a=false,className:i,onClick:l}){let s=!!l&&!a,c=n&&t&&!a,m=p=>{p.stopPropagation(),p.preventDefault(),t&&!a&&t();},d=()=>{l&&!a&&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(b,{name:"X",size:r==="sm"?12:r==="md"?14:16,className:"text-current opacity-70 hover:opacity-100"})})]});return s?jsxRuntime.jsx("button",{type:"button",onClick:d,className:$a({variant:o,size:r,isDisabled:a,isClickable:s,className:i}),disabled:a,children:u}):jsxRuntime.jsx("span",{className:$a({variant:o,size:r,isDisabled:a,isClickable:s,className:i}),children:u})}function Ba({value:e,readOnly:t=false,onChange:r,language:o="json",theme:n="github_dark",height:a,width:i="100%",className:l,lineHeight:s=19,minLines:c=3,maxLines:m=50,showLineNumbers:d=true,showGutter:u=true,fontSize:p=14,wrapEnabled:g=false}){let f=rt.useRef(null),h=rt.useMemo(()=>{if(a)return a;let y=(e.match(/\n/g)||[]).length+1;return `${Math.max(c,Math.min(y,m))*s+10}px`},[e,a,s,c,m]);return rt.useEffect(()=>{f.current?.editor&&f.current.editor.resize();},[h]),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden rounded-md border border-border-input",l),style:{width:i,height:h},children:jsxRuntime.jsx(Hd__default.default,{ref:f,mode:o,theme:n,value:e,onChange:r,readOnly:t,width:"100%",height:"100%",fontSize:p,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 Ud=({isEntering:e,isExiting:t,className:r})=>["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":"",r].filter(Boolean).join(" ");function Eo({children:e,content:t,...r}){return jsxRuntime.jsxs(reactAriaComponents.TooltipTrigger,{delay:200,children:[e,jsxRuntime.jsxs(reactAriaComponents.Tooltip,{...r,offset:10,className:reactAriaComponents.composeRenderProps(r.className,(o,n)=>Ud({...n,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"})})}),t]})]})}function Va({value:e,children:t,className:r,size:o="sm"}){let[n,a]=rt.useState(false),s=jsxRuntime.jsx(z,{variant:"icon",size:o,onPress:()=>{let c=e||(typeof t=="string"?t:"");navigator.clipboard.writeText(c),a(true),setTimeout(()=>{a(false);},2e3);},className:"!px-2",children:jsxRuntime.jsx(b,{name:"Copy",size:o==="sm"?14:16})});return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1",r),children:[t,n?jsxRuntime.jsx(Eo,{content:"Copied!",children:s}):s]})}var za={duration:.5,ease:"easeInOut"},Rr=rt.createContext(null),st=()=>{let e=rt.useContext(Rr);if(!e)throw new Error("useChartContext must be used within a ChartContextProvider");return e};var wt=({data:e,color:t="#6b7280"})=>{let r=rt.useId(),o=rt.useId(),{xScale:n,yScale:a,animationSettings:i}=st(),l=n.range(),s=a.range();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:r,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: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:c=>n(c.xValue),y:c=>a(c.yValue),yScale:a,fill:`url(#${r})`,curve:curve.curveLinear}),jsxRuntime.jsx(shape.LinePath,{data:e,x:c=>n(c.xValue),y:c=>a(c.yValue),stroke:t,strokeWidth:3,curve:curve.curveLinear})]})})]})};var kt=({data:e,color:t="#6b7280",opacity:r=1,categoryColors:o={}})=>{let{xScale:n,yScale:a,animationSettings:i}=st(),l=rt.useId(),s=n.range(),c=a.range(),m=[...e].sort((p,g)=>p.xValue.getTime()-g.xValue.getTime()),d=m.length>1?m[1].xValue.getTime()-m[0].xValue.getTime():15*6e4,u=Math.abs(n(new Date(m[0].xValue.getTime()+d))-n(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((p,g)=>{let f=n(p.xValue),h=a(p.yValue),y=c[0]-h,w=m[g+1],P=w?Math.abs(n(w.xValue)-f):u,L=p.category&&o[p.category]?o[p.category]:t;return jsxRuntime.jsx(shape.Bar,{x:f-P/2,y:h,width:P,height:y,fill:L,opacity:r,rx:1},p.xValue.getTime())})})})]})};var ee={top:20,right:20,bottom:50,left:60};function Tt(e,t="$"){let r=(o,n)=>o==null?"-":n(o);switch(e){case "number":return {format:o=>r(o,n=>n.toLocaleString()),tickFormat:o=>r(o,n=>n.toLocaleString())};case "percent":return {format:o=>r(o,n=>`${n.toFixed(1)}%`),tickFormat:o=>r(o,n=>`${n.toFixed(0)}%`),min:0,max:100,tickInterval:20};case "kWh":return {format:o=>r(o,n=>`${(n/1e3).toFixed(1)} kWh`),tickFormat:o=>r(o,n=>`${(n/1e3).toFixed(1)}`)};case "kW":return {format:o=>r(o,n=>`${(n/1e3).toFixed(1)} kW`),tickFormat:o=>r(o,n=>`${(n/1e3).toFixed(1)}`)};case "amperes":return {format:o=>r(o,n=>`${n.toFixed(1)} A`),tickFormat:o=>r(o,n=>`${n.toFixed(1)} A`)};case "temperature":return {format:o=>r(o,n=>`${n.toFixed(1)}\xB0`),tickFormat:o=>r(o,n=>`${n.toFixed(0)}\xB0`)};case "percentageChange":return {format:o=>r(o,n=>`${n>0?"+":""}${(n*100).toFixed(1)}%`),tickFormat:o=>r(o,n=>`${n>0?"+":""}${(n*100).toFixed(0)}%`),min:-100,max:100};case "decimal":return {format:o=>r(o,n=>n.toFixed(2)),tickFormat:o=>r(o,n=>n.toFixed(1))};case "currency":return {format:o=>r(o,n=>`${t}${n.toLocaleString()}`),tickFormat:o=>r(o,n=>`${t}${n.toLocaleString()}`)};case "scientific":return {format:o=>r(o,n=>n.toExponential(2)),tickFormat:o=>r(o,n=>n.toExponential(1))};case "integer":return {format:o=>r(o,n=>Math.round(n).toLocaleString()),tickFormat:o=>r(o,n=>Math.round(n).toLocaleString())};case "logarithmic":return {format:o=>r(o,n=>n.toExponential(1)),tickFormat:o=>r(o,n=>n.toExponential(0)),min:1,tickInterval:10};case "timeDuration":return {format:o=>r(o,n=>`${Math.floor(n/60)}:${(n%60).toString().padStart(2,"0")} min`),tickFormat:o=>r(o,n=>`${Math.floor(n/60)}m`),min:0};case "compact":return {format:o=>r(o,n=>new Intl.NumberFormat("en",{notation:"compact"}).format(n)),tickFormat:o=>r(o,n=>new Intl.NumberFormat("en",{notation:"compact"}).format(n))};case "si":return {format:o=>r(o,n=>new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:2}).format(n)),tickFormat:o=>r(o,n=>new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(n))};case "bytes":return {format:o=>r(o,n=>{let a=["B","KB","MB","GB","TB"],i=0,l=n;for(;l>=1024&&i<a.length-1;)l/=1024,i++;return `${l.toFixed(1)} ${a[i]}`}),tickFormat:o=>r(o,n=>{let a=["B","KB","MB","GB","TB"],i=0,l=n;for(;l>=1024&&i<a.length-1;)l/=1024,i++;return `${l.toFixed(0)} ${a[i]}`}),min:0};case "rate":return {format:o=>r(o,n=>`${n.toFixed(1)} req/sec`),tickFormat:o=>r(o,n=>`${n.toFixed(0)}/s`)};case "ordinal":return {format:o=>r(o,n=>{let a=["th","st","nd","rd"],i=n%100;return n+(a[(i-20)%10]||a[i]||a[0])}),tickFormat:o=>r(o,n=>n.toString()),min:1};case "date":return {format:o=>r(o,n=>new Intl.DateTimeFormat("en",{dateStyle:"medium"}).format(new Date(n))),tickFormat:o=>r(o,n=>new Intl.DateTimeFormat("en",{dateStyle:"short"}).format(new Date(n))),min:0};case "largeCurrency":return {format:o=>r(o,n=>`${t}${(n/1e6).toFixed(2)}M`),tickFormat:o=>r(o,n=>`${t}${(n/1e6).toFixed(0)}M`)};case "coordinates":return {format:o=>r(o,n=>`${Math.abs(n).toFixed(3)}\xB0 ${n>=0?"N":"S"}`),tickFormat:o=>r(o,n=>`${Math.abs(n).toFixed(1)}\xB0 ${n>=0?"N":"S"}`),min:-90,max:90};case "ranked":return {format:o=>r(o,n=>`Rank: ${n}`),tickFormat:o=>r(o,n=>n.toString()),min:1};default:return {format:o=>r(o,n=>n.toLocaleString()),tickFormat:o=>r(o,n=>n.toLocaleString())}}}var Ao=(e,t)=>{let r=d3Array.extent(e,o=>o.xValue);return scale.scaleTime({range:[ee.left,t-ee.right],domain:r,nice:true})},Vo=(e,t,r)=>{let o=Tt(r),n=d3Array.min(e,s=>s.yValue)||0,a=d3Array.max(e,s=>s.yValue)||0,i=o.min!==void 0?o.min:n>=0?0:n*1.1,l=o.max!==void 0?o.max:a<=0?0:a*1.1;return scale.scaleLinear({range:[t-ee.bottom,ee.top],domain:[i,l],nice:true})};var mu=({top:e,scale:t,width:r})=>jsxRuntime.jsx(axis.Axis,{orientation:"bottom",top:e,scale:t,numTicks:Math.min(6,Math.floor(r/100)),tickFormat:o=>{let n=o;return new Intl.DateTimeFormat("en",{month:"short",day:"numeric"}).format(n)},stroke:"#e5e7eb",tickStroke:"#e5e7eb",tickLabelProps:()=>({fill:"#6b7280",fontSize:12,textAnchor:"middle"})}),pu=({left:e,scale:t,yFormatType:r})=>{let o=Tt(r);return jsxRuntime.jsx(axis.Axis,{orientation:"left",left:e,scale:t,numTicks:5,tickFormat:n=>(o.tickFormat||o.format)(n),stroke:"#e5e7eb",tickStroke:"#e5e7eb",tickLabelProps:()=>({fill:"#6b7280",fontSize:12,textAnchor:"end",dy:"0.33em"})})},Zt={Bottom:mu,Left:pu};var xu=({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))}),Mr=({items:e,onExport:t})=>{let[r,o]=rt__namespace.default.useState(false),[n,a]=rt__namespace.default.useState(null),i=rt__namespace.default.useCallback(async l=>{let s=l;o(true),a(s);try{await t(s);}catch(c){console.error("Export failed:",c);}finally{o(false),a(null);}},[t]);return jsxRuntime.jsxs("div",{className:"mt-4 flex items-center justify-between overflow-y-hidden",children:[jsxRuntime.jsx(xu,{items:e}),jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsxs(z,{variant:"secondary",size:"sm",isDisabled:r,children:[jsxRuntime.jsx(b,{name:"Export",size:16}),r?"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:r,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(b,{name:"List",size:14}),n==="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:r,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(b,{name:"Code",size:14}),n==="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:r,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(b,{name:"DownloadSimple",size:14}),n==="png"?"Exporting...":"Export as PNG"]})})]})})]})]})};function Oo(e,t,r=true){let o=e||"chart";if(r){let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return `${o}-${n}.${t}`}return `${o}.${t}`}async function Wo(e,t,r={},o){let n=Array.isArray(t[0])?t:[t];try{switch(e){case "csv":await yu(n,r);break;case "svg":await vu(o,r);break;case "png":await Cu(o,r);break;default:throw new Error(`Unsupported export type: ${e}`)}}catch(a){throw console.error("Export failed:",a),new Error(`Failed to export chart as ${e}: ${a instanceof Error?a.message:"Unknown error"}`)}}async function yu(e,t){try{let r=new Map;e.forEach(s=>{s.forEach(c=>{let m=c.xValue.getTime();r.has(m)||r.set(m,c.xValue);});});let n=Array.from(r.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}`,p=m.find(g=>g.xValue.getTime()===s.getTime());c[u]=p?p.yValue:"",p?.category&&(c[`${u} Category`]=p.category);}),c}),a=hu__default.default.unparse(n,{header:!0,skipEmptyLines:!0}),i=new Blob([a],{type:"text/csv;charset=utf-8;"}),l=Oo(t.filename||"chart-data","csv",t.timestamp!==!1);fileSaver.saveAs(i,l);}catch(r){throw new Error(`CSV export failed: ${r instanceof Error?r.message:"Unknown error"}`)}}async function vu(e,t){if(!e.current)throw new Error("SVG element not found");try{let o=e.current.cloneNode(!0);if(!o.querySelector("rect[data-background]")){let c=document.createElementNS("http://www.w3.org/2000/svg","rect");c.setAttribute("width",o.getAttribute("width")||"100%"),c.setAttribute("height",o.getAttribute("height")||"100%"),c.setAttribute("fill","white"),c.setAttribute("data-background","true"),o.insertBefore(c,o.firstChild);}let i=new XMLSerializer().serializeToString(o);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=Oo(t.filename||"chart","svg",t.timestamp!==!1);fileSaver.saveAs(l,s);}catch(r){throw new Error(`SVG export failed: ${r instanceof Error?r.message:"Unknown error"}`)}}async function Cu(e,t,r=2){if(!e.current)throw new Error("SVG element not found");let o="";try{let n=e.current,a=n.getBoundingClientRect(),i=n.cloneNode(!0);i.setAttribute("width",String(a.width)),i.setAttribute("height",String(a.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(a.width)),s.setAttribute("height",String(a.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 o=URL.createObjectURL(d),new Promise((u,p)=>{let g=new Image,f=setTimeout(()=>{o&&URL.revokeObjectURL(o),p(new Error("Image loading timeout"));},1e4);g.onload=()=>{clearTimeout(f);try{let h=document.createElement("canvas");h.width=a.width*r,h.height=a.height*r;let y=h.getContext("2d");if(!y)throw new Error("Canvas context not available");y.imageSmoothingEnabled=!0,y.imageSmoothingQuality="high",y.scale(r,r),y.fillStyle="white",y.fillRect(0,0,a.width,a.height),y.drawImage(g,0,0,a.width,a.height),h.toBlob(w=>{if(w){let P=Oo(t.filename||"chart","png",t.timestamp!==!1);fileSaver.saveAs(w,P),u();}else p(new Error("Failed to create PNG blob"));o&&URL.revokeObjectURL(o);},"image/png",1);}catch(h){o&&URL.revokeObjectURL(o),p(h);}},g.onerror=()=>{clearTimeout(f),o&&URL.revokeObjectURL(o),p(new Error("Failed to load SVG as image"));},g.src=o;})}catch(n){throw o&&URL.revokeObjectURL(o),new Error(`PNG export failed: ${n instanceof Error?n.message:"Unknown error"}`)}}function Nu(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 Su(e){return {csv:"CSV Spreadsheet",svg:"SVG Vector Image",png:"PNG Image"}[e]||"Unknown Format"}var qt=new Map,Yt=(e,t="#000000")=>{if(typeof window>"u")return t;let r=e.startsWith("var(")?e.slice(4,-1):e.startsWith("--")?e:`--${e}`;if(qt.has(r))return qt.get(r);try{let o=document.documentElement,a=getComputedStyle(o).getPropertyValue(r).trim();if(a)return qt.set(r,a),a;let i=document.createElement("div");i.style.color=`var(${r})`,document.body.appendChild(i);let l=getComputedStyle(i).color;return document.body.removeChild(i),l&&l!=="rgb(0, 0, 0)"?(qt.set(r,l),l):t}catch(o){return console.warn(`Failed to resolve color for ${e}:`,o),t}},wu=()=>{qt.clear();},Lr=()=>{let e=[];for(let t=1;t<=10;t++){let r=Yt(`--data-categorical-${t}`);r&&e.push(r);}return e.length===0?_a():e},_a=()=>["#444ae1","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#f97316","#14b8a6","#6366f1"],_o=()=>Yt("--data-default","#444ae1"),Pu=(e,t)=>{let r={},o=Lr();return e.forEach((n,a)=>{t&&t[n]?r[n]=t[n]:r[n]=o[a%o.length];}),r},Ka=e=>{let t=e.match(/\d+/g);if(!t||t.length<3)return true;let[r,o,n]=t.map(Number);return (.299*r+.587*o+.114*n)/255>.5},ku=e=>Ka(e)?Yt("--text-body","#333333"):Yt("--neutral-white","#ffffff");var Ir=({data:e,formatType:t})=>{if(!e)return null;let r=Tt(t),o=rt__namespace.default.useRef(null),[n,a]=rt__namespace.default.useState({x:0,y:0,translate:"translate(-50%, -100%)"});rt__namespace.default.useEffect(()=>{if(!o.current)return;let s=o.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),a({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: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:n.x,top:n.y,transform:n.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:r.format(l.value)})]},l.label))})]})})};var Rt=({data:e,color:t="#6b7280",strokeWidth:r=3,strokeDasharray:o})=>{let{xScale:n,yScale:a,animationSettings:i}=st(),l=a.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=>n(s.xValue),y:s=>a(s.yValue),stroke:t,strokeWidth:r,strokeDasharray:o,strokeLinecap:"round",curve:curve.curveLinear})})};var Au=d3Array.bisector(e=>e.xValue).left,Vu=()=>jsxRuntime.jsx("div",{className:"flex h-full items-center justify-center",children:jsxRuntime.jsx("p",{className:"text-gray-500",children:"No data available"})}),zu=()=>jsxRuntime.jsxs("div",{className:"flex h-full flex-col gap-4 p-4",children:[jsxRuntime.jsx(B,{className:"h-full w-full"}),jsxRuntime.jsxs("div",{className:"flex gap-4",children:[jsxRuntime.jsx(B,{className:"h-4 w-24"}),jsxRuntime.jsx(B,{className:"h-4 w-24"})]})]}),Hu=({parentWidth:e,parentHeight:t,yFormatType:r="number",isLoading:o=false,children:n})=>{let[a,i]=rt.useState(null),l=rt.useRef(null),s=rt.useRef(0),c=rt.useMemo(()=>Lr(),[]),m=rt.useMemo(()=>_o(),[]),{datasets:d,seriesMetadata:u}=rt.useMemo(()=>{let v=[],D=[],$=0,O=rt.Children.toArray(n).filter(x=>rt.isValidElement(x)&&(x.type===wt||x.type===Rt||x.type===kt)&&x.props.data).length;return rt.Children.forEach(n,x=>{if(rt.isValidElement(x)&&(x.type===wt||x.type===Rt||x.type===kt)&&x.props.data){v.push(x.props.data);let E=x.props.color||(O===1?m:c[$%c.length]);D.push({label:x.props.label||`Series ${v.length}`,color:E}),$++;}}),{datasets:v,seriesMetadata:D}},[n]),p=e,g=t-60,f=rt.useMemo(()=>d.flat(),[d]),h=rt.useMemo(()=>Ao(f,p),[f,p]),y=rt.useMemo(()=>Vo(f,g,r),[f,g,r]),w=rt.useCallback(v=>{let{left:D}=l.current?.getBoundingClientRect()||{left:0},$=v.clientX-D;if(v.timeStamp-(s.current||0)<16)return;s.current=v.timeStamp;let O=h.invert($),x=d.map((j,de)=>{if(!j||j.length===0)return null;let he=Au(j,O,1);if(he===0)return {point:j[0],datasetIndex:de};if(he>=j.length)return {point:j[j.length-1],datasetIndex:de};let ze=j[he-1],F=j[he];if(!ze||!F)return null;let V=Math.abs(ze.xValue.getTime()-O.getTime()),Z=Math.abs(F.xValue.getTime()-O.getTime());return {point:V<Z?ze:F,datasetIndex:de}}).filter(j=>j!==null&&u[j.datasetIndex]!==void 0).map(({point:j,datasetIndex:de})=>({label:u[de].label,value:j.yValue,color:u[de].color,point:j}));if(x.length===0){i(null);return}let E=h(x[0].point.xValue),re=E>(p-ee.right-ee.left)/2+ee.left;i({xValue:x[0].point.xValue,series:x.map(({label:j,value:de,color:he})=>({label:j,value:de,color:he})),x:E,y:y(x[0].value),position:re?"left":"right"});},[d,u,h,y,p]),P=()=>{i(null);},L={width:p,height:g,xScale:h,yScale:y,yFormatType:r,animationSettings:za,tooltip:{data:a,show:i,hide:()=>i(null)}},N=rt.Children.map(n,(v,D)=>rt.isValidElement(v)&&(v.type===wt||v.type===Rt||v.type===kt)?rt__namespace.default.cloneElement(v,{...v.props,color:u[D]?.color}):v),C=u.map(v=>({category:v.label,fill:v.color})),T=rt.useCallback(async v=>{try{await Wo(v,d,{xLabel:"Date",yLabel:"Value",seriesLabels:u.map(D=>D.label),timestamp:!0},l);}catch(D){console.error("Export failed:",D);}},[d,u]);return o?jsxRuntime.jsx(zu,{}):d.length===0?jsxRuntime.jsx(Vu,{}):jsxRuntime.jsx("div",{className:"relative flex h-full flex-col",children:jsxRuntime.jsxs(Rr.Provider,{value:L,children:[jsxRuntime.jsxs("svg",{width:p,height:g,className:"overflow-visible",ref:l,children:[jsxRuntime.jsx("g",{children:y.ticks(5).map(v=>jsxRuntime.jsx(shape.Line,{from:{x:ee.left,y:y(v)},to:{x:p-ee.right,y:y(v)},stroke:"#e5e7eb",strokeWidth:1},`grid-line-${v}`))}),N,jsxRuntime.jsx(Zt.Bottom,{top:g-ee.bottom,scale:h,width:p-ee.left-ee.right}),jsxRuntime.jsx(Zt.Left,{left:ee.left,scale:y,yFormatType:r}),a?.series.map(v=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:h(a.xValue),cy:y(v.value),r:8,fill:"white",stroke:v.color,strokeWidth:2,style:{transition:"all 100ms ease-out"}}),jsxRuntime.jsx("circle",{cx:h(a.xValue),cy:y(v.value),r:4,fill:v.color,style:{transition:"all 100ms ease-out"}})]},`highlight-${v.label}`)),jsxRuntime.jsx("rect",{x:ee.left,y:ee.top,width:p-ee.left-ee.right,height:g-ee.top-ee.bottom,fill:"transparent",style:{cursor:"crosshair"},onMouseMove:w,onMouseLeave:P})]}),jsxRuntime.jsx(Ir,{data:a,formatType:r}),jsxRuntime.jsx(Mr,{onExport:T,items:C})]})})},qa=responsive.withParentSize(Hu);function qo(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 Le(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 ne(e="left",t){return tailwindMerge.twMerge("flex items-center gap-1",qo(e),t)}function $r(e,t="\u2014"){return e==null||e===""?t:String(e)}var ct={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 Ie(e="normal"){return {high:ct.lg,normal:ct.md,low:ct.sm}[e]}function xe(e,t){return typeof e=="function"?e(t):e}function Ya(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 Xa(e){return e?"success":"neutral"}function Er(e,t=false){return t?e>0?"text-green-600":e<0?"text-red-600":"text-text-body":"text-text-body"}function Ja(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 dt(e,t,r,o="hover",n){if(!t)return e;let a=typeof t=="function"&&r?t(r):t,i=Ja(o);return jsxRuntime.jsx("a",{href:a,className:tailwindMerge.twMerge(i,n),onClick:l=>{l.metaKey||l.ctrlKey;},children:e})}function Qa({row:e,context:t,actions:r,align:o="right",size:n="sm"}){let{isLoading:a}=t;if(a)return jsxRuntime.jsx(B,{className:ct.sm});let i=r.filter(s=>!xe(s.hidden,e));if(i.length===0)return null;let l=ne(o);return jsxRuntime.jsx("div",{className:l,children:i.map(s=>{let c=xe(s.disabled,e);return s.variant==="icon"||!s.label?jsxRuntime.jsx(z,{variant:"icon",size:n,onPress:()=>{s.onClick(e);},isDisabled:c,"aria-label":s.label||s.id,children:jsxRuntime.jsx(b,{name:s.icon||"DotsThree",size:n==="sm"?16:20})},s.id):jsxRuntime.jsxs(z,{variant:s.variant||"secondary",size:n,onPress:()=>{s.onClick(e);},isDisabled:c,children:[s.icon&&jsxRuntime.jsx(b,{name:s.icon,size:n==="sm"?14:16}),s.label]},s.id)})})}function ei({value:e,context:t,format:r="icon",trueText:o="Yes",falseText:n="No",trueIcon:a="Check",falseIcon:i="X",showFalse:l=true,align:s="center",emphasis:c="normal"}){let{isLoading:m}=t;if(m)return jsxRuntime.jsx(B,{className:Ie(c)});let d=!!e;if(!d&&!l)return jsxRuntime.jsx("div",{className:ne(s)});let u=ne(s);switch(r){case "icon":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx(b,{name:d?a:i,size:16,className:d?"text-green-600":"text-gray-400"})});case "text":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx("span",{className:Le(c),children:d?o:n})});case "badge":return jsxRuntime.jsx("div",{className:u,children:jsxRuntime.jsx(Nt,{variant:d?"success":"neutral",size:"sm",children:d?o:n})});default:return null}}function ti({value:e,row:t,context:r,format:o="date",customFormat:n,emptyText:a="\u2014",align:i="left",emphasis:l="normal",href:s,linkBehavior:c="hover"}){let{isLoading:m}=r;if(m)return jsxRuntime.jsx(B,{className:Ie(l)});if(!e)return jsxRuntime.jsx("div",{className:ne(i,"text-text-muted"),children:a});let d=e instanceof Date?e:new Date(e);if(isNaN(d.getTime()))return jsxRuntime.jsx("div",{className:ne(i,"text-text-muted"),children:a});let u;switch(o){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=Wu(d);break;case "custom":u=n?d.toLocaleString("en-US",n):d.toISOString();break;default:u=d.toLocaleDateString();}let p=ne(i,Le(l)),g=xe(s,t);return g?jsxRuntime.jsx("div",{className:p,children:dt(u,g,t,c)}):jsxRuntime.jsx("div",{className:p,children:u})}function Wu(e){let r=new Date().getTime()-e.getTime(),o=Math.floor(r/1e3),n=Math.floor(o/60),a=Math.floor(n/60),i=Math.floor(a/24);return o<60?"just now":n<60?`${n} minute${n!==1?"s":""} ago`:a<24?`${a} hour${a!==1?"s":""} ago`:i<7?`${i} day${i!==1?"s":""} ago`:e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function ri({value:e,row:t,context:r,format:o="number",decimals:n=0,prefix:a,suffix:i,emptyText:l="\u2014",align:s="right",emphasis:c="normal",href:m,linkBehavior:d="hover",showPositiveSign:u=false,colorCode:p=false}){let{isLoading:g}=r;if(g)return jsxRuntime.jsx(B,{className:Ie(c)});if(e==null||isNaN(Number(e)))return jsxRuntime.jsx("div",{className:ne(s,"text-text-muted"),children:l});let f=Number(e),h;switch(o){case "currency":h=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(f);break;case "percent":h=new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(f/100);break;case "compact":h=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:n>0?1:0,maximumFractionDigits:n}).format(f);break;default:h=new Intl.NumberFormat("en-US",{minimumFractionDigits:n,maximumFractionDigits:n}).format(f);}let w=`${u&&f>0?"+":""}${h}`,P=p?Er(f,true):Le(c),L=ne(s,P),N=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a&&jsxRuntime.jsx("span",{className:"text-text-muted",children:a}),jsxRuntime.jsx("span",{children:w}),i&&jsxRuntime.jsx("span",{className:"text-text-muted",children:i})]}),C=xe(m,t);return C?jsxRuntime.jsx("div",{className:L,children:dt(N,C,t,d)}):jsxRuntime.jsx("div",{className:L,children:N})}function oi({row:e,context:t,isSelected:r=false,onSelect:o,isDisabled:n=false,align:a="center"}){let{isLoading:i}=t;if(i)return jsxRuntime.jsx("div",{className:ne(a),children:jsxRuntime.jsx(B,{className:"h-4 w-4 rounded"})});let l=xe(n,e),s=ne(a);return jsxRuntime.jsx("div",{className:s,children:jsxRuntime.jsx(Do,{isSelected:r,onChange:c=>{o?.(e,c);},isDisabled:l,"aria-label":"Select row"})})}function ni({value:e,row:t,context:r,prefix:o,suffix:n,emptyText:a="\u2014",href:i,linkBehavior:l="visible",emphasis:s="normal",truncate:c=true,align:m="left"}){let{isLoading:d}=r;if(d)return jsxRuntime.jsx(B,{className:Ie(s)});let u=$r(e,a),p=xe(i,t),g=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx("span",{className:"text-text-muted",children:o}),jsxRuntime.jsx("span",{className:c?"truncate":"",children:u}),n&&jsxRuntime.jsx("span",{className:"text-text-muted",children:n})]}),f=ne(m,Le(s));return p?jsxRuntime.jsx("div",{className:f,children:dt(g,p,t,l)}):jsxRuntime.jsx("div",{className:f,children:g})}var Zu={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},qu={sm:"hidden sm:grid",md:"hidden md:grid",lg:"hidden lg:grid",xl:"hidden xl:grid"};function Ar(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function Vr(e,t,r,o){if(r.cell){let n=r.cell,a=typeof r.cellProps=="function"?r.cellProps(e,t):r.cellProps;return jsxRuntime.jsx(n,{value:e,row:t,context:o,...a})}return r.render?r.render(e,t,o):e?.toString()??"\u2014"}function Hr({row:e,columns:t,density:r,isLoading:o,onClick:n}){let a=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=a.filter(d=>d.mobilePriority===1||d.mobileFormat==="primary"),l=a.filter(d=>d.mobilePriority===2&&d.mobileFormat!=="primary"),s=a.filter(d=>d.mobileFormat==="badge"),c={isLoading:!!o,rowIndex:0,columnIndex:0,density:r};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",n&&"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"}[r]),onClick:n,role:n?"button":void 0,tabIndex:n?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=Ar(e,d);return jsxRuntime.jsx("div",{className:"font-medium text-text-body [&>*]:!justify-start [&>*]:!text-left",children:Vr(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=Ar(e,d);return jsxRuntime.jsx("div",{className:"inline-flex",children:Vr(u,e,d,c)},d.id)})})]}),l.length>0&&jsxRuntime.jsx("div",{className:"space-y-1",children:l.map(d=>{let u=Ar(e,d),p=d.showLabel&&d.label;return jsxRuntime.jsxs("div",{className:"flex items-center text-sm text-text-muted",children:[d.icon&&jsxRuntime.jsx(b,{name:d.icon,className:"mr-1.5 h-4 w-4 flex-shrink-0"}),p&&jsxRuntime.jsxs("span",{className:"mr-1 font-medium",children:[d.label,":"]}),jsxRuntime.jsx("span",{className:"truncate [&>*]:!justify-start [&>*]:!text-left",children:Vr(u,e,d,c)})]},d.id)})})]})}function Gr({row:e,columns:t,density:r,isLoading:o,onClick:n}){let a=t.filter(s=>s.mobile!==false),i={isLoading:!!o,rowIndex:0,columnIndex:0,density:r};return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",n&&"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"}[r]),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,children:jsxRuntime.jsx("div",{className:"space-y-2",children:a.map((s,c)=>{let m=Ar(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:Vr(m,e,s,i)})]},s.id)})})})}function ai(e="md"){return {mobile:Zu[e],desktop:qu[e]}}function ii({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 Xo={compact:"py-1.5 px-3 text-sm",default:"py-3 px-4 text-sm",relaxed:"py-4 px-4 text-base"},Jo={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"},Xu={full:"w-full",auto:"w-auto inline-block",contained:"w-full max-w-6xl mx-auto"},Ju={auto:"table-auto",fixed:"table-fixed",responsive:"table-auto"};function Qo(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 Qu(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function em({column:e,sortConfig:t,onSort:r,stickyHeader:o,density:n="default"}){let a=t?.columnId===e.id,i=a?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",Xo[n],Jo[e.align||"left"],o&&"sticky top-0 z-10",e.sortable&&"cursor-pointer hover:bg-background-hover"),onClick:()=>e.sortable&&r(e.id),role:"columnheader","aria-sort":a?i==="asc"?"ascending":"descending":"none",style:Qo(e),children:[jsxRuntime.jsx("span",{className:"truncate",children:e.label}),e.sortable&&jsxRuntime.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsx(b,{name:i==="asc"?"CaretUp":i==="desc"?"CaretDown":"CaretUp",size:12,className:a?"text-text-body":"text-text-muted opacity-50"})})]})}function tm({column:e,row:t,rowIndex:r,columnIndex:o,isHovered:n,density:a="default",className:i}){let l=Qu(t,e),s={isLoading:false,isHovered:n,rowIndex:r,columnIndex:o,density:a},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",Xo[a],Jo[e.align||"left"],i),role:"cell",style:Qo(e),children:c})}function rm({column:e,rowIndex:t,columnIndex:r,density:o="default"}){let n={isLoading:true,rowIndex:t,columnIndex:r,density:o},a;if(e.cell){let i=e.cell,l=typeof e.cellProps=="function"?e.cellProps(null,{}):e.cellProps;a=jsxRuntime.jsx(i,{value:null,row:{},context:n,...l});}else e.render?a=e.render(null,{},n):a=jsxRuntime.jsx(B,{className:"h-4 w-full max-w-[200px]"});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default",Xo[o],Jo[e.align||"left"]),role:"cell",style:Qo(e),children:a})}function om({columns:e,row:t,rowIndex:r,density:o="default",onClick:n}){let[a,i]=rt.useState(false),l=rt.useCallback(()=>{n&&n(t);},[n,t]);return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("contents group",n&&"cursor-pointer"),role:"row",onClick:l,onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),children:e.map((s,c)=>jsxRuntime.jsx(tm,{column:s,row:t,rowIndex:r,columnIndex:c,isHovered:a,density:o,className:n?"group-hover:bg-background-hover":""},s.id))})}function nm({columns:e,rowIndex:t,density:r="default"}){return jsxRuntime.jsx("div",{className:"contents",role:"row",children:e.map((o,n)=>jsxRuntime.jsx(rm,{column:o,rowIndex:t,columnIndex:n,density:r},o.id))})}function ci({columns:e,data:t,className:r,density:o="default",width:n="full",height:a,maxHeight:i,layout:l="auto",mobileRenderer:s="auto",customMobileRowRender:c,mobileBreakpoint:m="md",isLoading:d=false,loadingRowCount:u=5,stickyHeader:p=false,onRowClick:g,getRowId:f,hideHeader:h=false,onSort:y,"aria-label":w}){let[P,L]=rt.useState(null),N=rt.useMemo(()=>e.map(x=>{if(x.width)return typeof x.width=="number"?`${x.width}px`:x.width;if(x.flex)return `${x.flex}fr`;if(x.minWidth&&x.maxWidth){let E=typeof x.minWidth=="number"?`${x.minWidth}px`:x.minWidth,re=typeof x.maxWidth=="number"?`${x.maxWidth}px`:x.maxWidth;return `minmax(${E}, ${re})`}return x.minWidth?`minmax(${typeof x.minWidth=="number"?`${x.minWidth}px`:x.minWidth}, 1fr)`:x.maxWidth?`minmax(0, ${typeof x.maxWidth=="number"?`${x.maxWidth}px`:x.maxWidth})`:"1fr"}).join(" "),[e]),C=rt.useCallback(x=>{if(!e.find(j=>j.id===x)?.sortable)return;let re=null;P?.columnId===x?P.direction==="asc"?re={columnId:x,direction:"desc"}:re=null:re={columnId:x,direction:"asc"},L(re),y?.(re);},[e,P,y]),T={};a&&(T.height=typeof a=="number"?`${a}px`:a,T.overflowY="auto"),i&&(T.maxHeight=typeof i=="number"?`${i}px`:i,T.overflowY="auto");let v=tailwindMerge.twMerge(Xu[n],l==="responsive"?"overflow-x-auto":"overflow-auto",r),D=ai(m),$=s!=="none",O=(x,E)=>$?s==="custom"&&c?c(x,E):jsxRuntime.jsx(s==="cards"?Gr:Hr,{row:x,columns:e,density:o,isLoading:d,onClick:g?()=>g(x):void 0}):null;return jsxRuntime.jsxs("div",{className:v,style:T,children:[jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("grid border-separate border-spacing-0",Ju[l],n==="auto"?"inline-grid w-auto":"w-full",$&&D.desktop),role:"table","aria-label":w,style:{gridTemplateColumns:N},children:[!h&&jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:e.map(x=>jsxRuntime.jsx(em,{column:x,sortConfig:P,onSort:C,stickyHeader:p,density:o},x.id))}),jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:d?Array.from({length:u}).map((x,E)=>jsxRuntime.jsx(nm,{columns:e,rowIndex:E,density:o},`loading-${E}`)):t.length>0?t.map((x,E)=>{let re=f?f(x):`row-${E}`;return jsxRuntime.jsx(om,{columns:e,row:x,rowIndex:E,density:o,onClick:g},re)}):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:D.mobile,children:d?Array.from({length:u}).map((x,E)=>jsxRuntime.jsx(ii,{density:o},`mobile-loading-${E}`)):t.length>0?t.map((x,E)=>{let re=f?f(x):`mobile-row-${E}`;return jsxRuntime.jsx("div",{children:O(x,E)},re)}):jsxRuntime.jsx("div",{className:"py-12 text-center text-text-muted",children:"No data available"})})]})}function di({label:e,description:t,errorMessage:r,showCalendar:o=false,...n}){let[a,i]=rt.useState(false),l=s=>{n.onChange&&s&&n.onChange(s),i(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...n,className:K(n.className,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(q,{children:e}),o?jsxRuntime.jsxs(yr,{className:"w-auto min-w-[208px]",children:[jsxRuntime.jsx(It,{className:"min-w-[150px] flex-1"}),jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:a,onOpenChange:i,children:[jsxRuntime.jsx(z,{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(wr,{value:n.value,onChange:l,minValue:n.minValue,maxValue:n.maxValue,isDisabled:n.isDisabled,isReadOnly:n.isReadOnly,isDateUnavailable:n.isDateUnavailable})})})]})]}):jsxRuntime.jsx(It,{}),t&&jsxRuntime.jsx(J,{children:t}),typeof r=="string"?jsxRuntime.jsx(U,{children:r}):null]})}function pm({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 It(e){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:t=>_t({...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:pm({isPlaceholder:t.isPlaceholder,isDisabled:!t.isEditable})})})}function Dt(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 Nm({selectionState:e,isDisabled:t}){let r=`${ae} 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"},n=t?"text-textFaint dark:text-zinc-600 forced-colors:text-textFaint font-light":"";return [r,o[e],n].filter(Boolean).join(" ")}function Or({errorMessage:e,...t}){return jsxRuntime.jsxs(reactAriaComponents.RangeCalendar,{...t,children:[jsxRuntime.jsx(Pr,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"w-full [&_td]:px-0",children:[jsxRuntime.jsx(kr,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:r=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:r,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:n,isSelectionStart:a,isSelectionEnd:i,isFocusVisible:l,isDisabled:s})=>jsxRuntime.jsx("span",{className:Nm({selectionState:n&&(a||i)?"cap":n?"middle":"none",isDisabled:s}),children:o})})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-red-600",children:e})]})}function pi({label:e,description:t,errorMessage:r,...o}){return jsxRuntime.jsxs(reactAriaComponents.DateRangePicker,{...o,className:K(o.className,"group flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(q,{children:e}),jsxRuntime.jsxs(yr,{className:"w-auto min-w-[208px]",children:[jsxRuntime.jsx(It,{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(It,{slot:"end",className:"flex-1 px-2 py-1.5 text-sm"}),jsxRuntime.jsx(z,{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 r=="string"?jsxRuntime.jsx(U,{children:r}):null,jsxRuntime.jsx(at,{children:jsxRuntime.jsx(Dt,{children:jsxRuntime.jsx(Or,{})})})]})}var Et=({title:e,onClose:t,hideCloseIcon:r=false,titleAlign:o="left",hasBackArrow:n=false,onBack:a,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:[n&&jsxRuntime.jsx(z,{variant:"unstyled",onPress:a,className:"absolute left-4",children:jsxRuntime.jsx(b,{name:"CaretLeft","data-testid":"back-arrow"})}),i||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(Re,{size:"xs",children:e}),t&&!r&&jsxRuntime.jsx(z,{variant:"unstyled",onPress:t,"aria-label":"Close dialog",children:jsxRuntime.jsx(b,{name:"X","data-testid":"close-button"})})]})]});var Bt=class extends rt.Component{constructor(){super(...arguments);Gt(this,"state",{hasError:false});Gt(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(r){return {hasError:true,error:r}}componentDidCatch(r,o){console.error("Error Boundary caught an error:",r,o);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(Me,{children:[this.props.title&&jsxRuntime.jsx(Me.Header,{title:this.props.title}),jsxRuntime.jsx(Me.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","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 rn=({children:e,title:t,headerContent:r,isOpen:o,slideInFrom:n="right",transparentOverlay:a=false,onClose:i,className:l,primaryAction:s,secondaryAction:c,footerContent:m,contentPadding:d=true,maxWidth:u="400px"})=>{let[p,g]=rt.useState(false);if(rt.useEffect(()=>{if(o){let y=setTimeout(()=>g(true),10);return ()=>clearTimeout(y)}else g(false);},[o]),!o)return null;let f=s||c,h=f||m;return jsxRuntime.jsx(Bt,{children:jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{isOpen:o,onOpenChange:i,isDismissable:true,className:`fixed inset-0 z-50 ${a?"bg-transparent":"bg-black/50"}`,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"flex justify-end",isDismissable:true,children:jsxRuntime.jsxs(Dt,{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 ${p?n==="right"?"animate-in slide-in-from-right":"animate-in slide-in-from-left":""} ${l||""}`,style:{[n==="right"?"right":"left"]:0,maxWidth:u,transform:p?void 0:n==="right"?"translateX(100%)":"translateX(-100%)"},children:[(t||r)&&jsxRuntime.jsx(Et,{title:t,headerContent:r,onClose:i||(()=>{})}),jsxRuntime.jsx("div",{className:`flex-1 overflow-y-auto overscroll-contain ${d?"p-6":"p-0"}`,children:e}),h&&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}),f&&jsxRuntime.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[c&&jsxRuntime.jsx(z,{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(z,{size:s.size||"lg",fullWidth:true,onPress:s.onPress,isLoading:s.isLoading,isDisabled:s.isDisabled,children:s.label})]})]})]})})})})};rn.displayName="Drawer";function xi({value:e,onChange:t,onUrlChange:r,accept:o="image/*",maxSize:n,isDisabled:a=false,onUpload:i,className:l,showPreview:s=true,placeholder:c="Drop files here or click to browse"}){let[m,d]=rt.useState(false),[u,p]=rt.useState(false),[g,f]=rt.useState(null),[h,y]=rt.useState(e),w=rt.useRef(null),P=async C=>{if(f(null),n&&C.size>n){f(`File size must be less than ${(n/1024/1024).toFixed(2)}MB`);return}if(s&&C.type.startsWith("image/")){let T=new FileReader;T.onloadend=()=>{y(T.result);},T.readAsDataURL(C);}if(i){p(true);try{let T=await i(C);y(T),r?.(T);}catch(T){f("Failed to upload file"),console.error("Upload error:",T);}finally{p(false);}}t?.(C,h);},L=C=>{let T=C.items;if(T.length>0){let v=T[0];if(v.kind==="file"){let D=v.getAsFile();D&&P(D);}}d(false);},N=()=>{y(void 0),f(null),t?.(null),r?.(""),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",a&&"pointer-events-none opacity-50",g&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:L,onDropEnter:()=>d(true),onDropExit:()=>d(false),children:[h?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[s&&h.startsWith("data:image")?jsxRuntime.jsx("img",{src:h,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"})]}),!a&&jsxRuntime.jsx(z,{variant:"icon",size:"sm",onPress:N,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:o==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${o}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:o.split(","),onSelect:C=>{let T=Array.from(C||[]);T.length>0&&P(T[0]);},children:jsxRuntime.jsx(z,{variant:"secondary",size:"sm",isDisabled:a,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 hi(e){return jsxRuntime.jsx(reactAriaComponents.Form,{...e,className:tailwindMerge.twMerge("flex flex-col gap-4",e.className)})}var Gm={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12",none:"grid-cols-none"},Om={sm:{1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12",none:"sm:grid-cols-none"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12",none:"md:grid-cols-none"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12",none:"lg:grid-cols-none"},xl:{1:"xl:grid-cols-1",2:"xl:grid-cols-2",3:"xl:grid-cols-3",4:"xl:grid-cols-4",5:"xl:grid-cols-5",6:"xl:grid-cols-6",7:"xl:grid-cols-7",8:"xl:grid-cols-8",9:"xl:grid-cols-9",10:"xl:grid-cols-10",11:"xl:grid-cols-11",12:"xl:grid-cols-12",none:"xl:grid-cols-none"},"2xl":{1:"2xl:grid-cols-1",2:"2xl:grid-cols-2",3:"2xl:grid-cols-3",4:"2xl:grid-cols-4",5:"2xl:grid-cols-5",6:"2xl:grid-cols-6",7:"2xl:grid-cols-7",8:"2xl:grid-cols-8",9:"2xl:grid-cols-9",10:"2xl:grid-cols-10",11:"2xl:grid-cols-11",12:"2xl:grid-cols-12",none:"2xl:grid-cols-none"}},Wm={none:"gap-0",xs:"gap-x-2 gap-y-1",sm:"gap-x-3 gap-y-2",md:"gap-x-4 gap-y-3",lg:"gap-x-6 gap-y-4",xl:"gap-x-8 gap-y-6","2xl":"gap-x-12 gap-y-8"},_m={none:"gap-x-0",xs:"gap-x-2",sm:"gap-x-3",md:"gap-x-4",lg:"gap-x-6",xl:"gap-x-8","2xl":"gap-x-12"},Km={none:"gap-y-0",xs:"gap-y-1",sm:"gap-y-2",md:"gap-y-3",lg:"gap-y-4",xl:"gap-y-6","2xl":"gap-y-8"},Um={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},jm={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},Zm={row:"grid-flow-row",col:"grid-flow-col",dense:"grid-flow-dense","row-dense":"grid-flow-row-dense","col-dense":"grid-flow-col-dense"},qm={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",full:"col-span-full",auto:"col-auto"},Ym={sm:{1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",full:"sm:col-span-full",auto:"sm:col-auto"},md:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",full:"md:col-span-full",auto:"md:col-auto"},lg:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",full:"lg:col-span-full",auto:"lg:col-auto"},xl:{1:"xl:col-span-1",2:"xl:col-span-2",3:"xl:col-span-3",4:"xl:col-span-4",5:"xl:col-span-5",6:"xl:col-span-6",7:"xl:col-span-7",8:"xl:col-span-8",9:"xl:col-span-9",10:"xl:col-span-10",11:"xl:col-span-11",12:"xl:col-span-12",full:"xl:col-span-full",auto:"xl:col-auto"},"2xl":{1:"2xl:col-span-1",2:"2xl:col-span-2",3:"2xl:col-span-3",4:"2xl:col-span-4",5:"2xl:col-span-5",6:"2xl:col-span-6",7:"2xl:col-span-7",8:"2xl:col-span-8",9:"2xl:col-span-9",10:"2xl:col-span-10",11:"2xl:col-span-11",12:"2xl:col-span-12",full:"2xl:col-span-full",auto:"2xl:col-auto"}};function vi(e,t,r){if(!e)return "";if(typeof e!="object")return t[e]||"";let o=[];return "base"in e&&e.base!==void 0&&o.push(t[e.base]),Object.entries(r).forEach(([n,a])=>{let i=e[n];i!==void 0&&o.push(a[i]);}),o.join(" ")}function on({cols:e=1,gap:t="md",gapX:r,gapY:o,align:n="stretch",justify:a="start",flow:i="row",autoFit:l,autoFill:s,className:c,children:m}){let d=tailwindMerge.twMerge("grid",l||s?"":vi(e,Gm,Om),!r&&!o&&Wm[t],r&&_m[r],o&&Km[o],Um[n],jm[a],Zm[i],c),u={};return l?u.gridTemplateColumns=`repeat(auto-fit, minmax(${l}, 1fr))`:s&&(u.gridTemplateColumns=`repeat(auto-fill, minmax(${s}, 1fr))`),jsxRuntime.jsx("div",{className:d,style:u,children:m})}function Ci({span:e,className:t,children:r}){let o=tailwindMerge.twMerge(vi(e,qm,Ym),t);return jsxRuntime.jsx("div",{className:o,children:r})}on.Item=Ci;function Xm(e,t,r){if(typeof e=="string")return e;let o={maximumFractionDigits:2,...r};e>=1e4&&!r?.notation&&(o.notation="compact");let n=new Intl.NumberFormat(void 0,o).format(e);return t==="%"?`${n}%`:t?`${n} ${t}`:n}function Jm(e,t="upIsGood"){if(e===0)return "text-text-muted";let r=e>0;return t==="upIsGood"?r?"text-feedback-success":"text-feedback-error":r?"text-feedback-error":"text-feedback-success"}function Qm({points:e,className:t,ariaLabel:r}){let i=e.map(p=>typeof p.y=="number"?p.y:0);if(i.length===0)return null;let l=Math.min(...i),c=Math.max(...i)-l,m=p=>c===0?20/2:18-(p-l)/c*16,d=60/Math.max(e.length-1,1),u=e.map((p,g)=>{let f=2+g*d,h=m(typeof p.y=="number"?p.y:0);return `${g===0?"M":"L"} ${f} ${h}`}).join(" ");return jsxRuntime.jsx("svg",{width:64,height:20,role:"img","aria-label":r,className:tailwindMerge.twMerge("overflow-visible",t),children:jsxRuntime.jsx("path",{d:u,fill:"none",strokeWidth:"1.5",className:"stroke-border-muted"})})}function Si({label:e,value:t,unit:r,format:o,delta:n,deltaPeriodLabel:a,deltaIntent:i="upIsGood",trend:l,status:s,helpText:c,size:m="md",orientation:d="vertical",loading:u,empty:p,error:g,onClick:f,className:h,renderValue:y,renderDelta:w,renderTrend:P}){let N={sm:{label:"text-xs",value:"text-base",delta:"text-xs",gap:"gap-1"},md:{label:"text-sm",value:"text-xl",delta:"text-sm",gap:"gap-2"},lg:{label:"text-base",value:"text-2xl",delta:"text-base",gap:"gap-3"}}[m],C=u?jsxRuntime.jsx(B,{className:"h-7 w-20"}):p?jsxRuntime.jsx("span",{className:"text-text-muted",children:"\u2014"}):g?jsxRuntime.jsx("span",{className:"text-feedback-error text-sm",children:typeof g=="string"?g:"Error"}):y?y(t):Xm(t,r,o),T=w?w(n):n!==void 0&&!u&&!p&&!g?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge(N.delta,Jm(n,i),"flex items-center gap-1"),children:[n>0&&jsxRuntime.jsx(b,{name:"ArrowUp",size:12}),n<0&&jsxRuntime.jsx(b,{name:"ArrowDown",size:12}),n===0&&jsxRuntime.jsx(b,{name:"Minus",size:12}),jsxRuntime.jsxs("span",{children:[n>0?"+":"",Math.abs(n).toFixed(1),r==="%"?"%":""]}),a&&jsxRuntime.jsxs("span",{className:"text-text-muted",children:["\xB7 ",a]})]}):u?jsxRuntime.jsx(B,{className:"h-4 w-24"}):null,v=P?P(l):l&&l.length>0&&!u&&!g?jsxRuntime.jsx(Qm,{points:l,ariaLabel:`${e} trend`,className:p?"opacity-30":""}):u?jsxRuntime.jsx(B,{className:"h-5 w-16"}):null;return jsxRuntime.jsxs("section",{className:tailwindMerge.twMerge("flex min-w-0",d==="horizontal"?`items-center ${N.gap}`:`flex-col ${N.gap}`,f&&"cursor-pointer hover:bg-background-muted rounded-lg px-3 py-2 -mx-3 -my-2 transition-colors",h),"aria-labelledby":`kpi-${e}`,onClick:f,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("h3",{id:`kpi-${e}`,className:tailwindMerge.twMerge(N.label,"font-medium text-text-caption truncate"),children:u?jsxRuntime.jsx(B,{className:"h-4 w-24"}):e}),c&&!u&&jsxRuntime.jsx(b,{name:"Question",size:12,className:"text-text-muted cursor-help","aria-label":"Help"})]}),jsxRuntime.jsxs("div",{className:"flex items-baseline gap-2",children:[jsxRuntime.jsx("output",{className:tailwindMerge.twMerge(N.value,"font-semibold",g?"text-feedback-error":"text-text-heading"),"aria-label":`Value: ${C}`,children:C}),s&&!u&&!g&&jsxRuntime.jsx(Nt,{variant:s.tone||"neutral",size:"sm",children:s.value})]}),(T||v)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[T,v]})]})}var ep={xs:"gap-2",sm:"gap-3",md:"gap-4",lg:"gap-6",xl:"gap-8"},tp={start:"items-start",center:"items-center",stretch:"items-stretch"};function rp(e){if(typeof e=="number")return `grid-cols-${e}`;let t=[];return e.base!==void 0&&t.push(`grid-cols-${e.base}`),e.sm!==void 0&&t.push(`sm:grid-cols-${e.sm}`),e.md!==void 0&&t.push(`md:grid-cols-${e.md}`),e.lg!==void 0&&t.push(`lg:grid-cols-${e.lg}`),e.xl!==void 0&&t.push(`xl:grid-cols-${e.xl}`),e["2xl"]!==void 0&&t.push(`2xl:grid-cols-${e["2xl"]}`),t.join(" ")}function an({children:e,cols:t={base:1,sm:2,md:3,lg:4},gap:r="md",align:o="stretch",equalizeHeights:n=true,header:a,loading:i,className:l}){let s=i?rt__namespace.default.Children.map(e,c=>rt__namespace.default.isValidElement(c)&&c.type&&typeof c.type!="string"&&"displayName"in c.type?rt__namespace.default.cloneElement(c,{loading:true}):c):e;return jsxRuntime.jsxs("section",{className:tailwindMerge.twMerge("w-full",l),"aria-label":"Key metrics",children:[a&&jsxRuntime.jsx("div",{className:"mb-4",children:a}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("grid",rp(t),ep[r],tp[o],n&&"auto-rows-fr","w-full"),children:s})]})}an.displayName="KpiGroup";function ap({children:e,...t}){return jsxRuntime.jsx(reactAriaComponents.ListBox,{...t,className:K(t.className,"outline-0"),children:e})}var Ti=({className:e,size:t=24,color:r="text-action-primary"})=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent",r,e),style:{width:t,height:t},role:"status","aria-label":"loading",children:jsxRuntime.jsx("span",{className:"sr-only",children:"Loading..."})});var or={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 Fi({width:e="100%",height:t="100%",initialViewState:r={longitude:-122.4194,latitude:37.7749,zoom:14},isLoading:o=false,theme:n="streets",mapboxAccessToken:a,showMarker:i=true,className:l}){let s={width:typeof e=="number"?`${e}px`:e,height:typeof t=="number"?`${t}px`:t};return o?jsxRuntime.jsx("div",{style:s,className:l,children:jsxRuntime.jsx(B,{width:s.width,height:s.height})}):a?jsxRuntime.jsx("div",{style:s,className:l,children:jsxRuntime.jsxs(lp__default.default,{mapboxAccessToken:a,initialViewState:r,style:s,mapStyle:or[n],scrollZoom:false,dragPan:false,dragRotate:false,doubleClickZoom:false,touchZoomRotate:false,attributionControl:false,interactive:false,children:[i&&jsxRuntime.jsx(lp.Marker,{longitude:r.longitude,latitude:r.latitude,anchor:"bottom",children:jsxRuntime.jsx(b,{name:"MapPin",size:36,className:"text-action-primary",weight:"fill"})}),jsxRuntime.jsx(lp.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(b,{name:"MapPin",size:48,className:"mx-auto mb-2 opacity-50"}),jsxRuntime.jsx("p",{className:"text-sm",children:"Map requires Mapbox token"})]})})}function xp(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 hp(e){if(e.length===0)return null;let t=e[0].latitude,r=e[0].latitude,o=e[0].longitude,n=e[0].longitude;return e.forEach(a=>{t=Math.min(t,a.latitude),r=Math.max(r,a.latitude),o=Math.min(o,a.longitude),n=Math.max(n,a.longitude);}),{longitude:(o+n)/2,latitude:(t+r)/2,zoom:10}}function Di({data:e,initialViewState:t,viewState:r,onViewStateChange:o,onPointClick:n,selectedPointId:a,scrollEnabled:i=true,className:l,theme:s="streets",mapboxAccessToken:c,enableClustering:m=true,renderMarker:d}){let u=rt.useRef(null),[p,g]=rt.useState(false),f=rt.useMemo(()=>t||hp(e)||{longitude:-122.4194,latitude:37.7749,zoom:10},[t,e]),h=rt.useCallback(C=>{o?.(C.viewState);let T=Math.abs(C.viewState.longitude-f.longitude)>.01||Math.abs(C.viewState.latitude-f.latitude)>.01||Math.abs(C.viewState.zoom-f.zoom)>.5;g(T);},[o,f]),y=rt.useCallback(()=>{u.current?.flyTo({center:[f.longitude,f.latitude],zoom:f.zoom,duration:1e3}),g(false);},[f]),w=rt.useCallback(C=>{let T=C.features?.[0];T&&T.properties?.id&&n?.(T.properties.id);},[n]),P=rt.useMemo(()=>xp(e),[e]),L=rt.useMemo(()=>a?e.find(C=>C.id===a):null,[a,e]),N=rt.useMemo(()=>{let C={id:"unclustered-points",type:"circle",source:"points",filter:m?["!",["has","point_count"]]:void 0,paint:{"circle-color":["case",["==",["get","id"],a||""],"#3B82F6","#10B981"],"circle-radius":["case",["==",["get","id"],a||""],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"}},C]:[C]},[a,m]);return c?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("relative h-full w-full",l),children:jsxRuntime.jsxs(lp__default.default,{ref:u,initialViewState:r||f,style:{width:"100%",height:"100%"},mapStyle:or[s],mapboxAccessToken:c,onMove:h,onClick:w,interactiveLayerIds:["unclustered-points","clusters"],scrollZoom:i,cursor:"pointer",children:[jsxRuntime.jsx(lp.NavigationControl,{position:"top-right"}),p&&jsxRuntime.jsx(z,{className:"absolute bottom-4 right-4 shadow-lg",onPress:y,variant:"secondary",size:"sm",children:"Reset View"}),P&&jsxRuntime.jsx(lp.Source,{id:"points",type:"geojson",data:P,cluster:m,clusterMaxZoom:14,clusterRadius:50,children:N.map(C=>jsxRuntime.jsx(lp.Layer,{...C},C.id))}),L&&!d&&jsxRuntime.jsx(lp.Marker,{longitude:L.longitude,latitude:L.latitude,children:jsxRuntime.jsx(b,{name:"MapPin",size:40,className:"text-action-primary relative -top-5",weight:"fill"})}),d&&e.map(C=>jsxRuntime.jsx(lp.Marker,{longitude:C.longitude,latitude:C.latitude,children:d(C,C.id===a)},C.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(b,{name:"MapPin",size:48,className:"mx-auto mb-2 opacity-50"}),jsxRuntime.jsx("p",{className:"text-sm",children:"Map requires Mapbox token"})]})})}var Cp={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 $i({label:e,size:t="md",variant:r="default",showWarningIndicator:o=true,warningThreshold:n=80,className:a,...i}){let l=Cp[t];return jsxRuntime.jsx(reactAriaComponents.Meter,{...i,className:K(a,"flex flex-col gap-1"),children:({percentage:s,valueText:c})=>{let m=o&&s>=n,d=r==="default"?Np(s):r;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]",Sp(d)),style:{width:`${Math.min(100,Math.max(0,s))}%`},role:"presentation","aria-hidden":"true"})})]})}})}function Np(e){return e<50?"success":e<70?"info":e<90?"warning":"error"}function Sp(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 Dp={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 Zr({id:e,message:t,variant:r="info",duration:o=5e3,dismissible:n=true,onDismiss:a,className:i}){let{container:l,icon:s}=Dp[r];return rt.useEffect(()=>{if(o>0){let c=setTimeout(()=>{a?.();},o);return ()=>clearTimeout(c)}},[o,a]),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}),n&&jsxRuntime.jsx("button",{onClick:a,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 Hp={"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 qr({notices:e,onDismiss:t,position:r="top-right",className:o}){let[n,a]=rt.useState(false);if(rt.useEffect(()=>{a(true);},[]),!n)return null;let i=jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("pointer-events-none fixed z-50 flex flex-col gap-2",Hp[r],o),"aria-live":"polite","aria-atomic":"true",children:jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"sync",children:e.map(l=>jsxRuntime.jsx(Zr,{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 Ei=rt.createContext(void 0);function Bi({children:e,position:t="top-right",maxNotices:r=5,defaultDuration:o=5e3,defaultDismissible:n=true}){let[a,i]=rt.useState([]),l=rt.useCallback((d,u)=>{let p=`notice-${Date.now()}-${Math.random()}`,g={id:p,message:d,variant:u?.variant||"info",duration:u?.duration??o,dismissible:u?.dismissible??n};return i(f=>{let h=[...f,g];return h.length>r?h.slice(-r):h}),p},[r,o,n]),s=rt.useCallback(d=>{i(u=>u.filter(p=>p.id!==d));},[]),c=rt.useCallback(()=>{i([]);},[]),m={notices:a,addNotice:l,removeNotice:s,clearNotices:c};return jsxRuntime.jsxs(Ei.Provider,{value:m,children:[e,jsxRuntime.jsx(qr,{notices:a,onDismiss:s,position:t})]})}function Ai(){let e=rt.useContext(Ei);if(!e)throw new Error("useNoticeContext must be used within a NoticeProvider");return e}function Vi(){let{addNotice:e,removeNotice:t,clearNotices:r}=Ai(),o=rt.useCallback((s,c)=>e(s,c),[e]),n=rt.useCallback((s,c)=>e(s,{...c,variant:"success"}),[e]),a=rt.useCallback((s,c)=>e(s,{...c,variant:"error"}),[e]),i=rt.useCallback((s,c)=>e(s,{...c,variant:"warning"}),[e]),l=rt.useCallback((s,c)=>e(s,{...c,variant:"info"}),[e]);return {show:o,success:n,error:a,warning:i,info:l,dismiss:t,clear:r}}var Xp=e=>tailwindMerge.twMerge(Ct({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 Hi({label:e,description:t,errorMessage:r,size:o,tooltip:n,isRequired:a,transparent:i,validationResult:l,...s}){let c=rt.useId();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...s,id:c,isRequired:a,className:K(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:!!r||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:o,tooltip:n,isRequired:a,htmlFor:c,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{className:Xp({isInvalid:d||!!r,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(b,{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(b,{name:"CaretDown",size:14})})]})]})}),t&&jsxRuntime.jsx(J,{size:o,className:"mt-3",children:t}),r&&jsxRuntime.jsx(U,{size:o,className:"mt-3",children:typeof r=="function"?r(l):r})]})})}function qe({children:e,maxWidth:t=1400,paddingXClass:r="px-4 md:px-6",paddingYClass:o="py-4 md:py-6",className:n}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(`w-full ${r} ${o}`,n),style:{marginInline:"auto",maxWidth:t},children:e})}function Oi({title:e,subtitle:t,breadcrumbs:r,breadcrumbsNode:o,meta:n,headingAs:a,className:i}){return jsxRuntime.jsxs("header",{className:tailwindMerge.twMerge("mb-4 md:mb-6",i),"aria-labelledby":"page-title",children:[o?jsxRuntime.jsx("div",{className:"mb-2",children:o}):r?.length?jsxRuntime.jsx("div",{className:"mb-2",children:jsxRuntime.jsx(Nr,{children:r.map((l,s)=>jsxRuntime.jsx(Sr,{...l.href?{href:l.href}:{},children:l.label},`${l.label}-${s}`))})}):null,jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("div",{id:"page-title",children:jsxRuntime.jsx(Re,{tag:a||"h1",size:"xl",children:e})}),t?jsxRuntime.jsx("p",{className:"mt-1 text-text-muted",children:t}):null]}),n?jsxRuntime.jsx("div",{className:"shrink-0",children:n}):null]})]})}function Wi({primary:e,secondary:t,children:r,align:o="end",className:n}){return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge(`mb-3 md:mb-4 flex items-center gap-2 ${o==="end"?"justify-end":"justify-start"}`,n),children:[r,jsxRuntime.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[t,e]})]})}function _i({children:e,className:t,ariaLabel:r="Filters"}){return jsxRuntime.jsx("section",{"aria-label":r,className:tailwindMerge.twMerge("mb-4 md:mb-6 flex flex-wrap items-center gap-2",t),children:e})}function Ki({tabs:e,value:t,defaultValue:r,onChange:o,className:n}){let[a,i]=rt__namespace.useState(r||e[0]?.id),l=t??a,s=m=>{e.find(d=>d.id===m)?.disabled||(t===void 0&&i(m),o?.(m));},c=m=>{let d=e.findIndex(u=>u.id===l);if(!(d<0)){if(m.key==="ArrowRight"||m.key==="ArrowDown"){m.preventDefault();for(let u=1;u<=e.length;u++){let p=e[(d+u)%e.length];if(!p.disabled)return s(p.id)}}if(m.key==="ArrowLeft"||m.key==="ArrowUp"){m.preventDefault();for(let u=1;u<=e.length;u++){let p=e[(d-u+e.length)%e.length];if(!p.disabled)return s(p.id)}}}};return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("mb-3 md:mb-4",n),children:jsxRuntime.jsx("div",{role:"tablist","aria-label":"Page sections",className:"flex flex-wrap items-center gap-1",onKeyDown:c,children:e.map(m=>jsxRuntime.jsx("button",{type:"button",role:"tab","aria-selected":l===m.id,"aria-controls":`panel-${m.id}`,disabled:m.disabled,onClick:()=>s(m.id),className:tailwindMerge.twMerge("rounded-md px-3 py-1.5 text-sm transition-colors",l===m.id?"bg-background-surface text-text-heading font-medium":"text-text-body hover:bg-background-muted",m.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"),children:m.label},m.id))})})}function Ui({children:e,className:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full",t),children:e})}function ji({children:e,sticky:t=true,className:r}){return jsxRuntime.jsx("aside",{className:tailwindMerge.twMerge(t?"lg:sticky lg:top-20":"",r),children:e})}qe.Header=Oi;qe.Actions=Wi;qe.Filters=_i;qe.Tabs=Ki;qe.Content=Ui;qe.Aside=ji;function Jp(e){return typeof e=="object"&&e!==null&&"features"in e&&Array.isArray(e.features)&&"type"in e&&typeof e.type=="string"}var Qp=process.env.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN||"";function Yi({label:e="Search for a place",selectedKey:t,defaultSelectedKey:r,onSelectionChange:o,placeholder:n="Enter a location...",errorMessage:a,description:i,size:l="md",tooltip:s,isRequired:c,isDisabled:m,showErrors:d=true,autoFocus:u=false,onSelect:p,searchTypes:g=["place","address"],defaultFilter:f,validationResult:h,countryRestrictions:y,proximity:w="ip"}){let P=rt.useRef(new WeakMap),L=rt.useRef([]),N={requestType:"REST",method:"GET",url:"https://api.mapbox.com/geocoding/v5/mapbox.places/{q}.json",extraParams:{access_token:Qp,types:g.join(","),limit:"5",...y?.length?{country:y.join(",").toLowerCase()}:{},...w?{proximity:w==="ip"?"ip":w.join(",")}:{}},shouldLoad:v=>v.length>0,transformResponse:v=>{if(!Jp(v))return [];let D=v.features.map($=>{let O={id:$.id,name:$.place_name};return P.current.set(O,{type:$.place_type[0],center:$.center}),O});return D.length>0&&(L.current=D),D}},C=v=>{let D=P.current.get(v),$=v.name.split(", "),O=$[0],x=$.slice(1).join(", ");return jsxRuntime.jsxs("div",{className:"flex items-center gap-3 py-0.5",children:[jsxRuntime.jsx(b,{name:D?.type==="address"?"MapPin":D?.type==="place"?"Buildings":D?.type==="region"?"MapPinArea":D?.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}),x&&jsxRuntime.jsx("span",{className:"truncate text-sm text-text-muted",children:x})]})]})},T=v=>v?jsxRuntime.jsx(b,{name:"CircleNotch",className:"h-4 w-4 animate-spin text-text-muted"}):jsxRuntime.jsx(b,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-muted"});return jsxRuntime.jsx(vr,{"data-testid":"autocomplete","data-config":JSON.stringify({types:g.join(","),country:y?.join(",").toLowerCase(),proximity:w==="ip"?"ip":w?.join(",")}),label:e,selectedKey:t,defaultSelectedKey:r,onSelectionChange:v=>{if(o?.(v),v){let $=L.current.find(O=>O.id===v);if($){let O=P.current.get($);O&&p({id:$.id,place_name:$.name,place_type:[O.type],center:O.center});}}},requestConfig:N,placeholder:n,errorMessage:a,description:i,size:l,tooltip:s,isRequired:c,isDisabled:m,showErrors:d,autoFocus:u,renderItem:C,renderLeftIcon:T,defaultFilter:f,validationResult:h})}function Ji({label:e,rightLabel:t,progressWidth:r=64,hideLabels:o=false,...n}){return jsxRuntime.jsx(reactAriaComponents.ProgressBar,{...n,className:K(n.className,"flex flex-col gap-1"),children:({percentage:a,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:t||i})]}),jsxRuntime.jsx("div",{className:`relative h-2 w-${r} 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:a)+"%"}})})]})})}function Qi(e){return jsxRuntime.jsxs(reactAriaComponents.RadioGroup,{...e,className:K(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(U,{children:typeof e.errorMessage=="function"&&e.validationResult?e.errorMessage(e.validationResult):typeof e.errorMessage=="string"?e.errorMessage:null})]})}function nf({isSelected:e,isInvalid:t,isDisabled:r}){let o=[ae(),"w-5 h-5 rounded-full border-2 bg-background-surface transition-all"];return r?o.push("border-border-muted forced-colors:!border-[GrayText]"):t?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 es(e){return jsxRuntime.jsx(reactAriaComponents.Radio,{...e,className:K(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:nf(t)}),e.children]})})}var df=e=>{let t=Be({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),r=[e.showSearchIcon?"pl-8":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(t,r,e.className)};function Yr({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,transparent:i,showSearchIcon:l,isClearable:s,onClear:c,type:m,validationResult:d,...u}){let[p,g]=rt__namespace.default.useState(false),{isFocused:f,handleFocus:h,handleBlur:y}=Oe(),w=m==="password";return jsxRuntime.jsx(reactAriaComponents.TextField,{...u,isRequired:a,className:K(u.className,"group flex flex-col"),children:({isDisabled:P,isInvalid:L})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsxs(We,{children:[l&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 transform",children:jsxRuntime.jsx(b,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-muted"})}),jsxRuntime.jsx(xa,{size:o,disabled:P,type:w?p?"text":"password":m,value:u.value,defaultValue:u.defaultValue,placeholder:u.placeholder,onFocus:N=>h(N,u.onFocus),onBlur:N=>y(N,u.onBlur),onChange:N=>u.onChange?.(N.target.value),className:df({isInvalid:L,isDisabled:P,isFocused:f,size:o,transparent:i,showSearchIcon:l,isClearable:s,hasValue:!!u.value,isPassword:w,className:typeof u.className=="string"?u.className:void 0})}),s&&u.value&&!P&&jsxRuntime.jsx(ba,{onClick:()=>{c?c():u.onChange&&u.onChange("");},size:o}),w&&!P&&jsxRuntime.jsx("button",{type:"button",onClick:()=>g(!p),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-muted hover:text-text-body","aria-label":p?"Hide password":"Show password",onMouseDown:N=>{N.preventDefault(),N.stopPropagation();},children:jsxRuntime.jsx(b,{name:p?"EyeSlash":"Eye",size:o==="sm"?16:20,className:"text-text-body"})})]}),t&&jsxRuntime.jsx(J,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsxRuntime.jsx(U,{size:o,className:"mt-1",children:r}),typeof r=="function"&&d&&jsxRuntime.jsx(U,{size:o,className:"mt-1",children:r(d)})]})})}var gt=({isActive:e=false,onPress:t,children:r})=>jsxRuntime.jsx(z,{variant:e?"secondary":"ghost",size:"sm",onPress:t,className:"p-1",children:r});function yf({initialUrl:e,isOpen:t,onClose:r,onSubmit:o}){let[n,a]=rt.useState(e);return rt__namespace.default.useEffect(()=>{a(e);},[e]),jsxRuntime.jsx(reactAriaComponents.Modal,{isDismissable:true,isOpen:t,onOpenChange:l=>!l&&r(),children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"relative",children:jsxRuntime.jsxs("form",{onSubmit:l=>{l.preventDefault(),o(n),r();},children:[jsxRuntime.jsx(Et,{title:"Insert Link",onClose:r}),jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(Yr,{label:"URL",type:"url",value:n,onChange:a,autoFocus:true,className:"w-full"})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 border-t border-border-muted p-4",children:[jsxRuntime.jsx(z,{variant:"secondary",onPress:r,children:"Cancel"}),jsxRuntime.jsx(z,{type:"submit",children:"Save"})]})]})})})}function ns({initialContent:e="",onChange:t,className:r,isDisabled:o=false,placeholder:n="Start typing..."}){let[a,i]=rt.useState(false),l=react.useEditor({extensions:[gf__default.default.configure({heading:{levels:[1,2]}}),uf__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})=>{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",o&&"opacity-50",r),children:[l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(menus.BubbleMenu,{editor:l,shouldShow:({editor:m})=>m.isActive("link")&&!a,className:"flex items-center gap-1 rounded-md border border-border-input bg-background-surface p-1 shadow-md",children:[jsxRuntime.jsxs(z,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>{let m=l.getAttributes("link").href;window.open(m,"_blank");},children:[jsxRuntime.jsx(b,{name:"ArrowSquareOut",className:"mr-1 h-4 w-4"}),"Open"]}),jsxRuntime.jsxs(z,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:s,children:[jsxRuntime.jsx(b,{name:"PencilSimple",className:"mr-1 h-4 w-4"}),"Edit"]}),jsxRuntime.jsxs(z,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>l.chain().focus().unsetLink().run(),children:[jsxRuntime.jsx(b,{name:"X",className:"mr-1 h-4 w-4"}),"Remove"]})]}),jsxRuntime.jsx(yf,{isOpen:a,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(gt,{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(gt,{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(gt,{isActive:l.isActive("bold"),onPress:()=>l.chain().focus().toggleBold().run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"B"})}),jsxRuntime.jsx(gt,{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(gt,{isActive:l.isActive("bulletList"),onPress:()=>l.chain().focus().toggleBulletList().run(),children:jsxRuntime.jsx(b,{name:"ListBullets",className:"h-4 w-4"})}),jsxRuntime.jsx(gt,{isActive:l.isActive("orderedList"),onPress:()=>l.chain().focus().toggleOrderedList().run(),children:jsxRuntime.jsx(b,{name:"ListNumbers",className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(gt,{isActive:l.isActive("link"),onPress:s,children:jsxRuntime.jsx(b,{name:"PaperclipHorizontal",className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:"relative min-h-[200px] w-full",children:[jsxRuntime.jsx(react.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:n})]})]}):null}var Nf={plain:"",contained:"bg-background-surface rounded-lg border border-border-default p-6",bordered:"border-y border-border-default py-6"},Sf={none:"",sm:"my-4",md:"my-6 md:my-8",lg:"my-8 md:my-12"};function is({title:e,description:t,actions:r,variant:o="plain",spacing:n="md",withDivider:a=false,headingAs:i="h2",className:l,children:s}){let c=rt__namespace.default.useId(),m=e||t||r;return jsxRuntime.jsxs("section",{className:tailwindMerge.twMerge(Sf[n],Nf[o],l),"aria-labelledby":e?c:void 0,children:[m&&jsxRuntime.jsxs("header",{id:c,className:tailwindMerge.twMerge("flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",a&&"border-b border-border-default pb-4 mb-6",!a&&s&&"mb-4"),children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx(Re,{tag:i,size:"md",className:"text-text-heading",children:e}),t&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-text-muted",children:t})]}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r})]}),s&&jsxRuntime.jsx("div",{className:"",children:s})]})}var Pf={sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base",xl:"h-14 text-lg"},kf={sm:14,md:16,lg:18,xl:20},Tf=({isSelected:e,isFirst:t,isLast:r,isDisabled:o})=>tailwindMerge.twMerge(ae(),"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",!r&&"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 cs({options:e,value:t,onChange:r,size:o="md",className:n,isDisabled:a,"aria-label":i}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-flex overflow-hidden rounded-md border-2 border-border-muted",Pf[o],n),role:"group","aria-label":i,children:e.map((l,s)=>jsxRuntime.jsxs(reactAriaComponents.ToggleButton,{isSelected:t===l.id,onChange:()=>r(l.id),className:Tf({isSelected:t===l.id,isFirst:s===0,isLast:s===e.length-1,isDisabled:a}),isDisabled:a,"aria-label":l.label,children:[l.icon&&jsxRuntime.jsx(b,{name:l.icon,size:kf[o]}),l.label]},l.id))})}function If(e="md"){return `flex-1 text-start data-[placeholder]:text-text-placeholder ${W[e].text}`}function Df(){let e=rt__namespace.default.useCallback((r,o)=>{o?.(r);},[]),t=rt__namespace.default.useCallback((r,o)=>{o?.(r);},[]);return {handleFocus:e,handleBlur:t}}function gs({label:e,description:t,errorMessage:r,children:o,items:n,renderItem:a,size:i="md",selectedKey:l,defaultSelectedKey:s,onSelectionChange:c,placeholder:m,showErrors:d=false,tooltip:u,isRequired:p,transparent:g,...f}){let[h,y]=rt.useState(null),[w,P]=rt.useState(null),L=l??h??s,{handleFocus:N,handleBlur:C}=Df(),T=$=>{c&&$!==null&&c($),c||y($);},v=rt.useRef(null),D=rt.useRef(null);return jsxRuntime.jsx(reactAriaComponents.Select,{...f,selectedKey:L,defaultSelectedKey:s,onSelectionChange:T,placeholder:m,className:K(f.className,"group flex w-full flex-col"),ref:v,onOpenChange:$=>{$&&D.current?P(D.current.offsetWidth):$||v.current?.blur();},children:({isDisabled:$,isInvalid:O,isOpen:x})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:i,tooltip:u,isRequired:p,children:e}),jsxRuntime.jsx(We,{children:jsxRuntime.jsx("div",{ref:D,children:jsxRuntime.jsxs(z,{variant:"unstyled",className:tailwindMerge.twMerge(Be({isInvalid:O||d&&!!r,isDisabled:$,isFocused:x,transparent:g,size:i}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:E=>N(E,f.onFocus),onBlur:E=>C(E,f.onBlur),"data-open":x,children:[jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:If(i)}),jsxRuntime.jsx(b,{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",x&&"rotate-180")})]})})}),t&&jsxRuntime.jsx(J,{size:i,className:"mt-3",children:t}),d&&jsxRuntime.jsx(U,{size:i,className:"mt-3 text-feedback-error-text",children:typeof r=="function"&&f.validationResult?r(f.validationResult):typeof r=="string"?r:null}),jsxRuntime.jsx(at,{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:n,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:a&&n?E=>jsxRuntime.jsx(nt,{id:E.id,textValue:E.label,size:i,children:a(E)},E.id):o})})]})})}function bs({label:e,description:t,tooltip:r,errorMessage:o,size:n="md",className:a,value:i,defaultValue:l=0,onChange:s,min:c=0,max:m=100,step:d=1,disabled:u,showValue:p=true}){let g=typeof i=="number",[f,h]=rt__namespace.default.useState(l),y=g?i:f,w=Math.min(Math.max(y,c),m),P=Math.max(m-c,1e-5),L=(w-c)/P*100;return jsxRuntime.jsxs("div",{className:K(a,"group flex w-full flex-col gap-1"),children:[e&&jsxRuntime.jsx(q,{size:n,tooltip:r,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:`${L}%`},"aria-hidden":true}),jsxRuntime.jsx("input",{type:"range",min:c,max:m,step:d,value:y,disabled:u,"aria-invalid":!!o,onChange:N=>{let C=Number(N.currentTarget.value);g||h(C),s?.(C);},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)})]}),p&&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}),o&&jsxRuntime.jsx(U,{className:"mt-1",children:o})]})}var Vf=rt__namespace.default.createContext({orientation:"horizontal",isResizing:false});function Jr({defaultSize:e=.7,minSize:t=240,maxSize:r=600,orientation:o="horizontal",resizable:n=true,onResize:a,className:i,children:l}){let s=rt.useRef(null),[c,m]=rt.useState(false),[d,u]=rt.useState(e>1?.7:e),p=rt.useCallback(P=>{if(!s.current||!c)return;let L=s.current.getBoundingClientRect(),N=o==="horizontal"?L.width:L.height,C=o==="horizontal"?L.left:L.top,v=(o==="horizontal"?P.clientX:P.clientY)-C,D=N-v;if(D<t||D>r)return;let $=v/N;u($),a?.($);},[c,o,t,r,a]),g=rt.useCallback(()=>{m(false);},[]),f=rt.useCallback(P=>{P.preventDefault(),P.stopPropagation(),m(true);},[]);rt.useEffect(()=>{if(c)return document.addEventListener("mousemove",p),document.addEventListener("mouseup",g),document.body.style.cursor=o==="horizontal"?"col-resize":"row-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",g),document.body.style.cursor="",document.body.style.userSelect="";}},[c,p,g,o]);let h=rt__namespace.default.Children.toArray(l).find(P=>rt__namespace.default.isValidElement(P)&&P.type===ys),y=rt__namespace.default.Children.toArray(l).find(P=>rt__namespace.default.isValidElement(P)&&P.type===vs),w=`${d*100}%`;return jsxRuntime.jsx(Vf.Provider,{value:{orientation:o,isResizing:c},children:jsxRuntime.jsxs("div",{ref:s,className:tailwindMerge.twMerge("flex w-full h-full",o==="horizontal"?"flex-row":"flex-col",i),children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-auto",o==="horizontal"?"h-full":"w-full"),style:{[o==="horizontal"?"width":"height"]:w},children:h}),n&&jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative group",o==="horizontal"?"w-2 -mx-1 cursor-col-resize":"h-2 -my-1 cursor-row-resize"),onMouseDown:f,role:"separator","aria-orientation":o,"aria-label":"Resize divider",tabIndex:0,onKeyDown:P=>{if(o==="horizontal"){if(P.key==="ArrowLeft"&&d>.3){let N=Math.max(.3,d-.01);u(N),a?.(N);}else if(P.key==="ArrowRight"&&d<.8){let N=Math.min(.8,d+.01);u(N),a?.(N);}}},children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute bg-border-default transition-all",o==="horizontal"?"left-1/2 -translate-x-1/2 w-px h-full group-hover:w-1":"top-1/2 -translate-y-1/2 h-px w-full group-hover:h-1","group-hover:bg-action-primary/50",c&&"bg-action-primary",c&&(o==="horizontal"?"w-1":"h-1"))}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("absolute",o==="horizontal"?"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-1 h-8":"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-8 h-1","bg-border-muted rounded-full opacity-0 group-hover:opacity-100 transition-opacity")})]}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-auto flex-1",o==="horizontal"?"h-full":"w-full"),children:y})]})})}function ys({className:e,children:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full h-full",e),children:t})}function vs({className:e,children:t}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full h-full",e),children:t})}Jr.Main=ys;Jr.Aside=vs;function Hf(e,t,r){if(e==null)return jsxRuntime.jsx("span",{className:"text-text-muted",children:"\u2014"});if(typeof t=="function")return t(e);if(t&&typeof t=="object")switch(t.type){case "number":{if(typeof e=="number"){let n=new Intl.NumberFormat(void 0,{maximumFractionDigits:2,...t.options}).format(e),a=t.unit||r;return a?`${n} ${a}`:n}break}case "date":{if(e instanceof Date)return jsxRuntime.jsx("time",{dateTime:e.toISOString(),title:e.toISOString(),children:new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short",...t.options}).format(e)});break}case "duration":{if(typeof e=="number"){let a=(t.base||"seconds")==="ms"?Math.floor(e/1e3):e,i=Math.floor(a/3600),l=Math.floor(a%3600/60),s=a%60,c=[];return i>0&&c.push(`${i}h`),l>0&&c.push(`${l}m`),(s>0||c.length===0)&&c.push(`${s}s`),c.join(" ")}break}case "bool":{if(typeof e=="boolean")return e?t.trueLabel||"Yes":t.falseLabel||"No";break}case "string":{if(typeof e=="string")switch(t.transform){case "uppercase":return e.toUpperCase();case "lowercase":return e.toLowerCase();case "capitalize":return e.charAt(0).toUpperCase()+e.slice(1);default:return e}break}}if(typeof e=="number"){let n=new Intl.NumberFormat(void 0,{maximumFractionDigits:2}).format(e);return r?`${n} ${r}`:n}if(e instanceof Date)return jsxRuntime.jsx("time",{dateTime:e.toISOString(),title:e.toISOString(),children:new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(e)});if(typeof e=="boolean")return e?"Yes":"No";let o=String(e);return r?`${o} ${r}`:o}function Gf(e){if(e.thresholds&&e.value!==null&&e.value!==void 0){for(let t of e.thresholds)if(t.when(e.value))return t.tone}return e.tone}var Of={neutral:"text-text-body",success:"text-feedback-success",warning:"text-feedback-warning",error:"text-feedback-error",info:"text-feedback-info"};function Wf({item:e,dense:t,valueAlign:r,onCopy:o}){let n=Gf(e),a=n?Of[n]:"",i=()=>{if(!e.copyable||!o)return;let c=typeof e.copyable=="function"?e.copyable(e.value):String(e.value);navigator.clipboard.writeText(c),o(c,e.id);},l=jsxRuntime.jsxs("dd",{className:tailwindMerge.twMerge(t?"text-sm":"text-base","font-medium",r==="start"?"text-left":"text-right",a,e.disabled&&"opacity-50"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[r==="start"&&e.copyable&&jsxRuntime.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-background-muted transition-colors","aria-label":`Copy ${e.label}`,children:jsxRuntime.jsx(b,{name:"Copy",size:12})}),jsxRuntime.jsx("span",{className:e.href?"hover:underline cursor-pointer":"",children:Hf(e.value,e.formatter,e.unit)}),e.iconRight,r==="end"&&e.copyable&&jsxRuntime.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-background-muted transition-colors","aria-label":`Copy ${e.label}`,children:jsxRuntime.jsx(b,{name:"Copy",size:12})})]}),e.meta&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-xs text-text-muted mt-0.5",r==="start"?"text-left":"text-right"),children:e.meta})]}),s=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("dt",{className:tailwindMerge.twMerge(t?"text-xs":"text-sm","text-text-caption truncate","flex items-center gap-1",e.disabled&&"opacity-50"),children:[e.iconLeft,jsxRuntime.jsx("span",{title:typeof e.label=="string"?e.label:void 0,children:e.label}),e.tooltip&&jsxRuntime.jsx(b,{name:"Question",size:10,className:"text-text-muted","aria-label":"More information"})]}),e.href?jsxRuntime.jsx("a",{href:e.href,onClick:e.onAction,className:"block",children:l}):l]});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("grid grid-cols-[1fr_auto] items-start",t?"gap-x-2":"gap-x-4"),children:s})}function Cs({items:e,layout:t="one-column",dense:r=false,valueAlign:o="end",showDividers:n=false,skeleton:a=false,empty:i=false,error:l,className:s,onCopy:c}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("grid",t==="two-column"?"md:grid-cols-2 gap-x-6":"grid-cols-1",r?"gap-y-1":"gap-y-2",s),children:(e.length>0?e:Array(4).fill(null)).map((m,d)=>jsxRuntime.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-start gap-x-4",children:[jsxRuntime.jsx(B,{className:"h-4 w-24"}),jsxRuntime.jsx(B,{className:"h-5 w-16"})]},d))}):l?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-sm text-feedback-error",s),children:l}):i||e.length===0?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-sm text-text-muted",s),children:"No data available"}):jsxRuntime.jsx("dl",{className:tailwindMerge.twMerge("grid",t==="two-column"?"md:grid-cols-2 gap-x-6":"grid-cols-1",r?"gap-y-1":"gap-y-2",s),children:e.map((m,d)=>jsxRuntime.jsxs(rt__namespace.default.Fragment,{children:[n&&d>0&&t==="one-column"&&jsxRuntime.jsx("div",{className:"col-span-full border-t border-border-default -mt-1 mb-1"}),jsxRuntime.jsx(Wf,{item:m,dense:r,valueAlign:o,onCopy:c})]},m.id))})}function Uf({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",ae,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 jf({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 Ns({children:e,...t}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...t,className:K(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:r=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:Uf(r),children:jsxRuntime.jsx("span",{className:jf(r)})}),e]})})}function eg({orientation:e,className:t=""}){return `flex flex-col w-full ${{horizontal:"",vertical:"flex-row"}[e]||""} ${t}`.trim()}function Ss(e){return jsxRuntime.jsx("div",{className:"w-full",children:jsxRuntime.jsx(reactAriaComponents.Tabs,{...e,className:reactAriaComponents.composeRenderProps(e.className,(t,r)=>eg({...r,className:t}))})})}function tg({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 ws(e){return jsxRuntime.jsx(reactAriaComponents.TabList,{...e,className:reactAriaComponents.composeRenderProps(e.className,(t,r)=>tg({...r,className:t||""}))})}function rg({isSelected:e,isDisabled:t,className:r=""}){let o="flex items-center cursor-default px-1 py-2 font-medium transition hover:cursor-pointer relative",n=ae(),a="";return t?a="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?a="text-action-primary border-b-2 border-action-primary z-10 forced-colors:bg-[Highlight]":a="text-text-muted hover:text-text-body",`${o} ${n} ${a} ${r}`.trim()}function Ps(e){return jsxRuntime.jsx(reactAriaComponents.Tab,{...e,"data-testid":e.id?`tab-${e.id}`:void 0,className:reactAriaComponents.composeRenderProps(e.className,(t,r)=>rg({...r,className:t,isSelected:r.isSelected}))})}function og({className:e=""}){let t="block w-full mt-4 text-text-body",r=ae();return `${t} ${r} ${e}`.trim()}function ks(e){return jsxRuntime.jsx(reactAriaComponents.TabPanel,{...e,className:reactAriaComponents.composeRenderProps(e.className,(t,r)=>og({...r,className:t||""}))})}var ag=e=>{let t=Be({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),r=`min-h-[100px] py-2 ${e.isDisabled?"resize-none":"resize-y"}`;return tailwindMerge.twMerge(t,r,e.className)};function Ts({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,required:a,transparent:i,isInvalid:l,isDisabled:s,className:c,validationResult:m,...d}){let{isFocused:u,handleFocus:p,handleBlur:g}=Oe();return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(We,{children:jsxRuntime.jsx("textarea",{...d,required:a,onFocus:f=>{d.onFocus&&d.onFocus(f),p(f);},onBlur:f=>{d.onBlur&&d.onBlur(f),g(f);},className:ag({isInvalid:l,isDisabled:s,isFocused:u,size:o,transparent:i,className:c}),disabled:s})}),t&&jsxRuntime.jsx(J,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsxRuntime.jsx(U,{size:o,className:"mt-1",children:r}),typeof r=="function"&&m&&jsxRuntime.jsx(U,{size:o,className:"mt-1",children:r(m)})]})})}function Ls({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,required:a,transparent:i,isInvalid:l,isDisabled:s,className:c,validationResult:m,value:d="",onChange:u,chips:p=[],onChipsChange:g,triggerPattern:f="{{",onTriggerDetected:h,onTriggerDismissed:y,renderChip:w,chipVariant:P="primary",chipSize:L,...N}){let C=rt.useRef(null),{isFocused:T,handleFocus:v,handleBlur:D}=Oe(),$=L||"sm",O=rt.useRef(null),x=rt.useCallback(F=>{let V="",Z=R=>{if(R.nodeType===Node.TEXT_NODE){if(!R.parentElement?.closest("[data-chip-id]")){let M=R.textContent||"";V+=M;}}else if(R.nodeType===Node.ELEMENT_NODE){let k=R;if(k.hasAttribute("data-chip-id")){let M=k.getAttribute("data-chip-id");V+=`{{${M}}}`;return}else if(k.tagName==="BR"){V+=`
66
+ `;return}else k.tagName;}for(let k=0;k<R.childNodes.length;k++)Z(R.childNodes[k]);};return Z(F),V},[]),E=rt.useCallback((F,V)=>{let Z=document.createTreeWalker(F,NodeFilter.SHOW_TEXT,{acceptNode:H=>{let ie=H.parentElement;return ie&&ie.closest("[data-chip-id]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),R=Z.nextNode(),k=Math.max(0,V);for(;R;){let H=R.nodeValue||"";if(H.length>=k){let ie=document.createRange();ie.setStart(R,k),ie.collapse(true);let Je=window.getSelection();Je?.removeAllRanges(),Je?.addRange(ie);return}k-=H.length,R=Z.nextNode();}let M=window.getSelection(),I=document.createRange();I.selectNodeContents(F),I.collapse(false),M?.removeAllRanges(),M?.addRange(I);},[]);rt.useEffect(()=>{C.current&&!d&&C.current.textContent!==""&&(C.current.textContent="");},[d]),rt.useLayoutEffect(()=>{if(C.current){if(d===""){if(T)try{C.current.focus({preventScroll:!0}),E(C.current,0);}catch{}return}if(O.current!=null)try{E(C.current,O.current);}finally{O.current=null;}}},[d,E,T]);let re=rt.useCallback((F,V)=>{if(u?.(F),F===""){y?.();return}if(f&&h&&V!==void 0){let Z=F.slice(0,V),R=typeof f=="string"?new RegExp(`\\${f}([^\\s]*)$`):f,k=Z.match(R);if(k){let M=k[1]||"",I=V-k[0].length;h({query:M,position:V,startIndex:I});}else y?.();}},[u,f,h,y]),j=rt.useCallback(F=>{if(!g||!u)return;let V=p.filter(R=>R.id!==F);g(V);let Z=d.replace(new RegExp(`\\{\\{${F}\\}\\}`,"g"),"");u(Z);},[p,g,d,u]),de=rt.useCallback(F=>w?w(F,()=>j(F.id)):jsxRuntime.jsx(Tr,{variant:P,size:$,onRemove:s?void 0:()=>j(F.id),isDisabled:s,className:"py-0.5 px-1.5 gap-1 text-xs leading-none rounded-md",children:F.label},F.id),[w,P,$,j,s]),he=()=>{let F=Be({isInvalid:l,isDisabled:s,isFocused:T,transparent:i,size:o}),V=`min-h-[100px] py-2 px-3 ${s?"resize-none":"resize-y"}`,Z=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(F,V,Z,c)},ze=()=>d?d.split(/(\{\{[^}]+\}\})/g).map((V,Z)=>{let R=V.match(/\{\{([^}]+)\}\}/);if(R){let k=R[1],M=p.find(I=>I.id===k);if(M)return jsxRuntime.jsx("span",{className:"inline-block align-baseline cursor-pointer",contentEditable:false,suppressContentEditableWarning:true,"data-chip-id":k,style:{userSelect:"none",verticalAlign:"baseline",lineHeight:"1"},onClick:I=>{I.preventDefault();let H=window.getSelection(),ie=document.createRange();ie.selectNode(I.currentTarget),H?.removeAllRanges(),H?.addRange(ie);},children:de(M)},`chip-${k}-${Z}`)}return V.includes(`
67
+ `)?V.split(`
68
+ `).map((k,M)=>jsxRuntime.jsxs(rt__namespace.default.Fragment,{children:[k,M<V.split(`
69
+ `).length-1&&jsxRuntime.jsx("br",{})]},`line-${Z}-${M}`)):V}):null;return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(q,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(We,{children:jsxRuntime.jsx("div",{ref:C,contentEditable:!s,suppressContentEditableWarning:true,onInput:F=>{if(s)return;let V=F.target,Z=V.querySelector("[data-chip-id]")!==null,R;if(Z?(R=x(V),R=R.replace(/(\{\{[^}]+\}\})\s{2,}/g,"$1 ").replace(/\s{2,}(\{\{[^}]+\}\})/g," $1")):R=V.textContent||"",R===""){try{let I=document.createRange();I.selectNodeContents(V),I.collapse(!0);let H=window.getSelection();H?.removeAllRanges(),H?.addRange(I),O.current=0;}catch{}re("",0);return}if(R===d)return;let k=window.getSelection(),M=0;if(k&&k.rangeCount>0)try{let I=k.getRangeAt(0);if(Z){let H=0,ie=!1,Je=be=>{if(ie)return !0;if(be===I.startContainer)return H+=I.startOffset,ie=!0,!0;if(be.nodeType===Node.TEXT_NODE){if(!be.parentElement?.closest("[data-chip-id]")){if(be.contains(I.startContainer))return H+=I.startOffset,ie=!0,!0;H+=(be.textContent||"").length;}}else if(be.nodeType===Node.ELEMENT_NODE){let ye=be;if(ye.hasAttribute("data-chip-id")){if(ye.contains(I.startContainer)||ye===I.startContainer){let Vs=ye.getAttribute("data-chip-id");return H+=`{{${Vs}}}`.length,ie=!0,!0}let As=ye.getAttribute("data-chip-id");return H+=`{{${As}}}`.length,!1}else if(ye.tagName==="BR")return ye===I.startContainer?(ie=!0,!0):(H+=1,!1)}for(let ye=0;ye<be.childNodes.length;ye++)if(Je(be.childNodes[ye]))return !0;return !1};Je(V),M=H;}else {let H=document.createRange();H.setStart(V,0),H.setEnd(I.startContainer,I.startOffset),M=H.toString().length;}}catch{M=R.length;}O.current=M,re(R,M);},onKeyDown:F=>{if(s)return;let V=window.getSelection();if(!(!V||V.rangeCount===0))try{let Z=V.getRangeAt(0),R=Z.commonAncestorContainer;if(F.key==="ArrowLeft"||F.key==="ArrowRight"){let k=R.nodeType===Node.TEXT_NODE?R.parentElement?.closest("[data-chip-id]"):R.closest("[data-chip-id]");if(k){F.preventDefault();try{let M=document.createRange(),I=window.getSelection();F.key==="ArrowLeft"?M.setStartBefore(k):M.setStartAfter(k),M.collapse(!0),I?.removeAllRanges(),I?.addRange(M);}catch{}}}if(F.key==="Backspace"){let k=null;if(k=(R.nodeType===Node.TEXT_NODE?R.parentElement?.closest("[data-chip-id]"):R.closest("[data-chip-id]"))||null,!k)if(R.nodeType===Node.TEXT_NODE){let M=R;if(Z.startOffset===0&&M.parentElement){let I=M.previousSibling;if(I&&I.nodeType===Node.ELEMENT_NODE){let H=I.closest("[data-chip-id]");H&&(k=H);}}}else {let M=R;if(Z.startOffset>0){let I=M.childNodes[Z.startOffset-1];if(I&&I.nodeType===Node.ELEMENT_NODE){let H=I.closest("[data-chip-id]");H&&(k=H);}}}if(k){F.preventDefault(),F.stopPropagation();let M=k.getAttribute("data-chip-id");if(!M)return;let I=`{{${M}}}`,H=d.indexOf(I);if(H!==-1){let ie=d.slice(0,H)+d.slice(H+I.length),Je=p.filter(be=>be.id!==M);O.current=H;try{window.getSelection()?.removeAllRanges();}catch{}g?.(Je),u?.(ie);}}}}catch{}},onFocus:F=>{s||(N.onFocus&&N.onFocus(F),v(F));},onBlur:F=>{s||(N.onBlur&&N.onBlur(F),D(F));},className:he(),style:{whiteSpace:"pre-wrap",wordBreak:"break-word",...N.style},"data-placeholder":N.placeholder,children:ze()},d===""?"empty":"content")}),t&&jsxRuntime.jsx(J,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsxRuntime.jsx(U,{size:o,className:"mt-1",children:r}),typeof r=="function"&&m&&jsxRuntime.jsx(U,{size:o,className:"mt-1",children:r(m)})]})})}var bg=e=>tailwindMerge.twMerge("w-full",Ct({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused}),hr({transparent:e.transparent,isDisabled:e.isDisabled}),W[e.size||"md"].text,W[e.size||"md"].height,W[e.size||"md"].padding,"pl-[var(--control-padding-sm)]","flex items-center gap-0.5",e.className),xg=({isPlaceholder:e,isDisabled:t,isFocused:r,size:o="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",W[o].text,"px-0.5 -my-0.5",r&&"!outline-[1.5px] !outline-[var(--control-focus-ring-color)] ![--tw-outline-style:solid]",!t&&!r&&"hover:bg-text-body/[0.05]");function Ds({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,transparent:i,validationResult:l,...s}){let{isFocused:c}=Oe(),[m,d]=rt.useState(null),u=rt.useRef(null);return rt.useEffect(()=>{let p=h=>{let y=h.target;y.hasAttribute("data-type")&&d(y.getAttribute("data-type"));},g=()=>{d(null);},f=u.current;return f&&(f.addEventListener("focusin",p),f.addEventListener("focusout",g)),()=>{f&&(f.removeEventListener("focusin",p),f.removeEventListener("focusout",g));}},[]),jsxRuntime.jsx(reactAriaComponents.TimeField,{...s,children:({isDisabled:p,isInvalid:g})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(q,{isRequired:a,tooltip:n,children:e}),jsxRuntime.jsx(reactAriaComponents.DateInput,{ref:u,className:bg({size:o,transparent:i,isDisabled:p,isInvalid:g,isFocused:c}),children:f=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:f,className:xg({isPlaceholder:f.isPlaceholder,isDisabled:!f.isEditable,isFocused:m===f.type,size:o})})}),t&&jsxRuntime.jsx(J,{children:t}),typeof r=="string"?jsxRuntime.jsx(U,{children:r}):null]})})}var Cg="flex font-medium justify-center items-center gap-2 text-center transition whitespace-nowrap box-border",$s={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]"}},Ng="opacity-[--control-hover-opacity] cursor-not-allowed pointer-events-none grayscale",Sg="opacity-100 cursor-pointer",wg={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},Pg={primary:"bg-action-primary text-white",destructive:"bg-action-destructive text-white"};function kg(e){let{variant:t="default",size:r="md",isDisabled:o,isSelected:n,borderRadius:a,borderRight:i,borderLeft:l}=e,s=`${Cg} ${n?$s[t].selected:$s[t].unselected}`;return s+=` ${W[r].text} ${W[r].height} ${W[r].padding} ${W[r].gap}`,s+=` ${o?Ng:Sg}`,a==="left"&&(s+=" rounded-l-sm"),a==="right"&&(s+=" rounded-r-sm"),i&&(s+=" border-r"),l&&(s+=" border-l"),s+=` ${ae()}`,tailwindMerge.twMerge(s)}function Bs(e){let{className:t,children:r,onPress:o,icon:n,iconPosition:a="left",iconWeight:i,isLoading:l=false,loadingText:s,loadingIndicator:c,size:m="md",badgeNumber:d,badgeVariant:u="primary",badgePosition:p="top-right",...g}=e,f=n?jsxRuntime.jsx(b,{name:n,className:`icon-[--control-icon-size-${m}]`,weight:i}):null,h=()=>{let w=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a==="left"&&f,r,a==="right"&&f]});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(b,{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},y=jsxRuntime.jsx(reactAriaComponents.ToggleButton,{onPress:o,...g,className:tailwindMerge.twMerge(kg(e),t),"aria-busy":l,children:h()});return d&&d>0?jsxRuntime.jsxs("div",{className:"relative",children:[y,jsxRuntime.jsx("span",{className:`absolute ${wg[p]} flex h-5 w-5 items-center justify-center rounded-full ${Pg[u]} text-xs`,"aria-label":`${d} items`,children:d})]}):y}exports.ActionCell=Qa;exports.ActionMenu=aa;exports.AppShell=la;exports.AreaSeries=wt;exports.AutoMobileRenderer=Hr;exports.Autocomplete=vr;exports.Avatar=Na;exports.Badge=Nt;exports.BarSeries=kt;exports.BooleanCell=ei;exports.Breadcrumb=Sr;exports.Breadcrumbs=Nr;exports.Button=z;exports.Calendar=wr;exports.Card=Me;exports.CardMobileRenderer=Gr;exports.ChartAxis=Zt;exports.ChartBottomBar=Mr;exports.ChartContainer=qa;exports.ChartContext=Rr;exports.ChartTooltip=Ir;exports.Checkbox=Do;exports.CheckboxGroup=Td;exports.Chip=Tr;exports.ClearButton=ba;exports.CodeEditor=Ba;exports.ColorModeProvider=ga;exports.CopyToClipboard=Va;exports.DataTable=ci;exports.DateCell=ti;exports.DateField=di;exports.DateRangePicker=pi;exports.Description=J;exports.Dialog=Dt;exports.DialogHeader=Et;exports.Drawer=rn;exports.ErrorBoundary=Bt;exports.FieldError=U;exports.FieldGroup=yr;exports.FileUpload=xi;exports.Form=hi;exports.FormatRegistry=S;exports.Grid=on;exports.Heading=Re;exports.Icon=b;exports.Input=xa;exports.InputWrapper=We;exports.InteractiveMap=Di;exports.Kpi=Si;exports.KpiGroup=an;exports.Label=q;exports.LineSeries=Rt;exports.ListBox=ap;exports.ListBoxItem=nt;exports.Loader=Ti;exports.Logo=pr;exports.MAPBOX_THEMES=or;exports.Meter=$i;exports.Notice=Zr;exports.NoticeContainer=qr;exports.NoticeProvider=Bi;exports.NumberCell=ri;exports.NumberField=Hi;exports.PageLayout=qe;exports.PlaceSearch=Yi;exports.Popover=at;exports.ProgressBar=Ji;exports.Radio=es;exports.RadioGroup=Qi;exports.RangeCalendar=Or;exports.RichTextEditor=ns;exports.SKELETON_SIZES=ct;exports.Section=is;exports.SegmentedControl=cs;exports.Select=gs;exports.SelectCell=oi;exports.SideNav=fr;exports.Skeleton=B;exports.Slider=bs;exports.SplitPane=Jr;exports.StatList=Cs;exports.StaticMap=Fi;exports.Switch=Ns;exports.Tab=Ps;exports.TabList=ws;exports.TabPanel=ks;exports.Tabs=Ss;exports.TextArea=Ts;exports.TextAreaWithChips=Ls;exports.TextCell=ni;exports.TextField=Yr;exports.TextLink=Ro;exports.TimeField=Ds;exports.ToggleButton=Bs;exports.Tooltip=Eo;exports.TopNav=Ot;exports.autoScaleDistance=kn;exports.autoScaleEnergy=Ln;exports.autoScalePower=ul;exports.camelCaseToWords=qn;exports.capitalize=jn;exports.celsiusToFahrenheit=hl;exports.celsiusToKelvin=fb;exports.centimetersToInches=ab;exports.clearColorCache=wu;exports.createCategoryColorMap=Pu;exports.createFormat=Fb;exports.createXScale=Ao;exports.createYScale=Vo;exports.defaultMargin=ee;exports.enumToSentenceCase=Nl;exports.exportChart=Wo;exports.fahrenheitToCelsius=yl;exports.fahrenheitToKelvin=gb;exports.feetToMeters=Yg;exports.feetToMiles=Qg;exports.formatBoolean=vn;exports.formatCurrency=wn;exports.formatDate=Cn;exports.formatDistance=Tn;exports.formatEmptyValue=$r;exports.formatEnergy=$n;exports.formatFieldValue=Rb;exports.formatInternationalPhone=so;exports.formatNumber=Sn;exports.formatPhone=Bn;exports.formatPhoneNumber=En;exports.formatTemperature=On;exports.formatText=ea;exports.formatUSPhone=mr;exports.getBadgeClasses=Ya;exports.getBooleanBadgeVariant=Xa;exports.getCellAlignmentClasses=qo;exports.getCellContainerClasses=ne;exports.getCellTextClasses=Le;exports.getContrastingTextColor=ku;exports.getDateParts=Og;exports.getDefaultChartColor=_o;exports.getDefaultColors=_a;exports.getExportFormatName=Su;exports.getFieldGroupStyles=_t;exports.getInputBackgroundStyles=hr;exports.getInputBaseStyles=Be;exports.getInputStateStyles=Ct;exports.getNumericColorClasses=Er;exports.getResolvedColor=Yt;exports.getSkeletonSize=Ie;exports.getThemeCategoricalColors=Lr;exports.getYFormatSettings=Tt;exports.inchesToCentimeters=nb;exports.isExportSupported=Nu;exports.isLightColor=Ka;exports.isNil=A;exports.kelvinToCelsius=vl;exports.kelvinToFahrenheit=bb;exports.kilometersToMiles=Jg;exports.metersToFeet=qg;exports.metersToMiles=eb;exports.metersToYards=ob;exports.milesToFeet=Pn;exports.milesToKilometers=Xg;exports.milesToMeters=tb;exports.parseBoolean=Ge;exports.resolveValue=xe;exports.snakeCaseToWords=Yn;exports.temperatureStringToSymbol=An;exports.toActiveInactive=js;exports.toAmps=ml;exports.toBoolean=He;exports.toCelsius=zn;exports.toCentimeters=sl;exports.toCheckmark=qs;exports.toCompactNumber=al;exports.toCurrency=Nn;exports.toCustomDateFormat=el;exports.toDateString=Ys;exports.toEnabledDisabled=Ks;exports.toFahrenheit=Vn;exports.toFeet=oo;exports.toFloat=ol;exports.toFormattedNumber=nl;exports.toFullDateTime=Js;exports.toGWh=Mn;exports.toISOString=Qs;exports.toInches=cl;exports.toInteger=rl;exports.toKelvin=Hn;exports.toKilometers=ro;exports.toKilovolts=gl;exports.toLowerCase=_n;exports.toMW=dl;exports.toMWh=Fn;exports.toMeters=to;exports.toMiles=no;exports.toMillimeters=ll;exports.toMilliohms=xl;exports.toMillivolts=fl;exports.toNauticalMiles=Zg;exports.toOhms=bl;exports.toOnOff=Us;exports.toPercentage=tl;exports.toRelativeTime=Xs;exports.toScientificNotation=il;exports.toSecret=Sl;exports.toSentenceCase=Kn;exports.toTemperature=Gn;exports.toTitleCase=Un;exports.toTrueFalse=Zs;exports.toUpperCase=Wn;exports.toVolts=pl;exports.toWatts=In;exports.toWh=Rn;exports.toYards=ao;exports.tokW=Dn;exports.tokWh=io;exports.truncateEnd=Qn;exports.truncateMiddle=Xn;exports.truncateStart=Jn;exports.ucFirst=Zn;exports.useChartContext=st;exports.useColorMode=fa;exports.useDebounce=ur;exports.useInputFocus=Oe;exports.useLocalStorage=yn;exports.useNotice=Vi;exports.yardsToMeters=rb;//# sourceMappingURL=index.cjs.map
70
70
  //# sourceMappingURL=index.cjs.map