1 line
68 KiB
JSON
1 line
68 KiB
JSON
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"children\", \"action\", \"showAction\", \"hideAction\", \"popupVisible\", \"defaultPopupVisible\", \"onPopupVisibleChange\", \"afterPopupVisibleChange\", \"mouseEnterDelay\", \"mouseLeaveDelay\", \"focusDelay\", \"blurDelay\", \"mask\", \"maskClosable\", \"getPopupContainer\", \"forceRender\", \"autoDestroy\", \"destroyPopupOnHide\", \"popup\", \"popupClassName\", \"popupStyle\", \"popupPlacement\", \"builtinPlacements\", \"popupAlign\", \"zIndex\", \"stretch\", \"getPopupClassNameFromAlign\", \"fresh\", \"alignPoint\", \"onPopupClick\", \"onPopupAlign\", \"arrow\", \"popupMotion\", \"maskMotion\", \"popupTransitionName\", \"popupAnimation\", \"maskTransitionName\", \"maskAnimation\", \"className\", \"getTriggerDOMNode\"];\nimport Portal from '@rc-component/portal';\nimport classNames from 'classnames';\nimport ResizeObserver from 'rc-resize-observer';\nimport { isDOM } from \"rc-util/es/Dom/findDOMNode\";\nimport { getShadowRoot } from \"rc-util/es/Dom/shadow\";\nimport useEvent from \"rc-util/es/hooks/useEvent\";\nimport useId from \"rc-util/es/hooks/useId\";\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport isMobile from \"rc-util/es/isMobile\";\nimport * as React from 'react';\nimport Popup from \"./Popup\";\nimport TriggerWrapper from \"./TriggerWrapper\";\nimport TriggerContext from \"./context\";\nimport useAction from \"./hooks/useAction\";\nimport useAlign from \"./hooks/useAlign\";\nimport useWatch from \"./hooks/useWatch\";\nimport useWinClick from \"./hooks/useWinClick\";\nimport { getAlignPopupClassName, getMotion } from \"./util\";\n\n// Removed Props List\n// Seems this can be auto\n// getDocument?: (element?: HTMLElement) => Document;\n\n// New version will not wrap popup with `rc-trigger-popup-content` when multiple children\n\nexport function generateTrigger() {\n var PortalComponent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Portal;\n var Trigger = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-trigger-popup' : _props$prefixCls,\n children = props.children,\n _props$action = props.action,\n action = _props$action === void 0 ? 'hover' : _props$action,\n showAction = props.showAction,\n hideAction = props.hideAction,\n popupVisible = props.popupVisible,\n defaultPopupVisible = props.defaultPopupVisible,\n onPopupVisibleChange = props.onPopupVisibleChange,\n afterPopupVisibleChange = props.afterPopupVisibleChange,\n mouseEnterDelay = props.mouseEnterDelay,\n _props$mouseLeaveDela = props.mouseLeaveDelay,\n mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,\n focusDelay = props.focusDelay,\n blurDelay = props.blurDelay,\n mask = props.mask,\n _props$maskClosable = props.maskClosable,\n maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,\n getPopupContainer = props.getPopupContainer,\n forceRender = props.forceRender,\n autoDestroy = props.autoDestroy,\n destroyPopupOnHide = props.destroyPopupOnHide,\n popup = props.popup,\n popupClassName = props.popupClassName,\n popupStyle = props.popupStyle,\n popupPlacement = props.popupPlacement,\n _props$builtinPlaceme = props.builtinPlacements,\n builtinPlacements = _props$builtinPlaceme === void 0 ? {} : _props$builtinPlaceme,\n popupAlign = props.popupAlign,\n zIndex = props.zIndex,\n stretch = props.stretch,\n getPopupClassNameFromAlign = props.getPopupClassNameFromAlign,\n fresh = props.fresh,\n alignPoint = props.alignPoint,\n onPopupClick = props.onPopupClick,\n onPopupAlign = props.onPopupAlign,\n arrow = props.arrow,\n popupMotion = props.popupMotion,\n maskMotion = props.maskMotion,\n popupTransitionName = props.popupTransitionName,\n popupAnimation = props.popupAnimation,\n maskTransitionName = props.maskTransitionName,\n maskAnimation = props.maskAnimation,\n className = props.className,\n getTriggerDOMNode = props.getTriggerDOMNode,\n restProps = _objectWithoutProperties(props, _excluded);\n var mergedAutoDestroy = autoDestroy || destroyPopupOnHide || false;\n\n // =========================== Mobile ===========================\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n mobile = _React$useState2[0],\n setMobile = _React$useState2[1];\n useLayoutEffect(function () {\n setMobile(isMobile());\n }, []);\n\n // ========================== Context ===========================\n var subPopupElements = React.useRef({});\n var parentContext = React.useContext(TriggerContext);\n var context = React.useMemo(function () {\n return {\n registerSubPopup: function registerSubPopup(id, subPopupEle) {\n subPopupElements.current[id] = subPopupEle;\n parentContext === null || parentContext === void 0 || parentContext.registerSubPopup(id, subPopupEle);\n }\n };\n }, [parentContext]);\n\n // =========================== Popup ============================\n var id = useId();\n var _React$useState3 = React.useState(null),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n popupEle = _React$useState4[0],\n setPopupEle = _React$useState4[1];\n\n // Used for forwardRef popup. Not use internal\n var externalPopupRef = React.useRef(null);\n var setPopupRef = useEvent(function (node) {\n externalPopupRef.current = node;\n if (isDOM(node) && popupEle !== node) {\n setPopupEle(node);\n }\n parentContext === null || parentContext === void 0 || parentContext.registerSubPopup(id, node);\n });\n\n // =========================== Target ===========================\n // Use state to control here since `useRef` update not trigger render\n var _React$useState5 = React.useState(null),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n targetEle = _React$useState6[0],\n setTargetEle = _React$useState6[1];\n\n // Used for forwardRef target. Not use internal\n var externalForwardRef = React.useRef(null);\n var setTargetRef = useEvent(function (node) {\n if (isDOM(node) && targetEle !== node) {\n setTargetEle(node);\n externalForwardRef.current = node;\n }\n });\n\n // ========================== Children ==========================\n var child = React.Children.only(children);\n var originChildProps = (child === null || child === void 0 ? void 0 : child.props) || {};\n var cloneProps = {};\n var inPopupOrChild = useEvent(function (ele) {\n var _getShadowRoot, _getShadowRoot2;\n var childDOM = targetEle;\n return (childDOM === null || childDOM === void 0 ? void 0 : childDOM.contains(ele)) || ((_getShadowRoot = getShadowRoot(childDOM)) === null || _getShadowRoot === void 0 ? void 0 : _getShadowRoot.host) === ele || ele === childDOM || (popupEle === null || popupEle === void 0 ? void 0 : popupEle.contains(ele)) || ((_getShadowRoot2 = getShadowRoot(popupEle)) === null || _getShadowRoot2 === void 0 ? void 0 : _getShadowRoot2.host) === ele || ele === popupEle || Object.values(subPopupElements.current).some(function (subPopupEle) {\n return (subPopupEle === null || subPopupEle === void 0 ? void 0 : subPopupEle.contains(ele)) || ele === subPopupEle;\n });\n });\n\n // =========================== Motion ===========================\n var mergePopupMotion = getMotion(prefixCls, popupMotion, popupAnimation, popupTransitionName);\n var mergeMaskMotion = getMotion(prefixCls, maskMotion, maskAnimation, maskTransitionName);\n\n // ============================ Open ============================\n var _React$useState7 = React.useState(defaultPopupVisible || false),\n _React$useState8 = _slicedToArray(_React$useState7, 2),\n internalOpen = _React$useState8[0],\n setInternalOpen = _React$useState8[1];\n\n // Render still use props as first priority\n var mergedOpen = popupVisible !== null && popupVisible !== void 0 ? popupVisible : internalOpen;\n\n // We use effect sync here in case `popupVisible` back to `undefined`\n var setMergedOpen = useEvent(function (nextOpen) {\n if (popupVisible === undefined) {\n setInternalOpen(nextOpen);\n }\n });\n useLayoutEffect(function () {\n setInternalOpen(popupVisible || false);\n }, [popupVisible]);\n var openRef = React.useRef(mergedOpen);\n openRef.current = mergedOpen;\n var lastTriggerRef = React.useRef([]);\n lastTriggerRef.current = [];\n var internalTriggerOpen = useEvent(function (nextOpen) {\n var _lastTriggerRef$curre;\n setMergedOpen(nextOpen);\n\n // Enter or Pointer will both trigger open state change\n // We only need take one to avoid duplicated change event trigger\n // Use `lastTriggerRef` to record last open type\n if (((_lastTriggerRef$curre = lastTriggerRef.current[lastTriggerRef.current.length - 1]) !== null && _lastTriggerRef$curre !== void 0 ? _lastTriggerRef$curre : mergedOpen) !== nextOpen) {\n lastTriggerRef.current.push(nextOpen);\n onPopupVisibleChange === null || onPopupVisibleChange === void 0 || onPopupVisibleChange(nextOpen);\n }\n });\n\n // Trigger for delay\n var delayRef = React.useRef();\n var clearDelay = function clearDelay() {\n clearTimeout(delayRef.current);\n };\n var triggerOpen = function triggerOpen(nextOpen) {\n var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n clearDelay();\n if (delay === 0) {\n internalTriggerOpen(nextOpen);\n } else {\n delayRef.current = setTimeout(function () {\n internalTriggerOpen(nextOpen);\n }, delay * 1000);\n }\n };\n React.useEffect(function () {\n return clearDelay;\n }, []);\n\n // ========================== Motion ============================\n var _React$useState9 = React.useState(false),\n _React$useState10 = _slicedToArray(_React$useState9, 2),\n inMotion = _React$useState10[0],\n setInMotion = _React$useState10[1];\n useLayoutEffect(function (firstMount) {\n if (!firstMount || mergedOpen) {\n setInMotion(true);\n }\n }, [mergedOpen]);\n var _React$useState11 = React.useState(null),\n _React$useState12 = _slicedToArray(_React$useState11, 2),\n motionPrepareResolve = _React$useState12[0],\n setMotionPrepareResolve = _React$useState12[1];\n\n // =========================== Align ============================\n var _React$useState13 = React.useState([0, 0]),\n _React$useState14 = _slicedToArray(_React$useState13, 2),\n mousePos = _React$useState14[0],\n setMousePos = _React$useState14[1];\n var setMousePosByEvent = function setMousePosByEvent(event) {\n setMousePos([event.clientX, event.clientY]);\n };\n var _useAlign = useAlign(mergedOpen, popupEle, alignPoint ? mousePos : targetEle, popupPlacement, builtinPlacements, popupAlign, onPopupAlign),\n _useAlign2 = _slicedToArray(_useAlign, 11),\n ready = _useAlign2[0],\n offsetX = _useAlign2[1],\n offsetY = _useAlign2[2],\n offsetR = _useAlign2[3],\n offsetB = _useAlign2[4],\n arrowX = _useAlign2[5],\n arrowY = _useAlign2[6],\n scaleX = _useAlign2[7],\n scaleY = _useAlign2[8],\n alignInfo = _useAlign2[9],\n onAlign = _useAlign2[10];\n var _useAction = useAction(mobile, action, showAction, hideAction),\n _useAction2 = _slicedToArray(_useAction, 2),\n showActions = _useAction2[0],\n hideActions = _useAction2[1];\n var clickToShow = showActions.has('click');\n var clickToHide = hideActions.has('click') || hideActions.has('contextMenu');\n var triggerAlign = useEvent(function () {\n if (!inMotion) {\n onAlign();\n }\n });\n var onScroll = function onScroll() {\n if (openRef.current && alignPoint && clickToHide) {\n triggerOpen(false);\n }\n };\n useWatch(mergedOpen, targetEle, popupEle, triggerAlign, onScroll);\n useLayoutEffect(function () {\n triggerAlign();\n }, [mousePos, popupPlacement]);\n\n // When no builtinPlacements and popupAlign changed\n useLayoutEffect(function () {\n if (mergedOpen && !(builtinPlacements !== null && builtinPlacements !== void 0 && builtinPlacements[popupPlacement])) {\n triggerAlign();\n }\n }, [JSON.stringify(popupAlign)]);\n var alignedClassName = React.useMemo(function () {\n var baseClassName = getAlignPopupClassName(builtinPlacements, prefixCls, alignInfo, alignPoint);\n return classNames(baseClassName, getPopupClassNameFromAlign === null || getPopupClassNameFromAlign === void 0 ? void 0 : getPopupClassNameFromAlign(alignInfo));\n }, [alignInfo, getPopupClassNameFromAlign, builtinPlacements, prefixCls, alignPoint]);\n\n // ============================ Refs ============================\n React.useImperativeHandle(ref, function () {\n return {\n nativeElement: externalForwardRef.current,\n popupElement: externalPopupRef.current,\n forceAlign: triggerAlign\n };\n });\n\n // ========================== Stretch ===========================\n var _React$useState15 = React.useState(0),\n _React$useState16 = _slicedToArray(_React$useState15, 2),\n targetWidth = _React$useState16[0],\n setTargetWidth = _React$useState16[1];\n var _React$useState17 = React.useState(0),\n _React$useState18 = _slicedToArray(_React$useState17, 2),\n targetHeight = _React$useState18[0],\n setTargetHeight = _React$useState18[1];\n var syncTargetSize = function syncTargetSize() {\n if (stretch && targetEle) {\n var rect = targetEle.getBoundingClientRect();\n setTargetWidth(rect.width);\n setTargetHeight(rect.height);\n }\n };\n var onTargetResize = function onTargetResize() {\n syncTargetSize();\n triggerAlign();\n };\n\n // ========================== Motion ============================\n var onVisibleChanged = function onVisibleChanged(visible) {\n setInMotion(false);\n onAlign();\n afterPopupVisibleChange === null || afterPopupVisibleChange === void 0 || afterPopupVisibleChange(visible);\n };\n\n // We will trigger align when motion is in prepare\n var onPrepare = function onPrepare() {\n return new Promise(function (resolve) {\n syncTargetSize();\n setMotionPrepareResolve(function () {\n return resolve;\n });\n });\n };\n useLayoutEffect(function () {\n if (motionPrepareResolve) {\n onAlign();\n motionPrepareResolve();\n setMotionPrepareResolve(null);\n }\n }, [motionPrepareResolve]);\n\n // =========================== Action ===========================\n /**\n * Util wrapper for trigger action\n */\n function wrapperAction(eventName, nextOpen, delay, preEvent) {\n cloneProps[eventName] = function (event) {\n var _originChildProps$eve;\n preEvent === null || preEvent === void 0 || preEvent(event);\n triggerOpen(nextOpen, delay);\n\n // Pass to origin\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n (_originChildProps$eve = originChildProps[eventName]) === null || _originChildProps$eve === void 0 || _originChildProps$eve.call.apply(_originChildProps$eve, [originChildProps, event].concat(args));\n };\n }\n\n // ======================= Action: Click ========================\n if (clickToShow || clickToHide) {\n cloneProps.onClick = function (event) {\n var _originChildProps$onC;\n if (openRef.current && clickToHide) {\n triggerOpen(false);\n } else if (!openRef.current && clickToShow) {\n setMousePosByEvent(event);\n triggerOpen(true);\n }\n\n // Pass to origin\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n (_originChildProps$onC = originChildProps.onClick) === null || _originChildProps$onC === void 0 || _originChildProps$onC.call.apply(_originChildProps$onC, [originChildProps, event].concat(args));\n };\n }\n\n // Click to hide is special action since click popup element should not hide\n useWinClick(mergedOpen, clickToHide, targetEle, popupEle, mask, maskClosable, inPopupOrChild, triggerOpen);\n\n // ======================= Action: Hover ========================\n var hoverToShow = showActions.has('hover');\n var hoverToHide = hideActions.has('hover');\n var onPopupMouseEnter;\n var onPopupMouseLeave;\n if (hoverToShow) {\n // Compatible with old browser which not support pointer event\n wrapperAction('onMouseEnter', true, mouseEnterDelay, function (event) {\n setMousePosByEvent(event);\n });\n wrapperAction('onPointerEnter', true, mouseEnterDelay, function (event) {\n setMousePosByEvent(event);\n });\n onPopupMouseEnter = function onPopupMouseEnter(event) {\n // Only trigger re-open when popup is visible\n if ((mergedOpen || inMotion) && popupEle !== null && popupEle !== void 0 && popupEle.contains(event.target)) {\n triggerOpen(true, mouseEnterDelay);\n }\n };\n\n // Align Point\n if (alignPoint) {\n cloneProps.onMouseMove = function (event) {\n var _originChildProps$onM;\n // setMousePosByEvent(event);\n (_originChildProps$onM = originChildProps.onMouseMove) === null || _originChildProps$onM === void 0 || _originChildProps$onM.call(originChildProps, event);\n };\n }\n }\n if (hoverToHide) {\n wrapperAction('onMouseLeave', false, mouseLeaveDelay);\n wrapperAction('onPointerLeave', false, mouseLeaveDelay);\n onPopupMouseLeave = function onPopupMouseLeave() {\n triggerOpen(false, mouseLeaveDelay);\n };\n }\n\n // ======================= Action: Focus ========================\n if (showActions.has('focus')) {\n wrapperAction('onFocus', true, focusDelay);\n }\n if (hideActions.has('focus')) {\n wrapperAction('onBlur', false, blurDelay);\n }\n\n // ==================== Action: ContextMenu =====================\n if (showActions.has('contextMenu')) {\n cloneProps.onContextMenu = function (event) {\n var _originChildProps$onC2;\n if (openRef.current && hideActions.has('contextMenu')) {\n triggerOpen(false);\n } else {\n setMousePosByEvent(event);\n triggerOpen(true);\n }\n event.preventDefault();\n\n // Pass to origin\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n (_originChildProps$onC2 = originChildProps.onContextMenu) === null || _originChildProps$onC2 === void 0 || _originChildProps$onC2.call.apply(_originChildProps$onC2, [originChildProps, event].concat(args));\n };\n }\n\n // ========================= ClassName ==========================\n if (className) {\n cloneProps.className = classNames(originChildProps.className, className);\n }\n\n // =========================== Render ===========================\n var mergedChildrenProps = _objectSpread(_objectSpread({}, originChildProps), cloneProps);\n\n // Pass props into cloneProps for nest usage\n var passedProps = {};\n var passedEventList = ['onContextMenu', 'onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur'];\n passedEventList.forEach(function (eventName) {\n if (restProps[eventName]) {\n passedProps[eventName] = function () {\n var _mergedChildrenProps$;\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n (_mergedChildrenProps$ = mergedChildrenProps[eventName]) === null || _mergedChildrenProps$ === void 0 || _mergedChildrenProps$.call.apply(_mergedChildrenProps$, [mergedChildrenProps].concat(args));\n restProps[eventName].apply(restProps, args);\n };\n }\n });\n\n // Child Node\n var triggerNode = /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, mergedChildrenProps), passedProps));\n var arrowPos = {\n x: arrowX,\n y: arrowY\n };\n var innerArrow = arrow ? _objectSpread({}, arrow !== true ? arrow : {}) : null;\n\n // Render\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ResizeObserver, {\n disabled: !mergedOpen,\n ref: setTargetRef,\n onResize: onTargetResize\n }, /*#__PURE__*/React.createElement(TriggerWrapper, {\n getTriggerDOMNode: getTriggerDOMNode\n }, triggerNode)), /*#__PURE__*/React.createElement(TriggerContext.Provider, {\n value: context\n }, /*#__PURE__*/React.createElement(Popup, {\n portal: PortalComponent,\n ref: setPopupRef,\n prefixCls: prefixCls,\n popup: popup,\n className: classNames(popupClassName, alignedClassName),\n style: popupStyle,\n target: targetEle,\n onMouseEnter: onPopupMouseEnter,\n onMouseLeave: onPopupMouseLeave\n // https://github.com/ant-design/ant-design/issues/43924\n ,\n\n onPointerEnter: onPopupMouseEnter,\n zIndex: zIndex\n // Open\n ,\n\n open: mergedOpen,\n keepDom: inMotion,\n fresh: fresh\n // Click\n ,\n\n onClick: onPopupClick\n // Mask\n ,\n\n mask: mask\n // Motion\n ,\n\n motion: mergePopupMotion,\n maskMotion: mergeMaskMotion,\n onVisibleChanged: onVisibleChanged,\n onPrepare: onPrepare\n // Portal\n ,\n\n forceRender: forceRender,\n autoDestroy: mergedAutoDestroy,\n getPopupContainer: getPopupContainer\n // Arrow\n ,\n\n align: alignInfo,\n arrow: innerArrow,\n arrowPos: arrowPos\n // Align\n ,\n\n ready: ready,\n offsetX: offsetX,\n offsetY: offsetY,\n offsetR: offsetR,\n offsetB: offsetB,\n onAlign: triggerAlign\n // Stretch\n ,\n\n stretch: stretch,\n targetWidth: targetWidth / scaleX,\n targetHeight: targetHeight / scaleY\n })));\n });\n if (process.env.NODE_ENV !== 'production') {\n Trigger.displayName = 'Trigger';\n }\n return Trigger;\n}\nexport default generateTrigger(Portal);","map":{"version":3,"names":["_objectSpread","_slicedToArray","_objectWithoutProperties","_excluded","Portal","classNames","ResizeObserver","isDOM","getShadowRoot","useEvent","useId","useLayoutEffect","isMobile","React","Popup","TriggerWrapper","TriggerContext","useAction","useAlign","useWatch","useWinClick","getAlignPopupClassName","getMotion","generateTrigger","PortalComponent","arguments","length","undefined","Trigger","forwardRef","props","ref","_props$prefixCls","prefixCls","children","_props$action","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","_props$mouseLeaveDela","mouseLeaveDelay","focusDelay","blurDelay","mask","_props$maskClosable","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","_props$builtinPlaceme","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode","restProps","mergedAutoDestroy","_React$useState","useState","_React$useState2","mobile","setMobile","subPopupElements","useRef","parentContext","useContext","context","useMemo","registerSubPopup","id","subPopupEle","current","_React$useState3","_React$useState4","popupEle","setPopupEle","externalPopupRef","setPopupRef","node","_React$useState5","_React$useState6","targetEle","setTargetEle","externalForwardRef","setTargetRef","child","Children","only","originChildProps","cloneProps","inPopupOrChild","ele","_getShadowRoot","_getShadowRoot2","childDOM","contains","host","Object","values","some","mergePopupMotion","mergeMaskMotion","_React$useState7","_React$useState8","internalOpen","setInternalOpen","mergedOpen","setMergedOpen","nextOpen","openRef","lastTriggerRef","internalTriggerOpen","_lastTriggerRef$curre","push","delayRef","clearDelay","clearTimeout","triggerOpen","delay","setTimeout","useEffect","_React$useState9","_React$useState10","inMotion","setInMotion","firstMount","_React$useState11","_React$useState12","motionPrepareResolve","setMotionPrepareResolve","_React$useState13","_React$useState14","mousePos","setMousePos","setMousePosByEvent","event","clientX","clientY","_useAlign","_useAlign2","ready","offsetX","offsetY","offsetR","offsetB","arrowX","arrowY","scaleX","scaleY","alignInfo","onAlign","_useAction","_useAction2","showActions","hideActions","clickToShow","has","clickToHide","triggerAlign","onScroll","JSON","stringify","alignedClassName","baseClassName","useImperativeHandle","nativeElement","popupElement","forceAlign","_React$useState15","_React$useState16","targetWidth","setTargetWidth","_React$useState17","_React$useState18","targetHeight","setTargetHeight","syncTargetSize","rect","getBoundingClientRect","width","height","onTargetResize","onVisibleChanged","visible","onPrepare","Promise","resolve","wrapperAction","eventName","preEvent","_originChildProps$eve","_len","args","Array","_key","call","apply","concat","onClick","_originChildProps$onC","_len2","_key2","hoverToShow","hoverToHide","onPopupMouseEnter","onPopupMouseLeave","target","onMouseMove","_originChildProps$onM","onContextMenu","_originChildProps$onC2","preventDefault","_len3","_key3","mergedChildrenProps","passedProps","passedEventList","forEach","_mergedChildrenProps$","_len4","_key4","triggerNode","cloneElement","arrowPos","x","y","innerArrow","createElement","Fragment","disabled","onResize","Provider","value","portal","style","onMouseEnter","onMouseLeave","onPointerEnter","open","keepDom","motion","align","process","env","NODE_ENV","displayName"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/@rc-component/trigger/es/index.js"],"sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"children\", \"action\", \"showAction\", \"hideAction\", \"popupVisible\", \"defaultPopupVisible\", \"onPopupVisibleChange\", \"afterPopupVisibleChange\", \"mouseEnterDelay\", \"mouseLeaveDelay\", \"focusDelay\", \"blurDelay\", \"mask\", \"maskClosable\", \"getPopupContainer\", \"forceRender\", \"autoDestroy\", \"destroyPopupOnHide\", \"popup\", \"popupClassName\", \"popupStyle\", \"popupPlacement\", \"builtinPlacements\", \"popupAlign\", \"zIndex\", \"stretch\", \"getPopupClassNameFromAlign\", \"fresh\", \"alignPoint\", \"onPopupClick\", \"onPopupAlign\", \"arrow\", \"popupMotion\", \"maskMotion\", \"popupTransitionName\", \"popupAnimation\", \"maskTransitionName\", \"maskAnimation\", \"className\", \"getTriggerDOMNode\"];\nimport Portal from '@rc-component/portal';\nimport classNames from 'classnames';\nimport ResizeObserver from 'rc-resize-observer';\nimport { isDOM } from \"rc-util/es/Dom/findDOMNode\";\nimport { getShadowRoot } from \"rc-util/es/Dom/shadow\";\nimport useEvent from \"rc-util/es/hooks/useEvent\";\nimport useId from \"rc-util/es/hooks/useId\";\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport isMobile from \"rc-util/es/isMobile\";\nimport * as React from 'react';\nimport Popup from \"./Popup\";\nimport TriggerWrapper from \"./TriggerWrapper\";\nimport TriggerContext from \"./context\";\nimport useAction from \"./hooks/useAction\";\nimport useAlign from \"./hooks/useAlign\";\nimport useWatch from \"./hooks/useWatch\";\nimport useWinClick from \"./hooks/useWinClick\";\nimport { getAlignPopupClassName, getMotion } from \"./util\";\n\n// Removed Props List\n// Seems this can be auto\n// getDocument?: (element?: HTMLElement) => Document;\n\n// New version will not wrap popup with `rc-trigger-popup-content` when multiple children\n\nexport function generateTrigger() {\n var PortalComponent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Portal;\n var Trigger = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-trigger-popup' : _props$prefixCls,\n children = props.children,\n _props$action = props.action,\n action = _props$action === void 0 ? 'hover' : _props$action,\n showAction = props.showAction,\n hideAction = props.hideAction,\n popupVisible = props.popupVisible,\n defaultPopupVisible = props.defaultPopupVisible,\n onPopupVisibleChange = props.onPopupVisibleChange,\n afterPopupVisibleChange = props.afterPopupVisibleChange,\n mouseEnterDelay = props.mouseEnterDelay,\n _props$mouseLeaveDela = props.mouseLeaveDelay,\n mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,\n focusDelay = props.focusDelay,\n blurDelay = props.blurDelay,\n mask = props.mask,\n _props$maskClosable = props.maskClosable,\n maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,\n getPopupContainer = props.getPopupContainer,\n forceRender = props.forceRender,\n autoDestroy = props.autoDestroy,\n destroyPopupOnHide = props.destroyPopupOnHide,\n popup = props.popup,\n popupClassName = props.popupClassName,\n popupStyle = props.popupStyle,\n popupPlacement = props.popupPlacement,\n _props$builtinPlaceme = props.builtinPlacements,\n builtinPlacements = _props$builtinPlaceme === void 0 ? {} : _props$builtinPlaceme,\n popupAlign = props.popupAlign,\n zIndex = props.zIndex,\n stretch = props.stretch,\n getPopupClassNameFromAlign = props.getPopupClassNameFromAlign,\n fresh = props.fresh,\n alignPoint = props.alignPoint,\n onPopupClick = props.onPopupClick,\n onPopupAlign = props.onPopupAlign,\n arrow = props.arrow,\n popupMotion = props.popupMotion,\n maskMotion = props.maskMotion,\n popupTransitionName = props.popupTransitionName,\n popupAnimation = props.popupAnimation,\n maskTransitionName = props.maskTransitionName,\n maskAnimation = props.maskAnimation,\n className = props.className,\n getTriggerDOMNode = props.getTriggerDOMNode,\n restProps = _objectWithoutProperties(props, _excluded);\n var mergedAutoDestroy = autoDestroy || destroyPopupOnHide || false;\n\n // =========================== Mobile ===========================\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n mobile = _React$useState2[0],\n setMobile = _React$useState2[1];\n useLayoutEffect(function () {\n setMobile(isMobile());\n }, []);\n\n // ========================== Context ===========================\n var subPopupElements = React.useRef({});\n var parentContext = React.useContext(TriggerContext);\n var context = React.useMemo(function () {\n return {\n registerSubPopup: function registerSubPopup(id, subPopupEle) {\n subPopupElements.current[id] = subPopupEle;\n parentContext === null || parentContext === void 0 || parentContext.registerSubPopup(id, subPopupEle);\n }\n };\n }, [parentContext]);\n\n // =========================== Popup ============================\n var id = useId();\n var _React$useState3 = React.useState(null),\n _React$useState4 = _slicedToArray(_React$useState3, 2),\n popupEle = _React$useState4[0],\n setPopupEle = _React$useState4[1];\n\n // Used for forwardRef popup. Not use internal\n var externalPopupRef = React.useRef(null);\n var setPopupRef = useEvent(function (node) {\n externalPopupRef.current = node;\n if (isDOM(node) && popupEle !== node) {\n setPopupEle(node);\n }\n parentContext === null || parentContext === void 0 || parentContext.registerSubPopup(id, node);\n });\n\n // =========================== Target ===========================\n // Use state to control here since `useRef` update not trigger render\n var _React$useState5 = React.useState(null),\n _React$useState6 = _slicedToArray(_React$useState5, 2),\n targetEle = _React$useState6[0],\n setTargetEle = _React$useState6[1];\n\n // Used for forwardRef target. Not use internal\n var externalForwardRef = React.useRef(null);\n var setTargetRef = useEvent(function (node) {\n if (isDOM(node) && targetEle !== node) {\n setTargetEle(node);\n externalForwardRef.current = node;\n }\n });\n\n // ========================== Children ==========================\n var child = React.Children.only(children);\n var originChildProps = (child === null || child === void 0 ? void 0 : child.props) || {};\n var cloneProps = {};\n var inPopupOrChild = useEvent(function (ele) {\n var _getShadowRoot, _getShadowRoot2;\n var childDOM = targetEle;\n return (childDOM === null || childDOM === void 0 ? void 0 : childDOM.contains(ele)) || ((_getShadowRoot = getShadowRoot(childDOM)) === null || _getShadowRoot === void 0 ? void 0 : _getShadowRoot.host) === ele || ele === childDOM || (popupEle === null || popupEle === void 0 ? void 0 : popupEle.contains(ele)) || ((_getShadowRoot2 = getShadowRoot(popupEle)) === null || _getShadowRoot2 === void 0 ? void 0 : _getShadowRoot2.host) === ele || ele === popupEle || Object.values(subPopupElements.current).some(function (subPopupEle) {\n return (subPopupEle === null || subPopupEle === void 0 ? void 0 : subPopupEle.contains(ele)) || ele === subPopupEle;\n });\n });\n\n // =========================== Motion ===========================\n var mergePopupMotion = getMotion(prefixCls, popupMotion, popupAnimation, popupTransitionName);\n var mergeMaskMotion = getMotion(prefixCls, maskMotion, maskAnimation, maskTransitionName);\n\n // ============================ Open ============================\n var _React$useState7 = React.useState(defaultPopupVisible || false),\n _React$useState8 = _slicedToArray(_React$useState7, 2),\n internalOpen = _React$useState8[0],\n setInternalOpen = _React$useState8[1];\n\n // Render still use props as first priority\n var mergedOpen = popupVisible !== null && popupVisible !== void 0 ? popupVisible : internalOpen;\n\n // We use effect sync here in case `popupVisible` back to `undefined`\n var setMergedOpen = useEvent(function (nextOpen) {\n if (popupVisible === undefined) {\n setInternalOpen(nextOpen);\n }\n });\n useLayoutEffect(function () {\n setInternalOpen(popupVisible || false);\n }, [popupVisible]);\n var openRef = React.useRef(mergedOpen);\n openRef.current = mergedOpen;\n var lastTriggerRef = React.useRef([]);\n lastTriggerRef.current = [];\n var internalTriggerOpen = useEvent(function (nextOpen) {\n var _lastTriggerRef$curre;\n setMergedOpen(nextOpen);\n\n // Enter or Pointer will both trigger open state change\n // We only need take one to avoid duplicated change event trigger\n // Use `lastTriggerRef` to record last open type\n if (((_lastTriggerRef$curre = lastTriggerRef.current[lastTriggerRef.current.length - 1]) !== null && _lastTriggerRef$curre !== void 0 ? _lastTriggerRef$curre : mergedOpen) !== nextOpen) {\n lastTriggerRef.current.push(nextOpen);\n onPopupVisibleChange === null || onPopupVisibleChange === void 0 || onPopupVisibleChange(nextOpen);\n }\n });\n\n // Trigger for delay\n var delayRef = React.useRef();\n var clearDelay = function clearDelay() {\n clearTimeout(delayRef.current);\n };\n var triggerOpen = function triggerOpen(nextOpen) {\n var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n clearDelay();\n if (delay === 0) {\n internalTriggerOpen(nextOpen);\n } else {\n delayRef.current = setTimeout(function () {\n internalTriggerOpen(nextOpen);\n }, delay * 1000);\n }\n };\n React.useEffect(function () {\n return clearDelay;\n }, []);\n\n // ========================== Motion ============================\n var _React$useState9 = React.useState(false),\n _React$useState10 = _slicedToArray(_React$useState9, 2),\n inMotion = _React$useState10[0],\n setInMotion = _React$useState10[1];\n useLayoutEffect(function (firstMount) {\n if (!firstMount || mergedOpen) {\n setInMotion(true);\n }\n }, [mergedOpen]);\n var _React$useState11 = React.useState(null),\n _React$useState12 = _slicedToArray(_React$useState11, 2),\n motionPrepareResolve = _React$useState12[0],\n setMotionPrepareResolve = _React$useState12[1];\n\n // =========================== Align ============================\n var _React$useState13 = React.useState([0, 0]),\n _React$useState14 = _slicedToArray(_React$useState13, 2),\n mousePos = _React$useState14[0],\n setMousePos = _React$useState14[1];\n var setMousePosByEvent = function setMousePosByEvent(event) {\n setMousePos([event.clientX, event.clientY]);\n };\n var _useAlign = useAlign(mergedOpen, popupEle, alignPoint ? mousePos : targetEle, popupPlacement, builtinPlacements, popupAlign, onPopupAlign),\n _useAlign2 = _slicedToArray(_useAlign, 11),\n ready = _useAlign2[0],\n offsetX = _useAlign2[1],\n offsetY = _useAlign2[2],\n offsetR = _useAlign2[3],\n offsetB = _useAlign2[4],\n arrowX = _useAlign2[5],\n arrowY = _useAlign2[6],\n scaleX = _useAlign2[7],\n scaleY = _useAlign2[8],\n alignInfo = _useAlign2[9],\n onAlign = _useAlign2[10];\n var _useAction = useAction(mobile, action, showAction, hideAction),\n _useAction2 = _slicedToArray(_useAction, 2),\n showActions = _useAction2[0],\n hideActions = _useAction2[1];\n var clickToShow = showActions.has('click');\n var clickToHide = hideActions.has('click') || hideActions.has('contextMenu');\n var triggerAlign = useEvent(function () {\n if (!inMotion) {\n onAlign();\n }\n });\n var onScroll = function onScroll() {\n if (openRef.current && alignPoint && clickToHide) {\n triggerOpen(false);\n }\n };\n useWatch(mergedOpen, targetEle, popupEle, triggerAlign, onScroll);\n useLayoutEffect(function () {\n triggerAlign();\n }, [mousePos, popupPlacement]);\n\n // When no builtinPlacements and popupAlign changed\n useLayoutEffect(function () {\n if (mergedOpen && !(builtinPlacements !== null && builtinPlacements !== void 0 && builtinPlacements[popupPlacement])) {\n triggerAlign();\n }\n }, [JSON.stringify(popupAlign)]);\n var alignedClassName = React.useMemo(function () {\n var baseClassName = getAlignPopupClassName(builtinPlacements, prefixCls, alignInfo, alignPoint);\n return classNames(baseClassName, getPopupClassNameFromAlign === null || getPopupClassNameFromAlign === void 0 ? void 0 : getPopupClassNameFromAlign(alignInfo));\n }, [alignInfo, getPopupClassNameFromAlign, builtinPlacements, prefixCls, alignPoint]);\n\n // ============================ Refs ============================\n React.useImperativeHandle(ref, function () {\n return {\n nativeElement: externalForwardRef.current,\n popupElement: externalPopupRef.current,\n forceAlign: triggerAlign\n };\n });\n\n // ========================== Stretch ===========================\n var _React$useState15 = React.useState(0),\n _React$useState16 = _slicedToArray(_React$useState15, 2),\n targetWidth = _React$useState16[0],\n setTargetWidth = _React$useState16[1];\n var _React$useState17 = React.useState(0),\n _React$useState18 = _slicedToArray(_React$useState17, 2),\n targetHeight = _React$useState18[0],\n setTargetHeight = _React$useState18[1];\n var syncTargetSize = function syncTargetSize() {\n if (stretch && targetEle) {\n var rect = targetEle.getBoundingClientRect();\n setTargetWidth(rect.width);\n setTargetHeight(rect.height);\n }\n };\n var onTargetResize = function onTargetResize() {\n syncTargetSize();\n triggerAlign();\n };\n\n // ========================== Motion ============================\n var onVisibleChanged = function onVisibleChanged(visible) {\n setInMotion(false);\n onAlign();\n afterPopupVisibleChange === null || afterPopupVisibleChange === void 0 || afterPopupVisibleChange(visible);\n };\n\n // We will trigger align when motion is in prepare\n var onPrepare = function onPrepare() {\n return new Promise(function (resolve) {\n syncTargetSize();\n setMotionPrepareResolve(function () {\n return resolve;\n });\n });\n };\n useLayoutEffect(function () {\n if (motionPrepareResolve) {\n onAlign();\n motionPrepareResolve();\n setMotionPrepareResolve(null);\n }\n }, [motionPrepareResolve]);\n\n // =========================== Action ===========================\n /**\n * Util wrapper for trigger action\n */\n function wrapperAction(eventName, nextOpen, delay, preEvent) {\n cloneProps[eventName] = function (event) {\n var _originChildProps$eve;\n preEvent === null || preEvent === void 0 || preEvent(event);\n triggerOpen(nextOpen, delay);\n\n // Pass to origin\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n (_originChildProps$eve = originChildProps[eventName]) === null || _originChildProps$eve === void 0 || _originChildProps$eve.call.apply(_originChildProps$eve, [originChildProps, event].concat(args));\n };\n }\n\n // ======================= Action: Click ========================\n if (clickToShow || clickToHide) {\n cloneProps.onClick = function (event) {\n var _originChildProps$onC;\n if (openRef.current && clickToHide) {\n triggerOpen(false);\n } else if (!openRef.current && clickToShow) {\n setMousePosByEvent(event);\n triggerOpen(true);\n }\n\n // Pass to origin\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n (_originChildProps$onC = originChildProps.onClick) === null || _originChildProps$onC === void 0 || _originChildProps$onC.call.apply(_originChildProps$onC, [originChildProps, event].concat(args));\n };\n }\n\n // Click to hide is special action since click popup element should not hide\n useWinClick(mergedOpen, clickToHide, targetEle, popupEle, mask, maskClosable, inPopupOrChild, triggerOpen);\n\n // ======================= Action: Hover ========================\n var hoverToShow = showActions.has('hover');\n var hoverToHide = hideActions.has('hover');\n var onPopupMouseEnter;\n var onPopupMouseLeave;\n if (hoverToShow) {\n // Compatible with old browser which not support pointer event\n wrapperAction('onMouseEnter', true, mouseEnterDelay, function (event) {\n setMousePosByEvent(event);\n });\n wrapperAction('onPointerEnter', true, mouseEnterDelay, function (event) {\n setMousePosByEvent(event);\n });\n onPopupMouseEnter = function onPopupMouseEnter(event) {\n // Only trigger re-open when popup is visible\n if ((mergedOpen || inMotion) && popupEle !== null && popupEle !== void 0 && popupEle.contains(event.target)) {\n triggerOpen(true, mouseEnterDelay);\n }\n };\n\n // Align Point\n if (alignPoint) {\n cloneProps.onMouseMove = function (event) {\n var _originChildProps$onM;\n // setMousePosByEvent(event);\n (_originChildProps$onM = originChildProps.onMouseMove) === null || _originChildProps$onM === void 0 || _originChildProps$onM.call(originChildProps, event);\n };\n }\n }\n if (hoverToHide) {\n wrapperAction('onMouseLeave', false, mouseLeaveDelay);\n wrapperAction('onPointerLeave', false, mouseLeaveDelay);\n onPopupMouseLeave = function onPopupMouseLeave() {\n triggerOpen(false, mouseLeaveDelay);\n };\n }\n\n // ======================= Action: Focus ========================\n if (showActions.has('focus')) {\n wrapperAction('onFocus', true, focusDelay);\n }\n if (hideActions.has('focus')) {\n wrapperAction('onBlur', false, blurDelay);\n }\n\n // ==================== Action: ContextMenu =====================\n if (showActions.has('contextMenu')) {\n cloneProps.onContextMenu = function (event) {\n var _originChildProps$onC2;\n if (openRef.current && hideActions.has('contextMenu')) {\n triggerOpen(false);\n } else {\n setMousePosByEvent(event);\n triggerOpen(true);\n }\n event.preventDefault();\n\n // Pass to origin\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n (_originChildProps$onC2 = originChildProps.onContextMenu) === null || _originChildProps$onC2 === void 0 || _originChildProps$onC2.call.apply(_originChildProps$onC2, [originChildProps, event].concat(args));\n };\n }\n\n // ========================= ClassName ==========================\n if (className) {\n cloneProps.className = classNames(originChildProps.className, className);\n }\n\n // =========================== Render ===========================\n var mergedChildrenProps = _objectSpread(_objectSpread({}, originChildProps), cloneProps);\n\n // Pass props into cloneProps for nest usage\n var passedProps = {};\n var passedEventList = ['onContextMenu', 'onClick', 'onMouseDown', 'onTouchStart', 'onMouseEnter', 'onMouseLeave', 'onFocus', 'onBlur'];\n passedEventList.forEach(function (eventName) {\n if (restProps[eventName]) {\n passedProps[eventName] = function () {\n var _mergedChildrenProps$;\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n (_mergedChildrenProps$ = mergedChildrenProps[eventName]) === null || _mergedChildrenProps$ === void 0 || _mergedChildrenProps$.call.apply(_mergedChildrenProps$, [mergedChildrenProps].concat(args));\n restProps[eventName].apply(restProps, args);\n };\n }\n });\n\n // Child Node\n var triggerNode = /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, mergedChildrenProps), passedProps));\n var arrowPos = {\n x: arrowX,\n y: arrowY\n };\n var innerArrow = arrow ? _objectSpread({}, arrow !== true ? arrow : {}) : null;\n\n // Render\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ResizeObserver, {\n disabled: !mergedOpen,\n ref: setTargetRef,\n onResize: onTargetResize\n }, /*#__PURE__*/React.createElement(TriggerWrapper, {\n getTriggerDOMNode: getTriggerDOMNode\n }, triggerNode)), /*#__PURE__*/React.createElement(TriggerContext.Provider, {\n value: context\n }, /*#__PURE__*/React.createElement(Popup, {\n portal: PortalComponent,\n ref: setPopupRef,\n prefixCls: prefixCls,\n popup: popup,\n className: classNames(popupClassName, alignedClassName),\n style: popupStyle,\n target: targetEle,\n onMouseEnter: onPopupMouseEnter,\n onMouseLeave: onPopupMouseLeave\n // https://github.com/ant-design/ant-design/issues/43924\n ,\n onPointerEnter: onPopupMouseEnter,\n zIndex: zIndex\n // Open\n ,\n open: mergedOpen,\n keepDom: inMotion,\n fresh: fresh\n // Click\n ,\n onClick: onPopupClick\n // Mask\n ,\n mask: mask\n // Motion\n ,\n motion: mergePopupMotion,\n maskMotion: mergeMaskMotion,\n onVisibleChanged: onVisibleChanged,\n onPrepare: onPrepare\n // Portal\n ,\n forceRender: forceRender,\n autoDestroy: mergedAutoDestroy,\n getPopupContainer: getPopupContainer\n // Arrow\n ,\n align: alignInfo,\n arrow: innerArrow,\n arrowPos: arrowPos\n // Align\n ,\n ready: ready,\n offsetX: offsetX,\n offsetY: offsetY,\n offsetR: offsetR,\n offsetB: offsetB,\n onAlign: triggerAlign\n // Stretch\n ,\n stretch: stretch,\n targetWidth: targetWidth / scaleX,\n targetHeight: targetHeight / scaleY\n })));\n });\n if (process.env.NODE_ENV !== 'production') {\n Trigger.displayName = 'Trigger';\n }\n return Trigger;\n}\nexport default generateTrigger(Portal);"],"mappings":"AAAA,OAAOA,aAAa,MAAM,0CAA0C;AACpE,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAOC,wBAAwB,MAAM,oDAAoD;AACzF,IAAIC,SAAS,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,oBAAoB,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,4BAA4B,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,WAAW,EAAE,mBAAmB,CAAC;AAC3qB,OAAOC,MAAM,MAAM,sBAAsB;AACzC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,cAAc,MAAM,oB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