var __rest = this && this.__rest || function (s, e) {
    var t = {};
    for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
    }if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
        if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];
    }return t;
};
import React from 'react';
import { InlineBlock } from 'jsxstyle';
import * as colors from '../../mixins/colors';
import * as moreLinksAndButtons from '../../mixins/more-links-and-buttons';
import track from '../../utilities/tracking';
import prefixKeys from '../../utilities/prefix-object-keys';
var baseStyle = Object.assign({ color: colors.linkBlue, textDecoration: 'none', WebkitTapHighlightColor: 'transparent' }, prefixKeys('hover', {
    color: colors.linkOrange,
    cursor: 'pointer'
}), prefixKeys('active', {
    color: colors.linkActive
})
// - To be used sparingly
// '&.with-pointer-cursor': {
//   cursor: 'pointer'
// },
// '&.with-inherited-color': {
//   color: 'inherit',
//   '&:hover': {
//     color: colors.linkOrange,
//     '&:active': {
//       color: colors.linkActive
//     }
//   },
//   '&.with-underline': {
//     display: 'inline-block',
//     verticalAlign: 'baseline',
//     lineHeight: 1,
//     borderBottom: '1px solid',
//     '&:hover': {
//       borderBottomColor: 'transparent'
//     }
//   }
// }
);
var inheritedColorStyle = Object.assign({ color: 'inherit' }, prefixKeys('hover', Object.assign({ color: colors.linkOrange }, prefixKeys('active', {
    color: colors.linkActive
}))));
var TrackableLink = function TrackableLink(props) {
    var trackingData = props.track,
        withMoreIconAfter = props.withMoreIconAfter,
        withMoreIconBefore = props.withMoreIconBefore,
        withInheritedColor = props.withInheritedColor,
        passableProps = __rest(props, ["track", "withMoreIconAfter", "withMoreIconBefore", "withInheritedColor"]);

    var passedProps = Object.assign({}, withMoreIconAfter ? moreLinksAndButtons.withMoreIconAfter : {}, withMoreIconBefore ? moreLinksAndButtons.withMoreIconBefore : {}, withInheritedColor ? inheritedColorStyle : {}, passableProps);
    passedProps.props = passedProps.props || {};
    if (trackingData) {
        passedProps.props.onClick = track.bind(null, trackingData);
    }
    return React.createElement(InlineBlock, Object.assign({ component: 'a' }, baseStyle, passedProps));
};
export default TrackableLink;
//# sourceMappingURL=link.js.map