{
  "version": 3,
  "sources": ["../../src/angle-picker-control/index.tsx"],
  "sourcesContent": ["/**\n * External dependencies\n */\n\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Flex, FlexBlock } from '../flex';\nimport { Spacer } from '../spacer';\nimport NumberControl from '../number-control';\nimport InputControlPrefixWrapper from '../input-control/input-prefix-wrapper';\nimport InputControlSuffixWrapper from '../input-control/input-suffix-wrapper';\nimport AngleCircle from './angle-circle';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction UnforwardedAnglePickerControl(props, ref) {\n  const {\n    className,\n    label = __('Angle'),\n    onChange,\n    value,\n    ...restProps\n  } = props;\n  const handleOnNumberChange = unprocessedValue => {\n    if (onChange === undefined) {\n      return;\n    }\n    const inputValue = unprocessedValue !== undefined && unprocessedValue !== '' ? parseInt(unprocessedValue, 10) : 0;\n    onChange(inputValue);\n  };\n  const classes = clsx('components-angle-picker-control', className);\n\n  // Override the default behavior and position the degree symbol to the\n  // right of the number, regardless of the language direction.\n  const prefixOrSuffixProp = isRTL() ? {\n    prefix: /*#__PURE__*/_jsx(InputControlPrefixWrapper, {\n      children: \"\\xB0\"\n    })\n  } : {\n    suffix: /*#__PURE__*/_jsx(InputControlSuffixWrapper, {\n      children: \"\\xB0\"\n    })\n  };\n  return /*#__PURE__*/_jsxs(Flex, {\n    ...restProps,\n    ref: ref,\n    className: classes,\n    gap: 2,\n    children: [/*#__PURE__*/_jsx(FlexBlock, {\n      children: /*#__PURE__*/_jsx(NumberControl, {\n        __next40pxDefaultSize: true,\n        label: label,\n        className: \"components-angle-picker-control__input-field\",\n        max: 360,\n        min: 0,\n        onChange: handleOnNumberChange,\n        step: \"1\",\n        value: value,\n        spinControls: \"none\",\n        ...prefixOrSuffixProp\n      })\n    }), /*#__PURE__*/_jsx(Spacer, {\n      marginBottom: \"1\",\n      marginTop: \"auto\",\n      children: /*#__PURE__*/_jsx(AngleCircle, {\n        \"aria-hidden\": \"true\",\n        value: value,\n        onChange: onChange\n      })\n    })]\n  });\n}\n\n/**\n * `AnglePickerControl` is a React component to render a UI that allows users to\n * pick an angle. Users can choose an angle in a visual UI with the mouse by\n * dragging an angle indicator inside a circle or by directly inserting the\n * desired angle in a text field.\n *\n * ```jsx\n * import { useState } from '@wordpress/element';\n * import { AnglePickerControl } from '@wordpress/components';\n *\n * function Example() {\n *   const [ angle, setAngle ] = useState( 0 );\n *   return (\n *     <AnglePickerControl\n *       value={ angle }\n *       onChange={ setAngle }\n *     />\n *   );\n * }\n * ```\n */\nexport const AnglePickerControl = forwardRef(UnforwardedAnglePickerControl);\nAnglePickerControl.displayName = 'AnglePickerControl';\nexport default AnglePickerControl;"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAiB;AAKjB,qBAA2B;AAC3B,kBAA0B;AAK1B,kBAAgC;AAChC,oBAAuB;AACvB,4BAA0B;AAC1B,kCAAsC;AACtC,kCAAsC;AACtC,0BAAwB;AACxB,yBAA2C;AAC3C,SAAS,8BAA8B,OAAO,KAAK;AACjD,QAAM;AAAA,IACJ;AAAA,IACA,YAAQ,gBAAG,OAAO;AAAA,IAClB;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,uBAAuB,sBAAoB;AAC/C,QAAI,aAAa,QAAW;AAC1B;AAAA,IACF;AACA,UAAM,aAAa,qBAAqB,UAAa,qBAAqB,KAAK,SAAS,kBAAkB,EAAE,IAAI;AAChH,aAAS,UAAU;AAAA,EACrB;AACA,QAAM,cAAU,YAAAA,SAAK,mCAAmC,SAAS;AAIjE,QAAM,yBAAqB,mBAAM,IAAI;AAAA,IACnC,QAAqB,uCAAAC,KAAK,4BAAAC,SAA2B;AAAA,MACnD,UAAU;AAAA,IACZ,CAAC;AAAA,E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