index.dc19bc54.js 6.3 KB

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