@graphty/compact-mantine 0.6.0 → 0.8.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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@mantine/core"),t=require("react/jsx-runtime"),$=require("@mantine/hooks"),s=require("react"),wo=require("react-dom"),de=require("@tanstack/react-table"),Io=require("@tanstack/react-virtual"),u={WIDTH:280,PAD_LEFT:16,PAD_RIGHT:8,CONTENT:256,BODY:224,FIELD:108,GUTTER:8,TRAIL_GAP:8,TRAIL:24,TRIPLE:72,TRIPLE_GAP:4,CONTROL_HEIGHT:24,ROW_PITCH:32,TOGGLE_PITCH:24,DATA_PITCH:28,SECTION_HEADER:32,SECTION_PAD_BOTTOM:8,GLYPH_SLOT:16,GLYPH:14,CHEVRON:12,VALUE_INSET:24,SPARKLINE_HEIGHT:32,HISTOGRAM_HEIGHT:64,LABEL_COLUMN:76},b={VALUE:"var(--mantine-color-text)",CHROME:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",PROSE:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",PLACEHOLDER:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",DISABLED:"var(--mantine-color-disabled-color)",SURFACE:"light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-6))",PANEL:"var(--mantine-color-body)",RAISED:"light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-5))",SELECTED:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",ON_SELECTED:"var(--mantine-color-body)",BORDER:"light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))",DIVIDER:"light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))",ACCENT:"var(--mantine-primary-color-filled)",ON_ACCENT:"var(--mantine-primary-color-contrast)",WARNING:"var(--mantine-color-yellow-6)",SUCCESS:"var(--mantine-color-green-6)",DANGER:"var(--mantine-color-red-6)"},Dn=["#d5d7da","#a3a8b1","#7a828e","#5f6873","#48525c","#374047","#2a3035","#1f2428","#161b22","#0d1117"],kn={...o.DEFAULT_THEME.colors,dark:Dn},Eo={"--button-height":"24px","--button-fz":"11px","--button-padding-x":"8px"},So={"--ai-size":"24px"},Co={"--cb-size":"16px","--cb-icon-size":"12px"},To={Button:o.Button.extend({defaultProps:{size:"sm"},vars:()=>({root:Eo})}),ActionIcon:o.ActionIcon.extend({defaultProps:{size:"sm",variant:"subtle"},vars:()=>({root:So})}),CloseButton:o.CloseButton.extend({defaultProps:{size:"xs"},vars:()=>({root:Co})})},Ro={"--switch-height":"16px","--switch-width":"28px","--switch-thumb-size":"12px","--switch-track-label-padding":"2px","--switch-label-font-size":"5px"},Po={"--checkbox-size":"16px"},Ao={"--radio-size":"16px","--radio-icon-size":"6px"},en={"--slider-size":"4px","--slider-thumb-size":"12px"},jo={"--sc-font-size":"10px","--sc-padding":"4px 8px"},Lo={backgroundColor:"transparent"},Oo={backgroundColor:"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))"},wt={fontSize:11},tn={fontSize:10,marginTop:2},Ho={SegmentedControl:o.SegmentedControl.extend({defaultProps:{size:"sm",withItemsBorders:!1},vars:()=>({root:jo}),styles:{root:Lo,indicator:Oo}}),Checkbox:o.Checkbox.extend({defaultProps:{size:"sm"},vars:()=>({root:Po}),styles:{label:wt}}),Switch:o.Switch.extend({defaultProps:{size:"sm"},vars:()=>({root:Ro}),styles:{label:wt}}),Slider:o.Slider.extend({defaultProps:{size:"sm"},vars:()=>({root:en}),styles:{markLabel:tn}}),Radio:o.Radio.extend({defaultProps:{size:"sm"},vars:()=>({root:Ao}),styles:{label:wt}}),RangeSlider:o.RangeSlider.extend({defaultProps:{size:"sm"},vars:()=>({root:en}),styles:{markLabel:tn}})},_o={"--badge-height":"14px","--badge-fz":"9px","--badge-padding-x":"4px"},No={"--avatar-size":"24px"},Do={"--ti-size":"24px"},ko={"--indicator-size":"8px"},Go={"--kbd-fz":"10px","--kbd-padding":"2px 4px"},Mo={"--pill-height":"16px","--pill-fz":"10px"},zo={Text:o.Text.extend({}),Badge:o.Badge.extend({defaultProps:{size:"sm"},vars:()=>({root:_o})}),Pill:o.Pill.extend({defaultProps:{size:"sm"},vars:()=>({root:Mo})}),Avatar:o.Avatar.extend({defaultProps:{size:"sm"},vars:()=>({root:No})}),ThemeIcon:o.ThemeIcon.extend({defaultProps:{size:"sm"},vars:()=>({root:Do})}),Indicator:o.Indicator.extend({defaultProps:{size:"sm"},vars:()=>({root:ko})}),Kbd:o.Kbd.extend({defaultProps:{size:"sm"},vars:()=>({root:Go})})},Bo={"--loader-size":"18px"},Fo={"--progress-size":"4px"},Vo={label:{fontSize:9}},Uo={Loader:o.Loader.extend({defaultProps:{size:"sm"},vars:()=>({root:Bo})}),Progress:o.Progress.extend({defaultProps:{size:"sm"},vars:()=>({root:Fo}),styles:Vo}),RingProgress:o.RingProgress.extend({})},_t=1e3,ke=1100,Gn=8,Mn=4,zn="light-dark(var(--mantine-primary-color-filled), var(--mantine-primary-color-5))",$e={"--input-height":"24px","--input-size":"24px","--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":zn},ut={"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":zn},qe={fontSize:11,color:b.CHROME,marginBottom:1,lineHeight:1.2},Mt={paddingInlineStart:8,paddingInlineEnd:8,backgroundColor:"var(--mantine-color-default)"},Ke={label:qe,input:Mt},nn={label:qe,input:Mt},pt={dropdown:{padding:4,border:"none",boxShadow:"var(--mantine-shadow-md)"},option:{fontSize:11,padding:"4px 8px",borderRadius:4},options:{},groupLabel:{fontSize:10,padding:"4px 8px"},empty:{fontSize:11,padding:"8px"}},It={input:{...Ke.input,minHeight:24,height:"auto",display:"flex",alignItems:"center",paddingTop:4,paddingBottom:4},pillsList:{columnGap:4,rowGap:2},pill:{margin:0}},$o={TextInput:o.TextInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:$e}),styles:Ke}),NumberInput:o.NumberInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:{...$e,"--input-right-section-width":"24px"},controls:{"--ni-chevron-size":"10px"}}),styles:{label:qe,input:Mt,control:{borderColor:"transparent"}}}),Select:o.Select.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:ke}},vars:()=>({root:{},wrapper:$e}),styles:{...Ke,...pt}}),Textarea:o.Textarea.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:ut}),styles:nn}),PasswordInput:o.PasswordInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:$e}),styles:{...Ke,innerInput:{paddingInlineStart:8,paddingInlineEnd:8}}}),Autocomplete:o.Autocomplete.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:ke}},vars:()=>({root:{},wrapper:$e}),styles:{...Ke,...pt}}),MultiSelect:o.MultiSelect.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:ke}},vars:()=>({root:{},wrapper:{...$e,"--combobox-chevron-size":"12px"}}),styles:{label:qe,...pt,...It,inputField:{minWidth:60,flexBasis:60}}}),TagsInput:o.TagsInput.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:ke}},vars:()=>({root:{},wrapper:ut}),styles:{label:qe,...pt,...It,inputField:{minWidth:30,flexBasis:30}}}),PillsInput:o.PillsInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:ut}),styles:{label:qe,...It}}),FileInput:o.FileInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:$e}),styles:Ke}),JsonInput:o.JsonInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:ut}),styles:nn}),InputClearButton:o.InputClearButton.extend({defaultProps:{size:"xs"},vars:()=>({root:{"--cb-size":"16px","--cb-icon-size":"12px"}})})},Wo={"--pagination-control-size":"24px","--pagination-control-fz":"11px"},Yo={"--stepper-icon-size":"24px","--stepper-fz":"11px","--stepper-spacing":"8px"},Xo={"--burger-size":"18px","--burger-line-size":"2px"},Ko={root:{fontSize:11}},qo={root:{fontSize:11,minHeight:28},label:{fontSize:11}},Zo={tab:{fontSize:11,padding:"6px 10px"}},Jo={Anchor:o.Anchor.extend({defaultProps:{size:"sm"},styles:Ko}),Burger:o.Burger.extend({defaultProps:{size:"sm"},vars:()=>({root:Xo})}),NavLink:o.NavLink.extend({styles:qo}),Pagination:o.Pagination.extend({defaultProps:{size:"sm"},vars:()=>({root:Wo})}),Stepper:o.Stepper.extend({defaultProps:{size:"sm"},vars:()=>({root:Yo})}),Tabs:o.Tabs.extend({styles:Zo})},Qo={"--menu-item-fz":"11px"},er={tooltip:{fontSize:11,padding:"4px 8px"}},tr={dropdown:{padding:8}},nr={dropdown:{padding:8}},or={Menu:o.Menu.extend({defaultProps:{zIndex:ke},vars:()=>({dropdown:Qo})}),Tooltip:o.Tooltip.extend({defaultProps:{zIndex:ke},styles:er}),Popover:o.Popover.extend({defaultProps:{zIndex:ke},styles:tr}),HoverCard:o.HoverCard.extend({defaultProps:{zIndex:ke},styles:nr})},rr={xs:"10px",sm:"11px",md:"13px",lg:"14px",xl:"16px"},ar={xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},sr={xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},Bn=o.createTheme({colors:kn,fontSizes:rr,spacing:ar,radius:sr,focusRing:"auto",other:{panelGrid:u},components:{...$o,...To,...Ho,...zo,...Uo,...Jo,...or}}),ir=o.mergeMantineTheme(o.DEFAULT_THEME,Bn),Fn=["#5B8FF9FF","#FF6B6BFF","#61D095FF","#F7B731FF","#9B59B6FF","#5B8FF980","#FF6B6B80","#61D09580","#F7B73180","#9B59B680"],xt="#888888",Vn={mixed:"Mixed",fieldBound:"Bound to a data attribute",fieldPending:"Set but not yet applied",scaleSqrt:"Square root scale",scaleLinear:"Linear scale",scaleLog:"Logarithmic scale",details:"Details",departure:"Departure",percentile:e=>`${e} percentile`,expandSection:e=>`Expand ${e}`,collapseSection:e=>`Collapse ${e}`,addToSection:e=>`Add ${e}`,sectionHasConfiguredValues:e=>`${e} has configured values`,about:e=>`About ${e}`,resetToDefault:e=>`Reset ${e} to default`,colorSwatch:"Color swatch",colorHexValue:"Color hex value",opacity:"Opacity",colorPanelTitle:"Color",colorGenericName:"color",colorStops:"Color Stops",addColorStop:"Add color stop",colorStopPosition:e=>`Stop ${e} position`,removeColorStop:e=>`Remove color stop ${e}`,direction:"Direction",gradientDirection:"Gradient direction",degrees:e=>`${e}°`,percent:e=>`${e}%`,dataTable:"Data table",search:"Search",searchPlaceholder:"Search",clearSearch:"Clear search",noRows:"No rows",noMatchingRows:"No rows match the search",rowsShown:(e,n)=>`${e} of ${n} rows`,rowsSelected:e=>`${e} selected`,yes:"Yes",no:"No",closePanel:"Close panel",settings:"Settings",ordinal:(e,n)=>{switch(n){case"one":return`${e}st`;case"two":return`${e}nd`;case"few":return`${e}rd`;default:return`${e}th`}}},lr="en",Nt=s.createContext(Vn),Dt=s.createContext(void 0);function cr(e){return e!==void 0&&e!==""?e:typeof document<"u"&&document.documentElement.lang!==""?document.documentElement.lang:typeof navigator<"u"&&navigator.language!==""?navigator.language:lr}function dr({labels:e,locale:n,children:a}){const r=s.useContext(Nt),i=s.useContext(Dt),l=s.useMemo(()=>({...r,...e}),[r,e]),d=n??i;return t.jsx(Dt.Provider,{value:d,children:t.jsx(Nt.Provider,{value:l,children:a})})}function re(){return s.useContext(Nt)}function ze(){const e=s.useContext(Dt);return cr(e)}const ur=1234.5,pr="9876543210",fr=9876543210,hr=new Set([" "," "," "," ","'","’"]),gr="−",xr=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/iu,on=new Map;function mr(e){var h,p;const n=on.get(e);if(n!==void 0)return n;const a=new Intl.NumberFormat(e).formatToParts(ur),r=((h=a.find(f=>f.type==="decimal"))==null?void 0:h.value)??".",i=((p=a.find(f=>f.type==="group"))==null?void 0:p.value)??"",l=new Map;for(const f of"0123456789")l.set(f,f);const d=new Intl.NumberFormat(e,{useGrouping:!1}).format(fr);Array.from(d).forEach((f,x)=>{l.set(f,pr[x])});const g={decimal:r,digits:l,group:i};return on.set(e,g),g}function Un(e,n){const a=mr(n);let r="";for(const l of e.trim()){const d=a.digits.get(l);if(d!==void 0){r+=d;continue}if(l===a.decimal){r+=".";continue}if(!(l===a.group||hr.has(l))){if(l==="-"||l===gr){r+="-";continue}if(l==="+"){r+="+";continue}if(l==="e"||l==="E"){r+=l;continue}break}}const i=xr.exec(r);return i===null?Number.NaN:Number(i[0])}function Ye(e){const n=ze(),a=JSON.stringify(e??{});return s.useMemo(()=>new Intl.NumberFormat(n,e),[n,a])}function $n(){const e=ze(),n=re(),a=Ye(),r=s.useMemo(()=>new Intl.PluralRules(e,{type:"ordinal"}),[e]);return s.useCallback(i=>n.ordinal(a.format(i),r.select(i)),[n,a,r])}function Wn(e){const n=ze(),a=JSON.stringify(e??{});return s.useMemo(()=>new Intl.Collator(n,e),[n,a])}function zt(){const e=ze();return s.useCallback(n=>Un(n,e),[e])}const Yn=["sizeSmallest","sizeLargest","width","opacity","attribute","scaleSqrt","scaleLinear","scaleLog"],Xn=["N","E","W","D","K"],br=["chevronDown","chevronRight","chevronLeft","close","plus","minus","gear","warning","check","eye","refresh","copy","pin","info","reset"],Kn={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},Re={fill:"currentColor",stroke:"none"},yr={sizeSmallest:e=>t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"5",cy:"11",r:"2.5",...e?Re:{}}),t.jsx("circle",{cx:"10.5",cy:"6.5",r:"4",...e?Re:{}})]}),sizeLargest:e=>t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"4.5",cy:"11.5",r:"1.75",...e?Re:{}}),t.jsx("circle",{cx:"10",cy:"6",r:"5",...e?Re:{}})]}),width:e=>t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"2.5",y1:"8",x2:"13.5",y2:"8"}),t.jsx("polyline",{points:"5,5.5 2.5,8 5,10.5",...e?Re:{}}),t.jsx("polyline",{points:"11,5.5 13.5,8 11,10.5",...e?Re:{}})]}),opacity:e=>e?t.jsx("circle",{cx:"8",cy:"8",r:"5.5",...Re}):t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),t.jsx("path",{d:"M8 2.5a5.5 5.5 0 0 1 0 11z",...Re})]}),attribute:e=>e?t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M2.5 7.2V3.5a1 1 0 0 1 1-1h3.7l6.3 6.3-4.7 4.7z",...Re}),t.jsx("circle",{cx:"5.5",cy:"5.5",r:"0.75",style:{fill:b.SURFACE},stroke:"none"})]}):t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M2.5 7.2V3.5a1 1 0 0 1 1-1h3.7l6.3 6.3-4.7 4.7z"}),t.jsx("circle",{cx:"5.5",cy:"5.5",r:"0.75"})]}),scaleSqrt:()=>t.jsx("path",{d:"M2.5 13.5C4.5 5 8 2.5 13.5 2.5"}),scaleLinear:()=>t.jsx("line",{x1:"2.5",y1:"13.5",x2:"13.5",y2:"2.5"}),scaleLog:()=>t.jsx("path",{d:"M2.5 13.5C8 13.5 11.5 11 13.5 2.5"})},vr={chevronDown:t.jsx("polyline",{points:"4,6 8,10 12,6"}),chevronRight:t.jsx("polyline",{points:"6,4 10,8 6,12"}),chevronLeft:t.jsx("polyline",{points:"10,4 6,8 10,12"}),close:t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),t.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]}),plus:t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"8",y1:"3",x2:"8",y2:"13"}),t.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8"})]}),minus:t.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8"}),gear:t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"8",cy:"8",r:"2.25"}),t.jsx("path",{d:"M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M12.6 3.4l-1.4 1.4M4.8 11.2l-1.4 1.4"})]}),warning:t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M8 2.5l6 11H2z"}),t.jsx("line",{x1:"8",y1:"6.5",x2:"8",y2:"9.5"}),t.jsx("line",{x1:"8",y1:"11.5",x2:"8",y2:"11.75"})]}),check:t.jsx("polyline",{points:"3.5,8.5 6.5,11.5 12.5,5"}),eye:t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8z"}),t.jsx("circle",{cx:"8",cy:"8",r:"2"})]}),refresh:t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M2.5 8a5.5 5.5 0 1 0 1.6-3.9"}),t.jsx("polyline",{points:"2.5,2.5 2.5,6 6,6"})]}),copy:t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1"}),t.jsx("path",{d:"M10.5 5.5v-2a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2"})]}),pin:t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M6 2.5h4l-.5 3.5 2 2.5H4.5l2-2.5z"}),t.jsx("line",{x1:"8",y1:"8.5",x2:"8",y2:"13.5"})]}),info:t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"8",cy:"8",r:"6.5"}),t.jsx("line",{x1:"8",y1:"7",x2:"8",y2:"11.5"}),t.jsx("line",{x1:"8",y1:"4.5",x2:"8",y2:"4.75"})]}),reset:t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),t.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]})};function nt({name:e,filled:n=!1,size:a=u.GLYPH}){return t.jsx("svg",{width:a,height:a,...Kn,"aria-hidden":"true",focusable:"false","data-glyph":e,"data-filled":n?"true":"false",style:{flex:"0 0 auto",display:"block"},children:yr[e](n)})}function te({name:e,size:n=u.GLYPH}){return t.jsx("svg",{width:n,height:n,...Kn,"aria-hidden":"true",focusable:"false","data-glyph":e,style:{flex:"0 0 auto",display:"block"},children:vr[e]})}function Bt(e){return typeof e=="string"&&Yn.includes(e)}function Ft(e){return typeof e=="string"&&Xn.includes(e)}const Vt=255,Ut=100;function $t(e){return Math.round(parseInt(e,16)/Vt*Ut)}function Wt(e){return Math.round(e/Ut*Vt).toString(16).padStart(2,"0")}function wr(e){let n=e.replace("#","");n.length===3?n=`${n.split("").map(l=>l+l).join("")}ff`:n.length===4?n=n.split("").map(l=>l+l).join(""):n.length===6&&(n=`${n}ff`);const a=`#${n.slice(0,6)}`,r=n.slice(6,8),i=$t(r);return{hex:a,opacity:i}}function Ir(e,n){const a=e.replace("#",""),r=Wt(n);return`#${a}${r}`}function Er(e){return/^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}const qn=s.createContext(null);function Sr(){return s.useContext(qn)}function Cr({children:e}){const n=s.useRef(null);if(!s.isValidElement(e))throw new Error("PopoutAnchor requires a single valid React element as its child");const a=e,r=s.cloneElement(a,{ref:n});return t.jsx(qn.Provider,{value:{anchorRef:n},children:r})}function Tr({children:e}){return t.jsx(o.Box,{p:"sm",children:e})}const Rr=["[data-portal]","[data-combobox-dropdown]","[data-menu-dropdown]","[data-popover-dropdown]","[data-tooltip]","[data-hovercard-dropdown]","[data-dates-dropdown]","[data-modal]"].join(", ");function Pr(e,n=!0){s.useEffect(()=>{if(!n)return;const a=r=>{const i=r.target;i.closest('[role="dialog"]')||i.closest("[data-popout-trigger]")||i.closest("[data-popout-portal-container]")||i.closest(Rr)||e()};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[e,n])}function Ar(e,n=!0){s.useEffect(()=>{if(!n)return;const a=r=>{r.key==="Escape"&&(r.preventDefault(),e())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[e,n])}const Yt=s.createContext(null),Xt=s.createContext(null);function yt(){const e=s.useContext(Yt);if(!e)throw new Error("usePopoutContext must be used within a Popout component");return e}function jr(){return s.useContext(Yt)}function Lr(){const e=s.useContext(Xt);if(!e)throw new Error("usePopoutManagerContext must be used within a PopoutManager");return e}function Or(){return s.useContext(Xt)}function Hr({children:e,parentId:n=null,opened:a,defaultOpened:r,onOpenChange:i}){const l=s.useId(),d=s.useRef(null),[g,h]=$.useUncontrolled({value:a,defaultValue:r,finalValue:!1,onChange:i}),p=s.useRef(h);s.useEffect(()=>{p.current=h});const f=s.useCallback((v,S)=>{if(S){p.current(v,S);return}p.current(v)},[]),x=s.useCallback(v=>{f(!0,v)},[f]),y=s.useCallback(v=>{f(!1,v)},[f]),C=s.useCallback(v=>{f(!g,v)},[g,f]),T=s.useMemo(()=>({id:l,isOpen:g,open:x,close:y,toggle:C,triggerRef:d,parentId:n}),[l,g,x,y,C,n]);return t.jsx(Yt.Provider,{value:T,children:e})}function _r({children:e}){const[n,a]=s.useState(null),r=s.useRef([]),i=s.useRef(new Map),l=s.useRef(new Map),[d,g]=s.useState(0),h=s.useCallback(m=>{const w=[];for(const R of r.current)(l.current.get(R)??null)===m&&w.push(R);return w},[]),p=s.useCallback(m=>{const w=[];for(const R of r.current){let j=R;for(;j;){const K=l.current.get(j)??null;if(K===m){w.push(R);break}j=K}}return w},[]),f=s.useCallback(m=>{let w=0,R=m;for(;R;){const j=l.current.get(R)??null;if(!j)break;w++,R=j}return w},[]),x=s.useCallback(m=>{var R;const w=[...m].sort((j,K)=>f(K)-f(j));for(const j of w)(R=i.current.get(j))==null||R()},[f]),y=s.useCallback((m,w,R)=>{if(r.current.includes(m)){i.current.set(m,w);return}const j=R??null,K=h(j),W=[];for(const U of K)W.push(U),W.push(...p(U));x(W);const xe=new Set(W);r.current=r.current.filter(U=>!xe.has(U)),r.current.push(m),i.current.set(m,w),l.current.set(m,j),g(U=>U+1)},[h,p,x]),C=s.useCallback(m=>{if(!r.current.includes(m)){i.current.delete(m),l.current.delete(m);return}r.current=r.current.filter(w=>w!==m),i.current.delete(m),l.current.delete(m),g(w=>w+1)},[]),T=s.useCallback(m=>{const w=r.current.indexOf(m);return w>=0?_t+w:_t},[]),v=s.useCallback(m=>{const w=r.current,R=w.indexOf(m);R===-1||R===w.length-1||(r.current=[...w.filter(j=>j!==m),m],g(j=>j+1))},[]),S=s.useCallback(m=>l.current.get(m)??null,[]),H=s.useCallback((m,w)=>{let R=w;for(;R;){const j=l.current.get(R);if(j===m)return!0;R=j??null}return!1},[]),P=s.useCallback(m=>{const w=[],R=r.current;for(const j of R)H(m,j)&&w.push(j);return w},[H]),E=s.useCallback(m=>{const w=P(m);for(const R of[...w].reverse()){const j=i.current.get(R);j==null||j()}},[P]),A=s.useCallback(m=>{E(m);const w=i.current.get(m);w==null||w()},[E]),_=s.useCallback((m,w)=>{const R=r.current;for(const j of R){if(j===m)continue;l.current.get(j)===w&&A(j)}},[A]),L=s.useCallback(()=>{const m=r.current;if(m.length===0)return;const w=m[m.length-1],R=i.current.get(w);R==null||R()},[]),D=s.useCallback(()=>{const m=[...r.current];for(const w of m){const R=i.current.get(w);R==null||R()}},[]),N=s.useCallback(()=>r.current.length>0,[]),[G,M]=s.useState(!1);s.useEffect(()=>{M(r.current.length>0)},[d]),Ar(L,G),Pr(D,G);const F=s.useMemo(()=>({register:y,unregister:C,getZIndex:T,bringToFront:v,portalContainer:n,zIndexVersion:d,closeFocused:L,closeAll:D,hasOpenPopouts:N,closeWithDescendants:A,closeDescendants:E,closeSiblings:_,getParentId:S,isAncestor:H}),[y,C,T,v,n,d,L,D,N,A,E,_,S,H]);return t.jsxs(Xt.Provider,{value:F,children:[e,t.jsx("div",{ref:a,"data-popout-portal-container":!0,style:{display:"contents"}})]})}function Ae(){return o.useDirection().dir}function ue(e){return e==="rtl"}function Nr(e,n){return ue(n)?1-e:e}function Dr(e,n,a){return Nr(e,a)*n}function kr(e){return ue(e)?{transform:"scaleX(-1)"}:{}}const rn=3;function Gr(e){const{isOpen:n,onPress:a,onDragStart:r,onDrag:i,onDragEnd:l}=e,[d,g]=s.useState({left:0,top:0}),h=s.useRef(!1),p=s.useRef(!1),f=s.useRef(!1),x=s.useRef({x:0,y:0,offsetLeft:0,offsetTop:0}),y=s.useCallback(()=>{g({left:0,top:0})},[]),C=s.useCallback(()=>{const P=f.current;return f.current=!1,P},[]),T=s.useCallback(P=>{const E=P.target;if(!(E.tagName==="INPUT"||E.tagName==="TEXTAREA"||E.tagName==="BUTTON"||E.tagName==="SELECT"||E.closest("button")||E.closest("input")||E.closest("textarea")||E.closest("select"))){h.current=!0,p.current=!1,f.current=!1,x.current={x:P.clientX,y:P.clientY,offsetLeft:d.left,offsetTop:d.top},a==null||a(P);try{E.setPointerCapture(P.pointerId)}catch{}}},[d.left,d.top,a]),v=s.useCallback(P=>{if(!h.current)return;const E=P.clientX-x.current.x,A=P.clientY-x.current.y;if(!p.current){if(!(Math.abs(E)>=rn||Math.abs(A)>=rn))return;p.current=!0,r==null||r(P)}const _={left:x.current.offsetLeft+E,top:x.current.offsetTop+A};g(_),i==null||i(_,P)},[i,r]),S=s.useCallback(P=>{if(!h.current)return;h.current=!1;const E=P.target;E.hasPointerCapture(P.pointerId)&&E.releasePointerCapture(P.pointerId),p.current&&(p.current=!1,f.current=!0,l==null||l(P))},[l]),H=d.left!==0||d.top!==0;return n?{dragTriggerProps:{"data-drag-trigger":!0,onPointerDown:T,onPointerMove:v,onPointerUp:S,onPointerCancel:S,style:{cursor:"grab",userSelect:"none",touchAction:"none"}},dragOffset:d,resetDragOffset:y,hasDragged:H,consumeDragClick:C}:{dragTriggerProps:{},dragOffset:{left:0,top:0},resetDragOffset:y,hasDragged:!1,consumeDragClick:C}}function Mr({config:e,onClose:n,dragTriggerProps:a={},actions:r=[],activeTab:i,onTabChange:l,titleId:d}){var C;const g=re(),{style:h,...p}=a,x=e.variant==="tabs"?e:null,y=(x==null?void 0:x.tabs.map(T=>({value:T.id,label:T.label})))??[];return t.jsxs(o.Group,{"data-testid":"popout-header",justify:"space-between",px:"sm",py:"xs",...p,style:{...h},children:[e.variant==="title"?t.jsx(o.Text,{id:d,"data-testid":"popout-header-title",size:"sm",fw:500,children:e.title}):t.jsxs(t.Fragment,{children:[t.jsx(o.VisuallyHidden,{id:d,children:((C=x==null?void 0:x.tabs[0])==null?void 0:C.label)??g.settings}),t.jsx(o.SegmentedControl,{"data-testid":"popout-header-tabs",data:y,value:i,onChange:T=>l==null?void 0:l(T),size:"xs"})]}),t.jsxs(o.Group,{gap:4,children:[r.map(T=>t.jsx(o.ActionIcon,{variant:"subtle",onClick:T.onClick,"aria-label":T.label,children:T.icon},T.id)),t.jsx(o.CloseButton,{size:"sm","data-testid":"popout-header-close",onClick:n,"aria-label":g.closePanel})]})]})}function zr(e,n=document){return e===null?null:n.querySelector(`[data-popout-id="${e}"]`)}function an(e,n,a){const{trigger:r,parent:i,panel:l}=a;if(e!==void 0){if(typeof e=="object")return e.current;switch(e){case"parent":return i??l??r;case"panel":return l??i??r;case"trigger":return r;default:{const d=e;throw new Error(`Unknown anchor target: ${String(d)}`)}}}return n==="x"?i??l??r:r??i??l}function Br(e,n){return e==="start"?ue(n)?"right":"left":e==="end"?ue(n)?"left":"right":e}function Fr(e,n,a=Gn,r={}){const{placement:i="left",alignment:l="start",panelHeight:d=0,crossAnchorRect:g=e,direction:h="ltr"}=r;let p,f;switch(i){case"left":p=e.left-n-a,f=sn(g,l,d);break;case"right":p=e.right+a,f=sn(g,l,d);break;case"top":p=ln(g,l,n,h),f=e.top-d-a;break;case"bottom":p=ln(g,l,n,h),f=e.bottom+a;break;default:{const x=i;throw new Error(`Unknown placement: ${String(x)}`)}}return{left:p,top:f}}function sn(e,n,a){switch(n){case"start":return e.top;case"center":return e.top+e.height/2-a/2;case"end":return e.bottom-a;default:{const r=n;throw new Error(`Unknown alignment: ${String(r)}`)}}}function ln(e,n,a,r){switch(n){case"start":return ue(r)?e.right-a:e.left;case"center":return e.left+e.width/2-a/2;case"end":return ue(r)?e.left:e.right-a;default:{const i=n;throw new Error(`Unknown alignment: ${String(i)}`)}}}function Vr(e){var Ie,Ve;const{width:n,height:a,header:r,label:i,children:l,anchorX:d,anchorY:g,placement:h="left",alignment:p="start",gap:f,actions:x,manageFocus:y=!0,onDragStart:C,onDrag:T,onDragEnd:v}=e,{isOpen:S,close:H,triggerRef:P,id:E,parentId:A}=yt(),{getZIndex:_,portalContainer:L,register:D,unregister:N,bringToFront:G,zIndexVersion:M,closeDescendants:F}=Lr(),m=Sr(),w=Ae(),R=s.useId(),j=`popout-panel-${E}`,K=`popout-title-${R}`,[W,xe]=s.useState(null),U=s.useRef(!1),le=s.useRef(null),V=s.useCallback(()=>{G(E)},[G,E]),{dragTriggerProps:Z,dragOffset:ee,resetDragOffset:je,hasDragged:Le,consumeDragClick:ne}=Gr({isOpen:S,onPress:V,onDragStart:C,onDrag:T,onDragEnd:v}),me=(r==null?void 0:r.variant)==="tabs",X=(r==null?void 0:r.variant)==="tabs"?r:null,ve=(X==null?void 0:X.defaultTab)??((Ie=X==null?void 0:X.tabs[0])==null?void 0:Ie.id),[pe,Be]=s.useState(ve),Oe=f??(A===null?0:Mn),Qe=s.useCallback((z,J)=>{var Y;Be(z),(Y=X==null?void 0:X.onTabChange)==null||Y.call(X,z,J)},[X]),Fe=s.useCallback(z=>{z.stopPropagation(),G(E),!ne()&&F(E)},[F,G,ne,E]),ae=s.useCallback(z=>{F(E),H(z)},[F,H,E]),ge=s.useRef(H);s.useEffect(()=>{ge.current=H});const we=s.useCallback(()=>{ge.current()},[]);s.useEffect(()=>(S?D(E,we,A):N(E),()=>{N(E)}),[S,E,D,N,we,A]);const be=s.useCallback(()=>{const z={trigger:P.current,parent:zr(A),panel:(m==null?void 0:m.anchorRef.current)??null};return{inline:an(d,"x",z),block:an(g,"y",z)}},[P,A,m,d,g]),He=s.useCallback(()=>{var se;const{inline:z,block:J}=be(),Y=z??J,fe=J??z;if(!Y||!fe)return;const Q=(se=le.current)==null?void 0:se.getBoundingClientRect(),Ee=Math.max(n,(Q==null?void 0:Q.width)??0),ce=Math.max(a??0,(Q==null?void 0:Q.height)??0),k=Br(h,w),oe=k==="top"||k==="bottom",Ue=oe?fe:Y,st=oe?Y:fe,Se=Fr(Ue.getBoundingClientRect(),Ee,Oe,{placement:k,alignment:p,panelHeight:ce,crossAnchorRect:st.getBoundingClientRect(),direction:w});xe(De=>De&&De.left===Se.left&&De.top===Se.top?De:Se)},[be,n,a,h,p,Oe,w]);if($.useIsomorphicEffect(()=>{if(!S){xe(null);return}U.current||(je(),me&&Be(ve)),He()},[S,He,je,me,ve]),s.useEffect(()=>{if(!S)return;let z=0;const J=()=>{z===0&&(z=requestAnimationFrame(()=>{z=0,He()}))},Y=new ResizeObserver(J),fe=new MutationObserver(J),{inline:Q,block:Ee}=be();for(const k of new Set([Q,Ee].filter(oe=>oe!==null)))Y.observe(k),fe.observe(k,{attributes:!0,attributeFilter:["style","class"]});le.current&&Y.observe(le.current);const ce=()=>{Le||J()};return window.addEventListener("resize",ce),window.addEventListener("scroll",ce,!0),()=>{z!==0&&cancelAnimationFrame(z),Y.disconnect(),fe.disconnect(),window.removeEventListener("resize",ce),window.removeEventListener("scroll",ce,!0)}},[S,He,be,Le]),s.useEffect(()=>{var z;if(y){if(S){const J=setTimeout(()=>{var Y;(Y=le.current)==null||Y.focus()},0);return()=>{clearTimeout(J)}}U.current&&((z=P.current)==null||z.focus())}},[S,y,P]),s.useEffect(()=>{U.current=S},[S]),!S||!L)return null;const et=_(E),_e={left:((W==null?void 0:W.left)??0)+ee.left,top:((W==null?void 0:W.top)??0)+ee.top},Ne=t.jsxs(o.Paper,{ref:le,id:j,role:"dialog","aria-modal":"false","aria-labelledby":r?K:void 0,"aria-label":r?void 0:i,tabIndex:-1,radius:8,onClick:Fe,"data-testid":"popout-panel","data-popout-id":E,...A&&{"data-parent-id":A},style:{position:"fixed",left:_e.left,top:_e.top,minWidth:n,width:"min-content",...a!==void 0&&{minHeight:a},...W===null&&{visibility:"hidden"},zIndex:et,backgroundColor:"var(--mantine-color-body)",border:"1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.12))",boxShadow:["0 1px 2px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4))","0 4px 8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.35))","0 8px 16px light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.25))"].join(", ")},children:[r?t.jsx(Mr,{config:r,onClose:ae,dragTriggerProps:Z,activeTab:pe,onTabChange:Qe,actions:x,titleId:K}):null,t.jsx(o.Box,{"data-testid":"popout-panel-content",children:me?(Ve=X==null?void 0:X.tabs.find(z=>z.id===pe))==null?void 0:Ve.content:l})]});return wo.createPortal(Ne,L)}function Ur({children:e,action:n="toggle"}){const{open:a,toggle:r,triggerRef:i,isOpen:l,id:d}=yt(),g=s.useCallback(f=>{if(f.stopPropagation(),n==="open"){a(f);return}r(f)},[n,a,r]);if(!s.isValidElement(e))throw new Error("PopoutTrigger requires a single valid React element as its child");const h=`popout-panel-${d}`,p=e;return s.cloneElement(p,{onClick:f=>{var x,y;(y=(x=p.props).onClick)==null||y.call(x,f),g(f)},ref:i,"data-popout-trigger":!0,"aria-expanded":l,"aria-controls":h,"aria-haspopup":"dialog"})}function $r({children:e,opened:n,defaultOpened:a,onOpenChange:r}){const i=jr(),l=(i==null?void 0:i.id)??null;return t.jsx(Hr,{parentId:l,opened:n,defaultOpened:a,onOpenChange:r,children:e})}const Ge=Object.assign($r,{Trigger:Ur,Panel:Vr,Content:Tr,Anchor:Cr}),Wr=s.forwardRef(function({icon:n,size:a="xs",...r},i){const{isOpen:l}=yt();return t.jsx(o.ActionIcon,{ref:i,"data-testid":"popout-button",variant:l?"light":"subtle",size:a,c:l?void 0:"dimmed",...r,children:n})});function Zn({children:e}){return t.jsx(_r,{children:e})}const cn=4,dn=4,Yr=2,Xr=72,Kr=54,qr=220,un=0,Et=100,pn=9,fn=7,Zr=/^#[0-9A-F]{6}$/iu,Jr=1.1;function St(e){const n=e==="start"?dn:0,a=e==="end"?dn:0;return{borderStartStartRadius:n,borderEndStartRadius:n,borderStartEndRadius:a,borderEndEndRadius:a}}function Qr(){const e=ze();return s.useMemo(()=>{var a;return((a=new Intl.NumberFormat(e).formatToParts(Jr).find(r=>r.type==="decimal"))==null?void 0:a.value)??"."},[e])}function Jn({color:e,defaultColor:n,opacity:a,defaultOpacity:r=Et,onColorChange:i,onOpacityChange:l,label:d,showOpacity:g=!0,disabled:h=!1,onFocus:p,onBlur:f}){const x=re(),y=zt(),C=Qr(),T=s.useId(),[v,S]=$.useUncontrolled({value:e,defaultValue:void 0,finalValue:void 0,onChange:i}),[H,P]=$.useUncontrolled({value:a,defaultValue:void 0,finalValue:void 0,onChange:l}),E=v===void 0,A=H===void 0,_=E&&(!g||A),L=v??n,D=H??r,[N,G]=s.useState(L.replace("#","").toUpperCase()),[M,F]=s.useState(D);s.useEffect(()=>{G(L.replace("#","").toUpperCase())},[L]),s.useEffect(()=>{F(D)},[D]);const m=V=>{if(V.length===pn){S(V.slice(0,fn).toUpperCase()),g&&P($t(V.slice(fn,pn)));return}S(V.toUpperCase())},w=()=>`${L}${Wt(D)}`.toUpperCase(),R=V=>{G(V.currentTarget.value.toUpperCase())},j=V=>{const Z=N.toUpperCase(),ee=Z.startsWith("#")?Z:`#${Z}`;Zr.test(ee)&&ee!==L?S(ee,V):G(L.replace("#","").toUpperCase()),f==null||f(V)},K=V=>{F(V)},W=V=>{const Z=typeof M=="string"?y(M):M;if(Number.isNaN(Z)){F(D),f==null||f(V);return}const ee=Math.min(Et,Math.max(un,Z));ee!==D&&P(ee,V),F(ee),f==null||f(V)},xe=V=>{S(void 0,V),g&&P(void 0,V)},U=g?"middle":"end",le=t.jsxs(o.Group,{"data-testid":"compact-color-input",gap:cn,wrap:"nowrap",children:[t.jsxs(o.Group,{gap:0,wrap:"nowrap",children:[t.jsxs(Ge,{children:[t.jsx(Ge.Trigger,{children:t.jsx(o.ActionIcon,{variant:"filled",size:u.CONTROL_HEIGHT,radius:0,style:{backgroundColor:"var(--mantine-color-default)",...St("start")},"data-testid":"compact-color-input-swatch",disabled:h,"aria-label":x.colorSwatch,children:t.jsx(o.ColorSwatch,{color:L,size:u.GLYPH,radius:Yr,style:{border:`1px solid ${b.BORDER}`}})})}),t.jsx(Ge.Panel,{width:qr,header:{variant:"title",title:d??x.colorPanelTitle},placement:"bottom",alignment:"start",gap:cn,children:t.jsx(Ge.Content,{children:t.jsx(o.ColorPicker,{format:"hexa",value:w(),onChange:m,swatches:[...Fn]})})})]}),t.jsx(o.TextInput,{"data-testid":"compact-color-input-hex",disabled:h,value:N,onChange:R,onFocus:p,onBlur:j,"aria-label":x.colorHexValue,"data-is-default":E?"true":"false",w:Xr,styles:{input:{...St(U),fontFamily:"monospace",textTransform:"uppercase",...E?{fontStyle:"italic",color:b.CHROME}:{}}}}),g&&t.jsxs(t.Fragment,{children:[t.jsx(o.Divider,{orientation:"vertical",color:b.BORDER,h:u.CONTROL_HEIGHT,my:0}),t.jsx(o.NumberInput,{"data-testid":"compact-color-input-opacity",disabled:h,value:M,onChange:K,onFocus:p,onBlur:W,min:un,max:Et,decimalSeparator:C,hideControls:!0,suffix:"%","aria-label":x.opacity,"data-is-default":A?"true":"false",w:Kr,styles:{input:{...St("end"),textAlign:"end",...A?{fontStyle:"italic",color:b.CHROME}:{}}}})]})]}),!_&&t.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:b.CHROME,"data-testid":"compact-color-input-reset",disabled:h,"aria-label":x.resetToDefault(d??x.colorGenericName),onClick:xe,children:t.jsx(te,{name:"reset",size:u.CHEVRON})})]});return d===void 0?le:t.jsxs(o.Stack,{"data-testid":"compact-color-input-labelled",gap:0,role:"group","aria-labelledby":T,children:[t.jsx(o.Text,{id:T,"data-testid":"compact-color-input-label",size:"xs",c:b.CHROME,mb:1,lh:1.2,children:d}),le]})}const ft=u.GUTTER,hn=4,ea=1,ta=1.2,na="calc(-1 * var(--mantine-spacing-sm) - 1px)";function oa({label:e,actions:n,children:a,bleed:r=!1}){const i=s.useId(),l=n!=null;return t.jsxs(o.Box,{"data-testid":"control-group",role:"group","aria-labelledby":i,children:[t.jsx(o.Divider,{"data-testid":"control-group-divider",color:b.DIVIDER,size:ea,style:{marginBlockStart:ft,marginBlockEnd:0,marginInline:r?na:void 0}}),t.jsxs(o.Box,{"data-testid":"control-group-header",style:{display:"flex",alignItems:"center",gap:hn,boxSizing:"border-box",paddingBlock:ft,paddingInline:ft},children:[t.jsx(o.Box,{component:"span",id:i,"data-testid":"control-group-label",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--mantine-font-size-xs)",fontWeight:500,lineHeight:ta,color:b.VALUE},children:e}),l&&t.jsx(o.Box,{"data-testid":"control-group-actions",style:{display:"flex",alignItems:"center",gap:hn,flex:"0 0 auto"},children:n})]}),t.jsx(o.Stack,{"data-testid":"control-group-content",gap:0,px:ft,children:a})]})}function Pe(e){const n=s.useRef(void 0);s.useEffect(()=>{process.env.NODE_ENV==="production"||e===void 0||n.current!==e&&(n.current=e,console.warn(e))},[e])}const gn=250,ra=4;function aa({name:e,bubbleId:n}){const{isOpen:a,open:r,close:i}=yt();return t.jsx(Ge.Trigger,{action:"open",children:t.jsx(o.UnstyledButton,{type:"button",title:e,"aria-label":e,"aria-describedby":a?n:void 0,"data-testid":"info-circle",onMouseEnter:r,onMouseLeave:i,onFocus:r,onBlur:i,style:{flex:"0 0 auto",width:u.GLYPH,height:u.GLYPH,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"transparent",color:b.CHROME,cursor:"default"},children:t.jsx(te,{name:"info",size:u.CHEVRON})})})}function Qn({children:e,label:n,opened:a,defaultOpened:r,onOpenChange:i}){const l=re(),d=s.useId(),g=Or()!==null,h=l.about(n),p=t.jsxs(Ge,{opened:a,defaultOpened:r,onOpenChange:i,children:[t.jsx(aa,{name:h,bubbleId:d}),t.jsx(Ge.Panel,{width:gn,label:h,placement:"bottom",alignment:"start",gap:ra,anchorX:"trigger",anchorY:"trigger",manageFocus:!1,children:t.jsx(o.Box,{id:d,w:gn,p:"xs",style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1.4,color:b.PROSE},children:e})})]});return g?p:t.jsx(Zn,{children:p})}function ot(e){return e!=null&&e!==!1}function ye({children:e}){return t.jsx(o.Box,{"data-testid":"trailing-slot",style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center"},children:e})}const eo=s.forwardRef(function(n,a){const{label:r,changed:i=!1,icon:l,onClick:d,disabled:g=!1,loading:h=!1,style:p,...f}=n,x=re(),y=i?x.sectionHasConfiguredValues(r):r,C=i?b.VALUE:b.CHROME;return t.jsx(o.ActionIcon,{...f,ref:a,type:"button",variant:"subtle",color:"gray",size:u.TRAIL,radius:"sm",vars:()=>({root:{"--ai-color":C}}),title:y,"aria-label":y,"aria-busy":h,disabled:g,loading:h,"data-testid":"advanced-button","data-changed":i?"true":"false",onClick:d,style:{flex:"0 0 auto",...p},children:l??t.jsx(te,{name:"gear",size:u.GLYPH})})}),Ct=4,sa=1,xn=6,ia=12,la=1.2;function ca(e){const{label:n,opened:a,defaultOpened:r,onOpenChange:i,hasConfiguredValues:l=!1,empty:d=!1,onAdd:g,info:h,actions:p,children:f}=e,x=re(),y=Ae(),C=s.useId(),T=s.useId(),v=s.useId(),[S,H]=$.useUncontrolled({value:a,defaultValue:r,finalValue:!0,onChange:i}),P=!d&&s.Children.toArray(f).length>0,E=h!=null;Pe(d||P?void 0:`ControlSection "${n}" was given no children, and it holds the rows of a section. Pass the rows, set "empty" to draw it as a single row with a "+", or do not render it: a section header whose chevron opens onto nothing is a dead end for the reader.`);const A=F=>{H(!S,F)},_=S?x.collapseSection(n):x.expandSection(n),L=x.addToSection(n),D=ue(y)?"chevronLeft":"chevronRight",N={flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:b.CHROME},G={display:"flex",alignItems:"center",gap:Ct,flex:"0 1 auto",minWidth:0,height:"100%",background:"transparent",textAlign:"start"},M=t.jsx(o.Box,{component:"span",id:C,title:n,"data-testid":"control-section-name",style:{minWidth:0,fontSize:ia,fontWeight:500,lineHeight:la,color:d?b.CHROME:b.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n});return t.jsxs(o.Box,{role:"group","aria-labelledby":C,"aria-describedby":E?v:void 0,"data-testid":"control-section","data-empty":d?"true":void 0,children:[t.jsx(o.Divider,{"data-testid":"control-section-divider",color:b.DIVIDER,size:sa,my:0,mx:0}),t.jsxs(o.Box,{"data-testid":"control-section-header",style:{display:"flex",alignItems:"center",gap:Ct,boxSizing:"border-box",height:u.SECTION_HEADER,paddingInlineStart:u.PAD_LEFT,paddingInlineEnd:u.PAD_RIGHT},children:[P?t.jsxs(o.UnstyledButton,{type:"button","data-testid":"control-section-toggle","aria-label":_,"aria-expanded":S,"aria-controls":T,onClick:A,style:{...G,cursor:"pointer"},children:[t.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:N,children:t.jsx(te,{name:S?"chevronDown":D,size:u.CHEVRON})}),M]}):t.jsxs(o.Box,{style:G,children:[t.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:N}),M]}),l&&t.jsx(o.Box,{role:"img","aria-label":x.sectionHasConfiguredValues(n),"data-testid":"control-section-dot",style:{flex:"0 0 auto",width:xn,height:xn,borderRadius:"50%",background:b.ACCENT}}),E&&t.jsx(Qn,{label:n,children:h}),t.jsx(o.Box,{style:{flex:"1 1 auto"}}),p!=null&&t.jsx(o.Box,{"data-testid":"control-section-actions",style:{display:"flex",alignItems:"center",gap:Ct,flex:"0 0 auto"},children:p}),d&&g!==void 0&&t.jsx(ye,{children:t.jsx(o.ActionIcon,{type:"button",variant:"subtle",size:u.CONTROL_HEIGHT,radius:"sm",c:b.CHROME,title:L,"aria-label":L,"data-testid":"control-section-add",onClick:g,children:t.jsx(te,{name:"plus",size:u.GLYPH})})})]}),E&&t.jsx(o.Box,{id:v,"data-testid":"control-section-description",hidden:!0,children:h}),P&&t.jsx(o.Collapse,{id:T,in:S,children:t.jsx(o.Box,{"data-testid":"control-section-content",style:{paddingInlineStart:u.PAD_LEFT,paddingInlineEnd:u.PAD_RIGHT,paddingBottom:u.SECTION_PAD_BOTTOM},children:t.jsx(o.Stack,{gap:0,children:f})})})]})}const Tt="control-sub-group",mn=4,da=10,ua=1.2;function pa(e){const{label:n,opened:a,defaultOpened:r,onOpenChange:i,children:l}=e,d=re(),g=Ae(),h=s.useRef(void 0),[p,f]=$.useUncontrolled({value:a,defaultValue:r,finalValue:!1,onChange:i}),x=s.useCallback(S=>{h.current=S},[]),y=s.useCallback(S=>{const H=h.current;h.current=void 0,f(S===Tt,H)},[f]),C=p?d.collapseSection(n):d.expandSection(n);let T="chevronDown";p||(T=ue(g)?"chevronLeft":"chevronRight");const v={item:{border:"none",background:"transparent"},control:{paddingInline:0,paddingBlock:0,minHeight:u.TOGGLE_PITCH,color:b.CHROME},label:{paddingBlock:0,fontSize:"var(--mantine-font-size-xs)",lineHeight:ua,color:b.CHROME},chevron:{marginInlineStart:0,marginInlineEnd:mn,color:b.CHROME},content:{paddingBlock:0,paddingInlineStart:u.GUTTER,paddingInlineEnd:0}};return t.jsx(o.Accordion,{"data-testid":"control-sub-group",value:p?Tt:null,onChange:y,chevronPosition:"left",chevronSize:u.GLYPH_SLOT,disableChevronRotation:!0,chevron:t.jsx(te,{name:T,size:da}),styles:v,children:t.jsxs(o.Accordion.Item,{value:Tt,"data-testid":"control-sub-group-item",children:[t.jsx(o.Accordion.Control,{"data-testid":"control-sub-group-control","aria-label":C,onClick:x,children:t.jsx(o.Box,{component:"span","data-testid":"control-sub-group-label",title:n,style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})}),t.jsx(o.Accordion.Panel,{"data-testid":"control-sub-group-panel",children:t.jsx(o.Box,{"data-testid":"control-sub-group-content",style:{display:"flex",flexDirection:"column",gap:mn},children:l})})]})})}function Je(e){if("key"in e)return{source:"keyboard"};const n=e.nativeEvent;return typeof PointerEvent<"u"&&n instanceof PointerEvent?{source:n.pointerType===""?"keyboard":"pointer"}:{source:n.detail===0?"keyboard":"pointer"}}function fa(e){const n=re();return s.useMemo(()=>({...n,...e}),[n,e])}const ie=-1;function Ze(e,n,a){return Math.min(Math.max(e,n),a)}function ha(e,n,a,r,i){const{rowCount:l,columnCount:d,pageSize:g}=a,h=l-1,p=d-1;if(d===0)return;const f=ue(r)?"ArrowLeft":"ArrowRight",x=ue(r)?"ArrowRight":"ArrowLeft";if(n===f)return{row:e.row,column:Math.min(e.column+1,p)};if(n===x)return{row:e.row,column:Math.max(e.column-1,0)};if(n==="ArrowDown")return{row:Ze(e.row+1,ie,h),column:e.column};if(n==="ArrowUp")return{row:Ze(e.row-1,ie,h),column:e.column};if(n==="Home")return i.jumpToEnd?{row:ie,column:0}:{row:e.row,column:0};if(n==="End")return i.jumpToEnd?{row:Math.max(h,ie),column:p}:{row:e.row,column:p};if(n==="PageDown")return{row:Ze(Math.max(e.row,0)+g,0,Math.max(h,0)),column:e.column};if(n==="PageUp")return{row:Ze(Math.max(e.row,0)-g,0,Math.max(h,0)),column:e.column}}function ga(e,n){const a=n.rowCount-1,r=Math.max(n.columnCount-1,0);return{row:Ze(e.row,ie,Math.max(a,ie)),column:Ze(e.column,0,r)}}function ht(e,n){return e.row===n.row&&e.column===n.column}function xa(e,n,a){const r=Math.min(n,a),i=Math.max(n,a);return e.slice(r,i+1)}function kt(e,n){const a=new Set(e),r=[];for(const i of a)n.includes(i)||r.push(i);for(const i of n)a.has(i)&&r.push(i);return r}function ma(e){const{ids:n,index:a,selected:r,anchor:i,modifiers:l,mode:d}=e,g=n[a];if(d==="none"||g===void 0)return{selected:[...r],anchor:i};if(d==="single")return{selected:[g],anchor:g};const h=i===void 0?-1:n.indexOf(i);if(l.extend&&h!==-1){const p=xa(n,h,a);return{selected:l.toggle?kt([...r,...p],n):p,anchor:i}}if(l.toggle){const p=new Set(r);return p.has(g)?p.delete(g):p.add(g),{selected:kt(p,n),anchor:g}}return{selected:[g],anchor:g}}function ba(e,n,a){return a!=="multiple"?{selected:[...n],anchor:void 0}:{selected:kt([...n,...e],e),anchor:e[0]}}function bn(e,n){return e==null?"":typeof e=="string"?e:typeof e=="number"?Number.isFinite(e)?n.number.format(e):"":typeof e=="boolean"?e?n.yes:n.no:Number.isNaN(e.getTime())?"":n.date.format(e)}function yn(e){return e==null?!0:typeof e=="number"?!Number.isFinite(e):e instanceof Date&&Number.isNaN(e.getTime())}function ya(e,n,a){const r=yn(e),i=yn(n);return r||i?r&&i?0:r?-1:1:typeof e=="number"&&typeof n=="number"?e-n:typeof e=="boolean"&&typeof n=="boolean"?e===n?0:e?1:-1:e instanceof Date&&n instanceof Date?e.getTime()-n.getTime():a.compare(String(e),String(n))}const va=de.tableFeatures({columnFilteringFeature:de.columnFilteringFeature,columnOrderingFeature:de.columnOrderingFeature,columnVisibilityFeature:de.columnVisibilityFeature,filteredRowModel:de.createFilteredRowModel(),globalFilteringFeature:de.globalFilteringFeature,rowSelectionFeature:de.rowSelectionFeature,rowSortingFeature:de.rowSortingFeature,sortedRowModel:de.createSortedRowModel()}),wa=320,Ia=8,Ea=12,Sa=1.2,Ca="var(--mantine-primary-color-light)",vn="mantine-focus-auto",Rt=[],Ta=[];function wn(e){return e==="asc"?"ascending":e==="desc"?"descending":"none"}function Ra(e,n,a){return Math.min(Math.max(e,n),a)}function Pa(e,n){const{data:a,columns:r,getRowId:i,label:l,labelledBy:d,labels:g,height:h=wa,rowHeight:p=u.DATA_PITCH,headerHeight:f=u.CONTROL_HEIGHT,overscan:x=Ia,selectionMode:y="multiple",selectedIds:C,defaultSelectedIds:T,onSelectionChange:v,sorting:S,defaultSorting:H,onSortingChange:P,hiddenColumns:E,defaultHiddenColumns:A,onHiddenColumnsChange:_,columnOrder:L,defaultColumnOrder:D,onColumnOrderChange:N,filter:G,defaultFilter:M,onFilterChange:F,searchable:m=!1,onRowClick:w,onRowDoubleClick:R,onRowContextMenu:j,onFocus:K,onBlur:W,empty:xe}=e,U=fa(g),le=Ae(),V=ze(),Z=Ye(),ee=Wn({numeric:!0,sensitivity:"variant"}),je=s.useMemo(()=>new Intl.DateTimeFormat(V),[V]),Le=s.useMemo(()=>({number:Z,date:je,yes:U.yes,no:U.no}),[Z,je,U.yes,U.no]),[ne,me]=$.useUncontrolled({value:C,defaultValue:T,finalValue:Rt,onChange:(c,I)=>{v==null||v([...c],I)}}),[X,ve]=$.useUncontrolled({value:S,defaultValue:H,finalValue:Ta,onChange:(c,I)=>{P==null||P([...c],I)}}),[pe,Be]=$.useUncontrolled({value:E,defaultValue:A,finalValue:Rt,onChange:(c,I)=>{_==null||_([...c],I)}}),[Oe,Qe]=$.useUncontrolled({value:L,defaultValue:D,finalValue:Rt,onChange:(c,I)=>{N==null||N([...c],I)}}),[Fe,ae]=$.useUncontrolled({value:G,defaultValue:M,finalValue:"",onChange:(c,I)=>{F==null||F(c,I)}}),ge=s.useMemo(()=>{const c=new Map;for(const I of r)c.set(I.id,I);return c},[r]),we=JSON.stringify(pe),be=s.useMemo(()=>{const c=new Set(pe);return r.filter(I=>(I.filterable??!0)&&!c.has(I.id)).map(I=>I.id)},[r,we]),He=s.useMemo(()=>{const c=Fe.trim();if(c!=="")return{query:c.toLocaleLowerCase(V),columnIds:be}},[Fe,V,be]),et=s.useMemo(()=>[...a],[a]),_e=s.useMemo(()=>r.map(c=>({id:c.id,accessorFn:I=>c.value(I),enableSorting:c.sortable??!0,enableHiding:c.hideable??!0,enableGlobalFilter:c.filterable??!0,sortDescFirst:c.descendingFirst,sortFn:(I,O)=>ya(c.value(I.original),c.value(O.original),ee)})),[r,ee]),at=JSON.stringify(X),Xe=s.useMemo(()=>X.map(c=>({id:c.id,desc:c.desc})),[at]),Ne=s.useMemo(()=>{const c={};for(const I of pe)c[I]=!1;return c},[pe]),Ie=s.useMemo(()=>{const c={};for(const I of ne)c[I]=!0;return c},[ne]),Ve=s.useMemo(()=>[...Oe],[Oe]),z=s.useRef(void 0),J=de.useTable({features:va,data:et,columns:_e,getRowId:i,enableRowSelection:y!=="none",enableMultiRowSelection:y==="multiple",getColumnCanGlobalFilter:()=>!0,globalFilterFn:(c,I,O)=>{const B=O;if(B===void 0||!B.columnIds.includes(I))return!1;const q=ge.get(I);return q===void 0?!1:bn(q.value(c.original),Le).toLocaleLowerCase(V).includes(B.query)},state:{sorting:Xe,columnVisibility:Ne,columnOrder:Ve,rowSelection:Ie,globalFilter:He},onSortingChange:c=>{const I=de.functionalUpdate(c,Xe);ve(I.map(O=>({id:O.id,desc:O.desc})),z.current)},onColumnVisibilityChange:c=>{const I=de.functionalUpdate(c,Ne);Be(Object.keys(I).filter(O=>!I[O]))},onColumnOrderChange:c=>{Qe(de.functionalUpdate(c,Ve))},onRowSelectionChange:c=>{me(Object.keys(de.functionalUpdate(c,Ie)))}}),{rows:Y}=J.getRowModel(),fe=J.getVisibleLeafColumns(),Q=Y.length,Ee=fe.length,ce=s.useMemo(()=>Y.map(c=>c.id),[Y]),k=s.useRef(null),oe=s.useRef(null),Ue=Io.useVirtualizer({count:Q,getScrollElement:()=>k.current,estimateSize:()=>p,getItemKey:c=>ce[c]??c,overscan:x}),[st,Se]=s.useState({row:ie,column:0}),se=s.useMemo(()=>ga(st,{rowCount:Q,columnCount:Ee}),[st,Q,Ee]),De=s.useRef(!1),vt=s.useRef(void 0),go=c=>{c.row>=0&&Ue.scrollToIndex(c.row),De.current=!0,Se(I=>ht(I,c)?I:c)};s.useLayoutEffect(()=>{var O;if(!De.current)return;const c=`[data-grid-row="${se.row}"][data-grid-column="${se.column}"]`,I=(O=oe.current)==null?void 0:O.querySelector(c);I instanceof HTMLElement&&(De.current=!1,I.focus())});const qt=(c,I)=>{vt.current=c.anchor,!(c.selected.length===ne.length&&c.selected.every((B,q)=>B===ne[q]))&&me(c.selected,I)},it=(c,I,O)=>{qt(ma({ids:ce,index:c,selected:ne,anchor:vt.current,modifiers:I,mode:y}),O)},Zt=(c,I,O)=>{const B=Y[c];B!==void 0&&(w==null||w(B.original,I,O))},xo=(c,I)=>{c.getCanSort()&&(z.current=I,c.toggleSorting(void 0,I.shiftKey&&c.getCanMultiSort()),z.current=void 0)},mo=()=>{var O;const c=((O=k.current)==null?void 0:O.clientHeight)??0,I=Math.floor((c===0?p*10:c)/p);return Math.max(1,I-1)},bo=c=>{const I=y==="multiple",O=c.ctrlKey||c.metaKey;if(I&&O&&(c.key==="a"||c.key==="A")){c.preventDefault(),qt(ba(ce,ne,y),c);return}if(se.row>=0&&(c.key===" "||c.key==="Enter")){c.preventDefault(),c.key===" "?it(se.row,{extend:c.shiftKey,toggle:!c.shiftKey},c):(it(se.row,{extend:!1,toggle:!1},c),Zt(se.row,c,{source:"keyboard"}));return}const B=ha(se,c.key,{rowCount:Q,columnCount:Ee,pageSize:mo()},le,{jumpToEnd:O});B!==void 0&&(c.preventDefault(),go(B),I&&c.shiftKey&&B.row>=0&&B.row!==se.row&&it(B.row,{extend:!0,toggle:!1},c))};s.useImperativeHandle(n,()=>({scrollToRow:c=>{c>=0&&c<Q&&Ue.scrollToIndex(c)},setColumnHidden:(c,I)=>{var O;(O=J.getColumn(c))==null||O.toggleVisibility(!I)},moveColumn:(c,I)=>{const O=J.getAllLeafColumns().map(q=>q.id),B=O.indexOf(c);B!==-1&&(O.splice(B,1),O.splice(Ra(I,0,O.length),0,c),J.setColumnOrder(O))},clearSelection:()=>{vt.current=void 0,me([])}}),[J,Ue,Q,me]);const yo=fe.reduce((c,I)=>{var O;return c+(((O=ge.get(I.id))==null?void 0:O.width)??u.FIELD)},0),Jt=(c,I)=>{const O=(c==null?void 0:c.width)??u.FIELD;return{flex:I===Ee-1?`1 1 ${String(O)}px`:`0 0 ${String(O)}px`,minWidth:0,boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:(c==null?void 0:c.align)==="end"?"flex-end":"flex-start",paddingInline:u.GUTTER,outlineOffset:-2,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},lt=y!=="none",Qt=U.rowsShown(Z.format(Q),Z.format(a.length)),vo=()=>xe!==void 0?xe:a.length===0?U.noRows:U.noMatchingRows;return t.jsxs(o.Box,{"data-testid":"data-table",dir:ue(le)?"rtl":void 0,onFocus:K,onBlur:W,style:{display:"flex",flexDirection:"column",gap:u.TRAIL_GAP,width:"100%",color:b.VALUE},children:[m&&t.jsxs(o.Box,{style:{display:"flex",alignItems:"center",gap:u.GUTTER},children:[t.jsx(o.TextInput,{"data-testid":"data-table-search",size:"xs",type:"search","aria-label":U.search,placeholder:U.searchPlaceholder,value:Fe,onChange:c=>{ae(c.currentTarget.value,c)},rightSection:Fe===""?void 0:t.jsx(o.ActionIcon,{"data-testid":"data-table-search-clear",variant:"subtle",size:u.CONTROL_HEIGHT,"aria-label":U.clearSearch,onClick:c=>{ae("",c)},children:t.jsx(te,{name:"close",size:u.CHEVRON})}),rightSectionPointerEvents:"all",style:{flex:"1 1 auto",minWidth:0}}),t.jsx(o.Box,{component:"span","data-testid":"data-table-count","aria-hidden":"true",dir:"auto",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",color:b.CHROME},children:Qt})]}),t.jsxs(o.VisuallyHidden,{role:"status","aria-live":"polite",dir:"auto","data-testid":"data-table-status",children:[Qt,lt&&ne.length>0?` ${U.rowsSelected(Z.format(ne.length))}`:""]}),t.jsxs(o.Box,{ref:k,"data-testid":"data-table-viewport",style:{height:h,overflow:"auto",position:"relative",border:`1px solid ${b.BORDER}`,borderRadius:"var(--mantine-radius-sm)",background:b.PANEL},children:[t.jsxs(o.Table,{ref:oe,role:"grid","aria-label":d===void 0&&l===void 0?U.dataTable:l,"aria-labelledby":d,"aria-rowcount":Q+1,"aria-colcount":Ee,"aria-multiselectable":y==="multiple"?!0:void 0,onKeyDown:bo,stickyHeader:!0,tabularNums:!0,withRowBorders:!1,horizontalSpacing:0,verticalSpacing:0,highlightOnHover:lt,highlightOnHoverColor:b.SURFACE,style:{display:"grid",width:"100%",minWidth:yo,fontSize:Ea,lineHeight:Sa},children:[t.jsx(o.Table.Thead,{style:{display:"grid",position:"sticky",insetBlockStart:0,zIndex:1,background:b.PANEL,borderBlockEnd:`1px solid ${b.DIVIDER}`},children:t.jsx(o.Table.Tr,{role:"row","aria-rowindex":1,style:{display:"flex",width:"100%",height:f},children:fe.map((c,I)=>{const O=ge.get(c.id),B=c.getCanSort(),q=c.getIsSorted(),he=se.row===ie&&se.column===I,ct=q===!1?-1:c.getSortIndex(),dt=he?0:-1,tt=t.jsxs(t.Fragment,{children:[t.jsx(o.Box,{component:"span","data-testid":"data-table-header-label",dir:"auto",title:O==null?void 0:O.header,style:{flex:"0 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:q===!1?void 0:b.VALUE},children:(O==null?void 0:O.header)??c.id}),q!==!1&&t.jsx(o.Box,{component:"span","data-testid":"data-table-sort-glyph","data-direction":wn(q),"aria-hidden":"true",style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:b.VALUE,transform:q==="asc"?"rotate(180deg)":void 0},children:t.jsx(te,{name:"chevronDown",size:u.CHEVRON})}),Xe.length>1&&ct>=0&&t.jsx(o.Box,{component:"span","data-testid":"data-table-sort-priority","aria-hidden":"true",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-xs)",color:b.CHROME},children:Z.format(ct+1)})]});return t.jsx(o.Table.Th,{scope:"col","data-testid":"data-table-header","aria-colindex":I+1,"aria-sort":B?wn(q):void 0,"data-grid-row":B?void 0:ie,"data-grid-column":B?void 0:I,tabIndex:B?void 0:dt,className:B?void 0:vn,onFocus:B?void 0:()=>{Se(Ce=>ht(Ce,{row:ie,column:I})?Ce:{row:ie,column:I})},style:{...Jt(O,I),gap:u.GUTTER/2,height:f,fontSize:"var(--mantine-font-size-sm)",fontWeight:500,color:b.CHROME,textAlign:"start"},children:B?t.jsx(o.UnstyledButton,{type:"button","data-testid":"data-table-sort-button","data-grid-row":ie,"data-grid-column":I,tabIndex:dt,onClick:Ce=>{Se({row:ie,column:I}),xo(c,Ce)},onFocus:()=>{Se(Ce=>ht(Ce,{row:ie,column:I})?Ce:{row:ie,column:I})},style:{display:"flex",alignItems:"center",gap:u.GUTTER/2,justifyContent:(O==null?void 0:O.align)==="end"?"flex-end":"flex-start",flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",outlineOffset:-2,cursor:"pointer"},children:tt}):tt},c.id)})})}),t.jsx(o.Table.Tbody,{style:{display:"grid",position:"relative",height:Ue.getTotalSize()},children:Ue.getVirtualItems().map(c=>{const I=Y[c.index];if(I===void 0)return null;const O=ne.includes(I.id);return t.jsx(o.Table.Tr,{role:"row","data-testid":"data-table-row","data-index":c.index,"data-selected":O?"true":void 0,"aria-rowindex":c.index+2,"aria-selected":lt?O:void 0,onDoubleClick:B=>{R==null||R(I.original,B)},onContextMenu:B=>{j==null||j(I.original,B)},style:{display:"flex",position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:p,transform:`translateY(${String(c.start)}px)`,background:O?Ca:void 0,cursor:lt?"pointer":void 0},children:fe.map((B,q)=>{const he=ge.get(B.id),ct=se.row===c.index&&se.column===q,dt=he==null?void 0:he.value(I.original),tt=bn(dt,Le),Ce=(he==null?void 0:he.cell)===void 0?t.jsx(o.Box,{component:"span",dir:"auto",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:tt}):he.cell(I.original);return t.jsx(o.Table.Td,{role:"gridcell","data-testid":"data-table-cell","aria-colindex":q+1,"data-grid-row":c.index,"data-grid-column":q,tabIndex:ct?0:-1,className:vn,title:(he==null?void 0:he.cell)===void 0?tt:void 0,onFocus:()=>{Se(Te=>ht(Te,{row:c.index,column:q})?Te:{row:c.index,column:q})},onClick:Te=>{Se({row:c.index,column:q}),it(c.index,{extend:Te.shiftKey,toggle:Te.metaKey||Te.ctrlKey},Te),Zt(c.index,Te,Je(Te))},style:Jt(he,q),children:Ce},B.id)})},I.id)})})]}),Q===0&&t.jsx(o.Box,{"data-testid":"data-table-empty",style:{display:"flex",alignItems:"center",justifyContent:"center",padding:u.PAD_LEFT,fontSize:"var(--mantine-font-size-sm)",color:b.CHROME},children:vo()})]})]})}const Aa=s.forwardRef(Pa);function ja(){return crypto.randomUUID().slice(0,8)}function mt(e,n){return{id:ja(),offset:e,color:n}}function to(){return[mt(0,"#6366F1"),mt(1,"#06B6D4")]}const La=2,Oa=5,Ha=80,_a=0,Pt=100,At=0,Na=360,Da=[0,90,180,270,360];function ka({stops:e,defaultStops:n,direction:a,defaultDirection:r=At,showDirection:i=!0,onChange:l,onChangeStart:d,onChangeEnd:g,minStops:h=La,maxStops:p=Oa}){const f=re(),x=Ye({maximumFractionDigits:0}),y=s.useId(),C=s.useId(),T=s.useMemo(()=>to(),[]),[v,S]=$.useUncontrolled({value:e,defaultValue:n,finalValue:T,onChange:(m,w)=>{l==null||l(m,H,w)}}),[H,P]=$.useUncontrolled({value:a,defaultValue:r,finalValue:At,onChange:(m,w)=>{l==null||l(v,m,w)}}),E=s.useRef(!1),A=m=>{E.current||(E.current=!0,d==null||d(m))},_=(m,w)=>{E.current=!1,g==null||g(m,w)},L=(m,w)=>v.map((R,j)=>j===m?{...R,color:w}:R),D=(m,w)=>v.map((R,j)=>j===m?{...R,offset:w/Pt}:R),N=m=>{if(v.length>=p)return;const w=v[v.length-1],R=w===void 0?.5:(w.offset+1)/2,j=[...v,mt(R,xt)];j.sort((K,W)=>K.offset-W.offset),S(j,m)},G=(m,w)=>{v.length<=h||S(v.filter((R,j)=>j!==m),w)},M=v.length>=p,F=v.length<=h;return t.jsxs(o.Stack,{"data-testid":"gradient-editor",gap:"xs",children:[t.jsxs(o.Group,{justify:"space-between",align:"center",children:[t.jsx(o.Text,{id:y,"data-testid":"gradient-editor-heading",size:"xs",c:b.CHROME,children:f.colorStops}),t.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,"data-testid":"gradient-editor-add-stop",onClick:N,disabled:M,"aria-label":f.addColorStop,children:t.jsx(te,{name:"plus",size:u.CHEVRON})})]}),t.jsx(o.Stack,{"data-testid":"gradient-editor-stops",gap:"xs",role:"group","aria-labelledby":y,children:v.map((m,w)=>{const R=x.format(w+1);return t.jsxs(o.Group,{"data-testid":"gradient-editor-stop",gap:"xs",align:"flex-end",wrap:"nowrap",children:[t.jsx(Jn,{color:m.color,defaultColor:xt,onColorChange:(j,K)=>{S(L(w,j??xt),K)},showOpacity:!1}),t.jsx(o.Box,{style:{width:Ha},children:t.jsx(o.Slider,{"data-testid":"gradient-editor-stop-position",min:_a,max:Pt,value:m.offset*Pt,onPointerDown:A,onChange:j=>{A(),S(D(w,j))},onChangeEnd:j=>{_(D(w,j),H)},label:j=>f.percent(x.format(j)),thumbLabel:f.colorStopPosition(R)})}),t.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,onClick:j=>{G(w,j)},"data-testid":"gradient-editor-remove-stop",disabled:F,"aria-label":f.removeColorStop(R),children:t.jsx(te,{name:"minus",size:u.CHEVRON})})]},m.id)})}),i&&t.jsxs(o.Box,{"data-testid":"gradient-editor-direction",pb:"md",role:"group","aria-labelledby":C,children:[t.jsx(o.Text,{id:C,"data-testid":"gradient-editor-direction-heading",size:"xs",c:b.CHROME,mb:4,children:f.direction}),t.jsx(o.Slider,{"data-testid":"gradient-editor-direction-slider",min:At,max:Na,value:H,onPointerDown:A,onChange:m=>{A(),P(m)},onChangeEnd:m=>{_(v,m)},label:m=>f.degrees(x.format(m)),thumbLabel:f.gradientDirection,marks:Da.map(m=>({value:m,label:f.degrees(x.format(m))}))})]})]})}const Ga=4,Ma=2,za=1.1;function Ba(){const e=ze();return s.useMemo(()=>{var a;return((a=new Intl.NumberFormat(e).formatToParts(za).find(r=>r.type==="decimal"))==null?void 0:a.value)??"."},[e])}function Fa({label:e,value:n,defaultValue:a,onChange:r,min:i,max:l,step:d,decimalScale:g,suffix:h,hideControls:p=!0,disabled:f=!1,onFocus:x,onBlur:y}){const C=re(),T=zt(),v=Ba(),[S,H]=$.useUncontrolled({value:n,defaultValue:void 0,finalValue:void 0,onChange:r}),P=S===void 0,E=S??a,[A,_]=s.useState(E),L=s.useRef(!1);s.useEffect(()=>{L.current||_(S??a),L.current=!1},[S,a]);const D=M=>{L.current=!0,_(M)},N=M=>{const F=typeof A=="string"?T(A):A;if(Number.isNaN(F)){_(S??a),y==null||y(M);return}let m=F;i!==void 0&&m<i&&(m=i),l!==void 0&&m>l&&(m=l),m!==S&&H(m,M),_(m),y==null||y(M)},G=M=>{H(void 0,M)};return t.jsxs(o.Group,{"data-testid":"style-number-input",gap:Ga,wrap:"nowrap",align:"flex-end",children:[t.jsx(o.NumberInput,{"data-testid":"style-number-input-field",label:e,value:A,onChange:D,onFocus:x,onBlur:N,min:i,max:l,step:d,decimalScale:g,decimalSeparator:v,suffix:h,hideControls:p,disabled:f,"data-is-default":P?"true":"false",styles:{input:P?{fontStyle:"italic",color:b.CHROME}:void 0},style:{flex:1}}),!P&&t.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:b.CHROME,"data-testid":"style-number-input-reset",disabled:f,"aria-label":C.resetToDefault(e),onClick:G,style:{marginBlockEnd:Ma},children:t.jsx(te,{name:"reset",size:u.CHEVRON})})]})}const Va=4,Ua=2;function $a({label:e,value:n,defaultValue:a,options:r,onChange:i,disabled:l=!1,onFocus:d,onBlur:g}){const h=re(),[p,f]=$.useUncontrolled({value:n,defaultValue:void 0,finalValue:void 0,onChange:i}),x=p===void 0,y=p??a,C=v=>{v!==null&&f(v)},T=v=>{f(void 0,v)};return t.jsxs(o.Group,{"data-testid":"style-select",gap:Va,wrap:"nowrap",align:"flex-end",children:[t.jsx(o.Select,{"data-testid":"style-select-field",label:e,value:y,onChange:C,onFocus:d,onBlur:g,data:r,rightSection:t.jsx(te,{name:"chevronDown",size:u.GLYPH}),rightSectionPointerEvents:"none",disabled:l,"data-is-default":x?"true":"false",allowDeselect:!1,styles:{input:x?{fontStyle:"italic",color:b.CHROME}:void 0},style:{flex:1}}),!x&&t.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:b.CHROME,"data-testid":"style-select-reset",disabled:l,"aria-label":h.resetToDefault(e),onClick:T,style:{marginBlockEnd:Ua},children:t.jsx(te,{name:"reset",size:u.CHEVRON})})]})}const jt=4,Wa=`${String(u.TOGGLE_PITCH)}px`;function Ya({label:e,checked:n,defaultChecked:a,onChange:r,disabled:i=!1,onFocus:l,onBlur:d,children:g}){const h=s.useId(),[p,f]=$.useUncontrolled({value:n,defaultValue:a,finalValue:!1,onChange:r}),x=C=>{f(C.currentTarget.checked,C)},y={root:{minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:jt,fontSize:"var(--mantine-font-size-sm)",lineHeight:Wa,color:i?b.DISABLED:b.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}};return t.jsxs(o.Box,{"data-testid":"toggle-with-content","data-checked":p?"true":"false","data-disabled":i?"true":void 0,style:{display:"flex",flexDirection:"column",gap:jt},children:[t.jsx(o.Checkbox,{"data-testid":"toggle-with-content-checkbox",label:e,checked:p,disabled:i,"aria-expanded":p,"aria-controls":p?h:void 0,onChange:x,onFocus:l,onBlur:d,wrapperProps:{title:e},styles:y}),p&&t.jsx(o.Box,{id:h,"data-testid":"toggle-with-content-children",style:{display:"flex",flexDirection:"column",gap:jt,paddingInlineStart:u.GUTTER},children:g})]})}function no(e,n){return e!==void 0?e:n===void 0?"off":"polite"}function Me(e,n){const a=no(e,n);return a==="off"?{"aria-busy":n}:{"aria-live":a,"aria-atomic":!0,"aria-busy":n}}const Lt=4,Xa="(hover: none)";function Ka(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e)}function qa(e){const{state:n,stateTitle:a,busy:r,live:i,actions:l,residentActions:d,actionsVisible:g,onClick:h,onFocus:p,onBlur:f}=e,x=Me(i,r),{hovered:y,ref:C}=$.useHover(),T=$.useMediaQuery(Xa)??!1,[v,S]=s.useState(!1),H=s.useId(),P=v||(g??(y||T)),E=l!==void 0||d!==void 0,A=Ka(n),_=a!==void 0&&a!==A,L=a??A,D=E&&n!==void 0,N=_?t.jsxs(t.Fragment,{children:[t.jsx("span",{"aria-hidden":"true",children:n}),t.jsx(o.VisuallyHidden,{"data-testid":"action-row-state-full",children:a})]}):n;Pe(h!==void 0&&n===void 0?"ActionRow was given onClick but no state, and its own activation is carried by the text it reports. That text is also what names the row for a screen reader, so a row with nothing to report has nothing to activate. Give the row a state, or put the action on a control in actions.":void 0);const G=R=>{S(!0),p==null||p(R)},M=R=>{R.currentTarget.contains(R.relatedTarget)||S(!1),f==null||f(R)},F=R=>{h==null||h(R,Je(R))},m={flex:"1 1 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:b.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},w={...m,alignSelf:"stretch",lineHeight:`${u.ROW_PITCH}px`,textAlign:"start",borderRadius:"var(--mantine-radius-sm)"};return t.jsxs(o.Box,{ref:C,"data-testid":"action-row",role:D?"group":void 0,"aria-labelledby":D?H:void 0,onFocus:G,onBlur:M,style:{display:"flex",alignItems:"center",justifyContent:"space-between",boxSizing:"border-box",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[n!==void 0&&(h===void 0?t.jsx(o.Box,{component:"span",id:H,"data-testid":"action-row-state",title:L,...x,style:m,children:N}):t.jsx(o.UnstyledButton,{type:"button",id:H,"data-testid":"action-row-state",title:L,...x,onClick:F,style:w,children:N})),E&&t.jsxs(o.Box,{"data-testid":"action-row-affordances",style:{flex:"0 0 auto",marginInlineStart:"auto",display:"flex",alignItems:"center",gap:Lt},children:[l!==void 0&&t.jsx(o.Box,{"data-testid":"action-row-actions","data-visible":P?"true":"false",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Lt,opacity:P?1:0,pointerEvents:P?void 0:"none"},children:l}),d!==void 0&&t.jsx(o.Box,{"data-testid":"action-row-resident-actions",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Lt},children:d})]})]})}const oo=u.GUTTER,Za=12,ro=1.2,Ja=20,Qa=500,es="var(--mantine-primary-color-light)";function ts({name:e,value:n,icon:a,selected:r=!1,role:i="button",tabIndex:l,onClick:d,onDoubleClick:g,onContextMenu:h,onFocus:p,onBlur:f,trailing:x}){const{hovered:y,ref:C}=$.useHover(),T=d!==void 0,v=a!=null,S=n!=null,H=ot(x),P=i==="option",E=P?r:void 0,A=!P&&r?!0:void 0,_=G=>{d==null||d(G,Je(G))};let L="transparent";r?L=es:T&&y&&(L=b.SURFACE);const D=t.jsxs(t.Fragment,{children:[v&&t.jsx(o.Box,{component:"span","data-testid":"data-row-icon",style:{flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:b.CHROME},children:a}),t.jsx(o.Box,{component:"span","data-testid":"data-row-name",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),S&&t.jsx(o.Box,{component:"span","data-testid":"data-row-value",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",color:b.CHROME},children:n})]}),N={display:"flex",alignItems:"center",gap:u.GUTTER,flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",cursor:T?"pointer":"default"};return t.jsxs(o.Box,{ref:C,"data-testid":"data-row","data-selected":r?"true":void 0,onDoubleClick:g,onContextMenu:h,style:{display:"flex",alignItems:"center",gap:u.TRAIL_GAP,boxSizing:"border-box",width:"100%",height:u.DATA_PITCH,paddingInline:oo,borderRadius:"var(--mantine-radius-sm)",background:L,color:b.VALUE,fontSize:Za,lineHeight:ro},children:[T?t.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-button",role:P?"option":void 0,"aria-current":A,"aria-selected":E,tabIndex:l,onClick:_,onFocus:p,onBlur:f,style:N,children:D}):t.jsx(o.Box,{"data-testid":"data-row-body",role:P?"option":void 0,"aria-current":A,"aria-selected":E,tabIndex:l,onFocus:p,onBlur:f,style:N,children:D}),H&&t.jsx(ye,{children:x})]})}function ns({label:e,unit:n,sortDirection:a,defaultSortDirection:r,onSortChange:i,sortPriority:l}){const[d,g]=$.useUncontrolled({value:a,defaultValue:r,finalValue:"none",onChange:i}),h=Ye(),p=i!==void 0,f=d!=="none",x=T=>{g(d==="ascending"?"descending":"ascending",T)},y=t.jsxs(t.Fragment,{children:[t.jsx(o.Box,{component:"span","data-testid":"data-row-header-label",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:f?b.VALUE:void 0},children:e}),n!==void 0&&t.jsx(o.Box,{component:"span","data-testid":"data-row-header-unit",style:{flex:"0 0 auto",whiteSpace:"nowrap"},children:n}),l!==void 0&&f&&t.jsx(o.Box,{component:"span","aria-hidden":"true",style:{flex:"0 0 auto",display:"flex"},children:t.jsx(Kt,{children:h.format(l)})}),f&&t.jsx(o.Box,{component:"span","data-testid":"data-row-header-sort-glyph","data-direction":d,style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:b.VALUE,transform:d==="ascending"?"rotate(180deg)":void 0},children:t.jsx(te,{name:"chevronDown",size:u.CHEVRON})})]}),C=p||f;return t.jsx(o.Box,{"data-testid":"data-row-header",role:C?"columnheader":void 0,"aria-sort":C?d:void 0,style:{display:"flex",alignItems:"center",gap:u.GUTTER,boxSizing:"border-box",width:"100%",height:Ja,paddingInline:oo,fontSize:"var(--mantine-font-size-sm)",lineHeight:ro,color:b.CHROME},children:p?t.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-header-sort",onClick:x,style:{display:"flex",alignItems:"center",gap:u.GUTTER,flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",cursor:"pointer"},children:y}):y})}function Kt({children:e}){return t.jsx(o.Badge,{component:"span","data-testid":"rank-chip",style:{flex:"0 0 auto",background:b.RAISED,color:b.VALUE,fontWeight:Qa,textTransform:"none",letterSpacing:"normal"},children:e})}const In=2,os=1,rs=13,as=2,ss=1,is=1,ls=64,ao=4,En=ao/2,so=4,cs=12,We=100,ds=1.5,Gt=100;function bt({children:e,end:n,id:a}){return t.jsx(o.Box,{component:"span",id:a,"data-testid":`chart-axis-${n}`,style:{flex:"0 0 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:b.CHROME,whiteSpace:"nowrap"},children:e})}function io(){return t.jsx(o.Box,{"data-testid":"chart-baseline",style:{flex:"0 0 auto",height:os,background:b.BORDER}})}function lo({caption:e,rows:n,testId:a}){return t.jsxs(o.VisuallyHidden,{component:"table","data-testid":a,children:[e!==void 0&&t.jsx("caption",{children:e}),t.jsx("tbody",{children:n.map(r=>t.jsxs("tr",{children:[t.jsx("th",{scope:"row",children:r.header}),t.jsx("td",{children:r.value})]},r.id))})]})}function us(e,n){if(e.length===0)return null;const a=We/2;if(e.length===1)return`0,${a} ${We},${a}`;const r=Math.min(...e),l=Math.max(...e)-r,d=e.length-1;return e.map((g,h)=>{const p=Dr(h/d,We,n),f=l===0?a:We-(g-r)/l*We;return`${p},${f}`}).join(" ")}function co(){const e=s.useId(),n=`${e}min`,a=`${e}max`;return{min:n,max:a,describedBy:`${n} ${a}`}}function ps({bins:e,label:n,minLabel:a,maxLabel:r,busy:i,live:l,trailing:d}){const g=Ye(),h=co(),p=e.reduce((x,y)=>Math.max(x,y.count,0),0),f=e.map((x,y)=>({id:`${x.label}-${String(y)}`,header:x.label,value:g.format(x.count)}));return t.jsxs(o.Box,{"data-testid":"histogram-row","aria-busy":i,style:{display:"flex",alignItems:"flex-start",gap:u.TRAIL_GAP,height:u.HISTOGRAM_HEIGHT},children:[t.jsxs(o.Box,{"data-testid":"histogram-chart",...Me(l,i),style:{flex:"1 1 auto",minWidth:0,height:"100%",display:"flex",flexDirection:"column",gap:In},children:[t.jsxs(o.Box,{"data-testid":"histogram-drawing",role:n===void 0?void 0:"img","aria-label":n,"aria-describedby":n===void 0?void 0:h.describedBy,"aria-hidden":n===void 0?!0:void 0,style:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column",gap:In},children:[t.jsx(o.Box,{"data-testid":"histogram-plot",style:{flex:"1 1 auto",minHeight:0,display:"flex",alignItems:"flex-end",gap:as},children:e.map((x,y)=>{const C=Math.max(0,x.count),T=p===0?0:C/p*Gt,v=x.highlighted===!0;return t.jsx(o.Box,{"data-testid":"histogram-bar","data-highlighted":v?"true":"false","aria-hidden":"true",title:x.label,style:{flex:"1 1 0",minWidth:0,height:`${String(T)}%`,minHeight:C>0?is:0,background:v?b.ACCENT:b.BORDER,borderRadius:ss}},`${x.label}-${String(y)}`)})}),t.jsx(io,{})]}),t.jsxs(o.Box,{"data-testid":"chart-axis",style:{flex:"0 0 auto",height:rs,display:"flex",alignItems:"center",justifyContent:"space-between",gap:so},children:[t.jsx(bt,{end:"min",id:h.min,children:a}),t.jsx(bt,{end:"max",id:h.max,children:r})]})]}),t.jsx(lo,{caption:n,rows:f,testId:"histogram-values"}),ot(d)&&t.jsx(ye,{children:d})]})}function fs({values:e,label:n,minLabel:a,maxLabel:r,busy:i,live:l,trailing:d}){const g=Ae(),h=Ye(),p=co(),f=us(e,g),x=e.map((y,C)=>({id:`point-${String(C)}`,header:h.format(C+1),value:h.format(y)}));return t.jsxs(o.Box,{"data-testid":"sparkline-row","aria-busy":i,style:{display:"flex",alignItems:"center",gap:u.TRAIL_GAP,height:u.SPARKLINE_HEIGHT},children:[t.jsxs(o.Box,{"data-testid":"sparkline-chart",...Me(l,i),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:so},children:[t.jsx(bt,{end:"min",id:p.min,children:a}),t.jsxs(o.Box,{"data-testid":"sparkline-drawing",role:n===void 0?void 0:"img","aria-label":n,"aria-describedby":n===void 0?void 0:p.describedBy,"aria-hidden":n===void 0?!0:void 0,style:{flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",color:b.BORDER},children:[t.jsx(o.Box,{component:"svg","data-testid":"sparkline-plot",width:"100%",height:u.CONTROL_HEIGHT,viewBox:`0 0 ${String(We)} ${String(We)}`,preserveAspectRatio:"none",fill:"none",stroke:"currentColor",strokeWidth:ds,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{display:"block",overflow:"visible"},children:f!==null&&t.jsx("polyline",{points:f,vectorEffect:"non-scaling-stroke"})}),t.jsx(io,{})]}),t.jsx(bt,{end:"max",id:p.max,children:r})]}),t.jsx(lo,{caption:n,rows:x,testId:"sparkline-values"}),ot(d)&&t.jsx(ye,{children:d})]})}function hs({name:e,percentile:n,value:a,rank:r,busy:i,live:l,onClick:d,onDoubleClick:g,onContextMenu:h,onFocus:p,onBlur:f}){const x=re(),y=$n(),C=s.useId(),T=d,v=T!==void 0,S=Math.min(Gt,Math.max(0,n)),H=x.percentile(y(Math.round(S))),P=A=>{T!==void 0&&T(A,Je(A))},E=A=>{T!==void 0&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),T(A,Je(A)))};return t.jsxs(o.Box,{"data-testid":"metric-row",role:v?"button":void 0,tabIndex:v?0:void 0,...Me(l,i),onClick:P,onKeyDown:E,onDoubleClick:g,onContextMenu:h,onFocus:p,onBlur:f,style:{display:"flex",alignItems:"center",gap:u.GUTTER,height:u.ROW_PITCH,cursor:v?"pointer":"default"},children:[t.jsx(o.Box,{component:"span",id:C,"data-testid":"metric-row-name",title:e,style:{flex:"1 1 auto",minWidth:0,fontSize:cs,lineHeight:1.2,color:b.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),t.jsx(o.Progress.Root,{"data-testid":"metric-row-bar",role:"progressbar","aria-labelledby":C,"aria-valuemin":0,"aria-valuemax":Gt,"aria-valuenow":S,"aria-valuetext":H,title:H,size:ao,style:{flex:`0 0 ${String(ls)}px`,borderRadius:En,background:b.SURFACE},children:t.jsx(o.Progress.Section,{"data-testid":"metric-row-fill",value:S,withAria:!1,color:b.ACCENT,style:{borderRadius:En}})}),t.jsx(o.Box,{component:"span","data-testid":"metric-row-value",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:b.VALUE},children:a}),r!==void 0&&t.jsx(Kt,{children:r})]})}const uo=s.createContext(!1);function po({showLabels:e=!1,children:n}){return t.jsx(uo.Provider,{value:e,children:n})}function rt(){return s.useContext(uo)}const gs=u.VALUE_INSET-u.GLYPH_SLOT,xs=2,ms=1,bs=2,ys=3;function vs(e){if(e.fullValue!==void 0)return e.fullValue;if(typeof e.value=="string")return e.value;if(typeof e.value=="number")return String(e.value)}function ws({segment:e,grow:n,index:a}){const{glyph:r,value:i,unit:l,mono:d=!1}=e;let g=null;Bt(r)?g=t.jsx(nt,{name:r}):Ft(r)?g=t.jsx(o.Box,{component:"span","data-letter":r,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:r}):r!=null&&(g=r);const h=vs(e),p=e.fullValue!==void 0;return t.jsxs(o.Box,{"data-testid":"compound-segment","data-segment-index":a,"data-grow":n?"true":"false",style:{display:"flex",alignItems:"center",boxSizing:"border-box",flex:n?"1 1 auto":"0 0 auto",minWidth:0,height:u.CONTROL_HEIGHT,paddingBlock:0,paddingInline:gs},children:[g!==null&&t.jsx(o.Box,{"data-testid":"compound-segment-slot",style:{flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:b.CHROME},children:g}),t.jsx(o.Box,{component:"span","data-testid":"compound-segment-value","data-mono":d?"true":"false",title:h,"aria-hidden":p?!0:void 0,style:{flex:n?"1 1 auto":"0 0 auto",minWidth:0,fontFamily:d?"var(--mantine-font-family-monospace)":void 0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:b.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",unicodeBidi:"isolate"},children:i}),p&&t.jsx(o.VisuallyHidden,{children:e.fullValue}),l!==void 0&&t.jsx(o.Box,{component:"span","data-testid":"compound-segment-unit",style:{flex:"0 0 auto",marginInlineStart:xs,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:b.CHROME},children:l})]})}function Is(e,n){if(!(n>=bs&&n<=ys))return`CompoundRow "${e}" was given ${String(n)} ${n===1?"segment":"segments"}, and it holds two or three. A compound row shows one value together with the parts that belong to it: use PanelField for a single value, and a table or a list of rows for more than three.`}function Es(e,n){if(n!==1)return`CompoundRow "${e}" was given ${String(n)} segments that set grow, and exactly one should. The segment that sets grow takes the box's leftover width and should be the main value, with the rest sized to their content. Using the first segment that sets it, or the leading segment when none does.`}function Ss({label:e,segments:n,width:a=u.BODY,trailing:r,busy:i,live:l,onClick:d,onFocus:g,onBlur:h}){const p=rt(),f=s.useId(),x=n.filter(L=>L.grow===!0).length;Pe(Is(e,n.length)),Pe(Es(e,x));const y=n.findIndex(L=>L.grow===!0),C=y===-1?0:y,T=d!==void 0,v=no(l,i)!=="off",S=T||v,H=T?void 0:f,P=S?void 0:f,E=S||p,A={display:"flex",alignItems:"center",boxSizing:"border-box",flex:p?"1 1 auto":"0 0 auto",width:p?void 0:a,minWidth:0,height:u.CONTROL_HEIGHT,background:b.SURFACE,borderRadius:"var(--mantine-radius-sm)",overflow:"hidden",textAlign:"start",cursor:T?"pointer":void 0},_=t.jsxs(t.Fragment,{children:[S&&t.jsx(o.VisuallyHidden,{id:H,children:e}),n.map((L,D)=>t.jsxs(s.Fragment,{children:[D>0&&t.jsx(o.Box,{"data-testid":"compound-row-hairline",style:{flex:"0 0 auto",width:ms,height:u.CONTROL_HEIGHT,background:b.PANEL}}),t.jsx(ws,{segment:L,grow:D===C,index:D})]},D))]});return t.jsxs(o.Box,{"data-testid":"compound-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[p&&t.jsx(o.Box,{component:"span",id:P,"data-testid":"compound-row-label",title:e,"aria-hidden":S?!0:void 0,style:{flex:`0 0 ${u.LABEL_COLUMN}px`,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:b.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),T?t.jsx(o.UnstyledButton,{type:"button",title:e,"data-testid":"compound-row-box","data-interactive":"true",...Me(l,i),onClick:d,onFocus:g,onBlur:h,style:A,children:_}):t.jsx(o.Box,{role:"group","aria-label":E?void 0:e,"aria-labelledby":E?f:void 0,title:e,"data-testid":"compound-row-box","data-interactive":"false",...Me(l,i),onFocus:g,onBlur:h,style:A,children:_}),t.jsx(ye,{children:r})]})}const Ot=u.VALUE_INSET-u.GLYPH_SLOT,gt=4,Sn=4,Cs=u.VALUE_INSET+u.LABEL_COLUMN,Cn={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},fo=s.forwardRef(function(n,a){const{label:r,glyph:i,kind:l,value:d,defaultValue:g,onChange:h,data:p,unit:f,width:x=u.FIELD,bound:y=!1,mixed:C=!1,placeholder:T,pending:v=!1,min:S,max:H,step:P,onScrubStart:E,onScrub:A,onScrubEnd:_,onClick:L,disabled:D=!1,readOnly:N,boundDescription:G,pendingDescription:M,title:F,style:m,className:w,onKeyDown:R,...j}=n,K=rt(),W=re(),xe=Ae(),U=$.useMediaQuery("(pointer: coarse)"),[le,V]=$.useUncontrolled({value:d===null?"":d,defaultValue:g,finalValue:"",onChange:h}),Z=l??(p!==void 0?"select":"text"),ee=Z==="select",je=Z==="select"&&p!==void 0,Le=N??(h===void 0&&g===void 0),ne=String(le),me=T===!0,X=C||me;let ve;C?ve=W.mixed:me?ve=ne:typeof T=="string"&&(ve=T);const pe=[];C&&pe.push(W.mixed);const Be=G??W.fieldBound,Oe=M??W.fieldPending;y&&Be!==""&&pe.push(Be),v&&Oe!==""&&pe.push(Oe);const Qe=pe.length>0?pe.join(". "):void 0,ae=(E!==void 0||A!==void 0||_!==void 0)&&!D&&!U,ge=s.useRef(!1),we=s.useRef(!1),be=s.useRef(0),He=k=>{if(!ae||k.button!==0)return;k.preventDefault(),k.stopPropagation();const oe=k.currentTarget;typeof oe.setPointerCapture=="function"&&oe.setPointerCapture(k.pointerId),ge.current=!0,we.current=!1,be.current=k.clientX},et=k=>{if(!ge.current)return;const oe=k.clientX-be.current;oe!==0&&(be.current=k.clientX,we.current||(we.current=!0,E==null||E(k)),A==null||A(ue(xe)?-oe:oe,k))},_e=k=>{ge.current&&(ge.current=!1,we.current&&(we.current=!1,_==null||_(k)))},at=k=>{D||L==null||L(k)},Xe=k=>{R==null||R(k),!(L===void 0||D||k.defaultPrevented)&&(je||(k.key==="Enter"||k.key===" "&&Le)&&(k.preventDefault(),L(k)))},Ne=(k,oe)=>{V(k,oe)};let Ie=null;Bt(i)?Ie=t.jsx(nt,{name:i,filled:y}):Ft(i)?Ie=t.jsx(o.Box,{component:"span","data-letter":i,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:i}):i!=null&&(Ie=i);const Ve=t.jsxs(t.Fragment,{children:[t.jsxs(o.Box,{"data-testid":"panel-field-slot","data-scrub":ae?"true":void 0,onPointerDown:ae?He:void 0,onPointerMove:ae?et:void 0,onPointerUp:ae?_e:void 0,onPointerCancel:ae?_e:void 0,onLostPointerCapture:ae?_e:void 0,style:{position:"relative",flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:b.CHROME,cursor:ae?"ew-resize":void 0,touchAction:ae?"none":void 0},children:[Ie,v&&t.jsx(o.Box,{"data-testid":"panel-field-pending",style:{position:"absolute",insetInlineStart:0,bottom:0,width:Sn,height:Sn,background:b.ACCENT}})]}),K&&t.jsx(o.Box,{component:"span","data-testid":"panel-field-label","aria-hidden":"true",style:{flex:"1 1 auto",minWidth:0,marginInlineStart:gt,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:b.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r})]}),z=f!==void 0,J=z||ee?t.jsxs(t.Fragment,{children:[z&&t.jsx(o.Box,{component:"span","data-testid":"panel-field-unit",style:{flex:"0 0 auto",lineHeight:1},children:f}),ee&&t.jsx(o.Box,{component:"span","data-testid":"panel-field-chevron",style:{flex:"0 0 auto",display:"flex",alignItems:"center",marginInlineStart:z?gt:0},children:t.jsx(te,{name:"chevronDown",size:u.GLYPH})})]}):void 0;let Y=Ot+gt;ee&&(Y+=u.GLYPH),ee&&z&&(Y+=gt);const fe=J===void 0?void 0:`calc(${String((f==null?void 0:f.length)??0)}ch + ${String(Y)}px)`,Q=ae?"auto":"none",ce={"data-testid":"panel-field-value",...j,ref:a,className:w,label:r,description:Qe,placeholder:ve,disabled:D,readOnly:Le,onClick:at,onKeyDown:Xe,leftSection:Ve,leftSectionWidth:K?Cs:u.VALUE_INSET,leftSectionPointerEvents:Q,leftSectionProps:{style:{insetInlineStart:0,justifyContent:"flex-start",paddingInlineStart:Ot}},rightSection:J,rightSectionWidth:fe,rightSectionPointerEvents:"none",rightSectionProps:{style:{insetInlineEnd:0,justifyContent:"flex-end",paddingInlineEnd:Ot,fontSize:"var(--mantine-font-size-sm)",color:b.CHROME}},styles:{wrapper:{marginTop:0,marginBottom:0,"--input-placeholder-color":C?b.VALUE:b.PLACEHOLDER},input:{backgroundColor:b.SURFACE,paddingInlineStart:void 0,paddingInlineEnd:void 0},label:Cn,description:Cn},wrapperProps:{title:F??r,"data-testid":"panel-field","data-kind":Z,"data-bound":y?"true":void 0,"data-mixed":C?"true":void 0,"data-pending":v?"true":void 0,"data-disabled":D?"true":void 0},style:{flex:x==="fill"?"1 1 auto":"0 0 auto",width:x==="fill"?"100%":x,minWidth:0,...m}};return Z==="number"?t.jsx(o.NumberInput,{...ce,value:X?"":le,onChange:Ne,min:S,max:H,step:P,hideControls:!0}):je?t.jsx(o.Select,{...ce,data:p,value:X||ne===""?null:ne,onChange:k=>{Ne(k??"")}}):t.jsx(o.TextInput,{...ce,value:X?"":ne,onChange:k=>{Ne(k.currentTarget.value,k)}})}),Ts=2,Rs=u.BODY+u.TRAIL_GAP;function Ps(e){return s.Children.toArray(e).flatMap(n=>s.isValidElement(n)&&n.type===s.Fragment?s.Children.toArray(n.props.children):[n])}function Tn(e,n){return s.isValidElement(e)&&e.key!==null?e.key:`field-row-${String(n)}`}function As(e){if(s.isValidElement(e)&&typeof e.props.label=="string")return e.props.label}function Rn(e){return s.isValidElement(e)&&e.type===fo?s.cloneElement(e,{width:"fill"}):e}const js=s.forwardRef(function({children:n,trailing:a,groupLabel:r,role:i,style:l,"aria-label":d,"aria-labelledby":g,...h},p){const f=rt(),x=Ps(n),y=x.length;Pe(y===0||y>Ts?`FieldRow was given ${String(y)} ${y===1?"field":"fields"}, and it holds one field, or two side by side. A row with none is an empty 32px gap, and a third field has nowhere to go in the 280px panel the row is measured for. Put the extra fields on rows of their own.`:void 0);const C=r??d,v=i??(C!==void 0||g!==void 0?"group":void 0),S=ot(a);if(f&&y>1)return t.jsx(o.Box,{ref:p,"data-testid":"field-row-labelled","data-fields":y,role:v,"aria-label":C,"aria-labelledby":g,...h,style:{display:"flex",flexDirection:"column",...l},children:x.map((_,L)=>{const D=As(_);return t.jsxs(o.Box,{"data-testid":"field-row","data-labelled":"true",style:{display:"flex",alignItems:"center",height:u.ROW_PITCH},children:[t.jsx(o.Box,{component:"span","data-testid":"field-row-label",title:D,style:{flex:`0 0 ${String(u.LABEL_COLUMN)}px`,minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:b.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:D}),t.jsx(o.Box,{"data-testid":"field-row-slot","data-width":"fill",style:{display:"flex",alignItems:"center",flex:"1 1 auto",minWidth:0,marginInlineStart:u.GUTTER,marginInlineEnd:u.TRAIL_GAP},children:t.jsx(po,{showLabels:!1,children:Rn(_)})}),t.jsx(ye,{children:L===0?a:null})]},Tn(_,L))})});const H=y<=1,P=H&&!S;let E=u.FIELD;H&&(E=P?Rs:u.BODY);const A=P?void 0:u.TRAIL_GAP;return t.jsxs(o.Box,{ref:p,"data-testid":"field-row","data-fields":y,role:v,"aria-label":C,"aria-labelledby":g,...h,style:{display:"flex",alignItems:"center",height:u.ROW_PITCH,...l},children:[x.map((_,L)=>t.jsx(o.Box,{"data-testid":"field-row-slot","data-width":E,style:{display:"flex",alignItems:"center",flex:`0 0 ${String(E)}px`,minWidth:0,marginInlineStart:L===0?void 0:u.GUTTER,marginInlineEnd:L===y-1?A:void 0},children:Rn(_)},Tn(_,L))),t.jsx(ye,{children:a})]})}),Ls=2,Os=6,ho=1,Hs=u.CONTROL_HEIGHT-ho*2,_s=2,Pn=3,Ns=4,Ds=6,ks=u.GLYPH,Gs=3;function Ms(e,n){return n?b.DISABLED:e?b.ON_SELECTED:b.CHROME}function zs(e){const{options:n,value:a,defaultValue:r,onChange:i,label:l,labelledBy:d,name:g,disabled:h=!1,hybrid:p=!1,width:f,trailing:x,onFocus:y,onBlur:C}=e,T=rt(),v=n.length,[S]=n,[H,P]=$.useUncontrolled({value:a,defaultValue:r,finalValue:S===void 0?"":S.value,onChange:i}),E=s.useRef(void 0);Pe(v<Ls||v>Os?`IconGroupRow was given ${String(v)} ${v===1?"option":"options"}, and it holds two to six drawable ones. One option is a statement rather than a choice and belongs in a field, and more than six stop reading as a set of drawings -- use a select instead. Rendering them anyway.`:void 0);const A=f??(v<=Gs?u.FIELD:u.BODY),_=A==="fill",L=N=>{var m;if(h||N.key!=="Home"&&N.key!=="End")return;const G=n.filter(w=>w.disabled!==!0),M=N.key==="Home"?G[0]:G[G.length-1];if(M===void 0)return;N.preventDefault(),P(M.value,N),(m=Array.from(N.currentTarget.querySelectorAll('input[type="radio"]')).find(w=>w.value===M.value))==null||m.focus()},D=n.map(N=>{const G=N.value===H,M=h||N.disabled===!0,F=T||p&&G;return{value:N.value,disabled:N.disabled,label:t.jsxs(o.Box,{component:"span","data-testid":"icon-group-button","data-value":N.value,"data-active":G?"true":"false",title:N.label,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",gap:F?Ns:0,paddingInline:F?Ds:0,width:"100%",minWidth:0,color:Ms(G,M)},children:[t.jsx(o.Box,{component:"span","data-testid":"icon-group-icon",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:N.icon}),F?t.jsx(o.Box,{component:"span","data-testid":"icon-group-word",style:{minWidth:0,fontWeight:500,lineHeight:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:N.label}):t.jsx(o.VisuallyHidden,{children:N.label})]})}});return t.jsxs(o.Box,{"data-testid":"icon-group-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[t.jsx(o.SegmentedControl,{data:D,value:H,onChange:N=>{const G=E.current;E.current=void 0,P(N,G)},onChangeCapture:N=>{E.current=N},onKeyDown:L,onFocus:y,onBlur:C,name:g,disabled:h,radius:"sm","aria-label":l,"aria-labelledby":d,"data-testid":"icon-group-track","data-hybrid":p?"true":void 0,__vars:{"--sc-color":b.SELECTED,"--sc-shadow":"none"},styles:{root:{boxSizing:"border-box",flex:_?"1 1 auto":"0 0 auto",width:_?"100%":A,minWidth:0,height:u.CONTROL_HEIGHT,padding:ho,gap:_s,backgroundColor:b.SURFACE,overflow:"visible"},control:{flex:"1 1 auto",minWidth:ks},label:{display:"flex",alignItems:"center",justifyContent:"center",height:Hs,padding:0,borderRadius:Pn,fontSize:"var(--mantine-font-size-sm)"},innerLabel:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minWidth:0},indicator:{backgroundColor:b.SELECTED,borderRadius:Pn,boxShadow:"none"}}}),t.jsx(ye,{children:x})]})}const Bs=12,Fs=1.5,An=1.4,jn=4,Vs=20,Ln=220,On=2,Hn=new RegExp("\\p{Sentence_Terminal}","u"),Us=/[.!?]/u,_n=/\s/u;function $s(e){const n=Array.from(e);let a=0,r=0,i=0;for(;r<n.length;){if(!Hn.test(n[r])){r+=1;continue}let d=r;for(;d+1<n.length&&Hn.test(n[d+1]);)d+=1;const g=n[d+1],h=Us.test(n[d]);r=d+1,(!h||g===void 0||_n.test(g))&&(a+=1,i=r)}return n.slice(i).some(d=>!_n.test(d))?a+1:a}function Ws(e){return Array.from(e).length}function Ys(e,n){if(e!=="reading"||typeof n!="string")return;const a=Ws(n);if(a>Ln)return`ProseBlock was given a reading of ${String(a)} characters, and a reading is at most ${String(Ln)} characters. Shorten it, or it has stopped being a reading and become an explanation.`;const r=$s(n);if(r>On)return`ProseBlock was given a reading of ${String(r)} sentences, and a reading is at most ${String(On)} sentences. Delete any sentence that repeats what is already on screen, and move the rest into an InfoCircle.`}function Xs(e,n){if(!(n===void 0||e==="runRecord"))return`ProseBlock was given onDetails on the "${e}" shape, and it belongs to "runRecord". A reading and a departure line carry no chevron, so the handler is ignored.`}function Ks({variant:e,children:n,onDetails:a,busy:r,live:i}){const l=re(),d=Ae(),g=s.useId();Pe(Ys(e,n)),Pe(Xs(e,a));const h=Me(i,r);if(e==="reading")return t.jsx(o.Text,{...h,"data-testid":"prose-block","data-variant":e,style:{fontSize:Bs,lineHeight:Fs,color:b.PROSE},children:n});if(e==="departure")return t.jsxs(o.Box,{...h,role:"note","aria-label":l.departure,"data-testid":"prose-block","data-variant":e,style:{display:"flex",alignItems:"flex-start",gap:jn},children:[t.jsx(o.Box,{"aria-hidden":!0,"data-testid":"prose-block-warning",style:{flex:"0 0 auto",inlineSize:u.GLYPH_SLOT,blockSize:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:b.WARNING},children:t.jsx(te,{name:"warning",size:u.GLYPH})}),t.jsx(o.Text,{span:!0,size:"sm","data-testid":"prose-block-text",style:{lineHeight:An,color:b.VALUE},children:n})]});const p=typeof n=="string"?n:void 0;return t.jsxs(o.Box,{...h,"data-testid":"prose-block","data-variant":e,style:{display:"flex",alignItems:"center",gap:jn,blockSize:Vs},children:[t.jsx(o.Text,{span:!0,size:"sm",truncate:"end",id:g,title:p,"data-testid":"prose-block-text",style:{flex:"1 1 auto",minInlineSize:0,lineHeight:An,color:b.CHROME},children:n}),a!==void 0&&t.jsx(o.UnstyledButton,{type:"button",title:l.details,"aria-label":l.details,"aria-describedby":g,"data-testid":"prose-block-details",onClick:a,style:{flex:"0 0 auto",inlineSize:u.GLYPH_SLOT,blockSize:u.GLYPH_SLOT,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:"transparent",color:b.CHROME,cursor:"pointer"},children:t.jsx(te,{name:ue(d)?"chevronLeft":"chevronRight",size:u.CHEVRON})})]})}const Ht=4,qs=4,Zs=`polygon(0 calc(100% - ${qs}px), 100% 0, 100% 100%, 0 100%)`,Js=120,Qs=`linear-gradient(to right, ${b.SURFACE}, ${b.ACCENT})`,ei={sqrt:"scaleSqrt",linear:"scaleLinear",log:"scaleLog"},Nn={flex:"0 0 auto",lineHeight:1,color:b.CHROME,whiteSpace:"nowrap"};function ti({min:e,max:n,label:a,variant:r="size",gradient:i,scale:l,busy:d,live:g,onScaleClick:h,trailing:p}){const f=re(),x=Ae(),y=s.useId(),C=r==="color",T=l===void 0?void 0:ei[l],v=T===void 0?void 0:f[T],S=`${y}-label`,H=`${y}-min`,P=`${y}-max`,E=`${y}-scale`,A=[a===void 0?void 0:S,H,P,v===void 0?void 0:E].filter(D=>D!==void 0);let _=null;T!==void 0&&v!==void 0&&(h===void 0?_=t.jsx(o.Box,{"data-testid":"ramp-row-scale","aria-hidden":"true",title:v,style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center",color:b.CHROME},children:t.jsx(nt,{name:T})}):_=t.jsx(eo,{label:v,icon:t.jsx(nt,{name:T}),onClick:h}));const L=ot(p)?p:_;return t.jsxs(o.Box,{"data-testid":"ramp-row","data-variant":r,"data-scale":l,style:{display:"flex",alignItems:"center",gap:Ht,height:u.ROW_PITCH},children:[t.jsxs(o.Box,{"data-testid":"ramp-row-figure",role:"img","aria-labelledby":A.join(" "),...Me(g,d),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:Ht},children:[a!==void 0&&t.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-label",id:S,children:a}),t.jsx(o.Text,{span:!0,size:"sm",id:H,"data-testid":"ramp-row-min",style:Nn,children:e}),t.jsx(o.Box,{"data-testid":"ramp-row-ramp","data-variant":r,"aria-hidden":"true",style:{flex:"1 1 auto",minWidth:Js,height:u.GLYPH,boxSizing:"border-box",background:C?i??Qs:b.CHROME,borderRadius:C?"var(--mantine-radius-xs)":void 0,border:C?`1px solid ${b.BORDER}`:void 0,clipPath:C?void 0:Zs,...kr(x)}}),t.jsx(o.Text,{span:!0,size:"sm",id:P,"data-testid":"ramp-row-max",style:Nn,children:n}),v!==void 0&&t.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-scale",id:E,children:v})]}),t.jsx(o.Box,{style:{flex:"0 0 auto",display:"flex",marginInlineStart:u.TRAIL_GAP-Ht},children:t.jsx(ye,{children:L})})]})}const ni=4,oi=`${String(u.TOGGLE_PITCH)}px`,ri=2;function ai({label:e,checked:n,defaultChecked:a,onChange:r,control:i="checkbox",trailing:l,disabled:d=!1,onFocus:g,onBlur:h}){const[p,f]=$.useUncontrolled({value:n,defaultValue:a,finalValue:!1,onChange:r}),x=T=>{f(T.currentTarget.checked,T)},y={root:{flex:"1 1 auto",minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:ni,fontSize:"var(--mantine-font-size-sm)",lineHeight:oi,color:d?b.DISABLED:b.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},C={title:e};return t.jsxs(o.Box,{"data-testid":"toggle-row","data-control":i,"data-checked":p?"true":"false","data-disabled":d?"true":void 0,style:{display:"flex",alignItems:"center",boxSizing:"border-box",gap:u.TRAIL_GAP,height:u.TOGGLE_PITCH},children:[i==="switch"?t.jsx(o.Switch,{"data-testid":"toggle-row-control",label:e,checked:p,disabled:d,onChange:x,onFocus:g,onBlur:h,wrapperProps:C,styles:y}):t.jsx(o.Checkbox,{"data-testid":"toggle-row-control",label:e,checked:p,disabled:d,onChange:x,onFocus:g,onBlur:h,wrapperProps:C,styles:y}),t.jsx(ye,{children:l})]})}function si({children:e,label:n,labelledBy:a}){const r=s.Children.toArray(e).length;return Pe(r<ri?`ToggleRowGroup was given ${String(r)} ${r===1?"row":"rows"}, and it holds two or more. A single checkbox on a row of its own interrupts a column of rows to say one bit: put it in the trailing slot of the row it modifies, or make it one tile of a group of icon buttons. Rendering it anyway.`:void 0),t.jsx(o.Box,{role:"group","aria-label":a===void 0?n:void 0,"aria-labelledby":a,"data-testid":"toggle-row-group","data-rows":r,style:{display:"flex",flexDirection:"column"},children:e})}function ii(e="dark"){return o.useComputedColorScheme(e)}const li={xs:o.rem(4),sm:o.rem(8),md:o.rem(16),lg:o.rem(24),xl:o.rem(32)},ci={HEIGHT:24,FONT_SIZE:11,CONTROL_PADDING:8,SECTION_GAP:4},di="0.6.0";exports.ActionRow=qa;exports.AdvancedButton=eo;exports.COMPACT_SIZING=ci;exports.CompactColorInput=Jn;exports.CompoundRow=Ss;exports.ControlGroup=oa;exports.ControlSection=ca;exports.ControlSubGroup=pa;exports.DEFAULT_GRADIENT_STOP_COLOR=xt;exports.DataRow=ts;exports.DataRowHeader=ns;exports.DataTable=Aa;exports.FIELD_GLYPH_NAMES=Yn;exports.FIELD_LETTERS=Xn;exports.FieldGlyph=nt;exports.FieldRow=js;exports.GradientEditor=ka;exports.HistogramRow=ps;exports.IconGroupRow=zs;exports.InfoCircle=Qn;exports.LabelsProvider=dr;exports.MANTINE_SPACING=li;exports.MAX_ALPHA_HEX=Vt;exports.MAX_OPACITY_PERCENT=Ut;exports.MetricRow=hs;exports.PANEL_GRID=u;exports.PANEL_INK=b;exports.POPOUT_GAP=Gn;exports.POPOUT_NESTED_GAP=Mn;exports.POPOUT_Z_INDEX_BASE=_t;exports.PanelField=fo;exports.PanelLabelsProvider=po;exports.Popout=Ge;exports.PopoutButton=Wr;exports.PopoutManager=Zn;exports.ProseBlock=Ks;exports.RampRow=ti;exports.RankChip=Kt;exports.SWATCH_COLORS_HEXA=Fn;exports.SparklineRow=fs;exports.StyleNumberInput=Fa;exports.StyleSelect=$a;exports.ToggleRow=ai;exports.ToggleRowGroup=si;exports.ToggleWithContent=Ya;exports.TrailingSlot=ye;exports.UI_GLYPH_NAMES=br;exports.UiGlyph=te;exports.VERSION=di;exports.compactColors=kn;exports.compactDarkColors=Dn;exports.compactTheme=ir;exports.compactThemeOverride=Bn;exports.createColorStop=mt;exports.createDefaultGradientStops=to;exports.defaultLabels=Vn;exports.getActivationMeta=Je;exports.isFieldGlyphName=Bt;exports.isFieldLetter=Ft;exports.isRtl=ue;exports.isValidHex=Er;exports.opacityToAlphaHex=Wt;exports.parseAlphaFromHexa=$t;exports.parseHexaColor=wr;exports.parseLocaleNumber=Un;exports.toHexaColor=Ir;exports.useActualColorScheme=ii;exports.useCollator=Wn;exports.useDirection=Ae;exports.useLabels=re;exports.useLocale=ze;exports.useNumberFormatter=Ye;exports.useNumberParser=zt;exports.useOrdinalFormatter=$n;exports.usePanelLabels=rt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@mantine/core"),n=require("react/jsx-runtime"),X=require("@mantine/hooks"),r=require("react"),jo=require("react-dom"),xe=require("@tanstack/react-table"),Lo=require("@tanstack/react-virtual"),u={WIDTH:280,PAD_LEFT:16,PAD_RIGHT:8,CONTENT:256,BODY:224,FIELD:108,GUTTER:8,TRAIL_GAP:8,TRAIL:24,TRIPLE:72,TRIPLE_GAP:4,CONTROL_HEIGHT:24,ROW_PITCH:32,TOGGLE_PITCH:24,DATA_PITCH:28,SECTION_HEADER:32,SECTION_PAD_BOTTOM:8,GLYPH_SLOT:16,GLYPH:14,CHEVRON:12,VALUE_INSET:24,SPARKLINE_HEIGHT:32,HISTOGRAM_HEIGHT:64,LABEL_COLUMN:76},g={VALUE:"var(--mantine-color-text)",CHROME:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",PROSE:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",PLACEHOLDER:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",DISABLED:"var(--mantine-color-disabled-color)",SURFACE:"light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-6))",PANEL:"var(--mantine-color-body)",RAISED:"light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-5))",SELECTED:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",ON_SELECTED:"var(--mantine-color-body)",BORDER:"light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))",DIVIDER:"light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))",ACCENT:"var(--mantine-primary-color-filled)",ON_ACCENT:"var(--mantine-primary-color-contrast)",WARNING:"var(--mantine-color-yellow-6)",SUCCESS:"var(--mantine-color-green-6)",DANGER:"var(--mantine-color-red-6)"},Fn=["#d5d7da","#a3a8b1","#7a828e","#5f6873","#48525c","#374047","#2a3035","#1f2428","#161b22","#0d1117"],Vn={...o.DEFAULT_THEME.colors,dark:Fn},_o={compactSize:"sm",sizes:{xs:{"--button-height":"20px","--button-fz":"10px","--button-padding-x":"6px"},sm:{"--button-height":"24px","--button-fz":"11px","--button-padding-x":"8px"},md:{"--button-height":"30px","--button-fz":"13px","--button-padding-x":"12px"},lg:{"--button-height":"36px","--button-fz":"15px","--button-padding-x":"16px"},xl:{"--button-height":"44px","--button-fz":"17px","--button-padding-x":"20px"}}},Oo={compactSize:"sm",sizes:{xs:{"--ai-size":"18px"},sm:{"--ai-size":"24px"},md:{"--ai-size":"30px"},lg:{"--ai-size":"36px"},xl:{"--ai-size":"44px"}}};function Ho(e){return e==="light"?{"--ai-bd":"1px solid var(--ai-color)"}:{}}const Un={compactSize:"xs",sizes:{xs:{"--cb-size":"16px","--cb-icon-size":"12px"},sm:{"--cb-size":"20px","--cb-icon-size":"14px"},md:{"--cb-size":"24px","--cb-icon-size":"16px"},lg:{"--cb-size":"30px","--cb-icon-size":"20px"},xl:{"--cb-size":"36px","--cb-icon-size":"24px"}}};function F(e,t){const s=t==null?e.compactSize:String(t);return e.sizes[s]??e.sizes[e.compactSize]}const No={Button:o.Button.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(_o,t==null?void 0:t.size)})}),ActionIcon:o.ActionIcon.extend({defaultProps:{size:"sm",variant:"subtle"},vars:(e,t)=>({root:{...F(Oo,t==null?void 0:t.size),...Ho(t==null?void 0:t.variant)}})}),CloseButton:o.CloseButton.extend({defaultProps:{size:"xs"},vars:(e,t)=>({root:F(Un,t==null?void 0:t.size)})})},Do={compactSize:"sm",sizes:{xs:{"--switch-height":"12px","--switch-width":"22px","--switch-thumb-size":"8px","--switch-track-label-padding":"2px","--switch-label-font-size":"4px"},sm:{"--switch-height":"16px","--switch-width":"28px","--switch-thumb-size":"12px","--switch-track-label-padding":"2px","--switch-label-font-size":"5px"},md:{"--switch-height":"20px","--switch-width":"36px","--switch-thumb-size":"16px","--switch-track-label-padding":"3px","--switch-label-font-size":"7px"},lg:{"--switch-height":"24px","--switch-width":"44px","--switch-thumb-size":"20px","--switch-track-label-padding":"3px","--switch-label-font-size":"9px"},xl:{"--switch-height":"28px","--switch-width":"52px","--switch-thumb-size":"24px","--switch-track-label-padding":"4px","--switch-label-font-size":"11px"}}},ko={compactSize:"sm",sizes:{xs:{"--checkbox-size":"12px"},sm:{"--checkbox-size":"16px"},md:{"--checkbox-size":"20px"},lg:{"--checkbox-size":"24px"},xl:{"--checkbox-size":"28px"}}},Mo={compactSize:"sm",sizes:{xs:{"--radio-size":"12px","--radio-icon-size":"5px"},sm:{"--radio-size":"16px","--radio-icon-size":"6px"},md:{"--radio-size":"20px","--radio-icon-size":"8px"},lg:{"--radio-size":"24px","--radio-icon-size":"10px"},xl:{"--radio-size":"28px","--radio-icon-size":"12px"}}},an={compactSize:"sm",sizes:{xs:{"--slider-size":"2px","--slider-thumb-size":"8px"},sm:{"--slider-size":"4px","--slider-thumb-size":"12px"},md:{"--slider-size":"6px","--slider-thumb-size":"16px"},lg:{"--slider-size":"8px","--slider-thumb-size":"20px"},xl:{"--slider-size":"10px","--slider-thumb-size":"24px"}}},Go={compactSize:"sm",sizes:{xs:{"--sc-font-size":"9px","--sc-padding":"2px 6px"},sm:{"--sc-font-size":"10px","--sc-padding":"4px 8px"},md:{"--sc-font-size":"12px","--sc-padding":"6px 10px"},lg:{"--sc-font-size":"14px","--sc-padding":"8px 12px"},xl:{"--sc-font-size":"16px","--sc-padding":"10px 16px"}}},Bo={backgroundColor:"transparent"},Fo={backgroundColor:"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))"},zt={fontSize:11},ln={fontSize:10,marginTop:2},Vo={SegmentedControl:o.SegmentedControl.extend({defaultProps:{size:"sm",withItemsBorders:!1},vars:(e,t)=>({root:F(Go,t==null?void 0:t.size)}),styles:{root:Bo,indicator:Fo}}),Checkbox:o.Checkbox.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(ko,t==null?void 0:t.size)}),styles:{label:zt}}),Switch:o.Switch.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Do,t==null?void 0:t.size)}),styles:{label:zt}}),Slider:o.Slider.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(an,t==null?void 0:t.size)}),styles:{markLabel:ln}}),Radio:o.Radio.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Mo,t==null?void 0:t.size)}),styles:{label:zt}}),RangeSlider:o.RangeSlider.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(an,t==null?void 0:t.size)}),styles:{markLabel:ln}})},Uo={compactSize:"sm",sizes:{xs:{"--badge-height":"12px","--badge-fz":"8px","--badge-padding-x":"3px"},sm:{"--badge-height":"14px","--badge-fz":"9px","--badge-padding-x":"4px"},md:{"--badge-height":"18px","--badge-fz":"11px","--badge-padding-x":"6px"},lg:{"--badge-height":"22px","--badge-fz":"13px","--badge-padding-x":"8px"},xl:{"--badge-height":"26px","--badge-fz":"15px","--badge-padding-x":"10px"}}},$o={compactSize:"sm",sizes:{xs:{"--avatar-size":"18px"},sm:{"--avatar-size":"24px"},md:{"--avatar-size":"30px"},lg:{"--avatar-size":"36px"},xl:{"--avatar-size":"44px"}}},Wo={compactSize:"sm",sizes:{xs:{"--ti-size":"18px"},sm:{"--ti-size":"24px"},md:{"--ti-size":"30px"},lg:{"--ti-size":"36px"},xl:{"--ti-size":"44px"}}},Yo={compactSize:"sm",sizes:{xs:{"--indicator-size":"6px"},sm:{"--indicator-size":"8px"},md:{"--indicator-size":"10px"},lg:{"--indicator-size":"12px"},xl:{"--indicator-size":"14px"}}},Xo={compactSize:"sm",sizes:{xs:{"--kbd-fz":"9px","--kbd-padding":"1px 3px"},sm:{"--kbd-fz":"10px","--kbd-padding":"2px 4px"},md:{"--kbd-fz":"12px","--kbd-padding":"3px 6px"},lg:{"--kbd-fz":"14px","--kbd-padding":"4px 8px"},xl:{"--kbd-fz":"16px","--kbd-padding":"5px 10px"}}},Ko={compactSize:"sm",sizes:{xs:{"--pill-height":"14px","--pill-fz":"9px"},sm:{"--pill-height":"16px","--pill-fz":"10px"},md:{"--pill-height":"20px","--pill-fz":"12px"},lg:{"--pill-height":"24px","--pill-fz":"14px"},xl:{"--pill-height":"28px","--pill-fz":"16px"}}},qo={Text:o.Text.extend({}),Badge:o.Badge.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Uo,t==null?void 0:t.size)})}),Pill:o.Pill.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Ko,t==null?void 0:t.size)})}),Avatar:o.Avatar.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F($o,t==null?void 0:t.size)})}),ThemeIcon:o.ThemeIcon.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Wo,t==null?void 0:t.size)})}),Indicator:o.Indicator.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Yo,t==null?void 0:t.size)})}),Kbd:o.Kbd.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Xo,t==null?void 0:t.size)})})},Zo={compactSize:"sm",sizes:{xs:{"--loader-size":"14px"},sm:{"--loader-size":"18px"},md:{"--loader-size":"24px"},lg:{"--loader-size":"30px"},xl:{"--loader-size":"38px"}}},Jo={compactSize:"sm",sizes:{xs:{"--progress-size":"2px"},sm:{"--progress-size":"4px"},md:{"--progress-size":"6px"},lg:{"--progress-size":"8px"},xl:{"--progress-size":"10px"}}},Qo={label:{fontSize:9}},ei={Loader:o.Loader.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Zo,t==null?void 0:t.size)})}),Progress:o.Progress.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Jo,t==null?void 0:t.size)}),styles:Qo}),RingProgress:o.RingProgress.extend({})},Gt=1e3,Me=1100,$n=8,Wn=4,Yn="light-dark(var(--mantine-primary-color-filled), var(--mantine-primary-color-5))",Tt={"--input-height":"24px","--input-size":"24px","--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":Yn},Xn={"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":Yn},nt={fontSize:11,color:g.CHROME,marginBottom:1,lineHeight:1.2},$t={paddingInlineStart:8,paddingInlineEnd:8,backgroundColor:"var(--mantine-color-default)"},tt={label:nt,input:$t},cn={label:nt,input:$t},ht={dropdown:{padding:4,border:"none",boxShadow:"var(--mantine-shadow-md)"},option:{fontSize:11,padding:"4px 8px",borderRadius:4},options:{},groupLabel:{fontSize:10,padding:"4px 8px"},empty:{fontSize:11,padding:"8px"}},Pt={input:{...tt.input,minHeight:24,height:"auto",display:"flex",alignItems:"center",paddingTop:4,paddingBottom:4},pillsList:{columnGap:4,rowGap:2},pill:{margin:0}};function ve(e,t){return{...Tt,"--input-height":e,"--input-size":e,"--input-fz":t}}function gt(e){return{...Xn,"--input-fz":e}}const at={compactSize:"sm",sizes:{xs:ve("20px","10px"),sm:Tt,md:ve("30px","13px"),lg:ve("36px","15px"),xl:ve("44px","17px")}},mt={compactSize:"sm",sizes:{xs:gt("10px"),sm:Xn,md:gt("13px"),lg:gt("15px"),xl:gt("17px")}},ti={compactSize:"sm",sizes:{xs:{...ve("20px","10px"),"--input-right-section-width":"20px"},sm:{...Tt,"--input-right-section-width":"24px"},md:{...ve("30px","13px"),"--input-right-section-width":"30px"},lg:{...ve("36px","15px"),"--input-right-section-width":"36px"},xl:{...ve("44px","17px"),"--input-right-section-width":"44px"}}},ni={compactSize:"sm",sizes:{xs:{"--ni-chevron-size":"8px"},sm:{"--ni-chevron-size":"10px"},md:{"--ni-chevron-size":"12px"},lg:{"--ni-chevron-size":"14px"},xl:{"--ni-chevron-size":"16px"}}},oi={compactSize:"sm",sizes:{xs:{...ve("20px","10px"),"--combobox-chevron-size":"10px"},sm:{...Tt,"--combobox-chevron-size":"12px"},md:{...ve("30px","13px"),"--combobox-chevron-size":"14px"},lg:{...ve("36px","15px"),"--combobox-chevron-size":"16px"},xl:{...ve("44px","17px"),"--combobox-chevron-size":"18px"}}},ii={TextInput:o.TextInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:tt}),NumberInput:o.NumberInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(ti,t==null?void 0:t.size),controls:F(ni,t==null?void 0:t.size)}),styles:{label:nt,input:$t,control:{borderColor:"transparent"}}}),Select:o.Select.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Me}},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:{...tt,...ht}}),Textarea:o.Textarea.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(mt,t==null?void 0:t.size)}),styles:cn}),PasswordInput:o.PasswordInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:{...tt,innerInput:{paddingInlineStart:8,paddingInlineEnd:8}}}),Autocomplete:o.Autocomplete.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Me}},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:{...tt,...ht}}),MultiSelect:o.MultiSelect.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Me}},vars:(e,t)=>({root:{},wrapper:F(oi,t==null?void 0:t.size)}),styles:{label:nt,...ht,...Pt,inputField:{minWidth:60,flexBasis:60}}}),TagsInput:o.TagsInput.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Me}},vars:(e,t)=>({root:{},wrapper:F(mt,t==null?void 0:t.size)}),styles:{label:nt,...ht,...Pt,inputField:{minWidth:30,flexBasis:30}}}),PillsInput:o.PillsInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(mt,t==null?void 0:t.size)}),styles:{label:nt,...Pt}}),FileInput:o.FileInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:tt}),JsonInput:o.JsonInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(mt,t==null?void 0:t.size)}),styles:cn}),InputClearButton:o.InputClearButton.extend({defaultProps:{size:"xs"},vars:(e,t)=>({root:F(Un,t==null?void 0:t.size)})})},si={compactSize:"sm",sizes:{xs:{"--pagination-control-size":"20px","--pagination-control-fz":"10px"},sm:{"--pagination-control-size":"24px","--pagination-control-fz":"11px"},md:{"--pagination-control-size":"30px","--pagination-control-fz":"13px"},lg:{"--pagination-control-size":"36px","--pagination-control-fz":"15px"},xl:{"--pagination-control-size":"44px","--pagination-control-fz":"17px"}}},ri={compactSize:"sm",sizes:{xs:{"--stepper-icon-size":"20px","--stepper-fz":"10px","--stepper-spacing":"6px"},sm:{"--stepper-icon-size":"24px","--stepper-fz":"11px","--stepper-spacing":"8px"},md:{"--stepper-icon-size":"30px","--stepper-fz":"13px","--stepper-spacing":"12px"},lg:{"--stepper-icon-size":"36px","--stepper-fz":"15px","--stepper-spacing":"16px"},xl:{"--stepper-icon-size":"44px","--stepper-fz":"17px","--stepper-spacing":"20px"}}},ai={compactSize:"sm",sizes:{xs:{"--burger-size":"14px","--burger-line-size":"2px"},sm:{"--burger-size":"18px","--burger-line-size":"2px"},md:{"--burger-size":"24px","--burger-line-size":"3px"},lg:{"--burger-size":"30px","--burger-line-size":"3px"},xl:{"--burger-size":"38px","--burger-line-size":"4px"}}},li={root:{fontSize:11}},ci={root:{fontSize:11,minHeight:28},label:{fontSize:11}},di={tab:{fontSize:11,padding:"6px 10px"}},ui={Anchor:o.Anchor.extend({defaultProps:{size:"sm"},styles:li}),Burger:o.Burger.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(ai,t==null?void 0:t.size)})}),NavLink:o.NavLink.extend({styles:ci}),Pagination:o.Pagination.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(si,t==null?void 0:t.size)})}),Stepper:o.Stepper.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(ri,t==null?void 0:t.size)})}),Tabs:o.Tabs.extend({styles:di})},pi={"--menu-item-fz":"11px"},fi={tooltip:{fontSize:11,padding:"4px 8px"}},xi={dropdown:{padding:8}},hi={dropdown:{padding:8}},gi={Menu:o.Menu.extend({defaultProps:{zIndex:Me},vars:()=>({dropdown:pi})}),Tooltip:o.Tooltip.extend({defaultProps:{zIndex:Me},styles:fi}),Popover:o.Popover.extend({defaultProps:{zIndex:Me},styles:xi}),HoverCard:o.HoverCard.extend({defaultProps:{zIndex:Me},styles:hi})},mi={xs:"10px",sm:"11px",md:"13px",lg:"14px",xl:"16px"},bi={xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},yi={xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},Kn=o.createTheme({colors:Vn,fontSizes:mi,spacing:bi,radius:yi,focusRing:"auto",other:{panelGrid:u},components:{...ii,...No,...Vo,...qo,...ei,...ui,...gi}}),vi=o.mergeMantineTheme(o.DEFAULT_THEME,Kn),qn=["#5B8FF9FF","#FF6B6BFF","#61D095FF","#F7B731FF","#9B59B6FF","#5B8FF980","#FF6B6B80","#61D09580","#F7B73180","#9B59B680"],St="#888888",Zn={mixed:"Mixed",fieldBound:"Bound to a data attribute",fieldPending:"Set but not yet applied",scaleSqrt:"Square root scale",scaleLinear:"Linear scale",scaleLog:"Logarithmic scale",details:"Details",departure:"Departure",percentile:e=>`${e} percentile`,expandSection:e=>`Expand ${e}`,collapseSection:e=>`Collapse ${e}`,addToSection:e=>`Add ${e}`,sectionHasConfiguredValues:e=>`${e} has configured values`,about:e=>`About ${e}`,resetToDefault:e=>`Reset ${e} to default`,colorSwatch:"Color swatch",colorHexValue:"Color hex value",opacity:"Opacity",colorPanelTitle:"Color",colorGenericName:"color",colorStops:"Color Stops",addColorStop:"Add color stop",colorStopPosition:e=>`Stop ${e} position`,removeColorStop:e=>`Remove color stop ${e}`,direction:"Direction",gradientDirection:"Gradient direction",degrees:e=>`${e}°`,percent:e=>`${e}%`,dataTable:"Data table",search:"Search",searchPlaceholder:"Search",clearSearch:"Clear search",noRows:"No rows",noMatchingRows:"No rows match the search",rowsShown:(e,t)=>`${e} of ${t} rows`,rowsSelected:e=>`${e} selected`,yes:"Yes",no:"No",closePanel:"Close panel",settings:"Settings",ordinal:(e,t)=>{switch(t){case"one":return`${e}st`;case"two":return`${e}nd`;case"few":return`${e}rd`;default:return`${e}th`}}},wi="en",Bt=r.createContext(Zn),Ft=r.createContext(void 0);function Si(e){return e!==void 0&&e!==""?e:typeof document<"u"&&document.documentElement.lang!==""?document.documentElement.lang:typeof navigator<"u"&&navigator.language!==""?navigator.language:wi}function Ii({labels:e,locale:t,children:s}){const i=r.useContext(Bt),a=r.useContext(Ft),l=r.useMemo(()=>({...i,...e}),[i,e]),c=t??a;return n.jsx(Ft.Provider,{value:c,children:n.jsx(Bt.Provider,{value:l,children:s})})}function ae(){return r.useContext(Bt)}function Fe(){const e=r.useContext(Ft);return Si(e)}const Ei=1234.5,Ci="9876543210",Ti=9876543210,Ri=new Set([" "," "," "," ","'","’"]),zi="−",Pi=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/iu,dn=new Map;function Ai(e){var f,p;const t=dn.get(e);if(t!==void 0)return t;const s=new Intl.NumberFormat(e).formatToParts(Ei),i=((f=s.find(h=>h.type==="decimal"))==null?void 0:f.value)??".",a=((p=s.find(h=>h.type==="group"))==null?void 0:p.value)??"",l=new Map;for(const h of"0123456789")l.set(h,h);const c=new Intl.NumberFormat(e,{useGrouping:!1}).format(Ti);Array.from(c).forEach((h,m)=>{l.set(h,Ci[m])});const x={decimal:i,digits:l,group:a};return dn.set(e,x),x}function Jn(e,t){const s=Ai(t);let i="";for(const l of e.trim()){const c=s.digits.get(l);if(c!==void 0){i+=c;continue}if(l===s.decimal){i+=".";continue}if(!(l===s.group||Ri.has(l))){if(l==="-"||l===zi){i+="-";continue}if(l==="+"){i+="+";continue}if(l==="e"||l==="E"){i+=l;continue}break}}const a=Pi.exec(i);return a===null?Number.NaN:Number(a[0])}function qe(e){const t=Fe(),s=JSON.stringify(e??{});return r.useMemo(()=>new Intl.NumberFormat(t,e),[t,s])}function Qn(){const e=Fe(),t=ae(),s=qe(),i=r.useMemo(()=>new Intl.PluralRules(e,{type:"ordinal"}),[e]);return r.useCallback(a=>t.ordinal(s.format(a),i.select(a)),[t,s,i])}function eo(e){const t=Fe(),s=JSON.stringify(e??{});return r.useMemo(()=>new Intl.Collator(t,e),[t,s])}function Wt(){const e=Fe();return r.useCallback(t=>Jn(t,e),[e])}const to=["sizeSmallest","sizeLargest","width","opacity","attribute","scaleSqrt","scaleLinear","scaleLog"],no=["N","E","W","D","K"],ji=["chevronDown","chevronRight","chevronLeft","close","plus","minus","gear","warning","check","eye","refresh","copy","pin","keepOpen","info","reset"],oo={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},je={fill:"currentColor",stroke:"none"},Li={sizeSmallest:e=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"5",cy:"11",r:"2.5",...e?je:{}}),n.jsx("circle",{cx:"10.5",cy:"6.5",r:"4",...e?je:{}})]}),sizeLargest:e=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"4.5",cy:"11.5",r:"1.75",...e?je:{}}),n.jsx("circle",{cx:"10",cy:"6",r:"5",...e?je:{}})]}),width:e=>n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"2.5",y1:"8",x2:"13.5",y2:"8"}),n.jsx("polyline",{points:"5,5.5 2.5,8 5,10.5",...e?je:{}}),n.jsx("polyline",{points:"11,5.5 13.5,8 11,10.5",...e?je:{}})]}),opacity:e=>e?n.jsx("circle",{cx:"8",cy:"8",r:"5.5",...je}):n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),n.jsx("path",{d:"M8 2.5a5.5 5.5 0 0 1 0 11z",...je})]}),attribute:e=>e?n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M2.5 7.2V3.5a1 1 0 0 1 1-1h3.7l6.3 6.3-4.7 4.7z",...je}),n.jsx("circle",{cx:"5.5",cy:"5.5",r:"0.75",style:{fill:g.SURFACE},stroke:"none"})]}):n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M2.5 7.2V3.5a1 1 0 0 1 1-1h3.7l6.3 6.3-4.7 4.7z"}),n.jsx("circle",{cx:"5.5",cy:"5.5",r:"0.75"})]}),scaleSqrt:()=>n.jsx("path",{d:"M2.5 13.5C4.5 5 8 2.5 13.5 2.5"}),scaleLinear:()=>n.jsx("line",{x1:"2.5",y1:"13.5",x2:"13.5",y2:"2.5"}),scaleLog:()=>n.jsx("path",{d:"M2.5 13.5C8 13.5 11.5 11 13.5 2.5"})},_i={chevronDown:n.jsx("polyline",{points:"4,6 8,10 12,6"}),chevronRight:n.jsx("polyline",{points:"6,4 10,8 6,12"}),chevronLeft:n.jsx("polyline",{points:"10,4 6,8 10,12"}),close:n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]}),plus:n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"8",y1:"3",x2:"8",y2:"13"}),n.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8"})]}),minus:n.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8"}),gear:n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"8",cy:"8",r:"2.25"}),n.jsx("circle",{cx:"8",cy:"8",r:"4.75"}),n.jsx("path",{d:"M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M12.6 3.4l-1.4 1.4M4.8 11.2l-1.4 1.4"})]}),warning:n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M8 2.5l6 11H2z"}),n.jsx("line",{x1:"8",y1:"6.5",x2:"8",y2:"9.5"}),n.jsx("line",{x1:"8",y1:"11.5",x2:"8",y2:"11.75"})]}),check:n.jsx("polyline",{points:"3.5,8.5 6.5,11.5 12.5,5"}),eye:n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8z"}),n.jsx("circle",{cx:"8",cy:"8",r:"2"})]}),refresh:n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M2.5 8a5.5 5.5 0 1 0 1.6-3.9"}),n.jsx("polyline",{points:"2.5,2.5 2.5,6 6,6"})]}),copy:n.jsxs(n.Fragment,{children:[n.jsx("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1"}),n.jsx("path",{d:"M10.5 5.5v-2a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2"})]}),pin:n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M6 2.5h4l-.5 3.5 2 2.5H4.5l2-2.5z"}),n.jsx("line",{x1:"8",y1:"8.5",x2:"8",y2:"13.5"})]}),keepOpen:n.jsxs(n.Fragment,{children:[n.jsx("rect",{x:"3.5",y:"7",width:"9",height:"6.5",rx:"1"}),n.jsx("path",{d:"M5.75 7V5.25a2.25 2.25 0 0 1 4.5 0V7"})]}),info:n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"8",cy:"8",r:"6.5"}),n.jsx("line",{x1:"8",y1:"7",x2:"8",y2:"11.5"}),n.jsx("line",{x1:"8",y1:"4.5",x2:"8",y2:"4.75"})]}),reset:n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]})};function Ke({name:e,filled:t=!1,size:s=u.GLYPH}){return n.jsx("svg",{width:s,height:s,...oo,"aria-hidden":"true",focusable:"false","data-glyph":e,"data-filled":t?"true":"false",style:{flex:"0 0 auto",display:"block"},children:Li[e](t)})}function re({name:e,size:t=u.GLYPH}){return n.jsx("svg",{width:t,height:t,...oo,"aria-hidden":"true",focusable:"false","data-glyph":e,style:{flex:"0 0 auto",display:"block"},children:_i[e]})}function Yt(e){return typeof e=="string"&&to.includes(e)}function Xt(e){return typeof e=="string"&&no.includes(e)}const Kt=255,qt=100;function Zt(e){return Math.round(parseInt(e,16)/Kt*qt)}function Jt(e){return Math.round(e/qt*Kt).toString(16).padStart(2,"0")}function Oi(e){let t=e.replace("#","");t.length===3?t=`${t.split("").map(l=>l+l).join("")}ff`:t.length===4?t=t.split("").map(l=>l+l).join(""):t.length===6&&(t=`${t}ff`);const s=`#${t.slice(0,6)}`,i=t.slice(6,8),a=Zt(i);return{hex:s,opacity:a}}function Hi(e,t){const s=e.replace("#",""),i=Jt(t);return`#${s}${i}`}function Ni(e){return/^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}const It={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0};function Di(e,t){const s=e===void 0?"":e.trim();return s===""?t:`${/[.!?]$/u.test(s)?s:`${s}.`} ${t}`}function st({name:e,enabledTitle:t,disabled:s=!1,disabledReason:i,extraDescriptions:a}){const l=r.useId(),c=s&&i!==void 0&&i!==""?i:void 0,x=[];for(const p of a??[])p!==void 0&&p!==""&&x.push(p);c!==void 0&&x.push(c);const f=x.length>0?x.join(". "):void 0;return{title:c===void 0?t:Di(t??e,c),description:f,describedBy:f===void 0?void 0:l}}const io=r.createContext(null);function ki(){return r.useContext(io)}function Mi({children:e}){const t=r.useRef(null);if(!r.isValidElement(e))throw new Error("PopoutAnchor requires a single valid React element as its child");const s=e,i=r.cloneElement(s,{ref:t});return n.jsx(io.Provider,{value:{anchorRef:t},children:i})}function Gi({children:e}){return n.jsx(o.Box,{p:"sm",children:e})}const Bi=["[data-portal]","[data-combobox-dropdown]","[data-menu-dropdown]","[data-popover-dropdown]","[data-tooltip]","[data-hovercard-dropdown]","[data-dates-dropdown]","[data-modal]"].join(", ");function Fi(e,t=!0){r.useEffect(()=>{if(!t)return;const s=i=>{const a=i.target;a.closest('[role="dialog"]')||a.closest("[data-popout-trigger]")||a.closest("[data-popout-portal-container]")||a.closest(Bi)||e()};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[e,t])}function Vi(e,t=!0){r.useEffect(()=>{if(!t)return;const s=i=>{i.key==="Escape"&&(i.preventDefault(),e())};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[e,t])}const so=r.createContext(null);function Ui({id:e,children:t}){return n.jsx(so.Provider,{value:e,children:t})}function ro(){return r.useContext(so)}const Qt=r.createContext(null),en=r.createContext(null);function Rt(){const e=r.useContext(Qt);if(!e)throw new Error("usePopoutContext must be used within a Popout component");return e}function $i(){return r.useContext(Qt)}function Wi(){const e=r.useContext(en);if(!e)throw new Error("usePopoutManagerContext must be used within a PopoutManager");return e}function Yi(){return r.useContext(en)}function Xi({children:e,parentId:t=null,opened:s,defaultOpened:i,onOpenChange:a}){const l=r.useId(),c=r.useRef(null),x=ro(),[f,p]=X.useUncontrolled({value:s,defaultValue:i,finalValue:!1,onChange:a}),h=r.useRef(p);r.useEffect(()=>{h.current=p});const m=r.useCallback((C,z)=>{if(z){h.current(C,z);return}h.current(C)},[]),b=r.useCallback(C=>{m(!0,C)},[m]),v=r.useCallback(C=>{m(!1,C)},[m]),T=r.useCallback(C=>{m(!f,C)},[f,m]),R=r.useMemo(()=>({id:l,isOpen:f,open:b,close:v,toggle:T,triggerRef:c,parentId:t,region:x}),[l,f,b,v,T,t,x]);return n.jsx(Qt.Provider,{value:R,children:e})}function Ki({children:e}){const[t,s]=r.useState(null),i=r.useRef([]),a=r.useRef(new Map),l=r.useRef(new Map),c=r.useRef(new Map),[x,f]=r.useState(0),p=r.useCallback((y,S,H)=>(l.current.get(y)??null)!==S?!1:S!==null?!0:(c.current.get(y)??null)===H,[]),h=r.useCallback((y,S)=>i.current.filter(H=>p(H,y,S)),[p]),m=r.useCallback(y=>{const S=[];for(const H of i.current){let k=H;for(;k;){const K=l.current.get(k)??null;if(K===y){S.push(H);break}k=K}}return S},[]),b=r.useCallback(y=>{let S=0,H=y;for(;H;){const k=l.current.get(H)??null;if(!k)break;S++,H=k}return S},[]),v=r.useCallback(y=>{var H;const S=[...y].sort((k,K)=>b(K)-b(k));for(const k of S)(H=a.current.get(k))==null||H()},[b]),T=r.useCallback((y,S,H,k)=>{if(i.current.includes(y)){a.current.set(y,S);return}const K=H??null,q=k??null,ge=h(K,q),Q=[];for(const ne of ge)Q.push(ne),Q.push(...m(ne));v(Q);const le=new Set(Q);i.current=i.current.filter(ne=>!le.has(ne)),i.current.push(y),a.current.set(y,S),l.current.set(y,K),c.current.set(y,q),f(ne=>ne+1)},[h,m,v]),R=r.useCallback(y=>{if(!i.current.includes(y)){a.current.delete(y),l.current.delete(y),c.current.delete(y);return}i.current=i.current.filter(S=>S!==y),a.current.delete(y),l.current.delete(y),c.current.delete(y),f(S=>S+1)},[]),C=r.useCallback(y=>{const S=i.current.indexOf(y);return S>=0?Gt+S:Gt},[]),z=r.useCallback(y=>{const S=i.current,H=S.indexOf(y);H===-1||H===S.length-1||(i.current=[...S.filter(k=>k!==y),y],f(k=>k+1))},[]),I=r.useCallback(y=>l.current.get(y)??null,[]),w=r.useCallback((y,S)=>{let H=S;for(;H;){const k=l.current.get(H);if(k===y)return!0;H=k??null}return!1},[]),P=r.useCallback(y=>{const S=[],H=i.current;for(const k of H)w(y,k)&&S.push(k);return S},[w]),j=r.useCallback(y=>{const S=P(y);for(const H of[...S].reverse()){const k=a.current.get(H);k==null||k()}},[P]),L=r.useCallback(y=>{j(y);const S=a.current.get(y);S==null||S()},[j]),D=r.useCallback((y,S)=>{const H=c.current.get(y)??null;for(const k of i.current)k!==y&&p(k,S,H)&&L(k)},[L,p]),U=r.useCallback(()=>{const y=i.current;if(y.length===0)return;const S=y[y.length-1],H=a.current.get(S);H==null||H()},[]),G=r.useCallback(()=>{const y=[...i.current];for(const S of y){const H=a.current.get(S);H==null||H()}},[]),N=r.useCallback(()=>i.current.length>0,[]),[$,A]=r.useState(!1);r.useEffect(()=>{A(i.current.length>0)},[x]),Vi(U,$),Fi(G,$);const O=r.useMemo(()=>({register:T,unregister:R,getZIndex:C,bringToFront:z,portalContainer:t,zIndexVersion:x,closeFocused:U,closeAll:G,hasOpenPopouts:N,closeWithDescendants:L,closeDescendants:j,closeSiblings:D,getParentId:I,isAncestor:w}),[T,R,C,z,t,x,U,G,N,L,j,D,I,w]);return n.jsxs(en.Provider,{value:O,children:[e,n.jsx("div",{ref:s,"data-popout-portal-container":!0,style:{display:"contents"}})]})}function _e(){return o.useDirection().dir}function he(e){return e==="rtl"}function qi(e,t){return he(t)?1-e:e}function Zi(e,t,s){return qi(e,s)*t}function Ji(e){return he(e)?{transform:"scaleX(-1)"}:{}}const un=3;function Qi(e){const{isOpen:t,onPress:s,onDragStart:i,onDrag:a,onDragEnd:l}=e,[c,x]=r.useState({left:0,top:0}),f=r.useRef(!1),p=r.useRef(!1),h=r.useRef(!1),m=r.useRef({x:0,y:0,offsetLeft:0,offsetTop:0}),b=r.useCallback(()=>{x({left:0,top:0})},[]),v=r.useCallback(()=>{const I=h.current;return h.current=!1,I},[]),T=r.useCallback(I=>{const w=I.target;if(!(w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.tagName==="BUTTON"||w.tagName==="SELECT"||w.closest("button")||w.closest("input")||w.closest("textarea")||w.closest("select"))){f.current=!0,p.current=!1,h.current=!1,m.current={x:I.clientX,y:I.clientY,offsetLeft:c.left,offsetTop:c.top},s==null||s(I);try{w.setPointerCapture(I.pointerId)}catch{}}},[c.left,c.top,s]),R=r.useCallback(I=>{if(!f.current)return;const w=I.clientX-m.current.x,P=I.clientY-m.current.y;if(!p.current){if(!(Math.abs(w)>=un||Math.abs(P)>=un))return;p.current=!0,i==null||i(I)}const j={left:m.current.offsetLeft+w,top:m.current.offsetTop+P};x(j),a==null||a(j,I)},[a,i]),C=r.useCallback(I=>{if(!f.current)return;f.current=!1;const w=I.target;w.hasPointerCapture(I.pointerId)&&w.releasePointerCapture(I.pointerId),p.current&&(p.current=!1,h.current=!0,l==null||l(I))},[l]),z=c.left!==0||c.top!==0;return t?{dragTriggerProps:{"data-drag-trigger":!0,onPointerDown:T,onPointerMove:R,onPointerUp:C,onPointerCancel:C,style:{cursor:"grab",userSelect:"none",touchAction:"none"}},dragOffset:c,resetDragOffset:b,hasDragged:z,consumeDragClick:v}:{dragTriggerProps:{},dragOffset:{left:0,top:0},resetDragOffset:b,hasDragged:!1,consumeDragClick:v}}function es({config:e,onClose:t,dragTriggerProps:s={},actions:i=[],activeTab:a,onTabChange:l,titleId:c}){var v;const x=ae(),{style:f,...p}=s,m=e.variant==="tabs"?e:null,b=(m==null?void 0:m.tabs.map(T=>({value:T.id,label:T.label})))??[];return n.jsxs(o.Group,{"data-testid":"popout-header",justify:"space-between",px:"sm",py:"xs",...p,style:{...f},children:[e.variant==="title"?n.jsx(o.Text,{id:c,"data-testid":"popout-header-title",size:"sm",fw:500,children:e.title}):n.jsxs(n.Fragment,{children:[n.jsx(o.VisuallyHidden,{id:c,children:((v=m==null?void 0:m.tabs[0])==null?void 0:v.label)??x.settings}),n.jsx(o.SegmentedControl,{"data-testid":"popout-header-tabs",data:b,value:a,onChange:T=>l==null?void 0:l(T),size:"xs"})]}),n.jsxs(o.Group,{gap:4,children:[i.map(T=>n.jsx(o.ActionIcon,{variant:"subtle",onClick:T.onClick,"aria-label":T.label,children:T.icon},T.id)),n.jsx(o.CloseButton,{"data-testid":"popout-header-close",onClick:t,"aria-label":x.closePanel})]})]})}function ts(e,t=document){return e===null?null:t.querySelector(`[data-popout-id="${e}"]`)}function pn(e,t,s){const{trigger:i,parent:a,panel:l}=s;if(e!==void 0){if(typeof e=="object")return e.current;switch(e){case"parent":return a??l??i;case"panel":return l??a??i;case"trigger":return i;default:{const c=e;throw new Error(`Unknown anchor target: ${String(c)}`)}}}return t==="x"?a??l??i:i??a??l}function ns(e,t){return e==="start"?he(t)?"right":"left":e==="end"?he(t)?"left":"right":e}function os(e,t,s=$n,i={}){const{placement:a="left",alignment:l="start",panelHeight:c=0,crossAnchorRect:x=e,direction:f="ltr"}=i;let p,h;switch(a){case"left":p=e.left-t-s,h=fn(x,l,c);break;case"right":p=e.right+s,h=fn(x,l,c);break;case"top":p=xn(x,l,t,f),h=e.top-c-s;break;case"bottom":p=xn(x,l,t,f),h=e.bottom+s;break;default:{const m=a;throw new Error(`Unknown placement: ${String(m)}`)}}return{left:p,top:h}}function fn(e,t,s){switch(t){case"start":return e.top;case"center":return e.top+e.height/2-s/2;case"end":return e.bottom-s;default:{const i=t;throw new Error(`Unknown alignment: ${String(i)}`)}}}function xn(e,t,s,i){switch(t){case"start":return he(i)?e.right-s:e.left;case"center":return e.left+e.width/2-s/2;case"end":return he(i)?e.left:e.right-s;default:{const a=t;throw new Error(`Unknown alignment: ${String(a)}`)}}}function is(e){var Ye,Se;const{width:t,height:s,header:i,label:a,children:l,anchorX:c,anchorY:x,placement:f="left",alignment:p="start",gap:h,actions:m,manageFocus:b=!0,onDragStart:v,onDrag:T,onDragEnd:R}=e,{isOpen:C,close:z,triggerRef:I,id:w,parentId:P,region:j}=Rt(),{getZIndex:L,portalContainer:D,register:U,unregister:G,bringToFront:N,zIndexVersion:$,closeDescendants:A}=Wi(),O=ki(),y=_e(),S=r.useId(),H=`popout-panel-${w}`,k=`popout-title-${S}`,[K,q]=r.useState(null),ge=r.useRef(!1),Q=r.useRef(null),le=r.useCallback(()=>{N(w)},[N,w]),{dragTriggerProps:ne,dragOffset:W,resetDragOffset:oe,hasDragged:Y,consumeDragClick:me}=Qi({isOpen:C,onPress:le,onDragStart:v,onDrag:T,onDragEnd:R}),be=(i==null?void 0:i.variant)==="tabs",Z=(i==null?void 0:i.variant)==="tabs"?i:null,fe=(Z==null?void 0:Z.defaultTab)??((Ye=Z==null?void 0:Z.tabs[0])==null?void 0:Ye.id),[Ve,Oe]=r.useState(fe),Ze=h??(P===null?0:Wn),Ue=r.useCallback((B,ee)=>{var te;Oe(B),(te=Z==null?void 0:Z.onTabChange)==null||te.call(Z,B,ee)},[Z]),de=r.useCallback(B=>{B.stopPropagation(),N(w),!me()&&A(w)},[A,N,me,w]),we=r.useCallback(B=>{A(w),z(B)},[A,z,w]),Ce=r.useRef(z);r.useEffect(()=>{Ce.current=z});const Re=r.useCallback(()=>{Ce.current()},[]);r.useEffect(()=>(C?U(w,Re,P,j):G(w),()=>{G(w)}),[C,w,U,G,Re,P,j]);const He=r.useCallback(()=>{const B={trigger:I.current,parent:ts(P),panel:(O==null?void 0:O.anchorRef.current)??null};return{inline:pn(c,"x",B),block:pn(x,"y",B)}},[I,P,O,c,x]),Ne=r.useCallback(()=>{var et;const{inline:B,block:ee}=He(),te=B??ee,ie=ee??B;if(!te||!ie)return;const ue=(et=Q.current)==null?void 0:et.getBoundingClientRect(),Ie=Math.max(t,(ue==null?void 0:ue.width)??0),M=Math.max(s??0,(ue==null?void 0:ue.height)??0),se=ns(f,y),Te=se==="top"||se==="bottom",dt=Te?ie:te,De=Te?te:ie,ce=os(dt.getBoundingClientRect(),Ie,Ze,{placement:se,alignment:p,panelHeight:M,crossAnchorRect:De.getBoundingClientRect(),direction:y});q(ke=>ke&&ke.left===ce.left&&ke.top===ce.top?ke:ce)},[He,t,s,f,p,Ze,y]);if(X.useIsomorphicEffect(()=>{if(!C){q(null);return}ge.current||(oe(),be&&Oe(fe)),Ne()},[C,Ne,oe,be,fe]),r.useEffect(()=>{if(!C)return;let B=0;const ee=()=>{B===0&&(B=requestAnimationFrame(()=>{B=0,Ne()}))},te=new ResizeObserver(ee),ie=new MutationObserver(ee),{inline:ue,block:Ie}=He();for(const se of new Set([ue,Ie].filter(Te=>Te!==null)))te.observe(se),ie.observe(se,{attributes:!0,attributeFilter:["style","class"]});Q.current&&te.observe(Q.current);const M=()=>{Y||ee()};return window.addEventListener("resize",M),window.addEventListener("scroll",M,!0),()=>{B!==0&&cancelAnimationFrame(B),te.disconnect(),ie.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("scroll",M,!0)}},[C,Ne,He,Y]),r.useEffect(()=>{var B;if(b){if(C){const ee=setTimeout(()=>{var te;(te=Q.current)==null||te.focus()},0);return()=>{clearTimeout(ee)}}ge.current&&((B=I.current)==null||B.focus())}},[C,b,I]),r.useEffect(()=>{ge.current=C},[C]),!C||!D)return null;const $e=L(w),Je={left:((K==null?void 0:K.left)??0)+W.left,top:((K==null?void 0:K.top)??0)+W.top},ze=n.jsxs(o.Paper,{ref:Q,id:H,role:"dialog","aria-modal":"false","aria-labelledby":i?k:void 0,"aria-label":i?void 0:a,tabIndex:-1,radius:8,onClick:de,"data-testid":"popout-panel","data-popout-id":w,...P&&{"data-parent-id":P},style:{position:"fixed",left:Je.left,top:Je.top,minWidth:t,width:"min-content",...s!==void 0&&{minHeight:s},...K===null&&{visibility:"hidden"},zIndex:$e,backgroundColor:"var(--mantine-color-body)",border:"1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.12))",boxShadow:["0 1px 2px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4))","0 4px 8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.35))","0 8px 16px light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.25))"].join(", ")},children:[i?n.jsx(es,{config:i,onClose:we,dragTriggerProps:ne,activeTab:Ve,onTabChange:Ue,actions:m,titleId:k}):null,n.jsx(o.Box,{"data-testid":"popout-panel-content",children:be?(Se=Z==null?void 0:Z.tabs.find(B=>B.id===Ve))==null?void 0:Se.content:l})]});return jo.createPortal(ze,D)}function ss({children:e,action:t="toggle"}){const{open:s,toggle:i,triggerRef:a,isOpen:l,id:c}=Rt(),x=r.useCallback(h=>{if(h.stopPropagation(),t==="open"){s(h);return}i(h)},[t,s,i]);if(!r.isValidElement(e))throw new Error("PopoutTrigger requires a single valid React element as its child");const f=`popout-panel-${c}`,p=e;return r.cloneElement(p,{onClick:h=>{var m,b;(b=(m=p.props).onClick)==null||b.call(m,h),x(h)},ref:a,"data-popout-trigger":!0,"aria-expanded":l,"aria-controls":f,"aria-haspopup":"dialog"})}function rs({children:e,opened:t,defaultOpened:s,onOpenChange:i}){const a=$i(),l=(a==null?void 0:a.id)??null;return n.jsx(Xi,{parentId:l,opened:t,defaultOpened:s,onOpenChange:i,children:e})}const Ge=Object.assign(rs,{Trigger:ss,Panel:is,Content:Gi,Anchor:Mi}),as=r.forwardRef(function({icon:t,size:s="xs",...i},a){const{isOpen:l}=Rt();return n.jsx(o.ActionIcon,{ref:a,"data-testid":"popout-button",variant:l?"light":"subtle",size:s,c:l?void 0:"dimmed",...i,children:t})});function ao({children:e}){return n.jsx(Ki,{children:e})}const hn=4,gn=4,ls=2,cs=72,ds=54,us=220,mn=0,At=100,bn=9,yn=7,ps=/^#[0-9A-F]{6}$/iu,fs=1.1;function jt(e){const t=e==="start"?gn:0,s=e==="end"?gn:0;return{borderStartStartRadius:t,borderEndStartRadius:t,borderStartEndRadius:s,borderEndEndRadius:s}}function xs(){const e=Fe();return r.useMemo(()=>{var s;return((s=new Intl.NumberFormat(e).formatToParts(fs).find(i=>i.type==="decimal"))==null?void 0:s.value)??"."},[e])}function lo({color:e,defaultColor:t,opacity:s,defaultOpacity:i=At,onColorChange:a,onOpacityChange:l,onChange:c,label:x,showOpacity:f=!0,disabled:p=!1,disabledReason:h,onFocus:m,onBlur:b}){const v=ae(),T=Wt(),R=xs(),C=r.useId(),z=st({name:x,disabled:p,disabledReason:h}),[I,w]=X.useUncontrolled({value:e,defaultValue:void 0,finalValue:void 0,onChange:a}),[P,j]=X.useUncontrolled({value:s,defaultValue:void 0,finalValue:void 0,onChange:l}),L=I===void 0,D=P===void 0,U=L&&(!f||D),G=I??t,N=P??i,[$,A]=r.useState(G.replace("#","").toUpperCase()),[O,y]=r.useState(N);r.useEffect(()=>{A(G.replace("#","").toUpperCase())},[G]),r.useEffect(()=>{y(N)},[N]);const S=W=>{const oe=W.length===bn,Y=oe?W.slice(0,yn).toUpperCase():W.toUpperCase(),me=oe&&f,be=me?Zt(W.slice(yn,bn)):P;w(Y),me&&j(be),c==null||c(Y,be)},H=()=>`${G}${Jt(N)}`.toUpperCase(),k=W=>{A(W.currentTarget.value.toUpperCase())},K=W=>{const oe=$.toUpperCase(),Y=oe.startsWith("#")?oe:`#${oe}`;ps.test(Y)&&Y!==G?(w(Y,W),c==null||c(Y,P,W)):A(G.replace("#","").toUpperCase()),b==null||b(W)},q=W=>{y(W)},ge=W=>{const oe=typeof O=="string"?T(O):O;if(Number.isNaN(oe)){y(N),b==null||b(W);return}const Y=Math.min(At,Math.max(mn,oe));Y!==N&&(j(Y,W),c==null||c(I,Y,W)),y(Y),b==null||b(W)},Q=W=>{w(void 0,W),f&&j(void 0,W),c==null||c(void 0,f?void 0:P,W)},le=f?"middle":"end",ne=n.jsxs(o.Group,{"data-testid":"compact-color-input",gap:hn,wrap:"nowrap",title:x===void 0?z.title:void 0,"data-disabled":p?"true":void 0,children:[n.jsxs(o.Group,{gap:0,wrap:"nowrap",children:[n.jsxs(Ge,{children:[n.jsx(Ge.Trigger,{children:n.jsx(o.ActionIcon,{variant:"filled",size:u.CONTROL_HEIGHT,radius:0,style:{backgroundColor:"var(--mantine-color-default)",...jt("start")},"data-testid":"compact-color-input-swatch",disabled:p,"aria-label":v.colorSwatch,"aria-describedby":z.describedBy,children:n.jsx(o.ColorSwatch,{color:G,size:u.GLYPH,radius:ls,style:{border:`1px solid ${g.BORDER}`}})})}),n.jsx(Ge.Panel,{width:us,header:{variant:"title",title:x??v.colorPanelTitle},placement:"bottom",alignment:"start",gap:hn,children:n.jsx(Ge.Content,{children:n.jsx(o.ColorPicker,{format:"hexa",value:H(),onChange:S,swatches:[...qn]})})})]}),n.jsx(o.TextInput,{"data-testid":"compact-color-input-hex",disabled:p,description:z.description,value:$,onChange:k,onFocus:m,onBlur:K,"aria-label":v.colorHexValue,"data-is-default":L?"true":"false",w:cs,styles:{input:{...jt(le),fontFamily:"monospace",textTransform:"uppercase",...L?{fontStyle:"italic",color:g.CHROME}:{}},description:It}}),f&&n.jsxs(n.Fragment,{children:[n.jsx(o.Divider,{orientation:"vertical",color:g.BORDER,h:u.CONTROL_HEIGHT,my:0}),n.jsx(o.NumberInput,{"data-testid":"compact-color-input-opacity",disabled:p,description:z.description,value:O,onChange:q,onFocus:m,onBlur:ge,min:mn,max:At,decimalSeparator:R,hideControls:!0,suffix:"%","aria-label":v.opacity,"data-is-default":D?"true":"false",w:ds,styles:{input:{...jt("end"),textAlign:"end",...D?{fontStyle:"italic",color:g.CHROME}:{}},description:It}})]})]}),!U&&n.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:g.CHROME,"data-testid":"compact-color-input-reset",disabled:p,"aria-label":v.resetToDefault(x??v.colorGenericName),onClick:Q,children:n.jsx(re,{name:"reset",size:u.CHEVRON})}),z.description!==void 0&&n.jsx(o.VisuallyHidden,{id:z.describedBy,children:z.description})]});return x===void 0?ne:n.jsxs(o.Stack,{"data-testid":"compact-color-input-labelled",gap:0,role:"group","aria-labelledby":C,title:z.title,children:[n.jsx(o.Text,{id:C,"data-testid":"compact-color-input-label",size:"xs",c:g.CHROME,mb:1,lh:1.2,children:x}),ne]})}const bt=u.GUTTER,vn=4,hs=1,gs=1.2,ms="calc(-1 * var(--mantine-spacing-sm) - 1px)";function bs({label:e,actions:t,children:s,bleed:i=!1}){const a=r.useId(),l=t!=null;return n.jsxs(o.Box,{"data-testid":"control-group",role:"group","aria-labelledby":a,children:[n.jsx(o.Divider,{"data-testid":"control-group-divider",color:g.DIVIDER,size:hs,style:{marginBlockStart:bt,marginBlockEnd:0,marginInline:i?ms:void 0}}),n.jsxs(o.Box,{"data-testid":"control-group-header",style:{display:"flex",alignItems:"center",gap:vn,boxSizing:"border-box",paddingBlock:bt,paddingInline:bt},children:[n.jsx(o.Box,{component:"span",id:a,"data-testid":"control-group-label",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--mantine-font-size-xs)",fontWeight:500,lineHeight:gs,color:g.VALUE},children:e}),l&&n.jsx(o.Box,{"data-testid":"control-group-actions",style:{display:"flex",alignItems:"center",gap:vn,flex:"0 0 auto"},children:t})]}),n.jsx(o.Stack,{"data-testid":"control-group-content",gap:0,px:bt,children:s})]})}function Le(e){const t=r.useRef(void 0);r.useEffect(()=>{process.env.NODE_ENV==="production"||e===void 0||t.current!==e&&(t.current=e,console.warn(e))},[e])}const wn=250,ys=4;function vs({name:e,bubbleId:t}){const{isOpen:s,open:i,close:a}=Rt();return n.jsx(Ge.Trigger,{action:"open",children:n.jsx(o.UnstyledButton,{type:"button",title:e,"aria-label":e,"aria-describedby":s?t:void 0,"data-testid":"info-circle",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,style:{flex:"0 0 auto",width:u.GLYPH,height:u.GLYPH,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"transparent",color:g.CHROME,cursor:"default"},children:n.jsx(re,{name:"info",size:u.CHEVRON})})})}function co({children:e,label:t,opened:s,defaultOpened:i,onOpenChange:a}){const l=ae(),c=r.useId(),x=Yi()!==null,f=l.about(t),p=n.jsxs(Ge,{opened:s,defaultOpened:i,onOpenChange:a,children:[n.jsx(vs,{name:f,bubbleId:c}),n.jsx(Ge.Panel,{width:wn,label:f,placement:"bottom",alignment:"start",gap:ys,anchorX:"trigger",anchorY:"trigger",manageFocus:!1,children:n.jsx(o.Box,{id:c,w:wn,p:"xs",style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1.4,color:g.PROSE},children:e})})]});return x?p:n.jsx(ao,{children:p})}function lt(e){return e!=null&&e!==!1}function Ee({children:e}){return n.jsx(o.Box,{"data-testid":"trailing-slot",style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center"},children:e})}const uo=r.forwardRef(function(t,s){const{label:i,changed:a=!1,icon:l,onClick:c,disabled:x=!1,loading:f=!1,style:p,...h}=t,m=ae(),b=a?m.sectionHasConfiguredValues(i):i,v=a?g.VALUE:g.CHROME;return n.jsx(o.ActionIcon,{...h,ref:s,type:"button",variant:"subtle",color:"gray",size:u.TRAIL,radius:"sm",vars:()=>({root:{"--ai-color":v}}),title:b,"aria-label":b,"aria-busy":f,disabled:x,loading:f,"data-testid":"advanced-button","data-changed":a?"true":"false",onClick:c,style:{flex:"0 0 auto",...p},children:l??n.jsx(re,{name:"gear",size:u.GLYPH})})}),Lt=4,ws=1,Sn=6,Ss=12,Is=1.2;function Es(e){const{label:t,technicalName:s,opened:i,defaultOpened:a,onOpenChange:l,hasConfiguredValues:c=!1,empty:x=!1,onAdd:f,info:p,actions:h,children:m}=e,b=ae(),v=_e(),T=r.useId(),R=r.useId(),C=r.useId(),[z,I]=X.useUncontrolled({value:i,defaultValue:a,finalValue:!0,onChange:l}),w=!x&&r.Children.toArray(m).length>0,P=p!=null;Le(x||w?void 0:`ControlSection "${t}" was given no children, and it holds the rows of a section. Pass the rows, set "empty" to draw it as a single row with a "+", or do not render it: a section header whose chevron opens onto nothing is a dead end for the reader.`);const j=O=>{I(!z,O)},L=z?b.collapseSection(t):b.expandSection(t),D=b.addToSection(t),U=he(v)?"chevronLeft":"chevronRight",G={flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},N={display:"flex",alignItems:"center",gap:Lt,flex:"0 1 auto",minWidth:0,height:"100%",background:"transparent",textAlign:"start"},$=s===void 0?t:`${t} (${s})`,A=n.jsxs(o.Box,{component:"span",id:T,title:$,"data-testid":"control-section-name",style:{minWidth:0,fontSize:Ss,fontWeight:500,lineHeight:Is,color:x?g.CHROME:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t,s===void 0?null:n.jsx(o.Box,{component:"span","data-testid":"control-section-technical-name",style:{fontWeight:400,color:g.CHROME},children:` (${s})`})]});return n.jsxs(o.Box,{role:"group","aria-labelledby":T,"aria-describedby":P?C:void 0,"data-testid":"control-section","data-empty":x?"true":void 0,children:[n.jsx(o.Divider,{"data-testid":"control-section-divider",color:g.DIVIDER,size:ws,my:0,mx:0}),n.jsxs(o.Box,{"data-testid":"control-section-header",style:{display:"flex",alignItems:"center",gap:Lt,boxSizing:"border-box",height:u.SECTION_HEADER,paddingInlineStart:u.PAD_LEFT,paddingInlineEnd:u.PAD_RIGHT},children:[w?n.jsxs(o.UnstyledButton,{type:"button","data-testid":"control-section-toggle","aria-label":L,"aria-expanded":z,"aria-controls":R,onClick:j,style:{...N,cursor:"pointer"},children:[n.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:G,children:n.jsx(re,{name:z?"chevronDown":U,size:u.CHEVRON})}),A]}):n.jsxs(o.Box,{style:N,children:[n.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:G}),A]}),c&&n.jsx(o.Box,{role:"img","aria-label":b.sectionHasConfiguredValues(t),"data-testid":"control-section-dot",style:{flex:"0 0 auto",width:Sn,height:Sn,borderRadius:"50%",background:g.ACCENT}}),P&&n.jsx(co,{label:t,children:p}),n.jsx(o.Box,{style:{flex:"1 1 auto"}}),h!=null&&n.jsx(o.Box,{"data-testid":"control-section-actions",style:{display:"flex",alignItems:"center",gap:Lt,flex:"0 0 auto"},children:h}),x&&f!==void 0&&n.jsx(Ee,{children:n.jsx(o.ActionIcon,{type:"button",variant:"subtle",size:u.CONTROL_HEIGHT,radius:"sm",c:g.CHROME,title:D,"aria-label":D,"data-testid":"control-section-add",onClick:f,children:n.jsx(re,{name:"plus",size:u.GLYPH})})})]}),P&&n.jsx(o.Box,{id:C,"data-testid":"control-section-description",hidden:!0,children:p}),w&&n.jsx(o.Collapse,{id:R,in:z,children:n.jsx(o.Box,{"data-testid":"control-section-content",style:{paddingInlineStart:u.PAD_LEFT,paddingInlineEnd:u.PAD_RIGHT,paddingBottom:u.SECTION_PAD_BOTTOM},children:n.jsx(o.Stack,{gap:0,children:m})})})]})}const _t="control-sub-group",In=4,Cs=10,Ts=1.2;function Rs(e){const{label:t,opened:s,defaultOpened:i,onOpenChange:a,children:l}=e,c=ae(),x=_e(),f=r.useRef(void 0),[p,h]=X.useUncontrolled({value:s,defaultValue:i,finalValue:!1,onChange:a}),m=r.useCallback(C=>{f.current=C},[]),b=r.useCallback(C=>{const z=f.current;f.current=void 0,h(C===_t,z)},[h]),v=p?c.collapseSection(t):c.expandSection(t);let T="chevronDown";p||(T=he(x)?"chevronLeft":"chevronRight");const R={item:{border:"none",background:"transparent"},control:{paddingInline:0,paddingBlock:0,minHeight:u.TOGGLE_PITCH,color:g.CHROME},label:{paddingBlock:0,fontSize:"var(--mantine-font-size-xs)",lineHeight:Ts,color:g.CHROME},chevron:{marginInlineStart:0,marginInlineEnd:In,color:g.CHROME},content:{paddingBlock:0,paddingInlineStart:u.GUTTER,paddingInlineEnd:0}};return n.jsx(o.Accordion,{"data-testid":"control-sub-group",value:p?_t:null,onChange:b,chevronPosition:"left",chevronSize:u.GLYPH_SLOT,disableChevronRotation:!0,chevron:n.jsx(re,{name:T,size:Cs}),styles:R,children:n.jsxs(o.Accordion.Item,{value:_t,"data-testid":"control-sub-group-item",children:[n.jsx(o.Accordion.Control,{"data-testid":"control-sub-group-control","aria-label":v,onClick:m,children:n.jsx(o.Box,{component:"span","data-testid":"control-sub-group-label",title:t,style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})}),n.jsx(o.Accordion.Panel,{"data-testid":"control-sub-group-panel",children:n.jsx(o.Box,{"data-testid":"control-sub-group-content",style:{display:"flex",flexDirection:"column",gap:In},children:l})})]})})}function it(e){if("key"in e)return{source:"keyboard"};const t=e.nativeEvent;return typeof PointerEvent<"u"&&t instanceof PointerEvent?{source:t.pointerType===""?"keyboard":"pointer"}:{source:t.detail===0?"keyboard":"pointer"}}function zs(e){const t=ae();return r.useMemo(()=>({...t,...e}),[t,e])}const pe=-1;function ot(e,t,s){return Math.min(Math.max(e,t),s)}function Ps(e,t,s,i,a){const{rowCount:l,columnCount:c,pageSize:x}=s,f=l-1,p=c-1;if(c===0)return;const h=he(i)?"ArrowLeft":"ArrowRight",m=he(i)?"ArrowRight":"ArrowLeft";if(t===h)return{row:e.row,column:Math.min(e.column+1,p)};if(t===m)return{row:e.row,column:Math.max(e.column-1,0)};if(t==="ArrowDown")return{row:ot(e.row+1,pe,f),column:e.column};if(t==="ArrowUp")return{row:ot(e.row-1,pe,f),column:e.column};if(t==="Home")return a.jumpToEnd?{row:pe,column:0}:{row:e.row,column:0};if(t==="End")return a.jumpToEnd?{row:Math.max(f,pe),column:p}:{row:e.row,column:p};if(t==="PageDown")return{row:ot(Math.max(e.row,0)+x,0,Math.max(f,0)),column:e.column};if(t==="PageUp")return{row:ot(Math.max(e.row,0)-x,0,Math.max(f,0)),column:e.column}}function As(e,t){const s=t.rowCount-1,i=Math.max(t.columnCount-1,0);return{row:ot(e.row,pe,Math.max(s,pe)),column:ot(e.column,0,i)}}function yt(e,t){return e.row===t.row&&e.column===t.column}function js(e,t,s){const i=Math.min(t,s),a=Math.max(t,s);return e.slice(i,a+1)}function Vt(e,t){const s=new Set(e),i=[];for(const a of s)t.includes(a)||i.push(a);for(const a of t)s.has(a)&&i.push(a);return i}function Ls(e){const{ids:t,index:s,selected:i,anchor:a,modifiers:l,mode:c}=e,x=t[s];if(c==="none"||x===void 0)return{selected:[...i],anchor:a};if(c==="single")return{selected:[x],anchor:x};const f=a===void 0?-1:t.indexOf(a);if(l.extend&&f!==-1){const p=js(t,f,s);return{selected:l.toggle?Vt([...i,...p],t):p,anchor:a}}if(l.toggle){const p=new Set(i);return p.has(x)?p.delete(x):p.add(x),{selected:Vt(p,t),anchor:x}}return{selected:[x],anchor:x}}function _s(e,t,s){return s!=="multiple"?{selected:[...t],anchor:void 0}:{selected:Vt([...t,...e],e),anchor:e[0]}}function En(e,t){return e==null?"":typeof e=="string"?e:typeof e=="number"?Number.isFinite(e)?t.number.format(e):"":typeof e=="boolean"?e?t.yes:t.no:Number.isNaN(e.getTime())?"":t.date.format(e)}function Cn(e){return e==null?!0:typeof e=="number"?!Number.isFinite(e):e instanceof Date&&Number.isNaN(e.getTime())}function Os(e,t,s){const i=Cn(e),a=Cn(t);return i||a?i&&a?0:i?-1:1:typeof e=="number"&&typeof t=="number"?e-t:typeof e=="boolean"&&typeof t=="boolean"?e===t?0:e?1:-1:e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():s.compare(String(e),String(t))}const Hs=xe.tableFeatures({columnFilteringFeature:xe.columnFilteringFeature,columnOrderingFeature:xe.columnOrderingFeature,columnVisibilityFeature:xe.columnVisibilityFeature,filteredRowModel:xe.createFilteredRowModel(),globalFilteringFeature:xe.globalFilteringFeature,rowSelectionFeature:xe.rowSelectionFeature,rowSortingFeature:xe.rowSortingFeature,sortedRowModel:xe.createSortedRowModel()}),Ns=320,Ds=8,ks=12,Ms=1.2,Gs="var(--mantine-primary-color-light)",Tn="mantine-focus-auto",Ot=[],Bs=[];function Rn(e){return e==="asc"?"ascending":e==="desc"?"descending":"none"}function Fs(e,t,s){return Math.min(Math.max(e,t),s)}function Vs(e,t){const{data:s,columns:i,getRowId:a,label:l,labelledBy:c,labels:x,height:f=Ns,rowHeight:p=u.DATA_PITCH,headerHeight:h=u.CONTROL_HEIGHT,overscan:m=Ds,selectionMode:b="multiple",selectedIds:v,defaultSelectedIds:T,onSelectionChange:R,sorting:C,defaultSorting:z,onSortingChange:I,hiddenColumns:w,defaultHiddenColumns:P,onHiddenColumnsChange:j,columnOrder:L,defaultColumnOrder:D,onColumnOrderChange:U,filter:G,defaultFilter:N,onFilterChange:$,searchable:A=!1,onRowClick:O,onRowDoubleClick:y,onRowContextMenu:S,onFocus:H,onBlur:k,empty:K}=e,q=zs(x),ge=_e(),Q=Fe(),le=qe(),ne=eo({numeric:!0,sensitivity:"variant"}),W=r.useMemo(()=>new Intl.DateTimeFormat(Q),[Q]),oe=r.useMemo(()=>({number:le,date:W,yes:q.yes,no:q.no}),[le,W,q.yes,q.no]),[Y,me]=X.useUncontrolled({value:v,defaultValue:T,finalValue:Ot,onChange:(d,E)=>{R==null||R([...d],E)}}),[be,Z]=X.useUncontrolled({value:C,defaultValue:z,finalValue:Bs,onChange:(d,E)=>{I==null||I([...d],E)}}),[fe,Ve]=X.useUncontrolled({value:w,defaultValue:P,finalValue:Ot,onChange:(d,E)=>{j==null||j([...d],E)}}),[Oe,Ze]=X.useUncontrolled({value:L,defaultValue:D,finalValue:Ot,onChange:(d,E)=>{U==null||U([...d],E)}}),[Ue,de]=X.useUncontrolled({value:G,defaultValue:N,finalValue:"",onChange:(d,E)=>{$==null||$(d,E)}}),we=r.useMemo(()=>{const d=new Map;for(const E of i)d.set(E.id,E);return d},[i]),Ce=JSON.stringify(fe),Re=r.useMemo(()=>{const d=new Set(fe);return i.filter(E=>(E.filterable??!0)&&!d.has(E.id)).map(E=>E.id)},[i,Ce]),He=r.useMemo(()=>{const d=Ue.trim();if(d!=="")return{query:d.toLocaleLowerCase(Q),columnIds:Re}},[Ue,Q,Re]),Ne=r.useMemo(()=>[...s],[s]),$e=r.useMemo(()=>i.map(d=>({id:d.id,accessorFn:E=>d.value(E),enableSorting:d.sortable??!0,enableHiding:d.hideable??!0,enableGlobalFilter:d.filterable??!0,sortDescFirst:d.descendingFirst,sortFn:(E,_)=>Os(d.value(E.original),d.value(_.original),ne)})),[i,ne]),Je=JSON.stringify(be),Qe=r.useMemo(()=>be.map(d=>({id:d.id,desc:d.desc})),[Je]),We=r.useMemo(()=>{const d={};for(const E of fe)d[E]=!1;return d},[fe]),ze=r.useMemo(()=>{const d={};for(const E of Y)d[E]=!0;return d},[Y]),Ye=r.useMemo(()=>[...Oe],[Oe]),Se=r.useRef(void 0),B=xe.useTable({features:Hs,data:Ne,columns:$e,getRowId:a,enableRowSelection:b!=="none",enableMultiRowSelection:b==="multiple",getColumnCanGlobalFilter:()=>!0,globalFilterFn:(d,E,_)=>{const V=_;if(V===void 0||!V.columnIds.includes(E))return!1;const J=we.get(E);return J===void 0?!1:En(J.value(d.original),oe).toLocaleLowerCase(Q).includes(V.query)},state:{sorting:Qe,columnVisibility:We,columnOrder:Ye,rowSelection:ze,globalFilter:He},onSortingChange:d=>{const E=xe.functionalUpdate(d,Qe);Z(E.map(_=>({id:_.id,desc:_.desc})),Se.current)},onColumnVisibilityChange:d=>{const E=xe.functionalUpdate(d,We);Ve(Object.keys(E).filter(_=>!E[_]))},onColumnOrderChange:d=>{Ze(xe.functionalUpdate(d,Ye))},onRowSelectionChange:d=>{me(Object.keys(xe.functionalUpdate(d,ze)))}}),{rows:ee}=B.getRowModel(),te=B.getVisibleLeafColumns(),ie=ee.length,ue=te.length,Ie=r.useMemo(()=>ee.map(d=>d.id),[ee]),M=r.useRef(null),se=r.useRef(null),Te=Lo.useVirtualizer({count:ie,getScrollElement:()=>M.current,estimateSize:()=>p,getItemKey:d=>Ie[d]??d,overscan:m}),[dt,De]=r.useState({row:pe,column:0}),ce=r.useMemo(()=>As(dt,{rowCount:ie,columnCount:ue}),[dt,ie,ue]),et=r.useRef(!1),ke=r.useRef(void 0),Co=d=>{d.row>=0&&Te.scrollToIndex(d.row),et.current=!0,De(E=>yt(E,d)?E:d)};r.useLayoutEffect(()=>{var _;if(!et.current)return;const d=`[data-grid-row="${ce.row}"][data-grid-column="${ce.column}"]`,E=(_=se.current)==null?void 0:_.querySelector(d);E instanceof HTMLElement&&(et.current=!1,E.focus())});const nn=(d,E)=>{ke.current=d.anchor,!(d.selected.length===Y.length&&d.selected.every((V,J)=>V===Y[J]))&&me(d.selected,E)},ut=(d,E,_)=>{nn(Ls({ids:Ie,index:d,selected:Y,anchor:ke.current,modifiers:E,mode:b}),_)},on=(d,E,_)=>{const V=ee[d];V!==void 0&&(O==null||O(V.original,E,_))},To=(d,E)=>{d.getCanSort()&&(Se.current=E,d.toggleSorting(void 0,E.shiftKey&&d.getCanMultiSort()),Se.current=void 0)},Ro=()=>{var _;const d=((_=M.current)==null?void 0:_.clientHeight)??0,E=Math.floor((d===0?p*10:d)/p);return Math.max(1,E-1)},zo=d=>{const E=b==="multiple",_=d.ctrlKey||d.metaKey;if(E&&_&&(d.key==="a"||d.key==="A")){d.preventDefault(),nn(_s(Ie,Y,b),d);return}if(ce.row>=0&&(d.key===" "||d.key==="Enter")){d.preventDefault(),d.key===" "?ut(ce.row,{extend:d.shiftKey,toggle:!d.shiftKey},d):(ut(ce.row,{extend:!1,toggle:!1},d),on(ce.row,d,{source:"keyboard"}));return}const V=Ps(ce,d.key,{rowCount:ie,columnCount:ue,pageSize:Ro()},ge,{jumpToEnd:_});V!==void 0&&(d.preventDefault(),Co(V),E&&d.shiftKey&&V.row>=0&&V.row!==ce.row&&ut(V.row,{extend:!0,toggle:!1},d))};r.useImperativeHandle(t,()=>({scrollToRow:d=>{d>=0&&d<ie&&Te.scrollToIndex(d)},setColumnHidden:(d,E)=>{var _;(_=B.getColumn(d))==null||_.toggleVisibility(!E)},moveColumn:(d,E)=>{const _=B.getAllLeafColumns().map(J=>J.id),V=_.indexOf(d);V!==-1&&(_.splice(V,1),_.splice(Fs(E,0,_.length),0,d),B.setColumnOrder(_))},clearSelection:()=>{ke.current=void 0,me([])}}),[B,Te,ie,me]);const Po=te.reduce((d,E)=>{var _;return d+(((_=we.get(E.id))==null?void 0:_.width)??u.FIELD)},0),sn=(d,E)=>{const _=(d==null?void 0:d.width)??u.FIELD;return{flex:E===ue-1?`1 1 ${String(_)}px`:`0 0 ${String(_)}px`,minWidth:0,boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:(d==null?void 0:d.align)==="end"?"flex-end":"flex-start",paddingInline:u.GUTTER,outlineOffset:-2,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt=b!=="none",rn=q.rowsShown(le.format(ie),le.format(s.length)),Ao=()=>K!==void 0?K:s.length===0?q.noRows:q.noMatchingRows;return n.jsxs(o.Box,{"data-testid":"data-table",dir:he(ge)?"rtl":void 0,onFocus:H,onBlur:k,style:{display:"flex",flexDirection:"column",gap:u.TRAIL_GAP,width:"100%",color:g.VALUE},children:[A&&n.jsxs(o.Box,{style:{display:"flex",alignItems:"center",gap:u.GUTTER},children:[n.jsx(o.TextInput,{"data-testid":"data-table-search",size:"xs",type:"search","aria-label":q.search,placeholder:q.searchPlaceholder,value:Ue,onChange:d=>{de(d.currentTarget.value,d)},rightSection:Ue===""?void 0:n.jsx(o.ActionIcon,{"data-testid":"data-table-search-clear",variant:"subtle",size:u.CONTROL_HEIGHT,"aria-label":q.clearSearch,onClick:d=>{de("",d)},children:n.jsx(re,{name:"close",size:u.CHEVRON})}),rightSectionPointerEvents:"all",style:{flex:"1 1 auto",minWidth:0}}),n.jsx(o.Box,{component:"span","data-testid":"data-table-count","aria-hidden":"true",dir:"auto",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",color:g.CHROME},children:rn})]}),n.jsxs(o.VisuallyHidden,{role:"status","aria-live":"polite",dir:"auto","data-testid":"data-table-status",children:[rn,pt&&Y.length>0?` ${q.rowsSelected(le.format(Y.length))}`:""]}),n.jsxs(o.Box,{ref:M,"data-testid":"data-table-viewport",style:{height:f,overflow:"auto",position:"relative",border:`1px solid ${g.BORDER}`,borderRadius:"var(--mantine-radius-sm)",background:g.PANEL},children:[n.jsxs(o.Table,{ref:se,role:"grid","aria-label":c===void 0&&l===void 0?q.dataTable:l,"aria-labelledby":c,"aria-rowcount":ie+1,"aria-colcount":ue,"aria-multiselectable":b==="multiple"?!0:void 0,onKeyDown:zo,stickyHeader:!0,tabularNums:!0,withRowBorders:!1,horizontalSpacing:0,verticalSpacing:0,highlightOnHover:pt,highlightOnHoverColor:g.SURFACE,style:{display:"grid",width:"100%",minWidth:Po,fontSize:ks,lineHeight:Ms},children:[n.jsx(o.Table.Thead,{style:{display:"grid",position:"sticky",insetBlockStart:0,zIndex:1,background:g.PANEL,borderBlockEnd:`1px solid ${g.DIVIDER}`},children:n.jsx(o.Table.Tr,{role:"row","aria-rowindex":1,style:{display:"flex",width:"100%",height:h},children:te.map((d,E)=>{const _=we.get(d.id),V=d.getCanSort(),J=d.getIsSorted(),ye=ce.row===pe&&ce.column===E,ft=J===!1?-1:d.getSortIndex(),xt=ye?0:-1,rt=n.jsxs(n.Fragment,{children:[n.jsx(o.Box,{component:"span","data-testid":"data-table-header-label",dir:"auto",title:_==null?void 0:_.header,style:{flex:"0 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:J===!1?void 0:g.VALUE},children:(_==null?void 0:_.header)??d.id}),J!==!1&&n.jsx(o.Box,{component:"span","data-testid":"data-table-sort-glyph","data-direction":Rn(J),"aria-hidden":"true",style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:g.VALUE,transform:J==="asc"?"rotate(180deg)":void 0},children:n.jsx(re,{name:"chevronDown",size:u.CHEVRON})}),Qe.length>1&&ft>=0&&n.jsx(o.Box,{component:"span","data-testid":"data-table-sort-priority","aria-hidden":"true",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-xs)",color:g.CHROME},children:le.format(ft+1)})]});return n.jsx(o.Table.Th,{scope:"col","data-testid":"data-table-header","aria-colindex":E+1,"aria-sort":V?Rn(J):void 0,"data-grid-row":V?void 0:pe,"data-grid-column":V?void 0:E,tabIndex:V?void 0:xt,className:V?void 0:Tn,onFocus:V?void 0:()=>{De(Pe=>yt(Pe,{row:pe,column:E})?Pe:{row:pe,column:E})},style:{...sn(_,E),gap:u.GUTTER/2,height:h,fontSize:"var(--mantine-font-size-sm)",fontWeight:500,color:g.CHROME,textAlign:"start"},children:V?n.jsx(o.UnstyledButton,{type:"button","data-testid":"data-table-sort-button","data-grid-row":pe,"data-grid-column":E,tabIndex:xt,onClick:Pe=>{De({row:pe,column:E}),To(d,Pe)},onFocus:()=>{De(Pe=>yt(Pe,{row:pe,column:E})?Pe:{row:pe,column:E})},style:{display:"flex",alignItems:"center",gap:u.GUTTER/2,justifyContent:(_==null?void 0:_.align)==="end"?"flex-end":"flex-start",flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",outlineOffset:-2,cursor:"pointer"},children:rt}):rt},d.id)})})}),n.jsx(o.Table.Tbody,{style:{display:"grid",position:"relative",height:Te.getTotalSize()},children:Te.getVirtualItems().map(d=>{const E=ee[d.index];if(E===void 0)return null;const _=Y.includes(E.id);return n.jsx(o.Table.Tr,{role:"row","data-testid":"data-table-row","data-index":d.index,"data-selected":_?"true":void 0,"aria-rowindex":d.index+2,"aria-selected":pt?_:void 0,onDoubleClick:V=>{y==null||y(E.original,V)},onContextMenu:V=>{S==null||S(E.original,V)},style:{display:"flex",position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:p,transform:`translateY(${String(d.start)}px)`,background:_?Gs:void 0,cursor:pt?"pointer":void 0},children:te.map((V,J)=>{const ye=we.get(V.id),ft=ce.row===d.index&&ce.column===J,xt=ye==null?void 0:ye.value(E.original),rt=En(xt,oe),Pe=(ye==null?void 0:ye.cell)===void 0?n.jsx(o.Box,{component:"span",dir:"auto",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:rt}):ye.cell(E.original);return n.jsx(o.Table.Td,{role:"gridcell","data-testid":"data-table-cell","aria-colindex":J+1,"data-grid-row":d.index,"data-grid-column":J,tabIndex:ft?0:-1,className:Tn,title:(ye==null?void 0:ye.cell)===void 0?rt:void 0,onFocus:()=>{De(Ae=>yt(Ae,{row:d.index,column:J})?Ae:{row:d.index,column:J})},onClick:Ae=>{De({row:d.index,column:J}),ut(d.index,{extend:Ae.shiftKey,toggle:Ae.metaKey||Ae.ctrlKey},Ae),on(d.index,Ae,it(Ae))},style:sn(ye,J),children:Pe},V.id)})},E.id)})})]}),ie===0&&n.jsx(o.Box,{"data-testid":"data-table-empty",style:{display:"flex",alignItems:"center",justifyContent:"center",padding:u.PAD_LEFT,fontSize:"var(--mantine-font-size-sm)",color:g.CHROME},children:Ao()})]})]})}const Us=r.forwardRef(Vs);function $s(){return crypto.randomUUID().slice(0,8)}function Et(e,t){return{id:$s(),offset:e,color:t}}function po(){return[Et(0,"#6366F1"),Et(1,"#06B6D4")]}const Ws=2,Ys=5,Xs=80,Ks=0,Ht=100,Nt=0,qs=360,Zs=[0,90,180,270,360];function Js({stops:e,defaultStops:t,direction:s,defaultDirection:i=Nt,showDirection:a=!0,onChange:l,onChangeStart:c,onChangeEnd:x,minStops:f=Ws,maxStops:p=Ys}){const h=ae(),m=qe({maximumFractionDigits:0}),b=r.useId(),v=r.useId(),T=r.useMemo(()=>po(),[]),[R,C]=X.useUncontrolled({value:e,defaultValue:t,finalValue:T,onChange:(A,O)=>{l==null||l(A,z,O)}}),[z,I]=X.useUncontrolled({value:s,defaultValue:i,finalValue:Nt,onChange:(A,O)=>{l==null||l(R,A,O)}}),w=r.useRef(!1),P=A=>{w.current||(w.current=!0,c==null||c(A))},j=(A,O)=>{w.current=!1,x==null||x(A,O)},L=(A,O)=>R.map((y,S)=>S===A?{...y,color:O}:y),D=(A,O)=>R.map((y,S)=>S===A?{...y,offset:O/Ht}:y),U=A=>{if(R.length>=p)return;const O=R[R.length-1],y=O===void 0?.5:(O.offset+1)/2,S=[...R,Et(y,St)];S.sort((H,k)=>H.offset-k.offset),C(S,A)},G=(A,O)=>{R.length<=f||C(R.filter((y,S)=>S!==A),O)},N=R.length>=p,$=R.length<=f;return n.jsxs(o.Stack,{"data-testid":"gradient-editor",gap:"xs",children:[n.jsxs(o.Group,{justify:"space-between",align:"center",children:[n.jsx(o.Text,{id:b,"data-testid":"gradient-editor-heading",size:"xs",c:g.CHROME,children:h.colorStops}),n.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,"data-testid":"gradient-editor-add-stop",onClick:U,disabled:N,"aria-label":h.addColorStop,children:n.jsx(re,{name:"plus",size:u.CHEVRON})})]}),n.jsx(o.Stack,{"data-testid":"gradient-editor-stops",gap:"xs",role:"group","aria-labelledby":b,children:R.map((A,O)=>{const y=m.format(O+1);return n.jsxs(o.Group,{"data-testid":"gradient-editor-stop",gap:"xs",align:"flex-end",wrap:"nowrap",children:[n.jsx(lo,{color:A.color,defaultColor:St,onColorChange:(S,H)=>{C(L(O,S??St),H)},showOpacity:!1}),n.jsx(o.Box,{style:{width:Xs},children:n.jsx(o.Slider,{"data-testid":"gradient-editor-stop-position",min:Ks,max:Ht,value:A.offset*Ht,onPointerDown:P,onChange:S=>{P(),C(D(O,S))},onChangeEnd:S=>{j(D(O,S),z)},label:S=>h.percent(m.format(S)),thumbLabel:h.colorStopPosition(y)})}),n.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,onClick:S=>{G(O,S)},"data-testid":"gradient-editor-remove-stop",disabled:$,"aria-label":h.removeColorStop(y),children:n.jsx(re,{name:"minus",size:u.CHEVRON})})]},A.id)})}),a&&n.jsxs(o.Box,{"data-testid":"gradient-editor-direction",pb:"md",role:"group","aria-labelledby":v,children:[n.jsx(o.Text,{id:v,"data-testid":"gradient-editor-direction-heading",size:"xs",c:g.CHROME,mb:4,children:h.direction}),n.jsx(o.Slider,{"data-testid":"gradient-editor-direction-slider",min:Nt,max:qs,value:z,onPointerDown:P,onChange:A=>{P(),I(A)},onChangeEnd:A=>{j(R,A)},label:A=>h.degrees(m.format(A)),thumbLabel:h.gradientDirection,marks:Zs.map(A=>({value:A,label:h.degrees(m.format(A))}))})]})]})}const Qs=4,er=2,tr=1.1;function nr(){const e=Fe();return r.useMemo(()=>{var s;return((s=new Intl.NumberFormat(e).formatToParts(tr).find(i=>i.type==="decimal"))==null?void 0:s.value)??"."},[e])}function or({label:e,value:t,defaultValue:s,onChange:i,min:a,max:l,step:c,decimalScale:x,suffix:f,hideControls:p=!0,disabled:h=!1,disabledReason:m,onFocus:b,onBlur:v}){const T=ae(),R=st({name:e,disabled:h,disabledReason:m}),C=Wt(),z=nr(),[I,w]=X.useUncontrolled({value:t,defaultValue:void 0,finalValue:void 0,onChange:i}),P=I===void 0,j=I??s,[L,D]=r.useState(j),U=r.useRef(!1);r.useEffect(()=>{U.current||D(I??s),U.current=!1},[I,s]);const G=A=>{U.current=!0,D(A)},N=A=>{const O=typeof L=="string"?C(L):L;if(Number.isNaN(O)){D(I??s),v==null||v(A);return}let y=O;a!==void 0&&y<a&&(y=a),l!==void 0&&y>l&&(y=l),y!==I&&w(y,A),D(y),v==null||v(A)},$=A=>{w(void 0,A)};return n.jsxs(o.Group,{"data-testid":"style-number-input",gap:Qs,wrap:"nowrap",align:"flex-end",title:R.title,"data-disabled":h?"true":void 0,children:[n.jsx(o.NumberInput,{"data-testid":"style-number-input-field",label:e,description:R.description,value:L,onChange:G,onFocus:b,onBlur:N,min:a,max:l,step:c,decimalScale:x,decimalSeparator:z,suffix:f,hideControls:p,disabled:h,"data-is-default":P?"true":"false",styles:{input:P?{fontStyle:"italic",color:g.CHROME}:void 0,description:It},style:{flex:1}}),!P&&n.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:g.CHROME,"data-testid":"style-number-input-reset",disabled:h,"aria-label":T.resetToDefault(e),onClick:$,style:{marginBlockEnd:er},children:n.jsx(re,{name:"reset",size:u.CHEVRON})})]})}const ir=4,sr=2;function rr({label:e,value:t,defaultValue:s,options:i,onChange:a,disabled:l=!1,disabledReason:c,onFocus:x,onBlur:f}){const p=ae(),h=st({name:e,disabled:l,disabledReason:c}),[m,b]=X.useUncontrolled({value:t,defaultValue:void 0,finalValue:void 0,onChange:a}),v=m===void 0,T=m??s,R=z=>{z!==null&&b(z)},C=z=>{b(void 0,z)};return n.jsxs(o.Group,{"data-testid":"style-select",gap:ir,wrap:"nowrap",align:"flex-end",title:h.title,"data-disabled":l?"true":void 0,children:[n.jsx(o.Select,{"data-testid":"style-select-field",label:e,description:h.description,value:T,onChange:R,onFocus:x,onBlur:f,data:i,rightSection:n.jsx(re,{name:"chevronDown",size:u.GLYPH}),rightSectionPointerEvents:"none",disabled:l,"data-is-default":v?"true":"false",allowDeselect:!1,styles:{input:v?{fontStyle:"italic",color:g.CHROME}:void 0,description:It},style:{flex:1}}),!v&&n.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:g.CHROME,"data-testid":"style-select-reset",disabled:l,"aria-label":p.resetToDefault(e),onClick:C,style:{marginBlockEnd:sr},children:n.jsx(re,{name:"reset",size:u.CHEVRON})})]})}const vt=4,ar=`${String(u.TOGGLE_PITCH)}px`;function lr({label:e,checked:t,defaultChecked:s,onChange:i,disabled:a=!1,disabledReason:l,bound:c=!1,boundDescription:x,onFocus:f,onBlur:p,children:h}){const m=r.useId(),b=ae(),[v,T]=X.useUncontrolled({value:t,defaultValue:s,finalValue:!1,onChange:i}),R=P=>{T(P.currentTarget.checked,P)},C={root:{minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:vt,fontSize:"var(--mantine-font-size-sm)",lineHeight:ar,color:a?g.DISABLED:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},z=x??b.fieldBound,I=st({name:e,enabledTitle:e,disabled:a,disabledReason:l,extraDescriptions:c?[z]:void 0}),w=n.jsx(o.Checkbox,{"data-testid":"toggle-with-content-checkbox",label:e,checked:v,disabled:a,"aria-expanded":v,"aria-controls":v?m:void 0,"aria-describedby":I.describedBy,onChange:R,onFocus:f,onBlur:p,wrapperProps:{title:I.title},styles:C});return n.jsxs(o.Box,{"data-testid":"toggle-with-content","data-checked":v?"true":"false","data-disabled":a?"true":void 0,"data-bound":c?"true":void 0,style:{display:"flex",flexDirection:"column",gap:vt},children:[c?n.jsxs(o.Box,{"data-testid":"toggle-with-content-row",style:{display:"flex",alignItems:"center",gap:vt},children:[w,n.jsx(o.Box,{component:"span","data-testid":"toggle-with-content-bound",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",color:g.CHROME},children:n.jsx(Ke,{name:"attribute",filled:!0})})]}):w,I.description!==void 0&&n.jsx(o.VisuallyHidden,{id:I.describedBy,children:I.description}),v&&n.jsx(o.Box,{id:m,"data-testid":"toggle-with-content-children",style:{display:"flex",flexDirection:"column",gap:vt,paddingInlineStart:u.GUTTER},children:h})]})}function fo(e,t){return e!==void 0?e:t===void 0?"off":"polite"}function Be(e,t){const s=fo(e,t);return s==="off"?{"aria-busy":t}:{"aria-live":s,"aria-atomic":!0,"aria-busy":t}}const Dt=4,cr="(hover: none)";function dr(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e)}function ur(e){const{state:t,stateTitle:s,busy:i,live:a,actions:l,residentActions:c,actionsVisible:x,disabled:f=!1,onClick:p,onFocus:h,onBlur:m}=e,b=Be(a,i),{hovered:v,ref:T}=X.useHover(),R=X.useMediaQuery(cr)??!1,[C,z]=r.useState(!1),I=r.useId(),w=C||(x??(v||R)),P=l!==void 0||c!==void 0,j=dr(t),L=s!==void 0&&s!==j,D=s??j,U=P&&t!==void 0,G=L?n.jsxs(n.Fragment,{children:[n.jsx("span",{"aria-hidden":"true",children:t}),n.jsx(o.VisuallyHidden,{"data-testid":"action-row-state-full",children:s})]}):t;Le(p!==void 0&&t===void 0?"ActionRow was given onClick but no state, and its own activation is carried by the text it reports. That text is also what names the row for a screen reader, so a row with nothing to report has nothing to activate. Give the row a state, or put the action on a control in actions.":void 0);const N=S=>{z(!0),h==null||h(S)},$=S=>{S.currentTarget.contains(S.relatedTarget)||z(!1),m==null||m(S)},A=S=>{f||p==null||p(S,it(S))},O={flex:"1 1 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:f?g.DISABLED:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},y={...O,alignSelf:"stretch",lineHeight:`${u.ROW_PITCH}px`,textAlign:"start",borderRadius:"var(--mantine-radius-sm)"};return n.jsxs(o.Box,{ref:T,"data-testid":"action-row",role:U?"group":void 0,"aria-labelledby":U?I:void 0,"aria-disabled":f||void 0,"data-disabled":f||void 0,onFocus:N,onBlur:$,style:{display:"flex",alignItems:"center",justifyContent:"space-between",boxSizing:"border-box",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[t!==void 0&&(p===void 0?n.jsx(o.Box,{component:"span",id:I,"data-testid":"action-row-state",title:D,...b,style:O,children:G}):n.jsx(o.UnstyledButton,{type:"button",id:I,"data-testid":"action-row-state",title:D,...b,onClick:A,style:y,children:G})),P&&n.jsxs(o.Box,{"data-testid":"action-row-affordances",style:{flex:"0 0 auto",marginInlineStart:"auto",display:"flex",alignItems:"center",gap:Dt},children:[l!==void 0&&n.jsx(o.Box,{"data-testid":"action-row-actions","data-visible":w?"true":"false",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Dt,opacity:w?1:0,pointerEvents:w?void 0:"none"},children:l}),c!==void 0&&n.jsx(o.Box,{"data-testid":"action-row-resident-actions",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Dt},children:c})]})]})}const xo=u.GUTTER,pr=12,ho=1.2,fr=20,xr=500,hr="var(--mantine-primary-color-light)";function gr({name:e,value:t,icon:s,selected:i=!1,role:a="button",tabIndex:l,onClick:c,onDoubleClick:x,onContextMenu:f,onFocus:p,onBlur:h,trailing:m}){const{hovered:b,ref:v}=X.useHover(),T=c!==void 0,R=s!=null,C=t!=null,z=lt(m),I=a==="option",w=I?i:void 0,P=!I&&i?!0:void 0,j=G=>{c==null||c(G,it(G))};let L="transparent";i?L=hr:T&&b&&(L=g.SURFACE);const D=n.jsxs(n.Fragment,{children:[R&&n.jsx(o.Box,{component:"span","data-testid":"data-row-icon",style:{flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},children:s}),n.jsx(o.Box,{component:"span","data-testid":"data-row-name",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),C&&n.jsx(o.Box,{component:"span","data-testid":"data-row-value",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",color:g.CHROME},children:t})]}),U={display:"flex",alignItems:"center",gap:u.GUTTER,flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",cursor:T?"pointer":"default"};return n.jsxs(o.Box,{ref:v,"data-testid":"data-row","data-selected":i?"true":void 0,onDoubleClick:x,onContextMenu:f,style:{display:"flex",alignItems:"center",gap:u.TRAIL_GAP,boxSizing:"border-box",width:"100%",height:u.DATA_PITCH,paddingInline:xo,borderRadius:"var(--mantine-radius-sm)",background:L,color:g.VALUE,fontSize:pr,lineHeight:ho},children:[T?n.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-button",role:I?"option":void 0,"aria-current":P,"aria-selected":w,tabIndex:l,onClick:j,onFocus:p,onBlur:h,style:U,children:D}):n.jsx(o.Box,{"data-testid":"data-row-body",role:I?"option":void 0,"aria-current":P,"aria-selected":w,tabIndex:l,onFocus:p,onBlur:h,style:U,children:D}),z&&n.jsx(Ee,{children:m})]})}function mr({label:e,unit:t,sortDirection:s,defaultSortDirection:i,onSortChange:a,sortPriority:l}){const[c,x]=X.useUncontrolled({value:s,defaultValue:i,finalValue:"none",onChange:a}),f=qe(),p=a!==void 0,h=c!=="none",m=T=>{x(c==="ascending"?"descending":"ascending",T)},b=n.jsxs(n.Fragment,{children:[n.jsx(o.Box,{component:"span","data-testid":"data-row-header-label",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:h?g.VALUE:void 0},children:e}),t!==void 0&&n.jsx(o.Box,{component:"span","data-testid":"data-row-header-unit",style:{flex:"0 0 auto",whiteSpace:"nowrap"},children:t}),l!==void 0&&h&&n.jsx(o.Box,{component:"span","aria-hidden":"true",style:{flex:"0 0 auto",display:"flex"},children:n.jsx(tn,{children:f.format(l)})}),h&&n.jsx(o.Box,{component:"span","data-testid":"data-row-header-sort-glyph","data-direction":c,style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:g.VALUE,transform:c==="ascending"?"rotate(180deg)":void 0},children:n.jsx(re,{name:"chevronDown",size:u.CHEVRON})})]}),v=p||h;return n.jsx(o.Box,{"data-testid":"data-row-header",role:v?"columnheader":void 0,"aria-sort":v?c:void 0,style:{display:"flex",alignItems:"center",gap:u.GUTTER,boxSizing:"border-box",width:"100%",height:fr,paddingInline:xo,fontSize:"var(--mantine-font-size-sm)",lineHeight:ho,color:g.CHROME},children:p?n.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-header-sort",onClick:m,style:{display:"flex",alignItems:"center",gap:u.GUTTER,flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",cursor:"pointer"},children:b}):b})}function tn({children:e}){return n.jsx(o.Badge,{component:"span","data-testid":"rank-chip",style:{flex:"0 0 auto",background:g.RAISED,color:g.VALUE,fontWeight:xr,textTransform:"none",letterSpacing:"normal"},children:e})}const zn=2,br=1,yr=13,vr=2,wr=1,Sr=1,Ir=64,go=4,Pn=go/2,mo=4,Er=12,Xe=100,Cr=1.5,Ut=100;function Ct({children:e,end:t,id:s}){return n.jsx(o.Box,{component:"span",id:s,"data-testid":`chart-axis-${t}`,style:{flex:"0 0 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME,whiteSpace:"nowrap"},children:e})}function bo(){return n.jsx(o.Box,{"data-testid":"chart-baseline",style:{flex:"0 0 auto",height:br,background:g.BORDER}})}function yo({caption:e,rows:t,testId:s}){return n.jsxs(o.VisuallyHidden,{component:"table","data-testid":s,children:[e!==void 0&&n.jsx("caption",{children:e}),n.jsx("tbody",{children:t.map(i=>n.jsxs("tr",{children:[n.jsx("th",{scope:"row",children:i.header}),n.jsx("td",{children:i.value})]},i.id))})]})}function Tr(e,t){if(e.length===0)return null;const s=Xe/2;if(e.length===1)return`0,${s} ${Xe},${s}`;const i=Math.min(...e),l=Math.max(...e)-i,c=e.length-1;return e.map((x,f)=>{const p=Zi(f/c,Xe,t),h=l===0?s:Xe-(x-i)/l*Xe;return`${p},${h}`}).join(" ")}function vo(){const e=r.useId(),t=`${e}min`,s=`${e}max`;return{min:t,max:s,describedBy:`${t} ${s}`}}function Rr({bins:e,label:t,minLabel:s,maxLabel:i,busy:a,live:l,trailing:c}){const x=qe(),f=vo(),p=e.reduce((m,b)=>Math.max(m,b.count,0),0),h=e.map((m,b)=>({id:`${m.label}-${String(b)}`,header:m.label,value:x.format(m.count)}));return n.jsxs(o.Box,{"data-testid":"histogram-row","aria-busy":a,style:{display:"flex",alignItems:"flex-start",gap:u.TRAIL_GAP,height:u.HISTOGRAM_HEIGHT},children:[n.jsxs(o.Box,{"data-testid":"histogram-chart",...Be(l,a),style:{flex:"1 1 auto",minWidth:0,height:"100%",display:"flex",flexDirection:"column",gap:zn},children:[n.jsxs(o.Box,{"data-testid":"histogram-drawing",role:t===void 0?void 0:"img","aria-label":t,"aria-describedby":t===void 0?void 0:f.describedBy,"aria-hidden":t===void 0?!0:void 0,style:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column",gap:zn},children:[n.jsx(o.Box,{"data-testid":"histogram-plot",style:{flex:"1 1 auto",minHeight:0,display:"flex",alignItems:"flex-end",gap:vr},children:e.map((m,b)=>{const v=Math.max(0,m.count),T=p===0?0:v/p*Ut,R=m.highlighted===!0;return n.jsx(o.Box,{"data-testid":"histogram-bar","data-highlighted":R?"true":"false","aria-hidden":"true",title:m.label,style:{flex:"1 1 0",minWidth:0,height:`${String(T)}%`,minHeight:v>0?Sr:0,background:R?g.ACCENT:g.BORDER,borderRadius:wr}},`${m.label}-${String(b)}`)})}),n.jsx(bo,{})]}),n.jsxs(o.Box,{"data-testid":"chart-axis",style:{flex:"0 0 auto",height:yr,display:"flex",alignItems:"center",justifyContent:"space-between",gap:mo},children:[n.jsx(Ct,{end:"min",id:f.min,children:s}),n.jsx(Ct,{end:"max",id:f.max,children:i})]})]}),n.jsx(yo,{caption:t,rows:h,testId:"histogram-values"}),lt(c)&&n.jsx(Ee,{children:c})]})}function zr({values:e,label:t,minLabel:s,maxLabel:i,busy:a,live:l,trailing:c}){const x=_e(),f=qe(),p=vo(),h=Tr(e,x),m=e.map((b,v)=>({id:`point-${String(v)}`,header:f.format(v+1),value:f.format(b)}));return n.jsxs(o.Box,{"data-testid":"sparkline-row","aria-busy":a,style:{display:"flex",alignItems:"center",gap:u.TRAIL_GAP,height:u.SPARKLINE_HEIGHT},children:[n.jsxs(o.Box,{"data-testid":"sparkline-chart",...Be(l,a),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:mo},children:[n.jsx(Ct,{end:"min",id:p.min,children:s}),n.jsxs(o.Box,{"data-testid":"sparkline-drawing",role:t===void 0?void 0:"img","aria-label":t,"aria-describedby":t===void 0?void 0:p.describedBy,"aria-hidden":t===void 0?!0:void 0,style:{flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",color:g.BORDER},children:[n.jsx(o.Box,{component:"svg","data-testid":"sparkline-plot",width:"100%",height:u.CONTROL_HEIGHT,viewBox:`0 0 ${String(Xe)} ${String(Xe)}`,preserveAspectRatio:"none",fill:"none",stroke:"currentColor",strokeWidth:Cr,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{display:"block",overflow:"visible"},children:h!==null&&n.jsx("polyline",{points:h,vectorEffect:"non-scaling-stroke"})}),n.jsx(bo,{})]}),n.jsx(Ct,{end:"max",id:p.max,children:i})]}),n.jsx(yo,{caption:t,rows:m,testId:"sparkline-values"}),lt(c)&&n.jsx(Ee,{children:c})]})}function Pr({name:e,percentile:t,value:s,rank:i,busy:a,live:l,onClick:c,onDoubleClick:x,onContextMenu:f,onFocus:p,onBlur:h}){const m=ae(),b=Qn(),v=r.useId(),T=c,R=T!==void 0,C=Math.min(Ut,Math.max(0,t)),z=m.percentile(b(Math.round(C))),I=P=>{T!==void 0&&T(P,it(P))},w=P=>{T!==void 0&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),T(P,it(P)))};return n.jsxs(o.Box,{"data-testid":"metric-row",role:R?"button":void 0,tabIndex:R?0:void 0,...Be(l,a),onClick:I,onKeyDown:w,onDoubleClick:x,onContextMenu:f,onFocus:p,onBlur:h,style:{display:"flex",alignItems:"center",gap:u.GUTTER,height:u.ROW_PITCH,cursor:R?"pointer":"default"},children:[n.jsx(o.Box,{component:"span",id:v,"data-testid":"metric-row-name",title:e,style:{flex:"1 1 auto",minWidth:0,fontSize:Er,lineHeight:1.2,color:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),n.jsx(o.Progress.Root,{"data-testid":"metric-row-bar",role:"progressbar","aria-labelledby":v,"aria-valuemin":0,"aria-valuemax":Ut,"aria-valuenow":C,"aria-valuetext":z,title:z,size:go,style:{flex:`0 0 ${String(Ir)}px`,borderRadius:Pn,background:g.SURFACE},children:n.jsx(o.Progress.Section,{"data-testid":"metric-row-fill",value:C,withAria:!1,color:g.ACCENT,style:{borderRadius:Pn}})}),n.jsx(o.Box,{component:"span","data-testid":"metric-row-value",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.VALUE},children:s}),i!==void 0&&n.jsx(tn,{children:i})]})}const wo=r.createContext(!1);function So({showLabels:e=!1,children:t}){return n.jsx(wo.Provider,{value:e,children:t})}function ct(){return r.useContext(wo)}const Ar=u.VALUE_INSET-u.GLYPH_SLOT,jr=2,Lr=1,_r=2,Or=3;function Hr(e){if(e.fullValue!==void 0)return e.fullValue;if(typeof e.value=="string")return e.value;if(typeof e.value=="number")return String(e.value)}function Nr({segment:e,grow:t,index:s}){const{glyph:i,value:a,unit:l,mono:c=!1}=e;let x=null;Yt(i)?x=n.jsx(Ke,{name:i}):Xt(i)?x=n.jsx(o.Box,{component:"span","data-letter":i,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:i}):i!=null&&(x=i);const f=Hr(e),p=e.fullValue!==void 0;return n.jsxs(o.Box,{"data-testid":"compound-segment","data-segment-index":s,"data-grow":t?"true":"false",style:{display:"flex",alignItems:"center",boxSizing:"border-box",flex:t?"1 1 auto":"0 0 auto",minWidth:0,height:u.CONTROL_HEIGHT,paddingBlock:0,paddingInline:Ar},children:[x!==null&&n.jsx(o.Box,{"data-testid":"compound-segment-slot",style:{flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},children:x}),n.jsx(o.Box,{component:"span","data-testid":"compound-segment-value","data-mono":c?"true":"false",title:f,"aria-hidden":p?!0:void 0,style:{flex:t?"1 1 auto":"0 0 auto",minWidth:0,fontFamily:c?"var(--mantine-font-family-monospace)":void 0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",unicodeBidi:"isolate"},children:a}),p&&n.jsx(o.VisuallyHidden,{children:e.fullValue}),l!==void 0&&n.jsx(o.Box,{component:"span","data-testid":"compound-segment-unit",style:{flex:"0 0 auto",marginInlineStart:jr,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME},children:l})]})}function Dr(e,t){if(!(t>=_r&&t<=Or))return`CompoundRow "${e}" was given ${String(t)} ${t===1?"segment":"segments"}, and it holds two or three. A compound row shows one value together with the parts that belong to it: use PanelField for a single value, and a table or a list of rows for more than three.`}function kr(e,t){if(t!==1)return`CompoundRow "${e}" was given ${String(t)} segments that set grow, and exactly one should. The segment that sets grow takes the box's leftover width and should be the main value, with the rest sized to their content. Using the first segment that sets it, or the leading segment when none does.`}function Mr({label:e,segments:t,width:s=u.BODY,trailing:i,busy:a,live:l,onClick:c,onFocus:x,onBlur:f}){const p=ct(),h=r.useId(),m=t.filter(L=>L.grow===!0).length;Le(Dr(e,t.length)),Le(kr(e,m));const b=t.findIndex(L=>L.grow===!0),v=b===-1?0:b,T=c!==void 0,R=fo(l,a)!=="off",C=T||R,z=T?void 0:h,I=C?void 0:h,w=C||p,P={display:"flex",alignItems:"center",boxSizing:"border-box",flex:p?"1 1 auto":"0 0 auto",width:p?void 0:s,minWidth:0,height:u.CONTROL_HEIGHT,background:g.SURFACE,borderRadius:"var(--mantine-radius-sm)",overflow:"hidden",textAlign:"start",cursor:T?"pointer":void 0},j=n.jsxs(n.Fragment,{children:[C&&n.jsx(o.VisuallyHidden,{id:z,children:e}),t.map((L,D)=>n.jsxs(r.Fragment,{children:[D>0&&n.jsx(o.Box,{"data-testid":"compound-row-hairline",style:{flex:"0 0 auto",width:Lr,height:u.CONTROL_HEIGHT,background:g.PANEL}}),n.jsx(Nr,{segment:L,grow:D===v,index:D})]},D))]});return n.jsxs(o.Box,{"data-testid":"compound-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[p&&n.jsx(o.Box,{component:"span",id:I,"data-testid":"compound-row-label",title:e,"aria-hidden":C?!0:void 0,style:{flex:`0 0 ${u.LABEL_COLUMN}px`,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),T?n.jsx(o.UnstyledButton,{type:"button",title:e,"data-testid":"compound-row-box","data-interactive":"true",...Be(l,a),onClick:c,onFocus:x,onBlur:f,style:P,children:j}):n.jsx(o.Box,{role:"group","aria-label":w?void 0:e,"aria-labelledby":w?h:void 0,title:e,"data-testid":"compound-row-box","data-interactive":"false",...Be(l,a),onFocus:x,onBlur:f,style:P,children:j}),n.jsx(Ee,{children:i})]})}const kt=u.VALUE_INSET-u.GLYPH_SLOT,wt=4,An=4,Gr=u.VALUE_INSET+u.LABEL_COLUMN,jn={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},Io=r.forwardRef(function(t,s){const{label:i,glyph:a,kind:l,value:c,defaultValue:x,onChange:f,data:p,unit:h,width:m=u.FIELD,bound:b=!1,mixed:v=!1,placeholder:T,pending:R=!1,min:C,max:z,step:I,onScrubStart:w,onScrub:P,onScrubEnd:j,onClick:L,disabled:D=!1,readOnly:U,boundDescription:G,pendingDescription:N,title:$,style:A,className:O,onKeyDown:y,...S}=t,H=ct(),k=ae(),K=_e(),q=X.useMediaQuery("(pointer: coarse)"),[ge,Q]=X.useUncontrolled({value:c===null?"":c,defaultValue:x,finalValue:"",onChange:f}),le=l??(p!==void 0?"select":"text"),ne=le==="select",W=le==="select"&&p!==void 0,oe=U??(f===void 0&&x===void 0),Y=String(ge),me=T===!0,be=v||me;let Z;v?Z=k.mixed:me?Z=Y:typeof T=="string"&&(Z=T);const fe=[];v&&fe.push(k.mixed);const Ve=G??k.fieldBound,Oe=N??k.fieldPending;b&&Ve!==""&&fe.push(Ve),R&&Oe!==""&&fe.push(Oe);const Ze=fe.length>0?fe.join(". "):void 0,de=(w!==void 0||P!==void 0||j!==void 0)&&!D&&!q,we=r.useRef(!1),Ce=r.useRef(!1),Re=r.useRef(0),He=M=>{if(!de||M.button!==0)return;M.preventDefault(),M.stopPropagation();const se=M.currentTarget;typeof se.setPointerCapture=="function"&&se.setPointerCapture(M.pointerId),we.current=!0,Ce.current=!1,Re.current=M.clientX},Ne=M=>{if(!we.current)return;const se=M.clientX-Re.current;se!==0&&(Re.current=M.clientX,Ce.current||(Ce.current=!0,w==null||w(M)),P==null||P(he(K)?-se:se,M))},$e=M=>{we.current&&(we.current=!1,Ce.current&&(Ce.current=!1,j==null||j(M)))},Je=M=>{D||L==null||L(M)},Qe=M=>{y==null||y(M),!(L===void 0||D||M.defaultPrevented)&&(W||(M.key==="Enter"||M.key===" "&&oe)&&(M.preventDefault(),L(M)))},We=(M,se)=>{Q(M,se)};let ze=null;Yt(a)?ze=n.jsx(Ke,{name:a,filled:b}):Xt(a)?ze=n.jsx(o.Box,{component:"span","data-letter":a,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:a}):a!=null&&(ze=a);const Ye=n.jsxs(n.Fragment,{children:[n.jsxs(o.Box,{"data-testid":"panel-field-slot","data-scrub":de?"true":void 0,onPointerDown:de?He:void 0,onPointerMove:de?Ne:void 0,onPointerUp:de?$e:void 0,onPointerCancel:de?$e:void 0,onLostPointerCapture:de?$e:void 0,style:{position:"relative",flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME,cursor:de?"ew-resize":void 0,touchAction:de?"none":void 0},children:[ze,R&&n.jsx(o.Box,{"data-testid":"panel-field-pending",style:{position:"absolute",insetInlineStart:0,bottom:0,width:An,height:An,background:g.ACCENT}})]}),H&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-label","aria-hidden":"true",style:{flex:"1 1 auto",minWidth:0,marginInlineStart:wt,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i})]}),Se=h!==void 0,B=Se||ne?n.jsxs(n.Fragment,{children:[Se&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-unit",style:{flex:"0 0 auto",lineHeight:1},children:h}),ne&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-chevron",style:{flex:"0 0 auto",display:"flex",alignItems:"center",marginInlineStart:Se?wt:0},children:n.jsx(re,{name:"chevronDown",size:u.GLYPH})})]}):void 0;let ee=kt+wt;ne&&(ee+=u.GLYPH),ne&&Se&&(ee+=wt);const te=B===void 0?void 0:`calc(${String((h==null?void 0:h.length)??0)}ch + ${String(ee)}px)`,ie=de?"auto":"none",Ie={"data-testid":"panel-field-value",...S,ref:s,className:O,label:i,description:Ze,placeholder:Z,disabled:D,readOnly:oe,onClick:Je,onKeyDown:Qe,leftSection:Ye,leftSectionWidth:H?Gr:u.VALUE_INSET,leftSectionPointerEvents:ie,leftSectionProps:{style:{insetInlineStart:0,justifyContent:"flex-start",paddingInlineStart:kt}},rightSection:B,rightSectionWidth:te,rightSectionPointerEvents:"none",rightSectionProps:{style:{insetInlineEnd:0,justifyContent:"flex-end",paddingInlineEnd:kt,fontSize:"var(--mantine-font-size-sm)",color:g.CHROME}},styles:{wrapper:{marginTop:0,marginBottom:0,"--input-placeholder-color":v?g.VALUE:g.PLACEHOLDER},input:{backgroundColor:g.SURFACE,paddingInlineStart:void 0,paddingInlineEnd:void 0},label:jn,description:jn},wrapperProps:{title:$??i,"data-testid":"panel-field","data-kind":le,"data-bound":b?"true":void 0,"data-mixed":v?"true":void 0,"data-pending":R?"true":void 0,"data-disabled":D?"true":void 0},style:{flex:m==="fill"?"1 1 auto":"0 0 auto",width:m==="fill"?"100%":m,minWidth:0,...A}};return le==="number"?n.jsx(o.NumberInput,{...Ie,value:be?"":ge,onChange:We,min:C,max:z,step:I,hideControls:!0}):W?n.jsx(o.Select,{...Ie,data:p,value:be||Y===""?null:Y,onChange:M=>{We(M??"")}}):n.jsx(o.TextInput,{...Ie,value:be?"":Y,onChange:M=>{We(M.currentTarget.value,M)}})}),Br=2,Fr=u.BODY+u.TRAIL_GAP;function Vr(e){return r.Children.toArray(e).flatMap(t=>r.isValidElement(t)&&t.type===r.Fragment?r.Children.toArray(t.props.children):[t])}function Ln(e,t){return r.isValidElement(e)&&e.key!==null?e.key:`field-row-${String(t)}`}function Ur(e){if(r.isValidElement(e)&&typeof e.props.label=="string")return e.props.label}function _n(e){return r.isValidElement(e)&&e.type===Io?r.cloneElement(e,{width:"fill"}):e}const $r=r.forwardRef(function({children:t,trailing:s,groupLabel:i,role:a,style:l,"aria-label":c,"aria-labelledby":x,...f},p){const h=ct(),m=Vr(t),b=m.length;Le(b===0||b>Br?`FieldRow was given ${String(b)} ${b===1?"field":"fields"}, and it holds one field, or two side by side. A row with none is an empty 32px gap, and a third field has nowhere to go in the 280px panel the row is measured for. Put the extra fields on rows of their own.`:void 0);const v=i??c,R=a??(v!==void 0||x!==void 0?"group":void 0),C=lt(s);if(h&&b>1)return n.jsx(o.Box,{ref:p,"data-testid":"field-row-labelled","data-fields":b,role:R,"aria-label":v,"aria-labelledby":x,...f,style:{display:"flex",flexDirection:"column",...l},children:m.map((j,L)=>{const D=Ur(j);return n.jsxs(o.Box,{"data-testid":"field-row","data-labelled":"true",style:{display:"flex",alignItems:"center",height:u.ROW_PITCH},children:[n.jsx(o.Box,{component:"span","data-testid":"field-row-label",title:D,style:{flex:`0 0 ${String(u.LABEL_COLUMN)}px`,minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:D}),n.jsx(o.Box,{"data-testid":"field-row-slot","data-width":"fill",style:{display:"flex",alignItems:"center",flex:"1 1 auto",minWidth:0,marginInlineStart:u.GUTTER,marginInlineEnd:u.TRAIL_GAP},children:n.jsx(So,{showLabels:!1,children:_n(j)})}),n.jsx(Ee,{children:L===0?s:null})]},Ln(j,L))})});const z=b<=1,I=z&&!C;let w=u.FIELD;z&&(w=I?Fr:u.BODY);const P=I?void 0:u.TRAIL_GAP;return n.jsxs(o.Box,{ref:p,"data-testid":"field-row","data-fields":b,role:R,"aria-label":v,"aria-labelledby":x,...f,style:{display:"flex",alignItems:"center",height:u.ROW_PITCH,...l},children:[m.map((j,L)=>n.jsx(o.Box,{"data-testid":"field-row-slot","data-width":w,style:{display:"flex",alignItems:"center",flex:`0 0 ${String(w)}px`,minWidth:0,marginInlineStart:L===0?void 0:u.GUTTER,marginInlineEnd:L===b-1?P:void 0},children:_n(j)},Ln(j,L))),n.jsx(Ee,{children:s})]})}),Wr=2,Yr=6,Eo=1,Xr=u.CONTROL_HEIGHT-Eo*2,Kr=2,On=3,qr=4,Zr=6,Jr=u.GLYPH,Qr=3;function ea(e,t){return t?g.DISABLED:e?g.ON_SELECTED:g.CHROME}function ta(e){const{options:t,value:s,defaultValue:i,onChange:a,label:l,labelledBy:c,name:x,disabled:f=!1,disabledReason:p,hybrid:h=!1,width:m,trailing:b,onFocus:v,onBlur:T}=e,R=ct(),C=t.length,z=st({name:l,disabled:f,disabledReason:p}),[I]=t,[w,P]=X.useUncontrolled({value:s,defaultValue:i,finalValue:I===void 0?"":I.value,onChange:a}),j=r.useRef(void 0);Le(C<Wr||C>Yr?`IconGroupRow was given ${String(C)} ${C===1?"option":"options"}, and it holds two to six drawable ones. One option is a statement rather than a choice and belongs in a field, and more than six stop reading as a set of drawings -- use a select instead. Rendering them anyway.`:void 0);const L=m??(C<=Qr?u.FIELD:u.BODY),D=L==="fill",U=N=>{var y;if(f||N.key!=="Home"&&N.key!=="End")return;const $=t.filter(S=>S.disabled!==!0),A=N.key==="Home"?$[0]:$[$.length-1];if(A===void 0)return;N.preventDefault(),P(A.value,N),(y=Array.from(N.currentTarget.querySelectorAll('input[type="radio"]')).find(S=>S.value===A.value))==null||y.focus()},G=t.map(N=>{const $=N.value===w,A=f||N.disabled===!0,O=R||h&&$;return{value:N.value,disabled:N.disabled,label:n.jsxs(o.Box,{component:"span","data-testid":"icon-group-button","data-value":N.value,"data-active":$?"true":"false",title:N.label,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",gap:O?qr:0,paddingInline:O?Zr:0,width:"100%",minWidth:0,color:ea($,A)},children:[n.jsx(o.Box,{component:"span","data-testid":"icon-group-icon",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:N.icon}),O?n.jsx(o.Box,{component:"span","data-testid":"icon-group-word",style:{minWidth:0,fontWeight:500,lineHeight:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:N.label}):n.jsx(o.VisuallyHidden,{children:N.label})]})}});return n.jsxs(o.Box,{"data-testid":"icon-group-row",title:z.title,"data-disabled":f?"true":void 0,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[n.jsx(o.SegmentedControl,{data:G,value:w,onChange:N=>{const $=j.current;j.current=void 0,P(N,$)},onChangeCapture:N=>{j.current=N},onKeyDown:U,onFocus:v,onBlur:T,name:x,disabled:f,radius:"sm","aria-label":l,"aria-labelledby":c,"aria-describedby":z.describedBy,"data-testid":"icon-group-track","data-hybrid":h?"true":void 0,__vars:{"--sc-color":g.SELECTED,"--sc-shadow":"none"},styles:{root:{boxSizing:"border-box",flex:D?"1 1 auto":"0 0 auto",width:D?"100%":L,minWidth:0,height:u.CONTROL_HEIGHT,padding:Eo,gap:Kr,backgroundColor:g.SURFACE,overflow:"visible"},control:{flex:"1 1 auto",minWidth:Jr},label:{display:"flex",alignItems:"center",justifyContent:"center",height:Xr,padding:0,borderRadius:On,fontSize:"var(--mantine-font-size-sm)"},innerLabel:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minWidth:0},indicator:{backgroundColor:g.SELECTED,borderRadius:On,boxShadow:"none"}}}),z.description!==void 0&&n.jsx(o.VisuallyHidden,{id:z.describedBy,children:z.description}),n.jsx(Ee,{children:b})]})}const na=12,oa=1.5,Hn=1.4,Nn=4,ia=20,Dn=220,kn=2,Mn=new RegExp("\\p{Sentence_Terminal}","u"),sa=/[.!?]/u,Gn=/\s/u;function ra(e){const t=Array.from(e);let s=0,i=0,a=0;for(;i<t.length;){if(!Mn.test(t[i])){i+=1;continue}let c=i;for(;c+1<t.length&&Mn.test(t[c+1]);)c+=1;const x=t[c+1],f=sa.test(t[c]);i=c+1,(!f||x===void 0||Gn.test(x))&&(s+=1,a=i)}return t.slice(a).some(c=>!Gn.test(c))?s+1:s}function aa(e){return Array.from(e).length}function la(e,t){if(e!=="reading"||typeof t!="string")return;const s=aa(t);if(s>Dn)return`ProseBlock was given a reading of ${String(s)} characters, and a reading is at most ${String(Dn)} characters. Shorten it, or it has stopped being a reading and become an explanation.`;const i=ra(t);if(i>kn)return`ProseBlock was given a reading of ${String(i)} sentences, and a reading is at most ${String(kn)} sentences. Delete any sentence that repeats what is already on screen, and move the rest into an InfoCircle.`}function ca(e,t){if(!(t===void 0||e==="runRecord"))return`ProseBlock was given onDetails on the "${e}" shape, and it belongs to "runRecord". A reading and a departure line carry no chevron, so the handler is ignored.`}function da({variant:e,children:t,onDetails:s,busy:i,live:a}){const l=ae(),c=_e(),x=r.useId();Le(la(e,t)),Le(ca(e,s));const f=Be(a,i);if(e==="reading")return n.jsx(o.Text,{...f,"data-testid":"prose-block","data-variant":e,style:{fontSize:na,lineHeight:oa,color:g.PROSE},children:t});if(e==="departure")return n.jsxs(o.Box,{...f,role:"note","aria-label":l.departure,"data-testid":"prose-block","data-variant":e,style:{display:"flex",alignItems:"flex-start",gap:Nn},children:[n.jsx(o.Box,{"aria-hidden":!0,"data-testid":"prose-block-warning",style:{flex:"0 0 auto",inlineSize:u.GLYPH_SLOT,blockSize:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.WARNING},children:n.jsx(re,{name:"warning",size:u.GLYPH})}),n.jsx(o.Text,{span:!0,size:"sm","data-testid":"prose-block-text",style:{lineHeight:Hn,color:g.VALUE},children:t})]});const p=typeof t=="string"?t:void 0;return n.jsxs(o.Box,{...f,"data-testid":"prose-block","data-variant":e,style:{display:"flex",alignItems:"center",gap:Nn,blockSize:ia},children:[n.jsx(o.Text,{span:!0,size:"sm",truncate:"end",id:x,title:p,"data-testid":"prose-block-text",style:{flex:"1 1 auto",minInlineSize:0,lineHeight:Hn,color:g.CHROME},children:t}),s!==void 0&&n.jsx(o.UnstyledButton,{type:"button",title:l.details,"aria-label":l.details,"aria-describedby":x,"data-testid":"prose-block-details",onClick:s,style:{flex:"0 0 auto",inlineSize:u.GLYPH_SLOT,blockSize:u.GLYPH_SLOT,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:"transparent",color:g.CHROME,cursor:"pointer"},children:n.jsx(re,{name:he(c)?"chevronLeft":"chevronRight",size:u.CHEVRON})})]})}const Mt=4,ua=4,pa=`polygon(0 calc(100% - ${ua}px), 100% 0, 100% 100%, 0 100%)`,fa=120,xa=`linear-gradient(to right, ${g.SURFACE}, ${g.ACCENT})`,ha={sqrt:"scaleSqrt",linear:"scaleLinear",log:"scaleLog"},Bn={flex:"0 0 auto",lineHeight:1,color:g.CHROME,whiteSpace:"nowrap"};function ga({min:e,max:t,label:s,variant:i="size",gradient:a,scale:l,busy:c,live:x,onScaleClick:f,trailing:p}){const h=ae(),m=_e(),b=r.useId(),v=i==="color",T=l===void 0?void 0:ha[l],R=T===void 0?void 0:h[T],C=`${b}-label`,z=`${b}-min`,I=`${b}-max`,w=`${b}-scale`,P=[s===void 0?void 0:C,z,I,R===void 0?void 0:w].filter(D=>D!==void 0);let j=null;T!==void 0&&R!==void 0&&(f===void 0?j=n.jsx(o.Box,{"data-testid":"ramp-row-scale","aria-hidden":"true",title:R,style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},children:n.jsx(Ke,{name:T})}):j=n.jsx(uo,{label:R,icon:n.jsx(Ke,{name:T}),onClick:f}));const L=lt(p)?p:j;return n.jsxs(o.Box,{"data-testid":"ramp-row","data-variant":i,"data-scale":l,style:{display:"flex",alignItems:"center",gap:Mt,height:u.ROW_PITCH},children:[n.jsxs(o.Box,{"data-testid":"ramp-row-figure",role:"img","aria-labelledby":P.join(" "),...Be(x,c),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:Mt},children:[s!==void 0&&n.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-label",id:C,children:s}),n.jsx(o.Text,{span:!0,size:"sm",id:z,"data-testid":"ramp-row-min",style:Bn,children:e}),n.jsx(o.Box,{"data-testid":"ramp-row-ramp","data-variant":i,"aria-hidden":"true",style:{flex:"1 1 auto",minWidth:fa,height:u.GLYPH,boxSizing:"border-box",background:v?a??xa:g.CHROME,borderRadius:v?"var(--mantine-radius-xs)":void 0,border:v?`1px solid ${g.BORDER}`:void 0,clipPath:v?void 0:pa,...Ji(m)}}),n.jsx(o.Text,{span:!0,size:"sm",id:I,"data-testid":"ramp-row-max",style:Bn,children:t}),R!==void 0&&n.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-scale",id:w,children:R})]}),n.jsx(o.Box,{style:{flex:"0 0 auto",display:"flex",marginInlineStart:u.TRAIL_GAP-Mt},children:n.jsx(Ee,{children:L})})]})}const ma=4,ba=`${String(u.TOGGLE_PITCH)}px`,ya=2;function va({label:e,checked:t,defaultChecked:s,onChange:i,control:a="checkbox",trailing:l,disabled:c=!1,disabledReason:x,bound:f=!1,boundDescription:p,onFocus:h,onBlur:m}){const b=ae(),[v,T]=X.useUncontrolled({value:t,defaultValue:s,finalValue:!1,onChange:i}),R=j=>{T(j.currentTarget.checked,j)},C={root:{flex:"1 1 auto",minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:ma,fontSize:"var(--mantine-font-size-sm)",lineHeight:ba,color:c?g.DISABLED:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},z=p??b.fieldBound,I=st({name:e,enabledTitle:e,disabled:c,disabledReason:x,extraDescriptions:f?[z]:void 0}),w={title:I.title},P=f?n.jsx(o.Box,{component:"span","data-testid":"toggle-row-bound",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",color:g.CHROME},children:n.jsx(Ke,{name:"attribute",filled:!0})}):null;return n.jsxs(o.Box,{"data-testid":"toggle-row","data-control":a,"data-checked":v?"true":"false","data-disabled":c?"true":void 0,"data-bound":f?"true":void 0,style:{display:"flex",alignItems:"center",boxSizing:"border-box",gap:u.TRAIL_GAP,height:u.TOGGLE_PITCH},children:[a==="switch"?n.jsx(o.Switch,{"data-testid":"toggle-row-control",label:e,checked:v,disabled:c,"aria-describedby":I.describedBy,onChange:R,onFocus:h,onBlur:m,wrapperProps:w,styles:C}):n.jsx(o.Checkbox,{"data-testid":"toggle-row-control",label:e,checked:v,disabled:c,"aria-describedby":I.describedBy,onChange:R,onFocus:h,onBlur:m,wrapperProps:w,styles:C}),I.description!==void 0&&n.jsx(o.VisuallyHidden,{id:I.describedBy,children:I.description}),P,n.jsx(Ee,{children:l})]})}function wa({children:e,label:t,labelledBy:s}){const i=r.Children.toArray(e).length;return Le(i<ya?`ToggleRowGroup was given ${String(i)} ${i===1?"row":"rows"}, and it holds two or more. A single checkbox on a row of its own interrupts a column of rows to say one bit: put it in the trailing slot of the row it modifies, or make it one tile of a group of icon buttons. Rendering it anyway.`:void 0),n.jsx(o.Box,{role:"group","aria-label":s===void 0?t:void 0,"aria-labelledby":s,"data-testid":"toggle-row-group","data-rows":i,style:{display:"flex",flexDirection:"column"},children:e})}function Sa(e="dark"){return o.useComputedColorScheme(e)}const Ia={xs:o.rem(4),sm:o.rem(8),md:o.rem(16),lg:o.rem(24),xl:o.rem(32)},Ea={HEIGHT:24,FONT_SIZE:11,CONTROL_PADDING:8,SECTION_GAP:4},Ca="0.7.0";exports.ActionRow=ur;exports.AdvancedButton=uo;exports.COMPACT_SIZING=Ea;exports.CompactColorInput=lo;exports.CompoundRow=Mr;exports.ControlGroup=bs;exports.ControlSection=Es;exports.ControlSubGroup=Rs;exports.DEFAULT_GRADIENT_STOP_COLOR=St;exports.DataRow=gr;exports.DataRowHeader=mr;exports.DataTable=Us;exports.FIELD_GLYPH_NAMES=to;exports.FIELD_LETTERS=no;exports.FieldGlyph=Ke;exports.FieldRow=$r;exports.GradientEditor=Js;exports.HistogramRow=Rr;exports.IconGroupRow=ta;exports.InfoCircle=co;exports.LabelsProvider=Ii;exports.MANTINE_SPACING=Ia;exports.MAX_ALPHA_HEX=Kt;exports.MAX_OPACITY_PERCENT=qt;exports.MetricRow=Pr;exports.PANEL_GRID=u;exports.PANEL_INK=g;exports.POPOUT_GAP=$n;exports.POPOUT_NESTED_GAP=Wn;exports.POPOUT_Z_INDEX_BASE=Gt;exports.PanelField=Io;exports.PanelLabelsProvider=So;exports.Popout=Ge;exports.PopoutButton=as;exports.PopoutManager=ao;exports.PopoutRegion=Ui;exports.ProseBlock=da;exports.RampRow=ga;exports.RankChip=tn;exports.SWATCH_COLORS_HEXA=qn;exports.SparklineRow=zr;exports.StyleNumberInput=or;exports.StyleSelect=rr;exports.ToggleRow=va;exports.ToggleRowGroup=wa;exports.ToggleWithContent=lr;exports.TrailingSlot=Ee;exports.UI_GLYPH_NAMES=ji;exports.UiGlyph=re;exports.VERSION=Ca;exports.compactColors=Vn;exports.compactDarkColors=Fn;exports.compactTheme=vi;exports.compactThemeOverride=Kn;exports.createColorStop=Et;exports.createDefaultGradientStops=po;exports.defaultLabels=Zn;exports.getActivationMeta=it;exports.isFieldGlyphName=Yt;exports.isFieldLetter=Xt;exports.isRtl=he;exports.isValidHex=Ni;exports.opacityToAlphaHex=Jt;exports.parseAlphaFromHexa=Zt;exports.parseHexaColor=Oi;exports.parseLocaleNumber=Jn;exports.toHexaColor=Hi;exports.useActualColorScheme=Sa;exports.useCollator=eo;exports.useDirection=_e;exports.useLabels=ae;exports.useLocale=Fe;exports.useNumberFormatter=qe;exports.useNumberParser=Wt;exports.useOrdinalFormatter=Qn;exports.usePanelLabels=ct;exports.usePopoutRegion=ro;