{"ast":null,"code":"\"use client\";\n\nimport classNames from 'classnames';\nimport { Circle as RCCircle } from 'rc-progress';\nimport * as React from 'react';\nimport Tooltip from '../tooltip';\nimport { getPercentage, getSize, getStrokeColor } from './utils';\nconst CIRCLE_MIN_STROKE_WIDTH = 3;\nconst getMinPercent = width => CIRCLE_MIN_STROKE_WIDTH / width * 100;\nconst Circle = props => {\n  const {\n    prefixCls,\n    trailColor = null,\n    strokeLinecap = 'round',\n    gapPosition,\n    gapDegree,\n    width: originWidth = 120,\n    type,\n    children,\n    success,\n    size = originWidth\n  } = props;\n  const [width, height] = getSize(size, 'circle');\n  let {\n    strokeWidth\n  } = props;\n  if (strokeWidth === undefined) {\n    strokeWidth = Math.max(getMinPercent(width), 6);\n  }\n  const circleStyle = {\n    width,\n    height,\n    fontSize: width * 0.15 + 6\n  };\n  const realGapDegree = React.useMemo(() => {\n    // Support gapDeg = 0 when type = 'dashboard'\n    if (gapDegree || gapDegree === 0) {\n      return gapDegree;\n    }\n    if (type === 'dashboard') {\n      return 75;\n    }\n    return undefined;\n  }, [gapDegree, type]);\n  const gapPos = gapPosition || type === 'dashboard' && 'bottom' || undefined;\n  // using className to style stroke color\n  const isGradient = Object.prototype.toString.call(props.strokeColor) === '[object Object]';\n  const strokeColor = getStrokeColor({\n    success,\n    strokeColor: props.strokeColor\n  });\n  const wrapperClassName = classNames(`${prefixCls}-inner`, {\n    [`${prefixCls}-circle-gradient`]: isGradient\n  });\n  const circleContent = /*#__PURE__*/React.createElement(RCCircle, {\n    percent: getPercentage(props),\n    strokeWidth: strokeWidth,\n    trailWidth: strokeWidth,\n    strokeColor: strokeColor,\n    strokeLinecap: strokeLinecap,\n    trailColor: trailColor,\n    prefixCls: prefixCls,\n    gapDegree: realGapDegree,\n    gapPosition: gapPos\n  });\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: wrapperClassName,\n    style: circleStyle\n  }, width <= 20 ? /*#__PURE__*/React.createElement(Tooltip, {\n    title: children\n  }, /*#__PURE__*/React.createElement(\"span\", null, circleContent)) : /*#__PURE__*/React.createElement(React.Fragment, null, circleContent, children));\n};\nexport default Circle;","map":{"version":3,"names":["classNames","Circle","RCCircle","React","Tooltip","getPercentage","getSize","getStrokeColor","CIRCLE_MIN_STROKE_WIDTH","getMinPercent","width","props","prefixCls","trailColor","strokeLinecap","gapPosition","gapDegree","originWidth","type","children","success","size","height","strokeWidth","undefined","Math","max","circleStyle","fontSize","realGapDegree","useMemo","gapPos","isGradient","Object","prototype","toString","call","strokeColor","wrapperClassName","circleContent","createElement","percent","trailWidth","className","style","title","Fragment"],"sources":["/var/www/gavt/node_modules/antd/es/progress/Circle.js"],"sourcesContent":["\"use client\";\n\nimport classNames from 'classnames';\nimport { Circle as RCCircle } from 'rc-progress';\nimport * as React from 'react';\nimport Tooltip from '../tooltip';\nimport { getPercentage, getSize, getStrokeColor } from './utils';\nconst CIRCLE_MIN_STROKE_WIDTH = 3;\nconst getMinPercent = width => CIRCLE_MIN_STROKE_WIDTH / width * 100;\nconst Circle = props => {\n  const {\n    prefixCls,\n    trailColor = null,\n    strokeLinecap = 'round',\n    gapPosition,\n    gapDegree,\n    width: originWidth = 120,\n    type,\n    children,\n    success,\n    size = originWidth\n  } = props;\n  const [width, height] = getSize(size, 'circle');\n  let {\n    strokeWidth\n  } = props;\n  if (strokeWidth === undefined) {\n    strokeWidth = Math.max(getMinPercent(width), 6);\n  }\n  const circleStyle = {\n    width,\n    height,\n    fontSize: width * 0.15 + 6\n  };\n  const realGapDegree = React.useMemo(() => {\n    // Support gapDeg = 0 when type = 'dashboard'\n    if (gapDegree || gapDegree === 0) {\n      return gapDegree;\n    }\n    if (type === 'dashboard') {\n      return 75;\n    }\n    return undefined;\n  }, [gapDegree, type]);\n  const gapPos = gapPosition || type === 'dashboard' && 'bottom' || undefined;\n  // using className to style stroke color\n  const isGradient = Object.prototype.toString.call(props.strokeColor) === '[object Object]';\n  const strokeColor = getStrokeColor({\n    success,\n    strokeColor: props.strokeColor\n  });\n  const wrapperClassName = classNames(`${prefixCls}-inner`, {\n    [`${prefixCls}-circle-gradient`]: isGradient\n  });\n  const circleContent = /*#__PURE__*/React.createElement(RCCircle, {\n    percent: getPercentage(props),\n    strokeWidth: strokeWidth,\n    trailWidth: strokeWidth,\n    strokeColor: strokeColor,\n    strokeLinecap: strokeLinecap,\n    trailColor: trailColor,\n    prefixCls: prefixCls,\n    gapDegree: realGapDegree,\n    gapPosition: gapPos\n  });\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: wrapperClassName,\n    style: circleStyle\n  }, width <= 20 ? /*#__PURE__*/React.createElement(Tooltip, {\n    title: children\n  }, /*#__PURE__*/React.createElement(\"span\", null, circleContent)) : /*#__PURE__*/React.createElement(React.Fragment, null, circleContent, children));\n};\nexport default Circle;"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,UAAU,MAAM,YAAY;AACnC,SAASC,MAAM,IAAIC,QAAQ,QAAQ,aAAa;AAChD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,aAAa,EAAEC,OAAO,EAAEC,cAAc,QAAQ,SAAS;AAChE,MAAMC,uBAAuB,GAAG,CAAC;AACjC,MAAMC,aAAa,GAAGC,KAAK,IAAIF,uBAAuB,GAAGE,KAAK,GAAG,GAAG;AACpE,MAAMT,MAAM,GAAGU,KAAK,IAAI;EACtB,MAAM;IACJC,SAAS;IACTC,UAAU,GAAG,IAAI;IACjBC,aAAa,GAAG,OAAO;IACvBC,WAAW;IACXC,SAAS;IACTN,KAAK,EAAEO,WAAW,GAAG,GAAG;IACxBC,IAAI;IACJC,QAAQ;IACRC,OAAO;IACPC,IAAI,GAAGJ;EACT,CAAC,GAAGN,KAAK;EACT,MAAM,CAACD,KAAK,EAAEY,MAAM,CAAC,GAAGhB,OAAO,CAACe,IAAI,EAAE,QAAQ,CAAC;EAC/C,IAAI;IACFE;EACF,CAAC,GAAGZ,KAAK;EACT,IAAIY,WAAW,KAAKC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