index.f05535c0.js 5.6 KB

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