import{bi as T,bh as V,d8 as a,e as h,d as A,T as F,bo as L,bj as R,bp as j,r as k,bk as M,C as P,j as U,bm as z,bn as B,eC as g}from"./index-d2b25495.js";function N(e){return V("MuiLink",e)}const E=T("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),H=E,W=({theme:e,ownerState:o})=>{const n=o.color;if("colorSpace"in e&&e.colorSpace){const l=a(e,`palette.${n}.main`)||a(e,`palette.${n}`)||o.color;return e.alpha(l,.4)}const r=a(e,`palette.${n}.main`,!1)||a(e,`palette.${n}`,!1)||o.color,t=a(e,`palette.${n}.mainChannel`)||a(e,`palette.${n}Channel`);return"vars"in e&&t?`rgba(${t} / 0.4)`:h(r,.4)},O=W,v={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},q=e=>{const{classes:o,component:n,focusVisible:r,underline:t}=e,l={root:["root",`underline${L(t)}`,n==="button"&&"button",r&&"focusVisible"]};return B(l,N,o)},G=A(F,{name:"MuiLink",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:n}=e;return[o.root,o[`underline${L(n.underline)}`],n.component==="button"&&o.button]}})(R(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:o,ownerState:n})=>o==="always"&&n.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:o,ownerState:n})=>o==="always"&&n.color==="inherit",style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter(j()).map(([o])=>({props:{underline:"always",color:o},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[o].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${H.focusVisible}`]:{outline:"auto"}}}]}))),I=k.forwardRef(function(o,n){const r=M({props:o,name:"MuiLink"}),t=P(),{className:l,color:s="primary",component:p="a",onBlur:d,onFocus:y,TypographyClasses:w,underline:b="always",variant:f="inherit",sx:c,...C}=r,[$,x]=k.useState(!1),m=i=>{g(i.target)||x(!1),d&&d(i)},D=i=>{g(i.target)&&x(!0),y&&y(i)},u={...r,color:s,component:p,focusVisible:$,underline:b,variant:f},S=q(u);return U.jsx(G,{color:s,className:z(S.root,l),classes:w,component:p,onBlur:m,onFocus:D,ref:n,ownerState:u,variant:f,...C,sx:[...v[s]===void 0?[{color:s}]:[],...Array.isArray(c)?c:[c]],style:{...C.style,...b==="always"&&s!=="inherit"&&!v[s]&&{"--Link-underlineColor":O({theme:t,ownerState:u})}}})}),K=I;export{K as L};
