@epam/ai-dial-ui-kit 0.15.2 → 0.15.4
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/README.md +1 -0
- package/dist/CHANGELOG.md +4 -0
- package/dist/{DateCellRenderer-C7yExfh5.cjs → DateCellRenderer-C80QWn2I.cjs} +1 -1
- package/dist/{DateCellRenderer-ElULb0hY.cjs → DateCellRenderer-CfQgxeAQ.cjs} +1 -1
- package/dist/components/New/BottomSheet/BottomSheet.js +49 -48
- package/dist/components-manifest.json +3 -3
- package/dist/constants/public-class-names.js +5 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/file-manager.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/src/constants/public-class-names.d.ts +5 -0
- package/dist/{use-file-manager-tabs-Bgh8mfOJ.cjs → use-file-manager-tabs-BpaJ5_zh.cjs} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -290,6 +290,7 @@ breaking change and goes through the migration-guide process.
|
|
|
290
290
|
| `resizableContainer` | `dial-kit-resizable-container` | The content box inside a `ResizableContainer`'s resize frame |
|
|
291
291
|
| `popup` | `dial-kit-popup` | The `role="dialog"` panel of a `Popup` |
|
|
292
292
|
| `bottomSheet` | `dial-kit-bottom-sheet` | The `role="dialog"` panel of a `BottomSheet` |
|
|
293
|
+
| `bottomSheetOverlay` | `dial-kit-bottom-sheet-overlay` | The backdrop of a `BottomSheet`, which holds the panel |
|
|
293
294
|
| `sideDrawer` | `dial-kit-side-drawer` | The `role="dialog"` panel of a `SideDrawer`, open or closed |
|
|
294
295
|
| `confirmationPopup` | `dial-kit-confirmation-popup` | A `ConfirmationPopup`'s panel, additive to `popup` |
|
|
295
296
|
| `accordion` | `dial-kit-accordion` | The root of an `Accordion` |
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,8 @@ Versions match the git tags on the `development` branch.
|
|
|
19
19
|
|
|
20
20
|
### Added
|
|
21
21
|
|
|
22
|
+
- **`BottomSheet` (2.0) — public class on the backdrop, `dial-kit-bottom-sheet-overlay`** — the panel carried `dial-kit-bottom-sheet`, but the backdrop that holds it had no stable class, so a host that embeds a sheet in its own floating panel and has to lift the whole sheet above that panel's stacking context fell back to `[class*='_backdrop_']` selectors on the hashed module class a wrapping library passes through `overlayClassName`. The backdrop now carries `dial-kit-bottom-sheet-overlay` (`DIAL_KIT_CLASS.bottomSheetOverlay`), after any `overlayClassName`. The class has no declarations, so nothing renders differently. Where the stacking context can be avoided altogether, `portalId` still renders the sheet inside the host's own element. Requested in [ai-dial-chat#9392](https://github.com/epam/ai-dial-chat/issues/9392).
|
|
23
|
+
|
|
22
24
|
- **`InteractiveTooltip` (2.0) — `trigger`, to open the panel by click or tap** — the panel opens on hover or focus and renders nothing on a mobile screen, so a trigger whose only job is to reveal it, such as an info chip, showed nothing on a phone ([ai-dial-chat#9250](https://github.com/epam/ai-dial-chat/issues/9250)). `trigger={InteractiveTooltipTrigger.Click}` opens the panel on a click or tap and keeps it open until a second click on the trigger, a press outside or Escape. It works on every screen size and ignores hover and focus; with a controlled `open` it still reports through `onOpenChange`. The default, `InteractiveTooltipTrigger.Hover`, changes nothing, so the `InteractiveTooltip`s inside `Select` and `Dropdown` and every host that does not pass it are unchanged. Do not use `Click` on a trigger that has its own action, since the same tap would run both. Additive.
|
|
23
25
|
|
|
24
26
|
- **`AutocompleteTagInput` (2.0) — `openOnFocus`** — focusing or clicking the input opens the list of every suggestion that is not yet a tag, uncapped by `maxSuggestions`, so a short list can be browsed without typing. Nothing is highlighted in that list, so Enter adds nothing the user did not choose; ArrowDown lands on the first suggestion and ArrowUp on the last. The list stays open after a pick, and typing filters and caps it as before. Opt-in; without it nothing changes. Additive.
|
|
@@ -85,6 +87,8 @@ Versions match the git tags on the `development` branch.
|
|
|
85
87
|
|
|
86
88
|
### Fixed
|
|
87
89
|
|
|
90
|
+
- **`MarkdownEditor` (2.0) — toolbar no longer overflows on narrow cards** — on a phone-width card the formatting group did not wrap, so its last buttons ran past the card edge and the edit/preview/fullscreen group dropped onto a second line at the start. The formatting group now wraps inside the card and the mode group stays at the inline end. Wide toolbars are unchanged ([ai-dial-chat#9389](https://github.com/epam/ai-dial-chat/issues/9389)).
|
|
91
|
+
|
|
88
92
|
- **`Textarea` (2.0) — `invalid` no longer reaches the DOM** — the prop was spread onto the `<textarea>`, so React warned about a non-boolean `invalid` attribute on every render. It now only selects the error styling. No visual change.
|
|
89
93
|
|
|
90
94
|
- **`Dropdown` and `Select` — a submenu closes when its menu or the page scrolls** — a submenu is portalled and repositioned by Floating UI's `autoUpdate`, so scrolling the list that holds its trigger, or the page, left the submenu open and dragged it along after the trigger, even once the trigger had scrolled out of the clipped list. The submenu now closes when an ancestor of its trigger scrolls. Scrolling inside the submenu does not close it. The fix is in the shared submenu hook, so it covers the 2.0 and 1.0 `Dropdown` and `Select` submenus. Reported in [ai-dial-chat#9295](https://github.com/epam/ai-dial-chat/issues/9295), on the catalog's Create menu.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),g=require("./DateCellRenderer-ElULb0hY.cjs"),X=require("@tabler/icons-react"),o=require("react"),h=require("./merge-classes-BEJXjzkx.cjs"),C=require("@floating-ui/react"),be=require("./icon-DhjrDQ8I.cjs"),ae=require("./icon-CrGVkVpG.cjs"),p=require("./IconButton-DHOFapLo.cjs"),xt=require("classnames");function bt(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(s,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return s.default=e,Object.freeze(s)}const me=bt(o);var Se=(e=>(e.Top="top",e.Right="right",e.Bottom="bottom",e.Left="left",e))(Se||{}),Ce=(e=>(e.Hover="hover",e.Click="click",e))(Ce||{});const St=7,It=2,Nt=500,vt="fill-control-inverted",Et="z-tooltip max-w-[376px] whitespace-pre-wrap break-words rounded-lg bg-control-inverted px-3 py-2 dial-small-text text-control-inverted shadow-xs",Ue=o.createContext(null),$e=()=>{const e=o.useContext(Ue);if(e==null)throw new Error("Tooltip components must be wrapped in <TooltipContainer />");return e},yt=({initialOpen:e=!1,placement:s=Se.Bottom,isTriggerClickable:n=!1,open:r,onOpenChange:i}={})=>{const[d,l]=o.useState(e),u=o.useRef(null),m=r??d,x=i??l,S=C.useFloating({placement:s,open:m,onOpenChange:x,whileElementsMounted:C.autoUpdate,middleware:[C.offset(St+It),C.flip({fallbackAxisSideDirection:"start",padding:5}),C.shift({padding:5}),C.arrow({element:u})]}),f=C.useHover(S.context,{move:!1,enabled:r==null,mouseOnly:n,delay:{open:Nt,close:0}}),I=C.useFocus(S.context,{enabled:r==null}),y=C.useDismiss(S.context),_=C.useRole(S.context,{role:"tooltip"}),L=C.useInteractions([f,I,y,_]);return o.useEffect(()=>{if(!m)return;const k=S.refs.reference.current;if(!(k instanceof Element))return;const w=new IntersectionObserver(([j])=>{j.isIntersecting||x(!1)},{root:null,threshold:0});return w.observe(k),()=>w.disconnect()},[m,S.refs.reference,x]),o.useMemo(()=>({open:m,setOpen:x,arrowRef:u,...L,...S}),[m,x,L,S])},we=({children:e,...s})=>{const n=yt(s);return t.jsx(Ue.Provider,{value:n,children:e})},Re=({style:e,...s})=>{const n=$e(),r=p.useHasHover(),i=g.useThemeScope(),d=o.useRef(null),l=C.useMergeRefs([n.refs.setFloating,d]);return!n.open||!r?null:t.jsx(C.FloatingPortal,{id:"tooltip-portal",children:t.jsxs("div",{ref:l,"data-placement":n.placement,style:{...n.floatingStyles,...e},...n.getFloatingProps(s),className:xt(Et,i,n.getFloatingProps(s).className,g.DIAL_KIT_CLASS.tooltip),children:[s.children,t.jsx(C.FloatingArrow,{ref:n.arrowRef,context:n.context,className:vt})]})})},De=({children:e,asChild:s=!1,...n})=>{const r=$e(),i=s&&o.isValidElement(e),d=i?e.props?.ref:null,l=C.useMergeRefs([r.refs.setReference,...d?[d]:[]]);if(i){const u=e.props;return o.cloneElement(e,r.getReferenceProps({...u,...n,className:h.mergeClasses(u.className,n.className)||void 0,ref:l}))}return t.jsx("span",{ref:l,...r.getReferenceProps(n),className:n.className??"text-start",children:e})},qe=({hideTooltip:e=!1,tooltip:s,children:n,asChild:r=!1,triggerClassName:i,contentClassName:d,...l})=>{const u=!e&&!!s;return t.jsxs(we,{...l,children:[t.jsx(De,{asChild:r,className:i,children:n}),u&&t.jsx(Re,{className:d,children:s})]})},Pe={[p.ButtonVariant.Primary]:{[p.ButtonAppearance.Solid]:"dial-kit-primary-solid-button",[p.ButtonAppearance.Ghost]:"dial-kit-primary-ghost-button",[p.ButtonAppearance.Link]:"dial-kit-primary-link-button"},[p.ButtonVariant.Neutral]:{[p.ButtonAppearance.Solid]:"dial-kit-neutral-solid-button",[p.ButtonAppearance.Outlined]:"dial-kit-neutral-outlined-button"},[p.ButtonVariant.Danger]:{[p.ButtonAppearance.Solid]:"dial-kit-danger-solid-button",[p.ButtonAppearance.Ghost]:"dial-kit-danger-ghost-button",[p.ButtonAppearance.Outlined]:"dial-kit-danger-outlined-button"},[p.ButtonVariant.Static]:{[p.ButtonAppearance.Solid]:"dial-kit-static-solid-button"},[p.ButtonVariant.Starter]:{[p.ButtonAppearance.Outlined]:"dial-kit-starter-outlined-button"},[p.ButtonVariant.Success]:{},[p.ButtonVariant.Secondary]:{},[p.ButtonVariant.Tertiary]:{}},kt=e=>{e.preventDefault()},Xe=(e,s,n)=>{const r=s!=null&&!s.hideTooltip&&s.tooltip!=null&&s.tooltip!=="";return e&&r?{disabled:void 0,"aria-disabled":!0,onClick:kt}:{disabled:e,onClick:n}},Ye=(e=p.ButtonVariant.Primary,s=p.ButtonAppearance.Solid)=>{const n=Pe[e]?.[s];return n||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${s}. Using default primary solid button styles.`),Pe[p.ButtonVariant.Primary][p.ButtonAppearance.Solid])},Tt={[p.ElementSize.Small]:"size-[24px]",[p.ElementSize.Standard]:"size-[40px] dial-kit-enhanced-target",[p.ElementSize.Large]:"size-[48px] dial-kit-enhanced-target"},Ie=({variant:e,appearance:s=p.ButtonAppearance.Solid,size:n=p.ElementSize.Standard,className:r,icon:i,tooltipProps:d,type:l="button",disabled:u,...m})=>{const x=h.mergeClasses("dial-kit-base-icon-button dial-kit-base-button",e&&Ye(e,s),Tt[n],r),S=t.jsx("button",{...m,...Xe(u,d,m.onClick),type:l,className:x,"aria-label":p.resolveAccessibleName(m["aria-label"],d?.tooltip),children:i});return d?t.jsx(qe,{asChild:!0,...d,children:S}):S},Je=({caption:e,onClick:s,"aria-label":n})=>{if(!e)return null;const r=h.mergeClasses("text-secondary hover:text-control-accent-hover active:text-control-accent-active","focus-visible:outline focus-visible:outline-focus",g.DIAL_KIT_CLASS.infoButton);return t.jsx(Ie,{"aria-label":n,className:r,icon:t.jsx(X.IconInfoCircle,{size:ae.DIAL_ICON_SIZE.SM,stroke:be.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:s,size:p.ElementSize.Small,tooltipProps:{tooltip:e}})},je=({label:e,required:s,className:n,containerClassName:r,caption:i,size:d=p.ElementSize.Small,...l})=>e?t.jsxs("span",{className:h.mergeClasses("flex items-center gap-0.5",r,g.DIAL_KIT_CLASS.label),children:[t.jsxs("label",{...l,className:h.mergeClasses("text-secondary flex items-center gap-0.5",d===p.ElementSize.Small?"dial-tiny-semi-text":"dial-small-text",n),children:[typeof e=="string"?t.jsx("span",{className:"min-h-4",children:e}):e,s&&t.jsxs(t.Fragment,{children:[t.jsx("span",{"aria-hidden":"true",className:"text-error dial-tiny-text",children:"*"}),t.jsx("span",{className:"sr-only",children:"(required)"})]})]}),t.jsx(Je,{caption:i})]}):null;var D=(e=>(e.None="none",e.Check="check",e.Tint="tint",e.Checkbox="checkbox",e.Highlight="highlight",e))(D||{});const ze={size:14,stroke:3,"aria-hidden":!0},He=({isSelected:e=!1,isIndeterminate:s=!1,invalid:n=!1,disabled:r=!1,htmlFor:i,className:d})=>{const l=s||e,u=!!i,m=h.mergeClasses("grid size-[20px] shrink-0 place-items-center rounded border transition-colors duration-200",u&&"dial-kit-minimum-target",u&&"peer-focus-visible:outline peer-focus-visible:outline-focus",r?"border-transparent bg-control-disable-primary text-control-disable-primary":h.mergeClasses(n&&l&&"border-transparent bg-control-error text-control-permanent",n&&!l&&"border-error bg-control-neutral",!n&&l&&"border-transparent bg-control-accent text-control-permanent hover:bg-control-accent-hover",!n&&!l&&"border-default bg-control-neutral hover:border-accent hover:bg-control-accent-alpha-hover"),r?"cursor-not-allowed":u&&"cursor-pointer",d,g.DIAL_KIT_CLASS.checkboxBox),x=s?t.jsx(X.IconMinus,{...ze}):e&&t.jsx(X.IconCheck,{...ze});return u?t.jsx("label",{htmlFor:i,className:m,children:x}):t.jsx("span",{"aria-hidden":"true",className:m,children:x})},Be=({id:e,labelProps:s,isSelected:n=!1,isIndeterminate:r=!1,invalid:i=!1,disabled:d,onChange:l,caption:u,className:m,boxClassName:x,...S})=>{const f=o.useId(),I=e??f,y=u?`${I}-caption`:void 0,_=o.useCallback(k=>{l?.(k.target.checked)},[l]),L=o.useCallback(k=>{k&&(k.indeterminate=r)},[r]);return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:h.mergeClasses("flex items-center gap-2",m,g.DIAL_KIT_CLASS.checkbox),children:[t.jsx("input",{...S,ref:L,type:"checkbox",id:I,checked:n,disabled:d,onChange:_,"aria-checked":r?"mixed":n,"aria-invalid":i||void 0,"aria-label":p.resolveAccessibleName(typeof s?.label!="string"?S["aria-label"]:void 0),"aria-describedby":y,className:"peer sr-only"}),t.jsx(He,{htmlFor:I,isSelected:n,isIndeterminate:r,invalid:i,disabled:d,className:x}),s&&t.jsx(je,{size:p.ElementSize.Standard,...s,htmlFor:I,className:h.mergeClasses("py-[1px]",d?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",s.className)})]}),u&&t.jsx("span",{id:y,className:"dial-tiny-text text-secondary ml-[28px]",children:u})]})},At=8,_t=400,Lt="z-interactive-tooltip max-w-[320px] rounded-xl bg-layer-0 p-4 dial-small-text text-primary shadow-md",pe=({content:e,placement:s=Se.Right,children:n,asChild:r=!1,hideTooltip:i=!1,initialOpen:d=!1,trigger:l=Ce.Hover,open:u,onOpenChange:m,triggerClassName:x,contentClassName:S})=>{const f=g.useIsMobileScreen(),I=l===Ce.Click,y=g.useThemeScope(),[_,L]=o.useState(d),k=u??_,w=K=>{m?.(K),u==null&&L(K)},j=C.useFloatingNodeId(),{refs:H,floatingStyles:Y,context:T}=C.useFloating({nodeId:j,placement:s,open:k,onOpenChange:w,whileElementsMounted:C.autoUpdate,middleware:[C.offset(At),C.flip({padding:5}),C.shift({padding:5})]}),V=C.useHover(T,{enabled:u==null&&!I,handleClose:C.safePolygon(),delay:{open:_t,close:0}}),Z=C.useFocus(T,{enabled:u==null&&!I}),W=C.useClick(T,{enabled:I}),v=C.useDismiss(T),{getReferenceProps:J,getFloatingProps:ne}=C.useInteractions([V,Z,W,v]),se=o.useRef(null),G=C.useMergeRefs(o.useMemo(()=>[H.setFloating,se],[H.setFloating])),A=r&&o.isValidElement(n),M=A?n.props?.ref:null,O=C.useMergeRefs(o.useMemo(()=>[H.setReference,...M?[M]:[]],[H.setReference,M])),B=!i&&(I||!f)&&!!e,E=A?o.cloneElement(n,J({...n.props,ref:O,className:h.mergeClasses(n.props.className,x)||void 0})):t.jsx("span",{ref:O,...J(),className:x??"text-start",children:n});return t.jsxs(t.Fragment,{children:[E,k&&B&&t.jsx(C.FloatingPortal,{id:"interactive-tooltip-portal",children:t.jsx(C.FloatingFocusManager,{context:T,modal:!1,initialFocus:-1,returnFocus:!1,order:["reference","content"],children:t.jsx("div",{ref:G,"data-placement":T.placement,style:Y,...ne(),className:h.mergeClasses(Lt,y,S,g.DIAL_KIT_CLASS.interactiveTooltip),children:e})})})]})},Me="rounded-xl bg-layer-raised p-1 shadow-md",Oe="flex flex-col gap-0.5",Qe=h.mergeClasses(Me,"w-max"),et=h.mergeClasses(Qe,Oe,"py-2"),tt=h.mergeClasses("flex w-full shrink-0 cursor-pointer items-center gap-2 px-3 h-[40px] rounded-lg","dial-small-text text-primary truncate","hover:bg-control-accent-alpha-hover","focus-visible:outline focus-visible:outline-focus"),nt="bg-control-accent-alpha",wt=h.mergeClasses(nt,"text-accent"),Rt=h.mergeClasses("cursor-not-allowed text-control-disable-primary","bg-transparent hover:bg-transparent"),st=4,Dt=h.mergeClasses("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),jt=h.mergeClasses("z-floating focus-visible:outline-none",Me),Ht=Qe,Bt=et,Mt=h.mergeClasses(Oe,"py-1"),Ot="my-1 border-t border-tertiary",te=st,Ft=t.jsx(X.IconChevronRight,{size:ae.DIAL_ICON_SIZE.SM,stroke:be.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Fe=(e,s)=>({appearance:r,...i})=>t.jsx(Ie,{...i,variant:e,appearance:r||s}),rt=(e,s)=>({variant:r,...i})=>t.jsx(Ie,{...i,variant:r||s,appearance:e}),Vt=Fe(p.ButtonVariant.Primary,p.ButtonAppearance.Solid),Gt=Fe(p.ButtonVariant.Neutral,p.ButtonAppearance.Solid),Pt=Fe(p.ButtonVariant.Danger,p.ButtonAppearance.Ghost),ot=rt(p.ButtonAppearance.Ghost,p.ButtonVariant.Primary),zt=rt(p.ButtonAppearance.Solid,p.ButtonVariant.Static),at=({ariaLabel:e="Close",className:s,size:n=p.ElementSize.Small,onClose:r,...i})=>t.jsx(ot,{...i,size:n,"aria-label":e,className:h.mergeClasses(s,g.DIAL_KIT_CLASS.closeButton),onClick:r,icon:t.jsx(X.IconX,{size:n===p.ElementSize.Small?ae.DIAL_ICON_SIZE.SM:ae.DIAL_ICON_SIZE.MD,stroke:be.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),Zt=e=>{const s=o.useRef(null),[n,r]=o.useState(!1),[i,d]=o.useState(""),l=o.useRef(!1),u=o.useCallback(()=>{const x=s.current;x&&(l.current&&d(x.textContent??""),r(x.scrollWidth>x.clientWidth))},[]),m=o.useCallback(()=>g.scheduleMeasure(u),[u]);return o.useEffect(()=>{const x=s.current;if(x)return g.observeElementSize(x,u)},[u]),o.useEffect(()=>{l.current=typeof e!="string",m()},[e,m]),{ref:s,isTruncated:n,textContent:i,remeasure:m}},Ne=({text:e,className:s,contentClassName:n,hideTooltip:r=!1,id:i,customTooltipContent:d,...l})=>{const{ref:u,isTruncated:m,textContent:x,remeasure:S}=Zt(e),f=typeof e=="string"?e:x,I=o.useMemo(()=>r||!m?null:d??f,[d,f,r,m]);return t.jsxs(we,{...l,children:[t.jsx(De,{asChild:!0,onMouseEnter:S,onFocusCapture:S,children:t.jsx("span",{id:i,ref:u,"aria-label":m&&f?f:void 0,className:h.mergeClasses("block min-w-0 max-w-full flex-1 truncate text-start",s,g.DIAL_KIT_CLASS.ellipsisTooltip),children:e})}),!!I&&t.jsx(Re,{className:n,children:I})]})},Wt=t.jsx(X.IconCheck,{size:ae.DIAL_ICON_SIZE.SM,stroke:be.DIAL_KIT_ICON_STROKE,className:`shrink-0 ${g.DIAL_KIT_CLASS.menuItemCheck}`,"aria-hidden":!0}),ge=({label:e,icon:s,description:n,mark:r=D.None,selected:i=!1,danger:d=!1,trailing:l,rightControl:u,ellipsisLabel:m=!1,labelClassName:x,children:S,className:f,disabled:I=!1,type:y="button",..._})=>{const L=i&&r===D.Highlight,k=i&&(r===D.Checkbox||r===D.Tint),w=h.mergeClasses(d&&"text-error",I&&"text-control-disable-primary"),j=h.mergeClasses(tt,"aria-expanded:bg-control-accent-alpha-hover",L&&wt,k&&nt,I&&Rt,d&&"text-error",f,g.DIAL_KIT_CLASS.menuItem),H=t.jsxs("button",{type:y,disabled:I,"data-menu-item-row":u?"":void 0,className:u?"flex h-full min-w-0 flex-1 items-center gap-2 truncate text-start focus-visible:outline-none":j,..._,children:[S??t.jsxs(t.Fragment,{children:[r===D.Checkbox&&t.jsx(He,{isSelected:i,disabled:I}),s&&t.jsx(g.DialIcon,{icon:s,className:w}),m?t.jsx(Ne,{text:e,className:h.mergeClasses(w,x)}):t.jsx("span",{className:h.mergeClasses("min-w-0 flex-1 truncate text-start",w,x),children:e}),n&&t.jsx("span",{className:h.mergeClasses("shrink-0 text-secondary dial-small-text",I&&"text-control-disable-primary"),children:n}),i&&r===D.Check&&Wt]}),l&&t.jsx("span",{className:h.mergeClasses("ml-auto shrink-0",w),children:l})]});return u?t.jsxs("div",{role:"none",className:h.mergeClasses(j,"has-[[data-menu-item-row]:focus-visible]:outline","has-[[data-menu-item-row]:focus-visible]:outline-focus"),children:[H,u]}):H},he=e=>e.mark??(e.selectable?D.Checkbox:D.None),lt=e=>e.selectable?"menuitemcheckbox":he(e)===D.Check?"menuitemradio":"menuitem",Kt=({item:e,onRootClose:s})=>{const{isOpen:n,nodeId:r,refs:i,floatingStyles:d,context:l,getReferenceProps:u,getFloatingProps:m}=g.useSubMenuFloating(te,"menu",!!e.disabled),x=o.useCallback(f=>I=>{f.disabled||(f.onClick?.({key:f.key,domEvent:I}),f.selectable||s())},[s]),S=t.jsx(ge,{ref:i.setReference,role:"menuitem","aria-haspopup":"menu","aria-expanded":n,"aria-disabled":!!e.disabled,disabled:e.disabled,icon:e.icon,label:e.label,trailing:Ft,className:e.className,...u(),children:e.renderItem?.(e)});return t.jsxs(C.FloatingNode,{id:r,children:[e.interactiveTooltip?t.jsx(pe,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:S}):S,n&&t.jsx(g.SubMenuPanel,{refs:i,floatingStyles:d,context:l,getFloatingProps:m,role:"menu",surfaceClassName:e.renderSubMenu?Ht:Bt,children:e.renderSubMenu?e.renderSubMenu():t.jsxs(t.Fragment,{children:[e.menuHeader&&(typeof e.menuHeader=="function"?e.menuHeader():e.menuHeader),e.children.map(f=>{const I=lt(f),y=t.jsx(ge,{role:I,"aria-checked":I==="menuitem"?void 0:!!f.checked,"aria-current":he(f)===D.Highlight&&f.checked?!0:void 0,"aria-disabled":!!f.disabled,disabled:f.disabled,mark:he(f),selected:!!f.checked,danger:f.danger,icon:f.icon,label:f.label,className:f.className,rightControl:f.rightControl,onClick:x(f),children:f.renderItem?.(f)});return t.jsx(o.Fragment,{children:f.interactiveTooltip?t.jsx(pe,{asChild:!0,placement:f.interactiveTooltip.placement,content:f.interactiveTooltip.content,contentClassName:f.interactiveTooltip.contentClassName,children:y}):y},f.key)}),e.menuFooter&&(typeof e.menuFooter=="function"?e.menuFooter():e.menuFooter)]})})]})},Ut='[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"]',$t=e=>!e.hasAttribute("disabled")&&e.getAttribute("aria-disabled")!=="true",qt=["ArrowDown","ArrowUp","Home","End"],Xt=(e,s,n)=>{if(e==="Home")return 0;if(e==="End")return n-1;const r=e==="ArrowDown"?1:-1;return s===-1?r===1?0:n-1:(s+r+n)%n},Yt=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,ct=({children:e,items:s,onItemClick:n,menuHeader:r,menuFooter:i,renderOverlay:d,trigger:l=[g.DropdownTrigger.Click],placement:u,disabled:m=!1,open:x,defaultOpen:S=!1,onOpenChange:f,closable:I=!1,onClose:y,className:_,overlayContentClassName:L,separatorClassName:k,listClassName:w,listStyle:j,outsidePressIgnoreRef:H,outsideClosable:Y=!0,allowedPlacements:T,anchorToMouse:V=!1,matchReferenceWidth:Z=!0,maxDropdownHeight:W,initialFocus:v})=>{const J=g.useThemeScope(),[ne,se]=o.useState(S),G=x!==void 0,A=G?!!x:ne,M=o.useRef(null),[O,B]=o.useState(!0),E=o.useCallback((a,N,c)=>{a&&B(c!=="hover"&&c!=="safe-polygon"),G||se(a),f?.(a)},[G,f]),K=o.useId(),ve=u===void 0,le=C.useFloatingNodeId(),{refs:U,floatingStyles:P,context:F}=C.useFloating({nodeId:le,placement:u,open:A,onOpenChange:E,whileElementsMounted:C.autoUpdate,middleware:[C.offset({mainAxis:te,crossAxis:0}),ve?C.autoPlacement({alignment:"start",crossAxis:!0,padding:te,allowedPlacements:T}):C.flip({padding:te}),C.shift({padding:te}),C.size({padding:te,apply({availableWidth:a,availableHeight:N,elements:c}){const b=c.floating,R=Yt(c.reference);b.style.setProperty("--fui-available-height",`${Math.floor(N)}px`),b.style.setProperty("--reference-width",Z?`${Math.round(R)}px`:"0px"),Z?b.style.minWidth=`${Math.round(R)}px`:b.style.removeProperty("min-width"),b.style.maxWidth=`${Math.floor(a)}px`;const $=Math.floor(N);b.style.maxHeight=`${W?Math.min($,W):$}px`}})]}),re=C.useClick(F,{enabled:l.includes(g.DropdownTrigger.Click)&&!m}),Q=C.useHover(F,{enabled:l.includes(g.DropdownTrigger.Hover)&&!m,move:!1,restMs:40,handleClose:C.safePolygon(),delay:{open:80,close:80}}),Ee=C.useDismiss(F,{bubbles:!0,referencePress:!1,outsidePress:a=>{if(!Y)return!1;const N=a.target;return!(H?.current&&N instanceof Node&&H.current.contains(N))}}),oe=C.useRole(F,{role:"menu"}),{getReferenceProps:ce,getFloatingProps:ye}=C.useInteractions([re,Q,Ee,oe]),q=o.useCallback((a,N)=>{U.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:a,y:N,top:N,left:a,right:a,bottom:N})})},[U]),ee=o.useCallback(a=>{!l.includes(g.DropdownTrigger.ContextMenu)||m||(a.preventDefault(),V&&(q(a.clientX,a.clientY),M.current=document.elementFromPoint(a.clientX,a.clientY)),E(!0))},[V,m,E,q,l]),ke=o.useCallback(a=>{!V||m||(l.includes(g.DropdownTrigger.ContextMenu)&&A&&E(!1),q(a.clientX,a.clientY),M.current=document.elementFromPoint(a.clientX,a.clientY))},[V,m,q,A,l,E]);o.useEffect(()=>{m&&A&&E(!1)},[m,A,E]);const Te=o.useCallback(a=>{if(a.defaultPrevented||!qt.includes(a.key)||!a.currentTarget.contains(a.target))return;const N=Array.from(a.currentTarget.querySelectorAll(Ut)).filter($t);if(N.length===0)return;a.preventDefault();const c=a.currentTarget.ownerDocument.activeElement,b=N.findIndex(R=>R===c);N[Xt(a.key,b,N.length)]?.focus()},[]),ie=o.useCallback(a=>N=>{a.disabled||(a.onClick?.({key:a.key,domEvent:N}),n?.({key:a.key,domEvent:N}),a.selectable||E(!1))},[n,E]),Ae=o.useMemo(()=>d?d():s?t.jsxs(t.Fragment,{children:[r&&t.jsx(t.Fragment,{children:typeof r=="function"?r():r}),t.jsx("div",{role:"none",className:h.mergeClasses(Mt,L,g.DIAL_KIT_CLASS.dropdownList),"aria-label":"dropdown",children:s.map(a=>{if(a.type===g.DropdownItemType.Divider)return t.jsx("div",{role:"separator",className:h.mergeClasses(Ot,k)},a.key);if(a.type===g.DropdownItemType.PlainText)return t.jsx("div",{className:h.mergeClasses("px-3 py-2 text-secondary dial-caption-text",a.className),children:a.label},a.key);if(a.children?.length)return t.jsx(Kt,{item:a,onRootClose:()=>E(!1)},a.key);const N=he(a),c=lt(a),b=t.jsx(ge,{role:c,"aria-checked":c==="menuitem"?void 0:!!a.checked,"aria-current":N===D.Highlight&&a.checked?!0:void 0,"aria-disabled":!!a.disabled,disabled:a.disabled,mark:N,selected:!!a.checked,danger:a.danger,icon:a.icon,label:a.label,className:a.className,rightControl:a.rightControl,onClick:ie(a),children:a.renderItem?.(a)});return t.jsx(o.Fragment,{children:a.interactiveTooltip?t.jsx(pe,{asChild:!0,placement:a.interactiveTooltip.placement,content:a.interactiveTooltip.content,contentClassName:a.interactiveTooltip.contentClassName,children:b}):b},a.key)})}),i&&t.jsx(t.Fragment,{children:typeof i=="function"?i():i})]}):null,[ie,s,i,r,d,E,L,k]),ue=ce({onContextMenu:ee,onMouseDown:ke});return o.useEffect(()=>{if(!A)return;const a=U.reference.current;let N=null;if(a instanceof Element?N=a:M.current instanceof Element&&(N=M.current),!N)return;const c=new IntersectionObserver(([b])=>{b.isIntersecting||E(!1)},{root:null,threshold:0});return c.observe(N),()=>c.disconnect()},[A,U.reference,E]),t.jsx(C.FloatingTree,{children:t.jsxs(C.FloatingNode,{id:le,children:[t.jsx("span",{ref:U.setReference,className:h.mergeClasses(Dt,m&&"!cursor-not-allowed opacity-75",_,g.DIAL_KIT_CLASS.dropdown),"aria-haspopup":"menu","aria-expanded":A,"aria-controls":K,...ue,children:e}),A&&t.jsx(C.FloatingPortal,{children:t.jsx(C.FloatingFocusManager,{context:F,modal:!1,initialFocus:v!==void 0?v:O?0:-1,returnFocus:!0,children:t.jsxs("div",{id:K,ref:U.setFloating,style:j?{...j,...P}:P,className:h.mergeClasses(jt,!Z&&"w-max","overflow-auto",J,w),...ye({onKeyDown:Te}),children:[I&&t.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:t.jsx(at,{ariaLabel:"Close dropdown",onClose:a=>{y?.(a),E(!1)}})}),Ae]})})})]})})},it=e=>me.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},me.createElement("path",{d:"M20.2954 16.7035C20.2954 17.088 20.6029 17.4069 20.9737 17.4069C21.3445 17.4069 21.6519 17.088 21.6519 16.7035C21.6519 16.3189 21.3445 16 20.9737 16C20.6029 16 20.2954 16.3189 20.2954 16.7035Z",fill:"currentColor"}),me.createElement("path",{d:"M11.7041 16.7035C11.7041 17.088 11.3966 17.4069 11.0258 17.4069C10.655 17.4069 10.3476 17.088 10.3476 16.7035C10.3476 16.3189 10.655 16 11.0258 16C11.3966 16 11.7041 16.3189 11.7041 16.7035Z",fill:"currentColor"}),me.createElement("path",{d:"M19.0221 2.40002L19.5525 1.86969C19.4118 1.72904 19.221 1.65002 19.0221 1.65002V2.40002ZM26.5777 9.95558H27.3277C27.3277 9.75667 27.2487 9.5659 27.108 9.42525L26.5777 9.95558ZM5.42212 29.6H4.67212C4.67212 30.0142 5.00791 30.35 5.42212 30.35V29.6ZM8.44434 2.40002V1.65002V2.40002ZM13.8932 19.5173C13.8932 19.9315 14.229 20.2673 14.6432 20.2673C15.0574 20.2673 15.3932 19.9315 15.3932 19.5173H14.6432H13.8932ZM16.6063 19.5173C16.6063 19.9315 16.9421 20.2673 17.3563 20.2673C17.7705 20.2673 18.1063 19.9315 18.1063 19.5173H17.3563H16.6063ZM19.0221 2.40002H18.2721V8.44447H19.0221H19.7721V2.40002H19.0221ZM19.0221 8.44447H18.2721C18.2721 9.04415 18.5103 9.61927 18.9344 10.0433L19.4647 9.51299L19.995 8.98266C19.8523 8.83992 19.7721 8.64633 19.7721 8.44447H19.0221ZM19.4647 9.51299L18.9344 10.0433C19.3584 10.4674 19.9335 10.7056 20.5332 10.7056V9.95558V9.20558C20.3314 9.20558 20.1378 9.12539 19.995 8.98266L19.4647 9.51299ZM20.5332 9.95558V10.7056H26.5777V9.95558V9.20558H20.5332V9.95558ZM5.42212 29.6H6.17212V5.42225H5.42212H4.67212V29.6H5.42212ZM5.42212 5.42225H6.17212C6.17212 4.81962 6.41151 4.24167 6.83764 3.81554L6.30731 3.28521L5.77698 2.75488C5.06955 3.46231 4.67212 4.42179 4.67212 5.42225H5.42212ZM6.30731 3.28521L6.83764 3.81554C7.26376 3.38942 7.84171 3.15002 8.44434 3.15002V2.40002V1.65002C7.44389 1.65002 6.48441 2.04745 5.77698 2.75488L6.30731 3.28521ZM8.44434 2.40002V3.15002H19.0221V2.40002V1.65002H8.44434V2.40002ZM19.0221 2.40002L18.4918 2.93035L26.0473 10.4859L26.5777 9.95558L27.108 9.42525L19.5525 1.86969L19.0221 2.40002ZM26.5777 9.95558H25.8277V26.5778H26.5777H27.3277V9.95558H26.5777ZM26.5777 26.5778H25.8277C25.8277 27.1804 25.5883 27.7584 25.1622 28.1845L25.6925 28.7148L26.2228 29.2452C26.9302 28.5377 27.3277 27.5783 27.3277 26.5778H26.5777ZM25.6925 28.7148L25.1622 28.1845C24.736 28.6106 24.1581 28.85 23.5555 28.85V29.6V30.35C24.5559 30.35 25.5154 29.9526 26.2228 29.2452L25.6925 28.7148ZM23.5555 29.6V28.85H5.42212V29.6V30.35H23.5555V29.6ZM20.9737 16V16.75C20.9388 16.75 20.9181 16.7345 20.9119 16.7281C20.906 16.722 20.9019 16.7133 20.9019 16.7035H21.6519H22.4019C22.4019 15.9307 21.7842 15.25 20.9737 15.25V16ZM21.6519 16.7035H20.9019C20.9019 16.6936 20.906 16.685 20.9119 16.6788C20.9181 16.6724 20.9388 16.6569 20.9737 16.6569V17.4069V18.1569C21.7842 18.1569 22.4019 17.4762 22.4019 16.7035H21.6519ZM20.9737 17.4069V16.6569C21.0086 16.6569 21.0292 16.6724 21.0354 16.6788C21.0414 16.685 21.0454 16.6936 21.0454 16.7035H20.2954H19.5454C19.5454 17.4762 20.1631 18.1569 20.9737 18.1569V17.4069ZM20.2954 16.7035H21.0454C21.0454 16.7133 21.0414 16.722 21.0354 16.7281C21.0292 16.7345 21.0086 16.75 20.9737 16.75V16V15.25C20.1631 15.25 19.5454 15.9307 19.5454 16.7035H20.2954ZM11.0258 16V16.75C10.9909 16.75 10.9703 16.7345 10.9641 16.7281C10.9582 16.722 10.9541 16.7133 10.9541 16.7035H11.7041H12.4541C12.4541 15.9307 11.8364 15.25 11.0258 15.25V16ZM11.7041 16.7035H10.9541C10.9541 16.6936 10.9582 16.685 10.9641 16.6788C10.9703 16.6724 10.9909 16.6569 11.0258 16.6569V17.4069V18.1569C11.8364 18.1569 12.4541 17.4762 12.4541 16.7035H11.7041ZM11.0258 17.4069V16.6569C11.0607 16.6569 11.0814 16.6724 11.0876 16.6788C11.0935 16.685 11.0976 16.6936 11.0976 16.7035H10.3476H9.59757C9.59757 17.4762 10.2153 18.1569 11.0258 18.1569V17.4069ZM10.3476 16.7035H11.0976C11.0976 16.7133 11.0935 16.722 11.0876 16.7281C11.0814 16.7345 11.0607 16.75 11.0258 16.75V16V15.25C10.2153 15.25 9.59757 15.9307 9.59757 16.7035H10.3476ZM14.6432 19.5173H15.3932C15.3932 19.127 15.6889 18.8604 15.9998 18.8604V18.1104V17.3604C14.8094 17.3604 13.8932 18.3506 13.8932 19.5173H14.6432ZM15.9998 18.1104V18.8604C16.3106 18.8604 16.6063 19.127 16.6063 19.5173H17.3563H18.1063C18.1063 18.3506 17.1901 17.3604 15.9998 17.3604V18.1104Z",fill:"currentColor"})),ut=({id:e,name:s,value:n,labelProps:r,isSelected:i=!1,disabled:d,onChange:l,caption:u,className:m,...x})=>{const S=o.useId(),f=e??S,I=u?`${f}-caption`:void 0,y=o.useCallback(_=>{_.target.checked&&l?.(n)},[l,n]);return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:h.mergeClasses("flex items-center gap-2 ",m,g.DIAL_KIT_CLASS.radio),children:[t.jsx("input",{...x,type:"radio",id:f,name:s,value:n,checked:i,disabled:d,onChange:y,"aria-label":p.resolveAccessibleName(typeof r?.label!="string"?x["aria-label"]:void 0),"aria-describedby":I,className:"peer sr-only"}),t.jsx("label",{htmlFor:f,className:h.mergeClasses("group grid size-[20px] shrink-0 place-items-center rounded-full border transition-colors duration-200 hover:bg-control-accent-alpha-hover","dial-kit-minimum-target","peer-focus-visible:outline peer-focus-visible:outline-focus",d?"cursor-not-allowed border-default bg-control-disable-primary":h.mergeClasses("cursor-pointer",i?"border border-accent bg-control-neutral":"border-default bg-control-neutral")),children:i&&t.jsx("span",{className:h.mergeClasses("size-3 rounded-full",d?"bg-control-disable-secondary":"bg-control-accent")})}),r&&t.jsx(je,{size:p.ElementSize.Standard,...r,htmlFor:f,className:h.mergeClasses("py-[1px]",d?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",r.className)})]}),u&&t.jsx("span",{id:I,className:"dial-tiny-text text-secondary ml-[26px]",children:u})]})},Ze=32,dt=({title:e,description:s,icon:n,live:r=!1,className:i,titleClassName:d,descriptionClassName:l})=>t.jsxs("div",{role:r?"status":void 0,className:h.mergeClasses("flex size-full flex-col items-center justify-center gap-2 text-tertiary",i,g.DIAL_KIT_CLASS.noDataContent),children:[n??t.jsx(it,{width:Ze,height:Ze,"aria-hidden":"true"}),t.jsx("span",{className:h.mergeClasses("dial-tiny-text text-secondary",d),children:e}),s&&t.jsx("span",{className:h.mergeClasses("dial-tiny-text text-secondary",l),children:s})]});var xe=(e=>(e.Light="light",e.Dark="dark",e))(xe||{});const mt="dial-kit-grid",Jt="dial-kit-grid-with-selection",Qt="dial-kit-grid-without-header-borders",en="dial-kit-grid-row-select",tn="dial-kit-grid-header-select",nn="dial-kit-grid-selection-visible",sn="dial-kit-grid-align-right",Le=40,We="0.5px solid var(--stroke-tertiary, #E0E6F0)",fe={accentColor:"var(--bg-control-accent, #1D4ED8)",backgroundColor:"var(--bg-layer-raised, #FCFCFC)",oddRowBackgroundColor:"var(--bg-layer-sunken, #EEF1F7)",selectedRowBackgroundColor:"var(--bg-control-accent-alpha-active-subtle, #2764D914)",rowHoverColor:"var(--bg-control-accent-alpha-hover-subtle, #2764D90A)",borderColor:"var(--stroke-tertiary, #E0E6F0)",rowBorder:We,headerRowBorder:!1,headerColumnBorder:We,headerColumnBorderHeight:12,chromeBackgroundColor:"var(--bg-layer-base, #F5F7FA)",headerBackgroundColor:"var(--bg-layer-raised, #FCFCFC)",foregroundColor:"var(--text-primary, #161B2D)",headerTextColor:"var(--text-secondary, #57647A)",browserColorScheme:"light",headerFontSize:14,headerFontWeight:600,fontSize:14,fontFamily:"var(--theme-font, var(--font-inter))",spacing:4,borderRadius:4,inputBorderRadius:8,wrapperBorderRadius:8};var z=(e=>(e.API="api",e.ROW_DATA_CHANGED="rowDataChanged",e.CHECKBOX_SELECTED="checkboxSelected",e))(z||{});const rn=({params:e,mode:s,label:n,radioName:r,rowId:i,disabled:d})=>{const l=e.node,[u,m]=o.useState(()=>!!l.isSelected());o.useEffect(()=>{const S=()=>m(!!l.isSelected());return S(),l.addEventListener("rowSelected",S),()=>l.removeEventListener("rowSelected",S)},[l]);const x=S=>{d||l.setSelected(S,s===g.GridSelectionMode.SINGLE,z.CHECKBOX_SELECTED)};return s===g.GridSelectionMode.SINGLE?t.jsx(ut,{name:r,value:i,isSelected:u,disabled:d,"aria-label":n,onChange:()=>x(!0)}):t.jsx(Be,{isSelected:u,disabled:d,"aria-label":n,onChange:x})},Ke=e=>{let s=0,n=0;return e.forEachNodeAfterFilter(r=>{r.selectable!==!1&&(n++,r.isSelected()&&s++)}),{selected:s,selectable:n}},on=({api:e,label:s})=>{const[{selected:n,selectable:r},i]=o.useState(()=>Ke(e));o.useEffect(()=>{const l=()=>i(Ke(e));return l(),e.addEventListener("selectionChanged",l),e.addEventListener("modelUpdated",l),()=>{e.isDestroyed()||(e.removeEventListener("selectionChanged",l),e.removeEventListener("modelUpdated",l))}},[e]);const d=o.useCallback(l=>{if(l){e.selectAll("filtered",z.CHECKBOX_SELECTED);return}e.deselectAll("filtered",z.CHECKBOX_SELECTED)},[e]);return t.jsx(Be,{isSelected:r>0&&n===r,isIndeterminate:n>0&&n<r,disabled:r===0,"aria-label":s,onChange:d})},ft="en-US",Ct={year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},_e=40,an={minWidth:_e,width:_e,maxWidth:_e,resizable:!1,sortable:!1,filter:!1,floatingFilter:!1,suppressMovable:!0,suppressHeaderMenuButton:!0,suppressAutoSize:!0,suppressSizeToFit:!0},pt="dial-kit-grid-selection",ln=150,cn=100,un=({columnDefs:e,rowData:s,additionalGridOptions:n,getContextMenuItems:r,className:i,ariaLabel:d="Data grid",wrapCustomCellRenderers:l=!0,disabledRowIds:u,selectedRowIds:m,onSelectionChange:x,onGridApiChange:S,getRowId:f,alternateOddRowColors:I=!1,filterPlaceholder:y="Enter value",emptyStateIcon:_,emptyStateTitle:L="No results found",emptyStateDescription:k="Sorry, we couldn't find any results for your search.",loading:w=!1,wrapperBorder:j=!0,withoutHeaderBorders:H=!1,allowDisabledContextMenu:Y=!1,selectionMode:T,selectRowLabel:V,selectAllLabel:Z="Select all rows",colorScheme:W=xe.Light})=>{g.registerAgGridModulesOnce();const[v,J]=o.useState(),ne=g.useIsMobileScreen(),se=g.useIsTabletScreen(),G=o.useRef(new Set),A=o.useRef(void 0),M=`dial-kit-grid-selection-${o.useId()}`,O=o.useRef({getRowId:f,getContextMenuItems:r,onSelectionChange:x,selectRowLabel:V,wrapCustomCellRenderers:l});O.current={getRowId:f,getContextMenuItems:r,onSelectionChange:x,selectRowLabel:V,wrapCustomCellRenderers:l};const B=o.useCallback(c=>{const b=O.current.getRowId;return b?b(c):String(c.id??JSON.stringify(c))},[]),E=!!r,K=!!l,ve=o.useMemo(()=>g.themeBalham.withPart(W===xe.Dark?g.colorSchemeDark:g.colorSchemeLight).withParams({...fe,browserColorScheme:W,oddRowBackgroundColor:I?fe.oddRowBackgroundColor:fe.backgroundColor,wrapperBorder:j}),[I,W,j]),le=o.useCallback(c=>{c.api.sizeColumnsToFit()},[]),U=ne||se||(m?.size??0)>0,P=o.useCallback(c=>!!c&&!!u?.has(B(c)),[u,B]),F=o.useCallback((c,b,R)=>E?t.jsx(ct,{trigger:[g.DropdownTrigger.ContextMenu],items:c.data?O.current.getContextMenuItems?.(c.data)??[]:[],anchorToMouse:!0,matchReferenceWidth:!0,className:h.mergeClasses("size-full",R&&"cursor-not-allowed opacity-75"),disabled:R&&!Y,children:t.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:b})}):b,[E,Y]),re=o.useCallback(c=>{if(!c.data)return null;const b=P(c.data);return F(c,t.jsx(Ne,{text:c.value==null?"":String(c.value),className:"max-w-full dial-small-text text-primary",hideTooltip:b}),b)},[P,F]),Q=o.useCallback(c=>c===z.API||c===z.ROW_DATA_CHANGED,[]),Ee=o.useMemo(()=>g.debounceFn(c=>{const R=(c.selectedNodes??[]).map(Ve=>Ve.data),$=new Set(R.map(B));G.current=$,A.current=c.source,!Q(c.source)&&O.current.onSelectionChange?.($,R)},cn),[Q,B]),oe=o.useMemo(()=>{if(T)return{...an,colId:pt,headerName:"",headerClass:tn,cellClass:en,headerComponent:T===g.GridSelectionMode.MULTIPLE?on:void 0,headerComponentParams:{label:Z},cellRenderer:c=>{if(!c.data)return null;const b=B(c.data);return t.jsx(rn,{params:c,mode:T,rowId:b,radioName:M,label:O.current.selectRowLabel?.(c.data)??"Select row",disabled:u?.has(b)})}}},[T,Z,B,u,M]),ce=o.useCallback(c=>{if(!c.cellRenderer)return{...c,cellRenderer:re};const b=O.current.wrapCustomCellRenderers;if(!(typeof b=="function"?b(c):!!b))return c;const $=c.cellRenderer;return{...c,cellRenderer:de=>{const gt=P(de.data),Ge=typeof $=="function"?$:void 0,ht=Ge?t.jsx(Ge,{...de}):re(de);return F(de,ht,gt)}}},[P,re,F]),ye=o.useMemo(()=>{const c=K?(e??[]).map(ce):e??[];return oe?[oe,...c]:c},[e,K,ce,oe]),{defaultColDef:q,rowSelection:ee,...ke}=n??{},Te=o.useMemo(()=>({minWidth:ln,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:y,buttons:["reset"]},comparator:g.baseColumnComparator,...g.omitUndefined(q)}),[y,q]),ie=c=>{c.api.sizeColumnsToFit(),J(c.api),n?.onGridReady?.(c),S?.(c.api)};o.useEffect(()=>{v&&s&&v.setGridOption("rowData",s)},[v,s]);const Ae=o.useCallback(()=>t.jsx(dt,{live:!0,title:L,description:k,icon:_??t.jsx(X.IconZoomCancel,{size:100,stroke:.5,"aria-hidden":"true"})}),[L,k,_]),ue=typeof ee=="object"?ee:void 0,a=o.useMemo(()=>T?{isRowSelectable:c=>!P(c.data),...ue,mode:T===g.GridSelectionMode.SINGLE?"singleRow":"multiRow",checkboxes:!1,headerCheckbox:!1}:ee,[ee,ue,P,T]);o.useEffect(()=>{v&&s&&G.current.size&&G.current.forEach(c=>{const b=v.getRowNode(c);b&&!b.isSelected()&&b.setSelected(!0,!1,z.API)})},[v,s]),o.useEffect(()=>{v&&m&&(v.deselectAll("all",z.API),m.forEach(c=>{const b=v.getRowNode(c);b&&!b.isSelected()&&b.setSelected(!0,!1,z.API)}))},[v,m]);const N=o.useCallback(c=>c.data?B(c.data):"",[B]);return o.useEffect(()=>{const c=Q(A.current);if(v&&m?.size&&c){const b=Array.from(m)[0];if(b){const R=v.getRowNode(b);R&&v.ensureNodeVisible(R)}}},[v,Q,m]),t.jsx("div",{className:h.mergeClasses(mt,"size-full",T&&Jt,T&&U&&nn,H&&Qt,i),role:"region","aria-label":d,"aria-busy":w,children:t.jsx("div",{className:"h-full overflow-x-auto",children:t.jsx(g.AgGridReact,{rowModelType:"clientSide",headerHeight:Le,rowHeight:Le,cellSelection:!1,theme:ve,autoSizeStrategy:{type:"fitGridWidth"},columnDefs:ye,defaultColDef:Te,onGridSizeChanged:le,onGridReady:ie,loading:w,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:Ae,rowData:s,rowSelection:a,onSelectionChanged:Ee,getRowId:N,...ke})})})},dn=({value:e,locale:s=ft,options:n=Ct,emptyPlaceholder:r,className:i,hideTooltip:d=!1})=>{const l=g.convertToDate(e),u=o.useMemo(()=>l?new Intl.DateTimeFormat(s,n).format(l):r,[l,r,s,n]),m=l?l.toISOString():void 0;return t.jsx(Ne,{text:m?t.jsx("time",{dateTime:m,children:u}):t.jsx("span",{children:u}),className:h.mergeClasses("dial-small-text text-primary",i),hideTooltip:d})};exports.Checkbox=Be;exports.CheckboxBox=He;exports.CloseButton=at;exports.DEFAULT_DATE_FORMAT_OPTIONS=Ct;exports.DEFAULT_LOCALE=ft;exports.DangerIconButton=Pt;exports.DateCellRenderer=dn;exports.Dropdown=ct;exports.EllipsisTooltip=Ne;exports.GRID_ALIGN_RIGHT_CLASS=sn;exports.GRID_ROOT_CLASS=mt;exports.GRID_SELECTION_COLUMN_ID=pt;exports.GRID_THEME_PARAMS=fe;exports.GhostIconButton=ot;exports.Grid=un;exports.GridColorScheme=xe;exports.IconButton=Ie;exports.InfoButton=Je;exports.InteractiveTooltip=pe;exports.InteractiveTooltipTrigger=Ce;exports.Label=je;exports.MenuItem=ge;exports.MenuItemMark=D;exports.NeutralIconButton=Gt;exports.NoDataContent=dt;exports.PrimaryIconButton=Vt;exports.ROW_HEIGHT=Le;exports.Radio=ut;exports.StaticIconButton=zt;exports.SvgNoData=it;exports.Tooltip=qe;exports.TooltipContainer=we;exports.TooltipContent=Re;exports.TooltipPlacement=Se;exports.TooltipTrigger=De;exports.getButtonClassNames=Ye;exports.getDisabledButtonProps=Xe;exports.overlayGap=st;exports.overlayItemClassName=tt;exports.overlayListClassName=Oe;exports.overlaySubMenuListClassName=et;exports.overlaySurfaceClassName=Me;
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),g=require("./DateCellRenderer-CfQgxeAQ.cjs"),X=require("@tabler/icons-react"),o=require("react"),h=require("./merge-classes-BEJXjzkx.cjs"),C=require("@floating-ui/react"),be=require("./icon-DhjrDQ8I.cjs"),ae=require("./icon-CrGVkVpG.cjs"),p=require("./IconButton-DHOFapLo.cjs"),xt=require("classnames");function bt(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(s,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return s.default=e,Object.freeze(s)}const me=bt(o);var Se=(e=>(e.Top="top",e.Right="right",e.Bottom="bottom",e.Left="left",e))(Se||{}),Ce=(e=>(e.Hover="hover",e.Click="click",e))(Ce||{});const St=7,It=2,Nt=500,vt="fill-control-inverted",Et="z-tooltip max-w-[376px] whitespace-pre-wrap break-words rounded-lg bg-control-inverted px-3 py-2 dial-small-text text-control-inverted shadow-xs",Ue=o.createContext(null),$e=()=>{const e=o.useContext(Ue);if(e==null)throw new Error("Tooltip components must be wrapped in <TooltipContainer />");return e},yt=({initialOpen:e=!1,placement:s=Se.Bottom,isTriggerClickable:n=!1,open:r,onOpenChange:i}={})=>{const[d,l]=o.useState(e),u=o.useRef(null),m=r??d,x=i??l,S=C.useFloating({placement:s,open:m,onOpenChange:x,whileElementsMounted:C.autoUpdate,middleware:[C.offset(St+It),C.flip({fallbackAxisSideDirection:"start",padding:5}),C.shift({padding:5}),C.arrow({element:u})]}),f=C.useHover(S.context,{move:!1,enabled:r==null,mouseOnly:n,delay:{open:Nt,close:0}}),I=C.useFocus(S.context,{enabled:r==null}),y=C.useDismiss(S.context),_=C.useRole(S.context,{role:"tooltip"}),L=C.useInteractions([f,I,y,_]);return o.useEffect(()=>{if(!m)return;const k=S.refs.reference.current;if(!(k instanceof Element))return;const w=new IntersectionObserver(([j])=>{j.isIntersecting||x(!1)},{root:null,threshold:0});return w.observe(k),()=>w.disconnect()},[m,S.refs.reference,x]),o.useMemo(()=>({open:m,setOpen:x,arrowRef:u,...L,...S}),[m,x,L,S])},we=({children:e,...s})=>{const n=yt(s);return t.jsx(Ue.Provider,{value:n,children:e})},Re=({style:e,...s})=>{const n=$e(),r=p.useHasHover(),i=g.useThemeScope(),d=o.useRef(null),l=C.useMergeRefs([n.refs.setFloating,d]);return!n.open||!r?null:t.jsx(C.FloatingPortal,{id:"tooltip-portal",children:t.jsxs("div",{ref:l,"data-placement":n.placement,style:{...n.floatingStyles,...e},...n.getFloatingProps(s),className:xt(Et,i,n.getFloatingProps(s).className,g.DIAL_KIT_CLASS.tooltip),children:[s.children,t.jsx(C.FloatingArrow,{ref:n.arrowRef,context:n.context,className:vt})]})})},De=({children:e,asChild:s=!1,...n})=>{const r=$e(),i=s&&o.isValidElement(e),d=i?e.props?.ref:null,l=C.useMergeRefs([r.refs.setReference,...d?[d]:[]]);if(i){const u=e.props;return o.cloneElement(e,r.getReferenceProps({...u,...n,className:h.mergeClasses(u.className,n.className)||void 0,ref:l}))}return t.jsx("span",{ref:l,...r.getReferenceProps(n),className:n.className??"text-start",children:e})},qe=({hideTooltip:e=!1,tooltip:s,children:n,asChild:r=!1,triggerClassName:i,contentClassName:d,...l})=>{const u=!e&&!!s;return t.jsxs(we,{...l,children:[t.jsx(De,{asChild:r,className:i,children:n}),u&&t.jsx(Re,{className:d,children:s})]})},Pe={[p.ButtonVariant.Primary]:{[p.ButtonAppearance.Solid]:"dial-kit-primary-solid-button",[p.ButtonAppearance.Ghost]:"dial-kit-primary-ghost-button",[p.ButtonAppearance.Link]:"dial-kit-primary-link-button"},[p.ButtonVariant.Neutral]:{[p.ButtonAppearance.Solid]:"dial-kit-neutral-solid-button",[p.ButtonAppearance.Outlined]:"dial-kit-neutral-outlined-button"},[p.ButtonVariant.Danger]:{[p.ButtonAppearance.Solid]:"dial-kit-danger-solid-button",[p.ButtonAppearance.Ghost]:"dial-kit-danger-ghost-button",[p.ButtonAppearance.Outlined]:"dial-kit-danger-outlined-button"},[p.ButtonVariant.Static]:{[p.ButtonAppearance.Solid]:"dial-kit-static-solid-button"},[p.ButtonVariant.Starter]:{[p.ButtonAppearance.Outlined]:"dial-kit-starter-outlined-button"},[p.ButtonVariant.Success]:{},[p.ButtonVariant.Secondary]:{},[p.ButtonVariant.Tertiary]:{}},kt=e=>{e.preventDefault()},Xe=(e,s,n)=>{const r=s!=null&&!s.hideTooltip&&s.tooltip!=null&&s.tooltip!=="";return e&&r?{disabled:void 0,"aria-disabled":!0,onClick:kt}:{disabled:e,onClick:n}},Ye=(e=p.ButtonVariant.Primary,s=p.ButtonAppearance.Solid)=>{const n=Pe[e]?.[s];return n||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${s}. Using default primary solid button styles.`),Pe[p.ButtonVariant.Primary][p.ButtonAppearance.Solid])},Tt={[p.ElementSize.Small]:"size-[24px]",[p.ElementSize.Standard]:"size-[40px] dial-kit-enhanced-target",[p.ElementSize.Large]:"size-[48px] dial-kit-enhanced-target"},Ie=({variant:e,appearance:s=p.ButtonAppearance.Solid,size:n=p.ElementSize.Standard,className:r,icon:i,tooltipProps:d,type:l="button",disabled:u,...m})=>{const x=h.mergeClasses("dial-kit-base-icon-button dial-kit-base-button",e&&Ye(e,s),Tt[n],r),S=t.jsx("button",{...m,...Xe(u,d,m.onClick),type:l,className:x,"aria-label":p.resolveAccessibleName(m["aria-label"],d?.tooltip),children:i});return d?t.jsx(qe,{asChild:!0,...d,children:S}):S},Je=({caption:e,onClick:s,"aria-label":n})=>{if(!e)return null;const r=h.mergeClasses("text-secondary hover:text-control-accent-hover active:text-control-accent-active","focus-visible:outline focus-visible:outline-focus",g.DIAL_KIT_CLASS.infoButton);return t.jsx(Ie,{"aria-label":n,className:r,icon:t.jsx(X.IconInfoCircle,{size:ae.DIAL_ICON_SIZE.SM,stroke:be.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:s,size:p.ElementSize.Small,tooltipProps:{tooltip:e}})},je=({label:e,required:s,className:n,containerClassName:r,caption:i,size:d=p.ElementSize.Small,...l})=>e?t.jsxs("span",{className:h.mergeClasses("flex items-center gap-0.5",r,g.DIAL_KIT_CLASS.label),children:[t.jsxs("label",{...l,className:h.mergeClasses("text-secondary flex items-center gap-0.5",d===p.ElementSize.Small?"dial-tiny-semi-text":"dial-small-text",n),children:[typeof e=="string"?t.jsx("span",{className:"min-h-4",children:e}):e,s&&t.jsxs(t.Fragment,{children:[t.jsx("span",{"aria-hidden":"true",className:"text-error dial-tiny-text",children:"*"}),t.jsx("span",{className:"sr-only",children:"(required)"})]})]}),t.jsx(Je,{caption:i})]}):null;var D=(e=>(e.None="none",e.Check="check",e.Tint="tint",e.Checkbox="checkbox",e.Highlight="highlight",e))(D||{});const ze={size:14,stroke:3,"aria-hidden":!0},He=({isSelected:e=!1,isIndeterminate:s=!1,invalid:n=!1,disabled:r=!1,htmlFor:i,className:d})=>{const l=s||e,u=!!i,m=h.mergeClasses("grid size-[20px] shrink-0 place-items-center rounded border transition-colors duration-200",u&&"dial-kit-minimum-target",u&&"peer-focus-visible:outline peer-focus-visible:outline-focus",r?"border-transparent bg-control-disable-primary text-control-disable-primary":h.mergeClasses(n&&l&&"border-transparent bg-control-error text-control-permanent",n&&!l&&"border-error bg-control-neutral",!n&&l&&"border-transparent bg-control-accent text-control-permanent hover:bg-control-accent-hover",!n&&!l&&"border-default bg-control-neutral hover:border-accent hover:bg-control-accent-alpha-hover"),r?"cursor-not-allowed":u&&"cursor-pointer",d,g.DIAL_KIT_CLASS.checkboxBox),x=s?t.jsx(X.IconMinus,{...ze}):e&&t.jsx(X.IconCheck,{...ze});return u?t.jsx("label",{htmlFor:i,className:m,children:x}):t.jsx("span",{"aria-hidden":"true",className:m,children:x})},Be=({id:e,labelProps:s,isSelected:n=!1,isIndeterminate:r=!1,invalid:i=!1,disabled:d,onChange:l,caption:u,className:m,boxClassName:x,...S})=>{const f=o.useId(),I=e??f,y=u?`${I}-caption`:void 0,_=o.useCallback(k=>{l?.(k.target.checked)},[l]),L=o.useCallback(k=>{k&&(k.indeterminate=r)},[r]);return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:h.mergeClasses("flex items-center gap-2",m,g.DIAL_KIT_CLASS.checkbox),children:[t.jsx("input",{...S,ref:L,type:"checkbox",id:I,checked:n,disabled:d,onChange:_,"aria-checked":r?"mixed":n,"aria-invalid":i||void 0,"aria-label":p.resolveAccessibleName(typeof s?.label!="string"?S["aria-label"]:void 0),"aria-describedby":y,className:"peer sr-only"}),t.jsx(He,{htmlFor:I,isSelected:n,isIndeterminate:r,invalid:i,disabled:d,className:x}),s&&t.jsx(je,{size:p.ElementSize.Standard,...s,htmlFor:I,className:h.mergeClasses("py-[1px]",d?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",s.className)})]}),u&&t.jsx("span",{id:y,className:"dial-tiny-text text-secondary ml-[28px]",children:u})]})},At=8,_t=400,Lt="z-interactive-tooltip max-w-[320px] rounded-xl bg-layer-0 p-4 dial-small-text text-primary shadow-md",pe=({content:e,placement:s=Se.Right,children:n,asChild:r=!1,hideTooltip:i=!1,initialOpen:d=!1,trigger:l=Ce.Hover,open:u,onOpenChange:m,triggerClassName:x,contentClassName:S})=>{const f=g.useIsMobileScreen(),I=l===Ce.Click,y=g.useThemeScope(),[_,L]=o.useState(d),k=u??_,w=K=>{m?.(K),u==null&&L(K)},j=C.useFloatingNodeId(),{refs:H,floatingStyles:Y,context:T}=C.useFloating({nodeId:j,placement:s,open:k,onOpenChange:w,whileElementsMounted:C.autoUpdate,middleware:[C.offset(At),C.flip({padding:5}),C.shift({padding:5})]}),V=C.useHover(T,{enabled:u==null&&!I,handleClose:C.safePolygon(),delay:{open:_t,close:0}}),Z=C.useFocus(T,{enabled:u==null&&!I}),W=C.useClick(T,{enabled:I}),v=C.useDismiss(T),{getReferenceProps:J,getFloatingProps:ne}=C.useInteractions([V,Z,W,v]),se=o.useRef(null),G=C.useMergeRefs(o.useMemo(()=>[H.setFloating,se],[H.setFloating])),A=r&&o.isValidElement(n),M=A?n.props?.ref:null,O=C.useMergeRefs(o.useMemo(()=>[H.setReference,...M?[M]:[]],[H.setReference,M])),B=!i&&(I||!f)&&!!e,E=A?o.cloneElement(n,J({...n.props,ref:O,className:h.mergeClasses(n.props.className,x)||void 0})):t.jsx("span",{ref:O,...J(),className:x??"text-start",children:n});return t.jsxs(t.Fragment,{children:[E,k&&B&&t.jsx(C.FloatingPortal,{id:"interactive-tooltip-portal",children:t.jsx(C.FloatingFocusManager,{context:T,modal:!1,initialFocus:-1,returnFocus:!1,order:["reference","content"],children:t.jsx("div",{ref:G,"data-placement":T.placement,style:Y,...ne(),className:h.mergeClasses(Lt,y,S,g.DIAL_KIT_CLASS.interactiveTooltip),children:e})})})]})},Me="rounded-xl bg-layer-raised p-1 shadow-md",Oe="flex flex-col gap-0.5",Qe=h.mergeClasses(Me,"w-max"),et=h.mergeClasses(Qe,Oe,"py-2"),tt=h.mergeClasses("flex w-full shrink-0 cursor-pointer items-center gap-2 px-3 h-[40px] rounded-lg","dial-small-text text-primary truncate","hover:bg-control-accent-alpha-hover","focus-visible:outline focus-visible:outline-focus"),nt="bg-control-accent-alpha",wt=h.mergeClasses(nt,"text-accent"),Rt=h.mergeClasses("cursor-not-allowed text-control-disable-primary","bg-transparent hover:bg-transparent"),st=4,Dt=h.mergeClasses("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),jt=h.mergeClasses("z-floating focus-visible:outline-none",Me),Ht=Qe,Bt=et,Mt=h.mergeClasses(Oe,"py-1"),Ot="my-1 border-t border-tertiary",te=st,Ft=t.jsx(X.IconChevronRight,{size:ae.DIAL_ICON_SIZE.SM,stroke:be.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Fe=(e,s)=>({appearance:r,...i})=>t.jsx(Ie,{...i,variant:e,appearance:r||s}),rt=(e,s)=>({variant:r,...i})=>t.jsx(Ie,{...i,variant:r||s,appearance:e}),Vt=Fe(p.ButtonVariant.Primary,p.ButtonAppearance.Solid),Gt=Fe(p.ButtonVariant.Neutral,p.ButtonAppearance.Solid),Pt=Fe(p.ButtonVariant.Danger,p.ButtonAppearance.Ghost),ot=rt(p.ButtonAppearance.Ghost,p.ButtonVariant.Primary),zt=rt(p.ButtonAppearance.Solid,p.ButtonVariant.Static),at=({ariaLabel:e="Close",className:s,size:n=p.ElementSize.Small,onClose:r,...i})=>t.jsx(ot,{...i,size:n,"aria-label":e,className:h.mergeClasses(s,g.DIAL_KIT_CLASS.closeButton),onClick:r,icon:t.jsx(X.IconX,{size:n===p.ElementSize.Small?ae.DIAL_ICON_SIZE.SM:ae.DIAL_ICON_SIZE.MD,stroke:be.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),Zt=e=>{const s=o.useRef(null),[n,r]=o.useState(!1),[i,d]=o.useState(""),l=o.useRef(!1),u=o.useCallback(()=>{const x=s.current;x&&(l.current&&d(x.textContent??""),r(x.scrollWidth>x.clientWidth))},[]),m=o.useCallback(()=>g.scheduleMeasure(u),[u]);return o.useEffect(()=>{const x=s.current;if(x)return g.observeElementSize(x,u)},[u]),o.useEffect(()=>{l.current=typeof e!="string",m()},[e,m]),{ref:s,isTruncated:n,textContent:i,remeasure:m}},Ne=({text:e,className:s,contentClassName:n,hideTooltip:r=!1,id:i,customTooltipContent:d,...l})=>{const{ref:u,isTruncated:m,textContent:x,remeasure:S}=Zt(e),f=typeof e=="string"?e:x,I=o.useMemo(()=>r||!m?null:d??f,[d,f,r,m]);return t.jsxs(we,{...l,children:[t.jsx(De,{asChild:!0,onMouseEnter:S,onFocusCapture:S,children:t.jsx("span",{id:i,ref:u,"aria-label":m&&f?f:void 0,className:h.mergeClasses("block min-w-0 max-w-full flex-1 truncate text-start",s,g.DIAL_KIT_CLASS.ellipsisTooltip),children:e})}),!!I&&t.jsx(Re,{className:n,children:I})]})},Wt=t.jsx(X.IconCheck,{size:ae.DIAL_ICON_SIZE.SM,stroke:be.DIAL_KIT_ICON_STROKE,className:`shrink-0 ${g.DIAL_KIT_CLASS.menuItemCheck}`,"aria-hidden":!0}),ge=({label:e,icon:s,description:n,mark:r=D.None,selected:i=!1,danger:d=!1,trailing:l,rightControl:u,ellipsisLabel:m=!1,labelClassName:x,children:S,className:f,disabled:I=!1,type:y="button",..._})=>{const L=i&&r===D.Highlight,k=i&&(r===D.Checkbox||r===D.Tint),w=h.mergeClasses(d&&"text-error",I&&"text-control-disable-primary"),j=h.mergeClasses(tt,"aria-expanded:bg-control-accent-alpha-hover",L&&wt,k&&nt,I&&Rt,d&&"text-error",f,g.DIAL_KIT_CLASS.menuItem),H=t.jsxs("button",{type:y,disabled:I,"data-menu-item-row":u?"":void 0,className:u?"flex h-full min-w-0 flex-1 items-center gap-2 truncate text-start focus-visible:outline-none":j,..._,children:[S??t.jsxs(t.Fragment,{children:[r===D.Checkbox&&t.jsx(He,{isSelected:i,disabled:I}),s&&t.jsx(g.DialIcon,{icon:s,className:w}),m?t.jsx(Ne,{text:e,className:h.mergeClasses(w,x)}):t.jsx("span",{className:h.mergeClasses("min-w-0 flex-1 truncate text-start",w,x),children:e}),n&&t.jsx("span",{className:h.mergeClasses("shrink-0 text-secondary dial-small-text",I&&"text-control-disable-primary"),children:n}),i&&r===D.Check&&Wt]}),l&&t.jsx("span",{className:h.mergeClasses("ml-auto shrink-0",w),children:l})]});return u?t.jsxs("div",{role:"none",className:h.mergeClasses(j,"has-[[data-menu-item-row]:focus-visible]:outline","has-[[data-menu-item-row]:focus-visible]:outline-focus"),children:[H,u]}):H},he=e=>e.mark??(e.selectable?D.Checkbox:D.None),lt=e=>e.selectable?"menuitemcheckbox":he(e)===D.Check?"menuitemradio":"menuitem",Kt=({item:e,onRootClose:s})=>{const{isOpen:n,nodeId:r,refs:i,floatingStyles:d,context:l,getReferenceProps:u,getFloatingProps:m}=g.useSubMenuFloating(te,"menu",!!e.disabled),x=o.useCallback(f=>I=>{f.disabled||(f.onClick?.({key:f.key,domEvent:I}),f.selectable||s())},[s]),S=t.jsx(ge,{ref:i.setReference,role:"menuitem","aria-haspopup":"menu","aria-expanded":n,"aria-disabled":!!e.disabled,disabled:e.disabled,icon:e.icon,label:e.label,trailing:Ft,className:e.className,...u(),children:e.renderItem?.(e)});return t.jsxs(C.FloatingNode,{id:r,children:[e.interactiveTooltip?t.jsx(pe,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:S}):S,n&&t.jsx(g.SubMenuPanel,{refs:i,floatingStyles:d,context:l,getFloatingProps:m,role:"menu",surfaceClassName:e.renderSubMenu?Ht:Bt,children:e.renderSubMenu?e.renderSubMenu():t.jsxs(t.Fragment,{children:[e.menuHeader&&(typeof e.menuHeader=="function"?e.menuHeader():e.menuHeader),e.children.map(f=>{const I=lt(f),y=t.jsx(ge,{role:I,"aria-checked":I==="menuitem"?void 0:!!f.checked,"aria-current":he(f)===D.Highlight&&f.checked?!0:void 0,"aria-disabled":!!f.disabled,disabled:f.disabled,mark:he(f),selected:!!f.checked,danger:f.danger,icon:f.icon,label:f.label,className:f.className,rightControl:f.rightControl,onClick:x(f),children:f.renderItem?.(f)});return t.jsx(o.Fragment,{children:f.interactiveTooltip?t.jsx(pe,{asChild:!0,placement:f.interactiveTooltip.placement,content:f.interactiveTooltip.content,contentClassName:f.interactiveTooltip.contentClassName,children:y}):y},f.key)}),e.menuFooter&&(typeof e.menuFooter=="function"?e.menuFooter():e.menuFooter)]})})]})},Ut='[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"]',$t=e=>!e.hasAttribute("disabled")&&e.getAttribute("aria-disabled")!=="true",qt=["ArrowDown","ArrowUp","Home","End"],Xt=(e,s,n)=>{if(e==="Home")return 0;if(e==="End")return n-1;const r=e==="ArrowDown"?1:-1;return s===-1?r===1?0:n-1:(s+r+n)%n},Yt=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,ct=({children:e,items:s,onItemClick:n,menuHeader:r,menuFooter:i,renderOverlay:d,trigger:l=[g.DropdownTrigger.Click],placement:u,disabled:m=!1,open:x,defaultOpen:S=!1,onOpenChange:f,closable:I=!1,onClose:y,className:_,overlayContentClassName:L,separatorClassName:k,listClassName:w,listStyle:j,outsidePressIgnoreRef:H,outsideClosable:Y=!0,allowedPlacements:T,anchorToMouse:V=!1,matchReferenceWidth:Z=!0,maxDropdownHeight:W,initialFocus:v})=>{const J=g.useThemeScope(),[ne,se]=o.useState(S),G=x!==void 0,A=G?!!x:ne,M=o.useRef(null),[O,B]=o.useState(!0),E=o.useCallback((a,N,c)=>{a&&B(c!=="hover"&&c!=="safe-polygon"),G||se(a),f?.(a)},[G,f]),K=o.useId(),ve=u===void 0,le=C.useFloatingNodeId(),{refs:U,floatingStyles:P,context:F}=C.useFloating({nodeId:le,placement:u,open:A,onOpenChange:E,whileElementsMounted:C.autoUpdate,middleware:[C.offset({mainAxis:te,crossAxis:0}),ve?C.autoPlacement({alignment:"start",crossAxis:!0,padding:te,allowedPlacements:T}):C.flip({padding:te}),C.shift({padding:te}),C.size({padding:te,apply({availableWidth:a,availableHeight:N,elements:c}){const b=c.floating,R=Yt(c.reference);b.style.setProperty("--fui-available-height",`${Math.floor(N)}px`),b.style.setProperty("--reference-width",Z?`${Math.round(R)}px`:"0px"),Z?b.style.minWidth=`${Math.round(R)}px`:b.style.removeProperty("min-width"),b.style.maxWidth=`${Math.floor(a)}px`;const $=Math.floor(N);b.style.maxHeight=`${W?Math.min($,W):$}px`}})]}),re=C.useClick(F,{enabled:l.includes(g.DropdownTrigger.Click)&&!m}),Q=C.useHover(F,{enabled:l.includes(g.DropdownTrigger.Hover)&&!m,move:!1,restMs:40,handleClose:C.safePolygon(),delay:{open:80,close:80}}),Ee=C.useDismiss(F,{bubbles:!0,referencePress:!1,outsidePress:a=>{if(!Y)return!1;const N=a.target;return!(H?.current&&N instanceof Node&&H.current.contains(N))}}),oe=C.useRole(F,{role:"menu"}),{getReferenceProps:ce,getFloatingProps:ye}=C.useInteractions([re,Q,Ee,oe]),q=o.useCallback((a,N)=>{U.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:a,y:N,top:N,left:a,right:a,bottom:N})})},[U]),ee=o.useCallback(a=>{!l.includes(g.DropdownTrigger.ContextMenu)||m||(a.preventDefault(),V&&(q(a.clientX,a.clientY),M.current=document.elementFromPoint(a.clientX,a.clientY)),E(!0))},[V,m,E,q,l]),ke=o.useCallback(a=>{!V||m||(l.includes(g.DropdownTrigger.ContextMenu)&&A&&E(!1),q(a.clientX,a.clientY),M.current=document.elementFromPoint(a.clientX,a.clientY))},[V,m,q,A,l,E]);o.useEffect(()=>{m&&A&&E(!1)},[m,A,E]);const Te=o.useCallback(a=>{if(a.defaultPrevented||!qt.includes(a.key)||!a.currentTarget.contains(a.target))return;const N=Array.from(a.currentTarget.querySelectorAll(Ut)).filter($t);if(N.length===0)return;a.preventDefault();const c=a.currentTarget.ownerDocument.activeElement,b=N.findIndex(R=>R===c);N[Xt(a.key,b,N.length)]?.focus()},[]),ie=o.useCallback(a=>N=>{a.disabled||(a.onClick?.({key:a.key,domEvent:N}),n?.({key:a.key,domEvent:N}),a.selectable||E(!1))},[n,E]),Ae=o.useMemo(()=>d?d():s?t.jsxs(t.Fragment,{children:[r&&t.jsx(t.Fragment,{children:typeof r=="function"?r():r}),t.jsx("div",{role:"none",className:h.mergeClasses(Mt,L,g.DIAL_KIT_CLASS.dropdownList),"aria-label":"dropdown",children:s.map(a=>{if(a.type===g.DropdownItemType.Divider)return t.jsx("div",{role:"separator",className:h.mergeClasses(Ot,k)},a.key);if(a.type===g.DropdownItemType.PlainText)return t.jsx("div",{className:h.mergeClasses("px-3 py-2 text-secondary dial-caption-text",a.className),children:a.label},a.key);if(a.children?.length)return t.jsx(Kt,{item:a,onRootClose:()=>E(!1)},a.key);const N=he(a),c=lt(a),b=t.jsx(ge,{role:c,"aria-checked":c==="menuitem"?void 0:!!a.checked,"aria-current":N===D.Highlight&&a.checked?!0:void 0,"aria-disabled":!!a.disabled,disabled:a.disabled,mark:N,selected:!!a.checked,danger:a.danger,icon:a.icon,label:a.label,className:a.className,rightControl:a.rightControl,onClick:ie(a),children:a.renderItem?.(a)});return t.jsx(o.Fragment,{children:a.interactiveTooltip?t.jsx(pe,{asChild:!0,placement:a.interactiveTooltip.placement,content:a.interactiveTooltip.content,contentClassName:a.interactiveTooltip.contentClassName,children:b}):b},a.key)})}),i&&t.jsx(t.Fragment,{children:typeof i=="function"?i():i})]}):null,[ie,s,i,r,d,E,L,k]),ue=ce({onContextMenu:ee,onMouseDown:ke});return o.useEffect(()=>{if(!A)return;const a=U.reference.current;let N=null;if(a instanceof Element?N=a:M.current instanceof Element&&(N=M.current),!N)return;const c=new IntersectionObserver(([b])=>{b.isIntersecting||E(!1)},{root:null,threshold:0});return c.observe(N),()=>c.disconnect()},[A,U.reference,E]),t.jsx(C.FloatingTree,{children:t.jsxs(C.FloatingNode,{id:le,children:[t.jsx("span",{ref:U.setReference,className:h.mergeClasses(Dt,m&&"!cursor-not-allowed opacity-75",_,g.DIAL_KIT_CLASS.dropdown),"aria-haspopup":"menu","aria-expanded":A,"aria-controls":K,...ue,children:e}),A&&t.jsx(C.FloatingPortal,{children:t.jsx(C.FloatingFocusManager,{context:F,modal:!1,initialFocus:v!==void 0?v:O?0:-1,returnFocus:!0,children:t.jsxs("div",{id:K,ref:U.setFloating,style:j?{...j,...P}:P,className:h.mergeClasses(jt,!Z&&"w-max","overflow-auto",J,w),...ye({onKeyDown:Te}),children:[I&&t.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:t.jsx(at,{ariaLabel:"Close dropdown",onClose:a=>{y?.(a),E(!1)}})}),Ae]})})})]})})},it=e=>me.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},me.createElement("path",{d:"M20.2954 16.7035C20.2954 17.088 20.6029 17.4069 20.9737 17.4069C21.3445 17.4069 21.6519 17.088 21.6519 16.7035C21.6519 16.3189 21.3445 16 20.9737 16C20.6029 16 20.2954 16.3189 20.2954 16.7035Z",fill:"currentColor"}),me.createElement("path",{d:"M11.7041 16.7035C11.7041 17.088 11.3966 17.4069 11.0258 17.4069C10.655 17.4069 10.3476 17.088 10.3476 16.7035C10.3476 16.3189 10.655 16 11.0258 16C11.3966 16 11.7041 16.3189 11.7041 16.7035Z",fill:"currentColor"}),me.createElement("path",{d:"M19.0221 2.40002L19.5525 1.86969C19.4118 1.72904 19.221 1.65002 19.0221 1.65002V2.40002ZM26.5777 9.95558H27.3277C27.3277 9.75667 27.2487 9.5659 27.108 9.42525L26.5777 9.95558ZM5.42212 29.6H4.67212C4.67212 30.0142 5.00791 30.35 5.42212 30.35V29.6ZM8.44434 2.40002V1.65002V2.40002ZM13.8932 19.5173C13.8932 19.9315 14.229 20.2673 14.6432 20.2673C15.0574 20.2673 15.3932 19.9315 15.3932 19.5173H14.6432H13.8932ZM16.6063 19.5173C16.6063 19.9315 16.9421 20.2673 17.3563 20.2673C17.7705 20.2673 18.1063 19.9315 18.1063 19.5173H17.3563H16.6063ZM19.0221 2.40002H18.2721V8.44447H19.0221H19.7721V2.40002H19.0221ZM19.0221 8.44447H18.2721C18.2721 9.04415 18.5103 9.61927 18.9344 10.0433L19.4647 9.51299L19.995 8.98266C19.8523 8.83992 19.7721 8.64633 19.7721 8.44447H19.0221ZM19.4647 9.51299L18.9344 10.0433C19.3584 10.4674 19.9335 10.7056 20.5332 10.7056V9.95558V9.20558C20.3314 9.20558 20.1378 9.12539 19.995 8.98266L19.4647 9.51299ZM20.5332 9.95558V10.7056H26.5777V9.95558V9.20558H20.5332V9.95558ZM5.42212 29.6H6.17212V5.42225H5.42212H4.67212V29.6H5.42212ZM5.42212 5.42225H6.17212C6.17212 4.81962 6.41151 4.24167 6.83764 3.81554L6.30731 3.28521L5.77698 2.75488C5.06955 3.46231 4.67212 4.42179 4.67212 5.42225H5.42212ZM6.30731 3.28521L6.83764 3.81554C7.26376 3.38942 7.84171 3.15002 8.44434 3.15002V2.40002V1.65002C7.44389 1.65002 6.48441 2.04745 5.77698 2.75488L6.30731 3.28521ZM8.44434 2.40002V3.15002H19.0221V2.40002V1.65002H8.44434V2.40002ZM19.0221 2.40002L18.4918 2.93035L26.0473 10.4859L26.5777 9.95558L27.108 9.42525L19.5525 1.86969L19.0221 2.40002ZM26.5777 9.95558H25.8277V26.5778H26.5777H27.3277V9.95558H26.5777ZM26.5777 26.5778H25.8277C25.8277 27.1804 25.5883 27.7584 25.1622 28.1845L25.6925 28.7148L26.2228 29.2452C26.9302 28.5377 27.3277 27.5783 27.3277 26.5778H26.5777ZM25.6925 28.7148L25.1622 28.1845C24.736 28.6106 24.1581 28.85 23.5555 28.85V29.6V30.35C24.5559 30.35 25.5154 29.9526 26.2228 29.2452L25.6925 28.7148ZM23.5555 29.6V28.85H5.42212V29.6V30.35H23.5555V29.6ZM20.9737 16V16.75C20.9388 16.75 20.9181 16.7345 20.9119 16.7281C20.906 16.722 20.9019 16.7133 20.9019 16.7035H21.6519H22.4019C22.4019 15.9307 21.7842 15.25 20.9737 15.25V16ZM21.6519 16.7035H20.9019C20.9019 16.6936 20.906 16.685 20.9119 16.6788C20.9181 16.6724 20.9388 16.6569 20.9737 16.6569V17.4069V18.1569C21.7842 18.1569 22.4019 17.4762 22.4019 16.7035H21.6519ZM20.9737 17.4069V16.6569C21.0086 16.6569 21.0292 16.6724 21.0354 16.6788C21.0414 16.685 21.0454 16.6936 21.0454 16.7035H20.2954H19.5454C19.5454 17.4762 20.1631 18.1569 20.9737 18.1569V17.4069ZM20.2954 16.7035H21.0454C21.0454 16.7133 21.0414 16.722 21.0354 16.7281C21.0292 16.7345 21.0086 16.75 20.9737 16.75V16V15.25C20.1631 15.25 19.5454 15.9307 19.5454 16.7035H20.2954ZM11.0258 16V16.75C10.9909 16.75 10.9703 16.7345 10.9641 16.7281C10.9582 16.722 10.9541 16.7133 10.9541 16.7035H11.7041H12.4541C12.4541 15.9307 11.8364 15.25 11.0258 15.25V16ZM11.7041 16.7035H10.9541C10.9541 16.6936 10.9582 16.685 10.9641 16.6788C10.9703 16.6724 10.9909 16.6569 11.0258 16.6569V17.4069V18.1569C11.8364 18.1569 12.4541 17.4762 12.4541 16.7035H11.7041ZM11.0258 17.4069V16.6569C11.0607 16.6569 11.0814 16.6724 11.0876 16.6788C11.0935 16.685 11.0976 16.6936 11.0976 16.7035H10.3476H9.59757C9.59757 17.4762 10.2153 18.1569 11.0258 18.1569V17.4069ZM10.3476 16.7035H11.0976C11.0976 16.7133 11.0935 16.722 11.0876 16.7281C11.0814 16.7345 11.0607 16.75 11.0258 16.75V16V15.25C10.2153 15.25 9.59757 15.9307 9.59757 16.7035H10.3476ZM14.6432 19.5173H15.3932C15.3932 19.127 15.6889 18.8604 15.9998 18.8604V18.1104V17.3604C14.8094 17.3604 13.8932 18.3506 13.8932 19.5173H14.6432ZM15.9998 18.1104V18.8604C16.3106 18.8604 16.6063 19.127 16.6063 19.5173H17.3563H18.1063C18.1063 18.3506 17.1901 17.3604 15.9998 17.3604V18.1104Z",fill:"currentColor"})),ut=({id:e,name:s,value:n,labelProps:r,isSelected:i=!1,disabled:d,onChange:l,caption:u,className:m,...x})=>{const S=o.useId(),f=e??S,I=u?`${f}-caption`:void 0,y=o.useCallback(_=>{_.target.checked&&l?.(n)},[l,n]);return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:h.mergeClasses("flex items-center gap-2 ",m,g.DIAL_KIT_CLASS.radio),children:[t.jsx("input",{...x,type:"radio",id:f,name:s,value:n,checked:i,disabled:d,onChange:y,"aria-label":p.resolveAccessibleName(typeof r?.label!="string"?x["aria-label"]:void 0),"aria-describedby":I,className:"peer sr-only"}),t.jsx("label",{htmlFor:f,className:h.mergeClasses("group grid size-[20px] shrink-0 place-items-center rounded-full border transition-colors duration-200 hover:bg-control-accent-alpha-hover","dial-kit-minimum-target","peer-focus-visible:outline peer-focus-visible:outline-focus",d?"cursor-not-allowed border-default bg-control-disable-primary":h.mergeClasses("cursor-pointer",i?"border border-accent bg-control-neutral":"border-default bg-control-neutral")),children:i&&t.jsx("span",{className:h.mergeClasses("size-3 rounded-full",d?"bg-control-disable-secondary":"bg-control-accent")})}),r&&t.jsx(je,{size:p.ElementSize.Standard,...r,htmlFor:f,className:h.mergeClasses("py-[1px]",d?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",r.className)})]}),u&&t.jsx("span",{id:I,className:"dial-tiny-text text-secondary ml-[26px]",children:u})]})},Ze=32,dt=({title:e,description:s,icon:n,live:r=!1,className:i,titleClassName:d,descriptionClassName:l})=>t.jsxs("div",{role:r?"status":void 0,className:h.mergeClasses("flex size-full flex-col items-center justify-center gap-2 text-tertiary",i,g.DIAL_KIT_CLASS.noDataContent),children:[n??t.jsx(it,{width:Ze,height:Ze,"aria-hidden":"true"}),t.jsx("span",{className:h.mergeClasses("dial-tiny-text text-secondary",d),children:e}),s&&t.jsx("span",{className:h.mergeClasses("dial-tiny-text text-secondary",l),children:s})]});var xe=(e=>(e.Light="light",e.Dark="dark",e))(xe||{});const mt="dial-kit-grid",Jt="dial-kit-grid-with-selection",Qt="dial-kit-grid-without-header-borders",en="dial-kit-grid-row-select",tn="dial-kit-grid-header-select",nn="dial-kit-grid-selection-visible",sn="dial-kit-grid-align-right",Le=40,We="0.5px solid var(--stroke-tertiary, #E0E6F0)",fe={accentColor:"var(--bg-control-accent, #1D4ED8)",backgroundColor:"var(--bg-layer-raised, #FCFCFC)",oddRowBackgroundColor:"var(--bg-layer-sunken, #EEF1F7)",selectedRowBackgroundColor:"var(--bg-control-accent-alpha-active-subtle, #2764D914)",rowHoverColor:"var(--bg-control-accent-alpha-hover-subtle, #2764D90A)",borderColor:"var(--stroke-tertiary, #E0E6F0)",rowBorder:We,headerRowBorder:!1,headerColumnBorder:We,headerColumnBorderHeight:12,chromeBackgroundColor:"var(--bg-layer-base, #F5F7FA)",headerBackgroundColor:"var(--bg-layer-raised, #FCFCFC)",foregroundColor:"var(--text-primary, #161B2D)",headerTextColor:"var(--text-secondary, #57647A)",browserColorScheme:"light",headerFontSize:14,headerFontWeight:600,fontSize:14,fontFamily:"var(--theme-font, var(--font-inter))",spacing:4,borderRadius:4,inputBorderRadius:8,wrapperBorderRadius:8};var z=(e=>(e.API="api",e.ROW_DATA_CHANGED="rowDataChanged",e.CHECKBOX_SELECTED="checkboxSelected",e))(z||{});const rn=({params:e,mode:s,label:n,radioName:r,rowId:i,disabled:d})=>{const l=e.node,[u,m]=o.useState(()=>!!l.isSelected());o.useEffect(()=>{const S=()=>m(!!l.isSelected());return S(),l.addEventListener("rowSelected",S),()=>l.removeEventListener("rowSelected",S)},[l]);const x=S=>{d||l.setSelected(S,s===g.GridSelectionMode.SINGLE,z.CHECKBOX_SELECTED)};return s===g.GridSelectionMode.SINGLE?t.jsx(ut,{name:r,value:i,isSelected:u,disabled:d,"aria-label":n,onChange:()=>x(!0)}):t.jsx(Be,{isSelected:u,disabled:d,"aria-label":n,onChange:x})},Ke=e=>{let s=0,n=0;return e.forEachNodeAfterFilter(r=>{r.selectable!==!1&&(n++,r.isSelected()&&s++)}),{selected:s,selectable:n}},on=({api:e,label:s})=>{const[{selected:n,selectable:r},i]=o.useState(()=>Ke(e));o.useEffect(()=>{const l=()=>i(Ke(e));return l(),e.addEventListener("selectionChanged",l),e.addEventListener("modelUpdated",l),()=>{e.isDestroyed()||(e.removeEventListener("selectionChanged",l),e.removeEventListener("modelUpdated",l))}},[e]);const d=o.useCallback(l=>{if(l){e.selectAll("filtered",z.CHECKBOX_SELECTED);return}e.deselectAll("filtered",z.CHECKBOX_SELECTED)},[e]);return t.jsx(Be,{isSelected:r>0&&n===r,isIndeterminate:n>0&&n<r,disabled:r===0,"aria-label":s,onChange:d})},ft="en-US",Ct={year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},_e=40,an={minWidth:_e,width:_e,maxWidth:_e,resizable:!1,sortable:!1,filter:!1,floatingFilter:!1,suppressMovable:!0,suppressHeaderMenuButton:!0,suppressAutoSize:!0,suppressSizeToFit:!0},pt="dial-kit-grid-selection",ln=150,cn=100,un=({columnDefs:e,rowData:s,additionalGridOptions:n,getContextMenuItems:r,className:i,ariaLabel:d="Data grid",wrapCustomCellRenderers:l=!0,disabledRowIds:u,selectedRowIds:m,onSelectionChange:x,onGridApiChange:S,getRowId:f,alternateOddRowColors:I=!1,filterPlaceholder:y="Enter value",emptyStateIcon:_,emptyStateTitle:L="No results found",emptyStateDescription:k="Sorry, we couldn't find any results for your search.",loading:w=!1,wrapperBorder:j=!0,withoutHeaderBorders:H=!1,allowDisabledContextMenu:Y=!1,selectionMode:T,selectRowLabel:V,selectAllLabel:Z="Select all rows",colorScheme:W=xe.Light})=>{g.registerAgGridModulesOnce();const[v,J]=o.useState(),ne=g.useIsMobileScreen(),se=g.useIsTabletScreen(),G=o.useRef(new Set),A=o.useRef(void 0),M=`dial-kit-grid-selection-${o.useId()}`,O=o.useRef({getRowId:f,getContextMenuItems:r,onSelectionChange:x,selectRowLabel:V,wrapCustomCellRenderers:l});O.current={getRowId:f,getContextMenuItems:r,onSelectionChange:x,selectRowLabel:V,wrapCustomCellRenderers:l};const B=o.useCallback(c=>{const b=O.current.getRowId;return b?b(c):String(c.id??JSON.stringify(c))},[]),E=!!r,K=!!l,ve=o.useMemo(()=>g.themeBalham.withPart(W===xe.Dark?g.colorSchemeDark:g.colorSchemeLight).withParams({...fe,browserColorScheme:W,oddRowBackgroundColor:I?fe.oddRowBackgroundColor:fe.backgroundColor,wrapperBorder:j}),[I,W,j]),le=o.useCallback(c=>{c.api.sizeColumnsToFit()},[]),U=ne||se||(m?.size??0)>0,P=o.useCallback(c=>!!c&&!!u?.has(B(c)),[u,B]),F=o.useCallback((c,b,R)=>E?t.jsx(ct,{trigger:[g.DropdownTrigger.ContextMenu],items:c.data?O.current.getContextMenuItems?.(c.data)??[]:[],anchorToMouse:!0,matchReferenceWidth:!0,className:h.mergeClasses("size-full",R&&"cursor-not-allowed opacity-75"),disabled:R&&!Y,children:t.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:b})}):b,[E,Y]),re=o.useCallback(c=>{if(!c.data)return null;const b=P(c.data);return F(c,t.jsx(Ne,{text:c.value==null?"":String(c.value),className:"max-w-full dial-small-text text-primary",hideTooltip:b}),b)},[P,F]),Q=o.useCallback(c=>c===z.API||c===z.ROW_DATA_CHANGED,[]),Ee=o.useMemo(()=>g.debounceFn(c=>{const R=(c.selectedNodes??[]).map(Ve=>Ve.data),$=new Set(R.map(B));G.current=$,A.current=c.source,!Q(c.source)&&O.current.onSelectionChange?.($,R)},cn),[Q,B]),oe=o.useMemo(()=>{if(T)return{...an,colId:pt,headerName:"",headerClass:tn,cellClass:en,headerComponent:T===g.GridSelectionMode.MULTIPLE?on:void 0,headerComponentParams:{label:Z},cellRenderer:c=>{if(!c.data)return null;const b=B(c.data);return t.jsx(rn,{params:c,mode:T,rowId:b,radioName:M,label:O.current.selectRowLabel?.(c.data)??"Select row",disabled:u?.has(b)})}}},[T,Z,B,u,M]),ce=o.useCallback(c=>{if(!c.cellRenderer)return{...c,cellRenderer:re};const b=O.current.wrapCustomCellRenderers;if(!(typeof b=="function"?b(c):!!b))return c;const $=c.cellRenderer;return{...c,cellRenderer:de=>{const gt=P(de.data),Ge=typeof $=="function"?$:void 0,ht=Ge?t.jsx(Ge,{...de}):re(de);return F(de,ht,gt)}}},[P,re,F]),ye=o.useMemo(()=>{const c=K?(e??[]).map(ce):e??[];return oe?[oe,...c]:c},[e,K,ce,oe]),{defaultColDef:q,rowSelection:ee,...ke}=n??{},Te=o.useMemo(()=>({minWidth:ln,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:y,buttons:["reset"]},comparator:g.baseColumnComparator,...g.omitUndefined(q)}),[y,q]),ie=c=>{c.api.sizeColumnsToFit(),J(c.api),n?.onGridReady?.(c),S?.(c.api)};o.useEffect(()=>{v&&s&&v.setGridOption("rowData",s)},[v,s]);const Ae=o.useCallback(()=>t.jsx(dt,{live:!0,title:L,description:k,icon:_??t.jsx(X.IconZoomCancel,{size:100,stroke:.5,"aria-hidden":"true"})}),[L,k,_]),ue=typeof ee=="object"?ee:void 0,a=o.useMemo(()=>T?{isRowSelectable:c=>!P(c.data),...ue,mode:T===g.GridSelectionMode.SINGLE?"singleRow":"multiRow",checkboxes:!1,headerCheckbox:!1}:ee,[ee,ue,P,T]);o.useEffect(()=>{v&&s&&G.current.size&&G.current.forEach(c=>{const b=v.getRowNode(c);b&&!b.isSelected()&&b.setSelected(!0,!1,z.API)})},[v,s]),o.useEffect(()=>{v&&m&&(v.deselectAll("all",z.API),m.forEach(c=>{const b=v.getRowNode(c);b&&!b.isSelected()&&b.setSelected(!0,!1,z.API)}))},[v,m]);const N=o.useCallback(c=>c.data?B(c.data):"",[B]);return o.useEffect(()=>{const c=Q(A.current);if(v&&m?.size&&c){const b=Array.from(m)[0];if(b){const R=v.getRowNode(b);R&&v.ensureNodeVisible(R)}}},[v,Q,m]),t.jsx("div",{className:h.mergeClasses(mt,"size-full",T&&Jt,T&&U&&nn,H&&Qt,i),role:"region","aria-label":d,"aria-busy":w,children:t.jsx("div",{className:"h-full overflow-x-auto",children:t.jsx(g.AgGridReact,{rowModelType:"clientSide",headerHeight:Le,rowHeight:Le,cellSelection:!1,theme:ve,autoSizeStrategy:{type:"fitGridWidth"},columnDefs:ye,defaultColDef:Te,onGridSizeChanged:le,onGridReady:ie,loading:w,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:Ae,rowData:s,rowSelection:a,onSelectionChanged:Ee,getRowId:N,...ke})})})},dn=({value:e,locale:s=ft,options:n=Ct,emptyPlaceholder:r,className:i,hideTooltip:d=!1})=>{const l=g.convertToDate(e),u=o.useMemo(()=>l?new Intl.DateTimeFormat(s,n).format(l):r,[l,r,s,n]),m=l?l.toISOString():void 0;return t.jsx(Ne,{text:m?t.jsx("time",{dateTime:m,children:u}):t.jsx("span",{children:u}),className:h.mergeClasses("dial-small-text text-primary",i),hideTooltip:d})};exports.Checkbox=Be;exports.CheckboxBox=He;exports.CloseButton=at;exports.DEFAULT_DATE_FORMAT_OPTIONS=Ct;exports.DEFAULT_LOCALE=ft;exports.DangerIconButton=Pt;exports.DateCellRenderer=dn;exports.Dropdown=ct;exports.EllipsisTooltip=Ne;exports.GRID_ALIGN_RIGHT_CLASS=sn;exports.GRID_ROOT_CLASS=mt;exports.GRID_SELECTION_COLUMN_ID=pt;exports.GRID_THEME_PARAMS=fe;exports.GhostIconButton=ot;exports.Grid=un;exports.GridColorScheme=xe;exports.IconButton=Ie;exports.InfoButton=Je;exports.InteractiveTooltip=pe;exports.InteractiveTooltipTrigger=Ce;exports.Label=je;exports.MenuItem=ge;exports.MenuItemMark=D;exports.NeutralIconButton=Gt;exports.NoDataContent=dt;exports.PrimaryIconButton=Vt;exports.ROW_HEIGHT=Le;exports.Radio=ut;exports.StaticIconButton=zt;exports.SvgNoData=it;exports.Tooltip=qe;exports.TooltipContainer=we;exports.TooltipContent=Re;exports.TooltipPlacement=Se;exports.TooltipTrigger=De;exports.getButtonClassNames=Ye;exports.getDisabledButtonProps=Xe;exports.overlayGap=st;exports.overlayItemClassName=tt;exports.overlayListClassName=Oe;exports.overlaySubMenuListClassName=et;exports.overlaySurfaceClassName=Me;
|