{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { useRef } from 'react';\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport { offset } from \"../../util\";\nimport Panel from \"./Panel\";\nvar Content = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var prefixCls = props.prefixCls,\n    title = props.title,\n    style = props.style,\n    className = props.className,\n    visible = props.visible,\n    forceRender = props.forceRender,\n    destroyOnClose = props.destroyOnClose,\n    motionName = props.motionName,\n    ariaId = props.ariaId,\n    onVisibleChanged = props.onVisibleChanged,\n    mousePosition = props.mousePosition;\n  var dialogRef = useRef();\n\n  // ============================= Style ==============================\n  var _React$useState = React.useState(),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    transformOrigin = _React$useState2[0],\n    setTransformOrigin = _React$useState2[1];\n  var contentStyle = {};\n  if (transformOrigin) {\n    contentStyle.transformOrigin = transformOrigin;\n  }\n  function onPrepare() {\n    var elementOffset = offset(dialogRef.current);\n    setTransformOrigin(mousePosition ? \"\".concat(mousePosition.x - elementOffset.left, \"px \").concat(mousePosition.y - elementOffset.top, \"px\") : '');\n  }\n\n  // ============================= Render =============================\n  return /*#__PURE__*/React.createElement(CSSMotion, {\n    visible: visible,\n    onVisibleChanged: onVisibleChanged,\n    onAppearPrepare: onPrepare,\n    onEnterPrepare: onPrepare,\n    forceRender: forceRender,\n    motionName: motionName,\n    removeOnLeave: destroyOnClose,\n    ref: dialogRef\n  }, function (_ref, motionRef) {\n    var motionClassName = _ref.className,\n      motionStyle = _ref.style;\n    return /*#__PURE__*/React.createElement(Panel, _extends({}, props, {\n      ref: ref,\n      title: title,\n      ariaId: ariaId,\n      prefixCls: prefixCls,\n      holderRef: motionRef,\n      style: _objectSpread(_objectSpread(_objectSpread({}, motionStyle), style), contentStyle),\n      className: classNames(className, motionClassName)\n    }));\n  });\n});\nContent.displayName = 'Content';\nexport default Content;","map":{"version":3,"names":["_extends","_objectSpread","_slicedToArray","React","useRef","classNames","CSSMotion","offset","Panel","Content","forwardRef","props","ref","prefixCls","title","style","className","visible","forceRender","destroyOnClose","motionName","ariaId","onVisibleChanged","mousePosition","dialogRef","_React$useState","useState","_React$useState2","transformOrigin","setTransformOrigin","contentStyle","onPrepare","elementOffset","current","concat","x","left","y","top","createElement","onAppearPrepare","onEnterPrepare","removeOnLeave","_ref","motionRef","motionClassName","motionStyle","holderRef","displayName"],"sources":["D:/Project/UC_Trains_Voice/react-demo/node_modules/rc-dialog/es/Dialog/Content/index.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { useRef } from 'react';\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport { offset } from \"../../util\";\nimport Panel from \"./Panel\";\nvar Content = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var prefixCls = props.prefixCls,\n    title = props.title,\n    style = props.style,\n    className = props.className,\n    visible = props.visible,\n    forceRender = props.forceRender,\n    destroyOnClose = props.destroyOnClose,\n    motionName = props.motionName,\n    ariaId = props.ariaId,\n    onVisibleChanged = props.onVisibleChanged,\n    mousePosition = props.mousePosition;\n  var dialogRef = useRef();\n\n  // ============================= Style ==============================\n  var _React$useState = React.useState(),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    transformOrigin = _React$useState2[0],\n    setTransformOrigin = _React$useState2[1];\n  var contentStyle = {};\n  if (transformOrigin) {\n    contentStyle.transformOrigin = transformOrigin;\n  }\n  function onPrepare() {\n    var elementOffset = offset(dialogRef.current);\n    setTransformOrigin(mousePosition ? \"\".concat(mousePosition.x - elementOffset.left, \"px \").concat(mousePosition.y - elementOffset.top, \"px\") : '');\n  }\n\n  // ============================= Render =============================\n  return /*#__PURE__*/React.createElement(CSSMotion, {\n    visible: visible,\n    onVisibleChanged: onVisibleChanged,\n    onAppearPrepare: onPrepare,\n    onEnterPrepare: onPrepare,\n    forceRender: forceRender,\n    motionName: motionName,\n    removeOnLeave: destroyOnClose,\n    ref: dialogRef\n  }, function (_ref, motionRef) {\n    var motionClassName = _ref.className,\n      motionStyle = _ref.style;\n    return /*#__PURE__*/React.createElement(Panel, _extends({}, props, {\n      ref: ref,\n      title: title,\n      ariaId: ariaId,\n      prefixCls: prefixCls,\n      holderRef: motionRef,\n      style: _objectSpread(_objectSpread(_objectSpread({}, motionStyle), style), contentStyle),\n      className: classNames(className, motionClassName)\n    }));\n  });\n});\nContent.displayName = 'Content';\nexport default Content;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,MAAM,QAAQ,OAAO;AAC9B,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,WAAW;AACjC,SAASC,MAAM,QAAQ,YAAY;AACnC,OAAOC,KAAK,MAAM,SAAS;AAC3B,IAAIC,OAAO,GAAG,aAAaN,KAAK,CAACO,UAAU,CAAC,UAAUC,KAAK,EAAEC,GAAG,EAAE;EAChE,IAAIC,SAAS,GAAGF,KAAK,CAACE,SAAS;IAC7BC,KAAK,GAAGH,KAAK,CAACG,KAAK;IACnBC,KAAK,GAAGJ,KAAK,CAACI,KAAK;IACnBC,SAAS,GAAGL,KAAK,CAACK,SAAS;IAC3BC,OAAO,GAAGN,KAAK,CAACM,OAAO;IACvBC,WAAW,GAAGP,KAAK,CAACO,WAAW;IAC/BC,cAAc,GAAGR,KAAK,CAACQ,cAAc;IACrCC,UAAU,GAAGT,KAAK,CAACS,UAAU;IAC7BC,MAAM,GAAGV,KAAK,CAACU,MAAM;IACrBC,gBAA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