import*as t from"react";import e,{PrimeReactContext as r}from"primereact/api";import{ComponentBase as n,useHandleStyle as o}from"primereact/componentbase";import{useMergeProps as i,useDisplayOrder as a,useGlobalOnEscapeKey as u,ESC_KEY_HANDLING_PRIORITIES as l,useResizeListener as c,useOverlayScrollListener as p,useMountEffect as s,useUpdateEffect as f,useUnmountEffect as d}from"primereact/hooks";import{Portal as m}from"primereact/portal";import{classNames as h,DomHandler as v,ZIndexUtils as y,ObjectUtils as b}from"primereact/utils";function g(){return g=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);ra.width?(J.current.style.left="0px",J.current.style.right=window.innerWidth-a.width-n+"px"):(J.current.style.right="",J.current.style.left=n+"px"),J.current.style.top=o+"px",v.addClass(J.current,"p-tooltip-active")}else{var p=v.findCollisionPosition(i),s=dt(t,"my")||O.my||p.my,f=dt(t,"at")||O.at||p.at;J.current.style.padding="0px",v.flipfitCollision(J.current,t,s,f,(function(t){var e=t.at,r=e.x,n=O.at?"center"!==r&&r!==t.my.x?r:e.y:t.at["".concat(p.axis)];J.current.style.padding="",R(n),Ot(n),v.addClass(J.current,"p-tooltip-active")}))}},Ot=function(t){if(J.current){var e=getComputedStyle(J.current);"left"===t?J.current.style.left=parseFloat(e.left)-2*parseFloat(e.paddingLeft)+"px":"top"===t&&(J.current.style.top=parseFloat(e.top)-2*parseFloat(e.paddingTop)+"px")}},Tt=function(t){ft()||(tt.current=!0,Et(t))},St=function(t){if(t){var e=ht(t),r=e.showEvents,n=e.hideEvents,o=Nt(t);r.forEach((function(t){return null==o?void 0:o.addEventListener(t,wt)})),n.forEach((function(t){return null==o?void 0:o.addEventListener(t,Et)}))}},jt=function(t){if(t){var e=ht(t),r=e.showEvents,n=e.hideEvents,o=Nt(t);r.forEach((function(t){return null==o?void 0:o.removeEventListener(t,wt)})),n.forEach((function(t){return null==o?void 0:o.removeEventListener(t,Et)}))}},Pt=function(t){return dt(Q.current,t.toLowerCase())||O[t]},kt=function(t,e){It();var r=Pt(t);r?et.current["".concat(t)]=setTimeout((function(){return e()}),r):e()},Dt=function(t){if(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n