@equinor/stratus-ui 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require("react");c=s(c,1);let l=require("react/jsx-runtime"),u=require("react-dom"),d=require("@tanstack/react-table"),f=require("@tiptap/extension-color");f=s(f,1);let p=require("@tiptap/extension-highlight");p=s(p,1);let m=require("@tiptap/extension-subscript");m=s(m,1);let h=require("@tiptap/extension-superscript");h=s(h,1);let g=require("@tiptap/extension-table"),_=require("@tiptap/extension-table-cell");_=s(_,1);let v=require("@tiptap/extension-table-header");v=s(v,1);let y=require("@tiptap/extension-table-row");y=s(y,1);let b=require("@tiptap/extension-text-align");b=s(b,1);let x=require("@tiptap/extension-text-style"),S=require("@tiptap/core"),C=require("@tiptap/react"),w=require("@tiptap/starter-kit");w=s(w,1);let T=require("@popperjs/core"),E=require("date-fns");var D={primary:{main:`var(--stratus-primary)`,hover:`var(--stratus-primary-hover)`,hoverAlt:`var(--stratus-primary-hover-alt)`,highlight:`var(--stratus-primary-highlight)`,highlightHover:`var(--stratus-primary-highlight-hover)`,light:`var(--stratus-primary-light)`},secondary:{main:`var(--stratus-secondary)`,highlight:`var(--stratus-secondary-highlight)`,light:`var(--stratus-secondary-light)`},danger:{main:`var(--stratus-error)`,highlight:`var(--stratus-error-highlight)`},warning:{main:`var(--stratus-warning)`,highlight:`var(--stratus-warning-highlight)`},success:{main:`var(--stratus-success)`,highlight:`var(--stratus-success-highlight)`},text:{main:`var(--stratus-text-main)`,muted:`var(--stratus-text-muted)`,primary:`var(--stratus-text-primary)`,secondary:`var(--stratus-text-secondary)`,tertiary:`var(--stratus-text-tertiary)`,disabled:`var(--stratus-text-disabled)`},surface:{surface:`var(--stratus-surface)`,muted:`var(--stratus-surface-muted)`,raised:`var(--stratus-surface-raised)`,nav:`var(--stratus-bg-nav)`},border:{light:`var(--stratus-border-light)`,divider:`var(--stratus-divider)`}};function O(e,{as:t,disabled:n,type:r}){let i=t??e;return i===`button`?{Component:i,isButton:!0,rootProps:{disabled:n||void 0,type:r,"data-disabled":n?`true`:void 0}}:{Component:i,isButton:!1,rootProps:{"aria-disabled":n||void 0,"data-disabled":n?`true`:void 0}}}function k(...e){return e.filter(Boolean).join(` `)}var A={p:`padding`,pt:`paddingTop`,pr:`paddingRight`,pb:`paddingBottom`,pl:`paddingLeft`,px:`paddingInline`,py:`paddingBlock`,m:`margin`,mt:`marginTop`,mr:`marginRight`,mb:`marginBottom`,ml:`marginLeft`,mx:`marginInline`,my:`marginBlock`,w:`width`,minW:`minWidth`,maxW:`maxWidth`,h:`height`,minH:`minHeight`,maxH:`maxHeight`,bg:`backgroundColor`,rounded:`borderRadius`},j=new Set(`display.position.top.right.bottom.left.inset.zIndex.overflow.overflowX.overflowY.float.clear.visibility.boxSizing.flex.flexDirection.flexWrap.flexFlow.flexGrow.flexShrink.flexBasis.justifyContent.alignItems.alignSelf.alignContent.order.gap.rowGap.columnGap.grid.gridTemplate.gridTemplateColumns.gridTemplateRows.gridTemplateAreas.gridArea.gridColumn.gridRow.gridAutoFlow.gridAutoColumns.gridAutoRows.gridGap.gridRowGap.gridColumnGap.justifyItems.justifySelf.placeContent.placeItems.placeSelf.width.minWidth.maxWidth.height.minHeight.maxHeight.aspectRatio.margin.marginTop.marginRight.marginBottom.marginLeft.marginBlock.marginBlockStart.marginBlockEnd.marginInline.marginInlineStart.marginInlineEnd.padding.paddingTop.paddingRight.paddingBottom.paddingLeft.paddingBlock.paddingBlockStart.paddingBlockEnd.paddingInline.paddingInlineStart.paddingInlineEnd.border.borderTop.borderRight.borderBottom.borderLeft.borderWidth.borderStyle.borderColor.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomLeftRadius.borderBottomRightRadius.borderCollapse.borderSpacing.outline.outlineColor.outlineStyle.outlineWidth.outlineOffset.background.backgroundColor.backgroundImage.backgroundSize.backgroundPosition.backgroundRepeat.backgroundClip.backgroundOrigin.backgroundAttachment.color.opacity.font.fontFamily.fontSize.fontWeight.fontStyle.fontVariant.lineHeight.letterSpacing.textAlign.textDecoration.textTransform.textOverflow.textShadow.textIndent.whiteSpace.wordBreak.wordSpacing.wordWrap.overflowWrap.verticalAlign.transform.transformOrigin.transition.transitionProperty.transitionDuration.transitionTimingFunction.transitionDelay.animation.animationName.animationDuration.animationTimingFunction.animationDelay.animationIterationCount.animationDirection.animationFillMode.animationPlayState.boxShadow.filter.backdropFilter.mixBlendMode.clipPath.mask.cursor.pointerEvents.userSelect.resize.touchAction.scrollBehavior.scrollMargin.scrollPadding.scrollSnapType.scrollSnapAlign.tableLayout.listStyle.listStyleType.listStylePosition.listStyleImage.content.objectFit.objectPosition.isolation.contain.willChange.appearance.accentColor.caretColor`.split(`.`)),M=[0,4,8,16,32,64,128,256,512],N=new Set([`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`marginBlock`,`marginBlockStart`,`marginBlockEnd`,`marginInline`,`marginInlineStart`,`marginInlineEnd`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`paddingBlock`,`paddingBlockStart`,`paddingBlockEnd`,`paddingInline`,`paddingInlineStart`,`paddingInlineEnd`]),P=new Set([`gap`,`rowGap`,`columnGap`]);function F(e,t){if(typeof t!=`number`)return t;if(N.has(e)){let e=M[t];return e==null?`${t}px`:`${e}px`}return P.has(e)?`${t}px`:t}function I(e){let t={},n={...e};for(let[e,r]of Object.entries(A))e in n&&(r in n||(t[r]=F(r,n[e])),delete n[e]);for(let e of j)e in n&&(t[e]=F(e,n[e]),delete n[e]);if(`style`in n){let e=n.style;if(delete n.style,e&&typeof e==`object`)return{cssProps:{...e,...t},otherProps:n}}return{cssProps:t,otherProps:n}}function L(e){return c.forwardRef(e)}var R=c.forwardRef(function({className:e,disabled:t=!1},n){let r=c.useRef(null),i=c.useCallback((e,n)=>{let i=r.current;if(!i||t)return;let a=i.getBoundingClientRect(),o=e-a.left,s=n-a.top,c=Math.max(a.width,a.height)*2,l=document.createElement(`span`);l.className=k(`stratus-ripple`),l.style.width=`${c}px`,l.style.height=`${c}px`,l.style.left=`${o}px`,l.style.top=`${s}px`,i.appendChild(l);let u=getComputedStyle(i).getPropertyValue(`--stratus-button-ripple-opacity`).trim()||`0.22`,d=l.animate([{transform:`translate(-50%, -50%) scale(0)`,opacity:u},{transform:`translate(-50%, -50%) scale(1)`,opacity:`0`}],{duration:520,easing:`ease-out`,fill:`forwards`});d.onfinish=()=>l.remove()},[t]),a=c.useCallback(()=>{let e=r.current;if(!e)return;let t=e.getBoundingClientRect();i(t.left+t.width/2,t.top+t.height/2)},[i]);return c.useImperativeHandle(n,()=>({triggerAt:i,triggerCenter:a}),[i,a]),(0,l.jsx)(`span`,{ref:r,"aria-hidden":!0,className:k(`stratus-button__ripples`,e)})}),z=L((e,t)=>{let{cssProps:n,otherProps:r}=I(e),{variant:i=`contained`,colorScheme:a=`primary`,size:o=`md`,compact:s=!1,fullWidth:u=!1,as:d,loading:f=!1,spinner:p,startAdornment:m,endAdornment:h,className:g,disabled:_,children:v,type:y=`button`,disableRipple:b=!1,iconSize:x,onPointerDown:S,onKeyDown:C,...w}=r,T=s?`sm`:o,E=(0,c.useRef)(null),D=!!(!v&&(m||h)),A=!!(_||f),j=e=>{S?.(e),!e.defaultPrevented&&(b||A||e.button===0&&E.current?.triggerAt(e.clientX,e.clientY))},M=e=>{C?.(e),!e.defaultPrevented&&(b||A||(e.key===`Enter`||e.key===` `)&&E.current?.triggerCenter())},{Component:N,rootProps:P}=O(`button`,{as:d,disabled:A,type:y}),F=k(`stratus-button`,`stratus-button--${i}`,`stratus-button--${a}`,`stratus-button--${T}`,u&&`stratus-button--fullWidth`,D&&`stratus-button--iconOnly`,f&&`stratus-button--loading`,g),L=p??(0,l.jsx)(`span`,{className:`stratus-button__spinner`,"aria-hidden":!0}),z={...n};return(0,l.jsxs)(N,{ref:t,className:F,"aria-busy":f||void 0,style:z,...P,...w,onPointerDown:j,onKeyDown:M,children:[(0,l.jsx)(R,{ref:E,disabled:b||A}),f?L:null,m?(0,l.jsx)(`span`,{className:k(`stratus-button__startAdornment`),style:x?{fontSize:x,width:x,height:x}:void 0,children:m}):null,v?(0,l.jsx)(`span`,{className:k(`stratus-button__label`),children:v}):null,h?(0,l.jsx)(`span`,{className:k(`stratus-button__endAdornment`),style:x?{fontSize:x,width:x,height:x}:void 0,children:h}):null]})}),B=new Set([`default`,`primary`,`secondary`,`success`,`warning`,`danger`]),V=(0,c.forwardRef)(function(e,t){let{children:n,className:r,color:i=`inherit`,size:a,rotation:o=0,...s}=e,{cssProps:c,otherProps:u}=I(s),d=B.has(i),f=i!==`inherit`&&!d,p={...a==null?{}:{width:a,height:a},...c,...f?{color:i}:{},...o?{transform:`rotate(${o}deg)`}:{}};return(0,l.jsx)(`span`,{ref:t,className:k(`stratus-icon`,d&&`stratus-icon--${i}`,r),style:p,...u,children:n})});function H(e){let{name:t,width:n,height:r,svgPathData:i}=e,a=(0,c.memo)((0,c.forwardRef)(function(e,t){let{size:a,...o}=e;return(0,l.jsx)(V,{ref:t,size:a,...o,children:(0,l.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${n} ${r}`,fill:`currentColor`,children:(0,l.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:i})})})}));return a.displayName=t?t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace(`-`,``).replace(`_`,``)).replace(/^[a-z]/,e=>e.toUpperCase())+`Icon`:`SvgIcon`,a}var U=H({name:`arrow_drop_down`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m7 9.5 5 5 5-5z`});function ee(e){return e.startsWith(`top`)?`top`:e.startsWith(`bottom`)?`bottom`:e.startsWith(`left`)?`left`:`right`}var te=8;function ne(e,t,n){let r=ee(n),i=0,a=0;switch(r){case`bottom`:i=e.bottom+te;break;case`top`:i=e.top-t.height-te;break;case`left`:a=e.left-t.width-te;break;case`right`:a=e.right+te;break}r===`top`||r===`bottom`?a=n.endsWith(`-start`)?e.left:n.endsWith(`-end`)?e.right-t.width:e.left+e.width/2-t.width/2:i=n.endsWith(`-start`)?e.top:n.endsWith(`-end`)?e.bottom-t.height:e.top+e.height/2-t.height/2;let o=document.documentElement.clientWidth,s=document.documentElement.clientHeight;return a=Math.max(4,Math.min(a,o-t.width-4)),i=Math.max(4,Math.min(i,s-t.height-4)),{top:i,left:a}}var re=(0,c.forwardRef)(({children:e,className:t,content:n,placement:r=`bottom`,trigger:i=[`click`,`hover`],open:a,defaultOpen:o=!1,arrow:s=!0,closeOnClickOutside:d=!0,tooltipRef:f,zIndex:p=1500,maxWidth:m=`300px`,fontSize:h=`0.75rem`,style:g,container:_,keepMounted:v=!1,disablePortal:y=!1,onOpen:b,onClose:x,onClick:S,onMouseEnter:C,onMouseLeave:w,onContextMenu:T,onClickOutside:E,...D},O)=>{let[A,j]=(0,c.useState)(o),M=(0,c.useRef)(null),N=(0,c.useRef)(null),P=(0,c.useRef)(void 0),[F,I]=(0,c.useState)(null),L=a!==void 0,R=L?a:A,z=(0,c.useMemo)(()=>Array.isArray(i)?i:[i],[i]),B={};for(let e of Object.keys(D))e.startsWith(`data-`)&&(B[e]=D[e]);let V=(0,c.useCallback)(e=>{L||j(!0),b?.(e)},[L,b]),H=(0,c.useCallback)(e=>{L||j(!1),x?.(e)},[L,x]);(0,c.useImperativeHandle)(f,()=>({open:e=>{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0});V(e??t)},close:e=>{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0});H(e??t)}}));let U=(0,c.useCallback)(()=>{if(!M.current||!N.current)return;let e=M.current.getBoundingClientRect(),t=N.current.getBoundingClientRect();I(ne(e,{width:t.width,height:t.height},r))},[r]);(0,c.useLayoutEffect)(()=>{R&&U()},[R,U,n]),(0,c.useEffect)(()=>{if(!R)return;let e=()=>U();return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[R,U]),(0,c.useEffect)(()=>{if(!R||!d||!z.includes(`click`)&&!z.includes(`contextMenu`))return;let e=e=>{let t=e.target;M.current?.contains(t)||N.current?.contains(t)||(H(e),E?.(!1,e))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[R,d,H,E]);let te=(0,c.useCallback)(e=>{if(!z.includes(`click`))return;let t=!R;L||j(t),S?.(t,e),t?b?.(e):x?.(e)},[z,R,L,S,b,x]),re=(0,c.useCallback)(e=>{if(!z.includes(`contextMenu`))return;e.preventDefault();let t=!R;L||j(t),T?.(t,e),t?b?.(e):x?.(e)},[z,R,L,T,b,x]),W=(0,c.useCallback)(e=>{z.includes(`hover`)&&(clearTimeout(P.current),V(e),C?.(!0,e))},[z,V,C]),G=(0,c.useCallback)(e=>{z.includes(`hover`)&&(P.current=setTimeout(()=>H(e),100),w?.(!1,e))},[z,H,w]),ie=(0,c.useCallback)(()=>{z.includes(`hover`)&&clearTimeout(P.current)},[z]),ae=(0,c.useCallback)(e=>{z.includes(`hover`)&&(H(e),w?.(!1,e))},[z,H,w]),oe={};z.includes(`click`)&&(oe.onClick=te),z.includes(`contextMenu`)&&(oe.onContextMenu=re),z.includes(`hover`)&&(oe.onMouseEnter=W,oe.onMouseLeave=G);let se=(0,c.useCallback)(e=>{M.current=e},[]),ce=()=>typeof e==`string`?(0,l.jsx)(`span`,{ref:se,...oe,className:`stratus-tooltip-anchor`,children:e}):c.Children.map(e,e=>(0,c.isValidElement)(e)?(0,c.cloneElement)(e,{ref:se,...oe,style:{display:e.props?.display??`inline-block`,cursor:`pointer`,...e.props?.style}}):e),le=ee(r),ue=Array.isArray(m)?m[0]:m,de=Array.isArray(h)?h[0]:h,fe=R||v?(0,l.jsxs)(`div`,{ref:e=>{N.current=e,typeof O==`function`?O(e):O&&(O.current=e)},className:k(`stratus-tooltip`,`stratus-tooltip--${le}`,t),role:`tooltip`,"data-state":R?`open`:`closed`,style:{top:F?.top??-9999,left:F?.left??-9999,zIndex:typeof p==`string`?Number(p)||1500:p,display:R?void 0:`none`,...!R&&v?{visibility:`hidden`}:{}},onMouseEnter:ie,onMouseLeave:ae,...B,children:[s&&(0,l.jsx)(`span`,{className:`stratus-tooltip__arrow`}),(0,l.jsx)(`div`,{className:`stratus-tooltip__content`,style:{"--stratus-tooltip-max-width":ue,"--stratus-tooltip-font-size":de,...g},children:n})]}):null,K=!y&&typeof document<`u`?_??document.body:null;return(0,l.jsxs)(l.Fragment,{children:[ce(),fe&&(K?(0,u.createPortal)(fe,K):fe)]})});re.displayName=`Tooltip`;var W=(0,c.forwardRef)(function(e,t){let{menu:n,contextMenu:r,trigger:i=[`click`],arrow:a=!1,className:o,style:s,...c}=e,u=r?Array.isArray(i)?[...i,`contextMenu`]:[i,`contextMenu`]:i;return(0,l.jsx)(re,{ref:t,content:(0,l.jsx)(`div`,{className:`stratus-dropdown-content`,children:n}),trigger:u,arrow:a,maxWidth:`fit-content`,style:s,className:k(`stratus-dropdown`,o),...c})}),G=(0,c.forwardRef)(function(e,t){let{orientation:n,color:r,size:i,...a}=e,{cssProps:o,otherProps:s}=I(a),{className:c,style:u,...d}=s,f=fe()?.mode??`vertical`,p=n??(f===`horizontal`?`vertical`:`horizontal`),m={...u,...o};return r&&(p===`horizontal`?m.borderTopColor=r:m.borderLeftColor=r),i&&(p===`horizontal`?m.borderTopWidth=`${i}px`:m.borderLeftWidth=`${i}px`),(0,l.jsx)(`hr`,{ref:t,role:`separator`,"aria-orientation":p,className:k(`stratus-menu-divider`,`stratus-menu-divider--${p}`,c),style:m,...d})});G.displayName=`MenuDivider`;var ie=L((e,t)=>{let n=(0,c.useId)(),r=(0,c.useRef)(null),{as:i,children:a,id:o,startAdornment:s,endAdornment:u,disabled:d=!1,clickable:f=!0,onClick:p,...m}=e,{cssProps:h,otherProps:g}=I(m),{className:_,style:v,...y}=g,b=fe(),x=o??n,S=d||(b?.disabled??!1),C=b?.compact??!1,w=b?.isSelected(x)??!1,T=e=>{if(!(S||!f)&&(p?.({id:x,label:a},e),b)){b.toggleSelect(x,e,a);let t={menuItemId:x,selected:!b.isSelected(x),selectedIds:b.selectedIds,open:!1,openIds:b.openIds};b.onClick?.(t,e)}},E=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(e))},D=i??`li`,O=k(`stratus-menu-item`,C&&`stratus-menu-item--compact`,S&&`stratus-menu-item--disabled`,w&&`stratus-menu-item--selected`,!f&&`stratus-menu-item--not-clickable`,_),A={...v,...h};return(0,l.jsxs)(D,{ref:t,role:`menuitem`,tabIndex:S?void 0:0,"aria-disabled":S||void 0,className:O,style:A,onClick:T,onKeyDown:E,onPointerDown:e=>{S||!f||e.button===0&&r.current?.triggerAt(e.clientX,e.clientY)},...y,children:[f&&!S&&(0,l.jsx)(R,{ref:r}),s&&(0,l.jsx)(`span`,{className:`stratus-menu-item__start-adornment`,children:s}),(0,l.jsx)(`span`,{className:`stratus-menu-item__title`,children:a}),u&&(0,l.jsx)(`span`,{className:`stratus-menu-item__end-adornment`,children:u})]})}),ae=H({name:`chevron_down`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m7.41 8.295 4.59 4.58 4.59-4.58L18 9.705l-6 6-6-6z`}),oe=H({name:`chevron_right`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m8.295 16.59 4.58-4.59-4.58-4.59L9.705 6l6 6-6 6z`});function se(){return(0,l.jsx)(ae,{size:16})}function ce(){return(0,l.jsx)(oe,{size:16})}var le=(0,c.forwardRef)(function(e,t){let n=(0,c.useId)(),{title:r,children:i,id:a,startAdornment:o,arrow:s=!0,disabled:u=!1,onClick:d,...f}=e,{cssProps:p,otherProps:m}=I(f),{className:h,style:g,..._}=m,v=fe(),y=a??n,b=u||(v?.disabled??!1),x=v?.compact??!1,S=(v?.mode??`vertical`)===`inline`,[C,w]=(0,c.useState)(!1),T=v?.isOpen(y)??C,E=(0,c.useRef)(null),D=(0,c.useRef)(null),[O,A]=(0,c.useState)(T?`auto`:0),j=(0,c.useRef)(!0);(0,c.useEffect)(()=>{if(!S)return;if(j.current){j.current=!1,T&&A(`auto`);return}let e=E.current;if(e)if(T){let t=e.scrollHeight;A(t);let n=()=>{A(`auto`),e.removeEventListener(`transitionend`,n)};e.addEventListener(`transitionend`,n)}else{let t=e.scrollHeight;A(t),e.offsetHeight,requestAnimationFrame(()=>A(0))}},[T,S]),(0,c.useEffect)(()=>{if(S||!T)return;let e=e=>{let t=e.target;D.current?.contains(t)||E.current?.contains(t)||(v?v.toggleOpen(y,e,r):w(!1))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[S,T,v,y,r]);let M=e=>{if(b)return;let t={id:y,label:r,level:v?.level};d?.(t,e),v?v.toggleOpen(y,e,r):w(e=>!e)},N=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),M(e))},P=v?.triggersSubMenu??`click`,F=Array.isArray(P)?P.includes(`hover`):P===`hover`,L=e=>{!F||b||T||(v?v.toggleOpen(y,e,r):w(!0))},R=e=>{!F||b||!T||(v?v.toggleOpen(y,e,r):w(!1))},z=S?(0,l.jsx)(se,{}):(0,l.jsx)(ce,{});return(0,l.jsxs)(`li`,{ref:t,className:k(`stratus-submenu`,h),style:{...g,...p},onMouseEnter:S?void 0:L,onMouseLeave:S?void 0:R,..._,children:[(0,l.jsxs)(`div`,{ref:D,role:`menuitem`,tabIndex:b?void 0:0,"aria-haspopup":`true`,"aria-expanded":T,"aria-disabled":b||void 0,className:k(`stratus-submenu__trigger`,x&&`stratus-submenu__trigger--compact`,b&&`stratus-submenu__trigger--disabled`),onClick:M,onKeyDown:N,children:[o&&(0,l.jsx)(`span`,{className:`stratus-menu-item__start-adornment`,children:o}),(0,l.jsx)(`span`,{className:`stratus-submenu__trigger__title`,children:r}),s&&(0,l.jsx)(`span`,{className:k(`stratus-submenu__trigger__arrow`,S&&T&&`stratus-submenu__trigger__arrow--open`),children:z})]}),S?(0,l.jsx)(`div`,{ref:E,className:`stratus-submenu__inline-content`,style:{height:O},children:(0,l.jsx)(`ul`,{role:`menu`,className:`stratus-menu stratus-menu--inline`,children:i})}):T&&(0,l.jsx)(`div`,{ref:E,className:`stratus-submenu__popover`,children:(0,l.jsx)(`ul`,{role:`menu`,className:`stratus-menu`,children:i})})]})});le.displayName=`SubMenu`;var ue=le,de=(0,c.createContext)(null);function fe(){return(0,c.useContext)(de)}var K=L((e,t)=>{let{as:n,children:r,mode:i=`vertical`,inlineCollapsed:a=!1,multiple:o=!1,selectable:s=!0,selectedIds:u,openIds:d,triggersSubMenu:f=`click`,compact:p=!1,disabled:m=!1,onClick:h,onSelect:g,onDeselect:_,onOpen:v,onClose:y,...b}=e,{cssProps:x,otherProps:S}=I(b),{className:C,style:w,...T}=S,E=fe(),D=E?E.level+1:0,[O,A]=(0,c.useState)(u??[]),[j,M]=(0,c.useState)(d??[]),N=u??O,P=d??j;(0,c.useEffect)(()=>{u&&A(u)},[u]),(0,c.useEffect)(()=>{d&&M(d)},[d]);let F=(0,c.useCallback)(e=>N.includes(e),[N]),L=(0,c.useCallback)(e=>P.includes(e),[P]),R=(0,c.useCallback)((e,t,n)=>{if(!s)return;let r=N.includes(e),i;i=r?N.filter(t=>t!==e):o?[...N,e]:[e],u||A(i);let a={menuItemId:e,selected:!r,selectedIds:i,open:!1,openIds:P};r?_?.(a,t):g?.(a,t)},[s,N,o,u,P,g,_]),z=(0,c.useCallback)((e,t,n)=>{let r=P.includes(e),i;i=r?P.filter(t=>t!==e):[...P,e],d||M(i);let a={menuItemId:e,selected:!1,selectedIds:N,open:!r,openIds:i};r?y?.(a,t):v?.(a,t)},[P,d,N,v,y]),B={mode:a?`vertical`:i,compact:p,disabled:m,selectable:s,selectedIds:N,openIds:P,level:D,triggersSubMenu:f,isSelected:F,isOpen:L,toggleSelect:R,toggleOpen:z,onClick:h},V=n??`ul`,H=k(`stratus-menu`,`stratus-menu--${i}`,C),U={...w,...x};return(0,l.jsx)(de.Provider,{value:B,children:(0,l.jsx)(V,{ref:t,role:`menu`,className:H,style:U,...T,children:r})})}),pe=L((e,t)=>{let{as:n,options:r,selectedId:i,defaultSelectedId:a,menuButtonAriaLabel:o=`Select option`,onAction:s,onOptionChange:u,variant:d=`contained`,color:f=`primary`,compact:p=!1,fullWidth:m=!1,disabled:h=!1,...g}=e,_=(0,c.useRef)(null),[v,y]=(0,c.useState)((r.find(e=>e.id===a)??r[0])?.id),b=i??v,x=r.find(e=>e.id===b)??r[0],S=x?.id,C=p?`sm`:void 0,w=r.length>0,T=w&&r.every(e=>e.disabled),E=me,D=(e,t)=>{let n=r.find(t=>t.id===e.menuItemId);!n||n.disabled||(i===void 0&&y(n.id),u?.(n,t),_.current?.close(t))},O=e=>{!x||x.disabled||s?.(x,e)};return(0,l.jsxs)(E,{...g,ref:t,as:n,active:-1,variant:d,color:f,compact:p,fullWidth:m,disabled:h,children:[(0,l.jsx)(z,{onClick:O,disabled:h||!x||x.disabled,children:x?.label??`No options`}),(0,l.jsx)(W,{tooltipRef:_,placement:`bottom-end`,menu:(0,l.jsx)(K,{compact:p,selectedIds:S?[S]:[],onClick:D,children:r.map(e=>(0,l.jsx)(ie,{id:e.id,disabled:e.disabled,children:e.label},e.id))}),children:(0,l.jsx)(z,{"aria-label":o,disabled:h||!w||T,variant:d,colorScheme:f,size:C,style:{paddingLeft:10,paddingRight:10},children:(0,l.jsx)(U,{})})})]})}),me=L((e,t)=>{let{cssProps:n,otherProps:r}=I(e),{children:i,className:a,style:o,active:s,defaultActive:u=0,color:d=`primary`,variant:f=`outlined`,variantActive:p=`contained`,orientation:m=`horizontal`,compact:h=!1,fullWidth:g=!1,disabled:_=!1,onChange:v,as:y,...b}=r,x=s!==void 0,[S,C]=(0,c.useState)(u),w=x?s:S,T=(e,t)=>{x||C(e),v?.({index:e},t)},E=k(`stratus-buttonGroup`,`stratus-buttonGroup--${m}`,`stratus-buttonGroup--${d}`,g&&`stratus-buttonGroup--fullWidth`,h&&`stratus-buttonGroup--compact`,_&&`stratus-buttonGroup--disabled`,a),D={...o,...n};return(0,l.jsx)(y??`div`,{ref:t,role:`group`,className:E,style:D,...b,children:c.Children.toArray(i).map((e,t)=>{if(!(0,c.isValidElement)(e))return e;let n=w===t,r=e;return(0,c.cloneElement)(r,{className:k(r.props.className,n&&`stratus-buttonGroup__item--active`),variant:n?p:f,colorScheme:d,size:h?`sm`:void 0,disabled:_||r.props.disabled,onClick:e=>{let n=r.props.onClick;n?.(e),T(t,e)}})})})}),he=L((e,t)=>{let{cssProps:n,otherProps:r}=I(e),{as:i,className:a,gap:o,children:s,...c}=r,{Component:u,rootProps:d}=O(`div`,{as:i}),f=k(`stratus-box`,a),p={...n};return(0,l.jsx)(u,{ref:t,className:f,style:{gap:typeof o==`number`?`${o}px`:o,...p},...d,...c,children:s})}),ge=new Set([`primary`,`secondary`,`success`,`warning`,`danger`,`disabled`,`inherit`]),_e={h1:`h1`,h1_bold:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`},ve=L((e,t)=>{let{cssProps:n,otherProps:r}=I(e),{as:i,className:a,style:o,variant:s=`p`,color:c,children:u,...d}=r,{Component:f,rootProps:p}=O(_e[s]??`p`,{as:i}),m=k(`stratus-typography`,s&&`stratus-typography--${s}`,c&&ge.has(c)&&`stratus-typography--color-${c}`,a),h=c&&!ge.has(c)?{color:c}:void 0,g={...o,...n,...h};return(0,l.jsx)(f,{ref:t,className:m,style:Object.keys(g).length>0?g:void 0,...p,...d,children:u})});function ye(e){let t={};for(let n of e)t[String(n)]=!0;return t}function be(e,t){return e===!0?t.map(e=>e.id):Object.keys(e).filter(t=>e[t])}function xe(e){let t={};for(let n of e)t[n.id]=n.desc?`desc`:`asc`;return t}var Se={1:`0 1px 3px var(--stratus-shadow-ambient), 0 1px 2px var(--stratus-shadow-penumbra)`,2:`0 3px 6px var(--stratus-shadow-ambient), 0 2px 4px var(--stratus-shadow-penumbra)`,3:`0 10px 20px var(--stratus-shadow-ambient), 0 3px 6px var(--stratus-shadow-penumbra)`};function Ce(e,t){let{columns:n,data:r,rowId:i=`id`,childrenId:a=`children`,compact:o=!1,headerHeight:s,rowHeight:u,dynamicHeight:f=!1,sortable:p=!0,multiSort:m=!1,resizable:h=!0,expandable:g=!1,expandedRowKeys:_,defaultExpandedRowKeys:v,draggable:y=!1,selectable:b=!1,selectRowOnClick:x=!0,stripedRows:S=!1,disabled:C=!1,elevation:w=0,noDataValue:T,extraColumnsWidth:E,className:D,rowClassName:O,onRowClick:A,onColumnSort:j,onRowSelect:M,onDragEnd:N,onEndReached:P,style:F}=e,I=(0,c.useRef)(null),L=(0,c.useRef)(null),[R,z]=(0,c.useState)(0);(0,c.useEffect)(()=>{let e=I.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e)z(t.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]);let[B,V]=(0,c.useState)([]),H=(0,c.useCallback)(e=>{C||V(t=>{let n=typeof e==`function`?e(t):e;return j?.(xe(n)),n})},[j,C]),[U,ee]=(0,c.useState)(()=>v?ye(v):{}),te=(0,c.useMemo)(()=>_===void 0?U:ye(_),[_,U]),ne=(0,c.useCallback)(e=>{_===void 0&&ee(t=>typeof e==`function`?e(t):e)},[_]),[re,W]=(0,c.useState)(()=>e.defaultSelectedRowsIds?Object.fromEntries(e.defaultSelectedRowsIds.map(e=>[e,!0])):{}),[G,ie]=(0,c.useState)(null),[ae,oe]=(0,c.useState)(null),se=(0,c.useCallback)((e,t)=>typeof e==`function`?Math.max(e(R,t),0):typeof e==`string`?e.endsWith(`%`)?Math.max(parseFloat(e)/100*R,0):parseFloat(e)||150:e,[R]),ce=(0,c.useMemo)(()=>{let e=[];if(g){let t=E?E({totalWidth:R,column:{key:`__expandable__`},defaultWidth:48}):48;t>0&&e.push({id:`__expandable__`,size:t,minSize:t,maxSize:t,enableSorting:!1,enableResizing:!1,header:()=>null,cell:({row:e})=>e.getCanExpand()?(0,l.jsx)(`span`,{role:`button`,"aria-label":e.getIsExpanded()?`Collapse row`:`Expand row`,className:k(`stratus-table__expand-icon`,e.getIsExpanded()&&`stratus-table__expand-icon--open`),onClick:t=>{t.stopPropagation(),e.toggleExpanded()},children:`▶`}):null})}if(b){let t=E?E({totalWidth:R,column:{key:`__selectable__`},defaultWidth:48}):48;t>0&&e.push({id:`__selectable__`,size:t,minSize:t,maxSize:t,enableSorting:!1,enableResizing:!1,header:({table:e})=>(0,l.jsx)(`input`,{type:`checkbox`,checked:e.getIsAllRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()}),cell:({row:e})=>(0,l.jsx)(`input`,{type:`checkbox`,checked:e.getIsSelected(),onChange:t=>{e.toggleSelected(),M?.({rowIndex:e.index,rowData:e.original,selected:t.target.checked})},onClick:e=>e.stopPropagation()})})}if(y){let t=E?E({totalWidth:R,column:{key:`__draggable__`},defaultWidth:48}):48;t>0&&e.push({id:`__draggable__`,size:t,minSize:t,maxSize:t,enableSorting:!1,enableResizing:!1,header:()=>null,cell:()=>(0,l.jsx)(`span`,{"aria-label":`Drag row`,className:`stratus-table__drag-handle`,role:`img`})})}return n.forEach((t,n)=>{let r=t.key??t.dataKey,i=R>0?se(t.width,t):150,a=t.sortable===void 0?p:t.sortable,o=t.resizable===void 0?h:t.resizable,s;if(typeof t.sortType==`function`){let e=t.sortType,n=t.dataKey;s=(r,i)=>e(r.original,i.original,n,t)}else t.sortType===`datetime`&&(s=(e,n)=>{let r=e.original[t.dataKey],i=n.original[t.dataKey];return new Date(r instanceof Date||typeof r==`string`||typeof r==`number`?r:0).getTime()-new Date(i instanceof Date||typeof i==`string`||typeof i==`number`?i:0).getTime()});e.push({id:r,accessorKey:t.dataKey,size:i,minSize:t.minWidth??50,enableSorting:a,enableResizing:o,sortingFn:s??`auto`,header:t.headerRenderer?()=>t.headerRenderer({column:t,columnIndex:n}):()=>t.title??``,cell:t.cellRenderer?e=>t.cellRenderer({rowData:e.row.original,rowIndex:e.row.index,column:t,columnIndex:n,cellData:e.getValue()}):e=>{let t=e.getValue();return t==null?``:String(t)},meta:{_col:t,_colIndex:n}})}),e},[n,R,g,b,y,p,h,E,se,M]),le=(0,c.useCallback)(e=>String(e[i]),[i]),ue=(0,c.useCallback)(e=>{let t=e[a];return Array.isArray(t)?t:void 0},[a]),de=(0,d.useReactTable)({data:r,columns:ce,state:{sorting:B,expanded:te,rowSelection:re},getRowId:le,getSubRows:g?ue:void 0,onSortingChange:H,onExpandedChange:ne,onRowSelectionChange:W,getCoreRowModel:(0,d.getCoreRowModel)(),getSortedRowModel:(0,d.getSortedRowModel)(),getExpandedRowModel:g?(0,d.getExpandedRowModel)():void 0,enableSorting:p&&!C,enableMultiSort:m,enableSortingRemoval:!0,columnResizeMode:`onChange`,enableColumnResizing:h&&!C,enableRowSelection:b,enableExpanding:g});(0,c.useImperativeHandle)(t,()=>({clearSortState:()=>{V([]),j?.({})},setColumnSort:({columnKey:e,order:t})=>{let n=[{id:e,desc:t===`desc`}];V(n),j?.(xe(n))},setSelectedRows:e=>{W(Object.fromEntries(e.map(e=>[e,!0])))},getTableRef:()=>({scrollToTop:e=>{L.current&&(L.current.scrollTop=e)},scrollToRow:e=>{let t=u??(o?32:48);L.current&&(L.current.scrollTop=e*t)},scrollToLeft:e=>{L.current&&(L.current.scrollLeft=e)},getDOMNode:()=>I.current,getExpandedState:()=>({expandedData:(de.getExpandedRowModel?.()?.rows??de.getRowModel().rows).map(e=>e.original)}),getExpandedRowKeys:()=>be(de.getState().expanded,de.getRowModel().rows),setExpandedRowKeys:e=>{_===void 0&&ee(ye(e))}})}),[de,o,u,_,j]),(0,c.useEffect)(()=>{if(!P)return;let e=L.current;if(!e)return;let t=()=>{e.scrollTop+e.clientHeight>=e.scrollHeight-50&&P()};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[P]);let fe=Array.isArray(s)?s[0]:s,K=u??(o?32:48),pe=de.getRowModel().rows,me=de.getHeaderGroups(),he=r.length===0,ge=w?Se[w]??Se[1]:void 0,_e=(0,c.useCallback)((e,t)=>{!y||C||(ie(e.id),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.id))},[y,C]),ve=(0,c.useCallback)((e,t)=>{!y||C||(t.preventDefault(),t.dataTransfer.dropEffect=`move`,oe(e.id))},[y,C]),Ce=(0,c.useCallback)((e,t)=>{if(!y||C)return;t.preventDefault();let n=t.dataTransfer.getData(`text/plain`)||G;if(ie(null),oe(null),!n||n===e.id)return;let r=pe.findIndex(e=>e.id===n),i=pe.findIndex(t=>t.id===e.id);if(r<0||i<0)return;let a=pe.map(e=>e.original),[o]=a.splice(r,1);a.splice(i,0,o),N?.({oldIndex:r,newIndex:i,rowData:o,data:a})},[y,C,G,pe,N]),we=(0,c.useCallback)(()=>{ie(null),oe(null)},[]);return(0,l.jsx)(`div`,{ref:I,className:k(`stratus-table-root`,D),style:{...F,...ge?{boxShadow:ge}:{}},children:(0,l.jsx)(`div`,{ref:L,className:`stratus-table-scroll`,children:(0,l.jsxs)(`table`,{className:k(`stratus-table`,o?`stratus-table--compact`:void 0),style:de.getTotalSize()>0?{width:de.getTotalSize()}:void 0,children:[(0,l.jsx)(`colgroup`,{children:de.getAllColumns().map(e=>(0,l.jsx)(`col`,{style:{width:e.getSize()}},e.id))}),(0,l.jsx)(`thead`,{children:me.map(e=>(0,l.jsx)(`tr`,{style:fe?{height:fe}:void 0,children:e.headers.map(e=>{let t=e.column.getCanSort(),n=e.column.getIsSorted(),r=e.column.columnDef.meta?._col;return(0,l.jsxs)(`th`,{"data-sortable":t||void 0,"data-sort-direction":n||void 0,className:r?.headerClassName,style:{width:e.getSize(),...fe?{height:fe}:{}},onClick:t&&!C?e.column.getToggleSortingHandler():void 0,children:[e.isPlaceholder?null:(0,d.flexRender)(e.column.columnDef.header,e.getContext()),n&&(0,l.jsx)(`span`,{className:`stratus-table__sort-icon`,children:n===`asc`?`▲`:`▼`}),e.column.getCanResize()&&h&&(0,l.jsx)(`div`,{className:k(`stratus-table__resizer`,e.column.getIsResizing()&&`stratus-table__resizer--active`),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler()})]},e.id)})},e.id))}),(0,l.jsx)(`tbody`,{children:he?(0,l.jsx)(`tr`,{children:(0,l.jsx)(`td`,{colSpan:ce.length,children:(0,l.jsx)(`div`,{className:`stratus-table__empty`,children:T})})}):pe.map((e,t)=>{let n=e.original,r=le(n),i=``;typeof O==`function`?i=O({rowData:n,rowIndex:t}):typeof O==`string`&&(i=O);let a=S&&t%2==1,o=e.getIsSelected(),s=!!A,c=y&&ae===e.id;return(0,l.jsx)(`tr`,{className:k(i||void 0,y&&`stratus-table__row--draggable`,G===e.id&&`stratus-table__row--dragging`,c&&`stratus-table__row--drag-over`),draggable:y&&!C,"data-clickable":s||void 0,"data-selected":o||void 0,"data-striped":a||void 0,style:f?void 0:{height:K},onDragStart:t=>_e(e,t),onDragOver:t=>ve(e,t),onDrop:t=>Ce(e,t),onDragEnd:we,onClick:C?void 0:t=>{x&&b&&(e.toggleSelected(),M?.({rowIndex:e.index,rowData:n,selected:!e.getIsSelected()})),A?.({rowKey:r,rowIndex:e.index,rowData:n,event:t})},children:e.getVisibleCells().map(e=>{let r=e.column.columnDef.meta?._col,i=``;return r?.className&&(i=typeof r.className==`function`?r.className({rowData:n,rowIndex:t,column:r}):r.className),(0,l.jsx)(`td`,{className:i||void 0,style:{width:e.column.getSize()},children:(0,d.flexRender)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)})})]})})})}var we=(0,c.forwardRef)(Ce);we.displayName=`Table`;var Te=H({name:`check_circle_outlined`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-2-5.83 6.59-6.59L18 9l-8 8-4-4 1.41-1.41z`}),Ee=H({name:`close`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),De=H({name:`error_filled`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 15v-2h2v2zm0-10v6h2V7z`}),Oe=H({name:`info_circle`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12.01 22C17.53 22 22 17.52 22 12S17.53 2 12.01 2C6.48 2 2 6.48 2 12s4.48 10 10.01 10M13 9V7h-2v2zm0 8v-6h-2v6zm7-5c0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8 8-3.58 8-8`}),ke=H({name:`warning_filled`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m23 21.5-11-19-11 19zm-12-3v-2h2v2zm0-4h2v-4h-2z`}),Ae=20,je={info:()=>(0,l.jsx)(Oe,{size:Ae}),success:()=>(0,l.jsx)(Te,{size:Ae}),warning:()=>(0,l.jsx)(ke,{size:Ae}),error:()=>(0,l.jsx)(De,{size:Ae})},Me=(0,c.forwardRef)(function(e,t){let{cssProps:n,otherProps:r}=I(e),{className:i,children:a,variant:o=`contained`,severity:s=`info`,title:c,showIcon:u=!1,icon:d,onClose:f,...p}=r,m=typeof f==`function`,h=a!=null,g=()=>{if(d)return d;let e=je[s];return e?e():null};return(0,l.jsxs)(`div`,{ref:t,role:`alert`,className:k(`stratus-alert`,`stratus-alert--${o}`,`stratus-alert--${s}`,i),style:{...n},...p,children:[(0,l.jsxs)(`div`,{className:`stratus-alert__header`,children:[u&&(0,l.jsx)(`span`,{className:`stratus-alert__icon`,children:g()}),(0,l.jsx)(`div`,{className:`stratus-alert__title`,children:c}),m&&(0,l.jsx)(`button`,{type:`button`,className:`stratus-alert__close-btn`,"aria-label":`Close`,onClick:f,children:(0,l.jsx)(Ee,{size:18})})]}),h&&(0,l.jsx)(`div`,{className:`stratus-alert__message`,children:a})]})});Me.displayName=`Alert`;var Ne=H({name:`chevron_up`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m7.41 15.705 4.59-4.58 4.59 4.58 1.41-1.41-6-6-6 6z`});function Pe({id:e,header:t,headerLevel:n,headerItems:r,isExpanded:i,disabled:a,expandIconPosition:o,expandIcon:s,onToggle:c}){let u=s??(i?(0,l.jsx)(Ne,{size:16}):(0,l.jsx)(ae,{size:16}));return(0,l.jsxs)(`div`,{id:e,className:`stratus-accordion__header`,role:`button`,tabIndex:a?void 0:0,"aria-expanded":i,"aria-disabled":a||void 0,onClick:c,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c(e))},children:[o===`left`&&(0,l.jsx)(`span`,{className:`stratus-accordion__chevron stratus-accordion__chevron--left`,children:u}),(0,l.jsxs)(`div`,{className:`stratus-accordion__header-content`,children:[(0,l.jsx)(n,{className:k(`stratus-accordion__title`,i&&`stratus-accordion__title--expanded`),children:t}),r]}),o===`right`&&(0,l.jsx)(`span`,{className:`stratus-accordion__chevron stratus-accordion__chevron--right`,children:u})]})}var Fe=(0,c.forwardRef)(function(e,t){let{cssProps:n,otherProps:r}=I(e),{className:i,children:a,style:o,header:s,headerLevel:u=`h2`,headerItems:d,defaultExpanded:f,expanded:p,expandIconPosition:m=`left`,expandIcon:h,disabled:g=!1,elevation:_=!1,square:v=!0,onChange:y,...b}=r,x=(0,c.useId)(),S=typeof p==`boolean`,C=(0,c.useRef)(!0),[w,T]=(0,c.useState)(p??f??!1),E=!g&&(S?p:w),D=a!=null,O=(0,c.useRef)(null),[A,j]=(0,c.useState)(E?`auto`:0);(0,c.useEffect)(()=>{if(C.current){C.current=!1,E&&j(`auto`);return}let e=O.current;if(e)if(E){let t=e.scrollHeight;j(t);let n=()=>{j(`auto`),e.removeEventListener(`transitionend`,n)};e.addEventListener(`transitionend`,n)}else{let t=e.scrollHeight;j(t),e.offsetHeight,requestAnimationFrame(()=>j(0))}},[E]);let M=e=>{if(g)return;let t=S?!p:!w;S||T(t),y?.(t,e)};return(0,l.jsxs)(`div`,{ref:t,className:k(`stratus-accordion`,_&&`stratus-accordion--elevation`,!v&&`stratus-accordion--rounded`,i),style:{...o,...n},...b,children:[(0,l.jsx)(Pe,{id:x,header:s,headerLevel:u,headerItems:d,isExpanded:!!E,disabled:g,expandIconPosition:m,expandIcon:h,onToggle:M}),E&&D&&(0,l.jsx)(`div`,{className:`stratus-accordion__divider`}),(0,l.jsx)(`div`,{ref:O,className:`stratus-accordion__collapse`,style:{height:A},children:(0,l.jsx)(`div`,{className:`stratus-accordion__panel`,role:`region`,"aria-labelledby":x,children:a})})]})});Fe.displayName=`Accordion`;var Ie=H({name:`menu`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M3 8V6h18v2zm0 5h18v-2H3zm0 5h18v-2H3z`}),Le=H({name:`more_vertical`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-2 8c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2`}),Re=1024,ze=typeof window<`u`?window.innerWidth:Re,Be=0,Ve=null,He=new Set;function Ue(){Ve===null&&(Ve=requestAnimationFrame(()=>{Ve=null;let e=window.innerWidth;if(e!==ze){ze=e;for(let e of He)e()}}))}function We(e){return He.add(e),Be===0&&typeof window<`u`&&window.addEventListener(`resize`,Ue),Be+=1,()=>{He.delete(e),--Be,Be===0&&typeof window<`u`&&(window.removeEventListener(`resize`,Ue),Ve!==null&&(cancelAnimationFrame(Ve),Ve=null))}}function Ge(){return ze}function Ke(){return Re}function qe(){return(0,c.useSyncExternalStore)(We,Ge,Ke)}function Je({open:e,content:t,onClose:n}){return(0,l.jsxs)(l.Fragment,{children:[e&&(0,l.jsx)(`div`,{className:`stratus-appBar__drawer-backdrop`,onClick:n}),(0,l.jsx)(`div`,{className:k(`stratus-appBar__drawer`,e&&`stratus-appBar__drawer--open`),children:t})]})}var Ye=(0,c.forwardRef)(function(e,t){let{header:n,content:r,smallScreenContent:i,smallScreenContentOpen:a,smallScreenContentOnOpen:o,smallScreenContentOnClose:s,actions:u,smallScreenActions:d,smallScreenSize:f=425,zIndex:p,...m}=e,{cssProps:h,otherProps:g}=I(m),{className:_,style:v,...y}=g,b=qe(),x=typeof window<`u`&&b<f,S=typeof a==`boolean`,[C,w]=(0,c.useState)(!1),T=S?a:C,E=i??r,D=d??u,O=e=>{S||w(!0),o?.(e)},A=e=>{S||w(!1),s?.(e)},[j,M]=(0,c.useState)(!1),N=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!j)return;let e=e=>{N.current&&!N.current.contains(e.target)&&M(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[j]);let P={...v,...h,...p==null?{}:{zIndex:Number(p)}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`header`,{ref:t,className:k(`stratus-appBar`,_),style:P,...y,children:[(0,l.jsx)(`div`,{className:`stratus-appBar__header`,children:n}),!x&&r&&(0,l.jsx)(`div`,{className:`stratus-appBar__content`,children:r}),(0,l.jsxs)(`div`,{className:`stratus-appBar__actions`,children:[!x&&u,x&&(0,l.jsxs)(`div`,{className:`stratus-appBar__sm-actions`,children:[E&&(0,l.jsx)(`button`,{type:`button`,className:`stratus-appBar__menu-btn`,"aria-label":`Toggle AppBar menu content`,onClick:O,children:(0,l.jsx)(Ie,{size:24})}),D&&(0,l.jsxs)(`div`,{className:`stratus-appBar__popover-anchor`,ref:N,children:[(0,l.jsx)(`button`,{type:`button`,className:`stratus-appBar__menu-btn`,"aria-label":`Toggle AppBar menu actions`,onClick:()=>M(e=>!e),children:(0,l.jsx)(Le,{size:24})}),j&&(0,l.jsx)(`div`,{className:`stratus-appBar__popover`,children:D})]})]})]})]}),x&&E&&(0,l.jsx)(Je,{open:!!T,content:E,onClose:A})]})});Ye.displayName=`AppBar`;var Xe=(0,c.forwardRef)(function(e,t){let{children:n,content:r,variant:i=`default`,alignment:a=`top-right`,visible:o=!0,max:s=99,overlap:c,backgroundColor:u,color:d,bg:f,border:p,zIndex:m,...h}=e,{cssProps:g,otherProps:_}=I(h),{className:v,style:y,title:b,...x}=_,S=i===`dot`?null:typeof r==`number`&&r>s?`${s}+`:r,C={},w=u??f;return w&&(C.backgroundColor=w),d&&(C.color=d),p&&(C.border=p),m!=null&&(C.zIndex=Number(m)),(0,l.jsxs)(`div`,{ref:t,className:k(`stratus-badge-container`,v),style:{...y,...g},...x,children:[n,o&&(0,l.jsx)(`span`,{className:k(`stratus-badge`,i===`dot`&&`stratus-badge--dot`,`stratus-badge--${a}`,c===`circle`&&`stratus-badge--overlap-circle`),style:C,title:b,children:S})]})});Xe.displayName=`Badge`;var Ze=L((e,t)=>{let{as:n,children:r,disableRipple:i=!1,...a}=e,{cssProps:o,otherProps:s}=I(a),{className:c,style:u,...d}=s,f=n??`div`,p={...u,...o};return(0,l.jsxs)(f,{ref:t,role:`button`,tabIndex:0,className:k(`stratus-card__action-area`,c),style:p,...d,children:[r,!i&&(0,l.jsx)(R,{})]})}),Qe=L((e,t)=>{let{as:n,children:r,...i}=e,{cssProps:a,otherProps:o}=I(i),{className:s,style:c,...u}=o,d=n??`div`,f={...c,...a};return(0,l.jsx)(d,{ref:t,className:k(`stratus-card__actions`,s),style:f,...u,children:r})}),$e=L((e,t)=>{let{as:n,children:r,...i}=e,{cssProps:a,otherProps:o}=I(i),{className:s,style:c,...u}=o,d=n??`div`,f={...c,...a};return(0,l.jsx)(d,{ref:t,className:k(`stratus-card__content`,s),style:f,...u,children:r})}),et=L((e,t)=>{let{as:n,title:r,subtitle:i,startAdornment:a,endAdornment:o,children:s,...c}=e,{cssProps:u,otherProps:d}=I(c),{className:f,style:p,...m}=d,h=n??`div`,g={...p,...u};return(0,l.jsxs)(h,{ref:t,className:k(`stratus-card__header`,f),style:g,...m,children:[a&&(0,l.jsx)(`div`,{className:`stratus-card__header-start`,children:a}),(0,l.jsxs)(`div`,{className:`stratus-card__header-body`,children:[(0,l.jsx)(`span`,{className:`stratus-card__header-title`,children:r}),i&&(0,l.jsx)(`span`,{className:`stratus-card__header-subtitle`,children:i})]}),o&&(0,l.jsx)(`div`,{className:`stratus-card__header-end`,children:o}),s]})}),tt=L((e,t)=>{let{as:n,children:r,src:i,...a}=e,{cssProps:o,otherProps:s}=I(a),{className:c,style:u,...d}=s,f=n??`div`,p={...u,...o};return i&&(p.backgroundImage=`url(${i})`),(0,l.jsx)(f,{ref:t,className:k(`stratus-card__media`,c),style:p,...d,children:r})}),nt=L((e,t)=>{let{as:n,children:r,elevation:i=2,square:a=!1,...o}=e,{cssProps:s,otherProps:c}=I(o),{className:u,style:d,...f}=c;return(0,l.jsx)(n??`div`,{ref:t,className:k(`stratus-card`,i===0?`stratus-card--elevation-0`:`stratus-card--elevation-${i}`,a&&`stratus-card--square`,u),style:{...d,...s},...f,children:r})});function rt({disabled:e,onClose:t}){return(0,l.jsx)(`button`,{type:`button`,"aria-label":`Close chip`,className:`stratus-chip__close`,disabled:e,onClick:n=>{n.preventDefault(),n.stopPropagation(),!e&&t&&t(n)},children:(0,l.jsx)(Ee,{size:14})})}var it=(0,c.forwardRef)(function(e,t){let{children:n,variant:r=`default`,startAdornment:i,endAdornment:a,closable:o=!1,disabled:s=!1,disableRipple:u=!1,onClose:d,onClick:f,...p}=e,{cssProps:m,otherProps:h}=I(p),{className:g,style:_,...v}=h,y=typeof f==`function`&&!s,b=(0,c.useRef)(null),x=e=>{e.defaultPrevented||!y||u||e.button===0&&b.current?.triggerAt(e.clientX,e.clientY)},S=e=>{!s&&f&&f(e)},C=k(`stratus-chip`,`stratus-chip--${r}`,y&&`stratus-chip--clickable`,s&&`stratus-chip--disabled`,g),w={..._,...m};return(0,l.jsxs)(`div`,{ref:t,"aria-disabled":s||void 0,className:C,style:w,tabIndex:y?0:void 0,onClick:y?S:void 0,onPointerDown:y?x:void 0,onKeyDown:y?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),S(e))}:void 0,...v,children:[y&&!u&&(0,l.jsx)(R,{ref:b}),i&&(0,l.jsx)(`span`,{className:`stratus-chip__adornment stratus-chip__adornment--start`,children:i}),(0,l.jsx)(`span`,{className:`stratus-chip__text`,children:n}),a&&(0,l.jsx)(`span`,{className:`stratus-chip__adornment stratus-chip__adornment--end`,children:a}),o&&(0,l.jsx)(rt,{disabled:s,onClose:d})]})});it.displayName=`Chip`;var at=48,ot=L((e,t)=>{let{color:n,...r}=e,{cssProps:i,otherProps:a}=I(r),{as:o,className:s,size:c=48,style:u,thickness:d=4,value:f=0,variant:p=`indeterminate`,...m}=a,{Component:h,rootProps:g}=O(`span`,{as:o}),_=2*Math.PI*((at-d)/2),v=Math.max(0,Math.min(100,f)),y=p===`determinate`?{strokeDasharray:_.toFixed(3),strokeDashoffset:`${((100-v)/100*_).toFixed(3)}px`}:void 0,b={...u,...i,"--stratus-circular-progress-size":`${c}px`,...n?{"--stratus-circular-progress-color":n}:{}};return(0,l.jsx)(h,{ref:t,className:k(`stratus-circular-progress`,`stratus-circular-progress--${p}`,s),role:`progressbar`,"aria-valuenow":p===`determinate`?Math.round(v):void 0,"aria-valuemin":p===`determinate`?0:void 0,"aria-valuemax":p===`determinate`?100:void 0,style:b,...g,...m,children:(0,l.jsxs)(`svg`,{viewBox:`${at/2} ${at/2} ${at} ${at}`,"aria-hidden":!0,children:[(0,l.jsx)(`circle`,{className:`stratus-circular-progress__track`,cx:at,cy:at,r:(at-d)/2,fill:`none`,strokeWidth:d}),(0,l.jsx)(`circle`,{className:`stratus-circular-progress__indicator`,style:y,cx:at,cy:at,r:(at-d)/2,fill:`none`,strokeWidth:d,strokeLinecap:`round`})]})})});ot.displayName=`CircularProgress`;var st=L((e,t)=>{let{as:n,orientation:r=`horizontal`,size:i=1,color:a,...o}=e,{cssProps:s,otherProps:c}=I(o),{className:u,style:d,...f}=c;return(0,l.jsx)(n??`hr`,{ref:t,className:k(`stratus-divider`,`stratus-divider--${r}`,u),style:{...d,...s,"--stratus-divider-size":`${i}px`,...a?{"--stratus-divider-color":a}:{}},...f})});st.displayName=`Divider`;var ct=0,lt=``;function ut(e){(0,c.useEffect)(()=>{if(!(!e||typeof document>`u`))return ct===0&&(lt=document.body.style.overflow,document.body.style.overflow=`hidden`),ct+=1,()=>{--ct,ct===0&&(document.body.style.overflow=lt)}},[e])}var dt=[`a[href]`,`area[href]`,`button:not([disabled])`,`input:not([disabled]):not([type='hidden'])`,`select:not([disabled])`,`textarea:not([disabled])`,`iframe`,`object`,`embed`,`[tabindex]:not([tabindex='-1'])`,`[contenteditable='true']`,`audio[controls]`,`video[controls]`,`details > summary`].join(`,`);function ft(e){return Array.from(e.querySelectorAll(dt)).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`&&(e.offsetWidth>0||e.offsetHeight>0||e.tagName===`IFRAME`))}function pt(e,t,{initialFocus:n=!0,restoreFocus:r=!0}={}){(0,c.useEffect)(()=>{if(!t)return;let i=e.current;if(!i)return;let a=document.activeElement;if(n){let e=ft(i)[0]??i;e===i&&!i.hasAttribute(`tabindex`)&&i.setAttribute(`tabindex`,`-1`),e.focus({preventScroll:!0})}let o=e=>{if(e.key!==`Tab`)return;let t=ft(i);if(t.length===0){e.preventDefault(),i.focus({preventScroll:!0});return}let n=t[0],r=t[t.length-1],a=document.activeElement;e.shiftKey?(a===n||!i.contains(a))&&(e.preventDefault(),r.focus({preventScroll:!0})):a===r&&(e.preventDefault(),n.focus({preventScroll:!0}))};return document.addEventListener(`keydown`,o,!0),()=>{document.removeEventListener(`keydown`,o,!0),r&&a?.isConnected&&a.focus({preventScroll:!0})}},[t,e,n,r])}var mt=H({name:`fullscreen`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M7 10H5V5h5v2H7zm-2 4h2v3h3v2H5zm12 3h-3v2h5v-5h-2zM14 7V5h5v5h-2V7z`}),ht=H({name:`fullscreen_exit`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M5 8h3V5h2v5H5zm3 8H5v-2h5v5H8zm6 3h2v-3h3v-2h-5zm2-14v3h3v2h-5V5z`});function gt({header:e,headerId:t,hasStringHeader:n,closable:r,fullScreen:i,isFullscreen:a,isTemporary:o,onToggleFullscreen:s,onClose:c}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`stratus-drawer__header`,children:[(0,l.jsx)(`div`,{id:n?t:void 0,className:`stratus-drawer__header-inner`,children:e}),i&&o&&(0,l.jsx)(`button`,{type:`button`,"aria-label":a?`Exit fullscreen`:`Fullscreen`,className:`stratus-drawer__header-btn`,onClick:s,children:a?(0,l.jsx)(ht,{size:20}):(0,l.jsx)(mt,{size:20})}),r&&(0,l.jsx)(`button`,{type:`button`,"aria-label":`Close drawer`,className:`stratus-drawer__header-btn`,onClick:e=>c?.(e),children:(0,l.jsx)(Ee,{size:20})})]}),(0,l.jsx)(`hr`,{className:`stratus-drawer__divider`})]})}var _t=(0,c.forwardRef)(function(e,t){let{open:n=!1,variant:r=`temporary`,placement:i=`left`,smallScreenSize:a=425,header:o,closable:s=!1,fullScreen:d=!1,initialFullScreen:f=!1,keepMounted:p=!1,transitionDuration:m=225,hideBackdrop:h=!1,disablePortal:g=!1,children:_,onClose:v,width:y=240,...b}=e,{cssProps:x,otherProps:S}=I(b),{className:C,style:w,...T}=S,E=qe(),D=r===`responsive`?E<a?`temporary`:`permanent`:r,O=D===`temporary`,A=D===`persistent`,j=D===`permanent`,[M,N]=(0,c.useState)(f),P=(0,c.useCallback)(()=>N(e=>!e),[]),[F,L]=(0,c.useState)(n),[R,z]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(n)L(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>z(!0))});else{z(!1);let e=setTimeout(()=>{p||L(!1)},O||A?m:0);return()=>clearTimeout(e)}},[n,p,m,O,A]);let B=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!n||!O)return;let e=e=>{e.key===`Escape`&&v?.(e)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n,O,v]),pt(B,n&&O),ut(n&&O);let V=(0,c.useId)(),H=typeof o==`string`||typeof o==`number`,U=Array.isArray(y)?(E<a?y[0]:y[1])??y[0]:y,ee=typeof U==`number`?`${U}px`:U,te=i===`left`||i===`right`,ne={"--stratus-drawer-duration":`${m}ms`,...te?{width:M?`100%`:ee}:{},...w,...x};if(!(j||F||p))return null;let re=o!=null||s||d?(0,l.jsx)(gt,{header:o,headerId:V,hasStringHeader:H,closable:s,fullScreen:d,isFullscreen:M,isTemporary:O,onToggleFullscreen:P,onClose:v}):null,W=(0,l.jsxs)(`div`,{ref:e=>{B.current=e,typeof t==`function`?t(e):t&&(t.current=e)},role:O?`dialog`:void 0,"aria-modal":O&&n?!0:void 0,"aria-labelledby":O&&H?V:void 0,tabIndex:O?-1:void 0,className:k(`stratus-drawer`,`stratus-drawer--${D}`,`stratus-drawer--${i}`,R&&n||j?`stratus-drawer--open`:`stratus-drawer--closed`,M&&`stratus-drawer--fullscreen`,C),style:ne,...T,children:[re,_]});if(j||A)return(0,l.jsx)(`div`,{className:`stratus-drawer-container`,children:W});let G=(0,l.jsxs)(l.Fragment,{children:[!h&&(0,l.jsx)(`div`,{className:k(`stratus-drawer-backdrop`,R&&n&&`stratus-drawer-backdrop--open`),style:{"--stratus-drawer-duration":`${m}ms`},onClick:e=>v?.(e),"aria-hidden":!0}),W]});return g?G:(0,u.createPortal)(G,document.body)});_t.displayName=`Drawer`;var vt={info:()=>(0,l.jsx)(Oe,{size:20,color:`currentColor`}),success:()=>(0,l.jsx)(Te,{size:20,color:`currentColor`}),warning:()=>(0,l.jsx)(ke,{size:20,color:`currentColor`}),error:()=>(0,l.jsx)(De,{size:20,color:`currentColor`})};function yt({severity:e,message:t,actions:n,onClose:r}){return(0,l.jsxs)(l.Fragment,{children:[e&&(0,l.jsx)(`span`,{className:`stratus-notification__icon`,children:vt[e]()}),(0,l.jsx)(`div`,{className:`stratus-notification__content`,children:t}),n&&(0,l.jsx)(`div`,{className:`stratus-notification__actions`,children:n}),r&&(0,l.jsx)(`button`,{type:`button`,className:`stratus-notification__close`,"aria-label":`Close notification`,onClick:r,children:(0,l.jsx)(Ee,{size:16})})]})}var bt=(0,c.forwardRef)(function(e,t){let{open:n,message:r,actions:i,autoHide:a=!0,autoHideDuration:o=6e3,showAutoHideLoader:s=!0,closeOnClickOutside:d=!1,placement:f=`bottom-start`,disablePortal:p=!1,onClose:m,severity:h,children:g,..._}=e,{cssProps:v,otherProps:y}=I(_),{className:b,style:x,...S}=y,C=(0,c.useRef)(null),w=(0,c.useRef)(null),T=(0,c.useRef)(0),E=(0,c.useRef)(o),D=(0,c.useCallback)(()=>{w.current&&=(clearTimeout(w.current),null)},[]),O=(0,c.useRef)(m);(0,c.useEffect)(()=>{O.current=m},[m]);let A=(0,c.useCallback)(e=>{D(),E.current=e,T.current=Date.now(),w.current=setTimeout(()=>{O.current?.()},e)},[D]);(0,c.useEffect)(()=>(n&&a?A(o):D(),D),[n,a,o,A,D]);let[j,M]=(0,c.useState)(!1),N=()=>{a&&(D(),M(!0))},P=()=>{if(!a||!n)return;let e=Date.now()-T.current,t=Math.max(0,E.current-e);t>0&&A(t),M(!1)};if((0,c.useEffect)(()=>{if(!n||!d)return;let e=e=>{C.current&&!C.current.contains(e.target)&&m?.()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n,d,m]),!n)return null;let F=(0,l.jsxs)(`div`,{ref:e=>{C.current=e,typeof t==`function`?t(e):t&&(t.current=e)},className:k(`stratus-notification`,h?`stratus-notification--${h}`:g?void 0:`stratus-notification--default`,b),style:{...x,...v},onMouseEnter:N,onMouseLeave:P,...S,children:[g??(0,l.jsx)(yt,{severity:h,message:r,actions:i,onClose:m}),a&&s&&(0,l.jsx)(`div`,{className:`stratus-notification__progress-wrap`,children:(0,l.jsx)(`div`,{className:k(`stratus-notification__progress`,j&&`stratus-notification__progress--paused`),style:{animationDuration:`${o}ms`}})})]}),L=(0,l.jsx)(`div`,{className:k(`stratus-notification-container`,`stratus-notification-container--${f}`),children:F});return p?L:(0,u.createPortal)(L,document.body)}),xt=0,St=new Map;function Ct(){let e=document.getElementById(`stratus-notifications`);return e||(e=document.createElement(`div`),e.id=`stratus-notifications`,document.body.appendChild(e)),e}function wt(e){let t=St.get(e);t&&(t.cleanup(),t.container.remove(),St.delete(e));let n=document.getElementById(`stratus-notifications`);n&&n.children.length===0&&n.remove()}function Tt(e,t){let n=e.key??`stratus-notif-${++xt}`,r=e.placement??`bottom-start`,i=e.autoHideDuration??6e3,a=e.showAutoHideLoader??!0;wt(n);let o=Ct(),s=document.createElement(`div`);s.setAttribute(`data-notification-id`,n),s.style.position=`fixed`,s.style.zIndex=String(e.zIndex??1400),s.style.pointerEvents=`none`;let c=r.split(`-`),l=c[0],u=c[1];l===`top`?(s.style.top=`16px`,s.style.bottom=`auto`):(s.style.bottom=`16px`,s.style.top=`auto`),u===`start`?(s.style.left=`16px`,s.style.right=`auto`):u===`end`?(s.style.right=`16px`,s.style.left=`auto`):(s.style.left=`50%`,s.style.transform=`translateX(-50%)`),o.appendChild(s);let d=document.createElement(`div`);if(d.className=k(`stratus-notification`,t?`stratus-notification--${t}`:`stratus-notification--default`),d.style.pointerEvents=`auto`,e.maxWidth&&(d.style.maxWidth=typeof e.maxWidth==`number`?`${e.maxWidth}px`:e.maxWidth),t){let e=document.createElement(`span`);e.className=`stratus-notification__icon`,e.innerHTML=Et(t),d.appendChild(e)}let f=document.createElement(`div`);f.className=`stratus-notification__content`,f.textContent=String(e.message??``),d.appendChild(f);let p=document.createElement(`button`);p.className=`stratus-notification__close`,p.type=`button`,p.setAttribute(`aria-label`,`Close notification`),p.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>`,p.addEventListener(`click`,()=>wt(n)),d.appendChild(p);let m=null;if(a){let e=document.createElement(`div`);e.className=`stratus-notification__progress-wrap`,m=document.createElement(`div`),m.className=`stratus-notification__progress`,m.style.width=`100%`,e.appendChild(m),d.appendChild(e)}s.appendChild(d);let h=Date.now(),g=i,_=null,v=null;function y(){if(!m)return;let e=Date.now()-h,t=Math.max(0,(g-e)/i*100);m.style.width=`${t}%`,t>0&&(v=requestAnimationFrame(y))}function b(e){g=e,h=Date.now(),_=setTimeout(()=>wt(n),e),m&&(v=requestAnimationFrame(y))}function x(){_&&clearTimeout(_),v&&cancelAnimationFrame(v),_=null,v=null;let e=Date.now()-h;g=Math.max(0,g-e)}d.addEventListener(`mouseenter`,x),d.addEventListener(`mouseleave`,()=>{g>0&&b(g)}),b(i),St.set(n,{container:s,cleanup:()=>{_&&clearTimeout(_),v&&cancelAnimationFrame(v)}})}function Et(e){switch(e){case`info`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>`;case`success`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>`;case`warning`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>`;case`error`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>`}}var Dt=bt;Dt.show=e=>Tt(e),Dt.info=e=>Tt(e,`info`),Dt.success=e=>Tt(e,`success`),Dt.warning=e=>Tt(e,`warning`),Dt.error=e=>Tt(e,`error`),Dt.displayName=`Notification`;function Ot({footer:e,okText:t,cancelText:n,onOk:r,onCancel:i}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`hr`,{className:`stratus-modal__divider`}),(0,l.jsx)(`div`,{className:`stratus-modal__footer`,children:e??(0,l.jsxs)(l.Fragment,{children:[typeof i==`function`&&(0,l.jsx)(z,{variant:typeof r==`function`?`ghost`:`outlined`,onClick:i,children:n}),typeof r==`function`&&(0,l.jsx)(z,{variant:`contained`,onClick:r,children:t})]})})]})}function kt(){return(0,l.jsx)(Ee,{size:20})}var At=(0,c.forwardRef)(function(e,t){let{open:n,showClose:r=!0,closeIcon:i,title:a,footer:o,okText:s=`Ok`,cancelText:d=`Cancel`,fullScreen:f=!1,keepMounted:p=!1,disablePortal:m=!1,zIndex:h,backdropProps:g,onClose:_,onOk:v,onCancel:y,children:b,...x}=e,S=g?.closable??!1,C=g?.invisible??!1,{cssProps:w,otherProps:T}=I(x),{className:E,style:D,...O}=T,[A,j]=(0,c.useState)(n),[M,N]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(n)j(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>N(!0))});else{N(!1);let e=setTimeout(()=>{p||j(!1)},200);return()=>clearTimeout(e)}},[n,p]),(0,c.useEffect)(()=>{if(!n||!S)return;let e=e=>{e.key===`Escape`&&_?.(e)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n,S,_]),ut(n);let P=(0,c.useRef)(null);pt(P,n);let F=(0,c.useId)(),L=typeof a==`string`||typeof a==`number`,R=e=>{e.target===e.currentTarget&&(g?.onClick?.(e),S&&_?.(e))};if(!(A||p))return null;let B=a!=null||r,V=o!=null||typeof v==`function`||typeof y==`function`,H={...D,...w},U=(0,l.jsx)(`div`,{className:k(`stratus-modal-backdrop`,M&&n&&`stratus-modal-backdrop--open`,C&&`stratus-modal-backdrop--invisible`),style:h==null?void 0:{"--stratus-modal-z":Number(h)},onClick:R,"aria-hidden":!n,children:(0,l.jsx)(`div`,{ref:e=>{P.current=e,typeof t==`function`?t(e):t&&(t.current=e)},role:`dialog`,"aria-modal":!0,"aria-labelledby":L?F:void 0,tabIndex:-1,className:k(`stratus-modal`,f&&`stratus-modal--fullscreen`,E),style:H,...O,children:(0,l.jsxs)(`div`,{className:`stratus-modal__container`,children:[B&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`stratus-modal__header`,children:[a!=null&&(0,l.jsx)(`span`,{id:L?F:void 0,className:`stratus-modal__header-title`,children:a}),r&&(0,l.jsx)(z,{variant:`ghost`,"aria-label":`Close modal`,className:`stratus-modal__header-close`,onClick:e=>_?.(e),startAdornment:i??(0,l.jsx)(kt,{})})]}),(0,l.jsx)(`hr`,{className:`stratus-modal__divider`})]}),(0,l.jsx)(`div`,{className:k(`stratus-modal__content`,f&&`stratus-modal__content--fullscreen`),children:(0,l.jsx)(`div`,{className:`stratus-modal__content-inner`,children:b})}),V&&(0,l.jsx)(Ot,{footer:o,okText:s,cancelText:d,onOk:v,onCancel:y})]})})});return m?U:(0,u.createPortal)(U,document.body)});At.displayName=`Modal`;function jt({size:e=48}){return(0,l.jsxs)(`svg`,{className:`stratus-screen-loader__star-progress`,role:`progressbar`,"aria-label":`Loading`,"aria-valuetext":`Loading`,width:e,height:e*1.2,viewBox:`0 0 40 48`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,preserveAspectRatio:`xMidYMid meet`,style:e?{"--stratus-screen-loader-size":`${e}px`}:void 0,children:[(0,l.jsx)(`path`,{d:`M32.756 34.6798L29.482 36.5817C29.4139 36.6219 29.3295 36.6227 29.2606 36.5829L25.9476 34.7151C25.7975 34.6306 25.7967 34.4149 25.9456 34.3284L29.2397 32.4256C29.3077 32.3858 29.3914 32.3858 29.4603 32.4248L32.754 34.2931C32.9033 34.3784 32.9041 34.5929 32.756 34.6798Z`}),(0,l.jsx)(`path`,{d:`M25.9596 45.4706L22.6655 43.5867C22.5966 43.5469 22.554 43.4744 22.554 43.396V41.4289V39.5922C22.5519 39.4204 22.7381 39.3109 22.8878 39.397L26.1819 41.2981C26.25 41.3379 26.2926 41.4104 26.2934 41.4896V43.4268V45.2762C26.2947 45.4472 26.1085 45.5559 25.9596 45.4706Z`}),(0,l.jsx)(`path`,{d:`M12.3022 47.7037V44.9795V42.6544C12.3022 42.5495 12.3576 42.4515 12.4482 42.3986L14.1262 41.4062L16.8143 39.8188C17.0119 39.7019 17.2617 39.8442 17.2625 40.0739L17.2633 42.7627V45.1456C17.2633 45.251 17.2079 45.3486 17.1165 45.4015L12.7496 47.9587C12.552 48.0748 12.3031 47.9325 12.3022 47.7037Z`}),(0,l.jsx)(`path`,{d:`M0.221343 34.2106L6.76939 30.4056C6.90636 30.326 7.07449 30.3256 7.21227 30.4023L13.8378 34.1401C14.138 34.3095 14.14 34.7413 13.8415 34.9131L7.25492 38.7182C7.11795 38.7977 6.94941 38.7985 6.81204 38.7206L0.225854 34.9836C-0.0734986 34.8139 -0.075549 34.3833 0.221343 34.2106Z`}),(0,l.jsx)(`path`,{d:`M6.03876 9.125L16.9237 15.5151C17.1513 15.6484 17.2903 15.8912 17.2903 16.1549V28.8331C17.2903 29.4076 16.665 29.7647 16.1704 29.4728L5.28546 23.0264C5.05869 22.8919 4.92008 22.6479 4.9209 22.3855V9.76307C4.92254 9.1902 5.54503 8.83467 6.03876 9.125Z`}),(0,l.jsx)(`path`,{d:`M39.6262 1.07261V11.7603V19.3368C39.627 19.7178 39.4265 20.0709 39.0988 20.2644L31.4145 24.8195L23.3545 29.5964C22.6385 30.0192 21.7339 29.5029 21.7339 28.6717V10.3259C21.7339 9.94495 21.9356 9.5927 22.2641 9.39955L38.008 0.149533C38.7232 -0.270381 39.6241 0.24385 39.6262 1.07261Z`})]})}var Mt=L((e,t)=>{let{cssProps:n,otherProps:r}=I(e),{as:i,className:a,children:o,loader:s,sizeLoader:c,title:d,backdropInvisible:f=!1,container:p,disablePortal:m=!1,zIndex:h,style:g,..._}=r,{Component:v,rootProps:y}=O(`div`,{as:i}),b={...g,...n,...h==null?{}:{"--stratus-screen-loader-z":String(h)}},x=(0,l.jsx)(v,{ref:t,className:k(`stratus-screen-loader`,f&&`stratus-screen-loader--invisible`,a),role:`status`,"aria-live":`polite`,"aria-busy":`true`,style:Object.keys(b).length?b:void 0,...y,..._,children:(0,l.jsxs)(`div`,{className:`stratus-screen-loader__content`,children:[s??(0,l.jsx)(jt,{size:c}),d!=null&&(0,l.jsx)(ve,{className:`stratus-screen-loader__title`,variant:`h3`,as:`div`,children:d}),o!=null&&(0,l.jsx)(`div`,{className:`stratus-screen-loader__children`,children:o})]})});return m?x:typeof document>`u`?null:(0,u.createPortal)(x,p??document.body)});Mt.displayName=`ScreenLoader`;function Nt(){return(0,l.jsx)(Ee,{size:16})}var Pt=(0,c.forwardRef)(function(e,t){let{children:n,className:r,content:i,title:a,showClose:o=!1,closeIcon:s,footer:u,placement:d=`bottom`,trigger:f=`click`,open:p,arrow:m=!0,closeOnClickOutside:h=!0,tooltipRef:g,zIndex:_=1400,maxWidth:v=`300px`,style:y,keepMounted:b=!1,disablePortal:x=!1,onOpen:S,onClose:C}=e,w=(0,c.useRef)(null),T=g??w,E=a!=null||o,D=(0,l.jsxs)(`div`,{className:`stratus-popover__container`,children:[E&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`stratus-popover__header`,children:[a!=null&&(0,l.jsx)(`span`,{className:`stratus-popover__header-title`,children:a}),o&&(0,l.jsx)(z,{variant:`ghost`,"aria-label":`Close popover`,className:`stratus-popover__header-close`,onClick:()=>{T&&`current`in T&&T.current?.close()},children:s??(0,l.jsx)(Nt,{})})]}),(0,l.jsx)(`hr`,{className:`stratus-popover__divider`})]}),(0,l.jsx)(`div`,{className:`stratus-popover__content`,children:i}),u!=null&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`hr`,{className:`stratus-popover__divider`}),(0,l.jsx)(`div`,{className:`stratus-popover__footer`,children:u})]})]});return(0,l.jsx)(re,{ref:t,className:k(`stratus-popover`,r),content:D,placement:d,trigger:f,open:p,arrow:m,closeOnClickOutside:h,tooltipRef:T,zIndex:_,maxWidth:v,fontSize:`1rem`,style:y,keepMounted:b,disablePortal:x,onOpen:S,onClose:C,children:n})});Pt.displayName=`Popover`;function Ft({helperText:e,helperIcon:t}){return e?(0,l.jsxs)(`div`,{className:`stratus-input__helper`,children:[t&&(0,l.jsx)(`span`,{className:`stratus-input__helper-icon`,children:t}),(0,l.jsx)(`span`,{children:e})]}):null}function It({label:e,meta:t,htmlFor:n}){return!e&&!t?null:(0,l.jsxs)(`div`,{className:`stratus-input__label-row`,children:[e&&(0,l.jsx)(`label`,{className:`stratus-input__label`,htmlFor:n,children:e}),t&&(0,l.jsx)(`span`,{className:`stratus-input__meta`,children:t})]})}var Lt=(0,c.forwardRef)(function(e,t){let{children:n,className:r,style:i,inputRef:a,inputProps:o={},type:s=`text`,variant:u=`default`,label:d,meta:f,helperText:p,helperIcon:m,value:h,defaultValue:g,placeholder:_,startAdornment:v,endAdornment:y,outlineWidth:b,multiple:x=!1,compact:S=!1,fullWidth:C=!1,forceFocus:w=!1,disabled:T=!1,onChange:E,onFocus:D,onBlur:O,...A}=e,{cssProps:j,otherProps:M}=I(A),N=(0,c.useId)(),P=o.id??N,[F,L]=(0,c.useState)(g??``),R=h!==void 0,z=R?h:F,B=(0,c.useRef)(null),V=(0,c.useCallback)(e=>{B.current=e,a&&(a.current=e)},[a]),H=e=>{let t=e.target.value;R||L(t),E?.(t,e)},U=e=>{D?.(String(z),e)},ee=e=>{O?.(String(z),e)},te=k(`stratus-input`,`stratus-input--${u}`,S&&`stratus-input--compact`,C&&`stratus-input--full-width`,T&&`stratus-input--disabled`,w&&`stratus-input--force-focus`,r),ne={...b?{"--stratus-input-outline-w":b}:{},...i,...j},re=x?`textarea`:`input`;return(0,l.jsxs)(`div`,{ref:t,className:te,style:Object.keys(ne).length?ne:void 0,...M,children:[(0,l.jsx)(It,{label:d,meta:f,htmlFor:P}),(0,l.jsxs)(`div`,{className:`stratus-input__wrapper`,children:[v&&(0,l.jsx)(`span`,{className:`stratus-input__start-adornment`,children:v}),n??(0,l.jsx)(re,{...o,ref:V,id:P,type:x?void 0:s,className:k(`stratus-input__input`,x&&`stratus-input__input--textarea`,o.className),value:z,placeholder:_,disabled:T,onChange:H,onFocus:U,onBlur:ee}),y&&(0,l.jsx)(`span`,{className:`stratus-input__end-adornment`,children:y})]}),(0,l.jsx)(Ft,{helperText:p,helperIcon:m})]})}),Rt=(0,c.forwardRef)(function(e,t){let{inputRef:n,inputProps:r={},defaultChecked:i=!1,checked:a,variant:o=`default`,label:s,labelPlacement:u=`right`,color:d=`primary`,compact:f=!1,disabled:p=!1,disableRipple:m=!1,onChange:h,...g}=e,{cssProps:_,otherProps:v}=I(g),{className:y,style:b,...x}=v,[S,C]=(0,c.useState)(i),w=a!==void 0,T=w?a:S,E=(0,c.useRef)(null),D=(0,c.useCallback)(e=>{E.current=e,n&&(n.current=e)},[n]),O=e=>{w||C(e.target.checked),h?.(e)},A=k(`stratus-switch`,o===`small`&&`stratus-switch--small`,`stratus-switch--${d}`,f&&`stratus-switch--compact`,p&&`stratus-switch--disabled`,m&&`stratus-switch--no-ripple`,y),j={...b,..._},M=s?(0,l.jsx)(`span`,{className:`stratus-switch__label`,children:s}):null;return(0,l.jsxs)(`label`,{ref:t,className:A,style:Object.keys(j).length?j:void 0,...x,children:[u===`left`&&M,(0,l.jsx)(`input`,{...r,ref:D,type:`checkbox`,role:`switch`,className:`stratus-switch__input`,checked:T,disabled:p,onChange:O}),(0,l.jsx)(`span`,{className:`stratus-switch__track-wrapper`,children:(0,l.jsx)(`span`,{className:`stratus-switch__track`,children:(0,l.jsx)(`span`,{className:`stratus-switch__thumb`})})}),u===`right`&&M]})});function zt({size:e}){return(0,l.jsx)(`svg`,{className:`stratus-checkbox__icon stratus-checkbox__icon--unchecked`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`var(--stratus-surface, #fff)`,stroke:`currentColor`,strokeWidth:`2`})})}function Bt({size:e}){return(0,l.jsxs)(`svg`,{className:`stratus-checkbox__icon stratus-checkbox__icon--checked`,width:e,height:e,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`currentColor`}),(0,l.jsx)(`path`,{d:`M9 12l2 2 4-4`,stroke:`white`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Vt({size:e}){return(0,l.jsxs)(`svg`,{className:`stratus-checkbox__icon stratus-checkbox__icon--indeterminate`,width:e,height:e,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`currentColor`}),(0,l.jsx)(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`,stroke:`white`,strokeWidth:`2`,strokeLinecap:`round`})]})}var Ht=(0,c.forwardRef)(function(e,t){let{className:n,style:r,inputRef:i,inputProps:a={},defaultChecked:o=!1,checked:s,label:u,labelPlacement:d=`right`,color:f=`primary`,indeterminate:p=!1,uncheckedIcon:m,checkedIcon:h,indeterminateIcon:g,iconSize:_=24,compact:v=!1,disabled:y=!1,disableRipple:b=!1,onChange:x,...S}=e,{cssProps:C,otherProps:w}=I(S),[T,E]=(0,c.useState)(o),D=s!==void 0,O=D?s:T,A=(0,c.useRef)(null),j=(0,c.useCallback)(e=>{A.current=e,i&&(i.current=e)},[i]);(0,c.useEffect)(()=>{A.current&&(A.current.indeterminate=p)},[p]);let M=e=>{D||E(e.target.checked),x?.(e)},N=(0,c.useRef)(null),P=e=>{b||y||e.button===0&&N.current?.triggerAt(e.clientX,e.clientY)},F;F=p?g??(0,l.jsx)(Vt,{size:_}):O?h??(0,l.jsx)(Bt,{size:_}):m??(0,l.jsx)(zt,{size:_});let L=k(`stratus-checkbox`,`stratus-checkbox--${f}`,v&&`stratus-checkbox--compact`,y&&`stratus-checkbox--disabled`,b&&`stratus-checkbox--no-ripple`,n),z={...r,...C},B=u?(0,l.jsx)(`span`,{className:`stratus-checkbox__label`,children:u}):null;return(0,l.jsxs)(`label`,{ref:t,className:L,style:Object.keys(z).length?z:void 0,onPointerDown:P,...w,children:[d===`left`&&B,(0,l.jsx)(`input`,{...a,ref:j,type:`checkbox`,className:`stratus-checkbox__input`,checked:O,disabled:y,onChange:M,"data-indeterminate":p||void 0}),(0,l.jsxs)(`span`,{className:`stratus-checkbox__icon-wrapper`,children:[(0,l.jsx)(R,{ref:N,disabled:b||y}),F]}),d===`right`&&B]})});function Ut(){return(0,l.jsx)(`span`,{className:`stratus-select__chevron`,children:(0,l.jsx)(`svg`,{width:`10`,height:`5`,viewBox:`0 0 10 5`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M0 0l5 5 5-5z`})})})}function Wt({onClear:e}){return(0,l.jsx)(`button`,{type:`button`,className:`stratus-select__clear`,onClick:e,"aria-label":`Clear`,children:`✕`})}function Gt({helperText:e,helperIcon:t}){return e?(0,l.jsxs)(`div`,{className:`stratus-select__helper`,children:[t&&(0,l.jsx)(`span`,{className:`stratus-input__helper-icon`,children:t}),(0,l.jsx)(`span`,{children:e})]}):null}function Kt({label:e,meta:t,htmlFor:n}){return!e&&!t?null:(0,l.jsxs)(`div`,{className:`stratus-select__label-row`,children:[e&&(0,l.jsx)(`label`,{className:`stratus-select__label`,htmlFor:n,children:e}),t&&(0,l.jsx)(`span`,{className:`stratus-select__meta`,children:t})]})}function qt(e){return e==null||e===``?[]:Array.isArray(e)?e.filter(e=>e!==``&&e!=null):[e]}function Jt(e){let t=[];for(let n of e)n.type===`optgroup`&&n.options?t.push(...Jt(n.options)):t.push(n);return t}function Yt(e){return String(e.value??e.label)}function Xt(e){let t=[];return c.Children.forEach(e,e=>{if((0,c.isValidElement)(e)){if(e.type===`option`){let{value:n,disabled:r,children:i}=e.props;t.push({label:String(i??``),value:n===void 0?String(i??``):n,disabled:!!r})}else if(e.type===`optgroup`){let{label:n,disabled:r,children:i}=e.props;t.push({type:`optgroup`,label:String(n??``),disabled:!!r,options:Xt(i)})}}}),t}function Zt({tags:e,infield:t,selectedIds:n,allFlat:r,tagMaxCount:i,tagMaxCountPlaceholder:a,selectedLabel:o,onTagRemove:s}){if(e&&t){if(n.length===0)return null;let e=r.filter(e=>n.map(String).includes(String(Yt(e))));return i!==void 0&&e.length>i?(0,l.jsx)(`div`,{className:`stratus-select__tags`,children:(0,l.jsx)(`span`,{className:`stratus-select__tag`,children:typeof a==`function`?a(e.length):a??`${e.length} selected`})}):(0,l.jsx)(`div`,{className:`stratus-select__tags`,children:e.map(e=>(0,l.jsxs)(`span`,{className:`stratus-select__tag`,children:[e.label,(0,l.jsx)(`button`,{type:`button`,className:`stratus-select__tag-close`,onClick:t=>s(Yt(e),t),children:`✕`})]},Yt(e)))})}return t?(0,l.jsx)(`span`,{className:`stratus-select__selected-label`,children:typeof o==`function`?o(n.length,r.length):`${n.length}/${r.length} ${o}`}):null}var Qt=(0,c.forwardRef)(function(e,t){let{children:n,className:r,style:i,selectRef:a,inputRef:o,options:s=[],value:u,defaultValue:d,inputValue:f,variant:p=`default`,label:m,meta:h,placeholder:g,helperText:_,helperIcon:v,startAdornment:y,endAdornment:b,allowClear:x=!0,multiple:S=!1,expandable:C=!1,infield:w=!0,tags:T=!1,tagMaxCount:E,tagMaxCountPlaceholder:D,selectedLabel:O=`Selected`,filterOption:A=!0,noOptionsText:j=`No Data`,hideDropdownWhenEmpty:M=!1,persistInputText:N=!1,compact:P=!1,fullWidth:F=!1,disabled:L=!1,onSelect:R,onDeselect:z,onClear:B,onChange:V,itemGroupRenderer:H,itemRenderer:U,...ee}=e,{cssProps:te,otherProps:ne}=I(ee),re=(0,c.useId)(),[W,G]=(0,c.useState)(!1),[ie,ae]=(0,c.useState)(()=>qt(d)),[oe,se]=(0,c.useState)(``),[ce,le]=(0,c.useState)(-1),[ue,de]=(0,c.useState)(new Set),fe=u!==void 0,K=fe?qt(u):ie,pe=f===void 0?oe:f,me=(0,c.useRef)(null),he=(0,c.useRef)(null),ge=(0,c.useRef)(null),_e=(0,c.useCallback)(e=>{me.current=e,o&&(o.current=e)},[o]);(0,c.useImperativeHandle)(a,()=>({open:()=>{G(!0),me.current?.focus()},close:()=>G(!1)}),[]),(0,c.useEffect)(()=>{if(!W)return;let e=e=>{he.current&&!he.current.contains(e.target)&&(G(!1),se(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[W]);let ve=(0,c.useMemo)(()=>Xt(n),[n]),ye=(0,c.useMemo)(()=>s.length>0?s:ve,[s,ve]),be=(0,c.useMemo)(()=>Jt(ye),[ye]),xe=(0,c.useCallback)(e=>!A||!pe?!0:typeof A==`function`?A(e,pe,K.map(String)):e.label.toLowerCase().includes(pe.toLowerCase()),[A,pe,K]),Se=(0,c.useMemo)(()=>be.filter(e=>!e.disabled&&xe(e)),[be,xe]);(0,c.useEffect)(()=>{le(-1)},[W,Se.length]),(0,c.useEffect)(()=>{if(ce<0||!ge.current)return;let e=Se[ce];if(!e)return;let t=String(e.value??e.label);ge.current.querySelector(`[data-option-id="${CSS.escape(t)}"]`)?.scrollIntoView({block:`nearest`})},[ce,Se]);let Ce=(0,c.useMemo)(()=>S||K.length===0?``:be.find(e=>String(e.value??e.label)===String(K[0]))?.label??String(K[0]),[S,K,be]),we=(0,c.useCallback)((e,t)=>{let n=Yt(e),r=K.map(String).includes(String(n)),i;if(S)if(r){i=K.filter(e=>String(e)!==String(n)),fe||ae(i);let r={selectedValue:i,deselectedValue:e.value??e.label,options:be.filter(e=>i.map(String).includes(String(Yt(e))))};z?.(r,t)}else{i=[...K,e.value??e.label],fe||ae(i);let n={selectedValue:i,options:be.filter(e=>i.map(String).includes(String(Yt(e))))};R?.(n,t)}else{i=[e.value??e.label],fe||ae(i),G(!1),se(``);let n={selectedValue:e.value??e.label,options:[e]};R?.(n,t)}},[K,S,fe,be,R,z]),Te=(0,c.useCallback)(e=>{if(!L)switch(e.key){case`ArrowDown`:e.preventDefault(),W?le(e=>e<Se.length-1?e+1:0):G(!0);break;case`ArrowUp`:e.preventDefault(),W&&le(e=>e>0?e-1:Se.length-1);break;case`Enter`:if(e.preventDefault(),W&&ce>=0){let t=Se[ce];t&&we(t,e)}else W||G(!0);break;case`Escape`:W&&(e.preventDefault(),G(!1));break}},[L,W,ce,Se,we]),Ee=(0,c.useCallback)(e=>{e.stopPropagation(),fe||ae([]),se(``),B?.(e)},[fe,B]),De=(0,c.useCallback)((e,t)=>{t.stopPropagation();let n=be.find(t=>String(Yt(t))===String(e));n&&we(n,t)},[be,we]),Oe=(0,c.useCallback)(e=>{de(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ke=(0,c.useCallback)(e=>{if(!A)return;let t=e.target.value;se(t),V?.(t),W||G(!0)},[A,W,V]);function Ae(e){let t=[];for(let n of e){if(n.type===`optgroup`&&n.options){let e=Ae(n.options).filter(Boolean);if(e.length===0)continue;let r=C&&ue.has(n.label);H?t.push(H(n,r?[]:e,pe)):t.push((0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:k(`stratus-select__optgroup-label`,C&&`stratus-select__optgroup--expandable`),onClick:C?()=>Oe(n.label):void 0,children:[C&&(0,l.jsx)(`span`,{className:k(`stratus-select__optgroup-chevron`,r&&`stratus-select__optgroup-chevron--collapsed`),children:(0,l.jsx)(`svg`,{width:`10`,height:`5`,viewBox:`0 0 10 5`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M0 0l5 5 5-5z`})})}),n.label]}),!r&&e]},`group-${n.label}`));continue}if(!xe(n))continue;let e=Yt(n),r=K.map(String).includes(String(e)),i=Se[ce]===n;U?t.push((0,l.jsx)(`div`,{"data-option-id":e,className:k(i&&`stratus-select__option--highlighted`),onClick:n.disabled?void 0:e=>we(n,e),children:U(n,pe,K.map(String))},e)):t.push((0,l.jsxs)(`div`,{"data-option-id":e,className:k(`stratus-select__option`,r&&`stratus-select__option--selected`,i&&`stratus-select__option--highlighted`,n.disabled&&`stratus-select__option--disabled`),onClick:n.disabled?void 0:e=>we(n,e),children:[S&&(0,l.jsx)(`span`,{className:k(`stratus-select__checkbox`,r&&`stratus-select__checkbox--checked`,n.disabled&&`stratus-select__checkbox--disabled`),"aria-hidden":`true`,children:r&&(0,l.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`10`,height:`10`,children:(0,l.jsx)(`path`,{d:`M3 8.5l3 3 7-7`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),n.label]},e))}return t}let je=Ae(ye),Me=je.length>0,Ne=k(`stratus-select`,`stratus-select--${p}`,P&&`stratus-select--compact`,F&&`stratus-select--full-width`,L&&`stratus-select--disabled`,W&&`stratus-select--open`,A&&`stratus-select--filterable`,r),Pe={...i,...te},Fe=K.length>0||pe&&pe.length>0;return(0,l.jsxs)(`div`,{ref:e=>{he.current=e,typeof t==`function`?t(e):t&&(t.current=e)},className:Ne,style:Object.keys(Pe).length?Pe:void 0,...ne,children:[(0,l.jsx)(Kt,{label:m,meta:h,htmlFor:re}),(0,l.jsxs)(`div`,{className:`stratus-select__input-wrapper`,onClick:()=>{L||(G(e=>!e),me.current?.focus())},onKeyDown:Te,children:[y&&(0,l.jsx)(`span`,{className:`stratus-input__start-adornment`,children:y}),S&&T&&w&&K.length>0?(0,l.jsx)(Zt,{tags:T,infield:w,selectedIds:K,allFlat:be,tagMaxCount:E,tagMaxCountPlaceholder:D,selectedLabel:O,onTagRemove:De}):null,S&&!T&&w?(0,l.jsx)(Zt,{tags:T,infield:w,selectedIds:K,allFlat:be,tagMaxCount:E,tagMaxCountPlaceholder:D,selectedLabel:O,onTagRemove:De}):null,!(S&&T&&w&&K.length>0)&&!(S&&!T&&w)&&(0,l.jsx)(`input`,{ref:_e,id:re,type:`text`,className:`stratus-select__input`,value:A&&pe!==``&&(W||N)?pe:Ce,placeholder:K.length>0?void 0:g,disabled:L,onChange:ke,autoComplete:`off`}),b&&(0,l.jsx)(`span`,{className:`stratus-input__end-adornment`,children:b}),x&&Fe&&!L&&(0,l.jsx)(Wt,{onClear:Ee}),(0,l.jsx)(Ut,{})]}),W&&!(M&&!Me)&&(0,l.jsx)(`div`,{ref:ge,className:`stratus-select__dropdown`,children:Me?je:(0,l.jsx)(`div`,{className:`stratus-select__no-data`,children:j})}),(0,l.jsx)(Gt,{helperText:_,helperIcon:v})]})}),$t=new Set([`default`,`primary`,`secondary`,`success`,`warning`,`danger`,`disabled`]),en=L((e,t)=>{let{as:n,color:r,underline:i=`hover`,...a}=e,{cssProps:o,otherProps:s}=I(a),{className:c,style:u,rel:d,target:f,...p}=s,m=n??`a`,h=r&&$t.has(r),g=r&&!h,_=f&&m===`a`?Array.from(new Set([...String(d??``).split(/\s+/).filter(Boolean),`noreferrer`,`noopener`])).join(` `):d,v=k(`stratus-link`,h&&`stratus-link--${r}`,`stratus-link--underline-${i}`,c),y={...u,...o,...g?{color:r}:{}};return(0,l.jsx)(m,{ref:t,className:v,style:Object.keys(y).length?y:void 0,...p,target:f,rel:_})});en.displayName=`Link`;var tn=(0,c.forwardRef)(function(e,t){let{className:n,style:r,label:i,icon:a,disabled:o=!1,disableRipple:s=!1,children:u,color:d,...f}=e,{cssProps:p,otherProps:m}=I(f),h=(0,c.useRef)(null),g=e=>{m.onPointerDown?.(e),!(e.defaultPrevented||o||s)&&e.button===0&&h.current?.triggerAt(e.clientX,e.clientY)},_={...r,...p};return(0,l.jsxs)(`button`,{ref:t,type:`button`,className:k(`stratus-tab`,n),style:Object.keys(_).length?_:void 0,disabled:o,"aria-disabled":o||void 0,...m,onPointerDown:g,children:[a,i,!o&&!s&&(0,l.jsx)(R,{ref:h})]})}),nn=new Set([`primary`,`secondary`,`success`,`warning`,`danger`]),rn=(0,c.forwardRef)(function(e,t){let{className:n,style:r,tabsListAs:i=`div`,selectedTab:a,orientation:o=`horizontal`,textColor:s=`primary`,indicatorColor:u=`primary`,align:d=`flex-start`,fullWidth:f=!1,disabled:p=!1,onChange:m,children:h,...g}=e,{cssProps:_,otherProps:v}=I(g),y={...r,..._},b=nn.has(u),x=c.Children.toArray(h).map((e,t)=>{if(!(0,c.isValidElement)(e))return e;let n=e;return(0,c.cloneElement)(n,{className:k(n.props.className,t===a&&`stratus-tab--active`,s&&`stratus-tab--${s}`),color:s,disabled:p||n.props.disabled,onClick:e=>{m?.(t,e);let r=n.props.onClick;r?.(e)}})}),S=c.Children.toArray(h).map((e,t)=>{if(!(0,c.isValidElement)(e))return null;let n=e.props.children;if(!n)return null;let r=a!==t;return(0,l.jsx)(`div`,{className:k(`stratus-tabs__panel`,r&&`stratus-tabs__panel--hidden`),hidden:r,"aria-hidden":r,children:n},`stratus-tabs__panel--${t}`)}),C=S.some(Boolean);return(0,l.jsxs)(`div`,{className:k(`stratus-tabs-root`,`stratus-tabs-root--${o}`),children:[(0,l.jsx)(`div`,{ref:t,className:k(`stratus-tabs`,`stratus-tabs--${o}`,n),style:Object.keys(y).length?y:void 0,...v,children:(0,l.jsx)(`div`,{className:k(`stratus-tabs__container`,`stratus-tabs__container--${o}`),children:(0,l.jsx)(i,{className:k(`stratus-tabs__list`,`stratus-tabs__list--${o}`,f&&`stratus-tabs__list--fullwidth`,`stratus-tabs__indicator--${o}`,b&&`stratus-tabs__indicator--${u}`),style:{justifyContent:d},children:x})})}),C&&S]})}),an=new Set([0,1,2,3,4,5,6,8,12,16,24]);function on(e){let t=Math.round(e*.5),n=Math.round(e*.7),r=Math.round(e*-.2),i=e,a=Math.round(e*1.5),o=Math.round(e*.1),s=Math.round(e*1.8),c=Math.round(e*.35);return[`0px ${t}px ${n}px ${r}px rgba(0,0,0,0.2)`,`0px ${i}px ${a}px ${o}px rgba(0,0,0,0.14)`,`0px ${Math.round(e*.3)}px ${s}px ${c}px rgba(0,0,0,0.12)`].join(`,`)}var sn=L((e,t)=>{let{as:n,elevation:r=2,square:i=!1,...a}=e,{cssProps:o,otherProps:s}=I(a),{className:c,style:u,...d}=s,f=n??`div`,p=an.has(r),m={...u,...o,...!p&&r>0?{boxShadow:on(r)}:{}};return(0,l.jsx)(f,{ref:t,className:k(`stratus-paper`,i&&`stratus-paper--square`,p&&`stratus-paper--elevation-${r}`,c),style:Object.keys(m).length?m:void 0,...d})});sn.displayName=`Paper`;var cn=H({name:`search`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M14.966 14.255h.79l4.99 5-1.49 1.49-5-4.99v-.79l-.27-.28a6.47 6.47 0 0 1-4.23 1.57 6.5 6.5 0 1 1 6.5-6.5c0 1.61-.59 3.09-1.57 4.23zm-9.71-4.5c0 2.49 2.01 4.5 4.5 4.5s4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5-4.5 2.01-4.5 4.5`});function ln(){return(0,l.jsx)(cn,{size:16})}var un=(0,c.forwardRef)(function(e,t){let{className:n,inputValue:r,placeholder:i=`Search`,emptyOnStartTyping:a=!1,onSelect:o,onChange:s,onClear:u,filterOption:d=!0,hideDropdownWhenEmpty:f=!0,...p}=e,[,m]=(0,c.useState)(``),[h,g]=(0,c.useState)(r??``);return(0,c.useEffect)(()=>{r!==void 0&&g(r)},[r]),(0,l.jsx)(Qt,{ref:t,className:k(`stratus-input-search`,n),startAdornment:(0,l.jsx)(ln,{}),inputValue:h,placeholder:i,filterOption:d,hideDropdownWhenEmpty:f,persistInputText:!0,onSelect:(e,t)=>{if(!a&&e.selectedValue!=null){let t=e.options.find(t=>String(t.value??t.label)===String(e.selectedValue));t&&(m(t.label),g(t.label))}o?.(e,t)},onChange:e=>{g(a?``:e),s?.(e)},onClear:e=>{g(``),m(``),u?.(e)},...p})});function dn(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=dn(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function fn(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=fn(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var q=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return dn(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return fn(this,e,t,n)}findIndex(e){if(e==0)return mn(0,e);if(e==this.size)return mn(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?mn(t+1,i):mn(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};q.empty=new q([],0);var pn={index:0,offset:0};function mn(e,t){return pn.index=e,pn.offset=t,pn}function hn(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!hn(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!hn(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var gn=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&hn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};gn.none=[];var _n=class extends Error{},J=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=yn(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(vn(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(q.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};J.empty=new J(q.empty,0,0);function vn(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(vn(a.content,t-i-1,n-i-1)))}function yn(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=yn(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function bn(e,t,n){if(n.openStart>e.depth)throw new _n(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new _n(`Inconsistent open depths`);return xn(e,t,n,0)}function xn(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=xn(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return En(a,On(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return En(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=kn(n,e);return En(a,Dn(e,i,o,t,r))}}function Sn(e,t){if(!t.type.compatibleContent(e.type))throw new _n(`Cannot join `+t.type.name+` onto `+e.type.name)}function Cn(e,t,n){let r=e.node(n);return Sn(r,t.node(n)),r}function wn(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Tn(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(wn(e.nodeAfter,r),a++));for(let e=a;e<o;e++)wn(i.child(e),r);t&&t.depth==n&&t.textOffset&&wn(t.nodeBefore,r)}function En(e,t){return e.type.checkContent(t),e.copy(t)}function Dn(e,t,n,r,i){let a=e.depth>i&&Cn(e,t,i+1),o=r.depth>i&&Cn(n,r,i+1),s=[];return Tn(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Sn(a,o),wn(En(a,Dn(e,t,n,r,i+1)),s)):(a&&wn(En(a,On(e,t,i+1)),s),Tn(t,n,i,s),o&&wn(En(o,On(n,r,i+1)),s)),Tn(r,null,i,s),new q(s)}function On(e,t,n){let r=[];return Tn(null,e,n,r),e.depth>n&&wn(En(Cn(e,t,n+1),On(e,t,n+1)),r),Tn(t,null,n,r),new q(r)}function kn(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(q.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var An=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return gn.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Pn(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Nn.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Nn.set(t,r=new jn);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Mn,i}},jn=class{constructor(){this.elts=[],this.i=0}},Mn=12,Nn=new WeakMap,Pn=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Fn=Object.create(null),In=class e{constructor(e,t,n,r=gn.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||q.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&hn(this.attrs,t||e.defaultAttrs||Fn)&&gn.sameSet(this.marks,n||gn.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return J.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new J(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return bn(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return An.resolveCached(this,e)}resolveNoCache(e){return An.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Ln(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=q.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=gn.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!gn.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=q.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};In.prototype.text=void 0;function Ln(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Rn=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new zn(t,n);if(r.next==null)return e.empty;let i=Bn(r);r.next&&r.err(`Unexpected trailing text`);let a=Xn(qn(i));return Zn(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return q.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require("react");c=s(c,1);let l=require("react/jsx-runtime"),u=require("react-dom"),d=require("@tanstack/react-table"),f=require("@tiptap/extension-color");f=s(f,1);let p=require("@tiptap/extension-highlight");p=s(p,1);let m=require("@tiptap/extension-subscript");m=s(m,1);let h=require("@tiptap/extension-superscript");h=s(h,1);let g=require("@tiptap/extension-table"),_=require("@tiptap/extension-table-cell");_=s(_,1);let v=require("@tiptap/extension-table-header");v=s(v,1);let y=require("@tiptap/extension-table-row");y=s(y,1);let b=require("@tiptap/extension-text-align");b=s(b,1);let x=require("@tiptap/extension-text-style"),S=require("@tiptap/core"),C=require("@tiptap/react"),w=require("@tiptap/starter-kit");w=s(w,1);let T=require("@popperjs/core"),E=require("date-fns");var D={primary:{main:`var(--stratus-primary)`,hover:`var(--stratus-primary-hover)`,hoverAlt:`var(--stratus-primary-hover-alt)`,highlight:`var(--stratus-primary-highlight)`,highlightHover:`var(--stratus-primary-highlight-hover)`,light:`var(--stratus-primary-light)`},secondary:{main:`var(--stratus-secondary)`,highlight:`var(--stratus-secondary-highlight)`,light:`var(--stratus-secondary-light)`},danger:{main:`var(--stratus-error)`,highlight:`var(--stratus-error-highlight)`},warning:{main:`var(--stratus-warning)`,highlight:`var(--stratus-warning-highlight)`},success:{main:`var(--stratus-success)`,highlight:`var(--stratus-success-highlight)`},text:{main:`var(--stratus-text-main)`,muted:`var(--stratus-text-muted)`,primary:`var(--stratus-text-primary)`,secondary:`var(--stratus-text-secondary)`,tertiary:`var(--stratus-text-tertiary)`,disabled:`var(--stratus-text-disabled)`},surface:{surface:`var(--stratus-surface)`,muted:`var(--stratus-surface-muted)`,raised:`var(--stratus-surface-raised)`,nav:`var(--stratus-bg-nav)`},border:{light:`var(--stratus-border-light)`,divider:`var(--stratus-divider)`}};function O(e,{as:t,disabled:n,type:r}){let i=t??e;return i===`button`?{Component:i,isButton:!0,rootProps:{disabled:n||void 0,type:r,"data-disabled":n?`true`:void 0}}:{Component:i,isButton:!1,rootProps:{"aria-disabled":n||void 0,"data-disabled":n?`true`:void 0}}}function k(...e){return e.filter(Boolean).join(` `)}var A={p:`padding`,pt:`paddingTop`,pr:`paddingRight`,pb:`paddingBottom`,pl:`paddingLeft`,px:`paddingInline`,py:`paddingBlock`,m:`margin`,mt:`marginTop`,mr:`marginRight`,mb:`marginBottom`,ml:`marginLeft`,mx:`marginInline`,my:`marginBlock`,w:`width`,minW:`minWidth`,maxW:`maxWidth`,h:`height`,minH:`minHeight`,maxH:`maxHeight`,bg:`backgroundColor`,rounded:`borderRadius`},j=new Set(`display.position.top.right.bottom.left.inset.zIndex.overflow.overflowX.overflowY.float.clear.visibility.boxSizing.flex.flexDirection.flexWrap.flexFlow.flexGrow.flexShrink.flexBasis.justifyContent.alignItems.alignSelf.alignContent.order.gap.rowGap.columnGap.grid.gridTemplate.gridTemplateColumns.gridTemplateRows.gridTemplateAreas.gridArea.gridColumn.gridRow.gridAutoFlow.gridAutoColumns.gridAutoRows.gridGap.gridRowGap.gridColumnGap.justifyItems.justifySelf.placeContent.placeItems.placeSelf.width.minWidth.maxWidth.height.minHeight.maxHeight.aspectRatio.margin.marginTop.marginRight.marginBottom.marginLeft.marginBlock.marginBlockStart.marginBlockEnd.marginInline.marginInlineStart.marginInlineEnd.padding.paddingTop.paddingRight.paddingBottom.paddingLeft.paddingBlock.paddingBlockStart.paddingBlockEnd.paddingInline.paddingInlineStart.paddingInlineEnd.border.borderTop.borderRight.borderBottom.borderLeft.borderWidth.borderStyle.borderColor.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomLeftRadius.borderBottomRightRadius.borderCollapse.borderSpacing.outline.outlineColor.outlineStyle.outlineWidth.outlineOffset.background.backgroundColor.backgroundImage.backgroundSize.backgroundPosition.backgroundRepeat.backgroundClip.backgroundOrigin.backgroundAttachment.color.opacity.font.fontFamily.fontSize.fontWeight.fontStyle.fontVariant.lineHeight.letterSpacing.textAlign.textDecoration.textTransform.textOverflow.textShadow.textIndent.whiteSpace.wordBreak.wordSpacing.wordWrap.overflowWrap.verticalAlign.transform.transformOrigin.transition.transitionProperty.transitionDuration.transitionTimingFunction.transitionDelay.animation.animationName.animationDuration.animationTimingFunction.animationDelay.animationIterationCount.animationDirection.animationFillMode.animationPlayState.boxShadow.filter.backdropFilter.mixBlendMode.clipPath.mask.cursor.pointerEvents.userSelect.resize.touchAction.scrollBehavior.scrollMargin.scrollPadding.scrollSnapType.scrollSnapAlign.tableLayout.listStyle.listStyleType.listStylePosition.listStyleImage.content.objectFit.objectPosition.isolation.contain.willChange.appearance.accentColor.caretColor`.split(`.`)),M=[0,4,8,16,32,64,128,256,512],N=new Set([`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`marginBlock`,`marginBlockStart`,`marginBlockEnd`,`marginInline`,`marginInlineStart`,`marginInlineEnd`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`paddingBlock`,`paddingBlockStart`,`paddingBlockEnd`,`paddingInline`,`paddingInlineStart`,`paddingInlineEnd`]),P=new Set([`gap`,`rowGap`,`columnGap`]);function F(e,t){if(typeof t!=`number`)return t;if(N.has(e)){let e=M[t];return e==null?`${t}px`:`${e}px`}return P.has(e)?`${t}px`:t}function I(e){let t={},n={...e};for(let[e,r]of Object.entries(A))e in n&&(r in n||(t[r]=F(r,n[e])),delete n[e]);for(let e of j)e in n&&(t[e]=F(e,n[e]),delete n[e]);if(`style`in n){let e=n.style;if(delete n.style,e&&typeof e==`object`)return{cssProps:{...e,...t},otherProps:n}}return{cssProps:t,otherProps:n}}function L(e){return c.forwardRef(e)}var R=c.forwardRef(function({className:e,disabled:t=!1},n){let r=c.useRef(null),i=c.useCallback((e,n)=>{let i=r.current;if(!i||t)return;let a=i.getBoundingClientRect(),o=e-a.left,s=n-a.top,c=Math.max(a.width,a.height)*2,l=document.createElement(`span`);l.className=k(`stratus-ripple`),l.style.width=`${c}px`,l.style.height=`${c}px`,l.style.left=`${o}px`,l.style.top=`${s}px`,i.appendChild(l);let u=getComputedStyle(i).getPropertyValue(`--stratus-button-ripple-opacity`).trim()||`0.22`,d=l.animate([{transform:`translate(-50%, -50%) scale(0)`,opacity:u},{transform:`translate(-50%, -50%) scale(1)`,opacity:`0`}],{duration:520,easing:`ease-out`,fill:`forwards`});d.onfinish=()=>l.remove()},[t]),a=c.useCallback(()=>{let e=r.current;if(!e)return;let t=e.getBoundingClientRect();i(t.left+t.width/2,t.top+t.height/2)},[i]);return c.useImperativeHandle(n,()=>({triggerAt:i,triggerCenter:a}),[i,a]),(0,l.jsx)(`span`,{ref:r,"aria-hidden":!0,className:k(`stratus-button__ripples`,e)})}),z=L((e,t)=>{let{cssProps:n,otherProps:r}=I(e),{variant:i=`contained`,colorScheme:a=`primary`,size:o=`md`,compact:s=!1,fullWidth:u=!1,as:d,loading:f=!1,spinner:p,startAdornment:m,endAdornment:h,className:g,disabled:_,children:v,type:y=`button`,disableRipple:b=!1,iconSize:x,onPointerDown:S,onKeyDown:C,...w}=r,T=s?`sm`:o,E=(0,c.useRef)(null),D=!!(!v&&(m||h)),A=!!(_||f),j=e=>{S?.(e),!e.defaultPrevented&&(b||A||e.button===0&&E.current?.triggerAt(e.clientX,e.clientY))},M=e=>{C?.(e),!e.defaultPrevented&&(b||A||(e.key===`Enter`||e.key===` `)&&E.current?.triggerCenter())},{Component:N,rootProps:P}=O(`button`,{as:d,disabled:A,type:y}),F=k(`stratus-button`,`stratus-button--${i}`,`stratus-button--${a}`,`stratus-button--${T}`,u&&`stratus-button--fullWidth`,D&&`stratus-button--iconOnly`,f&&`stratus-button--loading`,g),L=p??(0,l.jsx)(`span`,{className:`stratus-button__spinner`,"aria-hidden":!0}),z={...n};return(0,l.jsxs)(N,{ref:t,className:F,"aria-busy":f||void 0,style:z,...P,...w,onPointerDown:j,onKeyDown:M,children:[(0,l.jsx)(R,{ref:E,disabled:b||A}),f?L:null,m?(0,l.jsx)(`span`,{className:k(`stratus-button__startAdornment`),style:x?{fontSize:x,width:x,height:x}:void 0,children:m}):null,v?(0,l.jsx)(`span`,{className:k(`stratus-button__label`),children:v}):null,h?(0,l.jsx)(`span`,{className:k(`stratus-button__endAdornment`),style:x?{fontSize:x,width:x,height:x}:void 0,children:h}):null]})}),B=new Set([`default`,`primary`,`secondary`,`success`,`warning`,`danger`]),V=(0,c.forwardRef)(function(e,t){let{children:n,className:r,color:i=`inherit`,size:a,rotation:o=0,...s}=e,{cssProps:c,otherProps:u}=I(s),d=B.has(i),f=i!==`inherit`&&!d,p={...a==null?{}:{width:a,height:a},...c,...f?{color:i}:{},...o?{transform:`rotate(${o}deg)`}:{}};return(0,l.jsx)(`span`,{ref:t,className:k(`stratus-icon`,d&&`stratus-icon--${i}`,r),style:p,...u,children:n})});function H(e){let{name:t,width:n,height:r,svgPathData:i}=e,a=(0,c.memo)((0,c.forwardRef)(function(e,t){let{size:a,...o}=e;return(0,l.jsx)(V,{ref:t,size:a,...o,children:(0,l.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${n} ${r}`,fill:`currentColor`,children:(0,l.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:i})})})}));return a.displayName=t?t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace(`-`,``).replace(`_`,``)).replace(/^[a-z]/,e=>e.toUpperCase())+`Icon`:`SvgIcon`,a}var U=H({name:`arrow_drop_down`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m7 9.5 5 5 5-5z`});function ee(e){return e.startsWith(`top`)?`top`:e.startsWith(`bottom`)?`bottom`:e.startsWith(`left`)?`left`:`right`}var te=8;function ne(e,t,n){let r=ee(n),i=0,a=0;switch(r){case`bottom`:i=e.bottom+te;break;case`top`:i=e.top-t.height-te;break;case`left`:a=e.left-t.width-te;break;case`right`:a=e.right+te;break}r===`top`||r===`bottom`?a=n.endsWith(`-start`)?e.left:n.endsWith(`-end`)?e.right-t.width:e.left+e.width/2-t.width/2:i=n.endsWith(`-start`)?e.top:n.endsWith(`-end`)?e.bottom-t.height:e.top+e.height/2-t.height/2;let o=document.documentElement.clientWidth,s=document.documentElement.clientHeight;return a=Math.max(4,Math.min(a,o-t.width-4)),i=Math.max(4,Math.min(i,s-t.height-4)),{top:i,left:a}}var re=(0,c.forwardRef)(({children:e,className:t,content:n,placement:r=`bottom`,trigger:i=[`click`,`hover`],open:a,defaultOpen:o=!1,arrow:s=!0,closeOnClickOutside:d=!0,tooltipRef:f,zIndex:p=1500,maxWidth:m=`300px`,fontSize:h=`0.75rem`,style:g,container:_,keepMounted:v=!1,disablePortal:y=!1,disabled:b=!1,onOpen:x,onClose:S,onClick:C,onMouseEnter:w,onMouseLeave:T,onContextMenu:E,onClickOutside:D,...O},A)=>{let[j,M]=(0,c.useState)(o),N=(0,c.useRef)(null),P=(0,c.useRef)(null),F=(0,c.useRef)(void 0),[I,L]=(0,c.useState)(null),R=a!==void 0,z=b?!1:R?a:j,B=(0,c.useRef)(z);(0,c.useEffect)(()=>{let e=B.current;B.current=z,b&&(clearTimeout(F.current),R||M(!1),e&&S?.(new MouseEvent(`click`,{bubbles:!0,cancelable:!0})))},[b,z,R,S]),(0,c.useEffect)(()=>()=>clearTimeout(F.current),[]);let V=(0,c.useMemo)(()=>Array.isArray(i)?i:[i],[i]),H={};for(let e of Object.keys(O))e.startsWith(`data-`)&&(H[e]=O[e]);let U=(0,c.useCallback)(e=>{b||(R||M(!0),x?.(e))},[b,R,x]),te=(0,c.useCallback)(e=>{R||M(!1),S?.(e)},[R,S]);(0,c.useImperativeHandle)(f,()=>({open:e=>{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0});U(e??t)},close:e=>{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0});te(e??t)}}));let re=(0,c.useCallback)(()=>{if(!N.current||!P.current)return;let e=N.current.getBoundingClientRect(),t=P.current.getBoundingClientRect();L(ne(e,{width:t.width,height:t.height},r))},[r]);(0,c.useLayoutEffect)(()=>{z&&re()},[z,re,n]),(0,c.useEffect)(()=>{if(!z)return;let e=()=>re();return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[z,re]),(0,c.useEffect)(()=>{if(!z||!d||!V.includes(`click`)&&!V.includes(`contextMenu`))return;let e=e=>{let t=e.target;N.current?.contains(t)||P.current?.contains(t)||(te(e),D?.(!1,e))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[z,d,te,D]);let W=(0,c.useCallback)(e=>{if(!V.includes(`click`))return;let t=!z;R||M(t),C?.(t,e),t?x?.(e):S?.(e)},[V,z,R,C,x,S]),G=(0,c.useCallback)(e=>{if(!V.includes(`contextMenu`))return;e.preventDefault();let t=!z;R||M(t),E?.(t,e),t?x?.(e):S?.(e)},[V,z,R,E,x,S]),ie=(0,c.useCallback)(e=>{V.includes(`hover`)&&(clearTimeout(F.current),U(e),w?.(!0,e))},[V,U,w]),ae=(0,c.useCallback)(e=>{V.includes(`hover`)&&(F.current=setTimeout(()=>te(e),100),T?.(!1,e))},[V,te,T]),oe=(0,c.useCallback)(()=>{V.includes(`hover`)&&clearTimeout(F.current)},[V]),se=(0,c.useCallback)(e=>{V.includes(`hover`)&&(te(e),T?.(!1,e))},[V,te,T]),ce={};b||(V.includes(`click`)&&(ce.onClick=W),V.includes(`contextMenu`)&&(ce.onContextMenu=G),V.includes(`hover`)&&(ce.onMouseEnter=ie,ce.onMouseLeave=ae));let le=(0,c.useCallback)(e=>{N.current=e},[]),ue=()=>typeof e==`string`?(0,l.jsx)(`span`,{ref:le,...ce,className:`stratus-tooltip-anchor`,style:b?{cursor:`default`}:void 0,children:e}):c.Children.map(e,e=>(0,c.isValidElement)(e)?(0,c.cloneElement)(e,{ref:le,...ce,style:{display:e.props?.display??`inline-block`,...b?{}:{cursor:`pointer`},...e.props?.style}}):e),de=ee(r),fe=Array.isArray(m)?m[0]:m,K=Array.isArray(h)?h[0]:h,pe=!b&&(z||v)?(0,l.jsxs)(`div`,{ref:e=>{P.current=e,typeof A==`function`?A(e):A&&(A.current=e)},className:k(`stratus-tooltip`,`stratus-tooltip--${de}`,t),role:`tooltip`,"data-state":z?`open`:`closed`,style:{top:I?.top??-9999,left:I?.left??-9999,zIndex:typeof p==`string`?Number(p)||1500:p,display:z?void 0:`none`,...!z&&v?{visibility:`hidden`}:{}},onMouseEnter:oe,onMouseLeave:se,...H,children:[s&&(0,l.jsx)(`span`,{className:`stratus-tooltip__arrow`}),(0,l.jsx)(`div`,{className:`stratus-tooltip__content`,style:{"--stratus-tooltip-max-width":fe,"--stratus-tooltip-font-size":K,...g},children:n})]}):null,me=!y&&typeof document<`u`?_??document.body:null;return(0,l.jsxs)(l.Fragment,{children:[ue(),pe&&(me?(0,u.createPortal)(pe,me):pe)]})});re.displayName=`Tooltip`;var W=(0,c.forwardRef)(function(e,t){let{menu:n,contextMenu:r,trigger:i=[`click`],arrow:a=!1,className:o,style:s,...c}=e,u=r?Array.isArray(i)?[...i,`contextMenu`]:[i,`contextMenu`]:i;return(0,l.jsx)(re,{ref:t,content:(0,l.jsx)(`div`,{className:`stratus-dropdown-content`,children:n}),trigger:u,arrow:a,maxWidth:`fit-content`,style:s,className:k(`stratus-dropdown`,o),...c})}),G=(0,c.forwardRef)(function(e,t){let{orientation:n,color:r,size:i,...a}=e,{cssProps:o,otherProps:s}=I(a),{className:c,style:u,...d}=s,f=fe()?.mode??`vertical`,p=n??(f===`horizontal`?`vertical`:`horizontal`),m={...u,...o};return r&&(p===`horizontal`?m.borderTopColor=r:m.borderLeftColor=r),i&&(p===`horizontal`?m.borderTopWidth=`${i}px`:m.borderLeftWidth=`${i}px`),(0,l.jsx)(`hr`,{ref:t,role:`separator`,"aria-orientation":p,className:k(`stratus-menu-divider`,`stratus-menu-divider--${p}`,c),style:m,...d})});G.displayName=`MenuDivider`;var ie=L((e,t)=>{let n=(0,c.useId)(),r=(0,c.useRef)(null),{as:i,children:a,id:o,startAdornment:s,endAdornment:u,disabled:d=!1,clickable:f=!0,onClick:p,...m}=e,{cssProps:h,otherProps:g}=I(m),{className:_,style:v,...y}=g,b=fe(),x=o??n,S=d||(b?.disabled??!1),C=b?.compact??!1,w=b?.isSelected(x)??!1,T=e=>{if(!(S||!f)&&(p?.({id:x,label:a},e),b)){b.toggleSelect(x,e,a);let t={menuItemId:x,selected:!b.isSelected(x),selectedIds:b.selectedIds,open:!1,openIds:b.openIds};b.onClick?.(t,e)}},E=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(e))},D=i??`li`,O=k(`stratus-menu-item`,C&&`stratus-menu-item--compact`,S&&`stratus-menu-item--disabled`,w&&`stratus-menu-item--selected`,!f&&`stratus-menu-item--not-clickable`,_),A={...v,...h};return(0,l.jsxs)(D,{ref:t,role:`menuitem`,tabIndex:S?void 0:0,"aria-disabled":S||void 0,className:O,style:A,onClick:T,onKeyDown:E,onPointerDown:e=>{S||!f||e.button===0&&r.current?.triggerAt(e.clientX,e.clientY)},...y,children:[f&&!S&&(0,l.jsx)(R,{ref:r}),s&&(0,l.jsx)(`span`,{className:`stratus-menu-item__start-adornment`,children:s}),(0,l.jsx)(`span`,{className:`stratus-menu-item__title`,children:a}),u&&(0,l.jsx)(`span`,{className:`stratus-menu-item__end-adornment`,children:u})]})}),ae=H({name:`chevron_down`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m7.41 8.295 4.59 4.58 4.59-4.58L18 9.705l-6 6-6-6z`}),oe=H({name:`chevron_right`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m8.295 16.59 4.58-4.59-4.58-4.59L9.705 6l6 6-6 6z`});function se(){return(0,l.jsx)(ae,{size:16})}function ce(){return(0,l.jsx)(oe,{size:16})}var le=(0,c.forwardRef)(function(e,t){let n=(0,c.useId)(),{title:r,children:i,id:a,startAdornment:o,arrow:s=!0,disabled:u=!1,onClick:d,...f}=e,{cssProps:p,otherProps:m}=I(f),{className:h,style:g,..._}=m,v=fe(),y=a??n,b=u||(v?.disabled??!1),x=v?.compact??!1,S=(v?.mode??`vertical`)===`inline`,[C,w]=(0,c.useState)(!1),T=v?.isOpen(y)??C,E=(0,c.useRef)(null),D=(0,c.useRef)(null),[O,A]=(0,c.useState)(T?`auto`:0),j=(0,c.useRef)(!0);(0,c.useEffect)(()=>{if(!S)return;if(j.current){j.current=!1,T&&A(`auto`);return}let e=E.current;if(e)if(T){let t=e.scrollHeight;A(t);let n=()=>{A(`auto`),e.removeEventListener(`transitionend`,n)};e.addEventListener(`transitionend`,n)}else{let t=e.scrollHeight;A(t),e.offsetHeight,requestAnimationFrame(()=>A(0))}},[T,S]),(0,c.useEffect)(()=>{if(S||!T)return;let e=e=>{let t=e.target;D.current?.contains(t)||E.current?.contains(t)||(v?v.toggleOpen(y,e,r):w(!1))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[S,T,v,y,r]);let M=e=>{if(b)return;let t={id:y,label:r,level:v?.level};d?.(t,e),v?v.toggleOpen(y,e,r):w(e=>!e)},N=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),M(e))},P=v?.triggersSubMenu??`click`,F=Array.isArray(P)?P.includes(`hover`):P===`hover`,L=e=>{!F||b||T||(v?v.toggleOpen(y,e,r):w(!0))},R=e=>{!F||b||!T||(v?v.toggleOpen(y,e,r):w(!1))},z=S?(0,l.jsx)(se,{}):(0,l.jsx)(ce,{});return(0,l.jsxs)(`li`,{ref:t,className:k(`stratus-submenu`,h),style:{...g,...p},onMouseEnter:S?void 0:L,onMouseLeave:S?void 0:R,..._,children:[(0,l.jsxs)(`div`,{ref:D,role:`menuitem`,tabIndex:b?void 0:0,"aria-haspopup":`true`,"aria-expanded":T,"aria-disabled":b||void 0,className:k(`stratus-submenu__trigger`,x&&`stratus-submenu__trigger--compact`,b&&`stratus-submenu__trigger--disabled`),onClick:M,onKeyDown:N,children:[o&&(0,l.jsx)(`span`,{className:`stratus-menu-item__start-adornment`,children:o}),(0,l.jsx)(`span`,{className:`stratus-submenu__trigger__title`,children:r}),s&&(0,l.jsx)(`span`,{className:k(`stratus-submenu__trigger__arrow`,S&&T&&`stratus-submenu__trigger__arrow--open`),children:z})]}),S?(0,l.jsx)(`div`,{ref:E,className:`stratus-submenu__inline-content`,style:{height:O},children:(0,l.jsx)(`ul`,{role:`menu`,className:`stratus-menu stratus-menu--inline`,children:i})}):T&&(0,l.jsx)(`div`,{ref:E,className:`stratus-submenu__popover`,children:(0,l.jsx)(`ul`,{role:`menu`,className:`stratus-menu`,children:i})})]})});le.displayName=`SubMenu`;var ue=le,de=(0,c.createContext)(null);function fe(){return(0,c.useContext)(de)}var K=L((e,t)=>{let{as:n,children:r,mode:i=`vertical`,inlineCollapsed:a=!1,multiple:o=!1,selectable:s=!0,selectedIds:u,openIds:d,triggersSubMenu:f=`click`,compact:p=!1,disabled:m=!1,onClick:h,onSelect:g,onDeselect:_,onOpen:v,onClose:y,...b}=e,{cssProps:x,otherProps:S}=I(b),{className:C,style:w,...T}=S,E=fe(),D=E?E.level+1:0,[O,A]=(0,c.useState)(u??[]),[j,M]=(0,c.useState)(d??[]),N=u??O,P=d??j;(0,c.useEffect)(()=>{u&&A(u)},[u]),(0,c.useEffect)(()=>{d&&M(d)},[d]);let F=(0,c.useCallback)(e=>N.includes(e),[N]),L=(0,c.useCallback)(e=>P.includes(e),[P]),R=(0,c.useCallback)((e,t,n)=>{if(!s)return;let r=N.includes(e),i;i=r?N.filter(t=>t!==e):o?[...N,e]:[e],u||A(i);let a={menuItemId:e,selected:!r,selectedIds:i,open:!1,openIds:P};r?_?.(a,t):g?.(a,t)},[s,N,o,u,P,g,_]),z=(0,c.useCallback)((e,t,n)=>{let r=P.includes(e),i;i=r?P.filter(t=>t!==e):[...P,e],d||M(i);let a={menuItemId:e,selected:!1,selectedIds:N,open:!r,openIds:i};r?y?.(a,t):v?.(a,t)},[P,d,N,v,y]),B={mode:a?`vertical`:i,compact:p,disabled:m,selectable:s,selectedIds:N,openIds:P,level:D,triggersSubMenu:f,isSelected:F,isOpen:L,toggleSelect:R,toggleOpen:z,onClick:h},V=n??`ul`,H=k(`stratus-menu`,`stratus-menu--${i}`,C),U={...w,...x};return(0,l.jsx)(de.Provider,{value:B,children:(0,l.jsx)(V,{ref:t,role:`menu`,className:H,style:U,...T,children:r})})}),pe=L((e,t)=>{let{as:n,options:r,selectedId:i,defaultSelectedId:a,menuButtonAriaLabel:o=`Select option`,onAction:s,onOptionChange:u,variant:d=`contained`,color:f=`primary`,compact:p=!1,fullWidth:m=!1,disabled:h=!1,...g}=e,_=(0,c.useRef)(null),[v,y]=(0,c.useState)((r.find(e=>e.id===a)??r[0])?.id),b=i??v,x=r.find(e=>e.id===b)??r[0],S=x?.id,C=p?`sm`:void 0,w=r.length>0,T=w&&r.every(e=>e.disabled),E=me,D=(e,t)=>{let n=r.find(t=>t.id===e.menuItemId);!n||n.disabled||(i===void 0&&y(n.id),u?.(n,t),_.current?.close(t))},O=e=>{!x||x.disabled||s?.(x,e)};return(0,l.jsxs)(E,{...g,ref:t,as:n,active:-1,variant:d,color:f,compact:p,fullWidth:m,disabled:h,children:[(0,l.jsx)(z,{onClick:O,disabled:h||!x||x.disabled,children:x?.label??`No options`}),(0,l.jsx)(W,{tooltipRef:_,placement:`bottom-end`,menu:(0,l.jsx)(K,{compact:p,selectedIds:S?[S]:[],onClick:D,children:r.map(e=>(0,l.jsx)(ie,{id:e.id,disabled:e.disabled,children:e.label},e.id))}),children:(0,l.jsx)(z,{"aria-label":o,disabled:h||!w||T,variant:d,colorScheme:f,size:C,style:{paddingLeft:10,paddingRight:10},children:(0,l.jsx)(U,{})})})]})}),me=L((e,t)=>{let{cssProps:n,otherProps:r}=I(e),{children:i,className:a,style:o,active:s,defaultActive:u=0,color:d=`primary`,variant:f=`outlined`,variantActive:p=`contained`,orientation:m=`horizontal`,compact:h=!1,fullWidth:g=!1,disabled:_=!1,onChange:v,as:y,...b}=r,x=s!==void 0,[S,C]=(0,c.useState)(u),w=x?s:S,T=(e,t)=>{x||C(e),v?.({index:e},t)},E=k(`stratus-buttonGroup`,`stratus-buttonGroup--${m}`,`stratus-buttonGroup--${d}`,g&&`stratus-buttonGroup--fullWidth`,h&&`stratus-buttonGroup--compact`,_&&`stratus-buttonGroup--disabled`,a),D={...o,...n};return(0,l.jsx)(y??`div`,{ref:t,role:`group`,className:E,style:D,...b,children:c.Children.toArray(i).map((e,t)=>{if(!(0,c.isValidElement)(e))return e;let n=w===t,r=e;return(0,c.cloneElement)(r,{className:k(r.props.className,n&&`stratus-buttonGroup__item--active`),variant:n?p:f,colorScheme:d,size:h?`sm`:void 0,disabled:_||r.props.disabled,onClick:e=>{let n=r.props.onClick;n?.(e),T(t,e)}})})})}),he=L((e,t)=>{let{cssProps:n,otherProps:r}=I(e),{as:i,className:a,gap:o,children:s,...c}=r,{Component:u,rootProps:d}=O(`div`,{as:i}),f=k(`stratus-box`,a),p={...n};return(0,l.jsx)(u,{ref:t,className:f,style:{gap:typeof o==`number`?`${o}px`:o,...p},...d,...c,children:s})}),ge=new Set([`primary`,`secondary`,`success`,`warning`,`danger`,`disabled`,`inherit`]),_e={h1:`h1`,h1_bold:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`},ve=L((e,t)=>{let{cssProps:n,otherProps:r}=I(e),{as:i,className:a,style:o,variant:s=`p`,color:c,children:u,...d}=r,{Component:f,rootProps:p}=O(_e[s]??`p`,{as:i}),m=k(`stratus-typography`,s&&`stratus-typography--${s}`,c&&ge.has(c)&&`stratus-typography--color-${c}`,a),h=c&&!ge.has(c)?{color:c}:void 0,g={...o,...n,...h};return(0,l.jsx)(f,{ref:t,className:m,style:Object.keys(g).length>0?g:void 0,...p,...d,children:u})});function ye(e){let t={};for(let n of e)t[String(n)]=!0;return t}function be(e,t){return e===!0?t.map(e=>e.id):Object.keys(e).filter(t=>e[t])}function xe(e){let t={};for(let n of e)t[n.id]=n.desc?`desc`:`asc`;return t}var Se={1:`0 1px 3px var(--stratus-shadow-ambient), 0 1px 2px var(--stratus-shadow-penumbra)`,2:`0 3px 6px var(--stratus-shadow-ambient), 0 2px 4px var(--stratus-shadow-penumbra)`,3:`0 10px 20px var(--stratus-shadow-ambient), 0 3px 6px var(--stratus-shadow-penumbra)`};function Ce(e,t){let{columns:n,data:r,rowId:i=`id`,childrenId:a=`children`,compact:o=!1,headerHeight:s,rowHeight:u,dynamicHeight:f=!1,sortable:p=!0,multiSort:m=!1,resizable:h=!0,expandable:g=!1,expandedRowKeys:_,defaultExpandedRowKeys:v,draggable:y=!1,selectable:b=!1,selectRowOnClick:x=!0,stripedRows:S=!1,disabled:C=!1,elevation:w=0,noDataValue:T,extraColumnsWidth:E,className:D,rowClassName:O,onRowClick:A,onColumnSort:j,onRowSelect:M,onDragEnd:N,onEndReached:P,style:F}=e,I=(0,c.useRef)(null),L=(0,c.useRef)(null),[R,z]=(0,c.useState)(0);(0,c.useEffect)(()=>{let e=I.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e)z(t.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]);let[B,V]=(0,c.useState)([]),H=(0,c.useCallback)(e=>{C||V(t=>{let n=typeof e==`function`?e(t):e;return j?.(xe(n)),n})},[j,C]),[U,ee]=(0,c.useState)(()=>v?ye(v):{}),te=(0,c.useMemo)(()=>_===void 0?U:ye(_),[_,U]),ne=(0,c.useCallback)(e=>{_===void 0&&ee(t=>typeof e==`function`?e(t):e)},[_]),[re,W]=(0,c.useState)(()=>e.defaultSelectedRowsIds?Object.fromEntries(e.defaultSelectedRowsIds.map(e=>[e,!0])):{}),[G,ie]=(0,c.useState)(null),[ae,oe]=(0,c.useState)(null),se=(0,c.useCallback)((e,t)=>typeof e==`function`?Math.max(e(R,t),0):typeof e==`string`?e.endsWith(`%`)?Math.max(parseFloat(e)/100*R,0):parseFloat(e)||150:e,[R]),ce=(0,c.useMemo)(()=>{let e=[];if(g){let t=E?E({totalWidth:R,column:{key:`__expandable__`},defaultWidth:48}):48;t>0&&e.push({id:`__expandable__`,size:t,minSize:t,maxSize:t,enableSorting:!1,enableResizing:!1,header:()=>null,cell:({row:e})=>e.getCanExpand()?(0,l.jsx)(`span`,{role:`button`,"aria-label":e.getIsExpanded()?`Collapse row`:`Expand row`,className:k(`stratus-table__expand-icon`,e.getIsExpanded()&&`stratus-table__expand-icon--open`),onClick:t=>{t.stopPropagation(),e.toggleExpanded()},children:`▶`}):null})}if(b){let t=E?E({totalWidth:R,column:{key:`__selectable__`},defaultWidth:48}):48;t>0&&e.push({id:`__selectable__`,size:t,minSize:t,maxSize:t,enableSorting:!1,enableResizing:!1,header:({table:e})=>(0,l.jsx)(`input`,{type:`checkbox`,checked:e.getIsAllRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()}),cell:({row:e})=>(0,l.jsx)(`input`,{type:`checkbox`,checked:e.getIsSelected(),onChange:t=>{e.toggleSelected(),M?.({rowIndex:e.index,rowData:e.original,selected:t.target.checked})},onClick:e=>e.stopPropagation()})})}if(y){let t=E?E({totalWidth:R,column:{key:`__draggable__`},defaultWidth:48}):48;t>0&&e.push({id:`__draggable__`,size:t,minSize:t,maxSize:t,enableSorting:!1,enableResizing:!1,header:()=>null,cell:()=>(0,l.jsx)(`span`,{"aria-label":`Drag row`,className:`stratus-table__drag-handle`,role:`img`})})}return n.forEach((t,n)=>{let r=t.key??t.dataKey,i=R>0?se(t.width,t):150,a=t.sortable===void 0?p:t.sortable,o=t.resizable===void 0?h:t.resizable,s;if(typeof t.sortType==`function`){let e=t.sortType,n=t.dataKey;s=(r,i)=>e(r.original,i.original,n,t)}else t.sortType===`datetime`&&(s=(e,n)=>{let r=e.original[t.dataKey],i=n.original[t.dataKey];return new Date(r instanceof Date||typeof r==`string`||typeof r==`number`?r:0).getTime()-new Date(i instanceof Date||typeof i==`string`||typeof i==`number`?i:0).getTime()});e.push({id:r,accessorKey:t.dataKey,size:i,minSize:t.minWidth??50,enableSorting:a,enableResizing:o,sortingFn:s??`auto`,header:t.headerRenderer?()=>t.headerRenderer({column:t,columnIndex:n}):()=>t.title??``,cell:t.cellRenderer?e=>t.cellRenderer({rowData:e.row.original,rowIndex:e.row.index,column:t,columnIndex:n,cellData:e.getValue()}):e=>{let t=e.getValue();return t==null?``:String(t)},meta:{_col:t,_colIndex:n}})}),e},[n,R,g,b,y,p,h,E,se,M]),le=(0,c.useCallback)(e=>String(e[i]),[i]),ue=(0,c.useCallback)(e=>{let t=e[a];return Array.isArray(t)?t:void 0},[a]),de=(0,d.useReactTable)({data:r,columns:ce,state:{sorting:B,expanded:te,rowSelection:re},getRowId:le,getSubRows:g?ue:void 0,onSortingChange:H,onExpandedChange:ne,onRowSelectionChange:W,getCoreRowModel:(0,d.getCoreRowModel)(),getSortedRowModel:(0,d.getSortedRowModel)(),getExpandedRowModel:g?(0,d.getExpandedRowModel)():void 0,enableSorting:p&&!C,enableMultiSort:m,enableSortingRemoval:!0,columnResizeMode:`onChange`,enableColumnResizing:h&&!C,enableRowSelection:b,enableExpanding:g});(0,c.useImperativeHandle)(t,()=>({clearSortState:()=>{V([]),j?.({})},setColumnSort:({columnKey:e,order:t})=>{let n=[{id:e,desc:t===`desc`}];V(n),j?.(xe(n))},setSelectedRows:e=>{W(Object.fromEntries(e.map(e=>[e,!0])))},getTableRef:()=>({scrollToTop:e=>{L.current&&(L.current.scrollTop=e)},scrollToRow:e=>{let t=u??(o?32:48);L.current&&(L.current.scrollTop=e*t)},scrollToLeft:e=>{L.current&&(L.current.scrollLeft=e)},getDOMNode:()=>I.current,getExpandedState:()=>({expandedData:(de.getExpandedRowModel?.()?.rows??de.getRowModel().rows).map(e=>e.original)}),getExpandedRowKeys:()=>be(de.getState().expanded,de.getRowModel().rows),setExpandedRowKeys:e=>{_===void 0&&ee(ye(e))}})}),[de,o,u,_,j]),(0,c.useEffect)(()=>{if(!P)return;let e=L.current;if(!e)return;let t=()=>{e.scrollTop+e.clientHeight>=e.scrollHeight-50&&P()};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[P]);let fe=Array.isArray(s)?s[0]:s,K=u??(o?32:48),pe=de.getRowModel().rows,me=de.getHeaderGroups(),he=r.length===0,ge=w?Se[w]??Se[1]:void 0,_e=(0,c.useCallback)((e,t)=>{!y||C||(ie(e.id),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.id))},[y,C]),ve=(0,c.useCallback)((e,t)=>{!y||C||(t.preventDefault(),t.dataTransfer.dropEffect=`move`,oe(e.id))},[y,C]),Ce=(0,c.useCallback)((e,t)=>{if(!y||C)return;t.preventDefault();let n=t.dataTransfer.getData(`text/plain`)||G;if(ie(null),oe(null),!n||n===e.id)return;let r=pe.findIndex(e=>e.id===n),i=pe.findIndex(t=>t.id===e.id);if(r<0||i<0)return;let a=pe.map(e=>e.original),[o]=a.splice(r,1);a.splice(i,0,o),N?.({oldIndex:r,newIndex:i,rowData:o,data:a})},[y,C,G,pe,N]),we=(0,c.useCallback)(()=>{ie(null),oe(null)},[]);return(0,l.jsx)(`div`,{ref:I,className:k(`stratus-table-root`,D),style:{...F,...ge?{boxShadow:ge}:{}},children:(0,l.jsx)(`div`,{ref:L,className:`stratus-table-scroll`,children:(0,l.jsxs)(`table`,{className:k(`stratus-table`,o?`stratus-table--compact`:void 0),style:de.getTotalSize()>0?{width:de.getTotalSize()}:void 0,children:[(0,l.jsx)(`colgroup`,{children:de.getAllColumns().map(e=>(0,l.jsx)(`col`,{style:{width:e.getSize()}},e.id))}),(0,l.jsx)(`thead`,{children:me.map(e=>(0,l.jsx)(`tr`,{style:fe?{height:fe}:void 0,children:e.headers.map(e=>{let t=e.column.getCanSort(),n=e.column.getIsSorted(),r=e.column.columnDef.meta?._col;return(0,l.jsxs)(`th`,{"data-sortable":t||void 0,"data-sort-direction":n||void 0,className:r?.headerClassName,style:{width:e.getSize(),...fe?{height:fe}:{}},onClick:t&&!C?e.column.getToggleSortingHandler():void 0,children:[e.isPlaceholder?null:(0,d.flexRender)(e.column.columnDef.header,e.getContext()),n&&(0,l.jsx)(`span`,{className:`stratus-table__sort-icon`,children:n===`asc`?`▲`:`▼`}),e.column.getCanResize()&&h&&(0,l.jsx)(`div`,{className:k(`stratus-table__resizer`,e.column.getIsResizing()&&`stratus-table__resizer--active`),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler()})]},e.id)})},e.id))}),(0,l.jsx)(`tbody`,{children:he?(0,l.jsx)(`tr`,{children:(0,l.jsx)(`td`,{colSpan:ce.length,children:(0,l.jsx)(`div`,{className:`stratus-table__empty`,children:T})})}):pe.map((e,t)=>{let n=e.original,r=le(n),i=``;typeof O==`function`?i=O({rowData:n,rowIndex:t}):typeof O==`string`&&(i=O);let a=S&&t%2==1,o=e.getIsSelected(),s=!!A,c=y&&ae===e.id;return(0,l.jsx)(`tr`,{className:k(i||void 0,y&&`stratus-table__row--draggable`,G===e.id&&`stratus-table__row--dragging`,c&&`stratus-table__row--drag-over`),draggable:y&&!C,"data-clickable":s||void 0,"data-selected":o||void 0,"data-striped":a||void 0,style:f?void 0:{height:K},onDragStart:t=>_e(e,t),onDragOver:t=>ve(e,t),onDrop:t=>Ce(e,t),onDragEnd:we,onClick:C?void 0:t=>{x&&b&&(e.toggleSelected(),M?.({rowIndex:e.index,rowData:n,selected:!e.getIsSelected()})),A?.({rowKey:r,rowIndex:e.index,rowData:n,event:t})},children:e.getVisibleCells().map(e=>{let r=e.column.columnDef.meta?._col,i=``;return r?.className&&(i=typeof r.className==`function`?r.className({rowData:n,rowIndex:t,column:r}):r.className),(0,l.jsx)(`td`,{className:i||void 0,style:{width:e.column.getSize()},children:(0,d.flexRender)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)})})]})})})}var we=(0,c.forwardRef)(Ce);we.displayName=`Table`;var Te=H({name:`check_circle_outlined`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-2-5.83 6.59-6.59L18 9l-8 8-4-4 1.41-1.41z`}),Ee=H({name:`close`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),De=H({name:`error_filled`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 15v-2h2v2zm0-10v6h2V7z`}),Oe=H({name:`info_circle`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12.01 22C17.53 22 22 17.52 22 12S17.53 2 12.01 2C6.48 2 2 6.48 2 12s4.48 10 10.01 10M13 9V7h-2v2zm0 8v-6h-2v6zm7-5c0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8 8-3.58 8-8`}),ke=H({name:`warning_filled`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m23 21.5-11-19-11 19zm-12-3v-2h2v2zm0-4h2v-4h-2z`}),Ae=20,je={info:()=>(0,l.jsx)(Oe,{size:Ae}),success:()=>(0,l.jsx)(Te,{size:Ae}),warning:()=>(0,l.jsx)(ke,{size:Ae}),error:()=>(0,l.jsx)(De,{size:Ae})},Me=(0,c.forwardRef)(function(e,t){let{cssProps:n,otherProps:r}=I(e),{className:i,children:a,variant:o=`contained`,severity:s=`info`,title:c,showIcon:u=!1,icon:d,onClose:f,...p}=r,m=typeof f==`function`,h=a!=null,g=()=>{if(d)return d;let e=je[s];return e?e():null};return(0,l.jsxs)(`div`,{ref:t,role:`alert`,className:k(`stratus-alert`,`stratus-alert--${o}`,`stratus-alert--${s}`,i),style:{...n},...p,children:[(0,l.jsxs)(`div`,{className:`stratus-alert__header`,children:[u&&(0,l.jsx)(`span`,{className:`stratus-alert__icon`,children:g()}),(0,l.jsx)(`div`,{className:`stratus-alert__title`,children:c}),m&&(0,l.jsx)(`button`,{type:`button`,className:`stratus-alert__close-btn`,"aria-label":`Close`,onClick:f,children:(0,l.jsx)(Ee,{size:18})})]}),h&&(0,l.jsx)(`div`,{className:`stratus-alert__message`,children:a})]})});Me.displayName=`Alert`;var Ne=H({name:`chevron_up`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`m7.41 15.705 4.59-4.58 4.59 4.58 1.41-1.41-6-6-6 6z`});function Pe({id:e,header:t,headerLevel:n,headerItems:r,isExpanded:i,disabled:a,expandIconPosition:o,expandIcon:s,onToggle:c}){let u=s??(i?(0,l.jsx)(Ne,{size:16}):(0,l.jsx)(ae,{size:16}));return(0,l.jsxs)(`div`,{id:e,className:`stratus-accordion__header`,role:`button`,tabIndex:a?void 0:0,"aria-expanded":i,"aria-disabled":a||void 0,onClick:c,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c(e))},children:[o===`left`&&(0,l.jsx)(`span`,{className:`stratus-accordion__chevron stratus-accordion__chevron--left`,children:u}),(0,l.jsxs)(`div`,{className:`stratus-accordion__header-content`,children:[(0,l.jsx)(n,{className:k(`stratus-accordion__title`,i&&`stratus-accordion__title--expanded`),children:t}),r]}),o===`right`&&(0,l.jsx)(`span`,{className:`stratus-accordion__chevron stratus-accordion__chevron--right`,children:u})]})}var Fe=(0,c.forwardRef)(function(e,t){let{cssProps:n,otherProps:r}=I(e),{className:i,children:a,style:o,header:s,headerLevel:u=`h2`,headerItems:d,defaultExpanded:f,expanded:p,expandIconPosition:m=`left`,expandIcon:h,disabled:g=!1,elevation:_=!1,square:v=!0,onChange:y,...b}=r,x=(0,c.useId)(),S=typeof p==`boolean`,C=(0,c.useRef)(!0),[w,T]=(0,c.useState)(p??f??!1),E=!g&&(S?p:w),D=a!=null,O=(0,c.useRef)(null),[A,j]=(0,c.useState)(E?`auto`:0);(0,c.useEffect)(()=>{if(C.current){C.current=!1,E&&j(`auto`);return}let e=O.current;if(e)if(E){let t=e.scrollHeight;j(t);let n=()=>{j(`auto`),e.removeEventListener(`transitionend`,n)};e.addEventListener(`transitionend`,n)}else{let t=e.scrollHeight;j(t),e.offsetHeight,requestAnimationFrame(()=>j(0))}},[E]);let M=e=>{if(g)return;let t=S?!p:!w;S||T(t),y?.(t,e)};return(0,l.jsxs)(`div`,{ref:t,className:k(`stratus-accordion`,_&&`stratus-accordion--elevation`,!v&&`stratus-accordion--rounded`,i),style:{...o,...n},...b,children:[(0,l.jsx)(Pe,{id:x,header:s,headerLevel:u,headerItems:d,isExpanded:!!E,disabled:g,expandIconPosition:m,expandIcon:h,onToggle:M}),E&&D&&(0,l.jsx)(`div`,{className:`stratus-accordion__divider`}),(0,l.jsx)(`div`,{ref:O,className:`stratus-accordion__collapse`,style:{height:A},children:(0,l.jsx)(`div`,{className:`stratus-accordion__panel`,role:`region`,"aria-labelledby":x,children:a})})]})});Fe.displayName=`Accordion`;var Ie=H({name:`menu`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M3 8V6h18v2zm0 5h18v-2H3zm0 5h18v-2H3z`}),Le=H({name:`more_vertical`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-2 8c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2`}),Re=1024,ze=typeof window<`u`?window.innerWidth:Re,Be=0,Ve=null,He=new Set;function Ue(){Ve===null&&(Ve=requestAnimationFrame(()=>{Ve=null;let e=window.innerWidth;if(e!==ze){ze=e;for(let e of He)e()}}))}function We(e){return He.add(e),Be===0&&typeof window<`u`&&window.addEventListener(`resize`,Ue),Be+=1,()=>{He.delete(e),--Be,Be===0&&typeof window<`u`&&(window.removeEventListener(`resize`,Ue),Ve!==null&&(cancelAnimationFrame(Ve),Ve=null))}}function Ge(){return ze}function Ke(){return Re}function qe(){return(0,c.useSyncExternalStore)(We,Ge,Ke)}function Je({open:e,content:t,onClose:n}){return(0,l.jsxs)(l.Fragment,{children:[e&&(0,l.jsx)(`div`,{className:`stratus-appBar__drawer-backdrop`,onClick:n}),(0,l.jsx)(`div`,{className:k(`stratus-appBar__drawer`,e&&`stratus-appBar__drawer--open`),children:t})]})}var Ye=(0,c.forwardRef)(function(e,t){let{header:n,content:r,smallScreenContent:i,smallScreenContentOpen:a,smallScreenContentOnOpen:o,smallScreenContentOnClose:s,actions:u,smallScreenActions:d,smallScreenSize:f=425,zIndex:p,...m}=e,{cssProps:h,otherProps:g}=I(m),{className:_,style:v,...y}=g,b=qe(),x=typeof window<`u`&&b<f,S=typeof a==`boolean`,[C,w]=(0,c.useState)(!1),T=S?a:C,E=i??r,D=d??u,O=e=>{S||w(!0),o?.(e)},A=e=>{S||w(!1),s?.(e)},[j,M]=(0,c.useState)(!1),N=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!j)return;let e=e=>{N.current&&!N.current.contains(e.target)&&M(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[j]);let P={...v,...h,...p==null?{}:{zIndex:Number(p)}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`header`,{ref:t,className:k(`stratus-appBar`,_),style:P,...y,children:[(0,l.jsx)(`div`,{className:`stratus-appBar__header`,children:n}),!x&&r&&(0,l.jsx)(`div`,{className:`stratus-appBar__content`,children:r}),(0,l.jsxs)(`div`,{className:`stratus-appBar__actions`,children:[!x&&u,x&&(0,l.jsxs)(`div`,{className:`stratus-appBar__sm-actions`,children:[E&&(0,l.jsx)(`button`,{type:`button`,className:`stratus-appBar__menu-btn`,"aria-label":`Toggle AppBar menu content`,onClick:O,children:(0,l.jsx)(Ie,{size:24})}),D&&(0,l.jsxs)(`div`,{className:`stratus-appBar__popover-anchor`,ref:N,children:[(0,l.jsx)(`button`,{type:`button`,className:`stratus-appBar__menu-btn`,"aria-label":`Toggle AppBar menu actions`,onClick:()=>M(e=>!e),children:(0,l.jsx)(Le,{size:24})}),j&&(0,l.jsx)(`div`,{className:`stratus-appBar__popover`,children:D})]})]})]})]}),x&&E&&(0,l.jsx)(Je,{open:!!T,content:E,onClose:A})]})});Ye.displayName=`AppBar`;var Xe=(0,c.forwardRef)(function(e,t){let{children:n,content:r,variant:i=`default`,alignment:a=`top-right`,visible:o=!0,max:s=99,overlap:c,backgroundColor:u,color:d,bg:f,border:p,zIndex:m,...h}=e,{cssProps:g,otherProps:_}=I(h),{className:v,style:y,title:b,...x}=_,S=i===`dot`?null:typeof r==`number`&&r>s?`${s}+`:r,C={},w=u??f;return w&&(C.backgroundColor=w),d&&(C.color=d),p&&(C.border=p),m!=null&&(C.zIndex=Number(m)),(0,l.jsxs)(`div`,{ref:t,className:k(`stratus-badge-container`,v),style:{...y,...g},...x,children:[n,o&&(0,l.jsx)(`span`,{className:k(`stratus-badge`,i===`dot`&&`stratus-badge--dot`,`stratus-badge--${a}`,c===`circle`&&`stratus-badge--overlap-circle`),style:C,title:b,children:S})]})});Xe.displayName=`Badge`;var Ze=L((e,t)=>{let{as:n,children:r,disableRipple:i=!1,...a}=e,{cssProps:o,otherProps:s}=I(a),{className:c,style:u,...d}=s,f=n??`div`,p={...u,...o};return(0,l.jsxs)(f,{ref:t,role:`button`,tabIndex:0,className:k(`stratus-card__action-area`,c),style:p,...d,children:[r,!i&&(0,l.jsx)(R,{})]})}),Qe=L((e,t)=>{let{as:n,children:r,...i}=e,{cssProps:a,otherProps:o}=I(i),{className:s,style:c,...u}=o,d=n??`div`,f={...c,...a};return(0,l.jsx)(d,{ref:t,className:k(`stratus-card__actions`,s),style:f,...u,children:r})}),$e=L((e,t)=>{let{as:n,children:r,...i}=e,{cssProps:a,otherProps:o}=I(i),{className:s,style:c,...u}=o,d=n??`div`,f={...c,...a};return(0,l.jsx)(d,{ref:t,className:k(`stratus-card__content`,s),style:f,...u,children:r})}),et=L((e,t)=>{let{as:n,title:r,subtitle:i,startAdornment:a,endAdornment:o,children:s,...c}=e,{cssProps:u,otherProps:d}=I(c),{className:f,style:p,...m}=d,h=n??`div`,g={...p,...u};return(0,l.jsxs)(h,{ref:t,className:k(`stratus-card__header`,f),style:g,...m,children:[a&&(0,l.jsx)(`div`,{className:`stratus-card__header-start`,children:a}),(0,l.jsxs)(`div`,{className:`stratus-card__header-body`,children:[(0,l.jsx)(`span`,{className:`stratus-card__header-title`,children:r}),i&&(0,l.jsx)(`span`,{className:`stratus-card__header-subtitle`,children:i})]}),o&&(0,l.jsx)(`div`,{className:`stratus-card__header-end`,children:o}),s]})}),tt=L((e,t)=>{let{as:n,children:r,src:i,...a}=e,{cssProps:o,otherProps:s}=I(a),{className:c,style:u,...d}=s,f=n??`div`,p={...u,...o};return i&&(p.backgroundImage=`url(${i})`),(0,l.jsx)(f,{ref:t,className:k(`stratus-card__media`,c),style:p,...d,children:r})}),nt=L((e,t)=>{let{as:n,children:r,elevation:i=2,square:a=!1,...o}=e,{cssProps:s,otherProps:c}=I(o),{className:u,style:d,...f}=c;return(0,l.jsx)(n??`div`,{ref:t,className:k(`stratus-card`,i===0?`stratus-card--elevation-0`:`stratus-card--elevation-${i}`,a&&`stratus-card--square`,u),style:{...d,...s},...f,children:r})});function rt({disabled:e,onClose:t}){return(0,l.jsx)(`button`,{type:`button`,"aria-label":`Close chip`,className:`stratus-chip__close`,disabled:e,onClick:n=>{n.preventDefault(),n.stopPropagation(),!e&&t&&t(n)},children:(0,l.jsx)(Ee,{size:14})})}var it=(0,c.forwardRef)(function(e,t){let{children:n,variant:r=`default`,startAdornment:i,endAdornment:a,closable:o=!1,disabled:s=!1,disableRipple:u=!1,onClose:d,onClick:f,...p}=e,{cssProps:m,otherProps:h}=I(p),{className:g,style:_,...v}=h,y=typeof f==`function`&&!s,b=(0,c.useRef)(null),x=e=>{e.defaultPrevented||!y||u||e.button===0&&b.current?.triggerAt(e.clientX,e.clientY)},S=e=>{!s&&f&&f(e)},C=k(`stratus-chip`,`stratus-chip--${r}`,y&&`stratus-chip--clickable`,s&&`stratus-chip--disabled`,g),w={..._,...m};return(0,l.jsxs)(`div`,{ref:t,"aria-disabled":s||void 0,className:C,style:w,tabIndex:y?0:void 0,onClick:y?S:void 0,onPointerDown:y?x:void 0,onKeyDown:y?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),S(e))}:void 0,...v,children:[y&&!u&&(0,l.jsx)(R,{ref:b}),i&&(0,l.jsx)(`span`,{className:`stratus-chip__adornment stratus-chip__adornment--start`,children:i}),(0,l.jsx)(`span`,{className:`stratus-chip__text`,children:n}),a&&(0,l.jsx)(`span`,{className:`stratus-chip__adornment stratus-chip__adornment--end`,children:a}),o&&(0,l.jsx)(rt,{disabled:s,onClose:d})]})});it.displayName=`Chip`;var at=48,ot=L((e,t)=>{let{color:n,...r}=e,{cssProps:i,otherProps:a}=I(r),{as:o,className:s,size:c=48,style:u,thickness:d=4,value:f=0,variant:p=`indeterminate`,...m}=a,{Component:h,rootProps:g}=O(`span`,{as:o}),_=2*Math.PI*((at-d)/2),v=Math.max(0,Math.min(100,f)),y=p===`determinate`?{strokeDasharray:_.toFixed(3),strokeDashoffset:`${((100-v)/100*_).toFixed(3)}px`}:void 0,b={...u,...i,"--stratus-circular-progress-size":`${c}px`,...n?{"--stratus-circular-progress-color":n}:{}};return(0,l.jsx)(h,{ref:t,className:k(`stratus-circular-progress`,`stratus-circular-progress--${p}`,s),role:`progressbar`,"aria-valuenow":p===`determinate`?Math.round(v):void 0,"aria-valuemin":p===`determinate`?0:void 0,"aria-valuemax":p===`determinate`?100:void 0,style:b,...g,...m,children:(0,l.jsxs)(`svg`,{viewBox:`${at/2} ${at/2} ${at} ${at}`,"aria-hidden":!0,children:[(0,l.jsx)(`circle`,{className:`stratus-circular-progress__track`,cx:at,cy:at,r:(at-d)/2,fill:`none`,strokeWidth:d}),(0,l.jsx)(`circle`,{className:`stratus-circular-progress__indicator`,style:y,cx:at,cy:at,r:(at-d)/2,fill:`none`,strokeWidth:d,strokeLinecap:`round`})]})})});ot.displayName=`CircularProgress`;var st=L((e,t)=>{let{as:n,orientation:r=`horizontal`,size:i=1,color:a,...o}=e,{cssProps:s,otherProps:c}=I(o),{className:u,style:d,...f}=c;return(0,l.jsx)(n??`hr`,{ref:t,className:k(`stratus-divider`,`stratus-divider--${r}`,u),style:{...d,...s,"--stratus-divider-size":`${i}px`,...a?{"--stratus-divider-color":a}:{}},...f})});st.displayName=`Divider`;var ct=0,lt=``;function ut(e){(0,c.useEffect)(()=>{if(!(!e||typeof document>`u`))return ct===0&&(lt=document.body.style.overflow,document.body.style.overflow=`hidden`),ct+=1,()=>{--ct,ct===0&&(document.body.style.overflow=lt)}},[e])}var dt=[`a[href]`,`area[href]`,`button:not([disabled])`,`input:not([disabled]):not([type='hidden'])`,`select:not([disabled])`,`textarea:not([disabled])`,`iframe`,`object`,`embed`,`[tabindex]:not([tabindex='-1'])`,`[contenteditable='true']`,`audio[controls]`,`video[controls]`,`details > summary`].join(`,`);function ft(e){return Array.from(e.querySelectorAll(dt)).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`&&(e.offsetWidth>0||e.offsetHeight>0||e.tagName===`IFRAME`))}function pt(e,t,{initialFocus:n=!0,restoreFocus:r=!0}={}){(0,c.useEffect)(()=>{if(!t)return;let i=e.current;if(!i)return;let a=document.activeElement;if(n){let e=ft(i)[0]??i;e===i&&!i.hasAttribute(`tabindex`)&&i.setAttribute(`tabindex`,`-1`),e.focus({preventScroll:!0})}let o=e=>{if(e.key!==`Tab`)return;let t=ft(i);if(t.length===0){e.preventDefault(),i.focus({preventScroll:!0});return}let n=t[0],r=t[t.length-1],a=document.activeElement;e.shiftKey?(a===n||!i.contains(a))&&(e.preventDefault(),r.focus({preventScroll:!0})):a===r&&(e.preventDefault(),n.focus({preventScroll:!0}))};return document.addEventListener(`keydown`,o,!0),()=>{document.removeEventListener(`keydown`,o,!0),r&&a?.isConnected&&a.focus({preventScroll:!0})}},[t,e,n,r])}var mt=H({name:`fullscreen`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M7 10H5V5h5v2H7zm-2 4h2v3h3v2H5zm12 3h-3v2h5v-5h-2zM14 7V5h5v5h-2V7z`}),ht=H({name:`fullscreen_exit`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M5 8h3V5h2v5H5zm3 8H5v-2h5v5H8zm6 3h2v-3h3v-2h-5zm2-14v3h3v2h-5V5z`});function gt({header:e,headerId:t,hasStringHeader:n,closable:r,fullScreen:i,isFullscreen:a,isTemporary:o,onToggleFullscreen:s,onClose:c}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`stratus-drawer__header`,children:[(0,l.jsx)(`div`,{id:n?t:void 0,className:`stratus-drawer__header-inner`,children:e}),i&&o&&(0,l.jsx)(`button`,{type:`button`,"aria-label":a?`Exit fullscreen`:`Fullscreen`,className:`stratus-drawer__header-btn`,onClick:s,children:a?(0,l.jsx)(ht,{size:20}):(0,l.jsx)(mt,{size:20})}),r&&(0,l.jsx)(`button`,{type:`button`,"aria-label":`Close drawer`,className:`stratus-drawer__header-btn`,onClick:e=>c?.(e),children:(0,l.jsx)(Ee,{size:20})})]}),(0,l.jsx)(`hr`,{className:`stratus-drawer__divider`})]})}var _t=(0,c.forwardRef)(function(e,t){let{open:n=!1,variant:r=`temporary`,placement:i=`left`,smallScreenSize:a=425,header:o,closable:s=!1,fullScreen:d=!1,initialFullScreen:f=!1,keepMounted:p=!1,transitionDuration:m=225,hideBackdrop:h=!1,disablePortal:g=!1,children:_,onClose:v,width:y=240,...b}=e,{cssProps:x,otherProps:S}=I(b),{className:C,style:w,...T}=S,E=qe(),D=r===`responsive`?E<a?`temporary`:`permanent`:r,O=D===`temporary`,A=D===`persistent`,j=D===`permanent`,[M,N]=(0,c.useState)(f),P=(0,c.useCallback)(()=>N(e=>!e),[]),[F,L]=(0,c.useState)(n),[R,z]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(n)L(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>z(!0))});else{z(!1);let e=setTimeout(()=>{p||L(!1)},O||A?m:0);return()=>clearTimeout(e)}},[n,p,m,O,A]);let B=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!n||!O)return;let e=e=>{e.key===`Escape`&&v?.(e)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n,O,v]),pt(B,n&&O),ut(n&&O);let V=(0,c.useId)(),H=typeof o==`string`||typeof o==`number`,U=Array.isArray(y)?(E<a?y[0]:y[1])??y[0]:y,ee=typeof U==`number`?`${U}px`:U,te=i===`left`||i===`right`,ne={"--stratus-drawer-duration":`${m}ms`,...te?{width:M?`100%`:ee}:{},...w,...x};if(!(j||F||p))return null;let re=o!=null||s||d?(0,l.jsx)(gt,{header:o,headerId:V,hasStringHeader:H,closable:s,fullScreen:d,isFullscreen:M,isTemporary:O,onToggleFullscreen:P,onClose:v}):null,W=(0,l.jsxs)(`div`,{ref:e=>{B.current=e,typeof t==`function`?t(e):t&&(t.current=e)},role:O?`dialog`:void 0,"aria-modal":O&&n?!0:void 0,"aria-labelledby":O&&H?V:void 0,tabIndex:O?-1:void 0,className:k(`stratus-drawer`,`stratus-drawer--${D}`,`stratus-drawer--${i}`,R&&n||j?`stratus-drawer--open`:`stratus-drawer--closed`,M&&`stratus-drawer--fullscreen`,C),style:ne,...T,children:[re,_]});if(j||A)return(0,l.jsx)(`div`,{className:`stratus-drawer-container`,children:W});let G=(0,l.jsxs)(l.Fragment,{children:[!h&&(0,l.jsx)(`div`,{className:k(`stratus-drawer-backdrop`,R&&n&&`stratus-drawer-backdrop--open`),style:{"--stratus-drawer-duration":`${m}ms`},onClick:e=>v?.(e),"aria-hidden":!0}),W]});return g?G:(0,u.createPortal)(G,document.body)});_t.displayName=`Drawer`;var vt={info:()=>(0,l.jsx)(Oe,{size:20,color:`currentColor`}),success:()=>(0,l.jsx)(Te,{size:20,color:`currentColor`}),warning:()=>(0,l.jsx)(ke,{size:20,color:`currentColor`}),error:()=>(0,l.jsx)(De,{size:20,color:`currentColor`})};function yt({severity:e,message:t,actions:n,onClose:r}){return(0,l.jsxs)(l.Fragment,{children:[e&&(0,l.jsx)(`span`,{className:`stratus-notification__icon`,children:vt[e]()}),(0,l.jsx)(`div`,{className:`stratus-notification__content`,children:t}),n&&(0,l.jsx)(`div`,{className:`stratus-notification__actions`,children:n}),r&&(0,l.jsx)(`button`,{type:`button`,className:`stratus-notification__close`,"aria-label":`Close notification`,onClick:r,children:(0,l.jsx)(Ee,{size:16})})]})}var bt=(0,c.forwardRef)(function(e,t){let{open:n,message:r,actions:i,autoHide:a=!0,autoHideDuration:o=6e3,showAutoHideLoader:s=!0,closeOnClickOutside:d=!1,placement:f=`bottom-start`,disablePortal:p=!1,onClose:m,severity:h,children:g,..._}=e,{cssProps:v,otherProps:y}=I(_),{className:b,style:x,...S}=y,C=(0,c.useRef)(null),w=(0,c.useRef)(null),T=(0,c.useRef)(0),E=(0,c.useRef)(o),D=(0,c.useCallback)(()=>{w.current&&=(clearTimeout(w.current),null)},[]),O=(0,c.useRef)(m);(0,c.useEffect)(()=>{O.current=m},[m]);let A=(0,c.useCallback)(e=>{D(),E.current=e,T.current=Date.now(),w.current=setTimeout(()=>{O.current?.()},e)},[D]);(0,c.useEffect)(()=>(n&&a?A(o):D(),D),[n,a,o,A,D]);let[j,M]=(0,c.useState)(!1),N=()=>{a&&(D(),M(!0))},P=()=>{if(!a||!n)return;let e=Date.now()-T.current,t=Math.max(0,E.current-e);t>0&&A(t),M(!1)};if((0,c.useEffect)(()=>{if(!n||!d)return;let e=e=>{C.current&&!C.current.contains(e.target)&&m?.()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n,d,m]),!n)return null;let F=(0,l.jsxs)(`div`,{ref:e=>{C.current=e,typeof t==`function`?t(e):t&&(t.current=e)},className:k(`stratus-notification`,h?`stratus-notification--${h}`:g?void 0:`stratus-notification--default`,b),style:{...x,...v},onMouseEnter:N,onMouseLeave:P,...S,children:[g??(0,l.jsx)(yt,{severity:h,message:r,actions:i,onClose:m}),a&&s&&(0,l.jsx)(`div`,{className:`stratus-notification__progress-wrap`,children:(0,l.jsx)(`div`,{className:k(`stratus-notification__progress`,j&&`stratus-notification__progress--paused`),style:{animationDuration:`${o}ms`}})})]}),L=(0,l.jsx)(`div`,{className:k(`stratus-notification-container`,`stratus-notification-container--${f}`),children:F});return p?L:(0,u.createPortal)(L,document.body)}),xt=0,St=new Map;function Ct(){let e=document.getElementById(`stratus-notifications`);return e||(e=document.createElement(`div`),e.id=`stratus-notifications`,document.body.appendChild(e)),e}function wt(e){let t=St.get(e);t&&(t.cleanup(),t.container.remove(),St.delete(e));let n=document.getElementById(`stratus-notifications`);n&&n.children.length===0&&n.remove()}function Tt(e,t){let n=e.key??`stratus-notif-${++xt}`,r=e.placement??`bottom-start`,i=e.autoHideDuration??6e3,a=e.showAutoHideLoader??!0;wt(n);let o=Ct(),s=document.createElement(`div`);s.setAttribute(`data-notification-id`,n),s.style.position=`fixed`,s.style.zIndex=String(e.zIndex??1400),s.style.pointerEvents=`none`;let c=r.split(`-`),l=c[0],u=c[1];l===`top`?(s.style.top=`16px`,s.style.bottom=`auto`):(s.style.bottom=`16px`,s.style.top=`auto`),u===`start`?(s.style.left=`16px`,s.style.right=`auto`):u===`end`?(s.style.right=`16px`,s.style.left=`auto`):(s.style.left=`50%`,s.style.transform=`translateX(-50%)`),o.appendChild(s);let d=document.createElement(`div`);if(d.className=k(`stratus-notification`,t?`stratus-notification--${t}`:`stratus-notification--default`),d.style.pointerEvents=`auto`,e.maxWidth&&(d.style.maxWidth=typeof e.maxWidth==`number`?`${e.maxWidth}px`:e.maxWidth),t){let e=document.createElement(`span`);e.className=`stratus-notification__icon`,e.innerHTML=Et(t),d.appendChild(e)}let f=document.createElement(`div`);f.className=`stratus-notification__content`,f.textContent=String(e.message??``),d.appendChild(f);let p=document.createElement(`button`);p.className=`stratus-notification__close`,p.type=`button`,p.setAttribute(`aria-label`,`Close notification`),p.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>`,p.addEventListener(`click`,()=>wt(n)),d.appendChild(p);let m=null;if(a){let e=document.createElement(`div`);e.className=`stratus-notification__progress-wrap`,m=document.createElement(`div`),m.className=`stratus-notification__progress`,m.style.width=`100%`,e.appendChild(m),d.appendChild(e)}s.appendChild(d);let h=Date.now(),g=i,_=null,v=null;function y(){if(!m)return;let e=Date.now()-h,t=Math.max(0,(g-e)/i*100);m.style.width=`${t}%`,t>0&&(v=requestAnimationFrame(y))}function b(e){g=e,h=Date.now(),_=setTimeout(()=>wt(n),e),m&&(v=requestAnimationFrame(y))}function x(){_&&clearTimeout(_),v&&cancelAnimationFrame(v),_=null,v=null;let e=Date.now()-h;g=Math.max(0,g-e)}d.addEventListener(`mouseenter`,x),d.addEventListener(`mouseleave`,()=>{g>0&&b(g)}),b(i),St.set(n,{container:s,cleanup:()=>{_&&clearTimeout(_),v&&cancelAnimationFrame(v)}})}function Et(e){switch(e){case`info`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>`;case`success`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>`;case`warning`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>`;case`error`:return`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>`}}var Dt=bt;Dt.show=e=>Tt(e),Dt.info=e=>Tt(e,`info`),Dt.success=e=>Tt(e,`success`),Dt.warning=e=>Tt(e,`warning`),Dt.error=e=>Tt(e,`error`),Dt.displayName=`Notification`;function Ot({footer:e,okText:t,cancelText:n,onOk:r,onCancel:i}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`hr`,{className:`stratus-modal__divider`}),(0,l.jsx)(`div`,{className:`stratus-modal__footer`,children:e??(0,l.jsxs)(l.Fragment,{children:[typeof i==`function`&&(0,l.jsx)(z,{variant:typeof r==`function`?`ghost`:`outlined`,onClick:i,children:n}),typeof r==`function`&&(0,l.jsx)(z,{variant:`contained`,onClick:r,children:t})]})})]})}function kt(){return(0,l.jsx)(Ee,{size:20})}var At=(0,c.forwardRef)(function(e,t){let{open:n,showClose:r=!0,closeIcon:i,title:a,footer:o,okText:s=`Ok`,cancelText:d=`Cancel`,fullScreen:f=!1,keepMounted:p=!1,disablePortal:m=!1,zIndex:h,backdropProps:g,onClose:_,onOk:v,onCancel:y,children:b,...x}=e,S=g?.closable??!1,C=g?.invisible??!1,{cssProps:w,otherProps:T}=I(x),{className:E,style:D,...O}=T,[A,j]=(0,c.useState)(n),[M,N]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(n)j(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>N(!0))});else{N(!1);let e=setTimeout(()=>{p||j(!1)},200);return()=>clearTimeout(e)}},[n,p]),(0,c.useEffect)(()=>{if(!n||!S)return;let e=e=>{e.key===`Escape`&&_?.(e)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n,S,_]),ut(n);let P=(0,c.useRef)(null);pt(P,n);let F=(0,c.useId)(),L=typeof a==`string`||typeof a==`number`,R=e=>{e.target===e.currentTarget&&(g?.onClick?.(e),S&&_?.(e))};if(!(A||p))return null;let B=a!=null||r,V=o!=null||typeof v==`function`||typeof y==`function`,H={...D,...w},U=(0,l.jsx)(`div`,{className:k(`stratus-modal-backdrop`,M&&n&&`stratus-modal-backdrop--open`,C&&`stratus-modal-backdrop--invisible`),style:h==null?void 0:{"--stratus-modal-z":Number(h)},onClick:R,"aria-hidden":!n,children:(0,l.jsx)(`div`,{ref:e=>{P.current=e,typeof t==`function`?t(e):t&&(t.current=e)},role:`dialog`,"aria-modal":!0,"aria-labelledby":L?F:void 0,tabIndex:-1,className:k(`stratus-modal`,f&&`stratus-modal--fullscreen`,E),style:H,...O,children:(0,l.jsxs)(`div`,{className:`stratus-modal__container`,children:[B&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`stratus-modal__header`,children:[a!=null&&(0,l.jsx)(`span`,{id:L?F:void 0,className:`stratus-modal__header-title`,children:a}),r&&(0,l.jsx)(z,{variant:`ghost`,"aria-label":`Close modal`,className:`stratus-modal__header-close`,onClick:e=>_?.(e),startAdornment:i??(0,l.jsx)(kt,{})})]}),(0,l.jsx)(`hr`,{className:`stratus-modal__divider`})]}),(0,l.jsx)(`div`,{className:k(`stratus-modal__content`,f&&`stratus-modal__content--fullscreen`),children:(0,l.jsx)(`div`,{className:`stratus-modal__content-inner`,children:b})}),V&&(0,l.jsx)(Ot,{footer:o,okText:s,cancelText:d,onOk:v,onCancel:y})]})})});return m?U:(0,u.createPortal)(U,document.body)});At.displayName=`Modal`;function jt({size:e=48}){return(0,l.jsxs)(`svg`,{className:`stratus-screen-loader__star-progress`,role:`progressbar`,"aria-label":`Loading`,"aria-valuetext":`Loading`,width:e,height:e*1.2,viewBox:`0 0 40 48`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,preserveAspectRatio:`xMidYMid meet`,style:e?{"--stratus-screen-loader-size":`${e}px`}:void 0,children:[(0,l.jsx)(`path`,{d:`M32.756 34.6798L29.482 36.5817C29.4139 36.6219 29.3295 36.6227 29.2606 36.5829L25.9476 34.7151C25.7975 34.6306 25.7967 34.4149 25.9456 34.3284L29.2397 32.4256C29.3077 32.3858 29.3914 32.3858 29.4603 32.4248L32.754 34.2931C32.9033 34.3784 32.9041 34.5929 32.756 34.6798Z`}),(0,l.jsx)(`path`,{d:`M25.9596 45.4706L22.6655 43.5867C22.5966 43.5469 22.554 43.4744 22.554 43.396V41.4289V39.5922C22.5519 39.4204 22.7381 39.3109 22.8878 39.397L26.1819 41.2981C26.25 41.3379 26.2926 41.4104 26.2934 41.4896V43.4268V45.2762C26.2947 45.4472 26.1085 45.5559 25.9596 45.4706Z`}),(0,l.jsx)(`path`,{d:`M12.3022 47.7037V44.9795V42.6544C12.3022 42.5495 12.3576 42.4515 12.4482 42.3986L14.1262 41.4062L16.8143 39.8188C17.0119 39.7019 17.2617 39.8442 17.2625 40.0739L17.2633 42.7627V45.1456C17.2633 45.251 17.2079 45.3486 17.1165 45.4015L12.7496 47.9587C12.552 48.0748 12.3031 47.9325 12.3022 47.7037Z`}),(0,l.jsx)(`path`,{d:`M0.221343 34.2106L6.76939 30.4056C6.90636 30.326 7.07449 30.3256 7.21227 30.4023L13.8378 34.1401C14.138 34.3095 14.14 34.7413 13.8415 34.9131L7.25492 38.7182C7.11795 38.7977 6.94941 38.7985 6.81204 38.7206L0.225854 34.9836C-0.0734986 34.8139 -0.075549 34.3833 0.221343 34.2106Z`}),(0,l.jsx)(`path`,{d:`M6.03876 9.125L16.9237 15.5151C17.1513 15.6484 17.2903 15.8912 17.2903 16.1549V28.8331C17.2903 29.4076 16.665 29.7647 16.1704 29.4728L5.28546 23.0264C5.05869 22.8919 4.92008 22.6479 4.9209 22.3855V9.76307C4.92254 9.1902 5.54503 8.83467 6.03876 9.125Z`}),(0,l.jsx)(`path`,{d:`M39.6262 1.07261V11.7603V19.3368C39.627 19.7178 39.4265 20.0709 39.0988 20.2644L31.4145 24.8195L23.3545 29.5964C22.6385 30.0192 21.7339 29.5029 21.7339 28.6717V10.3259C21.7339 9.94495 21.9356 9.5927 22.2641 9.39955L38.008 0.149533C38.7232 -0.270381 39.6241 0.24385 39.6262 1.07261Z`})]})}var Mt=L((e,t)=>{let{cssProps:n,otherProps:r}=I(e),{as:i,className:a,children:o,loader:s,sizeLoader:c,title:d,backdropInvisible:f=!1,container:p,disablePortal:m=!1,zIndex:h,style:g,..._}=r,{Component:v,rootProps:y}=O(`div`,{as:i}),b={...g,...n,...h==null?{}:{"--stratus-screen-loader-z":String(h)}},x=(0,l.jsx)(v,{ref:t,className:k(`stratus-screen-loader`,f&&`stratus-screen-loader--invisible`,a),role:`status`,"aria-live":`polite`,"aria-busy":`true`,style:Object.keys(b).length?b:void 0,...y,..._,children:(0,l.jsxs)(`div`,{className:`stratus-screen-loader__content`,children:[s??(0,l.jsx)(jt,{size:c}),d!=null&&(0,l.jsx)(ve,{className:`stratus-screen-loader__title`,variant:`h3`,as:`div`,children:d}),o!=null&&(0,l.jsx)(`div`,{className:`stratus-screen-loader__children`,children:o})]})});return m?x:typeof document>`u`?null:(0,u.createPortal)(x,p??document.body)});Mt.displayName=`ScreenLoader`;function Nt(){return(0,l.jsx)(Ee,{size:16})}var Pt=(0,c.forwardRef)(function(e,t){let{children:n,className:r,content:i,title:a,showClose:o=!1,closeIcon:s,footer:u,placement:d=`bottom`,trigger:f=`click`,open:p,arrow:m=!0,closeOnClickOutside:h=!0,tooltipRef:g,zIndex:_=1400,maxWidth:v=`300px`,style:y,keepMounted:b=!1,disablePortal:x=!1,onOpen:S,onClose:C}=e,w=(0,c.useRef)(null),T=g??w,E=a!=null||o,D=(0,l.jsxs)(`div`,{className:`stratus-popover__container`,children:[E&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`stratus-popover__header`,children:[a!=null&&(0,l.jsx)(`span`,{className:`stratus-popover__header-title`,children:a}),o&&(0,l.jsx)(z,{variant:`ghost`,"aria-label":`Close popover`,className:`stratus-popover__header-close`,onClick:()=>{T&&`current`in T&&T.current?.close()},children:s??(0,l.jsx)(Nt,{})})]}),(0,l.jsx)(`hr`,{className:`stratus-popover__divider`})]}),(0,l.jsx)(`div`,{className:`stratus-popover__content`,children:i}),u!=null&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`hr`,{className:`stratus-popover__divider`}),(0,l.jsx)(`div`,{className:`stratus-popover__footer`,children:u})]})]});return(0,l.jsx)(re,{ref:t,className:k(`stratus-popover`,r),content:D,placement:d,trigger:f,open:p,arrow:m,closeOnClickOutside:h,tooltipRef:T,zIndex:_,maxWidth:v,fontSize:`1rem`,style:y,keepMounted:b,disablePortal:x,onOpen:S,onClose:C,children:n})});Pt.displayName=`Popover`;function Ft({helperText:e,helperIcon:t}){return e?(0,l.jsxs)(`div`,{className:`stratus-input__helper`,children:[t&&(0,l.jsx)(`span`,{className:`stratus-input__helper-icon`,children:t}),(0,l.jsx)(`span`,{children:e})]}):null}function It({label:e,meta:t,htmlFor:n}){return!e&&!t?null:(0,l.jsxs)(`div`,{className:`stratus-input__label-row`,children:[e&&(0,l.jsx)(`label`,{className:`stratus-input__label`,htmlFor:n,children:e}),t&&(0,l.jsx)(`span`,{className:`stratus-input__meta`,children:t})]})}var Lt=(0,c.forwardRef)(function(e,t){let{children:n,className:r,style:i,inputRef:a,inputProps:o={},type:s=`text`,variant:u=`default`,label:d,meta:f,helperText:p,helperIcon:m,value:h,defaultValue:g,placeholder:_,startAdornment:v,endAdornment:y,outlineWidth:b,multiple:x=!1,compact:S=!1,fullWidth:C=!1,forceFocus:w=!1,disabled:T=!1,onChange:E,onFocus:D,onBlur:O,...A}=e,{cssProps:j,otherProps:M}=I(A),N=(0,c.useId)(),P=o.id??N,[F,L]=(0,c.useState)(g??``),R=h!==void 0,z=R?h:F,B=(0,c.useRef)(null),V=(0,c.useCallback)(e=>{B.current=e,a&&(a.current=e)},[a]),H=e=>{let t=e.target.value;R||L(t),E?.(t,e)},U=e=>{D?.(String(z),e)},ee=e=>{O?.(String(z),e)},te=k(`stratus-input`,`stratus-input--${u}`,S&&`stratus-input--compact`,C&&`stratus-input--full-width`,T&&`stratus-input--disabled`,w&&`stratus-input--force-focus`,r),ne={...b?{"--stratus-input-outline-w":b}:{},...i,...j},re=x?`textarea`:`input`;return(0,l.jsxs)(`div`,{ref:t,className:te,style:Object.keys(ne).length?ne:void 0,...M,children:[(0,l.jsx)(It,{label:d,meta:f,htmlFor:P}),(0,l.jsxs)(`div`,{className:`stratus-input__wrapper`,children:[v&&(0,l.jsx)(`span`,{className:`stratus-input__start-adornment`,children:v}),n??(0,l.jsx)(re,{...o,ref:V,id:P,type:x?void 0:s,className:k(`stratus-input__input`,x&&`stratus-input__input--textarea`,o.className),value:z,placeholder:_,disabled:T,onChange:H,onFocus:U,onBlur:ee}),y&&(0,l.jsx)(`span`,{className:`stratus-input__end-adornment`,children:y})]}),(0,l.jsx)(Ft,{helperText:p,helperIcon:m})]})}),Rt=(0,c.forwardRef)(function(e,t){let{inputRef:n,inputProps:r={},defaultChecked:i=!1,checked:a,variant:o=`default`,label:s,labelPlacement:u=`right`,color:d=`primary`,compact:f=!1,disabled:p=!1,disableRipple:m=!1,onChange:h,...g}=e,{cssProps:_,otherProps:v}=I(g),{className:y,style:b,...x}=v,[S,C]=(0,c.useState)(i),w=a!==void 0,T=w?a:S,E=(0,c.useRef)(null),D=(0,c.useCallback)(e=>{E.current=e,n&&(n.current=e)},[n]),O=e=>{w||C(e.target.checked),h?.(e)},A=k(`stratus-switch`,o===`small`&&`stratus-switch--small`,`stratus-switch--${d}`,f&&`stratus-switch--compact`,p&&`stratus-switch--disabled`,m&&`stratus-switch--no-ripple`,y),j={...b,..._},M=s?(0,l.jsx)(`span`,{className:`stratus-switch__label`,children:s}):null;return(0,l.jsxs)(`label`,{ref:t,className:A,style:Object.keys(j).length?j:void 0,...x,children:[u===`left`&&M,(0,l.jsx)(`input`,{...r,ref:D,type:`checkbox`,role:`switch`,className:`stratus-switch__input`,checked:T,disabled:p,onChange:O}),(0,l.jsx)(`span`,{className:`stratus-switch__track-wrapper`,children:(0,l.jsx)(`span`,{className:`stratus-switch__track`,children:(0,l.jsx)(`span`,{className:`stratus-switch__thumb`})})}),u===`right`&&M]})});function zt({size:e}){return(0,l.jsx)(`svg`,{className:`stratus-checkbox__icon stratus-checkbox__icon--unchecked`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`var(--stratus-surface, #fff)`,stroke:`currentColor`,strokeWidth:`2`})})}function Bt({size:e}){return(0,l.jsxs)(`svg`,{className:`stratus-checkbox__icon stratus-checkbox__icon--checked`,width:e,height:e,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`currentColor`}),(0,l.jsx)(`path`,{d:`M9 12l2 2 4-4`,stroke:`white`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Vt({size:e}){return(0,l.jsxs)(`svg`,{className:`stratus-checkbox__icon stratus-checkbox__icon--indeterminate`,width:e,height:e,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`currentColor`}),(0,l.jsx)(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`,stroke:`white`,strokeWidth:`2`,strokeLinecap:`round`})]})}var Ht=(0,c.forwardRef)(function(e,t){let{className:n,style:r,inputRef:i,inputProps:a={},defaultChecked:o=!1,checked:s,label:u,labelPlacement:d=`right`,color:f=`primary`,indeterminate:p=!1,uncheckedIcon:m,checkedIcon:h,indeterminateIcon:g,iconSize:_=24,compact:v=!1,disabled:y=!1,disableRipple:b=!1,onChange:x,...S}=e,{cssProps:C,otherProps:w}=I(S),[T,E]=(0,c.useState)(o),D=s!==void 0,O=D?s:T,A=(0,c.useRef)(null),j=(0,c.useCallback)(e=>{A.current=e,i&&(i.current=e)},[i]);(0,c.useEffect)(()=>{A.current&&(A.current.indeterminate=p)},[p]);let M=e=>{D||E(e.target.checked),x?.(e)},N=(0,c.useRef)(null),P=e=>{b||y||e.button===0&&N.current?.triggerAt(e.clientX,e.clientY)},F;F=p?g??(0,l.jsx)(Vt,{size:_}):O?h??(0,l.jsx)(Bt,{size:_}):m??(0,l.jsx)(zt,{size:_});let L=k(`stratus-checkbox`,`stratus-checkbox--${f}`,v&&`stratus-checkbox--compact`,y&&`stratus-checkbox--disabled`,b&&`stratus-checkbox--no-ripple`,n),z={...r,...C},B=u?(0,l.jsx)(`span`,{className:`stratus-checkbox__label`,children:u}):null;return(0,l.jsxs)(`label`,{ref:t,className:L,style:Object.keys(z).length?z:void 0,onPointerDown:P,...w,children:[d===`left`&&B,(0,l.jsx)(`input`,{...a,ref:j,type:`checkbox`,className:`stratus-checkbox__input`,checked:O,disabled:y,onChange:M,"data-indeterminate":p||void 0}),(0,l.jsxs)(`span`,{className:`stratus-checkbox__icon-wrapper`,children:[(0,l.jsx)(R,{ref:N,disabled:b||y}),F]}),d===`right`&&B]})});function Ut(){return(0,l.jsx)(`span`,{className:`stratus-select__chevron`,children:(0,l.jsx)(`svg`,{width:`10`,height:`5`,viewBox:`0 0 10 5`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M0 0l5 5 5-5z`})})})}function Wt({onClear:e}){return(0,l.jsx)(`button`,{type:`button`,className:`stratus-select__clear`,onClick:e,"aria-label":`Clear`,children:`✕`})}function Gt({helperText:e,helperIcon:t}){return e?(0,l.jsxs)(`div`,{className:`stratus-select__helper`,children:[t&&(0,l.jsx)(`span`,{className:`stratus-input__helper-icon`,children:t}),(0,l.jsx)(`span`,{children:e})]}):null}function Kt({label:e,meta:t,htmlFor:n}){return!e&&!t?null:(0,l.jsxs)(`div`,{className:`stratus-select__label-row`,children:[e&&(0,l.jsx)(`label`,{className:`stratus-select__label`,htmlFor:n,children:e}),t&&(0,l.jsx)(`span`,{className:`stratus-select__meta`,children:t})]})}function qt(e){return e==null||e===``?[]:Array.isArray(e)?e.filter(e=>e!==``&&e!=null):[e]}function Jt(e){let t=[];for(let n of e)n.type===`optgroup`&&n.options?t.push(...Jt(n.options)):t.push(n);return t}function Yt(e){return String(e.value??e.label)}function Xt(e){let t=[];return c.Children.forEach(e,e=>{if((0,c.isValidElement)(e)){if(e.type===`option`){let{value:n,disabled:r,children:i}=e.props;t.push({label:String(i??``),value:n===void 0?String(i??``):n,disabled:!!r})}else if(e.type===`optgroup`){let{label:n,disabled:r,children:i}=e.props;t.push({type:`optgroup`,label:String(n??``),disabled:!!r,options:Xt(i)})}}}),t}function Zt({tags:e,infield:t,selectedIds:n,allFlat:r,tagMaxCount:i,tagMaxCountPlaceholder:a,selectedLabel:o,onTagRemove:s}){if(e&&t){if(n.length===0)return null;let e=r.filter(e=>n.map(String).includes(String(Yt(e))));return i!==void 0&&e.length>i?(0,l.jsx)(`div`,{className:`stratus-select__tags`,children:(0,l.jsx)(`span`,{className:`stratus-select__tag`,children:typeof a==`function`?a(e.length):a??`${e.length} selected`})}):(0,l.jsx)(`div`,{className:`stratus-select__tags`,children:e.map(e=>(0,l.jsxs)(`span`,{className:`stratus-select__tag`,children:[e.label,(0,l.jsx)(`button`,{type:`button`,className:`stratus-select__tag-close`,onClick:t=>s(Yt(e),t),children:`✕`})]},Yt(e)))})}return t?(0,l.jsx)(`span`,{className:`stratus-select__selected-label`,children:typeof o==`function`?o(n.length,r.length):`${n.length}/${r.length} ${o}`}):null}var Qt=(0,c.forwardRef)(function(e,t){let{children:n,className:r,style:i,selectRef:a,inputRef:o,options:s=[],value:u,defaultValue:d,inputValue:f,variant:p=`default`,label:m,meta:h,placeholder:g,helperText:_,helperIcon:v,startAdornment:y,endAdornment:b,allowClear:x=!0,multiple:S=!1,expandable:C=!1,infield:w=!0,tags:T=!1,tagMaxCount:E,tagMaxCountPlaceholder:D,selectedLabel:O=`Selected`,filterOption:A=!0,noOptionsText:j=`No Data`,hideDropdownWhenEmpty:M=!1,persistInputText:N=!1,compact:P=!1,fullWidth:F=!1,disabled:L=!1,onSelect:R,onDeselect:z,onClear:B,onChange:V,itemGroupRenderer:H,itemRenderer:U,...ee}=e,{cssProps:te,otherProps:ne}=I(ee),re=(0,c.useId)(),[W,G]=(0,c.useState)(!1),[ie,ae]=(0,c.useState)(()=>qt(d)),[oe,se]=(0,c.useState)(``),[ce,le]=(0,c.useState)(-1),[ue,de]=(0,c.useState)(new Set),fe=u!==void 0,K=fe?qt(u):ie,pe=f===void 0?oe:f,me=(0,c.useRef)(null),he=(0,c.useRef)(null),ge=(0,c.useRef)(null),_e=(0,c.useCallback)(e=>{me.current=e,o&&(o.current=e)},[o]);(0,c.useImperativeHandle)(a,()=>({open:()=>{G(!0),me.current?.focus()},close:()=>G(!1)}),[]),(0,c.useEffect)(()=>{if(!W)return;let e=e=>{he.current&&!he.current.contains(e.target)&&(G(!1),se(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[W]);let ve=(0,c.useMemo)(()=>Xt(n),[n]),ye=(0,c.useMemo)(()=>s.length>0?s:ve,[s,ve]),be=(0,c.useMemo)(()=>Jt(ye),[ye]),xe=(0,c.useCallback)(e=>!A||!pe?!0:typeof A==`function`?A(e,pe,K.map(String)):e.label.toLowerCase().includes(pe.toLowerCase()),[A,pe,K]),Se=(0,c.useMemo)(()=>be.filter(e=>!e.disabled&&xe(e)),[be,xe]);(0,c.useEffect)(()=>{le(-1)},[W,Se.length]),(0,c.useEffect)(()=>{if(ce<0||!ge.current)return;let e=Se[ce];if(!e)return;let t=String(e.value??e.label);ge.current.querySelector(`[data-option-id="${CSS.escape(t)}"]`)?.scrollIntoView({block:`nearest`})},[ce,Se]);let Ce=(0,c.useMemo)(()=>S||K.length===0?``:be.find(e=>String(e.value??e.label)===String(K[0]))?.label??String(K[0]),[S,K,be]),we=(0,c.useCallback)((e,t)=>{let n=Yt(e),r=K.map(String).includes(String(n)),i;if(S)if(r){i=K.filter(e=>String(e)!==String(n)),fe||ae(i);let r={selectedValue:i,deselectedValue:e.value??e.label,options:be.filter(e=>i.map(String).includes(String(Yt(e))))};z?.(r,t)}else{i=[...K,e.value??e.label],fe||ae(i);let n={selectedValue:i,options:be.filter(e=>i.map(String).includes(String(Yt(e))))};R?.(n,t)}else{i=[e.value??e.label],fe||ae(i),G(!1),se(``);let n={selectedValue:e.value??e.label,options:[e]};R?.(n,t)}},[K,S,fe,be,R,z]),Te=(0,c.useCallback)(e=>{if(!L)switch(e.key){case`ArrowDown`:e.preventDefault(),W?le(e=>e<Se.length-1?e+1:0):G(!0);break;case`ArrowUp`:e.preventDefault(),W&&le(e=>e>0?e-1:Se.length-1);break;case`Enter`:if(e.preventDefault(),W&&ce>=0){let t=Se[ce];t&&we(t,e)}else W||G(!0);break;case`Escape`:W&&(e.preventDefault(),G(!1));break}},[L,W,ce,Se,we]),Ee=(0,c.useCallback)(e=>{e.stopPropagation(),fe||ae([]),se(``),B?.(e)},[fe,B]),De=(0,c.useCallback)((e,t)=>{t.stopPropagation();let n=be.find(t=>String(Yt(t))===String(e));n&&we(n,t)},[be,we]),Oe=(0,c.useCallback)(e=>{de(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ke=(0,c.useCallback)(e=>{if(!A)return;let t=e.target.value;se(t),V?.(t),W||G(!0)},[A,W,V]);function Ae(e){let t=[];for(let n of e){if(n.type===`optgroup`&&n.options){let e=Ae(n.options).filter(Boolean);if(e.length===0)continue;let r=C&&ue.has(n.label);H?t.push(H(n,r?[]:e,pe)):t.push((0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:k(`stratus-select__optgroup-label`,C&&`stratus-select__optgroup--expandable`),onClick:C?()=>Oe(n.label):void 0,children:[C&&(0,l.jsx)(`span`,{className:k(`stratus-select__optgroup-chevron`,r&&`stratus-select__optgroup-chevron--collapsed`),children:(0,l.jsx)(`svg`,{width:`10`,height:`5`,viewBox:`0 0 10 5`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M0 0l5 5 5-5z`})})}),n.label]}),!r&&e]},`group-${n.label}`));continue}if(!xe(n))continue;let e=Yt(n),r=K.map(String).includes(String(e)),i=Se[ce]===n;U?t.push((0,l.jsx)(`div`,{"data-option-id":e,className:k(i&&`stratus-select__option--highlighted`),onClick:n.disabled?void 0:e=>we(n,e),children:U(n,pe,K.map(String))},e)):t.push((0,l.jsxs)(`div`,{"data-option-id":e,className:k(`stratus-select__option`,r&&`stratus-select__option--selected`,i&&`stratus-select__option--highlighted`,n.disabled&&`stratus-select__option--disabled`),onClick:n.disabled?void 0:e=>we(n,e),children:[S&&(0,l.jsx)(`span`,{className:k(`stratus-select__checkbox`,r&&`stratus-select__checkbox--checked`,n.disabled&&`stratus-select__checkbox--disabled`),"aria-hidden":`true`,children:r&&(0,l.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`10`,height:`10`,children:(0,l.jsx)(`path`,{d:`M3 8.5l3 3 7-7`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),n.label]},e))}return t}let je=Ae(ye),Me=je.length>0,Ne=k(`stratus-select`,`stratus-select--${p}`,P&&`stratus-select--compact`,F&&`stratus-select--full-width`,L&&`stratus-select--disabled`,W&&`stratus-select--open`,A&&`stratus-select--filterable`,r),Pe={...i,...te},Fe=K.length>0||pe&&pe.length>0;return(0,l.jsxs)(`div`,{ref:e=>{he.current=e,typeof t==`function`?t(e):t&&(t.current=e)},className:Ne,style:Object.keys(Pe).length?Pe:void 0,...ne,children:[(0,l.jsx)(Kt,{label:m,meta:h,htmlFor:re}),(0,l.jsxs)(`div`,{className:`stratus-select__input-wrapper`,onClick:()=>{L||(G(e=>!e),me.current?.focus())},onKeyDown:Te,children:[y&&(0,l.jsx)(`span`,{className:`stratus-input__start-adornment`,children:y}),S&&T&&w&&K.length>0?(0,l.jsx)(Zt,{tags:T,infield:w,selectedIds:K,allFlat:be,tagMaxCount:E,tagMaxCountPlaceholder:D,selectedLabel:O,onTagRemove:De}):null,S&&!T&&w?(0,l.jsx)(Zt,{tags:T,infield:w,selectedIds:K,allFlat:be,tagMaxCount:E,tagMaxCountPlaceholder:D,selectedLabel:O,onTagRemove:De}):null,!(S&&T&&w&&K.length>0)&&!(S&&!T&&w)&&(0,l.jsx)(`input`,{ref:_e,id:re,type:`text`,className:`stratus-select__input`,value:A&&pe!==``&&(W||N)?pe:Ce,placeholder:K.length>0?void 0:g,disabled:L,onChange:ke,autoComplete:`off`}),b&&(0,l.jsx)(`span`,{className:`stratus-input__end-adornment`,children:b}),x&&Fe&&!L&&(0,l.jsx)(Wt,{onClear:Ee}),(0,l.jsx)(Ut,{})]}),W&&!(M&&!Me)&&(0,l.jsx)(`div`,{ref:ge,className:`stratus-select__dropdown`,children:Me?je:(0,l.jsx)(`div`,{className:`stratus-select__no-data`,children:j})}),(0,l.jsx)(Gt,{helperText:_,helperIcon:v})]})}),$t=new Set([`default`,`primary`,`secondary`,`success`,`warning`,`danger`,`disabled`]),en=L((e,t)=>{let{as:n,color:r,underline:i=`hover`,...a}=e,{cssProps:o,otherProps:s}=I(a),{className:c,style:u,rel:d,target:f,...p}=s,m=n??`a`,h=r&&$t.has(r),g=r&&!h,_=f&&m===`a`?Array.from(new Set([...String(d??``).split(/\s+/).filter(Boolean),`noreferrer`,`noopener`])).join(` `):d,v=k(`stratus-link`,h&&`stratus-link--${r}`,`stratus-link--underline-${i}`,c),y={...u,...o,...g?{color:r}:{}};return(0,l.jsx)(m,{ref:t,className:v,style:Object.keys(y).length?y:void 0,...p,target:f,rel:_})});en.displayName=`Link`;var tn=(0,c.forwardRef)(function(e,t){let{className:n,style:r,label:i,icon:a,disabled:o=!1,disableRipple:s=!1,children:u,color:d,...f}=e,{cssProps:p,otherProps:m}=I(f),h=(0,c.useRef)(null),g=e=>{m.onPointerDown?.(e),!(e.defaultPrevented||o||s)&&e.button===0&&h.current?.triggerAt(e.clientX,e.clientY)},_={...r,...p};return(0,l.jsxs)(`button`,{ref:t,type:`button`,className:k(`stratus-tab`,n),style:Object.keys(_).length?_:void 0,disabled:o,"aria-disabled":o||void 0,...m,onPointerDown:g,children:[a,i,!o&&!s&&(0,l.jsx)(R,{ref:h})]})}),nn=new Set([`primary`,`secondary`,`success`,`warning`,`danger`]),rn=(0,c.forwardRef)(function(e,t){let{className:n,style:r,tabsListAs:i=`div`,selectedTab:a,orientation:o=`horizontal`,textColor:s=`primary`,indicatorColor:u=`primary`,align:d=`flex-start`,fullWidth:f=!1,disabled:p=!1,onChange:m,children:h,...g}=e,{cssProps:_,otherProps:v}=I(g),y={...r,..._},b=nn.has(u),x=c.Children.toArray(h).map((e,t)=>{if(!(0,c.isValidElement)(e))return e;let n=e;return(0,c.cloneElement)(n,{className:k(n.props.className,t===a&&`stratus-tab--active`,s&&`stratus-tab--${s}`),color:s,disabled:p||n.props.disabled,onClick:e=>{m?.(t,e);let r=n.props.onClick;r?.(e)}})}),S=c.Children.toArray(h).map((e,t)=>{if(!(0,c.isValidElement)(e))return null;let n=e.props.children;if(!n)return null;let r=a!==t;return(0,l.jsx)(`div`,{className:k(`stratus-tabs__panel`,r&&`stratus-tabs__panel--hidden`),hidden:r,"aria-hidden":r,children:n},`stratus-tabs__panel--${t}`)}),C=S.some(Boolean);return(0,l.jsxs)(`div`,{className:k(`stratus-tabs-root`,`stratus-tabs-root--${o}`),children:[(0,l.jsx)(`div`,{ref:t,className:k(`stratus-tabs`,`stratus-tabs--${o}`,n),style:Object.keys(y).length?y:void 0,...v,children:(0,l.jsx)(`div`,{className:k(`stratus-tabs__container`,`stratus-tabs__container--${o}`),children:(0,l.jsx)(i,{className:k(`stratus-tabs__list`,`stratus-tabs__list--${o}`,f&&`stratus-tabs__list--fullwidth`,`stratus-tabs__indicator--${o}`,b&&`stratus-tabs__indicator--${u}`),style:{justifyContent:d},children:x})})}),C&&S]})}),an=new Set([0,1,2,3,4,5,6,8,12,16,24]);function on(e){let t=Math.round(e*.5),n=Math.round(e*.7),r=Math.round(e*-.2),i=e,a=Math.round(e*1.5),o=Math.round(e*.1),s=Math.round(e*1.8),c=Math.round(e*.35);return[`0px ${t}px ${n}px ${r}px rgba(0,0,0,0.2)`,`0px ${i}px ${a}px ${o}px rgba(0,0,0,0.14)`,`0px ${Math.round(e*.3)}px ${s}px ${c}px rgba(0,0,0,0.12)`].join(`,`)}var sn=L((e,t)=>{let{as:n,elevation:r=2,square:i=!1,...a}=e,{cssProps:o,otherProps:s}=I(a),{className:c,style:u,...d}=s,f=n??`div`,p=an.has(r),m={...u,...o,...!p&&r>0?{boxShadow:on(r)}:{}};return(0,l.jsx)(f,{ref:t,className:k(`stratus-paper`,i&&`stratus-paper--square`,p&&`stratus-paper--elevation-${r}`,c),style:Object.keys(m).length?m:void 0,...d})});sn.displayName=`Paper`;var cn=H({name:`search`,prefix:`eds`,height:`24`,width:`24`,svgPathData:`M14.966 14.255h.79l4.99 5-1.49 1.49-5-4.99v-.79l-.27-.28a6.47 6.47 0 0 1-4.23 1.57 6.5 6.5 0 1 1 6.5-6.5c0 1.61-.59 3.09-1.57 4.23zm-9.71-4.5c0 2.49 2.01 4.5 4.5 4.5s4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5-4.5 2.01-4.5 4.5`});function ln(){return(0,l.jsx)(cn,{size:16})}var un=(0,c.forwardRef)(function(e,t){let{className:n,inputValue:r,placeholder:i=`Search`,emptyOnStartTyping:a=!1,onSelect:o,onChange:s,onClear:u,filterOption:d=!0,hideDropdownWhenEmpty:f=!0,...p}=e,[,m]=(0,c.useState)(``),[h,g]=(0,c.useState)(r??``);return(0,c.useEffect)(()=>{r!==void 0&&g(r)},[r]),(0,l.jsx)(Qt,{ref:t,className:k(`stratus-input-search`,n),startAdornment:(0,l.jsx)(ln,{}),inputValue:h,placeholder:i,filterOption:d,hideDropdownWhenEmpty:f,persistInputText:!0,onSelect:(e,t)=>{if(!a&&e.selectedValue!=null){let t=e.options.find(t=>String(t.value??t.label)===String(e.selectedValue));t&&(m(t.label),g(t.label))}o?.(e,t)},onChange:e=>{g(a?``:e),s?.(e)},onClear:e=>{g(``),m(``),u?.(e)},...p})});function dn(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=dn(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function fn(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=fn(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var q=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return dn(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return fn(this,e,t,n)}findIndex(e){if(e==0)return mn(0,e);if(e==this.size)return mn(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?mn(t+1,i):mn(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};q.empty=new q([],0);var pn={index:0,offset:0};function mn(e,t){return pn.index=e,pn.offset=t,pn}function hn(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!hn(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!hn(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var gn=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&hn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};gn.none=[];var _n=class extends Error{},J=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=yn(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(vn(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(q.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};J.empty=new J(q.empty,0,0);function vn(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(vn(a.content,t-i-1,n-i-1)))}function yn(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=yn(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function bn(e,t,n){if(n.openStart>e.depth)throw new _n(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new _n(`Inconsistent open depths`);return xn(e,t,n,0)}function xn(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=xn(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return En(a,On(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return En(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=kn(n,e);return En(a,Dn(e,i,o,t,r))}}function Sn(e,t){if(!t.type.compatibleContent(e.type))throw new _n(`Cannot join `+t.type.name+` onto `+e.type.name)}function Cn(e,t,n){let r=e.node(n);return Sn(r,t.node(n)),r}function wn(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Tn(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(wn(e.nodeAfter,r),a++));for(let e=a;e<o;e++)wn(i.child(e),r);t&&t.depth==n&&t.textOffset&&wn(t.nodeBefore,r)}function En(e,t){return e.type.checkContent(t),e.copy(t)}function Dn(e,t,n,r,i){let a=e.depth>i&&Cn(e,t,i+1),o=r.depth>i&&Cn(n,r,i+1),s=[];return Tn(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Sn(a,o),wn(En(a,Dn(e,t,n,r,i+1)),s)):(a&&wn(En(a,On(e,t,i+1)),s),Tn(t,n,i,s),o&&wn(En(o,On(n,r,i+1)),s)),Tn(r,null,i,s),new q(s)}function On(e,t,n){let r=[];return Tn(null,e,n,r),e.depth>n&&wn(En(Cn(e,t,n+1),On(e,t,n+1)),r),Tn(t,null,n,r),new q(r)}function kn(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(q.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var An=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return gn.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Pn(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Nn.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Nn.set(t,r=new jn);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Mn,i}},jn=class{constructor(){this.elts=[],this.i=0}},Mn=12,Nn=new WeakMap,Pn=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Fn=Object.create(null),In=class e{constructor(e,t,n,r=gn.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||q.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&hn(this.attrs,t||e.defaultAttrs||Fn)&&gn.sameSet(this.marks,n||gn.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return J.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new J(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return bn(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return An.resolveCached(this,e)}resolveNoCache(e){return An.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Ln(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=q.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=gn.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!gn.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=q.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};In.prototype.text=void 0;function Ln(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Rn=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new zn(t,n);if(r.next==null)return e.empty;let i=Bn(r);r.next&&r.err(`Unexpected trailing text`);let a=Xn(qn(i));return Zn(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return q.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
2
2
|
`)}};Rn.empty=new Rn(!0);var zn=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Bn(e){let t=[];do t.push(Vn(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Vn(e){let t=[];do t.push(Hn(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Hn(e){let t=Kn(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Wn(e,t);else break;return t}function Un(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Wn(e,t){let n=Un(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Un(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Gn(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Kn(e){if(e.eat(`(`)){let t=Bn(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Gn(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function qn(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Jn(e,t){return t-e}function Yn(e,t){let n=[];return r(t),n.sort(Jn);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Xn(e){let t=Object.create(null);return n(Yn(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Yn(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Rn(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Jn);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Zn(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Qn(e){return e.tag!=null}function $n(e){return e.style!=null}var er=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Qn(e))this.tags.push(e);else if($n(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new lr(this,t,!1);return n.addAll(e,gn.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new lr(this,t,!0);return n.addAll(e,gn.none,t.from,t.to),J.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(dr(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=fr(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=fr(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},tr={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},nr={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},rr={ol:!0,ul:!0},ir=1,ar=2,or=4;function sr(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?ir:0)|(t===`full`?ar:0)}var cr=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=gn.none,this.match=i||(a&or?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(q.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ir)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=q.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(q.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!tr.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},lr=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=sr(null,t.preserveWhitespace,0)|(n?or:0);i=r?new cr(r.type,r.attrs,gn.none,!0,t.topMatch||r.type.contentMatch,a):n?new cr(null,null,gn.none,!0,null,a):new cr(e.schema.topNodeType,null,gn.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&ar?`full`:this.localPreserveWS||(r.options&ir)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;rr.hasOwnProperty(a)&&this.parser.normalizeLists&&ur(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:nr.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(tr.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=gn.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):pr(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=sr(e,i,a.options);a.options&or&&a.content.length==0&&(o|=or);let s=gn.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):pr(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new cr(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=ir);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function ur(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&rr.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function dr(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function fr(e){let t={};for(let n in e)t[n]=e[n];return t}function pr(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var mr=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=gr(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=br(gr(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&br(gr(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return br(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=hr(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return hr(e.marks)}};function hr(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function gr(e){return e.document||window.document}var _r=new WeakMap;function vr(e){let t=_r.get(e);return t===void 0&&_r.set(e,t=yr(e)),t}function yr(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function br(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=vr(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=br(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var xr=65535,Sr=2**16;function Cr(e,t){return e+t*Sr}function wr(e){return e&xr}function Tr(e){return(e-(e&xr))/Sr}var Er=1,Dr=2,Or=4,kr=8,Ar=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&kr)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Or)>0}},jr=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=wr(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+Tr(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Cr(o/3,e-s),f=e==s?Dr:e==u?Er:Or;return(t<0?e!=s:e!=u)&&(f|=kr),new Ar(a,f,d)}r+=l-c}return n?e+r:new Ar(e+r,0,null)}touches(e,t){let n=0,r=wr(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};jr.empty=new jr([]);var Mr=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Ar(e,r,null)}},Nr=Object.create(null),Pr=class{getMap(){return jr.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Nr[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Nr)throw RangeError(`Duplicate use of step JSON ID `+e);return Nr[e]=t,t.prototype.jsonID=e,t}},Fr=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof _n)return e.fail(t.message);throw t}}};function Ir(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Ir(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return q.fromArray(r)}var Lr=class e extends Pr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new J(Ir(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Fr.fromReplace(e,this.from,this.to,i)}invert(){return new Rr(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Pr.jsonID(`addMark`,Lr);var Rr=class e extends Pr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new J(Ir(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Fr.fromReplace(e,this.from,this.to,n)}invert(){return new Lr(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Pr.jsonID(`removeMark`,Rr);var zr=class e extends Pr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Fr.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Fr.fromReplace(e,this.pos,this.pos+1,new J(q.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Br(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Pr.jsonID(`addNodeMark`,zr);var Br=class e extends Pr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Fr.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Fr.fromReplace(e,this.pos,this.pos+1,new J(q.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new zr(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Pr.jsonID(`removeNodeMark`,Br);var Vr=class e extends Pr{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Ur(e,this.from,this.to)?Fr.fail(`Structure replace would overwrite content`):Fr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new jr([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?J.empty:new J(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?J.empty:new J(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,J.fromJSON(t,n.slice),!!n.structure)}};Pr.jsonID(`replace`,Vr);var Hr=class e extends Pr{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Ur(e,this.from,this.gapFrom)||Ur(e,this.gapTo,this.to)))return Fr.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Fr.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Fr.fromReplace(e,this.from,this.to,n):Fr.fail(`Content does not fit in gap`)}getMap(){return new jr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,J.fromJSON(t,n.slice),n.insert,!!n.structure)}};Pr.jsonID(`replaceAround`,Hr);function Ur(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Wr(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}var Gr=class e extends Pr{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Fr.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Fr.fromReplace(e,this.pos,this.pos+1,new J(q.from(r),0,+!t.isLeaf))}getMap(){return jr.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Pr.jsonID(`attr`,Gr);var Kr=class e extends Pr{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Fr.ok(n)}getMap(){return jr.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Pr.jsonID(`docAttr`,Kr);var qr=class extends Error{};qr=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},qr.prototype=Object.create(Error.prototype),qr.prototype.constructor=qr,qr.prototype.name=`TransformError`;var Jr=Object.create(null),Y=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Yr(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=J.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?J.empty:t),o==0&&ri(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),ri(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new X(e):ni(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?ni(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):ni(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new ei(e.node(0))}static atStart(e){return ni(e,e,0,0,1)||new ei(e)}static atEnd(e){return ni(e,e,e.content.size,e.childCount,-1)||new ei(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=Jr[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Jr)throw RangeError(`Duplicate use of selection JSON ID `+e);return Jr[e]=t,t.prototype.jsonID=e,t}getBookmark(){return X.between(this.$anchor,this.$head).getBookmark()}};Y.prototype.visible=!0;var Yr=class{constructor(e,t){this.$from=e,this.$to=t}},Xr=!1;function Zr(e){!Xr&&!e.parent.inlineContent&&(Xr=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var X=class e extends Y{constructor(e,t=e){Zr(e),Zr(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Y.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=J.empty){if(super.replace(e,t),t==J.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Qr(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=Y.findFrom(n,r,!0)||Y.findFrom(n,-r,!0);if(e)n=e.$head;else return Y.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Y.findFrom(t,-r,!0)||Y.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};Y.jsonID(`text`,X);var Qr=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return X.between(e.resolve(this.anchor),e.resolve(this.head))}},Z=class e extends Y{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?Y.near(a):new e(a)}content(){return new J(q.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new $r(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};Z.prototype.visible=!1,Y.jsonID(`node`,Z);var $r=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Qr(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Z.isSelectable(n)?new Z(t):Y.near(t)}},ei=class e extends Y{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=J.empty){if(t==J.empty){e.delete(0,e.doc.content.size);let t=Y.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return ti}};Y.jsonID(`all`,ei);var ti={map(){return this},resolve(e){return new ei(e)}};function ni(e,t,n,r,i,a=!1){if(t.inlineContent)return X.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=ni(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&Z.isSelectable(r))return Z.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function ri(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Vr||i instanceof Hr))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(Y.near(e.doc.resolve(o),n))}function ii(e,t){return!t||!e?e:e.bind(t)}var ai=class{constructor(e,t,n){this.name=e,this.init=ii(t.init,n),this.apply=ii(t.apply,n)}};new ai(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new ai(`selection`,{init(e,t){return e.selection||Y.atStart(t.doc)},apply(e){return e.selection}}),new ai(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new ai(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function oi(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=oi(i,t,{})),n[r]=i}return n}var si=class{constructor(e){this.spec=e,this.props={},e.props&&oi(e.props,this,this.props),this.key=e.key?e.key.key:li(`plugin`)}getState(e){return e[this.key]}},ci=Object.create(null);function li(e){return e in ci?e+`$`+ ++ci[e]:(ci[e]=0,e+`$`)}var ui=class{constructor(e=`key`){this.key=li(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};function di(e={}){return new si({view(t){return new fi(t,e)}})}var fi=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=Wr(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};function pi(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=pi(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function mi(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=mi(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var Q=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return pi(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return mi(this,e,t,n)}findIndex(e){if(e==0)return gi(0,e);if(e==this.size)return gi(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?gi(t+1,i):gi(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};Q.empty=new Q([],0);var hi={index:0,offset:0};function gi(e,t){return hi.index=e,hi.offset=t,hi}function _i(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!_i(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!_i(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var vi=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&_i(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};vi.none=[];var yi=class extends Error{},$=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=xi(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(bi(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(Q.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};$.empty=new $(Q.empty,0,0);function bi(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(bi(a.content,t-i-1,n-i-1)))}function xi(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=xi(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function Si(e,t,n){if(n.openStart>e.depth)throw new yi(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new yi(`Inconsistent open depths`);return Ci(e,t,n,0)}function Ci(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Ci(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return Oi(a,Ai(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Oi(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=ji(n,e);return Oi(a,ki(e,i,o,t,r))}}function wi(e,t){if(!t.type.compatibleContent(e.type))throw new yi(`Cannot join `+t.type.name+` onto `+e.type.name)}function Ti(e,t,n){let r=e.node(n);return wi(r,t.node(n)),r}function Ei(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Di(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Ei(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Ei(i.child(e),r);t&&t.depth==n&&t.textOffset&&Ei(t.nodeBefore,r)}function Oi(e,t){return e.type.checkContent(t),e.copy(t)}function ki(e,t,n,r,i){let a=e.depth>i&&Ti(e,t,i+1),o=r.depth>i&&Ti(n,r,i+1),s=[];return Di(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(wi(a,o),Ei(Oi(a,ki(e,t,n,r,i+1)),s)):(a&&Ei(Oi(a,Ai(e,t,i+1)),s),Di(t,n,i,s),o&&Ei(Oi(o,Ai(n,r,i+1)),s)),Di(r,null,i,s),new Q(s)}function Ai(e,t,n){let r=[];return Di(null,e,n,r),e.depth>n&&Ei(Oi(Ti(e,t,n+1),Ai(e,t,n+1)),r),Di(t,null,n,r),new Q(r)}function ji(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Q.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Mi=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return vi.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ii(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Fi.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Fi.set(t,r=new Ni);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Pi,i}},Ni=class{constructor(){this.elts=[],this.i=0}},Pi=12,Fi=new WeakMap,Ii=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Li=Object.create(null),Ri=class e{constructor(e,t,n,r=vi.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Q.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&_i(this.attrs,t||e.defaultAttrs||Li)&&vi.sameSet(this.marks,n||vi.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return $.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new $(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Si(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Mi.resolveCached(this,e)}resolveNoCache(e){return Mi.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),zi(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=Q.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=vi.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!vi.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=Q.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Ri.prototype.text=void 0;function zi(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Bi=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Vi(t,n);if(r.next==null)return e.empty;let i=Hi(r);r.next&&r.err(`Unexpected trailing text`);let a=Qi(Yi(i));return $i(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return Q.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|