"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[4827],{74827:(e,r,o)=>{o.r(r),o.d(r,{default:()=>f});var t=o(58878),a=o(8151),n=o(94426),l=o(997),i=o(98350),s=o(34914),d=o(84152),c=o(42333),g=o(89653);const p=(0,g.A)("div",{target:"e11k5jya2"})((()=>({display:"flex",flexDirection:"column"})),""),u=(0,g.A)("a",{target:"e11k5jya1"})((e=>{let{disabled:r,isCurrentPage:o,fluidWidth:t,theme:a}=e;return{textDecoration:"none",width:"number"==typeof t?`${t}px`:"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:a.spacing.sm,borderRadius:a.radii.default,paddingLeft:a.spacing.sm,paddingRight:a.spacing.sm,marginTop:a.spacing.threeXS,marginBottom:a.spacing.threeXS,lineHeight:a.lineHeights.menuItem,backgroundColor:o?a.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?a.colors.darkenedBgMix25:a.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:a.colors.darkenedBgMix15},"@media print":{paddingLeft:a.spacing.none},...r?{borderColor:a.colors.borderColor,backgroundColor:a.colors.transparent,color:a.colors.fadedText40,cursor:"not-allowed","&:hover":{color:a.colors.fadedText40,backgroundColor:a.colors.transparent}}:{}}}),""),h=(0,g.A)("span",{target:"e11k5jya0"})((e=>{let{disabled:r,theme:o}=e;return{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"}:{}}}),"");var b=o(90782);const f=function(e){const{onPageChange:r,currentPageScriptHash:o}=t.useContext(d.n),g=t.useContext(c.A),{colors:f}=(0,a.u)(),{disabled:x,element:k,width:C}=e,m={width:C},v=function(e,r){return!(null!==e||!r)||!(null===e&&!r)&&!0===e}(k.useContainerWidth,g),w=o===k.pageScriptHash;return(0,b.jsx)("div",{className:"stPageLink","data-testid":"stPageLink",style:m,children:(0,b.jsx)(i.F,{help:k.help,placement:l.W.TOP_RIGHT,children:(0,b.jsx)(p,{children:(0,b.jsxs)(u,{"data-testid":"stPageLink-NavLink",disabled:x,isCurrentPage:w,fluidWidth:!!v&&C,href:k.page,target:k.external?"_blank":"",rel:"noreferrer",onClick:e=>{k.external?x&&e.preventDefault():(e.preventDefault(),x||r(k.pageScriptHash))},children:[k.icon&&(0,b.jsx)(n.$,{size:"lg",color:f.bodyText,iconValue:k.icon}),(0,b.jsx)(h,{disabled:x,children:(0,b.jsx)(s.Ay,{source:k.label,allowHTML:!1,isLabel:!0,boldLabel:w,largerLabel:!0,disableLinks:!0})})]})})})})}}}]);