1 |
- import{U as l,a3 as A,b8 as U,b9 as G,ba as W,bb as x}from"./index.7994470a.js";var F;const m=typeof window!="undefined",M=e=>typeof e=="string",b=()=>{};m&&((F=window==null?void 0:window.navigator)==null?void 0:F.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function V(e,t){function r(...n){e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})}return r}const D=e=>e();function X(e=D){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 Y(e,t=!1,r="Timeout"){return new Promise((n,o)=>{setTimeout(t?()=>o(r):n,e)})}function K(e){return U()?(G(e),!0):!1}var $=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,Q=(e,t)=>{var r={};for(var n in e)q.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$)for(var n of $(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=D}=n,i=Q(n,["eventFilter"]);return A(e,V(o,t),i)}var k=Object.defineProperty,ee=Object.defineProperties,te=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,j=(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={}))L.call(t,r)&&j(e,r,t[r]);if(h)for(var r of h(t))R.call(t,r)&&j(e,r,t[r]);return e},ne=(e,t)=>ee(e,te(t)),ae=(e,t)=>{var r={};for(var n in e)L.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&h)for(var n of h(e))t.indexOf(n)<0&&R.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}=X(o);return{stop:Z(e,t,ne(re({},i),{eventFilter:d})),pause:u,resume:s,isActive:v}}function ie(e){var t;const r=x(e);return(t=r==null?void 0:r.$el)!=null?t:r}const _=m?window:void 0;m&&window.document;m&&window.navigator;m&&window.location;function J(...e){let t,r,n,o;if(M(e[0])?([r,n,o]=e,t=_):[t,r,n,o]=e,!t)return b;let i=b;const d=A(()=>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 K(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?W(t):l(t),v=l(!1),y=l(!1),O=l(void 0);async function w(f=0,...g){d&&(s.value=t),O.value=void 0,v.value=!1,y.value=!0,f>0&&await Y(f);const S=typeof e=="function"?e(...g):e;try{const c=await S;s.value=c,v.value=!0}catch(c){O.value=c,i(c)}finally{y.value=!1}return s.value}return n&&w(o),{state:s,isReady:v,isLoading:y,error:O,execute:w}}const P=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},N="__vueuse_ssr_handlers__";P[N]=P[N]||{};const se=P[N];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:y=_,eventFilter:O,onError:w=a=>{console.error(a)}}=n,f=(v?W:l)(t);if(!r)try{r=le("getDefaultStorage",()=>{var a;return(a=_)==null?void 0:a.localStorage})()}catch(a){w(a)}if(!r)return f;const g=x(t),S=ue(g),c=(o=n.serializer)!=null?o:fe[S],{pause:z,resume:I}=oe(f,()=>C(f.value),{flush:i,deep:d,eventFilter:O});return y&&u&&J(y,"storage",E),E(),f;function C(a){try{a==null?r.removeItem(e):r.setItem(e,c.write(a))}catch(p){w(p)}}function H(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){w(p)}finally{I()}}}function E(a){a&&a.key!==e||(f.value=H(a))}}function ve(e,t,r={}){const{window:n=_}=r;return ce(e,t,n==null?void 0:n.localStorage,r)}var T;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(T||(T={}));function ye({window:e=_}={}){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{ye as a,de as b,ve as c,J as u};
|