import{defineProperty as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as o}from"react/jsx-runtime";import i,{useRef as n,useCallback as t,cloneElement as r}from"react";import s from"classnames";import{CSSTransition as a}from"react-transition-group";import l from"../../../hooks/useClickOutside/index.js";import{chainFunctions as c,NOOP as p}from"../../../utils/function-utils.js";import d from"../../../hooks/useKeyEvent/index.js";import{HideShowEvent as m}from"../consts/dialog-show-hide-event.js";import"./DialogContent.scss.js";import{ESCAPE_KEYS as u}from"../../../constants/keyCodes.js";var f={},v={},h=i.forwardRef((function(h,g){var j,y=h.onEsc,C=void 0===y?p:y,k=h.children,O=h.position,b=h.wrapperClassName,E=h.isOpen,M=void 0!==E&&E,w=h.startingEdge,x=h.animationType,L=void 0===x?"expand":x,N=h.onMouseEnter,D=void 0===N?p:N,T=h.onMouseLeave,_=void 0===T?p:T,H=h.onClickOutside,I=void 0===H?p:H,K=h.onClick,P=void 0===K?p:K,R=h.showDelay,A=h.styleObject,B=void 0===A?v:A,S=h.isReferenceHidden,U=h.hasTooltip,q=void 0!==U&&U,z=n(null),F=t((function(e){if(M)return I(e,m.CLICK_OUTSIDE)}),[M,I]);return d({keys:u,callback:C}),l({callback:F,ref:z}),L&&(f.classNames="l3-style-animation-".concat(L)),o("span",Object.assign({className:s("l3-style-dialog-content-wrapper",b),ref:g,style:B,onClickCapture:P,"data-popper-reference-hidden":S},{children:o(a,Object.assign({},f,{in:M,appear:!!L,timeout:R},{children:o("div",Object.assign({className:s("l3-style-dialog-content-component",O,(j={},e(j,"edge-".concat(w),w),e(j,"has-tooltip",q),j)),ref:z},{children:i.Children.toArray(k).map((function(e){return r(e,{onMouseEnter:c([e.props.onMouseEnter,D]),onMouseLeave:c([e.props.onMouseLeave,_])})}))}))}))}))}));export{h as DialogContent};
