@workday/canvas-kit-mcp 15.0.1 → 15.0.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.
@@ -296,7 +296,7 @@ ${s}
296
296
  </svg>`,filename:"wd-icon-chevron-right-small.svg",category:"Navigation",tags:["navigation","arrow"]},vN={name:"cloud-arrow-up",type:Ia.System,svg:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="wd-icon wd-icon-cloud-arrow-up" viewBox="0 0 24 24" role="presentation" focusable="false"><path fill="oklch(0.3523 0 0 / 1)" d="M9.5 4c1.735 0 3.28.805 4.286 2.057Q14.136 6 14.5 6a4.5 4.5 0 0 1 4.262 3.058A5.001 5.001 0 0 1 18 19H6a5 5 0 0 1-1.998-9.585A5.5 5.5 0 0 1 9.5 4m0 2a3.5 3.5 0 0 0-3.466 3.98l.121.892-.874.214A3.002 3.002 0 0 0 6 17h5v-3.89l-1.48 1.21a.5.5 0 0 1-.703-.071l-.316-.387-.317-.386a.5.5 0 0 1 .07-.705l3.113-2.546q.035-.029.07-.053c.364-.247.852-.23 1.197.053l3.112 2.547c.213.174.245.49.07.704l-.632.773a.5.5 0 0 1-.703.07L13 13.11V17h5a3 3 0 1 0 0-6h-.027l-.875.008-.124-.866a2.5 2.5 0 0 0-3.287-2.007l-.767.263-.416-.694A3.5 3.5 0 0 0 9.5 6" class="wd-icon-fill"/>
297
297
  </svg>`,filename:"wd-icon-cloud-arrow-up.svg",category:"Data Stream",tags:["storage","store"]},Gte={name:"configure",type:Ia.System,svg:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="wd-icon wd-icon-configure" viewBox="0 0 24 24" role="presentation" focusable="false"><path fill="transparent" d="M2 6.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-5a.5.5 0 0 1-.5-.5zM9 14.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-5a.5.5 0 0 1-.5-.5zM16 7.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-5a.5.5 0 0 1-.5-.5z" class="wd-icon-background"/><path fill="oklch(0.3523 0 0 / 1)" d="M5.5 3a.5.5 0 0 1 .5.5V5h1.5A1.5 1.5 0 0 1 9 6.5v3A1.5 1.5 0 0 1 7.5 11H6v9.5a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5V11H2.5A1.5 1.5 0 0 1 1 9.5v-3A1.5 1.5 0 0 1 2.5 5H4V3.5a.5.5 0 0 1 .5-.5zM3 9h4V7H3zM12.5 3a.5.5 0 0 1 .5.5V13h1.5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5H13v1.5a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5V19H9.5A1.5 1.5 0 0 1 8 17.5v-3A1.5 1.5 0 0 1 9.5 13H11V3.5a.5.5 0 0 1 .5-.5zM10 17h4v-2h-4z" class="wd-icon-fill"/><path fill="oklch(0.3523 0 0 / 1)" d="M19.5 3a.5.5 0 0 1 .5.5V6h1.5A1.5 1.5 0 0 1 23 7.5v3a1.5 1.5 0 0 1-1.5 1.5H20v8.5a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5V12h-1.5a1.5 1.5 0 0 1-1.5-1.5v-3A1.5 1.5 0 0 1 16.5 6H18V3.5a.5.5 0 0 1 .5-.5zM17 10h4V8h-4z" class="wd-icon-fill"/>
298
298
  </svg>`,filename:"wd-icon-configure.svg",category:"Core",tags:["config","settings","preferences","sound board","configure"]},Hte={name:"user",type:Ia.System,svg:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="wd-icon wd-icon-user" viewBox="0 0 24 24" role="presentation" focusable="false"><path fill="transparent" d="M16 6a4 4 0 1 1-8 0 4 4 0 0 1 8 0M3 16.661a.5.5 0 0 1 .168-.371A13.45 13.45 0 0 1 12 13c3.377 0 6.465 1.24 8.832 3.29a.5.5 0 0 1 .168.371V20.5a.5.5 0 0 1-.5.5h-17a.5.5 0 0 1-.5-.5z" class="wd-icon-background"/><path fill="transparent" d="M21 16.661a.5.5 0 0 0-.168-.371A13.45 13.45 0 0 0 12 13c-3.377 0-6.465 1.24-8.832 3.29A.5.5 0 0 0 3 16.66V20.5a.5.5 0 0 0 .5.5h17a.5.5 0 0 0 .5-.5z" class="wd-icon-background"/><path fill="oklch(0.3523 0 0 / 1)" d="M12 12c3.627 0 6.944 1.333 9.486 3.534.334.289.514.704.514 1.127V20.5a1.5 1.5 0 0 1-1.5 1.5h-17a1.5 1.5 0 0 1-1.492-1.347L2 20.5v-3.839l.009-.158c.039-.367.213-.716.505-.969l.485-.402A14.44 14.44 0 0 1 12 12m0 2c-3.045 0-5.832 1.09-8 2.898V20h16v-3.102A12.44 12.44 0 0 0 12 14M12 1a5 5 0 1 1 0 10 5 5 0 0 1 0-10m0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6" class="wd-icon-fill"/>
299
- </svg>`,filename:"wd-icon-user.svg",category:"People",tags:["person","people","profile","avatar"]},qe=Xe({extends:dF,vars:{color:"",accentColor:"",backgroundColor:""},base:({size:e,accentColor:t,backgroundColor:n,color:a})=>({"& svg":{width:Z(e,ur.systemIcon.size.lg),height:Z(e,ur.systemIcon.size.lg)},".wd-icon .wd-icon-fill":{fill:Z(a,ur.systemIcon.color.fill)},".wd-icon .wd-icon-accent, & .wd-icon-accent2":{fill:Z(t,Z(a,ur.systemIcon.color.accent))},".wd-icon .wd-icon-background":{fill:Z(n,"transparent")},"@media (prefers-contrast: more)":{".wd-icon .wd-icon-fill, .wd-icon .wd-icon-accent":{color:"currentColor",fill:"currentColor"}}}),modifiers:{}}),gw=Be("span")({displayName:"SystemIcon",Component:({accent:e,background:t,color:n,icon:a,size:r,...i},o,s)=>S.jsx(jte,{as:s,src:a,type:Ia.System,ref:o,...Er(i,qe({size:zte(r,ur.systemIcon.size),color:n,accentColor:e,backgroundColor:t}))})}),Vte=oX(ute.as("span"))({position:"relative",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}),Wte=Be("span")({displayName:"ButtonLabel",Component:({children:e,...t},n,a)=>S.jsx(Vte,{as:a,ref:n,...t,children:e})}),Zte=Xe({base:{display:"inline-block"},modifiers:{size:{extraSmall:{[qe.vars.size]:ur.systemIcon.size.xs},small:{[qe.vars.size]:ur.systemIcon.size.md},medium:{[qe.vars.size]:ur.systemIcon.size.md},large:{[qe.vars.size]:ur.systemIcon.size.lg}}}}),Yte=Be("span")({Component:({icon:e,size:t="medium",shouldMirrorIcon:n=!1,shouldMirrorIconInRTL:a=!1,...r},i,o)=>e===void 0?null:S.jsx(gw,{ref:i,as:o,icon:e,shouldMirror:n,shouldMirrorInRTL:a,...Er(r,Zte({size:t}))})}),oe={default:Da("background","border","boxShadowInner","boxShadowOuter","icon","label","opacity","borderRadius"),focus:Da("background","border","boxShadowInner","boxShadowOuter","icon","label","opacity","borderRadius"),hover:Da("background","border","boxShadowInner","boxShadowOuter","icon","label","opacity","borderRadius"),active:Da("background","border","boxShadowInner","boxShadowOuter","icon","label","opacity","borderRadius"),disabled:Da("background","border","boxShadowInner","boxShadowOuter","icon","label","opacity","borderRadius")},ue=Xe({vars:{background:"",border:"",boxShadowInner:"",boxShadowOuter:"",label:"",opacity:"",borderRadius:""},base:({background:e,border:t,boxShadowInner:n,boxShadowOuter:a,label:r,opacity:i,borderRadius:o})=>({fontFamily:lt.default,fontSize:A.fontSize.subtext.lg,lineHeight:A.lineHeight.subtext.lg,letterSpacing:A.letterSpacing.subtext.lg,fontWeight:at.bold,backgroundColor:Z(oe.default.background,Z(e,"transparent")),color:Z(oe.default.label,Z(r,P.fg.strong)),borderWidth:We(1),borderStyle:"solid",gap:A.gap.sm,borderColor:Z(oe.default.border,Z(t,"transparent")),cursor:"pointer",display:"inline-flex",boxShadow:"none",alignItems:"center",justifyContent:"center",outline:`${We(2)} transparent`,whiteSpace:"nowrap",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",borderRadius:Z(oe.default.borderRadius,Z(o,A.shape.full)),position:"relative",verticalAlign:"middle",overflow:"hidden",[qe.vars.color]:Z(oe.default.icon,P.fg.strong),transition:"box-shadow 120ms linear, border 120ms linear, background-color 120ms linear, color 120ms linear","&:disabled, &:disabled:active, &.disabled":{cursor:"default",boxShadow:"none",opacity:Z(oe.default.opacity,Z(i,lr.full))},"&:focus-visible, &.focus":{backgroundColor:Z(oe.focus.background,Z(e,"transparent")),borderColor:Z(oe.focus.border,Z(t,"transparent")),color:Z(oe.focus.label,Z(r,P.fg.strong)),[qe.vars.color]:Z(oe.focus.icon,P.fg.strong),outline:`${We(2)} solid transparent`,outlineOffset:We(2),boxShadow:`0 0 0 ${We(2)} ${Z(oe.focus.boxShadowInner,Z(n,A.color.border.inverse.default))},0 0 0 ${We(4)} ${Z(oe.focus.boxShadowOuter,Z(a,A.color.brand.focus.primary))}`},"&:hover, &.hover":{backgroundColor:Z(oe.hover.background,Z(e,A.color.surface.contrast.strong)),borderColor:Z(oe.hover.border,Z(t,"transparent")),color:Z(oe.hover.label,Z(r,P.fg.stronger)),[qe.vars.color]:Z(oe.hover.icon,P.fg.stronger)},"&:hover:active":{transitionDuration:"40ms"},"&:active, &.active":{backgroundColor:Z(oe.active.background,Z(e,"transparent")),borderColor:Z(oe.active.border,Z(t,"transparent")),color:Z(oe.active.label,Z(r,P.fg.strong)),[qe.vars.color]:Z(oe.active.icon,P.fg.strong)},"&:disabled, &.disabled":{backgroundColor:Z(oe.disabled.background,Z(e,"transparent")),borderColor:Z(oe.disabled.border,Z(t,"transparent")),color:Z(oe.disabled.label,Z(r,P.fg.strong)),[qe.vars.color]:Z(oe.disabled.icon,"currentColor")},"@media (prefers-contrast: more)":{'&[aria-pressed="true"]':{outline:`${We(2)} solid transparent`,outlineOffset:`-${We(1)}`},'&[aria-pressed="true"]:focus-visible, &[aria-pressed="true"].focus':{outline:`${We(4)} double transparent`,outlineOffset:0}},svg:{pointerEvents:"none"}}),modifiers:{size:{large:{fontSize:A.fontSize.body.sm,lineHeight:A.lineHeight.body.sm,letterSpacing:A.letterSpacing.body.sm,height:A.size.lg,paddingInline:A.padding.xxl,minWidth:Ar.size1400},medium:{fontSize:A.fontSize.subtext.lg,lineHeight:A.lineHeight.subtext.lg,letterSpacing:A.letterSpacing.subtext.lg,minWidth:Ar.size1200,paddingInline:A.padding.xl,height:A.size.md},small:{fontSize:A.fontSize.subtext.lg,lineHeight:A.lineHeight.subtext.lg,letterSpacing:A.letterSpacing.subtext.lg,height:A.size.sm,minWidth:Ar.size1000,paddingInline:A.padding.md,gap:A.gap.xs},extraSmall:{fontSize:A.fontSize.subtext.md,lineHeight:A.lineHeight.subtext.md,letterSpacing:A.letterSpacing.subtext.md,height:A.size.xs,minWidth:"auto",paddingInline:A.padding.sm,gap:A.gap.xs}},grow:{true:{width:"100%",maxWidth:"100%"}},iconPosition:{only:{padding:0},start:{},end:{}}},compound:[{modifiers:{size:"large",iconPosition:"only"},styles:{minWidth:A.size.lg}},{modifiers:{size:"large",iconPosition:"start"},styles:{paddingInlineStart:A.padding.xl,paddingInlineEnd:A.padding.xxl}},{modifiers:{size:"large",iconPosition:"end"},styles:{paddingInlineStart:A.padding.xxl,paddingInlineEnd:A.padding.xl}},{modifiers:{size:"medium",iconPosition:"only"},styles:{minWidth:A.size.md}},{modifiers:{size:"medium",iconPosition:"start"},styles:{paddingInlineStart:A.padding.lg,paddingInlineEnd:A.padding.xl}},{modifiers:{size:"medium",iconPosition:"end"},styles:{paddingInlineStart:A.padding.xl,paddingInlineEnd:A.padding.lg}},{modifiers:{size:"small",iconPosition:"only"},styles:{minWidth:A.size.sm}},{modifiers:{size:"small",iconPosition:"start"},styles:{paddingInlineStart:A.padding.sm,paddingInlineEnd:A.padding.md}},{modifiers:{size:"small",iconPosition:"end"},styles:{paddingInlineStart:A.padding.md,paddingInlineEnd:A.padding.sm}},{modifiers:{size:"extraSmall",iconPosition:"only"},styles:{minWidth:A.size.xs}},{modifiers:{size:"extraSmall",iconPosition:"start"},styles:{paddingInlineStart:A.padding.xs,paddingInlineEnd:A.padding.sm}},{modifiers:{size:"extraSmall",iconPosition:"end"},styles:{paddingInlineStart:A.padding.sm,paddingInlineEnd:A.padding.xs}}]}),Ql=Be("button")({displayName:"BaseButton",Component:({children:e,size:t,fillIcon:n,grow:a,iconPosition:r,icon:i,colors:o,...s},l,u)=>S.jsx(u,{ref:l,type:"button",...ht(s,[ue({size:t,iconPosition:r,grow:a}),oe.default((o==null?void 0:o.default)||{}),oe.focus((o==null?void 0:o.focus)||{}),oe.hover((o==null?void 0:o.hover)||{}),oe.active((o==null?void 0:o.active)||{}),oe.disabled((o==null?void 0:o.disabled)||{})]),children:e}),subComponents:{Icon:Yte,Label:Wte}}),Kte=Be("button")({displayName:"Button",Component:({children:e,icon:t,colors:n,iconPosition:a,shouldMirrorIcon:r,shouldMirrorIconInRTL:i,size:o="medium",...s},l,u)=>{const c=a||(t?e?"start":"only":void 0);return S.jsxs(Ql,{as:u,ref:l,size:o,icon:t,colors:n,iconPosition:c,...s,children:[t&&c==="start"&&S.jsx(Ql.Icon,{size:o,icon:t,shouldMirrorIcon:r,shouldMirrorIconInRTL:i}),e&&S.jsx(Ql.Label,{children:e}),t&&c&&["only","end"].includes(c)&&S.jsx(Ql.Icon,{size:o,icon:t,shouldMirrorIcon:r,shouldMirrorIconInRTL:i})]})}}),Xte=Xe({extends:ue,base:{[ue.vars.background]:A.color.surface.transparent,[ue.vars.borderRadius]:A.shape.full,[ue.vars.border]:P.border.input.default,[ue.vars.label]:P.fg.default,[qe.vars.color]:Z(oe.default.icon,"currentColor"),"&:focus-visible, &.focus":{[ue.vars.background]:A.color.surface.default,[ue.vars.label]:P.fg.strong,[ue.vars.boxShadowInner]:A.color.focus.inverse,[ue.vars.boxShadowOuter]:A.color.brand.focus.primary,[qe.vars.color]:Z(oe.focus.icon,"currentColor")},"&:hover, &.hover":{[ue.vars.background]:Zl.darken({color:A.color.surface.transparent,mixinColor:A.color.surface.overlay.mixin,mixinValue:A.opacity.surface.hover}),[ue.vars.label]:P.fg.strong,[ue.vars.border]:A.color.border.input.hover,[qe.vars.color]:Z(oe.hover.icon,"currentColor")},"&:active, &.active":{[ue.vars.background]:Zl.darken({color:A.color.surface.transparent,mixinColor:A.color.surface.overlay.mixin,mixinValue:A.opacity.surface.pressed}),[ue.vars.label]:P.fg.strong,[ue.vars.border]:A.color.border.input.hover,[qe.vars.color]:Z(oe.active.icon,"currentColor")},"&:disabled, &.disabled":{[ue.vars.opacity]:lr.disabled,[ue.vars.background]:A.color.surface.transparent,[ue.vars.label]:P.fg.default,[qe.vars.color]:Z(oe.default.icon,"currentColor")}},modifiers:{variant:{inverse:{[ue.vars.background]:A.color.surface.transparent,[ue.vars.border]:A.color.border.inverse.default,[ue.vars.label]:P.fg.inverse,[qe.vars.color]:Z(oe.default.icon,"currentColor"),"&:hover, &.hover":{[ue.vars.background]:Zl.darken({color:A.color.surface.transparent,mixinColor:A.color.surface.overlay.mixin,mixinValue:A.opacity.surface.hover}),[ue.vars.border]:A.color.border.inverse.default,[ue.vars.label]:P.fg.inverse,[qe.vars.color]:Z(oe.hover.icon,"currentColor")},"&:focus-visible, &.focus":{[ue.vars.background]:A.color.surface.inverse,[ue.vars.border]:P.border.transparent,[ue.vars.label]:P.fg.contrast.default,[ue.vars.boxShadowInner]:P.border.contrast.default,[ue.vars.boxShadowOuter]:A.color.focus.inverse,[qe.vars.color]:Z(oe.focus.icon,"currentColor")},"&:active, &.active":{[ue.vars.background]:Zl.darken({color:A.color.surface.transparent,mixinColor:A.color.surface.overlay.mixin,mixinValue:A.opacity.surface.pressed}),[ue.vars.border]:A.color.border.inverse.default,[ue.vars.label]:P.fg.inverse,[qe.vars.color]:Z(oe.active.icon,"currentColor")},"&:disabled, &.disabled":{[ue.vars.opacity]:lr.disabled,[ue.vars.background]:A.color.surface.transparent,[ue.vars.label]:P.fg.inverse,[qe.vars.color]:Z(oe.default.icon,"currentColor")}}}}}),pF=Be("button")({displayName:"SecondaryButton",Component:({children:e,variant:t,size:n,iconPosition:a,grow:r,cs:i,...o},s,l)=>S.jsx(Kte,{as:l,ref:s,iconPosition:a,size:n,grow:r,cs:[Xte({variant:t,iconPosition:a,grow:r,size:n}),i],...o,children:e})});var bn="top",Cn="bottom",On="right",vn="left",hw="auto",bl=[bn,Cn,On,vn],Ii="start",bw="end",Jte="clippingParents",fF="viewport",co="popper",Qte="reference",yN=bl.reduce(function(e,t){return e.concat([t+"-"+Ii,t+"-"+bw])},[]),mF=[].concat(bl,[hw]).reduce(function(e,t){return e.concat([t,t+"-"+Ii,t+"-"+bw])},[]),ene="beforeRead",tne="read",nne="afterRead",rne="beforeMain",ane="main",ine="afterMain",one="beforeWrite",sne="write",lne="afterWrite",une=[ene,tne,nne,rne,ane,ine,one,sne,lne];function $n(e){return e?(e.nodeName||"").toLowerCase():null}function Ln(e){if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function rs(e){var t=Ln(e).Element;return e instanceof t||e instanceof Element}function Zn(e){var t=Ln(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function cne(e){var t=Ln(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function dne(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var a=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];!Zn(i)||!$n(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(o){var s=r[o];s===!1?i.removeAttribute(o):i.setAttribute(o,s===!0?"":s)}))})}function pne(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(a){var r=t.elements[a],i=t.attributes[a]||{},o=Object.keys(t.styles.hasOwnProperty(a)?t.styles[a]:n[a]),s=o.reduce(function(l,u){return l[u]="",l},{});!Zn(r)||!$n(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(l){r.removeAttribute(l)}))})}}const fne={name:"applyStyles",enabled:!0,phase:"write",fn:dne,effect:pne,requires:["computeStyles"]};function Vn(e){return e.split("-")[0]}function vw(e){return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function gF(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&cne(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function dr(e){return Ln(e).getComputedStyle(e)}function mne(e){return["table","td","th"].indexOf($n(e))>=0}function _r(e){return((rs(e)?e.ownerDocument:e.document)||window.document).documentElement}function Xd(e){return $n(e)==="html"?e:e.assignedSlot||e.parentNode||e.host||_r(e)}function SN(e){if(!Zn(e)||dr(e).position==="fixed")return null;var t=e.offsetParent;if(t){var n=_r(t);if($n(t)==="body"&&dr(t).position==="static"&&dr(n).position!=="static")return n}return t}function gne(e){for(var t=Xd(e);Zn(t)&&["html","body"].indexOf($n(t))<0;){var n=dr(t);if(n.transform!=="none"||n.perspective!=="none"||n.willChange&&n.willChange!=="auto")return t;t=t.parentNode}return null}function vl(e){for(var t=Ln(e),n=SN(e);n&&mne(n)&&dr(n).position==="static";)n=SN(n);return n&&$n(n)==="body"&&dr(n).position==="static"?t:n||gne(e)||t}function yw(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Su(e,t,n){return Math.max(e,Math.min(t,n))}function hF(){return{top:0,right:0,bottom:0,left:0}}function bF(e){return Object.assign(Object.assign({},hF()),e)}function vF(e,t){return t.reduce(function(n,a){return n[a]=e,n},{})}function hne(e){var t,n=e.state,a=e.name,r=n.elements.arrow,i=n.modifiersData.popperOffsets,o=Vn(n.placement),s=yw(o),l=[vn,On].indexOf(o)>=0,u=l?"height":"width";if(!(!r||!i)){var c=n.modifiersData[a+"#persistent"].padding,d=vw(r),p=s==="y"?bn:vn,g=s==="y"?Cn:On,b=n.rects.reference[u]+n.rects.reference[s]-i[s]-n.rects.popper[u],v=i[s]-n.rects.reference[s],I=vl(r),h=I?s==="y"?I.clientHeight||0:I.clientWidth||0:0,f=b/2-v/2,m=c[p],y=h-d[u]-c[g],_=h/2-d[u]/2+f,w=Su(m,_,y),k=s;n.modifiersData[a]=(t={},t[k]=w,t.centerOffset=w-_,t)}}function bne(e){var t=e.state,n=e.options,a=e.name,r=n.element,i=r===void 0?"[data-popper-arrow]":r,o=n.padding,s=o===void 0?0:o;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||gF(t.elements.popper,i)&&(t.elements.arrow=i,t.modifiersData[a+"#persistent"]={padding:bF(typeof s!="number"?s:vF(s,bl))}))}const vne={name:"arrow",enabled:!0,phase:"main",fn:hne,effect:bne,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};var yne={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Sne(e){var t=e.x,n=e.y,a=window,r=a.devicePixelRatio||1;return{x:Math.round(t*r)/r||0,y:Math.round(n*r)/r||0}}function EN(e){var t,n=e.popper,a=e.popperRect,r=e.placement,i=e.offsets,o=e.position,s=e.gpuAcceleration,l=e.adaptive,u=Sne(i),c=u.x,d=u.y,p=i.hasOwnProperty("x"),g=i.hasOwnProperty("y"),b=vn,v=bn,I=window;if(l){var h=vl(n);h===Ln(n)&&(h=_r(n)),r===bn&&(v=Cn,d-=h.clientHeight-a.height,d*=s?1:-1),r===vn&&(b=On,c-=h.clientWidth-a.width,c*=s?1:-1)}var f=Object.assign({position:o},l&&yne);if(s){var m;return Object.assign(Object.assign({},f),{},(m={},m[v]=g?"0":"",m[b]=p?"0":"",m.transform=(I.devicePixelRatio||1)<2?"translate("+c+"px, "+d+"px)":"translate3d("+c+"px, "+d+"px, 0)",m))}return Object.assign(Object.assign({},f),{},(t={},t[v]=g?d+"px":"",t[b]=p?c+"px":"",t.transform="",t))}function Ene(e){var t=e.state,n=e.options,a=n.gpuAcceleration,r=a===void 0?!0:a,i=n.adaptive,o=i===void 0?!0:i,s={placement:Vn(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign(Object.assign({},t.styles.popper),EN(Object.assign(Object.assign({},s),{},{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign(Object.assign({},t.styles.arrow),EN(Object.assign(Object.assign({},s),{},{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1})))),t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-placement":t.placement})}const _ne={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ene,data:{}};var eu={passive:!0};function wne(e){var t=e.state,n=e.instance,a=e.options,r=a.scroll,i=r===void 0?!0:r,o=a.resize,s=o===void 0?!0:o,l=Ln(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",n.update,eu)}),s&&l.addEventListener("resize",n.update,eu),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",n.update,eu)}),s&&l.removeEventListener("resize",n.update,eu)}}const kne={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:wne,data:{}};var Ine={left:"right",right:"left",bottom:"top",top:"bottom"};function Eu(e){return e.replace(/left|right|bottom|top/g,function(t){return Ine[t]})}var Tne={start:"end",end:"start"};function _N(e){return e.replace(/start|end/g,function(t){return Tne[t]})}function as(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function Sw(e){var t=Ln(e),n=t.pageXOffset,a=t.pageYOffset;return{scrollLeft:n,scrollTop:a}}function Ew(e){return as(_r(e)).left+Sw(e).scrollLeft}function xne(e){var t=Ln(e),n=_r(e),a=t.visualViewport,r=n.clientWidth,i=n.clientHeight,o=0,s=0;return a&&(r=a.width,i=a.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=a.offsetLeft,s=a.offsetTop)),{width:r,height:i,x:o+Ew(e),y:s}}function Rne(e){var t=_r(e),n=Sw(e),a=e.ownerDocument.body,r=Math.max(t.scrollWidth,t.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),i=Math.max(t.scrollHeight,t.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),o=-n.scrollLeft+Ew(e),s=-n.scrollTop;return dr(a||t).direction==="rtl"&&(o+=Math.max(t.clientWidth,a?a.clientWidth:0)-r),{width:r,height:i,x:o,y:s}}function _w(e){var t=dr(e),n=t.overflow,a=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+a)}function yF(e){return["html","body","#document"].indexOf($n(e))>=0?e.ownerDocument.body:Zn(e)&&_w(e)?e:yF(Xd(e))}function No(e,t){t===void 0&&(t=[]);var n=yF(e),a=$n(n)==="body",r=Ln(n),i=a?[r].concat(r.visualViewport||[],_w(n)?n:[]):n,o=t.concat(i);return a?o:o.concat(No(Xd(i)))}function Vv(e){return Object.assign(Object.assign({},e),{},{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ane(e){var t=as(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function wN(e,t){return t===fF?Vv(xne(e)):Zn(t)?Ane(t):Vv(Rne(_r(e)))}function Nne(e){var t=No(Xd(e)),n=["absolute","fixed"].indexOf(dr(e).position)>=0,a=n&&Zn(e)?vl(e):e;return rs(a)?t.filter(function(r){return rs(r)&&gF(r,a)&&$n(r)!=="body"}):[]}function Cne(e,t,n){var a=t==="clippingParents"?Nne(e):[].concat(t),r=[].concat(a,[n]),i=r[0],o=r.reduce(function(s,l){var u=wN(e,l);return s.top=Math.max(u.top,s.top),s.right=Math.min(u.right,s.right),s.bottom=Math.min(u.bottom,s.bottom),s.left=Math.max(u.left,s.left),s},wN(e,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function is(e){return e.split("-")[1]}function SF(e){var t=e.reference,n=e.element,a=e.placement,r=a?Vn(a):null,i=a?is(a):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(r){case bn:l={x:o,y:t.y-n.height};break;case Cn:l={x:o,y:t.y+t.height};break;case On:l={x:t.x+t.width,y:s};break;case vn:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=r?yw(r):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case Ii:l[u]=Math.floor(l[u])-Math.floor(t[c]/2-n[c]/2);break;case bw:l[u]=Math.floor(l[u])+Math.ceil(t[c]/2-n[c]/2);break}}return l}function Ti(e,t){t===void 0&&(t={});var n=t,a=n.placement,r=a===void 0?e.placement:a,i=n.boundary,o=i===void 0?Jte:i,s=n.rootBoundary,l=s===void 0?fF:s,u=n.elementContext,c=u===void 0?co:u,d=n.altBoundary,p=d===void 0?!1:d,g=n.padding,b=g===void 0?0:g,v=bF(typeof b!="number"?b:vF(b,bl)),I=c===co?Qte:co,h=e.elements.reference,f=e.rects.popper,m=e.elements[p?I:c],y=Cne(rs(m)?m:m.contextElement||_r(e.elements.popper),o,l),_=as(h),w=SF({reference:_,element:f,placement:r}),k=Vv(Object.assign(Object.assign({},f),w)),C=c===co?k:_,O={top:y.top-C.top+v.top,bottom:C.bottom-y.bottom+v.bottom,left:y.left-C.left+v.left,right:C.right-y.right+v.right},D=e.modifiersData.offset;if(c===co&&D){var H=D[r];Object.keys(O).forEach(function(ee){var te=[On,Cn].indexOf(ee)>=0?1:-1,ve=[bn,Cn].indexOf(ee)>=0?"y":"x";O[ee]+=H[ve]*te})}return O}function One(e,t){t===void 0&&(t={});var n=t,a=n.placement,r=n.boundary,i=n.rootBoundary,o=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?mF:l,c=is(a),d=c?s?yN:yN.filter(function(b){return is(b)===c}):bl,p=d.filter(function(b){return u.indexOf(b)>=0});p.length===0&&(p=d);var g=p.reduce(function(b,v){return b[v]=Ti(e,{placement:v,boundary:r,rootBoundary:i,padding:o})[Vn(v)],b},{});return Object.keys(g).sort(function(b,v){return g[b]-g[v]})}function $ne(e){if(Vn(e)===hw)return[];var t=Eu(e);return[_N(e),t,_N(t)]}function Lne(e){var t=e.state,n=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var r=n.mainAxis,i=r===void 0?!0:r,o=n.altAxis,s=o===void 0?!0:o,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,p=n.altBoundary,g=n.flipVariations,b=g===void 0?!0:g,v=n.allowedAutoPlacements,I=t.options.placement,h=Vn(I),f=h===I,m=l||(f||!b?[Eu(I)]:$ne(I)),y=[I].concat(m).reduce(function(ge,Ne){return ge.concat(Vn(Ne)===hw?One(t,{placement:Ne,boundary:c,rootBoundary:d,padding:u,flipVariations:b,allowedAutoPlacements:v}):Ne)},[]),_=t.rects.reference,w=t.rects.popper,k=new Map,C=!0,O=y[0],D=0;D<y.length;D++){var H=y[D],ee=Vn(H),te=is(H)===Ii,ve=[bn,Cn].indexOf(ee)>=0,_e=ve?"width":"height",me=Ti(t,{placement:H,boundary:c,rootBoundary:d,altBoundary:p,padding:u}),we=ve?te?On:vn:te?Cn:bn;_[_e]>w[_e]&&(we=Eu(we));var L=Eu(we),B=[];if(i&&B.push(me[ee]<=0),s&&B.push(me[we]<=0,me[L]<=0),B.every(function(ge){return ge})){O=H,C=!1;break}k.set(H,B)}if(C)for(var q=b?3:1,V=function(Ne){var Oe=y.find(function(Je){var sn=k.get(Je);if(sn)return sn.slice(0,Ne).every(function(Ta){return Ta})});if(Oe)return O=Oe,"break"},Y=q;Y>0;Y--){var He=V(Y);if(He==="break")break}t.placement!==O&&(t.modifiersData[a]._skip=!0,t.placement=O,t.reset=!0)}}const Dne={name:"flip",enabled:!0,phase:"main",fn:Lne,requiresIfExists:["offset"],data:{_skip:!1}};function kN(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function IN(e){return[bn,On,Cn,vn].some(function(t){return e[t]>=0})}function Mne(e){var t=e.state,n=e.name,a=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,o=Ti(t,{elementContext:"reference"}),s=Ti(t,{altBoundary:!0}),l=kN(o,a),u=kN(s,r,i),c=IN(l),d=IN(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const Pne={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Mne};function Une(e,t,n){var a=Vn(e),r=[vn,bn].indexOf(a)>=0?-1:1,i=typeof n=="function"?n(Object.assign(Object.assign({},t),{},{placement:e})):n,o=i[0],s=i[1];return o=o||0,s=(s||0)*r,[vn,On].indexOf(a)>=0?{x:s,y:o}:{x:o,y:s}}function Fne(e){var t=e.state,n=e.options,a=e.name,r=n.offset,i=r===void 0?[0,0]:r,o=mF.reduce(function(c,d){return c[d]=Une(d,t.rects,i),c},{}),s=o[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[a]=o}const zne={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Fne};function jne(e){var t=e.state,n=e.name;t.modifiersData[n]=SF({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Bne={name:"popperOffsets",enabled:!0,phase:"read",fn:jne,data:{}};function qne(e){return e==="x"?"y":"x"}function Gne(e){var t=e.state,n=e.options,a=e.name,r=n.mainAxis,i=r===void 0?!0:r,o=n.altAxis,s=o===void 0?!1:o,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,p=n.tether,g=p===void 0?!0:p,b=n.tetherOffset,v=b===void 0?0:b,I=Ti(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),h=Vn(t.placement),f=is(t.placement),m=!f,y=yw(h),_=qne(y),w=t.modifiersData.popperOffsets,k=t.rects.reference,C=t.rects.popper,O=typeof v=="function"?v(Object.assign(Object.assign({},t.rects),{},{placement:t.placement})):v,D={x:0,y:0};if(w){if(i){var H=y==="y"?bn:vn,ee=y==="y"?Cn:On,te=y==="y"?"height":"width",ve=w[y],_e=w[y]+I[H],me=w[y]-I[ee],we=g?-C[te]/2:0,L=f===Ii?k[te]:C[te],B=f===Ii?-C[te]:-k[te],q=t.elements.arrow,V=g&&q?vw(q):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:hF(),He=Y[H],ge=Y[ee],Ne=Su(0,k[te],V[te]),Oe=m?k[te]/2-we-Ne-He-O:L-Ne-He-O,Je=m?-k[te]/2+we+Ne+ge+O:B+Ne+ge+O,sn=t.elements.arrow&&vl(t.elements.arrow),Ta=sn?y==="y"?sn.clientTop||0:sn.clientLeft||0:0,xa=t.modifiersData.offset?t.modifiersData.offset[t.placement][y]:0,Ra=w[y]+Oe-xa-Ta,Jd=w[y]+Je-xa,Aa=Su(g?Math.min(_e,Ra):_e,ve,g?Math.max(me,Jd):me);w[y]=Aa,D[y]=Aa-ve}if(s){var ZF=y==="x"?bn:vn,YF=y==="x"?Cn:On,Sl=w[_],KF=Sl+I[ZF],XF=Sl-I[YF],Iw=Su(KF,Sl,XF);w[_]=Iw,D[_]=Iw-Sl}t.modifiersData[a]=D}}const Hne={name:"preventOverflow",enabled:!0,phase:"main",fn:Gne,requiresIfExists:["offset"]};function Vne(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Wne(e){return e===Ln(e)||!Zn(e)?Sw(e):Vne(e)}function Zne(e,t,n){n===void 0&&(n=!1);var a=_r(t),r=as(e),i=Zn(t),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(i||!i&&!n)&&(($n(t)!=="body"||_w(a))&&(o=Wne(t)),Zn(t)?(s=as(t),s.x+=t.clientLeft,s.y+=t.clientTop):a&&(s.x=Ew(a))),{x:r.left+o.scrollLeft-s.x,y:r.top+o.scrollTop-s.y,width:r.width,height:r.height}}function Yne(e){var t=new Map,n=new Set,a=[];e.forEach(function(i){t.set(i.name,i)});function r(i){n.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&r(l)}}),a.push(i)}return e.forEach(function(i){n.has(i.name)||r(i)}),a}function Kne(e){var t=Yne(e);return une.reduce(function(n,a){return n.concat(t.filter(function(r){return r.phase===a}))},[])}function Xne(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Jne(e){var t=e.reduce(function(n,a){var r=n[a.name];return n[a.name]=r?Object.assign(Object.assign(Object.assign({},r),a),{},{options:Object.assign(Object.assign({},r.options),a.options),data:Object.assign(Object.assign({},r.data),a.data)}):a,n},{});return Object.keys(t).map(function(n){return t[n]})}var TN={placement:"bottom",modifiers:[],strategy:"absolute"};function xN(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(a){return!(a&&typeof a.getBoundingClientRect=="function")})}function Qne(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,a=n===void 0?[]:n,r=t.defaultOptions,i=r===void 0?TN:r;return function(s,l,u){u===void 0&&(u=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign(Object.assign({},TN),i),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],p=!1,g={state:c,setOptions:function(h){v(),c.options=Object.assign(Object.assign(Object.assign({},i),c.options),h),c.scrollParents={reference:rs(s)?No(s):s.contextElement?No(s.contextElement):[],popper:No(l)};var f=Kne(Jne([].concat(a,c.options.modifiers)));return c.orderedModifiers=f.filter(function(m){return m.enabled}),b(),g.update()},forceUpdate:function(){if(!p){var h=c.elements,f=h.reference,m=h.popper;if(xN(f,m)){c.rects={reference:Zne(f,vl(m),c.options.strategy==="fixed"),popper:vw(m)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(D){return c.modifiersData[D.name]=Object.assign({},D.data)});for(var y=0;y<c.orderedModifiers.length;y++){if(c.reset===!0){c.reset=!1,y=-1;continue}var _=c.orderedModifiers[y],w=_.fn,k=_.options,C=k===void 0?{}:k,O=_.name;typeof w=="function"&&(c=w({state:c,options:C,name:O,instance:g})||c)}}}},update:Xne(function(){return new Promise(function(I){g.forceUpdate(),I(c)})}),destroy:function(){v(),p=!0}};if(!xN(s,l))return g;g.setOptions(u).then(function(I){!p&&u.onFirstUpdate&&u.onFirstUpdate(I)});function b(){c.orderedModifiers.forEach(function(I){var h=I.name,f=I.options,m=f===void 0?{}:f,y=I.effect;if(typeof y=="function"){var _=y({state:c,name:h,instance:g,options:m}),w=function(){};d.push(_||w)}})}function v(){d.forEach(function(I){return I()}),d=[]}return g}}var ere=[kne,Bne,_ne,fne,zne,Dne,Hne,vne,Pne],tre=Qne({defaultModifiers:ere});const nre=["top","top-start","top-end","bottom","bottom-start","bottom-end","right","right-start","right-end","left","left-start","left-end","auto","auto-start","auto-end"],rre=e=>{const[t,n]=e.split("-");let a;switch(t){case"top":a="bottom";break;case"bottom":a="top";break;case"left":a="right";break;case"right":a="left";break;default:a="auto"}return n&&(a=nre.find(r=>r.includes(`${a}-${n}`))??a),a},EF=(e,t,n)=>{if(e.length===0||e[0].split("-")[0]==="auto")return n;const{reference:a,popper:r}=t.rects,i=Ti({...t,placement:e[0]}),o=/left|right/.test(e[0].split("-")[0])?"horizontal":"vertical",s=(i.top>0||i.bottom>0||i.left>0||i.right>0)&&(o==="horizontal"?r.height/2-i.top<a.height||r.height/2-i.bottom<a.height:r.width-i.left<a.width||r.width-i.right<a.width),l=e[0].split("-")[0];return!s&&i[l]<=0?e[0]:EF(e.slice(1),t,n)},RN="fallbackModifier",AN={name:RN,enabled:!0,phase:"main",data:{_skip:!1},fn({state:e,options:t}){const n=e.options.placement,{fallbackPlacements:a}=t,r=[n,rre(n),...a||[]],i=EF(r,e,n);e.placement!==i&&(e.modifiersData[RN]._skip=!0,e.placement=i,e.reset=!0)}},_F=["top","right","bottom","left"],ww=J.forwardRef(({portal:e=!0,open:t=!0,...n},a)=>t?S.jsx(ore,{ref:a,portal:e,...n}):null),are=e=>{if(e!==null)return"current"in e?e.current||void 0:e},ire={},ore=J.forwardRef(({anchorElement:e,getAnchorClientRect:t,popperOptions:n=ire,placement:a="bottom",fallbackPlacements:r=_F,onPlacementChange:i,children:o,portal:s,popperInstanceRef:l},u)=>{const c=J.useRef(!0),{localRef:d,elementRef:p}=Wd(l),[g,b]=J.useState(a),v=Mte(u,e),I=J.useRef(a);I.current=g;const h=J.useMemo(()=>({name:"setPlacement",enabled:!0,phase:"afterWrite",fn({state:m}){b(m.placement),i==null||i(m.placement)}}),[b,i]);J.useLayoutEffect(()=>{const m=t?{getBoundingClientRect:t}:are(e??null);if(!m){console.warn("Popper: neither anchorElement or getAnchorClientRect was defined. A valid anchorElement or getAnchorClientRect callback must be provided to render a Popper");return}if(v.current){const y=tre(m,v.current,{placement:a,...n,modifiers:[h,{...AN,options:{fallbackPlacements:r}},...n.modifiers||[]]});return p(y),()=>{y==null||y.destroy()}}},[e,t,v]),J.useLayoutEffect(()=>{var m;c.current||(m=d.current)==null||m.setOptions({placement:a,...n,modifiers:[h,{...AN,options:{fallbackPlacements:r}},...n.modifiers||[]]}),c.current=!1},[n,a,r,h,d]);const f=S.jsx(S.Fragment,{children:sre(o)?o({placement:g}):o});return s?By.createPortal(f,v.current):f});function sre(e){return typeof e=="function"}const Ut=Zr({defaultConfig:{...Ya.defaultConfig,...ta.defaultConfig,mode:"single",shouldVirtualize:!1},requiredConfig:{...Ya.requiredConfig,...ta.requiredConfig},contextOverride:ta.Context})(e=>{const t=Ya(Ya.mergeConfig(e,{selection:e.mode==="single"?LU:vee})),n=ta(ta.mergeConfig(e,{id:t.state.id,onHide(){t.state.indexRef.current=0}}));iF(n),oF(n);const a={mode:e.mode,...t.state,...n.state},r={...t.events,...n.events};return{...t,...n,state:a,events:r,UNSTABLE_parentModel:e.UNSTABLE_parentModel}}),lre=Xe({vars:{minWidth:We(1),transformOriginVertical:"top",transformOriginHorizontal:"left",maxHeight:""},base:({transformOriginVertical:e,transformOriginHorizontal:t,minWidth:n,maxHeight:a})=>({fontFamily:lt.default,fontWeight:at.normal,fontSize:A.fontSize.subtext.lg,lineHeight:A.lineHeight.subtext.lg,letterSpacing:A.letterSpacing.subtext.lg,color:P.fg.default,position:"relative",display:"flex",flexDirection:"column",transition:"transform ease-out 150ms",padding:A.padding.xxs,borderRadius:A.shape.xxl,maxWidth:zn.subtract("100vw",A.size.sm),boxShadow:bU[3],minWidth:n,maxHeight:a,transformOrigin:`${e} ${t}`,".wd-no-animation &":{animation:"none"}})}),ure=Me()(()=>({})),wF=an("div")({displayName:"Menu.Card",modelHook:Ut,elemPropsHook:ure})(({minWidth:e,maxHeight:t,...n},a,r)=>{const i=J.useMemo(()=>cF(r.state.placement||"bottom"),[r.state.placement]);return S.jsx(Rte,{as:a,...ht(n,lre({minWidth:typeof e=="number"?We(e):e,maxHeight:typeof t=="number"?We(t):t,transformOriginVertical:i.vertical,transformOriginHorizontal:i.horizontal})),children:n.children})}),cre=Xe({base:{display:"block",height:We(1),border:"none",borderTop:`${We(1)} solid ${A.color.border.default}`,margin:`${A.gap.sm} ${A.gap.md}`}}),kF=Be("hr")({displayName:"Menu.Divider",Component({...e},t,n){return S.jsx(n,{ref:t,...Er(e,cre())})}}),NN={vertical:"bottom",horizontal:"center"},Wv=Da("positionX","positionY"),dre=SQ({"0%":{opacity:0,transform:`translate(${Wv.positionX}, ${Wv.positionY})`},"100%":{opacity:1,transform:"translate(0)"}}),pre=Xe({vars:{tooltipTransformOriginHorizontal:"",tooltipTransformOriginVertical:""},base:({tooltipTransformOriginHorizontal:e,tooltipTransformOriginVertical:t})=>({fontFamily:lt.default,fontWeight:at.normal,fontSize:A.fontSize.subtext.md,lineHeight:A.lineHeight.subtext.md,letterSpacing:A.letterSpacing.subtext.md,display:"inline-flex",position:"relative",padding:A.padding.sm,color:P.fg.inverse,animationName:dre,animationDuration:"150ms",animationTimingFunction:"ease-out",transformOrigin:`${t} ${e}`,a:{color:P.fg.inverse,textDecoration:"underline"},"&:before":{content:'""',borderRadius:A.shape.md,outline:`${We(1)} solid transparent`,outlineOffset:`-${We(1)}`,zIndex:-1,margin:A.gap.xs,backgroundColor:A.color.surface.contrast.default,position:"absolute",top:0,left:0,right:0,bottom:0,boxShadow:bU[2]},"[data-popper-reference-hidden] &":{visibility:"hidden",pointerEvents:"none"},'[data-popper-placement="top-start"] &, [data-popper-placement="bottom-start"] &':{left:zn.negate(Ar.size50)},'[data-popper-placement="top-end"] &, [data-popper-placement="bottom-end"] &':{right:zn.negate(Ar.size50)},'[data-popper-placement="left-start"] &, [data-popper-placement="right-start"] &':{top:zn.negate(Ar.size50)},'[data-popper-placement="left-end"] &, [data-popper-placement="right-end"] &':{bottom:zn.negate(Ar.size50)}}),modifiers:{elementHasFocus:{true:{padding:zn.subtract(A.padding.md,zn.divide(A.padding.xxs,2)),"&:before":{margin:Ar.size75}}}}}),fre=Be("div")({displayName:"TooltipContainer",Component:({children:e,transformOrigin:t=NN,elementHasFocus:n=!1,...a},r,i)=>{const o=zQ(t||NN,A.gap.sm);return S.jsx(i,{ref:r,...ht(a,[pre({tooltipTransformOriginHorizontal:t==null?void 0:t.horizontal,tooltipTransformOriginVertical:t==null?void 0:t.vertical,elementHasFocus:n}),Wv({positionX:o.x,positionY:o.y})]),children:e})}}),CN=(e,t=0)=>{const n=J.useRef(),a=()=>{n.current=window.setTimeout(e,t)},r=()=>{window.clearTimeout(n.current),n.current=void 0};return J.useEffect(()=>()=>{window.clearTimeout(n.current)},[n]),{start:a,clear:r}},mre=e=>{const t=e.tagName.toLowerCase(),n=e.getAttribute("tabindex");switch(t){case"button":case"input":case"select":case"textarea":case"details":return!0;default:return n?Number(n)>=0:!1}};function gre({type:e="label",titleText:t="",showDelay:n=300,hideDelay:a=100}={}){const r=J.useRef(!1),i=ta(),[o,s]=J.useState(null),l=Hd(),u=CN(i.events.hide,a),c=CN(i.events.show,n),d=()=>{u.start(),c.clear()},p=()=>{c.start(),u.clear()},g=f=>{s(f.currentTarget),p()},b=f=>{r.current||g(f),r.current=!1},v=f=>{r.current=!0,mre(f.currentTarget)&&i.events.hide()};oF(i),iF(i),Ote(i),$te(i);const I=i.state.visibility!=="hidden",h={"aria-describedby":e==="describe"&&I?l:void 0,"aria-description":e==="description"?t:void 0,"aria-label":e==="label"?t:void 0,onMouseEnter:g,onMouseLeave:d,onMouseDown:v,onFocus:b,onBlur:d};return h["aria-describedby"]===void 0&&delete h["aria-describedby"],{targetProps:h,popperProps:{open:I,anchorElement:o,ref:i.state.stackRef},tooltipProps:{id:e==="describe"&&I?l:void 0,role:"tooltip",onMouseEnter:p,onMouseLeave:d}}}const IF=e=>{const t=getComputedStyle(e);if(t.overflow==="auto"||t.overflow==="scroll"||t.overflow==="clip"||t.overflow==="hidden")return e;if(e.children){for(let n=0;n<e.children.length;n++){const a=IF(e.children[n]);if(a)return a}return null}return null},TF=e=>{const t=getComputedStyle(e);if(t.textOverflow==="ellipsis"||Number(t.webkitLineClamp)>0)return e;for(let n=0;n<e.children.length;n++){const a=TF(e.children[n]);if(a)return a}return null},ON=e=>{const t=TF(e)||IF(e);return t?t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight:!1};function hre(e,t,n=Object.keys(t)){return n.reduce((a,r)=>(typeof e[r]=="function"?a[r]=kU(t[r],e[r]):a[r]=t[r],a),{})}const kw=({placement:e="top",fallbackPlacements:t=_F,children:n,...a})=>{const[r,i]=J.useState(""),{targetProps:o,popperProps:s,tooltipProps:l}=gre({type:"muted"}),u=d=>{const p=d.currentTarget;i(p instanceof HTMLElement?p.innerText:""),ON(p)&&o.onMouseEnter(d)},c=d=>{const p=d.currentTarget;i(p instanceof HTMLElement?p.innerText:""),ON(p)&&o.onFocus(d)};return S.jsxs(J.Fragment,{children:[J.cloneElement(n,{...o,onMouseEnter:u,onFocus:c,"aria-label":void 0,...hre({...o,onMouseEnter:u,onFocus:c},n.props)}),S.jsx(ww,{placement:e,fallbackPlacements:t,...s,children:({placement:d})=>{const p=cF(d);return S.jsx(fre,{transformOrigin:p,...l,...a,children:r})}})]})},xF=Zr({defaultConfig:{id:void 0},requiredConfig:{}})(e=>({state:{id:Hd(e.id)},events:{}})),bre=Xe({base:{fontFamily:lt.default,fontSize:A.fontSize.subtext.lg,lineHeight:A.lineHeight.subtext.lg,letterSpacing:A.letterSpacing.subtext.lg,fontWeight:at.bold,display:"flex",alignItems:"center",width:"100%",gap:A.gap.md,padding:`${A.padding.xs} ${A.padding.md}`}}),vre=Me()(e=>({"data-type":"group",role:"group","aria-labelledby":e.state.id})),yre=Me()(e=>({id:e.state.id})),$N=an("div")({modelHook:xF,elemPropsHook:yre})(({children:e,...t},n)=>S.jsx(kw,{children:S.jsx(n,{...ht(t,bre()),children:e})})),RF=Vd("div")({displayName:"Menu.Group",modelHook:xF,elemPropsHook:vre,subComponents:{Heading:$N}})(({children:e,title:t,...n},a)=>S.jsxs(a,{...ht(n),children:[t?S.jsx($N,{children:t}):null,e]})),yl=Xe({parts:{text:"menu-item-text",icon:"menu-item-icon",selected:"menu-item-selected"},base:({textPart:e,iconPart:t,selectedPart:n})=>({fontFamily:lt.default,fontWeight:at.normal,fontSize:A.fontSize.subtext.lg,lineHeight:A.lineHeight.subtext.lg,letterSpacing:A.letterSpacing.subtext.lg,display:"flex",alignItems:"center",width:"100%",gap:A.gap.md,padding:`${A.padding.sm} ${A.padding.md}`,boxSizing:"border-box",cursor:"pointer",color:P.fg.default,borderWidth:0,borderRadius:A.shape.xxl,textAlign:"start",transition:"background-color 80ms, color 80ms",backgroundColor:"inherit",minHeight:A.size.md,overflowWrap:"anywhere",[qe.vars.color]:"currentColor",[`& :where(${n})`]:{transition:"opacity 80ms linear",opacity:lr.zero},"&:where(:has(span))":{display:"flex"},"&[aria-selected=true]":{color:A.color.brand.fg.primary.strong,backgroundColor:A.color.brand.surface.primary.strong,[`& :where(${n})`]:{opacity:lr.full},"&:where(.focus, :focus-visible)":{[qe.vars.color]:"currentColor",outline:"none",backgroundColor:A.color.brand.accent.primary,color:P.fg.inverse}},"&:is(.hover, :hover)":{color:P.fg.strong,backgroundColor:A.color.surface.overlay.hover.default},"&:is(.focus, :focus-visible)":{color:P.fg.inverse,backgroundColor:A.color.brand.accent.primary,outline:`${We(2)} solid transparent`,outlineOffset:`-${We(2)}`},"&:is(:disabled, [aria-disabled=true])":{cursor:"default",opacity:lr.disabled,"&:where(.hover, :hover, [aria-selected=true])":{background:"none"},"&:where(.focus, :focus-visible)":{backgroundColor:A.color.brand.accent.primary,opacity:lr.disabled}},[`& :where(${e})`]:{flexGrow:1,alignSelf:"center"},[`& :where(${t})`]:{alignSelf:"start"}})}),Sre=e=>S.jsx(gw,{...yl.parts.icon,...e}),AF=Be("span")({Component:({...e},t,n)=>S.jsx(n,{ref:t,...yl.parts.text,...Er(e)})}),NF=Be("button")({displayName:"MenuItem",Component:({children:e,isDisabled:t,...n},a,r)=>S.jsx(r,{ref:a,"aria-disabled":t,...ht(n,yl({})),children:typeof e=="string"?S.jsx(AF,{children:e}):e})}),CF=Me()(e=>({onKeyDown(t){const n=getComputedStyle(t.currentTarget);t.key==="ArrowLeft"&&n.direction==="ltr"&&e.UNSTABLE_parentModel&&e.events.hide(t)}})),OF=Me()((e,t,n={"data-id":""})=>{const{localRef:a,elementRef:r}=Wd(t),i=n["data-id"];return J.useLayoutEffect(()=>{e.state.mode==="single"&&lc(e.state,i)&&requestAnimationFrame(()=>{var o;(o=a.current)==null||o.focus()})},[i,a,e.state.cursorId,e.state.mode]),{ref:r,className:lc(e.state,n["data-id"])?"focus":void 0}});function $F(e){e.UNSTABLE_parentModel&&(e.UNSTABLE_parentModel.events.hide(),$F(e.UNSTABLE_parentModel))}const Ere=Zi(Me()(e=>({role:"menuitem",onMouseDown(t){e.events.goTo({id:t.currentTarget.getAttribute("data-id")})},onClick:e.state.mode==="single"?t=>{t.currentTarget.getAttribute("aria-disabled")!=="true"&&(e.events.hide(t),$F(e))}:void 0})),OF,CF,wee,MU,Kd),xi=an("button")({displayName:"Menu.Item",modelHook:Ut,elemPropsHook:Ere,subComponents:{Icon:Sre,Text:AF}})(({children:e,...t},n)=>S.jsx(kw,{placement:"left",children:S.jsx(NF,{as:n,...t,children:e})})),_re=Zi(Me()(e=>({role:"menu","aria-labelledby":e.state.id,"aria-orientation":e.state.orientation})),Fte,Lte),wre=Xe({base:{background:A.color.surface.popover,borderRadius:A.shape.xxl,padding:0,gap:A.gap.xs},modifiers:{orientation:{vertical:{flexDirection:"column"},horizontal:{flexDirection:"row"}}}}),LF=an("div")({displayName:"Menu.List",modelHook:Ut,elemPropsHook:_re})(({children:e,...t},n,a)=>S.jsx(vte,{as:n,model:a,marginY:A.gap.none,...Er(t,wre({orientation:a.state.orientation})),children:e})),DF=Be("span")({Component:({...e},t,n)=>S.jsxs(S.Fragment,{children:[S.jsx(xi.Text,{ref:t,as:n,...e}),S.jsx(gw,{...yl.parts.selected,icon:Bte})]})}),kre=Be("li")({displayName:"MenuOption",Component:({children:e,...t},n,a)=>S.jsx(a,{ref:n,...ht(t,yl()),children:typeof e=="string"?S.jsx(DF,{children:e}):e})}),Ire=Zi(Me()((e,t,n={})=>{const a=n["data-id"]||"";return{role:"option","aria-selected":bee(a,e.state),onMouseDown:o=>{o.button===0&&o.currentTarget.getAttribute("aria-disabled")!=="true"&&(e.events.select({id:a}),e.state.mode==="single"&&e.events.hide(o)),o.preventDefault()}}}),kee,Kd),MF=an("li")({displayName:"Menu.Item",modelHook:Ut,elemPropsHook:Ire,subComponents:{Icon:xi.Icon,Text:DF}})(({children:e,...t},n)=>S.jsx(kw,{placement:"left",children:S.jsx(kre,{as:n,...t,children:e})})),PF=Dte,UF={modifiers:[{name:"offset",options:{offset:()=>[0,4]}}]},Tre=an("div")({modelHook:Ut,elemPropsHook:PF})(({children:e,...t})=>S.jsx(ww,{placement:"bottom-start",popperOptions:UF,...t,children:e})),FF=Me()(e=>({id:e.state.id,"aria-haspopup":"true","aria-expanded":e.state.visibility==="visible",onKeyDown(t){switch(t.key){case"ArrowDown":case"ArrowUp":e.events.show(t)}}})),xre=Zi(FF,Pte),Rre=Zi(FF,Ute),Are=an(pF)({displayName:"Menu.Target",modelHook:Ut,elemPropsHook:xre})(({children:e,...t},n)=>S.jsx(n,{...t,children:e})),Nre=an(pF)({displayName:"Menu.Target",modelHook:Ut,elemPropsHook:Rre})(({children:e,...t},n)=>S.jsx(n,{...t,children:e})),Cre=an("div")({modelHook:Ut,elemPropsHook:PF})(({children:e,...t})=>S.jsx(ww,{placement:"right-start",popperOptions:UF,...t,children:e})),Ore=(e,t=0)=>{const n=z.useRef(),a=()=>{n.current=window.setTimeout(e,t)},r=()=>{window.clearTimeout(n.current),n.current=void 0};return z.useEffect(()=>()=>{window.clearTimeout(n.current)},[n]),{start:a,clear:r}},$re=Zi(Yl(e=>e.UNSTABLE_parentModel,OF),Yl(e=>e.UNSTABLE_parentModel,CF),Yl(e=>e.UNSTABLE_parentModel,MU),Me()((e,t)=>({ref:Wi(t,e.state.targetRef)})),Yl(e=>e.UNSTABLE_parentModel,Kd),Me()(e=>{const t=z.useRef(),n=Ore(()=>{e.UNSTABLE_parentModel.events.goTo({id:t.current||""}),e.events.show(event)},300);return{id:e.state.id,role:"menuitem","aria-haspopup":"true","aria-expanded":e.state.visibility==="visible",onMouseDown(a){e.UNSTABLE_parentModel.events.goTo({id:a.currentTarget.getAttribute("data-id")})},onMouseEnter(a){t.current=a.currentTarget.getAttribute("data-id"),n.start()},onMouseLeave(){n.clear()},onClick(a){e.state.targetRef.current instanceof Element||(e.state.targetRef.current=a.currentTarget),e.state.visibility!=="hidden"?e.events.hide(a):e.events.show(a)},"data-has-children":!0,onKeyDown(a){if(e.state.orientation==="vertical")switch(a.key){case"ArrowRight":case"Enter":case" ":e.events.show(a);break}}}})),Lre=an("button")({modelHook:Ut,elemPropsHook:$re})(({children:e,...t},n)=>S.jsxs(NF,{as:n,...t,children:[typeof e=="string"?S.jsx(xi.Text,{children:e}):e,S.jsx(xi.Icon,{icon:qte})]})),Dre=an()({modelHook:Ut,subComponents:{Card:wF,List:LF,Item:xi,TargetItem:Lre,Group:RF,Option:MF,Divider:kF,Popper:Cre}})(({children:e,model:t,...n},a,r)=>{const i=Ut(Ut.mergeConfig(n,{getId:r.getId,getTextValue:r.getTextValue,UNSTABLE_parentModel:r,mode:r.state.mode,orientation:r.state.orientation,onSelect(s){r.events.select(s)},onSelectAll(){r.events.selectAll()}})),o=Ut.Context;return S.jsx(o.Provider,{value:i,children:e})}),j=Vd()({displayName:"Menu",modelHook:Ut,subComponents:{Target:Are,Card:wF,List:LF,Item:xi,Group:RF,Option:MF,Divider:kF,TargetContext:Nre,Popper:Tre,Submenu:Dre}})(({children:e})=>S.jsx(S.Fragment,{children:e})),zF=()=>{const[e,t]=z.useState("");return S.jsxs(j,{onSelect:n=>t(n.id),children:[S.jsx(j.Target,{children:"Open Menu"}),S.jsx(j.Popper,{children:S.jsx(j.Card,{children:S.jsxs(j.List,{children:[S.jsx(j.Item,{children:"First Item"}),S.jsx(j.Item,{children:"Second Item"}),S.jsx(j.Divider,{}),S.jsx(j.Item,{children:"Third Item (with a really, really, really long label)"}),S.jsx(j.Item,{"aria-disabled":!0,children:"Fourth Item"})]})})}),S.jsxs(Yi,{size:"small",marginTop:"s",children:["Selected: ",S.jsx("span",{"data-testid":"output",children:e})]})]})};zF.__RAW__=`import React from 'react';
299
+ </svg>`,filename:"wd-icon-user.svg",category:"People",tags:["person","people","profile","avatar"]},qe=Xe({extends:dF,vars:{color:"",accentColor:"",backgroundColor:""},base:({size:e,accentColor:t,backgroundColor:n,color:a})=>({"& svg":{width:Z(e,ur.systemIcon.size.lg),height:Z(e,ur.systemIcon.size.lg)},".wd-icon .wd-icon-fill":{fill:Z(a,ur.systemIcon.color.fill)},".wd-icon .wd-icon-accent, & .wd-icon-accent2":{fill:Z(t,Z(a,ur.systemIcon.color.accent))},".wd-icon .wd-icon-background":{fill:Z(n,"transparent")},"@media (prefers-contrast: more)":{".wd-icon .wd-icon-fill, .wd-icon .wd-icon-accent":{color:"currentColor",fill:"currentColor"}}}),modifiers:{}}),gw=Be("span")({displayName:"SystemIcon",Component:({accent:e,background:t,color:n,icon:a,size:r,...i},o,s)=>S.jsx(jte,{as:s,src:a,type:Ia.System,ref:o,...Er(i,qe({size:zte(r,ur.systemIcon.size),color:n,accentColor:e,backgroundColor:t}))})}),Vte=oX(ute.as("span"))({position:"relative",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}),Wte=Be("span")({displayName:"ButtonLabel",Component:({children:e,...t},n,a)=>S.jsx(Vte,{as:a,ref:n,...t,children:e})}),Zte=Xe({base:{display:"inline-block"},modifiers:{size:{extraSmall:{[qe.vars.size]:ur.systemIcon.size.xs},small:{[qe.vars.size]:ur.systemIcon.size.md},medium:{[qe.vars.size]:ur.systemIcon.size.md},large:{[qe.vars.size]:ur.systemIcon.size.lg}}}}),Yte=Be("span")({Component:({icon:e,size:t="medium",shouldMirrorIcon:n=!1,shouldMirrorIconInRTL:a=!1,...r},i,o)=>e===void 0?null:S.jsx(gw,{ref:i,as:o,icon:e,shouldMirror:n,shouldMirrorInRTL:a,...Er(r,Zte({size:t}))})}),oe={default:Da("background","border","boxShadowInner","boxShadowOuter","icon","label","opacity","borderRadius"),focus:Da("background","border","boxShadowInner","boxShadowOuter","icon","label","opacity","borderRadius"),hover:Da("background","border","boxShadowInner","boxShadowOuter","icon","label","opacity","borderRadius"),active:Da("background","border","boxShadowInner","boxShadowOuter","icon","label","opacity","borderRadius"),disabled:Da("background","border","boxShadowInner","boxShadowOuter","icon","label","opacity","borderRadius")},ue=Xe({vars:{background:"",border:"",boxShadowInner:"",boxShadowOuter:"",label:"",opacity:"",borderRadius:""},base:({background:e,border:t,boxShadowInner:n,boxShadowOuter:a,label:r,opacity:i,borderRadius:o})=>({fontFamily:lt.default,fontSize:A.fontSize.subtext.lg,lineHeight:A.lineHeight.subtext.lg,letterSpacing:A.letterSpacing.subtext.lg,fontWeight:at.bold,backgroundColor:Z(oe.default.background,Z(e,"transparent")),color:Z(oe.default.label,Z(r,P.fg.strong)),borderWidth:We(1),borderStyle:"solid",gap:A.gap.sm,borderColor:Z(oe.default.border,Z(t,"transparent")),cursor:"pointer",display:"inline-flex",boxShadow:"none",alignItems:"center",justifyContent:"center",outline:`${We(2)} transparent`,whiteSpace:"nowrap",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",borderRadius:Z(oe.default.borderRadius,Z(o,A.shape.full)),position:"relative",verticalAlign:"middle",overflow:"hidden",[qe.vars.color]:Z(oe.default.icon,P.fg.strong),transition:"box-shadow 120ms linear, border 120ms linear, background-color 120ms linear, color 120ms linear","&:disabled, &:disabled:active, &.disabled":{cursor:"default",boxShadow:"none",opacity:Z(oe.default.opacity,Z(i,lr.full))},"&:focus-visible, &.focus":{backgroundColor:Z(oe.focus.background,Z(e,"transparent")),borderColor:Z(oe.focus.border,Z(t,"transparent")),color:Z(oe.focus.label,Z(r,P.fg.strong)),[qe.vars.color]:Z(oe.focus.icon,P.fg.strong),outline:`${We(2)} solid transparent`,outlineOffset:We(2),boxShadow:`0 0 0 ${We(2)} ${Z(oe.focus.boxShadowInner,Z(n,A.color.border.inverse.default))},0 0 0 ${We(4)} ${Z(oe.focus.boxShadowOuter,Z(a,A.color.brand.focus.primary))}`},"&:hover, &.hover":{backgroundColor:Z(oe.hover.background,Z(e,A.color.surface.contrast.strong)),borderColor:Z(oe.hover.border,Z(t,"transparent")),color:Z(oe.hover.label,Z(r,P.fg.stronger)),[qe.vars.color]:Z(oe.hover.icon,P.fg.stronger)},"&:hover:active":{transitionDuration:"40ms"},"&:active, &.active":{backgroundColor:Z(oe.active.background,Z(e,"transparent")),borderColor:Z(oe.active.border,Z(t,"transparent")),color:Z(oe.active.label,Z(r,P.fg.strong)),[qe.vars.color]:Z(oe.active.icon,P.fg.strong)},"&:disabled, &.disabled":{backgroundColor:Z(oe.disabled.background,Z(e,"transparent")),borderColor:Z(oe.disabled.border,Z(t,"transparent")),color:Z(oe.disabled.label,Z(r,P.fg.strong)),[qe.vars.color]:Z(oe.disabled.icon,"currentColor")},"@media (prefers-contrast: more)":{'&[aria-pressed="true"]':{outline:`${We(2)} solid transparent`,outlineOffset:`-${We(1)}`},'&[aria-pressed="true"]:focus-visible, &[aria-pressed="true"].focus':{outline:`${We(4)} double transparent`,outlineOffset:0}},svg:{pointerEvents:"none"}}),modifiers:{size:{large:{fontSize:A.fontSize.body.sm,lineHeight:A.lineHeight.body.sm,letterSpacing:A.letterSpacing.body.sm,height:A.size.lg,paddingInline:A.padding.xxl,minWidth:Ar.size1400},medium:{fontSize:A.fontSize.subtext.lg,lineHeight:A.lineHeight.subtext.lg,letterSpacing:A.letterSpacing.subtext.lg,minWidth:Ar.size1200,paddingInline:A.padding.xl,height:A.size.md},small:{fontSize:A.fontSize.subtext.lg,lineHeight:A.lineHeight.subtext.lg,letterSpacing:A.letterSpacing.subtext.lg,height:A.size.sm,minWidth:Ar.size1000,paddingInline:A.padding.md,gap:A.gap.xs},extraSmall:{fontSize:A.fontSize.subtext.md,lineHeight:A.lineHeight.subtext.md,letterSpacing:A.letterSpacing.subtext.md,height:A.size.xs,minWidth:"auto",paddingInline:A.padding.sm,gap:A.gap.xs}},grow:{true:{width:"100%",maxWidth:"100%"}},iconPosition:{only:{padding:0},start:{},end:{}}},compound:[{modifiers:{size:"large",iconPosition:"only"},styles:{minWidth:A.size.lg}},{modifiers:{size:"large",iconPosition:"start"},styles:{paddingInlineStart:A.padding.xl,paddingInlineEnd:A.padding.xxl}},{modifiers:{size:"large",iconPosition:"end"},styles:{paddingInlineStart:A.padding.xxl,paddingInlineEnd:A.padding.xl}},{modifiers:{size:"medium",iconPosition:"only"},styles:{minWidth:A.size.md}},{modifiers:{size:"medium",iconPosition:"start"},styles:{paddingInlineStart:A.padding.lg,paddingInlineEnd:A.padding.xl}},{modifiers:{size:"medium",iconPosition:"end"},styles:{paddingInlineStart:A.padding.xl,paddingInlineEnd:A.padding.lg}},{modifiers:{size:"small",iconPosition:"only"},styles:{minWidth:A.size.sm}},{modifiers:{size:"small",iconPosition:"start"},styles:{paddingInlineStart:A.padding.sm,paddingInlineEnd:A.padding.md}},{modifiers:{size:"small",iconPosition:"end"},styles:{paddingInlineStart:A.padding.md,paddingInlineEnd:A.padding.sm}},{modifiers:{size:"extraSmall",iconPosition:"only"},styles:{minWidth:A.size.xs}},{modifiers:{size:"extraSmall",iconPosition:"start"},styles:{paddingInlineStart:A.padding.xs,paddingInlineEnd:A.padding.sm}},{modifiers:{size:"extraSmall",iconPosition:"end"},styles:{paddingInlineStart:A.padding.sm,paddingInlineEnd:A.padding.xs}}]}),Ql=Be("button")({displayName:"BaseButton",Component:({children:e,size:t,fillIcon:n,grow:a,iconPosition:r,icon:i,colors:o,...s},l,u)=>S.jsx(u,{ref:l,type:"button",...ht(s,[ue({size:t,iconPosition:r,grow:a}),oe.default((o==null?void 0:o.default)||{}),oe.focus((o==null?void 0:o.focus)||{}),oe.hover((o==null?void 0:o.hover)||{}),oe.active((o==null?void 0:o.active)||{}),oe.disabled((o==null?void 0:o.disabled)||{})]),children:e}),subComponents:{Icon:Yte,Label:Wte}}),Kte=Be("button")({displayName:"Button",Component:({children:e,icon:t,colors:n,iconPosition:a,shouldMirrorIcon:r,shouldMirrorIconInRTL:i,size:o="medium",...s},l,u)=>{const c=a||(t?e?"start":"only":void 0);return S.jsxs(Ql,{as:u,ref:l,size:o,icon:t,colors:n,iconPosition:c,...s,children:[t&&c==="start"&&S.jsx(Ql.Icon,{size:o,icon:t,shouldMirrorIcon:r,shouldMirrorIconInRTL:i}),e&&S.jsx(Ql.Label,{children:e}),t&&c&&["only","end"].includes(c)&&S.jsx(Ql.Icon,{size:o,icon:t,shouldMirrorIcon:r,shouldMirrorIconInRTL:i})]})}}),Xte=Xe({extends:ue,base:{[ue.vars.background]:A.color.surface.transparent,[ue.vars.borderRadius]:A.shape.full,[ue.vars.border]:P.border.input.default,[ue.vars.label]:P.fg.default,[qe.vars.color]:Z(oe.default.icon,"currentColor"),"&:focus-visible, &.focus":{[ue.vars.background]:A.color.surface.default,[ue.vars.label]:P.fg.strong,[ue.vars.boxShadowInner]:A.color.focus.inverse,[ue.vars.boxShadowOuter]:A.color.brand.focus.primary,[qe.vars.color]:Z(oe.focus.icon,"currentColor")},"&:hover, &.hover":{[ue.vars.background]:Zl.darken({color:A.color.surface.transparent,mixinColor:A.color.surface.overlay.mixin,mixinValue:A.opacity.surface.hover}),[ue.vars.label]:P.fg.strong,[ue.vars.border]:A.color.border.input.hover,[qe.vars.color]:Z(oe.hover.icon,"currentColor")},"&:active, &.active":{[ue.vars.background]:Zl.darken({color:A.color.surface.transparent,mixinColor:A.color.surface.overlay.mixin,mixinValue:A.opacity.surface.pressed}),[ue.vars.label]:P.fg.strong,[ue.vars.border]:A.color.border.input.hover,[qe.vars.color]:Z(oe.active.icon,"currentColor")},"&:disabled, &.disabled":{[ue.vars.opacity]:lr.disabled,[ue.vars.background]:A.color.surface.transparent,[ue.vars.label]:P.fg.default,[qe.vars.color]:Z(oe.default.icon,"currentColor")}},modifiers:{variant:{inverse:{[ue.vars.background]:A.color.surface.transparent,[ue.vars.border]:A.color.border.inverse.default,[ue.vars.label]:P.fg.inverse,[qe.vars.color]:Z(oe.default.icon,"currentColor"),"&:hover, &.hover":{[ue.vars.background]:Zl.darken({color:A.color.surface.transparent,mixinColor:A.color.surface.overlay.mixin,mixinValue:A.opacity.surface.hover}),[ue.vars.border]:A.color.border.inverse.default,[ue.vars.label]:P.fg.inverse,[qe.vars.color]:Z(oe.hover.icon,"currentColor")},"&:focus-visible, &.focus":{[ue.vars.background]:A.color.surface.inverse,[ue.vars.border]:P.border.transparent,[ue.vars.label]:P.fg.contrast.default,[ue.vars.boxShadowInner]:P.border.contrast.default,[ue.vars.boxShadowOuter]:A.color.focus.inverse,[qe.vars.color]:Z(oe.focus.icon,"currentColor")},"&:active, &.active":{[ue.vars.background]:Zl.darken({color:A.color.surface.transparent,mixinColor:A.color.surface.overlay.mixin,mixinValue:A.opacity.surface.pressed}),[ue.vars.border]:A.color.border.inverse.default,[ue.vars.label]:P.fg.inverse,[qe.vars.color]:Z(oe.active.icon,"currentColor")},"&:disabled, &.disabled":{[ue.vars.opacity]:lr.disabled,[ue.vars.background]:A.color.surface.transparent,[ue.vars.label]:P.fg.inverse,[qe.vars.color]:Z(oe.default.icon,"currentColor")}}}}}),pF=Be("button")({displayName:"SecondaryButton",Component:({children:e,variant:t,size:n,iconPosition:a,grow:r,cs:i,...o},s,l)=>S.jsx(Kte,{as:l,ref:s,iconPosition:a,size:n,grow:r,cs:[Xte({variant:t,iconPosition:a,grow:r,size:n}),i],...o,children:e})});var bn="top",Cn="bottom",On="right",vn="left",hw="auto",bl=[bn,Cn,On,vn],Ii="start",bw="end",Jte="clippingParents",fF="viewport",co="popper",Qte="reference",yN=bl.reduce(function(e,t){return e.concat([t+"-"+Ii,t+"-"+bw])},[]),mF=[].concat(bl,[hw]).reduce(function(e,t){return e.concat([t,t+"-"+Ii,t+"-"+bw])},[]),ene="beforeRead",tne="read",nne="afterRead",rne="beforeMain",ane="main",ine="afterMain",one="beforeWrite",sne="write",lne="afterWrite",une=[ene,tne,nne,rne,ane,ine,one,sne,lne];function $n(e){return e?(e.nodeName||"").toLowerCase():null}function Ln(e){if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function rs(e){var t=Ln(e).Element;return e instanceof t||e instanceof Element}function Zn(e){var t=Ln(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function cne(e){var t=Ln(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function dne(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var a=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];!Zn(i)||!$n(i)||(Object.assign(i.style,a),Object.keys(r).forEach(function(o){var s=r[o];s===!1?i.removeAttribute(o):i.setAttribute(o,s===!0?"":s)}))})}function pne(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(a){var r=t.elements[a],i=t.attributes[a]||{},o=Object.keys(t.styles.hasOwnProperty(a)?t.styles[a]:n[a]),s=o.reduce(function(l,u){return l[u]="",l},{});!Zn(r)||!$n(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(l){r.removeAttribute(l)}))})}}const fne={name:"applyStyles",enabled:!0,phase:"write",fn:dne,effect:pne,requires:["computeStyles"]};function Vn(e){return e.split("-")[0]}function vw(e){return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function gF(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&cne(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function dr(e){return Ln(e).getComputedStyle(e)}function mne(e){return["table","td","th"].indexOf($n(e))>=0}function _r(e){return((rs(e)?e.ownerDocument:e.document)||window.document).documentElement}function Xd(e){return $n(e)==="html"?e:e.assignedSlot||e.parentNode||e.host||_r(e)}function SN(e){if(!Zn(e)||dr(e).position==="fixed")return null;var t=e.offsetParent;if(t){var n=_r(t);if($n(t)==="body"&&dr(t).position==="static"&&dr(n).position!=="static")return n}return t}function gne(e){for(var t=Xd(e);Zn(t)&&["html","body"].indexOf($n(t))<0;){var n=dr(t);if(n.transform!=="none"||n.perspective!=="none"||n.willChange&&n.willChange!=="auto")return t;t=t.parentNode}return null}function vl(e){for(var t=Ln(e),n=SN(e);n&&mne(n)&&dr(n).position==="static";)n=SN(n);return n&&$n(n)==="body"&&dr(n).position==="static"?t:n||gne(e)||t}function yw(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Su(e,t,n){return Math.max(e,Math.min(t,n))}function hF(){return{top:0,right:0,bottom:0,left:0}}function bF(e){return Object.assign(Object.assign({},hF()),e)}function vF(e,t){return t.reduce(function(n,a){return n[a]=e,n},{})}function hne(e){var t,n=e.state,a=e.name,r=n.elements.arrow,i=n.modifiersData.popperOffsets,o=Vn(n.placement),s=yw(o),l=[vn,On].indexOf(o)>=0,u=l?"height":"width";if(!(!r||!i)){var c=n.modifiersData[a+"#persistent"].padding,d=vw(r),p=s==="y"?bn:vn,g=s==="y"?Cn:On,b=n.rects.reference[u]+n.rects.reference[s]-i[s]-n.rects.popper[u],v=i[s]-n.rects.reference[s],I=vl(r),h=I?s==="y"?I.clientHeight||0:I.clientWidth||0:0,f=b/2-v/2,m=c[p],y=h-d[u]-c[g],_=h/2-d[u]/2+f,w=Su(m,_,y),k=s;n.modifiersData[a]=(t={},t[k]=w,t.centerOffset=w-_,t)}}function bne(e){var t=e.state,n=e.options,a=e.name,r=n.element,i=r===void 0?"[data-popper-arrow]":r,o=n.padding,s=o===void 0?0:o;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||gF(t.elements.popper,i)&&(t.elements.arrow=i,t.modifiersData[a+"#persistent"]={padding:bF(typeof s!="number"?s:vF(s,bl))}))}const vne={name:"arrow",enabled:!0,phase:"main",fn:hne,effect:bne,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};var yne={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Sne(e){var t=e.x,n=e.y,a=window,r=a.devicePixelRatio||1;return{x:Math.round(t*r)/r||0,y:Math.round(n*r)/r||0}}function EN(e){var t,n=e.popper,a=e.popperRect,r=e.placement,i=e.offsets,o=e.position,s=e.gpuAcceleration,l=e.adaptive,u=Sne(i),c=u.x,d=u.y,p=i.hasOwnProperty("x"),g=i.hasOwnProperty("y"),b=vn,v=bn,I=window;if(l){var h=vl(n);h===Ln(n)&&(h=_r(n)),r===bn&&(v=Cn,d-=h.clientHeight-a.height,d*=s?1:-1),r===vn&&(b=On,c-=h.clientWidth-a.width,c*=s?1:-1)}var f=Object.assign({position:o},l&&yne);if(s){var m;return Object.assign(Object.assign({},f),{},(m={},m[v]=g?"0":"",m[b]=p?"0":"",m.transform=(I.devicePixelRatio||1)<2?"translate("+c+"px, "+d+"px)":"translate3d("+c+"px, "+d+"px, 0)",m))}return Object.assign(Object.assign({},f),{},(t={},t[v]=g?d+"px":"",t[b]=p?c+"px":"",t.transform="",t))}function Ene(e){var t=e.state,n=e.options,a=n.gpuAcceleration,r=a===void 0?!0:a,i=n.adaptive,o=i===void 0?!0:i,s={placement:Vn(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign(Object.assign({},t.styles.popper),EN(Object.assign(Object.assign({},s),{},{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign(Object.assign({},t.styles.arrow),EN(Object.assign(Object.assign({},s),{},{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1})))),t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-placement":t.placement})}const _ne={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Ene,data:{}};var eu={passive:!0};function wne(e){var t=e.state,n=e.instance,a=e.options,r=a.scroll,i=r===void 0?!0:r,o=a.resize,s=o===void 0?!0:o,l=Ln(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",n.update,eu)}),s&&l.addEventListener("resize",n.update,eu),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",n.update,eu)}),s&&l.removeEventListener("resize",n.update,eu)}}const kne={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:wne,data:{}};var Ine={left:"right",right:"left",bottom:"top",top:"bottom"};function Eu(e){return e.replace(/left|right|bottom|top/g,function(t){return Ine[t]})}var Tne={start:"end",end:"start"};function _N(e){return e.replace(/start|end/g,function(t){return Tne[t]})}function as(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function Sw(e){var t=Ln(e),n=t.pageXOffset,a=t.pageYOffset;return{scrollLeft:n,scrollTop:a}}function Ew(e){return as(_r(e)).left+Sw(e).scrollLeft}function xne(e){var t=Ln(e),n=_r(e),a=t.visualViewport,r=n.clientWidth,i=n.clientHeight,o=0,s=0;return a&&(r=a.width,i=a.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=a.offsetLeft,s=a.offsetTop)),{width:r,height:i,x:o+Ew(e),y:s}}function Rne(e){var t=_r(e),n=Sw(e),a=e.ownerDocument.body,r=Math.max(t.scrollWidth,t.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),i=Math.max(t.scrollHeight,t.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),o=-n.scrollLeft+Ew(e),s=-n.scrollTop;return dr(a||t).direction==="rtl"&&(o+=Math.max(t.clientWidth,a?a.clientWidth:0)-r),{width:r,height:i,x:o,y:s}}function _w(e){var t=dr(e),n=t.overflow,a=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+a)}function yF(e){return["html","body","#document"].indexOf($n(e))>=0?e.ownerDocument.body:Zn(e)&&_w(e)?e:yF(Xd(e))}function No(e,t){t===void 0&&(t=[]);var n=yF(e),a=$n(n)==="body",r=Ln(n),i=a?[r].concat(r.visualViewport||[],_w(n)?n:[]):n,o=t.concat(i);return a?o:o.concat(No(Xd(i)))}function Vv(e){return Object.assign(Object.assign({},e),{},{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ane(e){var t=as(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function wN(e,t){return t===fF?Vv(xne(e)):Zn(t)?Ane(t):Vv(Rne(_r(e)))}function Nne(e){var t=No(Xd(e)),n=["absolute","fixed"].indexOf(dr(e).position)>=0,a=n&&Zn(e)?vl(e):e;return rs(a)?t.filter(function(r){return rs(r)&&gF(r,a)&&$n(r)!=="body"}):[]}function Cne(e,t,n){var a=t==="clippingParents"?Nne(e):[].concat(t),r=[].concat(a,[n]),i=r[0],o=r.reduce(function(s,l){var u=wN(e,l);return s.top=Math.max(u.top,s.top),s.right=Math.min(u.right,s.right),s.bottom=Math.min(u.bottom,s.bottom),s.left=Math.max(u.left,s.left),s},wN(e,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function is(e){return e.split("-")[1]}function SF(e){var t=e.reference,n=e.element,a=e.placement,r=a?Vn(a):null,i=a?is(a):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(r){case bn:l={x:o,y:t.y-n.height};break;case Cn:l={x:o,y:t.y+t.height};break;case On:l={x:t.x+t.width,y:s};break;case vn:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=r?yw(r):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case Ii:l[u]=Math.floor(l[u])-Math.floor(t[c]/2-n[c]/2);break;case bw:l[u]=Math.floor(l[u])+Math.ceil(t[c]/2-n[c]/2);break}}return l}function Ti(e,t){t===void 0&&(t={});var n=t,a=n.placement,r=a===void 0?e.placement:a,i=n.boundary,o=i===void 0?Jte:i,s=n.rootBoundary,l=s===void 0?fF:s,u=n.elementContext,c=u===void 0?co:u,d=n.altBoundary,p=d===void 0?!1:d,g=n.padding,b=g===void 0?0:g,v=bF(typeof b!="number"?b:vF(b,bl)),I=c===co?Qte:co,h=e.elements.reference,f=e.rects.popper,m=e.elements[p?I:c],y=Cne(rs(m)?m:m.contextElement||_r(e.elements.popper),o,l),_=as(h),w=SF({reference:_,element:f,placement:r}),k=Vv(Object.assign(Object.assign({},f),w)),C=c===co?k:_,O={top:y.top-C.top+v.top,bottom:C.bottom-y.bottom+v.bottom,left:y.left-C.left+v.left,right:C.right-y.right+v.right},D=e.modifiersData.offset;if(c===co&&D){var H=D[r];Object.keys(O).forEach(function(ee){var te=[On,Cn].indexOf(ee)>=0?1:-1,ve=[bn,Cn].indexOf(ee)>=0?"y":"x";O[ee]+=H[ve]*te})}return O}function One(e,t){t===void 0&&(t={});var n=t,a=n.placement,r=n.boundary,i=n.rootBoundary,o=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?mF:l,c=is(a),d=c?s?yN:yN.filter(function(b){return is(b)===c}):bl,p=d.filter(function(b){return u.indexOf(b)>=0});p.length===0&&(p=d);var g=p.reduce(function(b,v){return b[v]=Ti(e,{placement:v,boundary:r,rootBoundary:i,padding:o})[Vn(v)],b},{});return Object.keys(g).sort(function(b,v){return g[b]-g[v]})}function $ne(e){if(Vn(e)===hw)return[];var t=Eu(e);return[_N(e),t,_N(t)]}function Lne(e){var t=e.state,n=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var r=n.mainAxis,i=r===void 0?!0:r,o=n.altAxis,s=o===void 0?!0:o,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,p=n.altBoundary,g=n.flipVariations,b=g===void 0?!0:g,v=n.allowedAutoPlacements,I=t.options.placement,h=Vn(I),f=h===I,m=l||(f||!b?[Eu(I)]:$ne(I)),y=[I].concat(m).reduce(function(ge,Ne){return ge.concat(Vn(Ne)===hw?One(t,{placement:Ne,boundary:c,rootBoundary:d,padding:u,flipVariations:b,allowedAutoPlacements:v}):Ne)},[]),_=t.rects.reference,w=t.rects.popper,k=new Map,C=!0,O=y[0],D=0;D<y.length;D++){var H=y[D],ee=Vn(H),te=is(H)===Ii,ve=[bn,Cn].indexOf(ee)>=0,_e=ve?"width":"height",me=Ti(t,{placement:H,boundary:c,rootBoundary:d,altBoundary:p,padding:u}),we=ve?te?On:vn:te?Cn:bn;_[_e]>w[_e]&&(we=Eu(we));var L=Eu(we),B=[];if(i&&B.push(me[ee]<=0),s&&B.push(me[we]<=0,me[L]<=0),B.every(function(ge){return ge})){O=H,C=!1;break}k.set(H,B)}if(C)for(var q=b?3:1,V=function(Ne){var Oe=y.find(function(Je){var sn=k.get(Je);if(sn)return sn.slice(0,Ne).every(function(Ta){return Ta})});if(Oe)return O=Oe,"break"},Y=q;Y>0;Y--){var He=V(Y);if(He==="break")break}t.placement!==O&&(t.modifiersData[a]._skip=!0,t.placement=O,t.reset=!0)}}const Dne={name:"flip",enabled:!0,phase:"main",fn:Lne,requiresIfExists:["offset"],data:{_skip:!1}};function kN(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function IN(e){return[bn,On,Cn,vn].some(function(t){return e[t]>=0})}function Mne(e){var t=e.state,n=e.name,a=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,o=Ti(t,{elementContext:"reference"}),s=Ti(t,{altBoundary:!0}),l=kN(o,a),u=kN(s,r,i),c=IN(l),d=IN(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const Pne={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Mne};function Une(e,t,n){var a=Vn(e),r=[vn,bn].indexOf(a)>=0?-1:1,i=typeof n=="function"?n(Object.assign(Object.assign({},t),{},{placement:e})):n,o=i[0],s=i[1];return o=o||0,s=(s||0)*r,[vn,On].indexOf(a)>=0?{x:s,y:o}:{x:o,y:s}}function Fne(e){var t=e.state,n=e.options,a=e.name,r=n.offset,i=r===void 0?[0,0]:r,o=mF.reduce(function(c,d){return c[d]=Une(d,t.rects,i),c},{}),s=o[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[a]=o}const zne={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Fne};function jne(e){var t=e.state,n=e.name;t.modifiersData[n]=SF({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Bne={name:"popperOffsets",enabled:!0,phase:"read",fn:jne,data:{}};function qne(e){return e==="x"?"y":"x"}function Gne(e){var t=e.state,n=e.options,a=e.name,r=n.mainAxis,i=r===void 0?!0:r,o=n.altAxis,s=o===void 0?!1:o,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,p=n.tether,g=p===void 0?!0:p,b=n.tetherOffset,v=b===void 0?0:b,I=Ti(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),h=Vn(t.placement),f=is(t.placement),m=!f,y=yw(h),_=qne(y),w=t.modifiersData.popperOffsets,k=t.rects.reference,C=t.rects.popper,O=typeof v=="function"?v(Object.assign(Object.assign({},t.rects),{},{placement:t.placement})):v,D={x:0,y:0};if(w){if(i){var H=y==="y"?bn:vn,ee=y==="y"?Cn:On,te=y==="y"?"height":"width",ve=w[y],_e=w[y]+I[H],me=w[y]-I[ee],we=g?-C[te]/2:0,L=f===Ii?k[te]:C[te],B=f===Ii?-C[te]:-k[te],q=t.elements.arrow,V=g&&q?vw(q):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:hF(),He=Y[H],ge=Y[ee],Ne=Su(0,k[te],V[te]),Oe=m?k[te]/2-we-Ne-He-O:L-Ne-He-O,Je=m?-k[te]/2+we+Ne+ge+O:B+Ne+ge+O,sn=t.elements.arrow&&vl(t.elements.arrow),Ta=sn?y==="y"?sn.clientTop||0:sn.clientLeft||0:0,xa=t.modifiersData.offset?t.modifiersData.offset[t.placement][y]:0,Ra=w[y]+Oe-xa-Ta,Jd=w[y]+Je-xa,Aa=Su(g?Math.min(_e,Ra):_e,ve,g?Math.max(me,Jd):me);w[y]=Aa,D[y]=Aa-ve}if(s){var ZF=y==="x"?bn:vn,YF=y==="x"?Cn:On,Sl=w[_],KF=Sl+I[ZF],XF=Sl-I[YF],Iw=Su(KF,Sl,XF);w[_]=Iw,D[_]=Iw-Sl}t.modifiersData[a]=D}}const Hne={name:"preventOverflow",enabled:!0,phase:"main",fn:Gne,requiresIfExists:["offset"]};function Vne(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Wne(e){return e===Ln(e)||!Zn(e)?Sw(e):Vne(e)}function Zne(e,t,n){n===void 0&&(n=!1);var a=_r(t),r=as(e),i=Zn(t),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(i||!i&&!n)&&(($n(t)!=="body"||_w(a))&&(o=Wne(t)),Zn(t)?(s=as(t),s.x+=t.clientLeft,s.y+=t.clientTop):a&&(s.x=Ew(a))),{x:r.left+o.scrollLeft-s.x,y:r.top+o.scrollTop-s.y,width:r.width,height:r.height}}function Yne(e){var t=new Map,n=new Set,a=[];e.forEach(function(i){t.set(i.name,i)});function r(i){n.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&r(l)}}),a.push(i)}return e.forEach(function(i){n.has(i.name)||r(i)}),a}function Kne(e){var t=Yne(e);return une.reduce(function(n,a){return n.concat(t.filter(function(r){return r.phase===a}))},[])}function Xne(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Jne(e){var t=e.reduce(function(n,a){var r=n[a.name];return n[a.name]=r?Object.assign(Object.assign(Object.assign({},r),a),{},{options:Object.assign(Object.assign({},r.options),a.options),data:Object.assign(Object.assign({},r.data),a.data)}):a,n},{});return Object.keys(t).map(function(n){return t[n]})}var TN={placement:"bottom",modifiers:[],strategy:"absolute"};function xN(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(a){return!(a&&typeof a.getBoundingClientRect=="function")})}function Qne(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,a=n===void 0?[]:n,r=t.defaultOptions,i=r===void 0?TN:r;return function(s,l,u){u===void 0&&(u=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign(Object.assign({},TN),i),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],p=!1,g={state:c,setOptions:function(h){v(),c.options=Object.assign(Object.assign(Object.assign({},i),c.options),h),c.scrollParents={reference:rs(s)?No(s):s.contextElement?No(s.contextElement):[],popper:No(l)};var f=Kne(Jne([].concat(a,c.options.modifiers)));return c.orderedModifiers=f.filter(function(m){return m.enabled}),b(),g.update()},forceUpdate:function(){if(!p){var h=c.elements,f=h.reference,m=h.popper;if(xN(f,m)){c.rects={reference:Zne(f,vl(m),c.options.strategy==="fixed"),popper:vw(m)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(D){return c.modifiersData[D.name]=Object.assign({},D.data)});for(var y=0;y<c.orderedModifiers.length;y++){if(c.reset===!0){c.reset=!1,y=-1;continue}var _=c.orderedModifiers[y],w=_.fn,k=_.options,C=k===void 0?{}:k,O=_.name;typeof w=="function"&&(c=w({state:c,options:C,name:O,instance:g})||c)}}}},update:Xne(function(){return new Promise(function(I){g.forceUpdate(),I(c)})}),destroy:function(){v(),p=!0}};if(!xN(s,l))return g;g.setOptions(u).then(function(I){!p&&u.onFirstUpdate&&u.onFirstUpdate(I)});function b(){c.orderedModifiers.forEach(function(I){var h=I.name,f=I.options,m=f===void 0?{}:f,y=I.effect;if(typeof y=="function"){var _=y({state:c,name:h,instance:g,options:m}),w=function(){};d.push(_||w)}})}function v(){d.forEach(function(I){return I()}),d=[]}return g}}var ere=[kne,Bne,_ne,fne,zne,Dne,Hne,vne,Pne],tre=Qne({defaultModifiers:ere});const nre=["top","top-start","top-end","bottom","bottom-start","bottom-end","right","right-start","right-end","left","left-start","left-end","auto","auto-start","auto-end"],rre=e=>{const[t,n]=e.split("-");let a;switch(t){case"top":a="bottom";break;case"bottom":a="top";break;case"left":a="right";break;case"right":a="left";break;default:a="auto"}return n&&(a=nre.find(r=>r.includes(`${a}-${n}`))??a),a},EF=(e,t,n)=>{if(e.length===0||e[0].split("-")[0]==="auto")return n;const{reference:a,popper:r}=t.rects,i=Ti({...t,placement:e[0]}),o=/left|right/.test(e[0].split("-")[0])?"horizontal":"vertical",s=(i.top>0||i.bottom>0||i.left>0||i.right>0)&&(o==="horizontal"?r.height/2-i.top<a.height||r.height/2-i.bottom<a.height:r.width-i.left<a.width||r.width-i.right<a.width),l=e[0].split("-")[0];return!s&&i[l]<=0?e[0]:EF(e.slice(1),t,n)},RN="fallbackModifier",AN={name:RN,enabled:!0,phase:"main",data:{_skip:!1},fn({state:e,options:t}){const n=e.options.placement,{fallbackPlacements:a}=t,r=[n,rre(n),...a||[]],i=EF(r,e,n);e.placement!==i&&(e.modifiersData[RN]._skip=!0,e.placement=i,e.reset=!0)}},_F=["top","right","bottom","left"],ww=J.forwardRef(({portal:e=!0,open:t=!0,...n},a)=>t?S.jsx(ore,{ref:a,portal:e,...n}):null),are=e=>{if(e!==null)return"current"in e?e.current||void 0:e},ire={},ore=J.forwardRef(({anchorElement:e,getAnchorClientRect:t,popperOptions:n=ire,placement:a="bottom",fallbackPlacements:r=_F,onPlacementChange:i,children:o,portal:s,popperInstanceRef:l},u)=>{const c=J.useRef(!0),{localRef:d,elementRef:p}=Wd(l),[g,b]=J.useState(a),v=Mte(u,e),I=J.useRef(a);I.current=g;const h=J.useMemo(()=>({name:"setPlacement",enabled:!0,phase:"afterWrite",fn({state:m}){b(m.placement),i==null||i(m.placement)}}),[b,i]);J.useLayoutEffect(()=>{const m=t?{getBoundingClientRect:t}:are(e??null);if(!m){console.warn("Popper: neither anchorElement or getAnchorClientRect was defined. A valid anchorElement or getAnchorClientRect callback must be provided to render a Popper");return}if(v.current){const y=tre(m,v.current,{placement:a,...n,modifiers:[h,{...AN,options:{fallbackPlacements:r}},...n.modifiers||[]]});return p(y),()=>{y==null||y.destroy()}}},[e,t,v]),J.useLayoutEffect(()=>{var m;c.current||(m=d.current)==null||m.setOptions({placement:a,...n,modifiers:[h,{...AN,options:{fallbackPlacements:r}},...n.modifiers||[]]}),c.current=!1},[n,a,r,h,d]);const f=S.jsx(S.Fragment,{children:sre(o)?o({placement:g}):o});return s?By.createPortal(f,v.current):f});function sre(e){return typeof e=="function"}const Ut=Zr({defaultConfig:{...Ya.defaultConfig,...ta.defaultConfig,mode:"single",shouldVirtualize:!1},requiredConfig:{...Ya.requiredConfig,...ta.requiredConfig},contextOverride:ta.Context})(e=>{const t=Ya(Ya.mergeConfig(e,{selection:e.mode==="single"?LU:vee})),n=ta(ta.mergeConfig(e,{id:t.state.id,onHide(){t.state.indexRef.current=0}}));iF(n),oF(n);const a={mode:e.mode,...t.state,...n.state},r={...t.events,...n.events};return{...t,...n,state:a,events:r,UNSTABLE_parentModel:e.UNSTABLE_parentModel}}),lre=Xe({vars:{minWidth:We(1),transformOriginVertical:"top",transformOriginHorizontal:"left",maxHeight:""},base:({transformOriginVertical:e,transformOriginHorizontal:t,minWidth:n,maxHeight:a})=>({fontFamily:lt.default,fontWeight:at.normal,fontSize:A.fontSize.subtext.lg,lineHeight:A.lineHeight.subtext.lg,letterSpacing:A.letterSpacing.subtext.lg,color:P.fg.default,position:"relative",display:"flex",flexDirection:"column",transition:"transform ease-out 150ms",padding:A.padding.xxs,borderRadius:A.shape.xxl,maxWidth:zn.subtract("100vw",A.size.sm),boxShadow:bU[3],minWidth:n,maxHeight:a,transformOrigin:`${e} ${t}`,".wd-no-animation &":{animation:"none"}})}),ure=Me()(()=>({})),wF=an("div")({displayName:"Menu.Card",modelHook:Ut,elemPropsHook:ure})(({minWidth:e,maxHeight:t,...n},a,r)=>{const i=J.useMemo(()=>cF(r.state.placement||"bottom"),[r.state.placement]);return S.jsx(Rte,{as:a,...ht(n,lre({minWidth:typeof e=="number"?We(e):e,maxHeight:typeof t=="number"?We(t):t,transformOriginVertical:i.vertical,transformOriginHorizontal:i.horizontal})),children:n.children})}),cre=Xe({base:{display:"block",height:We(1),border:"none",borderTop:`${We(1)} solid ${A.color.border.default}`,margin:`${A.gap.sm} ${A.gap.md}`}}),kF=Be("hr")({displayName:"Menu.Divider",Component({...e},t,n){return S.jsx(n,{ref:t,...Er(e,cre())})}}),NN={vertical:"bottom",horizontal:"center"},Wv=Da("positionX","positionY"),dre=SQ({"0%":{opacity:0,transform:`translate(${Wv.positionX}, ${Wv.positionY})`},"100%":{opacity:1,transform:"translate(0)"}}),pre=Xe({vars:{tooltipTransformOriginHorizontal:"",tooltipTransformOriginVertical:""},base:({tooltipTransformOriginHorizontal:e,tooltipTransformOriginVertical:t})=>({fontFamily:lt.default,fontWeight:at.normal,fontSize:A.fontSize.subtext.md,lineHeight:A.lineHeight.subtext.md,letterSpacing:A.letterSpacing.subtext.md,display:"inline-flex",position:"relative",padding:A.padding.sm,color:P.fg.inverse,animationName:dre,animationDuration:"150ms",animationTimingFunction:"ease-out",transformOrigin:`${t} ${e}`,a:{color:P.fg.inverse,textDecoration:"underline"},"&:before":{content:'""',borderRadius:A.shape.md,outline:`${We(1)} solid transparent`,outlineOffset:`-${We(1)}`,zIndex:-1,margin:A.gap.xs,backgroundColor:A.color.surface.contrast.default,position:"absolute",top:0,left:0,right:0,bottom:0,boxShadow:bU[2]},"[data-popper-reference-hidden] &":{visibility:"hidden",pointerEvents:"none"},'[data-popper-placement="top-start"] &, [data-popper-placement="bottom-start"] &':{left:zn.negate(Ar.size50)},'[data-popper-placement="top-end"] &, [data-popper-placement="bottom-end"] &':{right:zn.negate(Ar.size50)},'[data-popper-placement="left-start"] &, [data-popper-placement="right-start"] &':{top:zn.negate(Ar.size50)},'[data-popper-placement="left-end"] &, [data-popper-placement="right-end"] &':{bottom:zn.negate(Ar.size50)}}),modifiers:{elementHasFocus:{true:{padding:zn.subtract(A.padding.md,zn.divide(A.padding.xxs,2)),"&:before":{margin:Ar.size75}}}}}),fre=Be("div")({displayName:"TooltipContainer",Component:({children:e,transformOrigin:t=NN,elementHasFocus:n=!1,...a},r,i)=>{const o=zQ(t||NN,A.gap.sm);return S.jsx(i,{ref:r,...ht(a,[pre({tooltipTransformOriginHorizontal:t==null?void 0:t.horizontal,tooltipTransformOriginVertical:t==null?void 0:t.vertical,elementHasFocus:n}),Wv({positionX:o.x,positionY:o.y})]),children:e})}}),CN=(e,t=0)=>{const n=J.useRef(),a=()=>{n.current=window.setTimeout(e,t)},r=()=>{window.clearTimeout(n.current),n.current=void 0};return J.useEffect(()=>()=>{window.clearTimeout(n.current)},[n]),{start:a,clear:r}},mre=e=>{const t=e.tagName.toLowerCase(),n=e.getAttribute("tabindex");switch(t){case"button":case"input":case"select":case"textarea":case"details":return!0;default:return n?Number(n)>=0:!1}};function gre({type:e="label",titleText:t="",showDelay:n=300,hideDelay:a=100}={}){const r=J.useRef(!1),i=ta(),[o,s]=J.useState(null),l=Hd(),u=CN(i.events.hide,a),c=CN(i.events.show,n),d=()=>{u.start(),c.clear()},p=()=>{c.start(),u.clear()},g=f=>{s(f.currentTarget),p()},b=f=>{r.current||g(f),r.current=!1},v=f=>{r.current=!0,mre(f.currentTarget)&&i.events.hide()};oF(i),iF(i),Ote(i),$te(i);const I=i.state.visibility!=="hidden",h={"aria-describedby":e==="describe"&&I?l:void 0,"aria-description":e==="description"?t:void 0,"aria-label":e==="label"?t:void 0,onMouseEnter:g,onMouseLeave:d,onMouseDown:v,onFocus:b,onBlur:d};return h["aria-describedby"]===void 0&&delete h["aria-describedby"],{targetProps:h,popperProps:{open:I,anchorElement:o,ref:i.state.stackRef},tooltipProps:{id:e==="describe"&&I?l:void 0,role:"tooltip",onMouseEnter:p,onMouseLeave:d}}}const IF=e=>{const t=getComputedStyle(e);if(t.overflow==="auto"||t.overflow==="scroll"||t.overflow==="clip"||t.overflow==="hidden")return e;if(e.children){for(let n=0;n<e.children.length;n++){const a=IF(e.children[n]);if(a)return a}return null}return null},TF=e=>{const t=getComputedStyle(e);if(t.textOverflow==="ellipsis"||Number(t.webkitLineClamp)>0)return e;for(let n=0;n<e.children.length;n++){const a=TF(e.children[n]);if(a)return a}return null},ON=e=>{const t=TF(e)||IF(e);return t?t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight:!1};function hre(e,t,n=Object.keys(t)){return n.reduce((a,r)=>(typeof e[r]=="function"?a[r]=kU(t[r],e[r]):a[r]=t[r],a),{})}const kw=({placement:e="top",fallbackPlacements:t=_F,children:n,...a})=>{const[r,i]=J.useState(""),{targetProps:o,popperProps:s,tooltipProps:l}=gre({type:"muted"}),u=d=>{const p=d.currentTarget;i(p instanceof HTMLElement?p.innerText:""),ON(p)&&o.onMouseEnter(d)},c=d=>{const p=d.currentTarget;i(p instanceof HTMLElement?p.innerText:""),ON(p)&&o.onFocus(d)};return S.jsxs(J.Fragment,{children:[J.cloneElement(n,{...o,onMouseEnter:u,onFocus:c,"aria-label":void 0,...hre({...o,onMouseEnter:u,onFocus:c},n.props)}),S.jsx(ww,{placement:e,fallbackPlacements:t,...s,children:({placement:d})=>{const p=cF(d);return S.jsx(fre,{transformOrigin:p,...l,...a,children:r})}})]})},xF=Zr({defaultConfig:{id:void 0},requiredConfig:{}})(e=>({state:{id:Hd(e.id)},events:{}})),bre=Xe({base:{fontFamily:lt.default,fontSize:A.fontSize.subtext.lg,lineHeight:A.lineHeight.subtext.lg,letterSpacing:A.letterSpacing.subtext.lg,fontWeight:at.bold,display:"flex",alignItems:"center",width:"100%",gap:A.gap.md,padding:`${A.padding.xs} ${A.padding.md}`}}),vre=Me()(e=>({"data-type":"group",role:"group","aria-labelledby":e.state.id})),yre=Me()(e=>({id:e.state.id})),$N=an("div")({modelHook:xF,elemPropsHook:yre})(({children:e,...t},n)=>S.jsx(kw,{children:S.jsx(n,{...ht(t,bre()),children:e})})),RF=Vd("div")({displayName:"Menu.Group",modelHook:xF,elemPropsHook:vre,subComponents:{Heading:$N}})(({children:e,title:t,...n},a)=>S.jsxs(a,{...ht(n),children:[t?S.jsx($N,{children:t}):null,e]})),yl=Xe({parts:{text:"menu-item-text",icon:"menu-item-icon",selected:"menu-item-selected"},base:({textPart:e,iconPart:t,selectedPart:n})=>({fontFamily:lt.default,fontWeight:at.normal,fontSize:A.fontSize.subtext.lg,lineHeight:A.lineHeight.subtext.lg,letterSpacing:A.letterSpacing.subtext.lg,display:"flex",alignItems:"center",width:"100%",gap:A.gap.md,padding:`${A.padding.sm} ${A.padding.md}`,boxSizing:"border-box",cursor:"pointer",color:P.fg.default,borderWidth:0,borderRadius:A.shape.xxl,textAlign:"start",transition:"background-color 80ms, color 80ms",backgroundColor:"inherit",minHeight:A.size.md,overflowWrap:"anywhere",[qe.vars.color]:"currentColor",[`& :where(${n})`]:{transition:"opacity 80ms linear",opacity:lr.zero},"&:where(:has(span))":{display:"flex"},"&[aria-selected=true]":{color:A.color.brand.fg.primary.strong,backgroundColor:A.color.brand.surface.primary.strong,[`& :where(${n})`]:{opacity:lr.full},"&:where(.focus, :focus-visible)":{[qe.vars.color]:"currentColor",outline:"none",backgroundColor:A.color.brand.accent.primary,color:P.fg.inverse}},"&:is(.hover, :hover)":{color:P.fg.strong,backgroundColor:A.color.surface.overlay.hover.default},"&:is(.focus, :focus-visible)":{color:P.fg.inverse,backgroundColor:A.color.brand.accent.primary,outline:`${We(2)} solid transparent`,outlineOffset:`-${We(2)}`},"&:is(:disabled, [aria-disabled=true])":{cursor:"default",opacity:lr.disabled,"&:where(.hover, :hover, [aria-selected=true])":{background:"none"},"&:where(.focus, :focus-visible)":{backgroundColor:A.color.brand.accent.primary,opacity:lr.disabled}},[`& :where(${e})`]:{flexGrow:1,alignSelf:"center"},[`& :where(${t})`]:{alignSelf:"start"}})}),Sre=e=>S.jsx(gw,{...yl.parts.icon,...e}),AF=Be("span")({Component:({...e},t,n)=>S.jsx(n,{ref:t,...yl.parts.text,...Er(e)})}),NF=Be("button")({displayName:"MenuItem",Component:({children:e,isDisabled:t,...n},a,r)=>S.jsx(r,{ref:a,"aria-disabled":t,...ht(n,yl({})),children:typeof e=="string"?S.jsx(AF,{children:e}):e})}),CF=Me()(e=>({onKeyDown(t){const n=getComputedStyle(t.currentTarget);t.key==="ArrowLeft"&&n.direction==="ltr"&&e.UNSTABLE_parentModel&&e.events.hide(t)}})),OF=Me()((e,t,n={"data-id":""})=>{const{localRef:a,elementRef:r}=Wd(t),i=n["data-id"];return J.useLayoutEffect(()=>{e.state.mode==="single"&&lc(e.state,i)&&requestAnimationFrame(()=>{var o;(o=a.current)==null||o.focus()})},[i,a,e.state.cursorId,e.state.mode]),{ref:r,className:lc(e.state,n["data-id"])?"focus":void 0}});function $F(e){e.UNSTABLE_parentModel&&(e.UNSTABLE_parentModel.events.hide(),$F(e.UNSTABLE_parentModel))}const Ere=Zi(Me()(e=>({role:"menuitem",onMouseDown(t){e.events.goTo({id:t.currentTarget.getAttribute("data-id")})},onClick:e.state.mode==="single"?t=>{t.currentTarget.getAttribute("aria-disabled")!=="true"&&(e.events.hide(t),$F(e))}:void 0})),OF,CF,wee,MU,Kd),xi=an("button")({displayName:"Menu.Item",modelHook:Ut,elemPropsHook:Ere,subComponents:{Icon:Sre,Text:AF}})(({children:e,...t},n)=>S.jsx(kw,{placement:"left",children:S.jsx(NF,{as:n,...t,children:e})})),_re=Zi(Me()(e=>({role:"menu","aria-labelledby":e.state.id,"aria-orientation":e.state.orientation})),Fte,Lte),wre=Xe({base:{background:A.color.surface.popover,borderRadius:A.shape.xxl,padding:0,gap:A.gap.xs},modifiers:{orientation:{vertical:{flexDirection:"column"},horizontal:{flexDirection:"row"}}}}),LF=an("div")({displayName:"Menu.List",modelHook:Ut,elemPropsHook:_re})(({children:e,...t},n,a)=>S.jsx(vte,{as:n,model:a,marginY:A.gap.none,...Er(t,wre({orientation:a.state.orientation})),children:e})),DF=Be("span")({Component:({...e},t,n)=>S.jsxs(S.Fragment,{children:[S.jsx(xi.Text,{ref:t,as:n,...e}),S.jsx(gw,{...yl.parts.selected,icon:Bte})]})}),kre=Be("li")({displayName:"MenuOption",Component:({children:e,...t},n,a)=>S.jsx(a,{ref:n,...ht(t,yl()),children:typeof e=="string"?S.jsx(DF,{children:e}):e})}),Ire=Zi(Me()((e,t,n={})=>{const a=n["data-id"]||"";return{role:"option","aria-selected":bee(a,e.state),onMouseDown:o=>{o.button===0&&o.currentTarget.getAttribute("aria-disabled")!=="true"&&(e.events.goTo({id:a}),e.events.select({id:a}),e.state.mode==="single"&&e.events.hide(o)),o.preventDefault()}}}),kee,Kd),MF=an("li")({displayName:"Menu.Item",modelHook:Ut,elemPropsHook:Ire,subComponents:{Icon:xi.Icon,Text:DF}})(({children:e,...t},n)=>S.jsx(kw,{placement:"left",children:S.jsx(kre,{as:n,...t,children:e})})),PF=Dte,UF={modifiers:[{name:"offset",options:{offset:()=>[0,4]}}]},Tre=an("div")({modelHook:Ut,elemPropsHook:PF})(({children:e,...t})=>S.jsx(ww,{placement:"bottom-start",popperOptions:UF,...t,children:e})),FF=Me()(e=>({id:e.state.id,"aria-haspopup":"true","aria-expanded":e.state.visibility==="visible",onKeyDown(t){switch(t.key){case"ArrowDown":case"ArrowUp":e.events.show(t)}}})),xre=Zi(FF,Pte),Rre=Zi(FF,Ute),Are=an(pF)({displayName:"Menu.Target",modelHook:Ut,elemPropsHook:xre})(({children:e,...t},n)=>S.jsx(n,{...t,children:e})),Nre=an(pF)({displayName:"Menu.Target",modelHook:Ut,elemPropsHook:Rre})(({children:e,...t},n)=>S.jsx(n,{...t,children:e})),Cre=an("div")({modelHook:Ut,elemPropsHook:PF})(({children:e,...t})=>S.jsx(ww,{placement:"right-start",popperOptions:UF,...t,children:e})),Ore=(e,t=0)=>{const n=z.useRef(),a=()=>{n.current=window.setTimeout(e,t)},r=()=>{window.clearTimeout(n.current),n.current=void 0};return z.useEffect(()=>()=>{window.clearTimeout(n.current)},[n]),{start:a,clear:r}},$re=Zi(Yl(e=>e.UNSTABLE_parentModel,OF),Yl(e=>e.UNSTABLE_parentModel,CF),Yl(e=>e.UNSTABLE_parentModel,MU),Me()((e,t)=>({ref:Wi(t,e.state.targetRef)})),Yl(e=>e.UNSTABLE_parentModel,Kd),Me()(e=>{const t=z.useRef(),n=Ore(()=>{e.UNSTABLE_parentModel.events.goTo({id:t.current||""}),e.events.show(event)},300);return{id:e.state.id,role:"menuitem","aria-haspopup":"true","aria-expanded":e.state.visibility==="visible",onMouseDown(a){e.UNSTABLE_parentModel.events.goTo({id:a.currentTarget.getAttribute("data-id")})},onMouseEnter(a){t.current=a.currentTarget.getAttribute("data-id"),n.start()},onMouseLeave(){n.clear()},onClick(a){e.state.targetRef.current instanceof Element||(e.state.targetRef.current=a.currentTarget),e.state.visibility!=="hidden"?e.events.hide(a):e.events.show(a)},"data-has-children":!0,onKeyDown(a){if(e.state.orientation==="vertical")switch(a.key){case"ArrowRight":case"Enter":case" ":e.events.show(a);break}}}})),Lre=an("button")({modelHook:Ut,elemPropsHook:$re})(({children:e,...t},n)=>S.jsxs(NF,{as:n,...t,children:[typeof e=="string"?S.jsx(xi.Text,{children:e}):e,S.jsx(xi.Icon,{icon:qte})]})),Dre=an()({modelHook:Ut,subComponents:{Card:wF,List:LF,Item:xi,TargetItem:Lre,Group:RF,Option:MF,Divider:kF,Popper:Cre}})(({children:e,model:t,...n},a,r)=>{const i=Ut(Ut.mergeConfig(n,{getId:r.getId,getTextValue:r.getTextValue,UNSTABLE_parentModel:r,mode:r.state.mode,orientation:r.state.orientation,onSelect(s){r.events.select(s)},onSelectAll(){r.events.selectAll()}})),o=Ut.Context;return S.jsx(o.Provider,{value:i,children:e})}),j=Vd()({displayName:"Menu",modelHook:Ut,subComponents:{Target:Are,Card:wF,List:LF,Item:xi,Group:RF,Option:MF,Divider:kF,TargetContext:Nre,Popper:Tre,Submenu:Dre}})(({children:e})=>S.jsx(S.Fragment,{children:e})),zF=()=>{const[e,t]=z.useState("");return S.jsxs(j,{onSelect:n=>t(n.id),children:[S.jsx(j.Target,{children:"Open Menu"}),S.jsx(j.Popper,{children:S.jsx(j.Card,{children:S.jsxs(j.List,{children:[S.jsx(j.Item,{children:"First Item"}),S.jsx(j.Item,{children:"Second Item"}),S.jsx(j.Divider,{}),S.jsx(j.Item,{children:"Third Item (with a really, really, really long label)"}),S.jsx(j.Item,{"aria-disabled":!0,children:"Fourth Item"})]})})}),S.jsxs(Yi,{size:"small",marginTop:"s",children:["Selected: ",S.jsx("span",{"data-testid":"output",children:e})]})]})};zF.__RAW__=`import React from 'react';
300
300
 
301
301
  import {Menu} from '@workday/canvas-kit-react/menu';
302
302
  import {BodyText} from '@workday/canvas-kit-react/text';
@@ -517,7 +517,7 @@ export const CustomTarget = () => {
517
517
  `;function Xa(e,t,n){let a=n.initialDeps??[],r;function i(){var o,s,l,u;let c;n.key&&((o=n.debug)!=null&&o.call(n))&&(c=Date.now());const d=e();if(!(d.length!==a.length||d.some((v,y)=>a[y]!==v)))return r;a=d;let g;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(g=Date.now()),r=t(...d),n.key&&((l=n.debug)!=null&&l.call(n))){const v=Math.round((Date.now()-c)*100)/100,y=Math.round((Date.now()-g)*100)/100,I=y/16,b=(f,h)=>{for(f=String(f);f.length<h;)f=" "+f;return f};console.info(`%c⏱ ${b(y,5)} /${b(v,5)} ms`,`
518
518
  font-size: .6rem;
519
519
  font-weight: bold;
520
- color: hsl(${Math.max(0,Math.min(120-120*I,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(u=n==null?void 0:n.onChange)==null||u.call(n,r),r}return i.updateDeps=o=>{a=o},i}function vN(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Kae=(e,t)=>Math.abs(e-t)<=1,Xae=(e,t,n)=>{let a;return function(...r){e.clearTimeout(a),a=e.setTimeout(()=>t.apply(this,r),n)}},bN=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Jae=e=>e,Qae=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),a=[];for(let r=t;r<=n;r++)a.push(r);return a},eie=(e,t)=>{const n=e.scrollElement;if(!n)return;const a=e.targetWindow;if(!a)return;const r=o=>{const{width:s,height:l}=o;t({width:Math.round(s),height:Math.round(l)})};if(r(bN(n)),!a.ResizeObserver)return()=>{};const i=new a.ResizeObserver(o=>{const s=()=>{const l=o[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(bN(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},yN={passive:!0},SN=typeof window>"u"?!0:"onscrollend"in window,tie=(e,t)=>{const n=e.scrollElement;if(!n)return;const a=e.targetWindow;if(!a)return;let r=0;const i=e.options.useScrollendEvent&&SN?()=>{}:Xae(a,()=>{t(r,!1)},e.options.isScrollingResetDelay),o=c=>()=>{const{horizontal:d,isRtl:p}=e.options;r=d?n.scrollLeft*(p&&-1||1):n.scrollTop,i(),t(r,c)},s=o(!0),l=o(!1);l(),n.addEventListener("scroll",s,yN);const u=e.options.useScrollendEvent&&SN;return u&&n.addEventListener("scrollend",l,yN),()=>{n.removeEventListener("scroll",s),u&&n.removeEventListener("scrollend",l)}},nie=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const a=t.borderBoxSize[0];if(a)return Math.round(a[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},rie=(e,{adjustments:t=0,behavior:n},a)=>{var r,i;const o=e+t;(i=(r=a.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[a.options.horizontal?"left":"top"]:o,behavior:n})};class aie{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const a=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(i=>{const o=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var r;(r=a())==null||r.disconnect(),n=null},observe:r=>{var i;return(i=a())==null?void 0:i.observe(r,{box:"border-box"})},unobserve:r=>{var i;return(i=a())==null?void 0:i.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([a,r])=>{typeof r>"u"&&delete n[a]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Jae,rangeExtractor:Qae,onChange:()=>{},measureElement:nie,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var a,r;(r=(a=this.options).onChange)==null||r.call(a,this,n)},this.maybeNotify=Xa(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const a=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==a){if(this.cleanup(),!a){this.maybeNotify();return}this.scrollElement=a,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,a)=>{const r=new Map,i=new Map;for(let o=a-1;o>=0;o--){const s=n[o];if(r.has(s.lane))continue;const l=i.get(s.lane);if(l==null||s.end>l.end?i.set(s.lane,s):s.end<l.end&&r.set(s.lane,!0),r.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((o,s)=>o.end===s.end?o.index-s.index:o.end-s.end)[0]:void 0},this.getMeasurementOptions=Xa(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,a,r,i,o)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:a,scrollMargin:r,getItemKey:i,enabled:o}),{key:!1}),this.getMeasurements=Xa(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:a,scrollMargin:r,getItemKey:i,enabled:o},s)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let c=l;c<n;c++){const d=i(c),p=this.options.lanes===1?u[c-1]:this.getFurthestMeasurement(u,c),g=p?p.end+this.options.gap:a+r,v=s.get(d),y=typeof v=="number"?v:this.options.estimateSize(c),I=g+y,b=p?p.lane:c%this.options.lanes;u[c]={index:c,start:g,size:y,end:I,key:d,lane:b}}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Xa(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,a,r,i)=>this.range=n.length>0&&a>0?iie({measurements:n,outerSize:a,scrollOffset:r,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Xa(()=>{let n=null,a=null;const r=this.calculateRange();return r&&(n=r.startIndex,a=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,a]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,a]},(n,a,r,i,o)=>i===null||o===null?[]:n({startIndex:i,endIndex:o,overscan:a,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const a=this.options.indexAttribute,r=n.getAttribute(a);return r?parseInt(r,10):(console.warn(`Missing attribute name '${a}={index}' on measured element.`),-1)},this._measureElement=(n,a)=>{const r=this.indexFromElement(n),i=this.measurementsCache[r];if(!i)return;const o=i.key,s=this.elementsCache.get(o);s!==n&&(s&&this.observer.unobserve(s),this.observer.observe(n),this.elementsCache.set(o,n)),n.isConnected&&this.resizeItem(r,this.options.measureElement(n,a,this))},this.resizeItem=(n,a)=>{const r=this.measurementsCache[n];if(!r)return;const i=this.itemSizeCache.get(r.key)??r.size,o=a-i;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,o,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,a)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,r)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(r))});return}this._measureElement(n,void 0)},this.getVirtualItems=Xa(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,a)=>{const r=[];for(let i=0,o=n.length;i<o;i++){const s=n[i],l=a[s];r.push(l)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const a=this.getMeasurements();if(a.length!==0)return vN(a[Nz(0,a.length-1,r=>vN(a[r]).start,n)])},this.getOffsetForAlignment=(n,a,r=0)=>{const i=this.getSize(),o=this.getScrollOffset();a==="auto"&&(a=n>=o+i?"end":"start"),a==="center"?n+=(r-i)/2:a==="end"&&(n-=i);const s=this.getTotalSize()-i;return Math.max(Math.min(s,n),0)},this.getOffsetForIndex=(n,a="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.measurementsCache[n];if(!r)return;const i=this.getSize(),o=this.getScrollOffset();if(a==="auto")if(r.end>=o+i-this.options.scrollPaddingEnd)a="end";else if(r.start<=o+this.options.scrollPaddingStart)a="start";else return[o,a];const s=a==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,a,r.size),a]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:a="start",behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,a),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:a="auto",behavior:r}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,a);if(!i)return;const[o,s]=i;this._scrollToOffset(o,{adjustments:void 0,behavior:r}),r!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const u=this.getOffsetForIndex(n,s);if(!u)return;const[c]=u,d=this.getScrollOffset();Kae(c,d)||this.scrollToIndex(n,{align:s,behavior:r})}else this.scrollToIndex(n,{align:s,behavior:r})}))},this.scrollBy=(n,{behavior:a}={})=>{this.cancelScrollToIndex(),a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:a})},this.getTotalSize=()=>{var n;const a=this.getMeasurements();let r;if(a.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((n=a[a.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let o=a.length-1;for(;o>=0&&i.some(s=>s===null);){const s=a[o];i[s.lane]===null&&(i[s.lane]=s.end),o--}r=Math.max(...i.filter(s=>s!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:a,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:a},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const Nz=(e,t,n,a)=>{for(;e<=t;){const r=(e+t)/2|0,i=n(r);if(i<a)e=r+1;else if(i>a)t=r-1;else return r}return e>0?e-1:0};function iie({measurements:e,outerSize:t,scrollOffset:n,lanes:a}){const r=e.length-1,i=l=>e[l].start;if(e.length<=a)return{startIndex:0,endIndex:r};let o=Nz(0,r,i,n),s=o;if(a===1)for(;s<r&&e[s].end<n+t;)s++;else if(a>1){const l=Array(a).fill(0);for(;s<r&&l.some(c=>c<n+t);){const c=e[s];l[c.lane]=c.end,s++}const u=Array(a).fill(n+t);for(;o>=0&&u.some(c=>c>=n);){const c=e[o];u[c.lane]=c.start,o--}o=Math.max(0,o-o%a),s=Math.min(r,s+(a-1-s%a))}return{startIndex:o,endIndex:s}}const EN=typeof document<"u"?V.useLayoutEffect:V.useEffect;function oie(e){const t=V.useReducer(()=>({}),{})[1],n={...e,onChange:(r,i)=>{var o;i?Qc.flushSync(t):t(),(o=e.onChange)==null||o.call(e,r,i)}},[a]=V.useState(()=>new aie(n));return a.setOptions(n),EN(()=>a._didMount(),[]),EN(()=>a._willUpdate()),a}function sie(e){return oie({observeElementRect:eie,observeElementOffset:tie,scrollToFn:rie,...e})}const hb=e=>e===void 0?"":typeof e=="string"?e:e.id||"",vb=e=>typeof e=="string"?e:e===void 0?"":e.text||"",lie={items:[]},Tu=Jt({defaultConfig:{...lie,id:"",getId:hb,getTextValue:vb,nonInteractiveIds:[],orientation:"vertical",defaultItemHeight:50,shouldVirtualize:!0}})(e=>{var b;const t=fa(e.id),n=D.useRef(hb),a=D.useRef(vb);n.current=e.getId||hb,a.current=e.getTextValue||e.getId||vb;const[r]=D.useState(e.orientation||"vertical"),[i,o]=D.useState(e.defaultItemHeight),s=e.shouldVirtualize&&!!((b=e.items)!=null&&b.length),l=D.useRef(0),u=D.useRef(null),c=D.useMemo(()=>(e.items||[]).map((f,h)=>({id:n.current(f),index:h,value:f,textValue:a.current(f)})),[e.items]),[d,p]=D.useState([]),g=sie({count:c.length,getScrollElement:()=>u.current,estimateSize:D.useCallback(()=>i,[i]),horizontal:e.orientation==="horizontal",overscan:3});return{state:{...{items:c.length?c:d},UNSTABLE_virtual:g,UNSTABLE_defaultItemHeight:i,containerRef:u,id:t,orientation:r,indexRef:l,nonInteractiveIds:e.nonInteractiveIds||[],isVirtualized:s},events:{registerItem(f){l.current++,p(h=>h.concat({...f,value:f,index:h.length}))},unregisterItem(f){p(h=>h.find(E=>E.id===f.id)?h.filter(E=>E.id!==f.id):h)},updateItemHeight(f){o(f.value)}},getId:e.getId,getTextValue:e.getTextValue}}),uie=e=>e,Tp=()=>0,xp=(e,{state:t})=>t.items.length-1,cie=(e,{state:t})=>{if(t.columnCount){const n=e%t.columnCount;return e-n}return Tp()},die=(e,{state:t})=>{if(t.columnCount){const n=e%t.columnCount-t.columnCount+1;let a=e-n;return a>=t.items.length&&(a=t.items.length-1),a}return xp(e,{state:t})},pie=(e,{state:t})=>t.columnCount?e%t.columnCount:Tp(),fie=(e,{state:t})=>t.columnCount?t.items.length-t.columnCount+e%t.columnCount:xp(e,{state:t}),mie=(e,{state:t})=>t.items.find(n=>n.id===e),kr=e=>typeof e.cursorId=="string"?e.cursorId:e.cursorId.slice(-1)[0]||"",$c=(e,t)=>e.cursorId&&typeof e.cursorId=="string"?e.cursorId===t:e.cursorId.includes(t),zo=e=>(t,{state:n},a=n.items.length)=>{if(Number.isNaN(t)){if(e===1)return Tp();if(e===-1)return xp(t,{state:n})}const r=n.items;let i=t+e;const s=Math.ceil(r.length/n.columnCount)*n.columnCount;return i<0?e===-1?i=r.length-1:(s+i>=r.length&&(i-=n.columnCount),i=s+i):i>=r.length&&(e===1?i=0:(i-s<0&&(i+=n.columnCount),i=i-s)),r.length>1&&n.nonInteractiveIds.includes(r[i].id)&&a>0?zo(e)(i,{state:n},a-1):i},gie=uie({getFirst:Tp,getLast:xp,getItem:mie,getNext:zo(1),getNextRow:(e,{state:t})=>zo(t.columnCount)(e,{state:t}),getPrevious:zo(-1),getPreviousRow:(e,{state:t})=>zo(-t.columnCount)(e,{state:t}),getPreviousPage:pie,getNextPage:fie,getFirstOfRow:cie,getLastOfRow:die}),xu=Jt({defaultConfig:{...Tu.defaultConfig,initialCursorId:"",columnCount:0,navigation:gie,pageSize:0},requiredConfig:Tu.requiredConfig,contextOverride:Tu.Context})(e=>{var d;const[t,n]=D.useState(e.initialCursorId),a=D.useRef(e.pageSize),r=e.columnCount||0,i=Tu(e),o=e.navigation,s=D.useRef(-1),l=p=>{var v;const g=((v=u.items[p])==null?void 0:v.id)||"";n(g)};t&&((d=i.state.items[s.current])==null?void 0:d.id)!==t?s.current=i.state.items.findIndex(p=>p.id===t):t||(s.current=-1);const u={...i.state,cursorId:t,columnCount:r,pageSizeRef:a,cursorIndexRef:s},c={...i.events,goTo(p){const g=u.items.findIndex(v=>v.id===p.id);l(g)},goToNext(){const p=o.getNext(s.current,{state:u});l(p)},goToPrevious(){const p=o.getPrevious(s.current,{state:u});l(p)},goToPreviousRow(){const p=o.getPreviousRow(s.current,{state:u});l(p)},goToNextRow(){const p=o.getNextRow(s.current,{state:u});l(p)},goToFirst(){const p=o.getFirst(s.current,{state:u});l(p)},goToLast(){const p=o.getLast(s.current,{state:u});l(p)},goToFirstOfRow(){const p=o.getFirstOfRow(s.current,{state:u});l(p)},goToLastOfRow(){const p=o.getLastOfRow(s.current,{state:u});l(p)},goToNextPage(){const p=o.getNextPage(s.current,{state:u});l(p)},goToPreviousPage(){const p=o.getPreviousPage(s.current,{state:u});l(p)}};return{...i,state:u,events:c,navigation:o}}),hie=(e,{selectedIds:t,unselectedIds:n})=>t==="all"?!n.includes(e):t.includes(e),Oz={select(e){return{selectedIds:[e],unselectedIds:[]}}},vie={select(e,{selectedIds:t,unselectedIds:n}){return t==="all"?{selectedIds:"all",unselectedIds:n.includes(e)?n.filter(r=>r!==e):n.concat(e)}:{selectedIds:t.includes(e)?t.filter(r=>r!==e):t.concat(e),unselectedIds:[]}}},bb=Jt({defaultConfig:{...xu.defaultConfig,initialSelectedIds:[],initialUnselectedIds:[],selection:Oz},requiredConfig:xu.requiredConfig,contextOverride:xu.Context})(e=>{const t=xu(e),[n,a]=D.useState(e.initialSelectedIds),[r,i]=D.useState(e.initialUnselectedIds),o=e.selection,s={...t.state,selectedIds:n,unselectedIds:r},l={...t.events,select(u){const{selectedIds:c,unselectedIds:d}=o.select(u.id,s);a(c),i(d)},selectAll(){a("all")},unselectAll(){a([])},setSelectedIds(u){a(u)},remove(u){}};return{...t,state:s,events:l,selection:o}}),fi=Jt({defaultConfig:{UNSTABLE_parentModel:void 0,...bb.defaultConfig},requiredConfig:bb.requiredConfig})(e=>({UNSTABLE_parentModel:e.UNSTABLE_parentModel,...bb(e)})),Vu=D.createContext({});function bie(e,t){return typeof t=="function"?e.state.isVirtualized?e.state.UNSTABLE_virtual.getVirtualItems().map(a=>{const r=e.state.items[a.index],i=t(r.value,a.index);return m.jsx(Vu.Provider,{value:{item:r,virtual:a},children:i},r.id||r.index)}):e.state.items.map(a=>{const r=t(a.value,a.index);return m.jsx(Vu.Provider,{value:{item:a},children:r},a.id||a.index)}):m.jsx(Vu.Provider,{value:{},children:t})}const Rp=ee()((e,t,n={})=>{const{state:a,events:r}=e,{item:i,virtual:o}=D.useContext(Vu),[s,l]=D.useState(n["data-id"]||(i==null?void 0:i.id)||""),{localRef:u,elementRef:c}=Pr(zr(t,o?e.state.UNSTABLE_virtual.measureElement:null)),d=o?{position:"absolute",top:0,left:0,transform:`translateY(${o.start}px)`}:{};return RU(()=>{var y;if((o==null?void 0:o.index)===0&&((y=u.current)!=null&&y.clientHeight),i)return;const p=a.indexRef.current,g=s||(n["data-has-children"]?`${a.id}-`:"")+String(p);if(a.items.find(I=>I.id===g))return;const v={id:g,textValue:n["data-text"]?n["data-text"]:typeof n.children=="string"?n.children:""};return r.registerItem(v),l(g),()=>{r.unregisterItem({id:g})}}),{ref:c,"data-id":s,disabled:n.disabled||a.nonInteractiveIds.includes(s)?!0:void 0,"aria-setsize":o?a.UNSTABLE_virtual.options.count:void 0,"aria-posinset":o?i.index+1:void 0,"data-index":o?i.index:void 0,style:d,id:tk(`${a.id}-${s}`)}}),Oy={horizontal:{ArrowLeft:"goToPrevious",Left:"goToPrevious",ArrowRight:"goToNext",Right:"goToNext",Home:"goToFirst",End:"goToLast",PageDown:"goToNextPage",PageUp:"goToPreviousPage"},vertical:{ArrowUp:"goToPrevious",Up:"goToPrevious",ArrowDown:"goToNext",Down:"goToNext",Home:"goToFirst",End:"goToLast",PageDown:"goToNextPage",PageUp:"goToPreviousPage"}},yie={ArrowLeft:"ArrowRight",Left:"Right",ArrowRight:"ArrowLeft",Right:"Left",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",Home:"Home",End:"End",PageDown:"PageDown",PageUp:"PageUp"},_N={...Oy.horizontal,Home:"goToFirstOfRow",End:"goToLastOfRow",ArrowUp:"goToPreviousRow",Up:"goToPreviousRow",ArrowDown:"goToNextRow",Down:"goToNextRow"},yb={Home:"goToFirst",End:"goToLast"},wN=(e,t)=>e.hasOwnProperty(t);function Lz(e,t){var r,i,o,s;if(e.ctrlKey){for(const l in yb)if(wN(yb,l)&&e.key===l)return(i=(r=t.events)[yb[l]])==null||i.call(r),!0}const n=t.state.columnCount>0?_N:Oy[t.state.orientation],a=TU(e.currentTarget);for(const l in n)if(wN(n,l)&&(a?e.key===yie[l]:e.key===l)){const u=t.state.columnCount>0?_N[l]:Oy[t.state.orientation][l];if(t.events[u])return(s=(o=t.events)[u])==null||s.call(o),!0}return!1}const Dz=(e,t,n)=>{e()===!1&&t>1&&requestAnimationFrame(()=>Dz(e,t-1)),n==null||n("Retry timeout")},Sie=(e,t,n)=>new Promise((a,r)=>{var s;const i=(((s=n==null?void 0:n.dataset)==null?void 0:s.focusId)||"").split("-")[0]||e.state.id,o=e.navigation.getItem(t,e);if(o){e.state.isVirtualized&&e.state.UNSTABLE_virtual.scrollToIndex(o.index);const l=u=>document.querySelector(`[data-focus-id="${wU(`${u}-${o.id}`)}"]`);Dz(()=>{const u=l(i)||l(e.state.id);return u&&(u.focus(),a(u)),!!u},5,r)}}),$z=ee()((e,t,n={})=>{const a=D.useRef(e.state);a.current=e.state;const r=D.useRef(null);return D.useEffect(()=>{r.current&&Sie(e,kr(e.state),r.current).then(()=>{r.current=null})},[e.state.cursorId]),D.useEffect(()=>{!e.state.cursorId&&e.state.items.length&&e.events.goTo({id:e.state.items[0].id})},[e.state.cursorId,e.state.items,e.events]),{onKeyDown(i){Lz(i,e)&&(i.preventDefault(),r.current=i.currentTarget)},onClick(){e.events.goTo({id:n["data-id"]})},"data-focus-id":tk(`${e.state.id}-${n["data-id"]}`),tabIndex:e.state.cursorId?n["data-id"]&&$c(e.state,n["data-id"])?0:-1:0}}),Eie=ee()(({state:e,events:t},n,a={})=>{const r=a["data-id"]||"";return{onClick:o=>{!e.nonInteractiveIds.includes(r)&&o.currentTarget.getAttribute("aria-disabled")!=="true"&&t.select({id:r})}}}),_ie=ee()(e=>({"aria-activedescendant":e.state.cursorId?tk(`${e.state.id}-${typeof e.state.cursorId=="string"?e.state.cursorId:e.state.cursorId.join("-")}`):void 0})),wie=ee()((e,t,n={})=>{const a=n["data-id"]||"";return{className:$c(e.state,a)?"focus":""}}),kie=ce("li")({displayName:"Item",modelHook:fi,elemPropsHook:Rp})((e,t)=>m.jsx(t,{...he(e)})),Iie=ee()(e=>({style:{position:"relative",height:e.state.isVirtualized?e.state.UNSTABLE_virtual.getTotalSize():void 0}})),kN=se({parts:{listBoxContainer:"list-box-container"},base:{'& :where([data-part="list"])':{display:"flex",flexDirection:"column",marginBlock:0}},modifiers:{orientation:{vertical:{overflowY:"auto"},horizontal:{overflowY:void 0,'& :where([data-part="list"])':{flexDirection:"row"}}}}}),Mz=cr("ul")({displayName:"ListBox",modelHook:fi,elemPropsHook:Iie,subComponents:{Item:kie}})(({height:e,maxHeight:t,marginY:n,marginBottom:a,overflowY:r,marginTop:i,...o},s,l)=>m.jsx("div",{ref:l.state.containerRef,...kN.parts.listBoxContainer,...At({style:{height:e,maxHeight:t,marginBottom:a??n,marginTop:i??n}},kN({orientation:l.state.orientation})),children:m.jsx(s,{...he(o),"data-part":"list",children:bie(l,o.children)})})),dt=Jt({defaultConfig:{...fi.defaultConfig,...et.defaultConfig,mode:"single",shouldVirtualize:!1},requiredConfig:{...fi.requiredConfig,...et.requiredConfig},contextOverride:et.Context})(e=>{const t=fi(fi.mergeConfig(e,{selection:e.mode==="single"?Oz:vie})),n=et(et.mergeConfig(e,{id:t.state.id,onHide(){t.state.indexRef.current=0}}));ez(n),rk(n);const a={mode:e.mode,...t.state,...n.state},r={...t.events,...n.events};return{...t,...n,state:a,events:r,UNSTABLE_parentModel:e.UNSTABLE_parentModel}}),Pz=se({vars:{minWidth:me(1),transformOriginVertical:"top",transformOriginHorizontal:"left",maxHeight:""},base:({transformOriginVertical:e,transformOriginHorizontal:t,minWidth:n,maxHeight:a})=>({fontFamily:rt.default,fontWeight:Ze.normal,fontSize:S.fontSize.subtext.lg,lineHeight:S.lineHeight.subtext.lg,letterSpacing:S.letterSpacing.subtext.lg,color:C.fg.default,position:"relative",display:"flex",flexDirection:"column",transition:"transform ease-out 150ms",padding:S.padding.xxs,borderRadius:S.shape.xxl,maxWidth:$n.subtract("100vw",S.size.sm),boxShadow:yp[3],minWidth:n,maxHeight:a,transformOrigin:`${e} ${t}`,".wd-no-animation &":{animation:"none"}})}),Tie=ee()(()=>({})),Fz=ce("div")({displayName:"Menu.Card",modelHook:dt,elemPropsHook:Tie})(({minWidth:e,maxHeight:t,...n},a,r)=>{const i=V.useMemo(()=>_p(r.state.placement||"bottom"),[r.state.placement]);return m.jsx(Ep,{as:a,...he(n,Pz({minWidth:typeof e=="number"?me(e):e,maxHeight:typeof t=="number"?me(t):t,transformOriginVertical:i.vertical,transformOriginHorizontal:i.horizontal})),children:n.children})}),xie=se({base:{display:"block",height:me(1),border:"none",borderTop:`${me(1)} solid ${S.color.border.default}`,margin:`${S.gap.sm} ${S.gap.md}`}}),Uz=Re("hr")({displayName:"Menu.Divider",Component({...e},t,n){return m.jsx(n,{ref:t,...At(e,xie())})}});var Rie=function(e){return Object.prototype.hasOwnProperty.call(e,"props")},Aie=function(e,t){return e+Rs(t)},Rs=function(e){return e===null||typeof e=="boolean"||typeof e>"u"?"":typeof e=="number"?e.toString():typeof e=="string"?e:Array.isArray(e)?e.reduce(Aie,""):Rie(e)&&Object.prototype.hasOwnProperty.call(e.props,"children")?Rs(e.props.children):""};Rs.default=Rs;var Cie=Rs;const Nie=As(Cie),IN={vertical:"bottom",horizontal:"center"},Ly=Ea("positionX","positionY"),Oie=Yw({"0%":{opacity:0,transform:`translate(${Ly.positionX}, ${Ly.positionY})`},"100%":{opacity:1,transform:"translate(0)"}}),Lie=se({vars:{tooltipTransformOriginHorizontal:"",tooltipTransformOriginVertical:""},base:({tooltipTransformOriginHorizontal:e,tooltipTransformOriginVertical:t})=>({fontFamily:rt.default,fontWeight:Ze.normal,fontSize:S.fontSize.subtext.md,lineHeight:S.lineHeight.subtext.md,letterSpacing:S.letterSpacing.subtext.md,display:"inline-flex",position:"relative",padding:S.padding.sm,color:C.fg.inverse,animationName:Oie,animationDuration:"150ms",animationTimingFunction:"ease-out",transformOrigin:`${t} ${e}`,a:{color:C.fg.inverse,textDecoration:"underline"},"&:before":{content:'""',borderRadius:S.shape.md,outline:`${me(1)} solid transparent`,outlineOffset:`-${me(1)}`,zIndex:-1,margin:S.gap.xs,backgroundColor:S.color.surface.contrast.default,position:"absolute",top:0,left:0,right:0,bottom:0,boxShadow:yp[2]},"[data-popper-reference-hidden] &":{visibility:"hidden",pointerEvents:"none"},'[data-popper-placement="top-start"] &, [data-popper-placement="bottom-start"] &':{left:$n.negate(Jn.size50)},'[data-popper-placement="top-end"] &, [data-popper-placement="bottom-end"] &':{right:$n.negate(Jn.size50)},'[data-popper-placement="left-start"] &, [data-popper-placement="right-start"] &':{top:$n.negate(Jn.size50)},'[data-popper-placement="left-end"] &, [data-popper-placement="right-end"] &':{bottom:$n.negate(Jn.size50)}}),modifiers:{elementHasFocus:{true:{padding:$n.subtract(S.padding.md,$n.divide(S.padding.xxs,2)),"&:before":{margin:Jn.size75}}}}}),zz=Re("div")({displayName:"TooltipContainer",Component:({children:e,transformOrigin:t=IN,elementHasFocus:n=!1,...a},r,i)=>{const o=IU(t||IN,S.gap.sm);return m.jsx(i,{ref:r,...he(a,[Lie({tooltipTransformOriginHorizontal:t==null?void 0:t.horizontal,tooltipTransformOriginVertical:t==null?void 0:t.vertical,elementHasFocus:n}),Ly({positionX:o.x,positionY:o.y})]),children:e})}}),TN=(e,t=0)=>{const n=V.useRef(),a=()=>{n.current=window.setTimeout(e,t)},r=()=>{window.clearTimeout(n.current),n.current=void 0};return V.useEffect(()=>()=>{window.clearTimeout(n.current)},[n]),{start:a,clear:r}},Die=e=>{const t=e.tagName.toLowerCase(),n=e.getAttribute("tabindex");switch(t){case"button":case"input":case"select":case"textarea":case"details":return!0;default:return n?Number(n)>=0:!1}};function jz({type:e="label",titleText:t="",showDelay:n=300,hideDelay:a=100}={}){const r=V.useRef(!1),i=et(),[o,s]=V.useState(null),l=fa(),u=TN(i.events.hide,a),c=TN(i.events.show,n),d=()=>{u.start(),c.clear()},p=()=>{c.start(),u.clear()},g=f=>{s(f.currentTarget),p()},v=f=>{r.current||g(f),r.current=!1},y=f=>{r.current=!0,Die(f.currentTarget)&&i.events.hide()};rk(i),ez(i),Ene(i),_ne(i);const I=i.state.visibility!=="hidden",b={"aria-describedby":e==="describe"&&I?l:void 0,"aria-description":e==="description"?t:void 0,"aria-label":e==="label"?t:void 0,onMouseEnter:g,onMouseLeave:d,onMouseDown:y,onFocus:v,onBlur:d};return b["aria-describedby"]===void 0&&delete b["aria-describedby"],{targetProps:b,popperProps:{open:I,anchorElement:o,ref:i.state.stackRef},tooltipProps:{id:e==="describe"&&I?l:void 0,role:"tooltip",onMouseEnter:p,onMouseLeave:d}}}function $ie(e,t,n=Object.keys(t)){return n.reduce((a,r)=>(typeof e[r]=="function"?a[r]=Jw(t[r],e[r]):a[r]=t[r],a),{})}const Mie=Re("div")({displayName:"Tooltip",Component({type:e="label",placement:t="top",title:n,children:a,showDelay:r=300,hideDelay:i=100,fallbackPlacements:o=gk,...s}){const l=Nie(n),{targetProps:u,popperProps:c,tooltipProps:d}=jz({type:e,titleText:l,showDelay:r,hideDelay:i}),[p,g]=V.useState(!1),{localRef:v}=Pr();return V.useEffect(()=>{const y=v.current;if(!y)return;const I=()=>{g(y.matches(":focus-visible")||y.classList.contains("focus"))};return I(),y.addEventListener("focus",I),y.addEventListener("blur",I),()=>{y.removeEventListener("focus",I),y.removeEventListener("blur",I)}},[v]),m.jsxs(V.Fragment,{children:[V.cloneElement(a,{...u,...$ie(a.props,u),.../^(muted|describe)$/.test(e)&&a.props["aria-label"]?{"aria-label":a.props["aria-label"]}:{}}),m.jsx(ql,{placement:t,fallbackPlacements:o,...c,children:({placement:y})=>{const I=_p(y);return m.jsx(zz,{transformOrigin:I,...At(s),...d,elementHasFocus:p,children:n})}})]})}}),Bz=e=>{const t=getComputedStyle(e);if(t.overflow==="auto"||t.overflow==="scroll"||t.overflow==="clip"||t.overflow==="hidden")return e;if(e.children){for(let n=0;n<e.children.length;n++){const a=Bz(e.children[n]);if(a)return a}return null}return null},qz=e=>{const t=getComputedStyle(e);if(t.textOverflow==="ellipsis"||Number(t.webkitLineClamp)>0)return e;for(let n=0;n<e.children.length;n++){const a=qz(e.children[n]);if(a)return a}return null},xN=e=>{const t=qz(e)||Bz(e);return t?t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight:!1};function Pie(e,t,n=Object.keys(t)){return n.reduce((a,r)=>(typeof e[r]=="function"?a[r]=Jw(t[r],e[r]):a[r]=t[r],a),{})}const hk=({placement:e="top",fallbackPlacements:t=gk,children:n,...a})=>{const[r,i]=V.useState(""),{targetProps:o,popperProps:s,tooltipProps:l}=jz({type:"muted"}),u=d=>{const p=d.currentTarget;i(p instanceof HTMLElement?p.innerText:""),xN(p)&&o.onMouseEnter(d)},c=d=>{const p=d.currentTarget;i(p instanceof HTMLElement?p.innerText:""),xN(p)&&o.onFocus(d)};return m.jsxs(V.Fragment,{children:[V.cloneElement(n,{...o,onMouseEnter:u,onFocus:c,"aria-label":void 0,...Pie({...o,onMouseEnter:u,onFocus:c},n.props)}),m.jsx(ql,{placement:e,fallbackPlacements:t,...s,children:({placement:d})=>{const p=_p(d);return m.jsx(zz,{transformOrigin:p,...l,...a,children:r})}})]})},Hz=Jt({defaultConfig:{id:void 0},requiredConfig:{}})(e=>({state:{id:fa(e.id)},events:{}})),Fie=se({base:{fontFamily:rt.default,fontSize:S.fontSize.subtext.lg,lineHeight:S.lineHeight.subtext.lg,letterSpacing:S.letterSpacing.subtext.lg,fontWeight:Ze.bold,display:"flex",alignItems:"center",width:"100%",gap:S.gap.md,padding:`${S.padding.xs} ${S.padding.md}`}}),Uie=ee()(e=>({"data-type":"group",role:"group","aria-labelledby":e.state.id})),zie=ee()(e=>({id:e.state.id})),RN=ce("div")({modelHook:Hz,elemPropsHook:zie})(({children:e,...t},n)=>m.jsx(hk,{children:m.jsx(n,{...he(t,Fie()),children:e})})),Gz=cr("div")({displayName:"Menu.Group",modelHook:Hz,elemPropsHook:Uie,subComponents:{Heading:RN}})(({children:e,title:t,...n},a)=>m.jsxs(a,{...he(n),children:[t?m.jsx(RN,{children:t}):null,e]})),Wl=se({parts:{text:"menu-item-text",icon:"menu-item-icon",selected:"menu-item-selected"},base:({textPart:e,iconPart:t,selectedPart:n})=>({fontFamily:rt.default,fontWeight:Ze.normal,fontSize:S.fontSize.subtext.lg,lineHeight:S.lineHeight.subtext.lg,letterSpacing:S.letterSpacing.subtext.lg,display:"flex",alignItems:"center",width:"100%",gap:S.gap.md,padding:`${S.padding.sm} ${S.padding.md}`,boxSizing:"border-box",cursor:"pointer",color:C.fg.default,borderWidth:0,borderRadius:S.shape.xxl,textAlign:"start",transition:"background-color 80ms, color 80ms",backgroundColor:"inherit",minHeight:S.size.md,overflowWrap:"anywhere",[Q.vars.color]:"currentColor",[`& :where(${n})`]:{transition:"opacity 80ms linear",opacity:ct.zero},"&:where(:has(span))":{display:"flex"},"&[aria-selected=true]":{color:S.color.brand.fg.primary.strong,backgroundColor:S.color.brand.surface.primary.strong,[`& :where(${n})`]:{opacity:ct.full},"&:where(.focus, :focus-visible)":{[Q.vars.color]:"currentColor",outline:"none",backgroundColor:S.color.brand.accent.primary,color:C.fg.inverse}},"&:is(.hover, :hover)":{color:C.fg.strong,backgroundColor:S.color.surface.overlay.hover.default},"&:is(.focus, :focus-visible)":{color:C.fg.inverse,backgroundColor:S.color.brand.accent.primary,outline:`${me(2)} solid transparent`,outlineOffset:`-${me(2)}`},"&:is(:disabled, [aria-disabled=true])":{cursor:"default",opacity:ct.disabled,"&:where(.hover, :hover, [aria-selected=true])":{background:"none"},"&:where(.focus, :focus-visible)":{backgroundColor:S.color.brand.accent.primary,opacity:ct.disabled}},[`& :where(${e})`]:{flexGrow:1,alignSelf:"center"},[`& :where(${t})`]:{alignSelf:"start"}})}),jie=e=>m.jsx(ks,{...Wl.parts.icon,...e}),Wz=Re("span")({Component:({...e},t,n)=>m.jsx(n,{ref:t,...Wl.parts.text,...At(e)})}),Vz=Re("button")({displayName:"MenuItem",Component:({children:e,isDisabled:t,...n},a,r)=>m.jsx(r,{ref:a,"aria-disabled":t,...he(n,Wl({})),children:typeof e=="string"?m.jsx(Wz,{children:e}):e})}),Zz=ee()(e=>({onKeyDown(t){const n=getComputedStyle(t.currentTarget);t.key==="ArrowLeft"&&n.direction==="ltr"&&e.UNSTABLE_parentModel&&e.events.hide(t)}})),Yz=ee()((e,t,n={"data-id":""})=>{const{localRef:a,elementRef:r}=Pr(t),i=n["data-id"];return V.useLayoutEffect(()=>{e.state.mode==="single"&&$c(e.state,i)&&requestAnimationFrame(()=>{var o;(o=a.current)==null||o.focus()})},[i,a,e.state.cursorId,e.state.mode]),{ref:r,className:$c(e.state,n["data-id"])?"focus":void 0}});function Kz(e){e.UNSTABLE_parentModel&&(e.UNSTABLE_parentModel.events.hide(),Kz(e.UNSTABLE_parentModel))}const Bie=dr(ee()(e=>({role:"menuitem",onMouseDown(t){e.events.goTo({id:t.currentTarget.getAttribute("data-id")})},onClick:e.state.mode==="single"?t=>{t.currentTarget.getAttribute("aria-disabled")!=="true"&&(e.events.hide(t),Kz(e))}:void 0})),Yz,Zz,Eie,$z,Rp),Yi=ce("button")({displayName:"Menu.Item",modelHook:dt,elemPropsHook:Bie,subComponents:{Icon:jie,Text:Wz}})(({children:e,...t},n)=>m.jsx(hk,{placement:"left",children:m.jsx(Vz,{as:n,...t,children:e})})),qie=dr(ee()(e=>({role:"menu","aria-labelledby":e.state.id,"aria-orientation":e.state.orientation})),sk,wne),Xz=se({base:{background:S.color.surface.popover,borderRadius:S.shape.xxl,padding:0,gap:S.gap.xs},modifiers:{orientation:{vertical:{flexDirection:"column"},horizontal:{flexDirection:"row"}}}}),Jz=ce("div")({displayName:"Menu.List",modelHook:dt,elemPropsHook:qie})(({children:e,...t},n,a)=>m.jsx(Mz,{as:n,model:a,marginY:S.gap.none,...At(t,Xz({orientation:a.state.orientation})),children:e})),Qz=Re("span")({Component:({...e},t,n)=>m.jsxs(m.Fragment,{children:[m.jsx(Yi.Text,{ref:t,as:n,...e}),m.jsx(ks,{...Wl.parts.selected,icon:Une})]})}),Hie=Re("li")({displayName:"MenuOption",Component:({children:e,...t},n,a)=>m.jsx(a,{ref:n,...he(t,Wl()),children:typeof e=="string"?m.jsx(Qz,{children:e}):e})}),Gie=dr(ee()((e,t,n={})=>{const a=n["data-id"]||"";return{role:"option","aria-selected":hie(a,e.state),onMouseDown:o=>{o.button===0&&o.currentTarget.getAttribute("aria-disabled")!=="true"&&(e.events.select({id:a}),e.state.mode==="single"&&e.events.hide(o)),o.preventDefault()}}}),wie,Rp),e2=ce("li")({displayName:"Menu.Item",modelHook:dt,elemPropsHook:Gie,subComponents:{Icon:Yi.Icon,Text:Qz}})(({children:e,...t},n)=>m.jsx(hk,{placement:"left",children:m.jsx(Hie,{as:n,...t,children:e})})),t2=ik,n2={modifiers:[{name:"offset",options:{offset:()=>[0,4]}}]},Wie=ce("div")({modelHook:dt,elemPropsHook:t2})(({children:e,...t})=>m.jsx(ql,{placement:"bottom-start",popperOptions:n2,...t,children:e})),r2=ee()(e=>({id:e.state.id,"aria-haspopup":"true","aria-expanded":e.state.visibility==="visible",onKeyDown(t){switch(t.key){case"ArrowDown":case"ArrowUp":e.events.show(t)}}})),Vie=dr(r2,ok),Zie=dr(r2,Ane),Yie=ce(kp)({displayName:"Menu.Target",modelHook:dt,elemPropsHook:Vie})(({children:e,...t},n)=>m.jsx(n,{...t,children:e})),Kie=ce(kp)({displayName:"Menu.Target",modelHook:dt,elemPropsHook:Zie})(({children:e,...t},n)=>m.jsx(n,{...t,children:e})),Xie=ce("div")({modelHook:dt,elemPropsHook:t2})(({children:e,...t})=>m.jsx(ql,{placement:"right-start",popperOptions:n2,...t,children:e})),Jie=(e,t=0)=>{const n=D.useRef(),a=()=>{n.current=window.setTimeout(e,t)},r=()=>{window.clearTimeout(n.current),n.current=void 0};return D.useEffect(()=>()=>{window.clearTimeout(n.current)},[n]),{start:a,clear:r}},Qie=dr(_u(e=>e.UNSTABLE_parentModel,Yz),_u(e=>e.UNSTABLE_parentModel,Zz),_u(e=>e.UNSTABLE_parentModel,$z),ee()((e,t)=>({ref:zr(t,e.state.targetRef)})),_u(e=>e.UNSTABLE_parentModel,Rp),ee()(e=>{const t=D.useRef(),n=Jie(()=>{e.UNSTABLE_parentModel.events.goTo({id:t.current||""}),e.events.show(event)},300);return{id:e.state.id,role:"menuitem","aria-haspopup":"true","aria-expanded":e.state.visibility==="visible",onMouseDown(a){e.UNSTABLE_parentModel.events.goTo({id:a.currentTarget.getAttribute("data-id")})},onMouseEnter(a){t.current=a.currentTarget.getAttribute("data-id"),n.start()},onMouseLeave(){n.clear()},onClick(a){e.state.targetRef.current instanceof Element||(e.state.targetRef.current=a.currentTarget),e.state.visibility!=="hidden"?e.events.hide(a):e.events.show(a)},"data-has-children":!0,onKeyDown(a){if(e.state.orientation==="vertical")switch(a.key){case"ArrowRight":case"Enter":case" ":e.events.show(a);break}}}})),eoe=ce("button")({modelHook:dt,elemPropsHook:Qie})(({children:e,...t},n)=>m.jsxs(Vz,{as:n,...t,children:[typeof e=="string"?m.jsx(Yi.Text,{children:e}):e,m.jsx(Yi.Icon,{icon:zne})]})),toe=ce()({modelHook:dt,subComponents:{Card:Fz,List:Jz,Item:Yi,TargetItem:eoe,Group:Gz,Option:e2,Divider:Uz,Popper:Xie}})(({children:e,model:t,...n},a,r)=>{const i=dt(dt.mergeConfig(n,{getId:r.getId,getTextValue:r.getTextValue,UNSTABLE_parentModel:r,mode:r.state.mode,orientation:r.state.orientation,onSelect(s){r.events.select(s)},onSelectAll(){r.events.selectAll()}})),o=dt.Context;return m.jsx(o.Provider,{value:i,children:e})}),Jo=cr()({displayName:"Menu",modelHook:dt,subComponents:{Target:Yie,Card:Fz,List:Jz,Item:Yi,Group:Gz,Option:e2,Divider:Uz,TargetContext:Kie,Popper:Wie,Submenu:toe}})(({children:e})=>m.jsx(m.Fragment,{children:e})),Sb=Jt({defaultConfig:{value:void 0,onFilterChange(e){},onChange(e){}}})(e=>{const t=D.createRef();return{onFilterChange:e.onFilterChange,onChange:e.onChange,state:{value:e.value,inputRef:t},events:{}}}),Ir=Jt({defaultConfig:{...Sb.defaultConfig,...dt.defaultConfig,shouldVirtualize:!0},requiredConfig:{...Sb.requiredConfig,...dt.requiredConfig}})(e=>{const t=Sb(e),n=dt(e),[a,r]=D.useState(0),i={width:a,...t.state,...n.state},o={...t.events,...n.events,setWidth(s){r(s)}};return{...n,...t,state:i,events:o}}),noe=ee()(e=>({onKeyDown(t){(t.key==="ArrowDown"||t.key==="ArrowUp"&&e.state.visibility!=="visible")&&(e.events.show(t),e.events.setWidth(t.currentTarget.getBoundingClientRect().width))}})),roe=ee()(e=>({onKeyDown(t){e.state.visibility==="visible"&&Lz(t,e)&&t.preventDefault()}})),aoe=ee()(e=>{const t=e.state.visibility!=="hidden";return D.useLayoutEffect(()=>{var n;t&&e.events.setWidth(((n=e.state.targetRef.current)==null?void 0:n.getBoundingClientRect().width)||0)},[t,e.events,e.state.targetRef]),{}}),a2=dr(ee()((e,t)=>{const n=zr(t,e.state.inputRef);return D.useEffect(()=>{if(e.state.cursorId&&e.state.visibility==="visible"){const a=e.navigation.getItem(kr(e.state),e);if(e.state.isVirtualized&&a)e.state.UNSTABLE_virtual.scrollToIndex(a.index);else{const r=document.querySelector(`[id="${e.state.id}-list"] [data-id="${kr(e.state)}"]`);r&&requestAnimationFrame(()=>{r.scrollIntoView({block:"nearest"})})}}},[e.state.cursorId,e.state.selectedIds,e.state.visibility]),{onKeyDown(a){if(a.key==="Enter"&&!a.metaKey&&e.state.visibility==="visible"){const r=document.querySelector(`[data-id="${kr(e.state)}"]`);r&&(r==null?void 0:r.getAttribute("aria-disabled"))!=="true"&&(e.events.select({id:kr(e.state)}),e.state.mode==="single"&&e.events.hide(a)),a.preventDefault()}},onBlur(a){e.events.hide(a)},onClick(a){e.state.visibility==="hidden"&&e.events.setWidth(a.currentTarget.getBoundingClientRect().width)},value:e.state.value,role:"combobox","aria-haspopup":"listbox","aria-expanded":e.state.visibility==="visible","aria-autocomplete":"list","aria-controls":`${e.state.id}-list`,"aria-activedescendant":e.state.visibility==="hidden"?null:void 0,id:e.state.id,ref:n}}),aoe,noe,_ie,roe,ok),ioe=ce(Zi)({modelHook:Ir,elemPropsHook:a2})(({children:e,...t},n)=>m.jsx(n,{...t,children:e})),ooe=ee()(e=>({minWidth:e.state.width})),soe=se({base:{'& :where([data-part="list-box-container"])':{borderRadius:S.shape.xxl}}}),loe=ce("div")({modelHook:Ir,elemPropsHook:ooe})(({children:e,...t},n)=>m.jsx(Jo.Card,{as:n,...At(t,soe()),children:e})),uoe=ee()(e=>({role:"listbox","aria-labelledby":e.state.id,id:`${e.state.id}-list`})),coe=se({base:{},extends:Xz}),doe=ce("ul")({modelHook:Ir,elemPropsHook:uoe})(({children:e,...t},n,a)=>m.jsx(Mz,{as:n,model:a,marginY:S.gap.none,...At(t,coe({orientation:a.state.orientation})),children:e})),poe=ik,foe=ce("div")({displayName:"Combobox.Menu.Popper",modelHook:dt,elemPropsHook:poe})(({children:e,...t})=>m.jsx(Jo.Popper,{fallbackPlacements:["top","bottom"],...t,children:e})),AN=ce()({modelHook:Ir,subComponents:{Popper:foe,List:doe,Item:Jo.Option,Card:loe,Divider:Jo.Divider}})(({children:e},t,n)=>m.jsx(Jo,{model:n,children:e})),ki=cr()({displayName:"Combobox",modelHook:Ir,subComponents:{Input:ioe,Menu:AN}})(({children:e},t,n)=>m.jsx(AN,{model:n,children:e})),moe=ee()(e=>(D.useLayoutEffect(()=>{var n;const t=(n=e.state.items.find(a=>a.id===e.state.cursorId))==null?void 0:n.id;!e.state.selectedIds.length&&e.state.items.length&&!t?e.events.goTo({id:e.state.items[0].id}):e.state.selectedIds.length&&!t&&e.events.goTo({id:e.state.selectedIds[0]})},[e.state.selectedIds,e.events,e.state.items,e.state.cursorId,e.state.visibility]),{})),goe=ee()(e=>{var u;const t=D.useRef(""),n=D.useRef(),[a,r]=D.useState(t.current),i=()=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{t.current="",r(t.current)},500)},o=(c,d,p=e.state.items.length,g=!0)=>{for(let v=c;v<p;v++)if(e.state.items[v].textValue.toLowerCase().startsWith(d.toLowerCase())&&(!g||g&&!e.state.nonInteractiveIds.includes(e.state.items[v].id)))return v;return-1},s=e.state.items.length>0&&((u=e.navigation.getItem(kr(e.state),e))==null?void 0:u.index)||0,l=(c,d)=>{const p=t.current.length===0?s+1:s,g=p===d?0:p;t.current+=c,r(t.current),i();let v=o(g,t.current);o(g,t.current),v===-1&&(v=o(0,t.current,g)),v>-1&&(e.events.goTo({id:e.state.items[v].id}),e.state.visibility==="hidden"&&e.events.select({id:e.state.items[v].id}))};return{onKeyDown(c){c.key.length===1&&c.key.match(/\S/)&&l(c.key,e.state.items.length),(c.key==="Spacebar"||c.key===" ")&&e.state.visibility==="visible"&&t.current!==""&&l(" ",e.state.items.length),(c.key==="Spacebar"||c.key===" ")&&e.state.visibility==="hidden"&&t.current!==""&&l(" ",e.state.items.length)},keySoFar:a}});function hoe(e){return!!e}const voe=ee()((e,t,{disabled:n,value:a,onChange:r,name:i}={})=>{const{elementRef:o,localRef:s}=Pr(e.state.targetRef),{elementRef:l,localRef:u}=Pr(t),c=D.useRef(e.navigation);c.current=e.navigation;const d=D.useRef(e.state);return d.current=e.state,D.useLayoutEffect(()=>{u.current&&typeof a=="string"&&a!==u.current.value&&e.events.setSelectedIds(a?a.split(", "):[])},[a,u,e.events]),D.useImperativeHandle(l,()=>{if(u.current&&s.current){const p=u.current,g=s.current;return Object.defineProperty(p,"value",{get(){var y,I;return(I=(y=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(p),"value"))==null?void 0:y.get)==null?void 0:I.call(p)},set(v){p&&v!==(d.current.selectedIds==="all"?[]:d.current.selectedIds).join(", ")&&e.events.setSelectedIds(v?v.split(", "):[])}}),Object.defineProperty(p,"focus",{configurable:!0,writable:!0,value:v=>g.focus(v)}),Object.defineProperty(p,"blur",{configurable:!0,writable:!0,value:()=>g.blur()}),p}return u.current},[u,s,e.events]),D.useLayoutEffect(()=>{if(s.current){const p=e.state.items.length===0?"":(e.state.selectedIds==="all"?[]:e.state.selectedIds.map(g=>c.current.getItem(g,{state:d.current})).filter(hoe).map(g=>g.textValue)).join(", ");p!==s.current.value&&xy(s.current,p)}if(u.current){const p=(e.state.selectedIds==="all"?[]:e.state.selectedIds).join(", ");p!==u.current.value&&xy(u.current,p)}},[e.state.selectedIds,e.state.items,u,s]),{ref:o,form:"",value:null,onChange:p=>{var g;return(g=e.onFilterChange)==null||g.call(e,p),null},name:null,disabled:n,formInputProps:{disabled:n,tabIndex:-1,"aria-hidden":!0,ref:l,onChange:p=>{var g;r==null||r(p),(g=e.onChange)==null||g.call(e,p)},name:i}}}),boe=ee()(e=>{const t=e.state.visibility!=="hidden";return D.useEffect(()=>{!t&&e.state.selectedIds.length&&e.events.goTo({id:e.state.selectedIds[0]})},[t,e.events,e.state.selectedIds]),{}}),Ap=Jt({defaultConfig:{...Ir.defaultConfig,shouldVirtualize:!1},requiredConfig:{...Ir.requiredConfig},contextOverride:Ir.Context})(e=>Ir(e)),yoe=ee()(e=>({width:e.state.width})),Soe=se({base:{[Pz.vars.maxHeight]:me(300)}}),Eoe=ce("div")({modelHook:Ap,elemPropsHook:yoe})(({children:e,...t},n)=>m.jsx(ki.Menu.Card,{as:n,...At(t,Soe()),children:e})),_oe=dr(ee()((e,t,n={})=>{const{elementRef:a,localRef:r}=Pr(t);return mte({ref:r,onResize:i=>{if(e.state.visibility==="visible"){const o=i.width?i.width+42+8:0;e.events.setWidth(o)}}}),D.useEffect(()=>{var i;if(e.state.cursorId&&e.state.visibility==="visible"){const o=e.navigation.getItem(kr(e.state),e);if(e.state.isVirtualized&&o)e.state.UNSTABLE_virtual.scrollToIndex(o.index);else{const s=(i=r.current)==null?void 0:i.getAttribute("aria-controls");if(s){const l=document.querySelector(`[id="${s}"] [data-id="${kr(e.state)}"]`);l&&requestAnimationFrame(()=>{l.scrollIntoView({block:"nearest"})})}}}},[e.state.cursorId,e.state.selectedIds,e.state.visibility]),{onKeyDown(i){i.key!=="Tab"&&i.preventDefault(),(i.key==="Spacebar"||i.key===" "&&e.state.visibility==="hidden"&&(n==null?void 0:n.keySoFar)==="")&&e.events.show(),(i.key==="Spacebar"||i.key===" ")&&e.state.visibility==="visible"&&(n==null?void 0:n.keySoFar)===""&&(e.events.select({id:kr(e.state)}),e.events.hide())},autoComplete:"off",keySoFar:null,ref:a}}),goe,boe,moe,voe,a2),va=se({parts:{caret:"select-caret-icon",caretContainer:"select-caret-container",startIconContainer:"select-start-icon-container",startIcon:"select-start-icon",endIcon:"select-end-icon",hiddenInput:"select-hidden-input",visualInput:"select-visual-input"},base:({hiddenInputPart:e,startIconPart:t,endIconPart:n,visualInputPart:a,caretContainerPart:r,startIconContainerPart:i,caretPart:o})=>({[e]:{position:"absolute",top:0,bottom:0,left:0,right:0,opacity:ct.zero,cursor:"default",pointerEvents:"none",minWidth:"100%",width:"100%"},[`${t}, ${n}, ${r}, ${i}`]:{position:"absolute",pointerEvents:"none"},[a]:{caretColor:"transparent",backgroundColor:S.color.surface.default,color:C.fg.default,cursor:"default","&::placeholder":{color:C.fg.default},"&::selection":{backgroundColor:"transparent"}},[o]:{[Q.vars.color]:C.fg.default},"&:has(:disabled, .disabled)":{[o]:{[Q.vars.color]:C.fg.disabled}}}),modifiers:{error:{error:({visualInputPart:e})=>({[e]:{backgroundColor:S.color.brand.surface.critical.default}}),caution:({visualInputPart:e})=>({[e]:{backgroundColor:S.color.brand.surface.caution.default}})}}}),woe=ce(Zi)({modelHook:Ap,elemPropsHook:_oe})(({inputStartIcon:e,formInputProps:t,error:n,...a},r,i)=>m.jsxs(Oo,{"data-width":"ck-formfield-width",...va({error:n}),children:[e&&i.state.selectedIds.length>0&&m.jsx(Oo.InnerStart,{...va.parts.startIconContainer,children:m.jsx(ks,{...va.parts.startIcon,icon:e})}),m.jsx(Oo.Input,{...va.parts.hiddenInput,...t}),m.jsx(Oo.Input,{as:r,placeholder:"Choose an option",error:n,...va.parts.visualInput,...a}),m.jsx(Oo.InnerEnd,{...va.parts.caretContainer,children:m.jsx(ks,{...va.parts.caret,icon:Fne})})]})),koe=ce("li")({modelHook:Ap,subComponents:{Icon:ki.Menu.Item.Icon}})(({children:e,...t},n,a)=>m.jsx(ki.Menu.Item,{as:n,...t,children:e})),Ja=cr()({displayName:"Select",modelHook:Ap,subComponents:{Input:woe,Popper:ki.Menu.Popper,Card:Eoe,List:ki.Menu.List,Item:koe}})(({children:e,...t},n,a)=>m.jsx(ki,{model:a,...t,children:e})),Ioe=["Blue","Yellow"],Toe=En({gap:ho.md,padding:Sp.xs}),i2=()=>{const e=pr(),t=n=>{n.preventDefault(),console.log("form data",{first:n.currentTarget.elements.namedItem("first").value,last:n.currentTarget.elements.namedItem("last").value,favoriteColor:n.currentTarget.elements.namedItem("favoriteColor").value}),e.events.hide()};return m.jsxs(K,{model:e,children:[m.jsx(K.Target,{icon:jne,children:"Create New User"}),m.jsx(K.Overlay,{children:m.jsxs(K.Card,{as:"form",onSubmit:t,children:[m.jsx(K.CloseIcon,{"aria-label":"Close"}),m.jsx(K.Heading,{children:"New User"}),m.jsxs(K.Body,{children:[m.jsxs(en,{children:[m.jsx(en.Label,{children:"First Name"}),m.jsx(en.Input,{as:Zi,name:"first"})]}),m.jsxs(en,{children:[m.jsx(en.Label,{children:"Last Name"}),m.jsx(en.Input,{as:Zi,name:"last"})]}),m.jsxs(en,{children:[m.jsx(en.Label,{children:"Favorite Color"}),m.jsx(en.Field,{children:m.jsxs(Ja,{items:Ioe,children:[m.jsx(en.Input,{as:Ja.Input,name:"favoriteColor"}),m.jsx(Ja.Popper,{children:m.jsx(Ja.Card,{children:m.jsx(Ja.List,{children:n=>m.jsx(Ja.Item,{children:n})})})})]})})]})]}),m.jsxs(xr,{cs:Toe,children:[m.jsx(K.CloseButton,{children:"Cancel"}),m.jsx(Fr,{type:"submit",children:"Submit"})]})]})})]})};i2.__RAW__=`import React from 'react';
520
+ color: hsl(${Math.max(0,Math.min(120-120*I,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(u=n==null?void 0:n.onChange)==null||u.call(n,r),r}return i.updateDeps=o=>{a=o},i}function vN(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Kae=(e,t)=>Math.abs(e-t)<=1,Xae=(e,t,n)=>{let a;return function(...r){e.clearTimeout(a),a=e.setTimeout(()=>t.apply(this,r),n)}},bN=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Jae=e=>e,Qae=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),a=[];for(let r=t;r<=n;r++)a.push(r);return a},eie=(e,t)=>{const n=e.scrollElement;if(!n)return;const a=e.targetWindow;if(!a)return;const r=o=>{const{width:s,height:l}=o;t({width:Math.round(s),height:Math.round(l)})};if(r(bN(n)),!a.ResizeObserver)return()=>{};const i=new a.ResizeObserver(o=>{const s=()=>{const l=o[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(bN(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},yN={passive:!0},SN=typeof window>"u"?!0:"onscrollend"in window,tie=(e,t)=>{const n=e.scrollElement;if(!n)return;const a=e.targetWindow;if(!a)return;let r=0;const i=e.options.useScrollendEvent&&SN?()=>{}:Xae(a,()=>{t(r,!1)},e.options.isScrollingResetDelay),o=c=>()=>{const{horizontal:d,isRtl:p}=e.options;r=d?n.scrollLeft*(p&&-1||1):n.scrollTop,i(),t(r,c)},s=o(!0),l=o(!1);l(),n.addEventListener("scroll",s,yN);const u=e.options.useScrollendEvent&&SN;return u&&n.addEventListener("scrollend",l,yN),()=>{n.removeEventListener("scroll",s),u&&n.removeEventListener("scrollend",l)}},nie=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const a=t.borderBoxSize[0];if(a)return Math.round(a[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},rie=(e,{adjustments:t=0,behavior:n},a)=>{var r,i;const o=e+t;(i=(r=a.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[a.options.horizontal?"left":"top"]:o,behavior:n})};class aie{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const a=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(i=>{const o=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var r;(r=a())==null||r.disconnect(),n=null},observe:r=>{var i;return(i=a())==null?void 0:i.observe(r,{box:"border-box"})},unobserve:r=>{var i;return(i=a())==null?void 0:i.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([a,r])=>{typeof r>"u"&&delete n[a]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Jae,rangeExtractor:Qae,onChange:()=>{},measureElement:nie,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var a,r;(r=(a=this.options).onChange)==null||r.call(a,this,n)},this.maybeNotify=Xa(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const a=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==a){if(this.cleanup(),!a){this.maybeNotify();return}this.scrollElement=a,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,a)=>{const r=new Map,i=new Map;for(let o=a-1;o>=0;o--){const s=n[o];if(r.has(s.lane))continue;const l=i.get(s.lane);if(l==null||s.end>l.end?i.set(s.lane,s):s.end<l.end&&r.set(s.lane,!0),r.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((o,s)=>o.end===s.end?o.index-s.index:o.end-s.end)[0]:void 0},this.getMeasurementOptions=Xa(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,a,r,i,o)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:a,scrollMargin:r,getItemKey:i,enabled:o}),{key:!1}),this.getMeasurements=Xa(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:a,scrollMargin:r,getItemKey:i,enabled:o},s)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let c=l;c<n;c++){const d=i(c),p=this.options.lanes===1?u[c-1]:this.getFurthestMeasurement(u,c),g=p?p.end+this.options.gap:a+r,v=s.get(d),y=typeof v=="number"?v:this.options.estimateSize(c),I=g+y,b=p?p.lane:c%this.options.lanes;u[c]={index:c,start:g,size:y,end:I,key:d,lane:b}}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Xa(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,a,r,i)=>this.range=n.length>0&&a>0?iie({measurements:n,outerSize:a,scrollOffset:r,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Xa(()=>{let n=null,a=null;const r=this.calculateRange();return r&&(n=r.startIndex,a=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,a]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,a]},(n,a,r,i,o)=>i===null||o===null?[]:n({startIndex:i,endIndex:o,overscan:a,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const a=this.options.indexAttribute,r=n.getAttribute(a);return r?parseInt(r,10):(console.warn(`Missing attribute name '${a}={index}' on measured element.`),-1)},this._measureElement=(n,a)=>{const r=this.indexFromElement(n),i=this.measurementsCache[r];if(!i)return;const o=i.key,s=this.elementsCache.get(o);s!==n&&(s&&this.observer.unobserve(s),this.observer.observe(n),this.elementsCache.set(o,n)),n.isConnected&&this.resizeItem(r,this.options.measureElement(n,a,this))},this.resizeItem=(n,a)=>{const r=this.measurementsCache[n];if(!r)return;const i=this.itemSizeCache.get(r.key)??r.size,o=a-i;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,o,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,a)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,r)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(r))});return}this._measureElement(n,void 0)},this.getVirtualItems=Xa(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,a)=>{const r=[];for(let i=0,o=n.length;i<o;i++){const s=n[i],l=a[s];r.push(l)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const a=this.getMeasurements();if(a.length!==0)return vN(a[Nz(0,a.length-1,r=>vN(a[r]).start,n)])},this.getOffsetForAlignment=(n,a,r=0)=>{const i=this.getSize(),o=this.getScrollOffset();a==="auto"&&(a=n>=o+i?"end":"start"),a==="center"?n+=(r-i)/2:a==="end"&&(n-=i);const s=this.getTotalSize()-i;return Math.max(Math.min(s,n),0)},this.getOffsetForIndex=(n,a="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.measurementsCache[n];if(!r)return;const i=this.getSize(),o=this.getScrollOffset();if(a==="auto")if(r.end>=o+i-this.options.scrollPaddingEnd)a="end";else if(r.start<=o+this.options.scrollPaddingStart)a="start";else return[o,a];const s=a==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,a,r.size),a]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:a="start",behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,a),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:a="auto",behavior:r}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,a);if(!i)return;const[o,s]=i;this._scrollToOffset(o,{adjustments:void 0,behavior:r}),r!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const u=this.getOffsetForIndex(n,s);if(!u)return;const[c]=u,d=this.getScrollOffset();Kae(c,d)||this.scrollToIndex(n,{align:s,behavior:r})}else this.scrollToIndex(n,{align:s,behavior:r})}))},this.scrollBy=(n,{behavior:a}={})=>{this.cancelScrollToIndex(),a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:a})},this.getTotalSize=()=>{var n;const a=this.getMeasurements();let r;if(a.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((n=a[a.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let o=a.length-1;for(;o>=0&&i.some(s=>s===null);){const s=a[o];i[s.lane]===null&&(i[s.lane]=s.end),o--}r=Math.max(...i.filter(s=>s!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:a,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:a},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const Nz=(e,t,n,a)=>{for(;e<=t;){const r=(e+t)/2|0,i=n(r);if(i<a)e=r+1;else if(i>a)t=r-1;else return r}return e>0?e-1:0};function iie({measurements:e,outerSize:t,scrollOffset:n,lanes:a}){const r=e.length-1,i=l=>e[l].start;if(e.length<=a)return{startIndex:0,endIndex:r};let o=Nz(0,r,i,n),s=o;if(a===1)for(;s<r&&e[s].end<n+t;)s++;else if(a>1){const l=Array(a).fill(0);for(;s<r&&l.some(c=>c<n+t);){const c=e[s];l[c.lane]=c.end,s++}const u=Array(a).fill(n+t);for(;o>=0&&u.some(c=>c>=n);){const c=e[o];u[c.lane]=c.start,o--}o=Math.max(0,o-o%a),s=Math.min(r,s+(a-1-s%a))}return{startIndex:o,endIndex:s}}const EN=typeof document<"u"?V.useLayoutEffect:V.useEffect;function oie(e){const t=V.useReducer(()=>({}),{})[1],n={...e,onChange:(r,i)=>{var o;i?Qc.flushSync(t):t(),(o=e.onChange)==null||o.call(e,r,i)}},[a]=V.useState(()=>new aie(n));return a.setOptions(n),EN(()=>a._didMount(),[]),EN(()=>a._willUpdate()),a}function sie(e){return oie({observeElementRect:eie,observeElementOffset:tie,scrollToFn:rie,...e})}const hb=e=>e===void 0?"":typeof e=="string"?e:e.id||"",vb=e=>typeof e=="string"?e:e===void 0?"":e.text||"",lie={items:[]},Tu=Jt({defaultConfig:{...lie,id:"",getId:hb,getTextValue:vb,nonInteractiveIds:[],orientation:"vertical",defaultItemHeight:50,shouldVirtualize:!0}})(e=>{var b;const t=fa(e.id),n=D.useRef(hb),a=D.useRef(vb);n.current=e.getId||hb,a.current=e.getTextValue||e.getId||vb;const[r]=D.useState(e.orientation||"vertical"),[i,o]=D.useState(e.defaultItemHeight),s=e.shouldVirtualize&&!!((b=e.items)!=null&&b.length),l=D.useRef(0),u=D.useRef(null),c=D.useMemo(()=>(e.items||[]).map((f,h)=>({id:n.current(f),index:h,value:f,textValue:a.current(f)})),[e.items]),[d,p]=D.useState([]),g=sie({count:c.length,getScrollElement:()=>u.current,estimateSize:D.useCallback(()=>i,[i]),horizontal:e.orientation==="horizontal",overscan:3});return{state:{...{items:c.length?c:d},UNSTABLE_virtual:g,UNSTABLE_defaultItemHeight:i,containerRef:u,id:t,orientation:r,indexRef:l,nonInteractiveIds:e.nonInteractiveIds||[],isVirtualized:s},events:{registerItem(f){l.current++,p(h=>h.concat({...f,value:f,index:h.length}))},unregisterItem(f){p(h=>h.find(E=>E.id===f.id)?h.filter(E=>E.id!==f.id):h)},updateItemHeight(f){o(f.value)}},getId:e.getId,getTextValue:e.getTextValue}}),uie=e=>e,Tp=()=>0,xp=(e,{state:t})=>t.items.length-1,cie=(e,{state:t})=>{if(t.columnCount){const n=e%t.columnCount;return e-n}return Tp()},die=(e,{state:t})=>{if(t.columnCount){const n=e%t.columnCount-t.columnCount+1;let a=e-n;return a>=t.items.length&&(a=t.items.length-1),a}return xp(e,{state:t})},pie=(e,{state:t})=>t.columnCount?e%t.columnCount:Tp(),fie=(e,{state:t})=>t.columnCount?t.items.length-t.columnCount+e%t.columnCount:xp(e,{state:t}),mie=(e,{state:t})=>t.items.find(n=>n.id===e),kr=e=>typeof e.cursorId=="string"?e.cursorId:e.cursorId.slice(-1)[0]||"",$c=(e,t)=>e.cursorId&&typeof e.cursorId=="string"?e.cursorId===t:e.cursorId.includes(t),zo=e=>(t,{state:n},a=n.items.length)=>{if(Number.isNaN(t)){if(e===1)return Tp();if(e===-1)return xp(t,{state:n})}const r=n.items;let i=t+e;const s=Math.ceil(r.length/n.columnCount)*n.columnCount;return i<0?e===-1?i=r.length-1:(s+i>=r.length&&(i-=n.columnCount),i=s+i):i>=r.length&&(e===1?i=0:(i-s<0&&(i+=n.columnCount),i=i-s)),r.length>1&&n.nonInteractiveIds.includes(r[i].id)&&a>0?zo(e)(i,{state:n},a-1):i},gie=uie({getFirst:Tp,getLast:xp,getItem:mie,getNext:zo(1),getNextRow:(e,{state:t})=>zo(t.columnCount)(e,{state:t}),getPrevious:zo(-1),getPreviousRow:(e,{state:t})=>zo(-t.columnCount)(e,{state:t}),getPreviousPage:pie,getNextPage:fie,getFirstOfRow:cie,getLastOfRow:die}),xu=Jt({defaultConfig:{...Tu.defaultConfig,initialCursorId:"",columnCount:0,navigation:gie,pageSize:0},requiredConfig:Tu.requiredConfig,contextOverride:Tu.Context})(e=>{var d;const[t,n]=D.useState(e.initialCursorId),a=D.useRef(e.pageSize),r=e.columnCount||0,i=Tu(e),o=e.navigation,s=D.useRef(-1),l=p=>{var v;const g=((v=u.items[p])==null?void 0:v.id)||"";n(g)};t&&((d=i.state.items[s.current])==null?void 0:d.id)!==t?s.current=i.state.items.findIndex(p=>p.id===t):t||(s.current=-1);const u={...i.state,cursorId:t,columnCount:r,pageSizeRef:a,cursorIndexRef:s},c={...i.events,goTo(p){const g=u.items.findIndex(v=>v.id===p.id);l(g)},goToNext(){const p=o.getNext(s.current,{state:u});l(p)},goToPrevious(){const p=o.getPrevious(s.current,{state:u});l(p)},goToPreviousRow(){const p=o.getPreviousRow(s.current,{state:u});l(p)},goToNextRow(){const p=o.getNextRow(s.current,{state:u});l(p)},goToFirst(){const p=o.getFirst(s.current,{state:u});l(p)},goToLast(){const p=o.getLast(s.current,{state:u});l(p)},goToFirstOfRow(){const p=o.getFirstOfRow(s.current,{state:u});l(p)},goToLastOfRow(){const p=o.getLastOfRow(s.current,{state:u});l(p)},goToNextPage(){const p=o.getNextPage(s.current,{state:u});l(p)},goToPreviousPage(){const p=o.getPreviousPage(s.current,{state:u});l(p)}};return{...i,state:u,events:c,navigation:o}}),hie=(e,{selectedIds:t,unselectedIds:n})=>t==="all"?!n.includes(e):t.includes(e),Oz={select(e){return{selectedIds:[e],unselectedIds:[]}}},vie={select(e,{selectedIds:t,unselectedIds:n}){return t==="all"?{selectedIds:"all",unselectedIds:n.includes(e)?n.filter(r=>r!==e):n.concat(e)}:{selectedIds:t.includes(e)?t.filter(r=>r!==e):t.concat(e),unselectedIds:[]}}},bb=Jt({defaultConfig:{...xu.defaultConfig,initialSelectedIds:[],initialUnselectedIds:[],selection:Oz},requiredConfig:xu.requiredConfig,contextOverride:xu.Context})(e=>{const t=xu(e),[n,a]=D.useState(e.initialSelectedIds),[r,i]=D.useState(e.initialUnselectedIds),o=e.selection,s={...t.state,selectedIds:n,unselectedIds:r},l={...t.events,select(u){const{selectedIds:c,unselectedIds:d}=o.select(u.id,s);a(c),i(d)},selectAll(){a("all")},unselectAll(){a([])},setSelectedIds(u){a(u)},remove(u){}};return{...t,state:s,events:l,selection:o}}),fi=Jt({defaultConfig:{UNSTABLE_parentModel:void 0,...bb.defaultConfig},requiredConfig:bb.requiredConfig})(e=>({UNSTABLE_parentModel:e.UNSTABLE_parentModel,...bb(e)})),Vu=D.createContext({});function bie(e,t){return typeof t=="function"?e.state.isVirtualized?e.state.UNSTABLE_virtual.getVirtualItems().map(a=>{const r=e.state.items[a.index],i=t(r.value,a.index);return m.jsx(Vu.Provider,{value:{item:r,virtual:a},children:i},r.id||r.index)}):e.state.items.map(a=>{const r=t(a.value,a.index);return m.jsx(Vu.Provider,{value:{item:a},children:r},a.id||a.index)}):m.jsx(Vu.Provider,{value:{},children:t})}const Rp=ee()((e,t,n={})=>{const{state:a,events:r}=e,{item:i,virtual:o}=D.useContext(Vu),[s,l]=D.useState(n["data-id"]||(i==null?void 0:i.id)||""),{localRef:u,elementRef:c}=Pr(zr(t,o?e.state.UNSTABLE_virtual.measureElement:null)),d=o?{position:"absolute",top:0,left:0,transform:`translateY(${o.start}px)`}:{};return RU(()=>{var y;if((o==null?void 0:o.index)===0&&((y=u.current)!=null&&y.clientHeight),i)return;const p=a.indexRef.current,g=s||(n["data-has-children"]?`${a.id}-`:"")+String(p);if(a.items.find(I=>I.id===g))return;const v={id:g,textValue:n["data-text"]?n["data-text"]:typeof n.children=="string"?n.children:""};return r.registerItem(v),l(g),()=>{r.unregisterItem({id:g})}}),{ref:c,"data-id":s,disabled:n.disabled||a.nonInteractiveIds.includes(s)?!0:void 0,"aria-setsize":o?a.UNSTABLE_virtual.options.count:void 0,"aria-posinset":o?i.index+1:void 0,"data-index":o?i.index:void 0,style:d,id:tk(`${a.id}-${s}`)}}),Oy={horizontal:{ArrowLeft:"goToPrevious",Left:"goToPrevious",ArrowRight:"goToNext",Right:"goToNext",Home:"goToFirst",End:"goToLast",PageDown:"goToNextPage",PageUp:"goToPreviousPage"},vertical:{ArrowUp:"goToPrevious",Up:"goToPrevious",ArrowDown:"goToNext",Down:"goToNext",Home:"goToFirst",End:"goToLast",PageDown:"goToNextPage",PageUp:"goToPreviousPage"}},yie={ArrowLeft:"ArrowRight",Left:"Right",ArrowRight:"ArrowLeft",Right:"Left",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",Home:"Home",End:"End",PageDown:"PageDown",PageUp:"PageUp"},_N={...Oy.horizontal,Home:"goToFirstOfRow",End:"goToLastOfRow",ArrowUp:"goToPreviousRow",Up:"goToPreviousRow",ArrowDown:"goToNextRow",Down:"goToNextRow"},yb={Home:"goToFirst",End:"goToLast"},wN=(e,t)=>e.hasOwnProperty(t);function Lz(e,t){var r,i,o,s;if(e.ctrlKey){for(const l in yb)if(wN(yb,l)&&e.key===l)return(i=(r=t.events)[yb[l]])==null||i.call(r),!0}const n=t.state.columnCount>0?_N:Oy[t.state.orientation],a=TU(e.currentTarget);for(const l in n)if(wN(n,l)&&(a?e.key===yie[l]:e.key===l)){const u=t.state.columnCount>0?_N[l]:Oy[t.state.orientation][l];if(t.events[u])return(s=(o=t.events)[u])==null||s.call(o),!0}return!1}const Dz=(e,t,n)=>{e()===!1&&t>1&&requestAnimationFrame(()=>Dz(e,t-1)),n==null||n("Retry timeout")},Sie=(e,t,n)=>new Promise((a,r)=>{var s;const i=(((s=n==null?void 0:n.dataset)==null?void 0:s.focusId)||"").split("-")[0]||e.state.id,o=e.navigation.getItem(t,e);if(o){e.state.isVirtualized&&e.state.UNSTABLE_virtual.scrollToIndex(o.index);const l=u=>document.querySelector(`[data-focus-id="${wU(`${u}-${o.id}`)}"]`);Dz(()=>{const u=l(i)||l(e.state.id);return u&&(u.focus(),a(u)),!!u},5,r)}}),$z=ee()((e,t,n={})=>{const a=D.useRef(e.state);a.current=e.state;const r=D.useRef(null);return D.useEffect(()=>{r.current&&Sie(e,kr(e.state),r.current).then(()=>{r.current=null})},[e.state.cursorId]),D.useEffect(()=>{!e.state.cursorId&&e.state.items.length&&e.events.goTo({id:e.state.items[0].id})},[e.state.cursorId,e.state.items,e.events]),{onKeyDown(i){Lz(i,e)&&(i.preventDefault(),r.current=i.currentTarget)},onClick(){e.events.goTo({id:n["data-id"]})},"data-focus-id":tk(`${e.state.id}-${n["data-id"]}`),tabIndex:e.state.cursorId?n["data-id"]&&$c(e.state,n["data-id"])?0:-1:0}}),Eie=ee()(({state:e,events:t},n,a={})=>{const r=a["data-id"]||"";return{onClick:o=>{!e.nonInteractiveIds.includes(r)&&o.currentTarget.getAttribute("aria-disabled")!=="true"&&t.select({id:r})}}}),_ie=ee()(e=>({"aria-activedescendant":e.state.cursorId?tk(`${e.state.id}-${typeof e.state.cursorId=="string"?e.state.cursorId:e.state.cursorId.join("-")}`):void 0})),wie=ee()((e,t,n={})=>{const a=n["data-id"]||"";return{className:$c(e.state,a)?"focus":""}}),kie=ce("li")({displayName:"Item",modelHook:fi,elemPropsHook:Rp})((e,t)=>m.jsx(t,{...he(e)})),Iie=ee()(e=>({style:{position:"relative",height:e.state.isVirtualized?e.state.UNSTABLE_virtual.getTotalSize():void 0}})),kN=se({parts:{listBoxContainer:"list-box-container"},base:{'& :where([data-part="list"])':{display:"flex",flexDirection:"column",marginBlock:0}},modifiers:{orientation:{vertical:{overflowY:"auto"},horizontal:{overflowY:void 0,'& :where([data-part="list"])':{flexDirection:"row"}}}}}),Mz=cr("ul")({displayName:"ListBox",modelHook:fi,elemPropsHook:Iie,subComponents:{Item:kie}})(({height:e,maxHeight:t,marginY:n,marginBottom:a,overflowY:r,marginTop:i,...o},s,l)=>m.jsx("div",{ref:l.state.containerRef,...kN.parts.listBoxContainer,...At({style:{height:e,maxHeight:t,marginBottom:a??n,marginTop:i??n}},kN({orientation:l.state.orientation})),children:m.jsx(s,{...he(o),"data-part":"list",children:bie(l,o.children)})})),dt=Jt({defaultConfig:{...fi.defaultConfig,...et.defaultConfig,mode:"single",shouldVirtualize:!1},requiredConfig:{...fi.requiredConfig,...et.requiredConfig},contextOverride:et.Context})(e=>{const t=fi(fi.mergeConfig(e,{selection:e.mode==="single"?Oz:vie})),n=et(et.mergeConfig(e,{id:t.state.id,onHide(){t.state.indexRef.current=0}}));ez(n),rk(n);const a={mode:e.mode,...t.state,...n.state},r={...t.events,...n.events};return{...t,...n,state:a,events:r,UNSTABLE_parentModel:e.UNSTABLE_parentModel}}),Pz=se({vars:{minWidth:me(1),transformOriginVertical:"top",transformOriginHorizontal:"left",maxHeight:""},base:({transformOriginVertical:e,transformOriginHorizontal:t,minWidth:n,maxHeight:a})=>({fontFamily:rt.default,fontWeight:Ze.normal,fontSize:S.fontSize.subtext.lg,lineHeight:S.lineHeight.subtext.lg,letterSpacing:S.letterSpacing.subtext.lg,color:C.fg.default,position:"relative",display:"flex",flexDirection:"column",transition:"transform ease-out 150ms",padding:S.padding.xxs,borderRadius:S.shape.xxl,maxWidth:$n.subtract("100vw",S.size.sm),boxShadow:yp[3],minWidth:n,maxHeight:a,transformOrigin:`${e} ${t}`,".wd-no-animation &":{animation:"none"}})}),Tie=ee()(()=>({})),Fz=ce("div")({displayName:"Menu.Card",modelHook:dt,elemPropsHook:Tie})(({minWidth:e,maxHeight:t,...n},a,r)=>{const i=V.useMemo(()=>_p(r.state.placement||"bottom"),[r.state.placement]);return m.jsx(Ep,{as:a,...he(n,Pz({minWidth:typeof e=="number"?me(e):e,maxHeight:typeof t=="number"?me(t):t,transformOriginVertical:i.vertical,transformOriginHorizontal:i.horizontal})),children:n.children})}),xie=se({base:{display:"block",height:me(1),border:"none",borderTop:`${me(1)} solid ${S.color.border.default}`,margin:`${S.gap.sm} ${S.gap.md}`}}),Uz=Re("hr")({displayName:"Menu.Divider",Component({...e},t,n){return m.jsx(n,{ref:t,...At(e,xie())})}});var Rie=function(e){return Object.prototype.hasOwnProperty.call(e,"props")},Aie=function(e,t){return e+Rs(t)},Rs=function(e){return e===null||typeof e=="boolean"||typeof e>"u"?"":typeof e=="number"?e.toString():typeof e=="string"?e:Array.isArray(e)?e.reduce(Aie,""):Rie(e)&&Object.prototype.hasOwnProperty.call(e.props,"children")?Rs(e.props.children):""};Rs.default=Rs;var Cie=Rs;const Nie=As(Cie),IN={vertical:"bottom",horizontal:"center"},Ly=Ea("positionX","positionY"),Oie=Yw({"0%":{opacity:0,transform:`translate(${Ly.positionX}, ${Ly.positionY})`},"100%":{opacity:1,transform:"translate(0)"}}),Lie=se({vars:{tooltipTransformOriginHorizontal:"",tooltipTransformOriginVertical:""},base:({tooltipTransformOriginHorizontal:e,tooltipTransformOriginVertical:t})=>({fontFamily:rt.default,fontWeight:Ze.normal,fontSize:S.fontSize.subtext.md,lineHeight:S.lineHeight.subtext.md,letterSpacing:S.letterSpacing.subtext.md,display:"inline-flex",position:"relative",padding:S.padding.sm,color:C.fg.inverse,animationName:Oie,animationDuration:"150ms",animationTimingFunction:"ease-out",transformOrigin:`${t} ${e}`,a:{color:C.fg.inverse,textDecoration:"underline"},"&:before":{content:'""',borderRadius:S.shape.md,outline:`${me(1)} solid transparent`,outlineOffset:`-${me(1)}`,zIndex:-1,margin:S.gap.xs,backgroundColor:S.color.surface.contrast.default,position:"absolute",top:0,left:0,right:0,bottom:0,boxShadow:yp[2]},"[data-popper-reference-hidden] &":{visibility:"hidden",pointerEvents:"none"},'[data-popper-placement="top-start"] &, [data-popper-placement="bottom-start"] &':{left:$n.negate(Jn.size50)},'[data-popper-placement="top-end"] &, [data-popper-placement="bottom-end"] &':{right:$n.negate(Jn.size50)},'[data-popper-placement="left-start"] &, [data-popper-placement="right-start"] &':{top:$n.negate(Jn.size50)},'[data-popper-placement="left-end"] &, [data-popper-placement="right-end"] &':{bottom:$n.negate(Jn.size50)}}),modifiers:{elementHasFocus:{true:{padding:$n.subtract(S.padding.md,$n.divide(S.padding.xxs,2)),"&:before":{margin:Jn.size75}}}}}),zz=Re("div")({displayName:"TooltipContainer",Component:({children:e,transformOrigin:t=IN,elementHasFocus:n=!1,...a},r,i)=>{const o=IU(t||IN,S.gap.sm);return m.jsx(i,{ref:r,...he(a,[Lie({tooltipTransformOriginHorizontal:t==null?void 0:t.horizontal,tooltipTransformOriginVertical:t==null?void 0:t.vertical,elementHasFocus:n}),Ly({positionX:o.x,positionY:o.y})]),children:e})}}),TN=(e,t=0)=>{const n=V.useRef(),a=()=>{n.current=window.setTimeout(e,t)},r=()=>{window.clearTimeout(n.current),n.current=void 0};return V.useEffect(()=>()=>{window.clearTimeout(n.current)},[n]),{start:a,clear:r}},Die=e=>{const t=e.tagName.toLowerCase(),n=e.getAttribute("tabindex");switch(t){case"button":case"input":case"select":case"textarea":case"details":return!0;default:return n?Number(n)>=0:!1}};function jz({type:e="label",titleText:t="",showDelay:n=300,hideDelay:a=100}={}){const r=V.useRef(!1),i=et(),[o,s]=V.useState(null),l=fa(),u=TN(i.events.hide,a),c=TN(i.events.show,n),d=()=>{u.start(),c.clear()},p=()=>{c.start(),u.clear()},g=f=>{s(f.currentTarget),p()},v=f=>{r.current||g(f),r.current=!1},y=f=>{r.current=!0,Die(f.currentTarget)&&i.events.hide()};rk(i),ez(i),Ene(i),_ne(i);const I=i.state.visibility!=="hidden",b={"aria-describedby":e==="describe"&&I?l:void 0,"aria-description":e==="description"?t:void 0,"aria-label":e==="label"?t:void 0,onMouseEnter:g,onMouseLeave:d,onMouseDown:y,onFocus:v,onBlur:d};return b["aria-describedby"]===void 0&&delete b["aria-describedby"],{targetProps:b,popperProps:{open:I,anchorElement:o,ref:i.state.stackRef},tooltipProps:{id:e==="describe"&&I?l:void 0,role:"tooltip",onMouseEnter:p,onMouseLeave:d}}}function $ie(e,t,n=Object.keys(t)){return n.reduce((a,r)=>(typeof e[r]=="function"?a[r]=Jw(t[r],e[r]):a[r]=t[r],a),{})}const Mie=Re("div")({displayName:"Tooltip",Component({type:e="label",placement:t="top",title:n,children:a,showDelay:r=300,hideDelay:i=100,fallbackPlacements:o=gk,...s}){const l=Nie(n),{targetProps:u,popperProps:c,tooltipProps:d}=jz({type:e,titleText:l,showDelay:r,hideDelay:i}),[p,g]=V.useState(!1),{localRef:v}=Pr();return V.useEffect(()=>{const y=v.current;if(!y)return;const I=()=>{g(y.matches(":focus-visible")||y.classList.contains("focus"))};return I(),y.addEventListener("focus",I),y.addEventListener("blur",I),()=>{y.removeEventListener("focus",I),y.removeEventListener("blur",I)}},[v]),m.jsxs(V.Fragment,{children:[V.cloneElement(a,{...u,...$ie(a.props,u),.../^(muted|describe)$/.test(e)&&a.props["aria-label"]?{"aria-label":a.props["aria-label"]}:{}}),m.jsx(ql,{placement:t,fallbackPlacements:o,...c,children:({placement:y})=>{const I=_p(y);return m.jsx(zz,{transformOrigin:I,...At(s),...d,elementHasFocus:p,children:n})}})]})}}),Bz=e=>{const t=getComputedStyle(e);if(t.overflow==="auto"||t.overflow==="scroll"||t.overflow==="clip"||t.overflow==="hidden")return e;if(e.children){for(let n=0;n<e.children.length;n++){const a=Bz(e.children[n]);if(a)return a}return null}return null},qz=e=>{const t=getComputedStyle(e);if(t.textOverflow==="ellipsis"||Number(t.webkitLineClamp)>0)return e;for(let n=0;n<e.children.length;n++){const a=qz(e.children[n]);if(a)return a}return null},xN=e=>{const t=qz(e)||Bz(e);return t?t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight:!1};function Pie(e,t,n=Object.keys(t)){return n.reduce((a,r)=>(typeof e[r]=="function"?a[r]=Jw(t[r],e[r]):a[r]=t[r],a),{})}const hk=({placement:e="top",fallbackPlacements:t=gk,children:n,...a})=>{const[r,i]=V.useState(""),{targetProps:o,popperProps:s,tooltipProps:l}=jz({type:"muted"}),u=d=>{const p=d.currentTarget;i(p instanceof HTMLElement?p.innerText:""),xN(p)&&o.onMouseEnter(d)},c=d=>{const p=d.currentTarget;i(p instanceof HTMLElement?p.innerText:""),xN(p)&&o.onFocus(d)};return m.jsxs(V.Fragment,{children:[V.cloneElement(n,{...o,onMouseEnter:u,onFocus:c,"aria-label":void 0,...Pie({...o,onMouseEnter:u,onFocus:c},n.props)}),m.jsx(ql,{placement:e,fallbackPlacements:t,...s,children:({placement:d})=>{const p=_p(d);return m.jsx(zz,{transformOrigin:p,...l,...a,children:r})}})]})},Hz=Jt({defaultConfig:{id:void 0},requiredConfig:{}})(e=>({state:{id:fa(e.id)},events:{}})),Fie=se({base:{fontFamily:rt.default,fontSize:S.fontSize.subtext.lg,lineHeight:S.lineHeight.subtext.lg,letterSpacing:S.letterSpacing.subtext.lg,fontWeight:Ze.bold,display:"flex",alignItems:"center",width:"100%",gap:S.gap.md,padding:`${S.padding.xs} ${S.padding.md}`}}),Uie=ee()(e=>({"data-type":"group",role:"group","aria-labelledby":e.state.id})),zie=ee()(e=>({id:e.state.id})),RN=ce("div")({modelHook:Hz,elemPropsHook:zie})(({children:e,...t},n)=>m.jsx(hk,{children:m.jsx(n,{...he(t,Fie()),children:e})})),Gz=cr("div")({displayName:"Menu.Group",modelHook:Hz,elemPropsHook:Uie,subComponents:{Heading:RN}})(({children:e,title:t,...n},a)=>m.jsxs(a,{...he(n),children:[t?m.jsx(RN,{children:t}):null,e]})),Wl=se({parts:{text:"menu-item-text",icon:"menu-item-icon",selected:"menu-item-selected"},base:({textPart:e,iconPart:t,selectedPart:n})=>({fontFamily:rt.default,fontWeight:Ze.normal,fontSize:S.fontSize.subtext.lg,lineHeight:S.lineHeight.subtext.lg,letterSpacing:S.letterSpacing.subtext.lg,display:"flex",alignItems:"center",width:"100%",gap:S.gap.md,padding:`${S.padding.sm} ${S.padding.md}`,boxSizing:"border-box",cursor:"pointer",color:C.fg.default,borderWidth:0,borderRadius:S.shape.xxl,textAlign:"start",transition:"background-color 80ms, color 80ms",backgroundColor:"inherit",minHeight:S.size.md,overflowWrap:"anywhere",[Q.vars.color]:"currentColor",[`& :where(${n})`]:{transition:"opacity 80ms linear",opacity:ct.zero},"&:where(:has(span))":{display:"flex"},"&[aria-selected=true]":{color:S.color.brand.fg.primary.strong,backgroundColor:S.color.brand.surface.primary.strong,[`& :where(${n})`]:{opacity:ct.full},"&:where(.focus, :focus-visible)":{[Q.vars.color]:"currentColor",outline:"none",backgroundColor:S.color.brand.accent.primary,color:C.fg.inverse}},"&:is(.hover, :hover)":{color:C.fg.strong,backgroundColor:S.color.surface.overlay.hover.default},"&:is(.focus, :focus-visible)":{color:C.fg.inverse,backgroundColor:S.color.brand.accent.primary,outline:`${me(2)} solid transparent`,outlineOffset:`-${me(2)}`},"&:is(:disabled, [aria-disabled=true])":{cursor:"default",opacity:ct.disabled,"&:where(.hover, :hover, [aria-selected=true])":{background:"none"},"&:where(.focus, :focus-visible)":{backgroundColor:S.color.brand.accent.primary,opacity:ct.disabled}},[`& :where(${e})`]:{flexGrow:1,alignSelf:"center"},[`& :where(${t})`]:{alignSelf:"start"}})}),jie=e=>m.jsx(ks,{...Wl.parts.icon,...e}),Wz=Re("span")({Component:({...e},t,n)=>m.jsx(n,{ref:t,...Wl.parts.text,...At(e)})}),Vz=Re("button")({displayName:"MenuItem",Component:({children:e,isDisabled:t,...n},a,r)=>m.jsx(r,{ref:a,"aria-disabled":t,...he(n,Wl({})),children:typeof e=="string"?m.jsx(Wz,{children:e}):e})}),Zz=ee()(e=>({onKeyDown(t){const n=getComputedStyle(t.currentTarget);t.key==="ArrowLeft"&&n.direction==="ltr"&&e.UNSTABLE_parentModel&&e.events.hide(t)}})),Yz=ee()((e,t,n={"data-id":""})=>{const{localRef:a,elementRef:r}=Pr(t),i=n["data-id"];return V.useLayoutEffect(()=>{e.state.mode==="single"&&$c(e.state,i)&&requestAnimationFrame(()=>{var o;(o=a.current)==null||o.focus()})},[i,a,e.state.cursorId,e.state.mode]),{ref:r,className:$c(e.state,n["data-id"])?"focus":void 0}});function Kz(e){e.UNSTABLE_parentModel&&(e.UNSTABLE_parentModel.events.hide(),Kz(e.UNSTABLE_parentModel))}const Bie=dr(ee()(e=>({role:"menuitem",onMouseDown(t){e.events.goTo({id:t.currentTarget.getAttribute("data-id")})},onClick:e.state.mode==="single"?t=>{t.currentTarget.getAttribute("aria-disabled")!=="true"&&(e.events.hide(t),Kz(e))}:void 0})),Yz,Zz,Eie,$z,Rp),Yi=ce("button")({displayName:"Menu.Item",modelHook:dt,elemPropsHook:Bie,subComponents:{Icon:jie,Text:Wz}})(({children:e,...t},n)=>m.jsx(hk,{placement:"left",children:m.jsx(Vz,{as:n,...t,children:e})})),qie=dr(ee()(e=>({role:"menu","aria-labelledby":e.state.id,"aria-orientation":e.state.orientation})),sk,wne),Xz=se({base:{background:S.color.surface.popover,borderRadius:S.shape.xxl,padding:0,gap:S.gap.xs},modifiers:{orientation:{vertical:{flexDirection:"column"},horizontal:{flexDirection:"row"}}}}),Jz=ce("div")({displayName:"Menu.List",modelHook:dt,elemPropsHook:qie})(({children:e,...t},n,a)=>m.jsx(Mz,{as:n,model:a,marginY:S.gap.none,...At(t,Xz({orientation:a.state.orientation})),children:e})),Qz=Re("span")({Component:({...e},t,n)=>m.jsxs(m.Fragment,{children:[m.jsx(Yi.Text,{ref:t,as:n,...e}),m.jsx(ks,{...Wl.parts.selected,icon:Une})]})}),Hie=Re("li")({displayName:"MenuOption",Component:({children:e,...t},n,a)=>m.jsx(a,{ref:n,...he(t,Wl()),children:typeof e=="string"?m.jsx(Qz,{children:e}):e})}),Gie=dr(ee()((e,t,n={})=>{const a=n["data-id"]||"";return{role:"option","aria-selected":hie(a,e.state),onMouseDown:o=>{o.button===0&&o.currentTarget.getAttribute("aria-disabled")!=="true"&&(e.events.goTo({id:a}),e.events.select({id:a}),e.state.mode==="single"&&e.events.hide(o)),o.preventDefault()}}}),wie,Rp),e2=ce("li")({displayName:"Menu.Item",modelHook:dt,elemPropsHook:Gie,subComponents:{Icon:Yi.Icon,Text:Qz}})(({children:e,...t},n)=>m.jsx(hk,{placement:"left",children:m.jsx(Hie,{as:n,...t,children:e})})),t2=ik,n2={modifiers:[{name:"offset",options:{offset:()=>[0,4]}}]},Wie=ce("div")({modelHook:dt,elemPropsHook:t2})(({children:e,...t})=>m.jsx(ql,{placement:"bottom-start",popperOptions:n2,...t,children:e})),r2=ee()(e=>({id:e.state.id,"aria-haspopup":"true","aria-expanded":e.state.visibility==="visible",onKeyDown(t){switch(t.key){case"ArrowDown":case"ArrowUp":e.events.show(t)}}})),Vie=dr(r2,ok),Zie=dr(r2,Ane),Yie=ce(kp)({displayName:"Menu.Target",modelHook:dt,elemPropsHook:Vie})(({children:e,...t},n)=>m.jsx(n,{...t,children:e})),Kie=ce(kp)({displayName:"Menu.Target",modelHook:dt,elemPropsHook:Zie})(({children:e,...t},n)=>m.jsx(n,{...t,children:e})),Xie=ce("div")({modelHook:dt,elemPropsHook:t2})(({children:e,...t})=>m.jsx(ql,{placement:"right-start",popperOptions:n2,...t,children:e})),Jie=(e,t=0)=>{const n=D.useRef(),a=()=>{n.current=window.setTimeout(e,t)},r=()=>{window.clearTimeout(n.current),n.current=void 0};return D.useEffect(()=>()=>{window.clearTimeout(n.current)},[n]),{start:a,clear:r}},Qie=dr(_u(e=>e.UNSTABLE_parentModel,Yz),_u(e=>e.UNSTABLE_parentModel,Zz),_u(e=>e.UNSTABLE_parentModel,$z),ee()((e,t)=>({ref:zr(t,e.state.targetRef)})),_u(e=>e.UNSTABLE_parentModel,Rp),ee()(e=>{const t=D.useRef(),n=Jie(()=>{e.UNSTABLE_parentModel.events.goTo({id:t.current||""}),e.events.show(event)},300);return{id:e.state.id,role:"menuitem","aria-haspopup":"true","aria-expanded":e.state.visibility==="visible",onMouseDown(a){e.UNSTABLE_parentModel.events.goTo({id:a.currentTarget.getAttribute("data-id")})},onMouseEnter(a){t.current=a.currentTarget.getAttribute("data-id"),n.start()},onMouseLeave(){n.clear()},onClick(a){e.state.targetRef.current instanceof Element||(e.state.targetRef.current=a.currentTarget),e.state.visibility!=="hidden"?e.events.hide(a):e.events.show(a)},"data-has-children":!0,onKeyDown(a){if(e.state.orientation==="vertical")switch(a.key){case"ArrowRight":case"Enter":case" ":e.events.show(a);break}}}})),eoe=ce("button")({modelHook:dt,elemPropsHook:Qie})(({children:e,...t},n)=>m.jsxs(Vz,{as:n,...t,children:[typeof e=="string"?m.jsx(Yi.Text,{children:e}):e,m.jsx(Yi.Icon,{icon:zne})]})),toe=ce()({modelHook:dt,subComponents:{Card:Fz,List:Jz,Item:Yi,TargetItem:eoe,Group:Gz,Option:e2,Divider:Uz,Popper:Xie}})(({children:e,model:t,...n},a,r)=>{const i=dt(dt.mergeConfig(n,{getId:r.getId,getTextValue:r.getTextValue,UNSTABLE_parentModel:r,mode:r.state.mode,orientation:r.state.orientation,onSelect(s){r.events.select(s)},onSelectAll(){r.events.selectAll()}})),o=dt.Context;return m.jsx(o.Provider,{value:i,children:e})}),Jo=cr()({displayName:"Menu",modelHook:dt,subComponents:{Target:Yie,Card:Fz,List:Jz,Item:Yi,Group:Gz,Option:e2,Divider:Uz,TargetContext:Kie,Popper:Wie,Submenu:toe}})(({children:e})=>m.jsx(m.Fragment,{children:e})),Sb=Jt({defaultConfig:{value:void 0,onFilterChange(e){},onChange(e){}}})(e=>{const t=D.createRef();return{onFilterChange:e.onFilterChange,onChange:e.onChange,state:{value:e.value,inputRef:t},events:{}}}),Ir=Jt({defaultConfig:{...Sb.defaultConfig,...dt.defaultConfig,shouldVirtualize:!0},requiredConfig:{...Sb.requiredConfig,...dt.requiredConfig}})(e=>{const t=Sb(e),n=dt(e),[a,r]=D.useState(0),i={width:a,...t.state,...n.state},o={...t.events,...n.events,setWidth(s){r(s)}};return{...n,...t,state:i,events:o}}),noe=ee()(e=>({onKeyDown(t){(t.key==="ArrowDown"||t.key==="ArrowUp"&&e.state.visibility!=="visible")&&(e.events.show(t),e.events.setWidth(t.currentTarget.getBoundingClientRect().width))}})),roe=ee()(e=>({onKeyDown(t){e.state.visibility==="visible"&&Lz(t,e)&&t.preventDefault()}})),aoe=ee()(e=>{const t=e.state.visibility!=="hidden";return D.useLayoutEffect(()=>{var n;t&&e.events.setWidth(((n=e.state.targetRef.current)==null?void 0:n.getBoundingClientRect().width)||0)},[t,e.events,e.state.targetRef]),{}}),a2=dr(ee()((e,t)=>{const n=zr(t,e.state.inputRef);return D.useEffect(()=>{if(e.state.cursorId&&e.state.visibility==="visible"){const a=e.navigation.getItem(kr(e.state),e);if(e.state.isVirtualized&&a)e.state.UNSTABLE_virtual.scrollToIndex(a.index);else{const r=document.querySelector(`[id="${e.state.id}-list"] [data-id="${kr(e.state)}"]`);r&&requestAnimationFrame(()=>{r.scrollIntoView({block:"nearest"})})}}},[e.state.cursorId,e.state.selectedIds,e.state.visibility]),{onKeyDown(a){if(a.key==="Enter"&&!a.metaKey&&e.state.visibility==="visible"){const r=document.querySelector(`[data-id="${kr(e.state)}"]`);r&&(r==null?void 0:r.getAttribute("aria-disabled"))!=="true"&&(e.events.select({id:kr(e.state)}),e.state.mode==="single"&&e.events.hide(a)),a.preventDefault()}},onBlur(a){e.events.hide(a)},onClick(a){e.state.visibility==="hidden"&&e.events.setWidth(a.currentTarget.getBoundingClientRect().width)},value:e.state.value,role:"combobox","aria-haspopup":"listbox","aria-expanded":e.state.visibility==="visible","aria-autocomplete":"list","aria-controls":`${e.state.id}-list`,"aria-activedescendant":e.state.visibility==="hidden"?null:void 0,id:e.state.id,ref:n}}),aoe,noe,_ie,roe,ok),ioe=ce(Zi)({modelHook:Ir,elemPropsHook:a2})(({children:e,...t},n)=>m.jsx(n,{...t,children:e})),ooe=ee()(e=>({minWidth:e.state.width})),soe=se({base:{'& :where([data-part="list-box-container"])':{borderRadius:S.shape.xxl}}}),loe=ce("div")({modelHook:Ir,elemPropsHook:ooe})(({children:e,...t},n)=>m.jsx(Jo.Card,{as:n,...At(t,soe()),children:e})),uoe=ee()(e=>({role:"listbox","aria-labelledby":e.state.id,id:`${e.state.id}-list`})),coe=se({base:{},extends:Xz}),doe=ce("ul")({modelHook:Ir,elemPropsHook:uoe})(({children:e,...t},n,a)=>m.jsx(Mz,{as:n,model:a,marginY:S.gap.none,...At(t,coe({orientation:a.state.orientation})),children:e})),poe=ik,foe=ce("div")({displayName:"Combobox.Menu.Popper",modelHook:dt,elemPropsHook:poe})(({children:e,...t})=>m.jsx(Jo.Popper,{fallbackPlacements:["top","bottom"],...t,children:e})),AN=ce()({modelHook:Ir,subComponents:{Popper:foe,List:doe,Item:Jo.Option,Card:loe,Divider:Jo.Divider}})(({children:e},t,n)=>m.jsx(Jo,{model:n,children:e})),ki=cr()({displayName:"Combobox",modelHook:Ir,subComponents:{Input:ioe,Menu:AN}})(({children:e},t,n)=>m.jsx(AN,{model:n,children:e})),moe=ee()(e=>(D.useLayoutEffect(()=>{var n;const t=(n=e.state.items.find(a=>a.id===e.state.cursorId))==null?void 0:n.id;!e.state.selectedIds.length&&e.state.items.length&&!t?e.events.goTo({id:e.state.items[0].id}):e.state.selectedIds.length&&!t&&e.events.goTo({id:e.state.selectedIds[0]})},[e.state.selectedIds,e.events,e.state.items,e.state.cursorId,e.state.visibility]),{})),goe=ee()(e=>{var u;const t=D.useRef(""),n=D.useRef(),[a,r]=D.useState(t.current),i=()=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{t.current="",r(t.current)},500)},o=(c,d,p=e.state.items.length,g=!0)=>{for(let v=c;v<p;v++)if(e.state.items[v].textValue.toLowerCase().startsWith(d.toLowerCase())&&(!g||g&&!e.state.nonInteractiveIds.includes(e.state.items[v].id)))return v;return-1},s=e.state.items.length>0&&((u=e.navigation.getItem(kr(e.state),e))==null?void 0:u.index)||0,l=(c,d)=>{const p=t.current.length===0?s+1:s,g=p===d?0:p;t.current+=c,r(t.current),i();let v=o(g,t.current);o(g,t.current),v===-1&&(v=o(0,t.current,g)),v>-1&&(e.events.goTo({id:e.state.items[v].id}),e.state.visibility==="hidden"&&e.events.select({id:e.state.items[v].id}))};return{onKeyDown(c){c.key.length===1&&c.key.match(/\S/)&&l(c.key,e.state.items.length),(c.key==="Spacebar"||c.key===" ")&&e.state.visibility==="visible"&&t.current!==""&&l(" ",e.state.items.length),(c.key==="Spacebar"||c.key===" ")&&e.state.visibility==="hidden"&&t.current!==""&&l(" ",e.state.items.length)},keySoFar:a}});function hoe(e){return!!e}const voe=ee()((e,t,{disabled:n,value:a,onChange:r,name:i}={})=>{const{elementRef:o,localRef:s}=Pr(e.state.targetRef),{elementRef:l,localRef:u}=Pr(t),c=D.useRef(e.navigation);c.current=e.navigation;const d=D.useRef(e.state);return d.current=e.state,D.useLayoutEffect(()=>{u.current&&typeof a=="string"&&a!==u.current.value&&e.events.setSelectedIds(a?a.split(", "):[])},[a,u,e.events]),D.useImperativeHandle(l,()=>{if(u.current&&s.current){const p=u.current,g=s.current;return Object.defineProperty(p,"value",{get(){var y,I;return(I=(y=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(p),"value"))==null?void 0:y.get)==null?void 0:I.call(p)},set(v){p&&v!==(d.current.selectedIds==="all"?[]:d.current.selectedIds).join(", ")&&e.events.setSelectedIds(v?v.split(", "):[])}}),Object.defineProperty(p,"focus",{configurable:!0,writable:!0,value:v=>g.focus(v)}),Object.defineProperty(p,"blur",{configurable:!0,writable:!0,value:()=>g.blur()}),p}return u.current},[u,s,e.events]),D.useLayoutEffect(()=>{if(s.current){const p=e.state.items.length===0?"":(e.state.selectedIds==="all"?[]:e.state.selectedIds.map(g=>c.current.getItem(g,{state:d.current})).filter(hoe).map(g=>g.textValue)).join(", ");p!==s.current.value&&xy(s.current,p)}if(u.current){const p=(e.state.selectedIds==="all"?[]:e.state.selectedIds).join(", ");p!==u.current.value&&xy(u.current,p)}},[e.state.selectedIds,e.state.items,u,s]),{ref:o,form:"",value:null,onChange:p=>{var g;return(g=e.onFilterChange)==null||g.call(e,p),null},name:null,disabled:n,formInputProps:{disabled:n,tabIndex:-1,"aria-hidden":!0,ref:l,onChange:p=>{var g;r==null||r(p),(g=e.onChange)==null||g.call(e,p)},name:i}}}),boe=ee()(e=>{const t=e.state.visibility!=="hidden";return D.useEffect(()=>{!t&&e.state.selectedIds.length&&e.events.goTo({id:e.state.selectedIds[0]})},[t,e.events,e.state.selectedIds]),{}}),Ap=Jt({defaultConfig:{...Ir.defaultConfig,shouldVirtualize:!1},requiredConfig:{...Ir.requiredConfig},contextOverride:Ir.Context})(e=>Ir(e)),yoe=ee()(e=>({width:e.state.width})),Soe=se({base:{[Pz.vars.maxHeight]:me(300)}}),Eoe=ce("div")({modelHook:Ap,elemPropsHook:yoe})(({children:e,...t},n)=>m.jsx(ki.Menu.Card,{as:n,...At(t,Soe()),children:e})),_oe=dr(ee()((e,t,n={})=>{const{elementRef:a,localRef:r}=Pr(t);return mte({ref:r,onResize:i=>{if(e.state.visibility==="visible"){const o=i.width?i.width+42+8:0;e.events.setWidth(o)}}}),D.useEffect(()=>{var i;if(e.state.cursorId&&e.state.visibility==="visible"){const o=e.navigation.getItem(kr(e.state),e);if(e.state.isVirtualized&&o)e.state.UNSTABLE_virtual.scrollToIndex(o.index);else{const s=(i=r.current)==null?void 0:i.getAttribute("aria-controls");if(s){const l=document.querySelector(`[id="${s}"] [data-id="${kr(e.state)}"]`);l&&requestAnimationFrame(()=>{l.scrollIntoView({block:"nearest"})})}}}},[e.state.cursorId,e.state.selectedIds,e.state.visibility]),{onKeyDown(i){i.key!=="Tab"&&i.preventDefault(),(i.key==="Spacebar"||i.key===" "&&e.state.visibility==="hidden"&&(n==null?void 0:n.keySoFar)==="")&&e.events.show(),(i.key==="Spacebar"||i.key===" ")&&e.state.visibility==="visible"&&(n==null?void 0:n.keySoFar)===""&&(e.events.select({id:kr(e.state)}),e.events.hide())},autoComplete:"off",keySoFar:null,ref:a}}),goe,boe,moe,voe,a2),va=se({parts:{caret:"select-caret-icon",caretContainer:"select-caret-container",startIconContainer:"select-start-icon-container",startIcon:"select-start-icon",endIcon:"select-end-icon",hiddenInput:"select-hidden-input",visualInput:"select-visual-input"},base:({hiddenInputPart:e,startIconPart:t,endIconPart:n,visualInputPart:a,caretContainerPart:r,startIconContainerPart:i,caretPart:o})=>({[e]:{position:"absolute",top:0,bottom:0,left:0,right:0,opacity:ct.zero,cursor:"default",pointerEvents:"none",minWidth:"100%",width:"100%"},[`${t}, ${n}, ${r}, ${i}`]:{position:"absolute",pointerEvents:"none"},[a]:{caretColor:"transparent",backgroundColor:S.color.surface.default,color:C.fg.default,cursor:"default","&::placeholder":{color:C.fg.default},"&::selection":{backgroundColor:"transparent"}},[o]:{[Q.vars.color]:C.fg.default},"&:has(:disabled, .disabled)":{[o]:{[Q.vars.color]:C.fg.disabled}}}),modifiers:{error:{error:({visualInputPart:e})=>({[e]:{backgroundColor:S.color.brand.surface.critical.default}}),caution:({visualInputPart:e})=>({[e]:{backgroundColor:S.color.brand.surface.caution.default}})}}}),woe=ce(Zi)({modelHook:Ap,elemPropsHook:_oe})(({inputStartIcon:e,formInputProps:t,error:n,...a},r,i)=>m.jsxs(Oo,{"data-width":"ck-formfield-width",...va({error:n}),children:[e&&i.state.selectedIds.length>0&&m.jsx(Oo.InnerStart,{...va.parts.startIconContainer,children:m.jsx(ks,{...va.parts.startIcon,icon:e})}),m.jsx(Oo.Input,{...va.parts.hiddenInput,...t}),m.jsx(Oo.Input,{as:r,placeholder:"Choose an option",error:n,...va.parts.visualInput,...a}),m.jsx(Oo.InnerEnd,{...va.parts.caretContainer,children:m.jsx(ks,{...va.parts.caret,icon:Fne})})]})),koe=ce("li")({modelHook:Ap,subComponents:{Icon:ki.Menu.Item.Icon}})(({children:e,...t},n,a)=>m.jsx(ki.Menu.Item,{as:n,...t,children:e})),Ja=cr()({displayName:"Select",modelHook:Ap,subComponents:{Input:woe,Popper:ki.Menu.Popper,Card:Eoe,List:ki.Menu.List,Item:koe}})(({children:e,...t},n,a)=>m.jsx(ki,{model:a,...t,children:e})),Ioe=["Blue","Yellow"],Toe=En({gap:ho.md,padding:Sp.xs}),i2=()=>{const e=pr(),t=n=>{n.preventDefault(),console.log("form data",{first:n.currentTarget.elements.namedItem("first").value,last:n.currentTarget.elements.namedItem("last").value,favoriteColor:n.currentTarget.elements.namedItem("favoriteColor").value}),e.events.hide()};return m.jsxs(K,{model:e,children:[m.jsx(K.Target,{icon:jne,children:"Create New User"}),m.jsx(K.Overlay,{children:m.jsxs(K.Card,{as:"form",onSubmit:t,children:[m.jsx(K.CloseIcon,{"aria-label":"Close"}),m.jsx(K.Heading,{children:"New User"}),m.jsxs(K.Body,{children:[m.jsxs(en,{children:[m.jsx(en.Label,{children:"First Name"}),m.jsx(en.Input,{as:Zi,name:"first"})]}),m.jsxs(en,{children:[m.jsx(en.Label,{children:"Last Name"}),m.jsx(en.Input,{as:Zi,name:"last"})]}),m.jsxs(en,{children:[m.jsx(en.Label,{children:"Favorite Color"}),m.jsx(en.Field,{children:m.jsxs(Ja,{items:Ioe,children:[m.jsx(en.Input,{as:Ja.Input,name:"favoriteColor"}),m.jsx(Ja.Popper,{children:m.jsx(Ja.Card,{children:m.jsx(Ja.List,{children:n=>m.jsx(Ja.Item,{children:n})})})})]})})]})]}),m.jsxs(xr,{cs:Toe,children:[m.jsx(K.CloseButton,{children:"Cancel"}),m.jsx(Fr,{type:"submit",children:"Submit"})]})]})})]})};i2.__RAW__=`import React from 'react';
521
521
 
522
522
  import {PrimaryButton} from '@workday/canvas-kit-react/button';
523
523
  import {FormField} from '@workday/canvas-kit-react/form-field';