import{h as y,ah as L,ac as M,aa as W,k as T,a4 as g,r as u,B as m,a0 as E,Z as O}from"./entry.FpkzWRi9.js";function S(e){return M()?(W(e),!0):!1}function w(e){return typeof e=="function"?e():T(e)}const A=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const N=Object.prototype.toString,C=e=>N.call(e)==="[object Object]",Y=()=>{};function j(e){return g()}function k(e,t=!0,n){j()?y(e,n):t?e():L(e)}function x(e){var t;const n=w(e);return(t=n==null?void 0:n.$el)!=null?t:n}const v=A?window:void 0;function b(...e){let t,n,r,o;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,o]=e,t=v):[t,n,r,o]=e,!t)return Y;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const a=[],i=()=>{a.forEach(l=>l()),a.length=0},s=(l,f,p,h)=>(l.addEventListener(f,p,h),()=>l.removeEventListener(f,p,h)),c=E(()=>[x(t),w(o)],([l,f])=>{if(i(),!l)return;const p=C(f)?{...f}:f;a.push(...n.flatMap(h=>r.map(I=>s(l,h,I,p))))},{immediate:!0,flush:"post"}),d=()=>{c(),i()};return S(d),d}function H(){const e=u(!1),t=g();return t&&y(()=>{e.value=!0},t),e}function V(e){const t=H();return m(()=>(t.value,!!e()))}function X(e,t={}){const{window:n=v}=t,r=V(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let o;const a=u(!1),i=d=>{a.value=d.matches},s=()=>{o&&("removeEventListener"in o?o.removeEventListener("change",i):o.removeListener(i))},c=O(()=>{r.value&&(s(),o=n.matchMedia(w(e)),"addEventListener"in o?o.addEventListener("change",i):o.addListener(i),a.value=o.matches)});return S(()=>{c(),s(),o=void 0}),a}function z(e={}){const{window:t=v,behavior:n="auto"}=e;if(!t)return{x:u(0),y:u(0)};const r=u(t.scrollX),o=u(t.scrollY),a=m({get(){return r.value},set(s){scrollTo({left:s,behavior:n})}}),i=m({get(){return o.value},set(s){scrollTo({top:s,behavior:n})}});return b(t,"scroll",()=>{r.value=t.scrollX,o.value=t.scrollY},{capture:!1,passive:!0}),{x:a,y:i}}function B(e={}){const{window:t=v,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:r=Number.POSITIVE_INFINITY,listenOrientation:o=!0,includeScrollbar:a=!0}=e,i=u(n),s=u(r),c=()=>{t&&(a?(i.value=t.innerWidth,s.value=t.innerHeight):(i.value=t.document.documentElement.clientWidth,s.value=t.document.documentElement.clientHeight))};if(c(),k(c),b("resize",c,{passive:!0}),o){const d=X("(orientation: portrait)");E(d,()=>c())}return{width:i,height:s}}export{z as a,B as u};
