import{A as e,B as r,D as o,E as n,N as t,O as a,S as l,W as i,_t as s,gt as p,lt as c,mt as u,pt as d,tt as y,x as m,yt as b}from"./render-cqdoDfd9.js";import{t as h}from"./Typography-8v555lWC.js";function x(e){return u("MuiLink",e)}var v=i("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),w=({theme:e,ownerState:o})=>{const n=o.color;if("colorSpace"in e&&e.colorSpace){const r=y(e,`palette.${n}.main`)||y(e,`palette.${n}`)||o.color;return e.alpha(r,.4)}const t=y(e,`palette.${n}.main`,!1)||y(e,`palette.${n}`,!1)||o.color,a=y(e,`palette.${n}.mainChannel`)||y(e,`palette.${n}Channel`);return"vars"in e&&a?`rgba(${a} / 0.4)`:r(t,.4)},f=b(s()),C=c(),S={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},g=e=>{const{classes:r,component:o,focusVisible:t,underline:a}=e;return d({root:["root",`underline${n(a)}`,"button"===o&&"button",t&&"focusVisible"]},x,r)},k=e(h,{name:"MuiLink",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.root,r[`underline${n(o.underline)}`],"button"===o.component&&r.button]}})(l(({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:e,ownerState:r})=>"always"===e&&"inherit"!==r.color,style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:e,ownerState:r})=>"always"===e&&"inherit"===r.color,style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter(m()).map(([r])=>({props:{underline:"always",color:r},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[r].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"},[`&.${v.focusVisible}`]:{outline:"auto"}}}]}))),D=f.forwardRef(function(e,r){const n=a({props:e,name:"MuiLink"}),l=t(),{className:i,color:s="primary",component:c="a",onBlur:u,onFocus:d,TypographyClasses:y,underline:m="always",variant:b="inherit",sx:h,...x}=n,[v,D]=f.useState(!1),L={...n,color:s,component:c,focusVisible:v,underline:m,variant:b};return(0,C.jsx)(k,{color:s,className:p(g(L).root,i),classes:y,component:c,onBlur:e=>{o(e.target)||D(!1),u&&u(e)},onFocus:e=>{o(e.target)&&D(!0),d&&d(e)},ref:r,ownerState:L,variant:b,...x,sx:[...void 0===S[s]?[{color:s}]:[],...Array.isArray(h)?h:[h]],style:{...x.style,..."always"===m&&"inherit"!==s&&!S[s]&&{"--Link-underlineColor":w({theme:l,ownerState:L})}}})});export{D as t};