import{I as e,J as t,o as n,A as o,j as s,z as l,U as u,i,V as a,W as r,e as c}from"./vue-DAoaJb2i.js";function v(n){return!!e()&&(t(n),!0)}const d="undefined"!=typeof window&&"undefined"!=typeof document;"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope);const f=e=>null!=e,p=Object.prototype.toString,m=e=>"[object Object]"===p.call(e),h=()=>{};function g(e){return Array.isArray(e)?e:[e]}function w(e,t=!0,s){l()?n(e,s):t?e():o(e)}const y=d?window:void 0;function b(e){var t;const n=a(e);return null!=(t=null==n?void 0:n.$el)?t:n}function O(...e){const t=[],n=()=>{t.forEach((e=>e())),t.length=0},o=i((()=>{const t=g(a(e[0])).filter((e=>null!=e));return t.every((e=>"string"!=typeof e))?t:void 0})),l=(u=([e,o,s,l])=>{if(n(),!(null==e?void 0:e.length)||!(null==o?void 0:o.length)||!(null==s?void 0:s.length))return;const u=m(l)?{...l}:l;t.push(...e.flatMap((e=>o.flatMap((t=>s.map((n=>((e,t,n,o)=>(e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)))(e,t,n,u))))))))},r={flush:"post"},s((()=>{var t,n;return[null!=(n=null==(t=o.value)?void 0:t.map((e=>b(e))))?n:[y].filter((e=>null!=e)),g(a(o.value?e[1]:e[0])),g(c(o.value?e[2]:e[1])),a(o.value?e[3]:e[2])]}),u,{...r,immediate:!0}));var u,r;return v(n),()=>{l(),n()}}function x(e){const t=function(){const e=u(!1),t=l();return t&&n((()=>{e.value=!0}),t),e}();return i((()=>(t.value,Boolean(e()))))}function E(e,t,n={}){const{window:o=y,...l}=n;let u;const r=x((()=>o&&"MutationObserver"in o)),c=()=>{u&&(u.disconnect(),u=void 0)},d=i((()=>{const t=g(a(e)).map(b).filter(f);return new Set(t)})),p=s((()=>d.value),(e=>{c(),r.value&&e.size&&(u=new MutationObserver(t),e.forEach((e=>u.observe(e,l))))}),{immediate:!0,flush:"post"}),m=()=>{p(),c()};return v(m),{isSupported:r,stop:m,takeRecords:()=>null==u?void 0:u.takeRecords()}}function R(e,t,n={}){const{window:o=y,...l}=n;let u;const r=x((()=>o&&"ResizeObserver"in o)),c=()=>{u&&(u.disconnect(),u=void 0)},d=i((()=>{const t=a(e);return Array.isArray(t)?t.map((e=>b(e))):[b(t)]})),f=s(d,(e=>{if(c(),r.value&&o){u=new ResizeObserver(t);for(const t of e)t&&u.observe(t,l)}}),{immediate:!0,flush:"post"}),p=()=>{c(),f()};return v(p),{isSupported:r,stop:p}}function S(e,t={}){const{reset:n=!0,windowResize:o=!0,windowScroll:l=!0,immediate:i=!0,updateTiming:a="sync"}=t,r=u(0),c=u(0),v=u(0),d=u(0),f=u(0),p=u(0),m=u(0),h=u(0);function g(){const t=b(e);if(!t)return void(n&&(r.value=0,c.value=0,v.value=0,d.value=0,f.value=0,p.value=0,m.value=0,h.value=0));const o=t.getBoundingClientRect();r.value=o.height,c.value=o.bottom,v.value=o.left,d.value=o.right,f.value=o.top,p.value=o.width,m.value=o.x,h.value=o.y}function y(){"sync"===a?g():"next-frame"===a&&requestAnimationFrame((()=>g()))}return R(e,y),s((()=>b(e)),(e=>!e&&y())),E(e,y,{attributeFilter:["style","class"]}),l&&O("scroll",y,{capture:!0,passive:!0}),o&&O("resize",y,{passive:!0}),w((()=>{i&&y()})),{height:r,bottom:c,left:v,right:d,top:f,width:p,x:m,y:h,update:y}}function X(e,t={}){const{delayEnter:n=0,delayLeave:o=0,triggerOnRemoval:s=!1,window:l=y}=t,a=u(!1);let c;const d=e=>{const t=e?n:o;c&&(clearTimeout(c),c=void 0),t?c=setTimeout((()=>a.value=e),t):a.value=e};return l?(O(e,"mouseenter",(()=>d(!0)),{passive:!0}),O(e,"mouseleave",(()=>d(!1)),{passive:!0}),s&&function(e,t,n={}){const{window:o=y,document:s=(null==o?void 0:o.document),flush:l="sync"}=n;if(!o||!s)return h;let u;const i=e=>{null==u||u(),u=e},a=r((()=>{const n=b(e);if(n){const{stop:e}=E(s,(e=>{e.map((e=>[...e.removedNodes])).flat().some((e=>e===n||e.contains(n)))&&t(e)}),{window:o,childList:!0,subtree:!0});i(e)}}),{flush:l}),c=()=>{a(),i()};v(c)}(i((()=>b(e))),(()=>d(!1))),a):a}function Y(e,t,n={}){const{root:o,rootMargin:l="0px",threshold:r=0,window:c=y,immediate:d=!0}=n,p=x((()=>c&&"IntersectionObserver"in c)),m=i((()=>g(a(e)).map(b).filter(f)));let w=h;const O=u(d),E=p.value?s((()=>[m.value,b(o),O.value]),(([e,n])=>{if(w(),!O.value)return;if(!e.length)return;const o=new IntersectionObserver(t,{root:b(n),rootMargin:l,threshold:r});e.forEach((e=>e&&o.observe(e))),w=()=>{o.disconnect(),w=h}}),{immediate:d,flush:"post"}):h,R=()=>{w(),E(),O.value=!1};return v(R),{isSupported:p,isActive:O,pause(){w(),O.value=!1},resume(){O.value=!0},stop:R}}const z={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof MouseEvent?[e.movementX,e.movementY]:null};function M(e,t={}){const{windowResize:n=!0,windowScroll:o=!0,handleOutside:l=!0,window:i=y}=t,a=t.type||"page",{x:r,y:c,sourceType:v}=function(e={}){const{type:t="page",touch:n=!0,resetOnTouchEnds:o=!1,initialValue:s={x:0,y:0},window:l=y,target:i=l,scroll:a=!0,eventFilter:r}=e;let c=null,v=0,d=0;const f=u(s.x),p=u(s.y),m=u(null),h="function"==typeof t?t:z[t],g=e=>{const t=h(e);c=e,t&&([f.value,p.value]=t,m.value="mouse"),l&&(v=l.scrollX,d=l.scrollY)},w=e=>{if(e.touches.length>0){const t=h(e.touches[0]);t&&([f.value,p.value]=t,m.value="touch")}},b=()=>{if(!c||!l)return;const e=h(c);c instanceof MouseEvent&&e&&(f.value=e[0]+l.scrollX-v,p.value=e[1]+l.scrollY-d)},x=()=>{f.value=s.x,p.value=s.y},E=r?e=>r((()=>g(e)),{}):e=>g(e),R=r?e=>r((()=>w(e)),{}):e=>w(e),S=r?()=>r((()=>b()),{}):()=>b();if(i){const e={passive:!0};O(i,["mousemove","dragover"],E,e),n&&"movement"!==t&&(O(i,["touchstart","touchmove"],R,e),o&&O(i,"touchend",x,e)),a&&"page"===t&&O(l,"scroll",S,e)}return{x:f,y:p,sourceType:m}}(t),d=u(null!=e?e:null==i?void 0:i.document.body),f=u(0),p=u(0),m=u(0),h=u(0),g=u(0),x=u(0),S=u(!0);function X(){if(!i)return;const e=b(d);if(!(e&&e instanceof Element))return;const{left:t,top:n,width:o,height:s}=e.getBoundingClientRect();m.value=t+("page"===a?i.pageXOffset:0),h.value=n+("page"===a?i.pageYOffset:0),g.value=s,x.value=o;const u=r.value-m.value,v=c.value-h.value;S.value=0===o||0===s||u<0||v<0||u>o||v>s,l&&(f.value=u,p.value=v)}const Y=[];if(w((()=>{X()})),i){const{stop:e}=R(d,X),{stop:t}=E(d,X,{attributeFilter:["style","class"]}),l=s([d,r,c],X);Y.push(e,t,l),O(document,"mouseleave",(()=>S.value=!0),{passive:!0}),o&&Y.push(O("scroll",X,{capture:!0,passive:!0})),n&&Y.push(O("resize",X,{passive:!0}))}return{x:r,y:c,sourceType:v,elementX:f,elementY:p,elementPositionX:m,elementPositionY:h,elementHeight:g,elementWidth:x,isOutside:S,stop:function(){Y.forEach((e=>e())),Y.length=0}}}export{Y as a,M as b,X as c,S as d,O as u};