@graphty/compact-mantine 0.8.16 → 0.8.18

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"),n=require("react/jsx-runtime"),X=require("@mantine/hooks"),r=require("react"),Lo=require("react-dom"),xe=require("@tanstack/react-table"),_o=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"],Un={...o.DEFAULT_THEME.colors,dark:Fn},Oo={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"}}},Ho={compactSize:"sm",sizes:{xs:{"--ai-size":"18px"},sm:{"--ai-size":"24px"},md:{"--ai-size":"30px"},lg:{"--ai-size":"36px"},xl:{"--ai-size":"44px"}}};function No(e){return e==="light"?{"--ai-bd":"1px solid var(--ai-color)"}:{}}const Vn={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 Do={Button:o.Button.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Oo,t==null?void 0:t.size)})}),ActionIcon:o.ActionIcon.extend({defaultProps:{size:"sm",variant:"subtle"},vars:(e,t)=>({root:{...F(Ho,t==null?void 0:t.size),...No(t==null?void 0:t.variant)}})}),CloseButton:o.CloseButton.extend({defaultProps:{size:"xs"},vars:(e,t)=>({root:F(Vn,t==null?void 0:t.size)})})},ko={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"}}},Mo={compactSize:"sm",sizes:{xs:{"--checkbox-size":"12px"},sm:{"--checkbox-size":"16px"},md:{"--checkbox-size":"20px"},lg:{"--checkbox-size":"24px"},xl:{"--checkbox-size":"28px"}}},Go={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"}}},Bo={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"}}},Fo={backgroundColor:"transparent"},Uo={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(Bo,t==null?void 0:t.size)}),styles:{root:Fo,indicator:Uo}}),Checkbox:o.Checkbox.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Mo,t==null?void 0:t.size)}),styles:{label:zt}}),Switch:o.Switch.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(ko,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(Go,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}})},$o={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"}}},Wo={compactSize:"sm",sizes:{xs:{"--avatar-size":"18px"},sm:{"--avatar-size":"24px"},md:{"--avatar-size":"30px"},lg:{"--avatar-size":"36px"},xl:{"--avatar-size":"44px"}}},Yo={compactSize:"sm",sizes:{xs:{"--ti-size":"18px"},sm:{"--ti-size":"24px"},md:{"--ti-size":"30px"},lg:{"--ti-size":"36px"},xl:{"--ti-size":"44px"}}},Xo={compactSize:"sm",sizes:{xs:{"--indicator-size":"6px"},sm:{"--indicator-size":"8px"},md:{"--indicator-size":"10px"},lg:{"--indicator-size":"12px"},xl:{"--indicator-size":"14px"}}},Ko={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"}}},qo={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"}}},Zo={Text:o.Text.extend({}),Badge:o.Badge.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F($o,t==null?void 0:t.size)})}),Pill:o.Pill.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(qo,t==null?void 0:t.size)})}),Avatar:o.Avatar.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Wo,t==null?void 0:t.size)})}),ThemeIcon:o.ThemeIcon.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Yo,t==null?void 0:t.size)})}),Indicator:o.Indicator.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Xo,t==null?void 0:t.size)})}),Kbd:o.Kbd.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Ko,t==null?void 0:t.size)})})},Jo={compactSize:"sm",sizes:{xs:{"--loader-size":"14px"},sm:{"--loader-size":"18px"},md:{"--loader-size":"24px"},lg:{"--loader-size":"30px"},xl:{"--loader-size":"38px"}}},Qo={compactSize:"sm",sizes:{xs:{"--progress-size":"2px"},sm:{"--progress-size":"4px"},md:{"--progress-size":"6px"},lg:{"--progress-size":"8px"},xl:{"--progress-size":"10px"}}},ei={label:{fontSize:9}},ti={Loader:o.Loader.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Jo,t==null?void 0:t.size)})}),Progress:o.Progress.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Qo,t==null?void 0:t.size)}),styles:ei}),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")}},ni={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"}}},oi={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"}}},ii={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"}}},si={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(ni,t==null?void 0:t.size),controls:F(oi,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(ii,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(Vn,t==null?void 0:t.size)})})},ri={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"}}},ai={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"}}},li={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"}}},ci={root:{fontSize:11}},di={root:{fontSize:11,minHeight:28},label:{fontSize:11}},ui={tab:{fontSize:11,padding:"6px 10px"}},pi={Anchor:o.Anchor.extend({defaultProps:{size:"sm"},styles:ci}),Burger:o.Burger.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(li,t==null?void 0:t.size)})}),NavLink:o.NavLink.extend({styles:di}),Pagination:o.Pagination.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(ri,t==null?void 0:t.size)})}),Stepper:o.Stepper.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(ai,t==null?void 0:t.size)})}),Tabs:o.Tabs.extend({styles:ui})},fi={"--menu-item-fz":"11px"},xi={tooltip:{fontSize:11,padding:"4px 8px"}},hi={dropdown:{padding:8}},gi={dropdown:{padding:8}},mi={Menu:o.Menu.extend({defaultProps:{zIndex:Me,withInitialFocusPlaceholder:!1},vars:()=>({dropdown:fi})}),Modal:o.Modal.extend({defaultProps:{closeButtonProps:{"aria-label":"Close"}}}),Drawer:o.Drawer.extend({defaultProps:{closeButtonProps:{"aria-label":"Close"}}}),Tooltip:o.Tooltip.extend({defaultProps:{zIndex:Me},styles:xi}),Popover:o.Popover.extend({defaultProps:{zIndex:Me},styles:hi}),HoverCard:o.HoverCard.extend({defaultProps:{zIndex:Me},styles:gi})},bi={xs:"10px",sm:"11px",md:"13px",lg:"14px",xl:"16px"},yi={xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},vi={xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},Kn=o.createTheme({colors:Un,fontSizes:bi,spacing:yi,radius:vi,focusRing:"auto",other:{panelGrid:u},components:{...si,...Do,...Vo,...Zo,...ti,...pi,...mi}}),wi=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`}}},Si="en",Bt=r.createContext(Zn),Ft=r.createContext(void 0);function Ii(e){return e!==void 0&&e!==""?e:typeof document<"u"&&document.documentElement.lang!==""?document.documentElement.lang:typeof navigator<"u"&&navigator.language!==""?navigator.language:Si}function Ei({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 Ii(e)}const Ci=1234.5,Ti="9876543210",Ri=9876543210,zi=new Set([" "," "," "," ","'","’"]),Pi="−",Ai=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/iu,dn=new Map;function ji(e){var f,p;const t=dn.get(e);if(t!==void 0)return t;const s=new Intl.NumberFormat(e).formatToParts(Ci),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(Ri);Array.from(c).forEach((h,m)=>{l.set(h,Ti[m])});const x={decimal:i,digits:l,group:a};return dn.set(e,x),x}function Jn(e,t){const s=ji(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||zi.has(l))){if(l==="-"||l===Pi){i+="-";continue}if(l==="+"){i+="+";continue}if(l==="e"||l==="E"){i+=l;continue}break}}const a=Ai.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"],Li=["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"},Re={fill:"currentColor",stroke:"none"},_i={sizeSmallest:e=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"5",cy:"11",r:"2.5",...e?Re:{}}),n.jsx("circle",{cx:"10.5",cy:"6.5",r:"4",...e?Re:{}})]}),sizeLargest:e=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"4.5",cy:"11.5",r:"1.75",...e?Re:{}}),n.jsx("circle",{cx:"10",cy:"6",r:"5",...e?Re:{}})]}),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?Re:{}}),n.jsx("polyline",{points:"11,5.5 13.5,8 11,10.5",...e?Re:{}})]}),opacity:e=>e?n.jsx("circle",{cx:"8",cy:"8",r:"5.5",...Re}):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",...Re})]}),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",...Re}),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:"1.5",...Re})]}),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"})},Oi={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:_i[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:Oi[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 Hi(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 Ni(e,t){const s=e.replace("#",""),i=Jt(t);return`#${s}${i}`}function Di(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 ki(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:ki(t??e,c),description:f,describedBy:f===void 0?void 0:l}}const io=r.createContext(null);function Mi(){return r.useContext(io)}function Gi({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 Bi({children:e}){return n.jsx(o.Box,{p:"sm",children:e})}const Fi=["[data-portal]","[data-combobox-dropdown]","[data-menu-dropdown]","[data-popover-dropdown]","[data-tooltip]","[data-hovercard-dropdown]","[data-dates-dropdown]","[data-modal]"].join(", ");function Ui(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(Fi)||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 $i({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 Wi(){return r.useContext(Qt)}function ao(){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(){const{closeAll:e,hasOpenPopouts:t}=ao();return r.useMemo(()=>({closeAll:e,hasOpenPopouts:t}),[e,t])}function Ki({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 qi({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]),V=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(V,$),Ui(G,$);const O=r.useMemo(()=>({register:T,unregister:R,getZIndex:C,bringToFront:z,portalContainer:t,zIndexVersion:x,closeFocused:V,closeAll:G,hasOpenPopouts:N,closeWithDescendants:L,closeDescendants:j,closeSiblings:D,getParentId:I,isAncestor:w}),[T,R,C,z,t,x,V,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 Zi(e,t){return he(t)?1-e:e}function Ji(e,t,s){return Zi(e,s)*t}function Qi(e){return he(e)?{transform:"scaleX(-1)"}:{}}const un=3;function es(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 ts({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 ns(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 os(e,t){return e==="start"?he(t)?"right":"left":e==="end"?he(t)?"left":"right":e}function is(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 ss(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:V,unregister:G,bringToFront:N,zIndexVersion:$,closeDescendants:A}=ao(),O=Mi(),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}=es({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),[Ue,Oe]=r.useState(fe),Ze=h??(P===null?0:Wn),Ve=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 ze=r.useCallback(()=>{Ce.current()},[]);r.useEffect(()=>(C?V(w,ze,P,j):G(w),()=>{G(w)}),[C,w,V,G,ze,P,j]);const He=r.useCallback(()=>{const B={trigger:I.current,parent:ns(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=os(f,y),Te=se==="top"||se==="bottom",dt=Te?ie:te,De=Te?te:ie,ce=is(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},Pe=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(ts,{config:i,onClose:we,dragTriggerProps:ne,activeTab:Ue,onTabChange:Ve,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===Ue))==null?void 0:Se.content:l})]});return Lo.createPortal(Pe,D)}function rs({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 as({children:e,opened:t,defaultOpened:s,onOpenChange:i}){const a=Wi(),l=(a==null?void 0:a.id)??null;return n.jsx(Ki,{parentId:l,opened:t,defaultOpened:s,onOpenChange:i,children:e})}const Ge=Object.assign(as,{Trigger:rs,Panel:ss,Content:Bi,Anchor:Gi}),ls=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 lo({children:e}){return n.jsx(qi,{children:e})}const hn=4,gn=4,cs=2,ds=72,us=54,ps=220,mn=0,At=100,bn=9,yn=7,fs=/^#[0-9A-F]{6}$/iu,xs=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 hs(){const e=Fe();return r.useMemo(()=>{var s;return((s=new Intl.NumberFormat(e).formatToParts(xs).find(i=>i.type==="decimal"))==null?void 0:s.value)??"."},[e])}function co({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=hs(),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,V=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}`;fs.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:cs,style:{border:`1px solid ${g.BORDER}`}})})}),n.jsx(Ge.Panel,{width:ps,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:ds,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:us,styles:{input:{...jt("end"),textAlign:"end",...D?{fontStyle:"italic",color:g.CHROME}:{}},description:It}})]})]}),!V&&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,gs=1,ms=1.2,bs="calc(-1 * var(--mantine-spacing-sm) - 1px)";function ys({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:gs,style:{marginBlockStart:bt,marginBlockEnd:0,marginInline:i?bs: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:ms,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,vs=4;function ws({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 uo({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(ws,{name:f,bubbleId:c}),n.jsx(Ge.Panel,{width:wn,label:f,placement:"bottom",alignment:"start",gap:vs,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(lo,{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 po=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,Ss=1,Sn=6,Is=12,Es=1.2;function Cs(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),V=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:Is,fontWeight:500,lineHeight:Es,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:Ss,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":V,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(uo,{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,Ts=10,Rs=1.2;function zs(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:Rs,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:Ts}),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 Ps(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 As(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 js(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 Ls(e,t,s){const i=Math.min(t,s),a=Math.max(t,s);return e.slice(i,a+1)}function Ut(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 _s(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=Ls(t,f,s);return{selected:l.toggle?Ut([...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:Ut(p,t),anchor:x}}return{selected:[x],anchor:x}}function Os(e,t,s){return s!=="multiple"?{selected:[...t],anchor:void 0}:{selected:Ut([...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 Hs(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 Ns=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()}),Ds=320,ks=8,Ms=12,Gs=1.2,Bs="var(--mantine-primary-color-light)",Tn="mantine-focus-auto",Ot=[],Fs=[];function Rn(e){return e==="asc"?"ascending":e==="desc"?"descending":"none"}function Us(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=Ds,rowHeight:p=u.DATA_PITCH,headerHeight:h=u.CONTROL_HEIGHT,overscan:m=ks,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:V,filter:G,defaultFilter:N,onFilterChange:$,searchable:A=!1,onRowClick:O,onRowDoubleClick:y,onRowContextMenu:S,onFocus:H,onBlur:k,empty:K}=e,q=Ps(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:Fs,onChange:(d,E)=>{I==null||I([...d],E)}}),[fe,Ue]=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)=>{V==null||V([...d],E)}}),[Ve,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),ze=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=Ve.trim();if(d!=="")return{query:d.toLocaleLowerCase(Q),columnIds:ze}},[Ve,Q,ze]),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,_)=>Hs(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]),Pe=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:Ns,data:Ne,columns:$e,getRowId:a,enableRowSelection:b!=="none",enableMultiRowSelection:b==="multiple",getColumnCanGlobalFilter:()=>!0,globalFilterFn:(d,E,_)=>{const U=_;if(U===void 0||!U.columnIds.includes(E))return!1;const J=we.get(E);return J===void 0?!1:En(J.value(d.original),oe).toLocaleLowerCase(Q).includes(U.query)},state:{sorting:Qe,columnVisibility:We,columnOrder:Ye,rowSelection:Pe,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);Ue(Object.keys(E).filter(_=>!E[_]))},onColumnOrderChange:d=>{Ze(xe.functionalUpdate(d,Ye))},onRowSelectionChange:d=>{me(Object.keys(xe.functionalUpdate(d,Pe)))}}),{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=_o.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(()=>js(dt,{rowCount:ie,columnCount:ue}),[dt,ie,ue]),et=r.useRef(!1),ke=r.useRef(void 0),To=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((U,J)=>U===Y[J]))&&me(d.selected,E)},ut=(d,E,_)=>{nn(_s({ids:Ie,index:d,selected:Y,anchor:ke.current,modifiers:E,mode:b}),_)},on=(d,E,_)=>{const U=ee[d];U!==void 0&&(O==null||O(U.original,E,_))},Ro=(d,E)=>{d.getCanSort()&&(Se.current=E,d.toggleSorting(void 0,E.shiftKey&&d.getCanMultiSort()),Se.current=void 0)},zo=()=>{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)},Po=d=>{const E=b==="multiple",_=d.ctrlKey||d.metaKey;if(E&&_&&(d.key==="a"||d.key==="A")){d.preventDefault(),nn(Os(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 U=As(ce,d.key,{rowCount:ie,columnCount:ue,pageSize:zo()},ge,{jumpToEnd:_});U!==void 0&&(d.preventDefault(),To(U),E&&d.shiftKey&&U.row>=0&&U.row!==ce.row&&ut(U.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),U=_.indexOf(d);U!==-1&&(_.splice(U,1),_.splice(Us(E,0,_.length),0,d),B.setColumnOrder(_))},clearSelection:()=>{ke.current=void 0,me([])}}),[B,Te,ie,me]);const Ao=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)),jo=()=>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:Ve,onChange:d=>{de(d.currentTarget.value,d)},rightSection:Ve===""?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:Po,stickyHeader:!0,tabularNums:!0,withRowBorders:!1,horizontalSpacing:0,verticalSpacing:0,highlightOnHover:pt,highlightOnHoverColor:g.SURFACE,style:{display:"grid",width:"100%",minWidth:Ao,fontSize:Ms,lineHeight:Gs},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),U=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":U?Rn(J):void 0,"data-grid-row":U?void 0:pe,"data-grid-column":U?void 0:E,tabIndex:U?void 0:xt,className:U?void 0:Tn,onFocus:U?void 0:()=>{De(Ae=>yt(Ae,{row:pe,column:E})?Ae:{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:U?n.jsx(o.UnstyledButton,{type:"button","data-testid":"data-table-sort-button","data-grid-row":pe,"data-grid-column":E,tabIndex:xt,onClick:Ae=>{De({row:pe,column:E}),Ro(d,Ae)},onFocus:()=>{De(Ae=>yt(Ae,{row:pe,column:E})?Ae:{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:U=>{y==null||y(E.original,U)},onContextMenu:U=>{S==null||S(E.original,U)},style:{display:"flex",position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:p,transform:`translateY(${String(d.start)}px)`,background:_?Bs:void 0,cursor:pt?"pointer":void 0},children:te.map((U,J)=>{const ye=we.get(U.id),ft=ce.row===d.index&&ce.column===J,xt=ye==null?void 0:ye.value(E.original),rt=En(xt,oe),Ae=(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(je=>yt(je,{row:d.index,column:J})?je:{row:d.index,column:J})},onClick:je=>{De({row:d.index,column:J}),ut(d.index,{extend:je.shiftKey,toggle:je.metaKey||je.ctrlKey},je),on(d.index,je,it(je))},style:sn(ye,J),children:Ae},U.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:jo()})]})]})}const $s=r.forwardRef(Vs);function Ws(){return crypto.randomUUID().slice(0,8)}function Et(e,t){return{id:Ws(),offset:e,color:t}}function fo(){return[Et(0,"#6366F1"),Et(1,"#06B6D4")]}const Ys=2,Xs=5,Ks=80,qs=0,Ht=100,Nt=0,Zs=360,Js=[0,90,180,270,360];function Qs({stops:e,defaultStops:t,direction:s,defaultDirection:i=Nt,showDirection:a=!0,onChange:l,onChangeStart:c,onChangeEnd:x,minStops:f=Ys,maxStops:p=Xs}){const h=ae(),m=qe({maximumFractionDigits:0}),b=r.useId(),v=r.useId(),T=r.useMemo(()=>fo(),[]),[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),V=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:V,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(co,{color:A.color,defaultColor:St,onColorChange:(S,H)=>{C(L(O,S??St),H)},showOpacity:!1}),n.jsx(o.Box,{style:{width:Ks},children:n.jsx(o.Slider,{"data-testid":"gradient-editor-stop-position",min:qs,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:Zs,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:Js.map(A=>({value:A,label:h.degrees(m.format(A))}))})]})]})}const er=4,tr=2,nr=1.1;function or(){const e=Fe();return r.useMemo(()=>{var s;return((s=new Intl.NumberFormat(e).formatToParts(nr).find(i=>i.type==="decimal"))==null?void 0:s.value)??"."},[e])}function ir({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=or(),[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),V=r.useRef(!1);r.useEffect(()=>{V.current||D(I??s),V.current=!1},[I,s]);const G=A=>{V.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:er,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:tr},children:n.jsx(re,{name:"reset",size:u.CHEVRON})})]})}const sr=4,rr=2;function ar({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:sr,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:rr},children:n.jsx(re,{name:"reset",size:u.CHEVRON})})]})}const vt=4,lr=`${String(u.TOGGLE_PITCH)}px`;function cr({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:lr,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 xo(e,t){return e!==void 0?e:t===void 0?"off":"polite"}function Be(e,t){const s=xo(e,t);return s==="off"?{"aria-busy":t}:{"aria-live":s,"aria-atomic":!0,"aria-busy":t}}const Dt=4,dr="(hover: none)";function ur(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e)}function pr(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(dr)??!1,[C,z]=r.useState(!1),I=r.useId(),w=C||(x??(v||R)),P=l!==void 0||c!==void 0,j=ur(t),L=s!==void 0&&s!==j,D=s??j,V=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:V?"group":void 0,"aria-labelledby":V?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 ho=u.GUTTER,fr=12,go=1.2,xr=20,hr=500,gr="var(--mantine-primary-color-light)";function mr({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=gr: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})]}),V={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:ho,borderRadius:"var(--mantine-radius-sm)",background:L,color:g.VALUE,fontSize:fr,lineHeight:go},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:V,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:V,children:D}),z&&n.jsx(Ee,{children:m})]})}function br({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:xr,paddingInline:ho,fontSize:"var(--mantine-font-size-sm)",lineHeight:go,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:hr,textTransform:"none",letterSpacing:"normal"},children:e})}const zn=2,yr=1,vr=13,wr=2,Sr=1,Ir=1,Er=64,mo=4,Pn=mo/2,bo=4,Cr=12,Xe=100,Tr=1.5,Vt=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 yo(){return n.jsx(o.Box,{"data-testid":"chart-baseline",style:{flex:"0 0 auto",height:yr,background:g.BORDER}})}function vo({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 Rr(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=Ji(f/c,Xe,t),h=l===0?s:Xe-(x-i)/l*Xe;return`${p},${h}`}).join(" ")}function wo(){const e=r.useId(),t=`${e}min`,s=`${e}max`;return{min:t,max:s,describedBy:`${t} ${s}`}}function zr({bins:e,label:t,minLabel:s,maxLabel:i,busy:a,live:l,trailing:c}){const x=qe(),f=wo(),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:wr},children:e.map((m,b)=>{const v=Math.max(0,m.count),T=p===0?0:v/p*Vt,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?Ir:0,background:R?g.ACCENT:g.BORDER,borderRadius:Sr}},`${m.label}-${String(b)}`)})}),n.jsx(yo,{})]}),n.jsxs(o.Box,{"data-testid":"chart-axis",style:{flex:"0 0 auto",height:vr,display:"flex",alignItems:"center",justifyContent:"space-between",gap:bo},children:[n.jsx(Ct,{end:"min",id:f.min,children:s}),n.jsx(Ct,{end:"max",id:f.max,children:i})]})]}),n.jsx(vo,{caption:t,rows:h,testId:"histogram-values"}),lt(c)&&n.jsx(Ee,{children:c})]})}function Pr({values:e,label:t,minLabel:s,maxLabel:i,busy:a,live:l,trailing:c}){const x=_e(),f=qe(),p=wo(),h=Rr(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:bo},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:Tr,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(yo,{})]}),n.jsx(Ct,{end:"max",id:p.max,children:i})]}),n.jsx(vo,{caption:t,rows:m,testId:"sparkline-values"}),lt(c)&&n.jsx(Ee,{children:c})]})}function Ar({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(Vt,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:Cr,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":Vt,"aria-valuenow":C,"aria-valuetext":z,title:z,size:mo,style:{flex:`0 0 ${String(Er)}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 So=r.createContext(!1);function Io({showLabels:e=!1,children:t}){return n.jsx(So.Provider,{value:e,children:t})}function ct(){return r.useContext(So)}const jr=u.VALUE_INSET-u.GLYPH_SLOT,Lr=2,_r=1,Or=2,Hr=3;function Nr(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 Dr({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=Nr(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:jr},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:Lr,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME},children:l})]})}function kr(e,t){if(!(t>=Or&&t<=Hr))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 Mr(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 Gr({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(kr(e,t.length)),Le(Mr(e,m));const b=t.findIndex(L=>L.grow===!0),v=b===-1?0:b,T=c!==void 0,R=xo(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:_r,height:u.CONTROL_HEIGHT,background:g.PANEL}}),n.jsx(Dr,{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,Br=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},Eo=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:V,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=V??(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 Ue=G??k.fieldBound,Oe=N??k.fieldPending;b&&Ue!==""&&fe.push(Ue),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),ze=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,ze.current=M.clientX},Ne=M=>{if(!we.current)return;const se=M.clientX-ze.current;se!==0&&(ze.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 Pe=null;Yt(a)?Pe=n.jsx(Ke,{name:a,filled:b}):Xt(a)?Pe=n.jsx(o.Box,{component:"span","data-letter":a,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:a}):a!=null&&(Pe=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:[Pe,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?Br: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)}})}),Fr=2,Ur=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 $r(e){if(r.isValidElement(e)&&typeof e.props.label=="string")return e.props.label}function _n(e){return r.isValidElement(e)&&e.type===Eo?r.cloneElement(e,{width:"fill"}):e}const Wr=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>Fr?`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=$r(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(Io,{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?Ur: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})]})}),Yr=2,Xr=6,Co=1,Kr=u.CONTROL_HEIGHT-Co*2,qr=2,On=3,Zr=4,Jr=6,Qr=u.GLYPH,ea=3;function ta(e,t){return t?g.DISABLED:e?g.ON_SELECTED:g.CHROME}function na(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<Yr||C>Xr?`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<=ea?u.FIELD:u.BODY),D=L==="fill",V=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?Zr:0,paddingInline:O?Jr:0,width:"100%",minWidth:0,color:ta($,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:V,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:Co,gap:qr,backgroundColor:g.SURFACE,overflow:"visible"},control:{flex:"1 1 auto",minWidth:Qr},label:{display:"flex",alignItems:"center",justifyContent:"center",height:Kr,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 oa=12,ia=1.5,Hn=1.4,Nn=4,sa=20,Dn=220,kn=2,Mn=new RegExp("\\p{Sentence_Terminal}","u"),ra=/[.!?]/u,Gn=/\s/u;function aa(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=ra.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 la(e){return Array.from(e).length}function ca(e,t){if(e!=="reading"||typeof t!="string")return;const s=la(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=aa(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 da(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 ua({variant:e,children:t,onDetails:s,busy:i,live:a}){const l=ae(),c=_e(),x=r.useId();Le(ca(e,t)),Le(da(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:oa,lineHeight:ia,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:sa},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,pa=4,fa=`polygon(0 calc(100% - ${pa}px), 100% 0, 100% 100%, 0 100%)`,xa=120,ha=`linear-gradient(to right, ${g.SURFACE}, ${g.ACCENT})`,ga={sqrt:"scaleSqrt",linear:"scaleLinear",log:"scaleLog"},Bn={flex:"0 0 auto",lineHeight:1,color:g.CHROME,whiteSpace:"nowrap"};function ma({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:ga[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(po,{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:xa,height:u.GLYPH,boxSizing:"border-box",background:v?a??ha:g.CHROME,borderRadius:v?"var(--mantine-radius-xs)":void 0,border:v?`1px solid ${g.BORDER}`:void 0,clipPath:v?void 0:fa,...Qi(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 ba=4,ya=`${String(u.TOGGLE_PITCH)}px`,va=2;function wa({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:ba,fontSize:"var(--mantine-font-size-sm)",lineHeight:ya,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 Sa({children:e,label:t,labelledBy:s}){const i=r.Children.toArray(e).length;return Le(i<va?`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 Ia(e="dark"){return o.useComputedColorScheme(e)}const Ea={xs:o.rem(4),sm:o.rem(8),md:o.rem(16),lg:o.rem(24),xl:o.rem(32)},Ca={HEIGHT:24,FONT_SIZE:11,CONTROL_PADDING:8,SECTION_GAP:4};exports.ActionRow=pr;exports.AdvancedButton=po;exports.COMPACT_SIZING=Ca;exports.CompactColorInput=co;exports.CompoundRow=Gr;exports.ControlGroup=ys;exports.ControlSection=Cs;exports.ControlSubGroup=zs;exports.DEFAULT_GRADIENT_STOP_COLOR=St;exports.DataRow=mr;exports.DataRowHeader=br;exports.DataTable=$s;exports.FIELD_GLYPH_NAMES=to;exports.FIELD_LETTERS=no;exports.FieldGlyph=Ke;exports.FieldRow=Wr;exports.GradientEditor=Qs;exports.HistogramRow=zr;exports.IconGroupRow=na;exports.InfoCircle=uo;exports.LabelsProvider=Ei;exports.MANTINE_SPACING=Ea;exports.MAX_ALPHA_HEX=Kt;exports.MAX_OPACITY_PERCENT=qt;exports.MetricRow=Ar;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=Eo;exports.PanelLabelsProvider=Io;exports.Popout=Ge;exports.PopoutButton=ls;exports.PopoutManager=lo;exports.PopoutRegion=$i;exports.ProseBlock=ua;exports.RampRow=ma;exports.RankChip=tn;exports.SWATCH_COLORS_HEXA=qn;exports.SparklineRow=Pr;exports.StyleNumberInput=ir;exports.StyleSelect=ar;exports.ToggleRow=wa;exports.ToggleRowGroup=Sa;exports.ToggleWithContent=cr;exports.TrailingSlot=Ee;exports.UI_GLYPH_NAMES=Li;exports.UiGlyph=re;exports.compactColors=Un;exports.compactDarkColors=Fn;exports.compactTheme=wi;exports.compactThemeOverride=Kn;exports.createColorStop=Et;exports.createDefaultGradientStops=fo;exports.defaultLabels=Zn;exports.getActivationMeta=it;exports.isFieldGlyphName=Yt;exports.isFieldLetter=Xt;exports.isRtl=he;exports.isValidHex=Di;exports.opacityToAlphaHex=Jt;exports.parseAlphaFromHexa=Zt;exports.parseHexaColor=Hi;exports.parseLocaleNumber=Jn;exports.toHexaColor=Ni;exports.useActualColorScheme=Ia;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.usePopoutManager=Xi;exports.usePopoutRegion=ro;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@mantine/core"),n=require("react/jsx-runtime"),r=require("react"),X=require("@mantine/hooks"),$o=require("react-dom"),fe=require("@tanstack/react-table"),Wo=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)"},to=["#d5d7da","#a3a8b1","#7a828e","#5f6873","#48525c","#374047","#2a3035","#1f2428","#161b22","#0d1117"],no={...o.DEFAULT_THEME.colors,dark:to},Yo={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"}}},Xo={compactSize:"sm",sizes:{xs:{"--ai-size":"18px"},sm:{"--ai-size":"24px"},md:{"--ai-size":"30px"},lg:{"--ai-size":"36px"},xl:{"--ai-size":"44px"}}};function Ko(e){return e==="light"?{"--ai-bd":"1px solid var(--ai-color)"}:{}}const oo={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 G(e,t){const s=t==null?e.compactSize:String(t);return e.sizes[s]??e.sizes[e.compactSize]}const qo={Button:o.Button.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(Yo,t==null?void 0:t.size)})}),ActionIcon:o.ActionIcon.extend({defaultProps:{size:"sm",variant:"subtle"},vars:(e,t)=>({root:{...G(Xo,t==null?void 0:t.size),...Ko(t==null?void 0:t.variant)}})}),CloseButton:o.CloseButton.extend({defaultProps:{size:"xs"},vars:(e,t)=>({root:G(oo,t==null?void 0:t.size)})})},Zo={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"}}},Jo={compactSize:"sm",sizes:{xs:{"--checkbox-size":"12px"},sm:{"--checkbox-size":"16px"},md:{"--checkbox-size":"20px"},lg:{"--checkbox-size":"24px"},xl:{"--checkbox-size":"28px"}}},Qo={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"}}},bn={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"}}},ei={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"}}},ti={backgroundColor:"transparent"},ni={backgroundColor:"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))"},_t={fontSize:11},yn={fontSize:10,marginTop:2},oi={SegmentedControl:o.SegmentedControl.extend({defaultProps:{size:"sm",withItemsBorders:!1},vars:(e,t)=>({root:G(ei,t==null?void 0:t.size)}),styles:{root:ti,indicator:ni}}),Checkbox:o.Checkbox.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(Jo,t==null?void 0:t.size)}),styles:{label:_t}}),Switch:o.Switch.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(Zo,t==null?void 0:t.size)}),styles:{label:_t}}),Slider:o.Slider.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(bn,t==null?void 0:t.size)}),styles:{markLabel:yn}}),Radio:o.Radio.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(Qo,t==null?void 0:t.size)}),styles:{label:_t}}),RangeSlider:o.RangeSlider.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(bn,t==null?void 0:t.size)}),styles:{markLabel:yn}})},ii={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"}}},si={compactSize:"sm",sizes:{xs:{"--avatar-size":"18px"},sm:{"--avatar-size":"24px"},md:{"--avatar-size":"30px"},lg:{"--avatar-size":"36px"},xl:{"--avatar-size":"44px"}}},ri={compactSize:"sm",sizes:{xs:{"--ti-size":"18px"},sm:{"--ti-size":"24px"},md:{"--ti-size":"30px"},lg:{"--ti-size":"36px"},xl:{"--ti-size":"44px"}}},ai={compactSize:"sm",sizes:{xs:{"--indicator-size":"6px"},sm:{"--indicator-size":"8px"},md:{"--indicator-size":"10px"},lg:{"--indicator-size":"12px"},xl:{"--indicator-size":"14px"}}},li={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"}}},ci={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"}}},di={Text:o.Text.extend({}),Badge:o.Badge.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(ii,t==null?void 0:t.size)})}),Pill:o.Pill.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(ci,t==null?void 0:t.size)})}),Avatar:o.Avatar.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(si,t==null?void 0:t.size)})}),ThemeIcon:o.ThemeIcon.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(ri,t==null?void 0:t.size)})}),Indicator:o.Indicator.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(ai,t==null?void 0:t.size)})}),Kbd:o.Kbd.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(li,t==null?void 0:t.size)})})},ui={compactSize:"sm",sizes:{xs:{"--loader-size":"14px"},sm:{"--loader-size":"18px"},md:{"--loader-size":"24px"},lg:{"--loader-size":"30px"},xl:{"--loader-size":"38px"}}},pi={compactSize:"sm",sizes:{xs:{"--progress-size":"2px"},sm:{"--progress-size":"4px"},md:{"--progress-size":"6px"},lg:{"--progress-size":"8px"},xl:{"--progress-size":"10px"}}},fi={label:{fontSize:9}},xi={Loader:o.Loader.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(ui,t==null?void 0:t.size)})}),Progress:o.Progress.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(pi,t==null?void 0:t.size)}),styles:fi}),RingProgress:o.RingProgress.extend({})},$t=1e3,Fe=1100,io=8,so=4,ro="light-dark(var(--mantine-primary-color-filled), var(--mantine-primary-color-5))",Rt={"--input-height":"24px","--input-size":"24px","--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":ro},ao={"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":ro},nt={fontSize:11,color:g.CHROME,marginBottom:1,lineHeight:1.2},qt={paddingInlineStart:8,paddingInlineEnd:8,backgroundColor:"var(--mantine-color-default)"},Be={label:nt,input:qt},vn={label:nt,input:qt},yt={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"}},Ot={input:{...Be.input,minHeight:"var(--input-height)",height:"auto",display:"flex",alignItems:"center",paddingTop:1,paddingBottom:1},pillsList:{columnGap:4,rowGap:2},pill:{margin:0}};function we(e,t){return{...Rt,"--input-height":e,"--input-size":e,"--input-fz":t}}function dt(e){return{...ao,"--input-fz":e}}function ct(e,t){return{...dt(t),"--input-height":e}}const Ke={compactSize:"sm",sizes:{xs:we("20px","10px"),sm:Rt,md:we("30px","13px"),lg:we("36px","15px"),xl:we("44px","17px")}},wn={compactSize:"sm",sizes:{xs:dt("10px"),sm:ao,md:dt("13px"),lg:dt("15px"),xl:dt("17px")}},hi={compactSize:"sm",sizes:{xs:{...we("20px","10px"),"--input-right-section-width":"20px"},sm:{...Rt,"--input-right-section-width":"24px"},md:{...we("30px","13px"),"--input-right-section-width":"30px"},lg:{...we("36px","15px"),"--input-right-section-width":"36px"},xl:{...we("44px","17px"),"--input-right-section-width":"44px"}}},gi={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"}}},mi={compactSize:"sm",sizes:{xs:{...we("20px","10px"),"--combobox-chevron-size":"10px"},sm:{...Rt,"--combobox-chevron-size":"12px"},md:{...we("30px","13px"),"--combobox-chevron-size":"14px"},lg:{...we("36px","15px"),"--combobox-chevron-size":"16px"},xl:{...we("44px","17px"),"--combobox-chevron-size":"18px"}}},Sn={compactSize:"sm",sizes:{xs:ct("20px","10px"),sm:ct("24px","11px"),md:ct("30px","13px"),lg:ct("36px","15px"),xl:ct("44px","17px")}},lo={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",passwordReveal:"Show the password",ordinal:(e,t)=>{switch(t){case"one":return`${e}st`;case"two":return`${e}nd`;case"few":return`${e}rd`;default:return`${e}th`}}},bi="en",Wt=r.createContext(lo),Yt=r.createContext(void 0);function yi(e){return e!==void 0&&e!==""?e:typeof document<"u"&&document.documentElement.lang!==""?document.documentElement.lang:typeof navigator<"u"&&navigator.language!==""?navigator.language:bi}function vi({labels:e,locale:t,children:s}){const i=r.useContext(Wt),a=r.useContext(Yt),l=r.useMemo(()=>({...i,...e}),[i,e]),c=t??a;return n.jsx(Yt.Provider,{value:c,children:n.jsx(Wt.Provider,{value:l,children:s})})}function oe(){return r.useContext(Wt)}function $e(){const e=r.useContext(Yt);return yi(e)}const wi=1234.5,Si="9876543210",Ii=9876543210,Ei=new Set([" "," "," "," ","'","’"]),Ci="−",Ti=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/iu,In=new Map;function zi(e){var f,p;const t=In.get(e);if(t!==void 0)return t;const s=new Intl.NumberFormat(e).formatToParts(wi),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(Ii);Array.from(c).forEach((h,m)=>{l.set(h,Si[m])});const x={decimal:i,digits:l,group:a};return In.set(e,x),x}function co(e,t){const s=zi(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||Ei.has(l))){if(l==="-"||l===Ci){i+="-";continue}if(l==="+"){i+="+";continue}if(l==="e"||l==="E"){i+=l;continue}break}}const a=Ti.exec(i);return a===null?Number.NaN:Number(a[0])}function Je(e){const t=$e(),s=JSON.stringify(e??{});return r.useMemo(()=>new Intl.NumberFormat(t,e),[t,s])}function uo(){const e=$e(),t=oe(),s=Je(),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 po(e){const t=$e(),s=JSON.stringify(e??{});return r.useMemo(()=>new Intl.Collator(t,e),[t,s])}function Zt(){const e=$e();return r.useCallback(t=>co(t,e),[e])}const Ri="M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",Pi="M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z";function Ai({reveal:e}){const t=oe();return n.jsxs(n.Fragment,{children:[n.jsx("svg",{viewBox:"0 0 15 15",fill:"none","aria-hidden":!0,style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:n.jsx("path",{d:e?Pi:Ri,fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),n.jsx(o.VisuallyHidden,{children:t.passwordReveal})]})}const ji={TextInput:o.TextInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size)}),styles:Be}),NumberInput:o.NumberInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(hi,t==null?void 0:t.size),controls:G(gi,t==null?void 0:t.size)}),styles:{label:nt,input:qt,control:{borderColor:"transparent"}}}),Select:o.Select.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Fe}},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size)}),styles:{...Be,...yt}}),Textarea:o.Textarea.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(wn,t==null?void 0:t.size)}),styles:vn}),PasswordInput:o.PasswordInput.extend({defaultProps:{size:"sm",variant:"filled",visibilityToggleButtonProps:{},visibilityToggleIcon:Ai},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size)}),styles:{...Be,innerInput:{paddingInlineStart:8,paddingInlineEnd:8}}}),Autocomplete:o.Autocomplete.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Fe}},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size)}),styles:{...Be,...yt}}),MultiSelect:o.MultiSelect.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Fe}},vars:(e,t)=>({root:{},wrapper:G(mi,t==null?void 0:t.size)}),styles:{label:nt,...yt,...Ot,inputField:{minWidth:60,flexBasis:60}}}),TagsInput:o.TagsInput.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Fe}},vars:(e,t)=>({root:{},wrapper:G(Sn,t==null?void 0:t.size)}),styles:{label:nt,...yt,...Ot,inputField:{minWidth:30,flexBasis:30}}}),PillsInput:o.PillsInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(Sn,t==null?void 0:t.size)}),styles:{label:nt,...Ot}}),FileInput:o.FileInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size)}),styles:Be}),JsonInput:o.JsonInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(wn,t==null?void 0:t.size)}),styles:vn}),NativeSelect:o.NativeSelect.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size)}),styles:Be}),ColorInput:o.ColorInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size),eyeDropperIcon:{},eyeDropperButton:{},colorPreview:{}}),styles:Be}),InputClearButton:o.InputClearButton.extend({defaultProps:{size:"xs"},vars:(e,t)=>({root:G(oo,t==null?void 0:t.size)})})},Li={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"}}},_i={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"}}},Oi={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"}}},Hi={root:{fontSize:11}},Ni={root:{fontSize:11,minHeight:28},label:{fontSize:11}},Di={tab:{fontSize:11,padding:"6px 10px"}},ki={Anchor:o.Anchor.extend({defaultProps:{size:"sm"},styles:Hi}),Burger:o.Burger.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(Oi,t==null?void 0:t.size)})}),NavLink:o.NavLink.extend({styles:Ni}),Pagination:o.Pagination.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(Li,t==null?void 0:t.size)})}),Stepper:o.Stepper.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(_i,t==null?void 0:t.size)})}),Tabs:o.Tabs.extend({styles:Di})},Mi={"--menu-item-fz":"11px"},Gi={tooltip:{fontSize:11,padding:"4px 8px"}},Bi={dropdown:{padding:8}},Fi={dropdown:{padding:8}},Vi={Menu:o.Menu.extend({defaultProps:{zIndex:Fe,withInitialFocusPlaceholder:!1},vars:()=>({dropdown:Mi})}),Modal:o.Modal.extend({defaultProps:{closeButtonProps:{"aria-label":"Close"}}}),Drawer:o.Drawer.extend({defaultProps:{closeButtonProps:{"aria-label":"Close"}}}),Tooltip:o.Tooltip.extend({defaultProps:{zIndex:Fe},styles:Gi}),Popover:o.Popover.extend({defaultProps:{zIndex:Fe},styles:Bi}),HoverCard:o.HoverCard.extend({defaultProps:{zIndex:Fe},styles:Fi})},Ui={xs:"10px",sm:"11px",md:"13px",lg:"14px",xl:"16px"},$i={xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},Wi={xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},fo=o.createTheme({colors:no,fontSizes:Ui,spacing:$i,radius:Wi,focusRing:"auto",other:{panelGrid:u},components:{...ji,...qo,...oi,...di,...xi,...ki,...Vi}}),Yi=o.mergeMantineTheme(o.DEFAULT_THEME,fo),xo=["#5B8FF9FF","#FF6B6BFF","#61D095FF","#F7B731FF","#9B59B6FF","#5B8FF980","#FF6B6B80","#61D09580","#F7B73180","#9B59B680"],Et="#888888",ho=["sizeSmallest","sizeLargest","width","opacity","attribute","scaleSqrt","scaleLinear","scaleLog"],go=["N","E","W","D","K"],Xi=["chevronDown","chevronRight","chevronLeft","close","plus","minus","gear","warning","check","eye","refresh","copy","pin","keepOpen","info","reset"],mo={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},Re={fill:"currentColor",stroke:"none"},Ki={sizeSmallest:e=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"5",cy:"11",r:"2.5",...e?Re:{}}),n.jsx("circle",{cx:"10.5",cy:"6.5",r:"4",...e?Re:{}})]}),sizeLargest:e=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"4.5",cy:"11.5",r:"1.75",...e?Re:{}}),n.jsx("circle",{cx:"10",cy:"6",r:"5",...e?Re:{}})]}),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?Re:{}}),n.jsx("polyline",{points:"11,5.5 13.5,8 11,10.5",...e?Re:{}})]}),opacity:e=>e?n.jsx("circle",{cx:"8",cy:"8",r:"5.5",...Re}):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",...Re})]}),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",...Re}),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:"1.5",...Re})]}),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"})},qi={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 Ze({name:e,filled:t=!1,size:s=u.GLYPH}){return n.jsx("svg",{width:s,height:s,...mo,"aria-hidden":"true",focusable:"false","data-glyph":e,"data-filled":t?"true":"false",style:{flex:"0 0 auto",display:"block"},children:Ki[e](t)})}function ie({name:e,size:t=u.GLYPH}){return n.jsx("svg",{width:t,height:t,...mo,"aria-hidden":"true",focusable:"false","data-glyph":e,style:{flex:"0 0 auto",display:"block"},children:qi[e]})}function Jt(e){return typeof e=="string"&&ho.includes(e)}function Qt(e){return typeof e=="string"&&go.includes(e)}const en=255,tn=100;function nn(e){return Math.round(parseInt(e,16)/en*tn)}function on(e){return Math.round(e/tn*en).toString(16).padStart(2,"0")}function Zi(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=nn(i);return{hex:s,opacity:a}}function Ji(e,t){const s=e.replace("#",""),i=on(t);return`#${s}${i}`}function Qi(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 Ct={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0};function es(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:es(t??e,c),description:f,describedBy:f===void 0?void 0:l}}const bo=r.createContext(null);function ts(){return r.useContext(bo)}function ns({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(bo.Provider,{value:{anchorRef:t},children:i})}function os({children:e}){return n.jsx(o.Box,{p:"sm",children:e})}const is=["[data-portal]","[data-combobox-dropdown]","[data-menu-dropdown]","[data-popover-dropdown]","[data-tooltip]","[data-hovercard-dropdown]","[data-dates-dropdown]","[data-modal]"].join(", ");function ss(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(is)||e()};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[e,t])}function rs(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 yo=r.createContext(null);function as({id:e,children:t}){return n.jsx(yo.Provider,{value:e,children:t})}function vo(){return r.useContext(yo)}const sn=r.createContext(null),rn=r.createContext(null);function Pt(){const e=r.useContext(sn);if(!e)throw new Error("usePopoutContext must be used within a Popout component");return e}function ls(){return r.useContext(sn)}function wo(){const e=r.useContext(rn);if(!e)throw new Error("usePopoutManagerContext must be used within a PopoutManager");return e}function cs(){return r.useContext(rn)}function ds(){const{closeAll:e,hasOpenPopouts:t}=wo();return r.useMemo(()=>({closeAll:e,hasOpenPopouts:t}),[e,t])}function us({children:e,parentId:t=null,opened:s,defaultOpened:i,onOpenChange:a}){const l=r.useId(),c=r.useRef(null),x=vo(),[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,R)=>{if(R){h.current(C,R);return}h.current(C)},[]),b=r.useCallback(C=>{m(!0,C)},[m]),v=r.useCallback(C=>{m(!1,C)},[m]),z=r.useCallback(C=>{m(!f,C)},[f,m]),T=r.useMemo(()=>({id:l,isOpen:f,open:b,close:v,toggle:z,triggerRef:c,parentId:t,region:x}),[l,f,b,v,z,t,x]);return n.jsx(sn.Provider,{value:T,children:e})}function ps({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,O)=>(l.current.get(y)??null)!==S?!1:S!==null?!0:(c.current.get(y)??null)===O,[]),h=r.useCallback((y,S)=>i.current.filter(O=>p(O,y,S)),[p]),m=r.useCallback(y=>{const S=[];for(const O of i.current){let k=O;for(;k;){const K=l.current.get(k)??null;if(K===y){S.push(O);break}k=K}}return S},[]),b=r.useCallback(y=>{let S=0,O=y;for(;O;){const k=l.current.get(O)??null;if(!k)break;S++,O=k}return S},[]),v=r.useCallback(y=>{var O;const S=[...y].sort((k,K)=>b(K)-b(k));for(const k of S)(O=a.current.get(k))==null||O()},[b]),z=r.useCallback((y,S,O,k)=>{if(i.current.includes(y)){a.current.set(y,S);return}const K=O??null,Se=k??null,be=h(K,Se),se=[];for(const te of be)se.push(te),se.push(...m(te));v(se);const q=new Set(se);i.current=i.current.filter(te=>!q.has(te)),i.current.push(y),a.current.set(y,S),l.current.set(y,K),c.current.set(y,Se),f(te=>te+1)},[h,m,v]),T=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?$t+S:$t},[]),R=r.useCallback(y=>{const S=i.current,O=S.indexOf(y);O===-1||O===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 O=S;for(;O;){const k=l.current.get(O);if(k===y)return!0;O=k??null}return!1},[]),P=r.useCallback(y=>{const S=[],O=i.current;for(const k of O)w(y,k)&&S.push(k);return S},[w]),j=r.useCallback(y=>{const S=P(y);for(const O of[...S].reverse()){const k=a.current.get(O);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 O=c.current.get(y)??null;for(const k of i.current)k!==y&&p(k,S,O)&&L(k)},[L,p]),U=r.useCallback(()=>{const y=i.current;if(y.length===0)return;const S=y[y.length-1],O=a.current.get(S);O==null||O()},[]),B=r.useCallback(()=>{const y=[...i.current];for(const S of y){const O=a.current.get(S);O==null||O()}},[]),N=r.useCallback(()=>i.current.length>0,[]),[$,A]=r.useState(!1);r.useEffect(()=>{A(i.current.length>0)},[x]),rs(U,$),ss(B,$);const H=r.useMemo(()=>({register:z,unregister:T,getZIndex:C,bringToFront:R,portalContainer:t,zIndexVersion:x,closeFocused:U,closeAll:B,hasOpenPopouts:N,closeWithDescendants:L,closeDescendants:j,closeSiblings:D,getParentId:I,isAncestor:w}),[z,T,C,R,t,x,U,B,N,L,j,D,I,w]);return n.jsxs(rn.Provider,{value:H,children:[e,n.jsx("div",{ref:s,"data-popout-portal-container":!0,style:{display:"contents"}})]})}function Oe(){return o.useDirection().dir}function xe(e){return e==="rtl"}function fs(e,t){return xe(t)?1-e:e}function xs(e,t,s){return fs(e,s)*t}function hs(e){return xe(e)?{transform:"scaleX(-1)"}:{}}const En=3;function gs(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},[]),z=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]),T=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)>=En||Math.abs(P)>=En))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]),R=c.left!==0||c.top!==0;return t?{dragTriggerProps:{"data-drag-trigger":!0,onPointerDown:z,onPointerMove:T,onPointerUp:C,onPointerCancel:C,style:{cursor:"grab",userSelect:"none",touchAction:"none"}},dragOffset:c,resetDragOffset:b,hasDragged:R,consumeDragClick:v}:{dragTriggerProps:{},dragOffset:{left:0,top:0},resetDragOffset:b,hasDragged:!1,consumeDragClick:v}}function ms({config:e,onClose:t,dragTriggerProps:s={},actions:i=[],activeTab:a,onTabChange:l,titleId:c}){var v;const x=oe(),{style:f,...p}=s,m=e.variant==="tabs"?e:null,b=(m==null?void 0:m.tabs.map(z=>({value:z.id,label:z.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:z=>l==null?void 0:l(z),size:"xs"})]}),n.jsxs(o.Group,{gap:4,children:[i.map(z=>n.jsx(o.ActionIcon,{variant:"subtle",onClick:z.onClick,"aria-label":z.label,children:z.icon},z.id)),n.jsx(o.CloseButton,{"data-testid":"popout-header-close",onClick:t,"aria-label":x.closePanel})]})]})}function bs(e,t=document){return e===null?null:t.querySelector(`[data-popout-id="${e}"]`)}function Cn(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 ys(e,t){return e==="start"?xe(t)?"right":"left":e==="end"?xe(t)?"left":"right":e}function vs(e,t,s=io,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=Tn(x,l,c);break;case"right":p=e.right+s,h=Tn(x,l,c);break;case"top":p=zn(x,l,t,f),h=e.top-c-s;break;case"bottom":p=zn(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 Tn(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 zn(e,t,s,i){switch(t){case"start":return xe(i)?e.right-s:e.left;case"center":return e.left+e.width/2-s/2;case"end":return xe(i)?e.left:e.right-s;default:{const a=t;throw new Error(`Unknown alignment: ${String(a)}`)}}}function ws(e){var Ge,Te;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:z,onDragEnd:T}=e,{isOpen:C,close:R,triggerRef:I,id:w,parentId:P,region:j}=Pt(),{getZIndex:L,portalContainer:D,register:U,unregister:B,bringToFront:N,zIndexVersion:$,closeDescendants:A}=wo(),H=ts(),y=Oe(),S=r.useId(),O=`popout-panel-${w}`,k=`popout-title-${S}`,[K,Se]=r.useState(null),be=r.useRef(!1),se=r.useRef(null),q=r.useCallback(()=>{N(w)},[N,w]),{dragTriggerProps:te,dragOffset:F,resetDragOffset:J,hasDragged:Z,consumeDragClick:Ie}=gs({isOpen:C,onPress:q,onDragStart:v,onDrag:z,onDragEnd:T}),he=(i==null?void 0:i.variant)==="tabs",W=(i==null?void 0:i.variant)==="tabs"?i:null,ce=(W==null?void 0:W.defaultTab)??((Ge=W==null?void 0:W.tabs[0])==null?void 0:Ge.id),[He,We]=r.useState(ce),Pe=h??(P===null?0:so),ft=r.useCallback((Y,re)=>{var ne;We(Y),(ne=W==null?void 0:W.onTabChange)==null||ne.call(W,Y,re)},[W]),ae=r.useCallback(Y=>{Y.stopPropagation(),N(w),!Ie()&&A(w)},[A,N,Ie,w]),Ne=r.useCallback(Y=>{A(w),R(Y)},[A,R,w]),ge=r.useRef(R);r.useEffect(()=>{ge.current=R});const Ae=r.useCallback(()=>{ge.current()},[]);r.useEffect(()=>(C?U(w,Ae,P,j):B(w),()=>{B(w)}),[C,w,U,B,Ae,P,j]);const Ee=r.useCallback(()=>{const Y={trigger:I.current,parent:bs(P),panel:(H==null?void 0:H.anchorRef.current)??null};return{inline:Cn(c,"x",Y),block:Cn(x,"y",Y)}},[I,P,H,c,x]),De=r.useCallback(()=>{var at;const{inline:Y,block:re}=Ee(),ne=Y??re,ye=re??Y;if(!ne||!ye)return;const de=(at=se.current)==null?void 0:at.getBoundingClientRect(),ue=Math.max(t,(de==null?void 0:de.width)??0),M=Math.max(s??0,(de==null?void 0:de.height)??0),ee=ys(f,y),pe=ee==="top"||ee==="bottom",Ye=pe?ye:ne,rt=pe?ne:ye,Xe=vs(Ye.getBoundingClientRect(),ue,Pe,{placement:ee,alignment:p,panelHeight:M,crossAnchorRect:rt.getBoundingClientRect(),direction:y});Se(ze=>ze&&ze.left===Xe.left&&ze.top===Xe.top?ze:Xe)},[Ee,t,s,f,p,Pe,y]);if(X.useIsomorphicEffect(()=>{if(!C){Se(null);return}be.current||(J(),he&&We(ce)),De()},[C,De,J,he,ce]),r.useEffect(()=>{if(!C)return;let Y=0;const re=()=>{Y===0&&(Y=requestAnimationFrame(()=>{Y=0,De()}))},ne=new ResizeObserver(re),ye=new MutationObserver(re),{inline:de,block:ue}=Ee();for(const ee of new Set([de,ue].filter(pe=>pe!==null)))ne.observe(ee),ye.observe(ee,{attributes:!0,attributeFilter:["style","class"]});se.current&&ne.observe(se.current);const M=()=>{Z||re()};return window.addEventListener("resize",M),window.addEventListener("scroll",M,!0),()=>{Y!==0&&cancelAnimationFrame(Y),ne.disconnect(),ye.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("scroll",M,!0)}},[C,De,Ee,Z]),r.useEffect(()=>{var Y;if(b){if(C){const re=setTimeout(()=>{var ne;(ne=se.current)==null||ne.focus()},0);return()=>{clearTimeout(re)}}be.current&&((Y=I.current)==null||Y.focus())}},[C,b,I]),r.useEffect(()=>{be.current=C},[C]),!C||!D)return null;const ke=L(w),Qe={left:((K==null?void 0:K.left)??0)+F.left,top:((K==null?void 0:K.top)??0)+F.top},Me=n.jsxs(o.Paper,{ref:se,id:O,role:"dialog","aria-modal":"false","aria-labelledby":i?k:void 0,"aria-label":i?void 0:a,tabIndex:-1,radius:8,onClick:ae,"data-testid":"popout-panel","data-popout-id":w,...P&&{"data-parent-id":P},style:{position:"fixed",left:Qe.left,top:Qe.top,minWidth:t,width:"min-content",...s!==void 0&&{minHeight:s},...K===null&&{visibility:"hidden"},zIndex:ke,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(ms,{config:i,onClose:Ne,dragTriggerProps:te,activeTab:He,onTabChange:ft,actions:m,titleId:k}):null,n.jsx(o.Box,{"data-testid":"popout-panel-content",children:he?(Te=W==null?void 0:W.tabs.find(Y=>Y.id===He))==null?void 0:Te.content:l})]});return $o.createPortal(Me,D)}function Ss({children:e,action:t="toggle"}){const{open:s,toggle:i,triggerRef:a,isOpen:l,id:c}=Pt(),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 Is({children:e,opened:t,defaultOpened:s,onOpenChange:i}){const a=ls(),l=(a==null?void 0:a.id)??null;return n.jsx(us,{parentId:l,opened:t,defaultOpened:s,onOpenChange:i,children:e})}const Ve=Object.assign(Is,{Trigger:Ss,Panel:ws,Content:os,Anchor:ns}),Es=r.forwardRef(function({icon:t,size:s="xs",...i},a){const{isOpen:l}=Pt();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 So({children:e}){return n.jsx(ps,{children:e})}const Rn=4,Pn=4,Cs=2,Ts=72,zs=54,Rs=220,An=0,Ht=100,jn=9,Ln=7,Ps=/^#[0-9A-F]{6}$/iu,As=1.1;function Nt(e){const t=e==="start"?Pn:0,s=e==="end"?Pn:0;return{borderStartStartRadius:t,borderEndStartRadius:t,borderStartEndRadius:s,borderEndEndRadius:s}}function js(){const e=$e();return r.useMemo(()=>{var s;return((s=new Intl.NumberFormat(e).formatToParts(As).find(i=>i.type==="decimal"))==null?void 0:s.value)??"."},[e])}function Io({color:e,defaultColor:t,opacity:s,defaultOpacity:i=Ht,onColorChange:a,onOpacityChange:l,onChange:c,label:x,showOpacity:f=!0,disabled:p=!1,disabledReason:h,onFocus:m,onBlur:b}){const v=oe(),z=Zt(),T=js(),C=r.useId(),R=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),B=I??t,N=P??i,[$,A]=r.useState(B.replace("#","").toUpperCase()),[H,y]=r.useState(N);r.useEffect(()=>{A(B.replace("#","").toUpperCase())},[B]),r.useEffect(()=>{y(N)},[N]);const S=F=>{const J=F.length===jn,Z=J?F.slice(0,Ln).toUpperCase():F.toUpperCase(),Ie=J&&f,he=Ie?nn(F.slice(Ln,jn)):P;w(Z),Ie&&j(he),c==null||c(Z,he)},O=()=>`${B}${on(N)}`.toUpperCase(),k=F=>{A(F.currentTarget.value.toUpperCase())},K=F=>{const J=$.toUpperCase(),Z=J.startsWith("#")?J:`#${J}`;Ps.test(Z)&&Z!==B?(w(Z,F),c==null||c(Z,P,F)):A(B.replace("#","").toUpperCase()),b==null||b(F)},Se=F=>{y(F)},be=F=>{const J=typeof H=="string"?z(H):H;if(Number.isNaN(J)){y(N),b==null||b(F);return}const Z=Math.min(Ht,Math.max(An,J));Z!==N&&(j(Z,F),c==null||c(I,Z,F)),y(Z),b==null||b(F)},se=F=>{w(void 0,F),f&&j(void 0,F),c==null||c(void 0,f?void 0:P,F)},q=f?"middle":"end",te=n.jsxs(o.Group,{"data-testid":"compact-color-input",gap:Rn,wrap:"nowrap",title:x===void 0?R.title:void 0,"data-disabled":p?"true":void 0,children:[n.jsxs(o.Group,{gap:0,wrap:"nowrap",children:[n.jsxs(Ve,{children:[n.jsx(Ve.Trigger,{children:n.jsx(o.ActionIcon,{variant:"filled",size:u.CONTROL_HEIGHT,radius:0,style:{backgroundColor:"var(--mantine-color-default)",...Nt("start")},"data-testid":"compact-color-input-swatch",disabled:p,"aria-label":v.colorSwatch,"aria-describedby":R.describedBy,children:n.jsx(o.ColorSwatch,{color:B,size:u.GLYPH,radius:Cs,style:{border:`1px solid ${g.BORDER}`}})})}),n.jsx(Ve.Panel,{width:Rs,header:{variant:"title",title:x??v.colorPanelTitle},placement:"bottom",alignment:"start",gap:Rn,children:n.jsx(Ve.Content,{children:n.jsx(o.ColorPicker,{format:"hexa",value:O(),onChange:S,swatches:[...xo]})})})]}),n.jsx(o.TextInput,{"data-testid":"compact-color-input-hex",disabled:p,description:R.description,value:$,onChange:k,onFocus:m,onBlur:K,"aria-label":v.colorHexValue,"data-is-default":L?"true":"false",w:Ts,styles:{input:{...Nt(q),fontFamily:"monospace",textTransform:"uppercase",...L?{fontStyle:"italic",color:g.CHROME}:{}},description:Ct}}),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:R.description,value:H,onChange:Se,onFocus:m,onBlur:be,min:An,max:Ht,decimalSeparator:T,hideControls:!0,suffix:"%","aria-label":v.opacity,"data-is-default":D?"true":"false",w:zs,styles:{input:{...Nt("end"),textAlign:"end",...D?{fontStyle:"italic",color:g.CHROME}:{}},description:Ct}})]})]}),!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:se,children:n.jsx(ie,{name:"reset",size:u.CHEVRON})}),R.description!==void 0&&n.jsx(o.VisuallyHidden,{id:R.describedBy,children:R.description})]});return x===void 0?te:n.jsxs(o.Stack,{"data-testid":"compact-color-input-labelled",gap:0,role:"group","aria-labelledby":C,title:R.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}),te]})}const vt=u.GUTTER,_n=4,Ls=1,_s=1.2,Os="calc(-1 * var(--mantine-spacing-sm) - 1px)";function Hs({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:Ls,style:{marginBlockStart:vt,marginBlockEnd:0,marginInline:i?Os:void 0}}),n.jsxs(o.Box,{"data-testid":"control-group-header",style:{display:"flex",alignItems:"center",gap:_n,boxSizing:"border-box",paddingBlock:vt,paddingInline:vt},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:_s,color:g.VALUE},children:e}),l&&n.jsx(o.Box,{"data-testid":"control-group-actions",style:{display:"flex",alignItems:"center",gap:_n,flex:"0 0 auto"},children:t})]}),n.jsx(o.Stack,{"data-testid":"control-group-content",gap:0,px:vt,children:s})]})}function _e(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 On=250,Ns=4;function Ds({name:e,bubbleId:t}){const{isOpen:s,open:i,close:a}=Pt();return n.jsx(Ve.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(ie,{name:"info",size:u.CHEVRON})})})}function Eo({children:e,label:t,opened:s,defaultOpened:i,onOpenChange:a}){const l=oe(),c=r.useId(),x=cs()!==null,f=l.about(t),p=n.jsxs(Ve,{opened:s,defaultOpened:i,onOpenChange:a,children:[n.jsx(Ds,{name:f,bubbleId:c}),n.jsx(Ve.Panel,{width:On,label:f,placement:"bottom",alignment:"start",gap:Ns,anchorX:"trigger",anchorY:"trigger",manageFocus:!1,children:n.jsx(o.Box,{id:c,w:On,p:"xs",style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1.4,color:g.PROSE},children:e})})]});return x?p:n.jsx(So,{children:p})}function ut(e){return e!=null&&e!==!1}function Ce({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 Co=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=oe(),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(ie,{name:"gear",size:u.GLYPH})})}),Dt=4,ks=1,Hn=6,Ms=12,Gs=1.2;function Bs(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=oe(),v=Oe(),z=r.useId(),T=r.useId(),C=r.useId(),[R,I]=X.useUncontrolled({value:i,defaultValue:a,finalValue:!0,onChange:l}),w=!x&&r.Children.toArray(m).length>0,P=p!=null;_e(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=H=>{I(!R,H)},L=R?b.collapseSection(t):b.expandSection(t),D=b.addToSection(t),U=xe(v)?"chevronLeft":"chevronRight",B={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:Dt,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:z,title:$,"data-testid":"control-section-name",style:{minWidth:0,fontSize:Ms,fontWeight:500,lineHeight:Gs,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":z,"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:ks,my:0,mx:0}),n.jsxs(o.Box,{"data-testid":"control-section-header",style:{display:"flex",alignItems:"center",gap:Dt,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":R,"aria-controls":T,onClick:j,style:{...N,cursor:"pointer"},children:[n.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:B,children:n.jsx(ie,{name:R?"chevronDown":U,size:u.CHEVRON})}),A]}):n.jsxs(o.Box,{style:N,children:[n.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:B}),A]}),c&&n.jsx(o.Box,{role:"img","aria-label":b.sectionHasConfiguredValues(t),"data-testid":"control-section-dot",style:{flex:"0 0 auto",width:Hn,height:Hn,borderRadius:"50%",background:g.ACCENT}}),P&&n.jsx(Eo,{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:Dt,flex:"0 0 auto"},children:h}),x&&f!==void 0&&n.jsx(Ce,{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(ie,{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:T,in:R,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 kt="control-sub-group",Nn=4,Fs=10,Vs=1.2;function Us(e){const{label:t,opened:s,defaultOpened:i,onOpenChange:a,children:l}=e,c=oe(),x=Oe(),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 R=f.current;f.current=void 0,h(C===kt,R)},[h]),v=p?c.collapseSection(t):c.expandSection(t);let z="chevronDown";p||(z=xe(x)?"chevronLeft":"chevronRight");const T={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:Vs,color:g.CHROME},chevron:{marginInlineStart:0,marginInlineEnd:Nn,color:g.CHROME},content:{paddingBlock:0,paddingInlineStart:u.GUTTER,paddingInlineEnd:0}};return n.jsx(o.Accordion,{"data-testid":"control-sub-group",value:p?kt:null,onChange:b,chevronPosition:"left",chevronSize:u.GLYPH_SLOT,disableChevronRotation:!0,chevron:n.jsx(ie,{name:z,size:Fs}),styles:T,children:n.jsxs(o.Accordion.Item,{value:kt,"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:Nn},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 $s(e){const t=oe();return r.useMemo(()=>({...t,...e}),[t,e])}const le=-1;function ot(e,t,s){return Math.min(Math.max(e,t),s)}function Ws(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=xe(i)?"ArrowLeft":"ArrowRight",m=xe(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,le,f),column:e.column};if(t==="ArrowUp")return{row:ot(e.row-1,le,f),column:e.column};if(t==="Home")return a.jumpToEnd?{row:le,column:0}:{row:e.row,column:0};if(t==="End")return a.jumpToEnd?{row:Math.max(f,le),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 Ys(e,t){const s=t.rowCount-1,i=Math.max(t.columnCount-1,0);return{row:ot(e.row,le,Math.max(s,le)),column:ot(e.column,0,i)}}function wt(e,t){return e.row===t.row&&e.column===t.column}function Xs(e,t,s){const i=Math.min(t,s),a=Math.max(t,s);return e.slice(i,a+1)}function Xt(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 Ks(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=Xs(t,f,s);return{selected:l.toggle?Xt([...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:Xt(p,t),anchor:x}}return{selected:[x],anchor:x}}function qs(e,t,s){return s!=="multiple"?{selected:[...t],anchor:void 0}:{selected:Xt([...t,...e],e),anchor:e[0]}}function Dn(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 kn(e){return e==null?!0:typeof e=="number"?!Number.isFinite(e):e instanceof Date&&Number.isNaN(e.getTime())}function Zs(e,t,s){const i=kn(e),a=kn(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 Js=fe.tableFeatures({columnFilteringFeature:fe.columnFilteringFeature,columnOrderingFeature:fe.columnOrderingFeature,columnVisibilityFeature:fe.columnVisibilityFeature,filteredRowModel:fe.createFilteredRowModel(),globalFilteringFeature:fe.globalFilteringFeature,rowSelectionFeature:fe.rowSelectionFeature,rowSortingFeature:fe.rowSortingFeature,sortedRowModel:fe.createSortedRowModel()}),Qs=320,er=8,tr=12,nr=1.2,or="var(--mantine-primary-color-light)",Mn="mantine-focus-auto",Mt=[],ir=[];function Gn(e){return e==="asc"?"ascending":e==="desc"?"descending":"none"}function sr(e,t,s){return Math.min(Math.max(e,t),s)}function rr(e,t){var gn,mn;const{data:s,rowCount:i,rowOffset:a=0,onRangeChange:l,columns:c,getRowId:x,label:f,labelledBy:p,labels:h,height:m=Qs,rowHeight:b=u.DATA_PITCH,headerHeight:v=u.CONTROL_HEIGHT,overscan:z=er,selectionMode:T="multiple",selectedIds:C,defaultSelectedIds:R,onSelectionChange:I,sorting:w,defaultSorting:P,onSortingChange:j,hiddenColumns:L,defaultHiddenColumns:D,onHiddenColumnsChange:U,columnOrder:B,defaultColumnOrder:N,onColumnOrderChange:$,filter:A,defaultFilter:H,onFilterChange:y,searchable:S=!1,onRowClick:O,onRowDoubleClick:k,onRowContextMenu:K,onFocus:Se,onBlur:be,empty:se}=e,q=$s(h),te=Oe(),F=$e(),J=Je(),Z=po({numeric:!0,sensitivity:"variant"}),Ie=r.useMemo(()=>new Intl.DateTimeFormat(F),[F]),he=r.useMemo(()=>({number:J,date:Ie,yes:q.yes,no:q.no}),[J,Ie,q.yes,q.no]),[W,ce]=X.useUncontrolled({value:C,defaultValue:R,finalValue:Mt,onChange:(d,E)=>{I==null||I([...d],E)}}),[He,We]=X.useUncontrolled({value:w,defaultValue:P,finalValue:ir,onChange:(d,E)=>{j==null||j([...d],E)}}),[Pe,ft]=X.useUncontrolled({value:L,defaultValue:D,finalValue:Mt,onChange:(d,E)=>{U==null||U([...d],E)}}),[ae,Ne]=X.useUncontrolled({value:B,defaultValue:N,finalValue:Mt,onChange:(d,E)=>{$==null||$([...d],E)}}),[ge,Ae]=X.useUncontrolled({value:A,defaultValue:H,finalValue:"",onChange:(d,E)=>{y==null||y(d,E)}}),Ee=r.useMemo(()=>{const d=new Map;for(const E of c)d.set(E.id,E);return d},[c]),De=JSON.stringify(Pe),ke=r.useMemo(()=>{const d=new Set(Pe);return c.filter(E=>(E.filterable??!0)&&!d.has(E.id)).map(E=>E.id)},[c,De]),Qe=r.useMemo(()=>{const d=ge.trim();if(d!=="")return{query:d.toLocaleLowerCase(F),columnIds:ke}},[ge,F,ke]),xt=r.useMemo(()=>[...s],[s]),et=r.useMemo(()=>c.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,_)=>Zs(d.value(E.original),d.value(_.original),Z)})),[c,Z]),Me=JSON.stringify(He),Ge=r.useMemo(()=>He.map(d=>({id:d.id,desc:d.desc})),[Me]),Te=r.useMemo(()=>{const d={};for(const E of Pe)d[E]=!1;return d},[Pe]),Y=r.useMemo(()=>{const d={};for(const E of W)d[E]=!0;return d},[W]),re=r.useMemo(()=>[...ae],[ae]),ne=r.useRef(void 0),ye=i!==void 0,de=ye?a:0,ue=fe.useTable({features:Js,data:xt,columns:et,getRowId:x,manualSorting:ye,manualFiltering:ye,enableRowSelection:T!=="none",enableMultiRowSelection:T==="multiple",getColumnCanGlobalFilter:()=>!0,globalFilterFn:(d,E,_)=>{const V=_;if(V===void 0||!V.columnIds.includes(E))return!1;const Q=Ee.get(E);return Q===void 0?!1:Dn(Q.value(d.original),he).toLocaleLowerCase(F).includes(V.query)},state:{sorting:Ge,columnVisibility:Te,columnOrder:re,rowSelection:Y,globalFilter:Qe},onSortingChange:d=>{const E=fe.functionalUpdate(d,Ge);We(E.map(_=>({id:_.id,desc:_.desc})),ne.current)},onColumnVisibilityChange:d=>{const E=fe.functionalUpdate(d,Te);ft(Object.keys(E).filter(_=>!E[_]))},onColumnOrderChange:d=>{Ne(fe.functionalUpdate(d,re))},onRowSelectionChange:d=>{ce(Object.keys(fe.functionalUpdate(d,Y)))}}),{rows:M}=ue.getRowModel(),ee=ue.getVisibleLeafColumns(),pe=i??M.length,Ye=ee.length,rt=r.useMemo(()=>M.map(d=>d.id),[M]),Xe=r.useRef(null),at=r.useRef(null),ze=Wo.useVirtualizer({count:pe,getScrollElement:()=>Xe.current,estimateSize:()=>b,getItemKey:d=>rt[d-de]??d,overscan:z}),At=ze.getVirtualItems(),ln=((gn=At[0])==null?void 0:gn.index)??0,cn=(((mn=At.at(-1))==null?void 0:mn.index)??-1)+1;r.useEffect(()=>{l==null||l(ln,cn)},[ln,cn]);const[dn,tt]=r.useState({row:le,column:0}),ve=r.useMemo(()=>Ys(dn,{rowCount:pe,columnCount:Ye}),[dn,pe,Ye]),jt=r.useRef(!1),Lt=r.useRef(void 0),Mo=d=>{d.row>=0&&ze.scrollToIndex(d.row),jt.current=!0,tt(E=>wt(E,d)?E:d)};r.useLayoutEffect(()=>{var _;if(!jt.current)return;const d=`[data-grid-row="${ve.row}"][data-grid-column="${ve.column}"]`,E=(_=at.current)==null?void 0:_.querySelector(d);E instanceof HTMLElement&&(jt.current=!1,E.focus())});const un=(d,E)=>{Lt.current=d.anchor,!(d.selected.length===W.length&&d.selected.every((V,Q)=>V===W[Q]))&&ce(d.selected,E)},ht=(d,E,_)=>{un(Ks({ids:rt,index:d-de,selected:W,anchor:Lt.current,modifiers:E,mode:T}),_)},pn=(d,E,_)=>{const V=M[d-de];V!==void 0&&(O==null||O(V.original,E,_))},Go=(d,E)=>{d.getCanSort()&&(ne.current=E,d.toggleSorting(void 0,E.shiftKey&&d.getCanMultiSort()),ne.current=void 0)},Bo=()=>{var _;const d=((_=Xe.current)==null?void 0:_.clientHeight)??0,E=Math.floor((d===0?b*10:d)/b);return Math.max(1,E-1)},Fo=d=>{const E=T==="multiple",_=d.ctrlKey||d.metaKey;if(E&&_&&(d.key==="a"||d.key==="A")){d.preventDefault(),un(qs(rt,W,T),d);return}if(ve.row>=0&&(d.key===" "||d.key==="Enter")){d.preventDefault(),d.key===" "?ht(ve.row,{extend:d.shiftKey,toggle:!d.shiftKey},d):(ht(ve.row,{extend:!1,toggle:!1},d),pn(ve.row,d,{source:"keyboard"}));return}const V=Ws(ve,d.key,{rowCount:pe,columnCount:Ye,pageSize:Bo()},te,{jumpToEnd:_});V!==void 0&&(d.preventDefault(),Mo(V),E&&d.shiftKey&&V.row>=0&&V.row!==ve.row&&ht(V.row,{extend:!0,toggle:!1},d))};r.useImperativeHandle(t,()=>({scrollToRow:d=>{d>=0&&d<pe&&ze.scrollToIndex(d)},setColumnHidden:(d,E)=>{var _;(_=ue.getColumn(d))==null||_.toggleVisibility(!E)},moveColumn:(d,E)=>{const _=ue.getAllLeafColumns().map(Q=>Q.id),V=_.indexOf(d);V!==-1&&(_.splice(V,1),_.splice(sr(E,0,_.length),0,d),ue.setColumnOrder(_))},clearSelection:()=>{Lt.current=void 0,ce([])}}),[ue,ze,pe,ce]);const Vo=ee.reduce((d,E)=>{var _;return d+(((_=Ee.get(E.id))==null?void 0:_.width)??u.FIELD)},0),fn=(d,E)=>{const _=(d==null?void 0:d.width)??u.FIELD;return{flex:E===Ye-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"}},gt=T!=="none",xn=i??s.length,hn=q.rowsShown(J.format(pe),J.format(xn)),Uo=()=>se!==void 0?se:xn===0?q.noRows:q.noMatchingRows;return n.jsxs(o.Box,{"data-testid":"data-table",dir:xe(te)?"rtl":void 0,onFocus:Se,onBlur:be,style:{display:"flex",flexDirection:"column",gap:u.TRAIL_GAP,width:"100%",color:g.VALUE},children:[S&&n.jsxs(o.Box,{style:{display:"flex",alignItems:"center",gap:u.GUTTER},children:[n.jsx(o.TextInput,{"data-testid":"data-table-search",type:"search","aria-label":q.search,placeholder:q.searchPlaceholder,value:ge,onChange:d=>{Ae(d.currentTarget.value,d)},rightSection:ge===""?void 0:n.jsx(o.ActionIcon,{"data-testid":"data-table-search-clear",variant:"subtle",size:u.CONTROL_HEIGHT,"aria-label":q.clearSearch,onClick:d=>{Ae("",d)},children:n.jsx(ie,{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:hn})]}),n.jsxs(o.VisuallyHidden,{role:"status","aria-live":"polite",dir:"auto","data-testid":"data-table-status",children:[hn,gt&&W.length>0?` ${q.rowsSelected(J.format(W.length))}`:""]}),n.jsxs(o.Box,{ref:Xe,"data-testid":"data-table-viewport",style:{height:m,overflow:"auto",position:"relative",border:`1px solid ${g.BORDER}`,borderRadius:"var(--mantine-radius-sm)",background:g.PANEL},children:[n.jsxs(o.Table,{ref:at,role:"grid","aria-label":p===void 0&&f===void 0?q.dataTable:f,"aria-labelledby":p,"aria-rowcount":pe+1,"aria-colcount":Ye,"aria-multiselectable":T==="multiple"?!0:void 0,onKeyDown:Fo,stickyHeader:!0,tabularNums:!0,withRowBorders:!1,horizontalSpacing:0,verticalSpacing:0,highlightOnHover:gt,highlightOnHoverColor:g.SURFACE,style:{display:"grid",width:"100%",minWidth:Vo,fontSize:tr,lineHeight:nr},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:v},children:ee.map((d,E)=>{const _=Ee.get(d.id),V=d.getCanSort(),Q=d.getIsSorted(),me=ve.row===le&&ve.column===E,mt=Q===!1?-1:d.getSortIndex(),bt=me?0:-1,lt=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:Q===!1?void 0:g.VALUE},children:(_==null?void 0:_.header)??d.id}),Q!==!1&&n.jsx(o.Box,{component:"span","data-testid":"data-table-sort-glyph","data-direction":Gn(Q),"aria-hidden":"true",style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:g.VALUE,transform:Q==="asc"?"rotate(180deg)":void 0},children:n.jsx(ie,{name:"chevronDown",size:u.CHEVRON})}),Ge.length>1&&mt>=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:J.format(mt+1)})]});return n.jsx(o.Table.Th,{scope:"col","data-testid":"data-table-header","aria-colindex":E+1,"aria-sort":V?Gn(Q):void 0,"data-grid-row":V?void 0:le,"data-grid-column":V?void 0:E,tabIndex:V?void 0:bt,className:V?void 0:Mn,onFocus:V?void 0:()=>{tt(je=>wt(je,{row:le,column:E})?je:{row:le,column:E})},style:{...fn(_,E),gap:u.GUTTER/2,height:v,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":le,"data-grid-column":E,tabIndex:bt,onClick:je=>{tt({row:le,column:E}),Go(d,je)},onFocus:()=>{tt(je=>wt(je,{row:le,column:E})?je:{row:le,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:lt}):lt},d.id)})})}),n.jsx(o.Table.Tbody,{style:{display:"grid",position:"relative",height:ze.getTotalSize()},children:At.map(d=>{const E=M[d.index-de];if(E===void 0)return null;const _=W.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":gt?_:void 0,onDoubleClick:V=>{k==null||k(E.original,V)},onContextMenu:V=>{K==null||K(E.original,V)},style:{display:"flex",position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:b,transform:`translateY(${String(d.start)}px)`,background:_?or:void 0,cursor:gt?"pointer":void 0},children:ee.map((V,Q)=>{const me=Ee.get(V.id),mt=ve.row===d.index&&ve.column===Q,bt=me==null?void 0:me.value(E.original),lt=Dn(bt,he),je=(me==null?void 0:me.cell)===void 0?n.jsx(o.Box,{component:"span",dir:"auto",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:lt}):me.cell(E.original);return n.jsx(o.Table.Td,{role:"gridcell","data-testid":"data-table-cell","aria-colindex":Q+1,"data-grid-row":d.index,"data-grid-column":Q,tabIndex:mt?0:-1,className:Mn,title:(me==null?void 0:me.cell)===void 0?lt:void 0,onFocus:()=>{tt(Le=>wt(Le,{row:d.index,column:Q})?Le:{row:d.index,column:Q})},onClick:Le=>{tt({row:d.index,column:Q}),ht(d.index,{extend:Le.shiftKey,toggle:Le.metaKey||Le.ctrlKey},Le),pn(d.index,Le,it(Le))},style:fn(me,Q),children:je},V.id)})},E.id)})})]}),pe===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:Uo()})]})]})}const ar=r.forwardRef(rr);function lr(){return crypto.randomUUID().slice(0,8)}function Tt(e,t){return{id:lr(),offset:e,color:t}}function To(){return[Tt(0,"#6366F1"),Tt(1,"#06B6D4")]}const cr=2,dr=5,ur=80,pr=0,Gt=100,Bt=0,fr=360,xr=[0,90,180,270,360];function hr({stops:e,defaultStops:t,direction:s,defaultDirection:i=Bt,showDirection:a=!0,onChange:l,onChangeStart:c,onChangeEnd:x,minStops:f=cr,maxStops:p=dr}){const h=oe(),m=Je({maximumFractionDigits:0}),b=r.useId(),v=r.useId(),z=r.useMemo(()=>To(),[]),[T,C]=X.useUncontrolled({value:e,defaultValue:t,finalValue:z,onChange:(A,H)=>{l==null||l(A,R,H)}}),[R,I]=X.useUncontrolled({value:s,defaultValue:i,finalValue:Bt,onChange:(A,H)=>{l==null||l(T,A,H)}}),w=r.useRef(!1),P=A=>{w.current||(w.current=!0,c==null||c(A))},j=(A,H)=>{w.current=!1,x==null||x(A,H)},L=(A,H)=>T.map((y,S)=>S===A?{...y,color:H}:y),D=(A,H)=>T.map((y,S)=>S===A?{...y,offset:H/Gt}:y),U=A=>{if(T.length>=p)return;const H=T[T.length-1],y=H===void 0?.5:(H.offset+1)/2,S=[...T,Tt(y,Et)];S.sort((O,k)=>O.offset-k.offset),C(S,A)},B=(A,H)=>{T.length<=f||C(T.filter((y,S)=>S!==A),H)},N=T.length>=p,$=T.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(ie,{name:"plus",size:u.CHEVRON})})]}),n.jsx(o.Stack,{"data-testid":"gradient-editor-stops",gap:"xs",role:"group","aria-labelledby":b,children:T.map((A,H)=>{const y=m.format(H+1);return n.jsxs(o.Group,{"data-testid":"gradient-editor-stop",gap:"xs",align:"flex-end",wrap:"nowrap",children:[n.jsx(Io,{color:A.color,defaultColor:Et,onColorChange:(S,O)=>{C(L(H,S??Et),O)},showOpacity:!1}),n.jsx(o.Box,{style:{width:ur},children:n.jsx(o.Slider,{"data-testid":"gradient-editor-stop-position",min:pr,max:Gt,value:A.offset*Gt,onPointerDown:P,onChange:S=>{P(),C(D(H,S))},onChangeEnd:S=>{j(D(H,S),R)},label:S=>h.percent(m.format(S)),thumbLabel:h.colorStopPosition(y)})}),n.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,onClick:S=>{B(H,S)},"data-testid":"gradient-editor-remove-stop",disabled:$,"aria-label":h.removeColorStop(y),children:n.jsx(ie,{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:Bt,max:fr,value:R,onPointerDown:P,onChange:A=>{P(),I(A)},onChangeEnd:A=>{j(T,A)},label:A=>h.degrees(m.format(A)),thumbLabel:h.gradientDirection,marks:xr.map(A=>({value:A,label:h.degrees(m.format(A))}))})]})]})}const gr=4,mr=2,br=1.1;function yr(){const e=$e();return r.useMemo(()=>{var s;return((s=new Intl.NumberFormat(e).formatToParts(br).find(i=>i.type==="decimal"))==null?void 0:s.value)??"."},[e])}function vr({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 z=oe(),T=st({name:e,disabled:h,disabledReason:m}),C=Zt(),R=yr(),[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 B=A=>{U.current=!0,D(A)},N=A=>{const H=typeof L=="string"?C(L):L;if(Number.isNaN(H)){D(I??s),v==null||v(A);return}let y=H;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:gr,wrap:"nowrap",align:"flex-end",title:T.title,"data-disabled":h?"true":void 0,children:[n.jsx(o.NumberInput,{"data-testid":"style-number-input-field",label:e,description:T.description,value:L,onChange:B,onFocus:b,onBlur:N,min:a,max:l,step:c,decimalScale:x,decimalSeparator:R,suffix:f,hideControls:p,disabled:h,"data-is-default":P?"true":"false",styles:{input:P?{fontStyle:"italic",color:g.CHROME}:void 0,description:Ct},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":z.resetToDefault(e),onClick:$,style:{marginBlockEnd:mr},children:n.jsx(ie,{name:"reset",size:u.CHEVRON})})]})}const wr=4,Sr=2;function Ir({label:e,value:t,defaultValue:s,options:i,onChange:a,disabled:l=!1,disabledReason:c,onFocus:x,onBlur:f}){const p=oe(),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,z=m??s,T=R=>{R!==null&&b(R)},C=R=>{b(void 0,R)};return n.jsxs(o.Group,{"data-testid":"style-select",gap:wr,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:z,onChange:T,onFocus:x,onBlur:f,data:i,rightSection:n.jsx(ie,{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:Ct},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(ie,{name:"reset",size:u.CHEVRON})})]})}const St=4,Er=`${String(u.TOGGLE_PITCH)}px`;function Cr({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=oe(),[v,z]=X.useUncontrolled({value:t,defaultValue:s,finalValue:!1,onChange:i}),T=P=>{z(P.currentTarget.checked,P)},C={root:{minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:St,fontSize:"var(--mantine-font-size-sm)",lineHeight:Er,color:a?g.DISABLED:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},R=x??b.fieldBound,I=st({name:e,enabledTitle:e,disabled:a,disabledReason:l,extraDescriptions:c?[R]: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:T,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:St},children:[c?n.jsxs(o.Box,{"data-testid":"toggle-with-content-row",style:{display:"flex",alignItems:"center",gap:St},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(Ze,{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:St,paddingInlineStart:u.GUTTER},children:h})]})}function zo(e,t){return e!==void 0?e:t===void 0?"off":"polite"}function Ue(e,t){const s=zo(e,t);return s==="off"?{"aria-busy":t}:{"aria-live":s,"aria-atomic":!0,"aria-busy":t}}const Ft=4,Tr="(hover: none)";function zr(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e)}function Rr(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=Ue(a,i),{hovered:v,ref:z}=X.useHover(),T=X.useMediaQuery(Tr)??!1,[C,R]=r.useState(!1),I=r.useId(),w=C||(x??(v||T)),P=l!==void 0||c!==void 0,j=zr(t),L=s!==void 0&&s!==j,D=s??j,U=P&&t!==void 0,B=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;_e(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=>{R(!0),h==null||h(S)},$=S=>{S.currentTarget.contains(S.relatedTarget)||R(!1),m==null||m(S)},A=S=>{f||p==null||p(S,it(S))},H={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={...H,alignSelf:"stretch",lineHeight:`${u.ROW_PITCH}px`,textAlign:"start",borderRadius:"var(--mantine-radius-sm)"};return n.jsxs(o.Box,{ref:z,"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:H,children:B}):n.jsx(o.UnstyledButton,{type:"button",id:I,"data-testid":"action-row-state",title:D,...b,onClick:A,style:y,children:B})),P&&n.jsxs(o.Box,{"data-testid":"action-row-affordances",style:{flex:"0 0 auto",marginInlineStart:"auto",display:"flex",alignItems:"center",gap:Ft},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:Ft,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:Ft},children:c})]})]})}const Ro=u.GUTTER,Pr=12,Po=1.2,Ar=20,jr=500,Lr="var(--mantine-primary-color-light)";function _r({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(),z=c!==void 0,T=s!=null,C=t!=null,R=ut(m),I=a==="option",w=I?i:void 0,P=!I&&i?!0:void 0,j=B=>{c==null||c(B,it(B))};let L="transparent";i?L=Lr:z&&b&&(L=g.SURFACE);const D=n.jsxs(n.Fragment,{children:[T&&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:z?"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:Ro,borderRadius:"var(--mantine-radius-sm)",background:L,color:g.VALUE,fontSize:Pr,lineHeight:Po},children:[z?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}),R&&n.jsx(Ce,{children:m})]})}function Or({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=Je(),p=a!==void 0,h=c!=="none",m=z=>{x(c==="ascending"?"descending":"ascending",z)},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(an,{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(ie,{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:Ar,paddingInline:Ro,fontSize:"var(--mantine-font-size-sm)",lineHeight:Po,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 an({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:jr,textTransform:"none",letterSpacing:"normal"},children:e})}const Bn=2,Hr=1,Nr=13,Dr=2,kr=1,Mr=1,Gr=64,Ao=4,Fn=Ao/2,jo=4,Br=12,qe=100,Fr=1.5,Kt=100;function zt({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 Lo(){return n.jsx(o.Box,{"data-testid":"chart-baseline",style:{flex:"0 0 auto",height:Hr,background:g.BORDER}})}function _o({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 Vr(e,t){if(e.length===0)return null;const s=qe/2;if(e.length===1)return`0,${s} ${qe},${s}`;const i=Math.min(...e),l=Math.max(...e)-i,c=e.length-1;return e.map((x,f)=>{const p=xs(f/c,qe,t),h=l===0?s:qe-(x-i)/l*qe;return`${p},${h}`}).join(" ")}function Oo(){const e=r.useId(),t=`${e}min`,s=`${e}max`;return{min:t,max:s,describedBy:`${t} ${s}`}}function Ur({bins:e,label:t,minLabel:s,maxLabel:i,busy:a,live:l,trailing:c}){const x=Je(),f=Oo(),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",...Ue(l,a),style:{flex:"1 1 auto",minWidth:0,height:"100%",display:"flex",flexDirection:"column",gap:Bn},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:Bn},children:[n.jsx(o.Box,{"data-testid":"histogram-plot",style:{flex:"1 1 auto",minHeight:0,display:"flex",alignItems:"flex-end",gap:Dr},children:e.map((m,b)=>{const v=Math.max(0,m.count),z=p===0?0:v/p*Kt,T=m.highlighted===!0;return n.jsx(o.Box,{"data-testid":"histogram-bar","data-highlighted":T?"true":"false","aria-hidden":"true",title:m.label,style:{flex:"1 1 0",minWidth:0,height:`${String(z)}%`,minHeight:v>0?Mr:0,background:T?g.ACCENT:g.BORDER,borderRadius:kr}},`${m.label}-${String(b)}`)})}),n.jsx(Lo,{})]}),n.jsxs(o.Box,{"data-testid":"chart-axis",style:{flex:"0 0 auto",height:Nr,display:"flex",alignItems:"center",justifyContent:"space-between",gap:jo},children:[n.jsx(zt,{end:"min",id:f.min,children:s}),n.jsx(zt,{end:"max",id:f.max,children:i})]})]}),n.jsx(_o,{caption:t,rows:h,testId:"histogram-values"}),ut(c)&&n.jsx(Ce,{children:c})]})}function $r({values:e,label:t,minLabel:s,maxLabel:i,busy:a,live:l,trailing:c}){const x=Oe(),f=Je(),p=Oo(),h=Vr(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",...Ue(l,a),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:jo},children:[n.jsx(zt,{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(qe)} ${String(qe)}`,preserveAspectRatio:"none",fill:"none",stroke:"currentColor",strokeWidth:Fr,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(Lo,{})]}),n.jsx(zt,{end:"max",id:p.max,children:i})]}),n.jsx(_o,{caption:t,rows:m,testId:"sparkline-values"}),ut(c)&&n.jsx(Ce,{children:c})]})}function Wr({name:e,percentile:t,value:s,rank:i,busy:a,live:l,onClick:c,onDoubleClick:x,onContextMenu:f,onFocus:p,onBlur:h}){const m=oe(),b=uo(),v=r.useId(),z=c,T=z!==void 0,C=Math.min(Kt,Math.max(0,t)),R=m.percentile(b(Math.round(C))),I=P=>{z!==void 0&&z(P,it(P))},w=P=>{z!==void 0&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),z(P,it(P)))};return n.jsxs(o.Box,{"data-testid":"metric-row",role:T?"button":void 0,tabIndex:T?0:void 0,...Ue(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:T?"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:Br,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":Kt,"aria-valuenow":C,"aria-valuetext":R,title:R,size:Ao,style:{flex:`0 0 ${String(Gr)}px`,borderRadius:Fn,background:g.SURFACE},children:n.jsx(o.Progress.Section,{"data-testid":"metric-row-fill",value:C,withAria:!1,color:g.ACCENT,style:{borderRadius:Fn}})}),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(an,{children:i})]})}const Ho=r.createContext(!1);function No({showLabels:e=!1,children:t}){return n.jsx(Ho.Provider,{value:e,children:t})}function pt(){return r.useContext(Ho)}const Yr=u.VALUE_INSET-u.GLYPH_SLOT,Xr=2,Kr=1,qr=2,Zr=3;function Jr(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 Qr({segment:e,grow:t,index:s}){const{glyph:i,value:a,unit:l,mono:c=!1}=e;let x=null;Jt(i)?x=n.jsx(Ze,{name:i}):Qt(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=Jr(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:Yr},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:Xr,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME},children:l})]})}function ea(e,t){if(!(t>=qr&&t<=Zr))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 ta(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 na({label:e,segments:t,width:s=u.BODY,trailing:i,busy:a,live:l,onClick:c,onFocus:x,onBlur:f}){const p=pt(),h=r.useId(),m=t.filter(L=>L.grow===!0).length;_e(ea(e,t.length)),_e(ta(e,m));const b=t.findIndex(L=>L.grow===!0),v=b===-1?0:b,z=c!==void 0,T=zo(l,a)!=="off",C=z||T,R=z?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:z?"pointer":void 0},j=n.jsxs(n.Fragment,{children:[C&&n.jsx(o.VisuallyHidden,{id:R,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:Kr,height:u.CONTROL_HEIGHT,background:g.PANEL}}),n.jsx(Qr,{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}),z?n.jsx(o.UnstyledButton,{type:"button",title:e,"data-testid":"compound-row-box","data-interactive":"true",...Ue(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",...Ue(l,a),onFocus:x,onBlur:f,style:P,children:j}),n.jsx(Ce,{children:i})]})}const Vt=u.VALUE_INSET-u.GLYPH_SLOT,It=4,Vn=4,oa=u.VALUE_INSET+u.LABEL_COLUMN,Un={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},Do=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:z,pending:T=!1,min:C,max:R,step:I,onScrubStart:w,onScrub:P,onScrubEnd:j,onClick:L,disabled:D=!1,readOnly:U,boundDescription:B,pendingDescription:N,title:$,style:A,className:H,onKeyDown:y,...S}=t,O=pt(),k=oe(),K=Oe(),Se=X.useMediaQuery("(pointer: coarse)"),[be,se]=X.useUncontrolled({value:c===null?"":c,defaultValue:x,finalValue:"",onChange:f}),q=l??(p!==void 0?"select":"text"),te=q==="select",F=q==="select"&&p!==void 0,J=U??(f===void 0&&x===void 0),Z=String(be),Ie=z===!0,he=v||Ie;let W;v?W=k.mixed:Ie?W=Z:typeof z=="string"&&(W=z);const ce=[];v&&ce.push(k.mixed);const He=B??k.fieldBound,We=N??k.fieldPending;b&&He!==""&&ce.push(He),T&&We!==""&&ce.push(We);const Pe=ce.length>0?ce.join(". "):void 0,ae=(w!==void 0||P!==void 0||j!==void 0)&&!D&&!Se,Ne=r.useRef(!1),ge=r.useRef(!1),Ae=r.useRef(0),Ee=M=>{if(!ae||M.button!==0)return;M.preventDefault(),M.stopPropagation();const ee=M.currentTarget;typeof ee.setPointerCapture=="function"&&ee.setPointerCapture(M.pointerId),Ne.current=!0,ge.current=!1,Ae.current=M.clientX},De=M=>{if(!Ne.current)return;const ee=M.clientX-Ae.current;ee!==0&&(Ae.current=M.clientX,ge.current||(ge.current=!0,w==null||w(M)),P==null||P(xe(K)?-ee:ee,M))},ke=M=>{Ne.current&&(Ne.current=!1,ge.current&&(ge.current=!1,j==null||j(M)))},Qe=M=>{D||L==null||L(M)},xt=M=>{y==null||y(M),!(L===void 0||D||M.defaultPrevented)&&(F||(M.key==="Enter"||M.key===" "&&J)&&(M.preventDefault(),L(M)))},et=(M,ee)=>{se(M,ee)};let Me=null;Jt(a)?Me=n.jsx(Ze,{name:a,filled:b}):Qt(a)?Me=n.jsx(o.Box,{component:"span","data-letter":a,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:a}):a!=null&&(Me=a);const Ge=n.jsxs(n.Fragment,{children:[n.jsxs(o.Box,{"data-testid":"panel-field-slot","data-scrub":ae?"true":void 0,onPointerDown:ae?Ee:void 0,onPointerMove:ae?De:void 0,onPointerUp:ae?ke:void 0,onPointerCancel:ae?ke:void 0,onLostPointerCapture:ae?ke: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:ae?"ew-resize":void 0,touchAction:ae?"none":void 0},children:[Me,T&&n.jsx(o.Box,{"data-testid":"panel-field-pending",style:{position:"absolute",insetInlineStart:0,bottom:0,width:Vn,height:Vn,background:g.ACCENT}})]}),O&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-label","aria-hidden":"true",style:{flex:"1 1 auto",minWidth:0,marginInlineStart:It,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i})]}),Te=h!==void 0,Y=Te||te?n.jsxs(n.Fragment,{children:[Te&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-unit",style:{flex:"0 0 auto",lineHeight:1},children:h}),te&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-chevron",style:{flex:"0 0 auto",display:"flex",alignItems:"center",marginInlineStart:Te?It:0},children:n.jsx(ie,{name:"chevronDown",size:u.GLYPH})})]}):void 0;let re=Vt+It;te&&(re+=u.GLYPH),te&&Te&&(re+=It);const ne=Y===void 0?void 0:`calc(${String((h==null?void 0:h.length)??0)}ch + ${String(re)}px)`,ye=ae?"auto":"none",ue={"data-testid":"panel-field-value",...S,ref:s,className:H,label:i,description:Pe,placeholder:W,disabled:D,readOnly:J,onClick:Qe,onKeyDown:xt,leftSection:Ge,leftSectionWidth:O?oa:u.VALUE_INSET,leftSectionPointerEvents:ye,leftSectionProps:{style:{insetInlineStart:0,justifyContent:"flex-start",paddingInlineStart:Vt}},rightSection:Y,rightSectionWidth:ne,rightSectionPointerEvents:"none",rightSectionProps:{style:{insetInlineEnd:0,justifyContent:"flex-end",paddingInlineEnd:Vt,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:Un,description:Un},wrapperProps:{title:$??i,"data-testid":"panel-field","data-kind":q,"data-bound":b?"true":void 0,"data-mixed":v?"true":void 0,"data-pending":T?"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 q==="number"?n.jsx(o.NumberInput,{...ue,value:he?"":be,onChange:et,min:C,max:R,step:I,hideControls:!0}):F?n.jsx(o.Select,{...ue,data:p,value:he||Z===""?null:Z,onChange:M=>{et(M??"")}}):n.jsx(o.TextInput,{...ue,value:he?"":Z,onChange:M=>{et(M.currentTarget.value,M)}})}),ia=2,sa=u.BODY+u.TRAIL_GAP;function ra(e){return r.Children.toArray(e).flatMap(t=>r.isValidElement(t)&&t.type===r.Fragment?r.Children.toArray(t.props.children):[t])}function $n(e,t){return r.isValidElement(e)&&e.key!==null?e.key:`field-row-${String(t)}`}function aa(e){if(r.isValidElement(e)&&typeof e.props.label=="string")return e.props.label}function Wn(e){return r.isValidElement(e)&&e.type===Do?r.cloneElement(e,{width:"fill"}):e}const la=r.forwardRef(function({children:t,trailing:s,groupLabel:i,role:a,style:l,"aria-label":c,"aria-labelledby":x,...f},p){const h=pt(),m=ra(t),b=m.length;_e(b===0||b>ia?`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,T=a??(v!==void 0||x!==void 0?"group":void 0),C=ut(s);if(h&&b>1)return n.jsx(o.Box,{ref:p,"data-testid":"field-row-labelled","data-fields":b,role:T,"aria-label":v,"aria-labelledby":x,...f,style:{display:"flex",flexDirection:"column",...l},children:m.map((j,L)=>{const D=aa(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(No,{showLabels:!1,children:Wn(j)})}),n.jsx(Ce,{children:L===0?s:null})]},$n(j,L))})});const R=b<=1,I=R&&!C;let w=u.FIELD;R&&(w=I?sa: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:T,"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:Wn(j)},$n(j,L))),n.jsx(Ce,{children:s})]})}),ca=2,da=6,ko=1,ua=u.CONTROL_HEIGHT-ko*2,pa=2,Yn=3,fa=4,xa=6,ha=u.GLYPH,ga=3;function ma(e,t){return t?g.DISABLED:e?g.ON_SELECTED:g.CHROME}function ba(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:z}=e,T=pt(),C=t.length,R=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);_e(C<ca||C>da?`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<=ga?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()},B=t.map(N=>{const $=N.value===w,A=f||N.disabled===!0,H=T||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:H?fa:0,paddingInline:H?xa:0,width:"100%",minWidth:0,color:ma($,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}),H?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:R.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:B,value:w,onChange:N=>{const $=j.current;j.current=void 0,P(N,$)},onChangeCapture:N=>{j.current=N},onKeyDown:U,onFocus:v,onBlur:z,name:x,disabled:f,radius:"sm","aria-label":l,"aria-labelledby":c,"aria-describedby":R.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:ko,gap:pa,backgroundColor:g.SURFACE,overflow:"visible"},control:{flex:"1 1 auto",minWidth:ha},label:{display:"flex",alignItems:"center",justifyContent:"center",height:ua,padding:0,borderRadius:Yn,fontSize:"var(--mantine-font-size-sm)"},innerLabel:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minWidth:0},indicator:{backgroundColor:g.SELECTED,borderRadius:Yn,boxShadow:"none"}}}),R.description!==void 0&&n.jsx(o.VisuallyHidden,{id:R.describedBy,children:R.description}),n.jsx(Ce,{children:b})]})}const ya=12,va=1.5,Xn=1.4,Kn=4,wa=20,qn=220,Zn=2,Jn=new RegExp("\\p{Sentence_Terminal}","u"),Sa=/[.!?]/u,Qn=/\s/u;function Ia(e){const t=Array.from(e);let s=0,i=0,a=0;for(;i<t.length;){if(!Jn.test(t[i])){i+=1;continue}let c=i;for(;c+1<t.length&&Jn.test(t[c+1]);)c+=1;const x=t[c+1],f=Sa.test(t[c]);i=c+1,(!f||x===void 0||Qn.test(x))&&(s+=1,a=i)}return t.slice(a).some(c=>!Qn.test(c))?s+1:s}function Ea(e){return Array.from(e).length}function Ca(e,t){if(e!=="reading"||typeof t!="string")return;const s=Ea(t);if(s>qn)return`ProseBlock was given a reading of ${String(s)} characters, and a reading is at most ${String(qn)} characters. Shorten it, or it has stopped being a reading and become an explanation.`;const i=Ia(t);if(i>Zn)return`ProseBlock was given a reading of ${String(i)} sentences, and a reading is at most ${String(Zn)} sentences. Delete any sentence that repeats what is already on screen, and move the rest into an InfoCircle.`}function Ta(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 za({variant:e,children:t,onDetails:s,busy:i,live:a}){const l=oe(),c=Oe(),x=r.useId();_e(Ca(e,t)),_e(Ta(e,s));const f=Ue(a,i);if(e==="reading")return n.jsx(o.Text,{...f,"data-testid":"prose-block","data-variant":e,style:{fontSize:ya,lineHeight:va,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:Kn},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(ie,{name:"warning",size:u.GLYPH})}),n.jsx(o.Text,{span:!0,size:"sm","data-testid":"prose-block-text",style:{lineHeight:Xn,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:Kn,blockSize:wa},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:Xn,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(ie,{name:xe(c)?"chevronLeft":"chevronRight",size:u.CHEVRON})})]})}const Ut=4,Ra=4,Pa=`polygon(0 calc(100% - ${Ra}px), 100% 0, 100% 100%, 0 100%)`,Aa=120,ja=`linear-gradient(to right, ${g.SURFACE}, ${g.ACCENT})`,La={sqrt:"scaleSqrt",linear:"scaleLinear",log:"scaleLog"},eo={flex:"0 0 auto",lineHeight:1,color:g.CHROME,whiteSpace:"nowrap"};function _a({min:e,max:t,label:s,variant:i="size",gradient:a,scale:l,busy:c,live:x,onScaleClick:f,trailing:p}){const h=oe(),m=Oe(),b=r.useId(),v=i==="color",z=l===void 0?void 0:La[l],T=z===void 0?void 0:h[z],C=`${b}-label`,R=`${b}-min`,I=`${b}-max`,w=`${b}-scale`,P=[s===void 0?void 0:C,R,I,T===void 0?void 0:w].filter(D=>D!==void 0);let j=null;z!==void 0&&T!==void 0&&(f===void 0?j=n.jsx(o.Box,{"data-testid":"ramp-row-scale","aria-hidden":"true",title:T,style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},children:n.jsx(Ze,{name:z})}):j=n.jsx(Co,{label:T,icon:n.jsx(Ze,{name:z}),onClick:f}));const L=ut(p)?p:j;return n.jsxs(o.Box,{"data-testid":"ramp-row","data-variant":i,"data-scale":l,style:{display:"flex",alignItems:"center",gap:Ut,height:u.ROW_PITCH},children:[n.jsxs(o.Box,{"data-testid":"ramp-row-figure",role:"img","aria-labelledby":P.join(" "),...Ue(x,c),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:Ut},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:R,"data-testid":"ramp-row-min",style:eo,children:e}),n.jsx(o.Box,{"data-testid":"ramp-row-ramp","data-variant":i,"aria-hidden":"true",style:{flex:"1 1 auto",minWidth:Aa,height:u.GLYPH,boxSizing:"border-box",background:v?a??ja:g.CHROME,borderRadius:v?"var(--mantine-radius-xs)":void 0,border:v?`1px solid ${g.BORDER}`:void 0,clipPath:v?void 0:Pa,...hs(m)}}),n.jsx(o.Text,{span:!0,size:"sm",id:I,"data-testid":"ramp-row-max",style:eo,children:t}),T!==void 0&&n.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-scale",id:w,children:T})]}),n.jsx(o.Box,{style:{flex:"0 0 auto",display:"flex",marginInlineStart:u.TRAIL_GAP-Ut},children:n.jsx(Ce,{children:L})})]})}const Oa=4,Ha=`${String(u.TOGGLE_PITCH)}px`,Na=2;function Da({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=oe(),[v,z]=X.useUncontrolled({value:t,defaultValue:s,finalValue:!1,onChange:i}),T=j=>{z(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:Oa,fontSize:"var(--mantine-font-size-sm)",lineHeight:Ha,color:c?g.DISABLED:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},R=p??b.fieldBound,I=st({name:e,enabledTitle:e,disabled:c,disabledReason:x,extraDescriptions:f?[R]: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(Ze,{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:T,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:T,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(Ce,{children:l})]})}function ka({children:e,label:t,labelledBy:s}){const i=r.Children.toArray(e).length;return _e(i<Na?`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 Ma(e="dark"){return o.useComputedColorScheme(e)}const Ga={xs:o.rem(4),sm:o.rem(8),md:o.rem(16),lg:o.rem(24),xl:o.rem(32)},Ba={HEIGHT:24,FONT_SIZE:11,CONTROL_PADDING:8,SECTION_GAP:4};exports.ActionRow=Rr;exports.AdvancedButton=Co;exports.COMPACT_SIZING=Ba;exports.CompactColorInput=Io;exports.CompoundRow=na;exports.ControlGroup=Hs;exports.ControlSection=Bs;exports.ControlSubGroup=Us;exports.DEFAULT_GRADIENT_STOP_COLOR=Et;exports.DataRow=_r;exports.DataRowHeader=Or;exports.DataTable=ar;exports.FIELD_GLYPH_NAMES=ho;exports.FIELD_LETTERS=go;exports.FieldGlyph=Ze;exports.FieldRow=la;exports.GradientEditor=hr;exports.HistogramRow=Ur;exports.IconGroupRow=ba;exports.InfoCircle=Eo;exports.LabelsProvider=vi;exports.MANTINE_SPACING=Ga;exports.MAX_ALPHA_HEX=en;exports.MAX_OPACITY_PERCENT=tn;exports.MetricRow=Wr;exports.PANEL_GRID=u;exports.PANEL_INK=g;exports.POPOUT_GAP=io;exports.POPOUT_NESTED_GAP=so;exports.POPOUT_Z_INDEX_BASE=$t;exports.PanelField=Do;exports.PanelLabelsProvider=No;exports.Popout=Ve;exports.PopoutButton=Es;exports.PopoutManager=So;exports.PopoutRegion=as;exports.ProseBlock=za;exports.RampRow=_a;exports.RankChip=an;exports.SWATCH_COLORS_HEXA=xo;exports.SparklineRow=$r;exports.StyleNumberInput=vr;exports.StyleSelect=Ir;exports.ToggleRow=Da;exports.ToggleRowGroup=ka;exports.ToggleWithContent=Cr;exports.TrailingSlot=Ce;exports.UI_GLYPH_NAMES=Xi;exports.UiGlyph=ie;exports.compactColors=no;exports.compactDarkColors=to;exports.compactTheme=Yi;exports.compactThemeOverride=fo;exports.createColorStop=Tt;exports.createDefaultGradientStops=To;exports.defaultLabels=lo;exports.getActivationMeta=it;exports.isFieldGlyphName=Jt;exports.isFieldLetter=Qt;exports.isRtl=xe;exports.isValidHex=Qi;exports.opacityToAlphaHex=on;exports.parseAlphaFromHexa=nn;exports.parseHexaColor=Zi;exports.parseLocaleNumber=co;exports.toHexaColor=Ji;exports.useActualColorScheme=Ma;exports.useCollator=po;exports.useDirection=Oe;exports.useLabels=oe;exports.useLocale=$e;exports.useNumberFormatter=Je;exports.useNumberParser=Zt;exports.useOrdinalFormatter=uo;exports.usePanelLabels=pt;exports.usePopoutManager=ds;exports.usePopoutRegion=vo;