import{n as s,R as g,a7 as x,aK as b,M as C,j as n,aI as L,aL as v,a8 as y,an as w,a2 as S}from"./index.DXat8gQf.js";const T=s("div",{target:"e15akk1j0"})({display:"flex",flexDirection:"column"}),h=s("a",{target:"e15akk1j1"})(({disabled:r,isCurrentPage:o,fluidWidth:t,theme:e})=>({textDecoration:"none",width:typeof t=="number"?`${t}px`:"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...r?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}})),P=s("span",{target:"e15akk1j2"})(({disabled:r,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...r?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}));function j(r,o){return r===null&&o?!0:r===null&&!o?!1:r===!0}function D(r){const{onPageChange:o,currentPageScriptHash:t}=g.useContext(x),e=g.useContext(b),{colors:u}=C(),{disabled:l,element:a,width:i}=r,p={width:i},f=j(a.useContainerWidth,e),c=t===a.pageScriptHash,k=d=>{a.external?l&&d.preventDefault():(d.preventDefault(),l||o(a.pageScriptHash))};return n("div",{className:"stPageLink","data-testid":"stPageLink",style:p,children:n(L,{help:a.help,placement:v.TOP_RIGHT,children:n(T,{children:y(h,{"data-testid":"stPageLink-NavLink",disabled:l,isCurrentPage:c,fluidWidth:f?i:!1,href:a.page,target:a.external?"_blank":"",rel:"noreferrer",onClick:k,children:[a.icon&&n(w,{size:"lg",color:u.bodyText,iconValue:a.icon}),n(P,{disabled:l,children:n(S,{source:a.label,allowHTML:!1,isLabel:!0,boldLabel:c,largerLabel:!0,disableLinks:!0})})]})})})})}export{D as default};
