import classNames from "classnames";
import * as React from "react";
import { AbstractPureComponent } from "../../common/abstractPureComponent";
import * as Classes from "../../common/classes";
import { SPINNER_WARN_CLASSES_SIZE } from "../../common/errors";
import { DISPLAYNAME_PREFIX, IIntentProps, IProps } from "../../common/props";
import { clamp } from "../../common/utils";
// see http://stackoverflow.com/a/18473154/3124288 for calculating arc path
const SPINNER_TRACK = "M 50,50 m 0,-44.5 a 44.5,44.5 0 1 1 0,89 a 44.5,44.5 0 1 1 0,-89";
// unitless total length of SVG path, to which stroke-dash* properties are relative.
// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/pathLength
// this value is the result of `.getTotalLength()` and works in all browsers:
const PATH_LENGTH = 280;
const MIN_SIZE = 10;
const STROKE_WIDTH = 4;
const MIN_STROKE_WIDTH = 16;
export interface ISpinnerProps extends IProps, IIntentProps {
/**
* Width and height of the spinner in pixels. The size cannot be less than
* 10px. Constants are available for common sizes: `Spinner.SIZE_SMALL`,
* `Spinner.SIZE_STANDARD`, `Spinner.SIZE_LARGE`.
* @default Spinner.SIZE_STANDARD = 50
*/
size?: number;
/**
* HTML tag for the wrapper element. If rendering a `` inside an
* `