{"version":3,"file":"SafeAnchor-CzK3s0G_.js","sources":["../../Client/node_modules/react-bootstrap/es/SafeAnchor.js"],"sourcesContent":["import _extends from \"@babel/runtime-corejs2/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime-corejs2/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime-corejs2/helpers/esm/inheritsLoose\";\nimport _assertThisInitialized from \"@babel/runtime-corejs2/helpers/esm/assertThisInitialized\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport elementType from 'prop-types-extra/lib/elementType';\nimport createChainedFunction from './utils/createChainedFunction';\nvar propTypes = {\n  href: PropTypes.string,\n  onClick: PropTypes.func,\n  onKeyDown: PropTypes.func,\n  disabled: PropTypes.bool,\n  role: PropTypes.string,\n  tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n  /**\n   * this is sort of silly but needed for Button\n   */\n  componentClass: elementType\n};\nvar defaultProps = {\n  componentClass: 'a'\n};\n\nfunction isTrivialHref(href) {\n  return !href || href.trim() === '#';\n}\n/**\n * There are situations due to browser quirks or Bootstrap CSS where\n * an anchor tag is needed, when semantically a button tag is the\n * better choice. SafeAnchor ensures that when an anchor is used like a\n * button its accessible. It also emulates input `disabled` behavior for\n * links, which is usually desirable for Buttons, NavItems, MenuItems, etc.\n */\n\n\nvar SafeAnchor =\n/*#__PURE__*/\nfunction (_React$Component) {\n  _inheritsLoose(SafeAnchor, _React$Component);\n\n  function SafeAnchor(props, context) {\n    var _this;\n\n    _this = _React$Component.call(this, props, context) || this;\n    _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n    _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n    return _this;\n  }\n\n  var _proto = SafeAnchor.prototype;\n\n  _proto.handleClick = function handleClick(event) {\n    var _this$props = this.props,\n        disabled = _this$props.disabled,\n        href = _this$props.href,\n        onClick = _this$props.onClick;\n\n    if (disabled || isTrivialHref(href)) {\n      event.preventDefault();\n    }\n\n    if (disabled) {\n      event.stopPropagation();\n      return;\n    }\n\n    if (onClick) {\n      onClick(event);\n    }\n  };\n\n  _proto.handleKeyDown = function handleKeyDown(event) {\n    if (event.key === ' ') {\n      event.preventDefault();\n      this.handleClick(event);\n    }\n  };\n\n  _proto.render = function render() {\n    var _this$props2 = this.props,\n        Component = _this$props2.componentClass,\n        disabled = _this$props2.disabled,\n        onKeyDown = _this$props2.onKeyDown,\n        props = _objectWithoutPropertiesLoose(_this$props2, [\"componentClass\", \"disabled\", \"onKeyDown\"]);\n\n    if (isTrivialHref(props.href)) {\n      props.role = props.role || 'button'; // we want to make sure there is a href attribute on the node\n      // otherwise, the cursor incorrectly styled (except with role='button')\n\n      props.href = props.href || '#';\n    }\n\n    if (disabled) {\n      props.tabIndex = -1;\n      props.style = _extends({\n        pointerEvents: 'none'\n      }, props.style);\n    }\n\n    return React.createElement(Component, _extends({}, props, {\n      onClick: this.handleClick,\n      onKeyDown: createChainedFunction(this.handleKeyDown, onKeyDown)\n    }));\n  };\n\n  return SafeAnchor;\n}(React.Component);\n\nSafeAnchor.propTypes = propTypes;\nSafeAnchor.defaultProps = defaultProps;\nexport default SafeAnchor;"],"names":["propTypes","PropTypes","elementType","defaultProps","isTrivialHref","href","SafeAnchor","_React$Component","_inheritsLoose","props","context","_this","_assertThisInitialized","_proto","event","_this$props","disabled","onClick","_this$props2","Component","onKeyDown","_objectWithoutPropertiesLoose","_extends","React","createChainedFunction"],"mappings":"iLAQA,IAAIA,EAAY,CACd,KAAMC,EAAU,OAChB,QAASA,EAAU,KACnB,UAAWA,EAAU,KACrB,SAAUA,EAAU,KACpB,KAAMA,EAAU,OAChB,SAAUA,EAAU,UAAU,CAACA,EAAU,OAAQA,EAAU,MAAM,CAAC,EAKlE,eAAgBC,CAClB,EACIC,EAAe,CACjB,eAAgB,GAClB,EAEA,SAASC,EAAcC,EAAM,CAC3B,MAAO,CAACA,GAAQA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