import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/objectWithoutProperties";import{jsx as r,jsxs as o,Fragment as i}from"react/jsx-runtime";import{withStyles as n,Tooltip as l,makeStyles as a}from"@material-ui/core";import c from"classnames";import p from"@material-ui/icons/Language";import{useDevCenterRouter as s}from"../DevCenter/DevCenterRouterContext/effects/useDevCenterRouter.js";var d=["children","href","TooltipProps","className","color","target","disabled","showTooltip","tooltipText"];function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function u(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?m(Object(o),!0).forEach((function(r){e(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):m(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}var f=n({tooltip:{padding:"4px 8px",display:"flex",alignItems:"center"}})(l),b=a((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"}}})),h=function(e){var n=e.children,a=e.href,m=e.TooltipProps,h=void 0===m?{}:m,g=e.className,v=void 0===g?"":g,O=e.color,y=void 0===O?"#03bcd4":O,j=e.target,x=void 0===j?"_blank":j,P=e.disabled,w=void 0!==P&&P,D=e.showTooltip,k=void 0!==D&&D,S=e.tooltipText,N=void 0===S?"":S,T=t(e,d),C=b({color:y}),z=s();if(w)return r(l,{title:"Disabled",placement:"bottom-start",children:r("span",u(u({className:c(C.disabled,v)},T),{},{children:n}))});var L=z&&"_self"===x?r("button",u(u({tabIndex:0,role:"link",className:c(C.buttonLink,C.root,v),onClick:function(e){e.metaKey||e.ctrlKey?window.open(a,"_blank"):z.push(a)}},T),{},{children:n})):r("a",u(u({className:c(C.root,v),target:x,href:a,rel:"noopener noreferrer"},T),{},{children:n})),R=N||(null==a?void 0:a.replaceAll("/","/​"));return k||N?r(f,u(u({title:o(i,{children:[r(p,{fontSize:"small",className:C.icon}),R]}),placement:"bottom-start"},h),{},{children:L})):L};export{h as default};
//# sourceMappingURL=index.js.map
