Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.179/page_editor/common/components/PopoverTooltip",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/popover","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.PopoverTooltip=function PopoverTooltip({alignPosition:t="top",content:r,header:o,id:a,showTooltipOnClick:c=!0,trigger:l}){const[u,d]=(0,i.useState)(!1);(0,i.useEffect)((()=>{if(!u)return;const handleKeyDown=e=>{"Escape"===e.key&&d(!1)};return window.addEventListener("keydown",handleKeyDown),()=>window.removeEventListener("keydown",handleKeyDown)}),[u]);const p={"aria-describedby":u?a:null,onBlur:()=>d(!1),onFocus:()=>d(!0),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),type:"button"};return i.default.createElement(n.default,{alignPosition:t,className:"position-fixed",disableScroll:!0,header:o,id:a,onShowChange:d,role:"tooltip",show:u,trigger:e.has(l.type)?i.default.cloneElement(l,_objectSpread(_objectSpread({},p),{},{onClick:e=>{var t,r;c&&d((e=>!e)),null===(t=(r=l.props).onClick)||void 0===t||t.call(r,e)}})):i.default.createElement("button",p,l)},r)};var o=_interopRequireWildcard(r("@frontend-taglib-clay$clayui/button")),n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("@frontend-taglib-clay$clayui/popover")),i=_interopRequireWildcard(r("liferay!frontend-js-react-web$react"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e=new Set([o.default,o.ClayButtonWithIcon,"button"])}}));
//# sourceMappingURL=PopoverTooltip.js.map