function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

/*
Copyright (c) Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import { styled } from '../styles';
import { BADGE_ENHANCER_STYLES, FLOATING_MARKER_ANCHOR_POSITIONS, LABEL_SIZES, EARNER_LOCATION_PUCK_CORE_SCALES, PINHEAD_SIZES_SHAPES, FLOATING_ROUTE_MARKER_POINTER_TRANSFORMS } from './constants';
export var getAnchorTransform = function getAnchorTransform(anchor, anchorSize) {
  var _FLOATING_MARKER_ANCH;

  return (_FLOATING_MARKER_ANCH = {}, _defineProperty(_FLOATING_MARKER_ANCH, FLOATING_MARKER_ANCHOR_POSITIONS.none, ""), _defineProperty(_FLOATING_MARKER_ANCH, FLOATING_MARKER_ANCHOR_POSITIONS.topLeft, "translate(".concat(anchorSize, "px, ").concat(anchorSize, "px)")), _defineProperty(_FLOATING_MARKER_ANCH, FLOATING_MARKER_ANCHOR_POSITIONS.topRight, "translate(-100%, ".concat(anchorSize, "px)")), _defineProperty(_FLOATING_MARKER_ANCH, FLOATING_MARKER_ANCHOR_POSITIONS.bottomLeft, "translate(".concat(anchorSize, "px, -100%)")), _defineProperty(_FLOATING_MARKER_ANCH, FLOATING_MARKER_ANCHOR_POSITIONS.bottomRight, "translate(-100%, -100%)"), _FLOATING_MARKER_ANCH)[anchor];
};
export var StyledDragShadowContainer = styled('div', function (_ref) {
  var $theme = _ref.$theme,
      $height = _ref.$height,
      $width = _ref.$width,
      $dragging = _ref.$dragging;
  return {
    width: "".concat($width, "px"),
    height: "".concat($height, "px"),
    opacity: $dragging ? 1 : 0,
    visibility: $dragging ? 'visible' : 'hidden',
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
    position: 'relative',
    boxShadow: $theme.lighting.shadow600
  };
});
StyledDragShadowContainer.displayName = "StyledDragShadowContainer";
StyledDragShadowContainer.displayName = 'StyledDragShadowContainer';
export var StyledDragShadow = styled('div', function (_ref2) {
  var $theme = _ref2.$theme,
      $background = _ref2.$background,
      $width = _ref2.$width;
  return {
    backgroundColor: $background,
    borderRadius: '50%',
    width: "".concat($width, "px"),
    height: '4px',
    position: 'absolute',
    bottom: 0
  };
});
StyledDragShadow.displayName = "StyledDragShadow";
StyledDragShadow.displayName = 'StyledDragShadow';
export var StyledNeedle = styled('div', function (_ref3) {
  var $theme = _ref3.$theme,
      $background = _ref3.$background,
      $height = _ref3.$height;
  return {
    backgroundColor: $background,
    width: '4px',
    height: "".concat($height, "px"),
    boxShadow: $theme.lighting.shadow600
  };
});
StyledNeedle.displayName = "StyledNeedle";
StyledNeedle.displayName = 'StyledNeedle';
export var StyledFloatingMarkerRoot = styled('div', function (_ref4) {
  var $size = _ref4.$size;
  return {
    position: 'relative',
    height: "".concat($size, "px"),
    width: "".concat($size, "px")
  };
});
StyledFloatingMarkerRoot.displayName = "StyledFloatingMarkerRoot";
StyledFloatingMarkerRoot.displayName = 'StyledFloatingMarkerRoot';
export var StyledFloatingMarkerPinHeadContainer = styled('div', function (_ref5) {
  var $theme = _ref5.$theme,
      $anchor = _ref5.$anchor,
      $anchorSize = _ref5.$anchorSize;
  return {
    position: 'absolute',
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
    transform: getAnchorTransform($anchor, $anchorSize)
  };
});
StyledFloatingMarkerPinHeadContainer.displayName = "StyledFloatingMarkerPinHeadContainer";
StyledFloatingMarkerPinHeadContainer.displayName = 'StyledFloatingMarkerPinHeadContainer';
export var StyledFloatingMarkerAnchorContainer = styled('div', function () {
  return {
    position: 'absolute'
  };
});
StyledFloatingMarkerAnchorContainer.displayName = "StyledFloatingMarkerAnchorContainer";
StyledFloatingMarkerAnchorContainer.displayName = 'StyledFloatingMarkerAnchorContainer';
export var StyledFixedMarkerRoot = styled('div', function () {
  return {
    display: 'flex',
    alignItems: 'center',
    flexDirection: 'column'
  };
});
StyledFixedMarkerRoot.displayName = "StyledFixedMarkerRoot";
StyledFixedMarkerRoot.displayName = 'StyledFixedMarkerRoot';
export var StyledFixedMarkerDragContainer = styled('div', function (_ref6) {
  var $theme = _ref6.$theme,
      $translateAmount = _ref6.$translateAmount,
      $performTranslate = _ref6.$performTranslate;
  return {
    transform: "translateY(".concat($performTranslate ? "".concat($translateAmount, "px") : '0px', ")"),
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
    display: 'flex',
    alignItems: 'center',
    flexDirection: 'column'
  };
});
StyledFixedMarkerDragContainer.displayName = "StyledFixedMarkerDragContainer";
StyledFixedMarkerDragContainer.displayName = 'StyledFixedMarkerDragContainer';
export var StyledOuterXXSmallAnchor = styled('div', function (_ref7) {
  var $theme = _ref7.$theme,
      $round = _ref7.$round,
      $background = _ref7.$background,
      $size = _ref7.$size;
  return {
    backgroundColor: $background,
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    height: "".concat($size, "px"),
    width: "".concat($size, "px"),
    borderRadius: $round ? '50%' : 0,
    boxShadow: $theme.lighting.shadow600
  };
});
StyledOuterXXSmallAnchor.displayName = "StyledOuterXXSmallAnchor";
StyledOuterXXSmallAnchor.displayName = 'StyledOuterXXSmallAnchor';
export var StyledInnerXXSmallAnchor = styled('div', function (_ref8) {
  var $round = _ref8.$round,
      $color = _ref8.$color,
      $size = _ref8.$size;
  return {
    backgroundColor: $color,
    height: "".concat($size, "px"),
    width: "".concat($size, "px"),
    borderRadius: $round ? '50%' : 0
  };
});
StyledInnerXXSmallAnchor.displayName = "StyledInnerXXSmallAnchor";
StyledInnerXXSmallAnchor.displayName = 'StyledInnerXXSmallAnchor';
export var StyledOuterXSmallAnchor = styled('div', function (_ref9) {
  var $theme = _ref9.$theme,
      $round = _ref9.$round,
      $background = _ref9.$background,
      $size = _ref9.$size;
  return {
    backgroundColor: $background,
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    height: "".concat($size, "px"),
    width: "".concat($size, "px"),
    borderRadius: $round ? '50%' : 0,
    boxShadow: $theme.lighting.shadow600
  };
});
StyledOuterXSmallAnchor.displayName = "StyledOuterXSmallAnchor";
StyledOuterXSmallAnchor.displayName = 'StyledOuterXSmallAnchor';
export var StyledInnerXSmallAnchor = styled('div', function (_ref10) {
  var $round = _ref10.$round,
      $color = _ref10.$color,
      $size = _ref10.$size;
  return {
    backgroundColor: $color,
    height: "".concat($size, "px"),
    width: "".concat($size, "px"),
    borderRadius: $round ? '50%' : 0
  };
});
StyledInnerXSmallAnchor.displayName = "StyledInnerXSmallAnchor";
StyledInnerXSmallAnchor.displayName = 'StyledInnerXSmallAnchor';
export var StyledPinHead = styled('div', function (_ref11) {
  var $theme = _ref11.$theme,
      $height = _ref11.$height,
      $background = _ref11.$background,
      $gridTemplateColumns = _ref11.$gridTemplateColumns,
      $type = _ref11.$type,
      $forceCircle = _ref11.$forceCircle;
  var sharedStyles = {
    fixed: {
      padding: '0px 12px',
      borderRadius: "".concat($height, "px")
    },
    floating: {
      padding: '0px 8px'
    }
  };
  return _objectSpread(_objectSpread({
    backgroundColor: $background,
    height: "".concat($height, "px"),
    display: 'grid',
    gridTemplateColumns: $gridTemplateColumns,
    gap: '8px',
    boxShadow: $theme.lighting.shadow600,
    whiteSpace: 'nowrap'
  }, sharedStyles[$type]), $forceCircle && {
    width: "".concat($height, "px"),
    display: 'flex',
    justifyContent: 'center',
    boxSizing: 'border-box'
  });
});
StyledPinHead.displayName = "StyledPinHead";
StyledPinHead.displayName = 'StyledPinHead';
export var StyledStrokedLabelContainer = styled('div', function (_ref12) {
  var $position = _ref12.$position,
      $theme = _ref12.$theme,
      $labelOffset = _ref12.$labelOffset;
  var staticLabelOffset = 4;
  var positions = {
    top: {
      left: "calc(50% + ".concat(staticLabelOffset, "px)"),
      bottom: '100%',
      alignItems: 'flex-end',
      justifyContent: 'center',
      textAlign: 'center'
    },
    bottom: {
      left: '50%',
      top: "calc(100% + ".concat(staticLabelOffset, "px + ").concat($labelOffset, "px)"),
      alignItems: 'flex-start',
      justifyContent: 'center',
      textAlign: 'center'
    },
    right: {
      left: "calc(100% + ".concat(staticLabelOffset, "px)"),
      top: '50%',
      alignItems: 'center',
      justifyContent: 'flex-start'
    },
    left: {
      right: "calc(100% + ".concat(staticLabelOffset, "px)"),
      top: '50%',
      alignItems: 'center',
      justifyContent: 'flex-end',
      textAlign: 'right'
    },
    none: {}
  };
  return _objectSpread({
    position: 'absolute',
    width: '0px',
    height: '0px',
    pointerEvents: 'none',
    display: 'flex'
  }, positions[$position]);
});
StyledStrokedLabelContainer.displayName = "StyledStrokedLabelContainer";
StyledStrokedLabelContainer.displayName = 'StyledStrokedLabelContainer';
export var StyledStrokedLabel = styled('div', function (_ref13) {
  var $theme = _ref13.$theme,
      $size = _ref13.$size;
  var strokeWidth = 1.5;
  var strokeColor = $theme.colors.borderInverseSelected;
  var textShadow = "-".concat(strokeWidth, "px -").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n    0 -").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n    ").concat(strokeWidth, "px -").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n    ").concat(strokeWidth, "px 0 0 ").concat(strokeColor, ",\n    ").concat(strokeWidth, "px ").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n    0 ").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n   -").concat(strokeWidth, "px ").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n   -").concat(strokeWidth, "px 0 0 ").concat(strokeColor);
  return _objectSpread(_objectSpread({
    display: 'flex'
  }, $theme.typography[LABEL_SIZES[$size]]), {}, {
    color: $theme.colors.contentPrimary,
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
    textShadow: textShadow,
    pointerEvents: 'auto',
    width: 'max-content',
    maxWidth: '200px'
  });
});
StyledStrokedLabel.displayName = "StyledStrokedLabel";
StyledStrokedLabel.displayName = 'StyledStrokedLabel';
export var StyledBadgeEnhancerRoot = styled('div', function (_ref14) {
  var $theme = _ref14.$theme,
      $size = _ref14.$size,
      $position = _ref14.$position;
  var x = $position.x,
      y = $position.y;
  return _objectSpread(_objectSpread({
    position: 'absolute'
  }, $theme.typography.LabelSmall), {}, {
    backgroundColor: $theme.colors.backgroundAccent,
    color: $theme.colors.contentOnColor,
    boxSizing: 'border-box',
    right: 0,
    transform: "translate(calc(100% + ".concat(x, "px), ").concat(y, "px)"),
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all")
  }, BADGE_ENHANCER_STYLES[$size]);
});
StyledBadgeEnhancerRoot.displayName = "StyledBadgeEnhancerRoot";
StyledBadgeEnhancerRoot.displayName = 'StyledBadgeEnhancerRoot';
export var RelativeContainer = styled('div', function () {
  return {
    position: 'relative'
  };
});
RelativeContainer.displayName = "RelativeContainer";
RelativeContainer.displayName = 'RelativeContainer';
export var StyledEnhancerSlot = styled('div', function (_ref15) {
  var $theme = _ref15.$theme,
      $color = _ref15.$color,
      $height = _ref15.$height,
      $size = _ref15.$size;
  return _objectSpread(_objectSpread({}, $theme.typography[LABEL_SIZES[$size]]), {}, {
    display: 'flex',
    alignItems: 'center',
    textAlign: 'center',
    lineHeight: "".concat($height, "px"),
    height: "".concat($height, "px"),
    color: $color
  });
});
StyledEnhancerSlot.displayName = "StyledEnhancerSlot";
export var StyledFloatingRouteMarkerRoot = styled('div', function (_ref16) {
  var $theme = _ref16.$theme,
      $height = _ref16.$height,
      $background = _ref16.$background,
      $gridTemplateColumns = _ref16.$gridTemplateColumns;
  return {
    position: 'absolute',
    backgroundColor: $background,
    height: "".concat($height, "px"),
    display: 'grid',
    gridTemplateColumns: $gridTemplateColumns,
    gap: '8px',
    filter: "drop-shadow(".concat($theme.lighting.shadow600, ")"),
    whiteSpace: 'nowrap',
    borderRadius: "".concat(8, "px"),
    padding: "".concat(4, "px ", 8, "px"),
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all")
  };
});
StyledFloatingRouteMarkerRoot.displayName = "StyledFloatingRouteMarkerRoot";
StyledFloatingRouteMarkerRoot.displayName = 'StyledFloatingRouteMarkerRoot';
StyledEnhancerSlot.displayName = 'StyledEnhancerSlot';
export var StyledLabelSlot = styled('div', function () {
  return {
    display: 'flex',
    justifyContent: 'center',
    flexDirection: 'column'
  };
});
StyledLabelSlot.displayName = "StyledLabelSlot";
StyledLabelSlot.displayName = 'StyledLabelSlot';
export var StyledLabel = styled('div', function (_ref17) {
  var $theme = _ref17.$theme,
      $size = _ref17.$size,
      $renderSecondaryLabel = _ref17.$renderSecondaryLabel,
      $color = _ref17.$color;
  var pinheadSizeOrder = Object.values(PINHEAD_SIZES_SHAPES);
  var labelSizeIndex = pinheadSizeOrder.findIndex(function (x) {
    return $size === x;
  });

  if ($renderSecondaryLabel) {
    labelSizeIndex--;
  }

  var typographyStyle = LABEL_SIZES[pinheadSizeOrder[labelSizeIndex]];
  return _objectSpread(_objectSpread({}, $theme.typography[typographyStyle]), {}, {
    color: $color
  });
});
StyledLabel.displayName = "StyledLabel";
StyledLabel.displayName = 'StyledLabel';
export var LocationPuckContainer = styled('div', function () {
  return {
    position: 'relative',
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center'
  };
});
LocationPuckContainer.displayName = "LocationPuckContainer";
LocationPuckContainer.displayName = 'LocationPuckContainer';
export var consumerLocationShadow = {
  boxShadow: "0px 2px 4px 0px rgba(67, 76, 123, 0.2)"
};
export var earnerLocationShadow = {
  boxShadow: "0px 3px 5px 0px rgba(67, 76, 123, 0.4)"
};
export var StyledConsumerLocationPuckCore = styled('div', function (_ref18) {
  var $theme = _ref18.$theme;
  return _objectSpread({
    height: "".concat(12, "px"),
    width: "".concat(12, "px"),
    background: $theme.colors.contentAccent,
    borderRadius: "".concat(100, "px "),
    position: 'absolute'
  }, consumerLocationShadow);
});
StyledConsumerLocationPuckCore.displayName = "StyledConsumerLocationPuckCore";
export var StyledLocationPuckApproximation = styled('div', function (_ref19) {
  var $theme = _ref19.$theme,
      $color = _ref19.$color,
      $radius = _ref19.$radius;
  return {
    background: $color,
    opacity: 0.12,
    height: "".concat($radius / 2, "px"),
    width: "".concat($radius / 2, "px"),
    borderRadius: "".concat(10000, "px "),
    position: 'absolute',
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all")
  };
});
StyledLocationPuckApproximation.displayName = "StyledLocationPuckApproximation";
StyledLocationPuckApproximation.displayName = 'StyledLocationPuckApproximation';
export var StyledEarnerLocationPuckCore = styled('div', function (_ref20) {
  var $theme = _ref20.$theme,
      $color = _ref20.$color,
      $size = _ref20.$size;
  return _objectSpread(_objectSpread({
    position: 'absolute',
    transform: "scale(".concat(EARNER_LOCATION_PUCK_CORE_SCALES[$size], ")"),
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all")
  }, earnerLocationShadow), {}, {
    borderRadius: '50%',
    height: "".concat(72, "px"),
    width: "".concat(72, "px"),
    background: $theme.colors.backgroundPrimary,
    border: "".concat(6, "px solid ", $color),
    boxSizing: 'border-box'
  });
});
StyledEarnerLocationPuckCore.displayName = "StyledEarnerLocationPuckCore";
StyledEarnerLocationPuckCore.displayName = 'StyledEarnerLocationPuckCore';
export var StyledFloatingRouteMarkerPointerContainer = styled('svg', function (_ref21) {
  var $position = _ref21.$position;
  return _objectSpread({
    position: 'absolute'
  }, FLOATING_ROUTE_MARKER_POINTER_TRANSFORMS[$position]);
});
StyledFloatingRouteMarkerPointerContainer.displayName = "StyledFloatingRouteMarkerPointerContainer";
StyledFloatingRouteMarkerPointerContainer.displayName = 'StyledFloatingRouteMarkerPointerContainer';
export var StyledFloatingRouteMarkerPointer = styled('path', function (_ref22) {
  var $theme = _ref22.$theme,
      $background = _ref22.$background;
  return {
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
    fill: $background
  };
});
StyledFloatingRouteMarkerPointer.displayName = "StyledFloatingRouteMarkerPointer";
StyledFloatingRouteMarkerPointer.displayName = 'StyledFloatingRouteMarkerPointer';