import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/objectWithoutProperties";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{forwardRef as n}from"react";import i from"classnames";import a from"@material-ui/icons/Language";import{Tooltip as l}from"../Tooltip/Tooltip.js";import c from"./TextLink.scss.js";var s=["to","children"],p=["children","className","testId","disableTooltip","disabled","component","to","onClick","target","type","underline"];function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function m(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?d(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):d(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var b=n((function(e,o){var n=e.to,i=e.children,a=r(e,s);return t("a",m(m({},a),{},{href:n,ref:o,children:i}))})),f={primary:c.primary,secondary:c.secondary},u={onHover:c.underlineOnHover,always:c.underlineAlways,never:c.underlineNever},y=n((function(e,n){var s=e.children,d=e.className,y=e.testId,v=e.disableTooltip,h=e.disabled,O=e.component,j=void 0===O?b:O,g=e.to,P=e.onClick,w=e.target,N=void 0===w?"_blank":w,k=e.type,T=void 0===k?"primary":k,D=e.underline,x=void 0===D?"onHover":D,C=r(e,p),H=i(c.link,h?c.disabled:c.enabled,f[T],u[x]),S=null==g?void 0:g.replaceAll("/","/​");return t(l,{title:o("div",{className:c.tooltip,children:[t(a,{fontSize:"small",className:c.icon}),S]}),disabled:v,placement:"bottom-start",children:t("span",{ref:n,className:d,children:h?t("span",{className:H,children:s}):t(j,m(m({onClick:P,className:H,"data-testid":y,to:g,target:N},C),{},{children:s}))})})}));export{y as TextLink};
//# sourceMappingURL=TextLink.js.map
