@atom-learning/components 2.31.1 → 2.31.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ae=require("@radix-ui/react-accordion"),Y=require("react"),Zo=require("@atom-learning/theme"),ya=require("@stitches/react"),v=require("@atom-learning/icons"),O=require("color2k"),Et=require("@radix-ui/react-slot"),er=require("invariant"),oe=require("@radix-ui/react-alert-dialog"),tr=require("@radix-ui/react-visually-hidden"),ar=require("uid"),ge=require("pure-react-carousel"),or=require("@radix-ui/react-checkbox"),H=require("react-hook-form"),rr=require("@radix-ui/react-radio-group"),nr=require("react-hook-form-persist"),ir=require("dlv"),lr=require("@radix-ui/react-toggle-group"),De=require("@reach/combobox"),se=require("@tanstack/react-table"),sr=require("use-deep-compare-effect"),et=require("throttle-debounce"),$e=require("@dnd-kit/core"),cr=require("@dnd-kit/modifiers"),_e=require("@dnd-kit/sortable"),dr=require("@dnd-kit/utilities"),ze=require("@radix-ui/react-tooltip"),mr=require("dayzed"),fe=require("@radix-ui/react-popover"),ur=require("dayjs"),pr=require("dayjs/plugin/customParseFormat"),_=require("@radix-ui/react-dialog"),Ie=require("@radix-ui/react-dropdown-menu"),hr=require("mdast-util-directive"),gr=require("mdast-util-from-markdown"),$r=require("micromark-extension-directive"),fr=require("@radix-ui/react-navigation-menu"),br=require("@radix-ui/react-progress"),tt=require("@radix-ui/react-slider"),vr=require("@radix-ui/react-switch"),at=require("@radix-ui/react-tabs"),Ct=require("react-hot-toast"),yr=require("react-player/vimeo");function U(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}function ee(e){if(e&&e.__esModule)return e;var a=Object.create(null);return e&&Object.keys(e).forEach(function(o){if(o!=="default"){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(a,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}}),a.default=e,Object.freeze(a)}var t=ee(Y),u=U(Y),xr=ee(Zo),Te=U(er),St=ee(tr),xa=ee(or),Re=ee(rr),wr=U(nr),Er=U(ir),ot=ee(lr),Cr=U(sr),qe=U(ur),Sr=U(pr),kr=ee(_),Dr=U(hr),zr=U(gr),Ir=U($r),ce=ee(fr),wa=ee(br),Ea=ee(vr),Tr=U(Ct),Rr=U(yr);const kt={bg:e=>({background:e}),size:e=>({height:e,width:e}),p:e=>({padding:e}),pt:e=>({paddingTop:e}),pr:e=>({paddingRight:e}),pb:e=>({paddingBottom:e}),pl:e=>({paddingLeft:e}),px:e=>({paddingLeft:e,paddingRight:e}),py:e=>({paddingTop:e,paddingBottom:e}),m:e=>({margin:e}),mt:e=>({marginTop:e}),mr:e=>({marginRight:e}),mb:e=>({marginBottom:e}),ml:e=>({marginLeft:e}),mx:e=>({marginLeft:e,marginRight:e}),my:e=>({marginTop:e,marginBottom:e})},Dt={sm:"(min-width: 550px)",md:"(min-width: 800px)",lg:"(min-width: 1100px)",xl:"(min-width: 1350px)",reducedMotion:"(prefers-reduced-motion)",allowMotion:"(prefers-reduced-motion: no-preference)",hover:"(hover: hover)"},Fr=ya.createStitches({theme:xr,utils:kt,media:Dt}),{css:Nr,getCssText:Mr,createTheme:Ar,globalCss:Ca,keyframes:D,styled:l,theme:q}=Fr,zt=(e,a)=>Object.keys(q[e]).reduce((o,r)=>({...o,[r]:JSON.parse(JSON.stringify(a).replace(/\$key/g,`$${e}$${r}`))}),{}),E=l("div",{});E.displayName="Box";const Fe=({css:e,children:a})=>e?t.createElement(E,{css:e},a):t.createElement(t.Fragment,null,a);Fe.displayName="CSSWrapper";const Q=(e,a)=>({"&::before":{content:"''",mb:`-${e}em`,display:"table"},"&::after":{content:"''",mt:`-${a||e}em`,display:"table"}}),Lr={chevron:e=>`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" stroke="${e}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" color="${e}"><polyline points="6 10 12 16 18 10"/></svg>`,search:e=>`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" stroke="${e}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" color="${e}"><path d="M14.4121122,14.4121122 L20,20"></path><circle cx="10" cy="10" r="6"></circle></svg>`},Sa=(e,a)=>`url(data:image/svg+xml;charset=US-ASCII,${encodeURIComponent(Lr[a](O.toHex(e)))})`,be=({position:e="relative",zIndex:a=1}={})=>({outline:"none",position:["relative","absolute","fixed","sticky"].includes(e)?e:"relative",zIndex:a>1?a:1,boxShadow:"white 0px 0px 0px 2px, $colors$primary 0px 0px 0px 4px"}),It=D({"0%":{opacity:0,transform:"translateY(2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Tt=D({"0%":{opacity:0,transform:"translateX(-2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Rt=D({"0%":{opacity:0,transform:"translateY(-2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Ft=D({"0%":{opacity:0,transform:"translateX(2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Nt=D({"0%":{opacity:0},"100%":{opacity:1}}),rt=D({"0%":{opacity:1},"100%":{opacity:0}}),Pr=D({"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(0)"}}),Wr=D({"0%":{transform:"translateX(0)"},"100%":{transform:"translateX(-100%)"}}),Br=D({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Or=D({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),Hr=l(ae.Content,{border:0,width:"100%",bg:"$background",overflow:"hidden",'&[data-state="open"]':{borderRadius:"0 0 $0 $0"},"@allowMotion":{'&[data-state="open"]':{animation:`${Br} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Or} 300ms ease-out`}}}),Vr=({children:e,css:a,...o})=>u.default.createElement(Hr,{...o},u.default.createElement(Fe,{css:a},e)),_r=l(ae.Item,{width:"100%","&:not(:last-child)":{mb:"$1"}}),qr=({children:e,value:a,...o})=>u.default.createElement(_r,{value:a,...o},e),ka=l("svg",{display:"inline-block",fill:"none",stroke:"currentcolor",strokeLinecap:"round",strokeLinejoin:"round",verticalAlign:"middle",variants:{size:{sm:{size:"$1",strokeWidth:"1.5"},md:{size:"$2",strokeWidth:"1.75"},lg:{size:"$3",strokeWidth:"2"}}}}),b=t.forwardRef(({is:e,size:a="md",...o},r)=>t.createElement(ka,{size:a,"aria-hidden":"true",...o,as:e,ref:r}));var Gr="#F3F8FF",jr="#E5F1FF",Yr="#D6EAFF",Ur="#C2DEFF",Xr="#B3D4FA",Jr="#057AFF",Kr="#0F67F5",Qr="#194DCC",Zr="#102DA3",en="#15235E",Da={blue1:Gr,blue2:jr,blue3:Yr,blue4:Ur,blue5:Xr,blue6:Jr,blue7:Kr,blue8:Qr,blue9:Zr,blue10:en},tn="#F6F6F6",an="#EBEBEB",on="#E0E0E0",rn="#CECECE",nn="#C2C2C2",ln="#757575",sn="#545454",cn="#333333",dn="#1F1F1F",mn="#1C1C1C",Mt={slate1:tn,slate2:an,slate3:on,slate4:rn,slate5:nn,slate6:ln,slate7:sn,slate8:cn,slate9:dn,slate10:mn};const un=[255,255,255,1],nt=[.05,.1,.15,.2,.27,.35,.5,.7,.8,.95],At=e=>Math.round(Math.max(Math.min(e,255),0)),za=(e,a)=>{const o={};return Object.entries(a).forEach(([r,n],i)=>{const[s,d,c]=O.parseToRgba(n),[m,p,h]=un,g=[At((s-m)/nt[i]+m),At((d-p)/nt[i]+p),At((c-h)/nt[i]+h),nt[i]];o[`${e}A${i+1}`]=`rgba(${g.join(",")})`}),o},re={},Ia=(e,a)=>{const o={};for(let r=1;r<=10;r++)o[`${e}${r}`]=`$${a}${r}`,o[`${e}A${r}`]=`$${a}A${r}`;return o},{styled:pn,createTheme:Ne}=ya.createStitches({theme:{colors:{background:"white",foreground:Mt.slate9,foreground6plus:"white",...Da,...za("blue",Da),...Mt,...za("slate",Mt)}},utils:kt,media:Dt});re["interactive-loContrast1"]=Ne("interactive-loContrast1",{colors:{interactiveForeground:"$foreground",interactive1:"white",interactive2:"$accent1",interactive3:"$accent2"}}),re["interactive-loContrast2"]=Ne("interactive-loContrast2",{colors:{interactiveForeground:"$foreground",interactive1:"$accent1",interactive2:"$accent2",interactive3:"$accent3"}}),re["interactive-hiContrast1"]=Ne("interactive-hiContrast1",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent7",interactive2:"$accent8",interactive3:"$accent9"}}),re["interactive-hiContrast2"]=Ne("interactive-hiContrast2",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent8",interactive2:"$accent9",interactive3:"$accent10"}});const hn={slate:"slate"},gn=()=>{Object.entries(hn).forEach(([e,a])=>{const o=`base-${e}`;re[o]=Ne(o,{colors:Ia("base",a)})})},$n={slate:"slate",blue:"blue"},fn=()=>{Object.entries($n).forEach(([e,a])=>{const o=`accent-${e}`;re[o]=Ne(o,{colors:Ia("accent",a)})})};gn(),fn();const bn=pn("div"),Lt=t.forwardRef(({base:e="",accent:a="",interactive:o="",className:r,asChild:n=!1,...i},s)=>{const d=[r,re[`interactive-${o}`],re[`accent-${a}`],re[`base-${e}`]].filter(Boolean).join(" ");return t.createElement(n?Et.Slot:bn,{ref:s,className:d,...i})});Lt.displayName="ColorScheme";const vn=l(b,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"},'[data-state="closed"] > &':{transform:"rotate(0deg)"}}),yn=l(ae.Trigger,{border:0,py:"$3",px:"$4",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",bg:"$interactive2",color:"$interactiveForeground","&[data-disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([data-disabled])":{"&:active, &:hover, &:focus-visible":{bg:"$interactive3"},"&:focus-visible":{...be()}},'&[data-state="open"]':{borderRadius:"$0 $0 0 0"},'&[data-state="closed"]':{borderRadius:"$0"}}),xn=({children:e,colorScheme:a={},...o})=>u.default.createElement(Lt,{asChild:!0,accent:"slate",interactive:"loContrast1",...a},u.default.createElement(yn,{...o},e,u.default.createElement(vn,{is:v.ChevronDown}))),wn=l(ae.Root,{width:"100%"}),Ge=u.default.forwardRef(({type:e="single",children:a,...o},r)=>u.default.createElement(wn,{ref:r,type:e,...o},a));Ge.Item=qr,Ge.Content=Vr,Ge.Trigger=xn,Ge.displayName="Accordion";const En={xs:"sm",sm:"sm",md:"md",lg:"lg"},Me=(e,a,o)=>({bg:"transparent",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:a},"&:not(:disabled):active":{color:o},"&[disabled]":{color:"$tonal400",cursor:"not-allowed"}}),je=(e,a,o)=>({bg:e,color:"white","&:not(:disabled):hover, &:not(:disabled):focus":{bg:a,color:"white"},"&:not(:disabled):active":{bg:o},"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"}}),Ye=(e,a,o)=>({border:"1px solid",borderColor:"currentColor",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:a},"&:not(:disabled):active":{color:o},"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"}}),Cn=l("button",{alignItems:"center",appearance:"none",bg:"white",border:"unset",borderRadius:"$0",boxSizing:"border-box",cursor:"pointer",display:"flex",justifyContent:"center",p:"unset",transition:"all 100ms ease-out",variants:{theme:{neutral:{},primary:{},success:{},warning:{},danger:{}},appearance:{simple:{},outline:{},solid:{}},size:{xs:{size:"$2"},sm:{size:"$3"},md:{size:"$4"},lg:{size:"$5"}},isRounded:{true:{borderRadius:"$round"}}},compoundVariants:[{theme:"neutral",appearance:"simple",css:Me("$tonal300","$primaryMid","$primaryDark")},{theme:"primary",appearance:"simple",css:Me("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"simple",css:Me("$primaryDark",O.darken(q.colors.primaryDark.value,.1),O.darken(q.colors.primaryDark.value,.15))},{theme:"success",appearance:"simple",css:Me("$success","$successMid","$successDark")},{theme:"warning",appearance:"simple",css:Me("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"simple",css:Me("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"solid",css:je("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"solid",css:je("$primaryDark",O.darken(q.colors.primaryDark.value,.1),O.darken(q.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:je("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:je("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"solid",css:je("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"outline",css:Ye("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"outline",css:Ye("$primaryDark",O.darken(q.colors.primaryDark.value,.1),O.darken(q.colors.primaryDark.value,.15))},{theme:"success",appearance:"outline",css:Ye("$success","$successMid","$successDark")},{theme:"warning",appearance:"outline",css:Ye("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"outline",css:Ye("$danger","$dangerMid","$dangerDark")}]}),M=t.forwardRef(({children:e,theme:a="primary",appearance:o="simple",size:r="sm",label:n,href:i,disabled:s,...d},c)=>{const m=`A single ${b.displayName} component is permitted as a child of ${M.displayName}`;return Te.default(t.Children.count(e)===1,m),t.createElement(Cn,{...d,...i?{as:"a",href:s?null:i,onClick:void 0,"aria-disabled":!!s}:{type:"button"},"aria-label":n,theme:a,appearance:o,size:r,ref:c,disabled:s},t.Children.map(e,p=>{if(!t.isValidElement(p))throw new Error(m);return Te.default(p.type===b,`Children of type ${p==null?void 0:p.type} aren't permitted. Only an ${b.displayName} component is allowed in ${M.displayName}`),t.cloneElement(p,{size:En[r],css:{...p.props.css?p.props.css:{}}})}))});M.displayName="ActionIcon";const it=2147483647,Ue=1147483646,Sn=10,kn=10,Dn=10,Pt="translate3d(-50%, -50%, 0)",Ta="translate3d(-50%, 50vh, 0)",zn=D({"0%":{transform:Ta},"100%":{transform:Pt}}),In=D({"0%":{transform:Pt},"100%":{transform:Ta}}),Tn=l(oe.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${Nt} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),Rn=l(oe.Content,{bg:"white",borderRadius:"$1",boxShadow:"$3",boxSizing:"border-box",left:"50%",maxWidth:"90vw",p:"$5",position:"fixed",top:"50%",transform:Pt,"&:focus":{outline:"none"},zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${zn} 550ms cubic-bezier(0.22, 1, 0.36, 1)`},'&[data-state="closed"]':{animation:`${In} 550ms cubic-bezier(0.22, 1, 0.36, 1)`}},variants:{size:{sm:{width:"380px"},md:{width:"480px"},lg:{width:"600px"}}}}),Fn=({size:e="sm",...a})=>t.createElement(oe.Portal,null,t.createElement(Tn,null),t.createElement(Rn,{size:e,...a})),Nn=l(oe.Root,{}),G=e=>t.createElement(Nn,{...e});G.Description=oe.Description,G.Title=oe.Title,G.Action=oe.Action,G.Cancel=oe.Cancel,G.Content=Fn,G.Trigger=oe.Trigger,G.displayName="AlertDialog";const Mn=()=>{const e=Y.useRef();return Y.useEffect(()=>(e.current=!0,()=>{e.current=!1})),e},z=l("div",{display:"flex"});z.displayName="Flex";const An=D({"0%":{opacity:0},"30%":{opacity:1},"50%":{opacity:1},"80%":{opacity:0},"100%":{opacity:0}}),Wt=l("div",{animationName:`${An}`,animationDuration:"1s",animationFillMode:"both",animationIterationCount:"infinite",animationTimingFunction:"linear",backgroundColor:"currentColor",borderRadius:"$round","&:nth-child(1)":{animationDelay:"-300ms"},"&:nth-child(2)":{animationDelay:"-150ms"},"&:nth-child(3)":{animationDelay:0},variants:{size:{sm:{size:"4px",mx:"2px"},md:{size:"6px",mx:"2px"},lg:{size:"8px",mx:"3px"}}}}),lt=({css:e={},message:a="Loading",size:o="md",...r})=>t.createElement(z,{css:{justifyContent:"center",...e},role:"alert",...r},t.createElement(St.Root,null,a),t.createElement(Wt,{size:o}),t.createElement(Wt,{size:o}),t.createElement(Wt,{size:o})),Bt=(e,a,o)=>({border:"1px solid",borderColor:"currentColor",color:e,"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{textDecoration:"none",color:a},"&:not([disabled]):active":{color:o}}),Ae=(e,a,o,r="white")=>({bg:e,color:r,"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{bg:a,color:r},"&:not([disabled]):active":{bg:o}}),Ra=l("button",{alignItems:"center",bg:"unset",border:"unset",borderRadius:"$0",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:600,justifyContent:"center",p:"unset",textDecoration:"none",transition:"all 100ms ease-out",whiteSpace:"nowrap",width:"max-content",variants:{theme:{primary:{},secondary:{},success:{},warning:{},danger:{},neutral:{}},appearance:{solid:{},outline:{}},size:{sm:{fontSize:"$sm",lineHeight:1.53,height:"$3",px:"$4"},md:{fontSize:"$md",lineHeight:1.5,height:"$4",px:"$5"},lg:{fontSize:"$lg",lineHeight:1.5,height:"$5",px:"$5"}},isLoading:{true:{cursor:"not-allowed",opacity:.6,pointerEvents:"none"}},fullWidth:{false:{width:"max-content"},true:{width:"100%"}}},compoundVariants:[{theme:"primary",appearance:"solid",css:Ae("$primary","$primaryMid","$primaryDark")},{theme:"secondary",appearance:"solid",css:Ae("$primaryDark",O.darken(q.colors.primaryDark.value,.1),O.darken(q.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:Ae("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:Ae("$warning","$warningMid","$warningDark","$tonal500")},{theme:"danger",appearance:"solid",css:Ae("$danger","$dangerMid","$dangerDark")},{theme:"neutral",appearance:"solid",css:Ae("white",O.opacify("white",-.1),O.opacify("white",-.25),"$primary")},{theme:"primary",appearance:"outline",css:Bt("$primary","$primaryMid","$primaryDark")},{theme:"neutral",appearance:"outline",css:Bt("white",O.opacify("white",-.2),O.opacify("white",-.35))},{theme:"secondary",appearance:"outline",css:Bt("$primaryDark",O.darken(q.colors.primaryDark.value,.1),O.darken(q.colors.primaryDark.value,.15))}]}),Ln=({isLoading:e,children:a})=>t.createElement(t.Fragment,null,t.createElement(lt,{css:{opacity:e?1:0,position:"absolute",transition:"opacity 150ms"}}),t.createElement(E,{as:"span",css:e?{opacity:0,transition:"opacity 150ms"}:{}},a)),Pn=e=>{switch(e){case"lg":return 22;case"md":return 20;case"sm":default:return 16}},Fa=(e,a)=>t.Children.map(e,(o,r)=>(o==null?void 0:o.type)===b?t.cloneElement(o,{css:{[r===0?"mr":"ml"]:a==="sm"?"$2":"$3",size:Pn(a),...o.props.css?o.props.css:{}}}):o),ne=t.forwardRef(({children:e,isLoading:a,onClick:o,href:r,appearance:n="solid",size:i="md",theme:s="primary",type:d="button",...c},m)=>t.createElement(Ra,{isLoading:a||!1,onClick:a?void 0:o,appearance:n,size:i,theme:s,...c,...r?{as:"a",href:r,onClick:void 0}:{},...r?{}:{type:d},ref:m},typeof a=="boolean"?t.createElement(Ln,{isLoading:a},Fa(e,i)):Fa(e,i)));ne.displayName="Button";const Ot=l("h2",{fontFamily:"$display",fontWeight:700,m:0,variants:{size:{xs:{fontFamily:"$body",fontWeight:600,fontSize:"$md",lineHeight:1.5,...Q(.3864)},sm:{fontSize:"$lg",lineHeight:1.14,...Q(.2174,.2254)},md:{fontSize:"$xl",lineHeight:1.14,...Q(.2174,.2254)},lg:{fontSize:"$2xl",lineHeight:1.08,...Q(.1865,.1945)},xl:{fontSize:"$3xl",lineHeight:1.12,...Q(.206,.214)},xxl:{fontSize:"$4xl",lineHeight:1.06,...Q(.1793,.1873)}},noCapsize:{true:{"&::before, &::after":{display:"none"}}}}}),st=t.forwardRef(({size:e="md",...a},o)=>t.createElement(Ot,{ref:o,size:e,...a}));st.displayName="Heading";const Wn=l("div",{display:"flex","& > *":{m:0},variants:{direction:{row:{flexDirection:"row"},"row-reverse":{flexDirection:"row-reverse"},column:{flexDirection:"column"}},wrap:{wrap:{flexWrap:"wrap"},"no-wrap":{flexWrap:"no-wrap"},"wrap-reverse":{flexWrap:"wrap-reverse"}},justify:{start:{justifyContent:"flex-start"},center:{justifyContent:"center"},end:{justifyContent:"flex-end"},false:{}},align:{start:{alignItems:"flex-start"},center:{alignItems:"center"},end:{alignItems:"flex-end"},false:{}},gap:{...zt("space",{mt:"-$key",ml:"-$key","& > *":{mt:"$key",ml:"$key"}}),false:{}}}}),Le=t.forwardRef(({css:e,gap:a=2,direction:o="row",wrap:r="wrap",justify:n="start",align:i,...s},d)=>t.createElement(Fe,{css:e},t.createElement(Wn,{ref:d,direction:o,gap:a,wrap:r,justify:n,align:typeof i>"u"&&o!=="column"?"center":i,...s})));Le.displayName="Stack";const Xe={size:{xs:{fontSize:"$xs",lineHeight:1.6,...Q(.4364)},sm:{fontSize:"$sm",lineHeight:1.53,...Q(.4056)},md:{fontSize:"$md",lineHeight:1.5,...Q(.3864)},lg:{fontSize:"$lg",lineHeight:1.52,...Q(.3983)},xl:{fontSize:"$xl",lineHeight:1.42,...Q(.3506)}},noCapsize:{true:{"&::before, &::after":{display:"none"}}}},Je=({size:e,noCapsize:a})=>({...Xe.size[e],...Xe.noCapsize[`${a}`]}),Ht=l("p",{fontFamily:"$body",fontWeight:400,margin:0,"& > &":{"&:before, &:after":{display:"none"}},variants:Xe}),L=t.forwardRef(({size:e="md",...a},o)=>t.createElement(Ht,{size:e,...a,ref:o}));L.displayName="Text";const Bn=({title:e,description:a,onAction:o,cancelActionText:r,confirmActionText:n,onClose:i,...s})=>t.createElement(G,{defaultOpen:!0},t.createElement(G.Content,{onEscapeKeyDown:d=>d.preventDefault(),onCloseAutoFocus:i,...s},t.createElement(st,{as:G.Title,size:"sm",css:{mb:"$5"}},e),a&&t.createElement(L,{as:G.Description,css:{mb:"$5"}},a),t.createElement(Le,{gap:"2",justify:"end"},r&&t.createElement(ne,{appearance:"outline",as:G.Cancel,onClick:()=>o(!1),size:"sm"},r),t.createElement(ne,{as:G.Action,onClick:()=>o(!0),size:"sm"},n)))),On=[],Hn=(e,a)=>{switch(a.type){case"ADD":return[...e,{...a.payload,id:ar.uid()}];case"REMOVE":return e.filter(({id:o})=>o!==a.payload);default:return e}},Na=t.createContext({showAlert:()=>null}),Vn=({children:e})=>{const[a,o]=t.useReducer(Hn,On),r=Mn();return t.createElement(Na.Provider,{value:{showAlert:n=>o({payload:n,type:"ADD"})}},Boolean(a.length)&&t.createElement(Bn,{...a[0],key:a[0].id,onClose:()=>{r.current&&o({payload:a[0].id,type:"REMOVE"})}}),e)},_n=()=>{const e=t.useContext(Na);if(e===void 0)throw new Error("useAlert must be used within a AlertProvider");return e},Vt=(e,a)=>{let o;switch(typeof e){case"object":o={},Object.keys(e).forEach(r=>{const n=e[r];o[r]=n&&a(n)});break;default:o=a(e)}return o},qn={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg",xxl:"lg"},Gn=({is:e})=>{const a=t.useContext(_t),{size:o}=a,r=t.useMemo(()=>Vt(o,n=>qn[n]),[o]);return t.createElement(b,{size:r,is:e})},Ma=l("img",{verticalAlign:"middle",maxWidth:"100%",variants:{fluid:{true:{"&[width]":{width:"auto"},"&[width][height]":{height:"auto"},'&[src$=".svg"]':{width:"100%",height:"auto",maxWidth:"none"}}}}}),Pe=Ma;Pe.displayName="Image";const Aa=()=>t.createElement(E,{css:{position:"relative",size:"100%"}},t.createElement(b,{is:v.User,css:{size:"100%"}})),jn={xs:"xs",sm:"sm",md:"sm",lg:"md",xl:"md",xxl:"lg"},La=()=>{const e=t.useContext(_t),{name:a,size:o}=e,r=t.useMemo(()=>Vt(o,n=>jn[n]),[o]);return a?t.createElement(L,{size:r,css:{color:"$tonal400"}},a[0].toUpperCase()):t.createElement(Aa,null)},Yn=l(Pe,{size:"100%",objectFit:"cover"}),Un=({src:e,alt:a})=>e?t.createElement(Yn,{src:e,alt:a}):t.createElement(La,null),Pa={display:"flex",justifyContent:"center",alignItems:"center",color:"$tonal400",borderRadius:"$round",border:"2px solid $tonal100",backgroundColor:"$white",overflow:"hidden",variants:{size:{xs:{size:"$2"},sm:{size:"$3"},md:{size:"$4"},lg:{size:"$5"},xl:{size:"$6"},xxl:{size:"$7"}}}},Xn=l("div",Pa),Jn=l("button",{all:"unset",...Pa,"&:not([disabled])":{"&:hover":{borderColor:"$tonal400",backgroundColor:"$tonal50"},"&:active":{borderColor:"$primary",backgroundColor:"$tonal100"},"&:focus-visible":be()},"&[disabled]":{opacity:"30%",cursor:"not-allowed"}}),_t=t.createContext({name:void 0,size:"lg"}),Kn=({children:e,name:a,size:o})=>{const r=t.useMemo(()=>({name:a,size:o}),[a,o]);return t.createElement(_t.Provider,{value:r},e)},Qn=({children:e,size:a="lg",name:o,disabled:r=!1,onClick:n})=>t.createElement(Kn,{name:o,size:a},n?t.createElement(Jn,{size:a,disabled:r,onClick:r?void 0:n,css:{cursor:r?"auto":"pointer"}},e):t.createElement(Xn,{size:a},e)),We=Qn;We.Image=Un,We.Initial=La,We.Placeholder=Aa,We.Icon=Gn,We.displayName="Avatar";const Zn=l(z,{justifyContent:"center",alignItems:"center",borderRadius:"$0",minWidth:0,border:"1px solid #FFFFFF",fontFamily:"$body","& > *:not(:last-child)":{mr:"$1"},variants:{theme:{success:{bg:"$successLight",color:"$successMid"},warning:{bg:"$warningLight",color:"$warningText"},danger:{bg:"$dangerLight",color:"$dangerMid"},neutral:{bg:"$tonal50",color:"$tonal400"},info:{bg:"$primaryLight",color:"$primaryMid"}},size:{xs:{fontSize:"$sm",px:"$1",height:"$2"},sm:{fontSize:"$md",px:"$1",height:"$3"},md:{fontSize:"$md",px:"$2",height:"$4"}}}}),Wa=({theme:e="info",size:a="sm",children:o,...r})=>t.createElement(Zn,{role:"status",theme:e,size:a,...r},t.Children.map(o,n=>{if(typeof n=="string"||typeof n=="number")return t.createElement(E,{css:{whiteSpace:"nowrap",overflowX:"hidden",textOverflow:"ellipsis",py:"$0"}},n);if(t.isValidElement(n)&&n.type===b)return t.cloneElement(n,{size:"sm",css:{...n.props.css,flexShrink:0}})}));Wa.displayName="Badge";const Ba={alignItems:"center",bg:"unset",border:"unset",color:"$primary",cursor:"pointer",display:"flex",justifyContent:"center",p:"unset",size:"$5",top:"50%",transform:"translateY(-50%)",transition:"color 0.15s ease-in-out","&:hover":{color:"$primaryMid"},"&:active":{color:"$primaryDark"},"&:disabled":{color:"$tonal100"}},ei=l(ge.ButtonBack,Ba),ti=l(ge.ButtonNext,Ba),ai=e=>t.createElement(ei,{...e},t.createElement(b,{is:v.ChevronLeft})),oi=e=>t.createElement(ti,{...e},t.createElement(b,{is:v.ChevronRight})),ri=l(ge.DotGroup,{justifyContent:"center","& button":{bg:"$tonal200",border:"none",borderRadius:"50%",cursor:"pointer",mx:"$1",p:"$1",size:"$space$3",transition:"all 100ms ease-in",'&[class*="selected"]':{bg:"$primary"},"&:hover, &:focus":{bg:"$primaryMid"}}}),ni=l(ge.Slide,{}),ii=({children:e,...a})=>t.createElement(ni,{...a,tag:"div"},t.createElement(E,{css:{px:"$3"}},e)),li=l(ge.Slider,{cursor:"grab",ml:"50%",overflow:"hidden",transform:"translateX(-50%)",'& [class*="sliderTray_"]':{p:"unset",m:"unset",transition:"transform .5s cubic-bezier(.645,.045,.355,1)"},'& [class*="slide_"]':{float:"left",pb:"0 !important"},'& [class*="slideInner"]':{display:"flex",justifyContent:"center"},variants:{overflow:{true:{overflow:"visible"}}}}),ve=({children:e,css:a,slideHeight:o,slideWidth:r,numSlides:n,...i})=>t.createElement(Fe,{css:a},t.createElement(ge.CarouselProvider,{naturalSlideWidth:r,naturalSlideHeight:o,totalSlides:n,...i},e)),si=()=>t.useContext(ge.CarouselContext);ve.ArrowNext=oi,ve.ArrowPrevious=ai,ve.Pagination=ri,ve.Slide=ii,ve.Slider=li,ve.displayName="Carousel";const ci=l(xa.Indicator,{display:"flex",alignItems:"center",justifyContent:"center"}),di=l(xa.Root,{appearance:"none",backgroundColor:"transparent",border:"1px solid $colors$tonal400",borderRadius:"3px",color:"white",cursor:"pointer",size:"$1",p:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 50ms ease-out",'&[data-state="checked"]':{backgroundColor:"$primary",borderColor:"$primary"},'&[data-state="indeterminate"]':{backgroundColor:"$primary",borderColor:"$primary"},"&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},"&[disabled]":{backgroundColor:"$tonal100",borderColor:"$tonal400",cursor:"not-allowed",color:"$tonal400"},variants:{state:{error:{borderColor:"$danger"}}}}),ct=t.forwardRef((e,a)=>t.createElement(di,{...e,ref:a},t.createElement(ci,null,t.createElement(b,{is:e.checked==="indeterminate"?v.Minus:v.Ok,css:{pointerEvents:"none",position:"absolute",strokeWidth:"3",size:14}}))));ct.displayName="Checkbox";const mi={success:{color:"$success"},warning:{color:"$warningText","& svg":{color:"$warningDark"}},info:{color:"$primary"},neutral:{color:"$tonal400"},error:{color:"$danger"}},ui={success:v.OkCircle,warning:v.Danger,info:v.Info,neutral:v.Info,error:v.Error},pi=l(z,{variants:{theme:mi}}),hi=l(b,{flexShrink:"0",mr:"$2"}),dt=({css:e,showIcon:a=!0,theme:o="error",size:r="sm",children:n,...i})=>t.createElement(pi,{theme:o,css:e,...i},a&&t.createElement(hi,{size:"sm",is:ui[o]}),t.createElement(L,{as:"span",size:r,css:{transform:"translateY($space$0)"}},n)),gi=l("label",{color:"$tonal500",fontFamily:"$body",m:0,variants:{size:{sm:Je({size:"sm"}),md:Je({size:"md"})},type:{block:{display:"block",fontWeight:600},inline:{display:"flex",fontWeight:400,maxWidth:"max-content"}},align:{start:{},center:{}},direction:{reverse:{},row:{}}},compoundVariants:[{type:"inline",align:"start",css:{alignItems:"flex-start"}},{type:"inline",align:"center",css:{alignItems:"center"}},{type:"inline",direction:"reverse",css:{flexDirection:"row-reverse"}},{type:"inline",direction:"row",css:{flexDirection:"row"}}]}),$i=l("span",{color:"$danger",ml:"$1",fontWeight:400}),Be=({align:e="start",as:a="label",direction:o="row",size:r="md",type:n="block",children:i,required:s,...d})=>t.createElement(gi,{as:a,size:r,type:n,align:e,direction:o,...d},i,s&&t.createElement($i,{"aria-hidden":!0},"*"));Be.displayName="Label";const Oe=l("li",{}),Oa=l("ul",{fontFamily:"$body",m:"unset",p:"unset",[`& > ${Oe}`]:{"&:not(:last-child)":{mb:"$2"},"&:last-child":{mb:0}},variants:{...Xe,as:{ol:{pl:"$4",listStyle:"decimal",[`& > ${Oe}`]:{pl:"$1","&::marker":{fontSize:"$sm",fontWeight:"bold"}}},ul:{pl:"$3",[`& > ${Oe}`]:{pl:"$2","&::marker":{content:"\u2022",fontWeight:"bold"}}}},theme:{primary:{[`& > ${Oe}`]:{"&::marker":{color:"$primary"}}}}}}),mt=t.forwardRef(({size:e="md",noCapsize:a=!0,ordered:o,...r},n)=>t.createElement(Oa,{ref:n,as:o?"ol":"ul",size:e,noCapsize:a,...r}));mt.Item=Oe;const fi=l(E,{bg:"$tonal100",borderRadius:"$1",color:"$tonal600",fontFamily:"$mono",fontSize:"$sm",lineHeight:1.4,my:"$4",p:"$3"}),bi=({node:e})=>t.createElement(fi,{as:"pre"},e.value),Ha=l("em",{fontStyle:"italic"}),vi=({node:e,handleNode:a})=>{var o;return t.createElement(Ha,null,(o=e.children)==null?void 0:o.map(a))},yi=e=>{switch(e){case 1:return{size:"xl",as:"h1"};case 2:return{size:"lg",as:"h2"};case 3:return{size:"md",as:"h3"};case 4:return{size:"sm",as:"h4"};case 5:return{size:"xs",as:"h5"};default:return{size:"xs",as:"h6"}}},xi=({node:e,handleNode:a,...o})=>{var r;const{as:n,size:i}=yi(e.depth);return t.createElement(st,{as:n,size:i,...o},(r=e.children)==null?void 0:r.map(a))},wi=l(E,{bg:"$tonal100",borderRadius:"$0",color:"$tonal600",display:"inline-block",fontFamily:"$mono",fontSize:"85%",p:"$0 $1"}),Ei=({node:e})=>t.createElement(wi,{as:"code"},e.value),Ci=({node:e,css:a})=>{var o;return t.createElement(Pe,{src:e.url,alt:(o=e.alt)!=null?o:void 0,css:a})},Si=({node:e,handleNode:a})=>{var o,r;return t.createElement(ut,{title:(o=e.title)!=null?o:void 0,href:e.url},(r=e.children)==null?void 0:r.map(a))},ki=({node:e,handleNode:a,css:o})=>{var r;return t.createElement(mt,{css:{"& p:before, & p:after":{display:"none"},...o},ordered:e.ordered||void 0},(r=e.children)==null?void 0:r.map(a))},Di=({node:e,handleNode:a})=>{var o;return t.createElement(mt.Item,null,(o=e.children)==null?void 0:o.map(a))},zi=({node:e,handleNode:a,...o})=>{var r;return t.createElement(L,{...o},(r=e.children)==null?void 0:r.map(a))},Ii=l("strong",{fontWeight:600}),Ti=({node:e,handleNode:a})=>{var o;return t.createElement(Ii,null,(o=e.children)==null?void 0:o.map(a))},Ri=({node:e})=>e.value,Va=l("hr",{border:0,bg:"$tonal100",variants:{orientation:{horizontal:{height:1,width:"100%"},vertical:{height:"100%",width:1,minHeight:"$3"}}}}),qt=u.default.forwardRef(({orientation:e="horizontal",...a},o)=>u.default.createElement(Va,{ref:o,orientation:e,...a})),Fi=({css:e})=>t.createElement(qt,{css:{width:"100%",...e}}),_a=l("a",{bg:"unset",border:"unset",p:"unset",color:"$primary",cursor:"pointer",fontFamily:"$body",textDecoration:"none","&:focus, &:hover":{color:"$primaryMid",textDecoration:"underline"},"&:active":{color:"$primaryDark"},[`${Ht} > &, ${Ot} > &, ${Oe} > &, ${Ha} > &`]:{fontSize:"100%",lineHeight:1,"&::before, &::after":{content:"none"}},variants:Xe}),ut=t.forwardRef(({size:e="md",href:a,...o},r)=>t.createElement(_a,{...!a&&{as:"button",noCapsize:!0},size:e,href:a,...o,ref:r}));ut.displayName="Link";const Gt=({children:e,css:a})=>t.createElement(L,{size:"sm",css:{color:"$tonal300",maxWidth:"80ch",...a}},e),te=({css:e,children:a,error:o,fieldId:r,label:n,prompt:i,description:s,required:d,hideLabel:c})=>{const m=c?St.Root:z;return t.createElement(E,{css:e},t.createElement(m,{css:{justifyContent:"space-between",alignItems:"center",mb:"$3"}},t.createElement(Be,{htmlFor:r,required:d},n),i&&t.createElement(ut,{href:i.link,size:"sm"},i.label)),s&&t.createElement(Gt,{css:{mb:"$3"}},s),a,o&&t.createElement(dt,{css:{mt:"$2"}},o))};te.displayName="FieldWrapper";const Ni=l(Re.Item,{alignItems:"center",appearance:"none",backgroundColor:"transparent",border:"1px solid $tonal400",borderRadius:"$round",color:"white",cursor:"pointer",display:"flex",justifyContent:"center",p:0,size:"$1",transition:"all 50ms ease-out","&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},'&[data-state="checked"]':{backgroundColor:"$primary",borderColor:"$primary"},"&[disabled]":{backgroundColor:"$tonal100",borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"}}),Mi=l(Re.Indicator,{size:"6px",borderRadius:"$round",backgroundColor:"currentcolor",position:"absolute"}),pt=e=>t.createElement(Ni,{...e},t.createElement(Mi,null));pt.displayName="RadioButton";const jt=l(Re.Root,{display:"flex",flexWrap:"wrap",variants:{direction:{row:{flexDirection:"row","& > *:not(:last-child)":{mr:"$5"}},column:{flexDirection:"column"}}}});jt.displayName="RadioButtonGroup";const ht=({align:e="start",children:a,css:o,description:r,direction:n="row",error:i,label:s,required:d})=>t.createElement(E,{css:o},t.createElement(Be,{align:e,direction:n,required:d,type:"inline"},t.Children.map(a,c=>t.createElement(E,{css:{[n==="reverse"?"ml":"mr"]:"$3",...((c==null?void 0:c.type)===ct||(c==null?void 0:c.type)===pt)&&{transform:"translateY($space$1)"}}},c)),s),i&&t.createElement(dt,{css:{mt:"$2"}},i),r&&t.createElement(Gt,{css:{mt:"$2",[n==="reverse"?"mr":"ml"]:"calc($space$3 + $sizes$1)"}},r));ht.displayName="InlineFieldWrapper";var qa=(e=>(e.LOCAL="local",e.SESSION="session",e))(qa||{});const Ai=l("form",{}),Li=({persist:e,watch:a,setValue:o,children:r})=>{const{id:n,...i}=e;let s={...i,storage:i.storage===qa.LOCAL?window.localStorage:window.sessionStorage};if(i.exclude){const{exclude:d,...c}=s,m=a(),p=Object.keys(m).filter(h=>{var g;if(!((g=i.exclude)!=null&&g.includes(h)))return h});s={...c,include:p}}return wr.default(n,{watch:a,setValue:o},s),r},Ga=({formMethods:e,handleSubmit:a,onSubmit:o,onError:r,children:n,...i})=>t.createElement(H.FormProvider,{...e},t.createElement(Ai,{"aria-label":"form",...i,onSubmit:a(o,r)},n)),ja=({children:e,defaultValues:a={},onSubmit:o,onError:r,validationMode:n="onBlur",render:i,persist:s,...d})=>{Te.default(!(e&&i),"`Form` should only be given one of `children` or `render`. When both are provided, `render` will be used and `children` will be ignored.");const c=H.useForm({defaultValues:a,mode:n}),{handleSubmit:m,watch:p,setValue:h}=c,g=i?i(c):e,$={formMethods:c,handleSubmit:m,onSubmit:o,onError:r,...d};return s?t.createElement(Li,{persist:s,watch:p,setValue:h},t.createElement(Ga,{...$},g)):t.createElement(Ga,{...$},g)};ja.displayName="Form";const ie=e=>{var a;const{errors:o}=H.useFormContext(),r=e.split(/[,[\].]+?/).filter(Boolean);return{error:(a=(()=>Er.default(o,r))())==null?void 0:a.message}};var Pi=(e=>(e.ON="on",e.OFF="off",e))(Pi||{});const Ya=({css:e,defaultChecked:a=!1,label:o,name:r,validation:n,description:i,...s})=>{const{control:d}=H.useFormContext(),{error:c}=ie(r);return t.createElement(H.Controller,{control:d,name:r,defaultValue:a,rules:n,render:({onChange:m,value:p,name:h})=>t.createElement(ht,{css:e,description:i,error:c,label:o,required:Boolean(n==null?void 0:n.required)},t.createElement(ct,{defaultChecked:a,defaultValue:a?"on":"off",checked:p,name:h,onCheckedChange:m,value:p?"on":"off",...c&&{state:"error"},...s}))})};Ya.displayName="CheckboxField";const Ua={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Wi=l("span",{display:"inline-flex",alignItems:"center",px:"$1",flexGrow:1,...Ua,"& > *:not(:last-child)":{mr:"$1"}}),Bi={sm:"sm",md:"sm",lg:"md"},Oi=l(b,{flexShrink:0}),Xa=({...e})=>{const a=t.useContext(Ja),{size:o}=a,r=t.useMemo(()=>Vt(o,n=>Bi[n]),[o]);return t.createElement(Oi,{...e,size:r})},Hi=({children:e,...a})=>{const o=t.Children.toArray(e),r=o.length<=1;return t.createElement(Wi,{...a},o.map(n=>!r&&typeof n=="string"?t.createElement(E,{as:"span",css:Ua,key:n},n):t.isValidElement(n)&&n.type===b?t.createElement(Xa,{...n.props}):n))},Vi=l(z,{px:"$2",border:"1px solid",borderRadius:"$0",alignItems:"center",fontFamily:"$body",maxWidth:"100%",borderColor:"$primary",color:"$primaryMid",bg:"$primaryLight","&[data-disabled]":{opacity:"0.3",pointerEvents:"none"},variants:{size:{sm:{height:"$2",...Je({size:"sm"})},md:{height:"$3",...Je({size:"sm"})},lg:{height:"$4",...Je({size:"md"})}}}}),Ja=t.createContext({}),_i=({size:e,children:a})=>{const o=t.useMemo(()=>({size:e}),[e]);return t.createElement(Ja.Provider,{value:o},a)},qi=t.forwardRef(({asWorkaround:e,size:a="md",...o},r)=>t.createElement(_i,{size:a},t.createElement(Vi,{ref:r,as:e,size:a,...o}))),de=qi;de.Content=Hi,de.Icon=Xa,de.displayName="Chip";const Yt=t.forwardRef(({gap:e=2,...a},o)=>t.createElement(Le,{ref:o,direction:"row",gap:e,align:!1,...a})),Ut=t.createContext({isDismissed:!1,setIsDismissed:()=>null}),Gi=({children:e,disabled:a})=>{const[o,r]=t.useState(!1),n=t.useMemo(()=>({disabled:a,isDismissed:o,setIsDismissed:r}),[a,o]);return t.createElement(Ut.Provider,{value:n},e)},ji=({asChild:e=!1,value:a,onDismiss:o,...r})=>{const n=t.useContext(Ut),{isDismissed:i,disabled:s}=n;if(t.useEffect(()=>{i&&(o==null||o(a))},[i]),i)return null;const d={...s&&{["data-disabled"]:""},...r};return t.createElement(e?Et.Slot:"div",{...d})},Yi=({disabled:e=!1,...a})=>t.createElement(Gi,{disabled:e},t.createElement(ji,{...a})),Ui=e=>t.createElement("button",{type:"button",...e},"Dismiss"),Ka=({asChild:e=!1,...a})=>{const o=t.useContext(Ut);if(o===void 0)throw new Error("Dismissible.Trigger can only be used within a Dismissible.Item");const{setIsDismissed:r,disabled:n}=o,i={disabled:n,onClick:()=>{r(!0)},...a};return t.createElement(e?Et.Slot:Ui,{...i})},gt=Yi;gt.Trigger=Ka,gt.displayName="Dismissible";const Qa=t.createContext({onDismiss:()=>null}),Xi=({children:e,disabled:a,onDismiss:o})=>{const r=t.useMemo(()=>({disabled:a,onDismiss:o}),[a,o]);return t.createElement(Qa.Provider,{value:r},e)},Ji=({as:e="div",disabled:a,onDismiss:o,...r})=>t.createElement(Xi,{disabled:a,onDismiss:o},t.createElement(e,{...r})),Ki=({children:e,disabled:a=!1,...o})=>{const r=t.useContext(Qa);if(r===void 0)throw new Error("DismissibleGroup.Item can only be used within a DismissibleGroup");const{onDismiss:n,disabled:i}=r;return t.createElement(gt,{disabled:i||a,onDismiss:n,...o},e)},ye=Ji;ye.Item=Ki,ye.Trigger=Ka,ye.displayName="DismissibleGroup";const Qi=l(de,{px:"$1"}),Zi=({size:e="md",children:a,dismissActionLabel:o="Dismiss",...r})=>t.createElement(ye.Item,{asChild:!0,...r},t.createElement(Qi,{size:e},t.createElement(de.Content,null,a),t.createElement(ye.Trigger,{asChild:!0},t.createElement(M,{label:o,css:{color:"$tonal200"},size:e==="sm"?"xs":"sm"},t.createElement(b,{is:v.Close}))))),el=t.forwardRef((e,a)=>t.createElement(Yt,{as:ye,ref:a,...e})),Xt=el;Xt.Item=Zi,Xt.displayName="ChipDismissibleGroup";const Za=l(b,{display:"none"}),tl=l(de,{"&:not([disabled])":{cursor:"pointer","&:hover":{bg:"$tonal100",color:"$tonal600",borderColor:"currentColor"},"&:focus-visible":{...be()},'&[data-state="on"]':{"&:hover":{bg:"$white",color:"$primaryDark"}}},'&[data-state="off"]':{color:"$tonal400",bg:"$tonal50",borderColor:"$tonal200"},'&[data-state="on"]':{[`& ${Za}`]:{display:"block"}}}),al=({size:e="md",children:a,...o})=>t.createElement(ot.Item,{...o,asChild:!0},t.createElement(tl,{asWorkaround:"button"},t.createElement(Za,{is:v.Ok,size:e==="lg"?"md":"sm"}),t.createElement(de.Content,null,a))),ol=t.forwardRef((e,a)=>t.createElement(Yt,{ref:a,as:ot.Root,orientation:"horizontal",...e})),Jt=ol;Jt.Item=al,Jt.displayName="ChipToggleGroupItem";const rl=l(De.ComboboxInput,{boxShadow:"none",fontSize:"$md",appearance:"none",backgroundImage:Sa(q.colors.tonal300.value,"chevron"),backgroundPosition:"right $space$3 top 50%, 0 0",backgroundRepeat:"no-repeat, repeat",backgroundSize:"20px auto, 100%",border:"1px solid $tonal300",borderRadius:"$0",boxSizing:"border-box",color:"$tonal600",cursor:"text",display:"block",fontFamily:"$body",height:"$4",pl:"$3",pr:"$6",transition:"all 100ms ease-out",width:"100%","&::placeholder":{color:"$tonal300",opacity:1},"&:focus-within":{borderColor:"$primary",outline:"none"},"&[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},variants:{state:{error:{border:"1px solid $danger"}}}}),nl=l(De.ComboboxList,{listStyle:"none",m:0,p:0,userSelect:"none"}),il=l(De.ComboboxOption,{color:"$tonal500",cursor:"pointer",m:0,p:"$2",'&:hover, &[aria-selected="true"]':{bg:"$tonal50",borderRadius:"$0"},"[data-user-value]":{color:"$primary"}}),ll=l(De.ComboboxPopover,{bg:"white",border:"solid 1px $tonal100",borderRadius:"$0",boxShadow:"$1",boxSizing:"border-box",fontFamily:"$body",fontSize:"$md",outline:"none",p:"$1",transform:"translateY($space$2)"});Ca({":root":{"--reach-combobox":1}})();const sl=l(De.Combobox,{}),xe=e=>t.createElement(sl,{...e});xe.displayName="Combobox",xe.Option=il,xe.Input=rl,xe.Popover=ll,xe.List=nl,xe.OptionText=De.ComboboxOptionText;var X=(e=>(e.NONE="none",e.PENDING="pending",e.FULFILLED="fulfilled",e.REJECTED="rejected",e))(X||{});const cl=e=>{if(e[0])return e[0].desc?"desc":"asc"},dl=async(e,a,o,r,n)=>{var i,s,d,c,m,p;const{pageIndex:h,pageSize:g}=o,$={pageIndex:(i=a==null?void 0:a.pageIndex)!=null?i:h,pageSize:(s=a==null?void 0:a.pageSize)!=null?s:g,sortBy:(c=a==null?void 0:a.sortBy)!=null?c:(d=r[0])==null?void 0:d.id,sortDirection:(m=a==null?void 0:a.sortDirection)!=null?m:cl(r),globalFilter:(p=a.globalFilter)!=null?p:n},f=await e($);return Te.default(Array.isArray(f==null?void 0:f.results),"The getAsyncData function must return an object with a property `result` which must be an array"),Te.default(f&&Number.isInteger(f.total)&&f.total>=0,"The getAsyncData function must return an object with a property `total` which must be a positive integer or zero"),f},ml={pageIndex:0,pageSize:10},ul=e=>{const[a,o]=u.default.useState(!!e),[r,n]=u.default.useState({...ml,...e||{}}),i=u.default.useCallback(()=>{o(!0)},[]);return{isPaginated:a,paginationState:r,setPaginationState:n,applyPagination:i}},pl=e=>{const[a,o]=u.default.useState(!1),[r,n]=u.default.useState(e?[{id:e.column,desc:e.direction==="desc"}]:[]);return{isSortable:a,setIsSortable:o,sorting:r,setSorting:n}},eo=t.createContext(null),hl=({columns:e,data:a=[],getAsyncData:o,defaultSort:r,initialState:n=void 0,children:i})=>{var s;const[d,c]=t.useState({results:a!=null?a:[],total:(s=a==null?void 0:a.length)!=null?s:0}),{isPaginated:m,applyPagination:p,paginationState:h,setPaginationState:g}=ul(n==null?void 0:n.pagination),[$,f]=t.useState(X.NONE),[y,C]=t.useState(""),{setIsSortable:w,isSortable:I,sorting:x,setSorting:S}=pl(r),F=t.useCallback(async N=>{if(o)try{f(X.PENDING);const V=await dl(o,N,h,x,y);c(V),f(X.FULFILLED)}catch{f(X.REJECTED)}},[o,h==null?void 0:h.pageIndex,h==null?void 0:h.pageSize,x,y]);t.useEffect(()=>{F({})},[F]),Cr.default(()=>{!a||c({results:a,total:a.length})},[a]);const A=()=>d.total,P=se.useReactTable({columns:e,data:d.results,pageCount:h?Math.ceil(A()/h.pageSize):-1,initialState:n,state:{sorting:x,globalFilter:y,pagination:h},manualPagination:o&&m,manualSorting:o&&m,enableSorting:$!==X.PENDING,enableGlobalFilter:!o,getCoreRowModel:se.getCoreRowModel(),getPaginationRowModel:m?se.getPaginationRowModel():void 0,getSortedRowModel:I||x.length?se.getSortedRowModel():void 0,getFilteredRowModel:se.getFilteredRowModel(),onPaginationChange:m?g:void 0,onSortingChange:S,onGlobalFilterChange:C}),T=t.useMemo(()=>({...P,data:d,setData:c,setIsSortable:w,applyPagination:p,getTotalRows:A,isSortable:I,asyncDataState:$,runAsyncData:F}),[P,p,A,I]);return t.createElement(eo.Provider,{value:T},i)},J=()=>{const e=t.useContext(eo);if(!e)throw new Error("useDataTable can only be called from inside a DataTableProvider");return e},Kt=l("tr",{bg:"unset"}),to=t.forwardRef((e,a)=>t.createElement(Kt,{...e,ref:a}));to.displayName="TableRow";const gl=l("tbody",{variants:{striped:{true:{[`${Kt}`]:{"&:nth-child(odd)":{bg:"white"},"&:nth-child(even)":{bg:"$tonal50"}}},false:{bg:"white"}}}}),ao=({striped:e=!0,...a})=>t.createElement(gl,{striped:e,...a});ao.displayName="TableBody";const He=l("td",{borderBottom:"1px solid $tonal100",boxSizing:"border-box",color:"$tonal400",fontFamily:"$body",lineHeight:1.5,p:"$2 $3",textAlign:"left",verticalAlign:"middle","&:first-child":{fontWeight:"bold"}});He.displayName="TableCell";const oo=l("tfoot",{});oo.displayName="TableFooter";const $t=l("td",{color:"$tonal400",fontFamily:"$body",fontWeight:600,p:"$2 $3",textAlign:"left",verticalAlign:"middle"});$t.displayName="TableFooterCell";const me=l("th",{color:"white",fontFamily:"$body",fontWeight:600,lineHeight:1.5,p:"$2 $3",textAlign:"left",verticalAlign:"middle"});me.displayName="TableHeaderCell";const Qt={PRIMARY:"primary",PRIMARY_DARK:"primaryDark",LIGHT:"light"},$l=l("thead",{variants:{theme:{[Qt.PRIMARY]:{[`${me}`]:{bg:"$primary"}},[Qt.PRIMARY_DARK]:{[`${me}`]:{bg:"$primaryDark"}},[Qt.LIGHT]:{[`${me}`]:{bg:"$tonal50",color:"$tonal600"}}}}}),ro=({theme:e="primaryDark",...a})=>u.default.createElement($l,{theme:e,...a});ro.displayName="TableHeader";const fl=l("table",{borderCollapse:"separate",borderSpacing:0,fontFamily:"$sans",fontSize:"$sm",width:"100%",variants:{size:{md:{[`${He}, ${me}, ${$t}`]:{height:"$4"}},lg:{[`${He}, ${me}, ${$t}`]:{height:"$5"}}},corners:{round:{[`${me}`]:{"&:first-of-type":{borderTopLeftRadius:"$0"},"&:last-of-type":{borderTopRightRadius:"$0"}},[`${Kt}:last-child`]:{[`${He}:first-child`]:{borderBottomLeftRadius:"$0"},[`${He}:last-child`]:{borderBottomRightRadius:"$0"}}},square:{}}}}),R=({size:e="md",corners:a="round",...o})=>t.createElement(fl,{size:e,corners:a,...o});R.Body=ao,R.Cell=He,R.Footer=oo,R.FooterCell=$t,R.Header=ro,R.HeaderCell=me,R.Row=to,R.displayName="Table";const bl=({striped:e=!1,...a})=>{const{getRowModel:o}=J();return t.createElement(R.Body,{...a,striped:e},o().rows.map(r=>t.createElement(W.Row,{row:r,key:r.id})))},Zt=({cell:e})=>t.createElement(R.Cell,{key:e.id},se.flexRender(e.column.columnDef.cell,e.getContext())),vl=({children:e})=>{const{asyncDataState:a,runAsyncData:o}=J();return a!==X.REJECTED?null:e(o)},yl=({children:e,hidden:a=!1})=>a?t.createElement(St.Root,null,e):e?t.createElement(t.Fragment,null,e):null,no=l("input",{appearance:"none",border:"1px solid $tonal400",borderRadius:"$0",boxShadow:"none",boxSizing:"border-box",color:"$tonal600",cursor:"text",display:"block",fontFamily:"$body",px:"$3",transition:"all 100ms ease-out",width:"100%","&:focus":{borderColor:"$primary",outline:"none"},"&[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&::placeholder":{color:"$tonal300",opacity:1},variants:{size:{sm:{height:"$3",fontSize:"$sm"},md:{height:"$4",fontSize:"$md"}},state:{error:{border:"1px solid $danger"}}}}),we=t.forwardRef(({type:e="text",size:a="md",...o},r)=>e==="number"?t.createElement(no,{type:"text",inputMode:"numeric",pattern:"[0-9]*",size:a,...o,ref:r}):t.createElement(no,{type:e,size:a,...o,ref:r}));we.displayName="Input";const xl=()=>{const e=t.useRef(null),a=t.useCallback(o=>{o&&(e.current=o)},[]);return[e,a]},wl=()=>{const[e,a]=t.useState(null),o=t.useCallback(r=>{r&&a(r)},[]);return[e,o]};var El=(e=>(e.SEARCH="SEARCH",e.CLEAR="CLEAR",e))(El||{});const Cl=l(b,{color:"$tonal300",position:"absolute",pointerEvents:"none",variants:{size:{sm:{top:"$2",right:"$2",size:"$1"},md:{top:10,right:10,size:20}}}}),Sl=l(we,{'&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, & input[type="search"]::-webkit-search-results-decoration':{display:"none"}}),ft=t.forwardRef(({size:e="md",css:a,value:o,clearText:r="Clear",onChange:n,...i},s)=>{const[d,c]=xl(),[m,p]=t.useState(o||""),[h,g]=t.useState(o?"CLEAR":"SEARCH");t.useImperativeHandle(s,()=>d.current);const $=()=>{var C,w;const I=d.current;if(!I)return;const x=(C=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:C.set;(w=x==null?void 0:x.call)==null||w.call(x,I,"");const S=new Event("input",{bubbles:!0});I.dispatchEvent(S),I.focus()},f=C=>{p(C.target.value),g(C.target.value?"CLEAR":"SEARCH"),n==null||n(C)},y=()=>h==="SEARCH"?t.createElement(Cl,{is:v.Search,size:e,css:{size:e=="sm"?"$1":20}}):t.createElement(M,{label:r,theme:"neutral",size:e,css:{position:"absolute",top:"0",right:"$1"},onClick:$},t.createElement(b,{is:v.Close}));return t.createElement(E,{css:{position:"relative",...a}},t.createElement(Sl,{ref:c,size:e,type:"search",...i,value:m,onChange:f,css:{pr:e==="sm"?"$5":"$6"}}),y())});ft.displayName="SearchInput";const kl=({onChange:e,label:a,hideLabel:o=!1,...r})=>{const{setGlobalFilter:n,getState:i,resetPagination:s}=J(),{globalFilter:d}=i(),c=et.debounce(250,m=>{const{target:{value:p}}=m;e==null||e(m),s(),n(p)});return t.createElement(t.Fragment,null,t.createElement(yl,{hidden:o},t.createElement(Be,{css:{mb:"$3"},htmlFor:a},a)),t.createElement(ft,{...r,value:d,onChange:c,name:a}))},Dl=({sortable:e=!0,theme:a="light",...o})=>{const{getHeaderGroups:r,setIsSortable:n}=J();return t.useEffect(()=>{n(e)},[e,n]),t.createElement(R.Header,{theme:a,...o},r().map(i=>t.createElement(R.Row,{key:i.id},i.headers.map(s=>t.createElement(W.HeaderCell,{header:s,key:s.id})))))},zl={asc:v.SortUp,desc:v.SortDown},Il=({direction:e})=>t.createElement(b,{is:zl[e],size:"sm",css:{position:"absolute",left:"$1"}}),Tl=({header:e,children:a,css:o,...r})=>{const n=e.column.getIsSorted(),{isSortable:i}=J(),s=e.column.getCanSort();return t.createElement(R.HeaderCell,{onClick:i&&s?e.column.getToggleSortingHandler():void 0,css:{cursor:i&&s?"pointer":"initial",...o},...r},t.createElement(z,{css:{alignItems:"center"}},se.flexRender(e.column.columnDef.header,e.getContext()),n&&i&&t.createElement(z,{css:{position:"relative",alignItems:"center"}},t.createElement(Il,{direction:n}))))},Rl=l(lt,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:1}),ea=e=>{const{asyncDataState:a}=J();return a!==X.PENDING?null:t.createElement(Rl,{...e})},Fl=({row:e})=>t.createElement(R.Row,null,e.getVisibleCells().map((a,o)=>t.createElement(Zt,{key:a.id,cell:a}))),Nl=({sortable:e,striped:a,theme:o,css:r,...n})=>{const{asyncDataState:i}=J(),s=i===X.PENDING;return t.createElement(t.Fragment,null,t.createElement(ea,null),t.createElement(R,{...n,css:{...r,...s&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},t.createElement(W.Head,{theme:o,sortable:e}),t.createElement(W.Body,{striped:a})))},io=t.createContext({idColumn:"id"}),Ml=()=>{const e=t.useContext(io);if(!e)throw new Error("useDragAndDropTable can only be called within a DragAndDropContainer");return e},Al=(e,a,o,r,n)=>{const{active:i,over:s}=e,d=o.indexOf(i.id),c=o.indexOf(s==null?void 0:s.id),m=_e.arrayMove(a.results,d,c);return n==null||n(d,c,m),{results:m,total:m.length}},Ll=(e,a)=>e.results.map(o=>{const r=o[a];if(r===void 0)throw new Error("To ensure drag-and-drop works correctly, please ensure that each row has a unique ID. Use the `id` property or pass DataTable an `idColumn` prop that defines the ID property on the rows.");return r}),Pl=({idColumn:e="id",onChange:a=void 0,children:o})=>{const{data:r,setData:n}=J(),i=t.useMemo(()=>Ll(r,e),[r]),s=$e.useSensors($e.useSensor($e.PointerSensor),$e.useSensor($e.KeyboardSensor,{coordinateGetter:_e.sortableKeyboardCoordinates}));return t.createElement($e.DndContext,{sensors:s,collisionDetection:$e.closestCenter,onDragEnd:d=>{const{active:c,over:m}=d;c.id&&(m==null?void 0:m.id)&&c.id!==(m==null?void 0:m.id)&&n(p=>Al({active:c,over:m},p,i,e,a))},modifiers:[cr.restrictToVerticalAxis]},t.createElement(_e.SortableContext,{items:i,strategy:_e.verticalListSortingStrategy},t.createElement(io.Provider,{value:{idColumn:e}},o)))},Wl=({row:e})=>{const{idColumn:a}=Ml(),{attributes:o,listeners:r,transform:n,setNodeRef:i,isDragging:s}=_e.useSortable({id:e.original[a]});return t.createElement(R.Row,{ref:i,css:{transform:dr.CSS.Transform.toString(n),zIndex:s?5:void 0}},e.getVisibleCells().map((d,c)=>c===0?t.createElement(R.Cell,{key:d.id},t.createElement(Ol,{...o,...r,isDragging:s,css:{display:"inline-block"},label:"drag and drop"}),se.flexRender(d.column.columnDef.cell,d.getContext())):t.createElement(Zt,{key:d.id,cell:d})))},Bl=l(M,{color:"inherit !important",fill:"currentColor",variants:{isDragging:{true:{cursor:"grabbing"},false:{cursor:"grab"}}}}),Ol=t.forwardRef(({isDragging:e,size:a,...o},r)=>t.createElement(Bl,{ref:r,isDragging:e,appearance:"simple",size:a,...o},t.createElement(b,{is:v.DragHandle,size:a}))),Hl=({striped:e=!1,...a})=>{const{getRowModel:o}=J();return t.createElement(R.Body,{...a,striped:e},o().rows.map(r=>t.createElement(Wl,{row:r,key:r.id})))},Vl=({idColumn:e,onDragAndDrop:a,sortable:o,striped:r,theme:n,css:i,...s})=>{const{asyncDataState:d}=J(),c=d===X.PENDING;return t.createElement(Pl,{onChange:a,idColumn:e},t.createElement(ea,null),t.createElement(R,{...s,css:{...i,...c&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},t.createElement(W.Head,{theme:n,sortable:o}),t.createElement(Hl,{striped:r})))},_l=l("select",{appearance:"none",backgroundColor:"white",backgroundImage:Sa(q.colors.tonal300.value,"chevron"),backgroundRepeat:"no-repeat, repeat",border:"1px solid $tonal300",borderRadius:"$0",color:"$tonal600",display:"block",fontFamily:"$body",fontWeight:400,lineHeight:1.4,transition:"all 75ms ease-out",width:"100%","&:hover":{cursor:"pointer"},"&:focus":{borderColor:"$primary",outline:"none"},"&::-ms-expand":{display:"none"},"&[disabled], > option[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},variants:{size:{sm:{backgroundPosition:"right $space$2 top 50%, 0 0",backgroundSize:"18px auto, 100%",fontSize:"$sm",height:"$3",pl:"$2",pr:"$5"},md:{backgroundPosition:"right $space$3 top 50%, 0 0",backgroundSize:"20px auto, 100%",fontSize:"$md",height:"$4",pl:"$3",pr:"$6"}},state:{error:{border:"1px solid $danger"}}}}),bt=t.forwardRef(({placeholder:e,children:a,size:o="md",...r},n)=>{const i={size:o,ref:n,...r};return[r.value,r.defaultValue].every(s=>s===void 0)&&(i.defaultValue=""),t.createElement(_l,{...i},e&&t.createElement("option",{disabled:!0,hidden:!0,value:""},e),a)});bt.displayName="Select";const ql=l(ze.Content,{backgroundColor:"$tonal500",borderRadius:"$0",boxShadow:"$0",color:"white",fontFamily:"$body",fontSize:"$sm",lineHeight:1.5,whiteSpace:"normal",px:"$3",py:"$2",zIndex:kn,"@allowMotion":{animationDuration:"75ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="delayed-open"]':{'&[data-side="top"]':{animationName:Rt},'&[data-side="right"]':{animationName:Ft},'&[data-side="bottom"]':{animationName:It},'&[data-side="left"]':{animationName:Tt}}},variants:{size:{sm:{maxWidth:"100px"},md:{maxWidth:"250px"},lg:{maxWidth:"400px"}}}}),Gl=l(ze.Arrow,{fill:"$tonal500",'[data-align="end"] &':{mr:"$2"},'[data-align="start"] &':{ml:"$2"}}),jl=({children:e,side:a="top",sideOffset:o=4,size:r="md",...n})=>t.createElement(ql,{side:a,sideOffset:o,size:r,...n},e,t.createElement(Gl,null)),K=({children:e,delayDuration:a=350,...o})=>t.createElement(ze.Root,{delayDuration:a,...o},e);K.Content=jl,K.Trigger=l(ze.Trigger,{}),K.Portal=ze.Portal,K.Provider=ze.Provider,K.displayName="Tooltip";const lo=({direction:e,...a})=>{const o=e==="next";return u.default.createElement(Ul,{appearance:"outline",icon:o?v.ChevronRight:v.ChevronLeft,isRounded:!0,label:o?"Next page":"Previous page",name:o?"Next page":"Previous page",size:"md",...a})},Yl=({gotoPage:e,pageCount:a,pageIndex:o,disabled:r})=>u.default.createElement(z,{css:{alignItems:"center"}},u.default.createElement(bt,{value:o,size:"sm",css:{mr:"$3"},disabled:r,onChange:n=>{e(Number(n.target.value))}},Array.from({length:a},(n,i)=>i).map(n=>u.default.createElement("option",{key:n,value:n},n+1))),u.default.createElement(L,{size:"sm",css:{flex:"none"}},`of ${a} ${a>1?"pages":"page"}`)),Ul=({icon:e,label:a,...o})=>u.default.createElement(K,null,u.default.createElement(K.Trigger,{asChild:!0},u.default.createElement(M,{label:a,...o},u.default.createElement(b,{is:e}))),u.default.createElement(K.Content,null,a)),Xl=l("nav",{display:"flex",justifyContent:"space-between",alignItems:"center",fontVariantNumeric:"tabular-nums"}),Jl=e=>{const{applyPagination:a,getState:o,getRowModel:r,getPageCount:n,previousPage:i,nextPage:s,setPageIndex:d,getTotalRows:c,asyncDataState:m}=J();t.useEffect(()=>{a()},[a]);const{pagination:p}=o(),h=p.pageIndex*p.pageSize+1,g=h+r().rows.length-1,$=m===X.PENDING||m===X.REJECTED;return t.createElement(Xl,{...e},t.createElement(L,{size:"sm"},`${h.toString()} - ${g.toString()} of ${c()} items`),t.createElement(Yl,{gotoPage:d,pageCount:n(),pageIndex:p.pageIndex,disabled:$}),t.createElement(z,{css:{justifyContent:"flex-end"}},t.createElement(lo,{direction:"previous",disabled:p.pageIndex===0||$,onClick:i,css:{mr:"$4"}}),t.createElement(lo,{direction:"next",disabled:p.pageIndex===n()-1||$,onClick:s})))},W=e=>t.createElement(hl,{...e});W.Body=bl,W.DataCell=Zt,W.DragAndDropTable=Vl,W.Head=Dl,W.HeaderCell=Tl,W.Pagination=Jl,W.Row=Fl,W.GlobalFilter=kl,W.Table=Nl,W.Loading=ea,W.Error=vl;const Kl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ql=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],so={open:"Open calendar",next:"Next month",previous:"Previous month",nextYear:"Next year",previousYear:"Previous year"},Zl=l("button",{bg:"transparent",border:"none",borderRadius:"$round",color:"$tonal900",cursor:"pointer",fontFamily:"$body",fontSize:"$sm",size:"$3",p:0,transition:"all 75ms","&:hover":{bg:"$tonal100"},"&:active":{color:"white",bg:"$primary"},"&:focus":{outline:"2px solid $primary",outlineOffset:"2px"},variants:{isSelected:{true:{bg:"$primary",color:"white","&:hover":{bg:"$primary"}}},isToday:{true:{bg:"$tonal100"}},isOutsideMonth:{true:{color:"$tonal200"}}}}),ta=l("div",{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gridGap:"$1 $2"}),es=l(ne,{color:"$tonal600",p:"$3",width:"$6",variants:{selected:{false:{color:"$tonal600 !important",fontWeight:"400","&:hover":{bg:"$tonal100 !important",color:"$tonal600 !important"},"&[disabled]":{bg:"white !important"}}}}}),ts=(e,a)=>{const o=e.slice(0,a);return e.slice(a).concat(o)},co=({css:e,refDateSelected:a,refDateToday:o,firstDayOfWeek:r=0,monthNames:n=Kl,weekdayNames:i=Ql,labels:s=so,date:d=new Date,minDate:c,maxDate:m,setYear:p,...h})=>{const[g,$]=t.useState(!1),[f,y]=t.useState(d==null?void 0:d.getFullYear()),C=T=>{const N=d;N.setFullYear(T),p(N),$(!1)},w=c&&f-16<=c.getFullYear(),I=m&&f>=m.getFullYear(),x=Array.from({length:16},(T,N)=>{const V=f-N;return m&&V>m.getFullYear()||c&&V<c.getFullYear()?0:V}),{calendars:S,getBackProps:F,getForwardProps:A,getDateProps:P}=mr.useDayzed({firstDayOfWeek:r,showOutsideDays:!0,date:d,minDate:c,maxDate:m,...h});return S.length?t.createElement(E,{css:{position:"relative",width:"min-content",mt:"-$1",...e}},t.createElement(z,{css:{position:"absolute",top:0,right:"-$1"}},t.createElement(M,{label:s[g?"previousYear":"previous"],theme:"neutral",size:"md",...!g&&F({calendars:S}),...g&&{onClick:()=>y(f-16)},disabled:g&&w},t.createElement(b,{is:v.ChevronLeft})),t.createElement(M,{label:s[g?"nextYear":"next"],theme:"neutral",size:"md",...!g&&A({calendars:S}),...g&&{onClick:()=>y(f+16)},disabled:g&&I},t.createElement(b,{is:v.ChevronRight}))),g&&t.createElement(ta,{css:{gridTemplateColumns:"repeat(4, 1fr)",pt:"$7",direction:"rtl",gridGap:"$3 $1"}},x.map((T,N)=>{const V=T===d.getFullYear();return T?t.createElement(es,{key:`${T}${N}`,theme:V?"primary":"neutral",onClick:()=>C(T),selected:V},T):t.createElement(E,{key:N,css:{width:"$6",height:"$4"}})})),!g&&S.map(({month:T,year:N,weeks:V})=>t.createElement(E,{key:`${T}${N}`},t.createElement(z,{css:{height:"$4",alignItems:"center",mb:"$4"}},t.createElement(ne,{theme:"neutral",css:{px:"0",color:"$tonal600"},onClick:()=>$(!0)},n[T]," ",N)),t.createElement(ta,{css:{mb:"$3"}},ts(i,r).map(ke=>t.createElement(L,{as:"span",size:"sm",key:`${T}${N}${ke}`,css:{fontWeight:600,textAlign:"center"}},ke))),t.createElement(ta,null,V.map((ke,wt)=>ke.map((k,j)=>{const Ve=`${T}${N}${wt}${j}`;if(!k)return t.createElement("div",{key:Ve});const{date:Jo,selected:ba,today:va,prevMonth:Ko,nextMonth:Qo}=k;return t.createElement(Zl,{isOutsideMonth:Ko||Qo,isSelected:ba,isToday:va,key:Ve,ref:ba?a:va?o:null,...P({dateObj:k}),type:"button"},Jo.getDate())})))))):null};co.displayName="Calendar";const as=l(fe.Content,{bg:"white",borderRadius:"$1",boxShadow:"$2",maxWidth:"90vw",p:"$sizes$2",pr:"$6",position:"relative",zIndex:Dn,"@allowMotion":{animationDuration:"75ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="open"]':{'&[data-side="top"]':{animationName:Rt},'&[data-side="right"]':{animationName:Ft},'&[data-side="bottom"]':{animationName:It},'&[data-side="left"]':{animationName:Tt}}},variants:{size:{sm:{maxWidth:"200px"},md:{maxWidth:"400px"},lg:{maxWidth:"600px"}}}}),os=l(fe.Arrow,{fill:"white",zIndex:1,'[data-align="end"] &':{mr:"$sizes$2"},'[data-align="start"] &':{ml:"$sizes$2"}}),rs=({children:e,side:a="top",sideOffset:o=8,closePopoverText:r="Close popover",showCloseButton:n=!0,size:i="md",...s})=>t.createElement(as,{size:i,side:a,sideOffset:o,...s},n&&t.createElement(M,{as:fe.Close,css:{position:"absolute",right:"$0",top:"$0"},label:r,size:"md",theme:"neutral"},t.createElement(b,{is:v.Close})),e,t.createElement(os,{width:16,height:8}));l(fe.Root,{});const le=e=>t.createElement(fe.Root,{...e});le.Content=rs,le.Portal=fe.Portal,le.Trigger=fe.Trigger,le.displayName="Popover";const mo="DD/MM/YYYY";qe.default.extend(Sr.default);const ns=(e,a=mo)=>{const[o,r]=Y.useState(e?qe.default(e).toDate():void 0),[n,i]=Y.useState(e?qe.default(e).format(a):"");return{dateString:n,date:o,setDate:(s,d=!1)=>{const c=d?qe.default(s,a,!0):qe.default(s);r(c.isValid()?c.toDate():void 0),i(d?s:c.format(a))}}},aa=t.forwardRef(({initialDate:e,dateFormat:a=mo,firstDayOfWeek:o=1,disabled:r,monthNames:n,weekdayNames:i,size:s="md",labels:d,revalidate:c,onChange:m,minDate:p,maxDate:h,...g},$)=>{const{date:f,dateString:y,setDate:C}=ns(e,a),w={...so,...d},[I,x]=t.useState(!1),S=t.useRef(null),F=t.useRef(null);return t.useEffect(()=>{m==null||m(f)},[f,m]),t.createElement(E,{css:{position:"relative"}},t.createElement(we,{name:"date",disabled:r,size:s,...g,onChange:A=>C(A.target.value,!0),value:y,ref:$}),t.createElement(le,{modal:!0,open:I,onOpenChange:x},t.createElement(le.Trigger,{asChild:!0},t.createElement(M,{css:{position:"absolute",top:"0",right:"0"},disabled:r,label:w.open,size:s,theme:"neutral"},t.createElement(b,{is:v.CalendarEvent}))),t.createElement(le.Portal,null,t.createElement(le.Content,{css:{pr:"$sizes$2",zIndex:Ue},side:"bottom",align:"end",showCloseButton:!1,onOpenAutoFocus:A=>{var P,T;A.preventDefault(),f?(P=F.current)==null||P.focus():(T=S.current)==null||T.focus()}},t.createElement(co,{date:f||new Date,selected:f,onDateSelected:async A=>{x(!1),await C(A.date,!1),c&&c()},setYear:async A=>{await C(A,!1),c&&c()},minDate:p,maxDate:h,refDateToday:S,refDateSelected:F,firstDayOfWeek:o,monthNames:n,weekdayNames:i,labels:w})))))});aa.displayName="DateInput";const uo=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:d,trigger:c}=H.useFormContext(),{error:m}=ie(o),p=r?d(r):d;return t.createElement(te,{css:e,description:i,error:m,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(aa,{id:o,name:o,ref:p,...m&&{state:"error"},...s,revalidate:c}))};uo.displayName="DateField";const oa=l(E,{width:"100vw",height:"100vh"}),is=l(_.Close,{}),ra="translate3d(-50%, -50%, 0)",po="translate3d(-50%, 50vh, 0)",ho="modal_overlay",ls=D({"0%":{transform:po},"100%":{transform:ra}}),ss=D({"0%":{transform:ra},"100%":{transform:po}}),cs=l(_.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",overflowY:"auto",zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${Nt} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),ds=l(_.Content,{bg:"white",borderRadius:"$1",boxShadow:"$3",boxSizing:"border-box",left:"50%",maxWidth:"90vw",maxHeight:"90vh",overflowY:"auto",p:"$5",position:"fixed",top:"50%",transform:ra,zIndex:Ue,"&:focus":{outline:"none"},"@allowMotion":{'&[data-state="open"]':{animation:`${ls} 550ms cubic-bezier(0.22, 1, 0.36, 1)`},'&[data-state="closed"]':{animation:`${ss} 550ms cubic-bezier(0.22, 1, 0.36, 1)`}},variants:{size:{xs:{width:"380px"},sm:{width:"480px"},md:{width:"600px"},lg:{width:"800px"},xl:{width:"1100px"}}}}),ms=({size:e="sm",children:a,closeDialogText:o="Close dialog",showCloseButton:r=!0,...n})=>t.createElement(_.Portal,null,t.createElement(cs,{id:ho},t.Children.map(a,i=>(i==null?void 0:i.type)===oa&&i),t.createElement(ds,{size:e,"aria-label":"Dialog",onPointerDownOutside:i=>{const s=i.target;(s==null?void 0:s.id)!==ho&&i.preventDefault()},...n},r&&t.createElement(M,{as:_.Close,css:{position:"absolute",right:"$4",top:"$4"},label:o,size:"md",theme:"neutral"},t.createElement(b,{is:v.Close})),t.Children.map(a,i=>(i==null?void 0:i.type)!==oa&&i)))),us=l(_.Root,{}),ue=e=>t.createElement(us,{...e});ue.Background=oa,ue.Close=is,ue.Content=ms,ue.Description=_.Description,ue.Title=_.Title,ue.Trigger=_.Trigger,ue.displayName="Dialog";const ps=l(Ie.Content,{bg:"white",borderRadius:"$0",boxShadow:"$0",py:"$2",zIndex:Sn,"@allowMotion":{animationDuration:"250ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="open"]':{'&[data-side="top"]':{animationName:Rt},'&[data-side="right"]':{animationName:Ft},'&[data-side="bottom"]':{animationName:It},'&[data-side="left"]':{animationName:Tt}}}}),hs={alignItems:"center",color:"$tonal600",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:400,position:"relative",px:"$3",py:"$2","&[data-disabled]":{color:"$tonal200",pointerEvents:"none"},'&[aria-current="page"], &:focus':{"&::before":{borderLeft:"2px solid currentColor",content:"",height:"$2",left:0,outline:"none",position:"absolute",transform:"scale(1)"}},"&:focus":{color:"$primaryMid",outline:"none"},"&:hover":{textDecoration:"underline"}},go=l(Ie.Item,hs),gs=l("a",{textDecoration:"none"}),$s=({children:e,href:a,...o})=>u.default.createElement(go,{...o,asChild:!0},u.default.createElement(gs,{href:a,role:"menuitem"},e)),fs=l(Ie.Separator,{height:"1px",backgroundColor:"$tonal200",my:"$2"}),bs=l(Ie.Trigger,{}),vs=l(Ie.Root,{}),Ee=e=>u.default.createElement(vs,{...e});Ee.Content=ps,Ee.Item=go,Ee.LinkItem=$s,Ee.Portal=Ie.Portal,Ee.Separator=fs,Ee.Trigger=bs;const $o=l(L,{color:"$tonal400",fontWeight:"400",variants:{size:{xs:{fontSize:"$sm",mb:"$4"},sm:{fontSize:"$sm",mb:"$4"},md:{fontSize:"$sm",mb:"$4"},lg:{fontSize:"$md",mb:"calc($4 + $2)"},xl:{fontSize:"$md",mb:"calc($4 + $2)"}}}}),ys=l(Pe,{variants:{size:{xs:{maxWidth:"56px",maxHeight:"32px",mb:"$4"},sm:{maxWidth:"84px",maxHeight:"48px",mb:"$4"},md:{maxWidth:"126px",maxHeight:"72px",mb:"$4"},lg:{maxWidth:"190px",maxHeight:"142px",mb:"calc($4 + $2)"},xl:{maxWidth:"285px",maxHeight:"213px",mb:"calc($4 + $2)"}}}}),fo=e=>u.default.createElement(ys,{...e}),bo=l("h2",{color:"$tonal400",fontFamily:"$body",fontWeight:"600",m:0,variants:{size:{xs:{fontSize:"$md",mb:"$3"},sm:{fontSize:"$md",mb:"$3"},md:{fontSize:"$md",mb:"$3"},lg:{fontSize:"$lg",mb:"$4"},xl:{fontSize:"$lg",mb:"$4"}}}}),xs=l(z,{flexDirection:"column",alignItems:"center",textAlign:"center","& > *:last-child":{mb:0},variants:{size:{xs:{p:"$2"},sm:{p:"$3"},md:{p:"$4"},lg:{p:"$5"},xl:{p:"$6"}}}}),Ke=({size:e="sm",children:a,...o})=>t.createElement(xs,{size:e,...o},t.Children.map(a,r=>t.isValidElement(r)&&(r.type===fo||r.type===bo||r.type===$o)?t.cloneElement(r,{...r.props,size:e}):r));Ke.displayName="EmptyState",Ke.Image=fo,Ke.Title=bo,Ke.Body=$o;const vo=({accept:e,children:a,multiple:o=!1,onFileSelect:r,...n})=>{const i=s=>{const{files:d}=s.target;r(d)};return t.createElement(ne,{as:"label",...n},t.createElement(b,{is:v.Upload}),a,t.createElement("input",{type:"file",onChange:i,accept:e,multiple:o,hidden:!0}))};vo.displayName="FileInput";const ws=l("div",{display:"grid",variants:{gap:zt("space",{gap:"$key"})}}),yo=({css:e,gap:a=2,minItemSize:o,maxItemSize:r="1fr",...n})=>t.createElement(ws,{css:{...o&&{gridTemplateColumns:`repeat(auto-fit, minmax(${o}, ${r}))`},...e},gap:a,...n});yo.displayName="Grid";const xo=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:d}=H.useFormContext(),{error:c}=ie(o),m=r?d(r):d;return t.createElement(te,{css:e,description:i,error:c,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(we,{id:o,name:o,ref:m,...c&&{state:"error"},...s}))};xo.displayName="InputField";const Es=l("div",{"& > *":{"&:not(:first-child)":{mt:"$5"},"&:not(:last-child)":{mb:"$5"}},[`& > ${Ot}`]:{maxWidth:"65ch"},[`& > ${Ht}`]:{maxWidth:"75ch"},[`& > ${Oa}`]:{maxWidth:"75ch"},[`& > ${Va}`]:{my:"$5"},[`& > ${Ma}`]:{display:"block","&:not(:first-child)":{mt:"$6"},"&:not(:last-child)":{mb:"$6"}}}),na=t.forwardRef((e,a)=>t.createElement(Es,{ref:a,...e}));na.displayName="StackContent";const Cs={code:bi,emphasis:vi,heading:xi,inlineCode:Ei,image:Ci,link:Si,list:ki,listItem:Di,paragraph:zi,strong:Ti,text:Ri,thematicBreak:Fi},Ss=e=>{var a,o;if((a=e.position)!=null&&a.start){const{line:r,column:n,offset:i}=(o=e.position)==null?void 0:o.start;return`${e.type}${r}${n}${i}`}return`${e.type}${+new Date}`},wo=({content:e,customComponents:a={},css:o})=>{const r=zr.default(e,{extensions:[Ir.default()],mdastExtensions:[Dr.default.fromMarkdown]}),n={...Cs,...a},i=s=>{const d=n[s.type];return d?t.createElement(d,{key:Ss(s),node:s,handleNode:i}):null};return t.createElement(na,{css:o},r.children.map(i))};wo.displayName="MarkdownContent";const Eo=u.default.createContext(void 0),ks=()=>{const e=u.default.useContext(Eo);if(e===void 0)throw new Error("useNavigationMenuContext must be used within a NavigationMenuContextProvider");return e},vt=e=>{e.preventDefault()},Ds=l("ul",{listStyle:"none",m:0,p:0}),zs=l(ce.Content,{p:"$3",bg:"white",mt:"4px",boxShadow:"$1",borderRadius:"$1"}),ia=({children:e})=>u.default.createElement(zs,{onPointerMove:vt,onPointerLeave:vt},u.default.createElement(Ds,null,e));ia.displayName="NavigationMenuDropdownContent";const Co={background:"none",color:"$tonal400",opacity:"30%",cursor:"default"},la={all:"unset",position:"relative",color:"$tonal400",outline:"none",cursor:"pointer",fontFamily:"$body",userSelect:"none",padding:"$3",borderRadius:"$1","&:hover":{background:"$tonal50",color:"$tonal600"},"&:active":{background:"$tonal100",color:"$tonal600"},"&:focus-visible":{boxShadow:"inset 0 0 0 2px $colors$primary"},"&:disabled":{...Co}},So={fontWeight:"600",color:"$tonal500","&::after":{backgroundColor:"$tonal500",borderRadius:"$1",bottom:0,content:"",display:"block",height:"2px",left:"50%",position:"absolute",transform:"translate(-50%,0)",width:"$2"}},Is=l(ce.Trigger,la,{display:"flex",alignItems:"center",borderRadius:"$1",justifyContent:"space-between",'&[data-state="open"]':{background:"$tonal100"},variants:{active:{true:{...So}}}}),sa=u.default.forwardRef(({children:e,active:a,...o},r)=>u.default.createElement(Is,{active:a,...o,ref:r,onPointerMove:vt,onPointerLeave:vt},e,u.default.createElement(b,{is:v.ChevronDown,css:{ml:"$1","[data-state=open] &":{transform:"rotate(-180deg)"},"@media (prefers-reduced-motion: no-preference)":{transition:"transform .2s ease"}},size:"sm"})));sa.displayName="NavigationMenuDropdownTrigger";const ko=({children:e,id:a,...o})=>{const{onNodeUpdate:r}=ks();return u.default.createElement(ce.Item,{value:a},u.default.Children.map(e,n=>{const i=u.default.isValidElement(n)&&n.type===sa,s=u.default.isValidElement(n)&&n.type===ia;if(!i&&!s)throw new Error('Only NavigationMenu.Trigger and NavigationMenu.Content can be the passed as a "children" of NavigationMenu.Dropdown');return i?u.default.cloneElement(n,{...o,ref:d=>r(d,a)}):n}))};ko.displayName="NavigationMenuDropdown";const Ts=l("button",{...la,...Co}),Rs=l(ce.Item),Fs=l(ce.Link,la,{display:"block",textDecoration:"none",lineHeight:1,variants:{elementType:{dropdownItem:{"&[data-active]":{background:"$primaryLight",color:"$primary","*":{color:"$primary"},"&:hover":{background:"$tonal50"},"&:active":{background:"$tonal100"},"&:focus-visible":{boxShadow:"0 0 0 2px $colors$primary"}}},link:{"&[data-active]":{...So}}}}}),ca=u.default.forwardRef(({children:e,href:a,disabled:o,css:r,variant:n="link",...i},s)=>u.default.createElement(Rs,null,o?u.default.createElement(Ts,{disabled:!0,...i},e):u.default.createElement(Fs,{href:a,ref:s,elementType:n,css:r,...i},e)));ca.displayName="NavigationMenuLink";const Do=u.default.forwardRef((e,a)=>u.default.createElement(ca,{ref:a,variant:"dropdownItem",...e})),zo=l(L,{color:"$tonal500",fontWeight:600});Do.displayName="NavigationMenuDropdownItem",zo.displayName="NavigationMenuDropdownItemTitle";const Ns=D({"0%, 50%":{opacity:0},"100%":{opacity:1}}),Ms=l(ce.Root,{display:"flex",justifyContent:"center",position:"relative"}),As=l(ce.List,{all:"unset",display:"flex",justifyContent:"center",alignItems:"center",gap:"$1",listStyle:"none"}),Ls=l(ce.Viewport,{zIndex:it}),Ps=l("div",{position:"absolute",left:0,top:"100%",width:"100%",display:"flex",justifyContent:"center"}),pe=({children:e,css:a})=>{const[o,r]=u.default.useState(),[n,i]=u.default.useState(),[s,d]=u.default.useState(0),c=u.default.useRef(null),m=200;u.default.useLayoutEffect(()=>{c.current&&d(c.current.offsetWidth)},[]),u.default.useEffect(()=>{let h;return n===""&&(h=setTimeout(()=>r(null),m)),()=>{h!==null&&clearTimeout(h)}},[n]);const p=(h,g)=>{if(h&&s&&n===g){const $=s/2,f=s-h.offsetLeft-h.offsetWidth+h.offsetWidth/2;r(Math.round($-f))}return h};return u.default.createElement(Eo.Provider,{value:{onNodeUpdate:p}},u.default.createElement(Ms,{onValueChange:i,css:a},u.default.createElement(As,{ref:c},e),u.default.createElement(Ps,null,u.default.createElement(Ls,{css:{transform:`translateX(${o||0}px)`,'&[data-state="open"]':{animation:`${Ns} ${m}ms ease`},'&[data-state="closed"]':{animation:`${rt} ${m}ms ease-out`}}}))))};pe.Link=ca,pe.Dropdown=ko,pe.DropdownContent=ia,pe.DropdownItem=Do,pe.DropdownItemTitle=zo,pe.DropdownTrigger=sa,pe.displayName="NavigationMenu";const Ws=l(E,{position:"relative"}),Bs=l(z,{fontFamily:"$body",fontSize:"$sm",flexDirection:"column",justifyContent:"center",position:"absolute",top:"0",right:"0",transform:"translate(calc($sizes$2 / 2), -50%)",borderRadius:"$round",p:"$2",height:"$2",minWidth:"$2",textAlign:"center",color:"#fff",bg:"$primary"}),Os=({value:e,children:a})=>u.default.createElement(Ws,null,!!e&&u.default.createElement(Bs,{role:"status"},e),a),Hs=l("span",{zIndex:1}),Vs=l(M,{borderColor:"$tonal400 !important",zIndex:1,"&:hover":{bg:"$tonal50",svg:{color:"$tonal400"}},svg:{color:"$tonal300"},"&:active":{bg:"$tonal100",svg:{color:"$tonal500"}},"&:disabled":{opacity:.3,pointerEvents:"none"}}),Io=t.forwardRef((e,a)=>{const{icon:o,disabledTooltipContent:r,showTooltip:n,...i}=e;return t.createElement(K,null,t.createElement(K.Trigger,{asChild:!0},t.createElement(Hs,{tabIndex:-1},t.createElement(Vs,{tabIndex:-1,appearance:"outline",ref:a,...i},t.createElement(b,{is:o})))),n&&t.createElement(K.Content,null,r))}),da=t.forwardRef((e,a)=>{const{name:o,min:r=0,max:n=Number.MAX_SAFE_INTEGER,step:i=1,initialValue:s=0,disabled:d=!1,readonly:c=!1,size:m="md",onChange:p,stepperButtonLabels:h,disabledTooltipContent:g,css:$,...f}=e,[y,C]=t.useState(s),w=t.useRef(null);t.useImperativeHandle(a,()=>w.current);const I={increment:"increment",decrement:"decrement",...h},x={decrement:`Cannot enter values below ${r}`,increment:`Cannot enter values above ${n}`,...g},S=y>=n,F=y<=r,A=t.useCallback(k=>Math.min(Math.max(k,r),n),[n,r]),P=t.useCallback(k=>{C(k),p==null||p(Number(k))},[p]),T=t.useCallback(k=>{const j=k.target.value.replace(/\D/g,"");P(j)},[P]),N=t.useCallback(()=>{var k;if(S||c)return;(k=w==null?void 0:w.current)==null||k.focus();let j;y===""?j=i:j=Number(y)+i,P(A(j))},[A,S,c,i,P,y]),V=t.useCallback(()=>{var k;if(F||c)return;(k=w==null?void 0:w.current)==null||k.focus();let j;y===""?j=r:j=Number(y)-i,P(A(j))},[A,F,c,r,i,P,y]),ke=t.useCallback(k=>{if(k.nativeEvent.isComposing)return;const j=k.key,Ve={ArrowUp:N,ArrowRight:N,ArrowDown:V,ArrowLeft:V,Home:()=>P(r),End:()=>P(n)}[j];Ve&&(k.preventDefault(),Ve(k))},[N,V,P,r,n]),wt={name:o,type:"number",value:y,...f,onChange:T,onKeyDown:ke,size:m,css:{borderRadius:"0px",width:"$6","&:disabled":{opacity:.3,pointerEvents:"none"}},ref:w,readOnly:c,disabled:d,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":Number(y),role:"spinbutton"};return t.createElement(z,{css:$},t.createElement(Io,{onClick:V,icon:v.Minus,css:{borderRight:"none",borderTopRightRadius:"0px",borderBottomRightRadius:"0px"},size:m,disabled:F||d,showTooltip:F&&!d,disabledTooltipContent:x.decrement,label:I.decrement}),t.createElement(we,{...wt}),t.createElement(Io,{onClick:N,icon:v.Plus,css:{borderLeft:"none",borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px"},size:m,disabled:S||d,showTooltip:S&&!d,disabledTooltipContent:x.increment,label:I.increment}))});da.displayName="NumberInput";const To=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:d,trigger:c}=H.useFormContext(),{error:m}=ie(o),p=r?d(r):d;return t.createElement(te,{css:e,description:i,error:m,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(da,{id:o,name:o,ref:p,...m&&{state:"error","aria-invalid":!0},...s,onChange:c}))};To.displayName="NumberInputField";const ma=t.forwardRef(({css:e,hidePasswordText:a="Hide password",showPasswordText:o="Show password",size:r="md",...n},i)=>{const[s,d]=Y.useState(!1),c=()=>d(m=>!m);return t.createElement(E,{css:{position:"relative",...e}},t.createElement(we,{...n,size:r,type:s?"text":"password",ref:i,css:{pr:"$sizes$2"}}),t.createElement(M,{appearance:"simple",theme:"neutral",css:{bottom:0,position:"absolute",right:0},label:s?a:o,onClick:c,onMouseDown:m=>m.preventDefault(),size:r},t.createElement(b,{is:s?v.Eye:v.EyeCrossed})))});ma.displayName="PasswordInput";const Ro=({css:e={},label:a="Password",name:o,prompt:r=void 0,description:n,validation:i,...s})=>{const{register:d}=H.useFormContext(),{error:c}=ie(o),m=i?d(i):d;return t.createElement(te,{css:{...e,position:"relative"},description:n,error:c,fieldId:o,label:a,prompt:r,required:Boolean(i==null?void 0:i.required)},t.createElement(ma,{autoComplete:"current-password",name:o,id:o,ref:m,...s}))};Ro.displayName="PasswordField";const _s=l(wa.Root,{borderRadius:"$round",background:"$tonal100",height:"$0",position:"relative",overflow:"hidden",width:"100%",variants:{theme:{primary:{color:"$primary"},success:{color:"$success"},warning:{color:"$warning"},danger:{color:"$danger"}}}}),qs=l(wa.Indicator,{backgroundColor:"currentcolor",borderRadius:"$round",boxSizing:"border-box",height:"100%",position:"absolute",transition:"all 300ms ease-out"}),Fo=({value:e,max:a=100,theme:o="primary",...r})=>t.createElement(_s,{value:e,max:a,theme:o,...r},t.createElement(qs,{style:{width:"100%",transform:`translateX(-${100-(e||0)/a*100}%)`}}));Fo.displayName="ProgressBar";const No=({css:e,label:a,value:o,...r})=>t.createElement(ht,{css:e,label:a},t.createElement(pt,{value:o,...r}));No.displayName="RadioField";const Gs=l("fieldset",{all:"unset"}),ua=({children:e,css:a,direction:o="column",defaultValue:r,description:n,label:i,name:s,validation:d,onValueChange:c,...m})=>{const{control:p}=H.useFormContext(),{error:h}=ie(s);return t.createElement(Gs,{css:a},t.createElement(Be,{as:"legend",css:{p:0,mb:"$3"},required:Boolean(d==null?void 0:d.required)},i),n&&t.createElement(Gt,{css:{mb:"$3"}},n),t.createElement(H.Controller,{control:p,name:s,rules:d,defaultValue:r,render:({onChange:g,value:$})=>t.createElement(jt,{direction:o,defaultValue:r,onValueChange:f=>{g(f),c==null||c(f)},value:$,...m},e)}),h&&t.createElement(dt,{css:{mt:"$2"}},h))};ua.Item=No,ua.displayName="RadioButtonField";const js=l(Re.Item,{alignItems:"center",bg:"white",border:"1px solid $tonal200",borderRadius:"$0",cursor:"pointer",display:"flex",textAlign:"left",'&[data-state="checked"]':{outline:"2px solid $primary",outlineOffset:"-2px"},variants:{align:{left:{flexDirection:"row"},right:{flexDirection:"row-reverse"}},size:{md:{px:"$4",py:"$3"},lg:{px:"$5",py:"$4"}},isFullWidth:{true:{width:"100%"},false:{width:"max-content"}}}}),Ys=l("div",{alignItems:"center",appearance:"none",backgroundColor:"transparent",border:"1px solid $tonal500",borderRadius:"$round",display:"flex",flexShrink:0,justifyContent:"center",p:0,size:"$1",transition:"all 50ms ease-out",'[data-state="checked"] &':{backgroundColor:"$primary",borderColor:"$primary"},variants:{containerIsFullWidth:{true:{},false:{}},align:{left:{mr:"$4"},right:{}}},compoundVariants:[{containerIsFullWidth:!0,align:"right",css:{ml:"auto"}},{containerIsFullWidth:!1,align:"right",css:{ml:"$4"}}]}),Us=l(Re.Indicator,{backgroundColor:"white",borderRadius:"$round",position:"absolute",size:"6px"}),Mo=({children:e,isFullWidth:a=!1,size:o="md",align:r="left",...n})=>t.createElement(js,{...n,align:r,isFullWidth:a,size:o},t.createElement(Ys,{align:r,containerIsFullWidth:a},t.createElement(Us,null)),t.createElement(E,null,e)),Xs=({css:e,children:a,size:o,isFullWidth:r,align:n,gap:i="3",justify:s,...d})=>t.createElement(Re.Root,{...d},t.createElement(Le,{direction:"row",justify:s,gap:i,css:e},t.Children.map(a,c=>t.isValidElement(c)&&(c==null?void 0:c.type)===Mo?t.cloneElement(c,{size:o,isFullWidth:r,align:n}):c))),Ao=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:d}=H.useFormContext(),{error:c}=ie(o),m=r?d(r):d;return t.createElement(te,{css:e,description:i,error:c,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(ft,{id:o,name:o,ref:m,...c&&{state:"error"},...s}))};Ao.displayName="SearchField";const Lo=({css:e=void 0,children:a,name:o,label:r,validation:n,prompt:i,description:s,hideLabel:d,...c})=>{const{register:m}=H.useFormContext(),{error:p}=ie(o),h=n?m(n):m;return t.createElement(te,{css:e,description:s,error:p,fieldId:o,label:r,prompt:i,required:Boolean(n==null?void 0:n.required),hideLabel:d},t.createElement(bt,{name:o,id:o,...c,ref:h,...p&&{state:"error"}},a))};Lo.displayName="SelectField";const Po=l(ae.Root,{width:"100%"});Po.displayName="SidedrawerAccordionRoot";const Js=D({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Ks=D({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),Qs=l(ae.Content,{bg:"white",overflow:"hidden","@allowMotion":{'&[data-state="open"]':{animation:`${Js} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Ks} 300ms ease-out`}}}),Zs=({children:e,...a})=>u.default.createElement(Qs,{...a},u.default.Children.map(e,o=>u.default.createElement(E,{css:{"> a":{px:"$6"},"> button":{px:"$6"}}},o))),ec=l(ae.Item,{}),pa={alignItems:"center",bg:"white",border:"unset",borderLeft:"4px solid transparent",color:"$tonal600",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:"400",fontSize:"$md",margin:0,minHeight:"48px",outline:"unset",outlineOffset:"unset",py:"$3",px:"$4",width:"100%",textDecoration:"none","&:hover":{bg:"$tonal50"},"&:active":{bg:"$tonal100"},"&:focus-visible":{boxShadow:"inset 0 0 0 2px $colors$primary"},"&[disabled]":{opacity:"0.3",pointerEvents:"none",cursor:"default"},variants:{active:{true:{bg:"$primaryLight",borderLeft:"4px solid $primary",color:"$primary",fontWeight:"600"}}}},tc=l(ae.Trigger,{justifyContent:"space-between",m:0,p:0,"&[data-state=open]":{fontWeight:"600"},...pa}),ac=l(b,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"}}),oc=({children:e,...a})=>u.default.createElement(ae.Header,null,u.default.createElement(tc,{...a},u.default.createElement(z,{css:{alignItems:"center"}},e),u.default.createElement(ac,{is:v.ChevronDown,size:"sm"}))),rc=({children:e})=>{let a=!1;return u.default.Children.forEach(e,o=>{var r;Y.isValidElement(o)&&((r=o.props)==null?void 0:r.value)&&(a=!0)}),u.default.createElement(E,{css:{flexGrow:1,width:"100%",overflowY:"auto"}},a?u.default.createElement(Po,{type:"single"},e):e)},nc=({appearance:e="simple",label:a="close",size:o="md",theme:r="neutral",...n})=>u.default.createElement(_.Close,{asChild:!0},u.default.createElement(M,{theme:r,appearance:e,size:o,label:a,...n},u.default.createElement(b,{is:v.Close}))),ic=l(_.Overlay,{animationFillMode:"forwards",bg:"$alpha600",cursor:"pointer",height:"100vh",left:"0",position:"fixed",top:"0",width:"100vw",zIndex:it-1,"@allowMotion":{'&[data-state="open"]':{animation:`${Nt} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),lc=l(_.Content,{bg:"white",boxShadow:"$2",display:"flex",flexDirection:"column",position:"fixed",top:0,left:0,height:"100%",maxWidth:"304px",width:"100%",zIndex:it,"@allowMotion":{'&[data-state="open"]':{animation:`${Pr} 250ms ease-out`},'&[data-state="closed"]':{animation:`${Wr} 250ms ease-out`}}}),sc=({children:e,...a})=>u.default.createElement(_.Portal,null,u.default.createElement(ic,{"data-testid":"sidedrawer_overlay"}),u.default.createElement(lc,{role:"navigation",...a},e)),cc=l("footer",{alignItems:"center",borderTop:"1px solid $tonal100",bottom:0,boxShadow:"$3",display:"flex",height:"$6",justifyContent:"center",p:"$3",width:"100%"}),dc=({delay:e=500,delayMethod:a="throttle"}={})=>{const[o,r]=Y.useState({x:0,y:0}),n=Y.useMemo(()=>{if(a==="throttle")return et.throttle;if(a==="debounce")return et.debounce},[a]);return Y.useEffect(()=>{const i=n(e,()=>{r({x:window.scrollX,y:window.scrollY})});return window.addEventListener("scroll",i),()=>{window.removeEventListener("scroll",i)}},[n,e]),o},mc=u.default.forwardRef(({icon:e,...a},o)=>u.default.createElement(M,{size:"md",appearance:"simple",theme:"neutral",ref:o,...a},u.default.createElement(b,{is:e}))),yt=({src:e,alt:a="Atom Learning logo",css:o})=>u.default.createElement(Pe,{className:"topbar-brand-logo",src:e,alt:a,css:{mr:"$3",mb:"5px",...o}});yt.toString=()=>".topbar-brand-logo";const uc=l(L,{color:"$tonal400"}),pc=l("a",{display:"flex",alignItems:"center",textDecoration:"none",color:"$tonal400","&:hover, &:focus":{textDecoration:"none"}}),hc=()=>u.default.createElement(qt,{orientation:"vertical",css:{height:"$2",bg:"$tonal100"}}),gc=l("div",{bg:"white",position:"sticky",display:"flex",alignItems:"center",width:"100vw",top:"0",zIndex:1,borderBottom:"1px solid $tonal100",transition:"box-shadow .2s ease-out",variants:{hasScrolled:{true:{boxShadow:"0px 4px 4px -2px rgba(31, 31, 31, 0.1);"}},size:{md:{height:"$6",[`& ${yt}`]:{'&[src$=".svg"]':{height:24,width:"auto"}}},lg:{height:"$7",[`& ${yt}`]:{'&[src$=".svg"]':{height:32,width:"auto"}}}}}}),$c=l(z,{alignItems:"center",height:"$4",mx:"$4",width:"100%","@md":{mx:"$5"}}),he=({size:e="md",...a})=>{const{y:o}=dc();return u.default.createElement(gc,{hasScrolled:!!o,size:e},u.default.createElement($c,{...a}))};he.Brand=pc,he.BrandLogo=yt,he.BrandName=uc,he.ActionIcon=mc,he.Divider=hc,he.displayName="TopBar";const fc=l("header",{"> div":{width:"100%"}}),bc=({children:e,...a})=>u.default.createElement(fc,{...a},u.default.createElement(he,{css:{mx:"$3"}},e)),vc=l("a",pa),yc=l("button",pa),xc=({active:e,children:a,disabled:o,href:r,onClick:n,...i})=>r?u.default.createElement(vc,{active:e,href:r,onClick:n,...i},a):u.default.createElement(yc,{active:e,disabled:o,onClick:n,...i},a),wc=l(_.Trigger,{}),Z=({children:e,...a})=>u.default.createElement(kr.Root,{...a},e);Z.Accordion=ec,Z.AccordionContent=Zs,Z.AccordionTrigger=oc,Z.Body=rc,Z.Close=nc,Z.Content=sc,Z.Footer=cc,Z.Header=bc,Z.Item=xc,Z.Trigger=wc;const Ec=l("div",{height:"$space$3",mt:"$3",position:"relative",width:"100%"}),Wo=(e,a,o)=>(e-a)/(o-a)*100,Cc=(e,a,o)=>{const r=Wo(e,a,o);return r<=10?0:r>=90?100:50},Sc=({min:e,max:a,steps:o=[]})=>o.length===0?null:t.createElement(Ec,null,o.map(r=>t.createElement(L,{as:"span",key:r.value,css:{position:"absolute",color:"$tonal300"},style:{left:`${Wo(r.value,e,a)}%`,transform:`translateX(-${Cc(r.value,e,a)}%)`}},r.label))),kc=({value:e=[],outputLabel:a=o=>`Current value is ${o}`})=>t.createElement(L,{css:{mt:"$4",color:"$tonal300",width:"100%"}},a(e.length===1?e[0]:e)),ha=l(tt.Track,{borderRadius:"$round",flexGrow:1,position:"relative",'&[data-orientation="horizontal"]':{height:"$space$1"},'&[data-orientation="vertical"]':{width:"$space$1"}}),Dc=l(tt.Root,{alignItems:"center",display:"flex",position:"relative",touchAction:"none",userSelect:"none",cursor:"pointer",'&[data-orientation="horizontal"]':{height:"$1"},'&[data-orientation="vertical"]':{flexDirection:"column",width:"$1"},"&[data-disabled]":{cursor:"not-allowed",bg:"$tonal100"},variants:{theme:{light:{[`${ha}`]:{bg:"#fff"}},tonal:{[`${ha}`]:{bg:"$tonal200"}}}}}),zc=l(tt.Range,{bg:"$primary",borderRadius:"$round",height:"100%",position:"absolute","&[data-disabled]":{bg:"$tonal200",cursor:"not-allowed"}}),Ic=l(tt.Thumb,{bg:"$primaryMid",borderRadius:"$round",display:"block",size:"$1","&:hover":{bg:"$primaryDark"},"&:focus":{outline:"2px solid $primaryMid",outlineOffset:"2px"},"&[data-disabled]":{bg:"$tonal200",cursor:"not-allowed"}}),Ce=({value:e,defaultValue:a,min:o=0,max:r=100,theme:n="tonal",css:i,children:s,...d})=>{const c=e||a;return t.createElement(Fe,{css:i},t.createElement(Dc,{theme:n,defaultValue:a,value:e,min:o,max:r,...d},t.createElement(ha,null,t.createElement(zc,null)),(c==null?void 0:c.length)&&c.map((m,p)=>t.createElement(Ic,{key:`thumb${p}`}))),s)};Ce.Value=kc,Ce.Steps=Sc,Ce.displayName="Slider";const Bo=({css:e,label:a,name:o,defaultValue:r,outputLabel:n,min:i=0,max:s=100,steps:d=[],...c})=>{const{control:m}=H.useFormContext();return u.default.createElement(te,{css:e,fieldId:o,label:a},u.default.createElement(H.Controller,{control:m,name:o,defaultValue:r,render:({onChange:p,value:h})=>u.default.createElement(Ce,{name:o,defaultValue:r,onValueChange:p,value:h,min:i,max:s,...c},u.default.createElement(Ce.Steps,{min:i,max:s,steps:d}),u.default.createElement(Ce.Value,{value:h||r,outputLabel:n}))}))};Bo.displayName="SliderField";const Oo=t.createContext({steps:[],goToPreviousStep:()=>null,goToNextStep:()=>null,goToStep:()=>null,activeStep:0,viewedSteps:[],allowSkip:!1,direction:"horizontal",hideLabels:!1,completedSteps:[],showCompletedIcons:!1}),Tc=({children:e,stepCount:a,allowSkip:o,onComplete:r,onStepChange:n,direction:i,steps:s,hideLabels:d,showCompletedIcons:c})=>{const[m,p]=t.useState(0),[h,g]=t.useState([0]),[$,f]=t.useState([]),y=!a;t.useEffect(()=>{g(x=>x.includes(m)?x:[...x,m]),n==null||n(m)},[m,n]);const C=()=>{const x=r&&m===a-1,S=m<a-1;if((r||S)&&f(F=>F.includes(m)?F:[...F,m]),x)return r==null?void 0:r();if(S)return p(F=>F+1)},w=()=>{p(x=>x-1)},I=x=>{p(x)};return t.createElement(Oo.Provider,{value:{steps:s||Array(a).fill(""),goToPreviousStep:y?void 0:w,goToNextStep:y?void 0:C,goToStep:y?void 0:I,activeStep:m,viewedSteps:h,completedSteps:$,allowSkip:o,direction:i,hideLabels:d,showCompletedIcons:c}},e)},ga=()=>{const e=t.useContext(Oo);if(!e)throw new Error("Ensure that you wrap any components with the root component Stepper");return e},Rc=({label:e,children:a,...o})=>{const{activeStep:r,goToPreviousStep:n}=ga();return t.createElement(ne,{size:"sm",appearance:"outline",...o,disabled:r===0,onClick:n},a||(e==null?void 0:e(r)))},Fc=({label:e,children:a,onClick:o,...r})=>{const{goToNextStep:n,activeStep:i}=ga();return t.createElement(ne,{size:"sm",...r,onClick:()=>{if(o)return o(n);n==null||n()},css:{ml:"auto"}},a||(e==null?void 0:e(i)))},Nc=l(z,{position:"relative",p:"$2",justifyContent:"center",alignItems:"center",size:"$3",borderRadius:"50%",border:"none",bg:"$tonal100",zIndex:1,flex:"none",variants:{status:{default:{bg:"$tonal100",color:"$tonal300"},active:{bg:"white",color:"$primaryMid",border:"2px solid",borderColor:"currentColor"},viewed:{bg:"white",border:"2px solid $tonal200",color:"$tonal600"},completed:{bg:"$primary",color:"white"},reviewed:{bg:"$primaryMid",color:"white"},success:{bg:"$success",color:"white"}}}}),Mc=l(z,{position:"relative",fontFamily:"$body",fontWeight:600,fontSize:"$md",alignItems:"center","&:not(:last-child)::after":{content:"",position:"absolute"},"&:focus-visible":{outline:"none"},variants:{canInteract:{true:{}},direction:{vertical:{py:"$3",flexDirection:"row","&:not(:last-child)::after":{height:"100%",width:"4px",left:"14px",top:"50%"}},horizontal:{px:"$2",flexDirection:"column","&:not(:last-child)::after":{width:"100%",height:"4px",left:"50%",top:"14px"}}},separator:{default:{"&:not(:last-child)::after":{bg:"$tonal100"}},active:{"&:not(:last-child)::after":{bg:"$primary"}},success:{"&:not(:last-child)::after":{bg:"$success"}},viewed:{"&:not(:last-child)::after":{bg:"$tonal200"}}},status:{completed:{},active:{},default:{},viewed:{},success:{},reviewed:{}}},compoundVariants:[{canInteract:!0,status:"completed",css:{"&:hover":{"& :first-child":{bg:"$primaryMid",color:"white !important"},"& :last-child":{color:"$primaryMid"}},"&:focus-visible":{"& :first-child":{outline:"2px solid $primary",outlineOffset:"2px"}}}},{canInteract:!0,status:"active",css:{"&:hover":{"& :first-child":{borderColor:"$tonal400",color:"$tonal600"},"& :last-child":{color:"$tonal600"}},"&:focus-visible":{"& :first-child":{outline:"2px solid $primary",outlineOffset:"2px"}}}},{canInteract:!0,status:"viewed",css:{"&:hover":{"& :first-child":{borderColor:"$tonal400",color:"$tonal600"},"& :last-child":{color:"$tonal600"}},"&:focus-visible":{"& :first-child":{outline:"2px solid $primary !important",outlineOffset:"2px !important"}}}},{canInteract:!0,status:"reviewed",css:{"&:focus-visible":{"& :first-child":{outline:"2px solid $primary !important",outlineOffset:"2px !important"}}}}]}),Ac=l(L,{fontWeight:600,variants:{direction:{vertical:{ml:"$3",textAlign:"left"},horizontal:{mt:"$3",textAlign:"center"}},status:{default:{color:"$tonal300",fontWeight:400},active:{color:"$primaryMid"},viewed:{color:"$tonal600"},completed:{color:"$primary"},success:{color:"$success"},reviewed:{}}}});var B=(e=>(e.ACTIVE="active",e.VIEWED="viewed",e.SUCCESS="success",e.DEFAULT="default",e.COMPLETED="completed",e.REVIEWED="reviewed",e))(B||{});const Lc=l(z,{justifyContent:"space-between",variants:{direction:{vertical:{flexDirection:"column"},horizontal:{flexDirection:"row"}}}}),Pc=({css:e})=>{const{steps:a,goToStep:o,activeStep:r,viewedSteps:n,allowSkip:i,direction:s,hideLabels:d,completedSteps:c,showCompletedIcons:m}=ga(),p=g=>{const $=a[g];return $.status?$.status:c.length===a.length?B.SUCCESS:r===g&&c.includes(r)?B.REVIEWED:r===g?B.ACTIVE:c.includes(g)?B.COMPLETED:n.includes(g)?B.VIEWED:B.DEFAULT},h=g=>{var $;const f=($=a[g])==null?void 0:$.status;return c.length===a.length||f===B.SUCCESS?B.SUCCESS:f===B.COMPLETED||g<Math.max(...n)?B.ACTIVE:f===B.VIEWED?B.VIEWED:B.DEFAULT};return t.createElement(Lc,{css:e,direction:s},a.map((g,$)=>{const f=p($),y=h($);return t.createElement(Mc,{tabIndex:0,key:`step_${$}`,direction:s,separator:y,status:f,css:s==="horizontal"?{width:`calc(100% / ${a.length})`}:{height:`calc(100% / ${a.length})`},canInteract:i},t.createElement(Nc,{as:i?"button":"div",onClick:()=>i&&n.includes($)?o==null?void 0:o($):void 0,status:f,"aria-current":$===r?"step":void 0,"aria-label":g.label?"":`step ${$+1}`,"aria-labelledby":g.label?`step-${$}`:void 0,css:{cursor:i&&n.includes($)?"pointer":"auto"}},g.status===B.SUCCESS||m&&f===B.COMPLETED?t.createElement(b,{is:v.Ok}):$+1),g.label&&!d&&t.createElement(Ac,{as:"span",id:`step-${$}`,direction:s,status:f},g.label))}))},Qe=({children:e,stepCount:a,allowSkip:o,onComplete:r,onStepChange:n,direction:i="horizontal",steps:s,hideLabels:d=!1,showCompletedIcons:c=!1,css:m})=>{Te.default(!(a&&s),"`Stepper` should only be given one of `stepCount` or `steps`. When both are provided, `steps` will be used and `stepCount` will be ignored.");const p=(s==null?void 0:s.length)||a||0;return t.createElement(Tc,{stepCount:p,allowSkip:o,onComplete:r,onStepChange:a?n:void 0,direction:i,steps:s||Array(p).fill(""),hideLabels:d,showCompletedIcons:c},t.createElement(E,{"aria-label":"progress",css:{width:"100%",...m}},e))};Qe.StepBack=Rc,Qe.StepForward=Fc,Qe.Steps=Pc,Qe.displayName="Stepper";const Wc=l(Ea.Root,{appearance:"none",backgroundColor:"$tonal200",border:"none",borderRadius:"$round",cursor:"pointer",display:"flex",overflow:"hidden",p:"$0",position:"relative",transition:"all 50ms ease-out",width:"$4","&:hover":{backgroundColor:"$tonal300"},"&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},'&[data-state="checked"]':{backgroundColor:"$primary"},'&[data-state="checked"]:hover':{backgroundColor:"$primaryMid"}}),Bc=l(Ea.Thumb,{backgroundColor:"white",borderRadius:"$round",display:"block",size:"$1",transition:"transform 50ms",willChange:"transform",'&[data-state="checked"]':{transform:"translateX(calc($sizes$2 - $space$1))"}}),Ho=e=>t.createElement(Wc,{...e},t.createElement(Bc,null));Ho.displayName="Switch";const Oc=({delay:e=500}={})=>{const[a,o]=Y.useState({width:void 0,height:void 0});return Y.useEffect(()=>{const r=et.debounce(e,()=>{o({width:window.innerWidth,height:window.innerHeight})});return window.addEventListener("resize",r),r(),()=>window.removeEventListener("resize",r)},[e]),a},Hc=l(Lt,{position:"relative",borderBottom:"1px solid $base3",width:"100%"}),Vc=l(at.List,{flexShrink:0,display:"flex",width:"100%",overflowX:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}),Vo=l(M,{height:"100% !important",position:"absolute",top:"50%",transform:"translateY(-50%)",cursor:"pointer",background:"$background !important",color:"$interactive1 !important",borderRadius:0,opacity:.9}),_c=10,_o=({children:e,colorScheme:a={},...o})=>{const[r,n]=wl(),{width:i}=Oc(),[s,d]=u.default.useState(!1),[c,m]=u.default.useState(!1),p=u.default.useCallback(h=>{if(!r)return;const{scrollWidth:g,scrollLeft:$,offsetWidth:f}=r,y=Math.round(g*(_c/100));let C=$;if(h==="right"){const w=$+y;C=w+f<=g?w:g-f}else{const w=$-y;C=w>0?w:0}r.scroll({left:C,behavior:"smooth"}),setTimeout(()=>{const{scrollWidth:w,scrollLeft:I,offsetWidth:x}=r,S=w-(I+x);I===0?(d(!1),m(!0)):S<5?(m(!1),d(!0)):(d(!0),m(!0))},500)},[r]);return u.default.useEffect(()=>{var h;if(!r)return;const{offsetWidth:g,scrollWidth:$}=r,f=$>g;(h=r.scroll)==null||h.call(r,{left:0}),d(!1),m(f)},[r,i]),u.default.createElement(Hc,{base:"slate",accent:"blue",interactive:"hiContrast1",...a,...o},s&&u.default.createElement(Vo,{label:"scroll left",size:"md",css:{left:0},onClick:()=>p("left")},u.default.createElement(b,{is:v.ChevronLeft})),u.default.createElement(Vc,{ref:n},e),c&&u.default.createElement(Vo,{label:"scroll right",size:"md",css:{right:0},onClick:()=>p("right")},u.default.createElement(b,{is:v.ChevronRight})))};_o.displayName="TabsTriggerList";const qc=l(at.Trigger,{background:"none",border:"none",cursor:"pointer",flexShrink:0,p:"$4",userSelect:"none",borderBottom:"2px solid transparent",'&[data-state="active"]':{color:"$interactive1",fontWeight:600,letterSpacing:"-0.005em",borderColor:"currentColor"},"&[data-disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([data-disabled])":{"&:hover, &:focus-visible":{color:"$interactive2",bg:"$accentA1"},"&:active":{color:"$interactive3"},"&:focus-visible":{...be()}}}),qo=({children:e,...a})=>t.createElement(qc,{asChild:!0,...a},t.createElement(L,{size:"sm",as:"button"},e));qo.displayName="TabsTrigger";const Gc=l(at.Content,{flexGrow:1,fontFamily:"$body"}),Go=Gc;Go.displayName="TabsContent";const jc=l(at.Root,{width:"100%"}),Ze=({children:e,...a})=>t.createElement(jc,{...a},e);Ze.TriggerList=_o,Ze.Trigger=qo,Ze.Content=Go,Ze.displayName="Tabs";const Yc=l("textarea",{boxShadow:"none",fontSize:"$md",appearance:"none",border:"1px solid $tonal400",borderRadius:"$0",boxSizing:"border-box",color:"$tonal600",fontFamily:"$body",fontWeight:400,lineHeight:1.4,minHeight:"$7",px:"$3",py:"calc($2 + $1)",resize:"vertical",transition:"all 75ms ease-out",width:"100%","&:focus":{borderColor:"$primary",outline:"none"},"&[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&::placeholder":{color:"$tonal300",opacity:1},variants:{state:{error:{border:"1px solid $danger"}}}}),$a=t.forwardRef((e,a)=>t.createElement(Yc,{...e,ref:a}));$a.displayName="Textarea";const jo=({css:e=void 0,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:d}=H.useFormContext(),{error:c}=ie(o),m=r?d(r):d;return t.createElement(te,{css:e,description:i,error:c,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement($a,{id:o,name:o,ref:m,...c&&{state:"error"},...s}))};jo.displayName="TextareaField";const Yo=400,Uc=D({"0%":{transform:"translate3d(0,-100%,0)",opacity:0},"100%":{transform:"translate3d(0,0,0)",opacity:1}}),Xc=D({"0%":{transform:"translate3d(0,0,0)",opacity:1},"100%":{transform:"translate3d(0,-100%,0)",opacity:0}}),Jc=l("div",{position:"absolute",width:"100%",variants:{visible:{true:{"@allowMotion":{animation:`${Uc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}},false:{opacity:0,"@allowMotion":{animation:`${Xc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}}}}}),Kc=l("div",{pointerEvents:"auto",alignItems:"center",borderRadius:"$0",boxShadow:"$1",boxSizing:"border-box",color:"white",display:"flex",minHeight:"$5",pl:"$4",position:"relative",pr:"$6",py:"$4",transition:"background-color 50ms ease-out",width:"100%","@sm":{width:Yo},"@allowMotion":{transition:"background-color 50ms ease-out, transform 150ms ease-out"},variants:{status:{blank:{bg:"$primary"},error:{bg:"$danger"},loading:{bg:"$primary"},success:{bg:"$success"}}}}),Qc=t.memo(({ariaLive:e,height:a,id:o,message:r,role:n,type:i="blank",visible:s,calculateOffset:d,updateHeight:c})=>{const m=d(o,{reverseOrder:!0,margin:8});return t.createElement(Jc,{visible:s},t.createElement(Kc,{ref:p=>{p&&a===void 0&&c(o,p.getBoundingClientRect().height)},status:i,role:n,"aria-live":e,style:{transform:`translateY(${m}px)`}},i==="error"&&t.createElement(b,{size:"sm",css:{mr:"$3",flex:"0 0 auto"},is:v.Error}),t.createElement(L,null,r),i==="loading"?t.createElement(lt,{css:{flex:"0 0 auto",ml:"auto"}}):t.createElement(M,{css:{position:"absolute",top:"$2",right:"$2",color:"white","&:hover,&:focus":{color:"white",opacity:.5}},label:"Close alert",onClick:()=>Ct.toast.dismiss(o)},t.createElement(b,{is:v.Close}))))}),Zc=l("div",{left:"$2",position:"fixed",top:"$2",right:"$2",zIndex:it,"@sm":{top:"$3",right:"auto",left:`calc(50% - ${Yo/2}px)`}}),Uo=({children:e})=>{const{toasts:a,handlers:o}=Ct.useToaster(),{startPause:r,endPause:n,calculateOffset:i,updateHeight:s}=o;return t.createElement(t.Fragment,null,t.createElement(Zc,{onMouseEnter:r,onMouseLeave:n},a.map(d=>t.createElement(Qc,{key:d.id,calculateOffset:i,updateHeight:s,...d}))),e)};Uo.displayName="ToastProvider";const Se=l(ot.Item,{bg:"white",color:"$tonal400",border:"1px solid $tonal200",cursor:"pointer","&::before":{background:"$tonal200"},"&:not([disabled])":{'&:hover, &:focus-visible, &[data-state="on"]':{"&::before":{background:"none"}},"&:hover":{borderColor:"currentColor !important",color:"$primaryMid"},"&:focus-visible":{...be(),'&[data-state="off"]':{borderColor:"$tonal200 !important"},'&[data-state="on"]':{boxShadow:`inset currentColor 0px 0px 0px 1px, ${be().boxShadow}`}}},"&[disabled]":{opacity:.3,cursor:"not-allowed"},'&[data-state="on"]':{color:"$primary",borderColor:"currentColor !important",boxShadow:"inset currentColor 0px 0px 0px 1px"}}),ed=Se,xt={sm:"32px",md:"40px",lg:"48px"},td={sm:"$4",md:"$5",lg:"$5"},ad={sm:"$2",md:"$3",lg:"$3"},fa=e=>({fontSize:`$${e}`,px:td[e],minHeight:xt[e],"& > *:not(:last-child)":{mr:ad[e]}}),od=l(Se,{flexGrow:1,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,lineHeight:1,py:"$1",[`& ${ka}`]:{flexShrink:0},variants:{size:{sm:fa("sm"),md:fa("md"),lg:fa("lg")},isIconOnly:{true:{}}},compoundVariants:[{isIconOnly:!0,size:"sm",css:{minWidth:xt.sm,p:0}},{isIconOnly:!0,size:"md",css:{minWidth:xt.md,p:0}},{isIconOnly:!0,size:"lg",css:{minWidth:xt.lg,p:0}}]}),rd=t.forwardRef(({size:e="md",children:a,...o},r)=>{var n;const i=t.Children.toArray(a),s=i.length<=1,d=s&&t.isValidElement(i[0])&&((n=i[0])==null?void 0:n.type)===b;return t.createElement(od,{ref:r,size:e,isIconOnly:d,...o},i.map(c=>!s&&(typeof c=="string"||typeof c=="number")?t.createElement("span",{key:c},c):t.isValidElement(c)&&(c==null?void 0:c.type)===b?t.cloneElement(c,{...c.props,size:e}):c))}),nd=l(ot.Root,{width:"fit-content",variants:{isFullWidth:{true:{width:"100%",[`& ${Se}`]:{flexBasis:0,flexGrow:1}}},hasGap:{true:{[`& ${Se}`]:{borderRadius:"$0"}},false:{borderRadius:"$0",bg:"white",[`& ${Se}`]:{bg:"transparent",borderRadius:0,position:"relative","&:not(:last-child)::before":{content:"",position:"absolute"}}}},direction:{column:{},row:{}}},compoundVariants:[{hasGap:!1,direction:"row",css:{[`& ${Se}`]:{"&:not(:last-child)::before":{top:"-1px",height:"calc(100% + 2px)",width:"1px",right:"0",transform:"translateX(150%)"},"&:not(:first-child)":{borderLeftColor:"transparent"},"&:not(:last-child)":{borderRightColor:"transparent"},"&:first-child":{borderTopLeftRadius:"$0",borderBottomLeftRadius:"$0"},"&:last-child":{borderTopRightRadius:"$0",borderBottomRightRadius:"$0"}}}},{hasGap:!1,direction:"column",css:{[`& ${Se}`]:{"&:not(:last-child)::before":{bottom:0,left:"-1px",height:"1px",width:"calc(100% + 2px)",transform:"translateY(150%)"},"&:first-child":{borderTopLeftRadius:"$0",borderTopRightRadius:"$0"},"&:last-child":{borderBottomLeftRadius:"$0",borderBottomRightRadius:"$0"},"&:not(:first-child)":{borderTopColor:"transparent"},"&:not(:last-child)":{borderBottomColor:"transparent"}}}}]}),id=e=>e==="horizontal"?"row":"column",ld=t.forwardRef(({orientation:e="horizontal",gap:a=!1,isFullWidth:o,children:r,wrap:n="no-wrap",...i},s)=>{const d=typeof a=="number",c=id(e);return t.createElement(nd,{ref:s,direction:c,hasGap:d,isFullWidth:o,orientation:e,...i},t.createElement(Le,{direction:c,gap:d&&a,align:!1,wrap:n},r))}),sd={Item:ed,Button:rd,Root:ld},cd=l(Rr.default,{}),Xo=t.forwardRef(({id:e,ratio:a=9/16,css:o,...r},n)=>t.createElement(Fe,{css:o},t.createElement(E,{css:{borderRadius:"$0",position:"relative",paddingTop:`${a*100}%`,overflow:"hidden",height:0,width:"100%"}},t.createElement(cd,{...r,role:"figure",url:`https://player.vimeo.com/video/${e}`,height:"100%",width:"100%",css:{position:"absolute",top:0,left:0},ref:n}))));Xo.displayName="Video",Object.defineProperty(exports,"toast",{enumerable:!0,get:function(){return Tr.default}}),exports.Accordion=Ge,exports.ActionIcon=M,exports.AlertDialog=G,exports.AlertProvider=Vn,exports.Avatar=We,exports.Badge=Wa,exports.Box=E,exports.Button=ne,exports.Carousel=ve,exports.Checkbox=ct,exports.CheckboxField=Ya,exports.Chip=de,exports.ChipDismissibleGroup=Xt,exports.ChipGroup=Yt,exports.ChipToggleGroup=Jt,exports.Combobox=xe,exports.DataTable=W,exports.DateField=uo,exports.DateInput=aa,exports.Dialog=ue,exports.Dismissible=gt,exports.DismissibleGroup=ye,exports.Divider=qt,exports.DropdownMenu=Ee,exports.EmptyState=Ke,exports.FieldWrapper=te,exports.FileInput=vo,exports.Flex=z,exports.Form=ja,exports.Grid=yo,exports.Heading=st,exports.Icon=b,exports.Image=Pe,exports.InlineFieldWrapper=ht,exports.InlineMessage=dt,exports.Input=we,exports.InputField=xo,exports.Label=Be,exports.Link=ut,exports.List=mt,exports.Loader=lt,exports.MarkdownContent=wo,exports.NavigationMenu=pe,exports.NotificationBadge=Os,exports.NumberInput=da,exports.NumberInputField=To,exports.PasswordField=Ro,exports.PasswordInput=ma,exports.Popover=le,exports.ProgressBar=Fo,exports.RadioButton=pt,exports.RadioButtonField=ua,exports.RadioButtonGroup=jt,exports.RadioCard=Mo,exports.RadioCardGroup=Xs,exports.SearchField=Ao,exports.SearchInput=ft,exports.Select=bt,exports.SelectField=Lo,exports.Sidedrawer=Z,exports.Slider=Ce,exports.SliderField=Bo,exports.Stack=Le,exports.StackContent=na,exports.Stepper=Qe,exports.StyledButton=Ra,exports.StyledLink=_a,exports.Switch=Ho,exports.Table=R,exports.Tabs=Ze,exports.Text=L,exports.Textarea=$a,exports.TextareaField=jo,exports.ToastProvider=Uo,exports.ToggleGroup=sd,exports.Tooltip=K,exports.TopBar=he,exports.Video=Xo,exports.createTheme=Ar,exports.createThemeVariants=zt,exports.css=Nr,exports.focusVisibleStyleBlock=be,exports.getCssText=Mr,exports.globalCss=Ca,exports.keyframes=D,exports.media=Dt,exports.styled=l,exports.theme=q,exports.useAlert=_n,exports.useCarousel=si,exports.useDataTable=J,exports.utils=kt;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ae=require("@radix-ui/react-accordion"),Y=require("react"),tr=require("@atom-learning/theme"),ya=require("@stitches/react"),v=require("@atom-learning/icons"),O=require("color2k"),Ct=require("@radix-ui/react-slot"),ar=require("invariant"),oe=require("@radix-ui/react-alert-dialog"),or=require("@radix-ui/react-visually-hidden"),rr=require("uid"),ge=require("pure-react-carousel"),nr=require("@radix-ui/react-checkbox"),H=require("react-hook-form"),ir=require("@radix-ui/react-radio-group"),lr=require("react-hook-form-persist"),sr=require("dlv"),cr=require("@radix-ui/react-toggle-group"),De=require("@reach/combobox"),se=require("@tanstack/react-table"),dr=require("use-deep-compare-effect"),et=require("throttle-debounce"),fe=require("@dnd-kit/core"),mr=require("@dnd-kit/modifiers"),qe=require("@dnd-kit/sortable"),ur=require("@dnd-kit/utilities"),ze=require("@radix-ui/react-tooltip"),pr=require("dayzed"),$e=require("@radix-ui/react-popover"),hr=require("dayjs"),gr=require("dayjs/plugin/customParseFormat"),q=require("@radix-ui/react-dialog"),Ie=require("@radix-ui/react-dropdown-menu"),fr=require("mdast-util-directive"),$r=require("mdast-util-from-markdown"),br=require("micromark-extension-directive"),vr=require("@radix-ui/react-navigation-menu"),yr=require("@radix-ui/react-progress"),tt=require("@radix-ui/react-slider"),xr=require("@radix-ui/react-switch"),at=require("@radix-ui/react-tabs"),St=require("react-hot-toast"),wr=require("react-player/vimeo");function U(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}function ee(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if(o!=="default"){var r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:function(){return e[o]}})}}),t.default=e,Object.freeze(t)}var a=ee(Y),u=U(Y),Er=ee(tr),Te=U(ar),kt=ee(or),xa=ee(nr),Re=ee(ir),Cr=U(lr),Sr=U(sr),ot=ee(cr),kr=U(dr),_e=U(hr),Dr=U(gr),zr=ee(q),Ir=U(fr),Tr=U($r),Rr=U(br),ce=ee(vr),wa=ee(yr),Ea=ee(xr),Fr=U(St),Nr=U(wr);const Dt={bg:e=>({background:e}),size:e=>({height:e,width:e}),p:e=>({padding:e}),pt:e=>({paddingTop:e}),pr:e=>({paddingRight:e}),pb:e=>({paddingBottom:e}),pl:e=>({paddingLeft:e}),px:e=>({paddingLeft:e,paddingRight:e}),py:e=>({paddingTop:e,paddingBottom:e}),m:e=>({margin:e}),mt:e=>({marginTop:e}),mr:e=>({marginRight:e}),mb:e=>({marginBottom:e}),ml:e=>({marginLeft:e}),mx:e=>({marginLeft:e,marginRight:e}),my:e=>({marginTop:e,marginBottom:e})},zt={sm:"(min-width: 550px)",md:"(min-width: 800px)",lg:"(min-width: 1100px)",xl:"(min-width: 1350px)",reducedMotion:"(prefers-reduced-motion)",allowMotion:"(prefers-reduced-motion: no-preference)",hover:"(hover: hover)"},Mr=ya.createStitches({theme:Er,utils:Dt,media:zt}),{css:Ar,getCssText:Lr,createTheme:Pr,globalCss:Ca,keyframes:D,styled:l,theme:_}=Mr,It=(e,t)=>Object.keys(_[e]).reduce((o,r)=>({...o,[r]:JSON.parse(JSON.stringify(t).replace(/\$key/g,`$${e}$${r}`))}),{}),w=l("div",{});w.displayName="Box";const Fe=({css:e,children:t})=>e?a.createElement(w,{css:e},t):a.createElement(a.Fragment,null,t);Fe.displayName="CSSWrapper";const Q=(e,t)=>({"&::before":{content:"''",mb:`-${e}em`,display:"table"},"&::after":{content:"''",mt:`-${t||e}em`,display:"table"}}),Wr={chevron:e=>`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" stroke="${e}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" color="${e}"><polyline points="6 10 12 16 18 10"/></svg>`,search:e=>`<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" stroke="${e}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none" color="${e}"><path d="M14.4121122,14.4121122 L20,20"></path><circle cx="10" cy="10" r="6"></circle></svg>`},Sa=(e,t)=>`url(data:image/svg+xml;charset=US-ASCII,${encodeURIComponent(Wr[t](O.toHex(e)))})`,be=({position:e="relative",zIndex:t=1}={})=>({outline:"none",position:["relative","absolute","fixed","sticky"].includes(e)?e:"relative",zIndex:t>1?t:1,boxShadow:"white 0px 0px 0px 2px, $colors$primary 0px 0px 0px 4px"}),Tt=D({"0%":{opacity:0,transform:"translateY(2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Rt=D({"0%":{opacity:0,transform:"translateX(-2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Ft=D({"0%":{opacity:0,transform:"translateY(-2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Nt=D({"0%":{opacity:0,transform:"translateX(2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Mt=D({"0%":{opacity:0},"100%":{opacity:1}}),rt=D({"0%":{opacity:1},"100%":{opacity:0}}),Br=D({"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(0)"}}),Or=D({"0%":{transform:"translateX(0)"},"100%":{transform:"translateX(-100%)"}}),Hr=D({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Vr=D({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),qr=l(ae.Content,{border:0,width:"100%",bg:"$background",overflow:"hidden",'&[data-state="open"]':{borderRadius:"0 0 $0 $0"},"@allowMotion":{'&[data-state="open"]':{animation:`${Hr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Vr} 300ms ease-out`}}}),_r=({children:e,css:t,...o})=>u.default.createElement(qr,{...o},u.default.createElement(Fe,{css:t},e)),Gr=l(ae.Item,{width:"100%","&:not(:last-child)":{mb:"$1"}}),jr=({children:e,value:t,...o})=>u.default.createElement(Gr,{value:t,...o},e),ka=l("svg",{display:"inline-block",fill:"none",stroke:"currentcolor",strokeLinecap:"round",strokeLinejoin:"round",verticalAlign:"middle",variants:{size:{sm:{size:"$1",strokeWidth:"1.5"},md:{size:"$2",strokeWidth:"1.75"},lg:{size:"$3",strokeWidth:"2"}}}}),b=a.forwardRef(({is:e,size:t="md",...o},r)=>a.createElement(ka,{size:t,"aria-hidden":"true",...o,as:e,ref:r}));var Yr="#F3F8FF",Ur="#E5F1FF",Xr="#D6EAFF",Jr="#C2DEFF",Kr="#B3D4FA",Qr="#057AFF",Zr="#0F67F5",en="#194DCC",tn="#102DA3",an="#15235E",Da={blue1:Yr,blue2:Ur,blue3:Xr,blue4:Jr,blue5:Kr,blue6:Qr,blue7:Zr,blue8:en,blue9:tn,blue10:an},on="#F6F6F6",rn="#EBEBEB",nn="#E0E0E0",ln="#CECECE",sn="#C2C2C2",cn="#757575",dn="#545454",mn="#333333",un="#1F1F1F",pn="#1C1C1C",At={slate1:on,slate2:rn,slate3:nn,slate4:ln,slate5:sn,slate6:cn,slate7:dn,slate8:mn,slate9:un,slate10:pn};const hn=[255,255,255,1],nt=[.05,.1,.15,.2,.27,.35,.5,.7,.8,.95],Lt=e=>Math.round(Math.max(Math.min(e,255),0)),za=(e,t)=>{const o={};return Object.entries(t).forEach(([r,n],i)=>{const[s,c,d]=O.parseToRgba(n),[m,p,h]=hn,g=[Lt((s-m)/nt[i]+m),Lt((c-p)/nt[i]+p),Lt((d-h)/nt[i]+h),nt[i]];o[`${e}A${i+1}`]=`rgba(${g.join(",")})`}),o},re={},Ia=(e,t)=>{const o={};for(let r=1;r<=10;r++)o[`${e}${r}`]=`$${t}${r}`,o[`${e}A${r}`]=`$${t}A${r}`;return o},{styled:gn,createTheme:Ne}=ya.createStitches({theme:{colors:{background:"white",foreground:At.slate9,foreground6plus:"white",...Da,...za("blue",Da),...At,...za("slate",At)}},utils:Dt,media:zt});re["interactive-loContrast1"]=Ne("interactive-loContrast1",{colors:{interactiveForeground:"$foreground",interactive1:"white",interactive2:"$accent1",interactive3:"$accent2"}}),re["interactive-loContrast2"]=Ne("interactive-loContrast2",{colors:{interactiveForeground:"$foreground",interactive1:"$accent1",interactive2:"$accent2",interactive3:"$accent3"}}),re["interactive-hiContrast1"]=Ne("interactive-hiContrast1",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent7",interactive2:"$accent8",interactive3:"$accent9"}}),re["interactive-hiContrast2"]=Ne("interactive-hiContrast2",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent8",interactive2:"$accent9",interactive3:"$accent10"}});const fn={slate:"slate"},$n=()=>{Object.entries(fn).forEach(([e,t])=>{const o=`base-${e}`;re[o]=Ne(o,{colors:Ia("base",t)})})},bn={slate:"slate",blue:"blue"},vn=()=>{Object.entries(bn).forEach(([e,t])=>{const o=`accent-${e}`;re[o]=Ne(o,{colors:Ia("accent",t)})})};$n(),vn();const yn=gn("div"),Pt=a.forwardRef(({base:e="",accent:t="",interactive:o="",className:r,asChild:n=!1,...i},s)=>{const c=[r,re[`interactive-${o}`],re[`accent-${t}`],re[`base-${e}`]].filter(Boolean).join(" ");return a.createElement(n?Ct.Slot:yn,{ref:s,className:c,...i})});Pt.displayName="ColorScheme";const xn=l(b,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"},'[data-state="closed"] > &':{transform:"rotate(0deg)"}}),wn=l(ae.Trigger,{border:0,py:"$3",px:"$4",width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",bg:"$interactive2",color:"$interactiveForeground","&[data-disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([data-disabled])":{"&:active, &:hover, &:focus-visible":{bg:"$interactive3"},"&:focus-visible":{...be()}},'&[data-state="open"]':{borderRadius:"$0 $0 0 0"},'&[data-state="closed"]':{borderRadius:"$0"}}),En=({children:e,colorScheme:t={},...o})=>u.default.createElement(Pt,{asChild:!0,accent:"slate",interactive:"loContrast1",...t},u.default.createElement(wn,{...o},e,u.default.createElement(xn,{is:v.ChevronDown}))),Cn=l(ae.Root,{width:"100%"}),Ge=u.default.forwardRef(({type:e="single",children:t,...o},r)=>u.default.createElement(Cn,{ref:r,type:e,...o},t));Ge.Item=jr,Ge.Content=_r,Ge.Trigger=En,Ge.displayName="Accordion";const Sn={xs:"sm",sm:"sm",md:"md",lg:"lg"},Me=(e,t,o)=>({bg:"transparent",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:t},"&:not(:disabled):active":{color:o},"&[disabled]":{color:"$tonal400",cursor:"not-allowed"}}),je=(e,t,o)=>({bg:e,color:"white","&:not(:disabled):hover, &:not(:disabled):focus":{bg:t,color:"white"},"&:not(:disabled):active":{bg:o},"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"}}),Ye=(e,t,o)=>({border:"1px solid",borderColor:"currentColor",color:e,"&:not(:disabled):hover, &:not(:disabled):focus":{color:t},"&:not(:disabled):active":{color:o},"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"}}),kn=l("button",{alignItems:"center",appearance:"none",bg:"white",border:"unset",borderRadius:"$0",boxSizing:"border-box",cursor:"pointer",display:"flex",justifyContent:"center",p:"unset",transition:"all 100ms ease-out",variants:{theme:{neutral:{},primary:{},success:{},warning:{},danger:{}},appearance:{simple:{},outline:{},solid:{}},size:{xs:{size:"$2"},sm:{size:"$3"},md:{size:"$4"},lg:{size:"$5"}},isRounded:{true:{borderRadius:"$round"}}},compoundVariants:[{theme:"neutral",appearance:"simple",css:Me("$tonal300","$primaryMid","$primaryDark")},{theme:"primary",appearance:"simple",css:Me("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"simple",css:Me("$primaryDark",O.darken(_.colors.primaryDark.value,.1),O.darken(_.colors.primaryDark.value,.15))},{theme:"success",appearance:"simple",css:Me("$success","$successMid","$successDark")},{theme:"warning",appearance:"simple",css:Me("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"simple",css:Me("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"solid",css:je("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"solid",css:je("$primaryDark",O.darken(_.colors.primaryDark.value,.1),O.darken(_.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:je("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:je("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"solid",css:je("$danger","$dangerMid","$dangerDark")},{theme:"primary",appearance:"outline",css:Ye("$primary","$primaryMid","$primaryDark")},{theme:"primaryDark",appearance:"outline",css:Ye("$primaryDark",O.darken(_.colors.primaryDark.value,.1),O.darken(_.colors.primaryDark.value,.15))},{theme:"success",appearance:"outline",css:Ye("$success","$successMid","$successDark")},{theme:"warning",appearance:"outline",css:Ye("$warning","$warningMid","$warningDark")},{theme:"danger",appearance:"outline",css:Ye("$danger","$dangerMid","$dangerDark")}]}),M=a.forwardRef(({children:e,theme:t="primary",appearance:o="simple",size:r="sm",label:n,href:i,disabled:s,...c},d)=>{const m=`A single ${b.displayName} component is permitted as a child of ${M.displayName}`;return Te.default(a.Children.count(e)===1,m),a.createElement(kn,{...c,...i?{as:"a",href:s?null:i,onClick:void 0,"aria-disabled":!!s}:{type:"button"},"aria-label":n,theme:t,appearance:o,size:r,ref:d,disabled:s},a.Children.map(e,p=>{if(!a.isValidElement(p))throw new Error(m);return Te.default(p.type===b,`Children of type ${p==null?void 0:p.type} aren't permitted. Only an ${b.displayName} component is allowed in ${M.displayName}`),a.cloneElement(p,{size:Sn[r],css:{...p.props.css?p.props.css:{}}})}))});M.displayName="ActionIcon";const it=2147483647,Ue=1147483646,Dn=10,zn=10,In=10,Wt="translate3d(-50%, -50%, 0)",Ta="translate3d(-50%, 50vh, 0)",Tn=D({"0%":{transform:Ta},"100%":{transform:Wt}}),Rn=D({"0%":{transform:Wt},"100%":{transform:Ta}}),Fn=l(oe.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${Mt} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),Nn=l(oe.Content,{bg:"white",borderRadius:"$1",boxShadow:"$3",boxSizing:"border-box",left:"50%",maxWidth:"90vw",p:"$5",position:"fixed",top:"50%",transform:Wt,"&:focus":{outline:"none"},zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${Tn} 550ms cubic-bezier(0.22, 1, 0.36, 1)`},'&[data-state="closed"]':{animation:`${Rn} 550ms cubic-bezier(0.22, 1, 0.36, 1)`}},variants:{size:{sm:{width:"380px"},md:{width:"480px"},lg:{width:"600px"}}}}),Mn=({size:e="sm",...t})=>a.createElement(oe.Portal,null,a.createElement(Fn,null),a.createElement(Nn,{size:e,...t})),An=l(oe.Root,{}),G=e=>a.createElement(An,{...e});G.Description=oe.Description,G.Title=oe.Title,G.Action=oe.Action,G.Cancel=oe.Cancel,G.Content=Mn,G.Trigger=oe.Trigger,G.displayName="AlertDialog";const Ln=()=>{const e=Y.useRef();return Y.useEffect(()=>(e.current=!0,()=>{e.current=!1})),e},z=l("div",{display:"flex"});z.displayName="Flex";const Pn=D({"0%":{opacity:0},"30%":{opacity:1},"50%":{opacity:1},"80%":{opacity:0},"100%":{opacity:0}}),Bt=l("div",{animationName:`${Pn}`,animationDuration:"1s",animationFillMode:"both",animationIterationCount:"infinite",animationTimingFunction:"linear",backgroundColor:"currentColor",borderRadius:"$round","&:nth-child(1)":{animationDelay:"-300ms"},"&:nth-child(2)":{animationDelay:"-150ms"},"&:nth-child(3)":{animationDelay:0},variants:{size:{sm:{size:"4px",mx:"2px"},md:{size:"6px",mx:"2px"},lg:{size:"8px",mx:"3px"}}}}),lt=({css:e={},message:t="Loading",size:o="md",...r})=>a.createElement(z,{css:{justifyContent:"center",...e},role:"alert",...r},a.createElement(kt.Root,null,t),a.createElement(Bt,{size:o}),a.createElement(Bt,{size:o}),a.createElement(Bt,{size:o})),Ot=(e,t,o)=>({border:"1px solid",borderColor:"currentColor",color:e,"&[disabled]":{borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{textDecoration:"none",color:t},"&:not([disabled]):active":{color:o}}),Ae=(e,t,o,r="white")=>({bg:e,color:r,"&[disabled]":{bg:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&:not([disabled]):hover, &:not([disabled]):focus":{bg:t,color:r},"&:not([disabled]):active":{bg:o}}),Ra=l("button",{alignItems:"center",bg:"unset",border:"unset",borderRadius:"$0",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:600,justifyContent:"center",p:"unset",textDecoration:"none",transition:"all 100ms ease-out",whiteSpace:"nowrap",width:"max-content",variants:{theme:{primary:{},secondary:{},success:{},warning:{},danger:{},neutral:{}},appearance:{solid:{},outline:{}},size:{sm:{fontSize:"$sm",lineHeight:1.53,height:"$3",px:"$4"},md:{fontSize:"$md",lineHeight:1.5,height:"$4",px:"$5"},lg:{fontSize:"$lg",lineHeight:1.5,height:"$5",px:"$5"}},isLoading:{true:{cursor:"not-allowed",opacity:.6,pointerEvents:"none"}},fullWidth:{false:{width:"max-content"},true:{width:"100%"}}},compoundVariants:[{theme:"primary",appearance:"solid",css:Ae("$primary","$primaryMid","$primaryDark")},{theme:"secondary",appearance:"solid",css:Ae("$primaryDark",O.darken(_.colors.primaryDark.value,.1),O.darken(_.colors.primaryDark.value,.15))},{theme:"success",appearance:"solid",css:Ae("$success","$successMid","$successDark")},{theme:"warning",appearance:"solid",css:Ae("$warning","$warningMid","$warningDark","$tonal500")},{theme:"danger",appearance:"solid",css:Ae("$danger","$dangerMid","$dangerDark")},{theme:"neutral",appearance:"solid",css:Ae("white",O.opacify("white",-.1),O.opacify("white",-.25),"$primary")},{theme:"primary",appearance:"outline",css:Ot("$primary","$primaryMid","$primaryDark")},{theme:"neutral",appearance:"outline",css:Ot("white",O.opacify("white",-.2),O.opacify("white",-.35))},{theme:"secondary",appearance:"outline",css:Ot("$primaryDark",O.darken(_.colors.primaryDark.value,.1),O.darken(_.colors.primaryDark.value,.15))}]}),Wn=({isLoading:e,children:t})=>a.createElement(a.Fragment,null,a.createElement(lt,{css:{opacity:e?1:0,position:"absolute",transition:"opacity 150ms"}}),a.createElement(w,{as:"span",css:e?{opacity:0,transition:"opacity 150ms"}:{}},t)),Bn=e=>{switch(e){case"lg":return 22;case"md":return 20;case"sm":default:return 16}},Fa=(e,t)=>a.Children.map(e,(o,r)=>(o==null?void 0:o.type)===b?a.cloneElement(o,{css:{[r===0?"mr":"ml"]:t==="sm"?"$2":"$3",size:Bn(t),...o.props.css?o.props.css:{}}}):o),ne=a.forwardRef(({children:e,isLoading:t,onClick:o,href:r,appearance:n="solid",size:i="md",theme:s="primary",type:c="button",...d},m)=>a.createElement(Ra,{isLoading:t||!1,onClick:t?void 0:o,appearance:n,size:i,theme:s,...d,...r?{as:"a",href:r,onClick:void 0}:{},...r?{}:{type:c},ref:m},typeof t=="boolean"?a.createElement(Wn,{isLoading:t},Fa(e,i)):Fa(e,i)));ne.displayName="Button";const Ht=l("h2",{fontFamily:"$display",fontWeight:700,m:0,variants:{size:{xs:{fontFamily:"$body",fontWeight:600,fontSize:"$md",lineHeight:1.5,...Q(.3864)},sm:{fontSize:"$lg",lineHeight:1.14,...Q(.2174,.2254)},md:{fontSize:"$xl",lineHeight:1.14,...Q(.2174,.2254)},lg:{fontSize:"$2xl",lineHeight:1.08,...Q(.1865,.1945)},xl:{fontSize:"$3xl",lineHeight:1.12,...Q(.206,.214)},xxl:{fontSize:"$4xl",lineHeight:1.06,...Q(.1793,.1873)}},noCapsize:{true:{"&::before, &::after":{display:"none"}}}}}),st=a.forwardRef(({size:e="md",...t},o)=>a.createElement(Ht,{ref:o,size:e,...t}));st.displayName="Heading";const On=l("div",{display:"flex","& > *":{m:0},variants:{direction:{row:{flexDirection:"row"},"row-reverse":{flexDirection:"row-reverse"},column:{flexDirection:"column"}},wrap:{wrap:{flexWrap:"wrap"},"no-wrap":{flexWrap:"no-wrap"},"wrap-reverse":{flexWrap:"wrap-reverse"}},justify:{start:{justifyContent:"flex-start"},center:{justifyContent:"center"},end:{justifyContent:"flex-end"},false:{}},align:{start:{alignItems:"flex-start"},center:{alignItems:"center"},end:{alignItems:"flex-end"},false:{}},gap:{...It("space",{mt:"-$key",ml:"-$key","& > *":{mt:"$key",ml:"$key"}}),false:{}}}}),Le=a.forwardRef(({css:e,gap:t=2,direction:o="row",wrap:r="wrap",justify:n="start",align:i,...s},c)=>a.createElement(Fe,{css:e},a.createElement(On,{ref:c,direction:o,gap:t,wrap:r,justify:n,align:typeof i>"u"&&o!=="column"?"center":i,...s})));Le.displayName="Stack";const Xe={size:{xs:{fontSize:"$xs",lineHeight:1.6,...Q(.4364)},sm:{fontSize:"$sm",lineHeight:1.53,...Q(.4056)},md:{fontSize:"$md",lineHeight:1.5,...Q(.3864)},lg:{fontSize:"$lg",lineHeight:1.52,...Q(.3983)},xl:{fontSize:"$xl",lineHeight:1.42,...Q(.3506)}},noCapsize:{true:{"&::before, &::after":{display:"none"}}}},Je=({size:e,noCapsize:t})=>({...Xe.size[e],...Xe.noCapsize[`${t}`]}),Vt=l("p",{fontFamily:"$body",fontWeight:400,margin:0,"& > &":{"&:before, &:after":{display:"none"}},variants:Xe}),L=a.forwardRef(({size:e="md",...t},o)=>a.createElement(Vt,{size:e,...t,ref:o}));L.displayName="Text";const Hn=({title:e,description:t,onAction:o,cancelActionText:r,confirmActionText:n,onClose:i,...s})=>a.createElement(G,{defaultOpen:!0},a.createElement(G.Content,{onEscapeKeyDown:c=>c.preventDefault(),onCloseAutoFocus:i,...s},a.createElement(st,{as:G.Title,size:"sm",css:{mb:"$5"}},e),t&&a.createElement(L,{as:G.Description,css:{mb:"$5"}},t),a.createElement(Le,{gap:"2",justify:"end"},r&&a.createElement(ne,{appearance:"outline",as:G.Cancel,onClick:()=>o(!1),size:"sm"},r),a.createElement(ne,{as:G.Action,onClick:()=>o(!0),size:"sm"},n)))),Vn=[],qn=(e,t)=>{switch(t.type){case"ADD":return[...e,{...t.payload,id:rr.uid()}];case"REMOVE":return e.filter(({id:o})=>o!==t.payload);default:return e}},Na=a.createContext({showAlert:()=>null}),_n=({children:e})=>{const[t,o]=a.useReducer(qn,Vn),r=Ln();return a.createElement(Na.Provider,{value:{showAlert:n=>o({payload:n,type:"ADD"})}},Boolean(t.length)&&a.createElement(Hn,{...t[0],key:t[0].id,onClose:()=>{r.current&&o({payload:t[0].id,type:"REMOVE"})}}),e)},Gn=()=>{const e=a.useContext(Na);if(e===void 0)throw new Error("useAlert must be used within a AlertProvider");return e},qt=(e,t)=>{let o;switch(typeof e){case"object":o={},Object.keys(e).forEach(r=>{const n=e[r];o[r]=n&&t(n)});break;default:o=t(e)}return o},jn={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg",xxl:"lg"},Yn=({is:e})=>{const t=a.useContext(_t),{size:o}=t,r=a.useMemo(()=>qt(o,n=>jn[n]),[o]);return a.createElement(b,{size:r,is:e})},Ma=l("img",{verticalAlign:"middle",maxWidth:"100%",variants:{fluid:{true:{"&[width]":{width:"auto"},"&[width][height]":{height:"auto"},'&[src$=".svg"]':{width:"100%",height:"auto",maxWidth:"none"}}}}}),Pe=Ma;Pe.displayName="Image";const Aa=()=>a.createElement(w,{css:{position:"relative",size:"100%"}},a.createElement(b,{is:v.User,css:{size:"100%"}})),Un={xs:"xs",sm:"sm",md:"sm",lg:"md",xl:"md",xxl:"lg"},La=()=>{const e=a.useContext(_t),{name:t,size:o}=e,r=a.useMemo(()=>qt(o,n=>Un[n]),[o]);return t?a.createElement(L,{size:r,css:{color:"$tonal400"}},t[0].toUpperCase()):a.createElement(Aa,null)},Xn=l(Pe,{size:"100%",objectFit:"cover"}),Jn=({src:e,alt:t})=>e?a.createElement(Xn,{src:e,alt:t}):a.createElement(La,null),Pa={display:"flex",justifyContent:"center",alignItems:"center",color:"$tonal400",borderRadius:"$round",border:"2px solid $tonal100",backgroundColor:"$white",overflow:"hidden",variants:{size:{xs:{size:"$2"},sm:{size:"$3"},md:{size:"$4"},lg:{size:"$5"},xl:{size:"$6"},xxl:{size:"$7"}}}},Kn=l("div",Pa),Qn=l("button",{all:"unset",...Pa,"&:not([disabled])":{"&:hover":{borderColor:"$tonal400",backgroundColor:"$tonal50"},"&:active":{borderColor:"$primary",backgroundColor:"$tonal100"},"&:focus-visible":be()},"&[disabled]":{opacity:"30%",cursor:"not-allowed"}}),_t=a.createContext({name:void 0,size:"lg"}),Zn=({children:e,name:t,size:o})=>{const r=a.useMemo(()=>({name:t,size:o}),[t,o]);return a.createElement(_t.Provider,{value:r},e)},ei=({children:e,size:t="lg",name:o,disabled:r=!1,onClick:n})=>a.createElement(Zn,{name:o,size:t},n?a.createElement(Qn,{size:t,disabled:r,onClick:r?void 0:n,css:{cursor:r?"auto":"pointer"}},e):a.createElement(Kn,{size:t},e)),We=ei;We.Image=Jn,We.Initial=La,We.Placeholder=Aa,We.Icon=Yn,We.displayName="Avatar";const ti=l(z,{justifyContent:"center",alignItems:"center",borderRadius:"$0",minWidth:0,border:"1px solid #FFFFFF",fontFamily:"$body","& > *:not(:last-child)":{mr:"$1"},variants:{theme:{success:{bg:"$successLight",color:"$successMid"},warning:{bg:"$warningLight",color:"$warningText"},danger:{bg:"$dangerLight",color:"$dangerMid"},neutral:{bg:"$tonal50",color:"$tonal400"},info:{bg:"$primaryLight",color:"$primaryMid"}},size:{xs:{fontSize:"$sm",px:"$1",height:"$2"},sm:{fontSize:"$md",px:"$1",height:"$3"},md:{fontSize:"$md",px:"$2",height:"$4"}}}}),Wa=({theme:e="info",size:t="sm",children:o,...r})=>a.createElement(ti,{role:"status",theme:e,size:t,...r},a.Children.map(o,n=>{if(typeof n=="string"||typeof n=="number")return a.createElement(w,{css:{whiteSpace:"nowrap",overflowX:"hidden",textOverflow:"ellipsis",py:"$0"}},n);if(a.isValidElement(n)&&n.type===b)return a.cloneElement(n,{size:"sm",css:{...n.props.css,flexShrink:0}})}));Wa.displayName="Badge";const Ba={alignItems:"center",bg:"unset",border:"unset",color:"$primary",cursor:"pointer",display:"flex",justifyContent:"center",p:"unset",size:"$5",top:"50%",transform:"translateY(-50%)",transition:"color 0.15s ease-in-out","&:hover":{color:"$primaryMid"},"&:active":{color:"$primaryDark"},"&:disabled":{color:"$tonal100"}},ai=l(ge.ButtonBack,Ba),oi=l(ge.ButtonNext,Ba),ri=e=>a.createElement(ai,{...e},a.createElement(b,{is:v.ChevronLeft})),ni=e=>a.createElement(oi,{...e},a.createElement(b,{is:v.ChevronRight})),ii=l(ge.DotGroup,{justifyContent:"center","& button":{bg:"$tonal200",border:"none",borderRadius:"50%",cursor:"pointer",mx:"$1",p:"$1",size:"$space$3",transition:"all 100ms ease-in",'&[class*="selected"]':{bg:"$primary"},"&:hover, &:focus":{bg:"$primaryMid"}}}),li=l(ge.Slide,{}),si=({children:e,...t})=>a.createElement(li,{...t,tag:"div"},a.createElement(w,{css:{px:"$3"}},e)),ci=l(ge.Slider,{cursor:"grab",ml:"50%",overflow:"hidden",transform:"translateX(-50%)",'& [class*="sliderTray_"]':{p:"unset",m:"unset",transition:"transform .5s cubic-bezier(.645,.045,.355,1)"},'& [class*="slide_"]':{float:"left",pb:"0 !important"},'& [class*="slideInner"]':{display:"flex",justifyContent:"center"},variants:{overflow:{true:{overflow:"visible"}}}}),ve=({children:e,css:t,slideHeight:o,slideWidth:r,numSlides:n,...i})=>a.createElement(Fe,{css:t},a.createElement(ge.CarouselProvider,{naturalSlideWidth:r,naturalSlideHeight:o,totalSlides:n,...i},e)),di=()=>a.useContext(ge.CarouselContext);ve.ArrowNext=ni,ve.ArrowPrevious=ri,ve.Pagination=ii,ve.Slide=si,ve.Slider=ci,ve.displayName="Carousel";const mi=l(xa.Indicator,{display:"flex",alignItems:"center",justifyContent:"center"}),ui=l(xa.Root,{appearance:"none",backgroundColor:"transparent",border:"1px solid $colors$tonal400",borderRadius:"3px",color:"white",cursor:"pointer",size:"$1",p:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 50ms ease-out",'&[data-state="checked"]':{backgroundColor:"$primary",borderColor:"$primary"},'&[data-state="indeterminate"]':{backgroundColor:"$primary",borderColor:"$primary"},"&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},"&[disabled]":{backgroundColor:"$tonal100",borderColor:"$tonal400",cursor:"not-allowed",color:"$tonal400"},variants:{state:{error:{borderColor:"$danger"}}}}),ct=a.forwardRef((e,t)=>a.createElement(ui,{...e,ref:t},a.createElement(mi,null,a.createElement(b,{is:e.checked==="indeterminate"?v.Minus:v.Ok,css:{pointerEvents:"none",position:"absolute",strokeWidth:"3",size:14}}))));ct.displayName="Checkbox";const pi={success:{color:"$success"},warning:{color:"$warningText","& svg":{color:"$warningDark"}},info:{color:"$primary"},neutral:{color:"$tonal400"},error:{color:"$danger"}},hi={success:v.OkCircle,warning:v.Danger,info:v.Info,neutral:v.Info,error:v.Error},gi=l(z,{variants:{theme:pi}}),fi=l(b,{flexShrink:"0",mr:"$2"}),dt=({css:e,showIcon:t=!0,theme:o="error",size:r="sm",children:n,...i})=>a.createElement(gi,{theme:o,css:e,...i},t&&a.createElement(fi,{size:"sm",is:hi[o]}),a.createElement(L,{as:"span",size:r,css:{transform:"translateY($space$0)"}},n)),$i=l("label",{color:"$tonal500",fontFamily:"$body",m:0,variants:{size:{sm:Je({size:"sm"}),md:Je({size:"md"})},type:{block:{display:"block",fontWeight:600},inline:{display:"flex",fontWeight:400,maxWidth:"max-content"}},align:{start:{},center:{}},direction:{reverse:{},row:{}}},compoundVariants:[{type:"inline",align:"start",css:{alignItems:"flex-start"}},{type:"inline",align:"center",css:{alignItems:"center"}},{type:"inline",direction:"reverse",css:{flexDirection:"row-reverse"}},{type:"inline",direction:"row",css:{flexDirection:"row"}}]}),bi=l("span",{color:"$danger",ml:"$1",fontWeight:400}),Be=({align:e="start",as:t="label",direction:o="row",size:r="md",type:n="block",children:i,required:s,...c})=>a.createElement($i,{as:t,size:r,type:n,align:e,direction:o,...c},i,s&&a.createElement(bi,{"aria-hidden":!0},"*"));Be.displayName="Label";const Oe=l("li",{}),Oa=l("ul",{fontFamily:"$body",m:"unset",p:"unset",[`& > ${Oe}`]:{"&:not(:last-child)":{mb:"$2"},"&:last-child":{mb:0}},variants:{...Xe,as:{ol:{pl:"$4",listStyle:"decimal",[`& > ${Oe}`]:{pl:"$1","&::marker":{fontSize:"$sm",fontWeight:"bold"}}},ul:{pl:"$3",[`& > ${Oe}`]:{pl:"$2","&::marker":{content:"\u2022",fontWeight:"bold"}}}},theme:{primary:{[`& > ${Oe}`]:{"&::marker":{color:"$primary"}}}}}}),mt=a.forwardRef(({size:e="md",noCapsize:t=!0,ordered:o,...r},n)=>a.createElement(Oa,{ref:n,as:o?"ol":"ul",size:e,noCapsize:t,...r}));mt.Item=Oe;const vi=l(w,{bg:"$tonal100",borderRadius:"$1",color:"$tonal600",fontFamily:"$mono",fontSize:"$sm",lineHeight:1.4,my:"$4",p:"$3"}),yi=({node:e})=>a.createElement(vi,{as:"pre"},e.value),Ha=l("em",{fontStyle:"italic"}),xi=({node:e,handleNode:t})=>{var o;return a.createElement(Ha,null,(o=e.children)==null?void 0:o.map(t))},wi=e=>{switch(e){case 1:return{size:"xl",as:"h1"};case 2:return{size:"lg",as:"h2"};case 3:return{size:"md",as:"h3"};case 4:return{size:"sm",as:"h4"};case 5:return{size:"xs",as:"h5"};default:return{size:"xs",as:"h6"}}},Ei=({node:e,handleNode:t,...o})=>{var r;const{as:n,size:i}=wi(e.depth);return a.createElement(st,{as:n,size:i,...o},(r=e.children)==null?void 0:r.map(t))},Ci=l(w,{bg:"$tonal100",borderRadius:"$0",color:"$tonal600",display:"inline-block",fontFamily:"$mono",fontSize:"85%",p:"$0 $1"}),Si=({node:e})=>a.createElement(Ci,{as:"code"},e.value),ki=({node:e,css:t})=>{var o;return a.createElement(Pe,{src:e.url,alt:(o=e.alt)!=null?o:void 0,css:t})},Di=({node:e,handleNode:t})=>{var o,r;return a.createElement(ut,{title:(o=e.title)!=null?o:void 0,href:e.url},(r=e.children)==null?void 0:r.map(t))},zi=({node:e,handleNode:t,css:o})=>{var r;return a.createElement(mt,{css:{"& p:before, & p:after":{display:"none"},...o},ordered:e.ordered||void 0},(r=e.children)==null?void 0:r.map(t))},Ii=({node:e,handleNode:t})=>{var o;return a.createElement(mt.Item,null,(o=e.children)==null?void 0:o.map(t))},Ti=({node:e,handleNode:t,...o})=>{var r;return a.createElement(L,{...o},(r=e.children)==null?void 0:r.map(t))},Ri=l("strong",{fontWeight:600}),Fi=({node:e,handleNode:t})=>{var o;return a.createElement(Ri,null,(o=e.children)==null?void 0:o.map(t))},Ni=({node:e})=>e.value,Va=l("hr",{border:0,bg:"$tonal100",variants:{orientation:{horizontal:{height:1,width:"100%"},vertical:{height:"100%",width:1,minHeight:"$3"}}}}),Gt=u.default.forwardRef(({orientation:e="horizontal",...t},o)=>u.default.createElement(Va,{ref:o,orientation:e,...t})),Mi=({css:e})=>a.createElement(Gt,{css:{width:"100%",...e}}),qa=l("a",{bg:"unset",border:"unset",p:"unset",color:"$primary",cursor:"pointer",fontFamily:"$body",textDecoration:"none","&:focus, &:hover":{color:"$primaryMid",textDecoration:"underline"},"&:active":{color:"$primaryDark"},[`${Vt} > &, ${Ht} > &, ${Oe} > &, ${Ha} > &`]:{fontSize:"100%",lineHeight:1,"&::before, &::after":{content:"none"}},variants:Xe}),ut=a.forwardRef(({size:e="md",href:t,...o},r)=>a.createElement(qa,{...!t&&{as:"button",noCapsize:!0},size:e,href:t,...o,ref:r}));ut.displayName="Link";const jt=({children:e,css:t})=>a.createElement(L,{size:"sm",css:{color:"$tonal300",maxWidth:"80ch",...t}},e),te=({css:e,children:t,error:o,fieldId:r,label:n,prompt:i,description:s,required:c,hideLabel:d})=>{const m=d?kt.Root:z;return a.createElement(w,{css:e},a.createElement(m,{css:{justifyContent:"space-between",alignItems:"center",mb:"$3"}},a.createElement(Be,{htmlFor:r,required:c},n),i&&a.createElement(ut,{href:i.link,size:"sm"},i.label)),s&&a.createElement(jt,{css:{mb:"$3"}},s),t,o&&a.createElement(dt,{css:{mt:"$2"}},o))};te.displayName="FieldWrapper";const Ai=l(Re.Item,{alignItems:"center",appearance:"none",backgroundColor:"transparent",border:"1px solid $tonal400",borderRadius:"$round",color:"white",cursor:"pointer",display:"flex",justifyContent:"center",p:0,size:"$1",transition:"all 50ms ease-out","&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},'&[data-state="checked"]':{backgroundColor:"$primary",borderColor:"$primary"},"&[disabled]":{backgroundColor:"$tonal100",borderColor:"$tonal400",color:"$tonal400",cursor:"not-allowed"}}),Li=l(Re.Indicator,{size:"6px",borderRadius:"$round",backgroundColor:"currentcolor",position:"absolute"}),pt=e=>a.createElement(Ai,{...e},a.createElement(Li,null));pt.displayName="RadioButton";const Yt=l(Re.Root,{display:"flex",flexWrap:"wrap",variants:{direction:{row:{flexDirection:"row","& > *:not(:last-child)":{mr:"$5"}},column:{flexDirection:"column"}}}});Yt.displayName="RadioButtonGroup";const ht=({align:e="start",children:t,css:o,description:r,direction:n="row",error:i,label:s,required:c})=>a.createElement(w,{css:o},a.createElement(Be,{align:e,direction:n,required:c,type:"inline"},a.Children.map(t,d=>a.createElement(w,{css:{[n==="reverse"?"ml":"mr"]:"$3",...((d==null?void 0:d.type)===ct||(d==null?void 0:d.type)===pt)&&{transform:"translateY($space$1)"}}},d)),s),i&&a.createElement(dt,{css:{mt:"$2"}},i),r&&a.createElement(jt,{css:{mt:"$2",[n==="reverse"?"mr":"ml"]:"calc($space$3 + $sizes$1)"}},r));ht.displayName="InlineFieldWrapper";var _a=(e=>(e.LOCAL="local",e.SESSION="session",e))(_a||{});const Pi=l("form",{}),Wi=({persist:e,watch:t,setValue:o,children:r})=>{const{id:n,...i}=e;let s={...i,storage:i.storage===_a.LOCAL?window.localStorage:window.sessionStorage};if(i.exclude){const{exclude:c,...d}=s,m=t(),p=Object.keys(m).filter(h=>{var g;if(!((g=i.exclude)!=null&&g.includes(h)))return h});s={...d,include:p}}return Cr.default(n,{watch:t,setValue:o},s),r},Ga=({formMethods:e,handleSubmit:t,onSubmit:o,onError:r,children:n,...i})=>a.createElement(H.FormProvider,{...e},a.createElement(Pi,{"aria-label":"form",...i,onSubmit:t(o,r)},n)),ja=({children:e,defaultValues:t={},onSubmit:o,onError:r,validationMode:n="onBlur",render:i,persist:s,...c})=>{Te.default(!(e&&i),"`Form` should only be given one of `children` or `render`. When both are provided, `render` will be used and `children` will be ignored.");const d=H.useForm({defaultValues:t,mode:n}),{handleSubmit:m,watch:p,setValue:h}=d,g=i?i(d):e,f={formMethods:d,handleSubmit:m,onSubmit:o,onError:r,...c};return s?a.createElement(Wi,{persist:s,watch:p,setValue:h},a.createElement(Ga,{...f},g)):a.createElement(Ga,{...f},g)};ja.displayName="Form";const ie=e=>{var t;const{errors:o}=H.useFormContext(),r=e.split(/[,[\].]+?/).filter(Boolean);return{error:(t=(()=>Sr.default(o,r))())==null?void 0:t.message}};var Bi=(e=>(e.ON="on",e.OFF="off",e))(Bi||{});const Ya=({css:e,defaultChecked:t=!1,label:o,name:r,validation:n,description:i,...s})=>{const{control:c}=H.useFormContext(),{error:d}=ie(r);return a.createElement(H.Controller,{control:c,name:r,defaultValue:t,rules:n,render:({onChange:m,value:p,name:h})=>a.createElement(ht,{css:e,description:i,error:d,label:o,required:Boolean(n==null?void 0:n.required)},a.createElement(ct,{defaultChecked:t,defaultValue:t?"on":"off",checked:p,name:h,onCheckedChange:m,value:p?"on":"off",...d&&{state:"error"},...s}))})};Ya.displayName="CheckboxField";const Ua={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Oi=l("span",{display:"inline-flex",alignItems:"center",px:"$1",flexGrow:1,...Ua,"& > *:not(:last-child)":{mr:"$1"}}),Hi={sm:"sm",md:"sm",lg:"md"},Vi=l(b,{flexShrink:0}),Xa=({...e})=>{const t=a.useContext(Ja),{size:o}=t,r=a.useMemo(()=>qt(o,n=>Hi[n]),[o]);return a.createElement(Vi,{...e,size:r})},qi=({children:e,...t})=>{const o=a.Children.toArray(e),r=o.length<=1;return a.createElement(Oi,{...t},o.map(n=>!r&&typeof n=="string"?a.createElement(w,{as:"span",css:Ua,key:n},n):a.isValidElement(n)&&n.type===b?a.createElement(Xa,{...n.props}):n))},_i=l(z,{px:"$2",border:"1px solid",borderRadius:"$0",alignItems:"center",fontFamily:"$body",maxWidth:"100%",borderColor:"$primary",color:"$primaryMid",bg:"$primaryLight","&[data-disabled]":{opacity:"0.3",pointerEvents:"none"},variants:{size:{sm:{height:"$2",...Je({size:"sm"})},md:{height:"$3",...Je({size:"sm"})},lg:{height:"$4",...Je({size:"md"})}}}}),Ja=a.createContext({}),Gi=({size:e,children:t})=>{const o=a.useMemo(()=>({size:e}),[e]);return a.createElement(Ja.Provider,{value:o},t)},ji=a.forwardRef(({asWorkaround:e,size:t="md",...o},r)=>a.createElement(Gi,{size:t},a.createElement(_i,{ref:r,as:e,size:t,...o}))),de=ji;de.Content=qi,de.Icon=Xa,de.displayName="Chip";const Ut=a.forwardRef(({gap:e=2,...t},o)=>a.createElement(Le,{ref:o,direction:"row",gap:e,align:!1,...t})),Xt=a.createContext({isDismissed:!1,setIsDismissed:()=>null}),Yi=({children:e,disabled:t})=>{const[o,r]=a.useState(!1),n=a.useMemo(()=>({disabled:t,isDismissed:o,setIsDismissed:r}),[t,o]);return a.createElement(Xt.Provider,{value:n},e)},Ui=({asChild:e=!1,value:t,onDismiss:o,...r})=>{const n=a.useContext(Xt),{isDismissed:i,disabled:s}=n;if(a.useEffect(()=>{i&&(o==null||o(t))},[i]),i)return null;const c={...s&&{["data-disabled"]:""},...r};return a.createElement(e?Ct.Slot:"div",{...c})},Xi=({disabled:e=!1,...t})=>a.createElement(Yi,{disabled:e},a.createElement(Ui,{...t})),Ji=e=>a.createElement("button",{type:"button",...e},"Dismiss"),Ka=({asChild:e=!1,...t})=>{const o=a.useContext(Xt);if(o===void 0)throw new Error("Dismissible.Trigger can only be used within a Dismissible.Item");const{setIsDismissed:r,disabled:n}=o,i={disabled:n,onClick:()=>{r(!0)},...t};return a.createElement(e?Ct.Slot:Ji,{...i})},gt=Xi;gt.Trigger=Ka,gt.displayName="Dismissible";const Qa=a.createContext({onDismiss:()=>null}),Ki=({children:e,disabled:t,onDismiss:o})=>{const r=a.useMemo(()=>({disabled:t,onDismiss:o}),[t,o]);return a.createElement(Qa.Provider,{value:r},e)},Qi=({as:e="div",disabled:t,onDismiss:o,...r})=>a.createElement(Ki,{disabled:t,onDismiss:o},a.createElement(e,{...r})),Zi=({children:e,disabled:t=!1,...o})=>{const r=a.useContext(Qa);if(r===void 0)throw new Error("DismissibleGroup.Item can only be used within a DismissibleGroup");const{onDismiss:n,disabled:i}=r;return a.createElement(gt,{disabled:i||t,onDismiss:n,...o},e)},ye=Qi;ye.Item=Zi,ye.Trigger=Ka,ye.displayName="DismissibleGroup";const el=l(de,{px:"$1"}),tl=({size:e="md",children:t,dismissActionLabel:o="Dismiss",...r})=>a.createElement(ye.Item,{asChild:!0,...r},a.createElement(el,{size:e},a.createElement(de.Content,null,t),a.createElement(ye.Trigger,{asChild:!0},a.createElement(M,{label:o,css:{color:"$tonal200"},size:e==="sm"?"xs":"sm"},a.createElement(b,{is:v.Close}))))),al=a.forwardRef((e,t)=>a.createElement(Ut,{as:ye,ref:t,...e})),Jt=al;Jt.Item=tl,Jt.displayName="ChipDismissibleGroup";const Za=l(b,{display:"none"}),ol=l(de,{"&:not([disabled])":{cursor:"pointer","&:hover":{bg:"$tonal100",color:"$tonal600",borderColor:"currentColor"},"&:focus-visible":{...be()},'&[data-state="on"]':{"&:hover":{bg:"$white",color:"$primaryDark"}}},'&[data-state="off"]':{color:"$tonal400",bg:"$tonal50",borderColor:"$tonal200"},'&[data-state="on"]':{[`& ${Za}`]:{display:"block"}}}),rl=({size:e="md",children:t,...o})=>a.createElement(ot.Item,{...o,asChild:!0},a.createElement(ol,{asWorkaround:"button"},a.createElement(Za,{is:v.Ok,size:e==="lg"?"md":"sm"}),a.createElement(de.Content,null,t))),nl=a.forwardRef((e,t)=>a.createElement(Ut,{ref:t,as:ot.Root,orientation:"horizontal",...e})),Kt=nl;Kt.Item=rl,Kt.displayName="ChipToggleGroupItem";const il=l(De.ComboboxInput,{boxShadow:"none",fontSize:"$md",appearance:"none",backgroundImage:Sa(_.colors.tonal300.value,"chevron"),backgroundPosition:"right $space$3 top 50%, 0 0",backgroundRepeat:"no-repeat, repeat",backgroundSize:"20px auto, 100%",border:"1px solid $tonal300",borderRadius:"$0",boxSizing:"border-box",color:"$tonal600",cursor:"text",display:"block",fontFamily:"$body",height:"$4",pl:"$3",pr:"$6",transition:"all 100ms ease-out",width:"100%","&::placeholder":{color:"$tonal300",opacity:1},"&:focus-within":{borderColor:"$primary",outline:"none"},"&[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},variants:{state:{error:{border:"1px solid $danger"}}}}),ll=l(De.ComboboxList,{listStyle:"none",m:0,p:0,userSelect:"none"}),sl=l(De.ComboboxOption,{color:"$tonal500",cursor:"pointer",m:0,p:"$2",'&:hover, &[aria-selected="true"]':{bg:"$tonal50",borderRadius:"$0"},"[data-user-value]":{color:"$primary"}}),cl=l(De.ComboboxPopover,{bg:"white",border:"solid 1px $tonal100",borderRadius:"$0",boxShadow:"$1",boxSizing:"border-box",fontFamily:"$body",fontSize:"$md",outline:"none",p:"$1",transform:"translateY($space$2)"});Ca({":root":{"--reach-combobox":1}})();const dl=l(De.Combobox,{}),xe=e=>a.createElement(dl,{...e});xe.displayName="Combobox",xe.Option=sl,xe.Input=il,xe.Popover=cl,xe.List=ll,xe.OptionText=De.ComboboxOptionText;var X=(e=>(e.NONE="none",e.PENDING="pending",e.FULFILLED="fulfilled",e.REJECTED="rejected",e))(X||{});const ml=e=>{if(e[0])return e[0].desc?"desc":"asc"},ul=async(e,t,o,r,n)=>{var i,s,c,d,m,p;const{pageIndex:h,pageSize:g}=o,f={pageIndex:(i=t==null?void 0:t.pageIndex)!=null?i:h,pageSize:(s=t==null?void 0:t.pageSize)!=null?s:g,sortBy:(d=t==null?void 0:t.sortBy)!=null?d:(c=r[0])==null?void 0:c.id,sortDirection:(m=t==null?void 0:t.sortDirection)!=null?m:ml(r),globalFilter:(p=t.globalFilter)!=null?p:n},$=await e(f);return Te.default(Array.isArray($==null?void 0:$.results),"The getAsyncData function must return an object with a property `result` which must be an array"),Te.default($&&Number.isInteger($.total)&&$.total>=0,"The getAsyncData function must return an object with a property `total` which must be a positive integer or zero"),$},pl={pageIndex:0,pageSize:10},hl=e=>{const[t,o]=u.default.useState(!!e),[r,n]=u.default.useState({...pl,...e||{}}),i=u.default.useCallback(()=>{o(!0)},[]);return{isPaginated:t,paginationState:r,setPaginationState:n,applyPagination:i}},gl=e=>{const[t,o]=u.default.useState(!1),[r,n]=u.default.useState(e?[{id:e.column,desc:e.direction==="desc"}]:[]);return{isSortable:t,setIsSortable:o,sorting:r,setSorting:n}},eo=a.createContext(null),fl=({columns:e,data:t=[],getAsyncData:o,defaultSort:r,initialState:n=void 0,children:i})=>{var s;const[c,d]=a.useState({results:t!=null?t:[],total:(s=t==null?void 0:t.length)!=null?s:0}),{isPaginated:m,applyPagination:p,paginationState:h,setPaginationState:g}=hl(n==null?void 0:n.pagination),[f,$]=a.useState(X.NONE),[y,C]=a.useState(""),{setIsSortable:E,isSortable:T,sorting:x,setSorting:S}=gl(r),F=a.useCallback(async N=>{if(o)try{$(X.PENDING);const V=await ul(o,N,h,x,y);d(V),$(X.FULFILLED)}catch{$(X.REJECTED)}},[o,h==null?void 0:h.pageIndex,h==null?void 0:h.pageSize,x,y]);a.useEffect(()=>{F({})},[F]),kr.default(()=>{!t||d({results:t,total:t.length})},[t]);const A=()=>c.total,P=se.useReactTable({columns:e,data:c.results,pageCount:h?Math.ceil(A()/h.pageSize):-1,initialState:n,state:{sorting:x,globalFilter:y,pagination:h},manualPagination:o&&m,manualSorting:o&&m,enableSorting:f!==X.PENDING,enableGlobalFilter:!o,getCoreRowModel:se.getCoreRowModel(),getPaginationRowModel:m?se.getPaginationRowModel():void 0,getSortedRowModel:T||x.length?se.getSortedRowModel():void 0,getFilteredRowModel:se.getFilteredRowModel(),onPaginationChange:m?g:void 0,onSortingChange:S,onGlobalFilterChange:C}),R=a.useMemo(()=>({...P,data:c,setData:d,setIsSortable:E,applyPagination:p,getTotalRows:A,isSortable:T,asyncDataState:f,runAsyncData:F}),[P,p,A,T]);return a.createElement(eo.Provider,{value:R},i)},J=()=>{const e=a.useContext(eo);if(!e)throw new Error("useDataTable can only be called from inside a DataTableProvider");return e},ft=l("tr",{bg:"unset"}),to=a.forwardRef((e,t)=>a.createElement(ft,{...e,ref:t}));to.displayName="TableRow";const ao=(e,t,o)=>{const[r,n]=a.useState([]),[i,s]=a.useState({});return a.useEffect(()=>{let c=0;s(r.reduce((d,m,p)=>{var h,g;const f={...d,[`& ${t}:nth-of-type(${p+1})`]:{position:"sticky",left:c,zIndex:"2"}};return c+=(((g=(h=o==null?void 0:o.current)==null?void 0:h.querySelectorAll(t))==null?void 0:g.item(p).clientWidth)||0)+.3,f},{}))},[r,o,t]),a.useLayoutEffect(()=>{const c=()=>{var d;const m=[];(d=o==null?void 0:o.current)==null||d.querySelectorAll(t).forEach(p=>m.push(p)),n(m.slice(0,e))};c(),window.addEventListener("resize",c)},[o,e,t]),{columnsCss:i}},$l=l("tbody",{variants:{striped:{true:{[`${ft}`]:{"&:nth-child(odd)":{bg:"white"},"&:nth-child(even)":{bg:"$tonal50"}}},false:{[`${ft}`]:{bg:"white"}}}}}),oo=({striped:e=!0,numOfStickyColumns:t=0,css:o,...r})=>{const n=a.useRef(null),{columnsCss:i}=ao(t,"td",n);return a.createElement($l,{striped:e,ref:n,css:{...i,...o,"& td":{bg:"inherit"}},...r})};oo.displayName="TableBody";const He=l("td",{borderBottom:"1px solid $tonal100",boxSizing:"border-box",color:"$tonal400",fontFamily:"$body",lineHeight:1.5,p:"$2 $3",textAlign:"left",verticalAlign:"middle","&:first-child":{fontWeight:"bold"}});He.displayName="TableCell";const ro=l("tfoot",{});ro.displayName="TableFooter";const $t=l("td",{color:"$tonal400",fontFamily:"$body",fontWeight:600,p:"$2 $3",textAlign:"left",verticalAlign:"middle"});$t.displayName="TableFooterCell";const me=l("th",{color:"white",fontFamily:"$body",fontWeight:600,lineHeight:1.5,p:"$2 $3",textAlign:"left",verticalAlign:"middle"});me.displayName="TableHeaderCell";const Qt={PRIMARY:"primary",PRIMARY_DARK:"primaryDark",LIGHT:"light"},bl=l("thead",{variants:{theme:{[Qt.PRIMARY]:{[`${me}`]:{bg:"$primary"}},[Qt.PRIMARY_DARK]:{[`${me}`]:{bg:"$primaryDark"}},[Qt.LIGHT]:{[`${me}`]:{bg:"$tonal50",color:"$tonal600"}}}}}),no=({theme:e="primaryDark",numOfStickyColumns:t=0,css:o,...r})=>{const n=u.default.useRef(null),{columnsCss:i}=ao(t,"th",n);return u.default.createElement(bl,{theme:e,ref:n,css:{...i,...o},...r})};no.displayName="TableHeader";const io=({children:e,numOfStickyColumns:t=0,css:o,...r})=>{const[n,i]=u.default.useState(!1);return u.default.createElement(w,{onScroll:s=>{i(s.currentTarget.scrollLeft>0)},role:"scrollbar",css:{overflow:"auto",maxWidth:"100%",...n&&{[`& th,td:nth-of-type(${t})`]:{boxShadow:"$colors$alpha200 -2px -3px 9px 1px",clipPath:"inset(0px -10px 0px 0px)"}},...o},...r},e)},vl=l("table",{borderCollapse:"separate",borderSpacing:0,fontFamily:"$sans",fontSize:"$sm",width:"100%",variants:{size:{md:{[`${He}, ${me}, ${$t}`]:{height:"$4"}},lg:{[`${He}, ${me}, ${$t}`]:{height:"$5"}}},corners:{round:{[`${me}`]:{"&:first-of-type":{borderTopLeftRadius:"$0"},"&:last-of-type":{borderTopRightRadius:"$0"}},[`${ft}:last-child`]:{[`${He}:first-child`]:{borderBottomLeftRadius:"$0"},[`${He}:last-child`]:{borderBottomRightRadius:"$0"}}},square:{}}}}),I=({size:e="md",corners:t="round",numOfStickyColumns:o=0,...r})=>{const n=a.createElement(vl,{size:e,corners:t,...r});return o?a.createElement(io,{numOfStickyColumns:o},n):n};I.Body=oo,I.Cell=He,I.Footer=ro,I.FooterCell=$t,I.Header=no,I.HeaderCell=me,I.Row=to,I.StickyColumnsContainer=io,I.displayName="Table";const yl=({striped:e=!1,...t})=>{const{getRowModel:o}=J();return a.createElement(I.Body,{...t,striped:e},o().rows.map(r=>a.createElement(W.Row,{row:r,key:r.id})))},Zt=({cell:e})=>a.createElement(I.Cell,{key:e.id},se.flexRender(e.column.columnDef.cell,e.getContext())),xl=({children:e})=>{const{asyncDataState:t,runAsyncData:o}=J();return t!==X.REJECTED?null:e(o)},wl=({children:e,hidden:t=!1})=>t?a.createElement(kt.Root,null,e):e?a.createElement(a.Fragment,null,e):null,lo=l("input",{appearance:"none",border:"1px solid $tonal400",borderRadius:"$0",boxShadow:"none",boxSizing:"border-box",color:"$tonal600",cursor:"text",display:"block",fontFamily:"$body",px:"$3",transition:"all 100ms ease-out",width:"100%","&:focus":{borderColor:"$primary",outline:"none"},"&[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&::placeholder":{color:"$tonal300",opacity:1},variants:{size:{sm:{height:"$3",fontSize:"$sm"},md:{height:"$4",fontSize:"$md"}},state:{error:{border:"1px solid $danger"}}}}),we=a.forwardRef(({type:e="text",size:t="md",...o},r)=>e==="number"?a.createElement(lo,{type:"text",inputMode:"numeric",pattern:"[0-9]*",size:t,...o,ref:r}):a.createElement(lo,{type:e,size:t,...o,ref:r}));we.displayName="Input";const El=()=>{const e=a.useRef(null),t=a.useCallback(o=>{o&&(e.current=o)},[]);return[e,t]},Cl=()=>{const[e,t]=a.useState(null),o=a.useCallback(r=>{r&&t(r)},[]);return[e,o]};var Sl=(e=>(e.SEARCH="SEARCH",e.CLEAR="CLEAR",e))(Sl||{});const kl=l(b,{color:"$tonal300",position:"absolute",pointerEvents:"none",variants:{size:{sm:{top:"$2",right:"$2",size:"$1"},md:{top:10,right:10,size:20}}}}),Dl=l(we,{'&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, & input[type="search"]::-webkit-search-results-decoration':{display:"none"}}),bt=a.forwardRef(({size:e="md",css:t,value:o,clearText:r="Clear",onChange:n,...i},s)=>{const[c,d]=El(),[m,p]=a.useState(o||""),[h,g]=a.useState(o?"CLEAR":"SEARCH");a.useImperativeHandle(s,()=>c.current);const f=()=>{var C,E;const T=c.current;if(!T)return;const x=(C=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:C.set;(E=x==null?void 0:x.call)==null||E.call(x,T,"");const S=new Event("input",{bubbles:!0});T.dispatchEvent(S),T.focus()},$=C=>{p(C.target.value),g(C.target.value?"CLEAR":"SEARCH"),n==null||n(C)},y=()=>h==="SEARCH"?a.createElement(kl,{is:v.Search,size:e,css:{size:e=="sm"?"$1":20}}):a.createElement(M,{label:r,theme:"neutral",size:e,css:{position:"absolute",top:"0",right:"$1"},onClick:f},a.createElement(b,{is:v.Close}));return a.createElement(w,{css:{position:"relative",...t}},a.createElement(Dl,{ref:d,size:e,type:"search",...i,value:m,onChange:$,css:{pr:e==="sm"?"$5":"$6"}}),y())});bt.displayName="SearchInput";const zl=({onChange:e,label:t,hideLabel:o=!1,...r})=>{const{setGlobalFilter:n,getState:i,resetPagination:s}=J(),{globalFilter:c}=i(),d=et.debounce(250,m=>{const{target:{value:p}}=m;e==null||e(m),s(),n(p)});return a.createElement(a.Fragment,null,a.createElement(wl,{hidden:o},a.createElement(Be,{css:{mb:"$3"},htmlFor:t},t)),a.createElement(bt,{...r,value:c,onChange:d,name:t}))},Il=({sortable:e=!0,theme:t="light",...o})=>{const{getHeaderGroups:r,setIsSortable:n}=J();return a.useEffect(()=>{n(e)},[e,n]),a.createElement(I.Header,{theme:t,...o},r().map(i=>a.createElement(I.Row,{key:i.id},i.headers.map(s=>a.createElement(W.HeaderCell,{header:s,key:s.id})))))},Tl={asc:v.SortUp,desc:v.SortDown},Rl=({direction:e})=>a.createElement(b,{is:Tl[e],size:"sm",css:{position:"absolute",left:"$1"}}),Fl=({header:e,children:t,css:o,...r})=>{const n=e.column.getIsSorted(),{isSortable:i}=J(),s=e.column.getCanSort();return a.createElement(I.HeaderCell,{onClick:i&&s?e.column.getToggleSortingHandler():void 0,css:{cursor:i&&s?"pointer":"initial",...o},...r},a.createElement(z,{css:{alignItems:"center"}},se.flexRender(e.column.columnDef.header,e.getContext()),n&&i&&a.createElement(z,{css:{position:"relative",alignItems:"center"}},a.createElement(Rl,{direction:n}))))},Nl=l(lt,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:1}),ea=e=>{const{asyncDataState:t}=J();return t!==X.PENDING?null:a.createElement(Nl,{...e})},Ml=({row:e})=>a.createElement(I.Row,null,e.getVisibleCells().map((t,o)=>a.createElement(Zt,{key:t.id,cell:t}))),Al=({sortable:e,striped:t,theme:o,css:r,numOfStickyColumns:n=0,...i})=>{const{asyncDataState:s}=J(),c=s===X.PENDING;return a.createElement(a.Fragment,null,a.createElement(ea,null),a.createElement(I,{...i,numOfStickyColumns:n,css:{...r,...c&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},a.createElement(W.Head,{theme:o,sortable:e,numOfStickyColumns:n}),a.createElement(W.Body,{striped:t,numOfStickyColumns:n})))},so=a.createContext({idColumn:"id"}),Ll=()=>{const e=a.useContext(so);if(!e)throw new Error("useDragAndDropTable can only be called within a DragAndDropContainer");return e},Pl=(e,t,o,r,n)=>{const{active:i,over:s}=e,c=o.indexOf(i.id),d=o.indexOf(s==null?void 0:s.id),m=qe.arrayMove(t.results,c,d);return n==null||n(c,d,m),{results:m,total:m.length}},Wl=(e,t)=>e.results.map(o=>{const r=o[t];if(r===void 0)throw new Error("To ensure drag-and-drop works correctly, please ensure that each row has a unique ID. Use the `id` property or pass DataTable an `idColumn` prop that defines the ID property on the rows.");return r}),Bl=({idColumn:e="id",onChange:t=void 0,children:o})=>{const{data:r,setData:n}=J(),i=a.useMemo(()=>Wl(r,e),[r]),s=fe.useSensors(fe.useSensor(fe.PointerSensor),fe.useSensor(fe.KeyboardSensor,{coordinateGetter:qe.sortableKeyboardCoordinates}));return a.createElement(fe.DndContext,{sensors:s,collisionDetection:fe.closestCenter,onDragEnd:c=>{const{active:d,over:m}=c;d.id&&(m==null?void 0:m.id)&&d.id!==(m==null?void 0:m.id)&&n(p=>Pl({active:d,over:m},p,i,e,t))},modifiers:[mr.restrictToVerticalAxis]},a.createElement(qe.SortableContext,{items:i,strategy:qe.verticalListSortingStrategy},a.createElement(so.Provider,{value:{idColumn:e}},o)))},Ol=({row:e})=>{const{idColumn:t}=Ll(),{attributes:o,listeners:r,transform:n,setNodeRef:i,isDragging:s}=qe.useSortable({id:e.original[t]});return a.createElement(I.Row,{ref:i,css:{transform:ur.CSS.Transform.toString(n),zIndex:s?5:void 0}},e.getVisibleCells().map((c,d)=>d===0?a.createElement(I.Cell,{key:c.id},a.createElement(Vl,{...o,...r,isDragging:s,css:{display:"inline-block"},label:"drag and drop"}),se.flexRender(c.column.columnDef.cell,c.getContext())):a.createElement(Zt,{key:c.id,cell:c})))},Hl=l(M,{color:"inherit !important",fill:"currentColor",variants:{isDragging:{true:{cursor:"grabbing"},false:{cursor:"grab"}}}}),Vl=a.forwardRef(({isDragging:e,size:t,...o},r)=>a.createElement(Hl,{ref:r,isDragging:e,appearance:"simple",size:t,...o},a.createElement(b,{is:v.DragHandle,size:t}))),ql=({striped:e=!1,...t})=>{const{getRowModel:o}=J();return a.createElement(I.Body,{...t,striped:e},o().rows.map(r=>a.createElement(Ol,{row:r,key:r.id})))},_l=({idColumn:e,onDragAndDrop:t,sortable:o,striped:r,theme:n,css:i,...s})=>{const{asyncDataState:c}=J(),d=c===X.PENDING;return a.createElement(Bl,{onChange:t,idColumn:e},a.createElement(ea,null),a.createElement(I,{...s,css:{...i,...d&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},a.createElement(W.Head,{theme:n,sortable:o}),a.createElement(ql,{striped:r})))},Gl=l("select",{appearance:"none",backgroundColor:"white",backgroundImage:Sa(_.colors.tonal300.value,"chevron"),backgroundRepeat:"no-repeat, repeat",border:"1px solid $tonal300",borderRadius:"$0",color:"$tonal600",display:"block",fontFamily:"$body",fontWeight:400,lineHeight:1.4,transition:"all 75ms ease-out",width:"100%","&:hover":{cursor:"pointer"},"&:focus":{borderColor:"$primary",outline:"none"},"&::-ms-expand":{display:"none"},"&[disabled], > option[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},variants:{size:{sm:{backgroundPosition:"right $space$2 top 50%, 0 0",backgroundSize:"18px auto, 100%",fontSize:"$sm",height:"$3",pl:"$2",pr:"$5"},md:{backgroundPosition:"right $space$3 top 50%, 0 0",backgroundSize:"20px auto, 100%",fontSize:"$md",height:"$4",pl:"$3",pr:"$6"}},state:{error:{border:"1px solid $danger"}}}}),vt=a.forwardRef(({placeholder:e,children:t,size:o="md",...r},n)=>{const i={size:o,ref:n,...r};return[r.value,r.defaultValue].every(s=>s===void 0)&&(i.defaultValue=""),a.createElement(Gl,{...i},e&&a.createElement("option",{disabled:!0,hidden:!0,value:""},e),t)});vt.displayName="Select";const jl=l(ze.Content,{backgroundColor:"$tonal500",borderRadius:"$0",boxShadow:"$0",color:"white",fontFamily:"$body",fontSize:"$sm",lineHeight:1.5,whiteSpace:"normal",px:"$3",py:"$2",zIndex:zn,"@allowMotion":{animationDuration:"75ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="delayed-open"]':{'&[data-side="top"]':{animationName:Ft},'&[data-side="right"]':{animationName:Nt},'&[data-side="bottom"]':{animationName:Tt},'&[data-side="left"]':{animationName:Rt}}},variants:{size:{sm:{maxWidth:"100px"},md:{maxWidth:"250px"},lg:{maxWidth:"400px"}}}}),Yl=l(ze.Arrow,{fill:"$tonal500",'[data-align="end"] &':{mr:"$2"},'[data-align="start"] &':{ml:"$2"}}),Ul=({children:e,side:t="top",sideOffset:o=4,size:r="md",...n})=>a.createElement(jl,{side:t,sideOffset:o,size:r,...n},e,a.createElement(Yl,null)),K=({children:e,delayDuration:t=350,...o})=>a.createElement(ze.Root,{delayDuration:t,...o},e);K.Content=Ul,K.Trigger=l(ze.Trigger,{}),K.Portal=ze.Portal,K.Provider=ze.Provider,K.displayName="Tooltip";const co=({direction:e,...t})=>{const o=e==="next";return u.default.createElement(Jl,{appearance:"outline",icon:o?v.ChevronRight:v.ChevronLeft,isRounded:!0,label:o?"Next page":"Previous page",name:o?"Next page":"Previous page",size:"md",...t})},Xl=({gotoPage:e,pageCount:t,pageIndex:o,disabled:r})=>u.default.createElement(z,{css:{alignItems:"center"}},u.default.createElement(vt,{value:o,size:"sm",css:{mr:"$3"},disabled:r,onChange:n=>{e(Number(n.target.value))}},Array.from({length:t},(n,i)=>i).map(n=>u.default.createElement("option",{key:n,value:n},n+1))),u.default.createElement(L,{size:"sm",css:{flex:"none"}},`of ${t} ${t>1?"pages":"page"}`)),Jl=({icon:e,label:t,...o})=>u.default.createElement(K,null,u.default.createElement(K.Trigger,{asChild:!0},u.default.createElement(M,{label:t,...o},u.default.createElement(b,{is:e}))),u.default.createElement(K.Content,null,t)),Kl=l("nav",{display:"flex",justifyContent:"space-between",alignItems:"center",fontVariantNumeric:"tabular-nums"}),Ql=e=>{const{applyPagination:t,getState:o,getRowModel:r,getPageCount:n,previousPage:i,nextPage:s,setPageIndex:c,getTotalRows:d,asyncDataState:m}=J();a.useEffect(()=>{t()},[t]);const{pagination:p}=o(),h=p.pageIndex*p.pageSize+1,g=h+r().rows.length-1,f=m===X.PENDING||m===X.REJECTED;return a.createElement(Kl,{...e},a.createElement(L,{size:"sm"},`${h.toString()} - ${g.toString()} of ${d()} items`),a.createElement(Xl,{gotoPage:c,pageCount:n(),pageIndex:p.pageIndex,disabled:f}),a.createElement(z,{css:{justifyContent:"flex-end"}},a.createElement(co,{direction:"previous",disabled:p.pageIndex===0||f,onClick:i,css:{mr:"$4"}}),a.createElement(co,{direction:"next",disabled:p.pageIndex===n()-1||f,onClick:s})))},W=e=>a.createElement(fl,{...e});W.Body=yl,W.DataCell=Zt,W.DragAndDropTable=_l,W.Head=Il,W.HeaderCell=Fl,W.Pagination=Ql,W.Row=Ml,W.GlobalFilter=zl,W.Table=Al,W.Loading=ea,W.Error=xl;const Zl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],es=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mo={open:"Open calendar",next:"Next month",previous:"Previous month",nextYear:"Next year",previousYear:"Previous year"},ts=l("button",{bg:"transparent",border:"none",borderRadius:"$round",color:"$tonal900",cursor:"pointer",fontFamily:"$body",fontSize:"$sm",size:"$3",p:0,transition:"all 75ms","&:hover":{bg:"$tonal100"},"&:active":{color:"white",bg:"$primary"},"&:focus":{outline:"2px solid $primary",outlineOffset:"2px"},variants:{isSelected:{true:{bg:"$primary",color:"white","&:hover":{bg:"$primary"}}},isToday:{true:{bg:"$tonal100"}},isOutsideMonth:{true:{color:"$tonal200"}}}}),ta=l("div",{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gridGap:"$1 $2"}),as=l(ne,{color:"$tonal600",p:"$3",width:"$6",variants:{selected:{false:{color:"$tonal600 !important",fontWeight:"400","&:hover":{bg:"$tonal100 !important",color:"$tonal600 !important"},"&[disabled]":{bg:"white !important"}}}}}),os=(e,t)=>{const o=e.slice(0,t);return e.slice(t).concat(o)},uo=({css:e,refDateSelected:t,refDateToday:o,firstDayOfWeek:r=0,monthNames:n=Zl,weekdayNames:i=es,labels:s=mo,date:c=new Date,minDate:d,maxDate:m,setYear:p,...h})=>{const[g,f]=a.useState(!1),[$,y]=a.useState(c==null?void 0:c.getFullYear()),C=R=>{const N=c;N.setFullYear(R),p(N),f(!1)},E=d&&$-16<=d.getFullYear(),T=m&&$>=m.getFullYear(),x=Array.from({length:16},(R,N)=>{const V=$-N;return m&&V>m.getFullYear()||d&&V<d.getFullYear()?0:V}),{calendars:S,getBackProps:F,getForwardProps:A,getDateProps:P}=pr.useDayzed({firstDayOfWeek:r,showOutsideDays:!0,date:c,minDate:d,maxDate:m,...h});return S.length?a.createElement(w,{css:{position:"relative",width:"min-content",mt:"-$1",...e}},a.createElement(z,{css:{position:"absolute",top:0,right:"-$1"}},a.createElement(M,{label:s[g?"previousYear":"previous"],theme:"neutral",size:"md",...!g&&F({calendars:S}),...g&&{onClick:()=>y($-16)},disabled:g&&E},a.createElement(b,{is:v.ChevronLeft})),a.createElement(M,{label:s[g?"nextYear":"next"],theme:"neutral",size:"md",...!g&&A({calendars:S}),...g&&{onClick:()=>y($+16)},disabled:g&&T},a.createElement(b,{is:v.ChevronRight}))),g&&a.createElement(ta,{css:{gridTemplateColumns:"repeat(4, 1fr)",pt:"$7",direction:"rtl",gridGap:"$3 $1"}},x.map((R,N)=>{const V=R===c.getFullYear();return R?a.createElement(as,{key:`${R}${N}`,theme:V?"primary":"neutral",onClick:()=>C(R),selected:V},R):a.createElement(w,{key:N,css:{width:"$6",height:"$4"}})})),!g&&S.map(({month:R,year:N,weeks:V})=>a.createElement(w,{key:`${R}${N}`},a.createElement(z,{css:{height:"$4",alignItems:"center",mb:"$4"}},a.createElement(ne,{theme:"neutral",css:{px:"0",color:"$tonal600"},onClick:()=>f(!0)},n[R]," ",N)),a.createElement(ta,{css:{mb:"$3"}},os(i,r).map(ke=>a.createElement(L,{as:"span",size:"sm",key:`${R}${N}${ke}`,css:{fontWeight:600,textAlign:"center"}},ke))),a.createElement(ta,null,V.map((ke,Et)=>ke.map((k,j)=>{const Ve=`${R}${N}${Et}${j}`;if(!k)return a.createElement("div",{key:Ve});const{date:Qo,selected:ba,today:va,prevMonth:Zo,nextMonth:er}=k;return a.createElement(ts,{isOutsideMonth:Zo||er,isSelected:ba,isToday:va,key:Ve,ref:ba?t:va?o:null,...P({dateObj:k}),type:"button"},Qo.getDate())})))))):null};uo.displayName="Calendar";const rs=l($e.Content,{bg:"white",borderRadius:"$1",boxShadow:"$2",maxWidth:"90vw",p:"$sizes$2",pr:"$6",position:"relative",zIndex:In,"@allowMotion":{animationDuration:"75ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="open"]':{'&[data-side="top"]':{animationName:Ft},'&[data-side="right"]':{animationName:Nt},'&[data-side="bottom"]':{animationName:Tt},'&[data-side="left"]':{animationName:Rt}}},variants:{size:{sm:{maxWidth:"200px"},md:{maxWidth:"400px"},lg:{maxWidth:"600px"}}}}),ns=l($e.Arrow,{fill:"white",zIndex:1,'[data-align="end"] &':{mr:"$sizes$2"},'[data-align="start"] &':{ml:"$sizes$2"}}),is=({children:e,side:t="top",sideOffset:o=8,closePopoverText:r="Close popover",showCloseButton:n=!0,size:i="md",...s})=>a.createElement(rs,{size:i,side:t,sideOffset:o,...s},n&&a.createElement(M,{as:$e.Close,css:{position:"absolute",right:"$0",top:"$0"},label:r,size:"md",theme:"neutral"},a.createElement(b,{is:v.Close})),e,a.createElement(ns,{width:16,height:8}));l($e.Root,{});const le=e=>a.createElement($e.Root,{...e});le.Content=is,le.Portal=$e.Portal,le.Trigger=$e.Trigger,le.displayName="Popover";const po="DD/MM/YYYY";_e.default.extend(Dr.default);const ls=(e,t=po)=>{const[o,r]=Y.useState(e?_e.default(e).toDate():void 0),[n,i]=Y.useState(e?_e.default(e).format(t):"");return{dateString:n,date:o,setDate:(s,c=!1)=>{const d=c?_e.default(s,t,!0):_e.default(s);r(d.isValid()?d.toDate():void 0),i(c?s:d.format(t))}}},aa=a.forwardRef(({initialDate:e,dateFormat:t=po,firstDayOfWeek:o=1,disabled:r,monthNames:n,weekdayNames:i,size:s="md",labels:c,revalidate:d,onChange:m,minDate:p,maxDate:h,...g},f)=>{const{date:$,dateString:y,setDate:C}=ls(e,t),E={...mo,...c},[T,x]=a.useState(!1),S=a.useRef(null),F=a.useRef(null);return a.useEffect(()=>{m==null||m($)},[$,m]),a.createElement(w,{css:{position:"relative"}},a.createElement(we,{name:"date",disabled:r,size:s,...g,onChange:A=>C(A.target.value,!0),value:y,ref:f}),a.createElement(le,{modal:!0,open:T,onOpenChange:x},a.createElement(le.Trigger,{asChild:!0},a.createElement(M,{css:{position:"absolute",top:"0",right:"0"},disabled:r,label:E.open,size:s,theme:"neutral"},a.createElement(b,{is:v.CalendarEvent}))),a.createElement(le.Portal,null,a.createElement(le.Content,{css:{pr:"$sizes$2",zIndex:Ue},side:"bottom",align:"end",showCloseButton:!1,onOpenAutoFocus:A=>{var P,R;A.preventDefault(),$?(P=F.current)==null||P.focus():(R=S.current)==null||R.focus()}},a.createElement(uo,{date:$||new Date,selected:$,onDateSelected:async A=>{x(!1),await C(A.date,!1),d&&d()},setYear:async A=>{await C(A,!1),d&&d()},minDate:p,maxDate:h,refDateToday:S,refDateSelected:F,firstDayOfWeek:o,monthNames:n,weekdayNames:i,labels:E})))))});aa.displayName="DateInput";const ho=({css:e,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c,trigger:d}=H.useFormContext(),{error:m}=ie(o),p=r?c(r):c;return a.createElement(te,{css:e,description:i,error:m,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(aa,{id:o,name:o,ref:p,...m&&{state:"error"},...s,revalidate:d}))};ho.displayName="DateField";const oa=l(w,{width:"100vw",height:"100vh"}),ss=l(q.Close,{}),ra="translate3d(-50%, -50%, 0)",go="translate3d(-50%, 50vh, 0)",fo="modal_overlay",cs=D({"0%":{transform:go},"100%":{transform:ra}}),ds=D({"0%":{transform:ra},"100%":{transform:go}}),ms=l(q.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",overflowY:"auto",zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${Mt} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),us=l(q.Content,{bg:"white",borderRadius:"$1",boxShadow:"$3",boxSizing:"border-box",left:"50%",maxWidth:"90vw",maxHeight:"90vh",overflowY:"auto",p:"$5",position:"fixed",top:"50%",transform:ra,zIndex:Ue,"&:focus":{outline:"none"},"@allowMotion":{'&[data-state="open"]':{animation:`${cs} 550ms cubic-bezier(0.22, 1, 0.36, 1)`},'&[data-state="closed"]':{animation:`${ds} 550ms cubic-bezier(0.22, 1, 0.36, 1)`}},variants:{size:{xs:{width:"380px"},sm:{width:"480px"},md:{width:"600px"},lg:{width:"800px"},xl:{width:"1100px"}}}}),ps=({size:e="sm",children:t,closeDialogText:o="Close dialog",showCloseButton:r=!0,...n})=>a.createElement(q.Portal,null,a.createElement(ms,{id:fo},a.Children.map(t,i=>(i==null?void 0:i.type)===oa&&i),a.createElement(us,{size:e,"aria-label":"Dialog",onPointerDownOutside:i=>{const s=i.target;(s==null?void 0:s.id)!==fo&&i.preventDefault()},...n},r&&a.createElement(M,{as:q.Close,css:{position:"absolute",right:"$4",top:"$4"},label:o,size:"md",theme:"neutral"},a.createElement(b,{is:v.Close})),a.Children.map(t,i=>(i==null?void 0:i.type)!==oa&&i)))),hs=l(q.Root,{}),ue=e=>a.createElement(hs,{...e});ue.Background=oa,ue.Close=ss,ue.Content=ps,ue.Description=q.Description,ue.Title=q.Title,ue.Trigger=q.Trigger,ue.displayName="Dialog";const gs=l(Ie.Content,{bg:"white",borderRadius:"$0",boxShadow:"$0",py:"$2",zIndex:Dn,"@allowMotion":{animationDuration:"250ms",animationTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",willChange:"transform, opacity",'&[data-state="open"]':{'&[data-side="top"]':{animationName:Ft},'&[data-side="right"]':{animationName:Nt},'&[data-side="bottom"]':{animationName:Tt},'&[data-side="left"]':{animationName:Rt}}}}),fs={alignItems:"center",color:"$tonal600",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:400,position:"relative",px:"$3",py:"$2","&[data-disabled]":{color:"$tonal200",pointerEvents:"none"},'&[aria-current="page"], &:focus':{"&::before":{borderLeft:"2px solid currentColor",content:"",height:"$2",left:0,outline:"none",position:"absolute",transform:"scale(1)"}},"&:focus":{color:"$primaryMid",outline:"none"},"&:hover":{textDecoration:"underline"}},$o=l(Ie.Item,fs),$s=l("a",{textDecoration:"none"}),bs=({children:e,href:t,...o})=>u.default.createElement($o,{...o,asChild:!0},u.default.createElement($s,{href:t,role:"menuitem"},e)),vs=l(Ie.Separator,{height:"1px",backgroundColor:"$tonal200",my:"$2"}),ys=l(Ie.Trigger,{}),xs=l(Ie.Root,{}),Ee=e=>u.default.createElement(xs,{...e});Ee.Content=gs,Ee.Item=$o,Ee.LinkItem=bs,Ee.Portal=Ie.Portal,Ee.Separator=vs,Ee.Trigger=ys;const bo=l(L,{color:"$tonal400",fontWeight:"400",variants:{size:{xs:{fontSize:"$sm",mb:"$4"},sm:{fontSize:"$sm",mb:"$4"},md:{fontSize:"$sm",mb:"$4"},lg:{fontSize:"$md",mb:"calc($4 + $2)"},xl:{fontSize:"$md",mb:"calc($4 + $2)"}}}}),ws=l(Pe,{variants:{size:{xs:{maxWidth:"56px",maxHeight:"32px",mb:"$4"},sm:{maxWidth:"84px",maxHeight:"48px",mb:"$4"},md:{maxWidth:"126px",maxHeight:"72px",mb:"$4"},lg:{maxWidth:"190px",maxHeight:"142px",mb:"calc($4 + $2)"},xl:{maxWidth:"285px",maxHeight:"213px",mb:"calc($4 + $2)"}}}}),vo=e=>u.default.createElement(ws,{...e}),yo=l("h2",{color:"$tonal400",fontFamily:"$body",fontWeight:"600",m:0,variants:{size:{xs:{fontSize:"$md",mb:"$3"},sm:{fontSize:"$md",mb:"$3"},md:{fontSize:"$md",mb:"$3"},lg:{fontSize:"$lg",mb:"$4"},xl:{fontSize:"$lg",mb:"$4"}}}}),Es=l(z,{flexDirection:"column",alignItems:"center",textAlign:"center","& > *:last-child":{mb:0},variants:{size:{xs:{p:"$2"},sm:{p:"$3"},md:{p:"$4"},lg:{p:"$5"},xl:{p:"$6"}}}}),Ke=({size:e="sm",children:t,...o})=>a.createElement(Es,{size:e,...o},a.Children.map(t,r=>a.isValidElement(r)&&(r.type===vo||r.type===yo||r.type===bo)?a.cloneElement(r,{...r.props,size:e}):r));Ke.displayName="EmptyState",Ke.Image=vo,Ke.Title=yo,Ke.Body=bo;const xo=({accept:e,children:t,multiple:o=!1,onFileSelect:r,...n})=>{const i=s=>{const{files:c}=s.target;r(c)};return a.createElement(ne,{as:"label",...n},a.createElement(b,{is:v.Upload}),t,a.createElement("input",{type:"file",onChange:i,accept:e,multiple:o,hidden:!0}))};xo.displayName="FileInput";const Cs=l("div",{display:"grid",variants:{gap:It("space",{gap:"$key"})}}),wo=({css:e,gap:t=2,minItemSize:o,maxItemSize:r="1fr",...n})=>a.createElement(Cs,{css:{...o&&{gridTemplateColumns:`repeat(auto-fit, minmax(${o}, ${r}))`},...e},gap:t,...n});wo.displayName="Grid";const Eo=({css:e,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return a.createElement(te,{css:e,description:i,error:d,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(we,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Eo.displayName="InputField";const Ss=l("div",{"& > *":{"&:not(:first-child)":{mt:"$5"},"&:not(:last-child)":{mb:"$5"}},[`& > ${Ht}`]:{maxWidth:"65ch"},[`& > ${Vt}`]:{maxWidth:"75ch"},[`& > ${Oa}`]:{maxWidth:"75ch"},[`& > ${Va}`]:{my:"$5"},[`& > ${Ma}`]:{display:"block","&:not(:first-child)":{mt:"$6"},"&:not(:last-child)":{mb:"$6"}}}),na=a.forwardRef((e,t)=>a.createElement(Ss,{ref:t,...e}));na.displayName="StackContent";const ks={code:yi,emphasis:xi,heading:Ei,inlineCode:Si,image:ki,link:Di,list:zi,listItem:Ii,paragraph:Ti,strong:Fi,text:Ni,thematicBreak:Mi},Ds=e=>{var t,o;if((t=e.position)!=null&&t.start){const{line:r,column:n,offset:i}=(o=e.position)==null?void 0:o.start;return`${e.type}${r}${n}${i}`}return`${e.type}${+new Date}`},Co=({content:e,customComponents:t={},css:o})=>{const r=Tr.default(e,{extensions:[Rr.default()],mdastExtensions:[Ir.default.fromMarkdown]}),n={...ks,...t},i=s=>{const c=n[s.type];return c?a.createElement(c,{key:Ds(s),node:s,handleNode:i}):null};return a.createElement(na,{css:o},r.children.map(i))};Co.displayName="MarkdownContent";const So=u.default.createContext(void 0),zs=()=>{const e=u.default.useContext(So);if(e===void 0)throw new Error("useNavigationMenuContext must be used within a NavigationMenuContextProvider");return e},yt=e=>{e.preventDefault()},Is=l("ul",{listStyle:"none",m:0,p:0}),Ts=l(ce.Content,{p:"$3",bg:"white",mt:"4px",boxShadow:"$1",borderRadius:"$1"}),ia=({children:e})=>u.default.createElement(Ts,{onPointerMove:yt,onPointerLeave:yt},u.default.createElement(Is,null,e));ia.displayName="NavigationMenuDropdownContent";const ko={background:"none",color:"$tonal400",opacity:"30%",cursor:"default"},la={all:"unset",position:"relative",color:"$tonal400",outline:"none",cursor:"pointer",fontFamily:"$body",userSelect:"none",padding:"$3",borderRadius:"$1","&:hover":{background:"$tonal50",color:"$tonal600"},"&:active":{background:"$tonal100",color:"$tonal600"},"&:focus-visible":{boxShadow:"inset 0 0 0 2px $colors$primary"},"&:disabled":{...ko}},Do={fontWeight:"600",color:"$tonal500","&::after":{backgroundColor:"$tonal500",borderRadius:"$1",bottom:0,content:"",display:"block",height:"2px",left:"50%",position:"absolute",transform:"translate(-50%,0)",width:"$2"}},Rs=l(ce.Trigger,la,{display:"flex",alignItems:"center",borderRadius:"$1",justifyContent:"space-between",'&[data-state="open"]':{background:"$tonal100"},variants:{active:{true:{...Do}}}}),sa=u.default.forwardRef(({children:e,active:t,...o},r)=>u.default.createElement(Rs,{active:t,...o,ref:r,onPointerMove:yt,onPointerLeave:yt},e,u.default.createElement(b,{is:v.ChevronDown,css:{ml:"$1","[data-state=open] &":{transform:"rotate(-180deg)"},"@media (prefers-reduced-motion: no-preference)":{transition:"transform .2s ease"}},size:"sm"})));sa.displayName="NavigationMenuDropdownTrigger";const zo=({children:e,id:t,...o})=>{const{onNodeUpdate:r}=zs();return u.default.createElement(ce.Item,{value:t},u.default.Children.map(e,n=>{const i=u.default.isValidElement(n)&&n.type===sa,s=u.default.isValidElement(n)&&n.type===ia;if(!i&&!s)throw new Error('Only NavigationMenu.Trigger and NavigationMenu.Content can be the passed as a "children" of NavigationMenu.Dropdown');return i?u.default.cloneElement(n,{...o,ref:c=>r(c,t)}):n}))};zo.displayName="NavigationMenuDropdown";const Fs=l("button",{...la,...ko}),Ns=l(ce.Item),Ms=l(ce.Link,la,{display:"block",textDecoration:"none",lineHeight:1,variants:{elementType:{dropdownItem:{"&[data-active]":{background:"$primaryLight",color:"$primary","*":{color:"$primary"},"&:hover":{background:"$tonal50"},"&:active":{background:"$tonal100"},"&:focus-visible":{boxShadow:"0 0 0 2px $colors$primary"}}},link:{"&[data-active]":{...Do}}}}}),ca=u.default.forwardRef(({children:e,href:t,disabled:o,css:r,variant:n="link",...i},s)=>u.default.createElement(Ns,null,o?u.default.createElement(Fs,{disabled:!0,...i},e):u.default.createElement(Ms,{href:t,ref:s,elementType:n,css:r,...i},e)));ca.displayName="NavigationMenuLink";const Io=u.default.forwardRef((e,t)=>u.default.createElement(ca,{ref:t,variant:"dropdownItem",...e})),To=l(L,{color:"$tonal500",fontWeight:600});Io.displayName="NavigationMenuDropdownItem",To.displayName="NavigationMenuDropdownItemTitle";const As=D({"0%, 50%":{opacity:0},"100%":{opacity:1}}),Ls=l(ce.Root,{display:"flex",justifyContent:"center",position:"relative"}),Ps=l(ce.List,{all:"unset",display:"flex",justifyContent:"center",alignItems:"center",gap:"$1",listStyle:"none"}),Ws=l(ce.Viewport,{zIndex:it}),Bs=l("div",{position:"absolute",left:0,top:"100%",width:"100%",display:"flex",justifyContent:"center"}),pe=({children:e,css:t})=>{const[o,r]=u.default.useState(),[n,i]=u.default.useState(),[s,c]=u.default.useState(0),d=u.default.useRef(null),m=200;u.default.useLayoutEffect(()=>{d.current&&c(d.current.offsetWidth)},[]),u.default.useEffect(()=>{let h;return n===""&&(h=setTimeout(()=>r(null),m)),()=>{h!==null&&clearTimeout(h)}},[n]);const p=(h,g)=>{if(h&&s&&n===g){const f=s/2,$=s-h.offsetLeft-h.offsetWidth+h.offsetWidth/2;r(Math.round(f-$))}return h};return u.default.createElement(So.Provider,{value:{onNodeUpdate:p}},u.default.createElement(Ls,{onValueChange:i,css:t},u.default.createElement(Ps,{ref:d},e),u.default.createElement(Bs,null,u.default.createElement(Ws,{css:{transform:`translateX(${o||0}px)`,'&[data-state="open"]':{animation:`${As} ${m}ms ease`},'&[data-state="closed"]':{animation:`${rt} ${m}ms ease-out`}}}))))};pe.Link=ca,pe.Dropdown=zo,pe.DropdownContent=ia,pe.DropdownItem=Io,pe.DropdownItemTitle=To,pe.DropdownTrigger=sa,pe.displayName="NavigationMenu";const Os=l(w,{position:"relative"}),Hs=l(z,{fontFamily:"$body",fontSize:"$sm",flexDirection:"column",justifyContent:"center",position:"absolute",top:"0",right:"0",transform:"translate(calc($sizes$2 / 2), -50%)",borderRadius:"$round",p:"$2",height:"$2",minWidth:"$2",textAlign:"center",color:"#fff",bg:"$primary"}),Vs=({value:e,children:t})=>u.default.createElement(Os,null,!!e&&u.default.createElement(Hs,{role:"status"},e),t),qs=l("span",{zIndex:1}),_s=l(M,{borderColor:"$tonal400 !important",zIndex:1,"&:hover":{bg:"$tonal50",svg:{color:"$tonal400"}},svg:{color:"$tonal300"},"&:active":{bg:"$tonal100",svg:{color:"$tonal500"}},"&:disabled":{opacity:.3,pointerEvents:"none"}}),Ro=a.forwardRef((e,t)=>{const{icon:o,disabledTooltipContent:r,showTooltip:n,...i}=e;return a.createElement(K,null,a.createElement(K.Trigger,{asChild:!0},a.createElement(qs,{tabIndex:-1},a.createElement(_s,{tabIndex:-1,appearance:"outline",ref:t,...i},a.createElement(b,{is:o})))),n&&a.createElement(K.Content,null,r))}),da=a.forwardRef((e,t)=>{const{name:o,min:r=0,max:n=Number.MAX_SAFE_INTEGER,step:i=1,initialValue:s=0,disabled:c=!1,readonly:d=!1,size:m="md",onChange:p,stepperButtonLabels:h,disabledTooltipContent:g,css:f,...$}=e,[y,C]=a.useState(s),E=a.useRef(null);a.useImperativeHandle(t,()=>E.current);const T={increment:"increment",decrement:"decrement",...h},x={decrement:`Cannot enter values below ${r}`,increment:`Cannot enter values above ${n}`,...g},S=y>=n,F=y<=r,A=a.useCallback(k=>Math.min(Math.max(k,r),n),[n,r]),P=a.useCallback(k=>{C(k),p==null||p(Number(k))},[p]),R=a.useCallback(k=>{const j=k.target.value.replace(/\D/g,"");P(j)},[P]),N=a.useCallback(()=>{var k;if(S||d)return;(k=E==null?void 0:E.current)==null||k.focus();let j;y===""?j=i:j=Number(y)+i,P(A(j))},[A,S,d,i,P,y]),V=a.useCallback(()=>{var k;if(F||d)return;(k=E==null?void 0:E.current)==null||k.focus();let j;y===""?j=r:j=Number(y)-i,P(A(j))},[A,F,d,r,i,P,y]),ke=a.useCallback(k=>{if(k.nativeEvent.isComposing)return;const j=k.key,Ve={ArrowUp:N,ArrowRight:N,ArrowDown:V,ArrowLeft:V,Home:()=>P(r),End:()=>P(n)}[j];Ve&&(k.preventDefault(),Ve(k))},[N,V,P,r,n]),Et={name:o,type:"number",value:y,...$,onChange:R,onKeyDown:ke,size:m,css:{borderRadius:"0px",width:"$6","&:disabled":{opacity:.3,pointerEvents:"none"}},ref:E,readOnly:d,disabled:c,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":Number(y),role:"spinbutton"};return a.createElement(z,{css:f},a.createElement(Ro,{onClick:V,icon:v.Minus,css:{borderRight:"none",borderTopRightRadius:"0px",borderBottomRightRadius:"0px"},size:m,disabled:F||c,showTooltip:F&&!c,disabledTooltipContent:x.decrement,label:T.decrement}),a.createElement(we,{...Et}),a.createElement(Ro,{onClick:N,icon:v.Plus,css:{borderLeft:"none",borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px"},size:m,disabled:S||c,showTooltip:S&&!c,disabledTooltipContent:x.increment,label:T.increment}))});da.displayName="NumberInput";const Fo=({css:e,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c,trigger:d}=H.useFormContext(),{error:m}=ie(o),p=r?c(r):c;return a.createElement(te,{css:e,description:i,error:m,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(da,{id:o,name:o,ref:p,...m&&{state:"error","aria-invalid":!0},...s,onChange:d}))};Fo.displayName="NumberInputField";const ma=a.forwardRef(({css:e,hidePasswordText:t="Hide password",showPasswordText:o="Show password",size:r="md",...n},i)=>{const[s,c]=Y.useState(!1),d=()=>c(m=>!m);return a.createElement(w,{css:{position:"relative",...e}},a.createElement(we,{...n,size:r,type:s?"text":"password",ref:i,css:{pr:"$sizes$2"}}),a.createElement(M,{appearance:"simple",theme:"neutral",css:{bottom:0,position:"absolute",right:0},label:s?t:o,onClick:d,onMouseDown:m=>m.preventDefault(),size:r},a.createElement(b,{is:s?v.Eye:v.EyeCrossed})))});ma.displayName="PasswordInput";const No=({css:e={},label:t="Password",name:o,prompt:r=void 0,description:n,validation:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=i?c(i):c;return a.createElement(te,{css:{...e,position:"relative"},description:n,error:d,fieldId:o,label:t,prompt:r,required:Boolean(i==null?void 0:i.required)},a.createElement(ma,{autoComplete:"current-password",name:o,id:o,ref:m,...s}))};No.displayName="PasswordField";const Gs=l(wa.Root,{borderRadius:"$round",background:"$tonal100",height:"$0",position:"relative",overflow:"hidden",width:"100%",variants:{theme:{primary:{color:"$primary"},success:{color:"$success"},warning:{color:"$warning"},danger:{color:"$danger"}}}}),js=l(wa.Indicator,{backgroundColor:"currentcolor",borderRadius:"$round",boxSizing:"border-box",height:"100%",position:"absolute",transition:"all 300ms ease-out"}),Mo=({value:e,max:t=100,theme:o="primary",...r})=>a.createElement(Gs,{value:e,max:t,theme:o,...r},a.createElement(js,{style:{width:"100%",transform:`translateX(-${100-(e||0)/t*100}%)`}}));Mo.displayName="ProgressBar";const Ao=({css:e,label:t,value:o,...r})=>a.createElement(ht,{css:e,label:t},a.createElement(pt,{value:o,...r}));Ao.displayName="RadioField";const Ys=l("fieldset",{all:"unset"}),ua=({children:e,css:t,direction:o="column",defaultValue:r,description:n,label:i,name:s,validation:c,onValueChange:d,...m})=>{const{control:p}=H.useFormContext(),{error:h}=ie(s);return a.createElement(Ys,{css:t},a.createElement(Be,{as:"legend",css:{p:0,mb:"$3"},required:Boolean(c==null?void 0:c.required)},i),n&&a.createElement(jt,{css:{mb:"$3"}},n),a.createElement(H.Controller,{control:p,name:s,rules:c,defaultValue:r,render:({onChange:g,value:f})=>a.createElement(Yt,{direction:o,defaultValue:r,onValueChange:$=>{g($),d==null||d($)},value:f,...m},e)}),h&&a.createElement(dt,{css:{mt:"$2"}},h))};ua.Item=Ao,ua.displayName="RadioButtonField";const Us=l(Re.Item,{alignItems:"center",bg:"white",border:"1px solid $tonal200",borderRadius:"$0",cursor:"pointer",display:"flex",textAlign:"left",'&[data-state="checked"]':{outline:"2px solid $primary",outlineOffset:"-2px"},variants:{align:{left:{flexDirection:"row"},right:{flexDirection:"row-reverse"}},size:{md:{px:"$4",py:"$3"},lg:{px:"$5",py:"$4"}},isFullWidth:{true:{width:"100%"},false:{width:"max-content"}}}}),Xs=l("div",{alignItems:"center",appearance:"none",backgroundColor:"transparent",border:"1px solid $tonal500",borderRadius:"$round",display:"flex",flexShrink:0,justifyContent:"center",p:0,size:"$1",transition:"all 50ms ease-out",'[data-state="checked"] &':{backgroundColor:"$primary",borderColor:"$primary"},variants:{containerIsFullWidth:{true:{},false:{}},align:{left:{mr:"$4"},right:{}}},compoundVariants:[{containerIsFullWidth:!0,align:"right",css:{ml:"auto"}},{containerIsFullWidth:!1,align:"right",css:{ml:"$4"}}]}),Js=l(Re.Indicator,{backgroundColor:"white",borderRadius:"$round",position:"absolute",size:"6px"}),Lo=({children:e,isFullWidth:t=!1,size:o="md",align:r="left",...n})=>a.createElement(Us,{...n,align:r,isFullWidth:t,size:o},a.createElement(Xs,{align:r,containerIsFullWidth:t},a.createElement(Js,null)),a.createElement(w,null,e)),Ks=({css:e,children:t,size:o,isFullWidth:r,align:n,gap:i="3",justify:s,...c})=>a.createElement(Re.Root,{...c},a.createElement(Le,{direction:"row",justify:s,gap:i,css:e},a.Children.map(t,d=>a.isValidElement(d)&&(d==null?void 0:d.type)===Lo?a.cloneElement(d,{size:o,isFullWidth:r,align:n}):d))),Po=({css:e,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return a.createElement(te,{css:e,description:i,error:d,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(bt,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Po.displayName="SearchField";const Wo=({css:e=void 0,children:t,name:o,label:r,validation:n,prompt:i,description:s,hideLabel:c,...d})=>{const{register:m}=H.useFormContext(),{error:p}=ie(o),h=n?m(n):m;return a.createElement(te,{css:e,description:s,error:p,fieldId:o,label:r,prompt:i,required:Boolean(n==null?void 0:n.required),hideLabel:c},a.createElement(vt,{name:o,id:o,...d,ref:h,...p&&{state:"error"}},t))};Wo.displayName="SelectField";const Bo=l(ae.Root,{width:"100%"});Bo.displayName="SidedrawerAccordionRoot";const Qs=D({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Zs=D({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),ec=l(ae.Content,{bg:"white",overflow:"hidden","@allowMotion":{'&[data-state="open"]':{animation:`${Qs} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Zs} 300ms ease-out`}}}),tc=({children:e,...t})=>u.default.createElement(ec,{...t},u.default.Children.map(e,o=>u.default.createElement(w,{css:{"> a":{px:"$6"},"> button":{px:"$6"}}},o))),ac=l(ae.Item,{}),pa={alignItems:"center",bg:"white",border:"unset",borderLeft:"4px solid transparent",color:"$tonal600",cursor:"pointer",display:"flex",fontFamily:"$body",fontWeight:"400",fontSize:"$md",margin:0,minHeight:"48px",outline:"unset",outlineOffset:"unset",py:"$3",px:"$4",width:"100%",textDecoration:"none","&:hover":{bg:"$tonal50"},"&:active":{bg:"$tonal100"},"&:focus-visible":{boxShadow:"inset 0 0 0 2px $colors$primary"},"&[disabled]":{opacity:"0.3",pointerEvents:"none",cursor:"default"},variants:{active:{true:{bg:"$primaryLight",borderLeft:"4px solid $primary",color:"$primary",fontWeight:"600"}}}},oc=l(ae.Trigger,{justifyContent:"space-between",m:0,p:0,"&[data-state=open]":{fontWeight:"600"},...pa}),rc=l(b,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"}}),nc=({children:e,...t})=>u.default.createElement(ae.Header,null,u.default.createElement(oc,{...t},u.default.createElement(z,{css:{alignItems:"center"}},e),u.default.createElement(rc,{is:v.ChevronDown,size:"sm"}))),ic=({children:e})=>{let t=!1;return u.default.Children.forEach(e,o=>{var r;Y.isValidElement(o)&&((r=o.props)==null?void 0:r.value)&&(t=!0)}),u.default.createElement(w,{css:{flexGrow:1,width:"100%",overflowY:"auto"}},t?u.default.createElement(Bo,{type:"single"},e):e)},lc=({appearance:e="simple",label:t="close",size:o="md",theme:r="neutral",...n})=>u.default.createElement(q.Close,{asChild:!0},u.default.createElement(M,{theme:r,appearance:e,size:o,label:t,...n},u.default.createElement(b,{is:v.Close}))),sc=l(q.Overlay,{animationFillMode:"forwards",bg:"$alpha600",cursor:"pointer",height:"100vh",left:"0",position:"fixed",top:"0",width:"100vw",zIndex:it-1,"@allowMotion":{'&[data-state="open"]':{animation:`${Mt} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),cc=l(q.Content,{bg:"white",boxShadow:"$2",display:"flex",flexDirection:"column",position:"fixed",top:0,left:0,height:"100%",maxWidth:"304px",width:"100%",zIndex:it,"@allowMotion":{'&[data-state="open"]':{animation:`${Br} 250ms ease-out`},'&[data-state="closed"]':{animation:`${Or} 250ms ease-out`}}}),dc=({children:e,...t})=>u.default.createElement(q.Portal,null,u.default.createElement(sc,{"data-testid":"sidedrawer_overlay"}),u.default.createElement(cc,{role:"navigation",...t},e)),mc=l("footer",{alignItems:"center",borderTop:"1px solid $tonal100",bottom:0,boxShadow:"$3",display:"flex",height:"$6",justifyContent:"center",p:"$3",width:"100%"}),uc=({delay:e=500,delayMethod:t="throttle"}={})=>{const[o,r]=Y.useState({x:0,y:0}),n=Y.useMemo(()=>{if(t==="throttle")return et.throttle;if(t==="debounce")return et.debounce},[t]);return Y.useEffect(()=>{const i=n(e,()=>{r({x:window.scrollX,y:window.scrollY})});return window.addEventListener("scroll",i),()=>{window.removeEventListener("scroll",i)}},[n,e]),o},pc=u.default.forwardRef(({icon:e,...t},o)=>u.default.createElement(M,{size:"md",appearance:"simple",theme:"neutral",ref:o,...t},u.default.createElement(b,{is:e}))),xt=({src:e,alt:t="Atom Learning logo",css:o})=>u.default.createElement(Pe,{className:"topbar-brand-logo",src:e,alt:t,css:{mr:"$3",mb:"5px",...o}});xt.toString=()=>".topbar-brand-logo";const hc=l(L,{color:"$tonal400"}),gc=l("a",{display:"flex",alignItems:"center",textDecoration:"none",color:"$tonal400","&:hover, &:focus":{textDecoration:"none"}}),fc=()=>u.default.createElement(Gt,{orientation:"vertical",css:{height:"$2",bg:"$tonal100"}}),$c=l("div",{bg:"white",position:"sticky",display:"flex",alignItems:"center",width:"100vw",top:"0",zIndex:1,borderBottom:"1px solid $tonal100",transition:"box-shadow .2s ease-out",variants:{hasScrolled:{true:{boxShadow:"0px 4px 4px -2px rgba(31, 31, 31, 0.1);"}},size:{md:{height:"$6",[`& ${xt}`]:{'&[src$=".svg"]':{height:24,width:"auto"}}},lg:{height:"$7",[`& ${xt}`]:{'&[src$=".svg"]':{height:32,width:"auto"}}}}}}),bc=l(z,{alignItems:"center",height:"$4",mx:"$4",width:"100%","@md":{mx:"$5"}}),he=({size:e="md",...t})=>{const{y:o}=uc();return u.default.createElement($c,{hasScrolled:!!o,size:e},u.default.createElement(bc,{...t}))};he.Brand=gc,he.BrandLogo=xt,he.BrandName=hc,he.ActionIcon=pc,he.Divider=fc,he.displayName="TopBar";const vc=l("header",{"> div":{width:"100%"}}),yc=({children:e,...t})=>u.default.createElement(vc,{...t},u.default.createElement(he,{css:{mx:"$3"}},e)),xc=l("a",pa),wc=l("button",pa),Ec=({active:e,children:t,disabled:o,href:r,onClick:n,...i})=>r?u.default.createElement(xc,{active:e,href:r,onClick:n,...i},t):u.default.createElement(wc,{active:e,disabled:o,onClick:n,...i},t),Cc=l(q.Trigger,{}),Z=({children:e,...t})=>u.default.createElement(zr.Root,{...t},e);Z.Accordion=ac,Z.AccordionContent=tc,Z.AccordionTrigger=nc,Z.Body=ic,Z.Close=lc,Z.Content=dc,Z.Footer=mc,Z.Header=yc,Z.Item=Ec,Z.Trigger=Cc;const Sc=l("div",{height:"$space$3",mt:"$3",position:"relative",width:"100%"}),Oo=(e,t,o)=>(e-t)/(o-t)*100,kc=(e,t,o)=>{const r=Oo(e,t,o);return r<=10?0:r>=90?100:50},Dc=({min:e,max:t,steps:o=[]})=>o.length===0?null:a.createElement(Sc,null,o.map(r=>a.createElement(L,{as:"span",key:r.value,css:{position:"absolute",color:"$tonal300"},style:{left:`${Oo(r.value,e,t)}%`,transform:`translateX(-${kc(r.value,e,t)}%)`}},r.label))),zc=({value:e=[],outputLabel:t=o=>`Current value is ${o}`})=>a.createElement(L,{css:{mt:"$4",color:"$tonal300",width:"100%"}},t(e.length===1?e[0]:e)),ha=l(tt.Track,{borderRadius:"$round",flexGrow:1,position:"relative",'&[data-orientation="horizontal"]':{height:"$space$1"},'&[data-orientation="vertical"]':{width:"$space$1"}}),Ic=l(tt.Root,{alignItems:"center",display:"flex",position:"relative",touchAction:"none",userSelect:"none",cursor:"pointer",'&[data-orientation="horizontal"]':{height:"$1"},'&[data-orientation="vertical"]':{flexDirection:"column",width:"$1"},"&[data-disabled]":{cursor:"not-allowed",bg:"$tonal100"},variants:{theme:{light:{[`${ha}`]:{bg:"#fff"}},tonal:{[`${ha}`]:{bg:"$tonal200"}}}}}),Tc=l(tt.Range,{bg:"$primary",borderRadius:"$round",height:"100%",position:"absolute","&[data-disabled]":{bg:"$tonal200",cursor:"not-allowed"}}),Rc=l(tt.Thumb,{bg:"$primaryMid",borderRadius:"$round",display:"block",size:"$1","&:hover":{bg:"$primaryDark"},"&:focus":{outline:"2px solid $primaryMid",outlineOffset:"2px"},"&[data-disabled]":{bg:"$tonal200",cursor:"not-allowed"}}),Ce=({value:e,defaultValue:t,min:o=0,max:r=100,theme:n="tonal",css:i,children:s,...c})=>{const d=e||t;return a.createElement(Fe,{css:i},a.createElement(Ic,{theme:n,defaultValue:t,value:e,min:o,max:r,...c},a.createElement(ha,null,a.createElement(Tc,null)),(d==null?void 0:d.length)&&d.map((m,p)=>a.createElement(Rc,{key:`thumb${p}`}))),s)};Ce.Value=zc,Ce.Steps=Dc,Ce.displayName="Slider";const Ho=({css:e,label:t,name:o,defaultValue:r,outputLabel:n,min:i=0,max:s=100,steps:c=[],...d})=>{const{control:m}=H.useFormContext();return u.default.createElement(te,{css:e,fieldId:o,label:t},u.default.createElement(H.Controller,{control:m,name:o,defaultValue:r,render:({onChange:p,value:h})=>u.default.createElement(Ce,{name:o,defaultValue:r,onValueChange:p,value:h,min:i,max:s,...d},u.default.createElement(Ce.Steps,{min:i,max:s,steps:c}),u.default.createElement(Ce.Value,{value:h||r,outputLabel:n}))}))};Ho.displayName="SliderField";const Vo=a.createContext({steps:[],goToPreviousStep:()=>null,goToNextStep:()=>null,goToStep:()=>null,activeStep:0,viewedSteps:[],allowSkip:!1,direction:"horizontal",hideLabels:!1,completedSteps:[],showCompletedIcons:!1}),Fc=({children:e,stepCount:t,allowSkip:o,onComplete:r,onStepChange:n,direction:i,steps:s,hideLabels:c,showCompletedIcons:d})=>{const[m,p]=a.useState(0),[h,g]=a.useState([0]),[f,$]=a.useState([]),y=!t;a.useEffect(()=>{g(x=>x.includes(m)?x:[...x,m]),n==null||n(m)},[m,n]);const C=()=>{const x=r&&m===t-1,S=m<t-1;if((r||S)&&$(F=>F.includes(m)?F:[...F,m]),x)return r==null?void 0:r();if(S)return p(F=>F+1)},E=()=>{p(x=>x-1)},T=x=>{p(x)};return a.createElement(Vo.Provider,{value:{steps:s||Array(t).fill(""),goToPreviousStep:y?void 0:E,goToNextStep:y?void 0:C,goToStep:y?void 0:T,activeStep:m,viewedSteps:h,completedSteps:f,allowSkip:o,direction:i,hideLabels:c,showCompletedIcons:d}},e)},ga=()=>{const e=a.useContext(Vo);if(!e)throw new Error("Ensure that you wrap any components with the root component Stepper");return e},Nc=({label:e,children:t,...o})=>{const{activeStep:r,goToPreviousStep:n}=ga();return a.createElement(ne,{size:"sm",appearance:"outline",...o,disabled:r===0,onClick:n},t||(e==null?void 0:e(r)))},Mc=({label:e,children:t,onClick:o,...r})=>{const{goToNextStep:n,activeStep:i}=ga();return a.createElement(ne,{size:"sm",...r,onClick:()=>{if(o)return o(n);n==null||n()},css:{ml:"auto"}},t||(e==null?void 0:e(i)))},Ac=l(z,{position:"relative",p:"$2",justifyContent:"center",alignItems:"center",size:"$3",borderRadius:"50%",border:"none",bg:"$tonal100",zIndex:1,flex:"none",variants:{status:{default:{bg:"$tonal100",color:"$tonal300"},active:{bg:"white",color:"$primaryMid",border:"2px solid",borderColor:"currentColor"},viewed:{bg:"white",border:"2px solid $tonal200",color:"$tonal600"},completed:{bg:"$primary",color:"white"},reviewed:{bg:"$primaryMid",color:"white"},success:{bg:"$success",color:"white"}}}}),Lc=l(z,{position:"relative",fontFamily:"$body",fontWeight:600,fontSize:"$md",alignItems:"center","&:not(:last-child)::after":{content:"",position:"absolute"},"&:focus-visible":{outline:"none"},variants:{canInteract:{true:{}},direction:{vertical:{py:"$3",flexDirection:"row","&:not(:last-child)::after":{height:"100%",width:"4px",left:"14px",top:"50%"}},horizontal:{px:"$2",flexDirection:"column","&:not(:last-child)::after":{width:"100%",height:"4px",left:"50%",top:"14px"}}},separator:{default:{"&:not(:last-child)::after":{bg:"$tonal100"}},active:{"&:not(:last-child)::after":{bg:"$primary"}},success:{"&:not(:last-child)::after":{bg:"$success"}},viewed:{"&:not(:last-child)::after":{bg:"$tonal200"}}},status:{completed:{},active:{},default:{},viewed:{},success:{},reviewed:{}}},compoundVariants:[{canInteract:!0,status:"completed",css:{"&:hover":{"& :first-child":{bg:"$primaryMid",color:"white !important"},"& :last-child":{color:"$primaryMid"}},"&:focus-visible":{"& :first-child":{outline:"2px solid $primary",outlineOffset:"2px"}}}},{canInteract:!0,status:"active",css:{"&:hover":{"& :first-child":{borderColor:"$tonal400",color:"$tonal600"},"& :last-child":{color:"$tonal600"}},"&:focus-visible":{"& :first-child":{outline:"2px solid $primary",outlineOffset:"2px"}}}},{canInteract:!0,status:"viewed",css:{"&:hover":{"& :first-child":{borderColor:"$tonal400",color:"$tonal600"},"& :last-child":{color:"$tonal600"}},"&:focus-visible":{"& :first-child":{outline:"2px solid $primary !important",outlineOffset:"2px !important"}}}},{canInteract:!0,status:"reviewed",css:{"&:focus-visible":{"& :first-child":{outline:"2px solid $primary !important",outlineOffset:"2px !important"}}}}]}),Pc=l(L,{fontWeight:600,variants:{direction:{vertical:{ml:"$3",textAlign:"left"},horizontal:{mt:"$3",textAlign:"center"}},status:{default:{color:"$tonal300",fontWeight:400},active:{color:"$primaryMid"},viewed:{color:"$tonal600"},completed:{color:"$primary"},success:{color:"$success"},reviewed:{}}}});var B=(e=>(e.ACTIVE="active",e.VIEWED="viewed",e.SUCCESS="success",e.DEFAULT="default",e.COMPLETED="completed",e.REVIEWED="reviewed",e))(B||{});const Wc=l(z,{justifyContent:"space-between",variants:{direction:{vertical:{flexDirection:"column"},horizontal:{flexDirection:"row"}}}}),Bc=({css:e})=>{const{steps:t,goToStep:o,activeStep:r,viewedSteps:n,allowSkip:i,direction:s,hideLabels:c,completedSteps:d,showCompletedIcons:m}=ga(),p=g=>{const f=t[g];return f.status?f.status:d.length===t.length?B.SUCCESS:r===g&&d.includes(r)?B.REVIEWED:r===g?B.ACTIVE:d.includes(g)?B.COMPLETED:n.includes(g)?B.VIEWED:B.DEFAULT},h=g=>{var f;const $=(f=t[g])==null?void 0:f.status;return d.length===t.length||$===B.SUCCESS?B.SUCCESS:$===B.COMPLETED||g<Math.max(...n)?B.ACTIVE:$===B.VIEWED?B.VIEWED:B.DEFAULT};return a.createElement(Wc,{css:e,direction:s},t.map((g,f)=>{const $=p(f),y=h(f);return a.createElement(Lc,{tabIndex:0,key:`step_${f}`,direction:s,separator:y,status:$,css:s==="horizontal"?{width:`calc(100% / ${t.length})`}:{height:`calc(100% / ${t.length})`},canInteract:i},a.createElement(Ac,{as:i?"button":"div",onClick:()=>i&&n.includes(f)?o==null?void 0:o(f):void 0,status:$,"aria-current":f===r?"step":void 0,"aria-label":g.label?"":`step ${f+1}`,"aria-labelledby":g.label?`step-${f}`:void 0,css:{cursor:i&&n.includes(f)?"pointer":"auto"}},g.status===B.SUCCESS||m&&$===B.COMPLETED?a.createElement(b,{is:v.Ok}):f+1),g.label&&!c&&a.createElement(Pc,{as:"span",id:`step-${f}`,direction:s,status:$},g.label))}))},Qe=({children:e,stepCount:t,allowSkip:o,onComplete:r,onStepChange:n,direction:i="horizontal",steps:s,hideLabels:c=!1,showCompletedIcons:d=!1,css:m})=>{Te.default(!(t&&s),"`Stepper` should only be given one of `stepCount` or `steps`. When both are provided, `steps` will be used and `stepCount` will be ignored.");const p=(s==null?void 0:s.length)||t||0;return a.createElement(Fc,{stepCount:p,allowSkip:o,onComplete:r,onStepChange:t?n:void 0,direction:i,steps:s||Array(p).fill(""),hideLabels:c,showCompletedIcons:d},a.createElement(w,{"aria-label":"progress",css:{width:"100%",...m}},e))};Qe.StepBack=Nc,Qe.StepForward=Mc,Qe.Steps=Bc,Qe.displayName="Stepper";const Oc=l(Ea.Root,{appearance:"none",backgroundColor:"$tonal200",border:"none",borderRadius:"$round",cursor:"pointer",display:"flex",overflow:"hidden",p:"$0",position:"relative",transition:"all 50ms ease-out",width:"$4","&:hover":{backgroundColor:"$tonal300"},"&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},'&[data-state="checked"]':{backgroundColor:"$primary"},'&[data-state="checked"]:hover':{backgroundColor:"$primaryMid"}}),Hc=l(Ea.Thumb,{backgroundColor:"white",borderRadius:"$round",display:"block",size:"$1",transition:"transform 50ms",willChange:"transform",'&[data-state="checked"]':{transform:"translateX(calc($sizes$2 - $space$1))"}}),qo=e=>a.createElement(Oc,{...e},a.createElement(Hc,null));qo.displayName="Switch";const Vc=({delay:e=500}={})=>{const[t,o]=Y.useState({width:void 0,height:void 0});return Y.useEffect(()=>{const r=et.debounce(e,()=>{o({width:window.innerWidth,height:window.innerHeight})});return window.addEventListener("resize",r),r(),()=>window.removeEventListener("resize",r)},[e]),t},qc=l(Pt,{position:"relative",borderBottom:"1px solid $base3",width:"100%"}),_c=l(at.List,{flexShrink:0,display:"flex",width:"100%",overflowX:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}),_o=l(M,{height:"100% !important",position:"absolute",top:"50%",transform:"translateY(-50%)",cursor:"pointer",background:"$background !important",color:"$interactive1 !important",borderRadius:0,opacity:.9}),Gc=10,Go=({children:e,colorScheme:t={},...o})=>{const[r,n]=Cl(),{width:i}=Vc(),[s,c]=u.default.useState(!1),[d,m]=u.default.useState(!1),p=u.default.useCallback(h=>{if(!r)return;const{scrollWidth:g,scrollLeft:f,offsetWidth:$}=r,y=Math.round(g*(Gc/100));let C=f;if(h==="right"){const E=f+y;C=E+$<=g?E:g-$}else{const E=f-y;C=E>0?E:0}r.scroll({left:C,behavior:"smooth"}),setTimeout(()=>{const{scrollWidth:E,scrollLeft:T,offsetWidth:x}=r,S=E-(T+x);T===0?(c(!1),m(!0)):S<5?(m(!1),c(!0)):(c(!0),m(!0))},500)},[r]);return u.default.useEffect(()=>{var h;if(!r)return;const{offsetWidth:g,scrollWidth:f}=r,$=f>g;(h=r.scroll)==null||h.call(r,{left:0}),c(!1),m($)},[r,i]),u.default.createElement(qc,{base:"slate",accent:"blue",interactive:"hiContrast1",...t,...o},s&&u.default.createElement(_o,{label:"scroll left",size:"md",css:{left:0},onClick:()=>p("left")},u.default.createElement(b,{is:v.ChevronLeft})),u.default.createElement(_c,{ref:n},e),d&&u.default.createElement(_o,{label:"scroll right",size:"md",css:{right:0},onClick:()=>p("right")},u.default.createElement(b,{is:v.ChevronRight})))};Go.displayName="TabsTriggerList";const jc=l(at.Trigger,{background:"none",border:"none",cursor:"pointer",flexShrink:0,p:"$4",userSelect:"none",borderBottom:"2px solid transparent",'&[data-state="active"]':{color:"$interactive1",fontWeight:600,letterSpacing:"-0.005em",borderColor:"currentColor"},"&[data-disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([data-disabled])":{"&:hover, &:focus-visible":{color:"$interactive2",bg:"$accentA1"},"&:active":{color:"$interactive3"},"&:focus-visible":{...be()}}}),jo=({children:e,...t})=>a.createElement(jc,{asChild:!0,...t},a.createElement(L,{size:"sm",as:"button"},e));jo.displayName="TabsTrigger";const Yc=l(at.Content,{flexGrow:1,fontFamily:"$body"}),Yo=Yc;Yo.displayName="TabsContent";const Uc=l(at.Root,{width:"100%"}),Ze=({children:e,...t})=>a.createElement(Uc,{...t},e);Ze.TriggerList=Go,Ze.Trigger=jo,Ze.Content=Yo,Ze.displayName="Tabs";const Xc=l("textarea",{boxShadow:"none",fontSize:"$md",appearance:"none",border:"1px solid $tonal400",borderRadius:"$0",boxSizing:"border-box",color:"$tonal600",fontFamily:"$body",fontWeight:400,lineHeight:1.4,minHeight:"$7",px:"$3",py:"calc($2 + $1)",resize:"vertical",transition:"all 75ms ease-out",width:"100%","&:focus":{borderColor:"$primary",outline:"none"},"&[disabled]":{backgroundColor:"$tonal100",color:"$tonal400",cursor:"not-allowed"},"&::placeholder":{color:"$tonal300",opacity:1},variants:{state:{error:{border:"1px solid $danger"}}}}),fa=a.forwardRef((e,t)=>a.createElement(Xc,{...e,ref:t}));fa.displayName="Textarea";const Uo=({css:e=void 0,label:t,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return a.createElement(te,{css:e,description:i,error:d,fieldId:o,label:t,prompt:n,required:Boolean(r==null?void 0:r.required)},a.createElement(fa,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Uo.displayName="TextareaField";const Xo=400,Jc=D({"0%":{transform:"translate3d(0,-100%,0)",opacity:0},"100%":{transform:"translate3d(0,0,0)",opacity:1}}),Kc=D({"0%":{transform:"translate3d(0,0,0)",opacity:1},"100%":{transform:"translate3d(0,-100%,0)",opacity:0}}),Qc=l("div",{position:"absolute",width:"100%",variants:{visible:{true:{"@allowMotion":{animation:`${Jc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}},false:{opacity:0,"@allowMotion":{animation:`${Kc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}}}}}),Zc=l("div",{pointerEvents:"auto",alignItems:"center",borderRadius:"$0",boxShadow:"$1",boxSizing:"border-box",color:"white",display:"flex",minHeight:"$5",pl:"$4",position:"relative",pr:"$6",py:"$4",transition:"background-color 50ms ease-out",width:"100%","@sm":{width:Xo},"@allowMotion":{transition:"background-color 50ms ease-out, transform 150ms ease-out"},variants:{status:{blank:{bg:"$primary"},error:{bg:"$danger"},loading:{bg:"$primary"},success:{bg:"$success"}}}}),ed=a.memo(({ariaLive:e,height:t,id:o,message:r,role:n,type:i="blank",visible:s,calculateOffset:c,updateHeight:d})=>{const m=c(o,{reverseOrder:!0,margin:8});return a.createElement(Qc,{visible:s},a.createElement(Zc,{ref:p=>{p&&t===void 0&&d(o,p.getBoundingClientRect().height)},status:i,role:n,"aria-live":e,style:{transform:`translateY(${m}px)`}},i==="error"&&a.createElement(b,{size:"sm",css:{mr:"$3",flex:"0 0 auto"},is:v.Error}),a.createElement(L,null,r),i==="loading"?a.createElement(lt,{css:{flex:"0 0 auto",ml:"auto"}}):a.createElement(M,{css:{position:"absolute",top:"$2",right:"$2",color:"white","&:hover,&:focus":{color:"white",opacity:.5}},label:"Close alert",onClick:()=>St.toast.dismiss(o)},a.createElement(b,{is:v.Close}))))}),td=l("div",{left:"$2",position:"fixed",top:"$2",right:"$2",zIndex:it,"@sm":{top:"$3",right:"auto",left:`calc(50% - ${Xo/2}px)`}}),Jo=({children:e})=>{const{toasts:t,handlers:o}=St.useToaster(),{startPause:r,endPause:n,calculateOffset:i,updateHeight:s}=o;return a.createElement(a.Fragment,null,a.createElement(td,{onMouseEnter:r,onMouseLeave:n},t.map(c=>a.createElement(ed,{key:c.id,calculateOffset:i,updateHeight:s,...c}))),e)};Jo.displayName="ToastProvider";const Se=l(ot.Item,{bg:"white",color:"$tonal400",border:"1px solid $tonal200",cursor:"pointer","&::before":{background:"$tonal200"},"&:not([disabled])":{'&:hover, &:focus-visible, &[data-state="on"]':{"&::before":{background:"none"}},"&:hover":{borderColor:"currentColor !important",color:"$primaryMid"},"&:focus-visible":{...be(),'&[data-state="off"]':{borderColor:"$tonal200 !important"},'&[data-state="on"]':{boxShadow:`inset currentColor 0px 0px 0px 1px, ${be().boxShadow}`}}},"&[disabled]":{opacity:.3,cursor:"not-allowed"},'&[data-state="on"]':{color:"$primary",borderColor:"currentColor !important",boxShadow:"inset currentColor 0px 0px 0px 1px"}}),ad=Se,wt={sm:"32px",md:"40px",lg:"48px"},od={sm:"$4",md:"$5",lg:"$5"},rd={sm:"$2",md:"$3",lg:"$3"},$a=e=>({fontSize:`$${e}`,px:od[e],minHeight:wt[e],"& > *:not(:last-child)":{mr:rd[e]}}),nd=l(Se,{flexGrow:1,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,lineHeight:1,py:"$1",[`& ${ka}`]:{flexShrink:0},variants:{size:{sm:$a("sm"),md:$a("md"),lg:$a("lg")},isIconOnly:{true:{}}},compoundVariants:[{isIconOnly:!0,size:"sm",css:{minWidth:wt.sm,p:0}},{isIconOnly:!0,size:"md",css:{minWidth:wt.md,p:0}},{isIconOnly:!0,size:"lg",css:{minWidth:wt.lg,p:0}}]}),id=a.forwardRef(({size:e="md",children:t,...o},r)=>{var n;const i=a.Children.toArray(t),s=i.length<=1,c=s&&a.isValidElement(i[0])&&((n=i[0])==null?void 0:n.type)===b;return a.createElement(nd,{ref:r,size:e,isIconOnly:c,...o},i.map(d=>!s&&(typeof d=="string"||typeof d=="number")?a.createElement("span",{key:d},d):a.isValidElement(d)&&(d==null?void 0:d.type)===b?a.cloneElement(d,{...d.props,size:e}):d))}),ld=l(ot.Root,{width:"fit-content",variants:{isFullWidth:{true:{width:"100%",[`& ${Se}`]:{flexBasis:0,flexGrow:1}}},hasGap:{true:{[`& ${Se}`]:{borderRadius:"$0"}},false:{borderRadius:"$0",bg:"white",[`& ${Se}`]:{bg:"transparent",borderRadius:0,position:"relative","&:not(:last-child)::before":{content:"",position:"absolute"}}}},direction:{column:{},row:{}}},compoundVariants:[{hasGap:!1,direction:"row",css:{[`& ${Se}`]:{"&:not(:last-child)::before":{top:"-1px",height:"calc(100% + 2px)",width:"1px",right:"0",transform:"translateX(150%)"},"&:not(:first-child)":{borderLeftColor:"transparent"},"&:not(:last-child)":{borderRightColor:"transparent"},"&:first-child":{borderTopLeftRadius:"$0",borderBottomLeftRadius:"$0"},"&:last-child":{borderTopRightRadius:"$0",borderBottomRightRadius:"$0"}}}},{hasGap:!1,direction:"column",css:{[`& ${Se}`]:{"&:not(:last-child)::before":{bottom:0,left:"-1px",height:"1px",width:"calc(100% + 2px)",transform:"translateY(150%)"},"&:first-child":{borderTopLeftRadius:"$0",borderTopRightRadius:"$0"},"&:last-child":{borderBottomLeftRadius:"$0",borderBottomRightRadius:"$0"},"&:not(:first-child)":{borderTopColor:"transparent"},"&:not(:last-child)":{borderBottomColor:"transparent"}}}}]}),sd=e=>e==="horizontal"?"row":"column",cd=a.forwardRef(({orientation:e="horizontal",gap:t=!1,isFullWidth:o,children:r,wrap:n="no-wrap",...i},s)=>{const c=typeof t=="number",d=sd(e);return a.createElement(ld,{ref:s,direction:d,hasGap:c,isFullWidth:o,orientation:e,...i},a.createElement(Le,{direction:d,gap:c&&t,align:!1,wrap:n},r))}),dd={Item:ad,Button:id,Root:cd},md=l(Nr.default,{}),Ko=a.forwardRef(({id:e,ratio:t=9/16,css:o,...r},n)=>a.createElement(Fe,{css:o},a.createElement(w,{css:{borderRadius:"$0",position:"relative",paddingTop:`${t*100}%`,overflow:"hidden",height:0,width:"100%"}},a.createElement(md,{...r,role:"figure",url:`https://player.vimeo.com/video/${e}`,height:"100%",width:"100%",css:{position:"absolute",top:0,left:0},ref:n}))));Ko.displayName="Video",Object.defineProperty(exports,"toast",{enumerable:!0,get:function(){return Fr.default}}),exports.Accordion=Ge,exports.ActionIcon=M,exports.AlertDialog=G,exports.AlertProvider=_n,exports.Avatar=We,exports.Badge=Wa,exports.Box=w,exports.Button=ne,exports.Carousel=ve,exports.Checkbox=ct,exports.CheckboxField=Ya,exports.Chip=de,exports.ChipDismissibleGroup=Jt,exports.ChipGroup=Ut,exports.ChipToggleGroup=Kt,exports.Combobox=xe,exports.DataTable=W,exports.DateField=ho,exports.DateInput=aa,exports.Dialog=ue,exports.Dismissible=gt,exports.DismissibleGroup=ye,exports.Divider=Gt,exports.DropdownMenu=Ee,exports.EmptyState=Ke,exports.FieldWrapper=te,exports.FileInput=xo,exports.Flex=z,exports.Form=ja,exports.Grid=wo,exports.Heading=st,exports.Icon=b,exports.Image=Pe,exports.InlineFieldWrapper=ht,exports.InlineMessage=dt,exports.Input=we,exports.InputField=Eo,exports.Label=Be,exports.Link=ut,exports.List=mt,exports.Loader=lt,exports.MarkdownContent=Co,exports.NavigationMenu=pe,exports.NotificationBadge=Vs,exports.NumberInput=da,exports.NumberInputField=Fo,exports.PasswordField=No,exports.PasswordInput=ma,exports.Popover=le,exports.ProgressBar=Mo,exports.RadioButton=pt,exports.RadioButtonField=ua,exports.RadioButtonGroup=Yt,exports.RadioCard=Lo,exports.RadioCardGroup=Ks,exports.SearchField=Po,exports.SearchInput=bt,exports.Select=vt,exports.SelectField=Wo,exports.Sidedrawer=Z,exports.Slider=Ce,exports.SliderField=Ho,exports.Stack=Le,exports.StackContent=na,exports.Stepper=Qe,exports.StyledButton=Ra,exports.StyledLink=qa,exports.Switch=qo,exports.Table=I,exports.Tabs=Ze,exports.Text=L,exports.Textarea=fa,exports.TextareaField=Uo,exports.ToastProvider=Jo,exports.ToggleGroup=dd,exports.Tooltip=K,exports.TopBar=he,exports.Video=Ko,exports.createTheme=Pr,exports.createThemeVariants=It,exports.css=Ar,exports.focusVisibleStyleBlock=be,exports.getCssText=Lr,exports.globalCss=Ca,exports.keyframes=D,exports.media=zt,exports.styled=l,exports.theme=_,exports.useAlert=Gn,exports.useCarousel=di,exports.useDataTable=J,exports.utils=Dt;