import{Q as Y,U as F,V as l,W as I,X as E,Y as N}from"./vendor.a0144ce9.js";function M(e){return Y()?(I(e),!0):!1}const m=typeof window!="undefined",H=e=>typeof e=="string",b=()=>{};function K(e,t){function r(...n){e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})}return r}const A=e=>e();function Q(e=A){const t=l(!0);function r(){t.value=!1}function n(){t.value=!0}return{isActive:t,pause:r,resume:n,eventFilter:(...i)=>{t.value&&e(...i)}}}function U(e,t=!1,r="Timeout"){return new Promise((n,o)=>{setTimeout(t?()=>o(r):n,e)})}var D=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,G=(e,t)=>{var r={};for(var n in e)q.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&D)for(var n of D(e))t.indexOf(n)<0&&B.call(e,n)&&(r[n]=e[n]);return r};function Z(e,t,r={}){const n=r,{eventFilter:o=A}=n,i=G(n,["eventFilter"]);return F(e,K(o,t),i)}var k=Object.defineProperty,ee=Object.defineProperties,te=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,x=(e,t,r)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,re=(e,t)=>{for(var r in t||(t={}))T.call(t,r)&&x(e,r,t[r]);if(S)for(var r of S(t))W.call(t,r)&&x(e,r,t[r]);return e},ne=(e,t)=>ee(e,te(t)),ae=(e,t)=>{var r={};for(var n in e)T.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&S)for(var n of S(e))t.indexOf(n)<0&&W.call(e,n)&&(r[n]=e[n]);return r};function oe(e,t,r={}){const n=r,{eventFilter:o}=n,i=ae(n,["eventFilter"]),{eventFilter:d,pause:u,resume:s,isActive:v}=Q(o);return{stop:Z(e,t,ne(re({},i),{eventFilter:d})),pause:u,resume:s,isActive:v}}function ie(e){var t;const r=N(e);return(t=r==null?void 0:r.$el)!=null?t:r}const O=m?window:void 0;m&&window.document;m&&window.navigator;m&&window.location;function J(...e){let t,r,n,o;if(H(e[0])?([r,n,o]=e,t=O):[t,r,n,o]=e,!t)return b;let i=b;const d=F(()=>ie(t),s=>{i(),!!s&&(s.addEventListener(r,n,o),i=()=>{s.removeEventListener(r,n,o),i=b})},{immediate:!0,flush:"post"}),u=()=>{d(),i()};return M(u),u}function de(e,t,r){const{immediate:n=!0,delay:o=0,onError:i=b,resetOnExecute:d=!0,shallow:u=!0}=r!=null?r:{},s=u?E(t):l(t),v=l(!1),w=l(!1),_=l(void 0);async function y(f=0,...g){d&&(s.value=t),_.value=void 0,v.value=!1,w.value=!0,f>0&&await U(f);const h=typeof e=="function"?e(...g):e;try{const c=await h;s.value=c,v.value=!0}catch(c){_.value=c,i(c)}finally{w.value=!1}return s.value}return n&&y(o),{state:s,isReady:v,isLoading:w,error:_,execute:y}}const P=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},$="__vueuse_ssr_handlers__";P[$]=P[$]||{};const se=P[$];function le(e,t){return se[e]||t}function ue(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}const fe={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function ce(e,t,r,n={}){var o;const{flush:i="pre",deep:d=!0,listenToStorageChanges:u=!0,writeDefaults:s=!0,shallow:v,window:w=O,eventFilter:_,onError:y=a=>{console.error(a)}}=n,f=(v?E:l)(t);if(!r)try{r=le("getDefaultStorage",()=>{var a;return(a=O)==null?void 0:a.localStorage})()}catch(a){y(a)}if(!r)return f;const g=N(t),h=ue(g),c=(o=n.serializer)!=null?o:fe[h],{pause:z,resume:C}=oe(f,()=>V(f.value),{flush:i,deep:d,eventFilter:_});return w&&u&&J(w,"storage",j),j(),f;function V(a){try{a==null?r.removeItem(e):r.setItem(e,c.write(a))}catch(p){y(p)}}function X(a){if(!(a&&a.key!==e)){z();try{const p=a?a.newValue:r.getItem(e);return p==null?(s&&g!==null&&r.setItem(e,c.write(g)),g):typeof p!="string"?p:c.read(p)}catch(p){y(p)}finally{C()}}}function j(a){a&&a.key!==e||(f.value=X(a))}}function ve(e,t,r={}){const{window:n=O}=r;return ce(e,t,n==null?void 0:n.localStorage,r)}var L,R;m&&(window==null?void 0:window.navigator)&&((L=window==null?void 0:window.navigator)==null?void 0:L.platform)&&/iP(ad|hone|od)/.test((R=window==null?void 0:window.navigator)==null?void 0:R.platform);function we({window:e=O}={}){if(!e)return{x:l(0),y:l(0)};const t=l(e.pageXOffset),r=l(e.pageYOffset);return J("scroll",()=>{t.value=e.pageXOffset,r.value=e.pageYOffset},{capture:!1,passive:!0}),{x:t,y:r}}export{we as a,de as b,ve as c,J as u};
