@orfium/ictinus 5.14.2 → 5.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21599,7 +21599,10 @@ const jU = ({
|
|
|
21599
21599
|
return m(e ? (_) => _.from && _.to ? {
|
|
21600
21600
|
from: R,
|
|
21601
21601
|
to: void 0
|
|
21602
|
-
} : _.from ? {
|
|
21602
|
+
} : _.from ? R.isBefore(_.from) ? {
|
|
21603
|
+
from: R,
|
|
21604
|
+
to: _.from.endOf("day")
|
|
21605
|
+
} : {
|
|
21603
21606
|
..._,
|
|
21604
21607
|
to: $
|
|
21605
21608
|
} : {
|
package/dist/index.umd.cjs
CHANGED
|
@@ -118,7 +118,7 @@ Unable to find an `+(n===!1?"accessible ":"")+'element with the role "'+t+'"'+s+
|
|
|
118
118
|
}`,";","")},oH=({isBetween:e})=>t=>w.css("vertical-align:middle;text-align:center;cursor:pointer;position:relative;background:",e?t.tokens.colors.get("palette.tertiary.muted"):t.tokens.colors.get("palette.tertiary.base"),";",""),iH=({isSelected:e,isToday:t,isDisabled:r,isBetween:n})=>o=>{const i=dl(o);return w.css(Cn(o),";border:",e?0:o.dimension.borderWidth.get("default")," solid ",t?o.tokens.colors.get("borderColor.interactive.active"):o.tokens.colors.get("borderColor.decorative.transparent"),";border-radius:",(t||e)&&o.dimension.borderRadius.get("circle"),";width:",i("dateSize"),";height:",i("dateSize"),";color:",e?o.tokens.colors.get("textColor.inverted.primary"):o.tokens.colors.get("textColor.default.primary"),";box-sizing:border-box;display:flex;align-items:center;justify-content:center;background:",e?o.tokens.colors.get("palette.primary.contrast"):"transparent",";",!r&&`&:hover {
|
|
119
119
|
border-radius: ${o.dimension.borderRadius.get("circle")};
|
|
120
120
|
background: ${!e&&(n?"transparent":o.tokens.colors.get("palette.tertiary.muted"))};
|
|
121
|
-
}`,";","")},aH=({day:e,month:t,year:r,onSelect:n,isSelected:o=!1,isBetween:i=!1,isLast:a=!1,isFirst:l=!1,isDisabled:s=!1,tabIndex:c})=>{const d=v.useMemo(()=>e&&oe.month(t).date(e).year(r),[r,e,t]),f=v.useMemo(()=>oe.month()===t&&oe.year()===r&&oe.date()===e,[r,t,e]),p=v.useCallback(C=>{C.preventDefault(),n&&d&&n(d)},[n,d]),{keyboardProps:g}=sr({events:{keydown:{onEnter:C=>{s||p(C)}}},hasPropagation:!0});return e?u.jsx("td",{style:{padding:0},onClick:s?void 0:p,children:u.jsx("div",{css:nH({isSelected:o,isBetween:i,isLast:a,isFirst:l,isToday:f,isDisabled:s}),tabIndex:c,"data-testid":`${e}_${t+1}_${r}${o?"_selected":""}`,...g,children:u.jsx("div",{css:iH({isSelected:o,isBetween:i,isLast:a,isFirst:l,isToday:f,isDisabled:s}),children:e})})}):u.jsx("td",{css:oH({isBetween:i})})},lH=v.memo(aH);fe.extend(Cf);const sH=["Monday","Tuesday","Wednesday","Thurdsday","Friday","Saturday","Sunday"],cH=({year:e,month:t,onDaySelect:r,selectedDays:n,disabledDates:o,isFirstCalendar:i})=>{const a=h.useMemo(()=>{const m=oe.month(t).year(e).date(1),S=m.daysInMonth(),b=m.day()||7,$=7,E=rH(e,t),L=Array(E*$).fill(null).reduce((x,O,y)=>{const D=y+1,I=R.inRange(D,b,S+b)?D-b+1:void 0;return[...x,I]},[]);return R.chunk(L,$)},[e,t]),l=v.useCallback(tH,[]),s=v.useCallback(QF,[]),c=v.useCallback(JF,[]),d=v.useCallback(eH,[]),{focusedDay:f,setFocusedDay:p,calendarRef:g,keyboardProps:C}=jF({selectedDays:n,isFirstCalendar:i,month:t,year:e});return u.jsxs(h.Fragment,{children:[u.jsx("div",{css:GF(),children:sH.map(m=>u.jsx("div",{css:YF(),children:m.substr(0,2)},m))}),u.jsx("table",{css:XF(),ref:g,tabIndex:0,"data-testid":"calendar_table",...C,onFocus:()=>{f===0&&p(1)},children:u.jsx("tbody",{children:a.map((m,S)=>u.jsx("tr",{children:m.map((b,$)=>u.jsx(lH,{tabIndex:f===b?0:-1,year:e,month:t,day:b,onSelect:r,isDisabled:!!s(b,t,e,o),isSelected:!!l(b,t,e,n.from,n.to),isBetween:!!c(b,t,e,n.from,n.to),isLast:!!d(b,"last",t,e,n.from,n.to),isFirst:!!d(b,"first",t,e,n.from,n.to)},`${e}-${t}-${S}-${$}-day`))},`${e}-${t}-${S}-week`))})})]})},uH=h.memo(cH),N9=({isSelected:e,hasNoResultsExist:t})=>r=>w.css("padding:",r.globals.spacing.get("6"),";font-size:",r.globals.typography.fontSize.get("4"),";background-color:",e?N.darken(.07,r.globals.oldColors.white):r.globals.oldColors.white,";cursor:default;color:",t?r.tokens.colors.get("textColor.default.secondary"):"initial",";text-align:",t?"center":"initial",";text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;&:hover{background-color:",N.darken(.03,r.globals.oldColors.white),";}",""),dH=({status:e,isVirtualized:t,height:r,sx:n})=>o=>w.css("background-color:",o.globals.oldColors.white,";border-radius:4px;box-shadow:",o.globals.elevation["02"],";top:",(e==null?void 0:e.type)!=="normal"?"70%":"110%",";z-index:500;position:absolute;max-height:",B(r),";overflow-y:",t?"hidden":"auto",";min-width:100%;max-width:",B(620),";",n,";",""),Le={value:"select_all",label:"Select All"},R9=v.forwardRef((e,t)=>{const{filteredOptions:r,handleOptionClick:n,selectedOption:o,isLoading:i,isVirtualized:a,size:l="normal",hasSelectAllOption:s=!1}=e,c=v.useRef(null),d=nr(c,t),f=P5*yo[l],p=()=>{var m,S;return((m=c.current)==null?void 0:m.scrollIntoView)&&((S=c.current)==null?void 0:S.scrollIntoView({block:"nearest",inline:"start"}))},g=v.useCallback(m=>{const S=String(R.head(Array.from(m)));if(S===Le.value)n(Le);else{const b=R.flatMap(r,$=>$.options||$).find($=>String($.value)===S);b&&n(b)}},[r,n]);v.useEffect(()=>{p()},[o]);const C=()=>r.length>0?u.jsxs(wo,{label:R.uniqueId("menu_list"),ref:d,height:f,isVirtualized:a&&r.length>P5,onSelectionChange:g,selectedKeys:[o.value],disabledKeys:r.filter(m=>m.isDisabled).map(m=>m.value),children:[s?u.jsx(Ge,{rowSize:l,textValue:Le.label,children:u.jsx(Ze,{children:Le.label})},Le.value):null,r.map(m=>{var S;return m.options&&((S=m.options)==null?void 0:S.length)>0?u.jsx(j5,{title:m.value,children:m.options.map(b=>u.jsx(Ge,{rowSize:l,textValue:b.label,children:u.jsx(Ze,{description:b.helperText,children:b.label})},b.value))},m.value):u.jsx(Ge,{rowSize:l,textValue:m.label,children:u.jsx(Ze,{description:m.helperText,children:m.label})},m.value)})]}):u.jsx("div",{css:N9({isSelected:!1,hasNoResultsExist:!0}),children:"No options"});return u.jsx("div",{css:dH({...e,height:f}),tabIndex:-1,children:i?u.jsx("div",{css:N9({isSelected:!1,hasNoResultsExist:!0}),children:"Loading..."}):C()})});R9.displayName="SelectMenu";const z9=R9;function fH(e){const r=new Date().getFullYear()+10,n=new Date().getFullYear()-10;return R.range(n,r).map(i=>({value:i.toString(),label:`${e.format("MMMM")} ${i.toString()}`}))}const pH=({setDate:e,onDaySelect:t=()=>{},selectedDays:r,date:n,handleArrow:o=()=>{},showedArrows:i="both",disabledDates:a,isRangePicker:l=!1})=>{const[s,c]=v.useState(!1),d=i!=="right",f=v.useMemo(()=>fH(n),[n]),p=v.useRef(null),{keyboardProps:g}=sr({events:{keydown:{onArrowDown:()=>{setTimeout(()=>{var m;const C=(m=p.current)==null?void 0:m.querySelectorAll('[role="option"]');if(C&&(C==null?void 0:C.length)>0){const S=R.head(C);S instanceof HTMLElement&&typeof S.focus=="function"&&S.focus()}},0)}}},hasPropagation:!0});return u.jsx(v.Fragment,{children:u.jsxs("div",{css:NF(),children:[u.jsxs("div",{css:zF(),children:[(i==="left"||i==="both")&&u.jsx("div",{css:q9({position:"left"}),children:u.jsx(ce,{iconName:"triangleLeft",type:"tertiary",onClick:()=>o("back"),dataTestId:"month_back"})}),u.jsxs(Et,{onClick:()=>{c(!1)},children:[u.jsxs("div",{css:WF(),children:[u.jsx("div",{css:UF({isRangePicker:l}),"data-testid":"month_header",...l?{}:g,children:u.jsxs(Te,{onClick:l?void 0:()=>c(!s),type:"tertiary",dataTestId:`${i!=="both"?i+"_":""}month`,children:[n.format("MMMM")," ",n.format("YYYY")]})}),s&&u.jsx(z9,{ref:p,filteredOptions:f,handleOptionClick:C=>{e(n.year(Number(C.value))),c(!1)},selectedOption:{value:n.format("YYYY"),label:n.format("YYYY")},sx:{top:"124%"}})]}),(i==="right"||i==="both")&&u.jsx("div",{css:q9({position:"right"}),children:u.jsx(ce,{iconName:"triangleRight",type:"tertiary",onClick:()=>o("forward"),dataTestId:"month_forward"})})]})]}),u.jsx(uH,{year:n.year(),month:n.month(),onDaySelect:t,selectedDays:r,disabledDates:a,isFirstCalendar:d})]})})},V9=v.memo(pH),gH=()=>e=>w.css(we,";border:",e.dimension.borderWidth.get("default")," solid ",e.tokens.colors.get("borderColor.decorative.default"),";border-radius:",e.dimension.borderRadius.get("md"),";width:fit-content;background-color:",e.tokens.colors.get("backgroundColor.default"),";",""),vH=()=>e=>w.css("border-right:",e.dimension.borderWidth.get("default")," solid ",e.tokens.colors.get("borderColor.decorative.default"),";",""),hH=({isSelected:e})=>t=>w.css(Cn(t),";white-space:nowrap;padding:",t.globals.spacing.get("6"),";font-weight:",e?t.globals.typography.fontWeight.get("medium"):t.globals.typography.fontWeight.get("regular"),";color:",e&&t.tokens.colors.get("textColor.default.active"),";cursor:pointer;background-color:",e?t.tokens.colors.get("palette.tertiary.muted"):"transparent",";position:relative;&:hover{background-color:",t.tokens.colors.get("palette.tertiary.muted"),";}","");var CH={name:"yqjhl6",styles:"display:flex;flex-direction:column;position:relative"};const bH=()=>CH;var yH={name:"1wbxrzl",styles:"display:flex;flex-direction:row;position:relative;z-index:10"};const mH=()=>yH,wH=()=>e=>{const t=dl(e);return w.css("display:flex;justify-content:flex-end;height:",t("actionsContainer"),";align-items:center;gap:",e.dimension.spacing.get("sm"),";padding:0 ",e.dimension.spacing.get("xl"),";border-top:",e.dimension.borderWidth.get("default")," solid ",e.tokens.colors.get("borderColor.decorative.default"),";","")},SH=e=>e.from??oe,xH=e=>{var t,r;return((r=e.from)==null?void 0:r.month(((t=e.from)==null?void 0:t.month())+1))??oe.month(oe.month()+1)};var EH={name:"zjik7",styles:"display:flex"};const $H=({selectedOption:e,setSelectedOption:t=()=>{},isRangePicker:r=!1,extraOptions:n=[],onDaySelect:o,selectedDays:i,disabledDates:a,onClearAll:l=()=>{},onApply:s=()=>{}})=>{const[c,d]=v.useState(SH(i)),[f,p]=v.useState(xH(i)),g=v.useCallback((C="back")=>{d(m=>m.month(m.month()+(C==="forward"?1:-1))),p(m=>m.month(m.month()+(C==="forward"?1:-1)))},[c,f]);return u.jsx("div",{css:gH(),children:u.jsxs("div",{css:bH(),"data-testid":"buttonMonthsWrapperStyle",children:[u.jsxs("div",{css:EH,children:[n.length>0&&r&&u.jsx("div",{css:vH(),"data-testid":"optionsWrapperStyle",children:n.map(C=>u.jsx("div",{css:hH({isSelected:e===C.value}),onClick:()=>t(C.value),children:C.label},C.value))}),u.jsxs("div",{css:mH(),children:[u.jsx(V9,{date:c,onDaySelect:o,selectedDays:i,setDate:d,handleArrow:g,showedArrows:r?"left":"both",disabledDates:a,isRangePicker:r}),r&&u.jsx(V9,{date:f,onDaySelect:o,selectedDays:i,setDate:p,handleArrow:g,showedArrows:r?"right":"both",disabledDates:a,isRangePicker:r})]})]}),u.jsxs("div",{css:wH(),children:[u.jsx(Te,{onClick:l,dataTestId:"cancel",type:"tertiary",children:KD}),u.jsx(Te,{onClick:s,dataTestId:"apply",isDisabled:!i.from||!i.to,children:jD})]})]})})},TH=h.memo($H),W9=e=>new ResizeObserver(t=>{const r=R.head(t);(r==null?void 0:r.target)!==(r==null?void 0:r.contentRect)&&r&&e(r.contentRect.height)}),_H=(e,t)=>{var a;const[r,n]=v.useState(0),[o,i]=v.useState(0);return v.useEffect(()=>{if(!e.current)return;const l=W9(n);return l.observe(e.current),()=>l.disconnect()},[e]),v.useEffect(()=>{var c;const l=R.head((c=t.current)==null?void 0:c.children);if(!l)return;const s=W9(i);return s.observe(l),()=>s.disconnect()},[t,(a=t.current)==null?void 0:a.children]),{parentHeight:r,childHeight:o}},kH=(e,t,r,n,o,i)=>{const[a,l]=v.useState({x:-1,y:-1}),{parentHeight:s,childHeight:c}=_H(e,t);return v.useLayoutEffect(()=>{var $,E,M;const{x:d,y:f,width:p}=e!=null&&e.current?($=e==null?void 0:e.current)==null?void 0:$.getBoundingClientRect():{x:0,y:0,width:0},{width:g}=t!=null&&t.current?(M=(E=t==null?void 0:t.current)==null?void 0:E.children[0])==null?void 0:M.getBoundingClientRect():{width:0},C=f+s+c>window.innerHeight;let m=0,S=0;i==="top"?S=S-c-f-n:i==="bottom"?S=s+n:i===void 0&&(C?(S=S-c-n,f+S<0&&(S=s+n)):S=s+n),d+g>window.innerWidth?m=m+p-g-r:m=r,l({x:m,y:S})},[e,t,o,n,r,s,c,i]),a},PH=(e,t)=>{var o,i;const[r,n]=v.useState();return v.useEffect(()=>{var a,l;e&&n((l=(a=t==null?void 0:t.current)==null?void 0:a.getBoundingClientRect())==null?void 0:l.width)},[e,t,(i=(o=t==null?void 0:t.current)==null?void 0:o.getBoundingClientRect())==null?void 0:i.width]),[r]},AH=(e,t,r)=>()=>w.css({overflow:e?"hidden":"inherit",textOverflow:e?"ellipsis":"inherit",width:"100%",height:"inherit",position:"relative","#unique-tooltip-id":{display:t?"block !important":"none !important"},...r==null?void 0:r.container},"",""),LH=(e,t,r,n)=>()=>w.css({position:"absolute",opacity:"1 !important",top:N.rem(t),left:N.rem(e),zIndex:999999999,width:r?N.rem(r):"fit-content",height:"fit-content",...n==null?void 0:n.itemContainer},"",""),_2=({id:e="unique-tooltip-id",isVisible:t,parent:r,isOverflowAllowed:n,hasWrapperWidth:o=!1,offsetX:i=0,offsetY:a=0,sx:l,children:s,placement:c})=>{const d=v.useRef(null),f=v.useRef(null),[p]=PH(o,d),{x:g,y:C}=kH(d,f,i,a,t,c),m=t&&g!==-1&&C!==-1;return u.jsxs("div",{css:AH(n,m,l),ref:d,children:[r,m&&u.jsx("div",{css:LH(g,C,p,l),id:e,ref:f,children:s})]})},MH=({isRangePicker:e=!1,onChange:t=()=>{},disableDates:r,value:n,inputProps:o,dateFormatOverride:i=void 0,isClearable:a=!1,filterConfig:l,options:s,dataTestId:c,placement:d})=>{const f=v.useMemo(()=>UD(n||{}),[n]),[p,g]=v.useState(!1),[C,m]=v.useState(""),[S,b]=v.useState(f),{keyboardProps:$}=sr({events:{keydown:{onEscape:()=>{g(!1)}}},hasPropagation:!0}),E=v.useCallback(P=>{const A=s==null?void 0:s.find(T=>T.value===P);A&&(b(Array.isArray(A.dates)?{from:A.dates[0],to:A.dates[1]}:{from:A.dates,to:A.dates}),m(P))},[s]),M=v.useCallback(P=>{var q,W,H,re;const A=P.to&&((q=P.from)!=null&&q.isAfter(P.to))?P.to:P.from,T=P.to&&((W=P.from)!=null&&W.isAfter(P.to))?P.from:P.to,_={from:A,to:T};_.to&&g(!1),t({from:(H=_.from)==null?void 0:H.toDate(),to:(re=_.to)==null?void 0:re.toDate()})},[t]),L=v.useCallback(P=>{const A=P.startOf("day"),T=P.endOf("day");return b(e?_=>_.from&&_.to?{from:A,to:void 0}:_.from?{..._,to:T}:{..._,from:A}:_=>_.from&&_.to&&P.isBetween(_.from,_.to)?xr:{from:A,to:T})},[e]),x=v.useCallback(()=>{g(!1)},[]),O=v.useCallback(()=>{b(xr),t(xr),g(!1)},[t]),y=v.useCallback(()=>{g(!p)},[p]),D=v.useCallback(P=>{if(!a&&!l.filterType)return!1;if(l!=null&&l.filterType)return g(!1),b(xr),t(xr);if((P==null?void 0:P.keyCode)===27)return g(!1);if((P==null?void 0:P.keyCode)===8){if(e&&f.from&&f.to)return b({from:f.from,to:void 0}),t({from:f.from.toDate(),to:void 0});b(xr),t(xr)}},[a,l==null?void 0:l.filterType,t,f,e]),I=v.useCallback(()=>{M(S)},[M,S]);return u.jsx(Et,{onClick:x,children:u.jsx("div",{...$,children:u.jsx(_2,{isVisible:p,placement:d,parent:u.jsx(qF,{filterConfig:l,isRangePicker:e,selectedDay:f,inputProps:o,dateFormatOverride:i,handleIconClick:y,handleClear:D,isOpen:p,dataTestId:c}),children:u.jsx("div",{css:QD(),children:u.jsx(TH,{selectedOption:C,setSelectedOption:E,extraOptions:s,isRangePicker:e,onDaySelect:L,selectedDays:S,disabledDates:r,onClearAll:O,onApply:I})})})})})},OH=v.memo(MH,ae),IH=(e,t)=>{const r=bl.useLocation(),[n,o]=v.useState();return v.useLayoutEffect(()=>{e.forEach(i=>{(i.options.map(s=>s.url).includes(r.pathname)||i.url===r.pathname)&&(o(i.url),t([i.url]))})},[r.pathname,e,t]),[n]},U9={semantic:{hover:{backgroundColor:{step:50}},focus:{border:{width:{step:1},color:{name:"magenta",shade:500}}},pressed:{backgroundColor:{step:100}},disabled:{opacity:{amount:.5},cursor:{name:"not-allowed"}}},dark:{hover:{backgroundColor:{step:50}},focus:{border:{width:{step:1},color:{name:"magenta",shade:500}}},pressed:{backgroundColor:{step:100}},disabled:{opacity:{amount:.5},cursor:{name:"not-allowed"}}}},BH=U9.semantic.focus.border.width.step,j9=U9.semantic.focus.border.color,DH=({theme:e,borderWidth:t=0})=>{const r=t+BH,n=e.utils.getColor(j9.name,j9.shade);return{borderWidth:B(r),focusColor:n,styleBorder:`${B(r)} solid ${n}`,styleOutline:`${n} auto ${B(r)}`}},FH=39,HH=e=>()=>w.css(de(10.2),";width:100%;background-color:white;height:100%;padding:",B(24)," 0;box-sizing:border-box;.menu-item-text,.submenu-item-text{opacity:",e?1:0,";width:",B(e?204:16),";white-space:nowrap;}",""),K9=e=>w.css(er,";height:",B(44),";color:",e.tokens.colors.get("textColor.default.primary"),";cursor:default;",""),Z9=()=>e=>w.css(K9(e),";width:100%;font-size:",B(16),";font-weight:",e.globals.typography.fontWeight.get("regular"),";padding:0 ",e.globals.spacing.get("6"),";background:transparent;border:0 solid transparent;display:flex;text-align:left;text-decoration:none;&:hover{background-color:",e.tokens.colors.get("palette.tertiary.muted"),";}&:focus-visible{outline:",e.tokens.colors.get("palette.tertiary.muted"),";}",""),qH=()=>e=>w.css(Z9()(e),";text-decoration:none;",""),NH=e=>t=>w.css(de(.2),";color:",e?t.tokens.colors.get("textColor.default.active"):t.tokens.colors.get("textColor.default.primary"),";font-weight:",e?t.globals.typography.fontWeight.get("bold"):"initial",";",""),RH=()=>e=>w.css(K9(e),";",de(.2),";box-sizing:border-box;font-size:",e.globals.typography.fontSize.get("3"),";color:",e.tokens.colors.get("textColor.default.primary"),";margin:",e.globals.spacing.get("3")," 0 ",e.globals.spacing.get("3")," 0;padding-left:",B(FH),";&:hover{background-color:",e.tokens.colors.get("palette.tertiary.muted"),"!important;}&.active:hover{background-color:",e.tokens.colors.get("palette.tertiary.contrast"),"!important;}&.active{font-weight:",e.globals.typography.fontWeight.get("bold"),";background-color:",e.tokens.colors.get("palette.tertiary.muted"),"!important;color:",e.tokens.colors.get("textColor.default.active"),";path{fill:",e.tokens.colors.get("textColor.default.active"),"!important;}}&:focus-visible{outline:",DH({theme:e}).styleOutline,";}text-decoration:none;",""),zH=(e,t)=>()=>w.css(de(.2),";opacity:",t?"1":"0",";transform:",e?"rotate(90deg)":"rotate(0deg);",";",""),VH=()=>e=>w.css(de(.2),";",lt,";margin-right:",e.globals.spacing.get("4"),";width:",B(32),";height:",B(32),";border-radius:50%;flex-shrink:0;",""),WH=()=>e=>w.css(lt,";width:",B(32),";height:",B(32),";margin-right:",e.globals.spacing.get("4"),";flex-shrink:0;",""),UH=(e,t)=>w.css("transition:opacity ",e?t+100:0,"ms ease,transform ",e?t+100:0,"ms ease;opacity:",Number(e),";transform:translateY(",e?0:B("-10px"),");",""),jH=(e,t)=>{const r=h.useRef(null),n=()=>{if(r.current===null)throw new Error("Uninitialised element ref");e?r.current.style.height="":r.current.style.height="0"},o=()=>{if(r.current===null)throw new Error("Uninitialised element ref");let i;return e?r.current.style.visibility="":i=window.setTimeout(()=>{if(r.current===null)throw new Error("Uninitialised element ref");r.current.style.visibility="hidden"},t),function(){clearTimeout(i)}};return h.useLayoutEffect(n,[e]),h.useLayoutEffect(o,[e,t]),r},KH=[{condition:({isExpanded:e,onChange:t})=>!!(e===void 0&&t||t===void 0&&typeof e=="boolean"),error:new tr("If expanded is defined onChange must be defined too and vice versa")},{condition:({content:e,children:t})=>e===void 0&&t===void 0,error:new tr("Either content or children must be defined")}],G9=e=>{const{textAndControl:t,component:r="div",transitionDuration:n=200,content:o,children:i,isInitiallyExpanded:a=!1,isExpanded:l,onChange:s,dataTestId:c}=e;oo(KH,e);const[d,f]=h.useState(a),p=r,g=o??i,C=l??d,m=jH(C,n),S=b=>{typeof l!="boolean"?f($=>!$):s&&s(b)};return u.jsxs(p,{"data-testid":Q("expand-collapse",c),children:[t(S,C),u.jsx("div",{css:UH(C,n),ref:m,children:g(C)})]})},Y9=v.memo(({isCurrent:e,isExpanded:t,name:r,url:n,iconName:o,options:i,toggleMenuItem:a,state:l})=>{const s=V(),c=v.useMemo(()=>i.length>0,[i.length]),d=u.jsxs(v.Fragment,{children:[u.jsx("div",{css:zH(t,c),children:u.jsx(U,{name:"triangleRight",color:s.tokens.colors.get("textColor.default.primary"),size:20})}),u.jsx("div",{css:VH(),children:u.jsx(U,{name:o,color:e?s.tokens.colors.get("textColor.default.active"):s.tokens.colors.get("textColor.default.primary"),size:20})}),u.jsx("span",{className:"menu-item-text",css:NH(e),children:r})]});return u.jsx(v.Fragment,{children:c?u.jsx(G9,{isExpanded:t,onChange:()=>a(n),textAndControl:f=>u.jsx("button",{type:"button",css:Z9(),"data-testid":n,onClick:f,children:d}),children:()=>u.jsx(v.Fragment,{children:i.map(f=>f.isVisible&&u.jsxs(bl.NavLink,{to:f.url,state:f.state,"data-testid":f.url,className:({isActive:p,isPending:g})=>g?"pending":p?"active":"",css:RH(),id:"submenu-item-link",children:[u.jsx("div",{css:WH(),children:u.jsx(U,{name:f.iconName,color:s.tokens.colors.get("textColor.default.primary"),size:20})}),u.jsx("span",{className:"submenu-item-text",children:f.name})]},f.url))})}):u.jsx(bl.NavLink,{to:n,state:l,"data-testid":n,className:({isActive:f,isPending:p})=>p?"pending":f?"active":"",css:qH(),children:d},n)})});Y9.displayName="MenuItem";const ZH=Y9,GH=({menuItems:e,isExpanded:t})=>{const[r,n]=v.useState([]),[o]=IH(e,n),i=v.useCallback(a=>{n(l=>l.indexOf(a)!==-1?[]:[a])},[]);return u.jsx("div",{css:HH(t),children:e.map(a=>a.isVisible&&u.jsx(ZH,{isCurrent:o===a.url,isExpanded:r.includes(a.url),toggleMenuItem:i,...a},a.url))})},YH=(e,t,r)=>n=>w.css(de(.2),";width:",B(e?"308px":t?"112px":"0px"),";background-color:",n.tokens.colors.get("backgroundColor.default"),";overflow:hidden;flex-grow:0;flex-shrink:0;height:100%;min-height:100%;z-index:100;position:",r?"absolute":"relative",";border-right:",B(1)," solid ",n.tokens.colors.get("borderColor.decorative.default"),";",""),XH=e=>{var n;const t=fn(),r=t.des1200&&!t.des1440;return u.jsxs("div",{css:YH(e.isExpanded,t.des1200,!t.des1440),onMouseEnter:()=>r&&e.setExpanded(!0),onMouseLeave:()=>r&&e.setExpanded(!1),"data-testid":"sidebar",children:[(n=e.renderHeader)==null?void 0:n.call(e),u.jsx(GH,{...R.omit(e,"renderHeader")})]})},k2={name:"np6l6x",styles:"min-width:150px;background:#ffffff"},P2=$e(ne.MenuItem,{target:"e73b2cc1"})(({rowSize:e,isCompact:t,isDisabled:r,theme:n})=>{const o=N.rem(yo[e]),i=w.css("0 ",n.dimension.spacing.get("md"),";",""),a=t?bn(n):os(n);return w.css("background-color:",n.tokens.colors.get("palette.tertiary.base"),";&>div{",a,";}div[parenttype='Menu']{display:flex;flex-direction:row;gap:",N.rem(12),";}padding:",i,";min-height:",o,";display:flex;flex-direction:row;&:hover{background-color:",r?void 0:n.tokens.colors.get("palette.tertiary.muted"),";cursor:",r?"initial":"pointer",";}span[role='presentation']{align-items:center;",a,";font-weight:",n.globals.typography.fontWeight.get("bold"),";}&[role='option']{gap:",N.rem(12),";}&[data-focus-visible]{background-color:",n.tokens.colors.get("palette.tertiary.muted"),";}&[aria-selected='true']{background-color:",n.tokens.colors.get("palette.tertiary.muted"),";&>div{color:",n.tokens.colors.get("textColor.default.active"),";",t?ns(n):Cn(n),";}&[data-focus-visible]{background-color:",n.tokens.colors.get("palette.tertiary.muted"),";}}opacity:",r?"0.5":"1",";cursor:",r?"not-allowed":"initial",";","")},""),A2=$e(ne.Menu,{target:"e73b2cc0"})(({theme:e})=>w.css("background-color:",e.tokens.colors.get("backgroundColor.default"),";border-color:",e.tokens.colors.get("borderColor.decorative.default"),";border-radius:",e.dimension.borderRadius.get("md"),";box-shadow:",e.tokens.boxShadow.get("2"),";border-width:",e.dimension.borderWidth.get("default"),";",""),""),L2=({sx:e})=>{const t=V();return u.jsx(ne.Separator,{css:[w.css("height:",N.rem(1),";border-color:",t.tokens.colors.get("borderColor.decorative.default"),";width:100%;margin:auto;border-bottom-width:",N.rem(1),";border-bottom-style:solid;",""),e,"",""]})},X9=({selectionMode:e="single",rowSize:t="normal",children:r,onSelectionChange:n=()=>{},disabledKeys:o=new Set,selectedKeys:i=new Set,triggerRef:a=null,isOpen:l=!1,onClose:s=()=>{},onAction:c=()=>{},dataTestId:d,sx:f={listProps:{}}})=>{const p=t==="compact";return u.jsx(ne.MenuTrigger,{isOpen:l,onOpenChange:s,children:u.jsx(ne.Popover,{triggerRef:a,css:k2,children:u.jsx(A2,{selectionMode:e,selectedKeys:i,disabledKeys:o,onSelectionChange:n,css:mo(f.listProps),"data-testid":d,onAction:c,children:h.Children.map(r,g=>{const{key:C=""}=g;return g.type===L2?g:u.jsx(P2,{isCompact:p,rowSize:t,isDisabled:o.has(C),id:C,children:g},C)})})})})},QH=e=>w.css("position:fixed;z-index:3000;width:100vw;height:100vh;top:0;left:0;background-color:",e.tokens.colors.get("backdrop.default"),";display:flex;justify-content:center;align-items:center;",""),JH=w.css("max-width:",B(500),";max-height:",B(684),";",""),eq=({isContentPadded:e})=>t=>w.css("display:flex;flex-direction:row;flex-wrap:wrap;padding:",e?`${t.globals.spacing.get("8")} ${t.globals.spacing.get("9")} ${t.globals.spacing.get("9")} ${t.globals.spacing.get("9")}`:void 0,";",""),tq=e=>w.css("width:100%;display:flex;justify-content:flex-end;padding:",e.globals.spacing.get("4")," ",e.globals.spacing.get("4")," 0 0;box-sizing:border-box;",""),rq=e=>w.css("width:100%;height:100%;display:flex;flex-direction:column;flex-wrap:wrap;text-align:left;color:",e.tokens.colors.get("textColor.default.primary"),";font-weight:",e.globals.typography.fontWeight.get("regular"),";",""),nq=e=>w.css("font-size:",e.globals.typography.fontSize.get("3"),";margin:0 0 ",e.globals.spacing.get("3")," 0;",""),oq=e=>w.css("font-size:",e.globals.typography.fontSize.get("9"),";color:",e.tokens.colors.get("textColor.default.primary"),";font-weight:",e.globals.typography.fontWeight.get("medium"),";margin:0 0 ",e.globals.spacing.get("9")," 0;",""),iq=e=>w.css("font-size:",e.globals.typography.fontSize.get("4"),";color:",e.tokens.colors.get("textColor.default.secondary"),";max-height:",B(430),";overflow-y:hidden;margin:0;",""),aq=e=>w.css("width:100%;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-end;margin:",e.globals.spacing.get("9")," 0 0 0;button{margin-left:",e.globals.spacing.get("6"),";}",""),lq=({label:e,heading:t,message:r,primaryCTA:n,primaryCTALabel:o,secondaryCTA:i,secondaryCTALabel:a,dataTestId:l})=>u.jsxs("div",{role:"dialog",css:rq,"data-testid":Q("modal-content",l),children:[!!e&&u.jsx("p",{css:nq,children:e}),u.jsx("h5",{css:oq,"data-testid":Q("modal-content-header",l),children:t}),u.jsx("p",{css:iq,"data-testid":Q("modal-content-message",l),children:r}),u.jsxs("div",{css:aq,children:[!!(i&&a)&&u.jsx(Te,{onClick:i,type:"tertiary",dataTestId:"modal-content-secondaryCTA",children:a}),!!(n&&o)&&u.jsx(Te,{onClick:n,dataTestId:"modal-content-primaryCTA",children:o})]})]}),fl=e=>{v.useEffect(()=>{const t=r=>{r.key==="Escape"&&e()};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[e])},sq=({isOpen:e=!1,onClose:t,dataTestId:r,children:n,contentProps:o,isContentPadded:i=!0})=>{fl(()=>{t()});const a=V();return v.useEffect(()=>(e&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow="unset"}),[e]),e?u.jsx("div",{css:QH,"data-testid":Q("modal-container",r),children:u.jsx(Et,{onClick:t,children:u.jsx("div",{css:JH,children:u.jsxs(Z5,{elevated:"02",radius:"3",children:[u.jsx("div",{css:tq,children:u.jsx(ce,{type:"tertiary",iconName:"close",onClick:t,color:a.tokens.colors.get("textColor.default.secondary"),dataTestId:"modal-close"})}),u.jsx("div",{css:eq({isContentPadded:i}),children:o?u.jsx(lq,{...o}):n})]})})})}):null},St=e=>e==="info"?"active":e,Q9=e=>e==="info"?"primaryAlt":e,cq=(e,t,r)=>w.css("border:",r.globals.borderWidth.get("2")," solid ",r.tokens.colors.get(`borderColor.interactive.${St(e)}`),";&[notification-type='banner']{box-shadow:",r.globals.elevation["02"],";}",t==="outlined"?`
|
|
121
|
+
}`,";","")},aH=({day:e,month:t,year:r,onSelect:n,isSelected:o=!1,isBetween:i=!1,isLast:a=!1,isFirst:l=!1,isDisabled:s=!1,tabIndex:c})=>{const d=v.useMemo(()=>e&&oe.month(t).date(e).year(r),[r,e,t]),f=v.useMemo(()=>oe.month()===t&&oe.year()===r&&oe.date()===e,[r,t,e]),p=v.useCallback(C=>{C.preventDefault(),n&&d&&n(d)},[n,d]),{keyboardProps:g}=sr({events:{keydown:{onEnter:C=>{s||p(C)}}},hasPropagation:!0});return e?u.jsx("td",{style:{padding:0},onClick:s?void 0:p,children:u.jsx("div",{css:nH({isSelected:o,isBetween:i,isLast:a,isFirst:l,isToday:f,isDisabled:s}),tabIndex:c,"data-testid":`${e}_${t+1}_${r}${o?"_selected":""}`,...g,children:u.jsx("div",{css:iH({isSelected:o,isBetween:i,isLast:a,isFirst:l,isToday:f,isDisabled:s}),children:e})})}):u.jsx("td",{css:oH({isBetween:i})})},lH=v.memo(aH);fe.extend(Cf);const sH=["Monday","Tuesday","Wednesday","Thurdsday","Friday","Saturday","Sunday"],cH=({year:e,month:t,onDaySelect:r,selectedDays:n,disabledDates:o,isFirstCalendar:i})=>{const a=h.useMemo(()=>{const m=oe.month(t).year(e).date(1),S=m.daysInMonth(),b=m.day()||7,$=7,E=rH(e,t),L=Array(E*$).fill(null).reduce((x,O,y)=>{const D=y+1,I=R.inRange(D,b,S+b)?D-b+1:void 0;return[...x,I]},[]);return R.chunk(L,$)},[e,t]),l=v.useCallback(tH,[]),s=v.useCallback(QF,[]),c=v.useCallback(JF,[]),d=v.useCallback(eH,[]),{focusedDay:f,setFocusedDay:p,calendarRef:g,keyboardProps:C}=jF({selectedDays:n,isFirstCalendar:i,month:t,year:e});return u.jsxs(h.Fragment,{children:[u.jsx("div",{css:GF(),children:sH.map(m=>u.jsx("div",{css:YF(),children:m.substr(0,2)},m))}),u.jsx("table",{css:XF(),ref:g,tabIndex:0,"data-testid":"calendar_table",...C,onFocus:()=>{f===0&&p(1)},children:u.jsx("tbody",{children:a.map((m,S)=>u.jsx("tr",{children:m.map((b,$)=>u.jsx(lH,{tabIndex:f===b?0:-1,year:e,month:t,day:b,onSelect:r,isDisabled:!!s(b,t,e,o),isSelected:!!l(b,t,e,n.from,n.to),isBetween:!!c(b,t,e,n.from,n.to),isLast:!!d(b,"last",t,e,n.from,n.to),isFirst:!!d(b,"first",t,e,n.from,n.to)},`${e}-${t}-${S}-${$}-day`))},`${e}-${t}-${S}-week`))})})]})},uH=h.memo(cH),N9=({isSelected:e,hasNoResultsExist:t})=>r=>w.css("padding:",r.globals.spacing.get("6"),";font-size:",r.globals.typography.fontSize.get("4"),";background-color:",e?N.darken(.07,r.globals.oldColors.white):r.globals.oldColors.white,";cursor:default;color:",t?r.tokens.colors.get("textColor.default.secondary"):"initial",";text-align:",t?"center":"initial",";text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;&:hover{background-color:",N.darken(.03,r.globals.oldColors.white),";}",""),dH=({status:e,isVirtualized:t,height:r,sx:n})=>o=>w.css("background-color:",o.globals.oldColors.white,";border-radius:4px;box-shadow:",o.globals.elevation["02"],";top:",(e==null?void 0:e.type)!=="normal"?"70%":"110%",";z-index:500;position:absolute;max-height:",B(r),";overflow-y:",t?"hidden":"auto",";min-width:100%;max-width:",B(620),";",n,";",""),Le={value:"select_all",label:"Select All"},R9=v.forwardRef((e,t)=>{const{filteredOptions:r,handleOptionClick:n,selectedOption:o,isLoading:i,isVirtualized:a,size:l="normal",hasSelectAllOption:s=!1}=e,c=v.useRef(null),d=nr(c,t),f=P5*yo[l],p=()=>{var m,S;return((m=c.current)==null?void 0:m.scrollIntoView)&&((S=c.current)==null?void 0:S.scrollIntoView({block:"nearest",inline:"start"}))},g=v.useCallback(m=>{const S=String(R.head(Array.from(m)));if(S===Le.value)n(Le);else{const b=R.flatMap(r,$=>$.options||$).find($=>String($.value)===S);b&&n(b)}},[r,n]);v.useEffect(()=>{p()},[o]);const C=()=>r.length>0?u.jsxs(wo,{label:R.uniqueId("menu_list"),ref:d,height:f,isVirtualized:a&&r.length>P5,onSelectionChange:g,selectedKeys:[o.value],disabledKeys:r.filter(m=>m.isDisabled).map(m=>m.value),children:[s?u.jsx(Ge,{rowSize:l,textValue:Le.label,children:u.jsx(Ze,{children:Le.label})},Le.value):null,r.map(m=>{var S;return m.options&&((S=m.options)==null?void 0:S.length)>0?u.jsx(j5,{title:m.value,children:m.options.map(b=>u.jsx(Ge,{rowSize:l,textValue:b.label,children:u.jsx(Ze,{description:b.helperText,children:b.label})},b.value))},m.value):u.jsx(Ge,{rowSize:l,textValue:m.label,children:u.jsx(Ze,{description:m.helperText,children:m.label})},m.value)})]}):u.jsx("div",{css:N9({isSelected:!1,hasNoResultsExist:!0}),children:"No options"});return u.jsx("div",{css:dH({...e,height:f}),tabIndex:-1,children:i?u.jsx("div",{css:N9({isSelected:!1,hasNoResultsExist:!0}),children:"Loading..."}):C()})});R9.displayName="SelectMenu";const z9=R9;function fH(e){const r=new Date().getFullYear()+10,n=new Date().getFullYear()-10;return R.range(n,r).map(i=>({value:i.toString(),label:`${e.format("MMMM")} ${i.toString()}`}))}const pH=({setDate:e,onDaySelect:t=()=>{},selectedDays:r,date:n,handleArrow:o=()=>{},showedArrows:i="both",disabledDates:a,isRangePicker:l=!1})=>{const[s,c]=v.useState(!1),d=i!=="right",f=v.useMemo(()=>fH(n),[n]),p=v.useRef(null),{keyboardProps:g}=sr({events:{keydown:{onArrowDown:()=>{setTimeout(()=>{var m;const C=(m=p.current)==null?void 0:m.querySelectorAll('[role="option"]');if(C&&(C==null?void 0:C.length)>0){const S=R.head(C);S instanceof HTMLElement&&typeof S.focus=="function"&&S.focus()}},0)}}},hasPropagation:!0});return u.jsx(v.Fragment,{children:u.jsxs("div",{css:NF(),children:[u.jsxs("div",{css:zF(),children:[(i==="left"||i==="both")&&u.jsx("div",{css:q9({position:"left"}),children:u.jsx(ce,{iconName:"triangleLeft",type:"tertiary",onClick:()=>o("back"),dataTestId:"month_back"})}),u.jsxs(Et,{onClick:()=>{c(!1)},children:[u.jsxs("div",{css:WF(),children:[u.jsx("div",{css:UF({isRangePicker:l}),"data-testid":"month_header",...l?{}:g,children:u.jsxs(Te,{onClick:l?void 0:()=>c(!s),type:"tertiary",dataTestId:`${i!=="both"?i+"_":""}month`,children:[n.format("MMMM")," ",n.format("YYYY")]})}),s&&u.jsx(z9,{ref:p,filteredOptions:f,handleOptionClick:C=>{e(n.year(Number(C.value))),c(!1)},selectedOption:{value:n.format("YYYY"),label:n.format("YYYY")},sx:{top:"124%"}})]}),(i==="right"||i==="both")&&u.jsx("div",{css:q9({position:"right"}),children:u.jsx(ce,{iconName:"triangleRight",type:"tertiary",onClick:()=>o("forward"),dataTestId:"month_forward"})})]})]}),u.jsx(uH,{year:n.year(),month:n.month(),onDaySelect:t,selectedDays:r,disabledDates:a,isFirstCalendar:d})]})})},V9=v.memo(pH),gH=()=>e=>w.css(we,";border:",e.dimension.borderWidth.get("default")," solid ",e.tokens.colors.get("borderColor.decorative.default"),";border-radius:",e.dimension.borderRadius.get("md"),";width:fit-content;background-color:",e.tokens.colors.get("backgroundColor.default"),";",""),vH=()=>e=>w.css("border-right:",e.dimension.borderWidth.get("default")," solid ",e.tokens.colors.get("borderColor.decorative.default"),";",""),hH=({isSelected:e})=>t=>w.css(Cn(t),";white-space:nowrap;padding:",t.globals.spacing.get("6"),";font-weight:",e?t.globals.typography.fontWeight.get("medium"):t.globals.typography.fontWeight.get("regular"),";color:",e&&t.tokens.colors.get("textColor.default.active"),";cursor:pointer;background-color:",e?t.tokens.colors.get("palette.tertiary.muted"):"transparent",";position:relative;&:hover{background-color:",t.tokens.colors.get("palette.tertiary.muted"),";}","");var CH={name:"yqjhl6",styles:"display:flex;flex-direction:column;position:relative"};const bH=()=>CH;var yH={name:"1wbxrzl",styles:"display:flex;flex-direction:row;position:relative;z-index:10"};const mH=()=>yH,wH=()=>e=>{const t=dl(e);return w.css("display:flex;justify-content:flex-end;height:",t("actionsContainer"),";align-items:center;gap:",e.dimension.spacing.get("sm"),";padding:0 ",e.dimension.spacing.get("xl"),";border-top:",e.dimension.borderWidth.get("default")," solid ",e.tokens.colors.get("borderColor.decorative.default"),";","")},SH=e=>e.from??oe,xH=e=>{var t,r;return((r=e.from)==null?void 0:r.month(((t=e.from)==null?void 0:t.month())+1))??oe.month(oe.month()+1)};var EH={name:"zjik7",styles:"display:flex"};const $H=({selectedOption:e,setSelectedOption:t=()=>{},isRangePicker:r=!1,extraOptions:n=[],onDaySelect:o,selectedDays:i,disabledDates:a,onClearAll:l=()=>{},onApply:s=()=>{}})=>{const[c,d]=v.useState(SH(i)),[f,p]=v.useState(xH(i)),g=v.useCallback((C="back")=>{d(m=>m.month(m.month()+(C==="forward"?1:-1))),p(m=>m.month(m.month()+(C==="forward"?1:-1)))},[c,f]);return u.jsx("div",{css:gH(),children:u.jsxs("div",{css:bH(),"data-testid":"buttonMonthsWrapperStyle",children:[u.jsxs("div",{css:EH,children:[n.length>0&&r&&u.jsx("div",{css:vH(),"data-testid":"optionsWrapperStyle",children:n.map(C=>u.jsx("div",{css:hH({isSelected:e===C.value}),onClick:()=>t(C.value),children:C.label},C.value))}),u.jsxs("div",{css:mH(),children:[u.jsx(V9,{date:c,onDaySelect:o,selectedDays:i,setDate:d,handleArrow:g,showedArrows:r?"left":"both",disabledDates:a,isRangePicker:r}),r&&u.jsx(V9,{date:f,onDaySelect:o,selectedDays:i,setDate:p,handleArrow:g,showedArrows:r?"right":"both",disabledDates:a,isRangePicker:r})]})]}),u.jsxs("div",{css:wH(),children:[u.jsx(Te,{onClick:l,dataTestId:"cancel",type:"tertiary",children:KD}),u.jsx(Te,{onClick:s,dataTestId:"apply",isDisabled:!i.from||!i.to,children:jD})]})]})})},TH=h.memo($H),W9=e=>new ResizeObserver(t=>{const r=R.head(t);(r==null?void 0:r.target)!==(r==null?void 0:r.contentRect)&&r&&e(r.contentRect.height)}),_H=(e,t)=>{var a;const[r,n]=v.useState(0),[o,i]=v.useState(0);return v.useEffect(()=>{if(!e.current)return;const l=W9(n);return l.observe(e.current),()=>l.disconnect()},[e]),v.useEffect(()=>{var c;const l=R.head((c=t.current)==null?void 0:c.children);if(!l)return;const s=W9(i);return s.observe(l),()=>s.disconnect()},[t,(a=t.current)==null?void 0:a.children]),{parentHeight:r,childHeight:o}},kH=(e,t,r,n,o,i)=>{const[a,l]=v.useState({x:-1,y:-1}),{parentHeight:s,childHeight:c}=_H(e,t);return v.useLayoutEffect(()=>{var $,E,M;const{x:d,y:f,width:p}=e!=null&&e.current?($=e==null?void 0:e.current)==null?void 0:$.getBoundingClientRect():{x:0,y:0,width:0},{width:g}=t!=null&&t.current?(M=(E=t==null?void 0:t.current)==null?void 0:E.children[0])==null?void 0:M.getBoundingClientRect():{width:0},C=f+s+c>window.innerHeight;let m=0,S=0;i==="top"?S=S-c-f-n:i==="bottom"?S=s+n:i===void 0&&(C?(S=S-c-n,f+S<0&&(S=s+n)):S=s+n),d+g>window.innerWidth?m=m+p-g-r:m=r,l({x:m,y:S})},[e,t,o,n,r,s,c,i]),a},PH=(e,t)=>{var o,i;const[r,n]=v.useState();return v.useEffect(()=>{var a,l;e&&n((l=(a=t==null?void 0:t.current)==null?void 0:a.getBoundingClientRect())==null?void 0:l.width)},[e,t,(i=(o=t==null?void 0:t.current)==null?void 0:o.getBoundingClientRect())==null?void 0:i.width]),[r]},AH=(e,t,r)=>()=>w.css({overflow:e?"hidden":"inherit",textOverflow:e?"ellipsis":"inherit",width:"100%",height:"inherit",position:"relative","#unique-tooltip-id":{display:t?"block !important":"none !important"},...r==null?void 0:r.container},"",""),LH=(e,t,r,n)=>()=>w.css({position:"absolute",opacity:"1 !important",top:N.rem(t),left:N.rem(e),zIndex:999999999,width:r?N.rem(r):"fit-content",height:"fit-content",...n==null?void 0:n.itemContainer},"",""),_2=({id:e="unique-tooltip-id",isVisible:t,parent:r,isOverflowAllowed:n,hasWrapperWidth:o=!1,offsetX:i=0,offsetY:a=0,sx:l,children:s,placement:c})=>{const d=v.useRef(null),f=v.useRef(null),[p]=PH(o,d),{x:g,y:C}=kH(d,f,i,a,t,c),m=t&&g!==-1&&C!==-1;return u.jsxs("div",{css:AH(n,m,l),ref:d,children:[r,m&&u.jsx("div",{css:LH(g,C,p,l),id:e,ref:f,children:s})]})},MH=({isRangePicker:e=!1,onChange:t=()=>{},disableDates:r,value:n,inputProps:o,dateFormatOverride:i=void 0,isClearable:a=!1,filterConfig:l,options:s,dataTestId:c,placement:d})=>{const f=v.useMemo(()=>UD(n||{}),[n]),[p,g]=v.useState(!1),[C,m]=v.useState(""),[S,b]=v.useState(f),{keyboardProps:$}=sr({events:{keydown:{onEscape:()=>{g(!1)}}},hasPropagation:!0}),E=v.useCallback(P=>{const A=s==null?void 0:s.find(T=>T.value===P);A&&(b(Array.isArray(A.dates)?{from:A.dates[0],to:A.dates[1]}:{from:A.dates,to:A.dates}),m(P))},[s]),M=v.useCallback(P=>{var q,W,H,re;const A=P.to&&((q=P.from)!=null&&q.isAfter(P.to))?P.to:P.from,T=P.to&&((W=P.from)!=null&&W.isAfter(P.to))?P.from:P.to,_={from:A,to:T};_.to&&g(!1),t({from:(H=_.from)==null?void 0:H.toDate(),to:(re=_.to)==null?void 0:re.toDate()})},[t]),L=v.useCallback(P=>{const A=P.startOf("day"),T=P.endOf("day");return b(e?_=>_.from&&_.to?{from:A,to:void 0}:_.from?A.isBefore(_.from)?{from:A,to:_.from.endOf("day")}:{..._,to:T}:{..._,from:A}:_=>_.from&&_.to&&P.isBetween(_.from,_.to)?xr:{from:A,to:T})},[e]),x=v.useCallback(()=>{g(!1)},[]),O=v.useCallback(()=>{b(xr),t(xr),g(!1)},[t]),y=v.useCallback(()=>{g(!p)},[p]),D=v.useCallback(P=>{if(!a&&!l.filterType)return!1;if(l!=null&&l.filterType)return g(!1),b(xr),t(xr);if((P==null?void 0:P.keyCode)===27)return g(!1);if((P==null?void 0:P.keyCode)===8){if(e&&f.from&&f.to)return b({from:f.from,to:void 0}),t({from:f.from.toDate(),to:void 0});b(xr),t(xr)}},[a,l==null?void 0:l.filterType,t,f,e]),I=v.useCallback(()=>{M(S)},[M,S]);return u.jsx(Et,{onClick:x,children:u.jsx("div",{...$,children:u.jsx(_2,{isVisible:p,placement:d,parent:u.jsx(qF,{filterConfig:l,isRangePicker:e,selectedDay:f,inputProps:o,dateFormatOverride:i,handleIconClick:y,handleClear:D,isOpen:p,dataTestId:c}),children:u.jsx("div",{css:QD(),children:u.jsx(TH,{selectedOption:C,setSelectedOption:E,extraOptions:s,isRangePicker:e,onDaySelect:L,selectedDays:S,disabledDates:r,onClearAll:O,onApply:I})})})})})},OH=v.memo(MH,ae),IH=(e,t)=>{const r=bl.useLocation(),[n,o]=v.useState();return v.useLayoutEffect(()=>{e.forEach(i=>{(i.options.map(s=>s.url).includes(r.pathname)||i.url===r.pathname)&&(o(i.url),t([i.url]))})},[r.pathname,e,t]),[n]},U9={semantic:{hover:{backgroundColor:{step:50}},focus:{border:{width:{step:1},color:{name:"magenta",shade:500}}},pressed:{backgroundColor:{step:100}},disabled:{opacity:{amount:.5},cursor:{name:"not-allowed"}}},dark:{hover:{backgroundColor:{step:50}},focus:{border:{width:{step:1},color:{name:"magenta",shade:500}}},pressed:{backgroundColor:{step:100}},disabled:{opacity:{amount:.5},cursor:{name:"not-allowed"}}}},BH=U9.semantic.focus.border.width.step,j9=U9.semantic.focus.border.color,DH=({theme:e,borderWidth:t=0})=>{const r=t+BH,n=e.utils.getColor(j9.name,j9.shade);return{borderWidth:B(r),focusColor:n,styleBorder:`${B(r)} solid ${n}`,styleOutline:`${n} auto ${B(r)}`}},FH=39,HH=e=>()=>w.css(de(10.2),";width:100%;background-color:white;height:100%;padding:",B(24)," 0;box-sizing:border-box;.menu-item-text,.submenu-item-text{opacity:",e?1:0,";width:",B(e?204:16),";white-space:nowrap;}",""),K9=e=>w.css(er,";height:",B(44),";color:",e.tokens.colors.get("textColor.default.primary"),";cursor:default;",""),Z9=()=>e=>w.css(K9(e),";width:100%;font-size:",B(16),";font-weight:",e.globals.typography.fontWeight.get("regular"),";padding:0 ",e.globals.spacing.get("6"),";background:transparent;border:0 solid transparent;display:flex;text-align:left;text-decoration:none;&:hover{background-color:",e.tokens.colors.get("palette.tertiary.muted"),";}&:focus-visible{outline:",e.tokens.colors.get("palette.tertiary.muted"),";}",""),qH=()=>e=>w.css(Z9()(e),";text-decoration:none;",""),NH=e=>t=>w.css(de(.2),";color:",e?t.tokens.colors.get("textColor.default.active"):t.tokens.colors.get("textColor.default.primary"),";font-weight:",e?t.globals.typography.fontWeight.get("bold"):"initial",";",""),RH=()=>e=>w.css(K9(e),";",de(.2),";box-sizing:border-box;font-size:",e.globals.typography.fontSize.get("3"),";color:",e.tokens.colors.get("textColor.default.primary"),";margin:",e.globals.spacing.get("3")," 0 ",e.globals.spacing.get("3")," 0;padding-left:",B(FH),";&:hover{background-color:",e.tokens.colors.get("palette.tertiary.muted"),"!important;}&.active:hover{background-color:",e.tokens.colors.get("palette.tertiary.contrast"),"!important;}&.active{font-weight:",e.globals.typography.fontWeight.get("bold"),";background-color:",e.tokens.colors.get("palette.tertiary.muted"),"!important;color:",e.tokens.colors.get("textColor.default.active"),";path{fill:",e.tokens.colors.get("textColor.default.active"),"!important;}}&:focus-visible{outline:",DH({theme:e}).styleOutline,";}text-decoration:none;",""),zH=(e,t)=>()=>w.css(de(.2),";opacity:",t?"1":"0",";transform:",e?"rotate(90deg)":"rotate(0deg);",";",""),VH=()=>e=>w.css(de(.2),";",lt,";margin-right:",e.globals.spacing.get("4"),";width:",B(32),";height:",B(32),";border-radius:50%;flex-shrink:0;",""),WH=()=>e=>w.css(lt,";width:",B(32),";height:",B(32),";margin-right:",e.globals.spacing.get("4"),";flex-shrink:0;",""),UH=(e,t)=>w.css("transition:opacity ",e?t+100:0,"ms ease,transform ",e?t+100:0,"ms ease;opacity:",Number(e),";transform:translateY(",e?0:B("-10px"),");",""),jH=(e,t)=>{const r=h.useRef(null),n=()=>{if(r.current===null)throw new Error("Uninitialised element ref");e?r.current.style.height="":r.current.style.height="0"},o=()=>{if(r.current===null)throw new Error("Uninitialised element ref");let i;return e?r.current.style.visibility="":i=window.setTimeout(()=>{if(r.current===null)throw new Error("Uninitialised element ref");r.current.style.visibility="hidden"},t),function(){clearTimeout(i)}};return h.useLayoutEffect(n,[e]),h.useLayoutEffect(o,[e,t]),r},KH=[{condition:({isExpanded:e,onChange:t})=>!!(e===void 0&&t||t===void 0&&typeof e=="boolean"),error:new tr("If expanded is defined onChange must be defined too and vice versa")},{condition:({content:e,children:t})=>e===void 0&&t===void 0,error:new tr("Either content or children must be defined")}],G9=e=>{const{textAndControl:t,component:r="div",transitionDuration:n=200,content:o,children:i,isInitiallyExpanded:a=!1,isExpanded:l,onChange:s,dataTestId:c}=e;oo(KH,e);const[d,f]=h.useState(a),p=r,g=o??i,C=l??d,m=jH(C,n),S=b=>{typeof l!="boolean"?f($=>!$):s&&s(b)};return u.jsxs(p,{"data-testid":Q("expand-collapse",c),children:[t(S,C),u.jsx("div",{css:UH(C,n),ref:m,children:g(C)})]})},Y9=v.memo(({isCurrent:e,isExpanded:t,name:r,url:n,iconName:o,options:i,toggleMenuItem:a,state:l})=>{const s=V(),c=v.useMemo(()=>i.length>0,[i.length]),d=u.jsxs(v.Fragment,{children:[u.jsx("div",{css:zH(t,c),children:u.jsx(U,{name:"triangleRight",color:s.tokens.colors.get("textColor.default.primary"),size:20})}),u.jsx("div",{css:VH(),children:u.jsx(U,{name:o,color:e?s.tokens.colors.get("textColor.default.active"):s.tokens.colors.get("textColor.default.primary"),size:20})}),u.jsx("span",{className:"menu-item-text",css:NH(e),children:r})]});return u.jsx(v.Fragment,{children:c?u.jsx(G9,{isExpanded:t,onChange:()=>a(n),textAndControl:f=>u.jsx("button",{type:"button",css:Z9(),"data-testid":n,onClick:f,children:d}),children:()=>u.jsx(v.Fragment,{children:i.map(f=>f.isVisible&&u.jsxs(bl.NavLink,{to:f.url,state:f.state,"data-testid":f.url,className:({isActive:p,isPending:g})=>g?"pending":p?"active":"",css:RH(),id:"submenu-item-link",children:[u.jsx("div",{css:WH(),children:u.jsx(U,{name:f.iconName,color:s.tokens.colors.get("textColor.default.primary"),size:20})}),u.jsx("span",{className:"submenu-item-text",children:f.name})]},f.url))})}):u.jsx(bl.NavLink,{to:n,state:l,"data-testid":n,className:({isActive:f,isPending:p})=>p?"pending":f?"active":"",css:qH(),children:d},n)})});Y9.displayName="MenuItem";const ZH=Y9,GH=({menuItems:e,isExpanded:t})=>{const[r,n]=v.useState([]),[o]=IH(e,n),i=v.useCallback(a=>{n(l=>l.indexOf(a)!==-1?[]:[a])},[]);return u.jsx("div",{css:HH(t),children:e.map(a=>a.isVisible&&u.jsx(ZH,{isCurrent:o===a.url,isExpanded:r.includes(a.url),toggleMenuItem:i,...a},a.url))})},YH=(e,t,r)=>n=>w.css(de(.2),";width:",B(e?"308px":t?"112px":"0px"),";background-color:",n.tokens.colors.get("backgroundColor.default"),";overflow:hidden;flex-grow:0;flex-shrink:0;height:100%;min-height:100%;z-index:100;position:",r?"absolute":"relative",";border-right:",B(1)," solid ",n.tokens.colors.get("borderColor.decorative.default"),";",""),XH=e=>{var n;const t=fn(),r=t.des1200&&!t.des1440;return u.jsxs("div",{css:YH(e.isExpanded,t.des1200,!t.des1440),onMouseEnter:()=>r&&e.setExpanded(!0),onMouseLeave:()=>r&&e.setExpanded(!1),"data-testid":"sidebar",children:[(n=e.renderHeader)==null?void 0:n.call(e),u.jsx(GH,{...R.omit(e,"renderHeader")})]})},k2={name:"np6l6x",styles:"min-width:150px;background:#ffffff"},P2=$e(ne.MenuItem,{target:"e73b2cc1"})(({rowSize:e,isCompact:t,isDisabled:r,theme:n})=>{const o=N.rem(yo[e]),i=w.css("0 ",n.dimension.spacing.get("md"),";",""),a=t?bn(n):os(n);return w.css("background-color:",n.tokens.colors.get("palette.tertiary.base"),";&>div{",a,";}div[parenttype='Menu']{display:flex;flex-direction:row;gap:",N.rem(12),";}padding:",i,";min-height:",o,";display:flex;flex-direction:row;&:hover{background-color:",r?void 0:n.tokens.colors.get("palette.tertiary.muted"),";cursor:",r?"initial":"pointer",";}span[role='presentation']{align-items:center;",a,";font-weight:",n.globals.typography.fontWeight.get("bold"),";}&[role='option']{gap:",N.rem(12),";}&[data-focus-visible]{background-color:",n.tokens.colors.get("palette.tertiary.muted"),";}&[aria-selected='true']{background-color:",n.tokens.colors.get("palette.tertiary.muted"),";&>div{color:",n.tokens.colors.get("textColor.default.active"),";",t?ns(n):Cn(n),";}&[data-focus-visible]{background-color:",n.tokens.colors.get("palette.tertiary.muted"),";}}opacity:",r?"0.5":"1",";cursor:",r?"not-allowed":"initial",";","")},""),A2=$e(ne.Menu,{target:"e73b2cc0"})(({theme:e})=>w.css("background-color:",e.tokens.colors.get("backgroundColor.default"),";border-color:",e.tokens.colors.get("borderColor.decorative.default"),";border-radius:",e.dimension.borderRadius.get("md"),";box-shadow:",e.tokens.boxShadow.get("2"),";border-width:",e.dimension.borderWidth.get("default"),";",""),""),L2=({sx:e})=>{const t=V();return u.jsx(ne.Separator,{css:[w.css("height:",N.rem(1),";border-color:",t.tokens.colors.get("borderColor.decorative.default"),";width:100%;margin:auto;border-bottom-width:",N.rem(1),";border-bottom-style:solid;",""),e,"",""]})},X9=({selectionMode:e="single",rowSize:t="normal",children:r,onSelectionChange:n=()=>{},disabledKeys:o=new Set,selectedKeys:i=new Set,triggerRef:a=null,isOpen:l=!1,onClose:s=()=>{},onAction:c=()=>{},dataTestId:d,sx:f={listProps:{}}})=>{const p=t==="compact";return u.jsx(ne.MenuTrigger,{isOpen:l,onOpenChange:s,children:u.jsx(ne.Popover,{triggerRef:a,css:k2,children:u.jsx(A2,{selectionMode:e,selectedKeys:i,disabledKeys:o,onSelectionChange:n,css:mo(f.listProps),"data-testid":d,onAction:c,children:h.Children.map(r,g=>{const{key:C=""}=g;return g.type===L2?g:u.jsx(P2,{isCompact:p,rowSize:t,isDisabled:o.has(C),id:C,children:g},C)})})})})},QH=e=>w.css("position:fixed;z-index:3000;width:100vw;height:100vh;top:0;left:0;background-color:",e.tokens.colors.get("backdrop.default"),";display:flex;justify-content:center;align-items:center;",""),JH=w.css("max-width:",B(500),";max-height:",B(684),";",""),eq=({isContentPadded:e})=>t=>w.css("display:flex;flex-direction:row;flex-wrap:wrap;padding:",e?`${t.globals.spacing.get("8")} ${t.globals.spacing.get("9")} ${t.globals.spacing.get("9")} ${t.globals.spacing.get("9")}`:void 0,";",""),tq=e=>w.css("width:100%;display:flex;justify-content:flex-end;padding:",e.globals.spacing.get("4")," ",e.globals.spacing.get("4")," 0 0;box-sizing:border-box;",""),rq=e=>w.css("width:100%;height:100%;display:flex;flex-direction:column;flex-wrap:wrap;text-align:left;color:",e.tokens.colors.get("textColor.default.primary"),";font-weight:",e.globals.typography.fontWeight.get("regular"),";",""),nq=e=>w.css("font-size:",e.globals.typography.fontSize.get("3"),";margin:0 0 ",e.globals.spacing.get("3")," 0;",""),oq=e=>w.css("font-size:",e.globals.typography.fontSize.get("9"),";color:",e.tokens.colors.get("textColor.default.primary"),";font-weight:",e.globals.typography.fontWeight.get("medium"),";margin:0 0 ",e.globals.spacing.get("9")," 0;",""),iq=e=>w.css("font-size:",e.globals.typography.fontSize.get("4"),";color:",e.tokens.colors.get("textColor.default.secondary"),";max-height:",B(430),";overflow-y:hidden;margin:0;",""),aq=e=>w.css("width:100%;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-end;margin:",e.globals.spacing.get("9")," 0 0 0;button{margin-left:",e.globals.spacing.get("6"),";}",""),lq=({label:e,heading:t,message:r,primaryCTA:n,primaryCTALabel:o,secondaryCTA:i,secondaryCTALabel:a,dataTestId:l})=>u.jsxs("div",{role:"dialog",css:rq,"data-testid":Q("modal-content",l),children:[!!e&&u.jsx("p",{css:nq,children:e}),u.jsx("h5",{css:oq,"data-testid":Q("modal-content-header",l),children:t}),u.jsx("p",{css:iq,"data-testid":Q("modal-content-message",l),children:r}),u.jsxs("div",{css:aq,children:[!!(i&&a)&&u.jsx(Te,{onClick:i,type:"tertiary",dataTestId:"modal-content-secondaryCTA",children:a}),!!(n&&o)&&u.jsx(Te,{onClick:n,dataTestId:"modal-content-primaryCTA",children:o})]})]}),fl=e=>{v.useEffect(()=>{const t=r=>{r.key==="Escape"&&e()};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[e])},sq=({isOpen:e=!1,onClose:t,dataTestId:r,children:n,contentProps:o,isContentPadded:i=!0})=>{fl(()=>{t()});const a=V();return v.useEffect(()=>(e&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow="unset"}),[e]),e?u.jsx("div",{css:QH,"data-testid":Q("modal-container",r),children:u.jsx(Et,{onClick:t,children:u.jsx("div",{css:JH,children:u.jsxs(Z5,{elevated:"02",radius:"3",children:[u.jsx("div",{css:tq,children:u.jsx(ce,{type:"tertiary",iconName:"close",onClick:t,color:a.tokens.colors.get("textColor.default.secondary"),dataTestId:"modal-close"})}),u.jsx("div",{css:eq({isContentPadded:i}),children:o?u.jsx(lq,{...o}):n})]})})})}):null},St=e=>e==="info"?"active":e,Q9=e=>e==="info"?"primaryAlt":e,cq=(e,t,r)=>w.css("border:",r.globals.borderWidth.get("2")," solid ",r.tokens.colors.get(`borderColor.interactive.${St(e)}`),";&[notification-type='banner']{box-shadow:",r.globals.elevation["02"],";}",t==="outlined"?`
|
|
122
122
|
background: ${r.tokens.colors.get("backgroundColor.default")};
|
|
123
123
|
`:`
|
|
124
124
|
background: ${r.tokens.colors.get(`palette.${Q9(e)}.muted`)};
|