@maxio-com/react-ui-components 9.34.1 → 9.34.2
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.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/skills/maxio-react/references/components-copy-to-clipboard.md +41 -1
- package/dist/skills/maxio-react/references/foundations-start-here.md +2 -0
- package/dist/temporary-typings/src/components/CopyToClipboard/CopyToClipboard.d.ts +1 -1
- package/dist/temporary-typings/src/components/CopyToClipboard/CopyToClipboard.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/CopyToClipboard/CopyToClipboard.types.d.ts +1 -0
- package/dist/temporary-typings/src/components/CopyToClipboard/CopyToClipboard.types.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/OverlayTrigger/OverlayTrigger.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/OverlayTrigger/portalContainer.d.ts +3 -0
- package/dist/temporary-typings/src/components/OverlayTrigger/portalContainer.d.ts.map +1 -0
- package/dist/temporary-typings/src/hooks/useOverlayTrigger/useOverlayTrigger.d.ts +7 -6
- package/dist/temporary-typings/src/hooks/useOverlayTrigger/useOverlayTrigger.d.ts.map +1 -1
- package/package.json +2 -2
- package/typings/index.d.ts +10 -9
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("classnames"),a=require("react-aria"),l=require("@react-aria/utils"),n=require("react-aria-components"),i=require("@internationalized/date"),r=require("@react-stately/toggle"),o=require("@react-stately/checkbox"),s=require("framer-motion"),c=require("@floating-ui/react-dom-interactions"),m=require("@tanstack/react-table"),d=require("@atlaskit/pragmatic-drag-and-drop/element/adapter"),u=require("@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item"),p=require("@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview"),x=require("@react-stately/radio"),g=require("@react-stately/toast"),b=require("@react-aria/toast");function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var E=f(e);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},h.apply(null,arguments)}const v=["address-card","arrow-down","arrow-down-left","arrow-down-left-long","arrow-down-long","arrow-down-right","arrow-down-right-long","arrow-down-up","arrow-left","arrow-left-long","arrow-left-right","arrow-right","arrow-right-long","arrow-turn-down-right","arrow-up","arrow-up-left","arrow-up-left-long","arrow-up-long","arrow-up-right","arrow-up-right-long","bank","bar-chart","briefcase","building","business-intelligence","calendar","caret-down","caret-left","caret-right","caret-up","chat","check","check-box","check-box-checked","check-box-checked-fill","check-box-indeterminate-fill","check-circle","check-circle-fill","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle","circle-half-stroke-small","circle-small-dash","circle-small-fill","circle-small-stroke","clipboard","cog","copy-file","credit-card","cross","cross-circle","cross-circle-fill","dashboard","diamond-small-fill","document","document-blank","dollar","dot-circle-fill","dot-fill","error","error-fill","error-small-fill","graph","home","info-circle","info-circle-fill","line-vertical","list","login","logout","megaphone","menu","menu-chevron-left","menu-chevron-right","notification","notification-unread","pen","plus","plus-circle","plus-circle-fill","question-circle","question-circle-fill","recently-viewed","search","square-small-fill","trash","triangle-small-fill","user","warning-circle","warning-circle-fill"],_=["anrok","dropbox","hubspot","numeral","oracle","quotapath","sage","sphere","taxjar"],N=["avalara","pipedrive","quickbooks","salesforce","xero"],w=({variant:a,color:l,className:n,size:i,"data-testid":r})=>{const o=(e,t)=>t.includes(e),s=o(a,v)||o(a,_),c=o(a,N),m=t({"fa-kit":s,"fa-kit-duotone":c,"fa-sharp fa-regular":!s&&!c,[`fa-${a}`]:!0,[`fa-${i}`]:i,[`maxio-icon--${l}`]:l&&!o(a,_)&&!o(a,N)},n);return e.createElement("i",{className:m,"data-testid":r})},y=({item:l,isSelected:n,truncateLabel:i=!1,role:r="option",small:o=!1})=>{const s=e.useRef(null),c=e.useRef(!1),m=a.useId();if(e.useEffect(()=>{n&&c.current&&s.current?.focus()},[n]),e.useEffect(()=>{c.current=!0},[]),"divider"===l.type)return e.createElement("div",{className:"maxio-action-list__divider",role:"separator","aria-hidden":"true"});const{leadingIconName:d,leadingIconClassName:u,trailingIconName:p,label:x,description:g,link:b}=l,f=t("maxio-action-list__label",{"maxio-truncate":i});return e.createElement("a",h({"aria-labelledby":m},b,{className:t("maxio-action-list__content",b.className,{"maxio-action-list__content--size-small":o}),tabIndex:n?0:-1,ref:s,role:r}),d&&e.createElement(w,{variant:d,className:t("maxio-action-list__leading-icon",u)}),e.createElement("span",{className:f,id:m},x),g&&e.createElement("span",{className:"maxio-action-list__description"},g),p&&e.createElement(w,{variant:p,className:"maxio-action-list__trailing-icon"}))},C=(e,t,a)=>0===e?e:1===e&&"divider"===t[e-1].type?a||e:"divider"===t[e-1].type?C(e-1,t,a||e):e-1,I=({items:a,isShadowed:l=!0,itemProps:n={},className:i,truncateLabels:r=!1,small:o=!1,...s})=>{const c=t("maxio-action-list",i,{"maxio-action-list--shadow":l}),[m,d]=e.useState(()=>a.findIndex(e=>"divider"!==e.type));return 0===a.length?null:e.createElement("div",h({className:c,onKeyDown:e=>{if("Space"===e.code||"Enter"===e.code){const e=a[m];e&&"divider"!==e.type&&window.open(e.link.href,e.link.target||"_self")}"ArrowUp"===e.code&&(e.preventDefault(),d(e=>C(e,a))),"ArrowDown"===e.code&&(e.preventDefault(),d(e=>((e,t)=>{const a=t.findIndex((t,a)=>"divider"!==t.type&&a>e);return-1===a?e:a})(e,a)))},role:"listbox"},s),a.map((t,a)=>e.createElement(y,h({item:t,truncateLabel:r,key:`listbox-${t.id}`,isSelected:a===m,small:o},n))))},R=({className:a,children:l,disabled:n,external:i,icon:r,size:o="sm",underline:s,variant:c,...m})=>{const d=t("maxio-link",{[`maxio-link--${o}`]:o,"maxio-link--disabled":n,[`maxio-link--${c}`]:c,"maxio-link--underline":s},a),u=i?"_blank":"_self";return e.createElement("a",h({className:d,target:u},m),l,r&&e.createElement(w,{variant:r,className:"maxio-link__icon"}))},k=({size:a="md",white:l=!1,className:n,"data-testid":i})=>{const r=t("maxio-loading-spinner",n,`maxio-loading-spinner--${a}`,{"maxio-loading-spinner--white":l});return e.createElement("div",{className:r,role:"status","aria-label":"loading","data-testid":i})},S=e.forwardRef(({fullWidth:n=!1,leadingElement:i,trailingElement:r,icon:o,variant:s="primary",size:c,...m},d)=>{const u=l.useObjectRef(d),{linkProps:p}=a.useLink({...m},u),x=t("maxio-button",m.className,{[`maxio-button--${c}`]:c,[`maxio-button--${s}`]:s,"maxio-button--full-width":n});return e.createElement("a",h({},p,{ref:u,className:x,href:m.href}),i&&e.cloneElement(i,{...e.isValidElement(i)&&{className:"maxio-button__leading-element"}}),m.children,(r||o)&&e.cloneElement(r||o,{...e.isValidElement(r||o)&&{className:"maxio-button__trailing-element"}}))}),D=e.forwardRef(({disabled:n,loading:i=!1,fullWidth:r=!1,leadingElement:o,trailingElement:s,icon:c,variant:m="primary",size:d,...u},p)=>{const x=l.useObjectRef(p),{buttonProps:g}=a.useButton({...u,isDisabled:n,formAction:"string"==typeof u.formAction?u.formAction:void 0},x),b=["primary","danger"].includes(m),f=t("maxio-button",u.className,{[`maxio-button--${d}`]:d,[`maxio-button--${m}`]:m,"maxio-button--loading":i,"maxio-button--full-width":r});return e.createElement("button",h({},g,{className:f,ref:x}),o&&e.cloneElement(o,{...e.isValidElement(o)&&{className:"maxio-button__leading-element"}}),u.children,!i&&(s||c)&&e.cloneElement(s||c,{...e.isValidElement(s||c)&&{className:"maxio-button__trailing-element"}}),i&&e.createElement(k,{className:"maxio-button__trailing-element",size:"md",white:b}))}),P=e.forwardRef((t,a)=>(e=>"href"in e)(t)?e.createElement(S,h({},t,{ref:a})):e.createElement(D,h({},t,{ref:a}))),T=({"aria-label":a,className:l,...n})=>e.createElement(P,h({"aria-label":a,className:t("maxio-button--icon",l)},n),null),M=(e,...t)=>e?[e,...t].join("."):void 0,O=({children:a,title:l,linkText:n,linkExternal:i,href:r,display:o="inline",sentiment:s="info",onDismiss:c,className:m,"data-testid":d})=>{if(!a&&!l)return console.warn("Alert component requires either children or title prop to be rendered"),null;const u=t("maxio-alert",{[`maxio-alert--${s}`]:"info"!==s&&s},m),p={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[s],x=t("maxio-alert__content",{"maxio-alert__content--block":"block"===o});return e.createElement("div",{className:u,"data-testid":d},e.createElement(w,{variant:p,className:"maxio-alert__icon","aria-hidden":"true"}),e.createElement("section",{className:"maxio-alert__container"},e.createElement("div",{className:x},l&&e.createElement("span",{className:"maxio-alert__title"},l),a&&e.createElement("span",{className:"maxio-alert__message"},a),n&&r&&e.createElement(R,h({className:"maxio-alert__link",href:r,variant:"high-contrast",underline:!0},i?{external:!0}:{}),n))),c&&e.createElement(T,{icon:e.createElement(w,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:c,className:"maxio-alert__dismiss","data-testid":M(d,"dismiss")}))},$=e.createContext({}),L=({children:t,testId:a})=>{const[l,n]=e.useState(!1),i=e.useId(),r=e.useId();return e.createElement($.Provider,{value:{controlsId:i,buttonId:r,isOpen:l,onClose:()=>n(!1),onOpen:()=>n(!0),onToggle:()=>n(e=>!e),testId:a}},t)};function B(){const t=e.useContext($);if(!t||"object"==typeof t&&0===Object.keys(t).length)throw new Error("useMenu hook must be used within a MenuProvider");return t}const z=({children:t})=>{const{isOpen:a,onToggle:l,onClose:n,testId:i}=B();return e.createElement("details",{open:a,onToggle:l,className:"maxio-action-menu","data-testid":i},"function"==typeof t?t({isOpen:a,onClose:n}):t)},F=({children:a,className:l,href:n,...i})=>{const r=n?e.createElement(R,{size:"sm",href:n},a):a;return e.createElement("li",h({className:t("maxio-breadcrumbs__item",l)},i),r)},A="Breadcrumbs requires at least one BreadcrumbsItem as children",V='Last BreadcrumbsItem should not have "href" prop. It is the current page.',H="Breadcrumbs only accepts BreadcrumbsItem as children",W=({children:a,arrowPosition:l,size:n="regular",maxWidth:i=160,"data-testid":r="tooltip"})=>e.createElement("div",{"data-testid":r,className:t("maxio-tooltip",`maxio-tooltip--${n}`,{[`maxio-tooltip--arrow-${l}`]:l})},e.createElement("div",{className:"maxio-tooltip__content",style:{maxWidth:i}},a)),j={click:c.useClick,hover:e=>c.useHover(e,{delay:100}),focus:c.useFocus,dismiss:c.useDismiss},q=(e,t)=>t.map(t=>j[t](e)),G=({placement:t="top",isActive:a=!1,interactions:l=["hover"],floatingElementOffset:n=0,onOverlayUpdate:i,autoHideMs:r})=>{const o=e.useRef(null),{strategy:s,x:m,y:d,context:u,floating:p,reference:x}=c.useFloating({placement:t,open:a,onOpenChange:e=>i(e),middleware:[c.offset(n)],whileElementsMounted:c.autoUpdate}),{getReferenceProps:g,getFloatingProps:b}=c.useInteractions([...q(u,l),c.useRole(u,{role:"tooltip"})]);e.useEffect(()=>{o.current&&clearTimeout(o.current),a&&r&&(o.current=window.setTimeout(()=>i(!1),r))},[a,r]);return{isActive:a,refs:{floating:p,reference:x},floatingElementCSSPosition:{position:s,top:d??0,left:m??0},getReferenceProps:g,getFloatingProps:b}};function U(t,a=0){const l=e.useRef((new Date).getTime()),n=e.useRef((new Date).getTime()),[i,r]=e.useState(!1);return e.useEffect(()=>{const e=()=>{l.current=(new Date).getTime(),r(!0)},i=()=>{n.current=(new Date).getTime(),window.setTimeout(()=>{l.current-n.current<=0&&r(!1)},a)},o=t&&t.current;return o&&(o.addEventListener("mouseenter",e),o.addEventListener("mouseleave",i)),()=>{o&&(o.removeEventListener("mouseenter",e),o.removeEventListener("mouseleave",i))}},[t]),i}function K(t=500){const[a,l]=e.useState(()=>{if("undefined"==typeof window)return{windowWitdh:0,windowHeight:0};const{innerWidth:e,innerHeight:t}=window;return{windowWitdh:e,windowHeight:t}}),n=e.useRef(null);return e.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{const{innerWidth:e,innerHeight:a}=window;window.clearTimeout(n.current??void 0),n.current=window.setTimeout(()=>{l({windowWitdh:e,windowHeight:a})},t)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[t]),a}function Y(t){const[a,n]=e.useState(()=>t.current?.clientWidth??0),i=()=>{const e=t.current?.clientWidth??0;n(t=>0===e&&t>0?t:e)};return e.useLayoutEffect(i,[t]),l.useResizeObserver({ref:t,onResize:i}),a}const Z=({children:a,usePortal:l=!1,isActive:n=!1,placement:i="top",interactions:r=["hover"],role:o="tooltip",renderOverlay:m,floatingElementOffset:d,motionSettings:u={},autoHideMs:p,onOverlayUpdate:x,className:g,"data-testid":b="overlay-trigger"})=>{const{getReferenceProps:f,getFloatingProps:E,refs:{floating:v,reference:_},floatingElementCSSPosition:N}=G({isActive:n,onOverlayUpdate:x,autoHideMs:p,floatingElementOffset:d,interactions:r,placement:i}),w=e.createElement(s.AnimatePresence,null,n&&e.createElement(s.motion.div,h({ref:v,style:N},u,E()),m()));return e.createElement(e.Fragment,null,e.createElement("div",h({ref:_,className:t("maxio-inline-flex",g)},f(),{"data-testid":b}),a),l?e.createElement(c.FloatingPortal,{id:"maxio-ui-portal"},w):w)},Q={top:"bottom",right:"left",bottom:"top",left:"right","top-start":"bottom-left","top-end":"bottom-right","right-start":"left-top","right-end":"left-bottom","bottom-start":"top-left","bottom-end":"top-right","left-start":"right-top","left-end":"right-bottom"},X=({children:t,interactions:a=["hover"],placement:l="right",maxWidth:n=160,size:i="regular",renderContent:r,autoHideMs:o,isVisible:s,usePortal:c,className:m,onVisibilityUpdate:d,floatingElementOffset:u=5,"data-testid":p})=>{const[x,g]=e.useState(!1),b=void 0!==s,f=e.useRef(null),E=e.useCallback(e=>{f.current&&clearTimeout(f.current),f.current=window.setTimeout(()=>{b||g(e),d&&d(e)},50)},[b,d]),h=e.useMemo(()=>(e=>{const t=e.startsWith("top")||e.startsWith("bottom")?"Y":"X",a=`translate${t}(${e.startsWith("bottom")||e.startsWith("right")?"-":""}10px)`;return{initial:{opacity:0,visibility:"hidden",transform:a},animate:{opacity:1,visibility:"visible",transform:`translate${t}(0px)`},exit:{opacity:0,visibility:"hidden",transform:a},transition:{ease:[.4,0,.5,1],duration:.2}}})(l),[l]);return e.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]),e.createElement(Z,{role:"tooltip",className:m,floatingElementOffset:u,motionSettings:h,isActive:b?s:x,onOverlayUpdate:E,autoHideMs:o,usePortal:c,placement:l,interactions:a,"data-testid":p,renderOverlay:()=>e.createElement(W,{size:i,arrowPosition:Q[l],maxWidth:n,"data-testid":M(p,"tooltip")},r())},t)},J="maxio-copy-to-clipboard--subtle",ee="maxio-copy-to-clipboard--xs",te={idle:"copy-file",copied:"check",error:"error"},ae="row-controls",le="row-actions",ne=({children:a,pattern:l,size:n,isExpandable:i,isUsingCustomRow:r,"data-testid":o})=>{const[s,c]=e.useState(!1),[m,d]=e.useState(!1),u=l&&r&&i,p=t("maxio-data-table",{"maxio-data-table--pattern":l&&!u,"maxio-data-table--expanded-child-pattern":u,"maxio-data-table--with-custom-row":r,[`maxio-data-table--${n}`]:n,"maxio-data-table--with-pinned-left-border":s,"maxio-data-table--with-pinned-right-border":m});return e.createElement("div",{className:"maxio-data-table-wrapper",onScroll:e=>{const t=e.target;c(t.scrollLeft>0),d(t.scrollWidth-t.clientWidth-t.scrollLeft>0)},"data-testid":o},e.createElement("table",{className:p},a))},ie=({children:t})=>e.createElement("thead",null,t),re=({children:t})=>e.createElement("tbody",null,t),oe=({children:a,table:l,header:n,className:i,enableExpanding:r,...o})=>{const s=n?.column,c=s?.getCanSort?.(),m=s?.getToggleSortingHandler?.(),d=n?.isPlaceholder,u=s?.columnDef?.meta?.align,p=s?.columnDef?.meta?.width,x=s?.columnDef?.meta?.controls,g=s?.columnDef?.meta?.actions,b=s?.getIsPinned(),f=s?.getIsSorted(),E="asc"===f,v=t("maxio-data-table__cell",i,{[`maxio-data-table__cell--pinned-${b}`]:b,"maxio-data-table__cell--sortable":c,"maxio-data-table__cell--active":f,[`maxio-data-table__cell--${u}`]:u,"maxio-data-table__cell--controls":x,"maxio-data-table__cell--actions":g}),_={...p?{width:p}:{},..."left"===b?{left:s?.getStart("left")}:"right"===b?{right:s?.getAfter("right")}:{}},N=((e,t)=>e&&t?"arrow-up":e&&!t?"arrow-down":"arrow-down-up")(!!f,E),y=l?.getToggleAllRowsExpandedHandler(),C=l?.getIsAllRowsExpanded?.(),I=n?.headerGroup.headers[0].id===ae?1:0,R=r&&n?.index===I;return d?null:e.createElement("th",h({scope:"col",role:"columnheader","aria-sort":f?E?"ascending":"descending":"none",className:v,onClick:m,colSpan:n?.colSpan,style:_},o),e.createElement("div",{className:"maxio-data-table__cell-flex"},!0===r&&R&&e.createElement(T,{size:"sm",variant:"ghost",icon:e.createElement(w,{size:"xs",variant:C?"chevron-down":"chevron-right"}),onClick:y,"aria-label":C?"Collapse all rows":"Expand all rows","data-open":C,className:"maxio-data-table__expand-button"}),a,c&&e.createElement(w,{variant:N,className:"maxio-data-table__sort-icon"})))},se=e=>e.subRows??[],ce=(e,t)=>Object.assign({},e,{subRows:t}),me=(e,t,a=[])=>{for(let l=0;l<e.length;l+=1){const n=e[l],i=[...a,l];if(n===t)return i;const r=me(se(n),t,i);if(r)return r}return null},de=(e,t)=>{const[a,...l]=t,n=e[a];if(!n)return null;const i=[...e];if(0===l.length)return i.splice(a,1),{data:i,item:n};const r=de(se(n),l);return r?(i[a]=ce(n,r.data),{data:i,item:r.item}):null},ue=(e,t,a,l)=>{const n=[...e];if(0===t.length)return n.splice(a,0,l),n;const[i,...r]=t,o=e[i];if(!o)return null;const s=ue(se(o),r,a,l);return s?(n[i]=ce(o,s),n):null},pe=(e,t)=>{let a,l=e;for(const e of t){if(a=l[e],!a)return;l=se(a)}return a},xe="maxio-data-table-row",ge=e.createContext(null),be=()=>e.useContext(ge),fe=e=>e.type===xe&&"string"==typeof e.instanceId&&"string"==typeof e.rowId,Ee=e=>{const t=(e=>{const t=u.extractInstruction(e);return t&&"instruction-blocked"!==t.type?"reorder-above"===t.type?"before":"reorder-below"===t.type?"after":"make-child"===t.type?"inside":null:null})(e);return"string"==typeof e.rowId&&t?{rowId:e.rowId,position:t}:null},he=({availability:t,children:a,data:l,enableExpanding:n,getRowReorderLabel:i,onRowReorder:r,rowReorderMode:o,table:s})=>{const c=`maxio-data-table-${e.useId()}`,[m,x]=e.useState(""),[g,b]=e.useState(null),[f,E]=e.useState(null),h=e.useRef(null),v=e.useCallback(e=>s.getCoreRowModel().rowsById[e],[s]),_=e.useCallback(e=>i?.(e)??e.id,[i]),N=e.useCallback((e,t)=>{const a=v(e),i=v(t.rowId);if(!a||!i)return null;const r=((e,t,a,l,n)=>{if(t.id===a.id||!((e,t,a,l)=>"all"===l||("siblings"===l?"inside"!==a&&(e.parentId??null)===(t.parentId??null):"inside"===a?e.depth===t.depth+1:e.depth===t.depth))(t,a,l,n))return null;const i=me(e,t.original),r=me(e,a.original);if(!i||!r||(s=r,(o=i).length<s.length&&o.every((e,t)=>s[t]===e)))return null;var o,s;const c=de(e,i);if(!c)return null;const m=((e,t)=>{const a=[...e],l=t.length-1;return l>=0&&e.length>l&&t.slice(0,l).every((t,a)=>e[a]===t)&&t[l]<e[l]&&(a[l]-=1),a})(r,i),d=m[m.length-1];if(void 0===d)return null;const u="inside"===l?m:m.slice(0,-1),p=pe(c.data,m);if(!p)return null;const x="inside"===l?se(p).length:d+("after"===l?1:0),g={parentRowId:"inside"===l?a.id:a.parentId??null,index:x},b={parentRowId:t.parentId??null,index:t.index};if(b.parentRowId===g.parentRowId&&b.index===g.index)return null;const f=ue(c.data,u,x,c.item);return f?{data:f,source:b,destination:g}:null})(l,a,i,t.position,o);return r&&!n&&null!==r.destination.parentRowId&&r.destination.parentRowId!==r.source.parentRowId?null:r},[l,n,v,o]),w=e.useCallback(e=>{h.current=e,b(e)},[]),y=e.useCallback((e,t)=>{const a=v(e),l=v(t.rowId),n=N(e,t);return a&&l&&n?(r({...n,row:a,rowId:a.id,targetRow:l,targetRowId:l.id,position:t.position}),x(`${_(a)} moved ${i=_(l),o=t.position,"inside"===o?`inside ${i}`:`${o} ${i}`}.`),!0):(x("That row cannot be moved to this position."),!1);var i,o},[_,N,v,r]),C=e.useCallback((e,{input:t,element:a,source:l})=>{const n={rowId:e.id,instanceId:c},i=u.attachInstruction(n,{element:a,input:t,currentLevel:e.depth,indentPerLevel:24,mode:"standard"}),r=Ee(i),o=fe(l.data)&&l.data.instanceId===c&&Boolean(r&&N(l.data.rowId,r));return{...i,isValid:o}},[N,c]),I=e.useCallback((e,a)=>{if(!t.available)return()=>{};const l=e=>{const t=e.isValid?Ee(e):null;w(t)};return d.dropTargetForElements({element:a,canDrop:({source:t})=>fe(t.data)&&t.data.instanceId===c&&t.data.rowId!==e.id&&!e.getParentRows().some(e=>e.id===t.data.rowId),getData:t=>C(e,t),onDragEnter:({self:e})=>l(e.data),onDrag:({self:e})=>l(e.data),onDragLeave:()=>{h.current?.rowId===e.id&&w(null)}})},[t,C,c,w]),R=e.useCallback((e,a)=>{const l=a.closest("tr");return t.available&&l instanceof HTMLElement?d.draggable({element:l,dragHandle:a,getInitialData:()=>({type:xe,instanceId:c,rowId:e.id}),onGenerateDragPreview:({nativeSetDragImage:t})=>{p.setCustomNativeDragPreview({nativeSetDragImage:t,render:({container:t})=>{const a=document.createElement("div");return a.className="maxio-data-table__drag-preview",a.textContent=_(e),a.setAttribute("aria-hidden","true"),t.append(a),()=>a.remove()}})}}):()=>{}},[t,_,c]);e.useEffect(()=>{if(t.available)return d.monitorForElements({canMonitor:({source:e})=>fe(e.data)&&e.data.instanceId===c,onDragStart:({source:e})=>{if(!fe(e.data))return;const t=v(e.data.rowId);E(e.data.rowId),t&&x(`${_(t)} grabbed. Choose a destination.`)},onDrop:({source:e,location:t})=>{if(fe(e.data)){const a=t.current.dropTargets[0]?.data,l=!0===a?.isValid?Ee(a):null;l?y(e.data.rowId,l):x("Row move cancelled.")}E(null),w(null)}})},[y,t,_,v,c,w]),e.useEffect(()=>{if("inside"!==g?.position)return;const e=v(g.rowId);if(!e?.getCanExpand()||e.getIsExpanded())return;const t=window.setTimeout(()=>e.toggleExpanded(!0),500);return()=>window.clearTimeout(t)},[g,v]);const k=e.useCallback(e=>{if(!t.available)return[];const a=e.parentId?v(e.parentId):null,l=a?.subRows??s.getCoreRowModel().rows,n=l.findIndex(t=>t.id===e.id);if(-1===n)return[];const i=l[n-1],r=l[n+1],o=l[0],c=l[l.length-1],m=[];if(n>1&&o&&m.push({id:"top",label:"Move to top",target:{rowId:o.id,position:"before"}}),i&&m.push({id:"up",label:"Move up",target:{rowId:i.id,position:"before"}}),r&&m.push({id:"down",label:"Move down",target:{rowId:r.id,position:"after"}}),n<l.length-2&&c&&m.push({id:"bottom",label:"Move to bottom",target:{rowId:c.id,position:"after"}}),a){let e=a;for(;e.parentId;){const t=v(e.parentId);if(!t)break;e=t}m.push({id:"move-to-root",label:"Move to root",target:{rowId:e.id,position:"after"}})}return s.getCoreRowModel().flatRows.forEach(t=>{t.id!==e.parentId&&m.push({id:`move-to:${t.id}`,label:`Move to ${_(t)}`,target:{rowId:t.id,position:"inside"}})}),m.filter(t=>Boolean(N(e.id,t.target)))},[t,_,N,v,s]),S=e.useCallback(e=>{if(!t.available)return!1;const a=e.parentId?v(e.parentId):null;return(a?.subRows??s.getCoreRowModel().rows).length>1||"siblings"!==o&&("all"===o?Boolean(a):!(!n||0===e.depth)&&s.getCoreRowModel().flatRows.some(t=>t.depth===e.depth-1&&t.id!==e.parentId))},[t,n,v,o,s]),D=e.useMemo(()=>({activeTarget:g,availability:t,draggingRowId:f,getActions:k,getLabel:_,hasActions:S,moveRow:y,registerHandle:R,registerRow:I}),[g,t,y,f,k,_,S,R,I]);return e.createElement(ge.Provider,{value:D},a,e.createElement("span",{className:"maxio-data-table__live-region",role:"status","aria-live":"polite","aria-atomic":"true"},m))},ve=({children:l,row:n,isChild:i,isHeader:r,className:o,onRowAction:s,...c})=>{const m=n?.getIsSelected?.(),d=n?.getCanExpand?.()&&n?.getIsExpanded?.(),u=Boolean(n&&s&&!r&&!i),p=e.useRef(null),x=be(),g=x?.registerRow,b=e.useRef(null),f=e=>{b.current=e.target},{pressProps:E}=a.usePress({isDisabled:!u,onPress:e=>{const t=b.current??e.target;b.current=null,n&&s&&!(e=>e instanceof Element&&Boolean(e.closest("a,button,input,select,textarea,label,.maxio-data-table__cell--controls,.maxio-data-table__cell--actions")))(t)&&s(n)}}),{focusProps:v,isFocused:_}=a.useFocusRing(),N=t({"maxio-data-table__row":!r,"maxio-data-table__header-row":r,"maxio-data-table__row--active":m||_,"maxio-data-table__row--expanded":d,"maxio-data-table__row--expanded-child":i,"maxio-data-table__row--actionable":u,"maxio-data-table__row--dragging":Boolean(n)&&x?.draggingRowId===n?.id,[`maxio-data-table__row--drop-${x?.activeTarget?.position}`]:Boolean(n)&&x?.activeTarget?.rowId===n?.id},o);e.useEffect(()=>{if(n&&g&&p.current&&!r&&!i)return g(n,p.current)},[i,r,g,n]);const w=u?a.mergeProps({onClickCapture:f,onKeyDownCapture:f,tabIndex:0},E,v,c):c;return e.createElement("tr",h({},w,{ref:p,className:N,tabIndex:u?w.tabIndex:c.tabIndex}),l)},_e=e.createContext({}),Ne=e.forwardRef(({checked:a,disabled:l,invalid:n,indeterminate:i,className:r,inputProps:o,error:s,label:c},m)=>{const d=t("maxio-checkbox",{"maxio-checkbox--checked":a,"maxio-checkbox--disabled":l,"maxio-checkbox--error":n,"maxio-checkbox--indeterminate":i},r);return e.createElement("label",{className:d},e.createElement("input",h({type:"checkbox",role:"checkbox",className:"maxio-checkbox__input",ref:m},o)),e.createElement("span",{className:"maxio-checkbox__control"},s&&e.createElement("span",{className:"maxio-checkbox__control-error"})),c&&e.createElement("span",{className:"maxio-checkbox__label"},c))});Ne.displayName="InnerCheckbox";const we=({label:t,error:l=!1,className:n,indeterminate:i,value:o="",disabled:s,readOnly:c,defaultChecked:m,checked:d,...u})=>{const p=e.useRef(null),x=e.useContext(_e),{inputProps:g,isDisabled:b,isInvalid:f,isSelected:E}=x&&Object.keys(x).length>0?a.useCheckboxGroupItem({value:o,"aria-label":t??u["aria-label"],isDisabled:s,isInvalid:l,isIndeterminate:i,isReadOnly:c,...u},x,p):a.useCheckbox({"aria-label":t??u["aria-label"],isDisabled:s,isInvalid:l,isIndeterminate:i,isReadOnly:c,value:o,...u},r.useToggleState({...u,isSelected:d,defaultSelected:m}),p);return e.createElement(Ne,h({inputProps:g,checked:E,disabled:b,invalid:f,indeterminate:i,className:n,error:l,label:t,ref:p},u))},ye=({children:a,className:l,...n})=>e.createElement("div",h({className:t("maxio-form-helper-text",l)},n),a),Ce=({children:a,className:l,...n})=>e.createElement("div",h({className:t("maxio-form-error",l)},n),e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},a)),Ie=({table:t,enableRowSelection:a,enableRowReordering:l})=>{const n=t?.getToggleAllPageRowsSelectedHandler?.(),i=t?.getIsAllPageRowsSelected?.()||t?.getIsAllRowsSelected?.(),r=t?.getIsSomePageRowsSelected?.();return a?e.createElement(e.Fragment,null,l&&e.createElement("span",{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon","aria-hidden":"true",style:{visibility:"hidden"}}),e.createElement(we,{"aria-label":"Select all rows",onChange:e=>{n("boolean"==typeof e?{target:{checked:e}}:e)},checked:i,indeterminate:!i&&r})):null},Re=({className:a,hideArrow:l=!1,children:i,offset:r=4,...o})=>e.createElement(n.Popover,h({},o,{className:t("maxio-popover",a),offset:r}),e.createElement(e.Fragment,null,!l&&e.createElement(n.OverlayArrow,{className:"maxio-popover__arrow"},e.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12","aria-hidden":!0},e.createElement("path",{d:"M0 0 L6 6 L12 0"}))),i)),ke=({row:t})=>{const a=be(),l=a?.registerHandle,i=a?.getActions,r=a?.hasActions,o=e.useRef(null),[s,c]=e.useState(!1),m=a?.draggingRowId===t.id,d=a?.getLabel(t)??t.id,u=e.useMemo(()=>r?.(t)??!1,[r,t]),p=e.useMemo(()=>s?i?.(t)??[]:[],[i,s,t]),x=(a&&!a.availability.available?a.availability.message:void 0)??(u?void 0:`No moves are available for ${d}.`);e.useEffect(()=>{if(l&&o.current&&!x)return l(t,o.current)},[l,t,x]),e.useEffect(()=>{x&&c(!1)},[x]);const g=e.createElement(n.Button,{ref:o,type:"button",className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon maxio-data-table__drag-handle","aria-label":`Reorder ${d}`,"aria-pressed":m,"aria-disabled":!!x||void 0,onPress:()=>{x||c(!0)}},e.createElement("i",{className:"fa-sharp fa-solid fa-grip-dots-vertical "+(x?"maxio-icon--disabled":"maxio-icon--secondary")}));return x?e.createElement(n.TooltipTrigger,{delay:0,closeDelay:0},g,e.createElement(n.Tooltip,{placement:"bottom start",offset:8,className:"maxio-tooltip maxio-tooltip--arrow-top-left"},e.createElement("div",{className:"maxio-tooltip__content"},x))):e.createElement(n.MenuTrigger,{trigger:"longPress",isOpen:s,onOpenChange:c},g,e.createElement(Re,{placement:"bottom start",hideArrow:!0},e.createElement(n.Menu,{autoFocus:"first",className:"maxio-data-table__reorder-menu",items:p,onAction:e=>{const l=p.find(t=>t.id===e);l&&(a?.moveRow(t.id,l.target),requestAnimationFrame(()=>o.current?.focus()))}},t=>e.createElement(n.MenuItem,{id:t.id,textValue:t.label,className:"maxio-data-table__reorder-menu-item"},t.label))))},Se=({row:t,enableRowSelection:a,enableRowReordering:l})=>{const n=t?.getToggleSelectedHandler?.(),i=t?.getIsSelected?.()||t?.getIsAllSubRowsSelected?.(),r=t?.getIsSomeSelected?.(),o=t.id||t.index;return e.createElement(e.Fragment,null,l&&e.createElement(ke,{row:t}),a&&e.createElement(we,{"aria-label":`Select row ${o}`,onChange:n,checked:i,indeterminate:r}))},De=({children:t})=>e.createElement("div",{className:"maxio-data-table__cell-flex"},t),Pe=({row:a,cell:l,children:n,className:i,...r})=>{const o=l?.column,s=o?.columnDef?.meta?.align,c=o?.columnDef?.meta?.controls,m=o?.columnDef?.meta?.actions,d=o?.getIsPinned(),u=t("maxio-data-table__cell",i,{[`maxio-data-table__cell--pinned-${d}`]:d,[`maxio-data-table__cell--${s}`]:s,"maxio-data-table__cell--controls":c,"maxio-data-table__cell--actions":m}),p="left"===d?{left:o?.getStart("left")}:"right"===d?{right:o?.getAfter("right")}:{};return e.createElement("td",h({className:u,style:p},r),n)},Te=({row:t,SubRowComponent:a,pattern:l,enableExpanding:n,onRowAction:i,testId:r})=>{const o=a&&t.getParentRow()&&t.getParentRow().getIsExpanded(),s=o&&t.getVisibleCells()[0].column.columnDef.id===ae,c=o&&t.getVisibleCells()[t.getVisibleCells().length-1].column.columnDef.id===le,d=[c,s].filter(Boolean).length,u=t.getVisibleCells().length-d,p=t.getParentRow()?.index??t.index,x=l&&a&&p%2==1?"maxio-data-table__row--with-pattern":void 0,g=t.getCanExpand?.(),b=t?.getToggleExpandedHandler?.(),f=t?.getIsExpanded?.(),E=g&&n?0:1.75,h=t.getVisibleCells()[0].column.columnDef.id===ae?1:0,v=t.getVisibleCells().find(({column:e})=>{const{actions:t,controls:a}=e.columnDef.meta??{};return!t&&!a}),_=i&&v?v.id:void 0;return e.createElement(e.Fragment,{key:t.id},o?e.createElement(ve,{key:`${t.id}-sub`,row:t,isChild:!0,className:x,"data-testid":M(r,"row",t.id)},s&&e.createElement(Pe,{className:"maxio-data-table__cell--pinned-left"}),e.createElement(Pe,{colSpan:u},a(t)),c&&e.createElement(Pe,{className:"maxio-data-table__cell--pinned-right"})):e.createElement(ve,{key:`${t.id}-parent`,row:t,className:x,onRowAction:i,"aria-labelledby":_,"data-testid":M(r,"row",t.id)},t.getVisibleCells().map(a=>{const l=n&&a.column.getIndex()===h;return e.createElement(Pe,{key:a.id,row:t,cell:a,id:a.id,"data-testid":M(r,"cell",t.id,a.column.id)},e.createElement("div",{className:"maxio-data-table__cell-flex",style:n&&l?{paddingLeft:`${t?.depth+E}rem`}:void 0},n&&g&&l&&e.createElement(T,{size:"sm",variant:"ghost",icon:e.createElement(w,{size:"xs",variant:f?"chevron-down":"chevron-right"}),onClick:b,"aria-label":f?"Collapse row":"Expand row","data-open":f,className:"maxio-data-table__expand-button"}),m.flexRender(a.column.columnDef.cell,a.getContext())))})))},Me={available:!0},Oe={available:!1,reason:"filtering",message:"Reordering is unavailable while the table is filtered."},$e={available:!1,reason:"grouping",message:"Reordering is unavailable while the table is grouped."},Le={available:!1,reason:"pagination",message:"Reordering is unavailable while the table is paginated."},Be=(e=[])=>e.filter(e=>e!==ae&&e!==le),ze=[],Fe=e=>e.subRows;const Ae=({as:a="div",children:l,compact:n=!1,size:i="md",className:r,...o})=>{const s=a,c=t({[`maxio-body-${i}`]:!n,[`maxio-body-${i}-compact`]:n},r);return e.createElement(s,h({className:c},o),l)},Ve={sm:"h3",md:"h2",lg:"h1"},He=({children:a,size:l="sm",className:n,...i})=>{const r=Ve[l],o=t(`maxio-heading-${l}`,n);return e.createElement(r,h({className:o},i),a)},We=e.createContext(void 0),je=e=>null!=e&&!1!==e&&""!==e,qe=({title:a,description:i,children:r,footer:o,role:s="dialog",showCloseButton:c="alertdialog"!==s,className:m,"aria-label":d,"aria-labelledby":u,"aria-describedby":p,"data-testid":x,...g})=>{const b=e.useContext(We),f=M(x,"close")??b,E=e.useId(),v=e.useId(),_=u??(d?void 0:E),N=[p,je(i)?v:void 0].filter(Boolean).join(" ")||void 0,y=e.useRef(null),C=e.useRef(null),I=function(t,a){const[n,i]=e.useState(!1),r=e.useCallback(()=>{const e=t.current;i(!!e&&e.scrollHeight>e.clientHeight)},[t]);return e.useLayoutEffect(r,[r]),l.useResizeObserver({ref:t,onResize:r}),l.useResizeObserver({ref:a,onResize:r}),n}(y,C);return e.createElement(n.Dialog,h({},g,{role:s,"aria-label":d,"aria-labelledby":_,"aria-describedby":N,className:t("maxio-dialog",m),"data-testid":x}),({close:t})=>{const l="function"==typeof o?o({close:t}):o;return e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-dialog__header"},e.createElement("div",{className:"maxio-dialog__title-group"},e.createElement(He,{id:E,size:"md",className:"maxio-dialog__title"},a),je(i)&&e.createElement("p",{id:v,className:"maxio-dialog__description"},i)),c&&e.createElement(T,{"aria-label":"Close",onClick:t,icon:e.createElement(w,{variant:"cross"}),variant:"ghost",size:"sm",className:"maxio-dialog__close","data-testid":f})),e.createElement("div",h({ref:y,className:"maxio-dialog__body"},I&&{tabIndex:0,role:"region","aria-labelledby":E}),e.createElement("div",{ref:C},"function"==typeof r?r({close:t}):r)),je(l)&&e.createElement("div",{className:"maxio-dialog__footer"},l))})};let Ge=!1;const Ue=({basis:a,flex:l,flexDirection:n,wrap:i,grow:r,shrink:o,gap:s,gapX:c,gapY:m,className:d,children:u,alignItems:p,justifyContent:x,...g})=>{const b=t("maxio-flex",{[`maxio-flex-${l}`]:l,[`maxio-basis-${a}`]:void 0!==a,[`maxio-flex-${n}`]:n,[`maxio-flex-${i}`]:i,"maxio-grow":r,"maxio-grow-0":!1===r,"maxio-shrink":o,"maxio-shrink-0":!1===o,[`maxio-gap-${s}`]:void 0!==s,[`maxio-gap-x-${c}`]:void 0!==c,[`maxio-gap-y-${m}`]:void 0!==m,[`maxio-items-${p}`]:p,[`maxio-justify-${x}`]:x},d);return e.createElement("div",h({className:b},g),u)},Ke=({className:a,children:l,items:i,render:r,renderEmptyState:o,isLoading:s=!1,onLoadMore:c,scrollOffset:m,showSelectAll:d=!1,...u})=>e.createElement(n.ListBox,h({},u,{items:i,renderEmptyState:s?void 0:o,className:n.composeRenderProps(a,e=>t("maxio-listbox",e)),render:(t,a)=>{const{selectionManager:l}=a.state,n=r?r(t,a):e.createElement("div",t);if("multiple"!==l.selectionMode||!d)return n;if(0===[...l.collection.getKeys()].filter(e=>{const t=l.collection.getItem(e);return"item"===t?.type&&l.canSelectItem(e)}).length)return n;const i=l.isSelectAll,o=i&&l.disallowEmptySelection;return e.createElement("div",null,e.createElement("div",{className:"maxio-listbox__select-all"},e.createElement(P,{type:"button",variant:"ghost",trailingElement:e.createElement(w,{variant:i?"check":""}),fullWidth:!0,"aria-pressed":i,disabled:o,onClick:()=>l.toggleSelectAll()},"Select all")),n)}}),c||s?e.createElement(e.Fragment,null,e.createElement(n.Collection,{items:i,dependencies:u.dependencies},l),e.createElement(n.ListBoxLoadMoreItem,{className:"maxio-listbox__load-more",isLoading:s,onLoadMore:s?void 0:c,scrollOffset:m},e.createElement(k,null))):l);Ke.displayName="ListBox";const Ye=({className:a,...l})=>{const i=l.textValue||("string"==typeof l.children?l.children:void 0);return e.createElement(n.ListBoxItem,h({},l,{textValue:i,className:t("maxio-listbox__item",a)}),n.composeRenderProps(l.children,(t,{isSelected:a})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-listbox__content"},"string"==typeof t?e.createElement(Ae,{size:"sm"},t):t),a&&e.createElement(w,{variant:"check"}))))};Ye.displayName="ListBox.Item";const Ze=({className:a,...l})=>e.createElement(n.ListBoxSection,h({},l,{className:t("maxio-listbox__section",a)}));Ze.displayName="ListBox.Section";const Qe=({className:a,...l})=>e.createElement(n.Header,h({},l,{className:t("maxio-listbox__header",a)}));Qe.displayName="ListBox.Header";const Xe=Object.assign(Ke,{Item:Ye,Section:Ze,Header:Qe}),Je=({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:i=!1,size:r="md",label:o,description:s,errorMessage:c,leadingElement:m=null,fullWidth:d,className:u,placeholder:p,renderEmptyState:x,isLoading:g=!1,onLoadMore:b,scrollOffset:f,allowsEmptyCollection:E=Boolean(g||b||x),selectionMode:v,children:_,...N})=>{const y=e.useRef(null),C=e.useRef(null),[I,R]=e.useState(),[k,S]=e.useState(0),D=!!c,P=l||D,T=_,M=e.useCallback(()=>{const e=y.current;if(!e)return;const t=C.current,a=t?t.getBoundingClientRect().left-e.getBoundingClientRect().left:0;S(e=>e===-a?e:-a),R(t=>{const a=`${e.offsetWidth}px`;return t?.["--trigger-width"]===a?t:{"--trigger-width":a}})},[]);e.useEffect(()=>{const e=y.current;if(!e)return;if(M(),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(M);return t.observe(e),()=>t.disconnect()},[M]);const O=t("maxio-text-field",`maxio-text-field--${r}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":P,"maxio-text-field--readonly":i,"maxio-text-field--full-width":d},u);return e.createElement(n.ComboBox,h({},N,{isDisabled:a,isInvalid:P,isReadOnly:i,selectionMode:v,allowsEmptyCollection:E,className:O}),o&&e.createElement(n.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{ref:y,className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement(n.Input,{ref:C,className:"maxio-text-field__input",placeholder:p}),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(n.Button,{className:t("maxio-button","maxio-button--ghost","maxio-button--icon","maxio-button--sm")},e.createElement(w,{variant:"chevron-up-down"})))),s&&!D&&e.createElement(n.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(n.FieldError,{className:"maxio-form-error"},t=>e.createElement(e.Fragment,null,e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},"function"==typeof c?c(t):c))),e.createElement(Re,{hideArrow:!0,className:"maxio-combobox__popover",crossOffset:k,style:I},e.createElement(Xe,{items:N.items??N.defaultItems,renderEmptyState:x,isLoading:g,onLoadMore:b,scrollOffset:f},T)))};Je.displayName="ComboBox";const et=t=>e.createElement(Xe.Item,t);et.displayName="ComboBox.Item";const tt=t=>e.createElement(Xe.Section,t);tt.displayName="ComboBox.Section";const at=t=>e.createElement(Xe.Header,t);at.displayName="ComboBox.Header";const lt=Object.assign(Je,{Item:et,Section:tt,Header:at}),nt=e.createContext({}),it=e.forwardRef(({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:i=!1,size:r="md",label:o,description:s,errorMessage:c,leadingElement:m=e.createElement(w,{variant:"search"}),clearButtonLabel:d="Clear search",fullWidth:u,className:p,...x},g)=>{const b=t("maxio-text-field",`maxio-text-field--${r}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":l,"maxio-text-field--readonly":i,"maxio-text-field--full-width":u},p);return e.createElement(n.SearchField,h({},x,{isDisabled:a,isReadOnly:i,isInvalid:l,className:b}),o&&e.createElement(n.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement(n.Input,{ref:g,className:"maxio-text-field__input"}),e.createElement("div",{className:"maxio-text-field__trailing-element maxio-search-field__clear-button"},e.createElement(n.Button,{"aria-label":d,className:"maxio-button maxio-button--icon maxio-button--sm maxio-button--ghost"},e.createElement(w,{variant:"cross",className:"maxio-button__trailing-element"})))),s&&!(l&&c)&&e.createElement(n.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(n.FieldError,{className:"maxio-form-error"},e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},c)))});it.displayName="SearchField";const rt=e.forwardRef(({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:i=!1,size:r="md",label:o,description:s,errorMessage:c,leadingElement:m=null,trailingElement:d=null,fullWidth:u,className:p,...x},g)=>{const b=t("maxio-text-field",`maxio-text-field--${r}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":l,"maxio-text-field--readonly":i,"maxio-text-field--full-width":u},p);return e.createElement(n.TextField,h({},x,{isDisabled:a,isReadOnly:i,isInvalid:l,className:b}),o&&e.createElement(n.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement(n.Input,{ref:g,className:"maxio-text-field__input"}),d&&e.createElement("div",{className:"maxio-text-field__trailing-element"},d)),s&&!(l&&c)&&e.createElement(n.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(n.FieldError,{className:"maxio-form-error"},e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},c)))});rt.displayName="TextField";const ot=e.forwardRef(({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:i=!1,size:r="md",label:o,description:s,errorMessage:c,leadingElement:m=null,trailingElement:d=null,showStepper:u=!1,fullWidth:p,className:x,...g},b)=>{const f=t("maxio-text-field",`maxio-text-field--${r}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":l,"maxio-text-field--readonly":i,"maxio-text-field--full-width":p},x);return e.createElement(n.NumberField,h({},g,{isDisabled:a,isReadOnly:i,isInvalid:l,className:f}),o&&e.createElement(n.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement(n.Input,{ref:b,className:"maxio-text-field__input"}),d&&e.createElement("div",{className:"maxio-text-field__trailing-element"},d),u&&e.createElement("div",{className:"maxio-text-field__trailing-element maxio-number-field__stepper"},e.createElement(n.Button,{slot:"decrement","aria-label":"Decrement",className:"maxio-button maxio-button--icon maxio-button--sm maxio-button--ghost"},e.createElement(w,{variant:"minus",size:"xs",className:"maxio-button__trailing-element"})),e.createElement(n.Separator,{orientation:"vertical",className:"maxio-number-field__stepper-separator"}),e.createElement(n.Button,{slot:"increment","aria-label":"Increment",className:"maxio-button maxio-button--icon maxio-button--sm maxio-button--ghost"},e.createElement(w,{variant:"plus",size:"xs",className:"maxio-button__trailing-element"})))),s&&!(l&&c)&&e.createElement(n.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(n.FieldError,{className:"maxio-form-error"},e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},c)))});ot.displayName="NumberField";const st=e.forwardRef(({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:i=!1,size:r="md",label:o,description:s,errorMessage:c,fullWidth:m,className:d,...u},p)=>{const x=t("maxio-text-area",`maxio-text-area--${r}`,{"maxio-text-area--disabled":a,"maxio-text-area--error":l,"maxio-text-area--readonly":i,"maxio-text-area--full-width":m},d);return e.createElement(n.TextField,h({},u,{isDisabled:a,isReadOnly:i,isInvalid:l,className:x}),o&&e.createElement(n.Label,{className:"maxio-form-label"},o),e.createElement(n.TextArea,{ref:p,className:"maxio-text-area__input"}),s&&!(l&&c)&&e.createElement(n.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(n.FieldError,{className:"maxio-form-error"},e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},c)))});st.displayName="TextArea";const ct=e.forwardRef(({disabled:l=!1,invalid:n=!1,readOnly:i=!1,size:r="md",label:o,helperText:s,showErrorMessage:c=!0,errorMessage:m,leadingElement:d=null,trailingElement:u=null,fullWidth:p,className:x,...g},b)=>{const f=e.useRef(null);e.useImperativeHandle(b,()=>f.current),e.useEffect(()=>{console.warn("TextInput is deprecated. Please use TextField instead.")},[]);const{spellCheck:E,...v}=g,_={...v,label:o,description:s,errorMessage:m,defaultValue:g.defaultValue?.toString(),value:g.value?.toString(),isDisabled:l,isReadOnly:i,isInvalid:n},{labelProps:N,inputProps:w,descriptionProps:y,errorMessageProps:C}=a.useTextField(_,f),I=t("maxio-text-field",`maxio-text-field--${r}`,{"maxio-text-field--disabled":l,"maxio-text-field--error":n,"maxio-text-field--readonly":i,"maxio-text-field--full-width":p},x),R=n&&m&&c;return e.createElement("div",{className:I},o&&e.createElement("label",h({className:"maxio-text-field__label"},N),o),e.createElement("div",{className:"maxio-text-field__items"},d&&e.createElement("div",{className:"maxio-text-field__leading-element"},d),e.createElement("input",h({ref:f,type:"text",className:"maxio-text-field__input"},w,{spellCheck:E})),u&&e.createElement("div",{className:"maxio-text-field__trailing-element"},u)),s&&!R&&e.createElement("div",h({className:"maxio-form-helper-text"},y),s),R&&e.createElement(Ce,C,m))});ct.displayName="TextInput";const mt=({options:l,label:n,size:i="md",inline:r=!1,disabled:o=!1,helperText:s,errorMessage:c,fullWidth:m=!1,...d})=>{const u=t("maxio-select",`maxio-select--${i}`,{"maxio-select--disabled":o,"maxio-select--inline":r,"maxio-select--error":!!c,"maxio-select--full-width":m}),p=a.useId();return e.createElement("div",{className:u},n&&e.createElement("label",{htmlFor:p,className:"maxio-select__label"},n),e.createElement("div",{className:"maxio-select__input-container"},e.createElement("select",h({id:p,className:"maxio-select__input",disabled:o},d),l.map(t=>e.createElement("option",{key:`option-${t.value}`,value:t.value,disabled:t.disabled},t.label))),e.createElement(w,{variant:"chevron-up-down"})),!!c&&e.createElement(Ce,null,c),s&&!c&&e.createElement("div",{className:"maxio-form-helper-text"},s))},dt=({slot:t,displayValue:a})=>{const l=e.createElement(n.DateInput,{slot:t,className:"maxio-date-field__input"},t=>e.createElement(n.DateSegment,{segment:t,className:"maxio-date-field__segment"}));return null==a?l:e.createElement("div",{className:"maxio-date-field__endpoint"},e.createElement("div",{hidden:!0},l),e.createElement("span",{className:"maxio-date-field__endpoint-value"},a))},ut=()=>{const t=e.useContext(n.CalendarStateContext),a=e.useContext(n.RangeCalendarStateContext);return t??a},pt=({items:t,value:a,onChange:l,isItemDisabled:n,...i})=>{const{isDisabled:r}=ut();return e.createElement(mt,h({},i,{disabled:r,value:String(a),onChange:e=>l(Number(e.target.value)),options:t.map(({id:e,date:t,formatted:a})=>({value:String(e),label:a,disabled:n?.(t)}))}))},xt=()=>{const{minValue:t,maxValue:a}=ut(),l=e=>!!t&&i.endOfMonth(e).compare(i.toCalendarDate(t))<0||!!a&&i.startOfMonth(e).compare(i.toCalendarDate(a))>0;return e.createElement(n.CalendarMonthPicker,null,t=>e.createElement(pt,h({},t,{isItemDisabled:l})))},gt=({navigation:t})=>"month"===t?e.createElement(n.Heading,{className:"maxio-calendar__heading"}):e.createElement(Ue,{grow:!0,alignItems:"center",gap:1},e.createElement(xt,null),e.createElement(n.CalendarYearPicker,null,t=>e.createElement(pt,t))),bt=({className:a,errorMessage:l,navigation:i="month",...r})=>e.createElement(n.Calendar,h({},r,{visibleDuration:{months:1},className:n.composeRenderProps(a,e=>t("maxio-calendar",e))}),e.createElement("header",{className:"maxio-calendar__header"},e.createElement(gt,{navigation:i}),e.createElement(n.Button,{slot:"previous",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"chevron-left"})),e.createElement(n.Button,{slot:"next",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"chevron-right"}))),e.createElement(n.CalendarGrid,{className:"maxio-calendar__grid"},e.createElement(n.CalendarGridHeader,null,t=>e.createElement(n.CalendarHeaderCell,{className:"maxio-calendar__weekday"},t)),e.createElement(n.CalendarGridBody,null,t=>e.createElement(n.CalendarCell,{date:t,className:"maxio-calendar__cell"}))),l&&e.createElement(n.Text,{slot:"errorMessage",className:"maxio-calendar__error"},l)),ft=({presets:t,label:a="Presets",isDisabled:l,isPresetDisabled:i,onSelect:r})=>t?.length?e.createElement(n.Group,{"aria-label":a,className:"maxio-date-field__presets"},t.map((t,a)=>e.createElement(n.Button,{key:a,className:"maxio-button maxio-button--ghost",isDisabled:l||t.isDisabled||null!==t.value&&i(t.value),onPress:()=>r(t.value)},t.label))):null,Et=(e,t)=>!!(t.minValue&&e.compare(t.minValue)<0||t.maxValue&&e.compare(t.maxValue)>0||t.isDateUnavailable?.(e)),ht=({className:a,errorMessage:l,navigation:i="month",...r})=>{const{direction:o}=n.useLocale();return e.createElement(n.RangeCalendar,h({},r,{visibleDuration:{months:1},className:n.composeRenderProps(a,e=>t("maxio-calendar","maxio-calendar--range",e))}),e.createElement("header",{className:"maxio-calendar__header"},e.createElement(gt,{navigation:i}),e.createElement(n.Button,{slot:"previous",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"rtl"===o?"chevron-right":"chevron-left"})),e.createElement(n.Button,{slot:"next",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"rtl"===o?"chevron-left":"chevron-right"}))),e.createElement(n.CalendarGrid,{className:"maxio-calendar__grid"},e.createElement(n.CalendarGridHeader,null,t=>e.createElement(n.CalendarHeaderCell,{className:"maxio-calendar__weekday"},t)),e.createElement(n.CalendarGridBody,null,t=>e.createElement(n.CalendarCell,{date:t,className:"maxio-calendar__cell"}))),l&&e.createElement(n.Text,{slot:"errorMessage",className:"maxio-calendar__error"},l))},vt=(e,t)=>null==e?null==t:null!=t&&0===e.compare(t),_t=({className:a,size:l="md",fullWidth:i=!1,selectionMode:r="single",orientation:o="horizontal",disallowEmptySelection:s=!0,...c})=>e.createElement(n.ToggleButtonGroup,h({},c,{selectionMode:r,orientation:o,disallowEmptySelection:s,className:n.composeRenderProps(a,e=>t("maxio-segmented-control",`maxio-segmented-control--${l}`,{"maxio-segmented-control--full-width":i},e))}));_t.displayName="SegmentedControl";const Nt=({className:a,children:l,...i})=>e.createElement(n.ToggleButton,h({},i,{className:n.composeRenderProps(a,e=>t("maxio-segmented-control__item",e))}),n.composeRenderProps(l,t=>e.createElement(e.Fragment,null,e.createElement(n.SelectionIndicator,{className:"maxio-segmented-control__selection-indicator","data-selected":!0}),t)));Nt.displayName="SegmentedControl.Item";const wt=Object.assign(_t,{Item:Nt}),yt=({leadingIcon:t,trailingIcon:a,type:l="menu",children:n,leadingIconClassName:i,isTooltipVisible:r=!1})=>e.createElement(e.Fragment,null,t&&e.createElement(X,{usePortal:!0,isVisible:r,renderContent:()=>n,floatingElementOffset:12},e.createElement("span",{className:"maxio-side-nav__icon"},e.createElement(w,{variant:t,className:i}))),e.createElement("span",{className:`maxio-side-nav__${l}-title`,"data-testid":"maxio-sidebar-section-name"},n),a&&e.createElement("span",{className:"maxio-side-nav__menu-chevron"},e.createElement(w,{variant:a}))),Ct=e=>"heading"!==e.type,It=e=>{const t=(e=>e.flat().filter(Ct).map(e=>e.items).flat().find(e=>e?.isCurrent))(e);return t?e.map(e=>e.map(e=>Ct(e)&&e.items?.includes(t)?{...e,isOpen:!0}:e)):e},Rt=e.createContext({}),kt=()=>e.useContext(Rt),St=({children:t,isOpen:a,onChange:l,withIcons:n=!0,sections:i,shouldToggleSidebar:r=!0,topDropdownItems:o,collapseBreakpoint:s=800})=>{const c=e.useRef(!1),[m,d]=e.useState(()=>!r||("boolean"==typeof a?a:"undefined"==typeof window||window.innerWidth>s)),[u,p]=e.useState(()=>It(i)),{windowWitdh:x}=K(200);e.useEffect(()=>{c.current&&l?.(m)},[m,l]),e.useEffect(()=>{c.current=!0},[]),e.useEffect(()=>{!function(e){if(!r)return;e<s&&m&&g()}(x)},[x]),e.useEffect(()=>{"boolean"==typeof a&&d(a)},[a]);const g=()=>{d(!1)};return e.createElement(Rt.Provider,{value:{sections:u,topDropdownItems:o,onSectionOpen:e=>{p(t=>t.map(t=>t.map(t=>Ct(t)?{...t,isOpen:t?.name===e&&!t.isOpen}:t)))},isOpen:m,onOpen:()=>{d(!0)},onClose:g,withIcons:n,shouldToggleSidebar:r}},t)},Dt=()=>{const{onOpen:t,topDropdownItems:a,isOpen:l}=kt(),{mainItem:n,otherItems:i,actions:r}=a,o=e.useRef(null),s=U(o),c=({id:e,title:t,icon:a,iconClass:l,url:n,...i})=>({id:e,label:t,leadingIconName:a,leadingIconClassName:l,link:{href:n,...i}}),{items:m,itemsCount:d}=e.useMemo(()=>({itemsCount:i.length+r.length,items:[...i.map(c),i?.length>0&&r?.length>0?{type:"divider",id:"item-divider"}:null,...r.map(c)].filter(e=>null!=e)}),[r,i]);return e.createElement(e.Fragment,null,0===d?e.createElement("a",{className:"maxio-side-nav__menu-button maxio-side-nav__menu-button--large",href:n.url,onClick:t},e.createElement("span",{className:"maxio-side-nav__menu-title"},n.title)):e.createElement("details",{className:"maxio-action-menu maxio-side-nav--action-menu"},e.createElement("summary",{onClick:t,className:"maxio-side-nav__menu-button","aria-haspopup":"true",ref:o},n.url?e.createElement(e.Fragment,null,e.createElement(yt,{type:"menu",isTooltipVisible:!l&&s,leadingIcon:n.icon,trailingIcon:"chevron-up-down",leadingIconClassName:n.iconClass},n.title)):e.createElement(yt,{type:"menu",trailingIcon:"chevron-up-down"},n.title)),e.createElement(I,{truncateLabels:!0,className:"maxio-action-menu__content","aria-label":"Action list",items:m,small:!0})))},Pt=({section:t})=>{const{isOpen:a,withIcons:l}=kt(),i=e.useRef(null),r=U(i);return e.createElement("li",{className:"maxio-side-nav__item","data-key":t.key,"data-testid":t.testId??"maxio-sidebar-section"},e.createElement(n.Link,{className:"maxio-side-nav__link","aria-current":t.isCurrent?"page":void 0,href:t.href,render:t.render,ref:i},e.createElement(yt,{isTooltipVisible:r&&!a,type:"menu",leadingIcon:l?t.icon:void 0},t.name)))},Tt=({section:a})=>{const{onOpen:l,onSectionOpen:i,isOpen:r,withIcons:o}=kt(),s=e.useRef(null),c=U(s);if(!Ct(a))return e.createElement("li",{className:"maxio-side-nav__item-header"},a.title);return a.Component?e.createElement(a.Component,{section:a}):a.href?e.createElement(Pt,{section:a}):e.createElement("li",{className:t("maxio-side-nav__item",{"maxio-side-nav__item--icon":o}),"data-testid":a.testId??"maxio-sidebar-section"},e.createElement("button",{className:"maxio-side-nav__menu-button",ref:s,"aria-expanded":a.isOpen?"true":"false",type:"button",onClick:()=>{i(a.name),l()}},e.createElement(yt,{type:"menu",isTooltipVisible:!r&&c,leadingIcon:o?a.icon:void 0,trailingIcon:a.items?.length?"chevron-down":void 0},a.name)),e.createElement("ul",{className:"maxio-side-nav__menu"},a.items?.map(t=>e.createElement("li",{key:`section-sub-item-${t.name}`,className:"maxio-side-nav__item","data-testid":t.testId??"maxio-section-item"},e.createElement(n.Link,{className:"maxio-side-nav__link",href:t.href,render:t.render,"aria-current":t.isCurrent?"page":void 0},e.createElement("span",{className:"maxio-side-nav__link-title"},t.name))))))},Mt=()=>{const{sections:t}=kt();return e.createElement(e.Fragment,null,t.map((t,a)=>e.createElement("ul",{role:"list",className:"maxio-side-nav__items",key:`section-list-${a}`},t.map((t,l)=>e.createElement(Tt,{key:`section-list-item-${t.type}-${a}-${l}`,section:t})))))},Ot=()=>{const{isOpen:t,onOpen:a,onClose:l,shouldToggleSidebar:n}=kt();return e.createElement("div",{className:"maxio-side-nav__logo-container"},e.createElement("a",{className:"maxio-side-nav__brand",href:"/","aria-label":"Maxio"}),n&&e.createElement("button",{className:"maxio-side-nav__menu-toggle","aria-label":t?"Collapse navigation":"Expand navigation","aria-expanded":t,onClick:t?l:a},e.createElement(w,{variant:"sidebar"})))},$t=()=>{const{isOpen:a}=kt();return e.createElement("nav",{className:t("maxio-side-nav",{"maxio-side-nav--collapsed":!a})},e.createElement(Ot,null),e.createElement(Dt,null),e.createElement("div",{className:"maxio-side-nav__items-container"},e.createElement(Mt,null)))},Lt=({disabled:a=!1,value:l=0,className:i,id:r,isCurrent:o,...s})=>{const c="icon"===s.type,m=({isSelected:e})=>t("maxio-tabs__tab",i,{"maxio-tabs__tab--active":e,"maxio-tabs__tab--disabled":a,"maxio-tabs__tab--icon":c});if("icon"===s.type){const{icon:t,...i}=s;return e.createElement(n.Tab,h({id:l,isDisabled:a},i,{className:m}),e.createElement("div",{className:"maxio-tabs__tab-content"},t))}const{children:d,rightIcon:u,...p}=s;return e.createElement(n.Tab,h({id:l,isDisabled:a},p,{className:m}),e.createElement("div",{className:"maxio-tabs__tab-content"},d,u||null))},Bt=e.createContext({variant:"line",withDivider:!1}),zt=({children:t,variant:a="line",withDivider:l=!1})=>e.createElement(Bt.Provider,{value:{variant:a,withDivider:l}},t),Ft=({children:a,value:l,className:i,id:r,...o})=>e.createElement(n.TabPanel,h({id:l,className:t("maxio-tabs__panel",i)},o),a),At=({children:a,className:l,...n})=>e.createElement("div",h({className:t("maxio-card__header",l)},n),a);At.displayName="Card.Header";const Vt=({children:a,className:l,...n})=>e.createElement("div",h({className:t("maxio-card__body",l)},n),a);Vt.displayName="Card.Body";const Ht=({children:a,className:l,...n})=>e.createElement("div",h({className:t("maxio-card__footer",l)},n),a);Ht.displayName="Card.Footer";const Wt=({children:a,className:l,variant:n="primary",...i})=>e.createElement("div",h({className:t("maxio-card",`maxio-card--${n}`,l)},i),a);Wt.displayName="Card";const jt=Object.assign(Wt,{Header:At,Body:Vt,Footer:Ht});var qt,Gt,Ut,Kt;function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},Yt.apply(null,arguments)}const Zt=e=>E.createElement("svg",Yt({xmlns:"http://www.w3.org/2000/svg","data-name":"Maxio Logo SVG",viewBox:"0 0 1036 240"},e),qt||(qt=E.createElement("path",{d:"M59.32 11.3 70.64 0l40.74 40.35v70.99H40.89L0 70.52l11.15-11.14 36.2 36.15h30.07l3.07-3.39-50.91-51.15 10.99-10.97 51.24 50.83 3.72-3.38V47.13zM180.68 11.3 169.36 0l-40.73 40.35v70.99h70.48L240 70.51l-11.15-11.14-36.2 36.15h-30.06l-3.07-3.39 50.91-51.15-10.99-10.97-51.24 50.83-3.72-3.38V47.12l36.2-35.83ZM59.32 228.7l11.31 11.29 40.74-40.35v-70.99H40.89L0 169.48l11.15 11.14 36.2-36.15h30.07l3.07 3.39-50.92 51.15 10.99 10.97 51.24-50.83 3.72 3.38v30.34zM180.68 228.7l-11.32 11.29-40.73-40.35v-70.99h70.48L240 169.48l-11.15 11.14-36.2-36.15h-30.06l-3.07 3.39 50.91 51.15-10.99 10.97-51.24-50.83-3.72 3.38v30.34zM1015.27 139.55c0-29.94-23.74-53.46-52.11-53.46s-52.11 23.52-52.11 53.46 23.74 53.46 52.11 53.46 52.11-23.52 52.11-53.46m20.32.95c-.5 40.27-32.73 72.76-72.43 72.76h-.94c-39.58-.52-71.5-33.32-71.5-73.71s32.43-73.71 72.44-73.71h.94c39.57.52 71.5 33.32 71.5 73.71v.95Z"})),Gt||(Gt=E.createElement("path",{fillRule:"evenodd",d:"M870.39 24h-20.33v20.33h20.33zm0 40.67h-20.33v148.59h20.33z"})),Ut||(Ut=E.createElement("path",{fillRule:"evenodd",d:"M850.05 24h20.33v20.33h-20.33zM695.01 82.85l50.83 56.28v6.53l-50.28 55.67 15.23 13.2 49.22-54.49h4.71l49.22 54.49 15.23-13.2-50.28-55.67v-6.53l50.83-56.28-15.23-13.2-50.15 55.52h-3.96l-50.15-55.52L695 82.85ZM660.49 78.64c-9.41-9.28-23.26-13.97-41.02-13.97-31.13 0-52.44 18.93-58.09 44.86l-.28 1.27 19.33 3.72.31-1.14c2.39-8.91 6.66-16.54 13.04-21.94 6.36-5.39 14.91-8.63 26.02-8.63s19.12 3.25 24.76 8.96c5.64 5.72 8.73 14.06 8.73 24.53v6.11L616.62 130l-3.26.68c-16.14 3.47-29.79 7.84-39.59 14.45-10.54 7.11-16.64 16.83-16.64 30.62 0 12.51 4.51 22.62 12.5 29.59 7.96 6.95 19.25 10.67 32.63 10.67 22.27 0 41.87-12.03 51.04-27.03v25.55h21.39v-95.3c0-17.6-4.77-31.3-14.19-40.58Zm-40.09 68.13c-12.86 2.77-23.05 5.42-30.03 9.63-3.46 2.09-6.08 4.54-7.84 7.54s-2.71 6.62-2.71 11.15c0 6.38 2.1 12.12 6.32 16.27 4.22 4.14 10.7 6.82 19.7 6.82 26.85 0 47.46-20.48 47.46-51.36v-7.2l-32.9 7.14Z"})),Kt||(Kt=E.createElement("path",{d:"M434.8 188.74h4.54l61.73-164.33.15-.41h35.57v189.35H515.9V55.37h-4.33l-59.7 157.57-.15.41h-29.29l-61.2-157.98h-4.35v157.98H336V24h35.57z"}))),Qt=a=>{const{size:l="sm",className:n,variant:i="lockup",alt:r="maxio logo","data-testid":o}=a,s="mark"===i,c="number"==typeof l;return e.createElement(Zt,{role:"img",viewBox:s?"0 0 240 240":"0 0 1036 240","aria-label":r,"data-testid":o,height:c?l:void 0,className:t("maxio-logo",!c&&`maxio-logo--${l}`,s&&"maxio-logo--mark",n)})},Xt=({state:a,...l})=>{const n=e.useRef(null),{toastProps:i,contentProps:r,titleProps:o,closeButtonProps:s}=b.useToast(l,a,n),{closable:c=!0,underline:m=!0,external:d=!1,testId:u}=l.toast.content,p=t("maxio-toast",{[`maxio-toast--${l.toast.content.sentiment}`]:l.toast.content.sentiment}),x={default:"info-circle-fill",success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[l.toast.content.sentiment||"default"];return e.createElement("div",h({className:p,"data-maxio-mode":"dark"},i,{ref:n,"data-testid":u}),e.createElement(w,{variant:x,className:"maxio-toast__icon"}),e.createElement("div",h({className:"maxio-toast__container"},r),e.createElement("div",h({className:"maxio-toast__content"},o),l.toast.content.title&&e.createElement("span",{className:"maxio-toast__title"},l.toast.content.title),l.toast.content.message&&e.createElement("span",{className:"maxio-toast__message"},l.toast.content.message),l.toast.content.link?.text&&l.toast.content.link?.href&&e.createElement(R,{href:l.toast.content.link.href,underline:m,external:d},l.toast.content.link.text))),c&&e.createElement(T,h({variant:"ghost",icon:e.createElement(w,{variant:"cross"}),"aria-label":"Dismiss Notification",className:"maxio-toast__dismiss"},s,{"data-testid":M(u,"dismiss")})))},Jt=({state:t,...a})=>{const l=e.useRef(null),{regionProps:n}=b.useToastRegion(a,t,l);return e.createElement("div",h({},n,{ref:l,className:a.className,style:{display:"flex",flexDirection:"column",gap:"10px"}}),t.visibleToasts.map(a=>e.createElement(Xt,{key:a.key,toast:a,state:t})))},ea=e.createContext(null);class ta extends g.ToastQueue{}const aa=({...t})=>{const l=e.useRef(null),{buttonProps:n}=a.useButton(t,l);return e.createElement("button",h({},n,{className:"maxio-chip__dismiss-button"}),e.createElement(w,{variant:"cross-circle-fill",className:"maxio-chip__icon"}))},la={success:"maxio-auth-layout__heading--success",danger:"maxio-auth-layout__heading--danger"};Object.defineProperty(exports,"DialogTrigger",{enumerable:!0,get:function(){return n.DialogTrigger}}),Object.defineProperty(exports,"Pressable",{enumerable:!0,get:function(){return n.Pressable}}),Object.defineProperty(exports,"createColumnHelper",{enumerable:!0,get:function(){return m.createColumnHelper}}),exports.ActionList=I,exports.Alert=O,exports.AuthLayout=({children:a,heading:l,description:n,sentiment:i="success",leadingElement:r=null,alert:o,topAddon:s=null,footer:c})=>e.createElement("div",{className:"maxio-auth-layout"},e.createElement(Ue,{alignItems:"center",justifyContent:"between"},e.createElement(Qt,{size:"md"}),s),o&&e.createElement(O,{display:"block",title:o.title,sentiment:o.sentiment},o.children),e.createElement(jt,{variant:"secondary"},e.createElement(jt.Body,null,e.createElement(Ue,{flexDirection:"col",gap:6},e.createElement(Ue,{flexDirection:"col",gap:2},e.createElement(Ue,{alignItems:"center",gap:2},r,e.createElement(He,{size:"lg",className:t("maxio-auth-layout__heading",la[i])},l)),n&&e.createElement(Ue,{style:{color:"var(--maxio-color-text-tertiary)"}},e.createElement(Ae,{size:"sm",className:"maxio-auth-layout__description"},n))),a)),c&&e.createElement(jt.Footer,null,c))),exports.Avatar=({className:a,src:l,alt:n="avatar","data-testid":i})=>e.createElement("img",{className:t("maxio-avatar",a),alt:n,src:l,"data-testid":i}),exports.Banner=({children:a,title:l,linkText:n,linkExternal:i,href:r,display:o="inline",sentiment:s="info",onDismiss:c,className:m,"data-testid":d})=>{if(!a&&!l)return console.warn("Banner component requires either children or title prop to be rendered"),null;const u=t("maxio-banner",{[`maxio-banner--${s}`]:"info"!==s&&s,className:m}),p={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[s],x=t("maxio-banner__content",{"maxio-banner__content--block":"block"===o});return e.createElement("div",{className:u,"aria-live":"assertive","data-testid":d},e.createElement(w,{variant:p,className:"maxio-banner__icon","aria-hidden":"true"}),e.createElement("section",{className:"maxio-banner__container"},e.createElement("div",{className:x},l&&e.createElement("span",{className:"maxio-banner__title"},l),a&&e.createElement("span",{className:"maxio-banner__message"},a),n&&r&&e.createElement(R,h({href:r},"warning"!==s&&{variant:"inverse"},{underline:!0},i?{external:!0}:{}),n))),c&&e.createElement(T,{icon:e.createElement(w,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:c,className:"maxio-banner__dismiss","data-testid":M(d,"dismiss")}))},exports.Body=Ae,exports.Breadcrumbs=({className:a,children:l,...n})=>{const i=e.Children.count(l);if(0===i)throw new Error(A);const r=e.Children.map(l,(t,a)=>{if(e.isValidElement(t)&&t.type===F){if(a===i-1&&t.props.href)throw new Error(V);return e.cloneElement(t,{"aria-current":a===i-1?"page":void 0})}throw new Error(H)});return e.createElement("nav",h({"aria-label":"Breadcrumb"},n),e.createElement("ol",{className:t("maxio-breadcrumbs",a)},r))},exports.BreadcrumbsItem=F,exports.Button=P,exports.Calendar=bt,exports.Card=jt,exports.Checkbox=we,exports.CheckboxGroup=({helperText:l,className:n,errorMessage:i,children:r,disabled:s,label:c,defaultValue:m,name:d,...u})=>{const p=o.useCheckboxGroupState({defaultValue:m,name:d,errorMessage:i,description:l,label:c,isDisabled:s,isInvalid:!!i,...u}),{groupProps:x,labelProps:g,descriptionProps:b,errorMessageProps:f,isInvalid:E}=a.useCheckboxGroup({"aria-label":(c??u["aria-label"])?.toString(),isDisabled:s,isInvalid:!!i,...u},p),v=t("maxio-checkbox-group",{"maxio-checkbox-group--disabled":s},n),_=l&&!i;return e.createElement("div",h({className:v},x),c&&e.createElement("label",h({className:"maxio-checkbox-group__label"},g),c),e.createElement(_e.Provider,{value:p},r),_&&e.createElement(ye,b,l),i&&E&&e.createElement(Ce,f,i))},exports.Chip=({label:l,onDismiss:n,dismissLabel:i,leadingIcon:o,trailingIcon:s,title:c,...m})=>{const d=e.useRef(null),u=r.useToggleState(m),{buttonProps:p}=a.useToggleButton(m,u,d),x=t("maxio-chip",{"maxio-chip--selected":u?.isSelected}),g=t("maxio-chip__button",{"maxio-chip--dismissible":n});return e.createElement("div",{className:x},e.createElement("button",h({className:g,ref:d},p,{title:c}),o&&e.createElement(w,{variant:o,className:"maxio-chip__icon"}),e.createElement("span",{className:"maxio-chip__label"},l),s&&!n&&e.createElement(w,{variant:s,className:"maxio-chip__icon"})),n&&e.createElement(aa,{onPress:n,"aria-label":i}))},exports.Code=({as:a="div",children:l,className:n,...i})=>{const r=a,o=t("maxio-code",n);return e.createElement(r,h({className:o},i),l)},exports.ComboBox=lt,exports.CopyToClipboard=({value:l,copyLabel:n="Copy",copiedLabel:i="Copied!",copyErrorLabel:r="Copy failed",size:o="md",variant:s="ghost",disabled:c,resetAfterMs:m=2e3,tooltipPlacement:d="top",onCopy:u,onCopyError:p,onClick:x,className:g,...b})=>{const{feedbackState:f,feedbackLabel:E,announcement:v,handleCopy:_}=((t,{copyLabel:a,copiedLabel:l,copyErrorLabel:n,resetAfterMs:i,onCopy:r,onCopyError:o,onClick:s})=>{const[c,m]=e.useState(null),d=e.useRef(null),u=e.useRef(0),p=e.useRef(!0),x=e.useRef(0),g=e.useRef(t),b=e.useCallback(()=>{null!==d.current&&(clearTimeout(d.current),d.current=null)},[]),f=e.useCallback(()=>{b(),m(null)},[b]),E=e.useCallback((e,t)=>{b(),m({state:e,value:t,announceId:++u.current}),d.current=window.setTimeout(f,i)},[b,i,f]);e.useEffect(()=>{g.current=t,f()},[f,t]),e.useEffect(()=>(p.current=!0,()=>{p.current=!1,b()}),[b]);const h=e.useCallback(async e=>{s?.(e);const a=++x.current,l=t,n=()=>!p.current||a!==x.current||l!==g.current;try{await navigator.clipboard.writeText(l)}catch(e){return n()||E("error",l),void o?.(e)}n()||E("copied",l),r?.(l)},[s,r,o,E,t]),v=c?.value===t?c.state:"idle",_={idle:a,copied:l,error:n}[v];return{feedbackState:v,feedbackLabel:_,announcement:"idle"!==v&&c?{id:c.announceId,message:_}:null,handleCopy:h}})(l,{copyLabel:n,copiedLabel:i,copyErrorLabel:r,resetAfterMs:m,onCopy:u,onCopyError:p,onClick:x});return e.createElement(e.Fragment,null,e.createElement(X,{interactions:["hover","focus"],placement:d,size:"small",renderContent:()=>E},e.createElement(T,h({},b,{"aria-label":n,className:t(g,{[J]:"subtle"===s,[ee]:"xs"===o}),variant:"subtle"===s?"ghost":s,size:"xs"===o?void 0:o,disabled:c,onClick:_,trailingElement:e.createElement(w,{variant:te[f]})}))),e.createElement(a.VisuallyHidden,null,e.createElement("span",{role:"status","aria-live":"polite","aria-atomic":"true"},v&&e.createElement("span",{key:v.id},v.message))))},exports.DataTable=({pattern:t,size:a="md",SubRowComponent:l,onExpand:n,onSelect:i,onSort:r,enableSorting:o=!1,enableRowSelection:s=!1,enableExpanding:c,columns:d,actions:u,actionsColumnSize:p,onRowAction:x,enableRowReordering:g=!1,getRowReorderLabel:b,onRowReorder:f,rowReorderMode:E="siblings",getRowId:v,getSubRows:_,state:N,"data-testid":w,...y})=>{const C=g?void 0:l,I=!g&&o,R=(({columns:t,HeaderControls:a,RowControls:l,RowActions:n,actions:i,actionsColumnSize:r,enableExpanding:o,enableRowSelection:s,enableRowReordering:c})=>e.useMemo(()=>{const m={id:ae,size:s&&c?72:40,header:t=>e.createElement(a,h({},t,{enableExpanding:o,enableRowSelection:s,enableRowReordering:c})),cell:t=>e.createElement(l,h({},t,{enableExpanding:o,enableRowSelection:s,enableRowReordering:c})),meta:{controls:!0,width:(s&&c?72:40)+"px"}},d=i&&n?{id:le,size:r??40,header:"",cell:t=>e.createElement(n,null,i(t.row,t.table)),meta:{actions:!0}}:null;let u=[...t];return(s||c)&&(u=[m,...u]),d&&(u=[...u,d]),u},[i,r,n,o,s,c,t,a,l]))({columns:d,HeaderControls:Ie,RowControls:Se,RowActions:De,actions:u,actionsColumnSize:p,enableRowSelection:s,enableRowReordering:g,enableExpanding:Boolean(c)}),k=m.useReactTable({state:{...N,...g&&{sorting:ze},columnPinning:{left:[...s||g?[ae]:[],...Be(N?.columnPinning?.left)],right:[...Be(N?.columnPinning?.right),...u?[le]:[]]}},getCoreRowModel:m.getCoreRowModel(),enableRowSelection:s,enableExpanding:Boolean(c),...!y.manualExpanding&&{getExpandedRowModel:m.getExpandedRowModel()},...!y.manualSorting&&!g&&{getSortedRowModel:m.getSortedRowModel()},columns:R,getRowId:v,...y,getSubRows:g?Fe:_??Fe,enableSorting:I,...g&&{getSortedRowModel:void 0}}),S=k.getCanSomeRowsExpand(),D=k.getState(),P=(({columnFilters:e,globalFilter:t,grouping:a,hasPagination:l})=>e.length>0||null!=t&&""!==t?Oe:a.length>0?$e:l?Le:Me)({columnFilters:D.columnFilters,globalFilter:D.globalFilter,grouping:D.grouping,hasPagination:Boolean(y.getPaginationRowModel||y.manualPagination)});e.useEffect(()=>{n?.(D.expanded)},[n,D.expanded]),e.useEffect(()=>{i?.(D.rowSelection)},[i,D.rowSelection]),e.useEffect(()=>{g||r?.(D.sorting)},[g,r,D.sorting]);const T=e.createElement(ne,{pattern:t,size:a,isExpandable:S,isUsingCustomRow:Boolean(C),"data-testid":w},e.createElement(ie,null,k.getHeaderGroups().map(t=>e.createElement(ve,{key:t.id,table:k,isHeader:!0},t.headers.map(t=>e.createElement(oe,{key:t.id,table:k,header:t,enableExpanding:c,"data-testid":M(w,"header",t.column.id)},m.flexRender(t.column.columnDef.header,t.getContext())))))),e.createElement(re,null,k.getRowModel().rows.map(a=>e.createElement(Te,{key:a.id,row:a,pattern:t,SubRowComponent:C,enableExpanding:c,onRowAction:x,testId:w}))));return g&&v&&f?e.createElement(he,{availability:P,data:y.data,enableExpanding:Boolean(c),getRowReorderLabel:b,onRowReorder:f,rowReorderMode:E,table:k},T):T},exports.DateField=({label:a,description:l,errorMessage:i,className:r,...o})=>e.createElement(n.DateField,h({},o,{className:n.composeRenderProps(r,(e,a)=>t("maxio-text-field","maxio-date-field",{"maxio-text-field--disabled":a.isDisabled,"maxio-text-field--error":a.isInvalid,"maxio-text-field--readonly":a.isReadOnly},e))}),null!=a&&e.createElement(n.Label,{className:"maxio-text-field__label"},a),e.createElement("div",{className:"maxio-text-field__items"},e.createElement("div",{className:"maxio-text-field__input"},e.createElement(dt,null))),null!=l&&e.createElement(n.Text,{slot:"description",className:"maxio-form-helper-text"},l),e.createElement(n.FieldError,{className:"maxio-form-error"},i)),exports.DatePicker=({label:a,description:l,errorMessage:i,className:r,presets:o,presetsLabel:s,navigation:c,...m})=>{const d=o?.find(e=>null===e.value)?.label;return e.createElement(n.DatePicker,h({},m,{className:n.composeRenderProps(r,(e,a)=>t("maxio-text-field","maxio-date-field",{"maxio-text-field--disabled":a.isDisabled,"maxio-text-field--error":a.isInvalid,"maxio-text-field--readonly":a.isReadOnly},e))}),({state:t,isDisabled:r,isReadOnly:u})=>e.createElement(e.Fragment,null,null!=a&&e.createElement(n.Label,{className:"maxio-text-field__label"},a),e.createElement(n.Group,{className:"maxio-text-field__items"},e.createElement("div",{className:"maxio-text-field__input"},e.createElement(dt,{displayValue:null===t.value?d:void 0})),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(n.Button,{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"calendar"})))),null!=l&&e.createElement(n.Text,{slot:"description",className:"maxio-form-helper-text"},l),e.createElement(n.FieldError,{className:"maxio-form-error"},i),e.createElement(Re,{hideArrow:!0,className:"maxio-date-field__popover"},e.createElement(n.Dialog,{className:"maxio-date-field__dialog"},e.createElement(bt,{navigation:c}),e.createElement(ft,{presets:o,label:s,isDisabled:r||u,isPresetDisabled:e=>Et(e,m),onSelect:e=>{t.setValue(e),t.setOpen(!1)}})))))},exports.DateRangePicker=({label:a,description:l,errorMessage:r,className:o,presets:s,presetsLabel:c,navigation:m,...d})=>e.createElement(n.DateRangePicker,h({},d,{className:n.composeRenderProps(o,(e,a)=>t("maxio-text-field","maxio-date-field",{"maxio-text-field--disabled":a.isDisabled,"maxio-text-field--error":a.isInvalid,"maxio-text-field--readonly":a.isReadOnly},e))}),({state:t,isDisabled:o,isReadOnly:u})=>{const p=((e,t)=>{if(null==e?.start||null==e?.end)return t?.find(t=>vt(t.value?.start,e?.start)&&vt(t.value?.end,e?.end))?.label})(t.value,s);return e.createElement(e.Fragment,null,null!=a&&e.createElement(n.Label,{className:"maxio-text-field__label"},a),e.createElement(n.Group,{className:"maxio-text-field__items"},e.createElement("div",{className:"maxio-text-field__input"},e.createElement(dt,{slot:"start",displayValue:null==t.value?.start?p:void 0}),e.createElement("span",{"aria-hidden":"true",className:"maxio-body-sm"},"→"),e.createElement(dt,{slot:"end",displayValue:null==t.value?.end?p:void 0})),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(n.Button,{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"calendar"})))),null!=l&&e.createElement(n.Text,{slot:"description",className:"maxio-form-helper-text"},l),e.createElement(n.FieldError,{className:"maxio-form-error"},r),e.createElement(Re,{hideArrow:!0,className:"maxio-date-field__popover"},e.createElement(n.Dialog,{className:"maxio-date-field__dialog"},e.createElement(ht,{navigation:m}),e.createElement(ft,{presets:s,label:c,isDisabled:o||u,isPresetDisabled:e=>((e,t)=>{const a=e.start?i.toCalendarDate(e.start):null,l={...t,isDateUnavailable:e=>t.isDateUnavailable?.(e,a)??!1};if(null!=e.start&&null!=e.end&&e.start.compare(e.end)>0||null!=e.start&&Et(e.start,{...t,isDateUnavailable:e=>t.isDateUnavailable?.(e,null)??!1})||null!=e.end&&Et(e.end,l))return!0;if(e.start&&e.end&&t.isDateUnavailable&&!t.allowsNonContiguousRanges){const l=i.toCalendarDate(e.end);for(let n=i.toCalendarDate(e.start).add({days:1});n.compare(l)<0;n=n.add({days:1}))if(t.isDateUnavailable(n,a))return!0}return!1})(e,d),onSelect:e=>((e,t)=>{!t||null!=t.start&&null!=t.end?t?.start&&t.end?e.setValue({start:t.start,end:t.end}):e.setValue(null):(e.setValue(null),e.setDateTime("start",t.start),e.setDateTime("end",t.end)),e.setOpen(!1)})(t,e)}))))}),exports.Dialog=qe,exports.Display=({as:a="div",children:l,size:n="md",className:i,...r})=>{const o=a,s=t(`maxio-display-${n}`,i);return e.createElement(o,h({className:s},r),l)},exports.Drawer=({placement:a="right",backdrop:l="dim",size:i="md",isDismissable:r=!0,className:o,style:s,title:c,description:m,footer:d,open:u,isOpen:p,children:x,"data-testid":g,...b})=>{const f=[c,m,d].some(e=>void 0!==e),E=void 0!==u&&void 0===p;return e.useEffect(()=>{!f&&!E||Ge||(Ge=!0,console.warn("Drawer: the `title`, `description`, `footer` and `open` props are deprecated and will be removed in the next major. Pass a `Dialog` as children and use `isOpen` instead."))},[f,E]),e.createElement(n.ModalOverlay,h({},b,{isOpen:p??u,isDismissable:r,className:t("maxio-drawer__backdrop",{"maxio-drawer__backdrop--dim":"dim"===l})}),e.createElement(n.Modal,{className:t("maxio-drawer",o),style:s,"data-placement":a,"data-size":i,"data-testid":g},f?e.createElement(We.Provider,{value:M(g,"close")},e.createElement(qe,{title:c,description:m,footer:d},x)):x))},exports.EmptyState=({hasActiveFilters:a=!1,title:l,headingLevel:n="h2",description:i,actions:r,className:o,...s})=>{const c=t("maxio-empty-state",o),m=n,d=!l&&!i?a?"We couldn't find any items matching your criteria. Try adjusting your search or filters to see more results.":"There is no data to display yet.":i;return e.createElement("div",h({className:c},s),e.createElement(Ue,{flexDirection:"col",alignItems:"center",gap:4,className:"maxio-empty-state__content"},e.createElement(Ue,{flexDirection:"col",alignItems:"center",gap:2,className:"maxio-empty-state__copy"},l&&e.createElement(m,{className:"maxio-heading-lg"},l),d&&e.createElement(Ae,{size:"sm",className:"maxio-empty-state__description"},d)),r&&e.createElement(Ue,{alignItems:"center",gap:2},r)))},exports.Flex=Ue,exports.FormErrorMessage=Ce,exports.FormHelperText=ye,exports.GlobalToastProvider=({children:t,toastQueue:a,...l})=>{const n=g.useToastQueue(a),i=e.useCallback(()=>{n.visibleToasts.forEach(e=>{a.close(e.key)})},[n.visibleToasts,a]),r=e.useMemo(()=>({addToast:a.add.bind(a),removeToast:a.clear.bind(a),removeAllToasts:i,state:n}),[a,i,n]);return e.createElement(ea.Provider,{value:r},t,n.visibleToasts.length>0&&e.createElement(Jt,h({},l,{state:n})))},exports.Grid=({children:a,templateColumns:l,templateRows:n,autoColumns:i,autoRows:r,inline:o,column:s,columnStart:c,columnEnd:m,row:d,rowStart:u,rowEnd:p,gap:x,gapX:g,gapY:b,className:f,justifyContent:E,alignItems:v,..._})=>{const N=t(f,{"maxio-grid":!o,"maxio-inline-grid":o,[`maxio-grid-cols-${l}`]:l,[`maxio-grid-rows-${n}`]:n,[`maxio-auto-cols-${i}`]:i,[`maxio-auto-rows-${r}`]:r,["maxio-col-"+("auto"===s?"auto":`span-${s}`)]:s,[`maxio-col-start-${c}`]:c,[`maxio-col-end-${m}`]:m,["maxio-row-"+("auto"===d?"auto":`span-${d}`)]:d,[`maxio-row-start-${u}`]:u,[`maxio-row-end-${p}`]:p,[`maxio-gap-${x}`]:void 0!==x,[`maxio-gap-x-${g}`]:void 0!==g,[`maxio-gap-y-${b}`]:void 0!==b,[`maxio-justify-${E}`]:E,[`maxio-items-${v}`]:v});return e.createElement("div",h({className:N||void 0},_),a)},exports.Heading=He,exports.Icon=w,exports.IconButton=T,exports.Label=({as:a="div",children:l,size:n="sm",className:i,...r})=>{const o=a,s=t(`maxio-label-${n}`,i);return e.createElement(o,h({className:s},r),l)},exports.Link=R,exports.ListBox=Xe,exports.LoadingSpinner=k,exports.Logo=Qt,exports.Menu=({children:t,"data-testid":a})=>e.createElement(L,{testId:a},e.createElement(z,null,t)),exports.MenuButton=({children:a,iconName:l="chevron-down","aria-label":n,size:i="md",variant:r="secondary","data-testid":o})=>{const s=t({"maxio-action-menu__chevron":"chevron-down"===l}),c=t("maxio-button",`maxio-button--${r}`,`maxio-button--${i}`,{"maxio-button--icon":l&&!a}),{isOpen:m,buttonId:d,controlsId:u,testId:p}=B();return e.createElement("summary",{className:c,"aria-haspopup":"true","aria-label":n,"aria-expanded":m,"aria-controls":u,id:d,"data-testid":o??M(p,"trigger")},a&&e.createElement("span",null,a),l&&e.createElement(w,{variant:l,className:`${s} maxio-button__trailing-element`}))},exports.MenuList=({items:a,alignItemsEnd:l=!1,"data-testid":n})=>{const i=t("maxio-action-menu__content",{"maxio-action-menu__content--align-end":l}),{controlsId:r,buttonId:o,testId:s}=B();return e.createElement("div",{className:i,role:"presentation","data-testid":n??M(s,"list")},e.createElement(I,{role:"menu",itemProps:{role:"menuitem"},id:r,"aria-labelledby":o,items:a}))},exports.Modal=({size:a="lg",isDismissable:l=!0,className:i,style:r,children:o,...s})=>e.createElement(n.ModalOverlay,h({},s,{isDismissable:l,className:"maxio-modal__backdrop"}),e.createElement(n.Modal,{className:t("maxio-modal",i),style:r,"data-size":a},o)),exports.NumberField=ot,exports.OverlayTrigger=Z,exports.Pagination=({size:t="md",onChange:a,totalItems:l=0,itemsPerPage:n=30,currentPage:i=1,pageSizeOptions:r,manualPageInput:o=!1,"data-testid":s})=>{const[c,m]=e.useState(i),[d,u]=e.useState(n),[p,x]=e.useState(i.toString());e.useEffect(()=>{x(c.toString())},[c]);const g=Math.ceil(l/d),b=c<g,f=c>1,E=d*(c-1)+1,h=Math.min(d*c,l),v=r.map(e=>({label:e.toString(),value:e.toString()})),_=Array.from({length:g},(e,t)=>t+1).map(e=>({label:e.toString(),value:e.toString()})),N=e=>{m(e),a?.({currentPage:e,itemsPerPage:d})},y=e=>{const t=parseInt(e,10);if(isNaN(t))return void x(c.toString());const a=Math.max(1,Math.min(t,g));x(a.toString()),N(a)};return e.createElement("div",{className:"maxio-pagination","data-testid":s},e.createElement("div",{className:"maxio-pagination__items-per-page"},e.createElement("label",{htmlFor:"items-per-page-large",className:"maxio-pagination__label"},"Items per page"),e.createElement(mt,{inline:!0,size:t,options:v,onChange:e=>{return t=Number(e.target.value),u(t),m(1),void a?.({currentPage:1,itemsPerPage:t});var t},value:d,id:"items-per-page-large"})),e.createElement("div",{className:"maxio-pagination__total-items"},e.createElement("span",null,E,"–",h," of ",l," items")),e.createElement("div",{className:"maxio-pagination__current-page"},o?e.createElement(ct,{className:"maxio-pagination__page-input",value:p,min:1,max:g,onChange:e=>(e=>{x(e)})(e),onBlur:e=>{y(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(y(e.currentTarget.value),e.currentTarget.blur())},"aria-label":"Page number",size:t,type:"number",onWheel:e=>e.preventDefault()}):e.createElement(mt,{inline:!0,size:t,"aria-label":"Select page",onChange:e=>N(Number(e.target.value)),value:c,options:_,id:"page-index-large"}),e.createElement("div",{className:"maxio-pagination__label"},"of ",g," pages")),e.createElement("div",{className:"maxio-pagination__controls"},e.createElement(X,{onVisibilityUpdate:()=>{},renderContent:()=>"Previous",floatingElementOffset:9,placement:"top",size:"small"},e.createElement(T,{icon:e.createElement(w,{variant:"chevron-left"}),size:t,variant:"ghost",onClick:()=>N(c-1),"aria-label":"Previous",disabled:!f,"data-testid":M(s,"prev")})),e.createElement(X,{onVisibilityUpdate:()=>{},renderContent:()=>"Next",floatingElementOffset:9,placement:"top",size:"small"},e.createElement(T,{icon:e.createElement(w,{variant:"chevron-right"}),size:t,variant:"ghost",onClick:()=>N(c+1),"aria-label":"Next",disabled:!b,"data-testid":M(s,"next")}))))},exports.Popover=Re,exports.ProgressBar=({label:l,helperText:n,size:i="md",variant:r="default",status:o,value:s,maxValue:c=100,"data-testid":m})=>{const d=a.useId(),u=a.useId(),p=o&&!!l&&!!s&&!("inline"===r),x=n&&!("inline"===r),g=n&&"inline"===r,{progressBarProps:b,labelProps:f}=a.useProgressBar({maxValue:c,value:s,label:l}),E=t("maxio-progress-bar",{"maxio-progress-bar--lg":"lg"===i,"maxio-progress-bar--success":s&&!("inline"===r)&&"success"===o,"maxio-progress-bar--error":s&&!("inline"===r)&&"error"===o,"maxio-progress-bar--indent":"indent"===r,"maxio-progress-bar--inline":"inline"===r,"maxio-progress-bar--indeterminate":void 0===s});return e.createElement("div",h({className:E},b,{"data-testid":m}),e.createElement("div",h({id:d,className:"maxio-progress-bar__label"},f),l),g&&e.createElement("div",{id:u,className:"maxio-progress-bar__helper-text"},n),e.createElement("div",{className:"maxio-progress-bar__track"},e.createElement("div",{className:"maxio-progress-bar__progress",style:{"--tw-scale-x":`${s}%`}})),p&&e.createElement("div",{className:`maxio-progress-bar__${o}-icon`}),x&&e.createElement("div",{id:u,className:"maxio-progress-bar__helper-text"},n))},exports.Radio=({indent:l=!1,disabled:n=!1,invalid:i=!1,label:r,...o})=>{const s=e.useRef(null),c=e.useContext(nt),{inputProps:m,isDisabled:d}=a.useRadio({...o,value:(o.value||"").toString(),"aria-label":o["aria-label"]||r,isDisabled:n},c,s),u=t("maxio-radio",{"maxio-radio--indent":l,"maxio-radio--disabled":d||c.isDisabled,"maxio-radio--error":i||c.isInvalid});return e.createElement("label",{className:u},e.createElement("input",h({ref:s,role:"radio",type:"radio",className:"maxio-radio__input"},m,{name:c.name||m.name})),e.createElement("span",{className:"maxio-radio__control"}),e.createElement("span",{className:"maxio-radio__label"},r))},exports.RadioGroup=({children:t,label:l,errorMessage:n,helperText:i,disabled:r=!1,invalid:o=!1,name:s,defaultValue:c,...m})=>{const d=x.useRadioGroupState({isDisabled:r,isInvalid:o,description:i,name:s,label:l,errorMessage:n,defaultValue:c,...m}),{radioGroupProps:u,labelProps:p,descriptionProps:g,errorMessageProps:b}=a.useRadioGroup({"aria-label":m["aria-label"]||l,...m},d);return e.createElement(e.Fragment,null,e.createElement("div",h({className:"maxio-radio-group"},u),l&&e.createElement("label",h({className:"maxio-radio-group__label"},p),l),e.createElement(nt.Provider,{value:d},t),o&&n&&e.createElement(Ce,b,n),i&&!o&&e.createElement(ye,g,i)))},exports.RangeCalendar=ht,exports.SearchField=it,exports.SegmentedControl=wt,exports.Select=mt,exports.SideNav=({withIcons:t=!0,shouldToggleSidebar:a=!1,topDropdownItems:l,sections:n=[],collapseBreakpoint:i=800,isOpen:r,onChange:o})=>e.createElement(St,{isOpen:r,onChange:o,collapseBreakpoint:i,withIcons:t,shouldToggleSidebar:a,topDropdownItems:l,sections:n},e.createElement($t,null)),exports.Tab=Lt,exports.TabList=({children:a,className:l,ariaLabel:i,overflow:r="none",moreLabel:o="More",...s})=>{const{variant:c,withDivider:m}=e.useContext(Bt),d=e.useContext(n.TabListStateContext),u=e.useId(),[p,x]=e.useState(!1),g=t("maxio-tabs",l,{"maxio-tabs--contained":"contained"===c,"maxio-tabs--divider":m}),b=e.Children.map(a,e=>e);(b??[]).forEach(t=>{if(!e.isValidElement(t)||t.type!==Lt)throw new Error("You can only pass <Tab /> component as children")});const f="auto"===r&&!!b?.length,{ref:E,moreButtonRef:v,overflowIndexes:_,handleKeyDownCapture:N}=(({overflowEnabled:t,childrenArray:a})=>{const l=e.useRef(null),i=e.useRef(null),r=e.useRef(null),[o,s]=e.useState(null),c=Y(l),m=e.useContext(n.TabListStateContext),d=null!=m?.selectedKey?Number(m.selectedKey):null,[u,p]=e.useState([]);e.useLayoutEffect(()=>{if(!t||!o)return void p((a??[]).map((e,t)=>t));const{visibleIndexes:e}=((e,t,a,l)=>{const n=e.map((e,t)=>t);if(e.reduce((e,t)=>e+t,0)<=t)return{visibleIndexes:n,overflowIndexes:[]};const i=[];let r=a;for(const a of n){if(r+e[a]>t)break;r+=e[a],i.push(a)}if(null!==l&&!i.includes(l)){for(r+=e[l];r>t&&i.length>0;)r-=e[i.pop()];i.push(l)}i.sort((e,t)=>e-t);const o=n.filter(e=>!i.includes(e));return{visibleIndexes:i,overflowIndexes:o}})(o.tabWidths,c,o.moreButtonWidth,r.current??d);e.length===(a??[]).length&&(r.current=null),p(e)},[t,o,c]),e.useLayoutEffect(()=>{t&&o&&null!==d&&p(e=>(e.includes(d)||(r.current=d),((e,t,a,l,n)=>{if(e.includes(n))return e;const i=[...e,n].sort((e,t)=>e-t);let r=l+i.reduce((e,a)=>e+t[a],0);for(;r>a&&i.length>1;){const e=i.length-1,a=i[e]===n?e-1:e,[l]=i.splice(a,1);r-=t[l]}return i})(e,o.tabWidths,c,o.moreButtonWidth,d)))},[d]);const x=t?(a??[]).map((e,t)=>t).filter(e=>!u.includes(e)):[],g=((e,t)=>e.filter(e=>!t?.[e]?.props.disabled))(u,a);e.useLayoutEffect(()=>{if(!t||!l.current)return void s(e=>null===e?e:null);const e=Array.from(l.current.querySelectorAll('[role="tab"]')),n=i.current?.getBoundingClientRect().width??0;s(t=>{const l=(a??[]).map((a,l)=>{const n=e[l]?.getBoundingClientRect().width??0;return n>0?n:t?.tabWidths[l]??0}),i=n>0?n:t?.moreButtonWidth??0,r=t?.tabWidths.length===l.length&&t.tabWidths.every((e,t)=>e===l[t]);return t&&r&&t.moreButtonWidth===i?t:{tabWidths:l,moreButtonWidth:i}})},[a,t]);const b=e=>{void 0!==e&&(m?.selectionManager.setFocused(!0),m?.selectionManager.setFocusedKey(e),m?.setSelectedKey(e),l.current?.querySelector(`[role="tab"][data-key="${e}"]`)?.focus())};return{ref:l,moreButtonRef:i,visibleIndexes:u,overflowIndexes:x,handleKeyDownCapture:e=>{if(0===x.length)return;const t=document.activeElement===i.current,a=m?.selectionManager.focusedKey,l=t?-1:g.indexOf(Number(a));if(t||-1!==l)switch(e.key){case"ArrowRight":if(t)return;return e.preventDefault(),e.stopPropagation(),void(l<g.length-1?b(g[l+1]):i.current?.focus());case"ArrowLeft":return e.preventDefault(),e.stopPropagation(),void(t?b(g[g.length-1]):l>0&&b(g[l-1]));case"Home":if(t)return;return e.preventDefault(),e.stopPropagation(),void b(g[0]);case"End":if(t)return;return e.preventDefault(),e.stopPropagation(),void b(g[g.length-1])}}}})({overflowEnabled:f,childrenArray:b}),y=e.createElement("span",{className:"maxio-tabs__tab-content"},o,e.createElement(w,{variant:"chevron-down",className:"maxio-tabs__more__chevron"})),C=_.map(e=>{return`#${t=u,"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,"\\$&")} [role="tablist"] > .maxio-tabs__tab:nth-child(${e+1})`;var t});return e.createElement("div",{id:u,className:g,ref:E,onKeyDownCapture:N},C.length>0&&e.createElement("style",null,`${C.join(", ")} { display: none; }`),e.createElement(n.TabList,h({"aria-label":i,className:"maxio-contents"},s),(b??[]).map((t,a)=>e.cloneElement(t,{key:a,value:a}))),f&&_.length>0&&e.createElement(n.MenuTrigger,{isOpen:p,onOpenChange:x},e.createElement(n.Button,{ref:v,className:"maxio-tabs__tab maxio-tabs__more__trigger","aria-label":o},y),p&&e.createElement(Re,{hideArrow:!0,placement:"bottom end",className:"maxio-tabs__more__menu"},e.createElement(n.Menu,{"aria-label":`${o} tabs`,onAction:e=>{d?.setSelectedKey(e),requestAnimationFrame(()=>{E.current?.querySelector(`[role="tab"][data-key="${e}"]`)?.focus()})}},_.map(t=>{const a=b[t],{disabled:l,type:i,"aria-label":r,"aria-labelledby":o}=a.props,s="icon"===i?a.props.icon:a.props.children;return e.createElement(n.MenuItem,{key:t,id:t,isDisabled:!!l,"aria-label":r,"aria-labelledby":o,className:"maxio-tabs__more__item"},s)})))))},exports.TabPanel=Ft,exports.TabPanels=({children:t})=>{const a=e.Children.map(t,(t,a)=>{if(!e.isValidElement(t)||t.type!==Ft)throw new Error("You can only pass <TabPanel /> component as children");return e.cloneElement(t,{key:a,value:a})});return e.createElement(n.TabPanels,{className:"maxio-tabs__panels"},a)},exports.Tabs=({children:t,variant:a="line",withDivider:l=!1,defaultIndex:i=0,index:r,onChange:o,"data-testid":s})=>e.createElement(n.Tabs,{className:"maxio-tabs-container",selectedKey:r,defaultSelectedKey:i,onSelectionChange:e=>o?.(Number(e)),"data-testid":s},e.createElement(zt,{variant:a,withDivider:l},t)),exports.Tag=({children:a,size:l,sentiment:n,kind:i="primary",leadingIcon:r,trailingIcon:o,"data-testid":s})=>{const c=t("maxio-tag",`maxio-tag--${i}`,!!n&&`maxio-tag--${n}`,!!l&&`maxio-tag--${l}`);return e.createElement("div",{className:c,"data-testid":s},r&&e.createElement(w,{variant:r,className:"maxio-tag__icon"}),e.createElement("span",{className:"maxio-tag__label"},a),o&&e.createElement(w,{variant:o,className:"maxio-tag__icon"}))},exports.TextArea=st,exports.TextField=rt,exports.TextInput=ct,exports.Tile=({children:a,className:l,href:n,onClick:i,target:r,disabled:o,"data-testid":s})=>{const c=n||i;if(!c)return e.createElement("div",{className:"maxio-tile","data-testid":s},a);const m=t("maxio-tile",l,{"maxio-tile--clickable":c,"maxio-tile--disabled":o});return e.createElement("a",{className:m,href:n,target:r,onClick:e=>{o&&n&&e.preventDefault(),!o&&i&&i()},"data-testid":s},a)},exports.ToastProvider=({children:t,...a})=>{const{maxVisibleToasts:l=5,...n}=a,i=g.useToastState({maxVisibleToasts:l,...n});return e.useEffect(()=>{console.warn("ToastProvider is deprecated. Please use the global toast API instead.")},[]),e.createElement(e.Fragment,null,t(i),i.visibleToasts.length>0&&e.createElement(Jt,h({},a,{state:i})))},exports.ToastQueue=ta,exports.Toggle=({defaultChecked:a,checked:l,onChange:n,disabled:i,valueDescription:r,valueDescriptionPosition:o,className:s,name:c,id:m,"data-testid":d="toggle-container",...u})=>{const p=e.useId(),x="boolean"==typeof a,g=m||p,b="left"===o?"row":"row-reverse",f=r&&o,E=e.useCallback(e=>{if("Enter"===e.code||"Space"===e.code){e.preventDefault();const t=e.currentTarget.checked;x&&(e.currentTarget.checked=!t),n&&n(!t,e)}},[x,n]),h=u["aria-label"]||(f?void 0:r);return e.createElement("div",{className:t("maxio-toggle",s,{"maxio-toggle--disabled":i}),style:{display:"inline-flex",flexDirection:b},"data-testid":d},f?e.createElement("label",{className:"maxio-toggle__label",htmlFor:g},r):null,e.createElement("div",{className:"maxio-toggle__container"},e.createElement("input",{type:"checkbox",defaultChecked:a,checked:l,onChange:e=>{n&&n(e.target.checked,e)},onKeyDown:E,disabled:i,className:"maxio-toggle__checkbox",id:g,name:c,"aria-label":h}),e.createElement("div",{className:"maxio-toggle__track",role:"switch","aria-checked":l,"aria-hidden":"true"},e.createElement("div",{className:"maxio-toggle__handle"}),e.createElement("span",{className:"maxio-toggle__icon"},e.createElement("i",{className:"maxio-toggle__icon-on"})),e.createElement("span",{className:"maxio-toggle__icon"},e.createElement("i",{className:"maxio-toggle__icon-off"})))))},exports.Tooltip=W,exports.TooltipTrigger=X,exports.TopBar=({children:t,actions:a,sideNavIsClosed:l,openSideNav:n,"data-testid":i})=>e.createElement("nav",{className:"maxio-top-bar","data-testid":i},l&&e.createElement(T,{"aria-label":"Open Side Navigation",variant:"ghost",icon:e.createElement(w,{variant:"sidebar"}),onClick:n}),e.createElement(Ue,{grow:!0,justifyContent:"end"},t),a),exports.useElementResizeObserver=Y,exports.useHover=U,exports.useOverlayTrigger=G,exports.useToast=()=>{const t=e.useContext(ea);if(!t)throw new Error("useToast must be used within a GlobalToastProvider. Please wrap your app with <GlobalToastProvider> to use the global toast API.");return t},exports.useWindowSize=K;
|
|
1
|
+
"use strict";var e=require("react"),t=require("classnames"),a=require("react-aria"),l=require("@react-aria/utils"),n=require("react-aria-components"),i=require("@internationalized/date"),r=require("@react-stately/toggle"),o=require("@react-stately/checkbox"),s=require("framer-motion"),c=require("@floating-ui/react-dom-interactions"),m=require("@tanstack/react-table"),d=require("@atlaskit/pragmatic-drag-and-drop/element/adapter"),u=require("@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item"),p=require("@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview"),x=require("@react-stately/radio"),g=require("@react-stately/toast"),b=require("@react-aria/toast");function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var E=f(e);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},h.apply(null,arguments)}const v=["address-card","arrow-down","arrow-down-left","arrow-down-left-long","arrow-down-long","arrow-down-right","arrow-down-right-long","arrow-down-up","arrow-left","arrow-left-long","arrow-left-right","arrow-right","arrow-right-long","arrow-turn-down-right","arrow-up","arrow-up-left","arrow-up-left-long","arrow-up-long","arrow-up-right","arrow-up-right-long","bank","bar-chart","briefcase","building","business-intelligence","calendar","caret-down","caret-left","caret-right","caret-up","chat","check","check-box","check-box-checked","check-box-checked-fill","check-box-indeterminate-fill","check-circle","check-circle-fill","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle","circle-half-stroke-small","circle-small-dash","circle-small-fill","circle-small-stroke","clipboard","cog","copy-file","credit-card","cross","cross-circle","cross-circle-fill","dashboard","diamond-small-fill","document","document-blank","dollar","dot-circle-fill","dot-fill","error","error-fill","error-small-fill","graph","home","info-circle","info-circle-fill","line-vertical","list","login","logout","megaphone","menu","menu-chevron-left","menu-chevron-right","notification","notification-unread","pen","plus","plus-circle","plus-circle-fill","question-circle","question-circle-fill","recently-viewed","search","square-small-fill","trash","triangle-small-fill","user","warning-circle","warning-circle-fill"],_=["anrok","dropbox","hubspot","numeral","oracle","quotapath","sage","sphere","taxjar"],N=["avalara","pipedrive","quickbooks","salesforce","xero"],w=({variant:a,color:l,className:n,size:i,"data-testid":r})=>{const o=(e,t)=>t.includes(e),s=o(a,v)||o(a,_),c=o(a,N),m=t({"fa-kit":s,"fa-kit-duotone":c,"fa-sharp fa-regular":!s&&!c,[`fa-${a}`]:!0,[`fa-${i}`]:i,[`maxio-icon--${l}`]:l&&!o(a,_)&&!o(a,N)},n);return e.createElement("i",{className:m,"data-testid":r})},y=({item:l,isSelected:n,truncateLabel:i=!1,role:r="option",small:o=!1})=>{const s=e.useRef(null),c=e.useRef(!1),m=a.useId();if(e.useEffect(()=>{n&&c.current&&s.current?.focus()},[n]),e.useEffect(()=>{c.current=!0},[]),"divider"===l.type)return e.createElement("div",{className:"maxio-action-list__divider",role:"separator","aria-hidden":"true"});const{leadingIconName:d,leadingIconClassName:u,trailingIconName:p,label:x,description:g,link:b}=l,f=t("maxio-action-list__label",{"maxio-truncate":i});return e.createElement("a",h({"aria-labelledby":m},b,{className:t("maxio-action-list__content",b.className,{"maxio-action-list__content--size-small":o}),tabIndex:n?0:-1,ref:s,role:r}),d&&e.createElement(w,{variant:d,className:t("maxio-action-list__leading-icon",u)}),e.createElement("span",{className:f,id:m},x),g&&e.createElement("span",{className:"maxio-action-list__description"},g),p&&e.createElement(w,{variant:p,className:"maxio-action-list__trailing-icon"}))},C=(e,t,a)=>0===e?e:1===e&&"divider"===t[e-1].type?a||e:"divider"===t[e-1].type?C(e-1,t,a||e):e-1,I=({items:a,isShadowed:l=!0,itemProps:n={},className:i,truncateLabels:r=!1,small:o=!1,...s})=>{const c=t("maxio-action-list",i,{"maxio-action-list--shadow":l}),[m,d]=e.useState(()=>a.findIndex(e=>"divider"!==e.type));return 0===a.length?null:e.createElement("div",h({className:c,onKeyDown:e=>{if("Space"===e.code||"Enter"===e.code){const e=a[m];e&&"divider"!==e.type&&window.open(e.link.href,e.link.target||"_self")}"ArrowUp"===e.code&&(e.preventDefault(),d(e=>C(e,a))),"ArrowDown"===e.code&&(e.preventDefault(),d(e=>((e,t)=>{const a=t.findIndex((t,a)=>"divider"!==t.type&&a>e);return-1===a?e:a})(e,a)))},role:"listbox"},s),a.map((t,a)=>e.createElement(y,h({item:t,truncateLabel:r,key:`listbox-${t.id}`,isSelected:a===m,small:o},n))))},R=({className:a,children:l,disabled:n,external:i,icon:r,size:o="sm",underline:s,variant:c,...m})=>{const d=t("maxio-link",{[`maxio-link--${o}`]:o,"maxio-link--disabled":n,[`maxio-link--${c}`]:c,"maxio-link--underline":s},a),u=i?"_blank":"_self";return e.createElement("a",h({className:d,target:u},m),l,r&&e.createElement(w,{variant:r,className:"maxio-link__icon"}))},k=({size:a="md",white:l=!1,className:n,"data-testid":i})=>{const r=t("maxio-loading-spinner",n,`maxio-loading-spinner--${a}`,{"maxio-loading-spinner--white":l});return e.createElement("div",{className:r,role:"status","aria-label":"loading","data-testid":i})},S=e.forwardRef(({fullWidth:n=!1,leadingElement:i,trailingElement:r,icon:o,variant:s="primary",size:c,...m},d)=>{const u=l.useObjectRef(d),{linkProps:p}=a.useLink({...m},u),x=t("maxio-button",m.className,{[`maxio-button--${c}`]:c,[`maxio-button--${s}`]:s,"maxio-button--full-width":n});return e.createElement("a",h({},p,{ref:u,className:x,href:m.href}),i&&e.cloneElement(i,{...e.isValidElement(i)&&{className:"maxio-button__leading-element"}}),m.children,(r||o)&&e.cloneElement(r||o,{...e.isValidElement(r||o)&&{className:"maxio-button__trailing-element"}}))}),D=e.forwardRef(({disabled:n,loading:i=!1,fullWidth:r=!1,leadingElement:o,trailingElement:s,icon:c,variant:m="primary",size:d,...u},p)=>{const x=l.useObjectRef(p),{buttonProps:g}=a.useButton({...u,isDisabled:n,formAction:"string"==typeof u.formAction?u.formAction:void 0},x),b=["primary","danger"].includes(m),f=t("maxio-button",u.className,{[`maxio-button--${d}`]:d,[`maxio-button--${m}`]:m,"maxio-button--loading":i,"maxio-button--full-width":r});return e.createElement("button",h({},g,{className:f,ref:x}),o&&e.cloneElement(o,{...e.isValidElement(o)&&{className:"maxio-button__leading-element"}}),u.children,!i&&(s||c)&&e.cloneElement(s||c,{...e.isValidElement(s||c)&&{className:"maxio-button__trailing-element"}}),i&&e.createElement(k,{className:"maxio-button__trailing-element",size:"md",white:b}))}),P=e.forwardRef((t,a)=>(e=>"href"in e)(t)?e.createElement(S,h({},t,{ref:a})):e.createElement(D,h({},t,{ref:a}))),T=({"aria-label":a,className:l,...n})=>e.createElement(P,h({"aria-label":a,className:t("maxio-button--icon",l)},n),null),M=(e,...t)=>e?[e,...t].join("."):void 0,O=({children:a,title:l,linkText:n,linkExternal:i,href:r,display:o="inline",sentiment:s="info",onDismiss:c,className:m,"data-testid":d})=>{if(!a&&!l)return console.warn("Alert component requires either children or title prop to be rendered"),null;const u=t("maxio-alert",{[`maxio-alert--${s}`]:"info"!==s&&s},m),p={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[s],x=t("maxio-alert__content",{"maxio-alert__content--block":"block"===o});return e.createElement("div",{className:u,"data-testid":d},e.createElement(w,{variant:p,className:"maxio-alert__icon","aria-hidden":"true"}),e.createElement("section",{className:"maxio-alert__container"},e.createElement("div",{className:x},l&&e.createElement("span",{className:"maxio-alert__title"},l),a&&e.createElement("span",{className:"maxio-alert__message"},a),n&&r&&e.createElement(R,h({className:"maxio-alert__link",href:r,variant:"high-contrast",underline:!0},i?{external:!0}:{}),n))),c&&e.createElement(T,{icon:e.createElement(w,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:c,className:"maxio-alert__dismiss","data-testid":M(d,"dismiss")}))},$=e.createContext({}),L=({children:t,testId:a})=>{const[l,n]=e.useState(!1),i=e.useId(),r=e.useId();return e.createElement($.Provider,{value:{controlsId:i,buttonId:r,isOpen:l,onClose:()=>n(!1),onOpen:()=>n(!0),onToggle:()=>n(e=>!e),testId:a}},t)};function B(){const t=e.useContext($);if(!t||"object"==typeof t&&0===Object.keys(t).length)throw new Error("useMenu hook must be used within a MenuProvider");return t}const z=({children:t})=>{const{isOpen:a,onToggle:l,onClose:n,testId:i}=B();return e.createElement("details",{open:a,onToggle:l,className:"maxio-action-menu","data-testid":i},"function"==typeof t?t({isOpen:a,onClose:n}):t)},A=({children:a,className:l,href:n,...i})=>{const r=n?e.createElement(R,{size:"sm",href:n},a):a;return e.createElement("li",h({className:t("maxio-breadcrumbs__item",l)},i),r)},F="Breadcrumbs requires at least one BreadcrumbsItem as children",V='Last BreadcrumbsItem should not have "href" prop. It is the current page.',H="Breadcrumbs only accepts BreadcrumbsItem as children",W=({children:a,arrowPosition:l,size:n="regular",maxWidth:i=160,"data-testid":r="tooltip"})=>e.createElement("div",{"data-testid":r,className:t("maxio-tooltip",`maxio-tooltip--${n}`,{[`maxio-tooltip--arrow-${l}`]:l})},e.createElement("div",{className:"maxio-tooltip__content",style:{maxWidth:i}},a)),j={click:c.useClick,hover:e=>c.useHover(e,{delay:100}),focus:c.useFocus,dismiss:c.useDismiss},q=(e,t)=>t.map(t=>j[t](e)),G=({placement:t="top",isActive:a=!1,interactions:l=["hover"],floatingElementOffset:n=0,onOverlayUpdate:i,autoHideMs:r,strategy:o="absolute",shiftIntoView:s=!1})=>{const m=e.useRef(null),[d,u]=e.useState(0),[p,x]=e.useState(a);a!==p&&(x(a),a&&u(e=>e+1));const{strategy:g,x:b,y:f,context:E,floating:h,reference:v,refs:_,middlewareData:N}=c.useFloating({placement:t,strategy:o,open:a,onOpenChange:e=>i(e),middleware:[c.offset(n),...s?[c.shift({padding:8,limiter:c.limitShift()}),c.hide(),{name:"openCycle",options:d,fn:()=>({data:{cycle:d}})}]:[]],whileElementsMounted:c.autoUpdate}),{getReferenceProps:w,getFloatingProps:y}=c.useInteractions([...q(E,l),c.useRole(E,{role:"tooltip"})]);e.useEffect(()=>{m.current&&clearTimeout(m.current),a&&r&&(m.current=window.setTimeout(()=>i(!1),r))},[a,r]);const C=N.openCycle?.cycle===d,I=C&&!!N.hide?.referenceHidden,R=s&&a&&!C,k={position:g,top:f??0,left:b??0,"--maxio-overlay-shift-x":`${N.shift?.x??0}px`,"--maxio-overlay-shift-y":`${N.shift?.y??0}px`,...(I||R)&&{visibility:"hidden"}};return{isActive:a,refs:{floating:h,reference:v,floatingElement:_.floating},isReferenceHidden:I,floatingElementCSSPosition:k,getReferenceProps:w,getFloatingProps:y}};function U(t,a=0){const l=e.useRef((new Date).getTime()),n=e.useRef((new Date).getTime()),[i,r]=e.useState(!1);return e.useEffect(()=>{const e=()=>{l.current=(new Date).getTime(),r(!0)},i=()=>{n.current=(new Date).getTime(),window.setTimeout(()=>{l.current-n.current<=0&&r(!1)},a)},o=t&&t.current;return o&&(o.addEventListener("mouseenter",e),o.addEventListener("mouseleave",i)),()=>{o&&(o.removeEventListener("mouseenter",e),o.removeEventListener("mouseleave",i))}},[t]),i}function K(t=500){const[a,l]=e.useState(()=>{if("undefined"==typeof window)return{windowWitdh:0,windowHeight:0};const{innerWidth:e,innerHeight:t}=window;return{windowWitdh:e,windowHeight:t}}),n=e.useRef(null);return e.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{const{innerWidth:e,innerHeight:a}=window;window.clearTimeout(n.current??void 0),n.current=window.setTimeout(()=>{l({windowWitdh:e,windowHeight:a})},t)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[t]),a}function Y(t){const[a,n]=e.useState(()=>t.current?.clientWidth??0),i=()=>{const e=t.current?.clientWidth??0;n(t=>0===e&&t>0?t:e)};return e.useLayoutEffect(i,[t]),l.useResizeObserver({ref:t,onResize:i}),a}const Z="maxio-ui-portal",Q=new Set;let X=null;const J=e=>"childList"===e.type?Array.from(e.removedNodes).some(e=>e.id===Z):!e.target.classList?.contains("maxio-overlay-trigger__overlay"),ee=({children:a,usePortal:l=!1,isActive:n=!1,placement:i="top",interactions:r=["hover"],role:o="tooltip",renderOverlay:m,floatingElementOffset:d,motionSettings:u={},autoHideMs:p,onOverlayUpdate:x,className:g,"data-testid":b="overlay-trigger"})=>{const{getReferenceProps:f,getFloatingProps:E,refs:{floating:v,reference:_,floatingElement:N},isReferenceHidden:w,floatingElementCSSPosition:y}=G({isActive:n,onOverlayUpdate:x,autoHideMs:p,floatingElementOffset:d,interactions:r,placement:i,strategy:l?"fixed":"absolute",shiftIntoView:l}),[C,I]=e.useState(null),R=e.useCallback(e=>{_(e),I(e)},[_]),k=e.useRef(null);e.useLayoutEffect(()=>{n&&(k.current=document.activeElement)},[n]),e.useLayoutEffect(()=>{const e=N.current;if(!w||!e?.contains(document.activeElement))return;const t=k.current;[...t&&C?.contains(t)?[t]:[],...Array.from(C?.querySelectorAll('button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"]):not(:disabled)')??[])].some(e=>(e.focus({preventScroll:!0}),document.activeElement===e))},[w,N,C]);const[S,D]=e.useReducer(e=>e+1,0);e.useEffect(()=>{var e;if(l&&n)return e=D,Q.add(e),X||(X=new MutationObserver(e=>{e.some(J)&&Q.forEach(e=>e())}),X.observe(document.documentElement,{attributes:!0,attributeFilter:["data-maxio-mode"],subtree:!0}),X.observe(document.body,{childList:!0})),()=>{Q.delete(e),0===Q.size&&(X?.disconnect(),X=null)}},[l,n]);const[P,T]=e.useState(null),M=P?.isConnected??!0;e.useLayoutEffect(()=>{if(!l||!n||!C)return;const e=(e=>{const t=e.closest('[role="dialog"], [role="alertdialog"], dialog');if(t)return t;let a=document.getElementById(Z);return a||(a=document.createElement("div"),a.id=Z,document.body.appendChild(a)),a})(C);e!==P&&T(e)},[l,n,C,P,M,S]);const O=l?C?.closest("[data-maxio-mode]")?.getAttribute("data-maxio-mode")??void 0:void 0,$=e.createElement(s.AnimatePresence,{onExitComplete:l?()=>T(null):void 0},n&&e.createElement(s.motion.div,h({ref:v,className:t("maxio-overlay-trigger__overlay",{"maxio-overlay-trigger__overlay--portaled":l}),style:l?{...y,zIndex:"var(--maxio-z-dropdown, 50)"}:y,inert:w||void 0,"data-maxio-mode":O},u,E()),m()));return e.createElement(e.Fragment,null,e.createElement("div",h({ref:R,className:t("maxio-inline-flex",g)},f(),{"data-testid":b}),a),l?P&&e.createElement(c.FloatingPortal,{root:P},$):$)},te={top:"bottom",right:"left",bottom:"top",left:"right","top-start":"bottom-left","top-end":"bottom-right","right-start":"left-top","right-end":"left-bottom","bottom-start":"top-left","bottom-end":"top-right","left-start":"right-top","left-end":"right-bottom"},ae=({children:t,interactions:a=["hover"],placement:l="right",maxWidth:n=160,size:i="regular",renderContent:r,autoHideMs:o,isVisible:s,usePortal:c,className:m,onVisibilityUpdate:d,floatingElementOffset:u=5,"data-testid":p})=>{const[x,g]=e.useState(!1),b=void 0!==s,f=e.useRef(null),E=e.useCallback(e=>{f.current&&clearTimeout(f.current),f.current=window.setTimeout(()=>{b||g(e),d&&d(e)},50)},[b,d]),h=e.useMemo(()=>(e=>{const t=e.startsWith("top")||e.startsWith("bottom")?"Y":"X",a=`translate${t}(${e.startsWith("bottom")||e.startsWith("right")?"-":""}10px)`;return{initial:{opacity:0,visibility:"hidden",transform:a},animate:{opacity:1,visibility:"visible",transform:`translate${t}(0px)`},exit:{opacity:0,visibility:"hidden",transform:a},transition:{ease:[.4,0,.5,1],duration:.2}}})(l),[l]);return e.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]),e.createElement(ee,{role:"tooltip",className:m,floatingElementOffset:u,motionSettings:h,isActive:b?s:x,onOverlayUpdate:E,autoHideMs:o,usePortal:c,placement:l,interactions:a,"data-testid":p,renderOverlay:()=>e.createElement(W,{size:i,arrowPosition:te[l],maxWidth:n,"data-testid":M(p,"tooltip")},r())},t)},le="maxio-copy-to-clipboard--subtle",ne="maxio-copy-to-clipboard--xs",ie={idle:"copy-file",copied:"check",error:"error"},re="row-controls",oe="row-actions",se=({children:a,pattern:l,size:n,isExpandable:i,isUsingCustomRow:r,"data-testid":o})=>{const[s,c]=e.useState(!1),[m,d]=e.useState(!1),u=l&&r&&i,p=t("maxio-data-table",{"maxio-data-table--pattern":l&&!u,"maxio-data-table--expanded-child-pattern":u,"maxio-data-table--with-custom-row":r,[`maxio-data-table--${n}`]:n,"maxio-data-table--with-pinned-left-border":s,"maxio-data-table--with-pinned-right-border":m});return e.createElement("div",{className:"maxio-data-table-wrapper",onScroll:e=>{const t=e.target;c(t.scrollLeft>0),d(t.scrollWidth-t.clientWidth-t.scrollLeft>0)},"data-testid":o},e.createElement("table",{className:p},a))},ce=({children:t})=>e.createElement("thead",null,t),me=({children:t})=>e.createElement("tbody",null,t),de=({children:a,table:l,header:n,className:i,enableExpanding:r,...o})=>{const s=n?.column,c=s?.getCanSort?.(),m=s?.getToggleSortingHandler?.(),d=n?.isPlaceholder,u=s?.columnDef?.meta?.align,p=s?.columnDef?.meta?.width,x=s?.columnDef?.meta?.controls,g=s?.columnDef?.meta?.actions,b=s?.getIsPinned(),f=s?.getIsSorted(),E="asc"===f,v=t("maxio-data-table__cell",i,{[`maxio-data-table__cell--pinned-${b}`]:b,"maxio-data-table__cell--sortable":c,"maxio-data-table__cell--active":f,[`maxio-data-table__cell--${u}`]:u,"maxio-data-table__cell--controls":x,"maxio-data-table__cell--actions":g}),_={...p?{width:p}:{},..."left"===b?{left:s?.getStart("left")}:"right"===b?{right:s?.getAfter("right")}:{}},N=((e,t)=>e&&t?"arrow-up":e&&!t?"arrow-down":"arrow-down-up")(!!f,E),y=l?.getToggleAllRowsExpandedHandler(),C=l?.getIsAllRowsExpanded?.(),I=n?.headerGroup.headers[0].id===re?1:0,R=r&&n?.index===I;return d?null:e.createElement("th",h({scope:"col",role:"columnheader","aria-sort":f?E?"ascending":"descending":"none",className:v,onClick:m,colSpan:n?.colSpan,style:_},o),e.createElement("div",{className:"maxio-data-table__cell-flex"},!0===r&&R&&e.createElement(T,{size:"sm",variant:"ghost",icon:e.createElement(w,{size:"xs",variant:C?"chevron-down":"chevron-right"}),onClick:y,"aria-label":C?"Collapse all rows":"Expand all rows","data-open":C,className:"maxio-data-table__expand-button"}),a,c&&e.createElement(w,{variant:N,className:"maxio-data-table__sort-icon"})))},ue=e=>e.subRows??[],pe=(e,t)=>Object.assign({},e,{subRows:t}),xe=(e,t,a=[])=>{for(let l=0;l<e.length;l+=1){const n=e[l],i=[...a,l];if(n===t)return i;const r=xe(ue(n),t,i);if(r)return r}return null},ge=(e,t)=>{const[a,...l]=t,n=e[a];if(!n)return null;const i=[...e];if(0===l.length)return i.splice(a,1),{data:i,item:n};const r=ge(ue(n),l);return r?(i[a]=pe(n,r.data),{data:i,item:r.item}):null},be=(e,t,a,l)=>{const n=[...e];if(0===t.length)return n.splice(a,0,l),n;const[i,...r]=t,o=e[i];if(!o)return null;const s=be(ue(o),r,a,l);return s?(n[i]=pe(o,s),n):null},fe=(e,t)=>{let a,l=e;for(const e of t){if(a=l[e],!a)return;l=ue(a)}return a},Ee="maxio-data-table-row",he=e.createContext(null),ve=()=>e.useContext(he),_e=e=>e.type===Ee&&"string"==typeof e.instanceId&&"string"==typeof e.rowId,Ne=e=>{const t=(e=>{const t=u.extractInstruction(e);return t&&"instruction-blocked"!==t.type?"reorder-above"===t.type?"before":"reorder-below"===t.type?"after":"make-child"===t.type?"inside":null:null})(e);return"string"==typeof e.rowId&&t?{rowId:e.rowId,position:t}:null},we=({availability:t,children:a,data:l,enableExpanding:n,getRowReorderLabel:i,onRowReorder:r,rowReorderMode:o,table:s})=>{const c=`maxio-data-table-${e.useId()}`,[m,x]=e.useState(""),[g,b]=e.useState(null),[f,E]=e.useState(null),h=e.useRef(null),v=e.useCallback(e=>s.getCoreRowModel().rowsById[e],[s]),_=e.useCallback(e=>i?.(e)??e.id,[i]),N=e.useCallback((e,t)=>{const a=v(e),i=v(t.rowId);if(!a||!i)return null;const r=((e,t,a,l,n)=>{if(t.id===a.id||!((e,t,a,l)=>"all"===l||("siblings"===l?"inside"!==a&&(e.parentId??null)===(t.parentId??null):"inside"===a?e.depth===t.depth+1:e.depth===t.depth))(t,a,l,n))return null;const i=xe(e,t.original),r=xe(e,a.original);if(!i||!r||(s=r,(o=i).length<s.length&&o.every((e,t)=>s[t]===e)))return null;var o,s;const c=ge(e,i);if(!c)return null;const m=((e,t)=>{const a=[...e],l=t.length-1;return l>=0&&e.length>l&&t.slice(0,l).every((t,a)=>e[a]===t)&&t[l]<e[l]&&(a[l]-=1),a})(r,i),d=m[m.length-1];if(void 0===d)return null;const u="inside"===l?m:m.slice(0,-1),p=fe(c.data,m);if(!p)return null;const x="inside"===l?ue(p).length:d+("after"===l?1:0),g={parentRowId:"inside"===l?a.id:a.parentId??null,index:x},b={parentRowId:t.parentId??null,index:t.index};if(b.parentRowId===g.parentRowId&&b.index===g.index)return null;const f=be(c.data,u,x,c.item);return f?{data:f,source:b,destination:g}:null})(l,a,i,t.position,o);return r&&!n&&null!==r.destination.parentRowId&&r.destination.parentRowId!==r.source.parentRowId?null:r},[l,n,v,o]),w=e.useCallback(e=>{h.current=e,b(e)},[]),y=e.useCallback((e,t)=>{const a=v(e),l=v(t.rowId),n=N(e,t);return a&&l&&n?(r({...n,row:a,rowId:a.id,targetRow:l,targetRowId:l.id,position:t.position}),x(`${_(a)} moved ${i=_(l),o=t.position,"inside"===o?`inside ${i}`:`${o} ${i}`}.`),!0):(x("That row cannot be moved to this position."),!1);var i,o},[_,N,v,r]),C=e.useCallback((e,{input:t,element:a,source:l})=>{const n={rowId:e.id,instanceId:c},i=u.attachInstruction(n,{element:a,input:t,currentLevel:e.depth,indentPerLevel:24,mode:"standard"}),r=Ne(i),o=_e(l.data)&&l.data.instanceId===c&&Boolean(r&&N(l.data.rowId,r));return{...i,isValid:o}},[N,c]),I=e.useCallback((e,a)=>{if(!t.available)return()=>{};const l=e=>{const t=e.isValid?Ne(e):null;w(t)};return d.dropTargetForElements({element:a,canDrop:({source:t})=>_e(t.data)&&t.data.instanceId===c&&t.data.rowId!==e.id&&!e.getParentRows().some(e=>e.id===t.data.rowId),getData:t=>C(e,t),onDragEnter:({self:e})=>l(e.data),onDrag:({self:e})=>l(e.data),onDragLeave:()=>{h.current?.rowId===e.id&&w(null)}})},[t,C,c,w]),R=e.useCallback((e,a)=>{const l=a.closest("tr");return t.available&&l instanceof HTMLElement?d.draggable({element:l,dragHandle:a,getInitialData:()=>({type:Ee,instanceId:c,rowId:e.id}),onGenerateDragPreview:({nativeSetDragImage:t})=>{p.setCustomNativeDragPreview({nativeSetDragImage:t,render:({container:t})=>{const a=document.createElement("div");return a.className="maxio-data-table__drag-preview",a.textContent=_(e),a.setAttribute("aria-hidden","true"),t.append(a),()=>a.remove()}})}}):()=>{}},[t,_,c]);e.useEffect(()=>{if(t.available)return d.monitorForElements({canMonitor:({source:e})=>_e(e.data)&&e.data.instanceId===c,onDragStart:({source:e})=>{if(!_e(e.data))return;const t=v(e.data.rowId);E(e.data.rowId),t&&x(`${_(t)} grabbed. Choose a destination.`)},onDrop:({source:e,location:t})=>{if(_e(e.data)){const a=t.current.dropTargets[0]?.data,l=!0===a?.isValid?Ne(a):null;l?y(e.data.rowId,l):x("Row move cancelled.")}E(null),w(null)}})},[y,t,_,v,c,w]),e.useEffect(()=>{if("inside"!==g?.position)return;const e=v(g.rowId);if(!e?.getCanExpand()||e.getIsExpanded())return;const t=window.setTimeout(()=>e.toggleExpanded(!0),500);return()=>window.clearTimeout(t)},[g,v]);const k=e.useCallback(e=>{if(!t.available)return[];const a=e.parentId?v(e.parentId):null,l=a?.subRows??s.getCoreRowModel().rows,n=l.findIndex(t=>t.id===e.id);if(-1===n)return[];const i=l[n-1],r=l[n+1],o=l[0],c=l[l.length-1],m=[];if(n>1&&o&&m.push({id:"top",label:"Move to top",target:{rowId:o.id,position:"before"}}),i&&m.push({id:"up",label:"Move up",target:{rowId:i.id,position:"before"}}),r&&m.push({id:"down",label:"Move down",target:{rowId:r.id,position:"after"}}),n<l.length-2&&c&&m.push({id:"bottom",label:"Move to bottom",target:{rowId:c.id,position:"after"}}),a){let e=a;for(;e.parentId;){const t=v(e.parentId);if(!t)break;e=t}m.push({id:"move-to-root",label:"Move to root",target:{rowId:e.id,position:"after"}})}return s.getCoreRowModel().flatRows.forEach(t=>{t.id!==e.parentId&&m.push({id:`move-to:${t.id}`,label:`Move to ${_(t)}`,target:{rowId:t.id,position:"inside"}})}),m.filter(t=>Boolean(N(e.id,t.target)))},[t,_,N,v,s]),S=e.useCallback(e=>{if(!t.available)return!1;const a=e.parentId?v(e.parentId):null;return(a?.subRows??s.getCoreRowModel().rows).length>1||"siblings"!==o&&("all"===o?Boolean(a):!(!n||0===e.depth)&&s.getCoreRowModel().flatRows.some(t=>t.depth===e.depth-1&&t.id!==e.parentId))},[t,n,v,o,s]),D=e.useMemo(()=>({activeTarget:g,availability:t,draggingRowId:f,getActions:k,getLabel:_,hasActions:S,moveRow:y,registerHandle:R,registerRow:I}),[g,t,y,f,k,_,S,R,I]);return e.createElement(he.Provider,{value:D},a,e.createElement("span",{className:"maxio-data-table__live-region",role:"status","aria-live":"polite","aria-atomic":"true"},m))},ye=({children:l,row:n,isChild:i,isHeader:r,className:o,onRowAction:s,...c})=>{const m=n?.getIsSelected?.(),d=n?.getCanExpand?.()&&n?.getIsExpanded?.(),u=Boolean(n&&s&&!r&&!i),p=e.useRef(null),x=ve(),g=x?.registerRow,b=e.useRef(null),f=e=>{b.current=e.target},{pressProps:E}=a.usePress({isDisabled:!u,onPress:e=>{const t=b.current??e.target;b.current=null,n&&s&&!(e=>e instanceof Element&&Boolean(e.closest("a,button,input,select,textarea,label,.maxio-data-table__cell--controls,.maxio-data-table__cell--actions")))(t)&&s(n)}}),{focusProps:v,isFocused:_}=a.useFocusRing(),N=t({"maxio-data-table__row":!r,"maxio-data-table__header-row":r,"maxio-data-table__row--active":m||_,"maxio-data-table__row--expanded":d,"maxio-data-table__row--expanded-child":i,"maxio-data-table__row--actionable":u,"maxio-data-table__row--dragging":Boolean(n)&&x?.draggingRowId===n?.id,[`maxio-data-table__row--drop-${x?.activeTarget?.position}`]:Boolean(n)&&x?.activeTarget?.rowId===n?.id},o);e.useEffect(()=>{if(n&&g&&p.current&&!r&&!i)return g(n,p.current)},[i,r,g,n]);const w=u?a.mergeProps({onClickCapture:f,onKeyDownCapture:f,tabIndex:0},E,v,c):c;return e.createElement("tr",h({},w,{ref:p,className:N,tabIndex:u?w.tabIndex:c.tabIndex}),l)},Ce=e.createContext({}),Ie=e.forwardRef(({checked:a,disabled:l,invalid:n,indeterminate:i,className:r,inputProps:o,error:s,label:c},m)=>{const d=t("maxio-checkbox",{"maxio-checkbox--checked":a,"maxio-checkbox--disabled":l,"maxio-checkbox--error":n,"maxio-checkbox--indeterminate":i},r);return e.createElement("label",{className:d},e.createElement("input",h({type:"checkbox",role:"checkbox",className:"maxio-checkbox__input",ref:m},o)),e.createElement("span",{className:"maxio-checkbox__control"},s&&e.createElement("span",{className:"maxio-checkbox__control-error"})),c&&e.createElement("span",{className:"maxio-checkbox__label"},c))});Ie.displayName="InnerCheckbox";const Re=({label:t,error:l=!1,className:n,indeterminate:i,value:o="",disabled:s,readOnly:c,defaultChecked:m,checked:d,...u})=>{const p=e.useRef(null),x=e.useContext(Ce),{inputProps:g,isDisabled:b,isInvalid:f,isSelected:E}=x&&Object.keys(x).length>0?a.useCheckboxGroupItem({value:o,"aria-label":t??u["aria-label"],isDisabled:s,isInvalid:l,isIndeterminate:i,isReadOnly:c,...u},x,p):a.useCheckbox({"aria-label":t??u["aria-label"],isDisabled:s,isInvalid:l,isIndeterminate:i,isReadOnly:c,value:o,...u},r.useToggleState({...u,isSelected:d,defaultSelected:m}),p);return e.createElement(Ie,h({inputProps:g,checked:E,disabled:b,invalid:f,indeterminate:i,className:n,error:l,label:t,ref:p},u))},ke=({children:a,className:l,...n})=>e.createElement("div",h({className:t("maxio-form-helper-text",l)},n),a),Se=({children:a,className:l,...n})=>e.createElement("div",h({className:t("maxio-form-error",l)},n),e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},a)),De=({table:t,enableRowSelection:a,enableRowReordering:l})=>{const n=t?.getToggleAllPageRowsSelectedHandler?.(),i=t?.getIsAllPageRowsSelected?.()||t?.getIsAllRowsSelected?.(),r=t?.getIsSomePageRowsSelected?.();return a?e.createElement(e.Fragment,null,l&&e.createElement("span",{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon","aria-hidden":"true",style:{visibility:"hidden"}}),e.createElement(Re,{"aria-label":"Select all rows",onChange:e=>{n("boolean"==typeof e?{target:{checked:e}}:e)},checked:i,indeterminate:!i&&r})):null},Pe=({className:a,hideArrow:l=!1,children:i,offset:r=4,...o})=>e.createElement(n.Popover,h({},o,{className:t("maxio-popover",a),offset:r}),e.createElement(e.Fragment,null,!l&&e.createElement(n.OverlayArrow,{className:"maxio-popover__arrow"},e.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12","aria-hidden":!0},e.createElement("path",{d:"M0 0 L6 6 L12 0"}))),i)),Te=({row:t})=>{const a=ve(),l=a?.registerHandle,i=a?.getActions,r=a?.hasActions,o=e.useRef(null),[s,c]=e.useState(!1),m=a?.draggingRowId===t.id,d=a?.getLabel(t)??t.id,u=e.useMemo(()=>r?.(t)??!1,[r,t]),p=e.useMemo(()=>s?i?.(t)??[]:[],[i,s,t]),x=(a&&!a.availability.available?a.availability.message:void 0)??(u?void 0:`No moves are available for ${d}.`);e.useEffect(()=>{if(l&&o.current&&!x)return l(t,o.current)},[l,t,x]),e.useEffect(()=>{x&&c(!1)},[x]);const g=e.createElement(n.Button,{ref:o,type:"button",className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon maxio-data-table__drag-handle","aria-label":`Reorder ${d}`,"aria-pressed":m,"aria-disabled":!!x||void 0,onPress:()=>{x||c(!0)}},e.createElement("i",{className:"fa-sharp fa-solid fa-grip-dots-vertical "+(x?"maxio-icon--disabled":"maxio-icon--secondary")}));return x?e.createElement(n.TooltipTrigger,{delay:0,closeDelay:0},g,e.createElement(n.Tooltip,{placement:"bottom start",offset:8,className:"maxio-tooltip maxio-tooltip--arrow-top-left"},e.createElement("div",{className:"maxio-tooltip__content"},x))):e.createElement(n.MenuTrigger,{trigger:"longPress",isOpen:s,onOpenChange:c},g,e.createElement(Pe,{placement:"bottom start",hideArrow:!0},e.createElement(n.Menu,{autoFocus:"first",className:"maxio-data-table__reorder-menu",items:p,onAction:e=>{const l=p.find(t=>t.id===e);l&&(a?.moveRow(t.id,l.target),requestAnimationFrame(()=>o.current?.focus()))}},t=>e.createElement(n.MenuItem,{id:t.id,textValue:t.label,className:"maxio-data-table__reorder-menu-item"},t.label))))},Me=({row:t,enableRowSelection:a,enableRowReordering:l})=>{const n=t?.getToggleSelectedHandler?.(),i=t?.getIsSelected?.()||t?.getIsAllSubRowsSelected?.(),r=t?.getIsSomeSelected?.(),o=t.id||t.index;return e.createElement(e.Fragment,null,l&&e.createElement(Te,{row:t}),a&&e.createElement(Re,{"aria-label":`Select row ${o}`,onChange:n,checked:i,indeterminate:r}))},Oe=({children:t})=>e.createElement("div",{className:"maxio-data-table__cell-flex"},t),$e=({row:a,cell:l,children:n,className:i,...r})=>{const o=l?.column,s=o?.columnDef?.meta?.align,c=o?.columnDef?.meta?.controls,m=o?.columnDef?.meta?.actions,d=o?.getIsPinned(),u=t("maxio-data-table__cell",i,{[`maxio-data-table__cell--pinned-${d}`]:d,[`maxio-data-table__cell--${s}`]:s,"maxio-data-table__cell--controls":c,"maxio-data-table__cell--actions":m}),p="left"===d?{left:o?.getStart("left")}:"right"===d?{right:o?.getAfter("right")}:{};return e.createElement("td",h({className:u,style:p},r),n)},Le=({row:t,SubRowComponent:a,pattern:l,enableExpanding:n,onRowAction:i,testId:r})=>{const o=a&&t.getParentRow()&&t.getParentRow().getIsExpanded(),s=o&&t.getVisibleCells()[0].column.columnDef.id===re,c=o&&t.getVisibleCells()[t.getVisibleCells().length-1].column.columnDef.id===oe,d=[c,s].filter(Boolean).length,u=t.getVisibleCells().length-d,p=t.getParentRow()?.index??t.index,x=l&&a&&p%2==1?"maxio-data-table__row--with-pattern":void 0,g=t.getCanExpand?.(),b=t?.getToggleExpandedHandler?.(),f=t?.getIsExpanded?.(),E=g&&n?0:1.75,h=t.getVisibleCells()[0].column.columnDef.id===re?1:0,v=t.getVisibleCells().find(({column:e})=>{const{actions:t,controls:a}=e.columnDef.meta??{};return!t&&!a}),_=i&&v?v.id:void 0;return e.createElement(e.Fragment,{key:t.id},o?e.createElement(ye,{key:`${t.id}-sub`,row:t,isChild:!0,className:x,"data-testid":M(r,"row",t.id)},s&&e.createElement($e,{className:"maxio-data-table__cell--pinned-left"}),e.createElement($e,{colSpan:u},a(t)),c&&e.createElement($e,{className:"maxio-data-table__cell--pinned-right"})):e.createElement(ye,{key:`${t.id}-parent`,row:t,className:x,onRowAction:i,"aria-labelledby":_,"data-testid":M(r,"row",t.id)},t.getVisibleCells().map(a=>{const l=n&&a.column.getIndex()===h;return e.createElement($e,{key:a.id,row:t,cell:a,id:a.id,"data-testid":M(r,"cell",t.id,a.column.id)},e.createElement("div",{className:"maxio-data-table__cell-flex",style:n&&l?{paddingLeft:`${t?.depth+E}rem`}:void 0},n&&g&&l&&e.createElement(T,{size:"sm",variant:"ghost",icon:e.createElement(w,{size:"xs",variant:f?"chevron-down":"chevron-right"}),onClick:b,"aria-label":f?"Collapse row":"Expand row","data-open":f,className:"maxio-data-table__expand-button"}),m.flexRender(a.column.columnDef.cell,a.getContext())))})))},Be={available:!0},ze={available:!1,reason:"filtering",message:"Reordering is unavailable while the table is filtered."},Ae={available:!1,reason:"grouping",message:"Reordering is unavailable while the table is grouped."},Fe={available:!1,reason:"pagination",message:"Reordering is unavailable while the table is paginated."},Ve=(e=[])=>e.filter(e=>e!==re&&e!==oe),He=[],We=e=>e.subRows;const je=({as:a="div",children:l,compact:n=!1,size:i="md",className:r,...o})=>{const s=a,c=t({[`maxio-body-${i}`]:!n,[`maxio-body-${i}-compact`]:n},r);return e.createElement(s,h({className:c},o),l)},qe={sm:"h3",md:"h2",lg:"h1"},Ge=({children:a,size:l="sm",className:n,...i})=>{const r=qe[l],o=t(`maxio-heading-${l}`,n);return e.createElement(r,h({className:o},i),a)},Ue=e.createContext(void 0),Ke=e=>null!=e&&!1!==e&&""!==e,Ye=({title:a,description:i,children:r,footer:o,role:s="dialog",showCloseButton:c="alertdialog"!==s,className:m,"aria-label":d,"aria-labelledby":u,"aria-describedby":p,"data-testid":x,...g})=>{const b=e.useContext(Ue),f=M(x,"close")??b,E=e.useId(),v=e.useId(),_=u??(d?void 0:E),N=[p,Ke(i)?v:void 0].filter(Boolean).join(" ")||void 0,y=e.useRef(null),C=e.useRef(null),I=function(t,a){const[n,i]=e.useState(!1),r=e.useCallback(()=>{const e=t.current;i(!!e&&e.scrollHeight>e.clientHeight)},[t]);return e.useLayoutEffect(r,[r]),l.useResizeObserver({ref:t,onResize:r}),l.useResizeObserver({ref:a,onResize:r}),n}(y,C);return e.createElement(n.Dialog,h({},g,{role:s,"aria-label":d,"aria-labelledby":_,"aria-describedby":N,className:t("maxio-dialog",m),"data-testid":x}),({close:t})=>{const l="function"==typeof o?o({close:t}):o;return e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-dialog__header"},e.createElement("div",{className:"maxio-dialog__title-group"},e.createElement(Ge,{id:E,size:"md",className:"maxio-dialog__title"},a),Ke(i)&&e.createElement("p",{id:v,className:"maxio-dialog__description"},i)),c&&e.createElement(T,{"aria-label":"Close",onClick:t,icon:e.createElement(w,{variant:"cross"}),variant:"ghost",size:"sm",className:"maxio-dialog__close","data-testid":f})),e.createElement("div",h({ref:y,className:"maxio-dialog__body"},I&&{tabIndex:0,role:"region","aria-labelledby":E}),e.createElement("div",{ref:C},"function"==typeof r?r({close:t}):r)),Ke(l)&&e.createElement("div",{className:"maxio-dialog__footer"},l))})};let Ze=!1;const Qe=({basis:a,flex:l,flexDirection:n,wrap:i,grow:r,shrink:o,gap:s,gapX:c,gapY:m,className:d,children:u,alignItems:p,justifyContent:x,...g})=>{const b=t("maxio-flex",{[`maxio-flex-${l}`]:l,[`maxio-basis-${a}`]:void 0!==a,[`maxio-flex-${n}`]:n,[`maxio-flex-${i}`]:i,"maxio-grow":r,"maxio-grow-0":!1===r,"maxio-shrink":o,"maxio-shrink-0":!1===o,[`maxio-gap-${s}`]:void 0!==s,[`maxio-gap-x-${c}`]:void 0!==c,[`maxio-gap-y-${m}`]:void 0!==m,[`maxio-items-${p}`]:p,[`maxio-justify-${x}`]:x},d);return e.createElement("div",h({className:b},g),u)},Xe=({className:a,children:l,items:i,render:r,renderEmptyState:o,isLoading:s=!1,onLoadMore:c,scrollOffset:m,showSelectAll:d=!1,...u})=>e.createElement(n.ListBox,h({},u,{items:i,renderEmptyState:s?void 0:o,className:n.composeRenderProps(a,e=>t("maxio-listbox",e)),render:(t,a)=>{const{selectionManager:l}=a.state,n=r?r(t,a):e.createElement("div",t);if("multiple"!==l.selectionMode||!d)return n;if(0===[...l.collection.getKeys()].filter(e=>{const t=l.collection.getItem(e);return"item"===t?.type&&l.canSelectItem(e)}).length)return n;const i=l.isSelectAll,o=i&&l.disallowEmptySelection;return e.createElement("div",null,e.createElement("div",{className:"maxio-listbox__select-all"},e.createElement(P,{type:"button",variant:"ghost",trailingElement:e.createElement(w,{variant:i?"check":""}),fullWidth:!0,"aria-pressed":i,disabled:o,onClick:()=>l.toggleSelectAll()},"Select all")),n)}}),c||s?e.createElement(e.Fragment,null,e.createElement(n.Collection,{items:i,dependencies:u.dependencies},l),e.createElement(n.ListBoxLoadMoreItem,{className:"maxio-listbox__load-more",isLoading:s,onLoadMore:s?void 0:c,scrollOffset:m},e.createElement(k,null))):l);Xe.displayName="ListBox";const Je=({className:a,...l})=>{const i=l.textValue||("string"==typeof l.children?l.children:void 0);return e.createElement(n.ListBoxItem,h({},l,{textValue:i,className:t("maxio-listbox__item",a)}),n.composeRenderProps(l.children,(t,{isSelected:a})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-listbox__content"},"string"==typeof t?e.createElement(je,{size:"sm"},t):t),a&&e.createElement(w,{variant:"check"}))))};Je.displayName="ListBox.Item";const et=({className:a,...l})=>e.createElement(n.ListBoxSection,h({},l,{className:t("maxio-listbox__section",a)}));et.displayName="ListBox.Section";const tt=({className:a,...l})=>e.createElement(n.Header,h({},l,{className:t("maxio-listbox__header",a)}));tt.displayName="ListBox.Header";const at=Object.assign(Xe,{Item:Je,Section:et,Header:tt}),lt=({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:i=!1,size:r="md",label:o,description:s,errorMessage:c,leadingElement:m=null,fullWidth:d,className:u,placeholder:p,renderEmptyState:x,isLoading:g=!1,onLoadMore:b,scrollOffset:f,allowsEmptyCollection:E=Boolean(g||b||x),selectionMode:v,children:_,...N})=>{const y=e.useRef(null),C=e.useRef(null),[I,R]=e.useState(),[k,S]=e.useState(0),D=!!c,P=l||D,T=_,M=e.useCallback(()=>{const e=y.current;if(!e)return;const t=C.current,a=t?t.getBoundingClientRect().left-e.getBoundingClientRect().left:0;S(e=>e===-a?e:-a),R(t=>{const a=`${e.offsetWidth}px`;return t?.["--trigger-width"]===a?t:{"--trigger-width":a}})},[]);e.useEffect(()=>{const e=y.current;if(!e)return;if(M(),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(M);return t.observe(e),()=>t.disconnect()},[M]);const O=t("maxio-text-field",`maxio-text-field--${r}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":P,"maxio-text-field--readonly":i,"maxio-text-field--full-width":d},u);return e.createElement(n.ComboBox,h({},N,{isDisabled:a,isInvalid:P,isReadOnly:i,selectionMode:v,allowsEmptyCollection:E,className:O}),o&&e.createElement(n.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{ref:y,className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement(n.Input,{ref:C,className:"maxio-text-field__input",placeholder:p}),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(n.Button,{className:t("maxio-button","maxio-button--ghost","maxio-button--icon","maxio-button--sm")},e.createElement(w,{variant:"chevron-up-down"})))),s&&!D&&e.createElement(n.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(n.FieldError,{className:"maxio-form-error"},t=>e.createElement(e.Fragment,null,e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},"function"==typeof c?c(t):c))),e.createElement(Pe,{hideArrow:!0,className:"maxio-combobox__popover",crossOffset:k,style:I},e.createElement(at,{items:N.items??N.defaultItems,renderEmptyState:x,isLoading:g,onLoadMore:b,scrollOffset:f},T)))};lt.displayName="ComboBox";const nt=t=>e.createElement(at.Item,t);nt.displayName="ComboBox.Item";const it=t=>e.createElement(at.Section,t);it.displayName="ComboBox.Section";const rt=t=>e.createElement(at.Header,t);rt.displayName="ComboBox.Header";const ot=Object.assign(lt,{Item:nt,Section:it,Header:rt}),st=e.createContext({}),ct=e.forwardRef(({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:i=!1,size:r="md",label:o,description:s,errorMessage:c,leadingElement:m=e.createElement(w,{variant:"search"}),clearButtonLabel:d="Clear search",fullWidth:u,className:p,...x},g)=>{const b=t("maxio-text-field",`maxio-text-field--${r}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":l,"maxio-text-field--readonly":i,"maxio-text-field--full-width":u},p);return e.createElement(n.SearchField,h({},x,{isDisabled:a,isReadOnly:i,isInvalid:l,className:b}),o&&e.createElement(n.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement(n.Input,{ref:g,className:"maxio-text-field__input"}),e.createElement("div",{className:"maxio-text-field__trailing-element maxio-search-field__clear-button"},e.createElement(n.Button,{"aria-label":d,className:"maxio-button maxio-button--icon maxio-button--sm maxio-button--ghost"},e.createElement(w,{variant:"cross",className:"maxio-button__trailing-element"})))),s&&!(l&&c)&&e.createElement(n.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(n.FieldError,{className:"maxio-form-error"},e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},c)))});ct.displayName="SearchField";const mt=e.forwardRef(({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:i=!1,size:r="md",label:o,description:s,errorMessage:c,leadingElement:m=null,trailingElement:d=null,fullWidth:u,className:p,...x},g)=>{const b=t("maxio-text-field",`maxio-text-field--${r}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":l,"maxio-text-field--readonly":i,"maxio-text-field--full-width":u},p);return e.createElement(n.TextField,h({},x,{isDisabled:a,isReadOnly:i,isInvalid:l,className:b}),o&&e.createElement(n.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement(n.Input,{ref:g,className:"maxio-text-field__input"}),d&&e.createElement("div",{className:"maxio-text-field__trailing-element"},d)),s&&!(l&&c)&&e.createElement(n.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(n.FieldError,{className:"maxio-form-error"},e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},c)))});mt.displayName="TextField";const dt=e.forwardRef(({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:i=!1,size:r="md",label:o,description:s,errorMessage:c,leadingElement:m=null,trailingElement:d=null,showStepper:u=!1,fullWidth:p,className:x,...g},b)=>{const f=t("maxio-text-field",`maxio-text-field--${r}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":l,"maxio-text-field--readonly":i,"maxio-text-field--full-width":p},x);return e.createElement(n.NumberField,h({},g,{isDisabled:a,isReadOnly:i,isInvalid:l,className:f}),o&&e.createElement(n.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement(n.Input,{ref:b,className:"maxio-text-field__input"}),d&&e.createElement("div",{className:"maxio-text-field__trailing-element"},d),u&&e.createElement("div",{className:"maxio-text-field__trailing-element maxio-number-field__stepper"},e.createElement(n.Button,{slot:"decrement","aria-label":"Decrement",className:"maxio-button maxio-button--icon maxio-button--sm maxio-button--ghost"},e.createElement(w,{variant:"minus",size:"xs",className:"maxio-button__trailing-element"})),e.createElement(n.Separator,{orientation:"vertical",className:"maxio-number-field__stepper-separator"}),e.createElement(n.Button,{slot:"increment","aria-label":"Increment",className:"maxio-button maxio-button--icon maxio-button--sm maxio-button--ghost"},e.createElement(w,{variant:"plus",size:"xs",className:"maxio-button__trailing-element"})))),s&&!(l&&c)&&e.createElement(n.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(n.FieldError,{className:"maxio-form-error"},e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},c)))});dt.displayName="NumberField";const ut=e.forwardRef(({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:i=!1,size:r="md",label:o,description:s,errorMessage:c,fullWidth:m,className:d,...u},p)=>{const x=t("maxio-text-area",`maxio-text-area--${r}`,{"maxio-text-area--disabled":a,"maxio-text-area--error":l,"maxio-text-area--readonly":i,"maxio-text-area--full-width":m},d);return e.createElement(n.TextField,h({},u,{isDisabled:a,isReadOnly:i,isInvalid:l,className:x}),o&&e.createElement(n.Label,{className:"maxio-form-label"},o),e.createElement(n.TextArea,{ref:p,className:"maxio-text-area__input"}),s&&!(l&&c)&&e.createElement(n.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(n.FieldError,{className:"maxio-form-error"},e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},c)))});ut.displayName="TextArea";const pt=e.forwardRef(({disabled:l=!1,invalid:n=!1,readOnly:i=!1,size:r="md",label:o,helperText:s,showErrorMessage:c=!0,errorMessage:m,leadingElement:d=null,trailingElement:u=null,fullWidth:p,className:x,...g},b)=>{const f=e.useRef(null);e.useImperativeHandle(b,()=>f.current),e.useEffect(()=>{console.warn("TextInput is deprecated. Please use TextField instead.")},[]);const{spellCheck:E,...v}=g,_={...v,label:o,description:s,errorMessage:m,defaultValue:g.defaultValue?.toString(),value:g.value?.toString(),isDisabled:l,isReadOnly:i,isInvalid:n},{labelProps:N,inputProps:w,descriptionProps:y,errorMessageProps:C}=a.useTextField(_,f),I=t("maxio-text-field",`maxio-text-field--${r}`,{"maxio-text-field--disabled":l,"maxio-text-field--error":n,"maxio-text-field--readonly":i,"maxio-text-field--full-width":p},x),R=n&&m&&c;return e.createElement("div",{className:I},o&&e.createElement("label",h({className:"maxio-text-field__label"},N),o),e.createElement("div",{className:"maxio-text-field__items"},d&&e.createElement("div",{className:"maxio-text-field__leading-element"},d),e.createElement("input",h({ref:f,type:"text",className:"maxio-text-field__input"},w,{spellCheck:E})),u&&e.createElement("div",{className:"maxio-text-field__trailing-element"},u)),s&&!R&&e.createElement("div",h({className:"maxio-form-helper-text"},y),s),R&&e.createElement(Se,C,m))});pt.displayName="TextInput";const xt=({options:l,label:n,size:i="md",inline:r=!1,disabled:o=!1,helperText:s,errorMessage:c,fullWidth:m=!1,...d})=>{const u=t("maxio-select",`maxio-select--${i}`,{"maxio-select--disabled":o,"maxio-select--inline":r,"maxio-select--error":!!c,"maxio-select--full-width":m}),p=a.useId();return e.createElement("div",{className:u},n&&e.createElement("label",{htmlFor:p,className:"maxio-select__label"},n),e.createElement("div",{className:"maxio-select__input-container"},e.createElement("select",h({id:p,className:"maxio-select__input",disabled:o},d),l.map(t=>e.createElement("option",{key:`option-${t.value}`,value:t.value,disabled:t.disabled},t.label))),e.createElement(w,{variant:"chevron-up-down"})),!!c&&e.createElement(Se,null,c),s&&!c&&e.createElement("div",{className:"maxio-form-helper-text"},s))},gt=({slot:t,displayValue:a})=>{const l=e.createElement(n.DateInput,{slot:t,className:"maxio-date-field__input"},t=>e.createElement(n.DateSegment,{segment:t,className:"maxio-date-field__segment"}));return null==a?l:e.createElement("div",{className:"maxio-date-field__endpoint"},e.createElement("div",{hidden:!0},l),e.createElement("span",{className:"maxio-date-field__endpoint-value"},a))},bt=()=>{const t=e.useContext(n.CalendarStateContext),a=e.useContext(n.RangeCalendarStateContext);return t??a},ft=({items:t,value:a,onChange:l,isItemDisabled:n,...i})=>{const{isDisabled:r}=bt();return e.createElement(xt,h({},i,{disabled:r,value:String(a),onChange:e=>l(Number(e.target.value)),options:t.map(({id:e,date:t,formatted:a})=>({value:String(e),label:a,disabled:n?.(t)}))}))},Et=()=>{const{minValue:t,maxValue:a}=bt(),l=e=>!!t&&i.endOfMonth(e).compare(i.toCalendarDate(t))<0||!!a&&i.startOfMonth(e).compare(i.toCalendarDate(a))>0;return e.createElement(n.CalendarMonthPicker,null,t=>e.createElement(ft,h({},t,{isItemDisabled:l})))},ht=({navigation:t})=>"month"===t?e.createElement(n.Heading,{className:"maxio-calendar__heading"}):e.createElement(Qe,{grow:!0,alignItems:"center",gap:1},e.createElement(Et,null),e.createElement(n.CalendarYearPicker,null,t=>e.createElement(ft,t))),vt=({className:a,errorMessage:l,navigation:i="month",...r})=>e.createElement(n.Calendar,h({},r,{visibleDuration:{months:1},className:n.composeRenderProps(a,e=>t("maxio-calendar",e))}),e.createElement("header",{className:"maxio-calendar__header"},e.createElement(ht,{navigation:i}),e.createElement(n.Button,{slot:"previous",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"chevron-left"})),e.createElement(n.Button,{slot:"next",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"chevron-right"}))),e.createElement(n.CalendarGrid,{className:"maxio-calendar__grid"},e.createElement(n.CalendarGridHeader,null,t=>e.createElement(n.CalendarHeaderCell,{className:"maxio-calendar__weekday"},t)),e.createElement(n.CalendarGridBody,null,t=>e.createElement(n.CalendarCell,{date:t,className:"maxio-calendar__cell"}))),l&&e.createElement(n.Text,{slot:"errorMessage",className:"maxio-calendar__error"},l)),_t=({presets:t,label:a="Presets",isDisabled:l,isPresetDisabled:i,onSelect:r})=>t?.length?e.createElement(n.Group,{"aria-label":a,className:"maxio-date-field__presets"},t.map((t,a)=>e.createElement(n.Button,{key:a,className:"maxio-button maxio-button--ghost",isDisabled:l||t.isDisabled||null!==t.value&&i(t.value),onPress:()=>r(t.value)},t.label))):null,Nt=(e,t)=>!!(t.minValue&&e.compare(t.minValue)<0||t.maxValue&&e.compare(t.maxValue)>0||t.isDateUnavailable?.(e)),wt=({className:a,errorMessage:l,navigation:i="month",...r})=>{const{direction:o}=n.useLocale();return e.createElement(n.RangeCalendar,h({},r,{visibleDuration:{months:1},className:n.composeRenderProps(a,e=>t("maxio-calendar","maxio-calendar--range",e))}),e.createElement("header",{className:"maxio-calendar__header"},e.createElement(ht,{navigation:i}),e.createElement(n.Button,{slot:"previous",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"rtl"===o?"chevron-right":"chevron-left"})),e.createElement(n.Button,{slot:"next",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"rtl"===o?"chevron-left":"chevron-right"}))),e.createElement(n.CalendarGrid,{className:"maxio-calendar__grid"},e.createElement(n.CalendarGridHeader,null,t=>e.createElement(n.CalendarHeaderCell,{className:"maxio-calendar__weekday"},t)),e.createElement(n.CalendarGridBody,null,t=>e.createElement(n.CalendarCell,{date:t,className:"maxio-calendar__cell"}))),l&&e.createElement(n.Text,{slot:"errorMessage",className:"maxio-calendar__error"},l))},yt=(e,t)=>null==e?null==t:null!=t&&0===e.compare(t),Ct=({className:a,size:l="md",fullWidth:i=!1,selectionMode:r="single",orientation:o="horizontal",disallowEmptySelection:s=!0,...c})=>e.createElement(n.ToggleButtonGroup,h({},c,{selectionMode:r,orientation:o,disallowEmptySelection:s,className:n.composeRenderProps(a,e=>t("maxio-segmented-control",`maxio-segmented-control--${l}`,{"maxio-segmented-control--full-width":i},e))}));Ct.displayName="SegmentedControl";const It=({className:a,children:l,...i})=>e.createElement(n.ToggleButton,h({},i,{className:n.composeRenderProps(a,e=>t("maxio-segmented-control__item",e))}),n.composeRenderProps(l,t=>e.createElement(e.Fragment,null,e.createElement(n.SelectionIndicator,{className:"maxio-segmented-control__selection-indicator","data-selected":!0}),t)));It.displayName="SegmentedControl.Item";const Rt=Object.assign(Ct,{Item:It}),kt=({leadingIcon:t,trailingIcon:a,type:l="menu",children:n,leadingIconClassName:i,isTooltipVisible:r=!1})=>e.createElement(e.Fragment,null,t&&e.createElement(ae,{usePortal:!0,isVisible:r,renderContent:()=>n,floatingElementOffset:12},e.createElement("span",{className:"maxio-side-nav__icon"},e.createElement(w,{variant:t,className:i}))),e.createElement("span",{className:`maxio-side-nav__${l}-title`,"data-testid":"maxio-sidebar-section-name"},n),a&&e.createElement("span",{className:"maxio-side-nav__menu-chevron"},e.createElement(w,{variant:a}))),St=e=>"heading"!==e.type,Dt=e=>{const t=(e=>e.flat().filter(St).map(e=>e.items).flat().find(e=>e?.isCurrent))(e);return t?e.map(e=>e.map(e=>St(e)&&e.items?.includes(t)?{...e,isOpen:!0}:e)):e},Pt=e.createContext({}),Tt=()=>e.useContext(Pt),Mt=({children:t,isOpen:a,onChange:l,withIcons:n=!0,sections:i,shouldToggleSidebar:r=!0,topDropdownItems:o,collapseBreakpoint:s=800})=>{const c=e.useRef(!1),[m,d]=e.useState(()=>!r||("boolean"==typeof a?a:"undefined"==typeof window||window.innerWidth>s)),[u,p]=e.useState(()=>Dt(i)),{windowWitdh:x}=K(200);e.useEffect(()=>{c.current&&l?.(m)},[m,l]),e.useEffect(()=>{c.current=!0},[]),e.useEffect(()=>{!function(e){if(!r)return;e<s&&m&&g()}(x)},[x]),e.useEffect(()=>{"boolean"==typeof a&&d(a)},[a]);const g=()=>{d(!1)};return e.createElement(Pt.Provider,{value:{sections:u,topDropdownItems:o,onSectionOpen:e=>{p(t=>t.map(t=>t.map(t=>St(t)?{...t,isOpen:t?.name===e&&!t.isOpen}:t)))},isOpen:m,onOpen:()=>{d(!0)},onClose:g,withIcons:n,shouldToggleSidebar:r}},t)},Ot=()=>{const{onOpen:t,topDropdownItems:a,isOpen:l}=Tt(),{mainItem:n,otherItems:i,actions:r}=a,o=e.useRef(null),s=U(o),c=({id:e,title:t,icon:a,iconClass:l,url:n,...i})=>({id:e,label:t,leadingIconName:a,leadingIconClassName:l,link:{href:n,...i}}),{items:m,itemsCount:d}=e.useMemo(()=>({itemsCount:i.length+r.length,items:[...i.map(c),i?.length>0&&r?.length>0?{type:"divider",id:"item-divider"}:null,...r.map(c)].filter(e=>null!=e)}),[r,i]);return e.createElement(e.Fragment,null,0===d?e.createElement("a",{className:"maxio-side-nav__menu-button maxio-side-nav__menu-button--large",href:n.url,onClick:t},e.createElement("span",{className:"maxio-side-nav__menu-title"},n.title)):e.createElement("details",{className:"maxio-action-menu maxio-side-nav--action-menu"},e.createElement("summary",{onClick:t,className:"maxio-side-nav__menu-button","aria-haspopup":"true",ref:o},n.url?e.createElement(e.Fragment,null,e.createElement(kt,{type:"menu",isTooltipVisible:!l&&s,leadingIcon:n.icon,trailingIcon:"chevron-up-down",leadingIconClassName:n.iconClass},n.title)):e.createElement(kt,{type:"menu",trailingIcon:"chevron-up-down"},n.title)),e.createElement(I,{truncateLabels:!0,className:"maxio-action-menu__content","aria-label":"Action list",items:m,small:!0})))},$t=({section:t})=>{const{isOpen:a,withIcons:l}=Tt(),i=e.useRef(null),r=U(i);return e.createElement("li",{className:"maxio-side-nav__item","data-key":t.key,"data-testid":t.testId??"maxio-sidebar-section"},e.createElement(n.Link,{className:"maxio-side-nav__link","aria-current":t.isCurrent?"page":void 0,href:t.href,render:t.render,ref:i},e.createElement(kt,{isTooltipVisible:r&&!a,type:"menu",leadingIcon:l?t.icon:void 0},t.name)))},Lt=({section:a})=>{const{onOpen:l,onSectionOpen:i,isOpen:r,withIcons:o}=Tt(),s=e.useRef(null),c=U(s);if(!St(a))return e.createElement("li",{className:"maxio-side-nav__item-header"},a.title);return a.Component?e.createElement(a.Component,{section:a}):a.href?e.createElement($t,{section:a}):e.createElement("li",{className:t("maxio-side-nav__item",{"maxio-side-nav__item--icon":o}),"data-testid":a.testId??"maxio-sidebar-section"},e.createElement("button",{className:"maxio-side-nav__menu-button",ref:s,"aria-expanded":a.isOpen?"true":"false",type:"button",onClick:()=>{i(a.name),l()}},e.createElement(kt,{type:"menu",isTooltipVisible:!r&&c,leadingIcon:o?a.icon:void 0,trailingIcon:a.items?.length?"chevron-down":void 0},a.name)),e.createElement("ul",{className:"maxio-side-nav__menu"},a.items?.map(t=>e.createElement("li",{key:`section-sub-item-${t.name}`,className:"maxio-side-nav__item","data-testid":t.testId??"maxio-section-item"},e.createElement(n.Link,{className:"maxio-side-nav__link",href:t.href,render:t.render,"aria-current":t.isCurrent?"page":void 0},e.createElement("span",{className:"maxio-side-nav__link-title"},t.name))))))},Bt=()=>{const{sections:t}=Tt();return e.createElement(e.Fragment,null,t.map((t,a)=>e.createElement("ul",{role:"list",className:"maxio-side-nav__items",key:`section-list-${a}`},t.map((t,l)=>e.createElement(Lt,{key:`section-list-item-${t.type}-${a}-${l}`,section:t})))))},zt=()=>{const{isOpen:t,onOpen:a,onClose:l,shouldToggleSidebar:n}=Tt();return e.createElement("div",{className:"maxio-side-nav__logo-container"},e.createElement("a",{className:"maxio-side-nav__brand",href:"/","aria-label":"Maxio"}),n&&e.createElement("button",{className:"maxio-side-nav__menu-toggle","aria-label":t?"Collapse navigation":"Expand navigation","aria-expanded":t,onClick:t?l:a},e.createElement(w,{variant:"sidebar"})))},At=()=>{const{isOpen:a}=Tt();return e.createElement("nav",{className:t("maxio-side-nav",{"maxio-side-nav--collapsed":!a})},e.createElement(zt,null),e.createElement(Ot,null),e.createElement("div",{className:"maxio-side-nav__items-container"},e.createElement(Bt,null)))},Ft=({disabled:a=!1,value:l=0,className:i,id:r,isCurrent:o,...s})=>{const c="icon"===s.type,m=({isSelected:e})=>t("maxio-tabs__tab",i,{"maxio-tabs__tab--active":e,"maxio-tabs__tab--disabled":a,"maxio-tabs__tab--icon":c});if("icon"===s.type){const{icon:t,...i}=s;return e.createElement(n.Tab,h({id:l,isDisabled:a},i,{className:m}),e.createElement("div",{className:"maxio-tabs__tab-content"},t))}const{children:d,rightIcon:u,...p}=s;return e.createElement(n.Tab,h({id:l,isDisabled:a},p,{className:m}),e.createElement("div",{className:"maxio-tabs__tab-content"},d,u||null))},Vt=e.createContext({variant:"line",withDivider:!1}),Ht=({children:t,variant:a="line",withDivider:l=!1})=>e.createElement(Vt.Provider,{value:{variant:a,withDivider:l}},t),Wt=({children:a,value:l,className:i,id:r,...o})=>e.createElement(n.TabPanel,h({id:l,className:t("maxio-tabs__panel",i)},o),a),jt=({children:a,className:l,...n})=>e.createElement("div",h({className:t("maxio-card__header",l)},n),a);jt.displayName="Card.Header";const qt=({children:a,className:l,...n})=>e.createElement("div",h({className:t("maxio-card__body",l)},n),a);qt.displayName="Card.Body";const Gt=({children:a,className:l,...n})=>e.createElement("div",h({className:t("maxio-card__footer",l)},n),a);Gt.displayName="Card.Footer";const Ut=({children:a,className:l,variant:n="primary",...i})=>e.createElement("div",h({className:t("maxio-card",`maxio-card--${n}`,l)},i),a);Ut.displayName="Card";const Kt=Object.assign(Ut,{Header:jt,Body:qt,Footer:Gt});var Yt,Zt,Qt,Xt;function Jt(){return Jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},Jt.apply(null,arguments)}const ea=e=>E.createElement("svg",Jt({xmlns:"http://www.w3.org/2000/svg","data-name":"Maxio Logo SVG",viewBox:"0 0 1036 240"},e),Yt||(Yt=E.createElement("path",{d:"M59.32 11.3 70.64 0l40.74 40.35v70.99H40.89L0 70.52l11.15-11.14 36.2 36.15h30.07l3.07-3.39-50.91-51.15 10.99-10.97 51.24 50.83 3.72-3.38V47.13zM180.68 11.3 169.36 0l-40.73 40.35v70.99h70.48L240 70.51l-11.15-11.14-36.2 36.15h-30.06l-3.07-3.39 50.91-51.15-10.99-10.97-51.24 50.83-3.72-3.38V47.12l36.2-35.83ZM59.32 228.7l11.31 11.29 40.74-40.35v-70.99H40.89L0 169.48l11.15 11.14 36.2-36.15h30.07l3.07 3.39-50.92 51.15 10.99 10.97 51.24-50.83 3.72 3.38v30.34zM180.68 228.7l-11.32 11.29-40.73-40.35v-70.99h70.48L240 169.48l-11.15 11.14-36.2-36.15h-30.06l-3.07 3.39 50.91 51.15-10.99 10.97-51.24-50.83-3.72 3.38v30.34zM1015.27 139.55c0-29.94-23.74-53.46-52.11-53.46s-52.11 23.52-52.11 53.46 23.74 53.46 52.11 53.46 52.11-23.52 52.11-53.46m20.32.95c-.5 40.27-32.73 72.76-72.43 72.76h-.94c-39.58-.52-71.5-33.32-71.5-73.71s32.43-73.71 72.44-73.71h.94c39.57.52 71.5 33.32 71.5 73.71v.95Z"})),Zt||(Zt=E.createElement("path",{fillRule:"evenodd",d:"M870.39 24h-20.33v20.33h20.33zm0 40.67h-20.33v148.59h20.33z"})),Qt||(Qt=E.createElement("path",{fillRule:"evenodd",d:"M850.05 24h20.33v20.33h-20.33zM695.01 82.85l50.83 56.28v6.53l-50.28 55.67 15.23 13.2 49.22-54.49h4.71l49.22 54.49 15.23-13.2-50.28-55.67v-6.53l50.83-56.28-15.23-13.2-50.15 55.52h-3.96l-50.15-55.52L695 82.85ZM660.49 78.64c-9.41-9.28-23.26-13.97-41.02-13.97-31.13 0-52.44 18.93-58.09 44.86l-.28 1.27 19.33 3.72.31-1.14c2.39-8.91 6.66-16.54 13.04-21.94 6.36-5.39 14.91-8.63 26.02-8.63s19.12 3.25 24.76 8.96c5.64 5.72 8.73 14.06 8.73 24.53v6.11L616.62 130l-3.26.68c-16.14 3.47-29.79 7.84-39.59 14.45-10.54 7.11-16.64 16.83-16.64 30.62 0 12.51 4.51 22.62 12.5 29.59 7.96 6.95 19.25 10.67 32.63 10.67 22.27 0 41.87-12.03 51.04-27.03v25.55h21.39v-95.3c0-17.6-4.77-31.3-14.19-40.58Zm-40.09 68.13c-12.86 2.77-23.05 5.42-30.03 9.63-3.46 2.09-6.08 4.54-7.84 7.54s-2.71 6.62-2.71 11.15c0 6.38 2.1 12.12 6.32 16.27 4.22 4.14 10.7 6.82 19.7 6.82 26.85 0 47.46-20.48 47.46-51.36v-7.2l-32.9 7.14Z"})),Xt||(Xt=E.createElement("path",{d:"M434.8 188.74h4.54l61.73-164.33.15-.41h35.57v189.35H515.9V55.37h-4.33l-59.7 157.57-.15.41h-29.29l-61.2-157.98h-4.35v157.98H336V24h35.57z"}))),ta=a=>{const{size:l="sm",className:n,variant:i="lockup",alt:r="maxio logo","data-testid":o}=a,s="mark"===i,c="number"==typeof l;return e.createElement(ea,{role:"img",viewBox:s?"0 0 240 240":"0 0 1036 240","aria-label":r,"data-testid":o,height:c?l:void 0,className:t("maxio-logo",!c&&`maxio-logo--${l}`,s&&"maxio-logo--mark",n)})},aa=({state:a,...l})=>{const n=e.useRef(null),{toastProps:i,contentProps:r,titleProps:o,closeButtonProps:s}=b.useToast(l,a,n),{closable:c=!0,underline:m=!0,external:d=!1,testId:u}=l.toast.content,p=t("maxio-toast",{[`maxio-toast--${l.toast.content.sentiment}`]:l.toast.content.sentiment}),x={default:"info-circle-fill",success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[l.toast.content.sentiment||"default"];return e.createElement("div",h({className:p,"data-maxio-mode":"dark"},i,{ref:n,"data-testid":u}),e.createElement(w,{variant:x,className:"maxio-toast__icon"}),e.createElement("div",h({className:"maxio-toast__container"},r),e.createElement("div",h({className:"maxio-toast__content"},o),l.toast.content.title&&e.createElement("span",{className:"maxio-toast__title"},l.toast.content.title),l.toast.content.message&&e.createElement("span",{className:"maxio-toast__message"},l.toast.content.message),l.toast.content.link?.text&&l.toast.content.link?.href&&e.createElement(R,{href:l.toast.content.link.href,underline:m,external:d},l.toast.content.link.text))),c&&e.createElement(T,h({variant:"ghost",icon:e.createElement(w,{variant:"cross"}),"aria-label":"Dismiss Notification",className:"maxio-toast__dismiss"},s,{"data-testid":M(u,"dismiss")})))},la=({state:t,...a})=>{const l=e.useRef(null),{regionProps:n}=b.useToastRegion(a,t,l);return e.createElement("div",h({},n,{ref:l,className:a.className,style:{display:"flex",flexDirection:"column",gap:"10px"}}),t.visibleToasts.map(a=>e.createElement(aa,{key:a.key,toast:a,state:t})))},na=e.createContext(null);class ia extends g.ToastQueue{}const ra=({...t})=>{const l=e.useRef(null),{buttonProps:n}=a.useButton(t,l);return e.createElement("button",h({},n,{className:"maxio-chip__dismiss-button"}),e.createElement(w,{variant:"cross-circle-fill",className:"maxio-chip__icon"}))},oa={success:"maxio-auth-layout__heading--success",danger:"maxio-auth-layout__heading--danger"};Object.defineProperty(exports,"DialogTrigger",{enumerable:!0,get:function(){return n.DialogTrigger}}),Object.defineProperty(exports,"Pressable",{enumerable:!0,get:function(){return n.Pressable}}),Object.defineProperty(exports,"createColumnHelper",{enumerable:!0,get:function(){return m.createColumnHelper}}),exports.ActionList=I,exports.Alert=O,exports.AuthLayout=({children:a,heading:l,description:n,sentiment:i="success",leadingElement:r=null,alert:o,topAddon:s=null,footer:c})=>e.createElement("div",{className:"maxio-auth-layout"},e.createElement(Qe,{alignItems:"center",justifyContent:"between"},e.createElement(ta,{size:"md"}),s),o&&e.createElement(O,{display:"block",title:o.title,sentiment:o.sentiment},o.children),e.createElement(Kt,{variant:"secondary"},e.createElement(Kt.Body,null,e.createElement(Qe,{flexDirection:"col",gap:6},e.createElement(Qe,{flexDirection:"col",gap:2},e.createElement(Qe,{alignItems:"center",gap:2},r,e.createElement(Ge,{size:"lg",className:t("maxio-auth-layout__heading",oa[i])},l)),n&&e.createElement(Qe,{style:{color:"var(--maxio-color-text-tertiary)"}},e.createElement(je,{size:"sm",className:"maxio-auth-layout__description"},n))),a)),c&&e.createElement(Kt.Footer,null,c))),exports.Avatar=({className:a,src:l,alt:n="avatar","data-testid":i})=>e.createElement("img",{className:t("maxio-avatar",a),alt:n,src:l,"data-testid":i}),exports.Banner=({children:a,title:l,linkText:n,linkExternal:i,href:r,display:o="inline",sentiment:s="info",onDismiss:c,className:m,"data-testid":d})=>{if(!a&&!l)return console.warn("Banner component requires either children or title prop to be rendered"),null;const u=t("maxio-banner",{[`maxio-banner--${s}`]:"info"!==s&&s,className:m}),p={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[s],x=t("maxio-banner__content",{"maxio-banner__content--block":"block"===o});return e.createElement("div",{className:u,"aria-live":"assertive","data-testid":d},e.createElement(w,{variant:p,className:"maxio-banner__icon","aria-hidden":"true"}),e.createElement("section",{className:"maxio-banner__container"},e.createElement("div",{className:x},l&&e.createElement("span",{className:"maxio-banner__title"},l),a&&e.createElement("span",{className:"maxio-banner__message"},a),n&&r&&e.createElement(R,h({href:r},"warning"!==s&&{variant:"inverse"},{underline:!0},i?{external:!0}:{}),n))),c&&e.createElement(T,{icon:e.createElement(w,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:c,className:"maxio-banner__dismiss","data-testid":M(d,"dismiss")}))},exports.Body=je,exports.Breadcrumbs=({className:a,children:l,...n})=>{const i=e.Children.count(l);if(0===i)throw new Error(F);const r=e.Children.map(l,(t,a)=>{if(e.isValidElement(t)&&t.type===A){if(a===i-1&&t.props.href)throw new Error(V);return e.cloneElement(t,{"aria-current":a===i-1?"page":void 0})}throw new Error(H)});return e.createElement("nav",h({"aria-label":"Breadcrumb"},n),e.createElement("ol",{className:t("maxio-breadcrumbs",a)},r))},exports.BreadcrumbsItem=A,exports.Button=P,exports.Calendar=vt,exports.Card=Kt,exports.Checkbox=Re,exports.CheckboxGroup=({helperText:l,className:n,errorMessage:i,children:r,disabled:s,label:c,defaultValue:m,name:d,...u})=>{const p=o.useCheckboxGroupState({defaultValue:m,name:d,errorMessage:i,description:l,label:c,isDisabled:s,isInvalid:!!i,...u}),{groupProps:x,labelProps:g,descriptionProps:b,errorMessageProps:f,isInvalid:E}=a.useCheckboxGroup({"aria-label":(c??u["aria-label"])?.toString(),isDisabled:s,isInvalid:!!i,...u},p),v=t("maxio-checkbox-group",{"maxio-checkbox-group--disabled":s},n),_=l&&!i;return e.createElement("div",h({className:v},x),c&&e.createElement("label",h({className:"maxio-checkbox-group__label"},g),c),e.createElement(Ce.Provider,{value:p},r),_&&e.createElement(ke,b,l),i&&E&&e.createElement(Se,f,i))},exports.Chip=({label:l,onDismiss:n,dismissLabel:i,leadingIcon:o,trailingIcon:s,title:c,...m})=>{const d=e.useRef(null),u=r.useToggleState(m),{buttonProps:p}=a.useToggleButton(m,u,d),x=t("maxio-chip",{"maxio-chip--selected":u?.isSelected}),g=t("maxio-chip__button",{"maxio-chip--dismissible":n});return e.createElement("div",{className:x},e.createElement("button",h({className:g,ref:d},p,{title:c}),o&&e.createElement(w,{variant:o,className:"maxio-chip__icon"}),e.createElement("span",{className:"maxio-chip__label"},l),s&&!n&&e.createElement(w,{variant:s,className:"maxio-chip__icon"})),n&&e.createElement(ra,{onPress:n,"aria-label":i}))},exports.Code=({as:a="div",children:l,className:n,...i})=>{const r=a,o=t("maxio-code",n);return e.createElement(r,h({className:o},i),l)},exports.ComboBox=ot,exports.CopyToClipboard=({value:l,copyLabel:n="Copy",copiedLabel:i="Copied!",copyErrorLabel:r="Copy failed",size:o="md",variant:s="ghost",disabled:c,resetAfterMs:m=2e3,tooltipPlacement:d="top",usePortal:u=!0,onCopy:p,onCopyError:x,onClick:g,className:b,...f})=>{const{feedbackState:E,feedbackLabel:v,announcement:_,handleCopy:N}=((t,{copyLabel:a,copiedLabel:l,copyErrorLabel:n,resetAfterMs:i,onCopy:r,onCopyError:o,onClick:s})=>{const[c,m]=e.useState(null),d=e.useRef(null),u=e.useRef(0),p=e.useRef(!0),x=e.useRef(0),g=e.useRef(t),b=e.useCallback(()=>{null!==d.current&&(clearTimeout(d.current),d.current=null)},[]),f=e.useCallback(()=>{b(),m(null)},[b]),E=e.useCallback((e,t)=>{b(),m({state:e,value:t,announceId:++u.current}),d.current=window.setTimeout(f,i)},[b,i,f]);e.useEffect(()=>{g.current=t,f()},[f,t]),e.useEffect(()=>(p.current=!0,()=>{p.current=!1,b()}),[b]);const h=e.useCallback(async e=>{s?.(e);const a=++x.current,l=t,n=()=>!p.current||a!==x.current||l!==g.current;try{await navigator.clipboard.writeText(l)}catch(e){return n()||E("error",l),void o?.(e)}n()||E("copied",l),r?.(l)},[s,r,o,E,t]),v=c?.value===t?c.state:"idle",_={idle:a,copied:l,error:n}[v];return{feedbackState:v,feedbackLabel:_,announcement:"idle"!==v&&c?{id:c.announceId,message:_}:null,handleCopy:h}})(l,{copyLabel:n,copiedLabel:i,copyErrorLabel:r,resetAfterMs:m,onCopy:p,onCopyError:x,onClick:g});return e.createElement(e.Fragment,null,e.createElement(ae,{interactions:["hover","focus"],placement:d,size:"small",usePortal:u,renderContent:()=>v},e.createElement(T,h({},f,{"aria-label":n,className:t(b,{[le]:"subtle"===s,[ne]:"xs"===o}),variant:"subtle"===s?"ghost":s,size:"xs"===o?void 0:o,disabled:c,onClick:N,trailingElement:e.createElement(w,{variant:ie[E]})}))),e.createElement(a.VisuallyHidden,null,e.createElement("span",{role:"status","aria-live":"polite","aria-atomic":"true"},_&&e.createElement("span",{key:_.id},_.message))))},exports.DataTable=({pattern:t,size:a="md",SubRowComponent:l,onExpand:n,onSelect:i,onSort:r,enableSorting:o=!1,enableRowSelection:s=!1,enableExpanding:c,columns:d,actions:u,actionsColumnSize:p,onRowAction:x,enableRowReordering:g=!1,getRowReorderLabel:b,onRowReorder:f,rowReorderMode:E="siblings",getRowId:v,getSubRows:_,state:N,"data-testid":w,...y})=>{const C=g?void 0:l,I=!g&&o,R=(({columns:t,HeaderControls:a,RowControls:l,RowActions:n,actions:i,actionsColumnSize:r,enableExpanding:o,enableRowSelection:s,enableRowReordering:c})=>e.useMemo(()=>{const m={id:re,size:s&&c?72:40,header:t=>e.createElement(a,h({},t,{enableExpanding:o,enableRowSelection:s,enableRowReordering:c})),cell:t=>e.createElement(l,h({},t,{enableExpanding:o,enableRowSelection:s,enableRowReordering:c})),meta:{controls:!0,width:(s&&c?72:40)+"px"}},d=i&&n?{id:oe,size:r??40,header:"",cell:t=>e.createElement(n,null,i(t.row,t.table)),meta:{actions:!0}}:null;let u=[...t];return(s||c)&&(u=[m,...u]),d&&(u=[...u,d]),u},[i,r,n,o,s,c,t,a,l]))({columns:d,HeaderControls:De,RowControls:Me,RowActions:Oe,actions:u,actionsColumnSize:p,enableRowSelection:s,enableRowReordering:g,enableExpanding:Boolean(c)}),k=m.useReactTable({state:{...N,...g&&{sorting:He},columnPinning:{left:[...s||g?[re]:[],...Ve(N?.columnPinning?.left)],right:[...Ve(N?.columnPinning?.right),...u?[oe]:[]]}},getCoreRowModel:m.getCoreRowModel(),enableRowSelection:s,enableExpanding:Boolean(c),...!y.manualExpanding&&{getExpandedRowModel:m.getExpandedRowModel()},...!y.manualSorting&&!g&&{getSortedRowModel:m.getSortedRowModel()},columns:R,getRowId:v,...y,getSubRows:g?We:_??We,enableSorting:I,...g&&{getSortedRowModel:void 0}}),S=k.getCanSomeRowsExpand(),D=k.getState(),P=(({columnFilters:e,globalFilter:t,grouping:a,hasPagination:l})=>e.length>0||null!=t&&""!==t?ze:a.length>0?Ae:l?Fe:Be)({columnFilters:D.columnFilters,globalFilter:D.globalFilter,grouping:D.grouping,hasPagination:Boolean(y.getPaginationRowModel||y.manualPagination)});e.useEffect(()=>{n?.(D.expanded)},[n,D.expanded]),e.useEffect(()=>{i?.(D.rowSelection)},[i,D.rowSelection]),e.useEffect(()=>{g||r?.(D.sorting)},[g,r,D.sorting]);const T=e.createElement(se,{pattern:t,size:a,isExpandable:S,isUsingCustomRow:Boolean(C),"data-testid":w},e.createElement(ce,null,k.getHeaderGroups().map(t=>e.createElement(ye,{key:t.id,table:k,isHeader:!0},t.headers.map(t=>e.createElement(de,{key:t.id,table:k,header:t,enableExpanding:c,"data-testid":M(w,"header",t.column.id)},m.flexRender(t.column.columnDef.header,t.getContext())))))),e.createElement(me,null,k.getRowModel().rows.map(a=>e.createElement(Le,{key:a.id,row:a,pattern:t,SubRowComponent:C,enableExpanding:c,onRowAction:x,testId:w}))));return g&&v&&f?e.createElement(we,{availability:P,data:y.data,enableExpanding:Boolean(c),getRowReorderLabel:b,onRowReorder:f,rowReorderMode:E,table:k},T):T},exports.DateField=({label:a,description:l,errorMessage:i,className:r,...o})=>e.createElement(n.DateField,h({},o,{className:n.composeRenderProps(r,(e,a)=>t("maxio-text-field","maxio-date-field",{"maxio-text-field--disabled":a.isDisabled,"maxio-text-field--error":a.isInvalid,"maxio-text-field--readonly":a.isReadOnly},e))}),null!=a&&e.createElement(n.Label,{className:"maxio-text-field__label"},a),e.createElement("div",{className:"maxio-text-field__items"},e.createElement("div",{className:"maxio-text-field__input"},e.createElement(gt,null))),null!=l&&e.createElement(n.Text,{slot:"description",className:"maxio-form-helper-text"},l),e.createElement(n.FieldError,{className:"maxio-form-error"},i)),exports.DatePicker=({label:a,description:l,errorMessage:i,className:r,presets:o,presetsLabel:s,navigation:c,...m})=>{const d=o?.find(e=>null===e.value)?.label;return e.createElement(n.DatePicker,h({},m,{className:n.composeRenderProps(r,(e,a)=>t("maxio-text-field","maxio-date-field",{"maxio-text-field--disabled":a.isDisabled,"maxio-text-field--error":a.isInvalid,"maxio-text-field--readonly":a.isReadOnly},e))}),({state:t,isDisabled:r,isReadOnly:u})=>e.createElement(e.Fragment,null,null!=a&&e.createElement(n.Label,{className:"maxio-text-field__label"},a),e.createElement(n.Group,{className:"maxio-text-field__items"},e.createElement("div",{className:"maxio-text-field__input"},e.createElement(gt,{displayValue:null===t.value?d:void 0})),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(n.Button,{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"calendar"})))),null!=l&&e.createElement(n.Text,{slot:"description",className:"maxio-form-helper-text"},l),e.createElement(n.FieldError,{className:"maxio-form-error"},i),e.createElement(Pe,{hideArrow:!0,className:"maxio-date-field__popover"},e.createElement(n.Dialog,{className:"maxio-date-field__dialog"},e.createElement(vt,{navigation:c}),e.createElement(_t,{presets:o,label:s,isDisabled:r||u,isPresetDisabled:e=>Nt(e,m),onSelect:e=>{t.setValue(e),t.setOpen(!1)}})))))},exports.DateRangePicker=({label:a,description:l,errorMessage:r,className:o,presets:s,presetsLabel:c,navigation:m,...d})=>e.createElement(n.DateRangePicker,h({},d,{className:n.composeRenderProps(o,(e,a)=>t("maxio-text-field","maxio-date-field",{"maxio-text-field--disabled":a.isDisabled,"maxio-text-field--error":a.isInvalid,"maxio-text-field--readonly":a.isReadOnly},e))}),({state:t,isDisabled:o,isReadOnly:u})=>{const p=((e,t)=>{if(null==e?.start||null==e?.end)return t?.find(t=>yt(t.value?.start,e?.start)&&yt(t.value?.end,e?.end))?.label})(t.value,s);return e.createElement(e.Fragment,null,null!=a&&e.createElement(n.Label,{className:"maxio-text-field__label"},a),e.createElement(n.Group,{className:"maxio-text-field__items"},e.createElement("div",{className:"maxio-text-field__input"},e.createElement(gt,{slot:"start",displayValue:null==t.value?.start?p:void 0}),e.createElement("span",{"aria-hidden":"true",className:"maxio-body-sm"},"→"),e.createElement(gt,{slot:"end",displayValue:null==t.value?.end?p:void 0})),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(n.Button,{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"calendar"})))),null!=l&&e.createElement(n.Text,{slot:"description",className:"maxio-form-helper-text"},l),e.createElement(n.FieldError,{className:"maxio-form-error"},r),e.createElement(Pe,{hideArrow:!0,className:"maxio-date-field__popover"},e.createElement(n.Dialog,{className:"maxio-date-field__dialog"},e.createElement(wt,{navigation:m}),e.createElement(_t,{presets:s,label:c,isDisabled:o||u,isPresetDisabled:e=>((e,t)=>{const a=e.start?i.toCalendarDate(e.start):null,l={...t,isDateUnavailable:e=>t.isDateUnavailable?.(e,a)??!1};if(null!=e.start&&null!=e.end&&e.start.compare(e.end)>0||null!=e.start&&Nt(e.start,{...t,isDateUnavailable:e=>t.isDateUnavailable?.(e,null)??!1})||null!=e.end&&Nt(e.end,l))return!0;if(e.start&&e.end&&t.isDateUnavailable&&!t.allowsNonContiguousRanges){const l=i.toCalendarDate(e.end);for(let n=i.toCalendarDate(e.start).add({days:1});n.compare(l)<0;n=n.add({days:1}))if(t.isDateUnavailable(n,a))return!0}return!1})(e,d),onSelect:e=>((e,t)=>{!t||null!=t.start&&null!=t.end?t?.start&&t.end?e.setValue({start:t.start,end:t.end}):e.setValue(null):(e.setValue(null),e.setDateTime("start",t.start),e.setDateTime("end",t.end)),e.setOpen(!1)})(t,e)}))))}),exports.Dialog=Ye,exports.Display=({as:a="div",children:l,size:n="md",className:i,...r})=>{const o=a,s=t(`maxio-display-${n}`,i);return e.createElement(o,h({className:s},r),l)},exports.Drawer=({placement:a="right",backdrop:l="dim",size:i="md",isDismissable:r=!0,className:o,style:s,title:c,description:m,footer:d,open:u,isOpen:p,children:x,"data-testid":g,...b})=>{const f=[c,m,d].some(e=>void 0!==e),E=void 0!==u&&void 0===p;return e.useEffect(()=>{!f&&!E||Ze||(Ze=!0,console.warn("Drawer: the `title`, `description`, `footer` and `open` props are deprecated and will be removed in the next major. Pass a `Dialog` as children and use `isOpen` instead."))},[f,E]),e.createElement(n.ModalOverlay,h({},b,{isOpen:p??u,isDismissable:r,className:t("maxio-drawer__backdrop",{"maxio-drawer__backdrop--dim":"dim"===l})}),e.createElement(n.Modal,{className:t("maxio-drawer",o),style:s,"data-placement":a,"data-size":i,"data-testid":g},f?e.createElement(Ue.Provider,{value:M(g,"close")},e.createElement(Ye,{title:c,description:m,footer:d},x)):x))},exports.EmptyState=({hasActiveFilters:a=!1,title:l,headingLevel:n="h2",description:i,actions:r,className:o,...s})=>{const c=t("maxio-empty-state",o),m=n,d=!l&&!i?a?"We couldn't find any items matching your criteria. Try adjusting your search or filters to see more results.":"There is no data to display yet.":i;return e.createElement("div",h({className:c},s),e.createElement(Qe,{flexDirection:"col",alignItems:"center",gap:4,className:"maxio-empty-state__content"},e.createElement(Qe,{flexDirection:"col",alignItems:"center",gap:2,className:"maxio-empty-state__copy"},l&&e.createElement(m,{className:"maxio-heading-lg"},l),d&&e.createElement(je,{size:"sm",className:"maxio-empty-state__description"},d)),r&&e.createElement(Qe,{alignItems:"center",gap:2},r)))},exports.Flex=Qe,exports.FormErrorMessage=Se,exports.FormHelperText=ke,exports.GlobalToastProvider=({children:t,toastQueue:a,...l})=>{const n=g.useToastQueue(a),i=e.useCallback(()=>{n.visibleToasts.forEach(e=>{a.close(e.key)})},[n.visibleToasts,a]),r=e.useMemo(()=>({addToast:a.add.bind(a),removeToast:a.clear.bind(a),removeAllToasts:i,state:n}),[a,i,n]);return e.createElement(na.Provider,{value:r},t,n.visibleToasts.length>0&&e.createElement(la,h({},l,{state:n})))},exports.Grid=({children:a,templateColumns:l,templateRows:n,autoColumns:i,autoRows:r,inline:o,column:s,columnStart:c,columnEnd:m,row:d,rowStart:u,rowEnd:p,gap:x,gapX:g,gapY:b,className:f,justifyContent:E,alignItems:v,..._})=>{const N=t(f,{"maxio-grid":!o,"maxio-inline-grid":o,[`maxio-grid-cols-${l}`]:l,[`maxio-grid-rows-${n}`]:n,[`maxio-auto-cols-${i}`]:i,[`maxio-auto-rows-${r}`]:r,["maxio-col-"+("auto"===s?"auto":`span-${s}`)]:s,[`maxio-col-start-${c}`]:c,[`maxio-col-end-${m}`]:m,["maxio-row-"+("auto"===d?"auto":`span-${d}`)]:d,[`maxio-row-start-${u}`]:u,[`maxio-row-end-${p}`]:p,[`maxio-gap-${x}`]:void 0!==x,[`maxio-gap-x-${g}`]:void 0!==g,[`maxio-gap-y-${b}`]:void 0!==b,[`maxio-justify-${E}`]:E,[`maxio-items-${v}`]:v});return e.createElement("div",h({className:N||void 0},_),a)},exports.Heading=Ge,exports.Icon=w,exports.IconButton=T,exports.Label=({as:a="div",children:l,size:n="sm",className:i,...r})=>{const o=a,s=t(`maxio-label-${n}`,i);return e.createElement(o,h({className:s},r),l)},exports.Link=R,exports.ListBox=at,exports.LoadingSpinner=k,exports.Logo=ta,exports.Menu=({children:t,"data-testid":a})=>e.createElement(L,{testId:a},e.createElement(z,null,t)),exports.MenuButton=({children:a,iconName:l="chevron-down","aria-label":n,size:i="md",variant:r="secondary","data-testid":o})=>{const s=t({"maxio-action-menu__chevron":"chevron-down"===l}),c=t("maxio-button",`maxio-button--${r}`,`maxio-button--${i}`,{"maxio-button--icon":l&&!a}),{isOpen:m,buttonId:d,controlsId:u,testId:p}=B();return e.createElement("summary",{className:c,"aria-haspopup":"true","aria-label":n,"aria-expanded":m,"aria-controls":u,id:d,"data-testid":o??M(p,"trigger")},a&&e.createElement("span",null,a),l&&e.createElement(w,{variant:l,className:`${s} maxio-button__trailing-element`}))},exports.MenuList=({items:a,alignItemsEnd:l=!1,"data-testid":n})=>{const i=t("maxio-action-menu__content",{"maxio-action-menu__content--align-end":l}),{controlsId:r,buttonId:o,testId:s}=B();return e.createElement("div",{className:i,role:"presentation","data-testid":n??M(s,"list")},e.createElement(I,{role:"menu",itemProps:{role:"menuitem"},id:r,"aria-labelledby":o,items:a}))},exports.Modal=({size:a="lg",isDismissable:l=!0,className:i,style:r,children:o,...s})=>e.createElement(n.ModalOverlay,h({},s,{isDismissable:l,className:"maxio-modal__backdrop"}),e.createElement(n.Modal,{className:t("maxio-modal",i),style:r,"data-size":a},o)),exports.NumberField=dt,exports.OverlayTrigger=ee,exports.Pagination=({size:t="md",onChange:a,totalItems:l=0,itemsPerPage:n=30,currentPage:i=1,pageSizeOptions:r,manualPageInput:o=!1,"data-testid":s})=>{const[c,m]=e.useState(i),[d,u]=e.useState(n),[p,x]=e.useState(i.toString());e.useEffect(()=>{x(c.toString())},[c]);const g=Math.ceil(l/d),b=c<g,f=c>1,E=d*(c-1)+1,h=Math.min(d*c,l),v=r.map(e=>({label:e.toString(),value:e.toString()})),_=Array.from({length:g},(e,t)=>t+1).map(e=>({label:e.toString(),value:e.toString()})),N=e=>{m(e),a?.({currentPage:e,itemsPerPage:d})},y=e=>{const t=parseInt(e,10);if(isNaN(t))return void x(c.toString());const a=Math.max(1,Math.min(t,g));x(a.toString()),N(a)};return e.createElement("div",{className:"maxio-pagination","data-testid":s},e.createElement("div",{className:"maxio-pagination__items-per-page"},e.createElement("label",{htmlFor:"items-per-page-large",className:"maxio-pagination__label"},"Items per page"),e.createElement(xt,{inline:!0,size:t,options:v,onChange:e=>{return t=Number(e.target.value),u(t),m(1),void a?.({currentPage:1,itemsPerPage:t});var t},value:d,id:"items-per-page-large"})),e.createElement("div",{className:"maxio-pagination__total-items"},e.createElement("span",null,E,"–",h," of ",l," items")),e.createElement("div",{className:"maxio-pagination__current-page"},o?e.createElement(pt,{className:"maxio-pagination__page-input",value:p,min:1,max:g,onChange:e=>(e=>{x(e)})(e),onBlur:e=>{y(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(y(e.currentTarget.value),e.currentTarget.blur())},"aria-label":"Page number",size:t,type:"number",onWheel:e=>e.preventDefault()}):e.createElement(xt,{inline:!0,size:t,"aria-label":"Select page",onChange:e=>N(Number(e.target.value)),value:c,options:_,id:"page-index-large"}),e.createElement("div",{className:"maxio-pagination__label"},"of ",g," pages")),e.createElement("div",{className:"maxio-pagination__controls"},e.createElement(ae,{onVisibilityUpdate:()=>{},renderContent:()=>"Previous",floatingElementOffset:9,placement:"top",size:"small"},e.createElement(T,{icon:e.createElement(w,{variant:"chevron-left"}),size:t,variant:"ghost",onClick:()=>N(c-1),"aria-label":"Previous",disabled:!f,"data-testid":M(s,"prev")})),e.createElement(ae,{onVisibilityUpdate:()=>{},renderContent:()=>"Next",floatingElementOffset:9,placement:"top",size:"small"},e.createElement(T,{icon:e.createElement(w,{variant:"chevron-right"}),size:t,variant:"ghost",onClick:()=>N(c+1),"aria-label":"Next",disabled:!b,"data-testid":M(s,"next")}))))},exports.Popover=Pe,exports.ProgressBar=({label:l,helperText:n,size:i="md",variant:r="default",status:o,value:s,maxValue:c=100,"data-testid":m})=>{const d=a.useId(),u=a.useId(),p=o&&!!l&&!!s&&!("inline"===r),x=n&&!("inline"===r),g=n&&"inline"===r,{progressBarProps:b,labelProps:f}=a.useProgressBar({maxValue:c,value:s,label:l}),E=t("maxio-progress-bar",{"maxio-progress-bar--lg":"lg"===i,"maxio-progress-bar--success":s&&!("inline"===r)&&"success"===o,"maxio-progress-bar--error":s&&!("inline"===r)&&"error"===o,"maxio-progress-bar--indent":"indent"===r,"maxio-progress-bar--inline":"inline"===r,"maxio-progress-bar--indeterminate":void 0===s});return e.createElement("div",h({className:E},b,{"data-testid":m}),e.createElement("div",h({id:d,className:"maxio-progress-bar__label"},f),l),g&&e.createElement("div",{id:u,className:"maxio-progress-bar__helper-text"},n),e.createElement("div",{className:"maxio-progress-bar__track"},e.createElement("div",{className:"maxio-progress-bar__progress",style:{"--tw-scale-x":`${s}%`}})),p&&e.createElement("div",{className:`maxio-progress-bar__${o}-icon`}),x&&e.createElement("div",{id:u,className:"maxio-progress-bar__helper-text"},n))},exports.Radio=({indent:l=!1,disabled:n=!1,invalid:i=!1,label:r,...o})=>{const s=e.useRef(null),c=e.useContext(st),{inputProps:m,isDisabled:d}=a.useRadio({...o,value:(o.value||"").toString(),"aria-label":o["aria-label"]||r,isDisabled:n},c,s),u=t("maxio-radio",{"maxio-radio--indent":l,"maxio-radio--disabled":d||c.isDisabled,"maxio-radio--error":i||c.isInvalid});return e.createElement("label",{className:u},e.createElement("input",h({ref:s,role:"radio",type:"radio",className:"maxio-radio__input"},m,{name:c.name||m.name})),e.createElement("span",{className:"maxio-radio__control"}),e.createElement("span",{className:"maxio-radio__label"},r))},exports.RadioGroup=({children:t,label:l,errorMessage:n,helperText:i,disabled:r=!1,invalid:o=!1,name:s,defaultValue:c,...m})=>{const d=x.useRadioGroupState({isDisabled:r,isInvalid:o,description:i,name:s,label:l,errorMessage:n,defaultValue:c,...m}),{radioGroupProps:u,labelProps:p,descriptionProps:g,errorMessageProps:b}=a.useRadioGroup({"aria-label":m["aria-label"]||l,...m},d);return e.createElement(e.Fragment,null,e.createElement("div",h({className:"maxio-radio-group"},u),l&&e.createElement("label",h({className:"maxio-radio-group__label"},p),l),e.createElement(st.Provider,{value:d},t),o&&n&&e.createElement(Se,b,n),i&&!o&&e.createElement(ke,g,i)))},exports.RangeCalendar=wt,exports.SearchField=ct,exports.SegmentedControl=Rt,exports.Select=xt,exports.SideNav=({withIcons:t=!0,shouldToggleSidebar:a=!1,topDropdownItems:l,sections:n=[],collapseBreakpoint:i=800,isOpen:r,onChange:o})=>e.createElement(Mt,{isOpen:r,onChange:o,collapseBreakpoint:i,withIcons:t,shouldToggleSidebar:a,topDropdownItems:l,sections:n},e.createElement(At,null)),exports.Tab=Ft,exports.TabList=({children:a,className:l,ariaLabel:i,overflow:r="none",moreLabel:o="More",...s})=>{const{variant:c,withDivider:m}=e.useContext(Vt),d=e.useContext(n.TabListStateContext),u=e.useId(),[p,x]=e.useState(!1),g=t("maxio-tabs",l,{"maxio-tabs--contained":"contained"===c,"maxio-tabs--divider":m}),b=e.Children.map(a,e=>e);(b??[]).forEach(t=>{if(!e.isValidElement(t)||t.type!==Ft)throw new Error("You can only pass <Tab /> component as children")});const f="auto"===r&&!!b?.length,{ref:E,moreButtonRef:v,overflowIndexes:_,handleKeyDownCapture:N}=(({overflowEnabled:t,childrenArray:a})=>{const l=e.useRef(null),i=e.useRef(null),r=e.useRef(null),[o,s]=e.useState(null),c=Y(l),m=e.useContext(n.TabListStateContext),d=null!=m?.selectedKey?Number(m.selectedKey):null,[u,p]=e.useState([]);e.useLayoutEffect(()=>{if(!t||!o)return void p((a??[]).map((e,t)=>t));const{visibleIndexes:e}=((e,t,a,l)=>{const n=e.map((e,t)=>t);if(e.reduce((e,t)=>e+t,0)<=t)return{visibleIndexes:n,overflowIndexes:[]};const i=[];let r=a;for(const a of n){if(r+e[a]>t)break;r+=e[a],i.push(a)}if(null!==l&&!i.includes(l)){for(r+=e[l];r>t&&i.length>0;)r-=e[i.pop()];i.push(l)}i.sort((e,t)=>e-t);const o=n.filter(e=>!i.includes(e));return{visibleIndexes:i,overflowIndexes:o}})(o.tabWidths,c,o.moreButtonWidth,r.current??d);e.length===(a??[]).length&&(r.current=null),p(e)},[t,o,c]),e.useLayoutEffect(()=>{t&&o&&null!==d&&p(e=>(e.includes(d)||(r.current=d),((e,t,a,l,n)=>{if(e.includes(n))return e;const i=[...e,n].sort((e,t)=>e-t);let r=l+i.reduce((e,a)=>e+t[a],0);for(;r>a&&i.length>1;){const e=i.length-1,a=i[e]===n?e-1:e,[l]=i.splice(a,1);r-=t[l]}return i})(e,o.tabWidths,c,o.moreButtonWidth,d)))},[d]);const x=t?(a??[]).map((e,t)=>t).filter(e=>!u.includes(e)):[],g=((e,t)=>e.filter(e=>!t?.[e]?.props.disabled))(u,a);e.useLayoutEffect(()=>{if(!t||!l.current)return void s(e=>null===e?e:null);const e=Array.from(l.current.querySelectorAll('[role="tab"]')),n=i.current?.getBoundingClientRect().width??0;s(t=>{const l=(a??[]).map((a,l)=>{const n=e[l]?.getBoundingClientRect().width??0;return n>0?n:t?.tabWidths[l]??0}),i=n>0?n:t?.moreButtonWidth??0,r=t?.tabWidths.length===l.length&&t.tabWidths.every((e,t)=>e===l[t]);return t&&r&&t.moreButtonWidth===i?t:{tabWidths:l,moreButtonWidth:i}})},[a,t]);const b=e=>{void 0!==e&&(m?.selectionManager.setFocused(!0),m?.selectionManager.setFocusedKey(e),m?.setSelectedKey(e),l.current?.querySelector(`[role="tab"][data-key="${e}"]`)?.focus())};return{ref:l,moreButtonRef:i,visibleIndexes:u,overflowIndexes:x,handleKeyDownCapture:e=>{if(0===x.length)return;const t=document.activeElement===i.current,a=m?.selectionManager.focusedKey,l=t?-1:g.indexOf(Number(a));if(t||-1!==l)switch(e.key){case"ArrowRight":if(t)return;return e.preventDefault(),e.stopPropagation(),void(l<g.length-1?b(g[l+1]):i.current?.focus());case"ArrowLeft":return e.preventDefault(),e.stopPropagation(),void(t?b(g[g.length-1]):l>0&&b(g[l-1]));case"Home":if(t)return;return e.preventDefault(),e.stopPropagation(),void b(g[0]);case"End":if(t)return;return e.preventDefault(),e.stopPropagation(),void b(g[g.length-1])}}}})({overflowEnabled:f,childrenArray:b}),y=e.createElement("span",{className:"maxio-tabs__tab-content"},o,e.createElement(w,{variant:"chevron-down",className:"maxio-tabs__more__chevron"})),C=_.map(e=>{return`#${t=u,"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,"\\$&")} [role="tablist"] > .maxio-tabs__tab:nth-child(${e+1})`;var t});return e.createElement("div",{id:u,className:g,ref:E,onKeyDownCapture:N},C.length>0&&e.createElement("style",null,`${C.join(", ")} { display: none; }`),e.createElement(n.TabList,h({"aria-label":i,className:"maxio-contents"},s),(b??[]).map((t,a)=>e.cloneElement(t,{key:a,value:a}))),f&&_.length>0&&e.createElement(n.MenuTrigger,{isOpen:p,onOpenChange:x},e.createElement(n.Button,{ref:v,className:"maxio-tabs__tab maxio-tabs__more__trigger","aria-label":o},y),p&&e.createElement(Pe,{hideArrow:!0,placement:"bottom end",className:"maxio-tabs__more__menu"},e.createElement(n.Menu,{"aria-label":`${o} tabs`,onAction:e=>{d?.setSelectedKey(e),requestAnimationFrame(()=>{E.current?.querySelector(`[role="tab"][data-key="${e}"]`)?.focus()})}},_.map(t=>{const a=b[t],{disabled:l,type:i,"aria-label":r,"aria-labelledby":o}=a.props,s="icon"===i?a.props.icon:a.props.children;return e.createElement(n.MenuItem,{key:t,id:t,isDisabled:!!l,"aria-label":r,"aria-labelledby":o,className:"maxio-tabs__more__item"},s)})))))},exports.TabPanel=Wt,exports.TabPanels=({children:t})=>{const a=e.Children.map(t,(t,a)=>{if(!e.isValidElement(t)||t.type!==Wt)throw new Error("You can only pass <TabPanel /> component as children");return e.cloneElement(t,{key:a,value:a})});return e.createElement(n.TabPanels,{className:"maxio-tabs__panels"},a)},exports.Tabs=({children:t,variant:a="line",withDivider:l=!1,defaultIndex:i=0,index:r,onChange:o,"data-testid":s})=>e.createElement(n.Tabs,{className:"maxio-tabs-container",selectedKey:r,defaultSelectedKey:i,onSelectionChange:e=>o?.(Number(e)),"data-testid":s},e.createElement(Ht,{variant:a,withDivider:l},t)),exports.Tag=({children:a,size:l,sentiment:n,kind:i="primary",leadingIcon:r,trailingIcon:o,"data-testid":s})=>{const c=t("maxio-tag",`maxio-tag--${i}`,!!n&&`maxio-tag--${n}`,!!l&&`maxio-tag--${l}`);return e.createElement("div",{className:c,"data-testid":s},r&&e.createElement(w,{variant:r,className:"maxio-tag__icon"}),e.createElement("span",{className:"maxio-tag__label"},a),o&&e.createElement(w,{variant:o,className:"maxio-tag__icon"}))},exports.TextArea=ut,exports.TextField=mt,exports.TextInput=pt,exports.Tile=({children:a,className:l,href:n,onClick:i,target:r,disabled:o,"data-testid":s})=>{const c=n||i;if(!c)return e.createElement("div",{className:"maxio-tile","data-testid":s},a);const m=t("maxio-tile",l,{"maxio-tile--clickable":c,"maxio-tile--disabled":o});return e.createElement("a",{className:m,href:n,target:r,onClick:e=>{o&&n&&e.preventDefault(),!o&&i&&i()},"data-testid":s},a)},exports.ToastProvider=({children:t,...a})=>{const{maxVisibleToasts:l=5,...n}=a,i=g.useToastState({maxVisibleToasts:l,...n});return e.useEffect(()=>{console.warn("ToastProvider is deprecated. Please use the global toast API instead.")},[]),e.createElement(e.Fragment,null,t(i),i.visibleToasts.length>0&&e.createElement(la,h({},a,{state:i})))},exports.ToastQueue=ia,exports.Toggle=({defaultChecked:a,checked:l,onChange:n,disabled:i,valueDescription:r,valueDescriptionPosition:o,className:s,name:c,id:m,"data-testid":d="toggle-container",...u})=>{const p=e.useId(),x="boolean"==typeof a,g=m||p,b="left"===o?"row":"row-reverse",f=r&&o,E=e.useCallback(e=>{if("Enter"===e.code||"Space"===e.code){e.preventDefault();const t=e.currentTarget.checked;x&&(e.currentTarget.checked=!t),n&&n(!t,e)}},[x,n]),h=u["aria-label"]||(f?void 0:r);return e.createElement("div",{className:t("maxio-toggle",s,{"maxio-toggle--disabled":i}),style:{display:"inline-flex",flexDirection:b},"data-testid":d},f?e.createElement("label",{className:"maxio-toggle__label",htmlFor:g},r):null,e.createElement("div",{className:"maxio-toggle__container"},e.createElement("input",{type:"checkbox",defaultChecked:a,checked:l,onChange:e=>{n&&n(e.target.checked,e)},onKeyDown:E,disabled:i,className:"maxio-toggle__checkbox",id:g,name:c,"aria-label":h}),e.createElement("div",{className:"maxio-toggle__track",role:"switch","aria-checked":l,"aria-hidden":"true"},e.createElement("div",{className:"maxio-toggle__handle"}),e.createElement("span",{className:"maxio-toggle__icon"},e.createElement("i",{className:"maxio-toggle__icon-on"})),e.createElement("span",{className:"maxio-toggle__icon"},e.createElement("i",{className:"maxio-toggle__icon-off"})))))},exports.Tooltip=W,exports.TooltipTrigger=ae,exports.TopBar=({children:t,actions:a,sideNavIsClosed:l,openSideNav:n,"data-testid":i})=>e.createElement("nav",{className:"maxio-top-bar","data-testid":i},l&&e.createElement(T,{"aria-label":"Open Side Navigation",variant:"ghost",icon:e.createElement(w,{variant:"sidebar"}),onClick:n}),e.createElement(Qe,{grow:!0,justifyContent:"end"},t),a),exports.useElementResizeObserver=Y,exports.useHover=U,exports.useOverlayTrigger=G,exports.useToast=()=>{const t=e.useContext(na);if(!t)throw new Error("useToast must be used within a GlobalToastProvider. Please wrap your app with <GlobalToastProvider> to use the global toast API.");return t},exports.useWindowSize=K;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|