{"version":3,"sources":["webpack:///./node_modules/rc-util/es/Children/toArray.js","webpack:///./node_modules/rc-trigger/es/utils/alignUtil.js","webpack:///./node_modules/rc-trigger/es/context.js","webpack:///./node_modules/rc-trigger/es/index.js","webpack:///./node_modules/rc-util/es/Dom/canUseDom.js","webpack:///./node_modules/rc-util/es/Dom/isVisible.js","webpack:///./node_modules/rc-util/es/Dom/dynamicCSS.js","webpack:///./node_modules/rc-util/es/Dom/contains.js","webpack:///./node_modules/rc-util/es/Dom/findDOMNode.js","webpack:///./node_modules/rc-util/es/Dom/styleChecker.js","webpack:///./node_modules/rc-util/es/Dom/addEventListener.js","webpack:///./node_modules/rc-trigger/es/utils/legacyUtil.js"],"names":["toArray","children","option","arguments","length","undefined","ret","Children","forEach","child","keepEmpty","Array","isArray","concat","props","push","isPointsEq","a1","a2","isAlignPoint","noop","returnEmptyString","returnDocument","element","ownerDocument","window","document","ALL_HANDLERS","PortalComponent","Trigger","Portal","_React$Component","_super","_this","_popupVisible","this","call","e","mouseEnterDelay","fireEvents","delaySetPopupVisible","setPoint","mouseLeaveDelay","clearDelayTimer","_this$popupRef$curren","relatedTarget","setTimeout","contains","popupRef","current","getElement","isFocusToShow","focusTime","Date","now","focusDelay","preClickTime","preTouchTime","isBlurToHide","blurDelay","preventDefault","setPopupVisible","isContextMenuToShow","close","event","preTime","Math","min","abs","isClickToShow","isClickToHide","nextVisible","state","popupVisible","_this$context","hasPopupMouseDown","clearTimeout","mouseDownTimeout","context","onPopupMouseDown","apply","mask","maskClosable","target","root","getRootDomNode","popupNode","getPopupDomNode","isContextMenuOnly","getTriggerDOMNode","triggerRef","domNode","findDOMNode","err","align","className","_this$props","popupPlacement","builtinPlacements","prefixCls","alignPoint","getPopupClassNameFromAlign","points","placements","Object","keys","i","placement","getAlignPopupClassName","join","_this$props2","destroyPopupOnHide","popupClassName","onPopupAlign","popupMotion","popupAnimation","popupTransitionName","popupStyle","maskAnimation","maskTransitionName","maskMotion","zIndex","popup","stretch","mobile","forceRender","onPopupClick","_this$state","point","getPopupAlign","mouseProps","isMouseEnterToShow","onMouseEnter","onPopupMouseEnter","isMouseLeaveToHide","onMouseLeave","onPopupMouseLeave","onMouseDown","onTouchStart","Popup","visible","onAlign","animation","getClassNameFromAlign","style","transitionName","ref","motion","onClick","popupContainer","raf","cancel","attachId","mountNode","_this$props3","getPopupContainer","getDocument","body","appendChild","attachParent","portalContainer","createElement","position","top","left","width","setState","pageX","pageY","prevPopupVisible","afterPopupVisibleChange","defaultPopupVisible","h","key","value","componentDidUpdate","currentDocument","clickOutsideHandler","addEventListener","onDocumentClick","touchOutsideHandler","contextMenuOutsideHandler1","onContextMenuClose","contextMenuOutsideHandler2","clearOutsideHandler","_this$popupRef$curren2","popupAlign","placementStr","baseAlign","getAlignFromPlacement","onPopupVisibleChange","delayS","_this2","delay","delayTimer","remove","childPros","_this$props4","action","showAction","indexOf","_this$props5","_this$props6","hideAction","_this$props7","_this$props8","_this$props9","_this$props10","_this$popupRef$curren3","forceAlign","type","childCallback","callback","_this$props11","autoDestroy","only","newChildProps","onContextMenu","createTwoChains","onMouseMove","onFocus","onBlur","childrenClassName","cloneProps","portal","trigger","getContainer","didUpdate","handlePortalUpdate","getComponent","Provider","triggerContextValue","_ref","prevState","newState","canUseDom","Element","offsetParent","getBBox","_getBBox","height","getBoundingClientRect","_element$getBoundingC","_width","_height","APPEND_ORDER","APPEND_PRIORITY","MARK_KEY","containerCache","Map","getMark","mark","startsWith","attachTo","querySelector","findStyles","container","from","get","filter","node","tagName","injectCSS","css","csp","prepend","_option$priority","priority","mergedOrder","getOrder","isPrependQueue","styleNode","setAttribute","nonce","innerHTML","firstChild","existStyle","styles","includes","getAttribute","nodePriority","Number","insertBefore","nextSibling","findExistNode","find","removeCSS","existNode","removeChild","updateCSS","originOption","cachedRealContainer","placeholderStyle","parentNode","set","syncRealContainer","_option$csp","_option$csp2","_option$csp3","newNode","n","isDOM","HTMLElement","SVGElement","_ReactDOM$findDOMNode","nativeElement","getDOM","Component","isStyleNameSupport","styleName","documentElement","styleNameList","some","name","isStyleValueSupport","ele","origin","isStyleSupport","styleValue","addEventListenerWrap","eventType","cb","unstable_batchedUpdates","removeEventListener","getMotion","motionName"],"mappings":"0FAAA,gEAEe,SAASA,EAAQC,GAC9B,IAAIC,EAASC,UAAUC,OAAS,QAAsBC,IAAjBF,UAAU,GAAmBA,UAAU,GAAK,CAAC,EAC9EG,EAAM,GAaV,OAZA,IAAMC,SAASC,QAAQP,GAAU,SAAUQ,SAC1BJ,IAAVI,GAAiC,OAAVA,GAAoBP,EAAOQ,aAGnDC,MAAMC,QAAQH,GAChBH,EAAMA,EAAIO,OAAOb,EAAQS,IAChB,qBAAWA,IAAUA,EAAMK,MACpCR,EAAMA,EAAIO,OAAOb,EAAQS,EAAMK,MAAMb,SAAUC,IAE/CI,EAAIS,KAAKN,GAEb,IACOH,CACT,C,qNCjBA,SAASU,EAAWC,EAAIC,EAAIC,GAC1B,OAAIA,EACKF,EAAG,KAAOC,EAAG,GAEfD,EAAG,KAAOC,EAAG,IAAMD,EAAG,KAAOC,EAAG,EACzC,C,cCJe,EADmB,gBAAoB,MCmBtD,SAASE,IAAQ,CACjB,SAASC,IACP,MAAO,EACT,CACA,SAASC,EAAeC,GACtB,OAAIA,EACKA,EAAQC,cAEVC,OAAOC,QAChB,CACA,IAAIC,EAAe,CAAC,UAAW,cAAe,eAAgB,eAAgB,eAAgB,UAAW,SAAU,iBA8pBpG,IAzpBiBC,EAC1BC,EAwpBS,KAzpBiBD,EAypBDE,EAAA,EAxpBzBD,EAAuB,SAAUE,GACnC,YAAUF,EAASE,GACnB,IAAIC,EAAS,YAAaH,GAG1B,SAASA,EAAQf,GACf,IAAImB,EA6RAC,EAeJ,OA3SA,YAAgBC,KAAMN,GACtBI,EAAQD,EAAOI,KAAKD,KAAMrB,GAC1B,YAAgB,YAAuBmB,GAAQ,WAAyB,eACxE,YAAgB,YAAuBA,GAAQ,aAA2B,eAC1E,YAAgB,YAAuBA,GAAQ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AElE,IAAIkN,EAAW,IAAS8G,wBAA0B,SAAa7R,GAC7D,IAAS6R,wBAAwBD,EAAI5R,EACvC,EAAI4R,EAIJ,OAHe,OAAX9O,QAA8B,IAAXA,GAAqBA,EAAO+F,kBACjD/F,EAAO+F,iBAAiB8I,EAAW5G,EAAUlN,GAExC,CACLiM,OAAQ,WACS,OAAXhH,QAA8B,IAAXA,GAAqBA,EAAOgP,qBACjDhP,EAAOgP,oBAAoBH,EAAW5G,EAAUlN,EAEpD,EAEJ,C,oCChBO,SAASkU,EAAU5F,GACxB,IAAIrI,EAAYqI,EAAKrI,UACnBgD,EAASqF,EAAKrF,OACdL,EAAY0F,EAAK1F,UACjBG,EAAiBuF,EAAKvF,eACxB,OAAIE,IAGAL,EACK,CACLuL,WAAY,GAAGxT,OAAOsF,EAAW,KAAKtF,OAAOiI,IAG7CG,EACK,CACLoL,WAAYpL,GAGT,KACT,CAnBA,iC","file":"js/6-b3a8d0cd2a75927c2eba.chunk.js","sourcesContent":["import React from 'react';\nimport { isFragment } from 'react-is';\nexport default function toArray(children) {\n var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var ret = [];\n React.Children.forEach(children, function (child) {\n if ((child === undefined || child === null) && !option.keepEmpty) {\n return;\n }\n if (Array.isArray(child)) {\n ret = ret.concat(toArray(child));\n } else if (isFragment(child) && child.props) {\n ret = ret.concat(toArray(child.props.children, option));\n } else {\n ret.push(child);\n }\n });\n return ret;\n}","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nfunction isPointsEq(a1, a2, isAlignPoint) {\n if (isAlignPoint) {\n return a1[0] === a2[0];\n }\n return a1[0] === a2[0] && a1[1] === a2[1];\n}\nexport function getAlignFromPlacement(builtinPlacements, placementStr, align) {\n var baseAlign = builtinPlacements[placementStr] || {};\n return _objectSpread(_objectSpread({}, baseAlign), align);\n}\nexport function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {\n var points = align.points;\n var placements = Object.keys(builtinPlacements);\n for (var i = 0; i < placements.length; i += 1) {\n var placement = placements[i];\n if (isPointsEq(builtinPlacements[placement].points, points, isAlignPoint)) {\n return \"\".concat(prefixCls, \"-placement-\").concat(placement);\n }\n }\n return '';\n}","import * as React from 'react';\nvar TriggerContext = /*#__PURE__*/React.createContext(null);\nexport default TriggerContext;","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport raf from \"rc-util/es/raf\";\nimport contains from \"rc-util/es/Dom/contains\";\nimport findDOMNode from \"rc-util/es/Dom/findDOMNode\";\nimport { composeRef, supportRef } from \"rc-util/es/ref\";\nimport addEventListener from \"rc-util/es/Dom/addEventListener\";\nimport Portal from \"rc-util/es/Portal\";\nimport classNames from 'classnames';\nimport { getAlignFromPlacement, getAlignPopupClassName } from \"./utils/alignUtil\";\nimport Popup from \"./Popup\";\nimport TriggerContext from \"./context\";\nfunction noop() {}\nfunction returnEmptyString() {\n return '';\n}\nfunction returnDocument(element) {\n if (element) {\n return element.ownerDocument;\n }\n return window.document;\n}\nvar ALL_HANDLERS = ['onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur', 'onContextMenu'];\n\n/**\n * Internal usage. Do not use in your code since this will be removed.\n */\nexport function generateTrigger(PortalComponent) {\n var Trigger = /*#__PURE__*/function (_React$Component) {\n _inherits(Trigger, _React$Component);\n var _super = _createSuper(Trigger);\n\n // ensure `getContainer` will be called only once\n function Trigger(props) {\n var _this;\n _classCallCheck(this, Trigger);\n _this = _super.call(this, props);\n _defineProperty(_assertThisInitialized(_this), \"popupRef\", /*#__PURE__*/React.createRef());\n _defineProperty(_assertThisInitialized(_this), \"triggerRef\", /*#__PURE__*/React.createRef());\n _defineProperty(_assertThisInitialized(_this), \"portalContainer\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"attachId\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"clickOutsideHandler\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"touchOutsideHandler\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"contextMenuOutsideHandler1\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"contextMenuOutsideHandler2\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"mouseDownTimeout\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"focusTime\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"preClickTime\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"preTouchTime\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"delayTimer\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"hasPopupMouseDown\", void 0);\n _defineProperty(_assertThisInitialized(_this), \"onMouseEnter\", function (e) {\n var mouseEnterDelay = _this.props.mouseEnterDelay;\n _this.fireEvents('onMouseEnter', e);\n _this.delaySetPopupVisible(true, mouseEnterDelay, mouseEnterDelay ? null : e);\n });\n _defineProperty(_assertThisInitialized(_this), \"onMouseMove\", function (e) {\n _this.fireEvents('onMouseMove', e);\n _this.setPoint(e);\n });\n _defineProperty(_assertThisInitialized(_this), \"onMouseLeave\", function (e) {\n _this.fireEvents('onMouseLeave', e);\n _this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay);\n });\n _defineProperty(_assertThisInitialized(_this), \"onPopupMouseEnter\", function () {\n _this.clearDelayTimer();\n });\n _defineProperty(_assertThisInitialized(_this), \"onPopupMouseLeave\", function (e) {\n var _this$popupRef$curren;\n\n // https://github.com/react-component/trigger/pull/13\n // react bug?\n if (e.relatedTarget && !e.relatedTarget.setTimeout && contains((_this$popupRef$curren = _this.popupRef.current) === null || _this$popupRef$curren === void 0 ? void 0 : _this$popupRef$curren.getElement(), e.relatedTarget)) {\n return;\n }\n _this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay);\n });\n _defineProperty(_assertThisInitialized(_this), \"onFocus\", function (e) {\n _this.fireEvents('onFocus', e); // incase focusin and focusout\n\n _this.clearDelayTimer();\n if (_this.isFocusToShow()) {\n _this.focusTime = Date.now();\n _this.delaySetPopupVisible(true, _this.props.focusDelay);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"onMouseDown\", function (e) {\n _this.fireEvents('onMouseDown', e);\n _this.preClickTime = Date.now();\n });\n _defineProperty(_assertThisInitialized(_this), \"onTouchStart\", function (e) {\n _this.fireEvents('onTouchStart', e);\n _this.preTouchTime = Date.now();\n });\n _defineProperty(_assertThisInitialized(_this), \"onBlur\", function (e) {\n _this.fireEvents('onBlur', e);\n _this.clearDelayTimer();\n if (_this.isBlurToHide()) {\n _this.delaySetPopupVisible(false, _this.props.blurDelay);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"onContextMenu\", function (e) {\n e.preventDefault();\n _this.fireEvents('onContextMenu', e);\n _this.setPopupVisible(true, e);\n });\n _defineProperty(_assertThisInitialized(_this), \"onContextMenuClose\", function () {\n if (_this.isContextMenuToShow()) {\n _this.close();\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"onClick\", function (event) {\n _this.fireEvents('onClick', event); // focus will trigger click\n\n if (_this.focusTime) {\n var preTime;\n if (_this.preClickTime && _this.preTouchTime) {\n preTime = Math.min(_this.preClickTime, _this.preTouchTime);\n } else if (_this.preClickTime) {\n preTime = _this.preClickTime;\n } else if (_this.preTouchTime) {\n preTime = _this.preTouchTime;\n }\n if (Math.abs(preTime - _this.focusTime) < 20) {\n return;\n }\n _this.focusTime = 0;\n }\n _this.preClickTime = 0;\n _this.preTouchTime = 0; // Only prevent default when all the action is click.\n // https://github.com/ant-design/ant-design/issues/17043\n // https://github.com/ant-design/ant-design/issues/17291\n\n if (_this.isClickToShow() && (_this.isClickToHide() || _this.isBlurToHide()) && event && event.preventDefault) {\n event.preventDefault();\n }\n var nextVisible = !_this.state.popupVisible;\n if (_this.isClickToHide() && !nextVisible || nextVisible && _this.isClickToShow()) {\n _this.setPopupVisible(!_this.state.popupVisible, event);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"onPopupMouseDown\", function () {\n _this.hasPopupMouseDown = true;\n clearTimeout(_this.mouseDownTimeout);\n _this.mouseDownTimeout = window.setTimeout(function () {\n _this.hasPopupMouseDown = false;\n }, 0);\n if (_this.context) {\n var _this$context;\n (_this$context = _this.context).onPopupMouseDown.apply(_this$context, arguments);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"onDocumentClick\", function (event) {\n if (_this.props.mask && !_this.props.maskClosable) {\n return;\n }\n var target = event.target;\n var root = _this.getRootDomNode();\n var popupNode = _this.getPopupDomNode();\n if (\n // mousedown on the target should also close popup when action is contextMenu.\n // https://github.com/ant-design/ant-design/issues/29853\n (!contains(root, target) || _this.isContextMenuOnly()) && !contains(popupNode, target) && !_this.hasPopupMouseDown) {\n _this.close();\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"getRootDomNode\", function () {\n var getTriggerDOMNode = _this.props.getTriggerDOMNode;\n if (getTriggerDOMNode) {\n return getTriggerDOMNode(_this.triggerRef.current);\n }\n try {\n var domNode = findDOMNode(_this.triggerRef.current);\n if (domNode) {\n return domNode;\n }\n } catch (err) {// Do nothing\n }\n return ReactDOM.findDOMNode(_assertThisInitialized(_this));\n });\n _defineProperty(_assertThisInitialized(_this), \"getPopupClassNameFromAlign\", function (align) {\n var className = [];\n var _this$props = _this.props,\n popupPlacement = _this$props.popupPlacement,\n builtinPlacements = _this$props.builtinPlacements,\n prefixCls = _this$props.prefixCls,\n alignPoint = _this$props.alignPoint,\n getPopupClassNameFromAlign = _this$props.getPopupClassNameFromAlign;\n if (popupPlacement && builtinPlacements) {\n className.push(getAlignPopupClassName(builtinPlacements, prefixCls, align, alignPoint));\n }\n if (getPopupClassNameFromAlign) {\n className.push(getPopupClassNameFromAlign(align));\n }\n return className.join(' ');\n });\n _defineProperty(_assertThisInitialized(_this), \"getComponent\", function () {\n var _this$props2 = _this.props,\n prefixCls = _this$props2.prefixCls,\n destroyPopupOnHide = _this$props2.destroyPopupOnHide,\n popupClassName = _this$props2.popupClassName,\n onPopupAlign = _this$props2.onPopupAlign,\n popupMotion = _this$props2.popupMotion,\n popupAnimation = _this$props2.popupAnimation,\n popupTransitionName = _this$props2.popupTransitionName,\n popupStyle = _this$props2.popupStyle,\n mask = _this$props2.mask,\n maskAnimation = _this$props2.maskAnimation,\n maskTransitionName = _this$props2.maskTransitionName,\n maskMotion = _this$props2.maskMotion,\n zIndex = _this$props2.zIndex,\n popup = _this$props2.popup,\n stretch = _this$props2.stretch,\n alignPoint = _this$props2.alignPoint,\n mobile = _this$props2.mobile,\n forceRender = _this$props2.forceRender,\n onPopupClick = _this$props2.onPopupClick;\n var _this$state = _this.state,\n popupVisible = _this$state.popupVisible,\n point = _this$state.point;\n var align = _this.getPopupAlign();\n var mouseProps = {};\n if (_this.isMouseEnterToShow()) {\n mouseProps.onMouseEnter = _this.onPopupMouseEnter;\n }\n if (_this.isMouseLeaveToHide()) {\n mouseProps.onMouseLeave = _this.onPopupMouseLeave;\n }\n mouseProps.onMouseDown = _this.onPopupMouseDown;\n mouseProps.onTouchStart = _this.onPopupMouseDown;\n return /*#__PURE__*/React.createElement(Popup, _extends({\n prefixCls: prefixCls,\n destroyPopupOnHide: destroyPopupOnHide,\n visible: popupVisible,\n point: alignPoint && point,\n className: popupClassName,\n align: align,\n onAlign: onPopupAlign,\n animation: popupAnimation,\n getClassNameFromAlign: _this.getPopupClassNameFromAlign\n }, mouseProps, {\n stretch: stretch,\n getRootDomNode: _this.getRootDomNode,\n style: popupStyle,\n mask: mask,\n zIndex: zIndex,\n transitionName: popupTransitionName,\n maskAnimation: maskAnimation,\n maskTransitionName: maskTransitionName,\n maskMotion: maskMotion,\n ref: _this.popupRef,\n motion: popupMotion,\n mobile: mobile,\n forceRender: forceRender,\n onClick: onPopupClick\n }), typeof popup === 'function' ? popup() : popup);\n });\n _defineProperty(_assertThisInitialized(_this), \"attachParent\", function (popupContainer) {\n raf.cancel(_this.attachId);\n var _this$props3 = _this.props,\n getPopupContainer = _this$props3.getPopupContainer,\n getDocument = _this$props3.getDocument;\n var domNode = _this.getRootDomNode();\n var mountNode;\n if (!getPopupContainer) {\n mountNode = getDocument(_this.getRootDomNode()).body;\n } else if (domNode || getPopupContainer.length === 0) {\n // Compatible for legacy getPopupContainer with domNode argument.\n // If no need `domNode` argument, will call directly.\n // https://codesandbox.io/s/eloquent-mclean-ss93m?file=/src/App.js\n mountNode = getPopupContainer(domNode);\n }\n if (mountNode) {\n mountNode.appendChild(popupContainer);\n } else {\n // Retry after frame render in case parent not ready\n _this.attachId = raf(function () {\n _this.attachParent(popupContainer);\n });\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"getContainer\", function () {\n if (!_this.portalContainer) {\n // In React.StrictMode component will call render multiple time in first mount.\n // When you want to refactor with FC, useRef will also init multiple time and\n // point to different useRef instance which will create multiple element\n // (This multiple render will not trigger effect so you can not clean up this\n // in effect). But this is safe with class component since it always point to same class instance.\n var getDocument = _this.props.getDocument;\n var popupContainer = getDocument(_this.getRootDomNode()).createElement('div'); // Make sure default popup container will never cause scrollbar appearing\n // https://github.com/react-component/trigger/issues/41\n\n popupContainer.style.position = 'absolute';\n popupContainer.style.top = '0';\n popupContainer.style.left = '0';\n popupContainer.style.width = '100%';\n _this.portalContainer = popupContainer;\n }\n _this.attachParent(_this.portalContainer);\n return _this.portalContainer;\n });\n _defineProperty(_assertThisInitialized(_this), \"setPoint\", function (point) {\n var alignPoint = _this.props.alignPoint;\n if (!alignPoint || !point) return;\n _this.setState({\n point: {\n pageX: point.pageX,\n pageY: point.pageY\n }\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"handlePortalUpdate\", function () {\n if (_this.state.prevPopupVisible !== _this.state.popupVisible) {\n _this.props.afterPopupVisibleChange(_this.state.popupVisible);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"triggerContextValue\", {\n onPopupMouseDown: _this.onPopupMouseDown\n });\n var _popupVisible;\n if ('popupVisible' in props) {\n _popupVisible = !!props.popupVisible;\n } else {\n _popupVisible = !!props.defaultPopupVisible;\n }\n _this.state = {\n prevPopupVisible: _popupVisible,\n popupVisible: _popupVisible\n };\n ALL_HANDLERS.forEach(function (h) {\n _this[\"fire\".concat(h)] = function (e) {\n _this.fireEvents(h, e);\n };\n });\n return _this;\n }\n _createClass(Trigger, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.componentDidUpdate();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n var props = this.props;\n var state = this.state; // We must listen to `mousedown` or `touchstart`, edge case:\n // https://github.com/ant-design/ant-design/issues/5804\n // https://github.com/react-component/calendar/issues/250\n // https://github.com/react-component/trigger/issues/50\n\n if (state.popupVisible) {\n var currentDocument;\n if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow())) {\n currentDocument = props.getDocument(this.getRootDomNode());\n this.clickOutsideHandler = addEventListener(currentDocument, 'mousedown', this.onDocumentClick);\n } // always hide on mobile\n\n if (!this.touchOutsideHandler) {\n currentDocument = currentDocument || props.getDocument(this.getRootDomNode());\n this.touchOutsideHandler = addEventListener(currentDocument, 'touchstart', this.onDocumentClick);\n } // close popup when trigger type contains 'onContextMenu' and document is scrolling.\n\n if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) {\n currentDocument = currentDocument || props.getDocument(this.getRootDomNode());\n this.contextMenuOutsideHandler1 = addEventListener(currentDocument, 'scroll', this.onContextMenuClose);\n } // close popup when trigger type contains 'onContextMenu' and window is blur.\n\n if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) {\n this.contextMenuOutsideHandler2 = addEventListener(window, 'blur', this.onContextMenuClose);\n }\n return;\n }\n this.clearOutsideHandler();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.clearDelayTimer();\n this.clearOutsideHandler();\n clearTimeout(this.mouseDownTimeout);\n raf.cancel(this.attachId);\n }\n }, {\n key: \"getPopupDomNode\",\n value: function getPopupDomNode() {\n var _this$popupRef$curren2;\n\n // for test\n return ((_this$popupRef$curren2 = this.popupRef.current) === null || _this$popupRef$curren2 === void 0 ? void 0 : _this$popupRef$curren2.getElement()) || null;\n }\n }, {\n key: \"getPopupAlign\",\n value: function getPopupAlign() {\n var props = this.props;\n var popupPlacement = props.popupPlacement,\n popupAlign = props.popupAlign,\n builtinPlacements = props.builtinPlacements;\n if (popupPlacement && builtinPlacements) {\n return getAlignFromPlacement(builtinPlacements, popupPlacement, popupAlign);\n }\n return popupAlign;\n }\n }, {\n key: \"setPopupVisible\",\n value:\n /**\n * @param popupVisible Show or not the popup element\n * @param event SyntheticEvent, used for `pointAlign`\n */\n function setPopupVisible(popupVisible, event) {\n var alignPoint = this.props.alignPoint;\n var prevPopupVisible = this.state.popupVisible;\n this.clearDelayTimer();\n if (prevPopupVisible !== popupVisible) {\n if (!('popupVisible' in this.props)) {\n this.setState({\n popupVisible: popupVisible,\n prevPopupVisible: prevPopupVisible\n });\n }\n this.props.onPopupVisibleChange(popupVisible);\n } // Always record the point position since mouseEnterDelay will delay the show\n\n if (alignPoint && event && popupVisible) {\n this.setPoint(event);\n }\n }\n }, {\n key: \"delaySetPopupVisible\",\n value: function delaySetPopupVisible(visible, delayS, event) {\n var _this2 = this;\n var delay = delayS * 1000;\n this.clearDelayTimer();\n if (delay) {\n var point = event ? {\n pageX: event.pageX,\n pageY: event.pageY\n } : null;\n this.delayTimer = window.setTimeout(function () {\n _this2.setPopupVisible(visible, point);\n _this2.clearDelayTimer();\n }, delay);\n } else {\n this.setPopupVisible(visible, event);\n }\n }\n }, {\n key: \"clearDelayTimer\",\n value: function clearDelayTimer() {\n if (this.delayTimer) {\n clearTimeout(this.delayTimer);\n this.delayTimer = null;\n }\n }\n }, {\n key: \"clearOutsideHandler\",\n value: function clearOutsideHandler() {\n if (this.clickOutsideHandler) {\n this.clickOutsideHandler.remove();\n this.clickOutsideHandler = null;\n }\n if (this.contextMenuOutsideHandler1) {\n this.contextMenuOutsideHandler1.remove();\n this.contextMenuOutsideHandler1 = null;\n }\n if (this.contextMenuOutsideHandler2) {\n this.contextMenuOutsideHandler2.remove();\n this.contextMenuOutsideHandler2 = null;\n }\n if (this.touchOutsideHandler) {\n this.touchOutsideHandler.remove();\n this.touchOutsideHandler = null;\n }\n }\n }, {\n key: \"createTwoChains\",\n value: function createTwoChains(event) {\n var childPros = this.props.children.props;\n var props = this.props;\n if (childPros[event] && props[event]) {\n return this[\"fire\".concat(event)];\n }\n return childPros[event] || props[event];\n }\n }, {\n key: \"isClickToShow\",\n value: function isClickToShow() {\n var _this$props4 = this.props,\n action = _this$props4.action,\n showAction = _this$props4.showAction;\n return action.indexOf('click') !== -1 || showAction.indexOf('click') !== -1;\n }\n }, {\n key: \"isContextMenuOnly\",\n value: function isContextMenuOnly() {\n var action = this.props.action;\n return action === 'contextMenu' || action.length === 1 && action[0] === 'contextMenu';\n }\n }, {\n key: \"isContextMenuToShow\",\n value: function isContextMenuToShow() {\n var _this$props5 = this.props,\n action = _this$props5.action,\n showAction = _this$props5.showAction;\n return action.indexOf('contextMenu') !== -1 || showAction.indexOf('contextMenu') !== -1;\n }\n }, {\n key: \"isClickToHide\",\n value: function isClickToHide() {\n var _this$props6 = this.props,\n action = _this$props6.action,\n hideAction = _this$props6.hideAction;\n return action.indexOf('click') !== -1 || hideAction.indexOf('click') !== -1;\n }\n }, {\n key: \"isMouseEnterToShow\",\n value: function isMouseEnterToShow() {\n var _this$props7 = this.props,\n action = _this$props7.action,\n showAction = _this$props7.showAction;\n return action.indexOf('hover') !== -1 || showAction.indexOf('mouseEnter') !== -1;\n }\n }, {\n key: \"isMouseLeaveToHide\",\n value: function isMouseLeaveToHide() {\n var _this$props8 = this.props,\n action = _this$props8.action,\n hideAction = _this$props8.hideAction;\n return action.indexOf('hover') !== -1 || hideAction.indexOf('mouseLeave') !== -1;\n }\n }, {\n key: \"isFocusToShow\",\n value: function isFocusToShow() {\n var _this$props9 = this.props,\n action = _this$props9.action,\n showAction = _this$props9.showAction;\n return action.indexOf('focus') !== -1 || showAction.indexOf('focus') !== -1;\n }\n }, {\n key: \"isBlurToHide\",\n value: function isBlurToHide() {\n var _this$props10 = this.props,\n action = _this$props10.action,\n hideAction = _this$props10.hideAction;\n return action.indexOf('focus') !== -1 || hideAction.indexOf('blur') !== -1;\n }\n }, {\n key: \"forcePopupAlign\",\n value: function forcePopupAlign() {\n if (this.state.popupVisible) {\n var _this$popupRef$curren3;\n (_this$popupRef$curren3 = this.popupRef.current) === null || _this$popupRef$curren3 === void 0 ? void 0 : _this$popupRef$curren3.forceAlign();\n }\n }\n }, {\n key: \"fireEvents\",\n value: function fireEvents(type, e) {\n var childCallback = this.props.children.props[type];\n if (childCallback) {\n childCallback(e);\n }\n var callback = this.props[type];\n if (callback) {\n callback(e);\n }\n }\n }, {\n key: \"close\",\n value: function close() {\n this.setPopupVisible(false);\n }\n }, {\n key: \"render\",\n value: function render() {\n var popupVisible = this.state.popupVisible;\n var _this$props11 = this.props,\n children = _this$props11.children,\n forceRender = _this$props11.forceRender,\n alignPoint = _this$props11.alignPoint,\n className = _this$props11.className,\n autoDestroy = _this$props11.autoDestroy;\n var child = React.Children.only(children);\n var newChildProps = {\n key: 'trigger'\n }; // ============================== Visible Handlers ==============================\n // >>> ContextMenu\n\n if (this.isContextMenuToShow()) {\n newChildProps.onContextMenu = this.onContextMenu;\n } else {\n newChildProps.onContextMenu = this.createTwoChains('onContextMenu');\n } // >>> Click\n\n if (this.isClickToHide() || this.isClickToShow()) {\n newChildProps.onClick = this.onClick;\n newChildProps.onMouseDown = this.onMouseDown;\n newChildProps.onTouchStart = this.onTouchStart;\n } else {\n newChildProps.onClick = this.createTwoChains('onClick');\n newChildProps.onMouseDown = this.createTwoChains('onMouseDown');\n newChildProps.onTouchStart = this.createTwoChains('onTouchStart');\n } // >>> Hover(enter)\n\n if (this.isMouseEnterToShow()) {\n newChildProps.onMouseEnter = this.onMouseEnter; // Point align\n\n if (alignPoint) {\n newChildProps.onMouseMove = this.onMouseMove;\n }\n } else {\n newChildProps.onMouseEnter = this.createTwoChains('onMouseEnter');\n } // >>> Hover(leave)\n\n if (this.isMouseLeaveToHide()) {\n newChildProps.onMouseLeave = this.onMouseLeave;\n } else {\n newChildProps.onMouseLeave = this.createTwoChains('onMouseLeave');\n } // >>> Focus\n\n if (this.isFocusToShow() || this.isBlurToHide()) {\n newChildProps.onFocus = this.onFocus;\n newChildProps.onBlur = this.onBlur;\n } else {\n newChildProps.onFocus = this.createTwoChains('onFocus');\n newChildProps.onBlur = this.createTwoChains('onBlur');\n } // =================================== Render ===================================\n\n var childrenClassName = classNames(child && child.props && child.props.className, className);\n if (childrenClassName) {\n newChildProps.className = childrenClassName;\n }\n var cloneProps = _objectSpread({}, newChildProps);\n if (supportRef(child)) {\n cloneProps.ref = composeRef(this.triggerRef, child.ref);\n }\n var trigger = /*#__PURE__*/React.cloneElement(child, cloneProps);\n var portal; // prevent unmounting after it's rendered\n\n if (popupVisible || this.popupRef.current || forceRender) {\n portal = /*#__PURE__*/React.createElement(PortalComponent, {\n key: \"portal\",\n getContainer: this.getContainer,\n didUpdate: this.handlePortalUpdate\n }, this.getComponent());\n }\n if (!popupVisible && autoDestroy) {\n portal = null;\n }\n return /*#__PURE__*/React.createElement(TriggerContext.Provider, {\n value: this.triggerContextValue\n }, trigger, portal);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(_ref, prevState) {\n var popupVisible = _ref.popupVisible;\n var newState = {};\n if (popupVisible !== undefined && prevState.popupVisible !== popupVisible) {\n newState.popupVisible = popupVisible;\n newState.prevPopupVisible = prevState.popupVisible;\n }\n return newState;\n }\n }]);\n return Trigger;\n }(React.Component);\n _defineProperty(Trigger, \"contextType\", TriggerContext);\n _defineProperty(Trigger, \"defaultProps\", {\n prefixCls: 'rc-trigger-popup',\n getPopupClassNameFromAlign: returnEmptyString,\n getDocument: returnDocument,\n onPopupVisibleChange: noop,\n afterPopupVisibleChange: noop,\n onPopupAlign: noop,\n popupClassName: '',\n mouseEnterDelay: 0,\n mouseLeaveDelay: 0.1,\n focusDelay: 0,\n blurDelay: 0.15,\n popupStyle: {},\n destroyPopupOnHide: false,\n popupAlign: {},\n defaultPopupVisible: false,\n mask: false,\n maskClosable: true,\n action: [],\n showAction: [],\n hideAction: [],\n autoDestroy: false\n });\n return Trigger;\n}\nexport default generateTrigger(Portal);","export default function canUseDom() {\n return !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n}","export default (function (element) {\n if (!element) {\n return false;\n }\n if (element instanceof Element) {\n if (element.offsetParent) {\n return true;\n }\n if (element.getBBox) {\n var _getBBox = element.getBBox(),\n width = _getBBox.width,\n height = _getBBox.height;\n if (width || height) {\n return true;\n }\n }\n if (element.getBoundingClientRect) {\n var _element$getBoundingC = element.getBoundingClientRect(),\n _width = _element$getBoundingC.width,\n _height = _element$getBoundingC.height;\n if (_width || _height) {\n return true;\n }\n }\n }\n return false;\n});","import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport canUseDom from \"./canUseDom\";\nimport contains from \"./contains\";\nvar APPEND_ORDER = 'data-rc-order';\nvar APPEND_PRIORITY = 'data-rc-priority';\nvar MARK_KEY = \"rc-util-key\";\nvar containerCache = new Map();\nfunction getMark() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n mark = _ref.mark;\n if (mark) {\n return mark.startsWith('data-') ? mark : \"data-\".concat(mark);\n }\n return MARK_KEY;\n}\nfunction getContainer(option) {\n if (option.attachTo) {\n return option.attachTo;\n }\n var head = document.querySelector('head');\n return head || document.body;\n}\nfunction getOrder(prepend) {\n if (prepend === 'queue') {\n return 'prependQueue';\n }\n return prepend ? 'prepend' : 'append';\n}\n\n/**\n * Find style which inject by rc-util\n */\nfunction findStyles(container) {\n return Array.from((containerCache.get(container) || container).children).filter(function (node) {\n return node.tagName === 'STYLE';\n });\n}\nexport function injectCSS(css) {\n var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!canUseDom()) {\n return null;\n }\n var csp = option.csp,\n prepend = option.prepend,\n _option$priority = option.priority,\n priority = _option$priority === void 0 ? 0 : _option$priority;\n var mergedOrder = getOrder(prepend);\n var isPrependQueue = mergedOrder === 'prependQueue';\n var styleNode = document.createElement('style');\n styleNode.setAttribute(APPEND_ORDER, mergedOrder);\n if (isPrependQueue && priority) {\n styleNode.setAttribute(APPEND_PRIORITY, \"\".concat(priority));\n }\n if (csp !== null && csp !== void 0 && csp.nonce) {\n styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;\n }\n styleNode.innerHTML = css;\n var container = getContainer(option);\n var firstChild = container.firstChild;\n if (prepend) {\n // If is queue `prepend`, it will prepend first style and then append rest style\n if (isPrependQueue) {\n var existStyle = (option.styles || findStyles(container)).filter(function (node) {\n // Ignore style which not injected by rc-util with prepend\n if (!['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER))) {\n return false;\n }\n\n // Ignore style which priority less then new style\n var nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0);\n return priority >= nodePriority;\n });\n if (existStyle.length) {\n container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);\n return styleNode;\n }\n }\n\n // Use `insertBefore` as `prepend`\n container.insertBefore(styleNode, firstChild);\n } else {\n container.appendChild(styleNode);\n }\n return styleNode;\n}\nfunction findExistNode(key) {\n var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var container = getContainer(option);\n return (option.styles || findStyles(container)).find(function (node) {\n return node.getAttribute(getMark(option)) === key;\n });\n}\nexport function removeCSS(key) {\n var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var existNode = findExistNode(key, option);\n if (existNode) {\n var container = getContainer(option);\n container.removeChild(existNode);\n }\n}\n\n/**\n * qiankun will inject `appendChild` to insert into other\n */\nfunction syncRealContainer(container, option) {\n var cachedRealContainer = containerCache.get(container);\n\n // Find real container when not cached or cached container removed\n if (!cachedRealContainer || !contains(document, cachedRealContainer)) {\n var placeholderStyle = injectCSS('', option);\n var parentNode = placeholderStyle.parentNode;\n containerCache.set(container, parentNode);\n container.removeChild(placeholderStyle);\n }\n}\n\n/**\n * manually clear container cache to avoid global cache in unit testes\n */\nexport function clearContainerCache() {\n containerCache.clear();\n}\nexport function updateCSS(css, key) {\n var originOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var container = getContainer(originOption);\n var styles = findStyles(container);\n var option = _objectSpread(_objectSpread({}, originOption), {}, {\n styles: styles\n });\n\n // Sync real parent\n syncRealContainer(container, option);\n var existNode = findExistNode(key, option);\n if (existNode) {\n var _option$csp, _option$csp2;\n if ((_option$csp = option.csp) !== null && _option$csp !== void 0 && _option$csp.nonce && existNode.nonce !== ((_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce)) {\n var _option$csp3;\n existNode.nonce = (_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce;\n }\n if (existNode.innerHTML !== css) {\n existNode.innerHTML = css;\n }\n return existNode;\n }\n var newNode = injectCSS(css, option);\n newNode.setAttribute(getMark(option), key);\n return newNode;\n}","export default function contains(root, n) {\n if (!root) {\n return false;\n }\n\n // Use native if support\n if (root.contains) {\n return root.contains(n);\n }\n\n // `document.contains` not support with IE11\n var node = n;\n while (node) {\n if (node === root) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nexport function isDOM(node) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Element\n // Since XULElement is also subclass of Element, we only need HTMLElement and SVGElement\n return node instanceof HTMLElement || node instanceof SVGElement;\n}\n\n/**\n * Retrieves a DOM node via a ref, and does not invoke `findDOMNode`.\n */\nexport function getDOM(node) {\n if (node && _typeof(node) === 'object' && isDOM(node.nativeElement)) {\n return node.nativeElement;\n }\n if (isDOM(node)) {\n return node;\n }\n return null;\n}\n\n/**\n * Return if a node is a DOM node. Else will return by `findDOMNode`\n */\nexport default function findDOMNode(node) {\n var domNode = getDOM(node);\n if (domNode) {\n return domNode;\n }\n if (node instanceof React.Component) {\n var _ReactDOM$findDOMNode;\n return (_ReactDOM$findDOMNode = ReactDOM.findDOMNode) === null || _ReactDOM$findDOMNode === void 0 ? void 0 : _ReactDOM$findDOMNode.call(ReactDOM, node);\n }\n return null;\n}","import canUseDom from \"./canUseDom\";\nvar isStyleNameSupport = function isStyleNameSupport(styleName) {\n if (canUseDom() && window.document.documentElement) {\n var styleNameList = Array.isArray(styleName) ? styleName : [styleName];\n var documentElement = window.document.documentElement;\n return styleNameList.some(function (name) {\n return name in documentElement.style;\n });\n }\n return false;\n};\nvar isStyleValueSupport = function isStyleValueSupport(styleName, value) {\n if (!isStyleNameSupport(styleName)) {\n return false;\n }\n var ele = document.createElement('div');\n var origin = ele.style[styleName];\n ele.style[styleName] = value;\n return ele.style[styleName] !== origin;\n};\nexport function isStyleSupport(styleName, styleValue) {\n if (!Array.isArray(styleName) && styleValue !== undefined) {\n return isStyleValueSupport(styleName, styleValue);\n }\n return isStyleNameSupport(styleName);\n}","import ReactDOM from 'react-dom';\nexport default function addEventListenerWrap(target, eventType, cb, option) {\n /* eslint camelcase: 2 */\n var callback = ReactDOM.unstable_batchedUpdates ? function run(e) {\n ReactDOM.unstable_batchedUpdates(cb, e);\n } : cb;\n if (target !== null && target !== void 0 && target.addEventListener) {\n target.addEventListener(eventType, callback, option);\n }\n return {\n remove: function remove() {\n if (target !== null && target !== void 0 && target.removeEventListener) {\n target.removeEventListener(eventType, callback, option);\n }\n }\n };\n}","export function getMotion(_ref) {\n var prefixCls = _ref.prefixCls,\n motion = _ref.motion,\n animation = _ref.animation,\n transitionName = _ref.transitionName;\n if (motion) {\n return motion;\n }\n if (animation) {\n return {\n motionName: \"\".concat(prefixCls, \"-\").concat(animation)\n };\n }\n if (transitionName) {\n return {\n motionName: transitionName\n };\n }\n return null;\n}"],"sourceRoot":""}