@atom-learning/components 2.35.0 → 2.36.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,2 +1,2 @@
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"),Ct=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"),fe=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"),$e=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"),fr=require("micromark-extension-directive"),$r=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"),St=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),Re=U(er),kt=ee(tr),xa=ee(or),Te=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(fr),ce=ee($r),wa=ee(br),Ea=ee(vr),Rr=U(St),Tr=U(yr);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)"},Nr=ya.createStitches({theme:xr,utils:Dt,media:zt}),{css:Fr,getCssText:Mr,createTheme:Ar,globalCss:Ca,keyframes:z,styled:l,theme:q}=Nr,It=(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 Ne=({css:e,children:a})=>e?t.createElement(E,{css:e},a):t.createElement(t.Fragment,null,a);Ne.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"}),Rt=z({"0%":{opacity:0,transform:"translateY(2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Tt=z({"0%":{opacity:0,transform:"translateX(-2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Nt=z({"0%":{opacity:0,transform:"translateY(-2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Ft=z({"0%":{opacity:0,transform:"translateX(2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Mt=z({"0%":{opacity:0},"100%":{opacity:1}}),rt=z({"0%":{opacity:1},"100%":{opacity:0}}),Pr=z({"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(0)"}}),Wr=z({"0%":{transform:"translateX(0)"},"100%":{transform:"translateX(-100%)"}}),Br=z({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Or=z({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(Ne,{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",At={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],Lt=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,g]=un,h=[Lt((s-m)/nt[i]+m),Lt((d-p)/nt[i]+p),Lt((c-g)/nt[i]+g),nt[i]];o[`${e}A${i+1}`]=`rgba(${h.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:Fe}=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"]=Fe("interactive-loContrast1",{colors:{interactiveForeground:"$foreground",interactive1:"white",interactive2:"$accent1",interactive3:"$accent2"}}),re["interactive-loContrast2"]=Fe("interactive-loContrast2",{colors:{interactiveForeground:"$foreground",interactive1:"$accent1",interactive2:"$accent2",interactive3:"$accent3"}}),re["interactive-hiContrast1"]=Fe("interactive-hiContrast1",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent7",interactive2:"$accent8",interactive3:"$accent9"}}),re["interactive-hiContrast2"]=Fe("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]=Fe(o,{colors:Ia("base",a)})})},fn={slate:"slate",blue:"blue"},$n=()=>{Object.entries(fn).forEach(([e,a])=>{const o=`accent-${e}`;re[o]=Fe(o,{colors:Ia("accent",a)})})};gn(),$n();const bn=pn("div"),it=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?Ct.Slot:bn,{ref:s,className:d,...i})});it.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(it,{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")}]}),A=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 ${A.displayName}`;return Re.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 Re.default(p.type===b,`Children of type ${p==null?void 0:p.type} aren't permitted. Only an ${b.displayName} component is allowed in ${A.displayName}`),t.cloneElement(p,{size:En[r],css:{...p.props.css?p.props.css:{}}})}))});A.displayName="ActionIcon";const lt=2147483647,Ue=1147483646,Sn=10,kn=10,Dn=10,Pt="translate3d(-50%, -50%, 0)",Ra="translate3d(-50%, 50vh, 0)",zn=z({"0%":{transform:Ra},"100%":{transform:Pt}}),In=z({"0%":{transform:Pt},"100%":{transform:Ra}}),Rn=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`}}}),Tn=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"}}}}),Nn=({size:e="sm",...a})=>t.createElement(oe.Portal,null,t.createElement(Rn,null),t.createElement(Tn,{size:e,...a})),Fn=l(oe.Root,{}),G=e=>t.createElement(Fn,{...e});G.Description=oe.Description,G.Title=oe.Title,G.Action=oe.Action,G.Cancel=oe.Cancel,G.Content=Nn,G.Trigger=oe.Trigger,G.displayName="AlertDialog";const Mn=()=>{const e=Y.useRef();return Y.useEffect(()=>(e.current=!0,()=>{e.current=!1})),e},I=l("div",{display:"flex"});I.displayName="Flex";const An=z({"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"}}}}),st=({css:e={},message:a="Loading",size:o="md",...r})=>t.createElement(I,{css:{justifyContent:"center",...e},role:"alert",...r},t.createElement(kt.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}}),Ta=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(st,{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}},Na=(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(Ta,{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},Na(e,i)):Na(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 !important"}}}}}),ct=t.forwardRef(({size:e="md",...a},o)=>t.createElement(Ot,{ref:o,size:e,...a}));ct.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:{...It("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(Ne,{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 !important"}}}},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(ct,{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}},Fa=t.createContext({showAlert:()=>null}),Vn=({children:e})=>{const[a,o]=t.useReducer(Hn,On),r=Mn();return t.createElement(Fa.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(Fa);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(I,{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(Ne,{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"}}}}),dt=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}}))));dt.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(I,{variants:{theme:mi}}),hi=l(b,{flexShrink:"0",mr:"$2"}),mt=({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"}}]}),fi=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(fi,{"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"}}}}}}),ut=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}));ut.Item=Oe;const $i=l(E,{bg:"$tonal100",borderRadius:"$1",color:"$tonal600",fontFamily:"$mono",fontSize:"$sm",lineHeight:1.4,my:"$4",p:"$3"}),bi=({node:e})=>t.createElement($i,{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(ct,{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(pt,{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(ut,{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(ut.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}),Ri=({node:e,handleNode:a})=>{var o;return t.createElement(Ii,null,(o=e.children)==null?void 0:o.map(a))},Ti=({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})),Ni=({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}),pt=t.forwardRef(({size:e="md",href:a,...o},r)=>t.createElement(_a,{...!a&&{as:"button",noCapsize:!0},size:e,href:a,...o,ref:r}));pt.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?kt.Root:I;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(pt,{href:i.link,size:"sm"},i.label)),s&&t.createElement(Gt,{css:{mb:"$3"}},s),a,o&&t.createElement(mt,{css:{mt:"$2"}},o))};te.displayName="FieldWrapper";const Fi=l(Te.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(Te.Indicator,{size:"6px",borderRadius:"$round",backgroundColor:"currentcolor",position:"absolute"}),ht=e=>t.createElement(Fi,{...e},t.createElement(Mi,null));ht.displayName="RadioButton";const jt=l(Te.Root,{display:"flex",flexWrap:"wrap",variants:{direction:{row:{flexDirection:"row","& > *:not(:last-child)":{mr:"$5"}},column:{flexDirection:"column"}}}});jt.displayName="RadioButtonGroup";const gt=({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)===dt||(c==null?void 0:c.type)===ht)&&{transform:"translateY($space$1)"}}},c)),s),i&&t.createElement(mt,{css:{mt:"$2"}},i),r&&t.createElement(Gt,{css:{mt:"$2",[n==="reverse"?"mr":"ml"]:"calc($space$3 + $sizes$1)"}},r));gt.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(g=>{var h;if(!((h=i.exclude)!=null&&h.includes(g)))return g});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})=>{Re.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:g}=c,h=i?i(c):e,f={formMethods:c,handleSubmit:m,onSubmit:o,onError:r,...d};return s?t.createElement(Li,{persist:s,watch:p,setValue:g},t.createElement(Ga,{...f},h)):t.createElement(Ga,{...f},h)};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,label:a,name:o,validation:r,description:n,defaultChecked:i=!1,checked:s,...d})=>{const{control:c}=H.useFormContext(),{error:m}=ie(o),{field:{ref:p,onChange:g,value:h,name:f}}=H.useController({name:o,control:c,rules:r,defaultValue:i});return t.useEffect(()=>{typeof s<"u"&&g(s)},[s]),t.createElement(gt,{css:e,description:n,error:m,label:a,required:Boolean(r==null?void 0:r.required)},t.createElement(dt,{ref:p,name:f,...d,onCheckedChange:g,value:h?"on":"off",checked:h,...m&&{state:"error"}}))};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,i)=>!r&&typeof n=="string"?t.createElement(E,{as:"span",css:Ua,key:n},n):t.isValidElement(n)&&n.type===b?t.createElement(Xa,{key:`icon-${i}`,...n.props}):n))},Vi=l(I,{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?Ct.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?Ct.Slot:Ui,{...i})},ft=Yi;ft.Trigger=Ka,ft.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(ft,{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(A,{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:g,pageSize:h}=o,f={pageIndex:(i=a==null?void 0:a.pageIndex)!=null?i:g,pageSize:(s=a==null?void 0:a.pageSize)!=null?s:h,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},$=await e(f);return Re.default(Array.isArray($==null?void 0:$.results),"The getAsyncData function must return an object with a property `result` which must be an array"),Re.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"),$},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:g,setPaginationState:h}=ul(n==null?void 0:n.pagination),[f,$]=t.useState(X.NONE),[y,R]=t.useState(""),{setIsSortable:w,isSortable:k,sorting:x,setSorting:C}=pl(r),S=t.useCallback(async M=>{if(o)try{$(X.PENDING);const V=await dl(o,M,g,x,y);c(V),$(X.FULFILLED)}catch{$(X.REJECTED)}},[o,g==null?void 0:g.pageIndex,g==null?void 0:g.pageSize,x,y]);t.useEffect(()=>{S({})},[S]),Cr.default(()=>{!a||c({results:a,total:a.length})},[a]);const T=()=>d.total,P=se.useReactTable({columns:e,data:d.results,pageCount:g?Math.ceil(T()/g.pageSize):-1,initialState:n,state:{sorting:x,globalFilter:y,pagination:g},manualPagination:o&&m,manualSorting:o&&m,enableSorting:f!==X.PENDING,enableGlobalFilter:!o,getCoreRowModel:se.getCoreRowModel(),getPaginationRowModel:m?se.getPaginationRowModel():void 0,getSortedRowModel:k||x.length?se.getSortedRowModel():void 0,getFilteredRowModel:se.getFilteredRowModel(),onPaginationChange:m?h:void 0,onSortingChange:C,onGlobalFilterChange:R}),N=t.useMemo(()=>({...P,data:d,setData:c,setIsSortable:w,applyPagination:p,getTotalRows:T,isSortable:k,asyncDataState:f,runAsyncData:S}),[P,p,T,k]);return t.createElement(eo.Provider,{value:N},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"},fl=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(fl,{theme:e,...a});ro.displayName="TableHeader";const $l=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:{}}}}),F=({size:e="md",corners:a="round",...o})=>t.createElement($l,{size:e,corners:a,...o});F.Body=ao,F.Cell=He,F.Footer=oo,F.FooterCell=$t,F.Header=ro,F.HeaderCell=me,F.Row=to,F.displayName="Table";const bl=({striped:e=!1,...a})=>{const{getRowModel:o}=J();return t.createElement(F.Body,{...a,striped:e},o().rows.map(r=>t.createElement(W.Row,{row:r,key:r.id})))},Zt=({cell:e})=>t.createElement(F.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(kt.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"}}),bt=t.forwardRef(({size:e="md",css:a,value:o,defaultValue:r="",onValueChange:n,clearText:i="Clear",onChange:s,...d},c)=>{const[m,p]=xl(),[g,h]=t.useState(r),[f,$]=t.useState(r?"CLEAR":"SEARCH");t.useEffect(()=>{typeof o>"u"||(h(o),$(o?"CLEAR":"SEARCH"))},[o]),t.useImperativeHandle(c,()=>m.current);const y=()=>{var k,x;const C=m.current;if(!C)return;const S=(k=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:k.set;(x=S==null?void 0:S.call)==null||x.call(S,C,"");const T=new Event("input",{bubbles:!0});C.dispatchEvent(T),C.focus(),n==null||n("")},R=k=>{s==null||s(k);const x=k.target.value;h(x),n==null||n(x),$(x?"CLEAR":"SEARCH")},w=()=>f==="SEARCH"?t.createElement(Cl,{is:v.Search,size:e,css:{size:e=="sm"?"$1":20}}):t.createElement(A,{label:i,theme:"neutral",size:e,css:{position:"absolute",top:"0",right:"$1"},onClick:y},t.createElement(b,{is:v.Close}));return t.createElement(E,{css:{position:"relative",...a}},t.createElement(Sl,{ref:p,size:e,type:"search",...d,value:g,onChange:R,css:{pr:e==="sm"?"$5":"$6"}}),w())});bt.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(bt,{...r,defaultValue: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(F.Header,{theme:a,...o},r().map(i=>t.createElement(F.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"}}),Rl=({header:e,children:a,css:o,...r})=>{const n=e.column.getIsSorted(),{isSortable:i}=J(),s=e.column.getCanSort();return t.createElement(F.HeaderCell,{onClick:i&&s?e.column.getToggleSortingHandler():void 0,css:{cursor:i&&s?"pointer":"initial",...o},...r},t.createElement(I,{css:{alignItems:"center"}},se.flexRender(e.column.columnDef.header,e.getContext()),n&&i&&t.createElement(I,{css:{position:"relative",alignItems:"center"}},t.createElement(Il,{direction:n}))))},Tl=l(st,{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(Tl,{...e})},Nl=({row:e})=>t.createElement(F.Row,null,e.getVisibleCells().map((a,o)=>t.createElement(Zt,{key:a.id,cell:a}))),Fl=({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(F,{...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=fe.useSensors(fe.useSensor(fe.PointerSensor),fe.useSensor(fe.KeyboardSensor,{coordinateGetter:_e.sortableKeyboardCoordinates}));return t.createElement(fe.DndContext,{sensors:s,collisionDetection:fe.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(F.Row,{ref:i,css:{transform:dr.CSS.Transform.toString(n),zIndex:s?5:void 0}},e.getVisibleCells().map((d,c)=>c===0?t.createElement(F.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(A,{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(F.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(F,{...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"}}}}),vt=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)});vt.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:Nt},'&[data-side="right"]':{animationName:Ft},'&[data-side="bottom"]':{animationName:Rt},'&[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(I,{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: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(A,{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(),g=p.pageIndex*p.pageSize+1,h=g+r().rows.length-1,f=m===X.PENDING||m===X.REJECTED;return t.createElement(Xl,{...e},t.createElement(L,{size:"sm"},`${g.toString()} - ${h.toString()} of ${c()} items`),t.createElement(Yl,{gotoPage:d,pageCount:n(),pageIndex:p.pageIndex,disabled:f}),t.createElement(I,{css:{justifyContent:"flex-end"}},t.createElement(lo,{direction:"previous",disabled:p.pageIndex===0||f,onClick:i,css:{mr:"$4"}}),t.createElement(lo,{direction:"next",disabled:p.pageIndex===n()-1||f,onClick:s})))},W=e=>t.createElement(hl,{...e});W.Body=bl,W.DataCell=Zt,W.DragAndDropTable=Vl,W.Head=Dl,W.HeaderCell=Rl,W.Pagination=Jl,W.Row=Nl,W.GlobalFilter=kl,W.Table=Fl,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,...g})=>{const[h,f]=t.useState(!1),[$,y]=t.useState(d==null?void 0:d.getFullYear()),R=N=>{const M=d;M.setFullYear(N),p(M),f(!1)},w=c&&$-16<=c.getFullYear(),k=m&&$>=m.getFullYear(),x=Array.from({length:16},(N,M)=>{const V=$-M;return m&&V>m.getFullYear()||c&&V<c.getFullYear()?0:V}),{calendars:C,getBackProps:S,getForwardProps:T,getDateProps:P}=mr.useDayzed({firstDayOfWeek:r,showOutsideDays:!0,date:d,minDate:c,maxDate:m,...g});return C.length?t.createElement(E,{css:{position:"relative",width:"min-content",mt:"-$1",...e}},t.createElement(I,{css:{position:"absolute",top:0,right:"-$1"}},t.createElement(A,{label:s[h?"previousYear":"previous"],theme:"neutral",size:"md",...!h&&S({calendars:C}),...h&&{onClick:()=>y($-16)},disabled:h&&w},t.createElement(b,{is:v.ChevronLeft})),t.createElement(A,{label:s[h?"nextYear":"next"],theme:"neutral",size:"md",...!h&&T({calendars:C}),...h&&{onClick:()=>y($+16)},disabled:h&&k},t.createElement(b,{is:v.ChevronRight}))),h&&t.createElement(ta,{css:{gridTemplateColumns:"repeat(4, 1fr)",pt:"$7",direction:"rtl",gridGap:"$3 $1"}},x.map((N,M)=>{const V=N===d.getFullYear();return N?t.createElement(es,{key:`${N}${M}`,theme:V?"primary":"neutral",onClick:()=>R(N),selected:V},N):t.createElement(E,{key:M,css:{width:"$6",height:"$4"}})})),!h&&C.map(({month:N,year:M,weeks:V})=>t.createElement(E,{key:`${N}${M}`},t.createElement(I,{css:{height:"$4",alignItems:"center",mb:"$4"}},t.createElement(ne,{theme:"neutral",css:{px:"0",color:"$tonal600"},onClick:()=>f(!0)},n[N]," ",M)),t.createElement(ta,{css:{mb:"$3"}},ts(i,r).map(ke=>t.createElement(L,{as:"span",size:"sm",key:`${N}${M}${ke}`,css:{fontWeight:600,textAlign:"center"}},ke))),t.createElement(ta,null,V.map((ke,Et)=>ke.map((D,j)=>{const Ve=`${N}${M}${Et}${j}`;if(!D)return t.createElement("div",{key:Ve});const{date:Jo,selected:ba,today:va,prevMonth:Ko,nextMonth:Qo}=D;return t.createElement(Zl,{isOutsideMonth:Ko||Qo,isSelected:ba,isToday:va,key:Ve,ref:ba?a:va?o:null,...P({dateObj:D}),type:"button"},Jo.getDate())})))))):null};co.displayName="Calendar";const as=l($e.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:Nt},'&[data-side="right"]':{animationName:Ft},'&[data-side="bottom"]':{animationName:Rt},'&[data-side="left"]':{animationName:Tt}}},variants:{size:{sm:{maxWidth:"200px"},md:{maxWidth:"400px"},lg:{maxWidth:"600px"}}}}),os=l($e.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(A,{as:$e.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($e.Root,{});const le=e=>t.createElement($e.Root,{...e});le.Content=rs,le.Portal=$e.Portal,le.Trigger=$e.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:g,...h},f)=>{const{date:$,dateString:y,setDate:R}=ns(e,a),w={...so,...d},[k,x]=t.useState(!1),C=t.useRef(null),S=t.useRef(null);return t.useEffect(()=>{m==null||m($)},[$,m]),t.createElement(E,{css:{position:"relative"}},t.createElement(we,{name:"date",disabled:r,size:s,...h,onChange:T=>R(T.target.value,!0),value:y,ref:f}),t.createElement(le,{modal:!0,open:k,onOpenChange:x},t.createElement(le.Trigger,{asChild:!0},t.createElement(A,{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:T=>{var P,N;T.preventDefault(),$?(P=S.current)==null||P.focus():(N=C.current)==null||N.focus()}},t.createElement(co,{date:$||new Date,selected:$,onDateSelected:async T=>{x(!1),await R(T.date,!1),c&&c()},setYear:async T=>{await R(T,!1),c&&c()},minDate:p,maxDate:g,refDateToday:C,refDateSelected:S,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=z({"0%":{transform:po},"100%":{transform:ra}}),ss=z({"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:`${Mt} 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(A,{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:Nt},'&[data-side="right"]':{animationName:Ft},'&[data-side="bottom"]':{animationName:Rt},'&[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"}),fs=({children:e,href:a,...o})=>u.default.createElement(go,{...o,asChild:!0},u.default.createElement(gs,{href:a,role:"menuitem"},e)),$s=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=fs,Ee.Portal=Ie.Portal,Ee.Separator=$s,Ee.Trigger=bs;const fo=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)"}}}}),$o=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(I,{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===$o||r.type===bo||r.type===fo)?t.cloneElement(r,{...r.props,size:e}):r));Ke.displayName="EmptyState",Ke.Image=$o,Ke.Title=bo,Ke.Body=fo;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:It("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:Ri,text:Ti,thematicBreak:Ni},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},yt=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:yt,onPointerLeave:yt},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: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 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 Rs=l("button",{...la,...Co}),Ts=l(ce.Item),Ns=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(Ts,null,o?u.default.createElement(Rs,{disabled:!0,...i},e):u.default.createElement(Ns,{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 Fs=z({"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:lt}),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 g;return n===""&&(g=setTimeout(()=>r(null),m)),()=>{g!==null&&clearTimeout(g)}},[n]);const p=(g,h)=>{if(g&&s&&n===h){const f=s/2,$=s-g.offsetLeft-g.offsetWidth+g.offsetWidth/2;r(Math.round(f-$))}return g};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:`${Fs} ${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(I,{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(A,{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:g,disabledTooltipContent:h,css:f,...$}=e,[y,R]=t.useState(s),w=t.useRef(null);t.useImperativeHandle(a,()=>w.current);const k={increment:"increment",decrement:"decrement",...g},x={decrement:`Cannot enter values below ${r}`,increment:`Cannot enter values above ${n}`,...h},C=y>=n,S=y<=r,T=t.useCallback(D=>Math.min(Math.max(D,r),n),[n,r]),P=t.useCallback(D=>{R(D),p==null||p(Number(D))},[p]),N=t.useCallback(D=>{const j=D.target.value.replace(/\D/g,"");P(j)},[P]),M=t.useCallback(()=>{var D;if(C||c)return;(D=w==null?void 0:w.current)==null||D.focus();let j;y===""?j=i:j=Number(y)+i,P(T(j))},[T,C,c,i,P,y]),V=t.useCallback(()=>{var D;if(S||c)return;(D=w==null?void 0:w.current)==null||D.focus();let j;y===""?j=r:j=Number(y)-i,P(T(j))},[T,S,c,r,i,P,y]),ke=t.useCallback(D=>{if(D.nativeEvent.isComposing)return;const j=D.key,Ve={ArrowUp:M,ArrowRight:M,ArrowDown:V,ArrowLeft:V,Home:()=>P(r),End:()=>P(n)}[j];Ve&&(D.preventDefault(),Ve(D))},[M,V,P,r,n]),Et={name:o,type:"number",value:y,...$,onChange:N,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(I,{css:f},t.createElement(Io,{onClick:V,icon:v.Minus,css:{borderRight:"none",borderTopRightRadius:"0px",borderBottomRightRadius:"0px"},size:m,disabled:S||d,showTooltip:S&&!d,disabledTooltipContent:x.decrement,label:k.decrement}),t.createElement(we,{...Et}),t.createElement(Io,{onClick:M,icon:v.Plus,css:{borderLeft:"none",borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px"},size:m,disabled:C||d,showTooltip:C&&!d,disabledTooltipContent:x.increment,label:k.increment}))});da.displayName="NumberInput";const Ro=({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}))};Ro.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(A,{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 To=({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}))};To.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"}),No=({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}%)`}}));No.displayName="ProgressBar";const Fo=({css:e,label:a,value:o,...r})=>t.createElement(gt,{css:e,label:a},t.createElement(ht,{value:o,...r}));Fo.displayName="RadioField";const Gs=l("fieldset",{all:"unset"}),ua=({children:e,css:a,direction:o="column",defaultValue:r,value:n,description:i,label:s,name:d,validation:c,onValueChange:m,...p})=>{const{control:g}=H.useFormContext(),{field:{ref:h,onChange:f,value:$,name:y}}=H.useController({name:d,control:g,rules:c,defaultValue:r}),{error:R}=ie(d);return t.useEffect(()=>{typeof n<"u"&&f(n)},[n]),t.createElement(Gs,{css:a},t.createElement(Be,{as:"legend",css:{p:0,mb:"$3"},required:Boolean(c==null?void 0:c.required)},s),i&&t.createElement(Gt,{css:{mb:"$3"}},i),t.createElement(jt,{ref:h,direction:o,defaultValue:r,onValueChange:w=>{f(w),m==null||m(w)},value:$,...p},e),R&&t.createElement(mt,{css:{mt:"$2"}},R))};ua.Item=Fo,ua.displayName="RadioButtonField";const js=l(Te.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(Te.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(Te.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(bt,{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),g=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(vt,{name:o,id:o,...c,ref:g,...p&&{state:"error"}},a))};Lo.displayName="SelectField";const Po=l(ae.Root,{width:"100%"});Po.displayName="SidedrawerAccordionRoot";const Js=z({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Ks=z({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(I,{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(A,{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:lt-1,"@allowMotion":{'&[data-state="open"]':{animation:`${Mt} 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:lt,"@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(A,{size:"md",appearance:"simple",theme:"neutral",ref:o,...a},u.default.createElement(b,{is:e}))),xt=({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}});xt.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",[`& ${xt}`]:{'&[src$=".svg"]':{height:24,width:"auto"}}},lg:{height:"$7",[`& ${xt}`]:{'&[src$=".svg"]':{height:32,width:"auto"}}}}}}),fc=l(I,{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(fc,{...a}))};he.Brand=pc,he.BrandLogo=xt,he.BrandName=uc,he.ActionIcon=mc,he.Divider=hc,he.displayName="TopBar";const $c=l("header",{"> div":{width:"100%"}}),bc=({children:e,...a})=>u.default.createElement($c,{...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=t.forwardRef(({value:e,defaultValue:a,min:o=0,max:r=100,theme:n="tonal",css:i,children:s,...d},c)=>{const m=e||a;return t.createElement(Ne,{css:i},t.createElement(Dc,{theme:n,defaultValue:a,value:e,min:o,max:r,ref:c,...d},t.createElement(ha,null,t.createElement(zc,null)),(m==null?void 0:m.length)&&m.map((p,g)=>t.createElement(Ic,{key:`thumb${g}`}))),s)});Ce.Value=kc,Ce.Steps=Sc,Ce.displayName="Slider";const Bo=({css:e,label:a,name:o,defaultValue:r,value:n,validation:i,outputLabel:s,min:d=0,max:c=100,steps:m=[],...p})=>{const{control:g}=H.useFormContext(),{field:{ref:h,onChange:f,value:$,name:y}}=H.useController({name:o,control:g,rules:i,defaultValue:r});return u.default.useEffect(()=>{n!=null&&n.length&&f(n)},[JSON.stringify(n)]),u.default.createElement(te,{css:e,fieldId:o,label:a},u.default.createElement(Ce,{ref:h,name:y,onValueChange:f,value:$,min:d,max:c,...p},u.default.createElement(Ce.Steps,{min:d,max:c,steps:m}),u.default.createElement(Ce.Value,{value:$,outputLabel:s})))};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}),Rc=({children:e,stepCount:a,allowSkip:o,onComplete:r,onStepChange:n,direction:i,steps:s,hideLabels:d,showCompletedIcons:c})=>{const[m,p]=t.useState(0),[g,h]=t.useState([0]),[f,$]=t.useState([]),y=!a;t.useEffect(()=>{h(x=>x.includes(m)?x:[...x,m]),n==null||n(m)},[m,n]);const R=()=>{const x=r&&m===a-1,C=m<a-1;if((r||C)&&$(S=>S.includes(m)?S:[...S,m]),x)return r==null?void 0:r();if(C)return p(S=>S+1)},w=()=>{p(x=>x-1)},k=x=>{p(x)};return t.createElement(Oo.Provider,{value:{steps:s||Array(a).fill(""),goToPreviousStep:y?void 0:w,goToNextStep:y?void 0:R,goToStep:y?void 0:k,activeStep:m,viewedSteps:g,completedSteps:f,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},Tc=({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)))},Nc=({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)))},Fc=l(I,{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(I,{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(I,{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=h=>{const f=a[h];return f.status?f.status:c.length===a.length?B.SUCCESS:r===h&&c.includes(r)?B.REVIEWED:r===h?B.ACTIVE:c.includes(h)?B.COMPLETED:n.includes(h)?B.VIEWED:B.DEFAULT},g=h=>{var f;const $=(f=a[h])==null?void 0:f.status;return c.length===a.length||$===B.SUCCESS?B.SUCCESS:$===B.COMPLETED||h<Math.max(...n)?B.ACTIVE:$===B.VIEWED?B.VIEWED:B.DEFAULT};return t.createElement(Lc,{css:e,direction:s},a.map((h,f)=>{const $=p(f),y=g(f);return t.createElement(Mc,{tabIndex:0,key:`step_${f}`,direction:s,separator:y,status:$,css:s==="horizontal"?{width:`calc(100% / ${a.length})`}:{height:`calc(100% / ${a.length})`},canInteract:i},t.createElement(Fc,{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":h.label?"":`step ${f+1}`,"aria-labelledby":h.label?`step-${f}`:void 0,css:{cursor:i&&n.includes(f)?"pointer":"auto"}},h.status===B.SUCCESS||m&&$===B.COMPLETED?t.createElement(b,{is:v.Ok}):f+1),h.label&&!d&&t.createElement(Ac,{as:"span",id:`step-${f}`,direction:s,status:$},h.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})=>{Re.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(Rc,{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=Tc,Qe.StepForward=Nc,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(it,{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(A,{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(g=>{if(!r)return;const{scrollWidth:h,scrollLeft:f,offsetWidth:$}=r,y=Math.round(h*(_c/100));let R=f;if(g==="right"){const w=f+y;R=w+$<=h?w:h-$}else{const w=f-y;R=w>0?w:0}r.scroll({left:R,behavior:"smooth"}),setTimeout(()=>{const{scrollWidth:w,scrollLeft:k,offsetWidth:x}=r,C=w-(k+x);k===0?(d(!1),m(!0)):C<5?(m(!1),d(!0)):(d(!0),m(!0))},500)},[r]);return u.default.useEffect(()=>{var g;if(!r)return;const{offsetWidth:h,scrollWidth:f}=r,$=f>h;(g=r.scroll)==null||g.call(r,{left:0}),d(!1),m($)},[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"}}}}),fa=t.forwardRef((e,a)=>t.createElement(Yc,{...e,ref:a}));fa.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(fa,{id:o,name:o,ref:m,...c&&{state:"error"},...s}))};jo.displayName="TextareaField";const Yo=400,Uc=z({"0%":{transform:"translate3d(0,-100%,0)",opacity:0},"100%":{transform:"translate3d(0,0,0)",opacity:1}}),Xc=z({"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(st,{css:{flex:"0 0 auto",ml:"auto"}}):t.createElement(A,{css:{position:"absolute",top:"$2",right:"$2",color:"white","&:hover,&:focus":{color:"white",opacity:.5}},label:"Close alert",onClick:()=>St.toast.dismiss(o)},t.createElement(b,{is:v.Close}))))}),Zc=l("div",{left:"$2",position:"fixed",top:"$2",right:"$2",zIndex:lt,"@sm":{top:"$3",right:"auto",left:`calc(50% - ${Yo/2}px)`}}),Uo=({children:e})=>{const{toasts:a,handlers:o}=St.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,wt={sm:"32px",md:"40px",lg:"48px"},td={sm:"$4",md:"$5",lg:"$5"},ad={sm:"$2",md:"$3",lg:"$3"},$a=e=>({fontSize:`$${e}`,px:td[e],minHeight:wt[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:$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}}]}),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(Tr.default,{}),Xo=t.forwardRef(({id:e,ratio:a=9/16,css:o,...r},n)=>t.createElement(Ne,{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 Rr.default}}),exports.Accordion=Ge,exports.ActionIcon=A,exports.AlertDialog=G,exports.AlertProvider=Vn,exports.Avatar=We,exports.Badge=Wa,exports.Box=E,exports.Button=ne,exports.Carousel=ve,exports.Checkbox=dt,exports.CheckboxField=Ya,exports.Chip=de,exports.ChipDismissibleGroup=Xt,exports.ChipGroup=Yt,exports.ChipToggleGroup=Jt,exports.ColorScheme=it,exports.Combobox=xe,exports.DataTable=W,exports.DateField=uo,exports.DateInput=aa,exports.Dialog=ue,exports.Dismissible=ft,exports.DismissibleGroup=ye,exports.Divider=qt,exports.DropdownMenu=Ee,exports.EmptyState=Ke,exports.FieldWrapper=te,exports.FileInput=vo,exports.Flex=I,exports.Form=ja,exports.Grid=yo,exports.Heading=ct,exports.Icon=b,exports.Image=Pe,exports.InlineFieldWrapper=gt,exports.InlineMessage=mt,exports.Input=we,exports.InputField=xo,exports.Label=Be,exports.Link=pt,exports.List=ut,exports.Loader=st,exports.MarkdownContent=wo,exports.NavigationMenu=pe,exports.NotificationBadge=Os,exports.NumberInput=da,exports.NumberInputField=Ro,exports.PasswordField=To,exports.PasswordInput=ma,exports.Popover=le,exports.ProgressBar=No,exports.RadioButton=ht,exports.RadioButtonField=ua,exports.RadioButtonGroup=jt,exports.RadioCard=Mo,exports.RadioCardGroup=Xs,exports.SearchField=Ao,exports.SearchInput=bt,exports.Select=vt,exports.SelectField=Lo,exports.Sidedrawer=Z,exports.Slider=Ce,exports.SliderField=Bo,exports.Stack=Le,exports.StackContent=na,exports.Stepper=Qe,exports.StyledButton=Ta,exports.StyledLink=_a,exports.Switch=Ho,exports.Table=F,exports.Tabs=Ze,exports.Text=L,exports.Textarea=fa,exports.TextareaField=jo,exports.ToastProvider=Uo,exports.ToggleGroup=sd,exports.Tooltip=K,exports.TopBar=he,exports.Video=Xo,exports.createTheme=Ar,exports.createThemeVariants=It,exports.css=Fr,exports.focusVisibleStyleBlock=be,exports.getCssText=Mr,exports.globalCss=Ca,exports.keyframes=z,exports.media=zt,exports.styled=l,exports.theme=q,exports.useAlert=_n,exports.useCarousel=si,exports.useDataTable=J,exports.utils=Dt;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var ae=require("@radix-ui/react-accordion"),Y=require("react"),er=require("@atom-learning/theme"),ya=require("@stitches/react"),v=require("@atom-learning/icons"),O=require("color2k"),St=require("@radix-ui/react-slot"),tr=require("invariant"),oe=require("@radix-ui/react-alert-dialog"),ar=require("@radix-ui/react-visually-hidden"),or=require("uid"),ge=require("pure-react-carousel"),rr=require("@radix-ui/react-checkbox"),H=require("react-hook-form"),nr=require("@radix-ui/react-radio-group"),ir=require("react-hook-form-persist"),lr=require("dlv"),sr=require("@radix-ui/react-toggle-group"),De=require("@reach/combobox"),se=require("@tanstack/react-table"),cr=require("use-deep-compare-effect"),et=require("throttle-debounce"),fe=require("@dnd-kit/core"),dr=require("@dnd-kit/modifiers"),_e=require("@dnd-kit/sortable"),mr=require("@dnd-kit/utilities"),ze=require("@radix-ui/react-tooltip"),ur=require("dayzed"),$e=require("@radix-ui/react-popover"),pr=require("dayjs"),hr=require("dayjs/plugin/customParseFormat"),_=require("@radix-ui/react-dialog"),Ie=require("@radix-ui/react-dropdown-menu"),gr=require("mdast-util-directive"),fr=require("mdast-util-from-markdown"),$r=require("micromark-extension-directive"),br=require("@radix-ui/react-navigation-menu"),vr=require("@radix-ui/react-progress"),tt=require("@radix-ui/react-slider"),yr=require("@radix-ui/react-switch"),at=require("@radix-ui/react-tabs"),kt=require("react-hot-toast"),xr=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),wr=ee(er),Te=U(tr),Dt=ee(ar),xa=ee(rr),Re=ee(nr),Er=U(ir),Cr=U(lr),ot=ee(sr),Sr=U(cr),qe=U(pr),kr=U(hr),Dr=ee(_),zr=U(gr),Ir=U(fr),Tr=U($r),ce=ee(br),wa=ee(vr),Ea=ee(yr),Rr=U(kt),Nr=U(xr);const zt={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})},It={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:wr,utils:zt,media:It}),{css:Mr,getCssText:Ar,createTheme:Lr,globalCss:Ca,keyframes:z,styled:l,theme:q}=Fr,Tt=(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 Ne=({css:e,children:a})=>e?t.createElement(E,{css:e},a):t.createElement(t.Fragment,null,a);Ne.displayName="CSSWrapper";const Q=(e,a)=>({"&::before":{content:"''",mb:`-${e}em`,display:"table"},"&::after":{content:"''",mt:`-${a||e}em`,display:"table"}}),Pr={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(Pr[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"}),Rt=z({"0%":{opacity:0,transform:"translateY(2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Nt=z({"0%":{opacity:0,transform:"translateX(-2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),Ft=z({"0%":{opacity:0,transform:"translateY(-2px)"},"100%":{opacity:1,transform:"translateY(0)"}}),Mt=z({"0%":{opacity:0,transform:"translateX(2px)"},"100%":{opacity:1,transform:"translateX(0)"}}),At=z({"0%":{opacity:0},"100%":{opacity:1}}),rt=z({"0%":{opacity:1},"100%":{opacity:0}}),Wr=z({"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(0)"}}),Br=z({"0%":{transform:"translateX(0)"},"100%":{transform:"translateX(-100%)"}}),Or=z({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Hr=z({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),Vr=l(ae.Content,{border:0,width:"100%",bg:"$background",overflow:"hidden",'&[data-state="open"]':{borderRadius:"0 0 $0 $0"},"@allowMotion":{'&[data-state="open"]':{animation:`${Or} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Hr} 300ms ease-out`}}}),_r=({children:e,css:a,...o})=>u.default.createElement(Vr,{...o},u.default.createElement(Ne,{css:a},e)),qr=l(ae.Item,{width:"100%","&:not(:last-child)":{mb:"$1"}}),Gr=({children:e,value:a,...o})=>u.default.createElement(qr,{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 jr="#F3F8FF",Yr="#E5F1FF",Ur="#D6EAFF",Xr="#C2DEFF",Jr="#B3D4FA",Kr="#057AFF",Qr="#0F67F5",Zr="#194DCC",en="#102DA3",tn="#15235E",Da={blue1:jr,blue2:Yr,blue3:Ur,blue4:Xr,blue5:Jr,blue6:Kr,blue7:Qr,blue8:Zr,blue9:en,blue10:tn},an="#F6F6F6",on="#EBEBEB",rn="#E0E0E0",nn="#CECECE",ln="#C2C2C2",sn="#757575",cn="#545454",dn="#333333",mn="#1F1F1F",un="#1C1C1C",Lt={slate1:an,slate2:on,slate3:rn,slate4:nn,slate5:ln,slate6:sn,slate7:cn,slate8:dn,slate9:mn,slate10:un};const pn=[255,255,255,1],nt=[.05,.1,.15,.2,.27,.35,.5,.7,.8,.95],Pt=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,c,d]=O.parseToRgba(n),[m,p,g]=pn,h=[Pt((s-m)/nt[i]+m),Pt((c-p)/nt[i]+p),Pt((d-g)/nt[i]+g),nt[i]];o[`${e}A${i+1}`]=`rgba(${h.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:hn,createTheme:Fe}=ya.createStitches({theme:{colors:{background:"white",foreground:Lt.slate9,foreground6plus:"white",...Da,...za("blue",Da),...Lt,...za("slate",Lt)}},utils:zt,media:It});re["interactive-loContrast1"]=Fe("interactive-loContrast1",{colors:{interactiveForeground:"$foreground",interactive1:"white",interactive2:"$accent1",interactive3:"$accent2"}}),re["interactive-loContrast2"]=Fe("interactive-loContrast2",{colors:{interactiveForeground:"$foreground",interactive1:"$accent1",interactive2:"$accent2",interactive3:"$accent3"}}),re["interactive-hiContrast1"]=Fe("interactive-hiContrast1",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent7",interactive2:"$accent8",interactive3:"$accent9"}}),re["interactive-hiContrast2"]=Fe("interactive-hiContrast2",{colors:{interactiveForeground:"$foreground6plus",interactive1:"$accent8",interactive2:"$accent9",interactive3:"$accent10"}});const gn={slate:"slate"},fn=()=>{Object.entries(gn).forEach(([e,a])=>{const o=`base-${e}`;re[o]=Fe(o,{colors:Ia("base",a)})})},$n={slate:"slate",blue:"blue"},bn=()=>{Object.entries($n).forEach(([e,a])=>{const o=`accent-${e}`;re[o]=Fe(o,{colors:Ia("accent",a)})})};fn(),bn();const vn=hn("div"),it=t.forwardRef(({base:e="",accent:a="",interactive:o="",className:r,asChild:n=!1,...i},s)=>{const c=[r,re[`interactive-${o}`],re[`accent-${a}`],re[`base-${e}`]].filter(Boolean).join(" ");return t.createElement(n?St.Slot:vn,{ref:s,className:c,...i})});it.displayName="ColorScheme";const yn=l(b,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"},'[data-state="closed"] > &':{transform:"rotate(0deg)"}}),xn=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"}}),wn=({children:e,colorScheme:a={},...o})=>u.default.createElement(it,{asChild:!0,accent:"slate",interactive:"loContrast1",...a},u.default.createElement(xn,{...o},e,u.default.createElement(yn,{is:v.ChevronDown}))),En=l(ae.Root,{width:"100%"}),Ge=u.default.forwardRef(({type:e="single",children:a,...o},r)=>u.default.createElement(En,{ref:r,type:e,...o},a));Ge.Item=Gr,Ge.Content=_r,Ge.Trigger=wn,Ge.displayName="Accordion";const Cn={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"}}),Sn=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")}]}),A=t.forwardRef(({children:e,theme:a="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 ${A.displayName}`;return Te.default(t.Children.count(e)===1,m),t.createElement(Sn,{...c,...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:d,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 ${A.displayName}`),t.cloneElement(p,{size:Cn[r],css:{...p.props.css?p.props.css:{}}})}))});A.displayName="ActionIcon";const lt=2147483647,Ue=1147483646,kn=10,Dn=10,zn=10,Wt="translate3d(-50%, -50%, 0)",Ta="translate3d(-50%, 50vh, 0)",In=z({"0%":{transform:Ta},"100%":{transform:Wt}}),Tn=z({"0%":{transform:Wt},"100%":{transform:Ta}}),Rn=l(oe.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${At} 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:`${In} 550ms cubic-bezier(0.22, 1, 0.36, 1)`},'&[data-state="closed"]':{animation:`${Tn} 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(Rn,null),t.createElement(Nn,{size:e,...a})),Mn=l(oe.Root,{}),G=e=>t.createElement(Mn,{...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 An=()=>{const e=Y.useRef();return Y.useEffect(()=>(e.current=!0,()=>{e.current=!1})),e},I=l("div",{display:"flex"});I.displayName="Flex";const Ln=z({"0%":{opacity:0},"30%":{opacity:1},"50%":{opacity:1},"80%":{opacity:0},"100%":{opacity:0}}),Bt=l("div",{animationName:`${Ln}`,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"}}}}),st=({css:e={},message:a="Loading",size:o="md",...r})=>t.createElement(I,{css:{justifyContent:"center",...e},role:"alert",...r},t.createElement(Dt.Root,null,a),t.createElement(Bt,{size:o}),t.createElement(Bt,{size:o}),t.createElement(Bt,{size:o})),Ot=(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: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(q.colors.primaryDark.value,.1),O.darken(q.colors.primaryDark.value,.15))}]}),Pn=({isLoading:e,children:a})=>t.createElement(t.Fragment,null,t.createElement(st,{css:{opacity:e?1:0,position:"absolute",transition:"opacity 150ms"}}),t.createElement(E,{as:"span",css:e?{opacity:0,transition:"opacity 150ms"}:{}},a)),Wn=e=>{switch(e){case"lg":return 22;case"md":return 20;case"sm":default:return 16}},Na=(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:Wn(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:c="button",...d},m)=>t.createElement(Ra,{isLoading:a||!1,onClick:a?void 0:o,appearance:n,size:i,theme:s,...d,...r?{as:"a",href:r,onClick:void 0}:{},...r?{}:{type:c},ref:m},typeof a=="boolean"?t.createElement(Pn,{isLoading:a},Na(e,i)):Na(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 !important"}}}}}),ct=t.forwardRef(({size:e="md",...a},o)=>t.createElement(Ht,{ref:o,size:e,...a}));ct.displayName="Heading";const Bn=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:{...Tt("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},c)=>t.createElement(Ne,{css:e},t.createElement(Bn,{ref:c,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 !important"}}}},Je=({size:e,noCapsize:a})=>({...Xe.size[e],...Xe.noCapsize[`${a}`]}),Vt=l("p",{fontFamily:"$body",fontWeight:400,margin:0,"& > &":{"&:before, &:after":{display:"none"}},variants:Xe}),L=t.forwardRef(({size:e="md",...a},o)=>t.createElement(Vt,{size:e,...a,ref:o}));L.displayName="Text";const On=({title:e,description:a,onAction:o,cancelActionText:r,confirmActionText:n,onClose:i,...s})=>t.createElement(G,{defaultOpen:!0},t.createElement(G.Content,{onEscapeKeyDown:c=>c.preventDefault(),onCloseAutoFocus:i,...s},t.createElement(ct,{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)))),Hn=[],Vn=(e,a)=>{switch(a.type){case"ADD":return[...e,{...a.payload,id:or.uid()}];case"REMOVE":return e.filter(({id:o})=>o!==a.payload);default:return e}},Fa=t.createContext({showAlert:()=>null}),_n=({children:e})=>{const[a,o]=t.useReducer(Vn,Hn),r=An();return t.createElement(Fa.Provider,{value:{showAlert:n=>o({payload:n,type:"ADD"})}},Boolean(a.length)&&t.createElement(On,{...a[0],key:a[0].id,onClose:()=>{r.current&&o({payload:a[0].id,type:"REMOVE"})}}),e)},qn=()=>{const e=t.useContext(Fa);if(e===void 0)throw new Error("useAlert must be used within a AlertProvider");return e},_t=(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},Gn={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg",xxl:"lg"},jn=({is:e})=>{const a=t.useContext(qt),{size:o}=a,r=t.useMemo(()=>_t(o,n=>Gn[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%"}})),Yn={xs:"xs",sm:"sm",md:"sm",lg:"md",xl:"md",xxl:"lg"},La=()=>{const e=t.useContext(qt),{name:a,size:o}=e,r=t.useMemo(()=>_t(o,n=>Yn[n]),[o]);return a?t.createElement(L,{size:r,css:{color:"$tonal400"}},a[0].toUpperCase()):t.createElement(Aa,null)},Un=l(Pe,{size:"100%",objectFit:"cover"}),Xn=({src:e,alt:a})=>e?t.createElement(Un,{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"}}}},Jn=l("div",Pa),Kn=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"}}),qt=t.createContext({name:void 0,size:"lg"}),Qn=({children:e,name:a,size:o})=>{const r=t.useMemo(()=>({name:a,size:o}),[a,o]);return t.createElement(qt.Provider,{value:r},e)},Zn=({children:e,size:a="lg",name:o,disabled:r=!1,onClick:n})=>t.createElement(Qn,{name:o,size:a},n?t.createElement(Kn,{size:a,disabled:r,onClick:r?void 0:n,css:{cursor:r?"auto":"pointer"}},e):t.createElement(Jn,{size:a},e)),We=Zn;We.Image=Xn,We.Initial=La,We.Placeholder=Aa,We.Icon=jn,We.displayName="Avatar";const ei=l(I,{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(ei,{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"}},ti=l(ge.ButtonBack,Ba),ai=l(ge.ButtonNext,Ba),oi=e=>t.createElement(ti,{...e},t.createElement(b,{is:v.ChevronLeft})),ri=e=>t.createElement(ai,{...e},t.createElement(b,{is:v.ChevronRight})),ni=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"}}}),ii=l(ge.Slide,{}),li=({children:e,...a})=>t.createElement(ii,{...a,tag:"div"},t.createElement(E,{css:{px:"$3"}},e)),si=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(Ne,{css:a},t.createElement(ge.CarouselProvider,{naturalSlideWidth:r,naturalSlideHeight:o,totalSlides:n,...i},e)),ci=()=>t.useContext(ge.CarouselContext);ve.ArrowNext=ri,ve.ArrowPrevious=oi,ve.Pagination=ni,ve.Slide=li,ve.Slider=si,ve.displayName="Carousel";const di=l(xa.Indicator,{display:"flex",alignItems:"center",justifyContent:"center"}),mi=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"}}}}),dt=t.forwardRef((e,a)=>t.createElement(mi,{...e,ref:a},t.createElement(di,null,t.createElement(b,{is:e.checked==="indeterminate"?v.Minus:v.Ok,css:{pointerEvents:"none",position:"absolute",strokeWidth:"3",size:14}}))));dt.displayName="Checkbox";const ui={success:{color:"$success"},warning:{color:"$warningText","& svg":{color:"$warningDark"}},info:{color:"$primary"},neutral:{color:"$tonal400"},error:{color:"$danger"}},pi={success:v.OkCircle,warning:v.Danger,info:v.Info,neutral:v.Info,error:v.Error},hi=l(I,{variants:{theme:ui}}),gi=l(b,{flexShrink:"0",mr:"$2"}),mt=({css:e,showIcon:a=!0,theme:o="error",size:r="sm",children:n,...i})=>t.createElement(hi,{theme:o,css:e,...i},a&&t.createElement(gi,{size:"sm",is:pi[o]}),t.createElement(L,{as:"span",size:r,css:{transform:"translateY($space$0)"}},n)),fi=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,...c})=>t.createElement(fi,{as:a,size:r,type:n,align:e,direction:o,...c},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"}}}}}}),ut=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}));ut.Item=Oe;const bi=l(E,{bg:"$tonal100",borderRadius:"$1",color:"$tonal600",fontFamily:"$mono",fontSize:"$sm",lineHeight:1.4,my:"$4",p:"$3"}),vi=({node:e})=>t.createElement(bi,{as:"pre"},e.value),Ha=l("em",{fontStyle:"italic"}),yi=({node:e,handleNode:a})=>{var o;return t.createElement(Ha,null,(o=e.children)==null?void 0:o.map(a))},xi=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"}}},wi=({node:e,handleNode:a,...o})=>{var r;const{as:n,size:i}=xi(e.depth);return t.createElement(ct,{as:n,size:i,...o},(r=e.children)==null?void 0:r.map(a))},Ei=l(E,{bg:"$tonal100",borderRadius:"$0",color:"$tonal600",display:"inline-block",fontFamily:"$mono",fontSize:"85%",p:"$0 $1"}),Ci=({node:e})=>t.createElement(Ei,{as:"code"},e.value),Si=({node:e,css:a})=>{var o;return t.createElement(Pe,{src:e.url,alt:(o=e.alt)!=null?o:void 0,css:a})},ki=({node:e,handleNode:a})=>{var o,r;return t.createElement(pt,{title:(o=e.title)!=null?o:void 0,href:e.url},(r=e.children)==null?void 0:r.map(a))},Di=({node:e,handleNode:a,css:o})=>{var r;return t.createElement(ut,{css:{"& p:before, & p:after":{display:"none"},...o},ordered:e.ordered||void 0},(r=e.children)==null?void 0:r.map(a))},zi=({node:e,handleNode:a})=>{var o;return t.createElement(ut.Item,null,(o=e.children)==null?void 0:o.map(a))},Ii=({node:e,handleNode:a,...o})=>{var r;return t.createElement(L,{...o},(r=e.children)==null?void 0:r.map(a))},Ti=l("strong",{fontWeight:600}),Ri=({node:e,handleNode:a})=>{var o;return t.createElement(Ti,null,(o=e.children)==null?void 0:o.map(a))},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",...a},o)=>u.default.createElement(Va,{ref:o,orientation:e,...a})),Fi=({css:e})=>t.createElement(Gt,{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"},[`${Vt} > &, ${Ht} > &, ${Oe} > &, ${Ha} > &`]:{fontSize:"100%",lineHeight:1,"&::before, &::after":{content:"none"}},variants:Xe}),pt=t.forwardRef(({size:e="md",href:a,...o},r)=>t.createElement(_a,{...!a&&{as:"button",noCapsize:!0},size:e,href:a,...o,ref:r}));pt.displayName="Link";const jt=({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:c,hideLabel:d})=>{const m=d?Dt.Root:I;return t.createElement(E,{css:e},t.createElement(m,{css:{justifyContent:"space-between",alignItems:"center",mb:"$3"}},t.createElement(Be,{htmlFor:r,required:c},n),i&&t.createElement(pt,{href:i.link,size:"sm"},i.label)),s&&t.createElement(jt,{css:{mb:"$3"}},s),a,o&&t.createElement(mt,{css:{mt:"$2"}},o))};te.displayName="FieldWrapper";const Mi=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"}}),Ai=l(Re.Indicator,{size:"6px",borderRadius:"$round",backgroundColor:"currentcolor",position:"absolute"}),ht=e=>t.createElement(Mi,{...e},t.createElement(Ai,null));ht.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 gt=({align:e="start",children:a,css:o,description:r,direction:n="row",error:i,label:s,required:c})=>t.createElement(E,{css:o},t.createElement(Be,{align:e,direction:n,required:c,type:"inline"},t.Children.map(a,d=>t.createElement(E,{css:{[n==="reverse"?"ml":"mr"]:"$3",...((d==null?void 0:d.type)===dt||(d==null?void 0:d.type)===ht)&&{transform:"translateY($space$1)"}}},d)),s),i&&t.createElement(mt,{css:{mt:"$2"}},i),r&&t.createElement(jt,{css:{mt:"$2",[n==="reverse"?"mr":"ml"]:"calc($space$3 + $sizes$1)"}},r));gt.displayName="InlineFieldWrapper";var qa=(e=>(e.LOCAL="local",e.SESSION="session",e))(qa||{});const Li=l("form",{}),Pi=({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:c,...d}=s,m=a(),p=Object.keys(m).filter(g=>{var h;if(!((h=i.exclude)!=null&&h.includes(g)))return g});s={...d,include:p}}return Er.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(Li,{"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,...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:a,mode:n}),{handleSubmit:m,watch:p,setValue:g}=d,h=i?i(d):e,f={formMethods:d,handleSubmit:m,onSubmit:o,onError:r,...c};return s?t.createElement(Pi,{persist:s,watch:p,setValue:g},t.createElement(Ga,{...f},h)):t.createElement(Ga,{...f},h)};ja.displayName="Form";const ie=e=>{var a;const{errors:o}=H.useFormContext(),r=e.split(/[,[\].]+?/).filter(Boolean);return{error:(a=(()=>Cr.default(o,r))())==null?void 0:a.message}};var Wi=(e=>(e.ON="on",e.OFF="off",e))(Wi||{});const Ya=({css:e,label:a,name:o,validation:r,description:n,defaultChecked:i=!1,checked:s,...c})=>{const{control:d}=H.useFormContext(),{error:m}=ie(o),{field:{ref:p,onChange:g,value:h,name:f}}=H.useController({name:o,control:d,rules:r,defaultValue:i});return t.useEffect(()=>{typeof s<"u"&&g(s)},[s]),t.createElement(gt,{css:e,description:n,error:m,label:a,required:Boolean(r==null?void 0:r.required)},t.createElement(dt,{ref:p,name:f,...c,onCheckedChange:g,value:h?"on":"off",checked:h,...m&&{state:"error"}}))};Ya.displayName="CheckboxField";const Ua={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Bi=l("span",{display:"inline-flex",alignItems:"center",px:"$1",flexGrow:1,...Ua,"& > *:not(:last-child)":{mr:"$1"}}),Oi={sm:"sm",md:"sm",lg:"md"},Hi=l(b,{flexShrink:0}),Xa=({...e})=>{const a=t.useContext(Ja),{size:o}=a,r=t.useMemo(()=>_t(o,n=>Oi[n]),[o]);return t.createElement(Hi,{...e,size:r})},Vi=({children:e,...a})=>{const o=t.Children.toArray(e),r=o.length<=1;return t.createElement(Bi,{...a},o.map((n,i)=>!r&&typeof n=="string"?t.createElement(E,{as:"span",css:Ua,key:n},n):t.isValidElement(n)&&n.type===b?t.createElement(Xa,{key:`icon-${i}`,...n.props}):n))},_i=l(I,{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({}),qi=({size:e,children:a})=>{const o=t.useMemo(()=>({size:e}),[e]);return t.createElement(Ja.Provider,{value:o},a)},Gi=t.forwardRef(({asWorkaround:e,size:a="md",...o},r)=>t.createElement(qi,{size:a},t.createElement(_i,{ref:r,as:e,size:a,...o}))),de=Gi;de.Content=Vi,de.Icon=Xa,de.displayName="Chip";const Ut=t.forwardRef(({gap:e=2,...a},o)=>t.createElement(Le,{ref:o,direction:"row",gap:e,align:!1,...a})),Xt=t.createContext({isDismissed:!1,setIsDismissed:()=>null}),ji=({children:e,disabled:a})=>{const[o,r]=t.useState(!1),n=t.useMemo(()=>({disabled:a,isDismissed:o,setIsDismissed:r}),[a,o]);return t.createElement(Xt.Provider,{value:n},e)},Yi=({asChild:e=!1,value:a,onDismiss:o,...r})=>{const n=t.useContext(Xt),{isDismissed:i,disabled:s}=n;if(t.useEffect(()=>{i&&(o==null||o(a))},[i]),i)return null;const c={...s&&{["data-disabled"]:""},...r};return t.createElement(e?St.Slot:"div",{...c})},Ui=({disabled:e=!1,...a})=>t.createElement(ji,{disabled:e},t.createElement(Yi,{...a})),Xi=e=>t.createElement("button",{type:"button",...e},"Dismiss"),Ka=({asChild:e=!1,...a})=>{const o=t.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)},...a};return t.createElement(e?St.Slot:Xi,{...i})},ft=Ui;ft.Trigger=Ka,ft.displayName="Dismissible";const Qa=t.createContext({onDismiss:()=>null}),Ji=({children:e,disabled:a,onDismiss:o})=>{const r=t.useMemo(()=>({disabled:a,onDismiss:o}),[a,o]);return t.createElement(Qa.Provider,{value:r},e)},Ki=({as:e="div",disabled:a,onDismiss:o,...r})=>t.createElement(Ji,{disabled:a,onDismiss:o},t.createElement(e,{...r})),Qi=({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(ft,{disabled:i||a,onDismiss:n,...o},e)},ye=Ki;ye.Item=Qi,ye.Trigger=Ka,ye.displayName="DismissibleGroup";const Zi=l(de,{px:"$1"}),el=({size:e="md",children:a,dismissActionLabel:o="Dismiss",...r})=>t.createElement(ye.Item,{asChild:!0,...r},t.createElement(Zi,{size:e},t.createElement(de.Content,null,a),t.createElement(ye.Trigger,{asChild:!0},t.createElement(A,{label:o,css:{color:"$tonal200"},size:e==="sm"?"xs":"sm"},t.createElement(b,{is:v.Close}))))),tl=t.forwardRef((e,a)=>t.createElement(Ut,{as:ye,ref:a,...e})),Jt=tl;Jt.Item=el,Jt.displayName="ChipDismissibleGroup";const Za=l(b,{display:"none"}),al=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"}}}),ol=({size:e="md",children:a,...o})=>t.createElement(ot.Item,{...o,asChild:!0},t.createElement(al,{asWorkaround:"button"},t.createElement(Za,{is:v.Ok,size:e==="lg"?"md":"sm"}),t.createElement(de.Content,null,a))),rl=t.forwardRef((e,a)=>t.createElement(Ut,{ref:a,as:ot.Root,orientation:"horizontal",...e})),Kt=rl;Kt.Item=ol,Kt.displayName="ChipToggleGroupItem";const nl=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"}}}}),il=l(De.ComboboxList,{listStyle:"none",m:0,p:0,userSelect:"none"}),ll=l(De.ComboboxOption,{color:"$tonal500",cursor:"pointer",m:0,p:"$2",'&:hover, &[aria-selected="true"]':{bg:"$tonal50",borderRadius:"$0"},"[data-user-value]":{color:"$primary"}}),sl=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 cl=l(De.Combobox,{}),xe=e=>t.createElement(cl,{...e});xe.displayName="Combobox",xe.Option=ll,xe.Input=nl,xe.Popover=sl,xe.List=il,xe.OptionText=De.ComboboxOptionText;var X=(e=>(e.NONE="none",e.PENDING="pending",e.FULFILLED="fulfilled",e.REJECTED="rejected",e))(X||{});const dl=e=>{if(e[0])return e[0].desc?"desc":"asc"},ml=async(e,a,o,r,n)=>{var i,s,c,d,m,p;const{pageIndex:g,pageSize:h}=o,f={pageIndex:(i=a==null?void 0:a.pageIndex)!=null?i:g,pageSize:(s=a==null?void 0:a.pageSize)!=null?s:h,sortBy:(d=a==null?void 0:a.sortBy)!=null?d:(c=r[0])==null?void 0:c.id,sortDirection:(m=a==null?void 0:a.sortDirection)!=null?m:dl(r),globalFilter:(p=a.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"),$},ul={pageIndex:0,pageSize:10},pl=e=>{const[a,o]=u.default.useState(!!e),[r,n]=u.default.useState({...ul,...e||{}}),i=u.default.useCallback(()=>{o(!0)},[]);return{isPaginated:a,paginationState:r,setPaginationState:n,applyPagination:i}},hl=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),gl=({columns:e,data:a=[],getAsyncData:o,defaultSort:r,initialState:n=void 0,children:i})=>{var s;const[c,d]=t.useState({results:a!=null?a:[],total:(s=a==null?void 0:a.length)!=null?s:0}),{isPaginated:m,applyPagination:p,paginationState:g,setPaginationState:h}=pl(n==null?void 0:n.pagination),[f,$]=t.useState(X.NONE),[y,R]=t.useState(""),{setIsSortable:w,isSortable:k,sorting:x,setSorting:C}=hl(r),S=t.useCallback(async M=>{if(o)try{$(X.PENDING);const V=await ml(o,M,g,x,y);d(V),$(X.FULFILLED)}catch{$(X.REJECTED)}},[o,g==null?void 0:g.pageIndex,g==null?void 0:g.pageSize,x,y]);t.useEffect(()=>{S({})},[S]),Sr.default(()=>{!a||d({results:a,total:a.length})},[a]);const N=()=>c.total,P=se.useReactTable({columns:e,data:c.results,pageCount:g?Math.ceil(N()/g.pageSize):-1,initialState:n,state:{sorting:x,globalFilter:y,pagination:g},manualPagination:o&&m,manualSorting:o&&m,enableSorting:f!==X.PENDING,enableGlobalFilter:!o,getCoreRowModel:se.getCoreRowModel(),getPaginationRowModel:m?se.getPaginationRowModel():void 0,getSortedRowModel:k||x.length?se.getSortedRowModel():void 0,getFilteredRowModel:se.getFilteredRowModel(),onPaginationChange:m?h:void 0,onSortingChange:C,onGlobalFilterChange:R}),F=t.useMemo(()=>({...P,data:c,setData:d,setIsSortable:w,applyPagination:p,getTotalRows:N,isSortable:k,asyncDataState:f,runAsyncData:S}),[P,p,N,k]);return t.createElement(eo.Provider,{value:F},i)},J=()=>{const e=t.useContext(eo);if(!e)throw new Error("useDataTable can only be called from inside a DataTableProvider");return e},$t=l("tr",{bg:"unset"}),to=t.forwardRef((e,a)=>t.createElement($t,{...e,ref:a}));to.displayName="TableRow";const fl=l("tbody",{variants:{striped:{true:{[`${$t}`]:{"&:nth-child(odd)":{bg:"white"},"&:nth-child(even)":{bg:"$tonal50"}}},false:{[`${$t}`]:{bg:"white"}}}}}),ao=({striped:e=!0,...a})=>t.createElement(fl,{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 bt=l("td",{color:"$tonal400",fontFamily:"$body",fontWeight:600,p:"$2 $3",textAlign:"left",verticalAlign:"middle"});bt.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 no=({children:e,numberOfStickyColumns:a=0,css:o,...r})=>{const[n,i]=u.default.useState(!1);return u.default.createElement(E,{onScroll:s=>{const c=s.currentTarget.scrollWidth>s.currentTarget.clientWidth;c!==n&&i(c)},role:"scrollbar",css:{overflow:"auto",maxWidth:"100%",[`& td:nth-of-type(${a}), th:nth-of-type(${a})`]:{...n&&{boxShadow:"$colors$alpha200 -2px -3px 9px 1px",clipPath:"inset(0px -10px 0px 0px)"},...a===1&&{position:"sticky",left:"0",zIndex:"2"}},"& td":{bg:"inherit"},...o},...r},e)},bl=l("table",{borderCollapse:"separate",borderSpacing:0,fontFamily:"$sans",fontSize:"$sm",width:"100%",variants:{size:{md:{[`${He}, ${me}, ${bt}`]:{height:"$4"}},lg:{[`${He}, ${me}, ${bt}`]:{height:"$5"}}},corners:{round:{[`${me}`]:{"&:first-of-type":{borderTopLeftRadius:"$0"},"&:last-of-type":{borderTopRightRadius:"$0"}},[`${$t}:last-child`]:{[`${He}:first-child`]:{borderBottomLeftRadius:"$0"},[`${He}:last-child`]:{borderBottomRightRadius:"$0"}}},square:{}}}}),T=({size:e="md",corners:a="round",numberOfStickyColumns:o=0,...r})=>{const n=t.createElement(bl,{size:e,corners:a,...r});return o?t.createElement(no,{numberOfStickyColumns:o},n):n};T.Body=ao,T.Cell=He,T.Footer=oo,T.FooterCell=bt,T.Header=ro,T.HeaderCell=me,T.Row=to,T.StickyColumnsContainer=no,T.displayName="Table";const vl=({striped:e=!1,...a})=>{const{getRowModel:o}=J();return t.createElement(T.Body,{...a,striped:e},o().rows.map(r=>t.createElement(W.Row,{row:r,key:r.id})))},Zt=({cell:e})=>t.createElement(T.Cell,{key:e.id},se.flexRender(e.column.columnDef.cell,e.getContext())),yl=({children:e})=>{const{asyncDataState:a,runAsyncData:o}=J();return a!==X.REJECTED?null:e(o)},xl=({children:e,hidden:a=!1})=>a?t.createElement(Dt.Root,null,e):e?t.createElement(t.Fragment,null,e):null,io=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(io,{type:"text",inputMode:"numeric",pattern:"[0-9]*",size:a,...o,ref:r}):t.createElement(io,{type:e,size:a,...o,ref:r}));we.displayName="Input";const wl=()=>{const e=t.useRef(null),a=t.useCallback(o=>{o&&(e.current=o)},[]);return[e,a]},El=()=>{const[e,a]=t.useState(null),o=t.useCallback(r=>{r&&a(r)},[]);return[e,o]};var Cl=(e=>(e.SEARCH="SEARCH",e.CLEAR="CLEAR",e))(Cl||{});const Sl=l(b,{color:"$tonal300",position:"absolute",pointerEvents:"none",variants:{size:{sm:{top:"$2",right:"$2",size:"$1"},md:{top:10,right:10,size:20}}}}),kl=l(we,{'&::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, & input[type="search"]::-webkit-search-results-decoration':{display:"none"}}),vt=t.forwardRef(({size:e="md",css:a,value:o,defaultValue:r="",onValueChange:n,clearText:i="Clear",onChange:s,...c},d)=>{const[m,p]=wl(),[g,h]=t.useState(r),[f,$]=t.useState(r?"CLEAR":"SEARCH");t.useEffect(()=>{typeof o>"u"||(h(o),$(o?"CLEAR":"SEARCH"))},[o]),t.useImperativeHandle(d,()=>m.current);const y=()=>{var k,x;const C=m.current;if(!C)return;const S=(k=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:k.set;(x=S==null?void 0:S.call)==null||x.call(S,C,"");const N=new Event("input",{bubbles:!0});C.dispatchEvent(N),C.focus(),n==null||n("")},R=k=>{s==null||s(k);const x=k.target.value;h(x),n==null||n(x),$(x?"CLEAR":"SEARCH")},w=()=>f==="SEARCH"?t.createElement(Sl,{is:v.Search,size:e,css:{size:e=="sm"?"$1":20}}):t.createElement(A,{label:i,theme:"neutral",size:e,css:{position:"absolute",top:"0",right:"$1"},onClick:y},t.createElement(b,{is:v.Close}));return t.createElement(E,{css:{position:"relative",...a}},t.createElement(kl,{ref:p,size:e,type:"search",...c,value:g,onChange:R,css:{pr:e==="sm"?"$5":"$6"}}),w())});vt.displayName="SearchInput";const Dl=({onChange:e,label:a,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 t.createElement(t.Fragment,null,t.createElement(xl,{hidden:o},t.createElement(Be,{css:{mb:"$3"},htmlFor:a},a)),t.createElement(vt,{...r,defaultValue:c,onChange:d,name:a}))},zl=({sortable:e=!0,theme:a="light",...o})=>{const{getHeaderGroups:r,setIsSortable:n}=J();return t.useEffect(()=>{n(e)},[e,n]),t.createElement(T.Header,{theme:a,...o},r().map(i=>t.createElement(T.Row,{key:i.id},i.headers.map(s=>t.createElement(W.HeaderCell,{header:s,key:s.id})))))},Il={asc:v.SortUp,desc:v.SortDown},Tl=({direction:e})=>t.createElement(b,{is:Il[e],size:"sm",css:{position:"absolute",left:"$1"}}),Rl=({header:e,children:a,css:o,...r})=>{const n=e.column.getIsSorted(),{isSortable:i}=J(),s=e.column.getCanSort();return t.createElement(T.HeaderCell,{onClick:i&&s?e.column.getToggleSortingHandler():void 0,css:{cursor:i&&s?"pointer":"initial",...o},...r},t.createElement(I,{css:{alignItems:"center"}},se.flexRender(e.column.columnDef.header,e.getContext()),n&&i&&t.createElement(I,{css:{position:"relative",alignItems:"center"}},t.createElement(Tl,{direction:n}))))},Nl=l(st,{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(Nl,{...e})},Fl=({row:e})=>t.createElement(T.Row,null,e.getVisibleCells().map((a,o)=>t.createElement(Zt,{key:a.id,cell:a}))),Ml=({sortable:e,striped:a,theme:o,css:r,numberOfStickyColumns:n=0,...i})=>{const{asyncDataState:s}=J(),c=s===X.PENDING;return t.createElement(t.Fragment,null,t.createElement(ea,null),t.createElement(T,{...i,numberOfStickyColumns:n,css:{...r,...c&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},t.createElement(W.Head,{theme:o,sortable:e}),t.createElement(W.Body,{striped:a})))},lo=t.createContext({idColumn:"id"}),Al=()=>{const e=t.useContext(lo);if(!e)throw new Error("useDragAndDropTable can only be called within a DragAndDropContainer");return e},Ll=(e,a,o,r,n)=>{const{active:i,over:s}=e,c=o.indexOf(i.id),d=o.indexOf(s==null?void 0:s.id),m=_e.arrayMove(a.results,c,d);return n==null||n(c,d,m),{results:m,total:m.length}},Pl=(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}),Wl=({idColumn:e="id",onChange:a=void 0,children:o})=>{const{data:r,setData:n}=J(),i=t.useMemo(()=>Pl(r,e),[r]),s=fe.useSensors(fe.useSensor(fe.PointerSensor),fe.useSensor(fe.KeyboardSensor,{coordinateGetter:_e.sortableKeyboardCoordinates}));return t.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=>Ll({active:d,over:m},p,i,e,a))},modifiers:[dr.restrictToVerticalAxis]},t.createElement(_e.SortableContext,{items:i,strategy:_e.verticalListSortingStrategy},t.createElement(lo.Provider,{value:{idColumn:e}},o)))},Bl=({row:e})=>{const{idColumn:a}=Al(),{attributes:o,listeners:r,transform:n,setNodeRef:i,isDragging:s}=_e.useSortable({id:e.original[a]});return t.createElement(T.Row,{ref:i,css:{transform:mr.CSS.Transform.toString(n),zIndex:s?5:void 0}},e.getVisibleCells().map((c,d)=>d===0?t.createElement(T.Cell,{key:c.id},t.createElement(Hl,{...o,...r,isDragging:s,css:{display:"inline-block"},label:"drag and drop"}),se.flexRender(c.column.columnDef.cell,c.getContext())):t.createElement(Zt,{key:c.id,cell:c})))},Ol=l(A,{color:"inherit !important",fill:"currentColor",variants:{isDragging:{true:{cursor:"grabbing"},false:{cursor:"grab"}}}}),Hl=t.forwardRef(({isDragging:e,size:a,...o},r)=>t.createElement(Ol,{ref:r,isDragging:e,appearance:"simple",size:a,...o},t.createElement(b,{is:v.DragHandle,size:a}))),Vl=({striped:e=!1,...a})=>{const{getRowModel:o}=J();return t.createElement(T.Body,{...a,striped:e},o().rows.map(r=>t.createElement(Bl,{row:r,key:r.id})))},_l=({idColumn:e,onDragAndDrop:a,sortable:o,striped:r,theme:n,css:i,...s})=>{const{asyncDataState:c}=J(),d=c===X.PENDING;return t.createElement(Wl,{onChange:a,idColumn:e},t.createElement(ea,null),t.createElement(T,{...s,css:{...i,...d&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},t.createElement(W.Head,{theme:n,sortable:o}),t.createElement(Vl,{striped:r})))},ql=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"}}}}),yt=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(ql,{...i},e&&t.createElement("option",{disabled:!0,hidden:!0,value:""},e),a)});yt.displayName="Select";const Gl=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:Dn,"@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:Mt},'&[data-side="bottom"]':{animationName:Rt},'&[data-side="left"]':{animationName:Nt}}},variants:{size:{sm:{maxWidth:"100px"},md:{maxWidth:"250px"},lg:{maxWidth:"400px"}}}}),jl=l(ze.Arrow,{fill:"$tonal500",'[data-align="end"] &':{mr:"$2"},'[data-align="start"] &':{ml:"$2"}}),Yl=({children:e,side:a="top",sideOffset:o=4,size:r="md",...n})=>t.createElement(Gl,{side:a,sideOffset:o,size:r,...n},e,t.createElement(jl,null)),K=({children:e,delayDuration:a=350,...o})=>t.createElement(ze.Root,{delayDuration:a,...o},e);K.Content=Yl,K.Trigger=l(ze.Trigger,{}),K.Portal=ze.Portal,K.Provider=ze.Provider,K.displayName="Tooltip";const so=({direction:e,...a})=>{const o=e==="next";return u.default.createElement(Xl,{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})},Ul=({gotoPage:e,pageCount:a,pageIndex:o,disabled:r})=>u.default.createElement(I,{css:{alignItems:"center"}},u.default.createElement(yt,{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"}`)),Xl=({icon:e,label:a,...o})=>u.default.createElement(K,null,u.default.createElement(K.Trigger,{asChild:!0},u.default.createElement(A,{label:a,...o},u.default.createElement(b,{is:e}))),u.default.createElement(K.Content,null,a)),Jl=l("nav",{display:"flex",justifyContent:"space-between",alignItems:"center",fontVariantNumeric:"tabular-nums"}),Kl=e=>{const{applyPagination:a,getState:o,getRowModel:r,getPageCount:n,previousPage:i,nextPage:s,setPageIndex:c,getTotalRows:d,asyncDataState:m}=J();t.useEffect(()=>{a()},[a]);const{pagination:p}=o(),g=p.pageIndex*p.pageSize+1,h=g+r().rows.length-1,f=m===X.PENDING||m===X.REJECTED;return t.createElement(Jl,{...e},t.createElement(L,{size:"sm"},`${g.toString()} - ${h.toString()} of ${d()} items`),t.createElement(Ul,{gotoPage:c,pageCount:n(),pageIndex:p.pageIndex,disabled:f}),t.createElement(I,{css:{justifyContent:"flex-end"}},t.createElement(so,{direction:"previous",disabled:p.pageIndex===0||f,onClick:i,css:{mr:"$4"}}),t.createElement(so,{direction:"next",disabled:p.pageIndex===n()-1||f,onClick:s})))},W=e=>t.createElement(gl,{...e});W.Body=vl,W.DataCell=Zt,W.DragAndDropTable=_l,W.Head=zl,W.HeaderCell=Rl,W.Pagination=Kl,W.Row=Fl,W.GlobalFilter=Dl,W.Table=Ml,W.Loading=ea,W.Error=yl;const Ql=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Zl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],co={open:"Open calendar",next:"Next month",previous:"Previous month",nextYear:"Next year",previousYear:"Previous year"},es=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"}),ts=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"}}}}}),as=(e,a)=>{const o=e.slice(0,a);return e.slice(a).concat(o)},mo=({css:e,refDateSelected:a,refDateToday:o,firstDayOfWeek:r=0,monthNames:n=Ql,weekdayNames:i=Zl,labels:s=co,date:c=new Date,minDate:d,maxDate:m,setYear:p,...g})=>{const[h,f]=t.useState(!1),[$,y]=t.useState(c==null?void 0:c.getFullYear()),R=F=>{const M=c;M.setFullYear(F),p(M),f(!1)},w=d&&$-16<=d.getFullYear(),k=m&&$>=m.getFullYear(),x=Array.from({length:16},(F,M)=>{const V=$-M;return m&&V>m.getFullYear()||d&&V<d.getFullYear()?0:V}),{calendars:C,getBackProps:S,getForwardProps:N,getDateProps:P}=ur.useDayzed({firstDayOfWeek:r,showOutsideDays:!0,date:c,minDate:d,maxDate:m,...g});return C.length?t.createElement(E,{css:{position:"relative",width:"min-content",mt:"-$1",...e}},t.createElement(I,{css:{position:"absolute",top:0,right:"-$1"}},t.createElement(A,{label:s[h?"previousYear":"previous"],theme:"neutral",size:"md",...!h&&S({calendars:C}),...h&&{onClick:()=>y($-16)},disabled:h&&w},t.createElement(b,{is:v.ChevronLeft})),t.createElement(A,{label:s[h?"nextYear":"next"],theme:"neutral",size:"md",...!h&&N({calendars:C}),...h&&{onClick:()=>y($+16)},disabled:h&&k},t.createElement(b,{is:v.ChevronRight}))),h&&t.createElement(ta,{css:{gridTemplateColumns:"repeat(4, 1fr)",pt:"$7",direction:"rtl",gridGap:"$3 $1"}},x.map((F,M)=>{const V=F===c.getFullYear();return F?t.createElement(ts,{key:`${F}${M}`,theme:V?"primary":"neutral",onClick:()=>R(F),selected:V},F):t.createElement(E,{key:M,css:{width:"$6",height:"$4"}})})),!h&&C.map(({month:F,year:M,weeks:V})=>t.createElement(E,{key:`${F}${M}`},t.createElement(I,{css:{height:"$4",alignItems:"center",mb:"$4"}},t.createElement(ne,{theme:"neutral",css:{px:"0",color:"$tonal600"},onClick:()=>f(!0)},n[F]," ",M)),t.createElement(ta,{css:{mb:"$3"}},as(i,r).map(ke=>t.createElement(L,{as:"span",size:"sm",key:`${F}${M}${ke}`,css:{fontWeight:600,textAlign:"center"}},ke))),t.createElement(ta,null,V.map((ke,Ct)=>ke.map((D,j)=>{const Ve=`${F}${M}${Ct}${j}`;if(!D)return t.createElement("div",{key:Ve});const{date:Ko,selected:ba,today:va,prevMonth:Qo,nextMonth:Zo}=D;return t.createElement(es,{isOutsideMonth:Qo||Zo,isSelected:ba,isToday:va,key:Ve,ref:ba?a:va?o:null,...P({dateObj:D}),type:"button"},Ko.getDate())})))))):null};mo.displayName="Calendar";const os=l($e.Content,{bg:"white",borderRadius:"$1",boxShadow:"$2",maxWidth:"90vw",p:"$sizes$2",pr:"$6",position:"relative",zIndex:zn,"@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:Mt},'&[data-side="bottom"]':{animationName:Rt},'&[data-side="left"]':{animationName:Nt}}},variants:{size:{sm:{maxWidth:"200px"},md:{maxWidth:"400px"},lg:{maxWidth:"600px"}}}}),rs=l($e.Arrow,{fill:"white",zIndex:1,'[data-align="end"] &':{mr:"$sizes$2"},'[data-align="start"] &':{ml:"$sizes$2"}}),ns=({children:e,side:a="top",sideOffset:o=8,closePopoverText:r="Close popover",showCloseButton:n=!0,size:i="md",...s})=>t.createElement(os,{size:i,side:a,sideOffset:o,...s},n&&t.createElement(A,{as:$e.Close,css:{position:"absolute",right:"$0",top:"$0"},label:r,size:"md",theme:"neutral"},t.createElement(b,{is:v.Close})),e,t.createElement(rs,{width:16,height:8}));l($e.Root,{});const le=e=>t.createElement($e.Root,{...e});le.Content=ns,le.Portal=$e.Portal,le.Trigger=$e.Trigger,le.displayName="Popover";const uo="DD/MM/YYYY";qe.default.extend(kr.default);const is=(e,a=uo)=>{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,c=!1)=>{const d=c?qe.default(s,a,!0):qe.default(s);r(d.isValid()?d.toDate():void 0),i(c?s:d.format(a))}}},aa=t.forwardRef(({initialDate:e,dateFormat:a=uo,firstDayOfWeek:o=1,disabled:r,monthNames:n,weekdayNames:i,size:s="md",labels:c,revalidate:d,onChange:m,minDate:p,maxDate:g,...h},f)=>{const{date:$,dateString:y,setDate:R}=is(e,a),w={...co,...c},[k,x]=t.useState(!1),C=t.useRef(null),S=t.useRef(null);return t.useEffect(()=>{m==null||m($)},[$,m]),t.createElement(E,{css:{position:"relative"}},t.createElement(we,{name:"date",disabled:r,size:s,...h,onChange:N=>R(N.target.value,!0),value:y,ref:f}),t.createElement(le,{modal:!0,open:k,onOpenChange:x},t.createElement(le.Trigger,{asChild:!0},t.createElement(A,{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:N=>{var P,F;N.preventDefault(),$?(P=S.current)==null||P.focus():(F=C.current)==null||F.focus()}},t.createElement(mo,{date:$||new Date,selected:$,onDateSelected:async N=>{x(!1),await R(N.date,!1),d&&d()},setYear:async N=>{await R(N,!1),d&&d()},minDate:p,maxDate:g,refDateToday:C,refDateSelected:S,firstDayOfWeek:o,monthNames:n,weekdayNames:i,labels:w})))))});aa.displayName="DateInput";const po=({css:e,label:a,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 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:d}))};po.displayName="DateField";const oa=l(E,{width:"100vw",height:"100vh"}),ls=l(_.Close,{}),ra="translate3d(-50%, -50%, 0)",ho="translate3d(-50%, 50vh, 0)",go="modal_overlay",ss=z({"0%":{transform:ho},"100%":{transform:ra}}),cs=z({"0%":{transform:ra},"100%":{transform:ho}}),ds=l(_.Overlay,{backgroundColor:"$alpha600",top:0,right:0,bottom:0,left:0,position:"fixed",overflowY:"auto",zIndex:Ue,"@allowMotion":{'&[data-state="open"]':{animation:`${At} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),ms=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:`${ss} 550ms cubic-bezier(0.22, 1, 0.36, 1)`},'&[data-state="closed"]':{animation:`${cs} 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"}}}}),us=({size:e="sm",children:a,closeDialogText:o="Close dialog",showCloseButton:r=!0,...n})=>t.createElement(_.Portal,null,t.createElement(ds,{id:go},t.Children.map(a,i=>(i==null?void 0:i.type)===oa&&i),t.createElement(ms,{size:e,"aria-label":"Dialog",onPointerDownOutside:i=>{const s=i.target;(s==null?void 0:s.id)!==go&&i.preventDefault()},...n},r&&t.createElement(A,{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)))),ps=l(_.Root,{}),ue=e=>t.createElement(ps,{...e});ue.Background=oa,ue.Close=ls,ue.Content=us,ue.Description=_.Description,ue.Title=_.Title,ue.Trigger=_.Trigger,ue.displayName="Dialog";const hs=l(Ie.Content,{bg:"white",borderRadius:"$0",boxShadow:"$0",py:"$2",zIndex:kn,"@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:Mt},'&[data-side="bottom"]':{animationName:Rt},'&[data-side="left"]':{animationName:Nt}}}}),gs={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"}},fo=l(Ie.Item,gs),fs=l("a",{textDecoration:"none"}),$s=({children:e,href:a,...o})=>u.default.createElement(fo,{...o,asChild:!0},u.default.createElement(fs,{href:a,role:"menuitem"},e)),bs=l(Ie.Separator,{height:"1px",backgroundColor:"$tonal200",my:"$2"}),vs=l(Ie.Trigger,{}),ys=l(Ie.Root,{}),Ee=e=>u.default.createElement(ys,{...e});Ee.Content=hs,Ee.Item=fo,Ee.LinkItem=$s,Ee.Portal=Ie.Portal,Ee.Separator=bs,Ee.Trigger=vs;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)"}}}}),xs=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)"}}}}),bo=e=>u.default.createElement(xs,{...e}),vo=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"}}}}),ws=l(I,{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(ws,{size:e,...o},t.Children.map(a,r=>t.isValidElement(r)&&(r.type===bo||r.type===vo||r.type===$o)?t.cloneElement(r,{...r.props,size:e}):r));Ke.displayName="EmptyState",Ke.Image=bo,Ke.Title=vo,Ke.Body=$o;const yo=({accept:e,children:a,multiple:o=!1,onFileSelect:r,...n})=>{const i=s=>{const{files:c}=s.target;r(c)};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}))};yo.displayName="FileInput";const Es=l("div",{display:"grid",variants:{gap:Tt("space",{gap:"$key"})}}),xo=({css:e,gap:a=2,minItemSize:o,maxItemSize:r="1fr",...n})=>t.createElement(Es,{css:{...o&&{gridTemplateColumns:`repeat(auto-fit, minmax(${o}, ${r}))`},...e},gap:a,...n});xo.displayName="Grid";const wo=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return t.createElement(te,{css:e,description:i,error:d,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(we,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};wo.displayName="InputField";const Cs=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=t.forwardRef((e,a)=>t.createElement(Cs,{ref:a,...e}));na.displayName="StackContent";const Ss={code:vi,emphasis:yi,heading:wi,inlineCode:Ci,image:Si,link:ki,list:Di,listItem:zi,paragraph:Ii,strong:Ri,text:Ni,thematicBreak:Fi},ks=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}`},Eo=({content:e,customComponents:a={},css:o})=>{const r=Ir.default(e,{extensions:[Tr.default()],mdastExtensions:[zr.default.fromMarkdown]}),n={...Ss,...a},i=s=>{const c=n[s.type];return c?t.createElement(c,{key:ks(s),node:s,handleNode:i}):null};return t.createElement(na,{css:o},r.children.map(i))};Eo.displayName="MarkdownContent";const Co=u.default.createContext(void 0),Ds=()=>{const e=u.default.useContext(Co);if(e===void 0)throw new Error("useNavigationMenuContext must be used within a NavigationMenuContextProvider");return e},xt=e=>{e.preventDefault()},zs=l("ul",{listStyle:"none",m:0,p:0}),Is=l(ce.Content,{p:"$3",bg:"white",mt:"4px",boxShadow:"$1",borderRadius:"$1"}),ia=({children:e})=>u.default.createElement(Is,{onPointerMove:xt,onPointerLeave:xt},u.default.createElement(zs,null,e));ia.displayName="NavigationMenuDropdownContent";const So={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":{...So}},ko={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"}},Ts=l(ce.Trigger,la,{display:"flex",alignItems:"center",borderRadius:"$1",justifyContent:"space-between",'&[data-state="open"]':{background:"$tonal100"},variants:{active:{true:{...ko}}}}),sa=u.default.forwardRef(({children:e,active:a,...o},r)=>u.default.createElement(Ts,{active:a,...o,ref:r,onPointerMove:xt,onPointerLeave:xt},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 Do=({children:e,id:a,...o})=>{const{onNodeUpdate:r}=Ds();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:c=>r(c,a)}):n}))};Do.displayName="NavigationMenuDropdown";const Rs=l("button",{...la,...So}),Ns=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]":{...ko}}}}}),ca=u.default.forwardRef(({children:e,href:a,disabled:o,css:r,variant:n="link",...i},s)=>u.default.createElement(Ns,null,o?u.default.createElement(Rs,{disabled:!0,...i},e):u.default.createElement(Fs,{href:a,ref:s,elementType:n,css:r,...i},e)));ca.displayName="NavigationMenuLink";const zo=u.default.forwardRef((e,a)=>u.default.createElement(ca,{ref:a,variant:"dropdownItem",...e})),Io=l(L,{color:"$tonal500",fontWeight:600});zo.displayName="NavigationMenuDropdownItem",Io.displayName="NavigationMenuDropdownItemTitle";const Ms=z({"0%, 50%":{opacity:0},"100%":{opacity:1}}),As=l(ce.Root,{display:"flex",justifyContent:"center",position:"relative"}),Ls=l(ce.List,{all:"unset",display:"flex",justifyContent:"center",alignItems:"center",gap:"$1",listStyle:"none"}),Ps=l(ce.Viewport,{zIndex:lt}),Ws=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,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 g;return n===""&&(g=setTimeout(()=>r(null),m)),()=>{g!==null&&clearTimeout(g)}},[n]);const p=(g,h)=>{if(g&&s&&n===h){const f=s/2,$=s-g.offsetLeft-g.offsetWidth+g.offsetWidth/2;r(Math.round(f-$))}return g};return u.default.createElement(Co.Provider,{value:{onNodeUpdate:p}},u.default.createElement(As,{onValueChange:i,css:a},u.default.createElement(Ls,{ref:d},e),u.default.createElement(Ws,null,u.default.createElement(Ps,{css:{transform:`translateX(${o||0}px)`,'&[data-state="open"]':{animation:`${Ms} ${m}ms ease`},'&[data-state="closed"]':{animation:`${rt} ${m}ms ease-out`}}}))))};pe.Link=ca,pe.Dropdown=Do,pe.DropdownContent=ia,pe.DropdownItem=zo,pe.DropdownItemTitle=Io,pe.DropdownTrigger=sa,pe.displayName="NavigationMenu";const Bs=l(E,{position:"relative"}),Os=l(I,{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"}),Hs=({value:e,children:a})=>u.default.createElement(Bs,null,!!e&&u.default.createElement(Os,{role:"status"},e),a),Vs=l("span",{zIndex:1}),_s=l(A,{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"}}),To=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(Vs,{tabIndex:-1},t.createElement(_s,{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:c=!1,readonly:d=!1,size:m="md",onChange:p,stepperButtonLabels:g,disabledTooltipContent:h,css:f,...$}=e,[y,R]=t.useState(s),w=t.useRef(null);t.useImperativeHandle(a,()=>w.current);const k={increment:"increment",decrement:"decrement",...g},x={decrement:`Cannot enter values below ${r}`,increment:`Cannot enter values above ${n}`,...h},C=y>=n,S=y<=r,N=t.useCallback(D=>Math.min(Math.max(D,r),n),[n,r]),P=t.useCallback(D=>{R(D),p==null||p(Number(D))},[p]),F=t.useCallback(D=>{const j=D.target.value.replace(/\D/g,"");P(j)},[P]),M=t.useCallback(()=>{var D;if(C||d)return;(D=w==null?void 0:w.current)==null||D.focus();let j;y===""?j=i:j=Number(y)+i,P(N(j))},[N,C,d,i,P,y]),V=t.useCallback(()=>{var D;if(S||d)return;(D=w==null?void 0:w.current)==null||D.focus();let j;y===""?j=r:j=Number(y)-i,P(N(j))},[N,S,d,r,i,P,y]),ke=t.useCallback(D=>{if(D.nativeEvent.isComposing)return;const j=D.key,Ve={ArrowUp:M,ArrowRight:M,ArrowDown:V,ArrowLeft:V,Home:()=>P(r),End:()=>P(n)}[j];Ve&&(D.preventDefault(),Ve(D))},[M,V,P,r,n]),Ct={name:o,type:"number",value:y,...$,onChange:F,onKeyDown:ke,size:m,css:{borderRadius:"0px",width:"$6","&:disabled":{opacity:.3,pointerEvents:"none"}},ref:w,readOnly:d,disabled:c,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":Number(y),role:"spinbutton"};return t.createElement(I,{css:f},t.createElement(To,{onClick:V,icon:v.Minus,css:{borderRight:"none",borderTopRightRadius:"0px",borderBottomRightRadius:"0px"},size:m,disabled:S||c,showTooltip:S&&!c,disabledTooltipContent:x.decrement,label:k.decrement}),t.createElement(we,{...Ct}),t.createElement(To,{onClick:M,icon:v.Plus,css:{borderLeft:"none",borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px"},size:m,disabled:C||c,showTooltip:C&&!c,disabledTooltipContent:x.increment,label:k.increment}))});da.displayName="NumberInput";const Ro=({css:e,label:a,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 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:d}))};Ro.displayName="NumberInputField";const ma=t.forwardRef(({css:e,hidePasswordText:a="Hide password",showPasswordText:o="Show password",size:r="md",...n},i)=>{const[s,c]=Y.useState(!1),d=()=>c(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(A,{appearance:"simple",theme:"neutral",css:{bottom:0,position:"absolute",right:0},label:s?a:o,onClick:d,onMouseDown:m=>m.preventDefault(),size:r},t.createElement(b,{is:s?v.Eye:v.EyeCrossed})))});ma.displayName="PasswordInput";const No=({css:e={},label:a="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 t.createElement(te,{css:{...e,position:"relative"},description:n,error:d,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}))};No.displayName="PasswordField";const qs=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"}}}}),Gs=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(qs,{value:e,max:a,theme:o,...r},t.createElement(Gs,{style:{width:"100%",transform:`translateX(-${100-(e||0)/a*100}%)`}}));Fo.displayName="ProgressBar";const Mo=({css:e,label:a,value:o,...r})=>t.createElement(gt,{css:e,label:a},t.createElement(ht,{value:o,...r}));Mo.displayName="RadioField";const js=l("fieldset",{all:"unset"}),ua=({children:e,css:a,direction:o="column",defaultValue:r,value:n,description:i,label:s,name:c,validation:d,onValueChange:m,...p})=>{const{control:g}=H.useFormContext(),{field:{ref:h,onChange:f,value:$,name:y}}=H.useController({name:c,control:g,rules:d,defaultValue:r}),{error:R}=ie(c);return t.useEffect(()=>{typeof n<"u"&&f(n)},[n]),t.createElement(js,{css:a},t.createElement(Be,{as:"legend",css:{p:0,mb:"$3"},required:Boolean(d==null?void 0:d.required)},s),i&&t.createElement(jt,{css:{mb:"$3"}},i),t.createElement(Yt,{ref:h,direction:o,defaultValue:r,onValueChange:w=>{f(w),m==null||m(w)},value:$,...p},e),R&&t.createElement(mt,{css:{mt:"$2"}},R))};ua.Item=Mo,ua.displayName="RadioButtonField";const Ys=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"}}}}),Us=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"}}]}),Xs=l(Re.Indicator,{backgroundColor:"white",borderRadius:"$round",position:"absolute",size:"6px"}),Ao=({children:e,isFullWidth:a=!1,size:o="md",align:r="left",...n})=>t.createElement(Ys,{...n,align:r,isFullWidth:a,size:o},t.createElement(Us,{align:r,containerIsFullWidth:a},t.createElement(Xs,null)),t.createElement(E,null,e)),Js=({css:e,children:a,size:o,isFullWidth:r,align:n,gap:i="3",justify:s,...c})=>t.createElement(Re.Root,{...c},t.createElement(Le,{direction:"row",justify:s,gap:i,css:e},t.Children.map(a,d=>t.isValidElement(d)&&(d==null?void 0:d.type)===Ao?t.cloneElement(d,{size:o,isFullWidth:r,align:n}):d))),Lo=({css:e,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return t.createElement(te,{css:e,description:i,error:d,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(vt,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Lo.displayName="SearchField";const Po=({css:e=void 0,children:a,name:o,label:r,validation:n,prompt:i,description:s,hideLabel:c,...d})=>{const{register:m}=H.useFormContext(),{error:p}=ie(o),g=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:c},t.createElement(yt,{name:o,id:o,...d,ref:g,...p&&{state:"error"}},a))};Po.displayName="SelectField";const Wo=l(ae.Root,{width:"100%"});Wo.displayName="SidedrawerAccordionRoot";const Ks=z({from:{height:0},to:{height:"var(--radix-accordion-content-height)"}}),Qs=z({from:{height:"var(--radix-accordion-content-height)"},to:{height:0}}),Zs=l(ae.Content,{bg:"white",overflow:"hidden","@allowMotion":{'&[data-state="open"]':{animation:`${Ks} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Qs} 300ms ease-out`}}}),ec=({children:e,...a})=>u.default.createElement(Zs,{...a},u.default.Children.map(e,o=>u.default.createElement(E,{css:{"> a":{px:"$6"},"> button":{px:"$6"}}},o))),tc=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"}}}},ac=l(ae.Trigger,{justifyContent:"space-between",m:0,p:0,"&[data-state=open]":{fontWeight:"600"},...pa}),oc=l(b,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"}}),rc=({children:e,...a})=>u.default.createElement(ae.Header,null,u.default.createElement(ac,{...a},u.default.createElement(I,{css:{alignItems:"center"}},e),u.default.createElement(oc,{is:v.ChevronDown,size:"sm"}))),nc=({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(Wo,{type:"single"},e):e)},ic=({appearance:e="simple",label:a="close",size:o="md",theme:r="neutral",...n})=>u.default.createElement(_.Close,{asChild:!0},u.default.createElement(A,{theme:r,appearance:e,size:o,label:a,...n},u.default.createElement(b,{is:v.Close}))),lc=l(_.Overlay,{animationFillMode:"forwards",bg:"$alpha600",cursor:"pointer",height:"100vh",left:"0",position:"fixed",top:"0",width:"100vw",zIndex:lt-1,"@allowMotion":{'&[data-state="open"]':{animation:`${At} 250ms ease-out`},'&[data-state="closed"]':{animation:`${rt} 550ms ease-out`}}}),sc=l(_.Content,{bg:"white",boxShadow:"$2",display:"flex",flexDirection:"column",position:"fixed",top:0,left:0,height:"100%",maxWidth:"304px",width:"100%",zIndex:lt,"@allowMotion":{'&[data-state="open"]':{animation:`${Wr} 250ms ease-out`},'&[data-state="closed"]':{animation:`${Br} 250ms ease-out`}}}),cc=({children:e,...a})=>u.default.createElement(_.Portal,null,u.default.createElement(lc,{"data-testid":"sidedrawer_overlay"}),u.default.createElement(sc,{role:"navigation",...a},e)),dc=l("footer",{alignItems:"center",borderTop:"1px solid $tonal100",bottom:0,boxShadow:"$3",display:"flex",height:"$6",justifyContent:"center",p:"$3",width:"100%"}),mc=({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},uc=u.default.forwardRef(({icon:e,...a},o)=>u.default.createElement(A,{size:"md",appearance:"simple",theme:"neutral",ref:o,...a},u.default.createElement(b,{is:e}))),wt=({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}});wt.toString=()=>".topbar-brand-logo";const pc=l(L,{color:"$tonal400"}),hc=l("a",{display:"flex",alignItems:"center",textDecoration:"none",color:"$tonal400","&:hover, &:focus":{textDecoration:"none"}}),gc=()=>u.default.createElement(Gt,{orientation:"vertical",css:{height:"$2",bg:"$tonal100"}}),fc=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",[`& ${wt}`]:{'&[src$=".svg"]':{height:24,width:"auto"}}},lg:{height:"$7",[`& ${wt}`]:{'&[src$=".svg"]':{height:32,width:"auto"}}}}}}),$c=l(I,{alignItems:"center",height:"$4",mx:"$4",width:"100%","@md":{mx:"$5"}}),he=({size:e="md",...a})=>{const{y:o}=mc();return u.default.createElement(fc,{hasScrolled:!!o,size:e},u.default.createElement($c,{...a}))};he.Brand=hc,he.BrandLogo=wt,he.BrandName=pc,he.ActionIcon=uc,he.Divider=gc,he.displayName="TopBar";const bc=l("header",{"> div":{width:"100%"}}),vc=({children:e,...a})=>u.default.createElement(bc,{...a},u.default.createElement(he,{css:{mx:"$3"}},e)),yc=l("a",pa),xc=l("button",pa),wc=({active:e,children:a,disabled:o,href:r,onClick:n,...i})=>r?u.default.createElement(yc,{active:e,href:r,onClick:n,...i},a):u.default.createElement(xc,{active:e,disabled:o,onClick:n,...i},a),Ec=l(_.Trigger,{}),Z=({children:e,...a})=>u.default.createElement(Dr.Root,{...a},e);Z.Accordion=tc,Z.AccordionContent=ec,Z.AccordionTrigger=rc,Z.Body=nc,Z.Close=ic,Z.Content=cc,Z.Footer=dc,Z.Header=vc,Z.Item=wc,Z.Trigger=Ec;const Cc=l("div",{height:"$space$3",mt:"$3",position:"relative",width:"100%"}),Bo=(e,a,o)=>(e-a)/(o-a)*100,Sc=(e,a,o)=>{const r=Bo(e,a,o);return r<=10?0:r>=90?100:50},kc=({min:e,max:a,steps:o=[]})=>o.length===0?null:t.createElement(Cc,null,o.map(r=>t.createElement(L,{as:"span",key:r.value,css:{position:"absolute",color:"$tonal300"},style:{left:`${Bo(r.value,e,a)}%`,transform:`translateX(-${Sc(r.value,e,a)}%)`}},r.label))),Dc=({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"}}),zc=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"}}}}}),Ic=l(tt.Range,{bg:"$primary",borderRadius:"$round",height:"100%",position:"absolute","&[data-disabled]":{bg:"$tonal200",cursor:"not-allowed"}}),Tc=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=t.forwardRef(({value:e,defaultValue:a,min:o=0,max:r=100,theme:n="tonal",css:i,children:s,...c},d)=>{const m=e||a;return t.createElement(Ne,{css:i},t.createElement(zc,{theme:n,defaultValue:a,value:e,min:o,max:r,ref:d,...c},t.createElement(ha,null,t.createElement(Ic,null)),(m==null?void 0:m.length)&&m.map((p,g)=>t.createElement(Tc,{key:`thumb${g}`}))),s)});Ce.Value=Dc,Ce.Steps=kc,Ce.displayName="Slider";const Oo=({css:e,label:a,name:o,defaultValue:r,value:n,validation:i,outputLabel:s,min:c=0,max:d=100,steps:m=[],...p})=>{const{control:g}=H.useFormContext(),{field:{ref:h,onChange:f,value:$,name:y}}=H.useController({name:o,control:g,rules:i,defaultValue:r});return u.default.useEffect(()=>{n!=null&&n.length&&f(n)},[JSON.stringify(n)]),u.default.createElement(te,{css:e,fieldId:o,label:a},u.default.createElement(Ce,{ref:h,name:y,onValueChange:f,value:$,min:c,max:d,...p},u.default.createElement(Ce.Steps,{min:c,max:d,steps:m}),u.default.createElement(Ce.Value,{value:$,outputLabel:s})))};Oo.displayName="SliderField";const Ho=t.createContext({steps:[],goToPreviousStep:()=>null,goToNextStep:()=>null,goToStep:()=>null,activeStep:0,viewedSteps:[],allowSkip:!1,direction:"horizontal",hideLabels:!1,completedSteps:[],showCompletedIcons:!1}),Rc=({children:e,stepCount:a,allowSkip:o,onComplete:r,onStepChange:n,direction:i,steps:s,hideLabels:c,showCompletedIcons:d})=>{const[m,p]=t.useState(0),[g,h]=t.useState([0]),[f,$]=t.useState([]),y=!a;t.useEffect(()=>{h(x=>x.includes(m)?x:[...x,m]),n==null||n(m)},[m,n]);const R=()=>{const x=r&&m===a-1,C=m<a-1;if((r||C)&&$(S=>S.includes(m)?S:[...S,m]),x)return r==null?void 0:r();if(C)return p(S=>S+1)},w=()=>{p(x=>x-1)},k=x=>{p(x)};return t.createElement(Ho.Provider,{value:{steps:s||Array(a).fill(""),goToPreviousStep:y?void 0:w,goToNextStep:y?void 0:R,goToStep:y?void 0:k,activeStep:m,viewedSteps:g,completedSteps:f,allowSkip:o,direction:i,hideLabels:c,showCompletedIcons:d}},e)},ga=()=>{const e=t.useContext(Ho);if(!e)throw new Error("Ensure that you wrap any components with the root component Stepper");return e},Nc=({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)))},Mc=l(I,{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"}}}}),Ac=l(I,{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"}}}}]}),Lc=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 Pc=l(I,{justifyContent:"space-between",variants:{direction:{vertical:{flexDirection:"column"},horizontal:{flexDirection:"row"}}}}),Wc=({css:e})=>{const{steps:a,goToStep:o,activeStep:r,viewedSteps:n,allowSkip:i,direction:s,hideLabels:c,completedSteps:d,showCompletedIcons:m}=ga(),p=h=>{const f=a[h];return f.status?f.status:d.length===a.length?B.SUCCESS:r===h&&d.includes(r)?B.REVIEWED:r===h?B.ACTIVE:d.includes(h)?B.COMPLETED:n.includes(h)?B.VIEWED:B.DEFAULT},g=h=>{var f;const $=(f=a[h])==null?void 0:f.status;return d.length===a.length||$===B.SUCCESS?B.SUCCESS:$===B.COMPLETED||h<Math.max(...n)?B.ACTIVE:$===B.VIEWED?B.VIEWED:B.DEFAULT};return t.createElement(Pc,{css:e,direction:s},a.map((h,f)=>{const $=p(f),y=g(f);return t.createElement(Ac,{tabIndex:0,key:`step_${f}`,direction:s,separator:y,status:$,css:s==="horizontal"?{width:`calc(100% / ${a.length})`}:{height:`calc(100% / ${a.length})`},canInteract:i},t.createElement(Mc,{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":h.label?"":`step ${f+1}`,"aria-labelledby":h.label?`step-${f}`:void 0,css:{cursor:i&&n.includes(f)?"pointer":"auto"}},h.status===B.SUCCESS||m&&$===B.COMPLETED?t.createElement(b,{is:v.Ok}):f+1),h.label&&!c&&t.createElement(Lc,{as:"span",id:`step-${f}`,direction:s,status:$},h.label))}))},Qe=({children:e,stepCount:a,allowSkip:o,onComplete:r,onStepChange:n,direction:i="horizontal",steps:s,hideLabels:c=!1,showCompletedIcons:d=!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(Rc,{stepCount:p,allowSkip:o,onComplete:r,onStepChange:a?n:void 0,direction:i,steps:s||Array(p).fill(""),hideLabels:c,showCompletedIcons:d},t.createElement(E,{"aria-label":"progress",css:{width:"100%",...m}},e))};Qe.StepBack=Nc,Qe.StepForward=Fc,Qe.Steps=Wc,Qe.displayName="Stepper";const Bc=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"}}),Oc=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))"}}),Vo=e=>t.createElement(Bc,{...e},t.createElement(Oc,null));Vo.displayName="Switch";const Hc=({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},Vc=l(it,{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(A,{height:"100% !important",position:"absolute",top:"50%",transform:"translateY(-50%)",cursor:"pointer",background:"$background !important",color:"$interactive1 !important",borderRadius:0,opacity:.9}),qc=10,qo=({children:e,colorScheme:a={},...o})=>{const[r,n]=El(),{width:i}=Hc(),[s,c]=u.default.useState(!1),[d,m]=u.default.useState(!1),p=u.default.useCallback(g=>{if(!r)return;const{scrollWidth:h,scrollLeft:f,offsetWidth:$}=r,y=Math.round(h*(qc/100));let R=f;if(g==="right"){const w=f+y;R=w+$<=h?w:h-$}else{const w=f-y;R=w>0?w:0}r.scroll({left:R,behavior:"smooth"}),setTimeout(()=>{const{scrollWidth:w,scrollLeft:k,offsetWidth:x}=r,C=w-(k+x);k===0?(c(!1),m(!0)):C<5?(m(!1),c(!0)):(c(!0),m(!0))},500)},[r]);return u.default.useEffect(()=>{var g;if(!r)return;const{offsetWidth:h,scrollWidth:f}=r,$=f>h;(g=r.scroll)==null||g.call(r,{left:0}),c(!1),m($)},[r,i]),u.default.createElement(Vc,{base:"slate",accent:"blue",interactive:"hiContrast1",...a,...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})))};qo.displayName="TabsTriggerList";const Gc=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()}}}),Go=({children:e,...a})=>t.createElement(Gc,{asChild:!0,...a},t.createElement(L,{size:"sm",as:"button"},e));Go.displayName="TabsTrigger";const jc=l(at.Content,{flexGrow:1,fontFamily:"$body"}),jo=jc;jo.displayName="TabsContent";const Yc=l(at.Root,{width:"100%"}),Ze=({children:e,...a})=>t.createElement(Yc,{...a},e);Ze.TriggerList=qo,Ze.Trigger=Go,Ze.Content=jo,Ze.displayName="Tabs";const Uc=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=t.forwardRef((e,a)=>t.createElement(Uc,{...e,ref:a}));fa.displayName="Textarea";const Yo=({css:e=void 0,label:a,name:o,validation:r,prompt:n,description:i,...s})=>{const{register:c}=H.useFormContext(),{error:d}=ie(o),m=r?c(r):c;return t.createElement(te,{css:e,description:i,error:d,fieldId:o,label:a,prompt:n,required:Boolean(r==null?void 0:r.required)},t.createElement(fa,{id:o,name:o,ref:m,...d&&{state:"error"},...s}))};Yo.displayName="TextareaField";const Uo=400,Xc=z({"0%":{transform:"translate3d(0,-100%,0)",opacity:0},"100%":{transform:"translate3d(0,0,0)",opacity:1}}),Jc=z({"0%":{transform:"translate3d(0,0,0)",opacity:1},"100%":{transform:"translate3d(0,-100%,0)",opacity:0}}),Kc=l("div",{position:"absolute",width:"100%",variants:{visible:{true:{"@allowMotion":{animation:`${Xc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}},false:{opacity:0,"@allowMotion":{animation:`${Jc} 250ms cubic-bezier(0.22, 1, 0.36, 1)`}}}}}),Qc=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:Uo},"@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"}}}}),Zc=t.memo(({ariaLive:e,height:a,id:o,message:r,role:n,type:i="blank",visible:s,calculateOffset:c,updateHeight:d})=>{const m=c(o,{reverseOrder:!0,margin:8});return t.createElement(Kc,{visible:s},t.createElement(Qc,{ref:p=>{p&&a===void 0&&d(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(st,{css:{flex:"0 0 auto",ml:"auto"}}):t.createElement(A,{css:{position:"absolute",top:"$2",right:"$2",color:"white","&:hover,&:focus":{color:"white",opacity:.5}},label:"Close alert",onClick:()=>kt.toast.dismiss(o)},t.createElement(b,{is:v.Close}))))}),ed=l("div",{left:"$2",position:"fixed",top:"$2",right:"$2",zIndex:lt,"@sm":{top:"$3",right:"auto",left:`calc(50% - ${Uo/2}px)`}}),Xo=({children:e})=>{const{toasts:a,handlers:o}=kt.useToaster(),{startPause:r,endPause:n,calculateOffset:i,updateHeight:s}=o;return t.createElement(t.Fragment,null,t.createElement(ed,{onMouseEnter:r,onMouseLeave:n},a.map(c=>t.createElement(Zc,{key:c.id,calculateOffset:i,updateHeight:s,...c}))),e)};Xo.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"}}),td=Se,Et={sm:"32px",md:"40px",lg:"48px"},ad={sm:"$4",md:"$5",lg:"$5"},od={sm:"$2",md:"$3",lg:"$3"},$a=e=>({fontSize:`$${e}`,px:ad[e],minHeight:Et[e],"& > *:not(:last-child)":{mr:od[e]}}),rd=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:Et.sm,p:0}},{isIconOnly:!0,size:"md",css:{minWidth:Et.md,p:0}},{isIconOnly:!0,size:"lg",css:{minWidth:Et.lg,p:0}}]}),nd=t.forwardRef(({size:e="md",children:a,...o},r)=>{var n;const i=t.Children.toArray(a),s=i.length<=1,c=s&&t.isValidElement(i[0])&&((n=i[0])==null?void 0:n.type)===b;return t.createElement(rd,{ref:r,size:e,isIconOnly:c,...o},i.map(d=>!s&&(typeof d=="string"||typeof d=="number")?t.createElement("span",{key:d},d):t.isValidElement(d)&&(d==null?void 0:d.type)===b?t.cloneElement(d,{...d.props,size:e}):d))}),id=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"}}}}]}),ld=e=>e==="horizontal"?"row":"column",sd=t.forwardRef(({orientation:e="horizontal",gap:a=!1,isFullWidth:o,children:r,wrap:n="no-wrap",...i},s)=>{const c=typeof a=="number",d=ld(e);return t.createElement(id,{ref:s,direction:d,hasGap:c,isFullWidth:o,orientation:e,...i},t.createElement(Le,{direction:d,gap:c&&a,align:!1,wrap:n},r))}),cd={Item:td,Button:nd,Root:sd},dd=l(Nr.default,{}),Jo=t.forwardRef(({id:e,ratio:a=9/16,css:o,...r},n)=>t.createElement(Ne,{css:o},t.createElement(E,{css:{borderRadius:"$0",position:"relative",paddingTop:`${a*100}%`,overflow:"hidden",height:0,width:"100%"}},t.createElement(dd,{...r,role:"figure",url:`https://player.vimeo.com/video/${e}`,height:"100%",width:"100%",css:{position:"absolute",top:0,left:0},ref:n}))));Jo.displayName="Video",Object.defineProperty(exports,"toast",{enumerable:!0,get:function(){return Rr.default}}),exports.Accordion=Ge,exports.ActionIcon=A,exports.AlertDialog=G,exports.AlertProvider=_n,exports.Avatar=We,exports.Badge=Wa,exports.Box=E,exports.Button=ne,exports.Carousel=ve,exports.Checkbox=dt,exports.CheckboxField=Ya,exports.Chip=de,exports.ChipDismissibleGroup=Jt,exports.ChipGroup=Ut,exports.ChipToggleGroup=Kt,exports.ColorScheme=it,exports.Combobox=xe,exports.DataTable=W,exports.DateField=po,exports.DateInput=aa,exports.Dialog=ue,exports.Dismissible=ft,exports.DismissibleGroup=ye,exports.Divider=Gt,exports.DropdownMenu=Ee,exports.EmptyState=Ke,exports.FieldWrapper=te,exports.FileInput=yo,exports.Flex=I,exports.Form=ja,exports.Grid=xo,exports.Heading=ct,exports.Icon=b,exports.Image=Pe,exports.InlineFieldWrapper=gt,exports.InlineMessage=mt,exports.Input=we,exports.InputField=wo,exports.Label=Be,exports.Link=pt,exports.List=ut,exports.Loader=st,exports.MarkdownContent=Eo,exports.NavigationMenu=pe,exports.NotificationBadge=Hs,exports.NumberInput=da,exports.NumberInputField=Ro,exports.PasswordField=No,exports.PasswordInput=ma,exports.Popover=le,exports.ProgressBar=Fo,exports.RadioButton=ht,exports.RadioButtonField=ua,exports.RadioButtonGroup=Yt,exports.RadioCard=Ao,exports.RadioCardGroup=Js,exports.SearchField=Lo,exports.SearchInput=vt,exports.Select=yt,exports.SelectField=Po,exports.Sidedrawer=Z,exports.Slider=Ce,exports.SliderField=Oo,exports.Stack=Le,exports.StackContent=na,exports.Stepper=Qe,exports.StyledButton=Ra,exports.StyledLink=_a,exports.Switch=Vo,exports.Table=T,exports.Tabs=Ze,exports.Text=L,exports.Textarea=fa,exports.TextareaField=Yo,exports.ToastProvider=Xo,exports.ToggleGroup=cd,exports.Tooltip=K,exports.TopBar=he,exports.Video=Jo,exports.createTheme=Lr,exports.createThemeVariants=Tt,exports.css=Mr,exports.focusVisibleStyleBlock=be,exports.getCssText=Ar,exports.globalCss=Ca,exports.keyframes=z,exports.media=It,exports.styled=l,exports.theme=q,exports.useAlert=qn,exports.useCarousel=ci,exports.useDataTable=J,exports.utils=zt;
2
2
  //# sourceMappingURL=index.cjs.js.map