{"ast":null,"code":"\"use client\";\n\nimport React, { useEffect, useState } from 'react';\nimport { generateColor } from '../util';\nimport ColorSteppers from './ColorSteppers';\nconst ColorRgbInput = _ref => {\n let {\n prefixCls,\n value,\n onChange\n } = _ref;\n const colorRgbInputPrefixCls = `${prefixCls}-rgb-input`;\n const [rgbValue, setRgbValue] = useState(generateColor(value || '#000'));\n // Update step value\n useEffect(() => {\n if (value) {\n setRgbValue(value);\n }\n }, [value]);\n const handleRgbChange = (step, type) => {\n const rgb = rgbValue.toRgb();\n rgb[type] = step || 0;\n const genColor = generateColor(rgb);\n if (!value) {\n setRgbValue(genColor);\n }\n onChange === null || onChange === void 0 ? void 0 : onChange(genColor);\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n className: colorRgbInputPrefixCls\n }, /*#__PURE__*/React.createElement(ColorSteppers, {\n max: 255,\n min: 0,\n value: Number(rgbValue.toRgb().r),\n prefixCls: prefixCls,\n className: colorRgbInputPrefixCls,\n onChange: step => handleRgbChange(Number(step), 'r')\n }), /*#__PURE__*/React.createElement(ColorSteppers, {\n max: 255,\n min: 0,\n value: Number(rgbValue.toRgb().g),\n prefixCls: prefixCls,\n className: colorRgbInputPrefixCls,\n onChange: step => handleRgbChange(Number(step), 'g')\n }), /*#__PURE__*/React.createElement(ColorSteppers, {\n max: 255,\n min: 0,\n value: Number(rgbValue.toRgb().b),\n prefixCls: prefixCls,\n className: colorRgbInputPrefixCls,\n onChange: step => handleRgbChange(Number(step), 'b')\n }));\n};\nexport default ColorRgbInput;","map":{"version":3,"names":["React","useEffect","useState","generateColor","ColorSteppers","ColorRgbInput","_ref","prefixCls","value","onChange","colorRgbInputPrefixCls","rgbValue","setRgbValue","handleRgbChange","step","type","rgb","toRgb","genColor","createElement","className","max","min","Number","r","g","b"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/color-picker/components/ColorRgbInput.js"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect, useState } from 'react';\nimport { generateColor } from '../util';\nimport ColorSteppers from './ColorSteppers';\nconst ColorRgbInput = _ref => {\n let {\n prefixCls,\n value,\n onChange\n } = _ref;\n const colorRgbInputPrefixCls = `${prefixCls}-rgb-input`;\n const [rgbValue, setRgbValue] = useState(generateColor(value || '#000'));\n // Update step value\n useEffect(() => {\n if (value) {\n setRgbValue(value);\n }\n }, [value]);\n const handleRgbChange = (step, type) => {\n const rgb = rgbValue.toRgb();\n rgb[type] = step || 0;\n const genColor = generateColor(rgb);\n if (!value) {\n setRgbValue(genColor);\n }\n onChange === null || onChange === void 0 ? void 0 : onChange(genColor);\n };\n return /*#__PURE__*/React.createElement(\"div\", {\n className: colorRgbInputPrefixCls\n }, /*#__PURE__*/React.createElement(ColorSteppers, {\n max: 255,\n min: 0,\n value: Number(rgbValue.toRgb().r),\n prefixCls: prefixCls,\n className: colorRgbInputPrefixCls,\n onChange: step => handleRgbChange(Number(step), 'r')\n }), /*#__PURE__*/React.createElement(ColorSteppers, {\n max: 255,\n min: 0,\n value: Number(rgbValue.toRgb().g),\n prefixCls: prefixCls,\n className: colorRgbInputPrefixCls,\n onChange: step => handleRgbChange(Number(step), 'g')\n }), /*#__PURE__*/React.createElement(ColorSteppers, {\n max: 255,\n min: 0,\n value: Number(rgbValue.toRgb().b),\n prefixCls: prefixCls,\n className: colorRgbInputPrefixCls,\n onChange: step => handleRgbChange(Number(step), 'b')\n }));\n};\nexport default ColorRgbInput;"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,aAAa,QAAQ,SAAS;AACvC,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,MAAMC,aAAa,GAAGC,IAAI,IAAI;EAC5B,IAAI;IACFC,SAAS;IACTC,KAAK;IACLC;EACF,CAAC,GAAGH,IAAI;EACR,MAAMI,sBAAsB,GAAG,GAAGH,SAAS,YAAY;EACvD,MAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAGV,QAA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