"use strict";var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),o=require("@material-ui/core"),r=require("prop-types"),i=require("classnames"),l=require("@material-ui/icons/Language"),n=require("../DevCenter/DevCenterRouterContext/effects/useDevCenterRouter.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(r),d=a(i),u=a(l),c=o.withStyles({tooltip:{padding:"4px 8px",display:"flex",alignItems:"center"}})(o.Tooltip),f=o.makeStyles((function(e){return{root:function(e){var t=e.color;return{color:t,fontSize:"inherit",lineHeight:"inherit",letterSpacing:"0.15px",textDecoration:"none","&:hover":{color:t,textDecoration:"underline"},"&:visited":{color:t}}},disabled:{color:e.palette.primary.dark,fontSize:"inherit",lineHeight:"inherit",letterSpacing:"0.15px"},icon:{marginRight:8},buttonLink:{border:"none",background:"none",padding:0,cursor:"pointer"}}})),p=function(r){var i=r.TooltipProps,l=r.children,a=r.className,s=r.color,p=r.disabled,g=r.showTooltip,h=r.tooltipText,b=r.target,m=r.href,x=e.__rest(r,["TooltipProps","children","className","color","disabled","showTooltip","tooltipText","target","href"]),_=f({color:s}),T=n.useDevCenterRouter();if(p)return t.jsx(o.Tooltip,e.__assign({title:"Disabled",placement:"bottom-start"},{children:t.jsx("span",e.__assign({className:d.default(_.disabled,a)},x,{children:l}))}));var j=T&&"_self"===b?t.jsx("button",e.__assign({tabIndex:0,role:"link",className:d.default(_.buttonLink,_.root,a),onClick:function(e){e.metaKey||e.ctrlKey?window.open(m,"_blank"):T.push(m)}},x,{children:l})):t.jsx("a",e.__assign({className:d.default(_.root,a),target:b,href:m,rel:"noopener noreferrer"},x,{children:l}));return g||h?t.jsx(c,e.__assign({title:t.jsxs(t.Fragment,{children:[t.jsx(u.default,{fontSize:"small",className:_.icon}),h||m]}),placement:"bottom-start"},i,{children:j})):j};s.default.node.isRequired,s.default.string.isRequired,s.default.string,s.default.string,s.default.oneOf(["_self","_blank"]),s.default.bool,s.default.bool,s.default.string,s.default.shape({}),p.propTypes={children:s.default.node.isRequired,href:s.default.string.isRequired,className:s.default.string,color:s.default.string,target:s.default.oneOf(["_self","_blank"]),disabled:s.default.bool,showTooltip:s.default.bool,tooltipText:s.default.string,TooltipProps:s.default.shape({})},p.defaultProps={TooltipProps:{},className:"",color:"#03bcd4",target:"_blank",disabled:!1,showTooltip:!1,tooltipText:""},module.exports=p;
