PromoCursed/node_modules/.cache/babel-loader/e3e5404efbcce2880cc68537c2cd314e4778f5b9862315a57dadd514e28502b5.json
2024-08-20 23:25:37 +04:00

1 line
11 KiB
JSON

{"ast":null,"code":"\"use client\";\n\nimport * as React from 'react';\nimport VerticalAlignTopOutlined from \"@ant-design/icons/es/icons/VerticalAlignTopOutlined\";\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport omit from \"rc-util/es/omit\";\nimport getScroll from '../_util/getScroll';\nimport { cloneElement } from '../_util/reactNode';\nimport scrollTo from '../_util/scrollTo';\nimport throttleByAnimationFrame from '../_util/throttleByAnimationFrame';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport useStyle from './style';\nconst BackTop = props => {\n const {\n prefixCls: customizePrefixCls,\n className,\n rootClassName,\n visibilityHeight = 400,\n target,\n onClick,\n duration = 450\n } = props;\n const [visible, setVisible] = React.useState(visibilityHeight === 0);\n const ref = React.useRef(null);\n const getDefaultTarget = () => {\n var _a;\n return ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.ownerDocument) || window;\n };\n const handleScroll = throttleByAnimationFrame(e => {\n const scrollTop = getScroll(e.target);\n setVisible(scrollTop >= visibilityHeight);\n });\n if (process.env.NODE_ENV !== 'production') {\n const warning = devUseWarning('BackTop');\n warning.deprecated(false, 'BackTop', 'FloatButton.BackTop');\n }\n React.useEffect(() => {\n const getTarget = target || getDefaultTarget;\n const container = getTarget();\n handleScroll({\n target: container\n });\n container === null || container === void 0 ? void 0 : container.addEventListener('scroll', handleScroll);\n return () => {\n handleScroll.cancel();\n container === null || container === void 0 ? void 0 : container.removeEventListener('scroll', handleScroll);\n };\n }, [target]);\n const scrollToTop = e => {\n scrollTo(0, {\n getContainer: target || getDefaultTarget,\n duration\n });\n onClick === null || onClick === void 0 ? void 0 : onClick(e);\n };\n const {\n getPrefixCls,\n direction\n } = React.useContext(ConfigContext);\n const prefixCls = getPrefixCls('back-top', customizePrefixCls);\n const rootPrefixCls = getPrefixCls();\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n const classString = classNames(hashId, cssVarCls, prefixCls, {\n [`${prefixCls}-rtl`]: direction === 'rtl'\n }, className, rootClassName);\n // fix https://fb.me/react-unknown-prop\n const divProps = omit(props, ['prefixCls', 'className', 'rootClassName', 'children', 'visibilityHeight', 'target']);\n const defaultElement = /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-content`\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-icon`\n }, /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, null)));\n return wrapCSSVar( /*#__PURE__*/React.createElement(\"div\", Object.assign({}, divProps, {\n className: classString,\n onClick: scrollToTop,\n ref: ref\n }), /*#__PURE__*/React.createElement(CSSMotion, {\n visible: visible,\n motionName: `${rootPrefixCls}-fade`\n }, _ref => {\n let {\n className: motionClassName\n } = _ref;\n return cloneElement(props.children || defaultElement, _ref2 => {\n let {\n className: cloneCls\n } = _ref2;\n return {\n className: classNames(motionClassName, cloneCls)\n };\n });\n })));\n};\nif (process.env.NODE_ENV !== 'production') {\n BackTop.displayName = 'BackTop';\n}\nexport default BackTop;","map":{"version":3,"names":["React","VerticalAlignTopOutlined","classNames","CSSMotion","omit","getScroll","cloneElement","scrollTo","throttleByAnimationFrame","devUseWarning","ConfigContext","useStyle","BackTop","props","prefixCls","customizePrefixCls","className","rootClassName","visibilityHeight","target","onClick","duration","visible","setVisible","useState","ref","useRef","getDefaultTarget","_a","current","ownerDocument","window","handleScroll","e","scrollTop","process","env","NODE_ENV","warning","deprecated","useEffect","getTarget","container","addEventListener","cancel","removeEventListener","scrollToTop","getContainer","getPrefixCls","direction","useContext","rootPrefixCls","wrapCSSVar","hashId","cssVarCls","classString","divProps","defaultElement","createElement","Object","assign","motionName","_ref","motionClassName","children","_ref2","cloneCls","displayName"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/back-top/index.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport VerticalAlignTopOutlined from \"@ant-design/icons/es/icons/VerticalAlignTopOutlined\";\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport omit from \"rc-util/es/omit\";\nimport getScroll from '../_util/getScroll';\nimport { cloneElement } from '../_util/reactNode';\nimport scrollTo from '../_util/scrollTo';\nimport throttleByAnimationFrame from '../_util/throttleByAnimationFrame';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport useStyle from './style';\nconst BackTop = props => {\n const {\n prefixCls: customizePrefixCls,\n className,\n rootClassName,\n visibilityHeight = 400,\n target,\n onClick,\n duration = 450\n } = props;\n const [visible, setVisible] = React.useState(visibilityHeight === 0);\n const ref = React.useRef(null);\n const getDefaultTarget = () => {\n var _a;\n return ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.ownerDocument) || window;\n };\n const handleScroll = throttleByAnimationFrame(e => {\n const scrollTop = getScroll(e.target);\n setVisible(scrollTop >= visibilityHeight);\n });\n if (process.env.NODE_ENV !== 'production') {\n const warning = devUseWarning('BackTop');\n warning.deprecated(false, 'BackTop', 'FloatButton.BackTop');\n }\n React.useEffect(() => {\n const getTarget = target || getDefaultTarget;\n const container = getTarget();\n handleScroll({\n target: container\n });\n container === null || container === void 0 ? void 0 : container.addEventListener('scroll', handleScroll);\n return () => {\n handleScroll.cancel();\n container === null || container === void 0 ? void 0 : container.removeEventListener('scroll', handleScroll);\n };\n }, [target]);\n const scrollToTop = e => {\n scrollTo(0, {\n getContainer: target || getDefaultTarget,\n duration\n });\n onClick === null || onClick === void 0 ? void 0 : onClick(e);\n };\n const {\n getPrefixCls,\n direction\n } = React.useContext(ConfigContext);\n const prefixCls = getPrefixCls('back-top', customizePrefixCls);\n const rootPrefixCls = getPrefixCls();\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n const classString = classNames(hashId, cssVarCls, prefixCls, {\n [`${prefixCls}-rtl`]: direction === 'rtl'\n }, className, rootClassName);\n // fix https://fb.me/react-unknown-prop\n const divProps = omit(props, ['prefixCls', 'className', 'rootClassName', 'children', 'visibilityHeight', 'target']);\n const defaultElement = /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-content`\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-icon`\n }, /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, null)));\n return wrapCSSVar( /*#__PURE__*/React.createElement(\"div\", Object.assign({}, divProps, {\n className: classString,\n onClick: scrollToTop,\n ref: ref\n }), /*#__PURE__*/React.createElement(CSSMotion, {\n visible: visible,\n motionName: `${rootPrefixCls}-fade`\n }, _ref => {\n let {\n className: motionClassName\n } = _ref;\n return cloneElement(props.children || defaultElement, _ref2 => {\n let {\n className: cloneCls\n } = _ref2;\n return {\n className: classNames(motionClassName, cloneCls)\n };\n });\n })));\n};\nif (process.env.NODE_ENV !== 'production') {\n BackTop.displayName = 'BackTop';\n}\nexport default BackTop;"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,wBAAwB,MAAM,qDAAqD;AAC1F,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,WAAW;AACjC,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,SAASC,YAAY,QAAQ,oBAAoB;AACjD,OAAOC,QAAQ,MAAM,mBAAmB;AACxC,OAAOC,wBAAwB,MAAM,mCAAmC;AACxE,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,QAAQ,MAAM,SAAS;AAC9B,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,SAAS,EAAEC,kBAAkB;IAC7BC,SAAS;IACTC,aAAa;IACbC,gBAAgB,GAAG,GAAG;IACtBC,MAAM;IACNC,OAAO;IACPC,QAAQ,GAAG;EACb,CAAC,GAAGR,KAAK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