text: import"./esm-chunk-eaca7b99.js";import{H as t,x as e,D as n}from"./esm-chunk-dac9ea79.js";import{D as i,R as o}from"./esm-chunk-b9f5fab8.js";function s(t,e,n){t.style.position="absolute",t.style.visibility="hidden",t.style.display="block";let i=function(t,e,n){let i=(d=t,d.offsetParent),o=function(t){if(!t)return{X:0,Y:0};var e=t.getBoundingClientRect();return{X:e.left+pageXOffset,Y:e.top+pageYOffset}}(i),s=i.getBoundingClientRect(),l=t.getBoundingClientRect(),u=e+pageXOffset-o.X;var d;s.left+u+l.width>=document.body.clientWidth&&(u=document.body.clientWidth-l.width-s.left-1);u+=i.scrollLeft;let c=n+pageYOffset-o.Y;s.top+c+l.height>=window.innerHeight&&(c-=l.height+1);return c+=i.scrollTop,{X:u,Y:c}}(t,e,n);return t.style.top=i.Y+"px",t.style.left=i.X+"px",t.style.visibility="visible",!1}function l(t){t.style.display="none",c(t)}function u(t){t.invokeMethodAsync("Hide")}function d(l,d,c,r){if(!(l=t(l)))return;i(l);let f=function(t){return function(t,e,n){let i=document.getElementById(e);i.contains(t.target)||i===t.target||u(n)}(t,l.id,r)},a=function(t){return function(t,e){"Escape"===t.key&&u(e)}(t,r)};return"ontouchstart"in window?e(document,"touchstart",f):e(document,"mousedown",f),e(document,"keydown",a),o(l,(function(){"ontouchstart"in window?n(document,"touchstart",f):n(document,"mousedown",f),n(document,"keydown",a)})),s(l,d,c),Promise.resolve("ok")}function c(e){if(e=t(e))return i(e),Promise.resolve("ok")}function r(e,n){if(!(n=t(n)))return;n.style.visibility="hidden",n.style.display="block";let i=e.getBoundingClientRect(),o=n.getBoundingClientRect();n.style.position="absolute";let s=e.offsetTop;i.top+o.height>=window.innerHeight&&(s-=o.height+i.top+1-window.innerHeight),n.style.top=s+"px";let l=i.width;i.left+l+o.width>=document.body.clientWidth&&(l-=o.width+i.width+1),n.style.left=l+"px",n.style.visibility="visible"}const f={RenderMenu:d,Dispose:c,RenderSubMenu:r,HideMenuClientSide:l};export default f;export{c as Dispose,l as HideMenuClientSide,d as RenderMenu,r as RenderSubMenu};
  