@spteck/react-controls-v2 2.5.7 → 2.5.8

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.
@@ -10,6 +10,8 @@ export interface PopupProps {
10
10
  excludeRefs?: React.RefObject<HTMLElement>[];
11
11
  children: React.ReactNode;
12
12
  theme?: Theme;
13
+ className?: string;
14
+ styles?: React.CSSProperties;
13
15
  }
14
16
  export declare const Popup: React.FC<PopupProps>;
15
17
  //# sourceMappingURL=Popup.d.ts.map
package/dist/index.cjs CHANGED
@@ -28,7 +28,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
28
28
  &::-webkit-scrollbar-thumb:hover {
29
29
  background: ${i.tokens.colorBrandBackgroundHover} !important;
30
30
  }
31
- `},[u])}},$e=e=>{let{children:r,className:i,onScroll:a}=e,{gridStyles:o,scrollbarClassName:s}=Qe(e),l=t.useRef(null),[u,d]=t.useState(0),[f,p]=t.useState(0);return t.useEffect(()=>{let e;return l.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;d(e),p(n)}}),e.observe(l.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{className:[i,s].filter(Boolean).join(` `),style:o(u,f),ref:l,onScroll:t.useCallback(e=>{if(!a)return;let{scrollTop:t,scrollHeight:n,clientHeight:r}=e.currentTarget;(t+r)/n>=.95&&a(e)},[a]),children:r})})},et=e=>{let{maxWith:n}=e,{getBaseStyles:r}=Se();return{rootStyles:t.useCallback((t,i)=>({...r(e,t,i),maxWidth:n}),[r,n,e]),layoutGridStyles:(0,l.css)({display:`grid`,overflow:`hidden`})}},tt={areas:[`header header header`,`sidebar content sidebar`,`footer footer footer`],columns:`1fr 3fr 1fr`,rows:`auto 1fr auto`},nt=e=>{let{className:r,children:a,layoutConfig:o=tt}=e,s=t.useRef(null),[l,u]=t.useState(0),[d,f]=t.useState(0),{rootStyles:p,layoutGridStyles:m}=et({...e,layoutConfig:o}),h=((e,n)=>{let r;return t.useCallback((...t)=>{clearTimeout(r),r=setTimeout(()=>e(...t),n)},[e,n])})((e,t)=>{u(e),f(t)},200);return t.useEffect(()=>{if(!s.current)return;let e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;h(e,n)}});return e.observe(s.current),()=>e.disconnect()},[h]),(0,n.jsx)(`div`,{id:`-Layout`,className:(0,i.mergeClasses)(r,m),style:{...p(l,d),gridTemplateAreas:o.areas.join(` `),gridTemplateColumns:o.columns,gridTemplateRows:o.rows},ref:s,children:t.Children.map(a,(e,r)=>t.isValidElement(e)?(0,n.jsx)(`div`,{style:{gridArea:e.props?.area??`area-${r}`},children:e},r):e)})},rt=e=>{let{area:t,children:r}=e;return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{style:{gridArea:t},children:r})})},it=e=>{let{verticalSpacing:n,horizontalSpacing:r}=e,{getSpacing:i}=Se();return{spaceStyles:t.useCallback(e=>e?r?{width:i(r,e,`horizontal`)}:n?{height:i(n,e,`vertical`)}:{}:{},[i,r,n])}},at=e=>{let r=t.useRef(null),[i,a]=t.useState(0),{spaceStyles:o}=it(e);return t.useEffect(()=>{let e;return r.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e}=t.contentRect;a(e)}}),e.observe(r.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{id:`-space`,style:o(i),ref:r})})},ot=e=>{let{horizontal:n,horizontalAlign:r,verticalAlign:i,verticalFill:a,wrap:o,columnGap:s,RowGap:c}=e,{getBaseStyles:l}=Se();return{stackStyles:t.useCallback((t,u)=>{let d=i||`start`,f=n?r:`start`,p=n?{flexFlow:o?`row wrap`:`row nowrap`,height:`100%`}:{height:`100%`,maxHeight:`100%`},m=l(e,t,u);return{columnGap:s,rowGap:c,display:`flex`,flexDirection:n?`row`:`column`,alignItems:d,justifyContent:f,...p,height:a?`100%`:m.height,...m,...e.styles}},[l,n,r,e,i,a,o])}},B=e=>{let{children:r,className:i}=e,{stackStyles:a}=ot(e),o=t.useRef(null),[s,l]=t.useState(0),[u,d]=t.useState(0);return t.useEffect(()=>{let e;return o.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;l(e),d(n)}}),e.observe(o.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{className:i,style:a(s,u),ref:o,children:r})})},st=e=>{let{children:r,grow:i,disableShrink:a,shrink:o,order:s,alignSelf:l,verticalFill:u}=e,{getBaseStyles:d}=Se(),f=t.useRef(null),[p,m]=t.useState(0),[h,g]=t.useState(0),_=d(e,p,h);return t.useEffect(()=>{let e;return f.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;m(e),g(n)}}),e.observe(f.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{ref:f,style:{..._,alignSelf:l,order:s,height:u?`100%`:`auto`,flexGrow:i?typeof i==`boolean`?1:i:void 0,flexShrink:a||!i&&!o?0:1,minWidth:0,minHeight:0,width:`auto`},children:r})})},ct=({ratio:e,children:t,maxWidth:r,maxHeight:i,style:a={},...o})=>{let s={position:`relative`,width:`100%`,paddingTop:`${100/e}%`,maxWidth:r||`none`,maxHeight:i||`none`,...a},c={position:`absolute`,top:0,left:0,width:`100%`,height:`100%`};return(0,n.jsx)(`div`,{style:s,...o,children:(0,n.jsx)(`div`,{style:c,children:t})})},lt=e=>{let{styles:n}=e,{getBaseStyles:r}=Se();return{aspectRatioStyles:t.useCallback((t,i)=>({...r(e,t,i),...n}),[r,e,n])}},ut=e=>{let{styles:n}=e,{getBaseStyles:r}=Se();return{centerStyles:t.useCallback((t,i)=>({...r(e,t,i),...n,overflow:`hidden`,display:`flex`,justifyContent:`center`,alignItems:`center`,width:`100%`,height:`100%`}),[r,e,n]),childrenStyles:(0,l.css)({justifyContent:`center`,textAlign:`center`})}},dt=e=>{let{className:r,children:i}=e,a=t.useRef(null),[o,s]=t.useState(0),[l,u]=t.useState(0),{centerStyles:d}=ut(e),f=(e,t)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}};return t.useEffect(()=>{let e=f(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;s(e),u(n)}},200),t=new c.ResizeObserver(t=>{e(t)});return a.current&&t.observe(a.current),()=>{t.disconnect()}},[]),(0,n.jsx)(`div`,{id:`center`,className:r,style:{...d(o,l),display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100%`,width:`100%`},ref:a,children:i})},ft=e=>{let{maxWidth:n}=e,{getBaseStyles:r}=Se();return{containerStyles:t.useCallback((t,i)=>!t||!i?{}:{...r(e,t,i),maxWidth:n},[r,n,e])}},pt=e=>{let{className:r,children:i,style:a,alignItems:o=`center`,justifyContent:l=`center`,flexDirection:u=`row`,centerContent:d=!0}=e,f=t.useRef(null),[p,m]=t.useState(0),[h,g]=t.useState(0),{containerStyles:_}=ft(e),v=t.useMemo(()=>(0,s.debounce)(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;m(e),g(n)}},200),[]);t.useEffect(()=>{let e=new c.ResizeObserver(e=>{v(e)});return f.current&&e.observe(f.current),()=>{e.disconnect(),v.cancel()}},[v]);let y=t.useMemo(()=>{if(!a)return;let{padding:e,margin:t,...n}=a;return n},[a]);return(0,n.jsx)(`div`,{id:`container`,className:r,style:{..._(p,h),display:`flex`,justifyContent:l,alignItems:o,flexDirection:u,...y},ref:f,children:d?(0,n.jsx)(dt,{children:i}):i})},mt=e=>{let[n,r]=(0,t.useState)(!0),[i,a]=(0,t.useState)(!0),o=(0,t.useCallback)(()=>{e&&e.scrollPrev()},[e]),s=(0,t.useCallback)(()=>{e&&e.scrollNext()},[e]),c=(0,t.useCallback)(e=>{r(!e.canScrollPrev()),a(!e.canScrollNext())},[]);return(0,t.useEffect)(()=>{e&&(c(e),e.on(`reInit`,c),e.on(`select`,c))},[e,c]),{prevBtnDisabled:n,nextBtnDisabled:i,onPrevButtonClick:o,onNextButtonClick:s}},ht=(e,n)=>{let{getCurrentDevice:r}=Se(),a=t.useCallback(()=>{let e=r(n),t=`95%`;switch(e){case`Medium`:t=`45%`;break;case`Large`:t=`calc(95% / 4)`;break;case`ExtraLarge`:t=`calc(95% / 5)`;break;case`ExtraExtraLarge`:t=`calc(95% / 6)`;break;default:t=`95%`;break}return t},[n,r]),o=t.useCallback(()=>{let e=r(n),t=i.tokens.spacingVerticalM;switch(e){case`Medium`:t=i.tokens.spacingVerticalM;break;case`Large`:t=i.tokens.spacingVerticalL;break;case`ExtraLarge`:t=i.tokens.spacingVerticalXL;break;default:t=i.tokens.spacingVerticalM;break}return t},[n,r]);return{enableControls:(0,l.css)({display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:10,padding:5}),embla__viewport:(0,l.css)({overflow:`hidden`,paddingTop:`10px`,paddingBottom:`20px`}),embla__container:(0,l.css)({backfaceVisibility:`hidden`,display:`flex`,touchAction:`pan-y`}),embla:(0,l.css)({".embla":{}}),embla__slide:(0,l.css)({minWidth:0,flex:`0 0 ${a()}`,paddingLeft:`${o()}`}),embla__buttons:(0,l.css)({display:`grid`,gridTemplateColumns:`repeat(2, 1fr)`,gap:0,alignItems:`center`})}},gt=e=>{let{styles:n}=e,{getBaseStyles:r}=Se();return{carouselStyles:t.useCallback((t,i)=>({...r(e,t,i),...n}),[r,e,n])}},_t=()=>({titleStyles:(0,l.css)({display:`-webkit-box`,overflow:`hidden`,textOverflow:`ellipsis`,WebkitLineClamp:`1`,WebkitBoxOrient:`vertical`,textAlign:`start`})}),vt=e=>{let{className:r,items:a,title:o}=e,s=t.useRef(null),[l,f]=t.useState(0),[p,m]=t.useState(0),{carouselStyles:h}=gt(e),[g,_]=(0,u.default)(),v=_t(),{enableControls:y,embla__slide:b,embla__container:x,embla__viewport:S,embla__buttons:C}=ht(e,l),{prevBtnDisabled:w,nextBtnDisabled:T,onPrevButtonClick:E,onNextButtonClick:D}=mt(_);return t.useEffect(()=>{let e;return s.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;f(e),m(n)}}),f(s.current.clientWidth),m(s.current.clientHeight),e.observe(s.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(`div`,{id:`-carousel`,role:`region`,"aria-roledescription":`carousel`,"aria-label":o||`Carousel`,className:(0,i.mergeClasses)(r,`embla`),style:{...h(l,p)},ref:s,children:[(0,n.jsxs)(`div`,{className:y,children:[(0,n.jsx)(i.Subtitle2,{className:v.titleStyles,children:o}),(0,n.jsxs)(`div`,{className:C,children:[(0,n.jsx)(i.Button,{onClick:E,disabled:w,appearance:`subtle`,icon:(0,n.jsx)(d.ChevronLeftRegular,{}),"aria-label":`Previous slide`}),(0,n.jsx)(i.Button,{onClick:D,disabled:T,appearance:`subtle`,icon:(0,n.jsx)(d.ChevronRightRegular,{}),"aria-label":`Next slide`})]})]}),(0,n.jsx)(`div`,{className:S,ref:g,children:(0,n.jsx)(`div`,{className:x,children:a.map((e,t)=>(0,n.jsx)(`div`,{className:b,role:`group`,"aria-roledescription":`slide`,"aria-label":`Slide ${t+1} of ${a.length}`,children:e},t))})})]})})},yt=e=>{let{direction:t=`horizontal`,resizerSize:n=6}=e,r=t===`horizontal`;return{root:(0,l.css)({position:`relative`,width:`100%`,height:`100%`}),pane:e=>{let t=e===void 0?void 0:typeof e==`number`?`${e}px`:e;return(0,l.css)({overflow:`auto`,position:`relative`,...r?{width:t,height:`100%`}:{height:t,width:`100%`}})},secondaryPane:(0,l.css)({flex:1,overflow:`auto`,position:`relative`,minWidth:0,minHeight:0}),resizer:(0,l.css)({flex:`0 0 auto`,...r?{width:n,cursor:`col-resize`,height:`100%`}:{height:n,cursor:`row-resize`,width:`100%`},backgroundColor:i.tokens.colorNeutralStroke1,transition:`background-color 150ms ease`,userSelect:`none`,zIndex:1}),resizerActive:(0,l.css)({backgroundColor:i.tokens.colorBrandStroke1}),resizerGrip:(0,l.css)({gap:`2px`}),gripDot:(0,l.css)({width:3,height:3,borderRadius:`50%`,backgroundColor:i.tokens.colorNeutralForeground3})}},V={xs:i.tokens.spacingHorizontalXS,s:i.tokens.spacingHorizontalS,m:i.tokens.spacingHorizontalM,l:i.tokens.spacingHorizontalL,xl:i.tokens.spacingHorizontalXL,xxl:i.tokens.spacingHorizontalXXL},H=t.default.memo(t.default.forwardRef(({direction:e=`vertical`,justifyContent:t=`flex-start`,alignItems:r=`stretch`,gap:a,columnGap:o,rowGap:s,margin:c,padding:u,marginTop:d,marginBottom:f,marginLeft:p,marginRight:m,paddingTop:h,paddingBottom:g,paddingLeft:_,paddingRight:v,width:y,height:b,wrap:x=!1,children:S,style:C,className:w,overflow:T,background:E},D)=>(0,n.jsx)(`div`,{ref:D,className:(0,i.mergeClasses)(w,(0,l.css)({display:`flex`,flexDirection:e===`horizontal`?`row`:`column`,justifyContent:t,alignItems:r,gap:a&&V[a]?V[a]:a,columnGap:o&&V[o]?V[o]:o,rowGap:s&&V[s]?V[s]:s,margin:c&&V[c]?V[c]:c,padding:u&&V[u]?V[u]:u,marginTop:d&&V[d]?V[d]:d,marginBottom:f&&V[f]?V[f]:f,marginLeft:p&&V[p]?V[p]:p,marginRight:m&&V[m]?V[m]:m,paddingTop:h&&V[h]?V[h]:h,paddingBottom:g&&V[g]?V[g]:g,paddingLeft:_&&V[_]?V[_]:_,paddingRight:v&&V[v]?V[v]:v,width:y,height:b,overflow:T,flexWrap:x?`wrap`:`nowrap`,backgroundColor:E,...C})),children:S}))),bt=e=>{let{direction:r=`horizontal`,defaultSize:i=`50%`,minSize:a=100,maxSize:o=1/0,minSecondarySize:s=100,resizable:c=!0,onResize:l,onResizeEnd:u,primaryContent:d,secondaryContent:f,className:p,styles:m}=e,h=yt(e),g=r===`horizontal`,_=t.useRef(null),v=t.useRef(null),[y,b]=t.useState(null),[x,S]=t.useState(!1),[C,w]=t.useState(!1);t.useEffect(()=>{if(y!==null||!_.current)return;let e=_.current.getBoundingClientRect(),t=g?e.width:e.height;if(typeof i==`number`)b(Math.min(Math.max(i,a),o));else if(typeof i==`string`&&i.endsWith(`%`)){let e=parseFloat(i)/100;b(Math.min(Math.max(t*e,a),o))}else b(t/2)},[i,a,o,g,y]);let T=t.useCallback(t=>{if(!_.current)return t;let n=_.current.getBoundingClientRect(),r=(g?n.width:n.height)-(e.resizerSize??6)-s;return Math.min(Math.max(t,a),Math.min(o,r))},[g,o,a,s,e.resizerSize]),E=t.useCallback(e=>{if(!c)return;e.preventDefault(),S(!0);let t=g?e.clientX:e.clientY,n=y??0,r=e=>{let r=T(n+((g?e.clientX:e.clientY)-t));b(r),l?.(r)},i=()=>{if(S(!1),document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i),v.current){let e=g?v.current.getBoundingClientRect().width:v.current.getBoundingClientRect().height;u?.(e)}};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)},[c,g,y,T,l,u]),D=t.useCallback(e=>{if(!c)return;S(!0);let t=e.touches[0],n=g?t.clientX:t.clientY,r=y??0,i=e=>{let t=e.touches[0],i=T(r+((g?t.clientX:t.clientY)-n));b(i),l?.(i)},a=()=>{if(S(!1),document.removeEventListener(`touchmove`,i),document.removeEventListener(`touchend`,a),v.current){let e=g?v.current.getBoundingClientRect().width:v.current.getBoundingClientRect().height;u?.(e)}};document.addEventListener(`touchmove`,i,{passive:!1}),document.addEventListener(`touchend`,a)},[c,g,y,T,l,u]),O=t.useCallback(e=>{if(!c||y===null)return;let t=e.shiftKey?50:10,n=0;if(g?e.key===`ArrowLeft`?n=-t:e.key===`ArrowRight`&&(n=t):e.key===`ArrowUp`?n=-t:e.key===`ArrowDown`&&(n=t),n!==0){e.preventDefault();let t=T(y+n);b(t),l?.(t),u?.(t)}},[c,y,g,T,l,u]);t.useEffect(()=>(x?(document.body.style.userSelect=`none`,document.body.style.cursor=g?`col-resize`:`row-resize`):(document.body.style.userSelect=``,document.body.style.cursor=``),()=>{document.body.style.userSelect=``,document.body.style.cursor=``}),[x,g]);let k=t.useRef(null),A=[h.resizer,C||x?h.resizerActive:``].filter(Boolean).join(` `);return t.useEffect(()=>{if(!c||!k.current)return;let e=k.current,t=e=>E(e),n=e=>D(e),r=e=>O(e),i=()=>w(!0),a=()=>w(!1);return e.addEventListener(`mousedown`,t),e.addEventListener(`touchstart`,n),e.addEventListener(`keydown`,r),e.addEventListener(`mouseenter`,i),e.addEventListener(`mouseleave`,a),()=>{e.removeEventListener(`mousedown`,t),e.removeEventListener(`touchstart`,n),e.removeEventListener(`keydown`,r),e.removeEventListener(`mouseenter`,i),e.removeEventListener(`mouseleave`,a)}},[c,E,D,O]),(0,n.jsxs)(H,{ref:_,className:[h.root,p].filter(Boolean).join(` `),style:{height:`100%`,width:`100%`,...m},direction:g?`horizontal`:`vertical`,overflow:`hidden`,children:[(0,n.jsx)(H,{ref:v,className:h.pane(y??void 0),style:{flex:`0 0 auto`},children:d}),c&&(0,n.jsx)(`div`,{ref:k,className:A,style:{flex:`0 0 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`},role:`separator`,"aria-orientation":g?`vertical`:`horizontal`,"aria-valuenow":Math.round(y??a),"aria-valuemin":a,"aria-valuemax":o===1/0?void 0:o,"aria-label":`Resize pane`,tabIndex:0,children:(0,n.jsxs)(H,{className:h.resizerGrip,direction:g?`vertical`:`horizontal`,alignItems:`center`,justifyContent:`center`,children:[(0,n.jsx)(H,{className:h.gripDot,children:``}),(0,n.jsx)(H,{className:h.gripDot,children:``}),(0,n.jsx)(H,{className:h.gripDot,children:``})]})}),(0,n.jsx)(H,{className:h.secondaryPane,style:{flex:1,minWidth:0,minHeight:0},children:f})]})},xt=({anchorPoint:e,isOpen:r,onClose:a,excludeRefs:o,children:s,theme:c})=>{let l=(0,t.useRef)(null),[u,d]=(0,t.useState)(null);(0,t.useLayoutEffect)(()=>{if(!r){d(null);return}if(l.current){let t=l.current.getBoundingClientRect(),n=e.left,r=e.top;n+t.width>window.innerWidth&&(n=window.innerWidth-t.width-10),r+t.height>window.innerHeight&&(r=window.innerHeight-t.height-10),d({left:n,top:r})}},[e,r,s]);let p=t.default.useCallback(e=>{let t=e.target;if(l.current&&!l.current.contains(t)){if(o&&o.some(e=>e.current&&e.current.contains(t)))return;a()}},[a,o]);if((0,t.useEffect)(()=>{if(!r)return;let e=requestAnimationFrame(()=>{document.addEventListener(`mousedown`,p)}),t=e=>{e.key===`Escape`&&a()};return document.addEventListener(`keydown`,t),()=>{cancelAnimationFrame(e),document.removeEventListener(`mousedown`,p),document.removeEventListener(`keydown`,t)}},[r,p,a]),!r)return null;let m=u||e;return f.default.createPortal(c?(0,n.jsx)(i.FluentProvider,{theme:c,children:(0,n.jsx)(i.Card,{ref:l,role:`dialog`,"aria-modal":`true`,style:{position:`fixed`,zIndex:1e3,top:m.top,left:m.left},children:s})}):(0,n.jsx)(i.Card,{ref:l,role:`dialog`,"aria-modal":`true`,style:{position:`fixed`,zIndex:1e3,top:m.top,left:m.left},children:s}),document.body)},St=(0,i.makeStyles)({labelContainer:{display:`flex`,flexDirection:`row`,justifyContent:`flex-start`,alignItems:`center`,...i.shorthands.gap(`6px`)},iconStyles:{width:`26px`},item:{paddingLeft:`15px`}}),Ct=e=>{let{label:r,icon:a,isRequired:o}=e,s=St();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(`div`,{className:s.labelContainer,children:[a&&t.isValidElement(a)?a:(0,n.jsx)(p.Icon,{icon:a,className:s.iconStyles,width:`20px`,height:`20px`,color:i.tokens.colorBrandForeground1,"aria-hidden":`true`}),(0,n.jsx)(i.Caption1,{style:{color:i.tokens.colorBrandForeground1},children:r}),(0,n.jsx)(i.Caption1,{style:{color:i.tokens.colorPaletteRedForeground1},children:o?` *`:``})]})})},wt=(0,i.makeStyles)({root:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100%`,width:`100%`},spinner:{width:`100px`,height:`100px`}}),Tt=e=>{let{size:t,label:r,labelPosition:a,style:o,className:s}=e,c=wt();return(0,n.jsx)(`div`,{className:c.root,children:(0,n.jsx)(i.Spinner,{style:o,className:(0,i.mergeClasses)(c.spinner,s),size:t,label:r,labelPosition:a,"aria-label":r?void 0:`Loading`})})},Et={xs:i.tokens.fontSizeBase200,s:i.tokens.fontSizeBase300,m:i.tokens.fontSizeBase400,l:i.tokens.fontSizeBase500,xl:i.tokens.fontSizeBase600,xxl:i.tokens.fontSizeHero700},U={xs:i.tokens.spacingHorizontalXS,s:i.tokens.spacingHorizontalS,m:i.tokens.spacingHorizontalM,l:i.tokens.spacingHorizontalL,xl:i.tokens.spacingHorizontalXL,xxl:i.tokens.spacingHorizontalXXL},Dt={regular:i.tokens.fontWeightRegular,semibold:i.tokens.fontWeightSemibold,bold:i.tokens.fontWeightBold},Ot=e=>{let{fontSize:t,fontFamily:r,fontWeight:a,numberOfLines:o,as:s,padding:c,paddingTop:u,paddingBottom:d,paddingLeft:f,paddingRight:p,margin:m,marginTop:h,marginBottom:g,marginLeft:_,marginRight:v,children:y,style:b,className:x,color:S,block:C,truncate:w,wrap:T}=e,E=(0,l.css)({color:S,padding:c&&U[c]?U[c]:c,paddingTop:u&&U[u]?U[u]:u,paddingBottom:d&&U[d]?U[d]:d,paddingLeft:f&&U[f]?U[f]:f,paddingRight:p&&U[p]?U[p]:p,margin:m&&U[m]?U[m]:m,marginTop:h&&U[h]?U[h]:h,marginBottom:g&&U[g]?U[g]:g,marginLeft:_&&U[_]?U[_]:_,marginRight:v&&U[v]?U[v]:v}),D={...b,...r?{fontFamily:r}:{},...t?{fontSize:Et[t]?Et[t]:t}:{},...a?{fontWeight:Dt[a]?Dt[a]:a}:{},...o?{display:`-webkit-box`,WebkitBoxOrient:`vertical`,overflow:`hidden`,WebkitLineClamp:o}:{}};return(0,n.jsx)(i.Text,{as:s,className:(0,i.mergeClasses)(x,E),style:D,block:C,truncate:w,wrap:T,children:y})},kt=e=>{let{onSelected:r,value:a,styles:o,options:s,apparence:c,shape:l,label:u}=e,d=t.useRef(),[f,p]=t.useState(a??s[0]),[m,h]=t.useState({option:[a?a?.key:s?.[0]?.key]}),g=t.useRef(null);t.useEffect(()=>{a!==void 0&&(p(a),h({option:[a.key]})),d.current=s.find(e=>e.key===(a?.key??s[0]?.key))?.icon},[a]);let[_,v]=t.useState(!1),y=t.useCallback((e,t)=>{v(t.open)},[]),b=t.useCallback(e=>e?.text??``,[]),x=t.useCallback((e,{name:t,checkedItems:n})=>{if(t===`option`){let e=n[0];p(s.find(t=>t.key===e)),h({option:n}),d.current=s.find(t=>t.key===e)?.icon,r(s.find(t=>t.key===e))}},[s,r]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(i.Field,{label:u,style:o,ref:g,children:(0,n.jsxs)(i.Menu,{open:_,onOpenChange:y,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:l??`circular`,icon:d.current,appearance:c??`secondary`,children:b(f)??`No data available`})}),(0,n.jsx)(i.MenuPopover,{children:(0,n.jsx)(i.MenuList,{onCheckedValueChange:x,checkedValues:m,style:{width:g.current?.offsetWidth},children:s.map(e=>(0,n.jsx)(i.MenuItemRadio,{name:`option`,value:e.key,icon:e.icon,disabled:e.disabled,children:b(e)},e.key))})})]})})})},At=()=>({styles:{container:(0,l.css)({display:`flex`,alignItems:`center`,alignContent:`center`,overflow:`hidden`,whiteSpace:`nowrap`,padding:`8px`,backgroundColor:`transparent`}),breadcrumbItem:(0,l.css)({minWidth:`fit-content`,padding:0,margin:`0px`}),separator:(0,l.css)({marginRight:`8px`})},getStyles:(e,t)=>{let{icon:n}=e;switch(t){case`small`:return(0,l.css)({fontSize:`12px`,padding:`4px`,paddingLeft:n?`0px`:`4px`});case`medium`:return(0,l.css)({fontSize:`14px`,padding:`6px`,paddingLeft:n?`0px`:`6px`});case`large`:return(0,l.css)({fontSize:`16px`,padding:`8px`,paddingLeft:n?`0px`:`8px`});case`current`:return(0,l.css)({fontWeight:i.tokens.fontWeightBold,cursor:`default`,display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,overflow:`hidden`,textAlign:`start`,textOverflow:`ellipsis`,wordBreak:`break-word`,fontFamily:i.tokens.fontFamilyBase});default:return(0,l.css)({fontSize:`14px`,padding:`6px`,paddingLeft:n?`0px`:`6px`})}}}),jt=({items:e,theme:r,size:a=`medium`})=>{let[o,s]=(0,t.useState)(!1),c=(0,t.useRef)(null),l=(0,t.useRef)(null),[u,p]=(0,t.useState)({top:0,left:0,position:`absolute`}),{getStyles:m}=At();return(0,t.useEffect)(()=>{let e=e=>{!c.current?.contains(e.target)&&!l.current?.contains(e.target)&&o&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.Button,{ref:c,icon:(0,n.jsx)(d.MoreHorizontalRegular,{}),appearance:`transparent`,onClick:()=>{if(c.current){let e=c.current.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,r=l.current?.offsetWidth||200,i=l.current?.offsetHeight||100,a=e.bottom+window.scrollY,o=e.left+window.scrollX;o+r>t&&(o=t-r-10),a+i>n&&(a=e.top+window.scrollY-i),p({top:a,left:o,position:`absolute`}),s(e=>!e)}},"aria-label":`More items`}),o&&(0,f.createPortal)(r?(0,n.jsx)(i.FluentProvider,{theme:r,children:(0,n.jsx)(i.Card,{ref:l,style:{...u,zIndex:1e3,padding:`8px`,minWidth:`150px`},children:e.map((e,t)=>(0,n.jsx)(i.Button,{icon:e.icon?e.icon:null,appearance:`transparent`,onClick:()=>{e.onClick?.(),s(!1)},children:(0,n.jsx)(i.Text,{className:m(e,a),children:e.label})},`overflow-${t}`))})}):(0,n.jsx)(i.Card,{ref:l,style:{...u,zIndex:1e3,padding:`8px`,minWidth:`150px`},children:e.map((e,t)=>(0,n.jsx)(i.Button,{icon:e.icon?e.icon:null,appearance:`transparent`,onClick:()=>{e.onClick?.(),s(!1)},children:(0,n.jsx)(i.Text,{className:m(e,a),children:e.label})},`overflow-${t}`))}),document.body)]})},Mt=(e,t)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}},Nt=({items:e,maxWidth:r=`100%`,styles:a,theme:o,size:s=`medium`,currentIndex:l=e.length-1,className:u})=>{let{styles:f,getStyles:p}=At(),m=(0,t.useRef)(null),[h,g]=(0,t.useState)([]),[_,v]=(0,t.useState)([]);return(0,t.useEffect)(()=>{let t=()=>{if(!m.current)return;let t=m.current.offsetWidth,n=0,r=[],i=[];e.forEach(e=>{n+80<=t-50?(r.push(e),n+=80):i.push(e)}),g(r),v(i)},n=Mt(t,100),r=new c.ResizeObserver(()=>{n()});return m.current&&r.observe(m.current),t(),()=>{r.disconnect()}},[e]),(0,n.jsx)(`div`,{ref:m,className:(0,i.mergeClasses)(f.container,u),style:{maxWidth:r,...a},children:(0,n.jsxs)(B,{horizontal:!0,verticalAlign:`center`,horizontalAlign:`start`,children:[h.map((e,r)=>(0,n.jsxs)(t.default.Fragment,{children:[r===l?(0,n.jsxs)(B,{horizontal:!0,verticalAlign:`center`,horizontalAlign:`start`,columnGap:5,styles:{overflow:`hidden`},children:[e.icon?t.default.cloneElement(e.icon,{style:{fontSize:s===`large`?`20px`:s===`medium`?`16px`:`12px`}}):null,(0,n.jsx)(i.Text,{className:(0,i.mergeClasses)(f.breadcrumbItem,p(e,s),p(e,`current`)),"aria-current":`page`,children:e.label},e.label)]}):(0,n.jsx)(i.Button,{icon:e.icon?e.icon:null,appearance:`transparent`,className:`${f.breadcrumbItem}`,onClick:e.onClick,children:(0,n.jsx)(i.Text,{className:p(e,s),children:e.label})},e.label),r<h.length-1&&(0,n.jsx)(d.ChevronRightRegular,{style:{fontSize:s===`large`?`20px`:s===`medium`?`16px`:`12px`}})]},e.label??`breadcrumb-${r}`)),_.length>0&&(0,n.jsx)(jt,{items:_,theme:o})]})})},Pt=({icon:e,hoverIcon:r,imageSrc:a,width:o=24,height:s=24,color:c,hoverColor:l,onClick:u,enabled:d=!0,ariaLabel:f})=>{let p=c||i.tokens.colorBrandBackground,m=l||i.tokens.colorBrandBackgroundHover,h=i.tokens.fontFamilyBase,[g,_]=(0,t.useState)(!1),v=(0,t.useCallback)(()=>{d&&_(!0)},[d]),y=(0,t.useCallback)(()=>{d&&_(!1)},[d]),b=(0,t.useMemo)(()=>d&&g&&r?r:e,[g,r,e,d]),x=(0,t.useMemo)(()=>({width:o,height:s,color:g?m:p,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:d?1:.5,fontFamily:h,fontSize:`inherit`}),[o,s,g,m,p,d,h]),S=(0,t.useMemo)(()=>({border:`none`,background:`none`,padding:0,cursor:d?`pointer`:`default`}),[d]),C=(0,t.useMemo)(()=>({width:o,height:s,objectFit:`contain`,opacity:d?1:.5}),[o,s,d]);return(0,n.jsx)(i.Button,{onClick:d?u:void 0,onMouseEnter:v,onMouseLeave:y,disabled:!d,style:S,"aria-label":f??`Icon Button`,children:a?(0,n.jsx)(`img`,{src:a,alt:`icon`,style:C}):t.default.cloneElement(b,{style:{...b.props.style,...x}})})},Ft=t.default.memo(Pt),It=()=>({getSpanSlots:t.useCallback((e,t)=>{let n=new Date(e),r=new Date(t),i=n.getHours(),a=n.getMinutes(),o=i*2+(a>=1?1:0),s=r.getHours(),c=r.getMinutes(),l=s*2+(c>=1?2:0);return{spanSlots:l-o,startSlot:o,endSlot:l}},[]),generateLightAndHoverColors:t.useCallback((e,t=20,n=10)=>{let r=e=>{let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=i-a,s=0,c=0,l=(i+a)/2;if(o!==0){switch(c=l>.5?o/(2-i-a):o/(i+a),i){case t:s=(n-r)/o+(n<r?6:0);break;case n:s=(r-t)/o+2;break;case r:s=(t-n)/o+4;break}s/=6}return{h:s*360,s:c*100,l:l*100}},i=(e,t,n)=>{let r=t*Math.min(n,100-n)/100,i=t=>{let i=(t+e/30)%12,a=n-r*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*a).toString(16).padStart(2,`0`)};return`#${i(0)}${i(8)}${i(4)}`},{h:a,s:o,l:s}=r(e);return{lightColor:i(a,o,Math.min(s+t,100)),hoverColor:i(a,o,Math.min(s+n,100))}},[]),getEventColors:t.useCallback(e=>{let t={backgroundColor:i.tokens.colorNeutralBackground3,hoverColor:i.tokens.colorNeutralBackground3Hover};return{"no category":t,meeting:{backgroundColor:i.tokens.colorPaletteBlueBackground2,hoverColor:i.tokens.colorPaletteBlueBorderActive},appointment:{backgroundColor:i.tokens.colorPaletteGreenBackground2,hoverColor:i.tokens.colorPaletteGreenBorderActive},task:{backgroundColor:i.tokens.colorPaletteRedBackground2,hoverColor:i.tokens.colorPaletteRedBorderActive},deadline:{backgroundColor:i.tokens.colorPaletteYellowBackground2,hoverColor:i.tokens.colorPaletteYellowBorderActive},holiday:{backgroundColor:i.tokens.colorPalettePurpleBackground2,hoverColor:i.tokens.colorPalettePurpleBorderActive},celebration:{backgroundColor:i.tokens.colorPaletteDarkOrangeBackground2,hoverColor:i.tokens.colorPaletteDarkOrangeBorderActive},reminder:{backgroundColor:i.tokens.colorPaletteTealBackground2,hoverColor:i.tokens.colorPaletteTealBorderActive},workshop:{backgroundColor:i.tokens.colorPaletteTealBackground2,hoverColor:i.tokens.colorPaletteTealBorderActive},webinar:{backgroundColor:i.tokens.colorPaletteMagentaBackground2,hoverColor:i.tokens.colorPaletteMagentaBorderActive},conference:{backgroundColor:i.tokens.colorPaletteBrownBackground2,hoverColor:i.tokens.colorPaletteBrownBorderActive}}[e.toLowerCase()]||t},[]),generateColor:t.useCallback(e=>{let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);let n=(t&16777215).toString(16).toUpperCase();return`#${`00000`.substring(0,6-n.length)+n}`},[]),getCalendarColors:t.useCallback(e=>{let t={beige:{backgroundColor:i.tokens.colorPaletteBeigeBackground2,hoverColor:i.tokens.colorPaletteBeigeBorderActive},blue:{backgroundColor:i.tokens.colorPaletteBlueBackground2,hoverColor:i.tokens.colorPaletteBlueBorderActive},brown:{backgroundColor:i.tokens.colorPaletteBrownBackground2,hoverColor:i.tokens.colorPaletteBrownBorderActive},gold:{backgroundColor:i.tokens.colorPaletteGoldBackground2,hoverColor:i.tokens.colorPaletteGoldBorderActive},lavender:{backgroundColor:i.tokens.colorPaletteLavenderBackground2,hoverColor:i.tokens.colorPaletteLavenderBorderActive},magenta:{backgroundColor:i.tokens.colorPaletteMagentaBackground2,hoverColor:i.tokens.colorPaletteMagentaBorderActive},navy:{backgroundColor:i.tokens.colorPaletteNavyBackground2,hoverColor:i.tokens.colorPaletteNavyBorderActive},pink:{backgroundColor:i.tokens.colorPalettePinkBackground2,hoverColor:i.tokens.colorPalettePinkBorderActive},plum:{backgroundColor:i.tokens.colorPalettePlumBackground2,hoverColor:i.tokens.colorPalettePlumBorderActive},purple:{backgroundColor:i.tokens.colorPalettePurpleBackground2,hoverColor:i.tokens.colorPalettePurpleBorderActive},red:{backgroundColor:i.tokens.colorPaletteRedBackground2,hoverColor:i.tokens.colorPaletteRedBorderActive},teal:{backgroundColor:i.tokens.colorPaletteTealBackground2,hoverColor:i.tokens.colorPaletteTealBorderActive},anchor:{backgroundColor:i.tokens.colorPaletteAnchorBackground2,hoverColor:i.tokens.colorPaletteAnchorBorderActive},"dark-red":{backgroundColor:i.tokens.colorPaletteDarkRedBackground2,hoverColor:i.tokens.colorPaletteDarkRedBorderActive},cranberry:{backgroundColor:i.tokens.colorPaletteCranberryBackground2,hoverColor:i.tokens.colorPaletteCranberryBorderActive},pumpkin:{backgroundColor:i.tokens.colorPalettePumpkinBackground2,hoverColor:i.tokens.colorPalettePumpkinBorderActive},peach:{backgroundColor:i.tokens.colorPalettePeachBackground2,hoverColor:i.tokens.colorPalettePeachBorderActive},marigold:{backgroundColor:i.tokens.colorPaletteMarigoldBackground2,hoverColor:i.tokens.colorPaletteMarigoldBorderActive},brass:{backgroundColor:i.tokens.colorPaletteBrassBackground2,hoverColor:i.tokens.colorPaletteBrassBorderActive},forest:{backgroundColor:i.tokens.colorPaletteForestBackground2,hoverColor:i.tokens.colorPaletteForestBorderActive},seafoam:{backgroundColor:i.tokens.colorPaletteSeafoamBackground2,hoverColor:i.tokens.colorPaletteSeafoamBorderActive},"dark-green":{backgroundColor:i.tokens.colorPaletteDarkGreenBackground2,hoverColor:i.tokens.colorPaletteDarkGreenBorderActive},"light-teal":{backgroundColor:i.tokens.colorPaletteLightTealBackground2,hoverColor:i.tokens.colorPaletteLightTealBorderActive},steel:{backgroundColor:i.tokens.colorPaletteSteelBackground2,hoverColor:i.tokens.colorPaletteSteelBorderActive},"royal-blue":{backgroundColor:i.tokens.colorPaletteRoyalBlueBackground2,hoverColor:i.tokens.colorPaletteRoyalBlueBorderActive},cornflower:{backgroundColor:i.tokens.colorPaletteCornflowerBackground2,hoverColor:i.tokens.colorPaletteCornflowerBorderActive},grape:{backgroundColor:i.tokens.colorPaletteGrapeBackground2,hoverColor:i.tokens.colorPaletteGrapeBorderActive},lilac:{backgroundColor:i.tokens.colorPaletteLilacBackground2,hoverColor:i.tokens.colorPaletteLilacBorderActive},mink:{backgroundColor:i.tokens.colorPaletteMinkBackground2,hoverColor:i.tokens.colorPaletteMinkBorderActive},platinum:{backgroundColor:i.tokens.colorPalettePlatinumBackground2,hoverColor:i.tokens.colorPalettePlatinumBorderActive}},n=t[`royal-blue`];return t[e]||n},[]),formatDate:t.useCallback((e,t)=>(0,a.format)((0,a.parseISO)(e),t),[])}),Lt={start:`Start`,end:`End`,location:`Location`,attendees:`Attendees`,details:`Details`},Rt=`32px`,zt=e=>({styles:{banner:(0,l.css)({display:`flex`,justifyContent:`center`,alignContent:`center`,alignItems:`center`,padding:`5px 10px 0px 10px`}),fieldContainer:(0,l.css)({paddingLeft:Rt}),title:(0,l.css)({lineClamp:2,overflow:`hidden`,display:`-webkit-box`,WebkitBoxOrient:`vertical`,wordBreak:`break-word`,WebkitLineClamp:2})}}),Bt=({fieldLabel:e,fieldValue:t,icon:r})=>(0,n.jsxs)(B,{children:[(0,n.jsx)(Ct,{label:e,icon:r}),(0,n.jsx)(B,{paddingLeft:Rt,children:(0,n.jsx)(i.Body1,{children:t})})]}),Vt=e=>{let{event:r,strings:a=Lt}=e,{title:o,start:s,end:c,location:l,category:u,attendees:d,weblink:f}=r,{styles:p}=zt(r),{formatDate:m}=It(),h=m(s,`PPp`),g=m(c,`PPp`),_=(0,i.partitionAvatarGroupItems)({items:d?.map(e=>e.id)||[]}),v=t.useCallback(e=>d?.find(t=>t.id===e)||void 0,[d]),y=t.useCallback(()=>(0,n.jsxs)(B,{children:[(0,n.jsx)(Ct,{label:a.attendees,icon:`ph:users-three`}),(0,n.jsx)(B,{paddingLeft:Rt,children:(0,n.jsxs)(i.AvatarGroup,{layout:`stack`,children:[_.inlineItems.map(e=>(0,n.jsx)(i.AvatarGroupItem,{name:v(e)?.name,image:{src:v(e)?.imageUrl}},e)),_.overflowItems&&(0,n.jsx)(i.AvatarGroupPopover,{children:_.overflowItems.map(e=>(0,n.jsx)(i.AvatarGroupItem,{name:v(e)?.name,image:{src:v(e)?.imageUrl}},e))})]})})]}),[_,v,a.attendees]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ze,{appearance:`subtle`,padding:`m`,paddingTop:`s`,width:`250px`,cardBody:(0,n.jsxs)(B,{RowGap:10,children:[(0,n.jsx)(`div`,{className:p.banner,children:(0,n.jsx)(i.Subtitle1,{className:p.title,children:o})}),(0,n.jsx)(i.Divider,{}),u&&(0,n.jsx)(B,{horizontal:!0,horizontalAlign:`end`,width:`100%`,children:(0,n.jsx)(i.Badge,{appearance:`filled`,children:u})}),(0,n.jsx)(Bt,{fieldLabel:a.start,fieldValue:h,icon:`mingcute:time-line`}),(0,n.jsx)(Bt,{fieldLabel:a.end,fieldValue:g,icon:`mingcute:time-line`}),(0,n.jsx)(Bt,{fieldLabel:a.location,fieldValue:l,icon:`mingcute:location-line`}),(0,n.jsx)(y,{})]}),cardFooterContent:(0,n.jsx)(B,{horizontal:!0,horizontalAlign:`end`,width:`100%`,children:(0,n.jsx)(i.Button,{appearance:`subtle`,onClick:()=>{window.open(f,`_blank`)},children:a.details})})})})},Ht=()=>({styles:{calendarWrapper:(0,l.css)({padding:`20px`,paddingTop:`10px`,overflow:`auto`,flex:1,display:`grid`,gridTemplateColumns:`repeat(7, 1fr)`,gridTemplateRows:`auto`,gridAutoRows:`minmax(100px, 1fr)`,gap:`1px`,width:`calc(100% - 40px)`}),header:(0,l.css)({display:`flex`,justifyContent:`start`,gap:`10px`,alignItems:`center`,padding:`16px`}),dayHeader:(0,l.css)({textAlign:`start`,padding:`8px`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),day:(0,l.css)({display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,border:`1px solid ${i.tokens.colorNeutralStroke1}`,backgroundColor:i.tokens.colorNeutralBackground1,position:`relative`}),otherMonthDay:(0,l.css)({color:i.tokens.colorNeutralStroke2,backgroundColor:i.tokens.colorNeutralBackground2}),cardDay:(0,l.css)({height:`100%`,minHeight:100,borderRadius:0,overflow:`hidden !important`,rowGap:5}),cardDayOnHover:(0,l.css)({":hover":{backgroundColor:i.tokens.colorNeutralBackground2}}),currentDay:(0,l.css)({borderTop:`5px solid ${i.tokens.colorBrandBackground}`}),currentDayLabel:(0,l.css)({color:i.tokens.colorBrandBackground,fontWeight:600}),eventCard:(0,l.css)({display:`flex`,flexDirection:`column`,alignItems:`flex-start`,zIndex:1}),eventContainer:(0,l.css)({display:`flex`,flexDirection:`column`,overflowY:`auto`,paddingTop:`5px`,paddingBottom:`5px`,paddingLeft:`5px`,paddingRight:`5px`,"::-webkit-scrollbar":{width:`5px`,height:`5px`},"::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground4,borderRadius:`10px`},"::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandStroke2Hover,borderRadius:`10px`},"::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorNeutralStroke2}}),eventCardWeekView:(0,l.css)({backgroundColor:i.tokens.colorBrandBackground,color:i.tokens.colorNeutralForegroundOnBrand,borderRadius:`4px`,padding:`4px`,margin:`2px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,height:`100%`}),popoverContent:(0,l.css)({padding:0,borderTopWidth:20,borderTopStyle:`solid`}),cardMonthTitle:(0,l.css)({display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,textAlign:`start`,textOverflow:`ellipsis`,paddingLeft:`8px`,wordBreak:`break-word`,overflow:`hidden`})},applyEventHouverColorClass:(e,t)=>(0,l.css)({backgroundColor:e??i.tokens.colorBrandBackground,":hover":{backgroundColor:t??i.tokens.colorBrandBackgroundHover}})}),Ut=e=>{let r=(0,i.useId)(),{events:o,date:s,onCardHoverChange:c,columnHeight:l}=e,{styles:u,applyEventHouverColorClass:d}=Ht(),f=t.useRef(null),{getEventColors:p,getCalendarColors:m}=It(),h=t.useCallback(e=>{c&&c(!0,e)},[c]),g=t.useCallback(e=>{c&&c(!1,e)},[c]),_=t.useCallback(e=>{f.current?.setTarget(e)},[f]),v=t.useCallback((e,t,r)=>(0,n.jsx)(`div`,{ref:_,children:(0,n.jsx)(Ze,{className:(0,i.mergeClasses)(u.eventCard,d(r.backgroundColor,r.backgroundColor)),paddingTop:`4px`,paddingBottom:`4px`,paddingLeft:`8px`,paddingRight:`8px`,marginTop:e===0?`0px`:`5px`,cardHeader:(0,n.jsx)(i.Caption1,{className:u.cardMonthTitle,children:t.title}),onMouseEnter:()=>h(t.title),onMouseLeave:()=>g(t.title)})},t.id??`card-${e}`),[h,g,d]),y=t.useCallback((e,t,a)=>(0,n.jsxs)(i.Popover,{withArrow:!0,mouseLeaveDelay:30,closeOnScroll:!0,closeOnIframeFocus:!0,openOnHover:!0,children:[(0,n.jsx)(i.PopoverTrigger,{children:v(t,e,a)}),(0,n.jsx)(i.PopoverSurface,{"aria-labelledby":r,className:(0,i.mergeClasses)(u.popoverContent),children:(0,n.jsx)(Vt,{event:e})})]},t),[v,r,u.popoverContent]);return!o||!o?.length?(0,n.jsx)(n.Fragment,{children:` `}):(0,n.jsx)(`div`,{style:{height:l},className:u.eventContainer,children:o.map((e,n)=>{if(!(0,a.isWithinInterval)(s,{start:(0,a.startOfDay)(new Date(e.start)),end:(0,a.endOfDay)(new Date(e.end))}))return null;let r;r=e.hexColor?{backgroundColor:e.hexColor,hoverColor:e.hexColor}:e.color?m(e.color):p(e.category);let o=e.onRenderInMonthView?.(e),c=e.id??`event-${n}`;return t.isValidElement(o)?t.cloneElement(o,{key:c,className:(0,i.mergeClasses)(o.props.className,u.eventCard)}):e.enableOnHouver?y(e,n,r):v(n,e,r)})})},Wt=e=>{let{day:r,currentMonth:o,events:s,date:c,columnHeight:l,onDayClick:u}=e,{styles:d}=Ht(),f=new Date,[p,m]=t.useState(!1),h=c.getDay()===0||c.getDay()===6,g=t.useMemo(()=>(0,a.isSameDay)(c,f),[c,f]),_=t.useMemo(()=>(0,n.jsx)(B,{horizontal:!0,horizontalAlign:`start`,verticalAlign:`center`,paddingLeft:`m`,paddingRight:`m`,children:(0,n.jsxs)(i.Body2,{className:d.currentDayLabel,style:{color:h?`${i.tokens.colorPaletteRedForeground1} !important`:``},children:[r,` `,f.toLocaleString(`default`,{month:`short`})]})}),[r,h,f,d.currentDayLabel]),v=t.useCallback(e=>{m(e)},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ze,{onClick:u?()=>u(c):void 0,className:(0,i.mergeClasses)(d.cardDay,o?``:d.otherMonthDay,g?d.currentDay:``,p?``:d.cardDayOnHover),cardHeader:g?_:(0,n.jsx)(B,{horizontal:!0,paddingLeft:`m`,paddingRight:`m`,children:(0,n.jsx)(i.Body2,{style:{color:h?`${i.tokens.colorPaletteRedForeground1} !important`:``},children:r})}),paddingTop:`m`,paddingBottom:`m`,paddingLeft:`0px`,paddingRight:`0px`,cardBody:(0,n.jsx)(Ut,{events:s,date:c,onCardHoverChange:v,columnHeight:l-60})})})},Gt=()=>({styles:{container:(0,l.css)({display:`flex`,flexDirection:`column`,width:`calc(100% - 40px)`,height:`100vh`,overflow:`hidden`,padding:`20px`}),header:(0,l.css)({display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`16px`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),weekGrid:(0,l.css)({display:`grid`,gridTemplateColumns:`80px repeat(7, 1fr)`,gridTemplateRows:`50px 40px repeat(48, 33px)`,height:`fit-content`,overflowY:`auto`,border:`1px solid ${i.tokens.colorNeutralStroke1}`,maxHeight:`calc(100vh - 100px)`,scrollbarWidth:`thin`,scrollbarColor:`${i.tokens.colorBrandBackground} ${i.tokens.colorNeutralBackground1}`,"&::-webkit-scrollbar":{width:`8px`},"&::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground1},"&::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandBackground,borderRadius:`4px`},"&::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorBrandBackgroundHover}}),blankHeader:(0,l.css)({gridColumn:`1`,backgroundColor:i.tokens.colorNeutralBackground3,borderBottom:`3px solid ${i.tokens.colorNeutralStroke3}`,position:`sticky`,top:0,zIndex:10}),timeColumn:(0,l.css)({gridColumn:`1`,gridRow:`3 / span 49`,display:`flex`,flexDirection:`column`,backgroundColor:i.tokens.colorNeutralBackground1,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`}),timeCell:(0,l.css)({height:`100%`,display:`flex`,alignItems:`center`,fontSize:`12px`,color:i.tokens.colorNeutralForeground3,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,justifyContent:`center`}),fullDayRow:(0,l.css)({gridRow:`2`,display:`grid`,gridTemplateColumns:`80px repeat(7, 1fr)`,gap:`0`,padding:`0`,backgroundColor:i.tokens.colorNeutralBackground2,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayLabel:(0,l.css)({gridColumn:`1`,display:`flex`,alignItems:`center`,justifyContent:`center`,alignContent:`center`,color:i.tokens.colorBrandBackground,padding:`5px`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayCell:(0,l.css)({borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,display:`flex`,flexDirection:`row`,gap:`0px`,padding:`4px`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`,overflow:`hidden`}),fullDayEvent:(0,l.css)({flex:`1 1 auto`,minWidth:`24px`,height:`24px`,padding:`4px 8px`,backgroundColor:i.tokens.colorBrandBackground,borderRadius:`4px`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`}),dayHeaderCell:(0,l.css)({textAlign:`center`,backgroundColor:i.tokens.colorNeutralBackground2,padding:`8px`,fontWeight:`bold`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,position:`sticky`,top:0,zIndex:10}),todayHeaderCell:(0,l.css)({borderTop:`5px solid ${i.tokens.colorBrandBackground}`}),eventCard:(0,l.css)({padding:2,alignItems:`center`,justifyContent:`center`,marginRight:`2px`,zIndex:1,position:`absolute`,alignContent:`center`,overflow:`hidden`,":hover":{pointerEvents:`auto`,cursor:`pointer`}}),event:(0,l.css)({height:`100%`,backgroundColor:i.tokens.colorBrandBackground,borderRadius:`4px`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginRight:`2px`,zIndex:1,position:`absolute`,alignContent:`center`,":hover":{pointerEvents:`auto`,cursor:`pointer`}}),dayCell:(0,l.css)({borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,position:`relative`,overflow:`visible`,FlexDirection:`column`,gap:`4px`}),currentTimeIndicator:(0,l.css)({position:`absolute`,left:0,height:`2px`,backgroundColor:i.tokens.colorPaletteRedBorderActive,width:`100%`,zIndex:1}),currentHalfHourCell:(0,l.css)({border:`2px solid ${i.tokens.colorPaletteRedBorderActive}`}),eventTitle:(0,l.css)({display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,textAlign:`start`,textOverflow:`ellipsis`,paddingLeft:`8px`,wordBreak:`break-word`,overflow:`hidden`}),popoverContent:(0,l.css)({padding:0,borderTopWidth:20,borderTopStyle:`solid`})},applyEventHouverColorClass:t.default.useCallback((e,t)=>(0,l.css)({backgroundColor:e??i.tokens.colorBrandBackground,":hover":{backgroundColor:t??i.tokens.colorBrandBackgroundHover}}),[i.tokens.colorBrandBackground,i.tokens.colorBrandBackgroundHover]),appyDynamicStyles:t.default.useCallback((e,t,n,r)=>(0,l.css)({flex:`0 0 calc(100% / ${t})`,height:`${n*r}px`,left:`${e*10}%`,width:`calc(${100-e*10}% - 8px)`,margin:4,marginTop:0,marginBottom:0}),[])}),Kt={timeSeparator:` - `,hourSuffix:`H`},qt=({event:e,colors:r,spanSlots:a,rowHeight:o,eventIndex:s,eventCount:c,strings:l=Kt})=>{let u=(0,i.useId)(),{styles:d,applyEventHouverColorClass:f,appyDynamicStyles:p}=Gt(),m=t.useRef(null),{formatDate:h}=It(),g=t.useMemo(()=>(0,n.jsx)(`div`,{children:(0,n.jsxs)(B,{columnGap:4,verticalAlign:`center`,children:[(0,n.jsx)(i.Caption1Strong,{className:d.eventTitle,children:e.title}),(0,n.jsxs)(B,{columnGap:4,horizontal:!0,verticalAlign:`center`,horizontalAlign:`start`,children:[(0,n.jsxs)(i.Caption1,{children:[h(e.start,`HH:mm`),l.hourSuffix]}),l.timeSeparator,(0,n.jsxs)(i.Caption1,{children:[h(e.end,`HH:mm`),l.hourSuffix]})]})]})}),[e,h,l,d.eventTitle]);return(0,n.jsx)(i.Card,{ref:m,className:(0,i.mergeClasses)(d.eventCard,f(r.backgroundColor,r.backgroundColor),p(s,c,o,a)),children:e.enableOnHouver?(0,n.jsxs)(i.Popover,{withArrow:!0,mouseLeaveDelay:50,closeOnScroll:!0,closeOnIframeFocus:!0,openOnHover:!0,children:[(0,n.jsx)(i.PopoverTrigger,{children:g}),(0,n.jsx)(i.PopoverSurface,{"aria-labelledby":u,className:(0,i.mergeClasses)(d.popoverContent),children:(0,n.jsx)(Vt,{event:e})})]}):g},e.id)},Jt=({event:e,eventCount:r,spanSlots:a,rowHeight:o,eventIndex:s,view:c})=>{let{styles:l,appyDynamicStyles:u}=Gt(),{getEventColors:d,getCalendarColors:f}=It(),p=e.hexColor?{backgroundColor:e.hexColor,hoverColor:e.hexColor}:e.color?f(e.color):d(e.category),m=c===`day`?e.onRenderInDayView?.(e):e.onRenderInWeekView?.(e);return t.isValidElement(m)?t.cloneElement(m,{event:e,className:(0,i.mergeClasses)(m.props.className,l.eventCard,u(s,r,o,a)),style:{...m.props.style}}):(0,n.jsx)(qt,{event:e,colors:p,spanSlots:a,rowHeight:o,eventIndex:s,eventCount:r},e.id)},Yt=e=>{let n=(0,t.useCallback)(e=>e.map(e=>({...e,id:e.id||(0,m.v4)()})),[]),r=(0,t.useCallback)(t=>new Date(new Date(t).toLocaleString(void 0,{timeZone:e})),[e]);return{getMonthCalendar:(0,t.useCallback)((e,t,i)=>{let o=n(e),s=new Date(t,i+1,0).getDate(),c={};for(let e=1;e<=s;e++){let n=(0,a.format)(new Date(t,i,e),`yyyy-MM-dd`);c[n]=[]}return o.forEach(e=>{let t=r(e.start),n=r(e.end),i=new Date(t);for(;i<=n;){let t=(0,a.format)(i,`yyyy-MM-dd`);c[t]&&c[t].push(e),i.setDate(i.getDate()+1)}}),c},[r]),getWeekEvents:(0,t.useCallback)((e,t)=>{let i=[],o=r(t),s=n(e);for(let e=0;e<7;e++){let t=new Date(o);t.setDate(o.getDate()+e);let n=(0,a.format)(t,`yyyy-MM-dd`),c=Array.from({length:48},(e,t)=>({time:`${String(Math.floor(t/2)).padStart(2,`0`)}:${t%2==0?`00`:`30`}`,events:[]})),l=[];s.forEach(e=>{let t=r(e.start),i=r(e.end);if(e.isFullDay){(0,a.format)(t,`yyyy-MM-dd`)<=n&&(0,a.format)(i,`yyyy-MM-dd`)>=n&&l.push(e);return}if((0,a.format)(t,`yyyy-MM-dd`)<=n&&(0,a.format)(i,`yyyy-MM-dd`)>=n){let r=new Date(t);for(;r<=i;){if((0,a.format)(r,`yyyy-MM-dd`)===n){let t=r.getHours()*2+(r.getMinutes()>=30?1:0);c[t]&&c[t].events.push(e)}r.setMinutes(r.getMinutes()+30)}}}),i.push({date:n,fullDayEvents:l,timeSlots:c})}return i},[r])}},Xt=()=>({styles:{container:(0,l.css)({display:`flex`,flexDirection:`column`,width:`calc(100% - 40px)`,height:`100vh`,overflow:`hidden`,padding:`20px`}),header:(0,l.css)({display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`16px`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),dayGrid:(0,l.css)({display:`grid`,gridTemplateColumns:`80px 1fr`,gridTemplateRows:`50px 40px repeat(48, 33px)`,height:`calc(100vh - 100px)`,overflowY:`auto`,border:`1px solid ${i.tokens.colorNeutralStroke1}`,maxHeight:`fit-content`,scrollbarWidth:`thin`,scrollbarColor:`${i.tokens.colorBrandBackground} ${i.tokens.colorNeutralBackground1}`,"&::-webkit-scrollbar":{width:`8px`},"&::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground1},"&::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandBackground,borderRadius:`4px`},"&::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorBrandBackgroundHover}}),blankHeader:(0,l.css)({gridColumn:`1`,backgroundColor:i.tokens.colorNeutralBackground3,borderBottom:`3px solid ${i.tokens.colorNeutralStroke3}`}),timeColumn:(0,l.css)({gridColumn:`1`,gridRow:`3 / span 49`,display:`flex`,flexDirection:`column`,backgroundColor:i.tokens.colorNeutralBackground1,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`}),timeCell:(0,l.css)({height:`100%`,maxHeight:`32px`,minHeight:`32px`,display:`flex`,alignItems:`center`,fontSize:`12px`,color:i.tokens.colorNeutralForeground3,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,justifyContent:`center`}),fullDayRow:(0,l.css)({gridRow:`2`,display:`grid`,gridTemplateColumns:`80px 33px`,gap:`0`,padding:`0`,backgroundColor:i.tokens.colorNeutralBackground2,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayLabel:(0,l.css)({gridColumn:`1`,display:`flex`,alignItems:`center`,justifyContent:`center`,alignContent:`center`,color:i.tokens.colorBrandBackground,padding:`5px`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayCell:(0,l.css)({borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,display:`flex`,flexDirection:`row`,gap:`2px`,padding:`4px`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`,overflow:`hidden`}),fullDayEvent:(0,l.css)({flex:`1 1 auto`,minWidth:`24px`,height:`24px`,padding:`4px 8px`,backgroundColor:i.tokens.colorBrandBackground,color:i.tokens.colorNeutralForegroundOnBrand,borderRadius:`4px`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`}),dayHeaderCell:(0,l.css)({textAlign:`center`,backgroundColor:i.tokens.colorNeutralBackground2,padding:`8px`,fontWeight:`bold`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),todayHeaderCell:(0,l.css)({borderTop:`5px solid ${i.tokens.colorBrandBackground}`}),eventCard:(0,l.css)({alignItems:`center`,justifyContent:`center`,marginRight:`2px`,zIndex:1,position:`absolute`,alignContent:`center`,overflow:`hidden`}),dayCell:(0,l.css)({borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,position:`relative`,overflow:`visible`,FlexDirection:`column`,gap:`4px`}),currentTimeIndicator:(0,l.css)({position:`absolute`,left:0,height:`2px`,backgroundColor:i.tokens.colorPaletteRedBorderActive,width:`100%`,zIndex:1}),currentHalfHourCell:(0,l.css)({border:`2px solid ${i.tokens.colorPaletteRedBorderActive}`}),eventTitle:(0,l.css)({display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,textAlign:`start`,textOverflow:`ellipsis`,paddingLeft:`8px`,wordBreak:`break-word`,overflow:`hidden`})},applyEventHouverColorClass:(e,t)=>(0,l.css)({backgroundColor:e??i.tokens.colorBrandBackground,":hover":{backgroundColor:t??i.tokens.colorBrandBackgroundHover}})}),Zt={allDay:`All Day`},Qt=33,$t=e=>{let{events:r,currentDay:o,height:s,strings:c=Zt}=e,{styles:l}=Xt(),u=(0,t.useRef)(null),{getSpanSlots:d,getEventColors:f,getCalendarColors:p}=It(),m=Intl.DateTimeFormat().resolvedOptions().timeZone,{getWeekEvents:h}=Yt(m),g=t.useCallback(()=>Array.from({length:24},(e,r)=>(0,n.jsxs)(t.Fragment,{children:[(0,n.jsx)(`div`,{className:l.timeCell,children:(0,n.jsxs)(i.Body1Strong,{children:[r,`:00`]})}),(0,n.jsx)(`div`,{className:l.timeCell})]},r)),[l.timeCell]),_=t.useCallback(()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:l.blankHeader}),Array.from({length:1},(e,t)=>{let r=(0,a.addDays)(o,t),s=(0,a.isToday)(r)?l.todayHeaderCell:``;return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(l.dayHeaderCell,s),children:[(0,n.jsx)(i.Text,{weight:`semibold`,size:600,style:{paddingRight:10},children:(0,a.format)(r,`dd`)}),(0,n.jsx)(i.Subtitle1,{children:(0,a.format)(r,`LLLL, yyyy`)})]},t)})]}),[o,l.blankHeader,l.dayHeaderCell,l.todayHeaderCell]),v=t.useCallback(()=>{let e=h(r,o.toISOString());return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:l.fullDayLabel,children:(0,n.jsx)(i.Body1,{children:c.allDay})}),Array.from({length:1},(t,r)=>{let s=(0,a.format)((0,a.addDays)(o,r),`yyyy-MM-dd`),c=e.find(e=>e.date===s)?.fullDayEvents||[];return(0,n.jsx)(`div`,{className:l.fullDayCell,children:c.map(e=>(0,n.jsx)(`div`,{className:l.fullDayEvent,style:{gridColumn:`${r+2}`,backgroundColor:e.color?p(e.color).backgroundColor:f(e.category).backgroundColor},children:(0,n.jsx)(i.Caption1Strong,{className:l.eventTitle,children:e.title})},e.id))},r)})]})},[o,h,l.fullDayCell,l.fullDayEvent,l.fullDayLabel,l.eventTitle,p,f,r,c.allDay]),y=t.useCallback(()=>{let e=h(r,o.toISOString());return Array.from({length:1},(r,i)=>{let s=(0,a.format)((0,a.addDays)(o,i),`yyyy-MM-dd`),c=e.find(e=>e.date===s);return(0,n.jsx)(t.Fragment,{children:c?.timeSlots.map((e,t)=>{let r=e.events.length;return(0,n.jsx)(`div`,{className:l.dayCell,style:{gridRow:t+3},children:e.events.map((e,i)=>{let{spanSlots:a,startSlot:o}=d(new Date(e.start),new Date(e.end));return t===o?(0,n.jsx)(Jt,{event:e,eventCount:r,spanSlots:a,rowHeight:Qt,eventIndex:i,view:`day`},e.id):null})},t)})},i)})},[o,d,h,l.dayCell,r]);return(0,n.jsx)(`div`,{className:l.container,style:{height:s},children:(0,n.jsxs)(`div`,{ref:u,className:l.dayGrid,children:[(0,n.jsx)(`div`,{className:l.timeColumn,children:g()}),_(),v(),y()]})})},W=function(e){return e.Day=`day`,e.Week=`week`,e.Month=`month`,e}({}),en={month:`Month`,week:`Week`,day:`Day`},tn=e=>{let{onSelected:r,value:a,strings:o=en}=e,[s,c]=t.useState(a??W.Month),[l,u]=t.useState({view:[a??W.Month]}),f=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarDayFilled,d.CalendarDayRegular),[]),p=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[]),m=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarWorkWeekFilled,d.CalendarWorkWeekRegular),[]);t.useEffect(()=>{a!==void 0&&(c(a),u({view:[a]}))},[a]);let[h,g]=t.useState(!1),_=t.useCallback((e,t)=>{g(t.open)},[]),v=t.useCallback(()=>{switch(s){case W.Month:return(0,n.jsx)(p,{});case W.Week:return(0,n.jsx)(m,{});case W.Day:return(0,n.jsx)(f,{});default:return(0,n.jsx)(p,{})}},[s]),y=t.useCallback(e=>{switch(e){case W.Month:return o.month;case W.Week:return o.week;case W.Day:return o.day;default:return o.month}},[o]),b=t.useCallback((e,{name:t,checkedItems:n})=>{if(t===`view`){let e=n[0];c(e),u({view:n}),r(e)}},[r]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(i.Menu,{open:h,onOpenChange:_,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:v(),style:{minWidth:`150px`},children:y(s)})}),(0,n.jsx)(i.MenuPopover,{children:(0,n.jsxs)(i.MenuList,{onCheckedValueChange:b,checkedValues:l,children:[(0,n.jsx)(i.MenuItemRadio,{icon:(0,n.jsx)(f,{}),name:`view`,value:W.Day,children:o.day}),(0,n.jsx)(i.MenuItemRadio,{icon:(0,n.jsx)(m,{}),name:`view`,value:W.Week,children:o.week}),(0,n.jsx)(i.MenuItemRadio,{icon:(0,n.jsx)(p,{}),name:`view`,value:W.Month,children:o.month})]})})]})})},nn=t.memo(e=>{let{onSelected:a,value:o}=e,[s,c]=t.useState(o??new Date),[l,u]=t.useState(()=>(0,r.format)(o??new Date,`dd MMM, yyyy`)),[f,p]=t.useState(!1),m=t.useCallback((e,t)=>{p(t.open)},[]),g=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[]),_=t.useCallback(e=>{if(e){let t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=(0,r.utcToZonedTime)(e,t);c(n),u((0,r.format)(n,`dd MMM, yyyy`)),a(n),p(!1)}},[a]);return(0,n.jsxs)(i.Menu,{open:f,onOpenChange:m,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:(0,n.jsx)(g,{}),style:{minWidth:`200px`},"aria-label":`Select date: ${l}`,children:l})}),(0,n.jsx)(i.MenuPopover,{style:{maxWidth:`fit-content`},children:(0,n.jsx)(i.MenuList,{children:(0,n.jsx)(h.Calendar,{highlightSelectedMonth:!0,showGoToToday:!0,onSelectDate:_,value:s})})})]})}),rn=()=>({root:(0,l.css)({outline:`none`})}),an={months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],goToToday:`Go to today`},on=e=>{let{onDateChange:r,defaultSelectedDate:i,onDismiss:a,strings:o=an}=e,s=rn(),[c,l]=t.useState(i??new Date),u=t.useCallback((e,t)=>{l(e),r(e),a()},[r,a]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(h.Calendar,{className:s.root,dateRangeType:h.DateRangeType.Month,highlightSelectedMonth:!0,isDayPickerVisible:!1,onSelectDate:u,value:c,onDismiss:a,showGoToToday:!1,allFocusable:!1,strings:o})})},sn=e=>{let{onSelected:r,value:o}=e,s=(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[c,l]=t.useState(o??new Date);t.useEffect(()=>{r(o??new Date),l(o??new Date)},[o]);let[u,f]=t.useState(!1),p=(e,t)=>{f(t.open)},m=t.useCallback(e=>{r(e),l(e)},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(i.Menu,{open:u,onOpenChange:p,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:(0,n.jsx)(s,{}),style:{minWidth:`200px`},"aria-label":`Select month: ${(0,a.format)(c,`MMMM yyyy`)}`,children:(0,a.format)(c,`MMMM yyyy`)})}),(0,n.jsx)(i.MenuPopover,{children:(0,n.jsx)(i.MenuList,{children:(0,n.jsx)(on,{onDateChange:m,defaultSelectedDate:c,onDismiss:()=>{f(!1)}})})})]})})},cn={selectWeekPlaceholder:`Select a week`},ln=e=>{let t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=(0,r.format)(e.start,`MMM`,{timeZone:t}),i=(0,r.format)(e.end,`MMM`,{timeZone:t});return(0,r.format)(e.start,`yyyy`,{timeZone:t})===(0,r.format)(e.end,`yyyy`,{timeZone:t})?n===i?`${(0,r.format)(e.start,`dd`,{timeZone:t})} - ${(0,r.format)(e.end,`dd MMM yyyy`,{timeZone:t})}`:`${(0,r.format)(e.start,`dd MMM`,{timeZone:t})} - ${(0,r.format)(e.end,`dd MMM yyyy`,{timeZone:t})}`:`${(0,r.format)(e.start,`dd MMM yyyy`,{timeZone:t})} - ${(0,r.format)(e.end,`dd MMM yyyy`,{timeZone:t})}`},un=e=>{let t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=(0,r.utcToZonedTime)(e,t),i=new Date(n);i.setDate(n.getDate()-n.getDay());let a=new Date(i);return a.setDate(i.getDate()+6),{start:(0,r.utcToZonedTime)(i,t),end:(0,r.utcToZonedTime)(a,t)}},dn=t.memo(e=>{let{onSelected:r,value:a,strings:o=cn}=e,s=h.DateRangeType.Week,[c,l]=t.useState(a??new Date),[u,f]=t.useState(()=>{let e=a??new Date;return e?ln(un(e)):o.selectWeekPlaceholder}),[p,m]=t.useState(!1),g=t.useCallback((e,t)=>{m(t.open)},[]),_=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[]),v=t.useCallback(e=>{if(e){l(e);let t=un(e);f(ln(t)),r({startDate:t.start,endDate:t.end}),m(!1)}},[r]),y=t.useMemo(()=>0,[]);return(0,n.jsxs)(i.Menu,{open:p,onOpenChange:g,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:(0,n.jsx)(_,{}),style:{minWidth:`200px`},"aria-label":`Select week: ${u}`,children:u})}),(0,n.jsx)(i.MenuPopover,{style:{maxWidth:`fit-content`},children:(0,n.jsx)(i.MenuList,{children:(0,n.jsx)(h.Calendar,{dateRangeType:s,highlightSelectedMonth:!0,showGoToToday:!0,onSelectDate:v,value:c,firstDayOfWeek:y})})})]})}),fn={today:`Today`,previous:`Previous`,next:`Next`},pn=t.memo(({selectedView:e,onSelectedView:r,currentDate:a,setCurrentDate:o,onWeekChange:s,onMonthChange:c,onDayChange:l,strings:u=fn})=>{let f=t.useMemo(()=>(0,d.bundleIcon)(d.ArrowDownFilled,d.ArrowDownRegular),[]),p=t.useMemo(()=>(0,d.bundleIcon)(d.ArrowUpFilled,d.ArrowUpRegular),[]),m=t.useCallback(e=>{s(e.startDate),o(e.startDate)},[s,o]),h=t.useCallback(e=>{c(e),o(e)},[c,o]),g=t.useCallback(e=>{l(e),o(e)},[l,o]),_=t.useCallback(()=>{switch(e){case W.Month:return(0,n.jsx)(sn,{onSelected:h,value:a});case W.Week:return(0,n.jsx)(dn,{onSelected:m,value:a});case W.Day:return(0,n.jsx)(nn,{onSelected:g,value:a});default:return(0,n.jsx)(sn,{onSelected:h,value:a})}},[e,h,m,g,a]),v=t.useCallback(()=>(0,n.jsx)(i.Tooltip,{content:u.today,relationship:`label`,children:(0,n.jsx)(i.Button,{shape:`circular`,icon:(0,n.jsx)(d.CalendarTodayRegular,{}),size:`medium`,onClick:()=>l(new Date),children:u.today})}),[l,u.today]),y=t.useCallback(t=>{let n=new Date(a);switch(e){case W.Month:n.setMonth(n.getMonth()+t),c(n);break;case W.Week:n.setDate(n.getDate()+t*7),s(n);break;case W.Day:n.setDate(n.getDate()+t),l(n);break;default:break}o(n)},[a,e,c,s,l,o]);return(0,n.jsxs)(B,{width:`calc(100% - 40px)`,height:`fit-content`,horizontal:!0,horizontalAlign:`space-between`,verticalAlign:`center`,paddingLeft:`20px`,paddingRight:`20px`,paddingBottom:`10px`,paddingTop:`10px`,columnGap:10,styles:{overflow:`hidden`},children:[(0,n.jsxs)(B,{horizontal:!0,horizontalAlign:`start`,verticalAlign:`center`,columnGap:10,children:[(0,n.jsx)(v,{}),(0,n.jsx)(_,{}),(0,n.jsx)(i.Tooltip,{content:u.previous,relationship:`label`,children:(0,n.jsx)(i.Button,{size:`medium`,icon:(0,n.jsx)(p,{fontSize:14}),onClick:()=>y(-1)})}),(0,n.jsx)(i.Tooltip,{content:u.next,relationship:`label`,children:(0,n.jsx)(i.Button,{size:`medium`,icon:(0,n.jsx)(f,{fontSize:14}),onClick:()=>y(1)})})]}),(0,n.jsx)(B,{horizontal:!0,horizontalAlign:`start`,verticalAlign:`center`,columnGap:10,children:(0,n.jsx)(tn,{onSelected:r,value:e})})]})}),mn={allDay:`All Day`},hn=e=>{let{events:r,currentDay:o,height:s,strings:l=mn}=e,{styles:u}=Gt(),[d]=(0,t.useState)(o),[f,p]=(0,t.useState)(32),m=(0,t.useRef)(null),{getSpanSlots:h,getEventColors:g,getCalendarColors:_,formatDate:v}=It(),y=(0,a.startOfWeek)(d,{weekStartsOn:0}),b=Intl.DateTimeFormat().resolvedOptions().timeZone,{getWeekEvents:x}=Yt(b);(0,t.useEffect)(()=>{let e=new c.ResizeObserver(()=>{if(m.current){let e=m.current.querySelector(`.dayCell`);e&&p(e.offsetHeight)}});return m.current&&e.observe(m.current),()=>{e.disconnect()}},[]);let S=t.useCallback(()=>Array.from({length:24},(e,r)=>(0,n.jsxs)(t.Fragment,{children:[(0,n.jsx)(`div`,{className:u.timeCell,children:(0,n.jsxs)(i.Body1Strong,{children:[r,`:00`]})}),(0,n.jsx)(`div`,{className:u.timeCell})]},r)),[u.timeCell]),C=t.useCallback(()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:u.blankHeader}),Array.from({length:7},(e,t)=>{let r=(0,a.addDays)(y,t),o=(0,a.isToday)(r)?u.todayHeaderCell:``;return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(u.dayHeaderCell,o),children:[(0,n.jsx)(i.Text,{weight:`regular`,size:600,style:{paddingRight:10},children:v(r.toISOString(),`dd`)}),(0,n.jsx)(i.Body1,{children:v(r.toISOString(),`EEE`)})]},t)})]}),[y,u,v]),w=t.useCallback(()=>{let e=x(r,y.toISOString());return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:u.fullDayLabel,children:(0,n.jsx)(i.Body1,{children:l.allDay})}),Array.from({length:7},(t,r)=>{let o=v((0,a.addDays)(y,r).toISOString(),`yyyy-MM-dd`),s=e.find(e=>e.date===o)?.fullDayEvents||[];return(0,n.jsx)(`div`,{className:u.fullDayCell,children:s.map(e=>(0,n.jsx)(`div`,{className:u.fullDayEvent,style:{gridColumn:`${r+2}`,backgroundColor:e.color?_(e.color).backgroundColor:g(e.category).backgroundColor},children:(0,n.jsx)(i.Caption1Strong,{className:u.eventTitle,children:e.title})},e.id))},r)})]})},[y,u,x,_,g,r,v,l.allDay]),T=t.useCallback(()=>{let e=x(r,y.toISOString());return Array.from({length:7},(t,r)=>{let i=(0,a.format)((0,a.addDays)(y,r),`yyyy-MM-dd`);return(0,n.jsx)(n.Fragment,{children:e.find(e=>e.date===i)?.timeSlots.map((e,t)=>{let r=e.events.length;return(0,n.jsx)(`div`,{className:u.dayCell,style:{gridRow:t+3},children:e.events.map((e,i)=>{let{spanSlots:a,startSlot:o}=h(new Date(e.start),new Date(e.end));return t===o?(0,n.jsx)(Jt,{event:e,eventCount:r,spanSlots:a,rowHeight:f,eventIndex:i,view:`week`},e.id):null})},t)})})})},[y,u,x,h,f,r]);return(0,n.jsx)(`div`,{className:u.container,style:{height:s},children:(0,n.jsxs)(`div`,{ref:m,className:u.weekGrid,children:[(0,n.jsx)(`div`,{className:u.timeColumn,children:S()}),C(),w(),T()]})})},gn={daysOfWeek:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},_n=({currentDate:e,rowHeight:t,getCalendarDays:r,getEventsForDay:a,styles:o,onDaySlotClick:s,height:c,calendarRef:l,strings:u})=>{let d=u?.daysOfWeek||gn.daysOfWeek;return(0,n.jsx)(B,{height:c,width:`100%`,verticalAlign:`start`,horizontalAlign:`start`,children:(0,n.jsxs)(`div`,{className:o.calendarWrapper,ref:l,role:`grid`,"aria-label":`Calendar`,children:[d.map((e,t)=>{let r=t===0||t===6;return(0,n.jsx)(i.Body1,{className:o.dayHeader,style:{color:r?i.tokens.colorPaletteRedForeground1:void 0},role:`columnheader`,children:e},e)}),r(e).map((e,r)=>{let{day:i,currentMonth:o}=e,c=o?a(e):[];return(0,n.jsx)(Wt,{day:i,date:e.date,currentMonth:e.currentMonth,events:c,columnHeight:t||0,onDayClick:s},r)})]})})},vn=t.memo(({events:e,currentDay:t,height:r,strings:i})=>(0,n.jsx)(hn,{events:e,currentDay:t,height:r,strings:i})),yn=t.memo(({events:e,currentDay:t,height:r,strings:i})=>(0,n.jsx)($t,{currentDay:t,events:e,height:r,strings:i})),bn=({events:e,height:r=800,theme:o,onDayChange:s,onMonthChange:l,onWeekChange:u,onViewChange:d,onDaySlotClick:f,defaultView:p,strings:m})=>{let{styles:h}=Ht(),g=(0,t.useRef)(null),[_,v]=(0,t.useState)(null),y=(0,t.useRef)(0),[b,x]=(0,t.useState)(new Date),[S,C]=(0,t.useState)(p??W.Month),{getMonthCalendar:w}=Yt(Intl.DateTimeFormat().resolvedOptions().timeZone),T=t.useCallback(e=>{let t=e.getMonth(),n=(0,a.startOfWeek)((0,a.startOfMonth)(e));return Array.from({length:42},(e,r)=>{let i=(0,a.addDays)(n,r);return{day:i.getDate(),currentMonth:i.getMonth()===t,date:i}})},[42]),E=t.useCallback(e=>{l&&l(e),x(e)},[l]),D=t.useCallback(e=>{s&&s(e),x(e)},[s]),O=t.useCallback(e=>{u&&u(e),x(e)},[u]),k=t.useCallback(e=>{d&&d(e),C(e)},[d]),A=t.useCallback(t=>{let{date:n}=t;return w(e,b.getFullYear(),b.getMonth())[(0,a.format)(n,`yyyy-MM-dd`)]?.flatMap(e=>e)||[]},[b,e]),j=t.useCallback(()=>{g.current&&requestAnimationFrame(()=>{if(g.current){let e=g.current.querySelector(`.${h.calendarWrapper} > div:nth-child(8)`);e&&(v(e.offsetHeight),y.current=e.offsetHeight)}})},[h.calendarWrapper]);(0,t.useEffect)(()=>{let e=new c.ResizeObserver(j);return g.current&&e.observe(g.current),j(),window.addEventListener(`resize`,j),()=>{e.disconnect(),window.removeEventListener(`resize`,j)}},[j,S]),(0,t.useEffect)(()=>{C(p||W.Month)},[p]);let M=t.useCallback(()=>{switch(S){case W.Month:return(0,n.jsx)(_n,{events:e,currentDate:b,rowHeight:_,getCalendarDays:T,getEventsForDay:A,styles:h,onDaySlotClick:f,height:r,calendarRef:g,strings:m?.calendarControl});case W.Week:return(0,n.jsx)(vn,{events:e,currentDay:b,height:r,strings:m?.weekView});case W.Day:return(0,n.jsx)(yn,{events:e,currentDay:b,height:r,strings:m?.dayView});default:return(0,n.jsx)(_n,{events:e,currentDate:b,rowHeight:_,getCalendarDays:T,getEventsForDay:A,styles:h,onDaySlotClick:f,height:r,calendarRef:g,strings:m?.calendarControl})}},[S,e,b,_,T,A,h,f,r]),N=(0,n.jsxs)(B,{height:`100%`,verticalAlign:`start`,children:[(0,n.jsx)(pn,{selectedView:S,onSelectedView:k,currentDate:b,setCurrentDate:x,onWeekChange:O,onMonthChange:E,onDayChange:D,strings:m?.toolbar}),(0,n.jsx)(M,{})]});return(0,n.jsx)(i.IdPrefixProvider,{value:`calendarControl-`,children:o?(0,n.jsx)(i.FluentProvider,{theme:o,applyStylesToPortals:!0,style:{width:`100%`},children:N}):(0,n.jsx)(`div`,{style:{width:`100%`},children:N})})},xn=()=>({styles:{root:(0,l.css)({marginLeft:i.tokens.spacingHorizontalM,marginRight:i.tokens.spacingHorizontalM,marginBottom:i.tokens.spacingVerticalM,marginTop:i.tokens.spacingVerticalM,containerType:`inline-size`,backgroundColor:i.tokens.colorNeutralBackground1,borderRadius:8,border:`1px solid ${i.tokens.colorNeutralStroke2}`}),header:(0,l.css)({borderBottom:`1px solid ${i.tokens.colorNeutralStroke2}`}),headerBackButton:(0,l.css)({fontSize:`clamp(6px, 3.5cqw, 22px)`}),headerLabel:(0,l.css)({textTransform:`capitalize`}),calendar:(0,l.css)({borderBottom:`1px solid ${i.tokens.colorNeutralStroke2}`,backgroundColor:i.tokens.colorNeutralBackground2}),weekdaysCorner:(0,l.css)({flex:`0 0 32px`}),weekday:(0,l.css)({flex:`1 1 calc(100% / 7)`,maxWidth:`calc(100% / 7)`,textAlign:`center`,textTransform:`capitalize`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`default`,userSelect:`none`,paddingBlock:`4px`,boxSizing:`border-box`}),weekNumber:(0,l.css)({flex:`0 0 28px`,marginInlineEnd:`4px`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`default`,userSelect:`none`}),day:(0,l.css)({flex:`1 1 calc(100% / 7)`,maxWidth:`calc(100% / 7)`,height:`48px`,minWidth:`0 !important`,padding:`4px !important`,fontWeight:500,fontSize:`clamp(6px, 3.5cqw, 22px)`,color:`${i.tokens.colorNeutralForeground1} !important`,cursor:`pointer`,userSelect:`none`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,position:`relative`,zIndex:0,borderRadius:0,"::before":{width:`32px`,height:`32px`,borderRadius:`100%`,content:`""`,position:`absolute`,top:`7px`,left:`calc(50% - 16px)`,zIndex:-1,pointerEvents:`none`},":focus-visible":{zIndex:1,outline:`2px solid ${i.tokens.colorBrandStroke1}`,outlineOffset:`-2px`,borderRadius:i.tokens.borderRadiusMedium},":hover::before":{backgroundColor:i.tokens.colorNeutralBackground1Hover}}),dayHidden:(0,l.css)({visibility:`hidden`,pointerEvents:`none`}),dayWeekend:(0,l.css)({color:`${i.tokens.colorPaletteRedForeground1} !important`}),dayOutside:(0,l.css)({color:`${i.tokens.colorNeutralForeground3} !important`}),dayToday:(0,l.css)({"::before":{backgroundColor:i.tokens.colorNeutralBackground3}}),daySelected:(0,l.css)({color:`${i.tokens.colorNeutralForegroundOnBrand} !important`,"::before":{backgroundColor:i.tokens.colorBrandBackground},":hover::before":{backgroundColor:i.tokens.colorBrandBackgroundHover}}),dayIndicators:(0,l.css)({position:`absolute`,bottom:`2px`,insetInline:0,paddingInlineStart:`2px`}),dayIndicator:(0,l.css)({width:`5px`,height:`5px`,borderRadius:`100%`,marginInlineStart:`-1px`}),eventsList:(0,l.css)({flex:1,minHeight:0,overflowY:`auto`,scrollbarWidth:`thin`,scrollbarColor:`${i.tokens.colorBrandBackground} ${i.tokens.colorNeutralBackground3}`,"&::-webkit-scrollbar":{width:`3px`,height:`3px`},"&::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground3,borderRadius:i.tokens.borderRadiusMedium},"&::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandBackground,borderRadius:i.tokens.borderRadiusMedium},"&::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorBrandBackgroundHover}}),eventsHeader:(0,l.css)({textTransform:`capitalize`}),event:(0,l.css)({cursor:`pointer`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke2}`,padding:`0 !important`,borderRadius:0,boxShadow:`none`,":last-child":{borderBottom:`none`},":hover":{backgroundColor:i.tokens.colorNeutralBackground1Hover},":focus-visible":{outline:`2px solid ${i.tokens.colorBrandStroke1}`,outlineOffset:`-2px`,borderRadius:i.tokens.borderRadiusMedium}}),eventColor:(0,l.css)({width:`4px`,borderRadius:`2px`,flexShrink:0,alignSelf:`stretch`}),eventTimeColor:i.tokens.colorNeutralForeground3}}),Sn=e=>(0,a.getISOWeek)(e[0]),Cn=t.memo(e=>{let{weeks:r,date:o,selectedDate:s,today:c,orderedShortDays:l,groupedEvents:u,weekendDays:d,firstDayOfWeek:f,highlightToday:p,withOutsideDays:m,withWeekNumbers:h,onDayClick:g,getEventColor:_,locale:v}=e,{styles:y}=xn(),b=t.useRef([]),x=t.useRef(null);x.current=null;let S=t.useCallback((e,t,n)=>{let r=e,i=t;switch(n.key){case`ArrowRight`:i+=1,i>=7&&(i=0,r+=1);break;case`ArrowLeft`:--i,i<0&&(i=6,--r);break;case`ArrowDown`:r+=1;break;case`ArrowUp`:--r;break;default:return}n.preventDefault();let a=b.current[r]?.[i];a&&a instanceof HTMLElement&&a.focus()},[]),C=t.useMemo(()=>(0,n.jsxs)(H,{direction:`horizontal`,marginBottom:i.tokens.spacingVerticalXS,children:[h&&(0,n.jsx)(`div`,{className:y.weekdaysCorner}),l.map((e,t)=>{let r=(f+t)%7,a=d.includes(r);return(0,n.jsx)(Ot,{as:`span`,fontSize:i.tokens.fontSizeBase200,fontWeight:`semibold`,color:a?i.tokens.colorPaletteRedForeground1:i.tokens.colorNeutralForeground3,className:y.weekday,style:{textAlign:`center`,width:`100%`},children:e},t)})]}),[l,h,y.weekdaysCorner,y.weekday]),w=t.useMemo(()=>r.map((e,t)=>{let r=e.map((e,r)=>{let l=!(0,a.isSameMonth)(e,o),f=d.includes((0,a.getDay)(e)),h=(0,a.isSameDay)(e,c)&&p,C=s?(0,a.isSameDay)(e,s):!1,w=u[(0,a.format)(e,`yyyy-MM-dd`)]||[],T=m||!l;T&&x.current===null&&(x.current={weekIndex:t,dayIndex:r});let E=x.current?.weekIndex===t&&x.current?.dayIndex===r,D=w.slice(0,3).map(e=>(0,n.jsx)(`div`,{className:y.dayIndicator,style:{backgroundColor:_(e)}},e.id));return(0,n.jsxs)(i.Button,{appearance:`transparent`,className:(0,i.mergeClasses)(y.day,!T&&y.dayHidden,l&&T&&!C&&!f&&y.dayOutside,f&&T&&!C&&y.dayWeekend,h&&!C&&y.dayToday,C&&y.daySelected),"aria-label":(0,a.format)(e,`MMMM d, yyyy`,{locale:v}),"aria-selected":C||void 0,tabIndex:T&&E?0:-1,onClick:T?()=>g(e):void 0,onKeyDown:T?e=>S(t,r,e):void 0,ref:e=>{b.current[t]||(b.current[t]=[]),b.current[t][r]=e},children:[T?e.getDate():null,T&&(0,n.jsx)(H,{direction:`horizontal`,justifyContent:`center`,className:y.dayIndicators,children:D})]},e.toISOString())}),l=Sn(e);return(0,n.jsxs)(H,{direction:`horizontal`,children:[h&&(0,n.jsx)(Ot,{fontSize:`xs`,color:i.tokens.colorNeutralForeground3,className:y.weekNumber,children:l}),r]},t)}),[r,o,s,c,d,p,m,h,u,_,g,S,y,v]);return(0,n.jsxs)(H,{direction:`vertical`,padding:i.tokens.spacingVerticalS,className:y.calendar,children:[C,w]})}),wn=t.memo(e=>{let{date:r,renderHeader:o,onYearClick:s,locale:c}=e,{styles:l}=xn(),u=(0,a.format)(r,`MMMM yyyy`,{locale:c}),f=t.useMemo(()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.Button,{appearance:`subtle`,className:l.headerBackButton,onClick:s,icon:(0,n.jsx)(d.ChevronRight20Regular,{style:{transform:`rotate(90deg)`}}),children:(0,a.format)(r,`yyyy`)}),(0,n.jsx)(Ot,{fontWeight:`bold`,className:l.headerLabel,children:u})]}),[r,s,l]),p=t.useMemo(()=>typeof o==`function`?o({date:r,defaultHeader:f}):f,[o,r,f]);return(0,n.jsx)(H,{direction:`horizontal`,alignItems:`center`,justifyContent:`space-between`,padding:i.tokens.spacingVerticalS,className:l.header,children:p})}),Tn=t.memo(({currentDate:e,onDateChange:r,todayLabel:a=`Today`,previousLabel:o=`Previous`,nextLabel:s=`Next`})=>{let c=t.useMemo(()=>(0,d.bundleIcon)(d.ArrowDownFilled,d.ArrowDownRegular),[]),l=t.useMemo(()=>(0,d.bundleIcon)(d.ArrowUpFilled,d.ArrowUpRegular),[]),u=t.useCallback(()=>{r(new Date)},[r]),f=t.useCallback(e=>{r(e)},[r]),p=t.useCallback(t=>{let n=new Date(e);n.setMonth(n.getMonth()+t),r(n)},[e,r]);return(0,n.jsxs)(H,{direction:`horizontal`,justifyContent:`flex-start`,alignItems:`center`,gap:`s`,padding:`10px 20px`,style:{overflow:`hidden`},children:[(0,n.jsx)(i.Tooltip,{content:a,relationship:`label`,children:(0,n.jsx)(i.Button,{shape:`circular`,icon:(0,n.jsx)(d.CalendarTodayRegular,{}),size:`medium`,onClick:u,children:a})}),(0,n.jsx)(sn,{onSelected:f,value:e}),(0,n.jsx)(i.Tooltip,{content:o,relationship:`label`,children:(0,n.jsx)(i.Button,{size:`medium`,icon:(0,n.jsx)(l,{fontSize:14}),onClick:()=>p(-1)})}),(0,n.jsx)(i.Tooltip,{content:s,relationship:`label`,children:(0,n.jsx)(i.Button,{size:`medium`,icon:(0,n.jsx)(c,{fontSize:14}),onClick:()=>p(1)})})]})}),En=e=>{let{events:r,header:o,allDayLabel:s,noEventsLabel:c,onEventClick:l,renderEvent:u,getEventColor:d,locale:f}=e,{styles:p}=xn(),m=t.useCallback(e=>{let t=(0,a.format)(new Date(e.start),`p`,{locale:f}),r=(0,a.format)(new Date(e.end),`p`,{locale:f}),o=e.isFullDay||t===`00:00`&&r===`00:00`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ze,{padding:`0px`,appearance:`subtle`,onClick:t=>l?.(e,t),cardBody:(0,n.jsxs)(H,{direction:`horizontal`,gap:`s`,paddingTop:i.tokens.spacingVerticalXS,paddingBottom:i.tokens.spacingVerticalXS,children:[(0,n.jsx)(`div`,{className:p.eventColor,style:{backgroundColor:d(e)}}),(0,n.jsxs)(H,{direction:`vertical`,children:[(0,n.jsx)(Ot,{as:`span`,fontWeight:`semibold`,fontSize:`s`,children:e.title}),(0,n.jsx)(Ot,{as:`span`,fontSize:`xs`,color:p.eventTimeColor,children:o?s:`${t} – ${r}`})]})]})},e.id),(0,n.jsx)(i.Divider,{style:{margin:0}})]})},[s,d,l,p]);return(0,n.jsxs)(H,{direction:`vertical`,padding:i.tokens.spacingVerticalS,className:p.eventsList,children:[(0,n.jsx)(Ot,{as:`span`,fontWeight:`bold`,marginBottom:i.tokens.spacingVerticalS,marginLeft:i.tokens.spacingHorizontalS,className:p.eventsHeader,children:o}),(0,n.jsx)(i.Divider,{style:{paddingLeft:i.tokens.spacingHorizontalS,paddingRight:i.tokens.spacingHorizontalS,paddingTop:i.tokens.spacingVerticalS}}),(0,n.jsx)(H,{direction:`vertical`,gap:`s`,style:{backgroundColor:`transparent`},padding:`s`,children:r.length>0?r.map(e=>u?u(e,m(e)):m(e)):(0,n.jsx)(Ot,{block:!0,color:i.tokens.colorNeutralForeground3,paddingTop:i.tokens.spacingVerticalXXL,paddingBottom:i.tokens.spacingVerticalXXL,style:{textAlign:`center`},children:c})})]})},Dn=e=>{let t=(0,a.startOfDay)(new Date(e.start)),n=(0,a.startOfDay)(new Date(e.end));return t.getTime()!==n.getTime()},On=(e,t)=>{if(Dn(e)){let n=(0,a.startOfDay)(new Date(e.start)),r=(0,a.startOfDay)(new Date(e.end)),i=n;for(;(0,a.isBefore)(i,r)||(0,a.isEqual)(i,r);){let n=(0,a.format)(i,`yyyy-MM-dd`);t[n]||(t[n]=[]),t[n].push(e),i=(0,a.addDays)(i,1)}return}let n=(0,a.format)(new Date(e.start),`yyyy-MM-dd`);t[n]||(t[n]=[]),t[n].push(e)},kn=(e,t)=>{let n={};if(!t)return n;let r=new Set;for(let i of t)if((0,a.isSameMonth)(new Date(i.start),e)){if(r.has(i.id)){console.warn(`[CompactCalendar] Duplicate event id found: ${i.id}`);continue}r.add(i.id),On(i,n)}return n},An=(e,n)=>(0,t.useMemo)(()=>kn(e,n),[e,n]),jn={en:o.enUS,"en-US":o.enUS,"en-us":o.enUS,ar:o.ar,"ar-SA":o.arSA,"ar-sa":o.arSA,az:o.az,"az-AZ":o.az,bg:o.bg,"bg-BG":o.bg,bs:o.bs,"bs-BA":o.bs,ca:o.ca,"ca-ES":o.ca,cs:o.cs,"cs-CZ":o.cs,cy:o.cy,da:o.da,"da-DK":o.da,de:o.de,"de-DE":o.de,el:o.el,"el-GR":o.el,es:o.es,"es-ES":o.es,et:o.et,"et-EE":o.et,eu:o.eu,fi:o.fi,"fi-FI":o.fi,fr:o.fr,"fr-FR":o.fr,gl:o.gl,he:o.he,"he-IL":o.he,hi:o.hi,"hi-IN":o.hi,hr:o.hr,"hr-HR":o.hr,hu:o.hu,"hu-HU":o.hu,id:o.id,"id-ID":o.id,it:o.it,"it-IT":o.it,ja:o.ja,"ja-JP":o.ja,kk:o.kk,"kk-KZ":o.kk,ko:o.ko,"ko-KR":o.ko,lt:o.lt,"lt-LT":o.lt,lv:o.lv,"lv-LV":o.lv,mk:o.mk,"mk-MK":o.mk,ms:o.ms,"ms-MY":o.ms,nb:o.nb,"nb-NO":o.nb,nl:o.nl,"nl-NL":o.nl,pl:o.pl,"pl-PL":o.pl,pt:o.pt,"pt-PT":o.pt,"pt-BR":o.ptBR,ro:o.ro,"ro-RO":o.ro,ru:o.ru,"ru-RU":o.ru,sk:o.sk,"sk-SK":o.sk,sl:o.sl,"sl-SI":o.sl,sr:o.sr,"sr-RS":o.sr,sv:o.sv,"sv-SE":o.sv,th:o.th,"th-TH":o.th,tr:o.tr,"tr-TR":o.tr,uk:o.uk,"uk-UA":o.uk,vi:o.vi,"vi-VN":o.vi,zh:o.zhCN,"zh-CN":o.zhCN};function Mn(e){return e?typeof e==`object`&&e?e:jn[e]||(jn[e.split(`-`)[0].toLowerCase()]??o.enUS):o.enUS}var Nn=[0,6],Pn=(e,t,n)=>{let r=(0,a.startOfMonth)(e),i=(0,a.getDay)(r),o=(0,a.getDaysInMonth)(e),s=(i-t+7)%7,c=(0,a.subDays)(r,s),l=n?42:Math.ceil((s+o)/7)*7,u=[],d=c;for(let e=0;e<l;e++){let t=Math.floor(e/7);u[t]||(u[t]=[]),u[t].push(d),d=(0,a.addDays)(d,1)}return u},Fn=r=>{let{date:o,selectedDate:s,defaultSelectedDate:c,onSelectedDateChange:l,withWeekNumbers:u=!1,firstDayOfWeek:d=1,weekendDays:f=Nn,consistentWeeks:p=!0,highlightToday:m=!0,withOutsideDays:h=!1,showToolbar:g=!1,events:_,onDayClick:v,onEventClick:y,onYearClick:b,renderHeader:x,renderEvent:S,eventsHeaderFormat:C=`EEEE, MMMM d`,locale:w,height:T,className:E,strings:D}=r,{styles:O}=xn(),{getCalendarColors:k}=It(),A=e.s(),j=e.m(),M=t.useMemo(()=>Mn(w??j?.locale),[w,j?.locale]),[N,ee]=t.useState(c??new Date),P=s===void 0?N:s,F=t.useCallback(e=>{s===void 0&&ee(e),l?.(e)},[s,l]),I=t.useMemo(()=>new Date,[]),L=An(o,_),R=D?.shortDays??A.shortDays,te=t.useMemo(()=>{let e=[];for(let t=0;t<7;t++)e.push(R[(d+t)%7]);return e},[R,d]),ne=t.useMemo(()=>Pn(o,d,p),[o,d,p]),re=t.useCallback(e=>e.hexColor?e.hexColor:e.color?k(e.color).backgroundColor:k(`royal-blue`).backgroundColor,[k]),ie=t.useCallback(e=>{F(e),v?.(e)},[F,v]),z=P?(0,a.format)(P,`yyyy-MM-dd`):``,ae=z?(L[z]||[]).sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime()):[],oe=P?(0,a.format)(P,C,{locale:M}):``;return(0,n.jsxs)(H,{direction:`vertical`,height:T??`100%`,className:(0,i.mergeClasses)(O.root,E),children:[g?(0,n.jsx)(Tn,{currentDate:o,onDateChange:e=>r.onDateChange?.(e),todayLabel:D?.today??A.today??`Today`,previousLabel:D?.previous??A.previous??`Previous`,nextLabel:D?.next??A.next??`Next`}):(0,n.jsx)(wn,{date:o,renderHeader:x,onYearClick:b,locale:M}),(0,n.jsx)(Cn,{weeks:ne,date:o,selectedDate:P,today:I,orderedShortDays:te,groupedEvents:L,weekendDays:f,firstDayOfWeek:d,highlightToday:m,withOutsideDays:h,withWeekNumbers:u,onDayClick:ie,getEventColor:re,locale:M}),(0,n.jsx)(En,{events:ae,header:oe,allDayLabel:D?.allDay??A.allDay,noEventsLabel:D?.noEvents??A.noEvents,onEventClick:y,renderEvent:S,getEventColor:re,locale:M})]})},In=(0,g.atom)(!1),Ln=(0,g.atom)(-1),Rn=(0,g.atom)(``),zn=(0,g.atom)(``),Bn=(0,g.atom)(new Set),Vn=(0,g.atom)(!0),Hn=(0,g.atom)(void 0);function Un(){return(0,g.createStore)()}var Wn=Un();function Gn(e){return{opened:e.get(In),selected:e.get(Ln),listId:e.get(Rn),query:e.get(zn),registeredActions:e.get(Bn)}}var G={open(e){e.set(In,!0),e.set(Ln,-1)},close(e){e.set(In,!1)},toggle(e){e.get(In)?e.set(In,!1):(e.set(In,!0),e.set(Ln,-1))},setQuery(e,t){t.get(Hn)?.(e),t.set(zn,e),Promise.resolve().then(()=>{G.selectAction(0,t)})},setListId(e,t){t.set(Rn,e)},selectAction(e,t){let n=t.get(Rn),r=n?document.getElementById(n):null,i=r?.querySelector(`[data-spotlight-selected]`),a=r?.querySelectorAll(`[data-spotlight-action]`)??[];if(a.length===0)return t.set(Ln,-1),-1;let o=e<0?a.length-1:e>=a.length?0:e,s=Math.max(0,Math.min(o,a.length-1));return i?.removeAttribute(`data-spotlight-selected`),a[s]?.scrollIntoView({block:`nearest`}),a[s]?.setAttribute(`data-spotlight-selected`,`true`),t.set(Ln,s),s},selectNextAction(e){return G.selectAction(e.get(Ln)+1,e)},selectPreviousAction(e){return G.selectAction(e.get(Ln)-1,e)},triggerSelectedAction(e){let t=e.get(Rn);(t?document.querySelector(`#${t} [data-spotlight-selected]`):null)?.click()},clearState(e,t){t.set(Ln,-1),e.clearQuery&&t.set(zn,``)}},Kn={open:()=>G.open(Wn),close:()=>G.close(Wn),toggle:()=>G.toggle(Wn)},qn=Kn.open,Jn=Kn.close,Yn=Kn.toggle;function Xn(){let e=Un();return[e,{open:()=>G.open(e),close:()=>G.close(e),toggle:()=>G.toggle(e)}]}function Zn(e=Wn){let[n,r]=(0,t.useState)(()=>Gn(e));return(0,t.useEffect)(()=>{let t=()=>r(Gn(e)),n=[e.sub(In,t),e.sub(Ln,t),e.sub(Rn,t),e.sub(zn,t),e.sub(Bn,t)];return t(),()=>n.forEach(e=>e())},[e]),n}function Qn(e){let t=e.toLowerCase().split(`+`).map(e=>e.trim()),n=typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/i.test(navigator.userAgent);return{key:t[t.length-1],ctrlKey:t.includes(`ctrl`)||!n&&t.includes(`mod`),metaKey:t.includes(`meta`)||n&&t.includes(`mod`),shiftKey:t.includes(`shift`),altKey:t.includes(`alt`)}}function $n(e,n=Wn,r=[`INPUT`,`TEXTAREA`,`SELECT`]){let i=(0,t.useCallback)(t=>{if(!e)return;let i=t.target;if(r.includes(i.tagName)||i.isContentEditable)return;let a=Array.isArray(e)?e:[e];for(let e of a){let r=Qn(e);if(t.key.toLowerCase()===r.key&&t.ctrlKey===r.ctrlKey&&t.metaKey===r.metaKey&&t.shiftKey===r.shiftKey&&t.altKey===r.altKey){t.preventDefault(),G.toggle(n);return}}},[e,n,r]);(0,t.useEffect)(()=>{if(e)return document.addEventListener(`keydown`,i),()=>document.removeEventListener(`keydown`,i)},[e,i])}var er=()=>({backdrop:(0,l.css)({position:`fixed`,inset:0,backgroundColor:`rgba(0, 0, 0, 0.35)`,backdropFilter:`blur(4px)`,zIndex:999999}),surface:(0,l.css)({padding:`0 !important`,overflow:`hidden`,borderRadius:i.tokens.borderRadiusXLarge,boxShadow:i.tokens.shadow64}),search:(0,l.css)({padding:i.tokens.spacingVerticalM,paddingInline:i.tokens.spacingHorizontalL,width:`100%`,boxSizing:`border-box`,"& > div":{width:`100%`}}),actionsList:(0,l.css)({borderTop:`1px solid ${i.tokens.colorNeutralStroke2}`,overflowY:`auto`}),action:(0,l.css)({alignItems:`flex-start`,width:`100%`,padding:`${i.tokens.spacingVerticalS} ${i.tokens.spacingHorizontalL}`,textAlign:`left`,gap:i.tokens.spacingHorizontalM,transition:`background-color 0.1s ease`,"&:hover":{backgroundColor:i.tokens.colorNeutralBackground1Hover},'&[data-spotlight-selected="true"]':{backgroundColor:i.tokens.colorBrandBackground,color:i.tokens.colorNeutralForegroundOnBrand}}),actionBody:(0,l.css)({flex:1,minWidth:0}),actionSectionLeft:(0,l.css)({flexShrink:0,fontSize:`30px`,paddingTop:`2px`,color:i.tokens.colorNeutralForeground3,'[data-spotlight-selected="true"] &':{color:i.tokens.colorNeutralForegroundOnBrand,opacity:.85}}),actionSectionRight:(0,l.css)({flexShrink:0,color:i.tokens.colorNeutralForeground3,'[data-spotlight-selected="true"] &':{color:i.tokens.colorNeutralForegroundOnBrand,opacity:.7}}),actionDescription:(0,l.css)({'[data-spotlight-selected="true"] &':{color:i.tokens.colorNeutralForegroundOnBrand,opacity:.7}}),actionsGroup:(0,l.css)({"&:not(:first-child)":{marginTop:i.tokens.spacingVerticalM}}),actionsGroupLabel:(0,l.css)({textTransform:`uppercase`,paddingInline:i.tokens.spacingHorizontalL,paddingBlock:i.tokens.spacingVerticalXS}),empty:(0,l.css)({padding:i.tokens.spacingVerticalL}),footer:(0,l.css)({borderTop:`1px solid ${i.tokens.colorNeutralStroke2}`}),highlight:(0,l.css)({backgroundColor:i.tokens.colorPaletteYellowBackground2,color:`inherit`,borderRadius:i.tokens.borderRadiusSmall,padding:`0 1px`,'[data-spotlight-selected="true"] &':{backgroundColor:`rgba(255, 255, 255, 0.3)`}})}),tr=({store:e=Wn,query:r,onQueryChange:a,clearQueryOnClose:o=!0,shortcut:s=`mod+K`,tagsToIgnore:c=[`INPUT`,`TEXTAREA`,`SELECT`],disabled:l=!1,onSpotlightOpen:u,onSpotlightClose:d,forceOpened:f=!1,closeOnActionTrigger:p=!0,maxWidth:m=600,yOffset:h=80,maxHeight:_=400,scrollable:v=!0,children:y,className:b})=>{let x=er(),{opened:S}=Zn(e),C=(0,t.useRef)(S);(0,t.useEffect)(()=>{e.set(Vn,p)},[e,p]),(0,t.useEffect)(()=>{e.set(Hn,a)},[e,a]),(0,t.useEffect)(()=>{typeof r==`string`&&e.set(zn,r)},[e,r]),$n(s,e,c),(0,t.useEffect)(()=>{C.current!==S&&(C.current=S,S?u?.():(d?.(),o&&G.setQuery(``,e),G.clearState({clearQuery:o},e)))},[S,u,d,o,e]);let w=(0,t.useCallback)(()=>{G.close(e)},[e]);if(l)return null;let T=S||f,E={position:`fixed`,top:typeof h==`number`?`${h}px`:h,left:`50%`,transform:`translateX(-50%)`,maxWidth:typeof m==`number`?`${m}px`:m,width:`100%`,zIndex:1e6,maxHeight:v?`calc(100vh - ${typeof h==`number`?`${h*2}px`:h})`:void 0,display:`flex`,flexDirection:`column`},D={display:`flex`,flexDirection:`column`,overflow:`hidden`,maxHeight:v?typeof _==`number`?`${_}px`:_:void 0,gap:0,padding:0};return(0,n.jsx)(g.Provider,{store:e,children:T&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:x.backdrop,onClick:w,"aria-hidden":`true`}),(0,n.jsx)(i.Dialog,{open:!0,modalType:`non-modal`,onOpenChange:(t,n)=>{n.open||G.close(e)},children:(0,n.jsx)(i.DialogSurface,{className:`${x.surface}${b?` ${b}`:``}`,style:E,"aria-label":`Spotlight search`,children:(0,n.jsx)(i.DialogBody,{style:D,children:y})})})]})})},nr=()=>({searchBoxStyles:_.css`
31
+ `},[u])}},$e=e=>{let{children:r,className:i,onScroll:a}=e,{gridStyles:o,scrollbarClassName:s}=Qe(e),l=t.useRef(null),[u,d]=t.useState(0),[f,p]=t.useState(0);return t.useEffect(()=>{let e;return l.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;d(e),p(n)}}),e.observe(l.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{className:[i,s].filter(Boolean).join(` `),style:o(u,f),ref:l,onScroll:t.useCallback(e=>{if(!a)return;let{scrollTop:t,scrollHeight:n,clientHeight:r}=e.currentTarget;(t+r)/n>=.95&&a(e)},[a]),children:r})})},et=e=>{let{maxWith:n}=e,{getBaseStyles:r}=Se();return{rootStyles:t.useCallback((t,i)=>({...r(e,t,i),maxWidth:n}),[r,n,e]),layoutGridStyles:(0,l.css)({display:`grid`,overflow:`hidden`})}},tt={areas:[`header header header`,`sidebar content sidebar`,`footer footer footer`],columns:`1fr 3fr 1fr`,rows:`auto 1fr auto`},nt=e=>{let{className:r,children:a,layoutConfig:o=tt}=e,s=t.useRef(null),[l,u]=t.useState(0),[d,f]=t.useState(0),{rootStyles:p,layoutGridStyles:m}=et({...e,layoutConfig:o}),h=((e,n)=>{let r;return t.useCallback((...t)=>{clearTimeout(r),r=setTimeout(()=>e(...t),n)},[e,n])})((e,t)=>{u(e),f(t)},200);return t.useEffect(()=>{if(!s.current)return;let e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;h(e,n)}});return e.observe(s.current),()=>e.disconnect()},[h]),(0,n.jsx)(`div`,{id:`-Layout`,className:(0,i.mergeClasses)(r,m),style:{...p(l,d),gridTemplateAreas:o.areas.join(` `),gridTemplateColumns:o.columns,gridTemplateRows:o.rows},ref:s,children:t.Children.map(a,(e,r)=>t.isValidElement(e)?(0,n.jsx)(`div`,{style:{gridArea:e.props?.area??`area-${r}`},children:e},r):e)})},rt=e=>{let{area:t,children:r}=e;return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{style:{gridArea:t},children:r})})},it=e=>{let{verticalSpacing:n,horizontalSpacing:r}=e,{getSpacing:i}=Se();return{spaceStyles:t.useCallback(e=>e?r?{width:i(r,e,`horizontal`)}:n?{height:i(n,e,`vertical`)}:{}:{},[i,r,n])}},at=e=>{let r=t.useRef(null),[i,a]=t.useState(0),{spaceStyles:o}=it(e);return t.useEffect(()=>{let e;return r.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e}=t.contentRect;a(e)}}),e.observe(r.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{id:`-space`,style:o(i),ref:r})})},ot=e=>{let{horizontal:n,horizontalAlign:r,verticalAlign:i,verticalFill:a,wrap:o,columnGap:s,RowGap:c}=e,{getBaseStyles:l}=Se();return{stackStyles:t.useCallback((t,u)=>{let d=i||`start`,f=n?r:`start`,p=n?{flexFlow:o?`row wrap`:`row nowrap`,height:`100%`}:{height:`100%`,maxHeight:`100%`},m=l(e,t,u);return{columnGap:s,rowGap:c,display:`flex`,flexDirection:n?`row`:`column`,alignItems:d,justifyContent:f,...p,height:a?`100%`:m.height,...m,...e.styles}},[l,n,r,e,i,a,o])}},B=e=>{let{children:r,className:i}=e,{stackStyles:a}=ot(e),o=t.useRef(null),[s,l]=t.useState(0),[u,d]=t.useState(0);return t.useEffect(()=>{let e;return o.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;l(e),d(n)}}),e.observe(o.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{className:i,style:a(s,u),ref:o,children:r})})},st=e=>{let{children:r,grow:i,disableShrink:a,shrink:o,order:s,alignSelf:l,verticalFill:u}=e,{getBaseStyles:d}=Se(),f=t.useRef(null),[p,m]=t.useState(0),[h,g]=t.useState(0),_=d(e,p,h);return t.useEffect(()=>{let e;return f.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;m(e),g(n)}}),e.observe(f.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(`div`,{ref:f,style:{..._,alignSelf:l,order:s,height:u?`100%`:`auto`,flexGrow:i?typeof i==`boolean`?1:i:void 0,flexShrink:a||!i&&!o?0:1,minWidth:0,minHeight:0,width:`auto`},children:r})})},ct=({ratio:e,children:t,maxWidth:r,maxHeight:i,style:a={},...o})=>{let s={position:`relative`,width:`100%`,paddingTop:`${100/e}%`,maxWidth:r||`none`,maxHeight:i||`none`,...a},c={position:`absolute`,top:0,left:0,width:`100%`,height:`100%`};return(0,n.jsx)(`div`,{style:s,...o,children:(0,n.jsx)(`div`,{style:c,children:t})})},lt=e=>{let{styles:n}=e,{getBaseStyles:r}=Se();return{aspectRatioStyles:t.useCallback((t,i)=>({...r(e,t,i),...n}),[r,e,n])}},ut=e=>{let{styles:n}=e,{getBaseStyles:r}=Se();return{centerStyles:t.useCallback((t,i)=>({...r(e,t,i),...n,overflow:`hidden`,display:`flex`,justifyContent:`center`,alignItems:`center`,width:`100%`,height:`100%`}),[r,e,n]),childrenStyles:(0,l.css)({justifyContent:`center`,textAlign:`center`})}},dt=e=>{let{className:r,children:i}=e,a=t.useRef(null),[o,s]=t.useState(0),[l,u]=t.useState(0),{centerStyles:d}=ut(e),f=(e,t)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}};return t.useEffect(()=>{let e=f(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;s(e),u(n)}},200),t=new c.ResizeObserver(t=>{e(t)});return a.current&&t.observe(a.current),()=>{t.disconnect()}},[]),(0,n.jsx)(`div`,{id:`center`,className:r,style:{...d(o,l),display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100%`,width:`100%`},ref:a,children:i})},ft=e=>{let{maxWidth:n}=e,{getBaseStyles:r}=Se();return{containerStyles:t.useCallback((t,i)=>!t||!i?{}:{...r(e,t,i),maxWidth:n},[r,n,e])}},pt=e=>{let{className:r,children:i,style:a,alignItems:o=`center`,justifyContent:l=`center`,flexDirection:u=`row`,centerContent:d=!0}=e,f=t.useRef(null),[p,m]=t.useState(0),[h,g]=t.useState(0),{containerStyles:_}=ft(e),v=t.useMemo(()=>(0,s.debounce)(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;m(e),g(n)}},200),[]);t.useEffect(()=>{let e=new c.ResizeObserver(e=>{v(e)});return f.current&&e.observe(f.current),()=>{e.disconnect(),v.cancel()}},[v]);let y=t.useMemo(()=>{if(!a)return;let{padding:e,margin:t,...n}=a;return n},[a]);return(0,n.jsx)(`div`,{id:`container`,className:r,style:{..._(p,h),display:`flex`,justifyContent:l,alignItems:o,flexDirection:u,...y},ref:f,children:d?(0,n.jsx)(dt,{children:i}):i})},mt=e=>{let[n,r]=(0,t.useState)(!0),[i,a]=(0,t.useState)(!0),o=(0,t.useCallback)(()=>{e&&e.scrollPrev()},[e]),s=(0,t.useCallback)(()=>{e&&e.scrollNext()},[e]),c=(0,t.useCallback)(e=>{r(!e.canScrollPrev()),a(!e.canScrollNext())},[]);return(0,t.useEffect)(()=>{e&&(c(e),e.on(`reInit`,c),e.on(`select`,c))},[e,c]),{prevBtnDisabled:n,nextBtnDisabled:i,onPrevButtonClick:o,onNextButtonClick:s}},ht=(e,n)=>{let{getCurrentDevice:r}=Se(),a=t.useCallback(()=>{let e=r(n),t=`95%`;switch(e){case`Medium`:t=`45%`;break;case`Large`:t=`calc(95% / 4)`;break;case`ExtraLarge`:t=`calc(95% / 5)`;break;case`ExtraExtraLarge`:t=`calc(95% / 6)`;break;default:t=`95%`;break}return t},[n,r]),o=t.useCallback(()=>{let e=r(n),t=i.tokens.spacingVerticalM;switch(e){case`Medium`:t=i.tokens.spacingVerticalM;break;case`Large`:t=i.tokens.spacingVerticalL;break;case`ExtraLarge`:t=i.tokens.spacingVerticalXL;break;default:t=i.tokens.spacingVerticalM;break}return t},[n,r]);return{enableControls:(0,l.css)({display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:10,padding:5}),embla__viewport:(0,l.css)({overflow:`hidden`,paddingTop:`10px`,paddingBottom:`20px`}),embla__container:(0,l.css)({backfaceVisibility:`hidden`,display:`flex`,touchAction:`pan-y`}),embla:(0,l.css)({".embla":{}}),embla__slide:(0,l.css)({minWidth:0,flex:`0 0 ${a()}`,paddingLeft:`${o()}`}),embla__buttons:(0,l.css)({display:`grid`,gridTemplateColumns:`repeat(2, 1fr)`,gap:0,alignItems:`center`})}},gt=e=>{let{styles:n}=e,{getBaseStyles:r}=Se();return{carouselStyles:t.useCallback((t,i)=>({...r(e,t,i),...n}),[r,e,n])}},_t=()=>({titleStyles:(0,l.css)({display:`-webkit-box`,overflow:`hidden`,textOverflow:`ellipsis`,WebkitLineClamp:`1`,WebkitBoxOrient:`vertical`,textAlign:`start`})}),vt=e=>{let{className:r,items:a,title:o}=e,s=t.useRef(null),[l,f]=t.useState(0),[p,m]=t.useState(0),{carouselStyles:h}=gt(e),[g,_]=(0,u.default)(),v=_t(),{enableControls:y,embla__slide:b,embla__container:x,embla__viewport:S,embla__buttons:C}=ht(e,l),{prevBtnDisabled:w,nextBtnDisabled:T,onPrevButtonClick:E,onNextButtonClick:D}=mt(_);return t.useEffect(()=>{let e;return s.current&&(e=new c.ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;f(e),m(n)}}),f(s.current.clientWidth),m(s.current.clientHeight),e.observe(s.current)),()=>{e&&e.disconnect()}},[]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(`div`,{id:`-carousel`,role:`region`,"aria-roledescription":`carousel`,"aria-label":o||`Carousel`,className:(0,i.mergeClasses)(r,`embla`),style:{...h(l,p)},ref:s,children:[(0,n.jsxs)(`div`,{className:y,children:[(0,n.jsx)(i.Subtitle2,{className:v.titleStyles,children:o}),(0,n.jsxs)(`div`,{className:C,children:[(0,n.jsx)(i.Button,{onClick:E,disabled:w,appearance:`subtle`,icon:(0,n.jsx)(d.ChevronLeftRegular,{}),"aria-label":`Previous slide`}),(0,n.jsx)(i.Button,{onClick:D,disabled:T,appearance:`subtle`,icon:(0,n.jsx)(d.ChevronRightRegular,{}),"aria-label":`Next slide`})]})]}),(0,n.jsx)(`div`,{className:S,ref:g,children:(0,n.jsx)(`div`,{className:x,children:a.map((e,t)=>(0,n.jsx)(`div`,{className:b,role:`group`,"aria-roledescription":`slide`,"aria-label":`Slide ${t+1} of ${a.length}`,children:e},t))})})]})})},yt=e=>{let{direction:t=`horizontal`,resizerSize:n=6}=e,r=t===`horizontal`;return{root:(0,l.css)({position:`relative`,width:`100%`,height:`100%`}),pane:e=>{let t=e===void 0?void 0:typeof e==`number`?`${e}px`:e;return(0,l.css)({overflow:`auto`,position:`relative`,...r?{width:t,height:`100%`}:{height:t,width:`100%`}})},secondaryPane:(0,l.css)({flex:1,overflow:`auto`,position:`relative`,minWidth:0,minHeight:0}),resizer:(0,l.css)({flex:`0 0 auto`,...r?{width:n,cursor:`col-resize`,height:`100%`}:{height:n,cursor:`row-resize`,width:`100%`},backgroundColor:i.tokens.colorNeutralStroke1,transition:`background-color 150ms ease`,userSelect:`none`,zIndex:1}),resizerActive:(0,l.css)({backgroundColor:i.tokens.colorBrandStroke1}),resizerGrip:(0,l.css)({gap:`2px`}),gripDot:(0,l.css)({width:3,height:3,borderRadius:`50%`,backgroundColor:i.tokens.colorNeutralForeground3})}},V={xs:i.tokens.spacingHorizontalXS,s:i.tokens.spacingHorizontalS,m:i.tokens.spacingHorizontalM,l:i.tokens.spacingHorizontalL,xl:i.tokens.spacingHorizontalXL,xxl:i.tokens.spacingHorizontalXXL},H=t.default.memo(t.default.forwardRef(({direction:e=`vertical`,justifyContent:t=`flex-start`,alignItems:r=`stretch`,gap:a,columnGap:o,rowGap:s,margin:c,padding:u,marginTop:d,marginBottom:f,marginLeft:p,marginRight:m,paddingTop:h,paddingBottom:g,paddingLeft:_,paddingRight:v,width:y,height:b,wrap:x=!1,children:S,style:C,className:w,overflow:T,background:E},D)=>(0,n.jsx)(`div`,{ref:D,className:(0,i.mergeClasses)(w,(0,l.css)({display:`flex`,flexDirection:e===`horizontal`?`row`:`column`,justifyContent:t,alignItems:r,gap:a&&V[a]?V[a]:a,columnGap:o&&V[o]?V[o]:o,rowGap:s&&V[s]?V[s]:s,margin:c&&V[c]?V[c]:c,padding:u&&V[u]?V[u]:u,marginTop:d&&V[d]?V[d]:d,marginBottom:f&&V[f]?V[f]:f,marginLeft:p&&V[p]?V[p]:p,marginRight:m&&V[m]?V[m]:m,paddingTop:h&&V[h]?V[h]:h,paddingBottom:g&&V[g]?V[g]:g,paddingLeft:_&&V[_]?V[_]:_,paddingRight:v&&V[v]?V[v]:v,width:y,height:b,overflow:T,flexWrap:x?`wrap`:`nowrap`,backgroundColor:E,...C})),children:S}))),bt=e=>{let{direction:r=`horizontal`,defaultSize:i=`50%`,minSize:a=100,maxSize:o=1/0,minSecondarySize:s=100,resizable:c=!0,onResize:l,onResizeEnd:u,primaryContent:d,secondaryContent:f,className:p,styles:m}=e,h=yt(e),g=r===`horizontal`,_=t.useRef(null),v=t.useRef(null),[y,b]=t.useState(null),[x,S]=t.useState(!1),[C,w]=t.useState(!1);t.useEffect(()=>{if(y!==null||!_.current)return;let e=_.current.getBoundingClientRect(),t=g?e.width:e.height;if(typeof i==`number`)b(Math.min(Math.max(i,a),o));else if(typeof i==`string`&&i.endsWith(`%`)){let e=parseFloat(i)/100;b(Math.min(Math.max(t*e,a),o))}else b(t/2)},[i,a,o,g,y]);let T=t.useCallback(t=>{if(!_.current)return t;let n=_.current.getBoundingClientRect(),r=(g?n.width:n.height)-(e.resizerSize??6)-s;return Math.min(Math.max(t,a),Math.min(o,r))},[g,o,a,s,e.resizerSize]),E=t.useCallback(e=>{if(!c)return;e.preventDefault(),S(!0);let t=g?e.clientX:e.clientY,n=y??0,r=e=>{let r=T(n+((g?e.clientX:e.clientY)-t));b(r),l?.(r)},i=()=>{if(S(!1),document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i),v.current){let e=g?v.current.getBoundingClientRect().width:v.current.getBoundingClientRect().height;u?.(e)}};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)},[c,g,y,T,l,u]),D=t.useCallback(e=>{if(!c)return;S(!0);let t=e.touches[0],n=g?t.clientX:t.clientY,r=y??0,i=e=>{let t=e.touches[0],i=T(r+((g?t.clientX:t.clientY)-n));b(i),l?.(i)},a=()=>{if(S(!1),document.removeEventListener(`touchmove`,i),document.removeEventListener(`touchend`,a),v.current){let e=g?v.current.getBoundingClientRect().width:v.current.getBoundingClientRect().height;u?.(e)}};document.addEventListener(`touchmove`,i,{passive:!1}),document.addEventListener(`touchend`,a)},[c,g,y,T,l,u]),O=t.useCallback(e=>{if(!c||y===null)return;let t=e.shiftKey?50:10,n=0;if(g?e.key===`ArrowLeft`?n=-t:e.key===`ArrowRight`&&(n=t):e.key===`ArrowUp`?n=-t:e.key===`ArrowDown`&&(n=t),n!==0){e.preventDefault();let t=T(y+n);b(t),l?.(t),u?.(t)}},[c,y,g,T,l,u]);t.useEffect(()=>(x?(document.body.style.userSelect=`none`,document.body.style.cursor=g?`col-resize`:`row-resize`):(document.body.style.userSelect=``,document.body.style.cursor=``),()=>{document.body.style.userSelect=``,document.body.style.cursor=``}),[x,g]);let k=t.useRef(null),A=[h.resizer,C||x?h.resizerActive:``].filter(Boolean).join(` `);return t.useEffect(()=>{if(!c||!k.current)return;let e=k.current,t=e=>E(e),n=e=>D(e),r=e=>O(e),i=()=>w(!0),a=()=>w(!1);return e.addEventListener(`mousedown`,t),e.addEventListener(`touchstart`,n),e.addEventListener(`keydown`,r),e.addEventListener(`mouseenter`,i),e.addEventListener(`mouseleave`,a),()=>{e.removeEventListener(`mousedown`,t),e.removeEventListener(`touchstart`,n),e.removeEventListener(`keydown`,r),e.removeEventListener(`mouseenter`,i),e.removeEventListener(`mouseleave`,a)}},[c,E,D,O]),(0,n.jsxs)(H,{ref:_,className:[h.root,p].filter(Boolean).join(` `),style:{height:`100%`,width:`100%`,...m},direction:g?`horizontal`:`vertical`,overflow:`hidden`,children:[(0,n.jsx)(H,{ref:v,className:h.pane(y??void 0),style:{flex:`0 0 auto`},children:d}),c&&(0,n.jsx)(`div`,{ref:k,className:A,style:{flex:`0 0 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`},role:`separator`,"aria-orientation":g?`vertical`:`horizontal`,"aria-valuenow":Math.round(y??a),"aria-valuemin":a,"aria-valuemax":o===1/0?void 0:o,"aria-label":`Resize pane`,tabIndex:0,children:(0,n.jsxs)(H,{className:h.resizerGrip,direction:g?`vertical`:`horizontal`,alignItems:`center`,justifyContent:`center`,children:[(0,n.jsx)(H,{className:h.gripDot,children:``}),(0,n.jsx)(H,{className:h.gripDot,children:``}),(0,n.jsx)(H,{className:h.gripDot,children:``})]})}),(0,n.jsx)(H,{className:h.secondaryPane,style:{flex:1,minWidth:0,minHeight:0},children:f})]})},xt=({anchorPoint:e,isOpen:r,onClose:a,excludeRefs:o,children:s,theme:c,className:l,styles:u})=>{let d=(0,t.useRef)(null),[p,m]=(0,t.useState)(null);(0,t.useLayoutEffect)(()=>{if(!r){m(null);return}if(d.current){let t=d.current.getBoundingClientRect(),n=e.left,r=e.top;n+t.width>window.innerWidth&&(n=window.innerWidth-t.width-10),r+t.height>window.innerHeight&&(r=window.innerHeight-t.height-10),m({left:n,top:r})}},[e,r,s]);let h=t.default.useCallback(e=>{let t=e.target;if(d.current&&!d.current.contains(t)){if(o&&o.some(e=>e.current&&e.current.contains(t)))return;a()}},[a,o]);if((0,t.useEffect)(()=>{if(!r)return;let e=requestAnimationFrame(()=>{document.addEventListener(`mousedown`,h)}),t=e=>{e.key===`Escape`&&a()};return document.addEventListener(`keydown`,t),()=>{cancelAnimationFrame(e),document.removeEventListener(`mousedown`,h),document.removeEventListener(`keydown`,t)}},[r,h,a]),!r)return null;let g=p||e;return f.default.createPortal(c?(0,n.jsx)(i.FluentProvider,{theme:c,children:(0,n.jsx)(i.Card,{ref:d,role:`dialog`,"aria-modal":`true`,className:l,style:{position:`fixed`,zIndex:1e3,top:g.top,left:g.left,...u},children:s})}):(0,n.jsx)(i.Card,{ref:d,role:`dialog`,"aria-modal":`true`,className:l,style:{position:`fixed`,zIndex:1e3,top:g.top,left:g.left,...u},children:s}),document.body)},St=(0,i.makeStyles)({labelContainer:{display:`flex`,flexDirection:`row`,justifyContent:`flex-start`,alignItems:`center`,...i.shorthands.gap(`6px`)},iconStyles:{width:`26px`},item:{paddingLeft:`15px`}}),Ct=e=>{let{label:r,icon:a,isRequired:o}=e,s=St();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(`div`,{className:s.labelContainer,children:[a&&t.isValidElement(a)?a:(0,n.jsx)(p.Icon,{icon:a,className:s.iconStyles,width:`20px`,height:`20px`,color:i.tokens.colorBrandForeground1,"aria-hidden":`true`}),(0,n.jsx)(i.Caption1,{style:{color:i.tokens.colorBrandForeground1},children:r}),(0,n.jsx)(i.Caption1,{style:{color:i.tokens.colorPaletteRedForeground1},children:o?` *`:``})]})})},wt=(0,i.makeStyles)({root:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100%`,width:`100%`},spinner:{width:`100px`,height:`100px`}}),Tt=e=>{let{size:t,label:r,labelPosition:a,style:o,className:s}=e,c=wt();return(0,n.jsx)(`div`,{className:c.root,children:(0,n.jsx)(i.Spinner,{style:o,className:(0,i.mergeClasses)(c.spinner,s),size:t,label:r,labelPosition:a,"aria-label":r?void 0:`Loading`})})},Et={xs:i.tokens.fontSizeBase200,s:i.tokens.fontSizeBase300,m:i.tokens.fontSizeBase400,l:i.tokens.fontSizeBase500,xl:i.tokens.fontSizeBase600,xxl:i.tokens.fontSizeHero700},U={xs:i.tokens.spacingHorizontalXS,s:i.tokens.spacingHorizontalS,m:i.tokens.spacingHorizontalM,l:i.tokens.spacingHorizontalL,xl:i.tokens.spacingHorizontalXL,xxl:i.tokens.spacingHorizontalXXL},Dt={regular:i.tokens.fontWeightRegular,semibold:i.tokens.fontWeightSemibold,bold:i.tokens.fontWeightBold},Ot=e=>{let{fontSize:t,fontFamily:r,fontWeight:a,numberOfLines:o,as:s,padding:c,paddingTop:u,paddingBottom:d,paddingLeft:f,paddingRight:p,margin:m,marginTop:h,marginBottom:g,marginLeft:_,marginRight:v,children:y,style:b,className:x,color:S,block:C,truncate:w,wrap:T}=e,E=(0,l.css)({color:S,padding:c&&U[c]?U[c]:c,paddingTop:u&&U[u]?U[u]:u,paddingBottom:d&&U[d]?U[d]:d,paddingLeft:f&&U[f]?U[f]:f,paddingRight:p&&U[p]?U[p]:p,margin:m&&U[m]?U[m]:m,marginTop:h&&U[h]?U[h]:h,marginBottom:g&&U[g]?U[g]:g,marginLeft:_&&U[_]?U[_]:_,marginRight:v&&U[v]?U[v]:v}),D={...b,...r?{fontFamily:r}:{},...t?{fontSize:Et[t]?Et[t]:t}:{},...a?{fontWeight:Dt[a]?Dt[a]:a}:{},...o?{display:`-webkit-box`,WebkitBoxOrient:`vertical`,overflow:`hidden`,WebkitLineClamp:o}:{}};return(0,n.jsx)(i.Text,{as:s,className:(0,i.mergeClasses)(x,E),style:D,block:C,truncate:w,wrap:T,children:y})},kt=e=>{let{onSelected:r,value:a,styles:o,options:s,apparence:c,shape:l,label:u}=e,d=t.useRef(),[f,p]=t.useState(a??s[0]),[m,h]=t.useState({option:[a?a?.key:s?.[0]?.key]}),g=t.useRef(null);t.useEffect(()=>{a!==void 0&&(p(a),h({option:[a.key]})),d.current=s.find(e=>e.key===(a?.key??s[0]?.key))?.icon},[a]);let[_,v]=t.useState(!1),y=t.useCallback((e,t)=>{v(t.open)},[]),b=t.useCallback(e=>e?.text??``,[]),x=t.useCallback((e,{name:t,checkedItems:n})=>{if(t===`option`){let e=n[0];p(s.find(t=>t.key===e)),h({option:n}),d.current=s.find(t=>t.key===e)?.icon,r(s.find(t=>t.key===e))}},[s,r]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(i.Field,{label:u,style:o,ref:g,children:(0,n.jsxs)(i.Menu,{open:_,onOpenChange:y,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:l??`circular`,icon:d.current,appearance:c??`secondary`,children:b(f)??`No data available`})}),(0,n.jsx)(i.MenuPopover,{children:(0,n.jsx)(i.MenuList,{onCheckedValueChange:x,checkedValues:m,style:{width:g.current?.offsetWidth},children:s.map(e=>(0,n.jsx)(i.MenuItemRadio,{name:`option`,value:e.key,icon:e.icon,disabled:e.disabled,children:b(e)},e.key))})})]})})})},At=()=>({styles:{container:(0,l.css)({display:`flex`,alignItems:`center`,alignContent:`center`,overflow:`hidden`,whiteSpace:`nowrap`,padding:`8px`,backgroundColor:`transparent`}),breadcrumbItem:(0,l.css)({minWidth:`fit-content`,padding:0,margin:`0px`}),separator:(0,l.css)({marginRight:`8px`})},getStyles:(e,t)=>{let{icon:n}=e;switch(t){case`small`:return(0,l.css)({fontSize:`12px`,padding:`4px`,paddingLeft:n?`0px`:`4px`});case`medium`:return(0,l.css)({fontSize:`14px`,padding:`6px`,paddingLeft:n?`0px`:`6px`});case`large`:return(0,l.css)({fontSize:`16px`,padding:`8px`,paddingLeft:n?`0px`:`8px`});case`current`:return(0,l.css)({fontWeight:i.tokens.fontWeightBold,cursor:`default`,display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,overflow:`hidden`,textAlign:`start`,textOverflow:`ellipsis`,wordBreak:`break-word`,fontFamily:i.tokens.fontFamilyBase});default:return(0,l.css)({fontSize:`14px`,padding:`6px`,paddingLeft:n?`0px`:`6px`})}}}),jt=({items:e,theme:r,size:a=`medium`})=>{let[o,s]=(0,t.useState)(!1),c=(0,t.useRef)(null),l=(0,t.useRef)(null),[u,p]=(0,t.useState)({top:0,left:0,position:`absolute`}),{getStyles:m}=At();return(0,t.useEffect)(()=>{let e=e=>{!c.current?.contains(e.target)&&!l.current?.contains(e.target)&&o&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.Button,{ref:c,icon:(0,n.jsx)(d.MoreHorizontalRegular,{}),appearance:`transparent`,onClick:()=>{if(c.current){let e=c.current.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,r=l.current?.offsetWidth||200,i=l.current?.offsetHeight||100,a=e.bottom+window.scrollY,o=e.left+window.scrollX;o+r>t&&(o=t-r-10),a+i>n&&(a=e.top+window.scrollY-i),p({top:a,left:o,position:`absolute`}),s(e=>!e)}},"aria-label":`More items`}),o&&(0,f.createPortal)(r?(0,n.jsx)(i.FluentProvider,{theme:r,children:(0,n.jsx)(i.Card,{ref:l,style:{...u,zIndex:1e3,padding:`8px`,minWidth:`150px`},children:e.map((e,t)=>(0,n.jsx)(i.Button,{icon:e.icon?e.icon:null,appearance:`transparent`,onClick:()=>{e.onClick?.(),s(!1)},children:(0,n.jsx)(i.Text,{className:m(e,a),children:e.label})},`overflow-${t}`))})}):(0,n.jsx)(i.Card,{ref:l,style:{...u,zIndex:1e3,padding:`8px`,minWidth:`150px`},children:e.map((e,t)=>(0,n.jsx)(i.Button,{icon:e.icon?e.icon:null,appearance:`transparent`,onClick:()=>{e.onClick?.(),s(!1)},children:(0,n.jsx)(i.Text,{className:m(e,a),children:e.label})},`overflow-${t}`))}),document.body)]})},Mt=(e,t)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}},Nt=({items:e,maxWidth:r=`100%`,styles:a,theme:o,size:s=`medium`,currentIndex:l=e.length-1,className:u})=>{let{styles:f,getStyles:p}=At(),m=(0,t.useRef)(null),[h,g]=(0,t.useState)([]),[_,v]=(0,t.useState)([]);return(0,t.useEffect)(()=>{let t=()=>{if(!m.current)return;let t=m.current.offsetWidth,n=0,r=[],i=[];e.forEach(e=>{n+80<=t-50?(r.push(e),n+=80):i.push(e)}),g(r),v(i)},n=Mt(t,100),r=new c.ResizeObserver(()=>{n()});return m.current&&r.observe(m.current),t(),()=>{r.disconnect()}},[e]),(0,n.jsx)(`div`,{ref:m,className:(0,i.mergeClasses)(f.container,u),style:{maxWidth:r,...a},children:(0,n.jsxs)(B,{horizontal:!0,verticalAlign:`center`,horizontalAlign:`start`,children:[h.map((e,r)=>(0,n.jsxs)(t.default.Fragment,{children:[r===l?(0,n.jsxs)(B,{horizontal:!0,verticalAlign:`center`,horizontalAlign:`start`,columnGap:5,styles:{overflow:`hidden`},children:[e.icon?t.default.cloneElement(e.icon,{style:{fontSize:s===`large`?`20px`:s===`medium`?`16px`:`12px`}}):null,(0,n.jsx)(i.Text,{className:(0,i.mergeClasses)(f.breadcrumbItem,p(e,s),p(e,`current`)),"aria-current":`page`,children:e.label},e.label)]}):(0,n.jsx)(i.Button,{icon:e.icon?e.icon:null,appearance:`transparent`,className:`${f.breadcrumbItem}`,onClick:e.onClick,children:(0,n.jsx)(i.Text,{className:p(e,s),children:e.label})},e.label),r<h.length-1&&(0,n.jsx)(d.ChevronRightRegular,{style:{fontSize:s===`large`?`20px`:s===`medium`?`16px`:`12px`}})]},e.label??`breadcrumb-${r}`)),_.length>0&&(0,n.jsx)(jt,{items:_,theme:o})]})})},Pt=({icon:e,hoverIcon:r,imageSrc:a,width:o=24,height:s=24,color:c,hoverColor:l,onClick:u,enabled:d=!0,ariaLabel:f})=>{let p=c||i.tokens.colorBrandBackground,m=l||i.tokens.colorBrandBackgroundHover,h=i.tokens.fontFamilyBase,[g,_]=(0,t.useState)(!1),v=(0,t.useCallback)(()=>{d&&_(!0)},[d]),y=(0,t.useCallback)(()=>{d&&_(!1)},[d]),b=(0,t.useMemo)(()=>d&&g&&r?r:e,[g,r,e,d]),x=(0,t.useMemo)(()=>({width:o,height:s,color:g?m:p,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:d?1:.5,fontFamily:h,fontSize:`inherit`}),[o,s,g,m,p,d,h]),S=(0,t.useMemo)(()=>({border:`none`,background:`none`,padding:0,cursor:d?`pointer`:`default`}),[d]),C=(0,t.useMemo)(()=>({width:o,height:s,objectFit:`contain`,opacity:d?1:.5}),[o,s,d]);return(0,n.jsx)(i.Button,{onClick:d?u:void 0,onMouseEnter:v,onMouseLeave:y,disabled:!d,style:S,"aria-label":f??`Icon Button`,children:a?(0,n.jsx)(`img`,{src:a,alt:`icon`,style:C}):t.default.cloneElement(b,{style:{...b.props.style,...x}})})},Ft=t.default.memo(Pt),It=()=>({getSpanSlots:t.useCallback((e,t)=>{let n=new Date(e),r=new Date(t),i=n.getHours(),a=n.getMinutes(),o=i*2+(a>=1?1:0),s=r.getHours(),c=r.getMinutes(),l=s*2+(c>=1?2:0);return{spanSlots:l-o,startSlot:o,endSlot:l}},[]),generateLightAndHoverColors:t.useCallback((e,t=20,n=10)=>{let r=e=>{let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=i-a,s=0,c=0,l=(i+a)/2;if(o!==0){switch(c=l>.5?o/(2-i-a):o/(i+a),i){case t:s=(n-r)/o+(n<r?6:0);break;case n:s=(r-t)/o+2;break;case r:s=(t-n)/o+4;break}s/=6}return{h:s*360,s:c*100,l:l*100}},i=(e,t,n)=>{let r=t*Math.min(n,100-n)/100,i=t=>{let i=(t+e/30)%12,a=n-r*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*a).toString(16).padStart(2,`0`)};return`#${i(0)}${i(8)}${i(4)}`},{h:a,s:o,l:s}=r(e);return{lightColor:i(a,o,Math.min(s+t,100)),hoverColor:i(a,o,Math.min(s+n,100))}},[]),getEventColors:t.useCallback(e=>{let t={backgroundColor:i.tokens.colorNeutralBackground3,hoverColor:i.tokens.colorNeutralBackground3Hover};return{"no category":t,meeting:{backgroundColor:i.tokens.colorPaletteBlueBackground2,hoverColor:i.tokens.colorPaletteBlueBorderActive},appointment:{backgroundColor:i.tokens.colorPaletteGreenBackground2,hoverColor:i.tokens.colorPaletteGreenBorderActive},task:{backgroundColor:i.tokens.colorPaletteRedBackground2,hoverColor:i.tokens.colorPaletteRedBorderActive},deadline:{backgroundColor:i.tokens.colorPaletteYellowBackground2,hoverColor:i.tokens.colorPaletteYellowBorderActive},holiday:{backgroundColor:i.tokens.colorPalettePurpleBackground2,hoverColor:i.tokens.colorPalettePurpleBorderActive},celebration:{backgroundColor:i.tokens.colorPaletteDarkOrangeBackground2,hoverColor:i.tokens.colorPaletteDarkOrangeBorderActive},reminder:{backgroundColor:i.tokens.colorPaletteTealBackground2,hoverColor:i.tokens.colorPaletteTealBorderActive},workshop:{backgroundColor:i.tokens.colorPaletteTealBackground2,hoverColor:i.tokens.colorPaletteTealBorderActive},webinar:{backgroundColor:i.tokens.colorPaletteMagentaBackground2,hoverColor:i.tokens.colorPaletteMagentaBorderActive},conference:{backgroundColor:i.tokens.colorPaletteBrownBackground2,hoverColor:i.tokens.colorPaletteBrownBorderActive}}[e.toLowerCase()]||t},[]),generateColor:t.useCallback(e=>{let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);let n=(t&16777215).toString(16).toUpperCase();return`#${`00000`.substring(0,6-n.length)+n}`},[]),getCalendarColors:t.useCallback(e=>{let t={beige:{backgroundColor:i.tokens.colorPaletteBeigeBackground2,hoverColor:i.tokens.colorPaletteBeigeBorderActive},blue:{backgroundColor:i.tokens.colorPaletteBlueBackground2,hoverColor:i.tokens.colorPaletteBlueBorderActive},brown:{backgroundColor:i.tokens.colorPaletteBrownBackground2,hoverColor:i.tokens.colorPaletteBrownBorderActive},gold:{backgroundColor:i.tokens.colorPaletteGoldBackground2,hoverColor:i.tokens.colorPaletteGoldBorderActive},lavender:{backgroundColor:i.tokens.colorPaletteLavenderBackground2,hoverColor:i.tokens.colorPaletteLavenderBorderActive},magenta:{backgroundColor:i.tokens.colorPaletteMagentaBackground2,hoverColor:i.tokens.colorPaletteMagentaBorderActive},navy:{backgroundColor:i.tokens.colorPaletteNavyBackground2,hoverColor:i.tokens.colorPaletteNavyBorderActive},pink:{backgroundColor:i.tokens.colorPalettePinkBackground2,hoverColor:i.tokens.colorPalettePinkBorderActive},plum:{backgroundColor:i.tokens.colorPalettePlumBackground2,hoverColor:i.tokens.colorPalettePlumBorderActive},purple:{backgroundColor:i.tokens.colorPalettePurpleBackground2,hoverColor:i.tokens.colorPalettePurpleBorderActive},red:{backgroundColor:i.tokens.colorPaletteRedBackground2,hoverColor:i.tokens.colorPaletteRedBorderActive},teal:{backgroundColor:i.tokens.colorPaletteTealBackground2,hoverColor:i.tokens.colorPaletteTealBorderActive},anchor:{backgroundColor:i.tokens.colorPaletteAnchorBackground2,hoverColor:i.tokens.colorPaletteAnchorBorderActive},"dark-red":{backgroundColor:i.tokens.colorPaletteDarkRedBackground2,hoverColor:i.tokens.colorPaletteDarkRedBorderActive},cranberry:{backgroundColor:i.tokens.colorPaletteCranberryBackground2,hoverColor:i.tokens.colorPaletteCranberryBorderActive},pumpkin:{backgroundColor:i.tokens.colorPalettePumpkinBackground2,hoverColor:i.tokens.colorPalettePumpkinBorderActive},peach:{backgroundColor:i.tokens.colorPalettePeachBackground2,hoverColor:i.tokens.colorPalettePeachBorderActive},marigold:{backgroundColor:i.tokens.colorPaletteMarigoldBackground2,hoverColor:i.tokens.colorPaletteMarigoldBorderActive},brass:{backgroundColor:i.tokens.colorPaletteBrassBackground2,hoverColor:i.tokens.colorPaletteBrassBorderActive},forest:{backgroundColor:i.tokens.colorPaletteForestBackground2,hoverColor:i.tokens.colorPaletteForestBorderActive},seafoam:{backgroundColor:i.tokens.colorPaletteSeafoamBackground2,hoverColor:i.tokens.colorPaletteSeafoamBorderActive},"dark-green":{backgroundColor:i.tokens.colorPaletteDarkGreenBackground2,hoverColor:i.tokens.colorPaletteDarkGreenBorderActive},"light-teal":{backgroundColor:i.tokens.colorPaletteLightTealBackground2,hoverColor:i.tokens.colorPaletteLightTealBorderActive},steel:{backgroundColor:i.tokens.colorPaletteSteelBackground2,hoverColor:i.tokens.colorPaletteSteelBorderActive},"royal-blue":{backgroundColor:i.tokens.colorPaletteRoyalBlueBackground2,hoverColor:i.tokens.colorPaletteRoyalBlueBorderActive},cornflower:{backgroundColor:i.tokens.colorPaletteCornflowerBackground2,hoverColor:i.tokens.colorPaletteCornflowerBorderActive},grape:{backgroundColor:i.tokens.colorPaletteGrapeBackground2,hoverColor:i.tokens.colorPaletteGrapeBorderActive},lilac:{backgroundColor:i.tokens.colorPaletteLilacBackground2,hoverColor:i.tokens.colorPaletteLilacBorderActive},mink:{backgroundColor:i.tokens.colorPaletteMinkBackground2,hoverColor:i.tokens.colorPaletteMinkBorderActive},platinum:{backgroundColor:i.tokens.colorPalettePlatinumBackground2,hoverColor:i.tokens.colorPalettePlatinumBorderActive}},n=t[`royal-blue`];return t[e]||n},[]),formatDate:t.useCallback((e,t)=>(0,a.format)((0,a.parseISO)(e),t),[])}),Lt={start:`Start`,end:`End`,location:`Location`,attendees:`Attendees`,details:`Details`},Rt=`32px`,zt=e=>({styles:{banner:(0,l.css)({display:`flex`,justifyContent:`center`,alignContent:`center`,alignItems:`center`,padding:`5px 10px 0px 10px`}),fieldContainer:(0,l.css)({paddingLeft:Rt}),title:(0,l.css)({lineClamp:2,overflow:`hidden`,display:`-webkit-box`,WebkitBoxOrient:`vertical`,wordBreak:`break-word`,WebkitLineClamp:2})}}),Bt=({fieldLabel:e,fieldValue:t,icon:r})=>(0,n.jsxs)(B,{children:[(0,n.jsx)(Ct,{label:e,icon:r}),(0,n.jsx)(B,{paddingLeft:Rt,children:(0,n.jsx)(i.Body1,{children:t})})]}),Vt=e=>{let{event:r,strings:a=Lt}=e,{title:o,start:s,end:c,location:l,category:u,attendees:d,weblink:f}=r,{styles:p}=zt(r),{formatDate:m}=It(),h=m(s,`PPp`),g=m(c,`PPp`),_=(0,i.partitionAvatarGroupItems)({items:d?.map(e=>e.id)||[]}),v=t.useCallback(e=>d?.find(t=>t.id===e)||void 0,[d]),y=t.useCallback(()=>(0,n.jsxs)(B,{children:[(0,n.jsx)(Ct,{label:a.attendees,icon:`ph:users-three`}),(0,n.jsx)(B,{paddingLeft:Rt,children:(0,n.jsxs)(i.AvatarGroup,{layout:`stack`,children:[_.inlineItems.map(e=>(0,n.jsx)(i.AvatarGroupItem,{name:v(e)?.name,image:{src:v(e)?.imageUrl}},e)),_.overflowItems&&(0,n.jsx)(i.AvatarGroupPopover,{children:_.overflowItems.map(e=>(0,n.jsx)(i.AvatarGroupItem,{name:v(e)?.name,image:{src:v(e)?.imageUrl}},e))})]})})]}),[_,v,a.attendees]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ze,{appearance:`subtle`,padding:`m`,paddingTop:`s`,width:`250px`,cardBody:(0,n.jsxs)(B,{RowGap:10,children:[(0,n.jsx)(`div`,{className:p.banner,children:(0,n.jsx)(i.Subtitle1,{className:p.title,children:o})}),(0,n.jsx)(i.Divider,{}),u&&(0,n.jsx)(B,{horizontal:!0,horizontalAlign:`end`,width:`100%`,children:(0,n.jsx)(i.Badge,{appearance:`filled`,children:u})}),(0,n.jsx)(Bt,{fieldLabel:a.start,fieldValue:h,icon:`mingcute:time-line`}),(0,n.jsx)(Bt,{fieldLabel:a.end,fieldValue:g,icon:`mingcute:time-line`}),(0,n.jsx)(Bt,{fieldLabel:a.location,fieldValue:l,icon:`mingcute:location-line`}),(0,n.jsx)(y,{})]}),cardFooterContent:(0,n.jsx)(B,{horizontal:!0,horizontalAlign:`end`,width:`100%`,children:(0,n.jsx)(i.Button,{appearance:`subtle`,onClick:()=>{window.open(f,`_blank`)},children:a.details})})})})},Ht=()=>({styles:{calendarWrapper:(0,l.css)({padding:`20px`,paddingTop:`10px`,overflow:`auto`,flex:1,display:`grid`,gridTemplateColumns:`repeat(7, 1fr)`,gridTemplateRows:`auto`,gridAutoRows:`minmax(100px, 1fr)`,gap:`1px`,width:`calc(100% - 40px)`}),header:(0,l.css)({display:`flex`,justifyContent:`start`,gap:`10px`,alignItems:`center`,padding:`16px`}),dayHeader:(0,l.css)({textAlign:`start`,padding:`8px`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),day:(0,l.css)({display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,border:`1px solid ${i.tokens.colorNeutralStroke1}`,backgroundColor:i.tokens.colorNeutralBackground1,position:`relative`}),otherMonthDay:(0,l.css)({color:i.tokens.colorNeutralStroke2,backgroundColor:i.tokens.colorNeutralBackground2}),cardDay:(0,l.css)({height:`100%`,minHeight:100,borderRadius:0,overflow:`hidden !important`,rowGap:5}),cardDayOnHover:(0,l.css)({":hover":{backgroundColor:i.tokens.colorNeutralBackground2}}),currentDay:(0,l.css)({borderTop:`5px solid ${i.tokens.colorBrandBackground}`}),currentDayLabel:(0,l.css)({color:i.tokens.colorBrandBackground,fontWeight:600}),eventCard:(0,l.css)({display:`flex`,flexDirection:`column`,alignItems:`flex-start`,zIndex:1}),eventContainer:(0,l.css)({display:`flex`,flexDirection:`column`,overflowY:`auto`,paddingTop:`5px`,paddingBottom:`5px`,paddingLeft:`5px`,paddingRight:`5px`,"::-webkit-scrollbar":{width:`5px`,height:`5px`},"::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground4,borderRadius:`10px`},"::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandStroke2Hover,borderRadius:`10px`},"::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorNeutralStroke2}}),eventCardWeekView:(0,l.css)({backgroundColor:i.tokens.colorBrandBackground,color:i.tokens.colorNeutralForegroundOnBrand,borderRadius:`4px`,padding:`4px`,margin:`2px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,height:`100%`}),popoverContent:(0,l.css)({padding:0,borderTopWidth:20,borderTopStyle:`solid`}),cardMonthTitle:(0,l.css)({display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,textAlign:`start`,textOverflow:`ellipsis`,paddingLeft:`8px`,wordBreak:`break-word`,overflow:`hidden`})},applyEventHouverColorClass:(e,t)=>(0,l.css)({backgroundColor:e??i.tokens.colorBrandBackground,":hover":{backgroundColor:t??i.tokens.colorBrandBackgroundHover}})}),Ut=e=>{let r=(0,i.useId)(),{events:o,date:s,onCardHoverChange:c,columnHeight:l}=e,{styles:u,applyEventHouverColorClass:d}=Ht(),f=t.useRef(null),{getEventColors:p,getCalendarColors:m}=It(),h=t.useCallback(e=>{c&&c(!0,e)},[c]),g=t.useCallback(e=>{c&&c(!1,e)},[c]),_=t.useCallback(e=>{f.current?.setTarget(e)},[f]),v=t.useCallback((e,t,r)=>(0,n.jsx)(`div`,{ref:_,children:(0,n.jsx)(Ze,{className:(0,i.mergeClasses)(u.eventCard,d(r.backgroundColor,r.backgroundColor)),paddingTop:`4px`,paddingBottom:`4px`,paddingLeft:`8px`,paddingRight:`8px`,marginTop:e===0?`0px`:`5px`,cardHeader:(0,n.jsx)(i.Caption1,{className:u.cardMonthTitle,children:t.title}),onMouseEnter:()=>h(t.title),onMouseLeave:()=>g(t.title)})},t.id??`card-${e}`),[h,g,d]),y=t.useCallback((e,t,a)=>(0,n.jsxs)(i.Popover,{withArrow:!0,mouseLeaveDelay:30,closeOnScroll:!0,closeOnIframeFocus:!0,openOnHover:!0,children:[(0,n.jsx)(i.PopoverTrigger,{children:v(t,e,a)}),(0,n.jsx)(i.PopoverSurface,{"aria-labelledby":r,className:(0,i.mergeClasses)(u.popoverContent),children:(0,n.jsx)(Vt,{event:e})})]},t),[v,r,u.popoverContent]);return!o||!o?.length?(0,n.jsx)(n.Fragment,{children:` `}):(0,n.jsx)(`div`,{style:{height:l},className:u.eventContainer,children:o.map((e,n)=>{if(!(0,a.isWithinInterval)(s,{start:(0,a.startOfDay)(new Date(e.start)),end:(0,a.endOfDay)(new Date(e.end))}))return null;let r;r=e.hexColor?{backgroundColor:e.hexColor,hoverColor:e.hexColor}:e.color?m(e.color):p(e.category);let o=e.onRenderInMonthView?.(e),c=e.id??`event-${n}`;return t.isValidElement(o)?t.cloneElement(o,{key:c,className:(0,i.mergeClasses)(o.props.className,u.eventCard)}):e.enableOnHouver?y(e,n,r):v(n,e,r)})})},Wt=e=>{let{day:r,currentMonth:o,events:s,date:c,columnHeight:l,onDayClick:u}=e,{styles:d}=Ht(),f=new Date,[p,m]=t.useState(!1),h=c.getDay()===0||c.getDay()===6,g=t.useMemo(()=>(0,a.isSameDay)(c,f),[c,f]),_=t.useMemo(()=>(0,n.jsx)(B,{horizontal:!0,horizontalAlign:`start`,verticalAlign:`center`,paddingLeft:`m`,paddingRight:`m`,children:(0,n.jsxs)(i.Body2,{className:d.currentDayLabel,style:{color:h?`${i.tokens.colorPaletteRedForeground1} !important`:``},children:[r,` `,f.toLocaleString(`default`,{month:`short`})]})}),[r,h,f,d.currentDayLabel]),v=t.useCallback(e=>{m(e)},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ze,{onClick:u?()=>u(c):void 0,className:(0,i.mergeClasses)(d.cardDay,o?``:d.otherMonthDay,g?d.currentDay:``,p?``:d.cardDayOnHover),cardHeader:g?_:(0,n.jsx)(B,{horizontal:!0,paddingLeft:`m`,paddingRight:`m`,children:(0,n.jsx)(i.Body2,{style:{color:h?`${i.tokens.colorPaletteRedForeground1} !important`:``},children:r})}),paddingTop:`m`,paddingBottom:`m`,paddingLeft:`0px`,paddingRight:`0px`,cardBody:(0,n.jsx)(Ut,{events:s,date:c,onCardHoverChange:v,columnHeight:l-60})})})},Gt=()=>({styles:{container:(0,l.css)({display:`flex`,flexDirection:`column`,width:`calc(100% - 40px)`,height:`100vh`,overflow:`hidden`,padding:`20px`}),header:(0,l.css)({display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`16px`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),weekGrid:(0,l.css)({display:`grid`,gridTemplateColumns:`80px repeat(7, 1fr)`,gridTemplateRows:`50px 40px repeat(48, 33px)`,height:`fit-content`,overflowY:`auto`,border:`1px solid ${i.tokens.colorNeutralStroke1}`,maxHeight:`calc(100vh - 100px)`,scrollbarWidth:`thin`,scrollbarColor:`${i.tokens.colorBrandBackground} ${i.tokens.colorNeutralBackground1}`,"&::-webkit-scrollbar":{width:`8px`},"&::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground1},"&::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandBackground,borderRadius:`4px`},"&::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorBrandBackgroundHover}}),blankHeader:(0,l.css)({gridColumn:`1`,backgroundColor:i.tokens.colorNeutralBackground3,borderBottom:`3px solid ${i.tokens.colorNeutralStroke3}`,position:`sticky`,top:0,zIndex:10}),timeColumn:(0,l.css)({gridColumn:`1`,gridRow:`3 / span 49`,display:`flex`,flexDirection:`column`,backgroundColor:i.tokens.colorNeutralBackground1,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`}),timeCell:(0,l.css)({height:`100%`,display:`flex`,alignItems:`center`,fontSize:`12px`,color:i.tokens.colorNeutralForeground3,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,justifyContent:`center`}),fullDayRow:(0,l.css)({gridRow:`2`,display:`grid`,gridTemplateColumns:`80px repeat(7, 1fr)`,gap:`0`,padding:`0`,backgroundColor:i.tokens.colorNeutralBackground2,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayLabel:(0,l.css)({gridColumn:`1`,display:`flex`,alignItems:`center`,justifyContent:`center`,alignContent:`center`,color:i.tokens.colorBrandBackground,padding:`5px`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayCell:(0,l.css)({borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,display:`flex`,flexDirection:`row`,gap:`0px`,padding:`4px`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`,overflow:`hidden`}),fullDayEvent:(0,l.css)({flex:`1 1 auto`,minWidth:`24px`,height:`24px`,padding:`4px 8px`,backgroundColor:i.tokens.colorBrandBackground,borderRadius:`4px`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`}),dayHeaderCell:(0,l.css)({textAlign:`center`,backgroundColor:i.tokens.colorNeutralBackground2,padding:`8px`,fontWeight:`bold`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,position:`sticky`,top:0,zIndex:10}),todayHeaderCell:(0,l.css)({borderTop:`5px solid ${i.tokens.colorBrandBackground}`}),eventCard:(0,l.css)({padding:2,alignItems:`center`,justifyContent:`center`,marginRight:`2px`,zIndex:1,position:`absolute`,alignContent:`center`,overflow:`hidden`,":hover":{pointerEvents:`auto`,cursor:`pointer`}}),event:(0,l.css)({height:`100%`,backgroundColor:i.tokens.colorBrandBackground,borderRadius:`4px`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginRight:`2px`,zIndex:1,position:`absolute`,alignContent:`center`,":hover":{pointerEvents:`auto`,cursor:`pointer`}}),dayCell:(0,l.css)({borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,position:`relative`,overflow:`visible`,FlexDirection:`column`,gap:`4px`}),currentTimeIndicator:(0,l.css)({position:`absolute`,left:0,height:`2px`,backgroundColor:i.tokens.colorPaletteRedBorderActive,width:`100%`,zIndex:1}),currentHalfHourCell:(0,l.css)({border:`2px solid ${i.tokens.colorPaletteRedBorderActive}`}),eventTitle:(0,l.css)({display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,textAlign:`start`,textOverflow:`ellipsis`,paddingLeft:`8px`,wordBreak:`break-word`,overflow:`hidden`}),popoverContent:(0,l.css)({padding:0,borderTopWidth:20,borderTopStyle:`solid`})},applyEventHouverColorClass:t.default.useCallback((e,t)=>(0,l.css)({backgroundColor:e??i.tokens.colorBrandBackground,":hover":{backgroundColor:t??i.tokens.colorBrandBackgroundHover}}),[i.tokens.colorBrandBackground,i.tokens.colorBrandBackgroundHover]),appyDynamicStyles:t.default.useCallback((e,t,n,r)=>(0,l.css)({flex:`0 0 calc(100% / ${t})`,height:`${n*r}px`,left:`${e*10}%`,width:`calc(${100-e*10}% - 8px)`,margin:4,marginTop:0,marginBottom:0}),[])}),Kt={timeSeparator:` - `,hourSuffix:`H`},qt=({event:e,colors:r,spanSlots:a,rowHeight:o,eventIndex:s,eventCount:c,strings:l=Kt})=>{let u=(0,i.useId)(),{styles:d,applyEventHouverColorClass:f,appyDynamicStyles:p}=Gt(),m=t.useRef(null),{formatDate:h}=It(),g=t.useMemo(()=>(0,n.jsx)(`div`,{children:(0,n.jsxs)(B,{columnGap:4,verticalAlign:`center`,children:[(0,n.jsx)(i.Caption1Strong,{className:d.eventTitle,children:e.title}),(0,n.jsxs)(B,{columnGap:4,horizontal:!0,verticalAlign:`center`,horizontalAlign:`start`,children:[(0,n.jsxs)(i.Caption1,{children:[h(e.start,`HH:mm`),l.hourSuffix]}),l.timeSeparator,(0,n.jsxs)(i.Caption1,{children:[h(e.end,`HH:mm`),l.hourSuffix]})]})]})}),[e,h,l,d.eventTitle]);return(0,n.jsx)(i.Card,{ref:m,className:(0,i.mergeClasses)(d.eventCard,f(r.backgroundColor,r.backgroundColor),p(s,c,o,a)),children:e.enableOnHouver?(0,n.jsxs)(i.Popover,{withArrow:!0,mouseLeaveDelay:50,closeOnScroll:!0,closeOnIframeFocus:!0,openOnHover:!0,children:[(0,n.jsx)(i.PopoverTrigger,{children:g}),(0,n.jsx)(i.PopoverSurface,{"aria-labelledby":u,className:(0,i.mergeClasses)(d.popoverContent),children:(0,n.jsx)(Vt,{event:e})})]}):g},e.id)},Jt=({event:e,eventCount:r,spanSlots:a,rowHeight:o,eventIndex:s,view:c})=>{let{styles:l,appyDynamicStyles:u}=Gt(),{getEventColors:d,getCalendarColors:f}=It(),p=e.hexColor?{backgroundColor:e.hexColor,hoverColor:e.hexColor}:e.color?f(e.color):d(e.category),m=c===`day`?e.onRenderInDayView?.(e):e.onRenderInWeekView?.(e);return t.isValidElement(m)?t.cloneElement(m,{event:e,className:(0,i.mergeClasses)(m.props.className,l.eventCard,u(s,r,o,a)),style:{...m.props.style}}):(0,n.jsx)(qt,{event:e,colors:p,spanSlots:a,rowHeight:o,eventIndex:s,eventCount:r},e.id)},Yt=e=>{let n=(0,t.useCallback)(e=>e.map(e=>({...e,id:e.id||(0,m.v4)()})),[]),r=(0,t.useCallback)(t=>new Date(new Date(t).toLocaleString(void 0,{timeZone:e})),[e]);return{getMonthCalendar:(0,t.useCallback)((e,t,i)=>{let o=n(e),s=new Date(t,i+1,0).getDate(),c={};for(let e=1;e<=s;e++){let n=(0,a.format)(new Date(t,i,e),`yyyy-MM-dd`);c[n]=[]}return o.forEach(e=>{let t=r(e.start),n=r(e.end),i=new Date(t);for(;i<=n;){let t=(0,a.format)(i,`yyyy-MM-dd`);c[t]&&c[t].push(e),i.setDate(i.getDate()+1)}}),c},[r]),getWeekEvents:(0,t.useCallback)((e,t)=>{let i=[],o=r(t),s=n(e);for(let e=0;e<7;e++){let t=new Date(o);t.setDate(o.getDate()+e);let n=(0,a.format)(t,`yyyy-MM-dd`),c=Array.from({length:48},(e,t)=>({time:`${String(Math.floor(t/2)).padStart(2,`0`)}:${t%2==0?`00`:`30`}`,events:[]})),l=[];s.forEach(e=>{let t=r(e.start),i=r(e.end);if(e.isFullDay){(0,a.format)(t,`yyyy-MM-dd`)<=n&&(0,a.format)(i,`yyyy-MM-dd`)>=n&&l.push(e);return}if((0,a.format)(t,`yyyy-MM-dd`)<=n&&(0,a.format)(i,`yyyy-MM-dd`)>=n){let r=new Date(t);for(;r<=i;){if((0,a.format)(r,`yyyy-MM-dd`)===n){let t=r.getHours()*2+(r.getMinutes()>=30?1:0);c[t]&&c[t].events.push(e)}r.setMinutes(r.getMinutes()+30)}}}),i.push({date:n,fullDayEvents:l,timeSlots:c})}return i},[r])}},Xt=()=>({styles:{container:(0,l.css)({display:`flex`,flexDirection:`column`,width:`calc(100% - 40px)`,height:`100vh`,overflow:`hidden`,padding:`20px`}),header:(0,l.css)({display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`16px`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),dayGrid:(0,l.css)({display:`grid`,gridTemplateColumns:`80px 1fr`,gridTemplateRows:`50px 40px repeat(48, 33px)`,height:`calc(100vh - 100px)`,overflowY:`auto`,border:`1px solid ${i.tokens.colorNeutralStroke1}`,maxHeight:`fit-content`,scrollbarWidth:`thin`,scrollbarColor:`${i.tokens.colorBrandBackground} ${i.tokens.colorNeutralBackground1}`,"&::-webkit-scrollbar":{width:`8px`},"&::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground1},"&::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandBackground,borderRadius:`4px`},"&::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorBrandBackgroundHover}}),blankHeader:(0,l.css)({gridColumn:`1`,backgroundColor:i.tokens.colorNeutralBackground3,borderBottom:`3px solid ${i.tokens.colorNeutralStroke3}`}),timeColumn:(0,l.css)({gridColumn:`1`,gridRow:`3 / span 49`,display:`flex`,flexDirection:`column`,backgroundColor:i.tokens.colorNeutralBackground1,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`}),timeCell:(0,l.css)({height:`100%`,maxHeight:`32px`,minHeight:`32px`,display:`flex`,alignItems:`center`,fontSize:`12px`,color:i.tokens.colorNeutralForeground3,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,justifyContent:`center`}),fullDayRow:(0,l.css)({gridRow:`2`,display:`grid`,gridTemplateColumns:`80px 33px`,gap:`0`,padding:`0`,backgroundColor:i.tokens.colorNeutralBackground2,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayLabel:(0,l.css)({gridColumn:`1`,display:`flex`,alignItems:`center`,justifyContent:`center`,alignContent:`center`,color:i.tokens.colorBrandBackground,padding:`5px`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`}),fullDayCell:(0,l.css)({borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,display:`flex`,flexDirection:`row`,gap:`2px`,padding:`4px`,borderBottom:`3px solid ${i.tokens.colorNeutralStroke2}`,overflow:`hidden`}),fullDayEvent:(0,l.css)({flex:`1 1 auto`,minWidth:`24px`,height:`24px`,padding:`4px 8px`,backgroundColor:i.tokens.colorBrandBackground,color:i.tokens.colorNeutralForegroundOnBrand,borderRadius:`4px`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`}),dayHeaderCell:(0,l.css)({textAlign:`center`,backgroundColor:i.tokens.colorNeutralBackground2,padding:`8px`,fontWeight:`bold`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`}),todayHeaderCell:(0,l.css)({borderTop:`5px solid ${i.tokens.colorBrandBackground}`}),eventCard:(0,l.css)({alignItems:`center`,justifyContent:`center`,marginRight:`2px`,zIndex:1,position:`absolute`,alignContent:`center`,overflow:`hidden`}),dayCell:(0,l.css)({borderBottom:`1px solid ${i.tokens.colorNeutralStroke1}`,borderRight:`1px solid ${i.tokens.colorNeutralStroke1}`,position:`relative`,overflow:`visible`,FlexDirection:`column`,gap:`4px`}),currentTimeIndicator:(0,l.css)({position:`absolute`,left:0,height:`2px`,backgroundColor:i.tokens.colorPaletteRedBorderActive,width:`100%`,zIndex:1}),currentHalfHourCell:(0,l.css)({border:`2px solid ${i.tokens.colorPaletteRedBorderActive}`}),eventTitle:(0,l.css)({display:`-webkit-box`,"-webkit-line-clamp":`1`,"-webkit-box-orient":`vertical`,textAlign:`start`,textOverflow:`ellipsis`,paddingLeft:`8px`,wordBreak:`break-word`,overflow:`hidden`})},applyEventHouverColorClass:(e,t)=>(0,l.css)({backgroundColor:e??i.tokens.colorBrandBackground,":hover":{backgroundColor:t??i.tokens.colorBrandBackgroundHover}})}),Zt={allDay:`All Day`},Qt=33,$t=e=>{let{events:r,currentDay:o,height:s,strings:c=Zt}=e,{styles:l}=Xt(),u=(0,t.useRef)(null),{getSpanSlots:d,getEventColors:f,getCalendarColors:p}=It(),m=Intl.DateTimeFormat().resolvedOptions().timeZone,{getWeekEvents:h}=Yt(m),g=t.useCallback(()=>Array.from({length:24},(e,r)=>(0,n.jsxs)(t.Fragment,{children:[(0,n.jsx)(`div`,{className:l.timeCell,children:(0,n.jsxs)(i.Body1Strong,{children:[r,`:00`]})}),(0,n.jsx)(`div`,{className:l.timeCell})]},r)),[l.timeCell]),_=t.useCallback(()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:l.blankHeader}),Array.from({length:1},(e,t)=>{let r=(0,a.addDays)(o,t),s=(0,a.isToday)(r)?l.todayHeaderCell:``;return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(l.dayHeaderCell,s),children:[(0,n.jsx)(i.Text,{weight:`semibold`,size:600,style:{paddingRight:10},children:(0,a.format)(r,`dd`)}),(0,n.jsx)(i.Subtitle1,{children:(0,a.format)(r,`LLLL, yyyy`)})]},t)})]}),[o,l.blankHeader,l.dayHeaderCell,l.todayHeaderCell]),v=t.useCallback(()=>{let e=h(r,o.toISOString());return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:l.fullDayLabel,children:(0,n.jsx)(i.Body1,{children:c.allDay})}),Array.from({length:1},(t,r)=>{let s=(0,a.format)((0,a.addDays)(o,r),`yyyy-MM-dd`),c=e.find(e=>e.date===s)?.fullDayEvents||[];return(0,n.jsx)(`div`,{className:l.fullDayCell,children:c.map(e=>(0,n.jsx)(`div`,{className:l.fullDayEvent,style:{gridColumn:`${r+2}`,backgroundColor:e.color?p(e.color).backgroundColor:f(e.category).backgroundColor},children:(0,n.jsx)(i.Caption1Strong,{className:l.eventTitle,children:e.title})},e.id))},r)})]})},[o,h,l.fullDayCell,l.fullDayEvent,l.fullDayLabel,l.eventTitle,p,f,r,c.allDay]),y=t.useCallback(()=>{let e=h(r,o.toISOString());return Array.from({length:1},(r,i)=>{let s=(0,a.format)((0,a.addDays)(o,i),`yyyy-MM-dd`),c=e.find(e=>e.date===s);return(0,n.jsx)(t.Fragment,{children:c?.timeSlots.map((e,t)=>{let r=e.events.length;return(0,n.jsx)(`div`,{className:l.dayCell,style:{gridRow:t+3},children:e.events.map((e,i)=>{let{spanSlots:a,startSlot:o}=d(new Date(e.start),new Date(e.end));return t===o?(0,n.jsx)(Jt,{event:e,eventCount:r,spanSlots:a,rowHeight:Qt,eventIndex:i,view:`day`},e.id):null})},t)})},i)})},[o,d,h,l.dayCell,r]);return(0,n.jsx)(`div`,{className:l.container,style:{height:s},children:(0,n.jsxs)(`div`,{ref:u,className:l.dayGrid,children:[(0,n.jsx)(`div`,{className:l.timeColumn,children:g()}),_(),v(),y()]})})},W=function(e){return e.Day=`day`,e.Week=`week`,e.Month=`month`,e}({}),en={month:`Month`,week:`Week`,day:`Day`},tn=e=>{let{onSelected:r,value:a,strings:o=en}=e,[s,c]=t.useState(a??W.Month),[l,u]=t.useState({view:[a??W.Month]}),f=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarDayFilled,d.CalendarDayRegular),[]),p=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[]),m=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarWorkWeekFilled,d.CalendarWorkWeekRegular),[]);t.useEffect(()=>{a!==void 0&&(c(a),u({view:[a]}))},[a]);let[h,g]=t.useState(!1),_=t.useCallback((e,t)=>{g(t.open)},[]),v=t.useCallback(()=>{switch(s){case W.Month:return(0,n.jsx)(p,{});case W.Week:return(0,n.jsx)(m,{});case W.Day:return(0,n.jsx)(f,{});default:return(0,n.jsx)(p,{})}},[s]),y=t.useCallback(e=>{switch(e){case W.Month:return o.month;case W.Week:return o.week;case W.Day:return o.day;default:return o.month}},[o]),b=t.useCallback((e,{name:t,checkedItems:n})=>{if(t===`view`){let e=n[0];c(e),u({view:n}),r(e)}},[r]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(i.Menu,{open:h,onOpenChange:_,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:v(),style:{minWidth:`150px`},children:y(s)})}),(0,n.jsx)(i.MenuPopover,{children:(0,n.jsxs)(i.MenuList,{onCheckedValueChange:b,checkedValues:l,children:[(0,n.jsx)(i.MenuItemRadio,{icon:(0,n.jsx)(f,{}),name:`view`,value:W.Day,children:o.day}),(0,n.jsx)(i.MenuItemRadio,{icon:(0,n.jsx)(m,{}),name:`view`,value:W.Week,children:o.week}),(0,n.jsx)(i.MenuItemRadio,{icon:(0,n.jsx)(p,{}),name:`view`,value:W.Month,children:o.month})]})})]})})},nn=t.memo(e=>{let{onSelected:a,value:o}=e,[s,c]=t.useState(o??new Date),[l,u]=t.useState(()=>(0,r.format)(o??new Date,`dd MMM, yyyy`)),[f,p]=t.useState(!1),m=t.useCallback((e,t)=>{p(t.open)},[]),g=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[]),_=t.useCallback(e=>{if(e){let t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=(0,r.utcToZonedTime)(e,t);c(n),u((0,r.format)(n,`dd MMM, yyyy`)),a(n),p(!1)}},[a]);return(0,n.jsxs)(i.Menu,{open:f,onOpenChange:m,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:(0,n.jsx)(g,{}),style:{minWidth:`200px`},"aria-label":`Select date: ${l}`,children:l})}),(0,n.jsx)(i.MenuPopover,{style:{maxWidth:`fit-content`},children:(0,n.jsx)(i.MenuList,{children:(0,n.jsx)(h.Calendar,{highlightSelectedMonth:!0,showGoToToday:!0,onSelectDate:_,value:s})})})]})}),rn=()=>({root:(0,l.css)({outline:`none`})}),an={months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],goToToday:`Go to today`},on=e=>{let{onDateChange:r,defaultSelectedDate:i,onDismiss:a,strings:o=an}=e,s=rn(),[c,l]=t.useState(i??new Date),u=t.useCallback((e,t)=>{l(e),r(e),a()},[r,a]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(h.Calendar,{className:s.root,dateRangeType:h.DateRangeType.Month,highlightSelectedMonth:!0,isDayPickerVisible:!1,onSelectDate:u,value:c,onDismiss:a,showGoToToday:!1,allFocusable:!1,strings:o})})},sn=e=>{let{onSelected:r,value:o}=e,s=(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[c,l]=t.useState(o??new Date);t.useEffect(()=>{r(o??new Date),l(o??new Date)},[o]);let[u,f]=t.useState(!1),p=(e,t)=>{f(t.open)},m=t.useCallback(e=>{r(e),l(e)},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(i.Menu,{open:u,onOpenChange:p,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:(0,n.jsx)(s,{}),style:{minWidth:`200px`},"aria-label":`Select month: ${(0,a.format)(c,`MMMM yyyy`)}`,children:(0,a.format)(c,`MMMM yyyy`)})}),(0,n.jsx)(i.MenuPopover,{children:(0,n.jsx)(i.MenuList,{children:(0,n.jsx)(on,{onDateChange:m,defaultSelectedDate:c,onDismiss:()=>{f(!1)}})})})]})})},cn={selectWeekPlaceholder:`Select a week`},ln=e=>{let t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=(0,r.format)(e.start,`MMM`,{timeZone:t}),i=(0,r.format)(e.end,`MMM`,{timeZone:t});return(0,r.format)(e.start,`yyyy`,{timeZone:t})===(0,r.format)(e.end,`yyyy`,{timeZone:t})?n===i?`${(0,r.format)(e.start,`dd`,{timeZone:t})} - ${(0,r.format)(e.end,`dd MMM yyyy`,{timeZone:t})}`:`${(0,r.format)(e.start,`dd MMM`,{timeZone:t})} - ${(0,r.format)(e.end,`dd MMM yyyy`,{timeZone:t})}`:`${(0,r.format)(e.start,`dd MMM yyyy`,{timeZone:t})} - ${(0,r.format)(e.end,`dd MMM yyyy`,{timeZone:t})}`},un=e=>{let t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=(0,r.utcToZonedTime)(e,t),i=new Date(n);i.setDate(n.getDate()-n.getDay());let a=new Date(i);return a.setDate(i.getDate()+6),{start:(0,r.utcToZonedTime)(i,t),end:(0,r.utcToZonedTime)(a,t)}},dn=t.memo(e=>{let{onSelected:r,value:a,strings:o=cn}=e,s=h.DateRangeType.Week,[c,l]=t.useState(a??new Date),[u,f]=t.useState(()=>{let e=a??new Date;return e?ln(un(e)):o.selectWeekPlaceholder}),[p,m]=t.useState(!1),g=t.useCallback((e,t)=>{m(t.open)},[]),_=t.useMemo(()=>(0,d.bundleIcon)(d.CalendarMonthFilled,d.CalendarMonthRegular),[]),v=t.useCallback(e=>{if(e){l(e);let t=un(e);f(ln(t)),r({startDate:t.start,endDate:t.end}),m(!1)}},[r]),y=t.useMemo(()=>0,[]);return(0,n.jsxs)(i.Menu,{open:p,onOpenChange:g,children:[(0,n.jsx)(i.MenuTrigger,{disableButtonEnhancement:!0,children:(0,n.jsx)(i.MenuButton,{shape:`circular`,icon:(0,n.jsx)(_,{}),style:{minWidth:`200px`},"aria-label":`Select week: ${u}`,children:u})}),(0,n.jsx)(i.MenuPopover,{style:{maxWidth:`fit-content`},children:(0,n.jsx)(i.MenuList,{children:(0,n.jsx)(h.Calendar,{dateRangeType:s,highlightSelectedMonth:!0,showGoToToday:!0,onSelectDate:v,value:c,firstDayOfWeek:y})})})]})}),fn={today:`Today`,previous:`Previous`,next:`Next`},pn=t.memo(({selectedView:e,onSelectedView:r,currentDate:a,setCurrentDate:o,onWeekChange:s,onMonthChange:c,onDayChange:l,strings:u=fn})=>{let f=t.useMemo(()=>(0,d.bundleIcon)(d.ArrowDownFilled,d.ArrowDownRegular),[]),p=t.useMemo(()=>(0,d.bundleIcon)(d.ArrowUpFilled,d.ArrowUpRegular),[]),m=t.useCallback(e=>{s(e.startDate),o(e.startDate)},[s,o]),h=t.useCallback(e=>{c(e),o(e)},[c,o]),g=t.useCallback(e=>{l(e),o(e)},[l,o]),_=t.useCallback(()=>{switch(e){case W.Month:return(0,n.jsx)(sn,{onSelected:h,value:a});case W.Week:return(0,n.jsx)(dn,{onSelected:m,value:a});case W.Day:return(0,n.jsx)(nn,{onSelected:g,value:a});default:return(0,n.jsx)(sn,{onSelected:h,value:a})}},[e,h,m,g,a]),v=t.useCallback(()=>(0,n.jsx)(i.Tooltip,{content:u.today,relationship:`label`,children:(0,n.jsx)(i.Button,{shape:`circular`,icon:(0,n.jsx)(d.CalendarTodayRegular,{}),size:`medium`,onClick:()=>l(new Date),children:u.today})}),[l,u.today]),y=t.useCallback(t=>{let n=new Date(a);switch(e){case W.Month:n.setMonth(n.getMonth()+t),c(n);break;case W.Week:n.setDate(n.getDate()+t*7),s(n);break;case W.Day:n.setDate(n.getDate()+t),l(n);break;default:break}o(n)},[a,e,c,s,l,o]);return(0,n.jsxs)(B,{width:`calc(100% - 40px)`,height:`fit-content`,horizontal:!0,horizontalAlign:`space-between`,verticalAlign:`center`,paddingLeft:`20px`,paddingRight:`20px`,paddingBottom:`10px`,paddingTop:`10px`,columnGap:10,styles:{overflow:`hidden`},children:[(0,n.jsxs)(B,{horizontal:!0,horizontalAlign:`start`,verticalAlign:`center`,columnGap:10,children:[(0,n.jsx)(v,{}),(0,n.jsx)(_,{}),(0,n.jsx)(i.Tooltip,{content:u.previous,relationship:`label`,children:(0,n.jsx)(i.Button,{size:`medium`,icon:(0,n.jsx)(p,{fontSize:14}),onClick:()=>y(-1)})}),(0,n.jsx)(i.Tooltip,{content:u.next,relationship:`label`,children:(0,n.jsx)(i.Button,{size:`medium`,icon:(0,n.jsx)(f,{fontSize:14}),onClick:()=>y(1)})})]}),(0,n.jsx)(B,{horizontal:!0,horizontalAlign:`start`,verticalAlign:`center`,columnGap:10,children:(0,n.jsx)(tn,{onSelected:r,value:e})})]})}),mn={allDay:`All Day`},hn=e=>{let{events:r,currentDay:o,height:s,strings:l=mn}=e,{styles:u}=Gt(),[d]=(0,t.useState)(o),[f,p]=(0,t.useState)(32),m=(0,t.useRef)(null),{getSpanSlots:h,getEventColors:g,getCalendarColors:_,formatDate:v}=It(),y=(0,a.startOfWeek)(d,{weekStartsOn:0}),b=Intl.DateTimeFormat().resolvedOptions().timeZone,{getWeekEvents:x}=Yt(b);(0,t.useEffect)(()=>{let e=new c.ResizeObserver(()=>{if(m.current){let e=m.current.querySelector(`.dayCell`);e&&p(e.offsetHeight)}});return m.current&&e.observe(m.current),()=>{e.disconnect()}},[]);let S=t.useCallback(()=>Array.from({length:24},(e,r)=>(0,n.jsxs)(t.Fragment,{children:[(0,n.jsx)(`div`,{className:u.timeCell,children:(0,n.jsxs)(i.Body1Strong,{children:[r,`:00`]})}),(0,n.jsx)(`div`,{className:u.timeCell})]},r)),[u.timeCell]),C=t.useCallback(()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:u.blankHeader}),Array.from({length:7},(e,t)=>{let r=(0,a.addDays)(y,t),o=(0,a.isToday)(r)?u.todayHeaderCell:``;return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(u.dayHeaderCell,o),children:[(0,n.jsx)(i.Text,{weight:`regular`,size:600,style:{paddingRight:10},children:v(r.toISOString(),`dd`)}),(0,n.jsx)(i.Body1,{children:v(r.toISOString(),`EEE`)})]},t)})]}),[y,u,v]),w=t.useCallback(()=>{let e=x(r,y.toISOString());return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:u.fullDayLabel,children:(0,n.jsx)(i.Body1,{children:l.allDay})}),Array.from({length:7},(t,r)=>{let o=v((0,a.addDays)(y,r).toISOString(),`yyyy-MM-dd`),s=e.find(e=>e.date===o)?.fullDayEvents||[];return(0,n.jsx)(`div`,{className:u.fullDayCell,children:s.map(e=>(0,n.jsx)(`div`,{className:u.fullDayEvent,style:{gridColumn:`${r+2}`,backgroundColor:e.color?_(e.color).backgroundColor:g(e.category).backgroundColor},children:(0,n.jsx)(i.Caption1Strong,{className:u.eventTitle,children:e.title})},e.id))},r)})]})},[y,u,x,_,g,r,v,l.allDay]),T=t.useCallback(()=>{let e=x(r,y.toISOString());return Array.from({length:7},(t,r)=>{let i=(0,a.format)((0,a.addDays)(y,r),`yyyy-MM-dd`);return(0,n.jsx)(n.Fragment,{children:e.find(e=>e.date===i)?.timeSlots.map((e,t)=>{let r=e.events.length;return(0,n.jsx)(`div`,{className:u.dayCell,style:{gridRow:t+3},children:e.events.map((e,i)=>{let{spanSlots:a,startSlot:o}=h(new Date(e.start),new Date(e.end));return t===o?(0,n.jsx)(Jt,{event:e,eventCount:r,spanSlots:a,rowHeight:f,eventIndex:i,view:`week`},e.id):null})},t)})})})},[y,u,x,h,f,r]);return(0,n.jsx)(`div`,{className:u.container,style:{height:s},children:(0,n.jsxs)(`div`,{ref:m,className:u.weekGrid,children:[(0,n.jsx)(`div`,{className:u.timeColumn,children:S()}),C(),w(),T()]})})},gn={daysOfWeek:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},_n=({currentDate:e,rowHeight:t,getCalendarDays:r,getEventsForDay:a,styles:o,onDaySlotClick:s,height:c,calendarRef:l,strings:u})=>{let d=u?.daysOfWeek||gn.daysOfWeek;return(0,n.jsx)(B,{height:c,width:`100%`,verticalAlign:`start`,horizontalAlign:`start`,children:(0,n.jsxs)(`div`,{className:o.calendarWrapper,ref:l,role:`grid`,"aria-label":`Calendar`,children:[d.map((e,t)=>{let r=t===0||t===6;return(0,n.jsx)(i.Body1,{className:o.dayHeader,style:{color:r?i.tokens.colorPaletteRedForeground1:void 0},role:`columnheader`,children:e},e)}),r(e).map((e,r)=>{let{day:i,currentMonth:o}=e,c=o?a(e):[];return(0,n.jsx)(Wt,{day:i,date:e.date,currentMonth:e.currentMonth,events:c,columnHeight:t||0,onDayClick:s},r)})]})})},vn=t.memo(({events:e,currentDay:t,height:r,strings:i})=>(0,n.jsx)(hn,{events:e,currentDay:t,height:r,strings:i})),yn=t.memo(({events:e,currentDay:t,height:r,strings:i})=>(0,n.jsx)($t,{currentDay:t,events:e,height:r,strings:i})),bn=({events:e,height:r=800,theme:o,onDayChange:s,onMonthChange:l,onWeekChange:u,onViewChange:d,onDaySlotClick:f,defaultView:p,strings:m})=>{let{styles:h}=Ht(),g=(0,t.useRef)(null),[_,v]=(0,t.useState)(null),y=(0,t.useRef)(0),[b,x]=(0,t.useState)(new Date),[S,C]=(0,t.useState)(p??W.Month),{getMonthCalendar:w}=Yt(Intl.DateTimeFormat().resolvedOptions().timeZone),T=t.useCallback(e=>{let t=e.getMonth(),n=(0,a.startOfWeek)((0,a.startOfMonth)(e));return Array.from({length:42},(e,r)=>{let i=(0,a.addDays)(n,r);return{day:i.getDate(),currentMonth:i.getMonth()===t,date:i}})},[42]),E=t.useCallback(e=>{l&&l(e),x(e)},[l]),D=t.useCallback(e=>{s&&s(e),x(e)},[s]),O=t.useCallback(e=>{u&&u(e),x(e)},[u]),k=t.useCallback(e=>{d&&d(e),C(e)},[d]),A=t.useCallback(t=>{let{date:n}=t;return w(e,b.getFullYear(),b.getMonth())[(0,a.format)(n,`yyyy-MM-dd`)]?.flatMap(e=>e)||[]},[b,e]),j=t.useCallback(()=>{g.current&&requestAnimationFrame(()=>{if(g.current){let e=g.current.querySelector(`.${h.calendarWrapper} > div:nth-child(8)`);e&&(v(e.offsetHeight),y.current=e.offsetHeight)}})},[h.calendarWrapper]);(0,t.useEffect)(()=>{let e=new c.ResizeObserver(j);return g.current&&e.observe(g.current),j(),window.addEventListener(`resize`,j),()=>{e.disconnect(),window.removeEventListener(`resize`,j)}},[j,S]),(0,t.useEffect)(()=>{C(p||W.Month)},[p]);let M=t.useCallback(()=>{switch(S){case W.Month:return(0,n.jsx)(_n,{events:e,currentDate:b,rowHeight:_,getCalendarDays:T,getEventsForDay:A,styles:h,onDaySlotClick:f,height:r,calendarRef:g,strings:m?.calendarControl});case W.Week:return(0,n.jsx)(vn,{events:e,currentDay:b,height:r,strings:m?.weekView});case W.Day:return(0,n.jsx)(yn,{events:e,currentDay:b,height:r,strings:m?.dayView});default:return(0,n.jsx)(_n,{events:e,currentDate:b,rowHeight:_,getCalendarDays:T,getEventsForDay:A,styles:h,onDaySlotClick:f,height:r,calendarRef:g,strings:m?.calendarControl})}},[S,e,b,_,T,A,h,f,r]),N=(0,n.jsxs)(B,{height:`100%`,verticalAlign:`start`,children:[(0,n.jsx)(pn,{selectedView:S,onSelectedView:k,currentDate:b,setCurrentDate:x,onWeekChange:O,onMonthChange:E,onDayChange:D,strings:m?.toolbar}),(0,n.jsx)(M,{})]});return(0,n.jsx)(i.IdPrefixProvider,{value:`calendarControl-`,children:o?(0,n.jsx)(i.FluentProvider,{theme:o,applyStylesToPortals:!0,style:{width:`100%`},children:N}):(0,n.jsx)(`div`,{style:{width:`100%`},children:N})})},xn=()=>({styles:{root:(0,l.css)({marginLeft:i.tokens.spacingHorizontalM,marginRight:i.tokens.spacingHorizontalM,marginBottom:i.tokens.spacingVerticalM,marginTop:i.tokens.spacingVerticalM,containerType:`inline-size`,backgroundColor:i.tokens.colorNeutralBackground1,borderRadius:8,border:`1px solid ${i.tokens.colorNeutralStroke2}`}),header:(0,l.css)({borderBottom:`1px solid ${i.tokens.colorNeutralStroke2}`}),headerBackButton:(0,l.css)({fontSize:`clamp(6px, 3.5cqw, 22px)`}),headerLabel:(0,l.css)({textTransform:`capitalize`}),calendar:(0,l.css)({borderBottom:`1px solid ${i.tokens.colorNeutralStroke2}`,backgroundColor:i.tokens.colorNeutralBackground2}),weekdaysCorner:(0,l.css)({flex:`0 0 32px`}),weekday:(0,l.css)({flex:`1 1 calc(100% / 7)`,maxWidth:`calc(100% / 7)`,textAlign:`center`,textTransform:`capitalize`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`default`,userSelect:`none`,paddingBlock:`4px`,boxSizing:`border-box`}),weekNumber:(0,l.css)({flex:`0 0 28px`,marginInlineEnd:`4px`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`default`,userSelect:`none`}),day:(0,l.css)({flex:`1 1 calc(100% / 7)`,maxWidth:`calc(100% / 7)`,height:`48px`,minWidth:`0 !important`,padding:`4px !important`,fontWeight:500,fontSize:`clamp(6px, 3.5cqw, 22px)`,color:`${i.tokens.colorNeutralForeground1} !important`,cursor:`pointer`,userSelect:`none`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,position:`relative`,zIndex:0,borderRadius:0,"::before":{width:`32px`,height:`32px`,borderRadius:`100%`,content:`""`,position:`absolute`,top:`7px`,left:`calc(50% - 16px)`,zIndex:-1,pointerEvents:`none`},":focus-visible":{zIndex:1,outline:`2px solid ${i.tokens.colorBrandStroke1}`,outlineOffset:`-2px`,borderRadius:i.tokens.borderRadiusMedium},":hover::before":{backgroundColor:i.tokens.colorNeutralBackground1Hover}}),dayHidden:(0,l.css)({visibility:`hidden`,pointerEvents:`none`}),dayWeekend:(0,l.css)({color:`${i.tokens.colorPaletteRedForeground1} !important`}),dayOutside:(0,l.css)({color:`${i.tokens.colorNeutralForeground3} !important`}),dayToday:(0,l.css)({"::before":{backgroundColor:i.tokens.colorNeutralBackground3}}),daySelected:(0,l.css)({color:`${i.tokens.colorNeutralForegroundOnBrand} !important`,"::before":{backgroundColor:i.tokens.colorBrandBackground},":hover::before":{backgroundColor:i.tokens.colorBrandBackgroundHover}}),dayIndicators:(0,l.css)({position:`absolute`,bottom:`2px`,insetInline:0,paddingInlineStart:`2px`}),dayIndicator:(0,l.css)({width:`5px`,height:`5px`,borderRadius:`100%`,marginInlineStart:`-1px`}),eventsList:(0,l.css)({flex:1,minHeight:0,overflowY:`auto`,scrollbarWidth:`thin`,scrollbarColor:`${i.tokens.colorBrandBackground} ${i.tokens.colorNeutralBackground3}`,"&::-webkit-scrollbar":{width:`3px`,height:`3px`},"&::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground3,borderRadius:i.tokens.borderRadiusMedium},"&::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandBackground,borderRadius:i.tokens.borderRadiusMedium},"&::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorBrandBackgroundHover}}),eventsHeader:(0,l.css)({textTransform:`capitalize`}),event:(0,l.css)({cursor:`pointer`,borderBottom:`1px solid ${i.tokens.colorNeutralStroke2}`,padding:`0 !important`,borderRadius:0,boxShadow:`none`,":last-child":{borderBottom:`none`},":hover":{backgroundColor:i.tokens.colorNeutralBackground1Hover},":focus-visible":{outline:`2px solid ${i.tokens.colorBrandStroke1}`,outlineOffset:`-2px`,borderRadius:i.tokens.borderRadiusMedium}}),eventColor:(0,l.css)({width:`4px`,borderRadius:`2px`,flexShrink:0,alignSelf:`stretch`}),eventTimeColor:i.tokens.colorNeutralForeground3}}),Sn=e=>(0,a.getISOWeek)(e[0]),Cn=t.memo(e=>{let{weeks:r,date:o,selectedDate:s,today:c,orderedShortDays:l,groupedEvents:u,weekendDays:d,firstDayOfWeek:f,highlightToday:p,withOutsideDays:m,withWeekNumbers:h,onDayClick:g,getEventColor:_,locale:v}=e,{styles:y}=xn(),b=t.useRef([]),x=t.useRef(null);x.current=null;let S=t.useCallback((e,t,n)=>{let r=e,i=t;switch(n.key){case`ArrowRight`:i+=1,i>=7&&(i=0,r+=1);break;case`ArrowLeft`:--i,i<0&&(i=6,--r);break;case`ArrowDown`:r+=1;break;case`ArrowUp`:--r;break;default:return}n.preventDefault();let a=b.current[r]?.[i];a&&a instanceof HTMLElement&&a.focus()},[]),C=t.useMemo(()=>(0,n.jsxs)(H,{direction:`horizontal`,marginBottom:i.tokens.spacingVerticalXS,children:[h&&(0,n.jsx)(`div`,{className:y.weekdaysCorner}),l.map((e,t)=>{let r=(f+t)%7,a=d.includes(r);return(0,n.jsx)(Ot,{as:`span`,fontSize:i.tokens.fontSizeBase200,fontWeight:`semibold`,color:a?i.tokens.colorPaletteRedForeground1:i.tokens.colorNeutralForeground3,className:y.weekday,style:{textAlign:`center`,width:`100%`},children:e},t)})]}),[l,h,y.weekdaysCorner,y.weekday]),w=t.useMemo(()=>r.map((e,t)=>{let r=e.map((e,r)=>{let l=!(0,a.isSameMonth)(e,o),f=d.includes((0,a.getDay)(e)),h=(0,a.isSameDay)(e,c)&&p,C=s?(0,a.isSameDay)(e,s):!1,w=u[(0,a.format)(e,`yyyy-MM-dd`)]||[],T=m||!l;T&&x.current===null&&(x.current={weekIndex:t,dayIndex:r});let E=x.current?.weekIndex===t&&x.current?.dayIndex===r,D=w.slice(0,3).map(e=>(0,n.jsx)(`div`,{className:y.dayIndicator,style:{backgroundColor:_(e)}},e.id));return(0,n.jsxs)(i.Button,{appearance:`transparent`,className:(0,i.mergeClasses)(y.day,!T&&y.dayHidden,l&&T&&!C&&!f&&y.dayOutside,f&&T&&!C&&y.dayWeekend,h&&!C&&y.dayToday,C&&y.daySelected),"aria-label":(0,a.format)(e,`MMMM d, yyyy`,{locale:v}),"aria-selected":C||void 0,tabIndex:T&&E?0:-1,onClick:T?()=>g(e):void 0,onKeyDown:T?e=>S(t,r,e):void 0,ref:e=>{b.current[t]||(b.current[t]=[]),b.current[t][r]=e},children:[T?e.getDate():null,T&&(0,n.jsx)(H,{direction:`horizontal`,justifyContent:`center`,className:y.dayIndicators,children:D})]},e.toISOString())}),l=Sn(e);return(0,n.jsxs)(H,{direction:`horizontal`,children:[h&&(0,n.jsx)(Ot,{fontSize:`xs`,color:i.tokens.colorNeutralForeground3,className:y.weekNumber,children:l}),r]},t)}),[r,o,s,c,d,p,m,h,u,_,g,S,y,v]);return(0,n.jsxs)(H,{direction:`vertical`,padding:i.tokens.spacingVerticalS,className:y.calendar,children:[C,w]})}),wn=t.memo(e=>{let{date:r,renderHeader:o,onYearClick:s,locale:c}=e,{styles:l}=xn(),u=(0,a.format)(r,`MMMM yyyy`,{locale:c}),f=t.useMemo(()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.Button,{appearance:`subtle`,className:l.headerBackButton,onClick:s,icon:(0,n.jsx)(d.ChevronRight20Regular,{style:{transform:`rotate(90deg)`}}),children:(0,a.format)(r,`yyyy`)}),(0,n.jsx)(Ot,{fontWeight:`bold`,className:l.headerLabel,children:u})]}),[r,s,l]),p=t.useMemo(()=>typeof o==`function`?o({date:r,defaultHeader:f}):f,[o,r,f]);return(0,n.jsx)(H,{direction:`horizontal`,alignItems:`center`,justifyContent:`space-between`,padding:i.tokens.spacingVerticalS,className:l.header,children:p})}),Tn=t.memo(({currentDate:e,onDateChange:r,todayLabel:a=`Today`,previousLabel:o=`Previous`,nextLabel:s=`Next`})=>{let c=t.useMemo(()=>(0,d.bundleIcon)(d.ArrowDownFilled,d.ArrowDownRegular),[]),l=t.useMemo(()=>(0,d.bundleIcon)(d.ArrowUpFilled,d.ArrowUpRegular),[]),u=t.useCallback(()=>{r(new Date)},[r]),f=t.useCallback(e=>{r(e)},[r]),p=t.useCallback(t=>{let n=new Date(e);n.setMonth(n.getMonth()+t),r(n)},[e,r]);return(0,n.jsxs)(H,{direction:`horizontal`,justifyContent:`flex-start`,alignItems:`center`,gap:`s`,padding:`10px 20px`,style:{overflow:`hidden`},children:[(0,n.jsx)(i.Tooltip,{content:a,relationship:`label`,children:(0,n.jsx)(i.Button,{shape:`circular`,icon:(0,n.jsx)(d.CalendarTodayRegular,{}),size:`medium`,onClick:u,"aria-label":a,children:a})}),(0,n.jsx)(sn,{onSelected:f,value:e}),(0,n.jsx)(i.Tooltip,{content:o,relationship:`label`,children:(0,n.jsx)(i.Button,{size:`medium`,icon:(0,n.jsx)(l,{fontSize:14}),onClick:()=>p(-1)})}),(0,n.jsx)(i.Tooltip,{content:s,relationship:`label`,children:(0,n.jsx)(i.Button,{size:`medium`,icon:(0,n.jsx)(c,{fontSize:14}),onClick:()=>p(1)})})]})}),En=e=>{let{events:r,header:o,allDayLabel:s,noEventsLabel:c,onEventClick:l,renderEvent:u,getEventColor:d,locale:f}=e,{styles:p}=xn(),m=t.useCallback(e=>{let t=(0,a.format)(new Date(e.start),`p`,{locale:f}),r=(0,a.format)(new Date(e.end),`p`,{locale:f}),o=e.isFullDay||t===`00:00`&&r===`00:00`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Ze,{padding:`0px`,appearance:`subtle`,onClick:t=>l?.(e,t),cardBody:(0,n.jsxs)(H,{direction:`horizontal`,gap:`s`,paddingTop:i.tokens.spacingVerticalXS,paddingBottom:i.tokens.spacingVerticalXS,children:[(0,n.jsx)(`div`,{className:p.eventColor,style:{backgroundColor:d(e)}}),(0,n.jsxs)(H,{direction:`vertical`,children:[(0,n.jsx)(Ot,{as:`span`,fontWeight:`semibold`,fontSize:`s`,children:e.title}),(0,n.jsx)(Ot,{as:`span`,fontSize:`xs`,color:p.eventTimeColor,children:o?s:`${t} – ${r}`})]})]})},e.id),(0,n.jsx)(i.Divider,{style:{margin:0}})]})},[s,d,l,p]);return(0,n.jsxs)(H,{direction:`vertical`,padding:i.tokens.spacingVerticalS,className:p.eventsList,children:[(0,n.jsx)(Ot,{as:`span`,fontWeight:`bold`,marginBottom:i.tokens.spacingVerticalS,marginLeft:i.tokens.spacingHorizontalS,className:p.eventsHeader,children:o}),(0,n.jsx)(i.Divider,{style:{paddingLeft:i.tokens.spacingHorizontalS,paddingRight:i.tokens.spacingHorizontalS,paddingTop:i.tokens.spacingVerticalS}}),(0,n.jsx)(H,{direction:`vertical`,gap:`s`,style:{backgroundColor:`transparent`},padding:`s`,children:r.length>0?r.map(e=>u?u(e,m(e)):m(e)):(0,n.jsx)(Ot,{block:!0,color:i.tokens.colorNeutralForeground3,paddingTop:i.tokens.spacingVerticalXXL,paddingBottom:i.tokens.spacingVerticalXXL,style:{textAlign:`center`},children:c})})]})},Dn=e=>{let t=(0,a.startOfDay)(new Date(e.start)),n=(0,a.startOfDay)(new Date(e.end));return t.getTime()!==n.getTime()},On=(e,t)=>{if(Dn(e)){let n=(0,a.startOfDay)(new Date(e.start)),r=(0,a.startOfDay)(new Date(e.end)),i=n;for(;(0,a.isBefore)(i,r)||(0,a.isEqual)(i,r);){let n=(0,a.format)(i,`yyyy-MM-dd`);t[n]||(t[n]=[]),t[n].push(e),i=(0,a.addDays)(i,1)}return}let n=(0,a.format)(new Date(e.start),`yyyy-MM-dd`);t[n]||(t[n]=[]),t[n].push(e)},kn=(e,t)=>{let n={};if(!t)return n;let r=new Set;for(let i of t)if((0,a.isSameMonth)(new Date(i.start),e)){if(r.has(i.id)){console.warn(`[CompactCalendar] Duplicate event id found: ${i.id}`);continue}r.add(i.id),On(i,n)}return n},An=(e,n)=>(0,t.useMemo)(()=>kn(e,n),[e,n]),jn={en:o.enUS,"en-US":o.enUS,"en-us":o.enUS,ar:o.ar,"ar-SA":o.arSA,"ar-sa":o.arSA,az:o.az,"az-AZ":o.az,bg:o.bg,"bg-BG":o.bg,bs:o.bs,"bs-BA":o.bs,ca:o.ca,"ca-ES":o.ca,cs:o.cs,"cs-CZ":o.cs,cy:o.cy,da:o.da,"da-DK":o.da,de:o.de,"de-DE":o.de,el:o.el,"el-GR":o.el,es:o.es,"es-ES":o.es,et:o.et,"et-EE":o.et,eu:o.eu,fi:o.fi,"fi-FI":o.fi,fr:o.fr,"fr-FR":o.fr,gl:o.gl,he:o.he,"he-IL":o.he,hi:o.hi,"hi-IN":o.hi,hr:o.hr,"hr-HR":o.hr,hu:o.hu,"hu-HU":o.hu,id:o.id,"id-ID":o.id,it:o.it,"it-IT":o.it,ja:o.ja,"ja-JP":o.ja,kk:o.kk,"kk-KZ":o.kk,ko:o.ko,"ko-KR":o.ko,lt:o.lt,"lt-LT":o.lt,lv:o.lv,"lv-LV":o.lv,mk:o.mk,"mk-MK":o.mk,ms:o.ms,"ms-MY":o.ms,nb:o.nb,"nb-NO":o.nb,nl:o.nl,"nl-NL":o.nl,pl:o.pl,"pl-PL":o.pl,pt:o.pt,"pt-PT":o.pt,"pt-BR":o.ptBR,ro:o.ro,"ro-RO":o.ro,ru:o.ru,"ru-RU":o.ru,sk:o.sk,"sk-SK":o.sk,sl:o.sl,"sl-SI":o.sl,sr:o.sr,"sr-RS":o.sr,sv:o.sv,"sv-SE":o.sv,th:o.th,"th-TH":o.th,tr:o.tr,"tr-TR":o.tr,uk:o.uk,"uk-UA":o.uk,vi:o.vi,"vi-VN":o.vi,zh:o.zhCN,"zh-CN":o.zhCN};function Mn(e){return e?typeof e==`object`&&e?e:jn[e]||(jn[e.split(`-`)[0].toLowerCase()]??o.enUS):o.enUS}var Nn=[0,6],Pn=(e,t,n)=>{let r=(0,a.startOfMonth)(e),i=(0,a.getDay)(r),o=(0,a.getDaysInMonth)(e),s=(i-t+7)%7,c=(0,a.subDays)(r,s),l=n?42:Math.ceil((s+o)/7)*7,u=[],d=c;for(let e=0;e<l;e++){let t=Math.floor(e/7);u[t]||(u[t]=[]),u[t].push(d),d=(0,a.addDays)(d,1)}return u},Fn=r=>{let{date:o,selectedDate:s,defaultSelectedDate:c,onSelectedDateChange:l,withWeekNumbers:u=!1,firstDayOfWeek:d=1,weekendDays:f=Nn,consistentWeeks:p=!0,highlightToday:m=!0,withOutsideDays:h=!1,showToolbar:g=!1,events:_,onDayClick:v,onEventClick:y,onYearClick:b,renderHeader:x,renderEvent:S,eventsHeaderFormat:C=`EEEE, MMMM d`,locale:w,height:T,className:E,strings:D}=r,{styles:O}=xn(),{getCalendarColors:k}=It(),A=e.s(),j=e.m(),M=t.useMemo(()=>Mn(w??j?.locale),[w,j?.locale]),[N,ee]=t.useState(c??new Date),P=s===void 0?N:s,F=t.useCallback(e=>{s===void 0&&ee(e),l?.(e)},[s,l]),I=t.useMemo(()=>new Date,[]),L=An(o,_),R=D?.shortDays??A.shortDays,te=t.useMemo(()=>{let e=[];for(let t=0;t<7;t++)e.push(R[(d+t)%7]);return e},[R,d]),ne=t.useMemo(()=>Pn(o,d,p),[o,d,p]),re=t.useCallback(e=>e.hexColor?e.hexColor:e.color?k(e.color).backgroundColor:k(`royal-blue`).backgroundColor,[k]),ie=t.useCallback(e=>{F(e),v?.(e)},[F,v]),z=P?(0,a.format)(P,`yyyy-MM-dd`):``,ae=z?(L[z]||[]).sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime()):[],oe=P?(0,a.format)(P,C,{locale:M}):``;return(0,n.jsxs)(H,{direction:`vertical`,height:T??`100%`,className:(0,i.mergeClasses)(O.root,E),children:[g?(0,n.jsx)(Tn,{currentDate:o,onDateChange:e=>r.onDateChange?.(e),todayLabel:D?.today??A.today??`Today`,previousLabel:D?.previous??A.previous??`Previous`,nextLabel:D?.next??A.next??`Next`}):(0,n.jsx)(wn,{date:o,renderHeader:x,onYearClick:b,locale:M}),(0,n.jsx)(Cn,{weeks:ne,date:o,selectedDate:P,today:I,orderedShortDays:te,groupedEvents:L,weekendDays:f,firstDayOfWeek:d,highlightToday:m,withOutsideDays:h,withWeekNumbers:u,onDayClick:ie,getEventColor:re,locale:M}),(0,n.jsx)(En,{events:ae,header:oe,allDayLabel:D?.allDay??A.allDay,noEventsLabel:D?.noEvents??A.noEvents,onEventClick:y,renderEvent:S,getEventColor:re,locale:M})]})},In=(0,g.atom)(!1),Ln=(0,g.atom)(-1),Rn=(0,g.atom)(``),zn=(0,g.atom)(``),Bn=(0,g.atom)(new Set),Vn=(0,g.atom)(!0),Hn=(0,g.atom)(void 0);function Un(){return(0,g.createStore)()}var Wn=Un();function Gn(e){return{opened:e.get(In),selected:e.get(Ln),listId:e.get(Rn),query:e.get(zn),registeredActions:e.get(Bn)}}var G={open(e){e.set(In,!0),e.set(Ln,-1)},close(e){e.set(In,!1)},toggle(e){e.get(In)?e.set(In,!1):(e.set(In,!0),e.set(Ln,-1))},setQuery(e,t){t.get(Hn)?.(e),t.set(zn,e),Promise.resolve().then(()=>{G.selectAction(0,t)})},setListId(e,t){t.set(Rn,e)},selectAction(e,t){let n=t.get(Rn),r=n?document.getElementById(n):null,i=r?.querySelector(`[data-spotlight-selected]`),a=r?.querySelectorAll(`[data-spotlight-action]`)??[];if(a.length===0)return t.set(Ln,-1),-1;let o=e<0?a.length-1:e>=a.length?0:e,s=Math.max(0,Math.min(o,a.length-1));return i?.removeAttribute(`data-spotlight-selected`),a[s]?.scrollIntoView({block:`nearest`}),a[s]?.setAttribute(`data-spotlight-selected`,`true`),t.set(Ln,s),s},selectNextAction(e){return G.selectAction(e.get(Ln)+1,e)},selectPreviousAction(e){return G.selectAction(e.get(Ln)-1,e)},triggerSelectedAction(e){let t=e.get(Rn);(t?document.querySelector(`#${t} [data-spotlight-selected]`):null)?.click()},clearState(e,t){t.set(Ln,-1),e.clearQuery&&t.set(zn,``)}},Kn={open:()=>G.open(Wn),close:()=>G.close(Wn),toggle:()=>G.toggle(Wn)},qn=Kn.open,Jn=Kn.close,Yn=Kn.toggle;function Xn(){let e=Un();return[e,{open:()=>G.open(e),close:()=>G.close(e),toggle:()=>G.toggle(e)}]}function Zn(e=Wn){let[n,r]=(0,t.useState)(()=>Gn(e));return(0,t.useEffect)(()=>{let t=()=>r(Gn(e)),n=[e.sub(In,t),e.sub(Ln,t),e.sub(Rn,t),e.sub(zn,t),e.sub(Bn,t)];return t(),()=>n.forEach(e=>e())},[e]),n}function Qn(e){let t=e.toLowerCase().split(`+`).map(e=>e.trim()),n=typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/i.test(navigator.userAgent);return{key:t[t.length-1],ctrlKey:t.includes(`ctrl`)||!n&&t.includes(`mod`),metaKey:t.includes(`meta`)||n&&t.includes(`mod`),shiftKey:t.includes(`shift`),altKey:t.includes(`alt`)}}function $n(e,n=Wn,r=[`INPUT`,`TEXTAREA`,`SELECT`]){let i=(0,t.useCallback)(t=>{if(!e)return;let i=t.target;if(r.includes(i.tagName)||i.isContentEditable)return;let a=Array.isArray(e)?e:[e];for(let e of a){let r=Qn(e);if(t.key.toLowerCase()===r.key&&t.ctrlKey===r.ctrlKey&&t.metaKey===r.metaKey&&t.shiftKey===r.shiftKey&&t.altKey===r.altKey){t.preventDefault(),G.toggle(n);return}}},[e,n,r]);(0,t.useEffect)(()=>{if(e)return document.addEventListener(`keydown`,i),()=>document.removeEventListener(`keydown`,i)},[e,i])}var er=()=>({backdrop:(0,l.css)({position:`fixed`,inset:0,backgroundColor:`rgba(0, 0, 0, 0.35)`,backdropFilter:`blur(4px)`,zIndex:999999}),surface:(0,l.css)({padding:`0 !important`,overflow:`hidden`,borderRadius:i.tokens.borderRadiusXLarge,boxShadow:i.tokens.shadow64}),search:(0,l.css)({padding:i.tokens.spacingVerticalM,paddingInline:i.tokens.spacingHorizontalL,width:`100%`,boxSizing:`border-box`,"& > div":{width:`100%`}}),actionsList:(0,l.css)({borderTop:`1px solid ${i.tokens.colorNeutralStroke2}`,overflowY:`auto`}),action:(0,l.css)({alignItems:`flex-start`,width:`100%`,padding:`${i.tokens.spacingVerticalS} ${i.tokens.spacingHorizontalL}`,textAlign:`left`,gap:i.tokens.spacingHorizontalM,transition:`background-color 0.1s ease`,"&:hover":{backgroundColor:i.tokens.colorNeutralBackground1Hover},'&[data-spotlight-selected="true"]':{backgroundColor:i.tokens.colorBrandBackground,color:i.tokens.colorNeutralForegroundOnBrand}}),actionBody:(0,l.css)({flex:1,minWidth:0}),actionSectionLeft:(0,l.css)({flexShrink:0,fontSize:`30px`,paddingTop:`2px`,color:i.tokens.colorNeutralForeground3,'[data-spotlight-selected="true"] &':{color:i.tokens.colorNeutralForegroundOnBrand,opacity:.85}}),actionSectionRight:(0,l.css)({flexShrink:0,color:i.tokens.colorNeutralForeground3,'[data-spotlight-selected="true"] &':{color:i.tokens.colorNeutralForegroundOnBrand,opacity:.7}}),actionDescription:(0,l.css)({'[data-spotlight-selected="true"] &':{color:i.tokens.colorNeutralForegroundOnBrand,opacity:.7}}),actionsGroup:(0,l.css)({"&:not(:first-child)":{marginTop:i.tokens.spacingVerticalM}}),actionsGroupLabel:(0,l.css)({textTransform:`uppercase`,paddingInline:i.tokens.spacingHorizontalL,paddingBlock:i.tokens.spacingVerticalXS}),empty:(0,l.css)({padding:i.tokens.spacingVerticalL}),footer:(0,l.css)({borderTop:`1px solid ${i.tokens.colorNeutralStroke2}`}),highlight:(0,l.css)({backgroundColor:i.tokens.colorPaletteYellowBackground2,color:`inherit`,borderRadius:i.tokens.borderRadiusSmall,padding:`0 1px`,'[data-spotlight-selected="true"] &':{backgroundColor:`rgba(255, 255, 255, 0.3)`}})}),tr=({store:e=Wn,query:r,onQueryChange:a,clearQueryOnClose:o=!0,shortcut:s=`mod+K`,tagsToIgnore:c=[`INPUT`,`TEXTAREA`,`SELECT`],disabled:l=!1,onSpotlightOpen:u,onSpotlightClose:d,forceOpened:f=!1,closeOnActionTrigger:p=!0,maxWidth:m=600,yOffset:h=80,maxHeight:_=400,scrollable:v=!0,children:y,className:b})=>{let x=er(),{opened:S}=Zn(e),C=(0,t.useRef)(S);(0,t.useEffect)(()=>{e.set(Vn,p)},[e,p]),(0,t.useEffect)(()=>{e.set(Hn,a)},[e,a]),(0,t.useEffect)(()=>{typeof r==`string`&&e.set(zn,r)},[e,r]),$n(s,e,c),(0,t.useEffect)(()=>{C.current!==S&&(C.current=S,S?u?.():(d?.(),o&&G.setQuery(``,e),G.clearState({clearQuery:o},e)))},[S,u,d,o,e]);let w=(0,t.useCallback)(()=>{G.close(e)},[e]);if(l)return null;let T=S||f,E={position:`fixed`,top:typeof h==`number`?`${h}px`:h,left:`50%`,transform:`translateX(-50%)`,maxWidth:typeof m==`number`?`${m}px`:m,width:`100%`,zIndex:1e6,maxHeight:v?`calc(100vh - ${typeof h==`number`?`${h*2}px`:h})`:void 0,display:`flex`,flexDirection:`column`},D={display:`flex`,flexDirection:`column`,overflow:`hidden`,maxHeight:v?typeof _==`number`?`${_}px`:_:void 0,gap:0,padding:0};return(0,n.jsx)(g.Provider,{store:e,children:T&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:x.backdrop,onClick:w,"aria-hidden":`true`}),(0,n.jsx)(i.Dialog,{open:!0,modalType:`non-modal`,onOpenChange:(t,n)=>{n.open||G.close(e)},children:(0,n.jsx)(i.DialogSurface,{className:`${x.surface}${b?` ${b}`:``}`,style:E,"aria-label":`Spotlight search`,children:(0,n.jsx)(i.DialogBody,{style:D,children:y})})})]})})},nr=()=>({searchBoxStyles:_.css`
32
32
  border: 1px solid ${i.tokens.colorNeutralStroke2};
33
33
  border-radius: 50px;
34
34
  background-color: ${i.tokens.colorNeutralBackground1};
@@ -360,7 +360,7 @@ import { AISearchIcon } from './AISearchIcon';
360
360
  animation-delay: 0.2s;
361
361
  `,dot3:l.css`
362
362
  animation-delay: 0.4s;
363
- `}},Uc=()=>{let e=Hc();return(0,n.jsxs)(`div`,{className:e.root,role:`status`,"aria-label":`Loading response`,children:[(0,n.jsx)(`div`,{className:`${e.dot} ${e.dot1}`}),(0,n.jsx)(`div`,{className:`${e.dot} ${e.dot2}`}),(0,n.jsx)(`div`,{className:`${e.dot} ${e.dot3}`})]})},Wc=(e,t)=>{switch(t.type){case`INIT`:return{...e,messages:[t.welcomeMessage],isLoading:!1};case`SET_INPUT`:return{...e,inputText:t.inputText};case`ADD_USER_MESSAGE`:return{...e,messages:[...e.messages,t.message]};case`ADD_ASSISTANT_MESSAGE`:return{...e,messages:[...e.messages,t.message]};case`UPDATE_LAST_ASSISTANT_MESSAGE`:{let n=[...e.messages],r=n.length-1;return r>=0&&n[r].senderName===`Assistant`&&(n[r]=t.message),{...e,messages:n}}case`SET_ERROR`:return{...e,error:t.error};case`CLEAR_INPUT`:return{...e,inputText:``};case`SET_IS_RUNNING`:return{...e,isRunning:!e.isRunning};default:return e}},Gc=()=>({markdown:(0,l.css)({fontFamily:i.tokens.fontFamilyBase,fontSize:i.tokens.fontSizeBase300,lineHeight:i.tokens.lineHeightBase300,color:i.tokens.colorNeutralForeground1,"& p":{marginTop:`0`,marginBottom:i.tokens.spacingVerticalM},"& h1, & h2, & h3, & h4, & h5, & h6":{marginTop:i.tokens.spacingVerticalL,marginBottom:i.tokens.spacingVerticalM,fontWeight:i.tokens.fontWeightSemibold},"& h1":{fontSize:i.tokens.fontSizeBase500},"& h2":{fontSize:i.tokens.fontSizeBase400},"& h3":{fontSize:i.tokens.fontSizeBase300},"& ul, & ol":{marginTop:`0`,marginBottom:i.tokens.spacingVerticalM,paddingLeft:i.tokens.spacingHorizontalXXL},"& li":{marginBottom:i.tokens.spacingVerticalXS},"& code":{fontFamily:i.tokens.fontFamilyMonospace,fontSize:i.tokens.fontSizeBase200,backgroundColor:i.tokens.colorNeutralBackground3,padding:`2px 4px`,borderRadius:i.tokens.borderRadiusSmall},"& pre":{backgroundColor:i.tokens.colorNeutralBackground3,padding:i.tokens.spacingVerticalM,borderRadius:i.tokens.borderRadiusMedium,overflowX:`auto`,marginBottom:i.tokens.spacingVerticalM},"& pre code":{backgroundColor:`transparent`,padding:`0`},"& table":{borderCollapse:`collapse`,width:`100%`,marginBottom:i.tokens.spacingVerticalM,border:`1px solid ${i.tokens.colorNeutralStroke1}`},"& thead":{backgroundColor:i.tokens.colorNeutralBackground3},"& th":{padding:i.tokens.spacingVerticalS+` `+i.tokens.spacingHorizontalM,textAlign:`left`,fontWeight:i.tokens.fontWeightSemibold,borderBottom:`2px solid ${i.tokens.colorNeutralStroke1}`,borderRight:`1px solid ${i.tokens.colorNeutralStroke2}`},"& td":{padding:i.tokens.spacingVerticalS+` `+i.tokens.spacingHorizontalM,borderBottom:`1px solid ${i.tokens.colorNeutralStroke2}`,borderRight:`1px solid ${i.tokens.colorNeutralStroke2}`},"& tr:last-child td":{borderBottom:`none`},"& th:last-child, & td:last-child":{borderRight:`none`},"& blockquote":{borderLeft:`4px solid ${i.tokens.colorBrandStroke1}`,paddingLeft:i.tokens.spacingHorizontalM,marginLeft:`0`,marginBottom:i.tokens.spacingVerticalM,color:i.tokens.colorNeutralForeground2},"& a":{color:i.tokens.colorBrandForeground1,textDecoration:`none`,":hover":{textDecoration:`underline`}},"& hr":{border:`none`,borderTop:`1px solid ${i.tokens.colorNeutralStroke2}`,marginTop:i.tokens.spacingVerticalL,marginBottom:i.tokens.spacingVerticalL}})}),Kc=({content:e,className:r})=>{let i=Gc(),[a,o]=t.useState(``);return t.useEffect(()=>{o(new D.default({html:!1,linkify:!0,typographer:!0,breaks:!0}).render(e))},[e]),(0,n.jsx)(`div`,{className:`${i.markdown} ${r||``}`,dangerouslySetInnerHTML:{__html:F.default.sanitize(a)}})},qc=(0,i.makeStyles)({plainText:{fontFamily:i.tokens.fontFamilyBase,fontSize:i.tokens.fontSizeBase300,lineHeight:i.tokens.lineHeightBase300,color:i.tokens.colorNeutralForeground1,whiteSpace:`pre-wrap`,wordBreak:`break-word`},htmlContent:{fontFamily:i.tokens.fontFamilyBase,fontSize:i.tokens.fontSizeBase300,lineHeight:i.tokens.lineHeightBase300,color:i.tokens.colorNeutralForeground1,"& p":{marginTop:`0`,marginBottom:i.tokens.spacingVerticalM},"& h1, & h2, & h3, & h4, & h5, & h6":{marginTop:i.tokens.spacingVerticalL,marginBottom:i.tokens.spacingVerticalM,fontWeight:i.tokens.fontWeightSemibold},"& table":{borderCollapse:`collapse`,width:`100%`,marginBottom:i.tokens.spacingVerticalM},"& th, & td":{border:`1px solid ${i.tokens.colorNeutralStroke1}`,padding:i.tokens.spacingHorizontalS,textAlign:`left`},"& th":{backgroundColor:i.tokens.colorNeutralBackground3,fontWeight:i.tokens.fontWeightSemibold}},debugBadge:{display:`inline-block`,padding:`${i.tokens.spacingVerticalXS} ${i.tokens.spacingHorizontalS}`,marginBottom:i.tokens.spacingVerticalS,backgroundColor:i.tokens.colorNeutralBackground3,borderRadius:i.tokens.borderRadiusSmall,fontSize:i.tokens.fontSizeBase200,fontFamily:i.tokens.fontFamilyMonospace,color:i.tokens.colorNeutralForeground2},adaptiveCardWrapper:{width:`100%`}}),Jc=({content:e,forceType:r,onTypeDetected:i,context:a,theme:o=Us.SharePoint,fluentTheme:s,onAdaptiveCardAction:c,className:l,debug:u=!1})=>{let d=qc(),{error:f}=z(),[p,m]=t.useState(null);if(t.useEffect(()=>{if(t.isValidElement(e)||typeof e!=`string`&&typeof e!=`object`)return;let n=Je(e);m(n),i&&i(n)},[e,i]),t.isValidElement(e))return(0,n.jsx)(n.Fragment,{children:e});let h=r||p?.type,g=p?.content||e;return(0,n.jsxs)(n.Fragment,{children:[!u||!p?null:(0,n.jsxs)(`div`,{className:d.debugBadge,children:[`Type: `,p.type,` | Confidence: `,(p.confidence*100).toFixed(0),`%`]}),(()=>{switch(h){case He.MARKDOWN:return(0,n.jsx)(Kc,{content:g,className:l});case He.HTML:return(0,n.jsx)(`div`,{className:` ${l||``}`,dangerouslySetInnerHTML:{__html:F.default.sanitize(g)}});case He.ADAPTIVE_CARD:return(0,n.jsx)(`div`,{className:`${d.adaptiveCardWrapper} ${l||``}`,children:(0,n.jsx)(xc,{card:typeof g==`string`?JSON.parse(g):g,context:a,theme:s,themeType:o,onInvokeAction:c||(()=>{}),onError:e=>f(`Adaptive Card Error:`,e instanceof Error?e:void 0)})});case He.PLAIN_TEXT:default:return(0,n.jsx)(`div`,{className:`${d.plainText} ${l||``}`,children:g})}})()]})},Yc=t.forwardRef((e,r)=>{let{messages:a,context:o}=e,s=e=>t.isValidElement(e)?e:typeof e==`string`?e.replace(/\{"status"\s*:\s*"executing"\}/gi,``).replace(/\{'status'\s*:\s*'executing'\}/gi,``).trim():e,c=(0,l.css)({flex:`1 1 0`,overflowY:`auto`,overflowX:`hidden`,padding:`16px`,paddingRight:`25px`,"::-webkit-scrollbar":{width:`6px`},"::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground4,borderRadius:`10px`},"::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandStroke2Hover,borderRadius:`10px`},"::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorNeutralStroke2}}),u=(0,l.css)({display:`flex`,flexDirection:`column`,gap:`10px`,paddingRight:`30px`});return(0,n.jsx)(`div`,{ref:r,className:c,role:`log`,"aria-live":`polite`,"aria-label":`Chat history`,children:(0,n.jsx)(P.Chat,{className:u,children:a.map((e,t)=>e.senderName===`User`?(0,n.jsx)(P.ChatMyMessage,{status:e.status,author:e.senderName,children:s(e.message)},t):(0,n.jsx)(P.ChatMessage,{decoration:e.status===`failed`?`important`:void 0,avatar:(0,n.jsx)(p.Icon,{icon:`carbon:ibm-consulting-advantage-assistant`,width:`32`,height:`32`,"aria-hidden":`true`,style:{color:i.tokens.colorBrandBackground}}),author:e.senderName,children:(0,n.jsx)(Jc,{content:s(e.message),context:o})},t))})})});Yc.displayName=`ChatList`;var Xc=()=>({container:(0,l.css)({display:`flex`,flexDirection:`column`,padding:`10px`,width:`100%`,height:`600px`,borderRadius:`8px`,boxShadow:`0 2px 10px rgba(0, 0, 0, 0.1)`,overflowY:`auto`,overflowX:`hidden`,position:`relative`,zIndex:1e3}),chatList:(0,l.css)({display:`flex`,flexDirection:`column`,gap:`10px`,paddingRight:`30px`,width:`100%`,"::-webkit-scrollbar":{width:`5px`,height:`5px`},"::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground4,borderRadius:`10px`},"::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandStroke2Hover,borderRadius:`10px`},"::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorNeutralStroke2}}),chatAIAssistantRoot:(0,l.css)({padding:`10px`,display:`flex`,flexDirection:`column`,position:`relative`,height:`calc(100% - 20px)`}),inputContainer:(0,l.css)({display:`flex`,flexDirection:`row`,flex:1,marginTop:`10px`,gap:`10px`,alignItems:`center`}),input:(0,l.css)({width:`100%`,fontSize:`14px`}),aiAssistantContainer:(0,l.css)({display:`flex`,flexDirection:`column`,height:`100%`,width:`100%`,boxSizing:`border-box`}),aiAssistantInputContainer:(0,l.css)({flex:`0 0 auto`,padding:`16px`,paddingBottom:`20px`,borderTop:`1px solid ${i.tokens.colorNeutralStroke2}`,backgroundColor:i.tokens.colorNeutralBackground1,boxSizing:`border-box`})}),Zc=(e,t)=>{let{getFormatRelative:n}=we(e,t);return n(new Date)},Qc=r=>{let{instrutions:a,timezone:o,locale:s,onResponse:c,openAIConfig:l,theme:u,placeholder:d,context:f}=r,[p,m]=t.useReducer(Wc,{messages:[],inputText:``,isLoading:!0,error:void 0,isRunning:!1}),{messages:h,inputText:g,isLoading:_,error:v,isRunning:y}=p,b=t.useRef([]),x=t.useRef(null),S=Xc(),C=e.n(),{error:w}=z(),{sendMessage:T,cancelRequest:E}=ue({endpoint:l?.endpoint,mcpServers:l?.mcpServers,requestHeaders:l?.requestHeaders}),D=t.useCallback(()=>{x.current&&(x.current.scrollTop=x.current.scrollHeight-x.current.clientHeight)},[]);t.useEffect(()=>{let e=setTimeout(()=>{D()},100);return()=>clearTimeout(e)},[h,D]),t.useEffect(()=>{m({type:`INIT`,welcomeMessage:{message:`Welcome to AI Assistant! How can I help you today?`,senderName:`Assistant`,timeStamp:Zc(o,f?.pageContext?.cultureInfo?.currentUICultureName||`en-US`),status:`received`}})},[]);let O=t.useCallback(async()=>{if(!g.trim())return;let e={message:g,senderName:`User`,timeStamp:Zc(o,f?.pageContext?.cultureInfo?.currentUICultureName||`en-US`),status:`received`},t=g;m({type:`ADD_USER_MESSAGE`,message:e}),m({type:`CLEAR_INPUT`}),m({type:`SET_IS_RUNNING`});let r={message:(0,n.jsx)(Uc,{}),senderName:`Assistant`,timeStamp:Zc(o,f?.pageContext?.cultureInfo?.currentUICultureName||`en-US`),status:`sending`};m({type:`ADD_ASSISTANT_MESSAGE`,message:r});try{let e=await T({instructions:a,input:t,timezone:o,locale:s,history:b.current,mcpServers:l?.mcpServers});if(c){let{message:t,status:n}=await c(e);m({type:`UPDATE_LAST_ASSISTANT_MESSAGE`,message:{...r,message:t||e,status:n||`received`}})}else m({type:`UPDATE_LAST_ASSISTANT_MESSAGE`,message:{...r,message:e,status:`received`}});m({type:`SET_IS_RUNNING`}),b.current.push(t),b.current.push(e)}catch(e){w(`Error during streaming:`,e instanceof Error?e:void 0);let t=`Error occurred while processing your request.`;e instanceof Error&&(t=e.message.includes(`Rate limit`)||e.message.includes(`429`)?`Rate limit exceeded. Please wait a moment before sending another message.`:e.message.includes(`quota`)?`API quota exceeded. Please try again later.`:e.message.includes(`abort`)?`Request was cancelled.`:e.message),m({type:`UPDATE_LAST_ASSISTANT_MESSAGE`,message:{...r,message:t,status:`failed`}}),m({type:`SET_IS_RUNNING`})}},[g,a,s,c,l,o,T,D,f]),k=t.useCallback(e=>{m({type:`SET_INPUT`,inputText:e})},[]);return _?(0,n.jsx)(i.Spinner,{size:`medium`}):v?(0,n.jsx)(_s,{message:C.processingError,messageType:te.INFO}):(0,n.jsxs)(`div`,{className:S.aiAssistantContainer,children:[(0,n.jsx)(Yc,{ref:x,messages:h,context:f}),(0,n.jsx)(`div`,{className:S.aiAssistantInputContainer,children:(0,n.jsx)(Vc,{context:f,value:g,onChange:k,placeholder:d,onSend:O,onAbort:E,theme:u,isRunning:y})})]})},$c=({context:r,onChange:a,value:o,placeholder:s,onSend:c,theme:l,isRunning:u,onAbort:d})=>{let[f,p]=(0,t.useState)(o||``),[m,h]=(0,t.useState)(!1),g=(0,t.useRef)(null),_=e.n(),[v,y]=(0,t.useState)({top:0,left:0}),[b,x]=(0,t.useState)([]),S=(0,t.useRef)({}),C=Bc(),{warn:w,error:T}=z();t.default.useEffect(()=>{g.current?.focus(),p(o||``)},[o]);let E=async e=>{if(S.current[e])return S.current[e];if(!r?.graphClient)return w(`Graph client not available`),[];try{let t=e&&e.length>0?`/users?$filter=startswith(displayName,'${e}')`:`/users?$orderby=displayName&$top=10`,n=(await r.graphClient.get(t))?.value||[],i=r.pageContext?.web?.absoluteUrl||``;return n.forEach(e=>{i?e.avatar=`${i}/_layouts/15/userphoto.aspx?size=S&accountname=${e.mail}`:e.avatar=`https://graph.microsoft.com/v1.0/users/${e.id}/photo/$value`}),S.current[e]=n,n}catch(e){return T(`Error fetching users from Graph:`,e instanceof Error?e:void 0),[]}},D=(0,t.useCallback)(ke(async e=>{let t=await E(e);t.sort((e,t)=>e.displayName.localeCompare(t.displayName)),x(t),h(!0),setTimeout(()=>{g.current?.focus()},0)},300),[r]),O=async e=>{p(e),a&&a(e),g.current?.focus();let t=e.lastIndexOf(`@`);if(t!==-1&&(t===0||e[t-1]===` `)){await D(e.slice(t+1));let n=g.current;if(n){let e=(0,ee.default)(n,t),r=n.getBoundingClientRect();y({top:r.top+e.top+22,left:r.left+e.left+16})}}else h(!1)},k=e=>{let t=f.replace(/@(\w*)$/,`@${e} `);p(t),a&&a(t),h(!1),x([]),g.current?.focus()},A=(0,t.useCallback)(({users:e})=>(0,n.jsxs)(`div`,{className:C.listContainer,children:[e.length===0&&(0,n.jsx)(i.Caption1,{children:_.noUsersFound}),e.map(e=>(0,n.jsx)(i.Card,{size:`small`,appearance:`subtle`,onMouseDown:e=>e.preventDefault(),onClick:()=>k(e.mail),children:(0,n.jsx)(i.Persona,{name:e.displayName,role:`gridcell`,secondaryText:e.mail,avatar:{image:{src:e.avatar}}})},e.id))]}),[C.listContainer,k]);return(0,n.jsxs)(B,{horizontal:!0,width:`100%`,className:C.inputContainer,children:[(0,n.jsx)(Ic,{ref:g,onSend:c,value:f,onChange:O,theme:l,placeholder:s,isRunning:u,onAbort:d}),(0,n.jsxs)(xt,{theme:l,anchorPoint:v,isOpen:m,onClose:()=>h(!1),excludeRefs:[g],children:[(0,n.jsx)(i.CardHeader,{header:(0,n.jsx)(i.Body1Strong,{className:C.sugestionsHeader,children:`Sugestions`})}),(0,n.jsx)(i.Divider,{}),(0,n.jsx)(A,{users:b})]})]})},el=()=>({inputContainer:(0,l.css)({marginTop:`auto`,marginLeft:`auto`,"::after":{content:`""`,position:`absolute`,bottom:0,left:0,right:0,borderBottom:`2px solid transparent`,pointerEvents:`none`,borderRadius:i.tokens.borderRadiusMedium}}),listContainer:(0,l.css)({maxHeight:`400px`,overflowY:`auto`,overflowX:`hidden`,"::-webkit-scrollbar":{width:`5px`,height:`5px`},"::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground4,borderRadius:`10px`},"::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandStroke2Hover,borderRadius:`10px`},"::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorNeutralStroke2}}),sugestionsHeader:(0,l.css)({color:i.tokens.colorBrandBackground})}),tl=e=>{let{width:t,height:n,zoomable:r=!1}=e;return{root:(0,l.css)({position:`relative`,borderRadius:i.tokens.borderRadiusMedium,border:`1px solid ${i.tokens.colorNeutralStroke2}`,width:t??`100%`,height:n??`auto`,...r?{cursor:`grab`}:{}}),svgContainer:(0,l.css)({width:`100%`}),loading:(0,l.css)({color:i.tokens.colorNeutralForeground3,fontFamily:i.tokens.fontFamilyBase,fontSize:i.tokens.fontSizeBase300})}},nl=0,rl=e=>{let[n,r]=t.useState(!1);return t.useEffect(()=>{let t=e.current;if(!t)return;let n=getComputedStyle(t).getPropertyValue(`--colorNeutralBackground1`).trim();if(n&&n.startsWith(`#`)&&n.length>=7){let e=parseInt(n.substring(1,3),16),t=parseInt(n.substring(3,5),16),i=parseInt(n.substring(5,7),16);r(.299*e+.587*t+.114*i<128)}}),n},il=r=>{let{source:a,url:o,theme:s,backgroundColor:c,className:l,styles:u,zoomable:d=!1,onRendered:f,onError:p,loadingContent:m,errorContent:h}=r,g=tl(r),_=t.useRef(null),v=t.useRef(null),y=rl(_),b=s??(y?`dark`:`default`),[x,S]=t.useState(null),[C,w]=t.useState(null),[T,E]=t.useState(!1),[D,O]=t.useState(null),{loading:k,errorMessage:A,noSource:j}=e.g();t.useEffect(()=>{if(a){O(a),w(null);return}if(o){let e=!1;return E(!0),w(null),fetch(o).then(e=>{if(!e.ok)throw Error(`Failed to fetch ${o}: ${e.status} ${e.statusText}`);return e.text()}).then(t=>{e||(O(t),E(!1))}).catch(t=>{if(!e){let e=t instanceof Error?t:Error(String(t));w(e),E(!1),p?.(e)}}),()=>{e=!0}}O(null)},[a,o,p]),t.useEffect(()=>{if(!D){S(null);return}let e=!1,t=`mermaid-diagram-${++nl}`;return I.default.initialize({startOnLoad:!1,theme:b,securityLevel:`loose`,fontFamily:i.tokens.fontFamilyBase,suppressErrorRendering:!0}),I.default.render(t,D).then(({svg:t})=>{e||(S(t),w(null),f?.(t))}).catch(n=>{if(!e){let e=n instanceof Error?n:Error(String(n));w(e),S(null),p?.(e)}document.getElementById(t)?.remove()}),()=>{e=!0,document.getElementById(t)?.remove()}},[D,b,f,p]);let[M,N]=t.useState(1),[ee,P]=t.useState({x:0,y:0}),F=t.useRef(!1),L=t.useRef({x:0,y:0});t.useEffect(()=>{let e=_.current;if(!e||!d)return;let t=e=>{e.preventDefault();let t=e.deltaY>0?-.1:.1;N(e=>Math.min(Math.max(e+t,.25),4))},n=e=>{F.current=!0,L.current={x:e.clientX,y:e.clientY}},r=e=>{if(!F.current)return;let t=e.clientX-L.current.x,n=e.clientY-L.current.y;L.current={x:e.clientX,y:e.clientY},P(e=>({x:e.x+t,y:e.y+n}))},i=()=>{F.current=!1};return e.addEventListener(`wheel`,t,{passive:!1}),e.addEventListener(`mousedown`,n),e.addEventListener(`mousemove`,r),e.addEventListener(`mouseup`,i),e.addEventListener(`mouseleave`,i),()=>{e.removeEventListener(`wheel`,t),e.removeEventListener(`mousedown`,n),e.removeEventListener(`mousemove`,r),e.removeEventListener(`mouseup`,i),e.removeEventListener(`mouseleave`,i)}},[d]),t.useEffect(()=>{N(1),P({x:0,y:0})},[D]),t.useEffect(()=>{let e=v.current;e&&(e.innerHTML=x??``,e.setAttribute(`role`,`img`),e.setAttribute(`aria-label`,`Mermaid diagram`))},[x]);let R=[g.root,l].filter(Boolean).join(` `);if(T)return(0,n.jsx)(H,{className:R,style:u,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,background:c,children:(0,n.jsx)(H,{className:g.loading,alignItems:`center`,justifyContent:`center`,padding:`xxl`,children:m??(0,n.jsx)(Tt,{size:`small`,label:k})})});if(C)return(0,n.jsx)(H,{className:R,style:u,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,background:c,children:h?h(C):(0,n.jsx)(_s,{message:A,messageType:te.ERROR})});if(!x)return(0,n.jsx)(H,{className:R,style:u,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,background:c,children:(0,n.jsx)(H,{className:g.loading,alignItems:`center`,justifyContent:`center`,padding:`xxl`,children:(0,n.jsx)(i.Text,{children:j})})});let ne=d?{transform:`translate(${ee.x}px, ${ee.y}px) scale(${M})`,transformOrigin:`center center`}:void 0;return(0,n.jsx)(H,{ref:_,className:R,style:u,alignItems:`center`,justifyContent:`center`,overflow:d?`auto`:`hidden`,background:c,children:(0,n.jsx)(H,{ref:v,className:g.svgContainer,alignItems:`center`,justifyContent:`center`,style:ne,children:(0,n.jsx)(n.Fragment,{})})})},al={small:i.tokens.borderRadiusSmall,medium:i.tokens.borderRadiusMedium,large:i.tokens.borderRadiusLarge,xLarge:i.tokens.borderRadiusXLarge},ol={brand:{border:i.tokens.colorBrandStroke1,bg:i.tokens.colorBrandBackground2},subtle:{border:i.tokens.colorNeutralStroke1,bg:i.tokens.colorNeutralBackground3},success:{border:i.tokens.colorPaletteGreenBorder2,bg:i.tokens.colorPaletteGreenBackground2},warning:{border:i.tokens.colorPaletteYellowBorder2,bg:i.tokens.colorPaletteYellowBackground2},danger:{border:i.tokens.colorPaletteRedBorder2,bg:i.tokens.colorPaletteRedBackground2},info:{border:i.tokens.colorPaletteBlueBorderActive,bg:i.tokens.colorPaletteBlueBackground2}},sl=e=>ol[e]??{border:e,bg:`transparent`},cl=e=>al[e]??e,ll=(e,n,r)=>{let{border:a,bg:o}=sl(e),s=cl(n),c=r/-2;return{root:(0,t.useMemo)(()=>(0,l.css)({position:`relative`,margin:0,borderInlineStart:`3px solid ${a}`,borderStartEndRadius:s,borderEndEndRadius:s,backgroundColor:o,padding:`${i.tokens.spacingVerticalXL} ${i.tokens.spacingHorizontalXXL}`,fontFamily:i.tokens.fontFamilyBase,fontSize:i.tokens.fontSizeBase300,lineHeight:i.tokens.lineHeightBase300,color:i.tokens.colorNeutralForeground1}),[a,s,o]),icon:(0,t.useMemo)(()=>(0,l.css)({position:`absolute`,color:a,backgroundColor:i.tokens.colorNeutralBackground1,display:`flex`,alignItems:`center`,justifyContent:`center`,top:c,insetInlineStart:c,width:r,height:r,borderRadius:`50%`}),[a,c,r]),cite:(0,t.useMemo)(()=>(0,l.css)({display:`block`,marginTop:i.tokens.spacingVerticalM,opacity:.6,fontSize:i.tokens.fontSizeBase200,lineHeight:i.tokens.lineHeightBase200,fontStyle:`normal`}),[])}},ul=48,dl=`brand`,fl=`medium`,pl=(0,t.memo)(({icon:e,iconSize:t=ul,color:r=dl,radius:a=fl,cite:o,className:s,style:c,children:l})=>{let u=ll(r,a,t);return(0,n.jsxs)(`blockquote`,{className:(0,i.mergeClasses)(u.root,s),style:c,role:`blockquote`,children:[e&&(0,n.jsx)(`span`,{className:u.icon,"aria-hidden":`true`,children:e}),l,o&&(0,n.jsx)(`cite`,{className:u.cite,children:o})]})});pl.displayName=`Blockquote`;var ml={spacingHorizontalXS:i.tokens.spacingHorizontalXS,spacingHorizontalS:i.tokens.spacingHorizontalS,spacingHorizontalM:i.tokens.spacingHorizontalM,spacingHorizontalL:i.tokens.spacingHorizontalL,spacingHorizontalXL:i.tokens.spacingHorizontalXL,spacingHorizontalXXL:i.tokens.spacingHorizontalXXL},hl=e=>ml[e]??e,gl=(e,n,r,i,a,o,s,c,u)=>{let d=hl(o),f=e===`horizontal`,p=(0,t.useMemo)(()=>(0,l.keyframes)({from:{transform:f?`translateX(0)`:`translateY(0)`},to:{transform:f?`translateX(calc(-100% / ${i} - ${d} / ${i}))`:`translateY(calc(-100% / ${i} - ${d} / ${i}))`}}),[f,i,d]);return{root:(0,t.useMemo)(()=>(0,l.css)({position:`relative`,overflow:`hidden`,display:`flex`,flexDirection:f?`row`:`column`,maxHeight:`100%`,maxWidth:`100%`,...s&&{"&::before, &::after":{content:`""`,position:`absolute`,zIndex:1,pointerEvents:`none`},...f?{"&::before":{top:0,bottom:0,left:0,width:u,background:`linear-gradient(to right, ${c}, transparent)`},"&::after":{top:0,bottom:0,right:0,width:u,background:`linear-gradient(to left, ${c}, transparent)`}}:{"&::before":{left:0,right:0,top:0,height:u,background:`linear-gradient(to bottom, ${c}, transparent)`},"&::after":{left:0,right:0,bottom:0,height:u,background:`linear-gradient(to top, ${c}, transparent)`}}}}),[f,s,c,u]),content:(0,t.useMemo)(()=>(0,l.css)({display:`flex`,flexDirection:f?`row`:`column`,gap:d,animation:`${p} ${a}ms linear infinite`,animationDirection:n?`reverse`:`normal`,...r&&{"*:hover > &":{animationPlayState:`paused`}}}),[f,d,p,a,n,r]),group:(0,t.useMemo)(()=>(0,l.css)({display:`flex`,flexShrink:0,flexDirection:f?`row`:`column`,gap:d}),[f,d])}},_l=4,vl=1e5,yl=`spacingHorizontalM`,bl=`5%`,xl=(0,t.memo)(({children:e,orientation:r=`horizontal`,reverse:a=!1,pauseOnHover:o=!1,repeat:s=_l,duration:c=vl,gap:l=yl,fadeEdges:u=!0,fadeEdgeColor:d=i.tokens.colorNeutralBackground1,fadeEdgeSize:f=bl,className:p,style:m})=>{let h=gl(r,a,o,s,c,l,u,d,f),g=(0,t.useMemo)(()=>Array.from({length:s},(t,r)=>(0,n.jsx)(`div`,{className:h.group,...r>0?{"aria-hidden":!0}:{},children:e},r)),[s,e,h.group]);return(0,n.jsx)(`div`,{className:(0,i.mergeClasses)(h.root,p),style:m,role:`marquee`,"aria-live":`off`,children:(0,n.jsx)(`div`,{className:h.content,children:g})})});xl.displayName=`Marquee`;var Sl=e=>{let{maxHeight:n,expanded:r,contentHeight:a,hasSpoiler:o,transitionDuration:s}=e;return(0,t.useMemo)(()=>({root:(0,l.css)({position:`relative`,...o&&{marginBottom:28}}),content:(0,l.css)({display:`flex`,flexDirection:`column`,overflow:`hidden`,maxHeight:r?a>0?a:void 0:n,transition:`max-height ${s}ms ease`}),control:(0,l.css)({position:`absolute`,insetInlineStart:0,top:`100%`,height:28,padding:0,fontWeight:Number(i.tokens.fontWeightSemibold)})}),[n,r,a,o,s])},Cl=()=>{let e=(0,t.useRef)(null),[n,r]=(0,t.useState)(0);return(0,t.useEffect)(()=>{if(!e.current)return;let t=new ResizeObserver(([e])=>{r(e.contentRect.height)});return t.observe(e.current),()=>t.disconnect()},[]),{ref:e,height:n}},wl=t.default.memo(({children:e,maxHeight:r=100,showLabel:a,hideLabel:o,defaultExpanded:s=!1,expanded:c,onExpandedChange:l,transitionDuration:u=200,showAriaLabel:d,hideAriaLabel:f,controlRef:p,className:m,style:h})=>{let g=(0,t.useId)(),_=`${g}-region`,{ref:v,height:y}=Cl(),b=c!==void 0,[x,S]=(0,t.useState)(s),C=b?c:x,w=r<y,T=Sl({maxHeight:r,expanded:C,contentHeight:y,hasSpoiler:w,transitionDuration:u}),E=(0,t.useCallback)(()=>{let e=!C;b||S(e),l?.(e)},[C,b,l]),D=C?f:d;return(0,n.jsxs)(`div`,{id:g,className:(0,i.mergeClasses)(T.root,m),style:h,children:[w&&(0,n.jsx)(i.Link,{ref:p,className:T.control,onClick:E,"aria-expanded":C,"aria-controls":_,...D?{"aria-label":D}:{},children:C?o:a}),(0,n.jsx)(`div`,{className:T.content,role:`region`,id:_,children:(0,n.jsx)(`div`,{ref:v,children:e})})]})});wl.displayName=`Spoiler`;var Tl={none:`0`,small:i.tokens.borderRadiusSmall,medium:i.tokens.borderRadiusMedium,large:i.tokens.borderRadiusLarge,xLarge:i.tokens.borderRadiusXLarge,circular:i.tokens.borderRadiusCircular},El=(e,n)=>(0,t.useMemo)(()=>{let t=Tl[n]??n;return{root:(0,l.css)({backgroundImage:`url(${CSS.escape?CSS.escape(e):e})`,backgroundSize:`cover`,backgroundPosition:`center`,display:`block`,width:`100%`,border:0,textDecoration:`none`,borderRadius:t})}},[e,n]),Dl=t.default.memo(({src:e,children:t,radius:r=`none`,className:a,style:o})=>(0,n.jsx)(`div`,{className:(0,i.mergeClasses)(El(e,r).root,a),style:o,role:`img`,"aria-label":e,children:t}));Dl.displayName=`BackgroundImage`;var Ol=({bulletSize:e,lineWidth:n,align:r})=>(0,t.useMemo)(()=>{let t=e/2+n/2;return{root:(0,l.css)({position:`relative`,...r===`left`&&{paddingInlineStart:t},...r===`right`&&{paddingInlineEnd:t}})}},[e,n,r]),kl=e=>{let{bulletSize:n,lineWidth:r,align:a,active:o,lineActive:s,isLast:c,isFirst:u,color:d,lineVariant:f,hasBulletContent:p}=e;return(0,t.useMemo)(()=>{let e=n/2+r/2,t=d||i.tokens.colorBrandForeground1,m=i.tokens.colorNeutralStroke1;return{item:(0,l.css)({position:`relative`,color:i.tokens.colorNeutralForeground1,...!u&&{marginTop:i.tokens.spacingVerticalXL},...!c&&{"&::before":{content:`""`,position:`absolute`,top:0,bottom:`calc(${i.tokens.spacingVerticalXL} * -1)`,pointerEvents:`none`,borderInlineStart:`${r}px ${f} ${s?t:m}`,...a===`left`&&{insetInlineStart:-r,insetInlineEnd:`auto`},...a===`right`&&{insetInlineStart:`auto`,insetInlineEnd:-r}}}}),bullet:(0,l.css)({width:n,height:n,borderRadius:`50%`,border:`${r}px solid ${o?t:m}`,backgroundColor:o?p?t:i.tokens.colorNeutralBackground1:p?i.tokens.colorNeutralStroke2:i.tokens.colorNeutralBackground1,position:`absolute`,top:0,display:`flex`,alignItems:`center`,justifyContent:`center`,color:o?i.tokens.colorNeutralForegroundOnBrand:i.tokens.colorNeutralForeground2,boxSizing:`border-box`,...a===`left`&&{insetInlineStart:-(n/2+r/2)},...a===`right`&&{insetInlineEnd:-(n/2+r/2)}}),body:(0,l.css)({...a===`left`&&{paddingInlineStart:e+8,textAlign:`left`},...a===`right`&&{paddingInlineEnd:e+8,textAlign:`right`}}),title:(0,l.css)({lineHeight:`1 !important`,marginBottom:i.tokens.spacingVerticalXXS,"& span":{lineHeight:`1 !important`}})}},[n,r,a,o,s,c,u,d,f,p])},Al=t.default.memo(({title:e,children:t,bullet:r,color:a,lineVariant:o=`solid`,active:s,lineActive:c,__active:l,__lineActive:u,__align:d=`left`,__bulletSize:f=16,__lineWidth:p=2,__color:m,__isFirst:h=!1,__isLast:g=!1,className:_,style:v})=>{let y=kl({bulletSize:f,lineWidth:p,align:d,active:s??l??!1,lineActive:c??u??!1,isLast:g,isFirst:h,color:a||m,lineVariant:o,hasBulletContent:!!r});return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(y.item,_),style:v,children:[(0,n.jsx)(`div`,{className:y.bullet,children:r}),(0,n.jsxs)(`div`,{className:y.body,children:[e&&(0,n.jsx)(i.Text,{block:!0,weight:`semibold`,size:300,className:y.title,children:e}),t]})]})});Al.displayName=`TimelineItem`;var jl=t.default.memo(({children:e,active:r=-1,color:a,bulletSize:o=16,lineWidth:s=2,align:c=`left`,reverseActive:l=!1,className:u,style:d})=>{let f=Ol({bulletSize:o,lineWidth:s,align:c}),p=t.Children.toArray(e),m=p.map((e,n)=>{if(!t.default.isValidElement(e))return e;let i=e.props,u=l?r>=p.length-n-1:r>=n,d=l?r>=p.length-n-1:r-1>=n;return(0,t.cloneElement)(e,{__active:i.active===void 0?u:i.active,__lineActive:i.lineActive===void 0?d:i.lineActive,__align:c,__bulletSize:o,__lineWidth:s,__color:a,__isFirst:n===0,__isLast:n===p.length-1})});return(0,n.jsx)(`div`,{className:(0,i.mergeClasses)(f.root,u),style:d,children:m})});jl.displayName=`Timeline`;var Ml=Object.assign(jl,{Item:Al}),Nl=({orientation:e,iconSize:n,iconPosition:r})=>(0,t.useMemo)(()=>({root:(0,l.css)({display:`flex`,flexDirection:`column`}),steps:(0,l.css)({display:`flex`,flexDirection:e===`horizontal`?`row`:`column`,alignItems:e===`horizontal`?`flex-start`:void 0,gap:0}),content:(0,l.css)({paddingTop:i.tokens.spacingVerticalL})}),[e,n,r]),Pl=e=>{let{iconSize:n,state:r,color:a,orientation:o,iconPosition:s,allowClick:c,isLast:u,separatorActive:d}=e;return(0,t.useMemo)(()=>{let e=a||i.tokens.colorBrandForeground1,t=i.tokens.colorNeutralStroke1;return{step:(0,l.css)({cursor:c?`pointer`:`default`,...o===`horizontal`&&{display:`grid`,gridTemplateColumns:u?`${n}px`:`${n}px 1fr`,gridTemplateRows:`auto auto`,flex:u?`0 0 auto`:`1 1 0`},...o===`vertical`&&{display:`flex`,flexDirection:s===`right`?`row-reverse`:`row`,gap:i.tokens.spacingHorizontalS,alignItems:`flex-start`},"&:focus-visible":{outline:`2px solid ${i.tokens.colorStrokeFocus2}`,outlineOffset:2,borderRadius:i.tokens.borderRadiusMedium}}),stepHeader:(0,l.css)({...o===`horizontal`&&{display:`contents`},...o===`vertical`&&{display:`flex`,flexDirection:`column`,alignItems:`center`}}),stepIcon:(0,l.css)({width:n,height:n,minWidth:n,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontWeight:i.tokens.fontWeightBold,fontSize:n*.36,boxSizing:`border-box`,flexShrink:0,transition:`background-color 150ms ease, border-color 150ms ease, color 150ms ease`,...o===`horizontal`&&{gridColumn:1,gridRow:1},...r===`stepCompleted`&&{backgroundColor:e,border:`2px solid ${e}`,color:i.tokens.colorNeutralForegroundOnBrand},...r===`stepProgress`&&{backgroundColor:i.tokens.colorNeutralBackground1,border:`2px solid ${e}`,color:e},...r===`stepInactive`&&{backgroundColor:i.tokens.colorNeutralBackground1,border:`2px solid ${t}`,color:i.tokens.colorNeutralForeground3}}),separator:(0,l.css)({transition:`background-color 150ms ease`,backgroundColor:d?e:t,...o===`horizontal`&&{gridColumn:2,gridRow:1,alignSelf:`center`,height:2,marginInline:i.tokens.spacingHorizontalS},...o===`vertical`&&{flex:1,width:2,minHeight:i.tokens.spacingVerticalL,marginBlock:i.tokens.spacingVerticalXXS}}),stepBody:(0,l.css)({display:`flex`,flexDirection:`column`,...o===`horizontal`&&{gridColumn:1,gridRow:2,alignItems:`center`,justifySelf:`center`,width:`max-content`,textAlign:`center`,whiteSpace:`nowrap`,marginTop:i.tokens.spacingVerticalXS},...o===`vertical`&&{paddingTop:2}}),stepLabel:(0,l.css)({lineHeight:1.3}),stepDescription:(0,l.css)({marginTop:i.tokens.spacingVerticalXXS})}},[n,r,a,o,s,c,u,d])},Fl=t.default.memo(({label:e,description:r,icon:a,completedIcon:o,progressIcon:s,color:c,withIcon:l=!0,allowStepSelect:u=!0,loading:f=!1,children:p,className:m,style:h,__step:g=0,__state:_=`stepInactive`,__color:v,__iconSize:y=34,__orientation:b=`horizontal`,__iconPosition:x=`left`,__completedIcon:S,__progressIcon:C,__allowClick:w=!1,__onStepClick:T,__isLast:E=!1,__separatorActive:D=!1})=>{let O=c||v,k=w&&u,A=Pl({iconSize:y,state:_,color:O,orientation:b,iconPosition:x,allowClick:k,isLast:E,separatorActive:D}),j=t.default.useCallback(()=>{k&&T&&T(g)},[k,T,g]),M=t.default.useCallback(e=>{(e.key===`Enter`||e.key===` `)&&k&&T&&(e.preventDefault(),T(g))},[k,T,g]),N=()=>l?f?(0,n.jsx)(i.Spinner,{size:`tiny`}):_===`stepCompleted`?o||S||(0,n.jsx)(d.Checkmark12Regular,{}):_===`stepProgress`&&(s||C)?s||C:a||(0,n.jsx)(i.Text,{size:200,weight:`bold`,children:g+1}):null;return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(A.step,m),style:h,onClick:j,onKeyDown:M,...k?{role:`button`}:{},tabIndex:k?0:void 0,...k?{"aria-label":typeof e==`string`?`Step ${g+1}: ${e}`:`Step ${g+1}`}:{},children:[(0,n.jsxs)(`div`,{className:A.stepHeader,children:[(0,n.jsx)(`div`,{className:A.stepIcon,children:N()}),!E&&(0,n.jsx)(`div`,{className:A.separator})]}),(e||r)&&(0,n.jsxs)(`div`,{className:A.stepBody,children:[e&&(0,n.jsx)(i.Text,{weight:`semibold`,size:300,className:A.stepLabel,children:e}),r&&(0,n.jsx)(i.Text,{size:200,className:A.stepDescription,children:r})]})]})});Fl.displayName=`StepperStep`;var Il=e=>null;Il.displayName=`StepperCompleted`;var Ll=t.default.memo(({children:e,active:r,onStepClick:a,color:o,iconSize:s=34,orientation:c=`horizontal`,iconPosition:l=`left`,allowNextStepsSelect:u=!0,completedIcon:d,progressIcon:f,className:p,style:m})=>{let h=Nl({orientation:c,iconSize:s,iconPosition:l}),{stepElements:g,completedContent:_,activeStepContent:v}=(0,t.useMemo)(()=>{let n=[],i=null,p=null,m=0;return t.Children.forEach(e,e=>{if(!t.default.isValidElement(e))return;if(e.type?.displayName===`StepperCompleted`){i=e.props.children;return}let h=m,g=h<r?`stepCompleted`:h===r?`stepProgress`:`stepInactive`,_=(0,t.cloneElement)(e,{__step:h,__state:g,__color:o,__iconSize:s,__orientation:c,__iconPosition:l,__completedIcon:d,__progressIcon:f,__allowClick:!!a&&(g===`stepCompleted`||u&&g===`stepInactive`||g===`stepProgress`),__onStepClick:a,__isLast:!1,__separatorActive:h<r}),v=e.props;h===r&&v.children&&(p=v.children),n.push(_),m++}),{stepElements:n,completedContent:i,activeStepContent:p}},[e,r,a,o,s,c,l,u,d,f]),y=(0,t.useMemo)(()=>g.length===0?g:g.map((e,n)=>n===g.length-1&&t.default.isValidElement(e)?(0,t.cloneElement)(e,{__isLast:!0}):e),[g]),b=r>=g.length&&_;return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(h.root,p),style:m,children:[(0,n.jsx)(`div`,{className:h.steps,role:`group`,"aria-label":`Progress steps`,children:y}),(b||v)&&(0,n.jsx)(`div`,{className:h.content,children:b?_:v})]})});Ll.displayName=`Stepper`;var Rl=Object.assign(Ll,{Step:Fl,Completed:Il}),zl={content:``,isCached:!1,status:`idle`},Bl=()=>(0,g.atom)(zl),Vl=new Map,Hl=()=>{Vl.clear()},Ul=({src:e,cacheRequests:n,fetchOptions:r,onError:i})=>{let a=(0,t.useRef)(i),o=(0,t.useRef)(r);a.current=i,o.current=r;let s=(0,t.useRef)(Bl()),c=(0,g.useAtomValue)(s.current),l=(0,g.useSetAtom)(s.current);return(0,t.useEffect)(()=>{if(typeof window>`u`){l({content:``,isCached:!1,status:`unsupported`});return}if(!e){l({content:``,isCached:!1,status:`failed`}),a.current?.(Error(`Missing src`));return}let t=/^data:image\/svg[^,]*?(;base64)?,(.*)/.exec(e);if(t){try{l({content:t[1]?window.atob(t[2]):decodeURIComponent(t[2]),isCached:!1,status:`loaded`})}catch{l({content:``,isCached:!1,status:`failed`}),a.current?.(Error(`Invalid data URI`))}return}if(e.includes(`<svg`)){l({content:e,isCached:!1,status:`loaded`});return}if(n&&Vl.has(e)){l({content:Vl.get(e),isCached:!0,status:`loaded`});return}l({content:``,isCached:!1,status:`loading`});let r=new AbortController;return fetch(e,{...o.current,signal:r.signal}).then(async t=>{if(!t.ok)throw Error(`Failed to fetch SVG: ${t.status}`);let[r]=(t.headers.get(`content-type`)??``).split(/ ?; ?/);if(r&&![`image/svg+xml`,`text/plain`,`application/xml`].some(e=>r.includes(e)))throw Error(`Invalid content type: ${r}`);let i=await t.text();n&&Vl.set(e,i),l({content:i,isCached:!1,status:`loaded`})}).catch(e=>{e.name!==`AbortError`&&(l({content:``,isCached:!1,status:`failed`}),a.current?.(e))}),()=>r.abort()},[e,n]),c},Wl=e=>{let t=``;for(let n=0;n<e;n++)t+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`.charAt(Math.floor(Math.random()*62));return t},Gl=e=>{e.querySelectorAll(`script`).forEach(e=>e.remove()),e.querySelectorAll(`foreignObject`).forEach(e=>e.remove());let t=[e,...Array.from(e.querySelectorAll(`*`))];for(let e of t)for(let t of Array.from(e.attributes))(/^on/i.test(t.name)||/^\s*javascript\s*:/i.test(t.value))&&e.removeAttribute(t.name)},Kl=(e,t,n)=>{let r=[...new XMLSerializer().serializeToString(e).matchAll(/\bid=["']([^"']+)["']/g)],i=[...new Set(r.map(e=>e[1]))];if(!i.length)return;i.sort((e,t)=>t.length-e.length);let a=[e,...Array.from(e.querySelectorAll(`*`))];for(let e of a)for(let r of Array.from(e.attributes)){let a=r.value,o=!1;for(let e of i){let i=`${e}__${t}`,s=e.replace(/[$()*+.?[\\\]^{|}]/g,`\\$&`);r.name===`id`&&a===e&&(a=i,o=!0);let c=RegExp(`url\\((['"]?)#${s}\\1\\)`,`g`);c.test(a)&&(a=a.replace(c,`url($1${n}#${i}$1)`),o=!0),[`href`,`xlink:href`].includes(r.name)&&a===`#${e}`&&(a=`${n}#${i}`,o=!0)}o&&e.setAttribute(r.name,a)}},ql=e=>{let{content:t,preProcessor:n,title:r,description:i,uniquifyIDs:a=!1,uniqueHash:o,baseURL:s=``,width:c,height:l}=e,u=n?n(t):t,d=new DOMParser().parseFromString(u,`image/svg+xml`);if(d.querySelector(`parsererror`))return null;let f=d.querySelector(`svg`);if(!f)return null;if(Gl(f),r!==void 0){let e=f.querySelector(`title`);if(e&&e.remove(),r){let e=d.createElementNS(`http://www.w3.org/2000/svg`,`title`);e.textContent=r,f.prepend(e)}}if(i){let e=f.querySelector(`desc`);e&&e.remove();let t=d.createElementNS(`http://www.w3.org/2000/svg`,`desc`);t.textContent=i;let n=f.querySelector(`title`);n?n.after(t):f.prepend(t)}return c!==void 0&&f.setAttribute(`width`,String(c)),l!==void 0&&f.setAttribute(`height`,String(l)),a&&Kl(f,o||Wl(8),s),new XMLSerializer().serializeToString(f)},Jl=()=>(0,t.useMemo)(()=>({root:(0,l.css)({display:`inline-flex`,lineHeight:0,"& svg":{display:`block`}})}),[]),Yl=t.default.memo(({src:e,cacheRequests:r=!0,title:a,description:o,uniquifyIDs:s=!1,uniqueHash:c,baseURL:l,preProcessor:u,fetchOptions:d,loader:f,children:p,innerRef:m,onLoad:h,onError:g,width:_,height:v,className:y,style:b})=>{let x=Jl(),S=(0,t.useRef)(null),C=(0,t.useRef)(h);C.current=h;let{content:w,status:T,isCached:E}=Ul({src:e,cacheRequests:r,fetchOptions:d,onError:g}),D=(0,t.useMemo)(()=>w?ql({content:w,preProcessor:u,title:a,description:o,uniquifyIDs:s,uniqueHash:c,baseURL:l,width:_,height:v}):null,[w,u,a,o,s,c,l,_,v]);return(0,t.useEffect)(()=>{if(!S.current||!D)return;let e=S.current.querySelector(`svg`);!e||!m||(typeof m==`function`?m(e):m.current=e)},[D,m]),(0,t.useEffect)(()=>{D&&T===`loaded`&&C.current?.(e,E)},[D,T,e,E]),T===`loading`||T===`idle`&&!D?(0,n.jsx)(n.Fragment,{children:f??null}):T===`failed`||T===`unsupported`||!D?(0,n.jsx)(n.Fragment,{children:p??null}):(0,n.jsx)(`div`,{ref:S,className:(0,i.mergeClasses)(x.root,y),style:b,dangerouslySetInnerHTML:{__html:D}})});Yl.displayName=`InlineSVG`;var Xl={numeric:/[^\d]/g,alpha:/[^a-zA-Z]/g,alphanumeric:/[^a-zA-Z0-9]/g},Zl={numeric:`numeric`,alpha:`text`,alphanumeric:`text`,none:`text`},Ql=(e,t,n,r)=>{let i=e.replace(/\s/g,``);return n===`none`?r&&(i=r(i)):i=i.replace(Xl[n],``),i.slice(0,t)},$l=e=>(0,g.atom)({value:e,focusedIndex:-1}),eu=e=>{let{length:n,value:r,defaultValue:i=``,validationType:a,sanitizeValue:o,onChange:s,onComplete:c,disabled:l=!1,readOnly:u=!1}=e,d=r!==void 0,f=(0,t.useRef)(s),p=(0,t.useRef)(c);f.current=s,p.current=c;let m=(0,t.useRef)($l(Ql(i,n,a,o))),h=(0,g.useAtomValue)(m.current),_=(0,g.useSetAtom)(m.current),v=d?Ql(r,n,a,o):h.value,y=(0,t.useRef)([]),b=(0,t.useCallback)(e=>{let t=Math.max(0,Math.min(e,n-1));y.current[t]?.focus(),y.current[t]?.select()},[n]),x=(0,t.useCallback)(e=>{let t=Ql(e,n,a,o);d||_(e=>({...e,value:t})),f.current?.(t),t.length===n&&p.current?.(t)},[n,a,o,d,_]),S=(0,t.useCallback)((e,t)=>{if(l||u)return;let r=t.currentTarget.value,i=Ql(r,n,a,o);if(i===``){x(v.slice(0,e)+v.slice(e+1));return}x(Ql(`${v.slice(0,e)}${i}${v.slice(e+i.length)}`,n,a,o));let s=Math.min(e+i.length,n-1);requestAnimationFrame(()=>b(s))},[v,n,a,o,l,u,x,b]),C=(0,t.useCallback)((e,t)=>{if(l)return;let{key:r}=t;if(r===`Backspace`){if(t.preventDefault(),u)return;(v[e]??``)===``?e>0&&(x(v.slice(0,e-1)+v.slice(e)),b(e-1)):(x(v.slice(0,e)+v.slice(e+1)),b(e));return}if(r===`Delete`){if(t.preventDefault(),u)return;x(v.slice(0,e)+v.slice(e+1));return}if(r===`ArrowLeft`){t.preventDefault(),b(Math.max(0,e-1));return}if(r===`ArrowRight`){t.preventDefault(),b(Math.min(n-1,e+1));return}if(r===`Home`){t.preventDefault(),b(0);return}if(r===`End`){t.preventDefault(),b(Math.max(v.length-1,0));return}},[v,n,l,u,x,b]),w=(0,t.useCallback)((e,t)=>{if(l||u)return;t.preventDefault();let r=Ql(t.clipboardData?.getData(`text/plain`)??``,n,a,o);if(!r)return;x(Ql(`${v.slice(0,e)}${r}`,n,a,o));let i=Math.min(e+r.length,n-1);requestAnimationFrame(()=>b(i))},[v,n,a,o,l,u,x,b]),T=(0,t.useCallback)(e=>{if(e>v.length){b(Math.min(v.length,n-1));return}_(t=>({...t,focusedIndex:e})),y.current[e]?.select()},[v.length,n,b,_]),E=(0,t.useCallback)(()=>{_(e=>({...e,focusedIndex:-1}))},[_]),D=(0,t.useMemo)(()=>Zl[a],[a]);return{value:v,focusedIndex:h.focusedIndex,inputRefs:y,inputMode:D,handleChange:S,handleKeyDown:C,handlePaste:w,handleFocus:T,handleBlur:E,focusSlot:b}},tu=e=>(0,t.useMemo)(()=>({root:(0,l.css)({display:`flex`,flexDirection:`column`,gap:i.tokens.spacingVerticalXS}),inputGroup:(0,l.css)({display:`flex`,alignItems:`center`,gap:e}),input:(0,l.css)({textAlign:`center`,fontFamily:i.tokens.fontFamilyBase,fontWeight:Number(i.tokens.fontWeightSemibold),color:i.tokens.colorNeutralForeground1,backgroundColor:i.tokens.colorNeutralBackground1,border:`1px solid ${i.tokens.colorNeutralStroke1}`,borderRadius:i.tokens.borderRadiusMedium,outline:`none`,transition:`border-color 0.15s ease, box-shadow 0.15s ease`,caretColor:i.tokens.colorBrandForeground1,"&::placeholder":{color:i.tokens.colorNeutralForeground4},"&:hover:not(:disabled)":{borderColor:i.tokens.colorBrandStroke1},"&:focus":{borderColor:i.tokens.colorBrandStroke1,boxShadow:`0 0 0 2px ${i.tokens.colorBrandBackground2}`}}),inputSmall:(0,l.css)({width:32,height:32,fontSize:i.tokens.fontSizeBase300}),inputMedium:(0,l.css)({width:40,height:40,fontSize:i.tokens.fontSizeBase400}),inputLarge:(0,l.css)({width:48,height:48,fontSize:i.tokens.fontSizeBase500}),inputFilled:(0,l.css)({borderColor:i.tokens.colorBrandStroke1}),inputActive:(0,l.css)({borderColor:i.tokens.colorBrandStroke1,boxShadow:`0 0 0 2px ${i.tokens.colorBrandBackground2}`}),inputDisabled:(0,l.css)({backgroundColor:i.tokens.colorNeutralBackgroundDisabled,borderColor:i.tokens.colorNeutralStrokeDisabled,color:i.tokens.colorNeutralForegroundDisabled,cursor:`not-allowed`}),inputError:(0,l.css)({borderColor:i.tokens.colorPaletteRedBorder2,"&:focus":{borderColor:i.tokens.colorPaletteRedBorder2,boxShadow:`0 0 0 2px ${i.tokens.colorPaletteRedBackground2}`}}),inputSuccess:(0,l.css)({borderColor:i.tokens.colorPaletteGreenBorder2,"&:focus":{borderColor:i.tokens.colorPaletteGreenBorder2,boxShadow:`0 0 0 2px ${i.tokens.colorPaletteGreenBackground2}`}}),inputWarning:(0,l.css)({borderColor:i.tokens.colorPaletteYellowBorder2,"&:focus":{borderColor:i.tokens.colorPaletteYellowBorder2,boxShadow:`0 0 0 2px ${i.tokens.colorPaletteYellowBackground2}`}}),separator:(0,l.css)({display:`flex`,alignItems:`center`,justifyContent:`center`,color:i.tokens.colorNeutralForeground3,fontSize:i.tokens.fontSizeBase400,fontWeight:Number(i.tokens.fontWeightSemibold),userSelect:`none`,flexShrink:0,width:12}),label:(0,l.css)({fontSize:i.tokens.fontSizeBase300,fontWeight:Number(i.tokens.fontWeightSemibold),color:i.tokens.colorNeutralForeground1,fontFamily:i.tokens.fontFamilyBase}),message:(0,l.css)({fontSize:i.tokens.fontSizeBase200,fontFamily:i.tokens.fontFamilyBase}),messageError:(0,l.css)({color:i.tokens.colorPaletteRedForeground1}),messageWarning:(0,l.css)({color:i.tokens.colorPaletteYellowForeground2}),messageInfo:(0,l.css)({color:i.tokens.colorNeutralForeground3}),messageSuccess:(0,l.css)({color:i.tokens.colorPaletteGreenForeground1})}),[e]),nu=t.default.memo(({length:e,value:r,defaultValue:a,onChange:o,onComplete:s,validationType:c=`numeric`,sanitizeValue:l,mask:u=!1,autoComplete:d=`one-time-code`,disabled:f=!1,readOnly:p=!1,label:m,message:h,messageType:g,required:_=!1,size:v=`medium`,gap:y=8,separatorAfter:b,separator:x=`–`,placeholder:S=``,className:C,style:w})=>{let T=tu(y),{value:E,focusedIndex:D,inputRefs:O,inputMode:k,handleChange:A,handleKeyDown:j,handlePaste:M,handleFocus:N,handleBlur:ee}=eu({length:e,value:r,defaultValue:a,validationType:c,sanitizeValue:l,onChange:o,onComplete:s,disabled:f,readOnly:p}),P=(0,t.useMemo)(()=>new Set(b??[]),[b]),F=v===`small`?T.inputSmall:v===`large`?T.inputLarge:T.inputMedium,I=g?T[`message${g.charAt(0).toUpperCase()}${g.slice(1)}`]:T.messageInfo,L=g===`error`?T.inputError:g===`success`?T.inputSuccess:g===`warning`?T.inputWarning:void 0,R=(0,t.useMemo)(()=>{let t=[];for(let r=0;r<e;r++){let a=E[r]??``,o=D===r,s=a!==``;t.push((0,n.jsx)(`input`,{ref:e=>{O.current[r]=e},type:u?`password`:`text`,inputMode:k,autoComplete:r===0?d:`off`,autoCorrect:`off`,spellCheck:!1,maxLength:r===0?e:1,tabIndex:r===0||o?0:-1,disabled:f,readOnly:p,required:_,placeholder:S,"aria-label":`Digit ${r+1} of ${e}`,value:a,className:(0,i.mergeClasses)(T.input,F,s&&T.inputFilled,o&&T.inputActive,f&&T.inputDisabled,L),onChange:e=>A(r,e),onKeyDown:e=>j(r,e),onPaste:e=>M(r,e),onFocus:()=>N(r),onBlur:ee},r)),P.has(r)&&t.push((0,n.jsx)(`span`,{className:T.separator,"aria-hidden":!0,children:x},`sep-${r}`))}return t},[e,E,D,u,k,d,f,p,_,S,T,F,L,P,x,A,j,M,N,ee,O]);return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(T.root,C),style:w,role:`group`,"aria-label":m??`One-time password`,children:[m&&(0,n.jsxs)(`label`,{className:T.label,children:[m,_&&(0,n.jsx)(`span`,{"aria-hidden":!0,children:` *`})]}),(0,n.jsx)(`div`,{className:T.inputGroup,children:R}),h&&(0,n.jsx)(`span`,{className:(0,i.mergeClasses)(T.message,I),role:`status`,children:h})]})});nu.displayName=`OTPField`;var ru=e=>{let{template:t}=e;return(0,n.jsx)(n.Fragment,{children:t})},iu=()=>({toolbar:l.css`
363
+ `}},Uc=()=>{let e=Hc();return(0,n.jsxs)(`div`,{className:e.root,role:`status`,"aria-label":`Loading response`,children:[(0,n.jsx)(`div`,{className:`${e.dot} ${e.dot1}`}),(0,n.jsx)(`div`,{className:`${e.dot} ${e.dot2}`}),(0,n.jsx)(`div`,{className:`${e.dot} ${e.dot3}`})]})},Wc=(e,t)=>{switch(t.type){case`INIT`:return{...e,messages:[t.welcomeMessage],isLoading:!1};case`SET_INPUT`:return{...e,inputText:t.inputText};case`ADD_USER_MESSAGE`:return{...e,messages:[...e.messages,t.message]};case`ADD_ASSISTANT_MESSAGE`:return{...e,messages:[...e.messages,t.message]};case`UPDATE_LAST_ASSISTANT_MESSAGE`:{let n=[...e.messages],r=n.length-1;return r>=0&&n[r].senderName===`Assistant`&&(n[r]=t.message),{...e,messages:n}}case`SET_ERROR`:return{...e,error:t.error};case`CLEAR_INPUT`:return{...e,inputText:``};case`SET_IS_RUNNING`:return{...e,isRunning:!e.isRunning};default:return e}},Gc=()=>({markdown:(0,l.css)({fontFamily:i.tokens.fontFamilyBase,fontSize:i.tokens.fontSizeBase300,lineHeight:i.tokens.lineHeightBase300,color:i.tokens.colorNeutralForeground1,"& p":{marginTop:`0`,marginBottom:i.tokens.spacingVerticalM},"& h1, & h2, & h3, & h4, & h5, & h6":{marginTop:i.tokens.spacingVerticalL,marginBottom:i.tokens.spacingVerticalM,fontWeight:i.tokens.fontWeightSemibold},"& h1":{fontSize:i.tokens.fontSizeBase500},"& h2":{fontSize:i.tokens.fontSizeBase400},"& h3":{fontSize:i.tokens.fontSizeBase300},"& ul, & ol":{marginTop:`0`,marginBottom:i.tokens.spacingVerticalM,paddingLeft:i.tokens.spacingHorizontalXXL},"& li":{marginBottom:i.tokens.spacingVerticalXS},"& code":{fontFamily:i.tokens.fontFamilyMonospace,fontSize:i.tokens.fontSizeBase200,backgroundColor:i.tokens.colorNeutralBackground3,padding:`2px 4px`,borderRadius:i.tokens.borderRadiusSmall},"& pre":{backgroundColor:i.tokens.colorNeutralBackground3,padding:i.tokens.spacingVerticalM,borderRadius:i.tokens.borderRadiusMedium,overflowX:`auto`,marginBottom:i.tokens.spacingVerticalM},"& pre code":{backgroundColor:`transparent`,padding:`0`},"& table":{borderCollapse:`collapse`,width:`100%`,marginBottom:i.tokens.spacingVerticalM,border:`1px solid ${i.tokens.colorNeutralStroke1}`},"& thead":{backgroundColor:i.tokens.colorNeutralBackground3},"& th":{padding:i.tokens.spacingVerticalS+` `+i.tokens.spacingHorizontalM,textAlign:`left`,fontWeight:i.tokens.fontWeightSemibold,borderBottom:`2px solid ${i.tokens.colorNeutralStroke1}`,borderRight:`1px solid ${i.tokens.colorNeutralStroke2}`},"& td":{padding:i.tokens.spacingVerticalS+` `+i.tokens.spacingHorizontalM,borderBottom:`1px solid ${i.tokens.colorNeutralStroke2}`,borderRight:`1px solid ${i.tokens.colorNeutralStroke2}`},"& tr:last-child td":{borderBottom:`none`},"& th:last-child, & td:last-child":{borderRight:`none`},"& blockquote":{borderLeft:`4px solid ${i.tokens.colorBrandStroke1}`,paddingLeft:i.tokens.spacingHorizontalM,marginLeft:`0`,marginBottom:i.tokens.spacingVerticalM,color:i.tokens.colorNeutralForeground2},"& a":{color:i.tokens.colorBrandForeground1,textDecoration:`none`,":hover":{textDecoration:`underline`}},"& hr":{border:`none`,borderTop:`1px solid ${i.tokens.colorNeutralStroke2}`,marginTop:i.tokens.spacingVerticalL,marginBottom:i.tokens.spacingVerticalL}})}),Kc=({content:e,className:r})=>{let i=Gc(),[a,o]=t.useState(``);return t.useEffect(()=>{o(new D.default({html:!1,linkify:!0,typographer:!0,breaks:!0}).render(e))},[e]),(0,n.jsx)(`div`,{className:`${i.markdown} ${r||``}`,dangerouslySetInnerHTML:{__html:F.default.sanitize(a)}})},qc=(0,i.makeStyles)({plainText:{fontFamily:i.tokens.fontFamilyBase,fontSize:i.tokens.fontSizeBase300,lineHeight:i.tokens.lineHeightBase300,color:i.tokens.colorNeutralForeground1,whiteSpace:`pre-wrap`,wordBreak:`break-word`},htmlContent:{fontFamily:i.tokens.fontFamilyBase,fontSize:i.tokens.fontSizeBase300,lineHeight:i.tokens.lineHeightBase300,color:i.tokens.colorNeutralForeground1,"& p":{marginTop:`0`,marginBottom:i.tokens.spacingVerticalM},"& h1, & h2, & h3, & h4, & h5, & h6":{marginTop:i.tokens.spacingVerticalL,marginBottom:i.tokens.spacingVerticalM,fontWeight:i.tokens.fontWeightSemibold},"& table":{borderCollapse:`collapse`,width:`100%`,marginBottom:i.tokens.spacingVerticalM},"& th, & td":{border:`1px solid ${i.tokens.colorNeutralStroke1}`,padding:i.tokens.spacingHorizontalS,textAlign:`left`},"& th":{backgroundColor:i.tokens.colorNeutralBackground3,fontWeight:i.tokens.fontWeightSemibold},"& a":{color:i.tokens.colorBrandForegroundLink}},debugBadge:{display:`inline-block`,padding:`${i.tokens.spacingVerticalXS} ${i.tokens.spacingHorizontalS}`,marginBottom:i.tokens.spacingVerticalS,backgroundColor:i.tokens.colorNeutralBackground3,borderRadius:i.tokens.borderRadiusSmall,fontSize:i.tokens.fontSizeBase200,fontFamily:i.tokens.fontFamilyMonospace,color:i.tokens.colorNeutralForeground2},adaptiveCardWrapper:{width:`100%`}}),Jc=({content:e,forceType:r,onTypeDetected:i,context:a,theme:o=Us.SharePoint,fluentTheme:s,onAdaptiveCardAction:c,className:l,debug:u=!1})=>{let d=qc(),{error:f}=z(),[p,m]=t.useState(null);if(t.useEffect(()=>{if(t.isValidElement(e)||typeof e!=`string`&&typeof e!=`object`)return;let n=Je(e);m(n),i&&i(n)},[e,i]),t.isValidElement(e))return(0,n.jsx)(n.Fragment,{children:e});let h=r||p?.type,g=p?.content||e;return(0,n.jsxs)(n.Fragment,{children:[!u||!p?null:(0,n.jsxs)(`div`,{className:d.debugBadge,children:[`Type: `,p.type,` | Confidence: `,(p.confidence*100).toFixed(0),`%`]}),(()=>{switch(h){case He.MARKDOWN:return(0,n.jsx)(Kc,{content:g,className:l});case He.HTML:return(0,n.jsx)(`div`,{className:` ${l||``}`,dangerouslySetInnerHTML:{__html:F.default.sanitize(g)}});case He.ADAPTIVE_CARD:return(0,n.jsx)(`div`,{className:`${d.adaptiveCardWrapper} ${l||``}`,children:(0,n.jsx)(xc,{card:typeof g==`string`?JSON.parse(g):g,context:a,theme:s,themeType:o,onInvokeAction:c||(()=>{}),onError:e=>f(`Adaptive Card Error:`,e instanceof Error?e:void 0)})});case He.PLAIN_TEXT:default:return(0,n.jsx)(`div`,{className:`${d.plainText} ${l||``}`,children:g})}})()]})},Yc=t.forwardRef((e,r)=>{let{messages:a,context:o}=e,s=e=>t.isValidElement(e)?e:typeof e==`string`?e.replace(/\{"status"\s*:\s*"executing"\}/gi,``).replace(/\{'status'\s*:\s*'executing'\}/gi,``).trim():e,c=(0,l.css)({flex:`1 1 0`,overflowY:`auto`,overflowX:`hidden`,padding:`16px`,paddingRight:`25px`,"::-webkit-scrollbar":{width:`6px`},"::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground4,borderRadius:`10px`},"::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandStroke2Hover,borderRadius:`10px`},"::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorNeutralStroke2}}),u=(0,l.css)({display:`flex`,flexDirection:`column`,gap:`10px`,paddingRight:`30px`});return(0,n.jsx)(`div`,{ref:r,className:c,role:`log`,"aria-live":`polite`,"aria-label":`Chat history`,children:(0,n.jsx)(P.Chat,{className:u,children:a.map((e,t)=>e.senderName===`User`?(0,n.jsx)(P.ChatMyMessage,{status:e.status,author:e.senderName,children:s(e.message)},t):(0,n.jsx)(P.ChatMessage,{decoration:e.status===`failed`?`important`:void 0,avatar:(0,n.jsx)(p.Icon,{icon:`carbon:ibm-consulting-advantage-assistant`,width:`32`,height:`32`,"aria-hidden":`true`,style:{color:i.tokens.colorBrandBackground}}),author:e.senderName,children:(0,n.jsx)(Jc,{content:s(e.message),context:o})},t))})})});Yc.displayName=`ChatList`;var Xc=()=>({container:(0,l.css)({display:`flex`,flexDirection:`column`,padding:`10px`,width:`100%`,height:`600px`,borderRadius:`8px`,boxShadow:`0 2px 10px rgba(0, 0, 0, 0.1)`,overflowY:`auto`,overflowX:`hidden`,position:`relative`,zIndex:1e3}),chatList:(0,l.css)({display:`flex`,flexDirection:`column`,gap:`10px`,paddingRight:`30px`,width:`100%`,"::-webkit-scrollbar":{width:`5px`,height:`5px`},"::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground4,borderRadius:`10px`},"::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandStroke2Hover,borderRadius:`10px`},"::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorNeutralStroke2}}),chatAIAssistantRoot:(0,l.css)({padding:`10px`,display:`flex`,flexDirection:`column`,position:`relative`,height:`calc(100% - 20px)`}),inputContainer:(0,l.css)({display:`flex`,flexDirection:`row`,flex:1,marginTop:`10px`,gap:`10px`,alignItems:`center`}),input:(0,l.css)({width:`100%`,fontSize:`14px`}),aiAssistantContainer:(0,l.css)({display:`flex`,flexDirection:`column`,height:`100%`,width:`100%`,boxSizing:`border-box`}),aiAssistantInputContainer:(0,l.css)({flex:`0 0 auto`,padding:`16px`,paddingBottom:`20px`,borderTop:`1px solid ${i.tokens.colorNeutralStroke2}`,backgroundColor:i.tokens.colorNeutralBackground1,boxSizing:`border-box`})}),Zc=(e,t)=>{let{getFormatRelative:n}=we(e,t);return n(new Date)},Qc=r=>{let{instrutions:a,timezone:o,locale:s,onResponse:c,openAIConfig:l,theme:u,placeholder:d,context:f}=r,[p,m]=t.useReducer(Wc,{messages:[],inputText:``,isLoading:!0,error:void 0,isRunning:!1}),{messages:h,inputText:g,isLoading:_,error:v,isRunning:y}=p,b=t.useRef([]),x=t.useRef(null),S=Xc(),C=e.n(),{error:w}=z(),{sendMessage:T,cancelRequest:E}=ue({endpoint:l?.endpoint,mcpServers:l?.mcpServers,requestHeaders:l?.requestHeaders}),D=t.useCallback(()=>{x.current&&(x.current.scrollTop=x.current.scrollHeight-x.current.clientHeight)},[]);t.useEffect(()=>{let e=setTimeout(()=>{D()},100);return()=>clearTimeout(e)},[h,D]),t.useEffect(()=>{m({type:`INIT`,welcomeMessage:{message:`Welcome to AI Assistant! How can I help you today?`,senderName:`Assistant`,timeStamp:Zc(o,f?.pageContext?.cultureInfo?.currentUICultureName||`en-US`),status:`received`}})},[]);let O=t.useCallback(async()=>{if(!g.trim())return;let e={message:g,senderName:`User`,timeStamp:Zc(o,f?.pageContext?.cultureInfo?.currentUICultureName||`en-US`),status:`received`},t=g;m({type:`ADD_USER_MESSAGE`,message:e}),m({type:`CLEAR_INPUT`}),m({type:`SET_IS_RUNNING`});let r={message:(0,n.jsx)(Uc,{}),senderName:`Assistant`,timeStamp:Zc(o,f?.pageContext?.cultureInfo?.currentUICultureName||`en-US`),status:`sending`};m({type:`ADD_ASSISTANT_MESSAGE`,message:r});try{let e=await T({instructions:a,input:t,timezone:o,locale:s,history:b.current,mcpServers:l?.mcpServers});if(c){let{message:t,status:n}=await c(e);m({type:`UPDATE_LAST_ASSISTANT_MESSAGE`,message:{...r,message:t||e,status:n||`received`}})}else m({type:`UPDATE_LAST_ASSISTANT_MESSAGE`,message:{...r,message:e,status:`received`}});m({type:`SET_IS_RUNNING`}),b.current.push(t),b.current.push(e)}catch(e){w(`Error during streaming:`,e instanceof Error?e:void 0);let t=`Error occurred while processing your request.`;e instanceof Error&&(t=e.message.includes(`Rate limit`)||e.message.includes(`429`)?`Rate limit exceeded. Please wait a moment before sending another message.`:e.message.includes(`quota`)?`API quota exceeded. Please try again later.`:e.message.includes(`abort`)?`Request was cancelled.`:e.message),m({type:`UPDATE_LAST_ASSISTANT_MESSAGE`,message:{...r,message:t,status:`failed`}}),m({type:`SET_IS_RUNNING`})}},[g,a,s,c,l,o,T,D,f]),k=t.useCallback(e=>{m({type:`SET_INPUT`,inputText:e})},[]);return _?(0,n.jsx)(i.Spinner,{size:`medium`}):v?(0,n.jsx)(_s,{message:C.processingError,messageType:te.INFO}):(0,n.jsxs)(`div`,{className:S.aiAssistantContainer,children:[(0,n.jsx)(Yc,{ref:x,messages:h,context:f}),(0,n.jsx)(`div`,{className:S.aiAssistantInputContainer,children:(0,n.jsx)(Vc,{context:f,value:g,onChange:k,placeholder:d,onSend:O,onAbort:E,theme:u,isRunning:y})})]})},$c=({context:r,onChange:a,value:o,placeholder:s,onSend:c,theme:l,isRunning:u,onAbort:d})=>{let[f,p]=(0,t.useState)(o||``),[m,h]=(0,t.useState)(!1),g=(0,t.useRef)(null),_=e.n(),[v,y]=(0,t.useState)({top:0,left:0}),[b,x]=(0,t.useState)([]),S=(0,t.useRef)({}),C=Bc(),{warn:w,error:T}=z();t.default.useEffect(()=>{g.current?.focus(),p(o||``)},[o]);let E=async e=>{if(S.current[e])return S.current[e];if(!r?.graphClient)return w(`Graph client not available`),[];try{let t=e&&e.length>0?`/users?$filter=startswith(displayName,'${e}')`:`/users?$orderby=displayName&$top=10`,n=(await r.graphClient.get(t))?.value||[],i=r.pageContext?.web?.absoluteUrl||``;return n.forEach(e=>{i?e.avatar=`${i}/_layouts/15/userphoto.aspx?size=S&accountname=${e.mail}`:e.avatar=`https://graph.microsoft.com/v1.0/users/${e.id}/photo/$value`}),S.current[e]=n,n}catch(e){return T(`Error fetching users from Graph:`,e instanceof Error?e:void 0),[]}},D=(0,t.useCallback)(ke(async e=>{let t=await E(e);t.sort((e,t)=>e.displayName.localeCompare(t.displayName)),x(t),h(!0),setTimeout(()=>{g.current?.focus()},0)},300),[r]),O=async e=>{p(e),a&&a(e),g.current?.focus();let t=e.lastIndexOf(`@`);if(t!==-1&&(t===0||e[t-1]===` `)){await D(e.slice(t+1));let n=g.current;if(n){let e=(0,ee.default)(n,t),r=n.getBoundingClientRect();y({top:r.top+e.top+22,left:r.left+e.left+16})}}else h(!1)},k=e=>{let t=f.replace(/@(\w*)$/,`@${e} `);p(t),a&&a(t),h(!1),x([]),g.current?.focus()},A=(0,t.useCallback)(({users:e})=>(0,n.jsxs)(`div`,{className:C.listContainer,children:[e.length===0&&(0,n.jsx)(i.Caption1,{children:_.noUsersFound}),e.map(e=>(0,n.jsx)(i.Card,{size:`small`,appearance:`subtle`,onMouseDown:e=>e.preventDefault(),onClick:()=>k(e.mail),children:(0,n.jsx)(i.Persona,{name:e.displayName,role:`gridcell`,secondaryText:e.mail,avatar:{image:{src:e.avatar}}})},e.id))]}),[C.listContainer,k]);return(0,n.jsxs)(B,{horizontal:!0,width:`100%`,className:C.inputContainer,children:[(0,n.jsx)(Ic,{ref:g,onSend:c,value:f,onChange:O,theme:l,placeholder:s,isRunning:u,onAbort:d}),(0,n.jsxs)(xt,{theme:l,anchorPoint:v,isOpen:m,onClose:()=>h(!1),excludeRefs:[g],children:[(0,n.jsx)(i.CardHeader,{header:(0,n.jsx)(i.Body1Strong,{className:C.sugestionsHeader,children:`Sugestions`})}),(0,n.jsx)(i.Divider,{}),(0,n.jsx)(A,{users:b})]})]})},el=()=>({inputContainer:(0,l.css)({marginTop:`auto`,marginLeft:`auto`,"::after":{content:`""`,position:`absolute`,bottom:0,left:0,right:0,borderBottom:`2px solid transparent`,pointerEvents:`none`,borderRadius:i.tokens.borderRadiusMedium}}),listContainer:(0,l.css)({maxHeight:`400px`,overflowY:`auto`,overflowX:`hidden`,"::-webkit-scrollbar":{width:`5px`,height:`5px`},"::-webkit-scrollbar-track":{background:i.tokens.colorNeutralBackground4,borderRadius:`10px`},"::-webkit-scrollbar-thumb":{background:i.tokens.colorBrandStroke2Hover,borderRadius:`10px`},"::-webkit-scrollbar-thumb:hover":{background:i.tokens.colorNeutralStroke2}}),sugestionsHeader:(0,l.css)({color:i.tokens.colorBrandBackground})}),tl=e=>{let{width:t,height:n,zoomable:r=!1}=e;return{root:(0,l.css)({position:`relative`,borderRadius:i.tokens.borderRadiusMedium,border:`1px solid ${i.tokens.colorNeutralStroke2}`,width:t??`100%`,height:n??`auto`,...r?{cursor:`grab`}:{}}),svgContainer:(0,l.css)({width:`100%`}),loading:(0,l.css)({color:i.tokens.colorNeutralForeground3,fontFamily:i.tokens.fontFamilyBase,fontSize:i.tokens.fontSizeBase300})}},nl=0,rl=e=>{let[n,r]=t.useState(!1);return t.useEffect(()=>{let t=e.current;if(!t)return;let n=getComputedStyle(t).getPropertyValue(`--colorNeutralBackground1`).trim();if(n&&n.startsWith(`#`)&&n.length>=7){let e=parseInt(n.substring(1,3),16),t=parseInt(n.substring(3,5),16),i=parseInt(n.substring(5,7),16);r(.299*e+.587*t+.114*i<128)}}),n},il=r=>{let{source:a,url:o,theme:s,backgroundColor:c,className:l,styles:u,zoomable:d=!1,onRendered:f,onError:p,loadingContent:m,errorContent:h}=r,g=tl(r),_=t.useRef(null),v=t.useRef(null),y=rl(_),b=s??(y?`dark`:`default`),[x,S]=t.useState(null),[C,w]=t.useState(null),[T,E]=t.useState(!1),[D,O]=t.useState(null),{loading:k,errorMessage:A,noSource:j}=e.g();t.useEffect(()=>{if(a){O(a),w(null);return}if(o){let e=!1;return E(!0),w(null),fetch(o).then(e=>{if(!e.ok)throw Error(`Failed to fetch ${o}: ${e.status} ${e.statusText}`);return e.text()}).then(t=>{e||(O(t),E(!1))}).catch(t=>{if(!e){let e=t instanceof Error?t:Error(String(t));w(e),E(!1),p?.(e)}}),()=>{e=!0}}O(null)},[a,o,p]),t.useEffect(()=>{if(!D){S(null);return}let e=!1,t=`mermaid-diagram-${++nl}`;return I.default.initialize({startOnLoad:!1,theme:b,securityLevel:`loose`,fontFamily:i.tokens.fontFamilyBase,suppressErrorRendering:!0}),I.default.render(t,D).then(({svg:t})=>{e||(S(t),w(null),f?.(t))}).catch(n=>{if(!e){let e=n instanceof Error?n:Error(String(n));w(e),S(null),p?.(e)}document.getElementById(t)?.remove()}),()=>{e=!0,document.getElementById(t)?.remove()}},[D,b,f,p]);let[M,N]=t.useState(1),[ee,P]=t.useState({x:0,y:0}),F=t.useRef(!1),L=t.useRef({x:0,y:0});t.useEffect(()=>{let e=_.current;if(!e||!d)return;let t=e=>{e.preventDefault();let t=e.deltaY>0?-.1:.1;N(e=>Math.min(Math.max(e+t,.25),4))},n=e=>{F.current=!0,L.current={x:e.clientX,y:e.clientY}},r=e=>{if(!F.current)return;let t=e.clientX-L.current.x,n=e.clientY-L.current.y;L.current={x:e.clientX,y:e.clientY},P(e=>({x:e.x+t,y:e.y+n}))},i=()=>{F.current=!1};return e.addEventListener(`wheel`,t,{passive:!1}),e.addEventListener(`mousedown`,n),e.addEventListener(`mousemove`,r),e.addEventListener(`mouseup`,i),e.addEventListener(`mouseleave`,i),()=>{e.removeEventListener(`wheel`,t),e.removeEventListener(`mousedown`,n),e.removeEventListener(`mousemove`,r),e.removeEventListener(`mouseup`,i),e.removeEventListener(`mouseleave`,i)}},[d]),t.useEffect(()=>{N(1),P({x:0,y:0})},[D]),t.useEffect(()=>{let e=v.current;e&&(e.innerHTML=x??``,e.setAttribute(`role`,`img`),e.setAttribute(`aria-label`,`Mermaid diagram`))},[x]);let R=[g.root,l].filter(Boolean).join(` `);if(T)return(0,n.jsx)(H,{className:R,style:u,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,background:c,children:(0,n.jsx)(H,{className:g.loading,alignItems:`center`,justifyContent:`center`,padding:`xxl`,children:m??(0,n.jsx)(Tt,{size:`small`,label:k})})});if(C)return(0,n.jsx)(H,{className:R,style:u,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,background:c,children:h?h(C):(0,n.jsx)(_s,{message:A,messageType:te.ERROR})});if(!x)return(0,n.jsx)(H,{className:R,style:u,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,background:c,children:(0,n.jsx)(H,{className:g.loading,alignItems:`center`,justifyContent:`center`,padding:`xxl`,children:(0,n.jsx)(i.Text,{children:j})})});let ne=d?{transform:`translate(${ee.x}px, ${ee.y}px) scale(${M})`,transformOrigin:`center center`}:void 0;return(0,n.jsx)(H,{ref:_,className:R,style:u,alignItems:`center`,justifyContent:`center`,overflow:d?`auto`:`hidden`,background:c,children:(0,n.jsx)(H,{ref:v,className:g.svgContainer,alignItems:`center`,justifyContent:`center`,style:ne,children:(0,n.jsx)(n.Fragment,{})})})},al={small:i.tokens.borderRadiusSmall,medium:i.tokens.borderRadiusMedium,large:i.tokens.borderRadiusLarge,xLarge:i.tokens.borderRadiusXLarge},ol={brand:{border:i.tokens.colorBrandStroke1,bg:i.tokens.colorBrandBackground2},subtle:{border:i.tokens.colorNeutralStroke1,bg:i.tokens.colorNeutralBackground3},success:{border:i.tokens.colorPaletteGreenBorder2,bg:i.tokens.colorPaletteGreenBackground2},warning:{border:i.tokens.colorPaletteYellowBorder2,bg:i.tokens.colorPaletteYellowBackground2},danger:{border:i.tokens.colorPaletteRedBorder2,bg:i.tokens.colorPaletteRedBackground2},info:{border:i.tokens.colorPaletteBlueBorderActive,bg:i.tokens.colorPaletteBlueBackground2}},sl=e=>ol[e]??{border:e,bg:`transparent`},cl=e=>al[e]??e,ll=(e,n,r)=>{let{border:a,bg:o}=sl(e),s=cl(n),c=r/-2;return{root:(0,t.useMemo)(()=>(0,l.css)({position:`relative`,margin:0,borderInlineStart:`3px solid ${a}`,borderStartEndRadius:s,borderEndEndRadius:s,backgroundColor:o,padding:`${i.tokens.spacingVerticalXL} ${i.tokens.spacingHorizontalXXL}`,fontFamily:i.tokens.fontFamilyBase,fontSize:i.tokens.fontSizeBase300,lineHeight:i.tokens.lineHeightBase300,color:i.tokens.colorNeutralForeground1}),[a,s,o]),icon:(0,t.useMemo)(()=>(0,l.css)({position:`absolute`,color:a,backgroundColor:i.tokens.colorNeutralBackground1,display:`flex`,alignItems:`center`,justifyContent:`center`,top:c,insetInlineStart:c,width:r,height:r,borderRadius:`50%`}),[a,c,r]),cite:(0,t.useMemo)(()=>(0,l.css)({display:`block`,marginTop:i.tokens.spacingVerticalM,opacity:.6,fontSize:i.tokens.fontSizeBase200,lineHeight:i.tokens.lineHeightBase200,fontStyle:`normal`}),[])}},ul=48,dl=`brand`,fl=`medium`,pl=(0,t.memo)(({icon:e,iconSize:t=ul,color:r=dl,radius:a=fl,cite:o,className:s,style:c,children:l})=>{let u=ll(r,a,t);return(0,n.jsxs)(`blockquote`,{className:(0,i.mergeClasses)(u.root,s),style:c,role:`blockquote`,children:[e&&(0,n.jsx)(`span`,{className:u.icon,"aria-hidden":`true`,children:e}),l,o&&(0,n.jsx)(`cite`,{className:u.cite,children:o})]})});pl.displayName=`Blockquote`;var ml={spacingHorizontalXS:i.tokens.spacingHorizontalXS,spacingHorizontalS:i.tokens.spacingHorizontalS,spacingHorizontalM:i.tokens.spacingHorizontalM,spacingHorizontalL:i.tokens.spacingHorizontalL,spacingHorizontalXL:i.tokens.spacingHorizontalXL,spacingHorizontalXXL:i.tokens.spacingHorizontalXXL},hl=e=>ml[e]??e,gl=(e,n,r,i,a,o,s,c,u)=>{let d=hl(o),f=e===`horizontal`,p=(0,t.useMemo)(()=>(0,l.keyframes)({from:{transform:f?`translateX(0)`:`translateY(0)`},to:{transform:f?`translateX(calc(-100% / ${i} - ${d} / ${i}))`:`translateY(calc(-100% / ${i} - ${d} / ${i}))`}}),[f,i,d]);return{root:(0,t.useMemo)(()=>(0,l.css)({position:`relative`,overflow:`hidden`,display:`flex`,flexDirection:f?`row`:`column`,maxHeight:`100%`,maxWidth:`100%`,...s&&{"&::before, &::after":{content:`""`,position:`absolute`,zIndex:1,pointerEvents:`none`},...f?{"&::before":{top:0,bottom:0,left:0,width:u,background:`linear-gradient(to right, ${c}, transparent)`},"&::after":{top:0,bottom:0,right:0,width:u,background:`linear-gradient(to left, ${c}, transparent)`}}:{"&::before":{left:0,right:0,top:0,height:u,background:`linear-gradient(to bottom, ${c}, transparent)`},"&::after":{left:0,right:0,bottom:0,height:u,background:`linear-gradient(to top, ${c}, transparent)`}}}}),[f,s,c,u]),content:(0,t.useMemo)(()=>(0,l.css)({display:`flex`,flexDirection:f?`row`:`column`,gap:d,animation:`${p} ${a}ms linear infinite`,animationDirection:n?`reverse`:`normal`,...r&&{"*:hover > &":{animationPlayState:`paused`}}}),[f,d,p,a,n,r]),group:(0,t.useMemo)(()=>(0,l.css)({display:`flex`,flexShrink:0,flexDirection:f?`row`:`column`,gap:d}),[f,d])}},_l=4,vl=1e5,yl=`spacingHorizontalM`,bl=`5%`,xl=(0,t.memo)(({children:e,orientation:r=`horizontal`,reverse:a=!1,pauseOnHover:o=!1,repeat:s=_l,duration:c=vl,gap:l=yl,fadeEdges:u=!0,fadeEdgeColor:d=i.tokens.colorNeutralBackground1,fadeEdgeSize:f=bl,className:p,style:m})=>{let h=gl(r,a,o,s,c,l,u,d,f),g=(0,t.useMemo)(()=>Array.from({length:s},(t,r)=>(0,n.jsx)(`div`,{className:h.group,...r>0?{"aria-hidden":!0}:{},children:e},r)),[s,e,h.group]);return(0,n.jsx)(`div`,{className:(0,i.mergeClasses)(h.root,p),style:m,role:`marquee`,"aria-live":`off`,children:(0,n.jsx)(`div`,{className:h.content,children:g})})});xl.displayName=`Marquee`;var Sl=e=>{let{maxHeight:n,expanded:r,contentHeight:a,hasSpoiler:o,transitionDuration:s}=e;return(0,t.useMemo)(()=>({root:(0,l.css)({position:`relative`,...o&&{marginBottom:28}}),content:(0,l.css)({display:`flex`,flexDirection:`column`,overflow:`hidden`,maxHeight:r?a>0?a:void 0:n,transition:`max-height ${s}ms ease`}),control:(0,l.css)({position:`absolute`,insetInlineStart:0,top:`100%`,height:28,padding:0,fontWeight:Number(i.tokens.fontWeightSemibold)})}),[n,r,a,o,s])},Cl=()=>{let e=(0,t.useRef)(null),[n,r]=(0,t.useState)(0);return(0,t.useEffect)(()=>{if(!e.current)return;let t=new ResizeObserver(([e])=>{r(e.contentRect.height)});return t.observe(e.current),()=>t.disconnect()},[]),{ref:e,height:n}},wl=t.default.memo(({children:e,maxHeight:r=100,showLabel:a,hideLabel:o,defaultExpanded:s=!1,expanded:c,onExpandedChange:l,transitionDuration:u=200,showAriaLabel:d,hideAriaLabel:f,controlRef:p,className:m,style:h})=>{let g=(0,t.useId)(),_=`${g}-region`,{ref:v,height:y}=Cl(),b=c!==void 0,[x,S]=(0,t.useState)(s),C=b?c:x,w=r<y,T=Sl({maxHeight:r,expanded:C,contentHeight:y,hasSpoiler:w,transitionDuration:u}),E=(0,t.useCallback)(()=>{let e=!C;b||S(e),l?.(e)},[C,b,l]),D=C?f:d;return(0,n.jsxs)(`div`,{id:g,className:(0,i.mergeClasses)(T.root,m),style:h,children:[w&&(0,n.jsx)(i.Link,{ref:p,className:T.control,onClick:E,"aria-expanded":C,"aria-controls":_,...D?{"aria-label":D}:{},children:C?o:a}),(0,n.jsx)(`div`,{className:T.content,role:`region`,id:_,children:(0,n.jsx)(`div`,{ref:v,children:e})})]})});wl.displayName=`Spoiler`;var Tl={none:`0`,small:i.tokens.borderRadiusSmall,medium:i.tokens.borderRadiusMedium,large:i.tokens.borderRadiusLarge,xLarge:i.tokens.borderRadiusXLarge,circular:i.tokens.borderRadiusCircular},El=(e,n)=>(0,t.useMemo)(()=>{let t=Tl[n]??n;return{root:(0,l.css)({backgroundImage:`url(${CSS.escape?CSS.escape(e):e})`,backgroundSize:`cover`,backgroundPosition:`center`,display:`block`,width:`100%`,border:0,textDecoration:`none`,borderRadius:t})}},[e,n]),Dl=t.default.memo(({src:e,children:t,radius:r=`none`,className:a,style:o})=>(0,n.jsx)(`div`,{className:(0,i.mergeClasses)(El(e,r).root,a),style:o,role:`img`,"aria-label":e,children:t}));Dl.displayName=`BackgroundImage`;var Ol=({bulletSize:e,lineWidth:n,align:r})=>(0,t.useMemo)(()=>{let t=e/2+n/2;return{root:(0,l.css)({position:`relative`,...r===`left`&&{paddingInlineStart:t},...r===`right`&&{paddingInlineEnd:t}})}},[e,n,r]),kl=e=>{let{bulletSize:n,lineWidth:r,align:a,active:o,lineActive:s,isLast:c,isFirst:u,color:d,lineVariant:f,hasBulletContent:p}=e;return(0,t.useMemo)(()=>{let e=n/2+r/2,t=d||i.tokens.colorBrandForeground1,m=i.tokens.colorNeutralStroke1;return{item:(0,l.css)({position:`relative`,color:i.tokens.colorNeutralForeground1,...!u&&{marginTop:i.tokens.spacingVerticalXL},...!c&&{"&::before":{content:`""`,position:`absolute`,top:0,bottom:`calc(${i.tokens.spacingVerticalXL} * -1)`,pointerEvents:`none`,borderInlineStart:`${r}px ${f} ${s?t:m}`,...a===`left`&&{insetInlineStart:-r,insetInlineEnd:`auto`},...a===`right`&&{insetInlineStart:`auto`,insetInlineEnd:-r}}}}),bullet:(0,l.css)({width:n,height:n,borderRadius:`50%`,border:`${r}px solid ${o?t:m}`,backgroundColor:o?p?t:i.tokens.colorNeutralBackground1:p?i.tokens.colorNeutralStroke2:i.tokens.colorNeutralBackground1,position:`absolute`,top:0,display:`flex`,alignItems:`center`,justifyContent:`center`,color:o?i.tokens.colorNeutralForegroundOnBrand:i.tokens.colorNeutralForeground2,boxSizing:`border-box`,...a===`left`&&{insetInlineStart:-(n/2+r/2)},...a===`right`&&{insetInlineEnd:-(n/2+r/2)}}),body:(0,l.css)({...a===`left`&&{paddingInlineStart:e+8,textAlign:`left`},...a===`right`&&{paddingInlineEnd:e+8,textAlign:`right`}}),title:(0,l.css)({lineHeight:`1 !important`,marginBottom:i.tokens.spacingVerticalXXS,"& span":{lineHeight:`1 !important`}})}},[n,r,a,o,s,c,u,d,f,p])},Al=t.default.memo(({title:e,children:t,bullet:r,color:a,lineVariant:o=`solid`,active:s,lineActive:c,__active:l,__lineActive:u,__align:d=`left`,__bulletSize:f=16,__lineWidth:p=2,__color:m,__isFirst:h=!1,__isLast:g=!1,className:_,style:v})=>{let y=kl({bulletSize:f,lineWidth:p,align:d,active:s??l??!1,lineActive:c??u??!1,isLast:g,isFirst:h,color:a||m,lineVariant:o,hasBulletContent:!!r});return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(y.item,_),style:v,children:[(0,n.jsx)(`div`,{className:y.bullet,children:r}),(0,n.jsxs)(`div`,{className:y.body,children:[e&&(0,n.jsx)(i.Text,{block:!0,weight:`semibold`,size:300,className:y.title,children:e}),t]})]})});Al.displayName=`TimelineItem`;var jl=t.default.memo(({children:e,active:r=-1,color:a,bulletSize:o=16,lineWidth:s=2,align:c=`left`,reverseActive:l=!1,className:u,style:d})=>{let f=Ol({bulletSize:o,lineWidth:s,align:c}),p=t.Children.toArray(e),m=p.map((e,n)=>{if(!t.default.isValidElement(e))return e;let i=e.props,u=l?r>=p.length-n-1:r>=n,d=l?r>=p.length-n-1:r-1>=n;return(0,t.cloneElement)(e,{__active:i.active===void 0?u:i.active,__lineActive:i.lineActive===void 0?d:i.lineActive,__align:c,__bulletSize:o,__lineWidth:s,__color:a,__isFirst:n===0,__isLast:n===p.length-1})});return(0,n.jsx)(`div`,{className:(0,i.mergeClasses)(f.root,u),style:d,children:m})});jl.displayName=`Timeline`;var Ml=Object.assign(jl,{Item:Al}),Nl=({orientation:e,iconSize:n,iconPosition:r})=>(0,t.useMemo)(()=>({root:(0,l.css)({display:`flex`,flexDirection:`column`}),steps:(0,l.css)({display:`flex`,flexDirection:e===`horizontal`?`row`:`column`,alignItems:e===`horizontal`?`flex-start`:void 0,gap:0}),content:(0,l.css)({paddingTop:i.tokens.spacingVerticalL})}),[e,n,r]),Pl=e=>{let{iconSize:n,state:r,color:a,orientation:o,iconPosition:s,allowClick:c,isLast:u,separatorActive:d}=e;return(0,t.useMemo)(()=>{let e=a||i.tokens.colorBrandForeground1,t=i.tokens.colorNeutralStroke1;return{step:(0,l.css)({cursor:c?`pointer`:`default`,...o===`horizontal`&&{display:`grid`,gridTemplateColumns:u?`${n}px`:`${n}px 1fr`,gridTemplateRows:`auto auto`,flex:u?`0 0 auto`:`1 1 0`},...o===`vertical`&&{display:`flex`,flexDirection:s===`right`?`row-reverse`:`row`,gap:i.tokens.spacingHorizontalS,alignItems:`flex-start`},"&:focus-visible":{outline:`2px solid ${i.tokens.colorStrokeFocus2}`,outlineOffset:2,borderRadius:i.tokens.borderRadiusMedium}}),stepHeader:(0,l.css)({...o===`horizontal`&&{display:`contents`},...o===`vertical`&&{display:`flex`,flexDirection:`column`,alignItems:`center`}}),stepIcon:(0,l.css)({width:n,height:n,minWidth:n,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontWeight:i.tokens.fontWeightBold,fontSize:n*.36,boxSizing:`border-box`,flexShrink:0,transition:`background-color 150ms ease, border-color 150ms ease, color 150ms ease`,...o===`horizontal`&&{gridColumn:1,gridRow:1},...r===`stepCompleted`&&{backgroundColor:e,border:`2px solid ${e}`,color:i.tokens.colorNeutralForegroundOnBrand},...r===`stepProgress`&&{backgroundColor:i.tokens.colorNeutralBackground1,border:`2px solid ${e}`,color:e},...r===`stepInactive`&&{backgroundColor:i.tokens.colorNeutralBackground1,border:`2px solid ${t}`,color:i.tokens.colorNeutralForeground3}}),separator:(0,l.css)({transition:`background-color 150ms ease`,backgroundColor:d?e:t,...o===`horizontal`&&{gridColumn:2,gridRow:1,alignSelf:`center`,height:2,marginInline:i.tokens.spacingHorizontalS},...o===`vertical`&&{flex:1,width:2,minHeight:i.tokens.spacingVerticalL,marginBlock:i.tokens.spacingVerticalXXS}}),stepBody:(0,l.css)({display:`flex`,flexDirection:`column`,...o===`horizontal`&&{gridColumn:1,gridRow:2,alignItems:`center`,justifySelf:`center`,width:`max-content`,textAlign:`center`,whiteSpace:`nowrap`,marginTop:i.tokens.spacingVerticalXS},...o===`vertical`&&{paddingTop:2}}),stepLabel:(0,l.css)({lineHeight:1.3}),stepDescription:(0,l.css)({marginTop:i.tokens.spacingVerticalXXS})}},[n,r,a,o,s,c,u,d])},Fl=t.default.memo(({label:e,description:r,icon:a,completedIcon:o,progressIcon:s,color:c,withIcon:l=!0,allowStepSelect:u=!0,loading:f=!1,children:p,className:m,style:h,__step:g=0,__state:_=`stepInactive`,__color:v,__iconSize:y=34,__orientation:b=`horizontal`,__iconPosition:x=`left`,__completedIcon:S,__progressIcon:C,__allowClick:w=!1,__onStepClick:T,__isLast:E=!1,__separatorActive:D=!1})=>{let O=c||v,k=w&&u,A=Pl({iconSize:y,state:_,color:O,orientation:b,iconPosition:x,allowClick:k,isLast:E,separatorActive:D}),j=t.default.useCallback(()=>{k&&T&&T(g)},[k,T,g]),M=t.default.useCallback(e=>{(e.key===`Enter`||e.key===` `)&&k&&T&&(e.preventDefault(),T(g))},[k,T,g]),N=()=>l?f?(0,n.jsx)(i.Spinner,{size:`tiny`}):_===`stepCompleted`?o||S||(0,n.jsx)(d.Checkmark12Regular,{}):_===`stepProgress`&&(s||C)?s||C:a||(0,n.jsx)(i.Text,{size:200,weight:`bold`,children:g+1}):null;return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(A.step,m),style:h,onClick:j,onKeyDown:M,...k?{role:`button`}:{},tabIndex:k?0:void 0,...k?{"aria-label":typeof e==`string`?`Step ${g+1}: ${e}`:`Step ${g+1}`}:{},children:[(0,n.jsxs)(`div`,{className:A.stepHeader,children:[(0,n.jsx)(`div`,{className:A.stepIcon,children:N()}),!E&&(0,n.jsx)(`div`,{className:A.separator})]}),(e||r)&&(0,n.jsxs)(`div`,{className:A.stepBody,children:[e&&(0,n.jsx)(i.Text,{weight:`semibold`,size:300,className:A.stepLabel,children:e}),r&&(0,n.jsx)(i.Text,{size:200,className:A.stepDescription,children:r})]})]})});Fl.displayName=`StepperStep`;var Il=e=>null;Il.displayName=`StepperCompleted`;var Ll=t.default.memo(({children:e,active:r,onStepClick:a,color:o,iconSize:s=34,orientation:c=`horizontal`,iconPosition:l=`left`,allowNextStepsSelect:u=!0,completedIcon:d,progressIcon:f,className:p,style:m})=>{let h=Nl({orientation:c,iconSize:s,iconPosition:l}),{stepElements:g,completedContent:_,activeStepContent:v}=(0,t.useMemo)(()=>{let n=[],i=null,p=null,m=0;return t.Children.forEach(e,e=>{if(!t.default.isValidElement(e))return;if(e.type?.displayName===`StepperCompleted`){i=e.props.children;return}let h=m,g=h<r?`stepCompleted`:h===r?`stepProgress`:`stepInactive`,_=(0,t.cloneElement)(e,{__step:h,__state:g,__color:o,__iconSize:s,__orientation:c,__iconPosition:l,__completedIcon:d,__progressIcon:f,__allowClick:!!a&&(g===`stepCompleted`||u&&g===`stepInactive`||g===`stepProgress`),__onStepClick:a,__isLast:!1,__separatorActive:h<r}),v=e.props;h===r&&v.children&&(p=v.children),n.push(_),m++}),{stepElements:n,completedContent:i,activeStepContent:p}},[e,r,a,o,s,c,l,u,d,f]),y=(0,t.useMemo)(()=>g.length===0?g:g.map((e,n)=>n===g.length-1&&t.default.isValidElement(e)?(0,t.cloneElement)(e,{__isLast:!0}):e),[g]),b=r>=g.length&&_;return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(h.root,p),style:m,children:[(0,n.jsx)(`div`,{className:h.steps,role:`group`,"aria-label":`Progress steps`,children:y}),(b||v)&&(0,n.jsx)(`div`,{className:h.content,children:b?_:v})]})});Ll.displayName=`Stepper`;var Rl=Object.assign(Ll,{Step:Fl,Completed:Il}),zl={content:``,isCached:!1,status:`idle`},Bl=()=>(0,g.atom)(zl),Vl=new Map,Hl=()=>{Vl.clear()},Ul=({src:e,cacheRequests:n,fetchOptions:r,onError:i})=>{let a=(0,t.useRef)(i),o=(0,t.useRef)(r);a.current=i,o.current=r;let s=(0,t.useRef)(Bl()),c=(0,g.useAtomValue)(s.current),l=(0,g.useSetAtom)(s.current);return(0,t.useEffect)(()=>{if(typeof window>`u`){l({content:``,isCached:!1,status:`unsupported`});return}if(!e){l({content:``,isCached:!1,status:`failed`}),a.current?.(Error(`Missing src`));return}let t=/^data:image\/svg[^,]*?(;base64)?,(.*)/.exec(e);if(t){try{l({content:t[1]?window.atob(t[2]):decodeURIComponent(t[2]),isCached:!1,status:`loaded`})}catch{l({content:``,isCached:!1,status:`failed`}),a.current?.(Error(`Invalid data URI`))}return}if(e.includes(`<svg`)){l({content:e,isCached:!1,status:`loaded`});return}if(n&&Vl.has(e)){l({content:Vl.get(e),isCached:!0,status:`loaded`});return}l({content:``,isCached:!1,status:`loading`});let r=new AbortController;return fetch(e,{...o.current,signal:r.signal}).then(async t=>{if(!t.ok)throw Error(`Failed to fetch SVG: ${t.status}`);let[r]=(t.headers.get(`content-type`)??``).split(/ ?; ?/);if(r&&![`image/svg+xml`,`text/plain`,`application/xml`].some(e=>r.includes(e)))throw Error(`Invalid content type: ${r}`);let i=await t.text();n&&Vl.set(e,i),l({content:i,isCached:!1,status:`loaded`})}).catch(e=>{e.name!==`AbortError`&&(l({content:``,isCached:!1,status:`failed`}),a.current?.(e))}),()=>r.abort()},[e,n]),c},Wl=e=>{let t=``;for(let n=0;n<e;n++)t+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`.charAt(Math.floor(Math.random()*62));return t},Gl=e=>{e.querySelectorAll(`script`).forEach(e=>e.remove()),e.querySelectorAll(`foreignObject`).forEach(e=>e.remove());let t=[e,...Array.from(e.querySelectorAll(`*`))];for(let e of t)for(let t of Array.from(e.attributes))(/^on/i.test(t.name)||/^\s*javascript\s*:/i.test(t.value))&&e.removeAttribute(t.name)},Kl=(e,t,n)=>{let r=[...new XMLSerializer().serializeToString(e).matchAll(/\bid=["']([^"']+)["']/g)],i=[...new Set(r.map(e=>e[1]))];if(!i.length)return;i.sort((e,t)=>t.length-e.length);let a=[e,...Array.from(e.querySelectorAll(`*`))];for(let e of a)for(let r of Array.from(e.attributes)){let a=r.value,o=!1;for(let e of i){let i=`${e}__${t}`,s=e.replace(/[$()*+.?[\\\]^{|}]/g,`\\$&`);r.name===`id`&&a===e&&(a=i,o=!0);let c=RegExp(`url\\((['"]?)#${s}\\1\\)`,`g`);c.test(a)&&(a=a.replace(c,`url($1${n}#${i}$1)`),o=!0),[`href`,`xlink:href`].includes(r.name)&&a===`#${e}`&&(a=`${n}#${i}`,o=!0)}o&&e.setAttribute(r.name,a)}},ql=e=>{let{content:t,preProcessor:n,title:r,description:i,uniquifyIDs:a=!1,uniqueHash:o,baseURL:s=``,width:c,height:l}=e,u=n?n(t):t,d=new DOMParser().parseFromString(u,`image/svg+xml`);if(d.querySelector(`parsererror`))return null;let f=d.querySelector(`svg`);if(!f)return null;if(Gl(f),r!==void 0){let e=f.querySelector(`title`);if(e&&e.remove(),r){let e=d.createElementNS(`http://www.w3.org/2000/svg`,`title`);e.textContent=r,f.prepend(e)}}if(i){let e=f.querySelector(`desc`);e&&e.remove();let t=d.createElementNS(`http://www.w3.org/2000/svg`,`desc`);t.textContent=i;let n=f.querySelector(`title`);n?n.after(t):f.prepend(t)}return c!==void 0&&f.setAttribute(`width`,String(c)),l!==void 0&&f.setAttribute(`height`,String(l)),a&&Kl(f,o||Wl(8),s),new XMLSerializer().serializeToString(f)},Jl=()=>(0,t.useMemo)(()=>({root:(0,l.css)({display:`inline-flex`,lineHeight:0,"& svg":{display:`block`}})}),[]),Yl=t.default.memo(({src:e,cacheRequests:r=!0,title:a,description:o,uniquifyIDs:s=!1,uniqueHash:c,baseURL:l,preProcessor:u,fetchOptions:d,loader:f,children:p,innerRef:m,onLoad:h,onError:g,width:_,height:v,className:y,style:b})=>{let x=Jl(),S=(0,t.useRef)(null),C=(0,t.useRef)(h);C.current=h;let{content:w,status:T,isCached:E}=Ul({src:e,cacheRequests:r,fetchOptions:d,onError:g}),D=(0,t.useMemo)(()=>w?ql({content:w,preProcessor:u,title:a,description:o,uniquifyIDs:s,uniqueHash:c,baseURL:l,width:_,height:v}):null,[w,u,a,o,s,c,l,_,v]);return(0,t.useEffect)(()=>{if(!S.current||!D)return;let e=S.current.querySelector(`svg`);!e||!m||(typeof m==`function`?m(e):m.current=e)},[D,m]),(0,t.useEffect)(()=>{D&&T===`loaded`&&C.current?.(e,E)},[D,T,e,E]),T===`loading`||T===`idle`&&!D?(0,n.jsx)(n.Fragment,{children:f??null}):T===`failed`||T===`unsupported`||!D?(0,n.jsx)(n.Fragment,{children:p??null}):(0,n.jsx)(`div`,{ref:S,className:(0,i.mergeClasses)(x.root,y),style:b,dangerouslySetInnerHTML:{__html:D}})});Yl.displayName=`InlineSVG`;var Xl={numeric:/[^\d]/g,alpha:/[^a-zA-Z]/g,alphanumeric:/[^a-zA-Z0-9]/g},Zl={numeric:`numeric`,alpha:`text`,alphanumeric:`text`,none:`text`},Ql=(e,t,n,r)=>{let i=e.replace(/\s/g,``);return n===`none`?r&&(i=r(i)):i=i.replace(Xl[n],``),i.slice(0,t)},$l=e=>(0,g.atom)({value:e,focusedIndex:-1}),eu=e=>{let{length:n,value:r,defaultValue:i=``,validationType:a,sanitizeValue:o,onChange:s,onComplete:c,disabled:l=!1,readOnly:u=!1}=e,d=r!==void 0,f=(0,t.useRef)(s),p=(0,t.useRef)(c);f.current=s,p.current=c;let m=(0,t.useRef)($l(Ql(i,n,a,o))),h=(0,g.useAtomValue)(m.current),_=(0,g.useSetAtom)(m.current),v=d?Ql(r,n,a,o):h.value,y=(0,t.useRef)([]),b=(0,t.useCallback)(e=>{let t=Math.max(0,Math.min(e,n-1));y.current[t]?.focus(),y.current[t]?.select()},[n]),x=(0,t.useCallback)(e=>{let t=Ql(e,n,a,o);d||_(e=>({...e,value:t})),f.current?.(t),t.length===n&&p.current?.(t)},[n,a,o,d,_]),S=(0,t.useCallback)((e,t)=>{if(l||u)return;let r=t.currentTarget.value,i=Ql(r,n,a,o);if(i===``){x(v.slice(0,e)+v.slice(e+1));return}x(Ql(`${v.slice(0,e)}${i}${v.slice(e+i.length)}`,n,a,o));let s=Math.min(e+i.length,n-1);requestAnimationFrame(()=>b(s))},[v,n,a,o,l,u,x,b]),C=(0,t.useCallback)((e,t)=>{if(l)return;let{key:r}=t;if(r===`Backspace`){if(t.preventDefault(),u)return;(v[e]??``)===``?e>0&&(x(v.slice(0,e-1)+v.slice(e)),b(e-1)):(x(v.slice(0,e)+v.slice(e+1)),b(e));return}if(r===`Delete`){if(t.preventDefault(),u)return;x(v.slice(0,e)+v.slice(e+1));return}if(r===`ArrowLeft`){t.preventDefault(),b(Math.max(0,e-1));return}if(r===`ArrowRight`){t.preventDefault(),b(Math.min(n-1,e+1));return}if(r===`Home`){t.preventDefault(),b(0);return}if(r===`End`){t.preventDefault(),b(Math.max(v.length-1,0));return}},[v,n,l,u,x,b]),w=(0,t.useCallback)((e,t)=>{if(l||u)return;t.preventDefault();let r=Ql(t.clipboardData?.getData(`text/plain`)??``,n,a,o);if(!r)return;x(Ql(`${v.slice(0,e)}${r}`,n,a,o));let i=Math.min(e+r.length,n-1);requestAnimationFrame(()=>b(i))},[v,n,a,o,l,u,x,b]),T=(0,t.useCallback)(e=>{if(e>v.length){b(Math.min(v.length,n-1));return}_(t=>({...t,focusedIndex:e})),y.current[e]?.select()},[v.length,n,b,_]),E=(0,t.useCallback)(()=>{_(e=>({...e,focusedIndex:-1}))},[_]),D=(0,t.useMemo)(()=>Zl[a],[a]);return{value:v,focusedIndex:h.focusedIndex,inputRefs:y,inputMode:D,handleChange:S,handleKeyDown:C,handlePaste:w,handleFocus:T,handleBlur:E,focusSlot:b}},tu=e=>(0,t.useMemo)(()=>({root:(0,l.css)({display:`flex`,flexDirection:`column`,gap:i.tokens.spacingVerticalXS}),inputGroup:(0,l.css)({display:`flex`,alignItems:`center`,gap:e}),input:(0,l.css)({textAlign:`center`,fontFamily:i.tokens.fontFamilyBase,fontWeight:Number(i.tokens.fontWeightSemibold),color:i.tokens.colorNeutralForeground1,backgroundColor:i.tokens.colorNeutralBackground1,border:`1px solid ${i.tokens.colorNeutralStroke1}`,borderRadius:i.tokens.borderRadiusMedium,outline:`none`,transition:`border-color 0.15s ease, box-shadow 0.15s ease`,caretColor:i.tokens.colorBrandForeground1,"&::placeholder":{color:i.tokens.colorNeutralForeground4},"&:hover:not(:disabled)":{borderColor:i.tokens.colorBrandStroke1},"&:focus":{borderColor:i.tokens.colorBrandStroke1,boxShadow:`0 0 0 2px ${i.tokens.colorBrandBackground2}`}}),inputSmall:(0,l.css)({width:32,height:32,fontSize:i.tokens.fontSizeBase300}),inputMedium:(0,l.css)({width:40,height:40,fontSize:i.tokens.fontSizeBase400}),inputLarge:(0,l.css)({width:48,height:48,fontSize:i.tokens.fontSizeBase500}),inputFilled:(0,l.css)({borderColor:i.tokens.colorBrandStroke1}),inputActive:(0,l.css)({borderColor:i.tokens.colorBrandStroke1,boxShadow:`0 0 0 2px ${i.tokens.colorBrandBackground2}`}),inputDisabled:(0,l.css)({backgroundColor:i.tokens.colorNeutralBackgroundDisabled,borderColor:i.tokens.colorNeutralStrokeDisabled,color:i.tokens.colorNeutralForegroundDisabled,cursor:`not-allowed`}),inputError:(0,l.css)({borderColor:i.tokens.colorPaletteRedBorder2,"&:focus":{borderColor:i.tokens.colorPaletteRedBorder2,boxShadow:`0 0 0 2px ${i.tokens.colorPaletteRedBackground2}`}}),inputSuccess:(0,l.css)({borderColor:i.tokens.colorPaletteGreenBorder2,"&:focus":{borderColor:i.tokens.colorPaletteGreenBorder2,boxShadow:`0 0 0 2px ${i.tokens.colorPaletteGreenBackground2}`}}),inputWarning:(0,l.css)({borderColor:i.tokens.colorPaletteYellowBorder2,"&:focus":{borderColor:i.tokens.colorPaletteYellowBorder2,boxShadow:`0 0 0 2px ${i.tokens.colorPaletteYellowBackground2}`}}),separator:(0,l.css)({display:`flex`,alignItems:`center`,justifyContent:`center`,color:i.tokens.colorNeutralForeground3,fontSize:i.tokens.fontSizeBase400,fontWeight:Number(i.tokens.fontWeightSemibold),userSelect:`none`,flexShrink:0,width:12}),label:(0,l.css)({fontSize:i.tokens.fontSizeBase300,fontWeight:Number(i.tokens.fontWeightSemibold),color:i.tokens.colorNeutralForeground1,fontFamily:i.tokens.fontFamilyBase}),message:(0,l.css)({fontSize:i.tokens.fontSizeBase200,fontFamily:i.tokens.fontFamilyBase}),messageError:(0,l.css)({color:i.tokens.colorPaletteRedForeground1}),messageWarning:(0,l.css)({color:i.tokens.colorPaletteYellowForeground2}),messageInfo:(0,l.css)({color:i.tokens.colorNeutralForeground3}),messageSuccess:(0,l.css)({color:i.tokens.colorPaletteGreenForeground1})}),[e]),nu=t.default.memo(({length:e,value:r,defaultValue:a,onChange:o,onComplete:s,validationType:c=`numeric`,sanitizeValue:l,mask:u=!1,autoComplete:d=`one-time-code`,disabled:f=!1,readOnly:p=!1,label:m,message:h,messageType:g,required:_=!1,size:v=`medium`,gap:y=8,separatorAfter:b,separator:x=`–`,placeholder:S=``,className:C,style:w})=>{let T=tu(y),{value:E,focusedIndex:D,inputRefs:O,inputMode:k,handleChange:A,handleKeyDown:j,handlePaste:M,handleFocus:N,handleBlur:ee}=eu({length:e,value:r,defaultValue:a,validationType:c,sanitizeValue:l,onChange:o,onComplete:s,disabled:f,readOnly:p}),P=(0,t.useMemo)(()=>new Set(b??[]),[b]),F=v===`small`?T.inputSmall:v===`large`?T.inputLarge:T.inputMedium,I=g?T[`message${g.charAt(0).toUpperCase()}${g.slice(1)}`]:T.messageInfo,L=g===`error`?T.inputError:g===`success`?T.inputSuccess:g===`warning`?T.inputWarning:void 0,R=(0,t.useMemo)(()=>{let t=[];for(let r=0;r<e;r++){let a=E[r]??``,o=D===r,s=a!==``;t.push((0,n.jsx)(`input`,{ref:e=>{O.current[r]=e},type:u?`password`:`text`,inputMode:k,autoComplete:r===0?d:`off`,autoCorrect:`off`,spellCheck:!1,maxLength:r===0?e:1,tabIndex:r===0||o?0:-1,disabled:f,readOnly:p,required:_,placeholder:S,"aria-label":`Digit ${r+1} of ${e}`,value:a,className:(0,i.mergeClasses)(T.input,F,s&&T.inputFilled,o&&T.inputActive,f&&T.inputDisabled,L),onChange:e=>A(r,e),onKeyDown:e=>j(r,e),onPaste:e=>M(r,e),onFocus:()=>N(r),onBlur:ee},r)),P.has(r)&&t.push((0,n.jsx)(`span`,{className:T.separator,"aria-hidden":!0,children:x},`sep-${r}`))}return t},[e,E,D,u,k,d,f,p,_,S,T,F,L,P,x,A,j,M,N,ee,O]);return(0,n.jsxs)(`div`,{className:(0,i.mergeClasses)(T.root,C),style:w,role:`group`,"aria-label":m??`One-time password`,children:[m&&(0,n.jsxs)(`label`,{className:T.label,children:[m,_&&(0,n.jsx)(`span`,{"aria-hidden":!0,children:` *`})]}),(0,n.jsx)(`div`,{className:T.inputGroup,children:R}),h&&(0,n.jsx)(`span`,{className:(0,i.mergeClasses)(T.message,I),role:`status`,children:h})]})});nu.displayName=`OTPField`;var ru=e=>{let{template:t}=e;return(0,n.jsx)(n.Fragment,{children:t})},iu=()=>({toolbar:l.css`
364
364
  display: flex !important;
365
365
  flex-wrap: nowrap !important;
366
366
  align-items: center !important;
package/dist/index.js CHANGED
@@ -1808,16 +1808,16 @@ var No = /* @__PURE__ */ function(e) {
1808
1808
  })
1809
1809
  ]
1810
1810
  });
1811
- }, ms = ({ anchorPoint: e, isOpen: t, onClose: n, excludeRefs: r, children: i, theme: a }) => {
1812
- let o = P(null), [s, c] = F(null);
1811
+ }, ms = ({ anchorPoint: e, isOpen: t, onClose: n, excludeRefs: r, children: i, theme: a, className: o, styles: s }) => {
1812
+ let c = P(null), [l, u] = F(null);
1813
1813
  ie(() => {
1814
1814
  if (!t) {
1815
- c(null);
1815
+ u(null);
1816
1816
  return;
1817
1817
  }
1818
- if (o.current) {
1819
- let t = o.current.getBoundingClientRect(), n = e.left, r = e.top;
1820
- n + t.width > window.innerWidth && (n = window.innerWidth - t.width - 10), r + t.height > window.innerHeight && (r = window.innerHeight - t.height - 10), c({
1818
+ if (c.current) {
1819
+ let t = c.current.getBoundingClientRect(), n = e.left, r = e.top;
1820
+ n + t.width > window.innerWidth && (n = window.innerWidth - t.width - 10), r + t.height > window.innerHeight && (r = window.innerHeight - t.height - 10), u({
1821
1821
  left: n,
1822
1822
  top: r
1823
1823
  });
@@ -1827,9 +1827,9 @@ var No = /* @__PURE__ */ function(e) {
1827
1827
  t,
1828
1828
  i
1829
1829
  ]);
1830
- let l = O.useCallback((e) => {
1830
+ let d = O.useCallback((e) => {
1831
1831
  let t = e.target;
1832
- if (o.current && !o.current.contains(t)) {
1832
+ if (c.current && !c.current.contains(t)) {
1833
1833
  if (r && r.some((e) => e.current && e.current.contains(t))) return;
1834
1834
  n();
1835
1835
  }
@@ -1837,42 +1837,46 @@ var No = /* @__PURE__ */ function(e) {
1837
1837
  if (M(() => {
1838
1838
  if (!t) return;
1839
1839
  let e = requestAnimationFrame(() => {
1840
- document.addEventListener("mousedown", l);
1840
+ document.addEventListener("mousedown", d);
1841
1841
  }), r = (e) => {
1842
1842
  e.key === "Escape" && n();
1843
1843
  };
1844
1844
  return document.addEventListener("keydown", r), () => {
1845
- cancelAnimationFrame(e), document.removeEventListener("mousedown", l), document.removeEventListener("keydown", r);
1845
+ cancelAnimationFrame(e), document.removeEventListener("mousedown", d), document.removeEventListener("keydown", r);
1846
1846
  };
1847
1847
  }, [
1848
1848
  t,
1849
- l,
1849
+ d,
1850
1850
  n
1851
1851
  ]), !t) return null;
1852
- let u = s || e;
1852
+ let f = l || e;
1853
1853
  return Ti.createPortal(a ? /* @__PURE__ */ L(Ge, {
1854
1854
  theme: a,
1855
1855
  children: /* @__PURE__ */ L(be, {
1856
- ref: o,
1856
+ ref: c,
1857
1857
  role: "dialog",
1858
1858
  "aria-modal": "true",
1859
+ className: o,
1859
1860
  style: {
1860
1861
  position: "fixed",
1861
1862
  zIndex: 1e3,
1862
- top: u.top,
1863
- left: u.left
1863
+ top: f.top,
1864
+ left: f.left,
1865
+ ...s
1864
1866
  },
1865
1867
  children: i
1866
1868
  })
1867
1869
  }) : /* @__PURE__ */ L(be, {
1868
- ref: o,
1870
+ ref: c,
1869
1871
  role: "dialog",
1870
1872
  "aria-modal": "true",
1873
+ className: o,
1871
1874
  style: {
1872
1875
  position: "fixed",
1873
1876
  zIndex: 1e3,
1874
- top: u.top,
1875
- left: u.left
1877
+ top: f.top,
1878
+ left: f.left,
1879
+ ...s
1876
1880
  },
1877
1881
  children: i
1878
1882
  }), document.body);
@@ -4320,6 +4324,7 @@ var No = /* @__PURE__ */ function(e) {
4320
4324
  icon: /* @__PURE__ */ L(zr, {}),
4321
4325
  size: "medium",
4322
4326
  onClick: s,
4327
+ "aria-label": n,
4323
4328
  children: n
4324
4329
  })
4325
4330
  }),
@@ -12802,7 +12807,8 @@ var vm = (e) => {
12802
12807
  "& th": {
12803
12808
  backgroundColor: U.colorNeutralBackground3,
12804
12809
  fontWeight: U.fontWeightSemibold
12805
- }
12810
+ },
12811
+ "& a": { color: U.colorBrandForegroundLink }
12806
12812
  },
12807
12813
  debugBadge: {
12808
12814
  display: "inline-block",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spteck/react-controls-v2",
3
- "version": "2.5.7",
3
+ "version": "2.5.8",
4
4
  "description": "Framework-agnostic React controls for Vite, Next.js, and SPFx - based on Fluent UI 9",
5
5
  "license": "MIT",
6
6
  "author": "João Mendes",